diff --git a/dist/index.js b/dist/index.js index 6cf12ac..e4da5e3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2002,6 +2002,9 @@ module.exports = options const fs = __nccwpck_require__(7147) const path = __nccwpck_require__(1017) const os = __nccwpck_require__(2037) +const packageJson = __nccwpck_require__(9968) + +const version = packageJson.version const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg @@ -2045,7 +2048,7 @@ function parse (src) { } function _log (message) { - console.log(`[dotenv][DEBUG] ${message}`) + console.log(`[dotenv@${version}][DEBUG] ${message}`) } function _resolveHome (envPath) { @@ -9997,6 +10000,14 @@ module.exports = require("util"); "use strict"; module.exports = require("zlib"); +/***/ }), + +/***/ 9968: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"name":"dotenv","version":"16.0.3","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"require":"./lib/main.js","types":"./lib/main.d.ts","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^17.0.9","decache":"^4.6.1","dtslint":"^3.7.0","sinon":"^12.0.1","standard":"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2","tap":"^15.1.6","tar":"^6.1.11","typescript":"^4.5.4"},"engines":{"node":">=12"}}'); + /***/ }) /******/ }); diff --git a/dist/index.js.map b/dist/index.js.map index c3885db..0831794 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5GA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;;;;;;;;;ACDA;AACA;AACA;;;;;;;;;ACFA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACriBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://tweet/./lib/main.js","../webpack://tweet/./lib/tweet.js","../webpack://tweet/./lib/upload-media.js","../webpack://tweet/./node_modules/@actions/core/lib/command.js","../webpack://tweet/./node_modules/@actions/core/lib/core.js","../webpack://tweet/./node_modules/@actions/core/lib/file-command.js","../webpack://tweet/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://tweet/./node_modules/@actions/core/lib/path-utils.js","../webpack://tweet/./node_modules/@actions/core/lib/summary.js","../webpack://tweet/./node_modules/@actions/core/lib/utils.js","../webpack://tweet/./node_modules/@actions/http-client/lib/auth.js","../webpack://tweet/./node_modules/@actions/http-client/lib/index.js","../webpack://tweet/./node_modules/@actions/http-client/lib/proxy.js","../webpack://tweet/./node_modules/dotenv/config.js","../webpack://tweet/./node_modules/dotenv/lib/cli-options.js","../webpack://tweet/./node_modules/dotenv/lib/env-options.js","../webpack://tweet/./node_modules/dotenv/lib/main.js","../webpack://tweet/./node_modules/tunnel/index.js","../webpack://tweet/./node_modules/tunnel/lib/tunnel.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/form-data.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/oauth1.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/oauth2.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/request-handler.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/request-maker.mixin.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/request-param.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client.base.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client.subclient.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client/readonly.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client/readwrite.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/globals.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/helpers.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/TwitterPaginator.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/dm.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/list.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/list.paginator.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/mutes.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/tweet.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/tweet.paginator.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/user.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/user.paginator.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/v2.paginator.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/plugins/helpers.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/settings.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/stream/TweetStream.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/stream/TweetStreamEventCombiner.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/stream/TweetStreamParser.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/auth.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/client.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/errors.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/plugins/client.plugins.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/plugins/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/responses.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/dev-utilities.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/dm.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/entities.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/geo.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/list.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/streaming.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/trends.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/tweet.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/user.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/list.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/spaces.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/streaming.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/tweet.definition.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/tweet.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/user.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/client.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/client.v1.read.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/client.v1.write.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/media-helpers.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2-labs/client.v2.labs.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2-labs/client.v2.labs.read.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2-labs/client.v2.labs.write.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/client.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/client.v2.read.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/client.v2.write.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/includes.v2.helper.js","../webpack://tweet/./node_modules/uuid/dist/index.js","../webpack://tweet/./node_modules/uuid/dist/md5.js","../webpack://tweet/./node_modules/uuid/dist/nil.js","../webpack://tweet/./node_modules/uuid/dist/parse.js","../webpack://tweet/./node_modules/uuid/dist/regex.js","../webpack://tweet/./node_modules/uuid/dist/rng.js","../webpack://tweet/./node_modules/uuid/dist/sha1.js","../webpack://tweet/./node_modules/uuid/dist/stringify.js","../webpack://tweet/./node_modules/uuid/dist/v1.js","../webpack://tweet/./node_modules/uuid/dist/v3.js","../webpack://tweet/./node_modules/uuid/dist/v35.js","../webpack://tweet/./node_modules/uuid/dist/v4.js","../webpack://tweet/./node_modules/uuid/dist/v5.js","../webpack://tweet/./node_modules/uuid/dist/validate.js","../webpack://tweet/./node_modules/uuid/dist/version.js","../webpack://tweet/external node-commonjs \"assert\"","../webpack://tweet/external node-commonjs \"crypto\"","../webpack://tweet/external node-commonjs \"events\"","../webpack://tweet/external node-commonjs \"fs\"","../webpack://tweet/external node-commonjs \"http\"","../webpack://tweet/external node-commonjs \"https\"","../webpack://tweet/external node-commonjs \"net\"","../webpack://tweet/external node-commonjs \"os\"","../webpack://tweet/external node-commonjs \"path\"","../webpack://tweet/external node-commonjs \"tls\"","../webpack://tweet/external node-commonjs \"util\"","../webpack://tweet/external node-commonjs \"zlib\"","../webpack://tweet/webpack/bootstrap","../webpack://tweet/webpack/runtime/compat","../webpack://tweet/webpack/before-startup","../webpack://tweet/webpack/startup","../webpack://tweet/webpack/after-startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nrequire(\"dotenv/config\");\nconst core = __importStar(require(\"@actions/core\"));\nconst path = __importStar(require(\"path\"));\nconst tweet_1 = require(\"./tweet\");\nconst upload_media_1 = require(\"./upload-media\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const mediaPaths = core.getInput('media_paths');\n const mediaIds = yield (0, upload_media_1.uploadMedia)(mediaPaths\n .split('\\n')\n .filter(x => x !== '')\n .map(mediaPath => path.join(process.cwd(), mediaPath)));\n core.debug(`Media IDs: ${mediaIds.join(', ')}`);\n const inReplyToStatusId = core.getInput('in_reply_to_status_id');\n const response = yield (0, tweet_1.tweet)(core.getInput('status'), mediaIds, inReplyToStatusId);\n core.setOutput('response', JSON.stringify(response));\n }\n catch (error) {\n if (error instanceof Error)\n core.setFailed(error.message);\n }\n });\n}\nrun();\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tweet = void 0;\nconst twitter_api_v2_1 = __importDefault(require(\"twitter-api-v2\"));\nfunction tweet(status, mediaIds = [], inReplyToStatusId = '') {\n return __awaiter(this, void 0, void 0, function* () {\n const appKey = process.env.CONSUMER_API_KEY;\n const appSecret = process.env.CONSUMER_API_SECRET_KEY;\n const accessToken = process.env.ACCESS_TOKEN;\n const accessSecret = process.env.ACCESS_TOKEN_SECRET;\n const client = new twitter_api_v2_1.default({\n appKey,\n appSecret,\n accessToken,\n accessSecret\n }).v1;\n const parameters = {};\n if (mediaIds.length > 0) {\n parameters['media_ids'] = mediaIds.join(',');\n }\n if (inReplyToStatusId !== '') {\n parameters['in_reply_to_status_id'] = inReplyToStatusId;\n }\n return yield client.tweet(status, parameters);\n });\n}\nexports.tweet = tweet;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uploadMedia = void 0;\nconst twitter_api_v2_1 = __importDefault(require(\"twitter-api-v2\"));\nconst fs = __importStar(require(\"fs\"));\nconst core = __importStar(require(\"@actions/core\"));\nfunction uploadMedia(mediaPaths) {\n return __awaiter(this, void 0, void 0, function* () {\n core.debug(JSON.stringify(mediaPaths));\n for (const path of mediaPaths) {\n if (!fs.existsSync(path)) {\n throw new Error(`${path} not exists`);\n }\n }\n const appKey = process.env.CONSUMER_API_KEY;\n const appSecret = process.env.CONSUMER_API_SECRET_KEY;\n const accessToken = process.env.ACCESS_TOKEN;\n const accessSecret = process.env.ACCESS_TOKEN_SECRET;\n const client = new twitter_api_v2_1.default({\n appKey,\n appSecret,\n accessToken,\n accessSecret\n }).v1;\n const mediaIdsPromise = mediaPaths.map((path) => __awaiter(this, void 0, void 0, function* () {\n return yield client.uploadMedia(path);\n }));\n return yield Promise.all(mediaIdsPromise);\n });\n}\nexports.uploadMedia = uploadMedia;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst uuid_1 = require(\"uuid\");\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.\n if (name.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedVal.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","(function () {\n require('./lib/main').config(\n Object.assign(\n {},\n require('./lib/env-options'),\n require('./lib/cli-options')(process.argv)\n )\n )\n})()\n","const re = /^dotenv_config_(encoding|path|debug|override)=(.+)$/\n\nmodule.exports = function optionMatcher (args) {\n return args.reduce(function (acc, cur) {\n const matches = cur.match(re)\n if (matches) {\n acc[matches[1]] = matches[2]\n }\n return acc\n }, {})\n}\n","// ../config.js accepts options via environment variables\nconst options = {}\n\nif (process.env.DOTENV_CONFIG_ENCODING != null) {\n options.encoding = process.env.DOTENV_CONFIG_ENCODING\n}\n\nif (process.env.DOTENV_CONFIG_PATH != null) {\n options.path = process.env.DOTENV_CONFIG_PATH\n}\n\nif (process.env.DOTENV_CONFIG_DEBUG != null) {\n options.debug = process.env.DOTENV_CONFIG_DEBUG\n}\n\nif (process.env.DOTENV_CONFIG_OVERRIDE != null) {\n options.override = process.env.DOTENV_CONFIG_OVERRIDE\n}\n\nmodule.exports = options\n","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parser src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _log (message) {\n console.log(`[dotenv][DEBUG] ${message}`)\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (options) {\n if (options.path != null) {\n dotenvPath = _resolveHome(options.path)\n }\n if (options.encoding != null) {\n encoding = options.encoding\n }\n }\n\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }))\n\n Object.keys(parsed).forEach(function (key) {\n if (!Object.prototype.hasOwnProperty.call(process.env, key)) {\n process.env[key] = parsed[key]\n } else {\n if (override === true) {\n process.env[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _log(`\"${key}\" is already defined in \\`process.env\\` and WAS overwritten`)\n } else {\n _log(`\"${key}\" is already defined in \\`process.env\\` and was NOT overwritten`)\n }\n }\n }\n })\n\n return { parsed }\n } catch (e) {\n if (debug) {\n _log(`Failed to load ${dotenvPath} ${e.message}`)\n }\n\n return { error: e }\n }\n}\n\nconst DotenvModule = {\n config,\n parse\n}\n\nmodule.exports.config = DotenvModule.config\nmodule.exports.parse = DotenvModule.parse\nmodule.exports = DotenvModule\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FormDataHelper = void 0;\nconst helpers_1 = require(\"../helpers\");\n// This class is partially inspired by https://github.com/form-data/form-data/blob/master/lib/form_data.js\n// All credits to their authors.\nclass FormDataHelper {\n constructor() {\n this._boundary = '';\n this._chunks = [];\n }\n bodyAppend(...values) {\n const allAsBuffer = values.map(val => val instanceof Buffer ? val : Buffer.from(val));\n this._chunks.push(...allAsBuffer);\n }\n append(field, value, contentType) {\n const convertedValue = value instanceof Buffer ? value : value.toString();\n const header = this.getMultipartHeader(field, convertedValue, contentType);\n this.bodyAppend(header, convertedValue, FormDataHelper.LINE_BREAK);\n }\n getHeaders() {\n return {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary(),\n };\n }\n /** Length of form-data (including footer length). */\n getLength() {\n return this._chunks.reduce((acc, cur) => acc + cur.length, this.getMultipartFooter().length);\n }\n getBuffer() {\n const allChunks = [...this._chunks, this.getMultipartFooter()];\n const totalBuffer = Buffer.alloc(this.getLength());\n let i = 0;\n for (const chunk of allChunks) {\n for (let j = 0; j < chunk.length; i++, j++) {\n totalBuffer[i] = chunk[j];\n }\n }\n return totalBuffer;\n }\n getBoundary() {\n if (!this._boundary) {\n this.generateBoundary();\n }\n return this._boundary;\n }\n generateBoundary() {\n // This generates a 50 character boundary similar to those used by Firefox.\n let boundary = '--------------------------';\n for (let i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n this._boundary = boundary;\n }\n getMultipartHeader(field, value, contentType) {\n // In this lib no need to guess more the content type, octet stream is ok of buffers\n if (!contentType) {\n contentType = value instanceof Buffer ? FormDataHelper.DEFAULT_CONTENT_TYPE : '';\n }\n const headers = {\n 'Content-Disposition': ['form-data', `name=\"${field}\"`],\n 'Content-Type': contentType,\n };\n let contents = '';\n for (const [prop, header] of Object.entries(headers)) {\n // skip nullish headers.\n if (!header.length) {\n continue;\n }\n contents += prop + ': ' + (0, helpers_1.arrayWrap)(header).join('; ') + FormDataHelper.LINE_BREAK;\n }\n return '--' + this.getBoundary() + FormDataHelper.LINE_BREAK + contents + FormDataHelper.LINE_BREAK;\n }\n getMultipartFooter() {\n if (this._footerChunk) {\n return this._footerChunk;\n }\n return this._footerChunk = Buffer.from('--' + this.getBoundary() + '--' + FormDataHelper.LINE_BREAK);\n }\n}\nexports.FormDataHelper = FormDataHelper;\nFormDataHelper.LINE_BREAK = '\\r\\n';\nFormDataHelper.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth1Helper = void 0;\nconst crypto = __importStar(require(\"crypto\"));\nclass OAuth1Helper {\n constructor(options) {\n this.nonceLength = 32;\n this.consumerKeys = options.consumerKeys;\n }\n static percentEncode(str) {\n return encodeURIComponent(str)\n .replace(/!/g, '%21')\n .replace(/\\*/g, '%2A')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29');\n }\n hash(base, key) {\n return crypto\n .createHmac('sha1', key)\n .update(base)\n .digest('base64');\n }\n authorize(request, accessTokens = {}) {\n const oauthInfo = {\n oauth_consumer_key: this.consumerKeys.key,\n oauth_nonce: this.getNonce(),\n oauth_signature_method: 'HMAC-SHA1',\n oauth_timestamp: this.getTimestamp(),\n oauth_version: '1.0',\n };\n if (accessTokens.key !== undefined) {\n oauthInfo.oauth_token = accessTokens.key;\n }\n if (!request.data) {\n request.data = {};\n }\n oauthInfo.oauth_signature = this.getSignature(request, accessTokens.secret, oauthInfo);\n return oauthInfo;\n }\n toHeader(oauthInfo) {\n const sorted = sortObject(oauthInfo);\n let header_value = 'OAuth ';\n for (const element of sorted) {\n if (element.key.indexOf('oauth_') !== 0) {\n continue;\n }\n header_value += OAuth1Helper.percentEncode(element.key) + '=\"' + OAuth1Helper.percentEncode(element.value) + '\",';\n }\n return {\n // Remove the last ,\n Authorization: header_value.slice(0, header_value.length - 1),\n };\n }\n getNonce() {\n const wordCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n let result = '';\n for (let i = 0; i < this.nonceLength; i++) {\n result += wordCharacters[Math.trunc(Math.random() * wordCharacters.length)];\n }\n return result;\n }\n getTimestamp() {\n return Math.trunc(new Date().getTime() / 1000);\n }\n getSignature(request, tokenSecret, oauthInfo) {\n return this.hash(this.getBaseString(request, oauthInfo), this.getSigningKey(tokenSecret));\n }\n getSigningKey(tokenSecret) {\n return OAuth1Helper.percentEncode(this.consumerKeys.secret) + '&' + OAuth1Helper.percentEncode(tokenSecret || '');\n }\n getBaseString(request, oauthInfo) {\n return request.method.toUpperCase() + '&'\n + OAuth1Helper.percentEncode(this.getBaseUrl(request.url)) + '&'\n + OAuth1Helper.percentEncode(this.getParameterString(request, oauthInfo));\n }\n getParameterString(request, oauthInfo) {\n const baseStringData = sortObject(percentEncodeData(mergeObject(oauthInfo, mergeObject(request.data, deParamUrl(request.url)))));\n let dataStr = '';\n for (const { key, value } of baseStringData) {\n // check if the value is an array\n // this means that this key has multiple values\n if (value && Array.isArray(value)) {\n // sort the array first\n value.sort();\n let valString = '';\n // serialize all values for this key: e.g. formkey=formvalue1&formkey=formvalue2\n value.forEach((item, i) => {\n valString += key + '=' + item;\n if (i < value.length) {\n valString += '&';\n }\n });\n dataStr += valString;\n }\n else {\n dataStr += key + '=' + value + '&';\n }\n }\n // Remove the last character\n return dataStr.slice(0, dataStr.length - 1);\n }\n getBaseUrl(url) {\n return url.split('?')[0];\n }\n}\nexports.OAuth1Helper = OAuth1Helper;\nexports.default = OAuth1Helper;\n// Helper functions //\nfunction mergeObject(obj1, obj2) {\n return {\n ...obj1 || {},\n ...obj2 || {},\n };\n}\nfunction sortObject(data) {\n return Object.keys(data)\n .sort()\n .map(key => ({ key, value: data[key] }));\n}\nfunction deParam(string) {\n const splitted = string.split('&');\n const data = {};\n for (const coupleKeyValue of splitted) {\n const [key, value = ''] = coupleKeyValue.split('=');\n // check if the key already exists\n // this can occur if the QS part of the url contains duplicate keys like this: ?formkey=formvalue1&formkey=formvalue2\n if (data[key]) {\n // the key exists already\n if (!Array.isArray(data[key])) {\n // replace the value with an array containing the already present value\n data[key] = [data[key]];\n }\n // and add the new found value to it\n data[key].push(decodeURIComponent(value));\n }\n else {\n // it doesn't exist, just put the found value in the data object\n data[key] = decodeURIComponent(value);\n }\n }\n return data;\n}\nfunction deParamUrl(url) {\n const tmp = url.split('?');\n if (tmp.length === 1)\n return {};\n return deParam(tmp[1]);\n}\nfunction percentEncodeData(data) {\n const result = {};\n for (const key in data) {\n let value = data[key];\n // check if the value is an array\n if (value && Array.isArray(value)) {\n value = value.map(v => OAuth1Helper.percentEncode(v));\n }\n else {\n value = OAuth1Helper.percentEncode(value);\n }\n result[OAuth1Helper.percentEncode(key)] = value;\n }\n return result;\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth2Helper = void 0;\nconst crypto = __importStar(require(\"crypto\"));\nclass OAuth2Helper {\n static getCodeVerifier() {\n return this.generateRandomString(128);\n }\n static getCodeChallengeFromVerifier(verifier) {\n return this.escapeBase64Url(crypto\n .createHash('sha256')\n .update(verifier)\n .digest('base64'));\n }\n static getAuthHeader(clientId, clientSecret) {\n const key = encodeURIComponent(clientId) + ':' + encodeURIComponent(clientSecret);\n return Buffer.from(key).toString('base64');\n }\n static generateRandomString(length) {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n for (let i = 0; i < length; i++) {\n text += possible[Math.floor(Math.random() * possible.length)];\n }\n return text;\n }\n static escapeBase64Url(string) {\n return string.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n}\nexports.OAuth2Helper = OAuth2Helper;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RequestHandlerHelper = void 0;\nconst https_1 = require(\"https\");\nconst settings_1 = require(\"../settings\");\nconst TweetStream_1 = __importDefault(require(\"../stream/TweetStream\"));\nconst types_1 = require(\"../types\");\nconst zlib = __importStar(require(\"zlib\"));\nclass RequestHandlerHelper {\n constructor(requestData) {\n this.requestData = requestData;\n this.requestErrorHandled = false;\n this.responseData = [];\n }\n /* Request helpers */\n get hrefPathname() {\n const url = this.requestData.url;\n return url.hostname + url.pathname;\n }\n isCompressionDisabled() {\n return !this.requestData.compression || this.requestData.compression === 'identity';\n }\n isFormEncodedEndpoint() {\n return this.requestData.url.href.startsWith('https://api.twitter.com/oauth/');\n }\n /* Error helpers */\n createRequestError(error) {\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log('Request error:', error);\n }\n return new types_1.ApiRequestError('Request failed.', {\n request: this.req,\n error,\n });\n }\n createPartialResponseError(error, abortClose) {\n const res = this.res;\n let message = `Request failed with partial response with HTTP code ${res.statusCode}`;\n if (abortClose) {\n message += ' (connection abruptly closed)';\n }\n else {\n message += ' (parse error)';\n }\n return new types_1.ApiPartialResponseError(message, {\n request: this.req,\n response: this.res,\n responseError: error,\n rawContent: Buffer.concat(this.responseData).toString(),\n });\n }\n formatV1Errors(errors) {\n return errors\n .map(({ code, message }) => `${message} (Twitter code ${code})`)\n .join(', ');\n }\n formatV2Error(error) {\n return `${error.title}: ${error.detail} (see ${error.type})`;\n }\n createResponseError({ res, data, rateLimit, code }) {\n var _a;\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log(`Request failed with code ${code}, data:`, data);\n settings_1.TwitterApiV2Settings.logger.log('Response headers:', res.headers);\n }\n // Errors formatting.\n let errorString = `Request failed with code ${code}`;\n if ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a.length) {\n const errors = data.errors;\n if ('code' in errors[0]) {\n errorString += ' - ' + this.formatV1Errors(errors);\n }\n else {\n errorString += ' - ' + this.formatV2Error(data);\n }\n }\n return new types_1.ApiResponseError(errorString, {\n code,\n data,\n headers: res.headers,\n request: this.req,\n response: res,\n rateLimit,\n });\n }\n /* Response helpers */\n getResponseDataStream(res) {\n if (this.isCompressionDisabled()) {\n return res;\n }\n const contentEncoding = (res.headers['content-encoding'] || 'identity').trim().toLowerCase();\n if (contentEncoding === 'br') {\n const brotli = zlib.createBrotliDecompress({\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH,\n });\n res.pipe(brotli);\n return brotli;\n }\n if (contentEncoding === 'gzip') {\n const gunzip = zlib.createGunzip({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH,\n });\n res.pipe(gunzip);\n return gunzip;\n }\n if (contentEncoding === 'deflate') {\n const inflate = zlib.createInflate({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH,\n });\n res.pipe(inflate);\n return inflate;\n }\n return res;\n }\n detectResponseType(res) {\n var _a, _b;\n // Auto parse if server responds with JSON body\n if (((_a = res.headers['content-type']) === null || _a === void 0 ? void 0 : _a.includes('application/json')) || ((_b = res.headers['content-type']) === null || _b === void 0 ? void 0 : _b.includes('application/problem+json'))) {\n return 'json';\n }\n // f-e oauth token endpoints\n else if (this.isFormEncodedEndpoint()) {\n return 'url';\n }\n return 'text';\n }\n getParsedResponse(res) {\n const data = this.responseData;\n const mode = this.requestData.forceParseMode || this.detectResponseType(res);\n if (mode === 'buffer') {\n return Buffer.concat(data);\n }\n else if (mode === 'text') {\n return Buffer.concat(data).toString();\n }\n else if (mode === 'json') {\n const asText = Buffer.concat(data).toString();\n return asText.length ? JSON.parse(asText) : undefined;\n }\n else if (mode === 'url') {\n const asText = Buffer.concat(data).toString();\n const formEntries = {};\n for (const [item, value] of new URLSearchParams(asText)) {\n formEntries[item] = value;\n }\n return formEntries;\n }\n else {\n // mode === 'none'\n return undefined;\n }\n }\n getRateLimitFromResponse(res) {\n let rateLimit = undefined;\n if (res.headers['x-rate-limit-limit']) {\n rateLimit = {\n limit: Number(res.headers['x-rate-limit-limit']),\n remaining: Number(res.headers['x-rate-limit-remaining']),\n reset: Number(res.headers['x-rate-limit-reset']),\n };\n if (this.requestData.rateLimitSaver) {\n this.requestData.rateLimitSaver(rateLimit);\n }\n }\n return rateLimit;\n }\n /* Request event handlers */\n onSocketEventHandler(reject, socket) {\n socket.on('close', this.onSocketCloseHandler.bind(this, reject));\n }\n onSocketCloseHandler(reject) {\n this.req.removeAllListeners('timeout');\n const res = this.res;\n if (res) {\n // Response ok, res.close/res.end can handle request ending\n return;\n }\n if (!this.requestErrorHandled) {\n return reject(this.createRequestError(new Error('Socket closed without any information.')));\n }\n // else: other situation\n }\n requestErrorHandler(reject, requestError) {\n var _a, _b;\n (_b = (_a = this.requestData).requestEventDebugHandler) === null || _b === void 0 ? void 0 : _b.call(_a, 'request-error', { requestError });\n this.requestErrorHandled = true;\n reject(this.createRequestError(requestError));\n }\n timeoutErrorHandler() {\n this.requestErrorHandled = true;\n this.req.destroy(new Error('Request timeout.'));\n }\n /* Response event handlers */\n classicResponseHandler(resolve, reject, res) {\n this.res = res;\n const dataStream = this.getResponseDataStream(res);\n // Register the response data\n dataStream.on('data', chunk => this.responseData.push(chunk));\n dataStream.on('end', this.onResponseEndHandler.bind(this, resolve, reject));\n dataStream.on('close', this.onResponseCloseHandler.bind(this, resolve, reject));\n // Debug handlers\n if (this.requestData.requestEventDebugHandler) {\n this.requestData.requestEventDebugHandler('response', { res });\n res.on('aborted', error => this.requestData.requestEventDebugHandler('response-aborted', { error }));\n res.on('error', error => this.requestData.requestEventDebugHandler('response-error', { error }));\n res.on('close', () => this.requestData.requestEventDebugHandler('response-close', { data: this.responseData }));\n res.on('end', () => this.requestData.requestEventDebugHandler('response-end'));\n }\n }\n onResponseEndHandler(resolve, reject) {\n const rateLimit = this.getRateLimitFromResponse(this.res);\n let data;\n try {\n data = this.getParsedResponse(this.res);\n }\n catch (e) {\n reject(this.createPartialResponseError(e, false));\n return;\n }\n // Handle bad error codes\n const code = this.res.statusCode;\n if (code >= 400) {\n reject(this.createResponseError({ data, res: this.res, rateLimit, code }));\n return;\n }\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${this.res.statusCode}`);\n settings_1.TwitterApiV2Settings.logger.log('Response body:', data);\n }\n resolve({\n data,\n headers: this.res.headers,\n rateLimit,\n });\n }\n onResponseCloseHandler(resolve, reject) {\n const res = this.res;\n if (res.aborted) {\n // Try to parse the request (?)\n try {\n this.getParsedResponse(this.res);\n // Ok, try to resolve normally the request\n return this.onResponseEndHandler(resolve, reject);\n }\n catch (e) {\n // Parse error, just drop with content\n return reject(this.createPartialResponseError(e, true));\n }\n }\n if (!res.complete) {\n return reject(this.createPartialResponseError(new Error('Response has been interrupted before response could be parsed.'), true));\n }\n // else: end has been called\n }\n streamResponseHandler(resolve, reject, res) {\n const code = res.statusCode;\n if (code < 400) {\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${res.statusCode} (starting stream)`);\n }\n const dataStream = this.getResponseDataStream(res);\n // HTTP code ok, consume stream\n resolve({ req: this.req, res: dataStream, originalResponse: res, requestData: this.requestData });\n }\n else {\n // Handle response normally, can only rejects\n this.classicResponseHandler(() => undefined, reject, res);\n }\n }\n /* Wrappers for request lifecycle */\n debugRequest() {\n const url = this.requestData.url;\n settings_1.TwitterApiV2Settings.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]`, this.requestData.options);\n if (url.search) {\n settings_1.TwitterApiV2Settings.logger.log('Request parameters:', [...url.searchParams.entries()].map(([key, value]) => `${key}: ${value}`));\n }\n if (this.requestData.body) {\n settings_1.TwitterApiV2Settings.logger.log('Request body:', this.requestData.body);\n }\n }\n buildRequest() {\n var _a;\n const url = this.requestData.url;\n const auth = url.username ? `${url.username}:${url.password}` : undefined;\n const headers = (_a = this.requestData.options.headers) !== null && _a !== void 0 ? _a : {};\n if (this.requestData.compression === true || this.requestData.compression === 'brotli') {\n headers['accept-encoding'] = 'br;q=1.0, gzip;q=0.8, deflate;q=0.5, *;q=0.1';\n }\n else if (this.requestData.compression === 'gzip') {\n headers['accept-encoding'] = 'gzip;q=1, deflate;q=0.5, *;q=0.1';\n }\n else if (this.requestData.compression === 'deflate') {\n headers['accept-encoding'] = 'deflate;q=1, *;q=0.1';\n }\n if (settings_1.TwitterApiV2Settings.debug) {\n this.debugRequest();\n }\n this.req = (0, https_1.request)({\n ...this.requestData.options,\n // Define URL params manually, addresses dependencies error https://github.com/PLhery/node-twitter-api-v2/issues/94\n host: url.hostname,\n port: url.port || undefined,\n path: url.pathname + url.search,\n protocol: url.protocol,\n auth,\n headers,\n });\n }\n registerRequestEventDebugHandlers(req) {\n req.on('close', () => this.requestData.requestEventDebugHandler('close'));\n req.on('abort', () => this.requestData.requestEventDebugHandler('abort'));\n req.on('socket', socket => {\n this.requestData.requestEventDebugHandler('socket', { socket });\n socket.on('error', error => this.requestData.requestEventDebugHandler('socket-error', { socket, error }));\n socket.on('connect', () => this.requestData.requestEventDebugHandler('socket-connect', { socket }));\n socket.on('close', withError => this.requestData.requestEventDebugHandler('socket-close', { socket, withError }));\n socket.on('end', () => this.requestData.requestEventDebugHandler('socket-end', { socket }));\n socket.on('lookup', (...data) => this.requestData.requestEventDebugHandler('socket-lookup', { socket, data }));\n socket.on('timeout', () => this.requestData.requestEventDebugHandler('socket-timeout', { socket }));\n });\n }\n makeRequest() {\n this.buildRequest();\n return new Promise((resolve, reject) => {\n const req = this.req;\n // Handle request errors\n req.on('error', this.requestErrorHandler.bind(this, reject));\n req.on('socket', this.onSocketEventHandler.bind(this, reject));\n req.on('response', this.classicResponseHandler.bind(this, resolve, reject));\n if (this.requestData.options.timeout) {\n req.on('timeout', this.timeoutErrorHandler.bind(this));\n }\n // Debug handlers\n if (this.requestData.requestEventDebugHandler) {\n this.registerRequestEventDebugHandlers(req);\n }\n if (this.requestData.body) {\n req.write(this.requestData.body);\n }\n req.end();\n });\n }\n async makeRequestAsStream() {\n const { req, res, requestData, originalResponse } = await this.makeRequestAndResolveWhenReady();\n return new TweetStream_1.default(requestData, { req, res, originalResponse });\n }\n makeRequestAndResolveWhenReady() {\n this.buildRequest();\n return new Promise((resolve, reject) => {\n const req = this.req;\n // Handle request errors\n req.on('error', this.requestErrorHandler.bind(this, reject));\n req.on('response', this.streamResponseHandler.bind(this, resolve, reject));\n if (this.requestData.body) {\n req.write(this.requestData.body);\n }\n req.end();\n });\n }\n}\nexports.RequestHandlerHelper = RequestHandlerHelper;\nexports.default = RequestHandlerHelper;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientRequestMaker = void 0;\nconst types_1 = require(\"../types\");\nconst TweetStream_1 = __importDefault(require(\"../stream/TweetStream\"));\nconst helpers_1 = require(\"../plugins/helpers\");\nconst helpers_2 = require(\"../helpers\");\nconst oauth1_helper_1 = __importDefault(require(\"./oauth1.helper\"));\nconst request_handler_helper_1 = __importDefault(require(\"./request-handler.helper\"));\nconst request_param_helper_1 = __importDefault(require(\"./request-param.helper\"));\nconst oauth2_helper_1 = require(\"./oauth2.helper\");\nclass ClientRequestMaker {\n constructor(settings) {\n this.rateLimits = {};\n this.clientSettings = {};\n if (settings) {\n this.clientSettings = settings;\n }\n }\n /** @deprecated - Switch to `@twitter-api-v2/plugin-rate-limit` */\n getRateLimits() {\n return this.rateLimits;\n }\n saveRateLimit(originalUrl, rateLimit) {\n this.rateLimits[originalUrl] = rateLimit;\n }\n /** Send a new request and returns a wrapped `Promise`. */\n async send(requestParams) {\n var _a, _b, _c, _d, _e;\n // Pre-request config hooks\n if ((_a = this.clientSettings.plugins) === null || _a === void 0 ? void 0 : _a.length) {\n const possibleResponse = await this.applyPreRequestConfigHooks(requestParams);\n if (possibleResponse) {\n return possibleResponse;\n }\n }\n const args = this.getHttpRequestArgs(requestParams);\n const options = {\n method: args.method,\n headers: args.headers,\n timeout: requestParams.timeout,\n agent: this.clientSettings.httpAgent,\n };\n const enableRateLimitSave = requestParams.enableRateLimitSave !== false;\n if (args.body) {\n request_param_helper_1.default.setBodyLengthHeader(options, args.body);\n }\n // Pre-request hooks\n if ((_b = this.clientSettings.plugins) === null || _b === void 0 ? void 0 : _b.length) {\n await this.applyPreRequestHooks(requestParams, args, options);\n }\n let request = new request_handler_helper_1.default({\n url: args.url,\n options,\n body: args.body,\n rateLimitSaver: enableRateLimitSave ? this.saveRateLimit.bind(this, args.rawUrl) : undefined,\n requestEventDebugHandler: requestParams.requestEventDebugHandler,\n compression: (_d = (_c = requestParams.compression) !== null && _c !== void 0 ? _c : this.clientSettings.compression) !== null && _d !== void 0 ? _d : true,\n forceParseMode: requestParams.forceParseMode,\n })\n .makeRequest();\n if ((0, helpers_1.hasRequestErrorPlugins)(this)) {\n request = this.applyResponseErrorHooks(requestParams, args, options, request);\n }\n const response = await request;\n // Post-request hooks\n if ((_e = this.clientSettings.plugins) === null || _e === void 0 ? void 0 : _e.length) {\n const responseOverride = await this.applyPostRequestHooks(requestParams, args, options, response);\n if (responseOverride) {\n return responseOverride.value;\n }\n }\n return response;\n }\n sendStream(requestParams) {\n var _a, _b;\n // Pre-request hooks\n if (this.clientSettings.plugins) {\n this.applyPreStreamRequestConfigHooks(requestParams);\n }\n const args = this.getHttpRequestArgs(requestParams);\n const options = {\n method: args.method,\n headers: args.headers,\n agent: this.clientSettings.httpAgent,\n };\n const enableRateLimitSave = requestParams.enableRateLimitSave !== false;\n const enableAutoConnect = requestParams.autoConnect !== false;\n if (args.body) {\n request_param_helper_1.default.setBodyLengthHeader(options, args.body);\n }\n const requestData = {\n url: args.url,\n options,\n body: args.body,\n rateLimitSaver: enableRateLimitSave ? this.saveRateLimit.bind(this, args.rawUrl) : undefined,\n payloadIsError: requestParams.payloadIsError,\n compression: (_b = (_a = requestParams.compression) !== null && _a !== void 0 ? _a : this.clientSettings.compression) !== null && _b !== void 0 ? _b : true,\n };\n const stream = new TweetStream_1.default(requestData);\n if (!enableAutoConnect) {\n return stream;\n }\n return stream.connect();\n }\n /* Token helpers */\n initializeToken(token) {\n if (typeof token === 'string') {\n this.bearerToken = token;\n }\n else if (typeof token === 'object' && 'appKey' in token) {\n this.consumerToken = token.appKey;\n this.consumerSecret = token.appSecret;\n if (token.accessToken && token.accessSecret) {\n this.accessToken = token.accessToken;\n this.accessSecret = token.accessSecret;\n }\n this._oauth = this.buildOAuth();\n }\n else if (typeof token === 'object' && 'username' in token) {\n const key = encodeURIComponent(token.username) + ':' + encodeURIComponent(token.password);\n this.basicToken = Buffer.from(key).toString('base64');\n }\n else if (typeof token === 'object' && 'clientId' in token) {\n this.clientId = token.clientId;\n this.clientSecret = token.clientSecret;\n }\n }\n getActiveTokens() {\n if (this.bearerToken) {\n return {\n type: 'oauth2',\n bearerToken: this.bearerToken,\n };\n }\n else if (this.basicToken) {\n return {\n type: 'basic',\n token: this.basicToken,\n };\n }\n else if (this.consumerSecret && this._oauth) {\n return {\n type: 'oauth-1.0a',\n appKey: this.consumerToken,\n appSecret: this.consumerSecret,\n accessToken: this.accessToken,\n accessSecret: this.accessSecret,\n };\n }\n else if (this.clientId) {\n return {\n type: 'oauth2-user',\n clientId: this.clientId,\n };\n }\n return { type: 'none' };\n }\n buildOAuth() {\n if (!this.consumerSecret || !this.consumerToken)\n throw new Error('Invalid consumer tokens');\n return new oauth1_helper_1.default({\n consumerKeys: { key: this.consumerToken, secret: this.consumerSecret },\n });\n }\n getOAuthAccessTokens() {\n if (!this.accessSecret || !this.accessToken)\n return;\n return {\n key: this.accessToken,\n secret: this.accessSecret,\n };\n }\n /* Plugin helpers */\n getPlugins() {\n var _a;\n return (_a = this.clientSettings.plugins) !== null && _a !== void 0 ? _a : [];\n }\n hasPlugins() {\n var _a;\n return !!((_a = this.clientSettings.plugins) === null || _a === void 0 ? void 0 : _a.length);\n }\n async applyPluginMethod(method, args) {\n var _a;\n let returnValue;\n for (const plugin of this.getPlugins()) {\n const value = await ((_a = plugin[method]) === null || _a === void 0 ? void 0 : _a.call(plugin, args));\n if (value && value instanceof types_1.TwitterApiPluginResponseOverride) {\n returnValue = value;\n }\n }\n return returnValue;\n }\n /* Request helpers */\n writeAuthHeaders({ headers, bodyInSignature, url, method, query, body }) {\n headers = { ...headers };\n if (this.bearerToken) {\n headers.Authorization = 'Bearer ' + this.bearerToken;\n }\n else if (this.basicToken) {\n // Basic auth, to request a bearer token\n headers.Authorization = 'Basic ' + this.basicToken;\n }\n else if (this.clientId && this.clientSecret) {\n // Basic auth with clientId + clientSecret\n headers.Authorization = 'Basic ' + oauth2_helper_1.OAuth2Helper.getAuthHeader(this.clientId, this.clientSecret);\n }\n else if (this.consumerSecret && this._oauth) {\n // Merge query and body\n const data = bodyInSignature ? request_param_helper_1.default.mergeQueryAndBodyForOAuth(query, body) : query;\n const auth = this._oauth.authorize({\n url: url.toString(),\n method,\n data,\n }, this.getOAuthAccessTokens());\n headers = { ...headers, ...this._oauth.toHeader(auth) };\n }\n return headers;\n }\n getUrlObjectFromUrlString(url) {\n // Add protocol to URL if needed\n if (!url.startsWith('http')) {\n url = 'https://' + url;\n }\n // Convert URL to object that will receive all URL modifications\n return new URL(url);\n }\n getHttpRequestArgs({ url: stringUrl, method, query: rawQuery = {}, body: rawBody = {}, headers, forceBodyMode, enableAuth, params, }) {\n let body = undefined;\n method = method.toUpperCase();\n headers = headers !== null && headers !== void 0 ? headers : {};\n // Add user agent header (Twitter recommends it)\n if (!headers['x-user-agent']) {\n headers['x-user-agent'] = 'Node.twitter-api-v2';\n }\n const url = this.getUrlObjectFromUrlString(stringUrl);\n // URL without query string to save as endpoint name\n const rawUrl = url.origin + url.pathname;\n // Apply URL parameters\n if (params) {\n request_param_helper_1.default.applyRequestParametersToUrl(url, params);\n }\n // Build a URL without anything in QS, and QSP in query\n const query = request_param_helper_1.default.formatQueryToString(rawQuery);\n request_param_helper_1.default.moveUrlQueryParamsIntoObject(url, query);\n // Delete undefined parameters\n if (!(rawBody instanceof Buffer)) {\n (0, helpers_2.trimUndefinedProperties)(rawBody);\n }\n // OAuth signature should not include parameters when using multipart.\n const bodyType = forceBodyMode !== null && forceBodyMode !== void 0 ? forceBodyMode : request_param_helper_1.default.autoDetectBodyType(url);\n // If undefined or true, enable auth by headers\n if (enableAuth !== false) {\n // OAuth needs body signature only if body is URL encoded.\n const bodyInSignature = ClientRequestMaker.BODY_METHODS.has(method) && bodyType === 'url';\n headers = this.writeAuthHeaders({ headers, bodyInSignature, method, query, url, body: rawBody });\n }\n if (ClientRequestMaker.BODY_METHODS.has(method)) {\n body = request_param_helper_1.default.constructBodyParams(rawBody, headers, bodyType) || undefined;\n }\n request_param_helper_1.default.addQueryParamsToUrl(url, query);\n return {\n rawUrl,\n url,\n method,\n headers,\n body,\n };\n }\n /* Plugin helpers */\n async applyPreRequestConfigHooks(requestParams) {\n var _a;\n const url = this.getUrlObjectFromUrlString(requestParams.url);\n for (const plugin of this.getPlugins()) {\n const result = await ((_a = plugin.onBeforeRequestConfig) === null || _a === void 0 ? void 0 : _a.call(plugin, {\n client: this,\n url,\n params: requestParams,\n }));\n if (result) {\n return result;\n }\n }\n }\n applyPreStreamRequestConfigHooks(requestParams) {\n var _a;\n const url = this.getUrlObjectFromUrlString(requestParams.url);\n for (const plugin of this.getPlugins()) {\n (_a = plugin.onBeforeStreamRequestConfig) === null || _a === void 0 ? void 0 : _a.call(plugin, {\n client: this,\n url,\n params: requestParams,\n });\n }\n }\n async applyPreRequestHooks(requestParams, computedParams, requestOptions) {\n await this.applyPluginMethod('onBeforeRequest', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n });\n }\n async applyPostRequestHooks(requestParams, computedParams, requestOptions, response) {\n return await this.applyPluginMethod('onAfterRequest', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n response,\n });\n }\n applyResponseErrorHooks(requestParams, computedParams, requestOptions, promise) {\n return promise.catch(helpers_1.applyResponseHooks.bind(this, requestParams, computedParams, requestOptions));\n }\n}\nexports.ClientRequestMaker = ClientRequestMaker;\nClientRequestMaker.BODY_METHODS = new Set(['POST', 'PUT', 'PATCH']);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RequestParamHelpers = void 0;\nconst form_data_helper_1 = require(\"./form-data.helper\");\nconst oauth1_helper_1 = __importDefault(require(\"./oauth1.helper\"));\n/* Helpers functions that are specific to this class but do not depends on instance */\nclass RequestParamHelpers {\n static formatQueryToString(query) {\n const formattedQuery = {};\n for (const prop in query) {\n if (typeof query[prop] === 'string') {\n formattedQuery[prop] = query[prop];\n }\n else if (typeof query[prop] !== 'undefined') {\n formattedQuery[prop] = String(query[prop]);\n }\n }\n return formattedQuery;\n }\n static autoDetectBodyType(url) {\n if (url.pathname.startsWith('/2/') || url.pathname.startsWith('/labs/2/')) {\n // oauth2 takes url encoded\n if (url.password.startsWith('/2/oauth2')) {\n return 'url';\n }\n // Twitter API v2 has JSON-encoded requests for everything else\n return 'json';\n }\n if (url.hostname === 'upload.twitter.com') {\n if (url.pathname === '/1.1/media/upload.json') {\n return 'form-data';\n }\n // json except for media/upload command, that is form-data.\n return 'json';\n }\n const endpoint = url.pathname.split('/1.1/', 2)[1];\n if (this.JSON_1_1_ENDPOINTS.has(endpoint)) {\n return 'json';\n }\n return 'url';\n }\n static addQueryParamsToUrl(url, query) {\n const queryEntries = Object.entries(query);\n if (queryEntries.length) {\n let search = '';\n for (const [key, value] of queryEntries) {\n search += (search.length ? '&' : '?') + `${oauth1_helper_1.default.percentEncode(key)}=${oauth1_helper_1.default.percentEncode(value)}`;\n }\n url.search = search;\n }\n }\n static constructBodyParams(body, headers, mode) {\n if (body instanceof Buffer) {\n return body;\n }\n if (mode === 'json') {\n headers['content-type'] = 'application/json;charset=UTF-8';\n return JSON.stringify(body);\n }\n else if (mode === 'url') {\n headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';\n if (Object.keys(body).length) {\n return new URLSearchParams(body)\n .toString()\n .replace(/\\*/g, '%2A'); // URLSearchParams doesnt encode '*', but Twitter wants it encoded.\n }\n return '';\n }\n else if (mode === 'raw') {\n throw new Error('You can only use raw body mode with Buffers. To give a string, use Buffer.from(str).');\n }\n else {\n const form = new form_data_helper_1.FormDataHelper();\n for (const parameter in body) {\n form.append(parameter, body[parameter]);\n }\n const formHeaders = form.getHeaders();\n headers['content-type'] = formHeaders['content-type'];\n return form.getBuffer();\n }\n }\n static setBodyLengthHeader(options, body) {\n var _a;\n options.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : {};\n if (typeof body === 'string') {\n options.headers['content-length'] = Buffer.byteLength(body);\n }\n else {\n options.headers['content-length'] = body.length;\n }\n }\n static isOAuthSerializable(item) {\n return !(item instanceof Buffer);\n }\n static mergeQueryAndBodyForOAuth(query, body) {\n const parameters = {};\n for (const prop in query) {\n parameters[prop] = query[prop];\n }\n if (this.isOAuthSerializable(body)) {\n for (const prop in body) {\n const bodyProp = body[prop];\n if (this.isOAuthSerializable(bodyProp)) {\n parameters[prop] = typeof bodyProp === 'object' && bodyProp !== null && 'toString' in bodyProp\n ? bodyProp.toString()\n : bodyProp;\n }\n }\n }\n return parameters;\n }\n static moveUrlQueryParamsIntoObject(url, query) {\n for (const [param, value] of url.searchParams) {\n query[param] = value;\n }\n // Remove the query string\n url.search = '';\n return url;\n }\n /**\n * Replace URL parameters available in pathname, like `:id`, with data given in `parameters`:\n * `https://twitter.com/:id.json` + `{ id: '20' }` => `https://twitter.com/20.json`\n */\n static applyRequestParametersToUrl(url, parameters) {\n url.pathname = url.pathname.replace(/:([A-Z_-]+)/ig, (fullMatch, paramName) => {\n if (parameters[paramName] !== undefined) {\n return String(parameters[paramName]);\n }\n return fullMatch;\n });\n return url;\n }\n}\nexports.RequestParamHelpers = RequestParamHelpers;\nRequestParamHelpers.JSON_1_1_ENDPOINTS = new Set([\n 'direct_messages/events/new.json',\n 'direct_messages/welcome_messages/new.json',\n 'direct_messages/welcome_messages/rules/new.json',\n 'media/metadata/create.json',\n 'collections/entries/curate.json',\n]);\nexports.default = RequestParamHelpers;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst request_maker_mixin_1 = require(\"./client-mixins/request-maker.mixin\");\nconst helpers_1 = require(\"./helpers\");\nconst globals_1 = require(\"./globals\");\n/**\n * Base class for Twitter instances\n */\nclass TwitterApiBase {\n constructor(token, settings = {}) {\n this._currentUser = null;\n this._currentUserV2 = null;\n if (token instanceof TwitterApiBase) {\n this._requestMaker = token._requestMaker;\n }\n else {\n this._requestMaker = new request_maker_mixin_1.ClientRequestMaker(settings);\n this._requestMaker.initializeToken(token);\n }\n }\n /* Prefix/Token handling */\n setPrefix(prefix) {\n this._prefix = prefix;\n }\n cloneWithPrefix(prefix) {\n const clone = this.constructor(this);\n clone.setPrefix(prefix);\n return clone;\n }\n getActiveTokens() {\n return this._requestMaker.getActiveTokens();\n }\n /* Rate limit cache / Plugins */\n getPlugins() {\n return this._requestMaker.getPlugins();\n }\n getPluginOfType(type) {\n return this.getPlugins().find(plugin => plugin instanceof type);\n }\n /**\n * @deprecated - Migrate to plugin `@twitter-api-v2/plugin-rate-limit`\n *\n * Tells if you hit the Twitter rate limit for {endpoint}.\n * (local data only, this should not ask anything to Twitter)\n */\n hasHitRateLimit(endpoint) {\n var _a;\n if (this.isRateLimitStatusObsolete(endpoint)) {\n return false;\n }\n return ((_a = this.getLastRateLimitStatus(endpoint)) === null || _a === void 0 ? void 0 : _a.remaining) === 0;\n }\n /**\n * @deprecated - Migrate to plugin `@twitter-api-v2/plugin-rate-limit`\n *\n * Tells if you hit the returned Twitter rate limit for {endpoint} has expired.\n * If client has no saved rate limit data for {endpoint}, this will gives you `true`.\n */\n isRateLimitStatusObsolete(endpoint) {\n const rateLimit = this.getLastRateLimitStatus(endpoint);\n if (rateLimit === undefined) {\n return true;\n }\n // Timestamps are exprimed in seconds, JS works with ms\n return (rateLimit.reset * 1000) < Date.now();\n }\n /**\n * @deprecated - Migrate to plugin `@twitter-api-v2/plugin-rate-limit`\n *\n * Get the last obtained Twitter rate limit information for {endpoint}.\n * (local data only, this should not ask anything to Twitter)\n */\n getLastRateLimitStatus(endpoint) {\n const endpointWithPrefix = endpoint.match(/^https?:\\/\\//) ? endpoint : (this._prefix + endpoint);\n return this._requestMaker.getRateLimits()[endpointWithPrefix];\n }\n /* Current user cache */\n /** Get cached current user. */\n getCurrentUserObject(forceFetch = false) {\n if (!forceFetch && this._currentUser) {\n if (this._currentUser.value) {\n return Promise.resolve(this._currentUser.value);\n }\n return this._currentUser.promise;\n }\n this._currentUser = (0, helpers_1.sharedPromise)(() => this.get('account/verify_credentials.json', { tweet_mode: 'extended' }, { prefix: globals_1.API_V1_1_PREFIX }));\n return this._currentUser.promise;\n }\n /**\n * Get cached current user from v2 API.\n * This can only be the slimest available `UserV2` object, with only `id`, `name` and `username` properties defined.\n *\n * To get a customized `UserV2Result`, use `.v2.me()`\n *\n * OAuth2 scopes: `tweet.read` & `users.read`\n */\n getCurrentUserV2Object(forceFetch = false) {\n if (!forceFetch && this._currentUserV2) {\n if (this._currentUserV2.value) {\n return Promise.resolve(this._currentUserV2.value);\n }\n return this._currentUserV2.promise;\n }\n this._currentUserV2 = (0, helpers_1.sharedPromise)(() => this.get('users/me', undefined, { prefix: globals_1.API_V2_PREFIX }));\n return this._currentUserV2.promise;\n }\n async get(url, query = {}, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'GET',\n query,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async delete(url, query = {}, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'DELETE',\n query,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async post(url, body, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'POST',\n body,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async put(url, body, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'PUT',\n body,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async patch(url, body, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'PATCH',\n body,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n getStream(url, query, { prefix = this._prefix, ...rest } = {}) {\n return this._requestMaker.sendStream({\n url: prefix ? prefix + url : url,\n method: 'GET',\n query,\n ...rest,\n });\n }\n postStream(url, body, { prefix = this._prefix, ...rest } = {}) {\n return this._requestMaker.sendStream({\n url: prefix ? prefix + url : url,\n method: 'POST',\n body,\n ...rest,\n });\n }\n}\nexports.default = TwitterApiBase;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_base_1 = __importDefault(require(\"./client.base\"));\n/**\n * Base subclient for every v1 and v2 client.\n */\nclass TwitterApiSubClient extends client_base_1.default {\n constructor(instance) {\n if (!(instance instanceof client_base_1.default)) {\n throw new Error('You must instance SubTwitterApi instance from existing TwitterApi instance.');\n }\n super(instance);\n }\n}\nexports.default = TwitterApiSubClient;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiReadOnly = exports.TwitterApiReadWrite = exports.TwitterApi = void 0;\nconst client_v1_1 = __importDefault(require(\"../v1/client.v1\"));\nconst client_v2_1 = __importDefault(require(\"../v2/client.v2\"));\nconst readwrite_1 = __importDefault(require(\"./readwrite\"));\n// \"Real\" exported client for usage of TwitterApi.\n/**\n * Twitter v1.1 and v2 API client.\n */\nclass TwitterApi extends readwrite_1.default {\n /* Direct access to subclients */\n get v1() {\n if (this._v1)\n return this._v1;\n return this._v1 = new client_v1_1.default(this);\n }\n get v2() {\n if (this._v2)\n return this._v2;\n return this._v2 = new client_v2_1.default(this);\n }\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n /* Static helpers */\n static getErrors(error) {\n var _a;\n if (typeof error !== 'object')\n return [];\n if (!('data' in error))\n return [];\n return (_a = error.data.errors) !== null && _a !== void 0 ? _a : [];\n }\n /** Extract another image size than obtained in a `profile_image_url` or `profile_image_url_https` field of a user object. */\n static getProfileImageInSize(profileImageUrl, size) {\n const lastPart = profileImageUrl.split('/').pop();\n const sizes = ['normal', 'bigger', 'mini'];\n let originalUrl = profileImageUrl;\n for (const availableSize of sizes) {\n if (lastPart.includes(`_${availableSize}`)) {\n originalUrl = profileImageUrl.replace(`_${availableSize}`, '');\n break;\n }\n }\n if (size === 'original') {\n return originalUrl;\n }\n const extPos = originalUrl.lastIndexOf('.');\n if (extPos !== -1) {\n const ext = originalUrl.slice(extPos + 1);\n return originalUrl.slice(0, extPos) + '_' + size + '.' + ext;\n }\n else {\n return originalUrl + '_' + size;\n }\n }\n}\nexports.TwitterApi = TwitterApi;\nvar readwrite_2 = require(\"./readwrite\");\nObject.defineProperty(exports, \"TwitterApiReadWrite\", { enumerable: true, get: function () { return __importDefault(readwrite_2).default; } });\nvar readonly_1 = require(\"./readonly\");\nObject.defineProperty(exports, \"TwitterApiReadOnly\", { enumerable: true, get: function () { return __importDefault(readonly_1).default; } });\nexports.default = TwitterApi;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _1 = __importDefault(require(\".\"));\nconst client_base_1 = __importDefault(require(\"../client.base\"));\nconst client_v1_read_1 = __importDefault(require(\"../v1/client.v1.read\"));\nconst client_v2_read_1 = __importDefault(require(\"../v2/client.v2.read\"));\nconst oauth2_helper_1 = require(\"../client-mixins/oauth2.helper\");\nconst request_param_helper_1 = __importDefault(require(\"../client-mixins/request-param.helper\"));\n/**\n * Twitter v1.1 and v2 API client.\n */\nclass TwitterApiReadOnly extends client_base_1.default {\n /* Direct access to subclients */\n get v1() {\n if (this._v1)\n return this._v1;\n return this._v1 = new client_v1_read_1.default(this);\n }\n get v2() {\n if (this._v2)\n return this._v2;\n return this._v2 = new client_v2_read_1.default(this);\n }\n /**\n * Fetch and cache current user.\n * This method can only be called with a OAuth 1.0a user authentication.\n *\n * You can use this method to test if authentication was successful.\n * Next calls to this methods will use the cached user, unless `forceFetch: true` is given.\n */\n async currentUser(forceFetch = false) {\n return await this.getCurrentUserObject(forceFetch);\n }\n /**\n * Fetch and cache current user.\n * This method can only be called with a OAuth 1.0a or OAuth2 user authentication.\n *\n * This can only be the slimest available `UserV2` object, with only id, name and username properties defined.\n * To get a customized `UserV2Result`, use `.v2.me()`\n *\n * You can use this method to test if authentication was successful.\n * Next calls to this methods will use the cached user, unless `forceFetch: true` is given.\n *\n * OAuth2 scopes: `tweet.read` & `users.read`\n */\n async currentUserV2(forceFetch = false) {\n return await this.getCurrentUserV2Object(forceFetch);\n }\n /* Shortcuts to endpoints */\n search(what, options) {\n return this.v2.search(what, options);\n }\n /* Authentication */\n /**\n * Generate the OAuth request token link for user-based OAuth 1.0 auth.\n *\n * ```ts\n * // Instanciate TwitterApi with consumer keys\n * const client = new TwitterApi({ appKey: 'consumer_key', appSecret: 'consumer_secret' });\n *\n * const tokenRequest = await client.generateAuthLink('oob-or-your-callback-url');\n * // redirect end-user to tokenRequest.url\n *\n * // Save tokenRequest.oauth_token_secret somewhere, it will be needed for next auth step.\n * ```\n */\n async generateAuthLink(oauth_callback = 'oob', { authAccessType, linkMode = 'authenticate', forceLogin, screenName, } = {}) {\n const oauthResult = await this.post('https://api.twitter.com/oauth/request_token', { oauth_callback, x_auth_access_type: authAccessType });\n let url = `https://api.twitter.com/oauth/${linkMode}?oauth_token=${encodeURIComponent(oauthResult.oauth_token)}`;\n if (forceLogin !== undefined) {\n url += `&force_login=${encodeURIComponent(forceLogin)}`;\n }\n if (screenName !== undefined) {\n url += `&screen_name=${encodeURIComponent(screenName)}`;\n }\n if (this._requestMaker.hasPlugins()) {\n this._requestMaker.applyPluginMethod('onOAuth1RequestToken', {\n client: this._requestMaker,\n url,\n oauthResult,\n });\n }\n return {\n url,\n ...oauthResult,\n };\n }\n /**\n * Obtain access to user-based OAuth 1.0 auth.\n *\n * After user is redirect from your callback, use obtained oauth_token and oauth_verifier to\n * instanciate the new TwitterApi instance.\n *\n * ```ts\n * // Use the saved oauth_token_secret associated to oauth_token returned by callback\n * const requestClient = new TwitterApi({\n * appKey: 'consumer_key',\n * appSecret: 'consumer_secret',\n * accessToken: 'oauth_token',\n * accessSecret: 'oauth_token_secret'\n * });\n *\n * // Use oauth_verifier obtained from callback request\n * const { client: userClient } = await requestClient.login('oauth_verifier');\n *\n * // {userClient} is a valid {TwitterApi} object you can use for future requests\n * ```\n */\n async login(oauth_verifier) {\n const tokens = this.getActiveTokens();\n if (tokens.type !== 'oauth-1.0a')\n throw new Error('You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login');\n const oauth_result = await this.post('https://api.twitter.com/oauth/access_token', { oauth_token: tokens.accessToken, oauth_verifier });\n const client = new _1.default({\n appKey: tokens.appKey,\n appSecret: tokens.appSecret,\n accessToken: oauth_result.oauth_token,\n accessSecret: oauth_result.oauth_token_secret,\n }, this._requestMaker.clientSettings);\n return {\n accessToken: oauth_result.oauth_token,\n accessSecret: oauth_result.oauth_token_secret,\n userId: oauth_result.user_id,\n screenName: oauth_result.screen_name,\n client,\n };\n }\n /**\n * Enable application-only authentication.\n *\n * To make the request, instanciate TwitterApi with consumer and secret.\n *\n * ```ts\n * const requestClient = new TwitterApi({ appKey: 'consumer', appSecret: 'secret' });\n * const appClient = await requestClient.appLogin();\n *\n * // Use {appClient} to make requests\n * ```\n */\n async appLogin() {\n const tokens = this.getActiveTokens();\n if (tokens.type !== 'oauth-1.0a')\n throw new Error('You must setup TwitterApi instance with consumer keys to accept app-only login');\n // Create a client with Basic authentication\n const basicClient = new _1.default({ username: tokens.appKey, password: tokens.appSecret });\n const res = await basicClient.post('https://api.twitter.com/oauth2/token', { grant_type: 'client_credentials' });\n // New object with Bearer token\n return new _1.default(res.access_token, this._requestMaker.clientSettings);\n }\n /* OAuth 2 user authentication */\n /**\n * Generate the OAuth request token link for user-based OAuth 2.0 auth.\n *\n * - **You can only use v2 API endpoints with this authentication method.**\n * - **You need to specify which scope you want to have when you create your auth link. Make sure it matches your needs.**\n *\n * See https://developer.twitter.com/en/docs/authentication/oauth-2-0/user-access-token for details.\n *\n * ```ts\n * // Instanciate TwitterApi with client ID\n * const client = new TwitterApi({ clientId: 'yourClientId' });\n *\n * // Generate a link to callback URL that will gives a token with tweet+user read access\n * const link = client.generateOAuth2AuthLink('your-callback-url', { scope: ['tweet.read', 'users.read'] });\n *\n * // Extract props from generate link\n * const { url, state, codeVerifier } = link;\n *\n * // redirect end-user to url\n * // Save `state` and `codeVerifier` somewhere, it will be needed for next auth step.\n * ```\n */\n generateOAuth2AuthLink(redirectUri, options = {}) {\n var _a, _b;\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n const state = (_a = options.state) !== null && _a !== void 0 ? _a : oauth2_helper_1.OAuth2Helper.generateRandomString(32);\n const codeVerifier = oauth2_helper_1.OAuth2Helper.getCodeVerifier();\n const codeChallenge = oauth2_helper_1.OAuth2Helper.getCodeChallengeFromVerifier(codeVerifier);\n const rawScope = (_b = options.scope) !== null && _b !== void 0 ? _b : '';\n const scope = Array.isArray(rawScope) ? rawScope.join(' ') : rawScope;\n const url = new URL('https://twitter.com/i/oauth2/authorize');\n const query = {\n response_type: 'code',\n client_id: this._requestMaker.clientId,\n redirect_uri: redirectUri,\n state,\n code_challenge: codeChallenge,\n code_challenge_method: 's256',\n scope,\n };\n request_param_helper_1.default.addQueryParamsToUrl(url, query);\n const result = {\n url: url.toString(),\n state,\n codeVerifier,\n codeChallenge,\n };\n if (this._requestMaker.hasPlugins()) {\n this._requestMaker.applyPluginMethod('onOAuth2RequestToken', {\n client: this._requestMaker,\n result,\n redirectUri,\n });\n }\n return result;\n }\n /**\n * Obtain access to user-based OAuth 2.0 auth.\n *\n * After user is redirect from your callback, use obtained code to\n * instanciate the new TwitterApi instance.\n *\n * You need to obtain `codeVerifier` from a call to `.generateOAuth2AuthLink`.\n *\n * ```ts\n * // Use the saved codeVerifier associated to state (present in query string of callback)\n * const requestClient = new TwitterApi({ clientId: 'yourClientId' });\n *\n * const { client: userClient, refreshToken } = await requestClient.loginWithOAuth2({\n * code: 'codeFromQueryString',\n * // the same URL given to generateOAuth2AuthLink\n * redirectUri,\n * // the verifier returned by generateOAuth2AuthLink\n * codeVerifier,\n * });\n *\n * // {userClient} is a valid {TwitterApi} object you can use for future requests\n * // {refreshToken} is defined if 'offline.access' is in scope.\n * ```\n */\n async loginWithOAuth2({ code, codeVerifier, redirectUri }) {\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n const accessTokenResult = await this.post('https://api.twitter.com/2/oauth2/token', {\n code,\n code_verifier: codeVerifier,\n redirect_uri: redirectUri,\n grant_type: 'authorization_code',\n client_id: this._requestMaker.clientId,\n client_secret: this._requestMaker.clientSecret,\n });\n return this.parseOAuth2AccessTokenResult(accessTokenResult);\n }\n /**\n * Obtain a new access token to user-based OAuth 2.0 auth from a refresh token.\n *\n * ```ts\n * const requestClient = new TwitterApi({ clientId: 'yourClientId' });\n *\n * const { client: userClient } = await requestClient.refreshOAuth2Token('refreshToken');\n * // {userClient} is a valid {TwitterApi} object you can use for future requests\n * ```\n */\n async refreshOAuth2Token(refreshToken) {\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n const accessTokenResult = await this.post('https://api.twitter.com/2/oauth2/token', {\n refresh_token: refreshToken,\n grant_type: 'refresh_token',\n client_id: this._requestMaker.clientId,\n client_secret: this._requestMaker.clientSecret,\n });\n return this.parseOAuth2AccessTokenResult(accessTokenResult);\n }\n /**\n * Revoke a single user-based OAuth 2.0 token.\n *\n * You must specify its source, access token (directly after login)\n * or refresh token (if you've called `.refreshOAuth2Token` before).\n */\n async revokeOAuth2Token(token, tokenType = 'access_token') {\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n return await this.post('https://api.twitter.com/2/oauth2/revoke', {\n client_id: this._requestMaker.clientId,\n client_secret: this._requestMaker.clientSecret,\n token,\n token_type_hint: tokenType,\n });\n }\n parseOAuth2AccessTokenResult(result) {\n const client = new _1.default(result.access_token, this._requestMaker.clientSettings);\n const scope = result.scope.split(' ').filter(e => e);\n return {\n client,\n expiresIn: result.expires_in,\n accessToken: result.access_token,\n scope,\n refreshToken: result.refresh_token,\n };\n }\n}\nexports.default = TwitterApiReadOnly;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_v1_write_1 = __importDefault(require(\"../v1/client.v1.write\"));\nconst client_v2_write_1 = __importDefault(require(\"../v2/client.v2.write\"));\nconst readonly_1 = __importDefault(require(\"./readonly\"));\n/**\n * Twitter v1.1 and v2 API client.\n */\nclass TwitterApiReadWrite extends readonly_1.default {\n /* Direct access to subclients */\n get v1() {\n if (this._v1)\n return this._v1;\n return this._v1 = new client_v1_write_1.default(this);\n }\n get v2() {\n if (this._v2)\n return this._v2;\n return this._v2 = new client_v2_write_1.default(this);\n }\n /**\n * Get a client with read only rights.\n */\n get readOnly() {\n return this;\n }\n}\nexports.default = TwitterApiReadWrite;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.API_V1_1_STREAM_PREFIX = exports.API_V1_1_UPLOAD_PREFIX = exports.API_V1_1_PREFIX = exports.API_V2_LABS_PREFIX = exports.API_V2_PREFIX = void 0;\nexports.API_V2_PREFIX = 'https://api.twitter.com/2/';\nexports.API_V2_LABS_PREFIX = 'https://api.twitter.com/labs/2/';\nexports.API_V1_1_PREFIX = 'https://api.twitter.com/1.1/';\nexports.API_V1_1_UPLOAD_PREFIX = 'https://upload.twitter.com/1.1/';\nexports.API_V1_1_STREAM_PREFIX = 'https://stream.twitter.com/1.1/';\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeDeprecationWarning = exports.hasMultipleItems = exports.isTweetStreamV2ErrorPayload = exports.trimUndefinedProperties = exports.arrayWrap = exports.sharedPromise = void 0;\nconst settings_1 = require(\"./settings\");\nfunction sharedPromise(getter) {\n const sharedPromise = {\n value: undefined,\n promise: getter().then(val => {\n sharedPromise.value = val;\n return val;\n }),\n };\n return sharedPromise;\n}\nexports.sharedPromise = sharedPromise;\nfunction arrayWrap(value) {\n if (Array.isArray(value)) {\n return value;\n }\n return [value];\n}\nexports.arrayWrap = arrayWrap;\nfunction trimUndefinedProperties(object) {\n // Delete undefined parameters\n for (const parameter in object) {\n if (object[parameter] === undefined)\n delete object[parameter];\n }\n}\nexports.trimUndefinedProperties = trimUndefinedProperties;\nfunction isTweetStreamV2ErrorPayload(payload) {\n // Is error only if 'errors' is present and 'data' does not exists\n return typeof payload === 'object'\n && 'errors' in payload\n && !('data' in payload);\n}\nexports.isTweetStreamV2ErrorPayload = isTweetStreamV2ErrorPayload;\nfunction hasMultipleItems(item) {\n if (Array.isArray(item) && item.length > 1) {\n return true;\n }\n return item.toString().includes(',');\n}\nexports.hasMultipleItems = hasMultipleItems;\nconst deprecationWarningsCache = new Set();\nfunction safeDeprecationWarning(message) {\n if (typeof console === 'undefined' || !console.warn || !settings_1.TwitterApiV2Settings.deprecationWarnings) {\n return;\n }\n const hash = `${message.instance}-${message.method}-${message.problem}`;\n if (deprecationWarningsCache.has(hash)) {\n return;\n }\n const formattedMsg = `[twitter-api-v2] Deprecation warning: In ${message.instance}.${message.method}() call` +\n `, ${message.problem}.\\n${message.resolution}.`;\n console.warn(formattedMsg);\n console.warn('To disable this message, import variable TwitterApiV2Settings from twitter-api-v2 and set TwitterApiV2Settings.deprecationWarnings to false.');\n deprecationWarningsCache.add(hash);\n}\nexports.safeDeprecationWarning = safeDeprecationWarning;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = void 0;\nvar client_1 = require(\"./client\");\nObject.defineProperty(exports, \"default\", { enumerable: true, get: function () { return __importDefault(client_1).default; } });\n__exportStar(require(\"./client\"), exports);\n__exportStar(require(\"./v1/client.v1\"), exports);\n__exportStar(require(\"./v2/client.v2\"), exports);\n__exportStar(require(\"./v2/includes.v2.helper\"), exports);\n__exportStar(require(\"./v2-labs/client.v2.labs\"), exports);\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./paginators\"), exports);\n__exportStar(require(\"./stream/TweetStream\"), exports);\n__exportStar(require(\"./settings\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PreviousableTwitterPaginator = exports.TwitterPaginator = void 0;\n/** TwitterPaginator: able to get consume data from initial request, then fetch next data sequentially. */\nclass TwitterPaginator {\n // noinspection TypeScriptAbstractClassConstructorCanBeMadeProtected\n constructor({ realData, rateLimit, instance, queryParams, sharedParams }) {\n this._maxResultsWhenFetchLast = 100;\n this._realData = realData;\n this._rateLimit = rateLimit;\n this._instance = instance;\n this._queryParams = queryParams;\n this._sharedParams = sharedParams;\n }\n get _isRateLimitOk() {\n const resetDate = this._rateLimit.reset * 1000;\n if (resetDate < Date.now()) {\n return true;\n }\n return this._rateLimit.remaining > 0;\n }\n makeRequest(queryParams) {\n return this._instance.get(this.getEndpoint(), queryParams, { fullResponse: true, params: this._sharedParams });\n }\n makeNewInstanceFromResult(result, queryParams) {\n // Construct a subclass\n return new this.constructor({\n realData: result.data,\n rateLimit: result.rateLimit,\n instance: this._instance,\n queryParams,\n sharedParams: this._sharedParams,\n });\n }\n getEndpoint() {\n return this._endpoint;\n }\n injectQueryParams(maxResults) {\n return {\n ...(maxResults ? { max_results: maxResults } : {}),\n ...this._queryParams,\n };\n }\n /* ---------------------- */\n /* Real paginator methods */\n /* ---------------------- */\n /**\n * Next page.\n */\n async next(maxResults) {\n const queryParams = this.getNextQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n return this.makeNewInstanceFromResult(result, queryParams);\n }\n /**\n * Next page, but store it in current instance.\n */\n async fetchNext(maxResults) {\n const queryParams = this.getNextQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n // Await in case of async sub-methods\n await this.refreshInstanceFromResult(result, true);\n return this;\n }\n /**\n * Fetch up to {count} items after current page,\n * as long as rate limit is not hit and Twitter has some results\n */\n async fetchLast(count = Infinity) {\n let queryParams = this.getNextQueryParams(this._maxResultsWhenFetchLast);\n let resultCount = 0;\n // Break at rate limit limit\n while (resultCount < count && this._isRateLimitOk) {\n const response = await this.makeRequest(queryParams);\n await this.refreshInstanceFromResult(response, true);\n resultCount += this.getPageLengthFromRequest(response);\n if (this.isFetchLastOver(response)) {\n break;\n }\n queryParams = this.getNextQueryParams(this._maxResultsWhenFetchLast);\n }\n return this;\n }\n get rateLimit() {\n return { ...this._rateLimit };\n }\n /** Get raw data returned by Twitter API. */\n get data() {\n return this._realData;\n }\n get done() {\n return !this.canFetchNextPage(this._realData);\n }\n /**\n * Iterate over currently fetched items.\n */\n *[Symbol.iterator]() {\n yield* this.getItemArray();\n }\n /**\n * Iterate over items \"undefinitely\" (until rate limit is hit / they're no more items available)\n * This will **mutate the current instance** and fill data, metas, etc. inside this instance.\n *\n * If you need to handle concurrent requests, or you need to rely on immutability, please use `.fetchAndIterate()` instead.\n */\n async *[Symbol.asyncIterator]() {\n yield* this.getItemArray();\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let paginator = this;\n let canFetchNextPage = this.canFetchNextPage(this._realData);\n while (canFetchNextPage && this._isRateLimitOk && paginator.getItemArray().length > 0) {\n const next = await paginator.next(this._maxResultsWhenFetchLast);\n // Store data into current instance [needed to access includes and meta]\n this.refreshInstanceFromResult({ data: next._realData, headers: {}, rateLimit: next._rateLimit }, true);\n canFetchNextPage = this.canFetchNextPage(next._realData);\n const items = next.getItemArray();\n yield* items;\n paginator = next;\n }\n }\n /**\n * Iterate over items \"undefinitely\" without modifying the current instance (until rate limit is hit / they're no more items available)\n *\n * This will **NOT** mutate the current instance, meaning that current instance will not inherit from `includes` and `meta` (v2 API only).\n * Use `Symbol.asyncIterator` (`for-await of`) to directly access items with current instance mutation.\n */\n async *fetchAndIterate() {\n for (const item of this.getItemArray()) {\n yield [item, this];\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let paginator = this;\n let canFetchNextPage = this.canFetchNextPage(this._realData);\n while (canFetchNextPage && this._isRateLimitOk && paginator.getItemArray().length > 0) {\n const next = await paginator.next(this._maxResultsWhenFetchLast);\n // Store data into current instance [needed to access includes and meta]\n this.refreshInstanceFromResult({ data: next._realData, headers: {}, rateLimit: next._rateLimit }, true);\n canFetchNextPage = this.canFetchNextPage(next._realData);\n for (const item of next.getItemArray()) {\n yield [item, next];\n }\n this._rateLimit = next._rateLimit;\n paginator = next;\n }\n }\n}\nexports.TwitterPaginator = TwitterPaginator;\n/** PreviousableTwitterPaginator: a TwitterPaginator able to get consume data from both side, next and previous. */\nclass PreviousableTwitterPaginator extends TwitterPaginator {\n /**\n * Previous page (new tweets)\n */\n async previous(maxResults) {\n const queryParams = this.getPreviousQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n return this.makeNewInstanceFromResult(result, queryParams);\n }\n /**\n * Previous page, but in current instance.\n */\n async fetchPrevious(maxResults) {\n const queryParams = this.getPreviousQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n await this.refreshInstanceFromResult(result, false);\n return this;\n }\n}\nexports.PreviousableTwitterPaginator = PreviousableTwitterPaginator;\nexports.default = TwitterPaginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WelcomeDmV1Paginator = exports.DmEventsV1Paginator = void 0;\nconst paginator_v1_1 = require(\"./paginator.v1\");\nclass DmEventsV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'direct_messages/events/list.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.events.push(...result.events);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.events.length;\n }\n getItemArray() {\n return this.events;\n }\n /**\n * Events returned by paginator.\n */\n get events() {\n return this._realData.events;\n }\n}\nexports.DmEventsV1Paginator = DmEventsV1Paginator;\nclass WelcomeDmV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'direct_messages/welcome_messages/list.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.welcome_messages.push(...result.welcome_messages);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.welcome_messages.length;\n }\n getItemArray() {\n return this.welcomeMessages;\n }\n get welcomeMessages() {\n return this._realData.welcome_messages;\n }\n}\nexports.WelcomeDmV1Paginator = WelcomeDmV1Paginator;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./tweet.paginator.v2\"), exports);\n__exportStar(require(\"./TwitterPaginator\"), exports);\n__exportStar(require(\"./dm.paginator.v1\"), exports);\n__exportStar(require(\"./mutes.paginator.v1\"), exports);\n__exportStar(require(\"./tweet.paginator.v1\"), exports);\n__exportStar(require(\"./user.paginator.v1\"), exports);\n__exportStar(require(\"./user.paginator.v2\"), exports);\n__exportStar(require(\"./list.paginator.v1\"), exports);\n__exportStar(require(\"./list.paginator.v2\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ListSubscribersV1Paginator = exports.ListMembersV1Paginator = exports.ListSubscriptionsV1Paginator = exports.ListOwnershipsV1Paginator = exports.ListMembershipsV1Paginator = void 0;\nconst paginator_v1_1 = require(\"./paginator.v1\");\nclass ListListsV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.lists.push(...result.lists);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.lists.length;\n }\n getItemArray() {\n return this.lists;\n }\n /**\n * Lists returned by paginator.\n */\n get lists() {\n return this._realData.lists;\n }\n}\nclass ListMembershipsV1Paginator extends ListListsV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/memberships.json';\n }\n}\nexports.ListMembershipsV1Paginator = ListMembershipsV1Paginator;\nclass ListOwnershipsV1Paginator extends ListListsV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/ownerships.json';\n }\n}\nexports.ListOwnershipsV1Paginator = ListOwnershipsV1Paginator;\nclass ListSubscriptionsV1Paginator extends ListListsV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/subscriptions.json';\n }\n}\nexports.ListSubscriptionsV1Paginator = ListSubscriptionsV1Paginator;\nclass ListUsersV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.users.push(...result.users);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.users.length;\n }\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n return this._realData.users;\n }\n}\nclass ListMembersV1Paginator extends ListUsersV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/members.json';\n }\n}\nexports.ListMembersV1Paginator = ListMembersV1Paginator;\nclass ListSubscribersV1Paginator extends ListUsersV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/subscribers.json';\n }\n}\nexports.ListSubscribersV1Paginator = ListSubscribersV1Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserListFollowedV2Paginator = exports.UserListMembershipsV2Paginator = exports.UserOwnedListsV2Paginator = void 0;\nconst v2_paginator_1 = require(\"./v2.paginator\");\nclass ListTimelineV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n getItemArray() {\n return this.lists;\n }\n /**\n * Lists returned by paginator.\n */\n get lists() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\nclass UserOwnedListsV2Paginator extends ListTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/owned_lists';\n }\n}\nexports.UserOwnedListsV2Paginator = UserOwnedListsV2Paginator;\nclass UserListMembershipsV2Paginator extends ListTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/list_memberships';\n }\n}\nexports.UserListMembershipsV2Paginator = UserListMembershipsV2Paginator;\nclass UserListFollowedV2Paginator extends ListTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/followed_lists';\n }\n}\nexports.UserListFollowedV2Paginator = UserListFollowedV2Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MuteUserIdsV1Paginator = exports.MuteUserListV1Paginator = void 0;\nconst paginator_v1_1 = require(\"./paginator.v1\");\nclass MuteUserListV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'mutes/users/list.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.users.push(...result.users);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.users.length;\n }\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n return this._realData.users;\n }\n}\nexports.MuteUserListV1Paginator = MuteUserListV1Paginator;\nclass MuteUserIdsV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'mutes/users/ids.json';\n this._maxResultsWhenFetchLast = 5000;\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.ids.push(...result.ids);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.ids.length;\n }\n getItemArray() {\n return this.ids;\n }\n /**\n * Users IDs returned by paginator.\n */\n get ids() {\n return this._realData.ids;\n }\n}\nexports.MuteUserIdsV1Paginator = MuteUserIdsV1Paginator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CursoredV1Paginator = void 0;\nconst TwitterPaginator_1 = __importDefault(require(\"./TwitterPaginator\"));\nclass CursoredV1Paginator extends TwitterPaginator_1.default {\n getNextQueryParams(maxResults) {\n var _a;\n return {\n ...this._queryParams,\n cursor: (_a = this._realData.next_cursor_str) !== null && _a !== void 0 ? _a : this._realData.next_cursor,\n ...(maxResults ? { count: maxResults } : {}),\n };\n }\n isFetchLastOver(result) {\n // If we cant fetch next page\n return !this.canFetchNextPage(result.data);\n }\n canFetchNextPage(result) {\n // If one of cursor is valid\n return !this.isNextCursorInvalid(result.next_cursor) || !this.isNextCursorInvalid(result.next_cursor_str);\n }\n isNextCursorInvalid(value) {\n return value === undefined\n || value === 0\n || value === -1\n || value === '0'\n || value === '-1';\n }\n}\nexports.CursoredV1Paginator = CursoredV1Paginator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserFavoritesV1Paginator = exports.ListTimelineV1Paginator = exports.UserTimelineV1Paginator = exports.MentionTimelineV1Paginator = exports.HomeTimelineV1Paginator = void 0;\nconst TwitterPaginator_1 = __importDefault(require(\"./TwitterPaginator\"));\n/** A generic TwitterPaginator able to consume TweetV1 timelines. */\nclass TweetTimelineV1Paginator extends TwitterPaginator_1.default {\n constructor() {\n super(...arguments);\n this.hasFinishedFetch = false;\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.push(...result);\n // HINT: This is an approximation, as \"end\" of pagination cannot be safely determined without cursors.\n this.hasFinishedFetch = result.length === 0;\n }\n }\n getNextQueryParams(maxResults) {\n const lastestId = BigInt(this._realData[this._realData.length - 1].id_str);\n return {\n ...this.injectQueryParams(maxResults),\n max_id: (lastestId - BigInt(1)).toString(),\n };\n }\n getPageLengthFromRequest(result) {\n return result.data.length;\n }\n isFetchLastOver(result) {\n return !result.data.length;\n }\n canFetchNextPage(result) {\n return result.length > 0;\n }\n getItemArray() {\n return this.tweets;\n }\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n return this._realData;\n }\n get done() {\n return super.done || this.hasFinishedFetch;\n }\n}\n// Timelines\n// Home\nclass HomeTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'statuses/home_timeline.json';\n }\n}\nexports.HomeTimelineV1Paginator = HomeTimelineV1Paginator;\n// Mention\nclass MentionTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'statuses/mentions_timeline.json';\n }\n}\nexports.MentionTimelineV1Paginator = MentionTimelineV1Paginator;\n// User\nclass UserTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'statuses/user_timeline.json';\n }\n}\nexports.UserTimelineV1Paginator = UserTimelineV1Paginator;\n// Lists\nclass ListTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/statuses.json';\n }\n}\nexports.ListTimelineV1Paginator = ListTimelineV1Paginator;\n// Favorites\nclass UserFavoritesV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'favorites/list.json';\n }\n}\nexports.UserFavoritesV1Paginator = UserFavoritesV1Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetV2ListTweetsPaginator = exports.TweetV2UserLikedTweetsPaginator = exports.TweetBookmarksTimelineV2Paginator = exports.TweetUserMentionTimelineV2Paginator = exports.TweetUserTimelineV2Paginator = exports.TweetHomeTimelineV2Paginator = exports.QuotedTweetsTimelineV2Paginator = exports.TweetSearchAllV2Paginator = exports.TweetSearchRecentV2Paginator = void 0;\nconst v2_paginator_1 = require(\"./v2.paginator\");\n/** A generic PreviousableTwitterPaginator able to consume TweetV2 timelines with since_id, until_id and next_token (when available). */\nclass TweetTimelineV2Paginator extends v2_paginator_1.TwitterV2Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n var _a;\n const result = response.data;\n const resultData = (_a = result.data) !== null && _a !== void 0 ? _a : [];\n this._rateLimit = response.rateLimit;\n if (!this._realData.data) {\n this._realData.data = [];\n }\n if (isNextPage) {\n this._realData.meta.oldest_id = result.meta.oldest_id;\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.meta.next_token = result.meta.next_token;\n this._realData.data.push(...resultData);\n }\n else {\n this._realData.meta.newest_id = result.meta.newest_id;\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.data.unshift(...resultData);\n }\n this.updateIncludes(result);\n }\n getNextQueryParams(maxResults) {\n this.assertUsable();\n const params = { ...this.injectQueryParams(maxResults) };\n if (this._realData.meta.next_token) {\n params.next_token = this._realData.meta.next_token;\n }\n else {\n if (params.start_time) {\n // until_id and start_time are forbidden together for some reason, so convert start_time to a since_id.\n params.since_id = this.dateStringToSnowflakeId(params.start_time);\n delete params.start_time;\n }\n if (params.end_time) {\n // until_id overrides end_time, so delete it\n delete params.end_time;\n }\n params.until_id = this._realData.meta.oldest_id;\n }\n return params;\n }\n getPreviousQueryParams(maxResults) {\n this.assertUsable();\n return {\n ...this.injectQueryParams(maxResults),\n since_id: this._realData.meta.newest_id,\n };\n }\n getPageLengthFromRequest(result) {\n var _a, _b;\n return (_b = (_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }\n isFetchLastOver(result) {\n var _a;\n return !((_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) || !this.canFetchNextPage(result.data);\n }\n canFetchNextPage(result) {\n return !!result.meta.next_token;\n }\n getItemArray() {\n return this.tweets;\n }\n dateStringToSnowflakeId(dateStr) {\n const TWITTER_START_EPOCH = BigInt('1288834974657');\n const date = new Date(dateStr);\n if (isNaN(date.valueOf())) {\n throw new Error('Unable to convert start_time/end_time to a valid date. A ISO 8601 DateTime is excepted, please check your input.');\n }\n const dateTimestamp = BigInt(date.valueOf());\n return ((dateTimestamp - TWITTER_START_EPOCH) << BigInt('22')).toString();\n }\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\n/** A generic PreviousableTwitterPaginator able to consume TweetV2 timelines with pagination_tokens. */\nclass TweetPaginableTimelineV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n super.refreshInstanceFromResult(response, isNextPage);\n const result = response.data;\n if (isNextPage) {\n this._realData.meta.oldest_id = result.meta.oldest_id;\n }\n else {\n this._realData.meta.newest_id = result.meta.newest_id;\n }\n }\n getItemArray() {\n return this.tweets;\n }\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\n// ----------------\n// - Tweet search -\n// ----------------\nclass TweetSearchRecentV2Paginator extends TweetTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/search/recent';\n }\n}\nexports.TweetSearchRecentV2Paginator = TweetSearchRecentV2Paginator;\nclass TweetSearchAllV2Paginator extends TweetTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/search/all';\n }\n}\nexports.TweetSearchAllV2Paginator = TweetSearchAllV2Paginator;\nclass QuotedTweetsTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/:id/quote_tweets';\n }\n}\nexports.QuotedTweetsTimelineV2Paginator = QuotedTweetsTimelineV2Paginator;\n// -----------------\n// - Home timeline -\n// -----------------\nclass TweetHomeTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/timelines/reverse_chronological';\n }\n}\nexports.TweetHomeTimelineV2Paginator = TweetHomeTimelineV2Paginator;\nclass TweetUserTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/tweets';\n }\n}\nexports.TweetUserTimelineV2Paginator = TweetUserTimelineV2Paginator;\nclass TweetUserMentionTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/mentions';\n }\n}\nexports.TweetUserMentionTimelineV2Paginator = TweetUserMentionTimelineV2Paginator;\n// -------------\n// - Bookmarks -\n// -------------\nclass TweetBookmarksTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/bookmarks';\n }\n}\nexports.TweetBookmarksTimelineV2Paginator = TweetBookmarksTimelineV2Paginator;\n// ---------------------------------------------------------------------------------\n// - Tweet lists (consume tweets with pagination tokens instead of since/until id) -\n// ---------------------------------------------------------------------------------\n/** A generic TwitterPaginator able to consume TweetV2 timelines. */\nclass TweetListV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n getItemArray() {\n return this.tweets;\n }\n}\nclass TweetV2UserLikedTweetsPaginator extends TweetListV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/liked_tweets';\n }\n}\nexports.TweetV2UserLikedTweetsPaginator = TweetV2UserLikedTweetsPaginator;\nclass TweetV2ListTweetsPaginator extends TweetListV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/:id/tweets';\n }\n}\nexports.TweetV2ListTweetsPaginator = TweetV2ListTweetsPaginator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FriendshipsOutgoingV1Paginator = exports.FriendshipsIncomingV1Paginator = exports.UserSearchV1Paginator = void 0;\nconst TwitterPaginator_1 = __importDefault(require(\"./TwitterPaginator\"));\nconst paginator_v1_1 = require(\"./paginator.v1\");\n/** A generic TwitterPaginator able to consume TweetV1 timelines. */\nclass UserSearchV1Paginator extends TwitterPaginator_1.default {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/search.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.push(...result);\n }\n }\n getNextQueryParams(maxResults) {\n var _a;\n const previousPage = Number((_a = this._queryParams.page) !== null && _a !== void 0 ? _a : '1');\n return {\n ...this._queryParams,\n page: previousPage + 1,\n ...maxResults ? { count: maxResults } : {},\n };\n }\n getPageLengthFromRequest(result) {\n return result.data.length;\n }\n isFetchLastOver(result) {\n return !result.data.length;\n }\n canFetchNextPage(result) {\n return result.length > 0;\n }\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n return this._realData;\n }\n}\nexports.UserSearchV1Paginator = UserSearchV1Paginator;\nclass FriendshipsIncomingV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'friendships/incoming.json';\n this._maxResultsWhenFetchLast = 5000;\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.ids.push(...result.ids);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.ids.length;\n }\n getItemArray() {\n return this.ids;\n }\n /**\n * Users IDs returned by paginator.\n */\n get ids() {\n return this._realData.ids;\n }\n}\nexports.FriendshipsIncomingV1Paginator = FriendshipsIncomingV1Paginator;\nclass FriendshipsOutgoingV1Paginator extends FriendshipsIncomingV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'friendships/outgoing.json';\n }\n}\nexports.FriendshipsOutgoingV1Paginator = FriendshipsOutgoingV1Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetRetweetersUsersV2Paginator = exports.TweetLikingUsersV2Paginator = exports.UserListFollowersV2Paginator = exports.UserListMembersV2Paginator = exports.UserFollowingV2Paginator = exports.UserFollowersV2Paginator = exports.UserMutingUsersV2Paginator = exports.UserBlockingUsersV2Paginator = void 0;\nconst v2_paginator_1 = require(\"./v2.paginator\");\n/** A generic PreviousableTwitterPaginator able to consume UserV2 timelines. */\nclass UserTimelineV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\nclass UserBlockingUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/blocking';\n }\n}\nexports.UserBlockingUsersV2Paginator = UserBlockingUsersV2Paginator;\nclass UserMutingUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/muting';\n }\n}\nexports.UserMutingUsersV2Paginator = UserMutingUsersV2Paginator;\nclass UserFollowersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/followers';\n }\n}\nexports.UserFollowersV2Paginator = UserFollowersV2Paginator;\nclass UserFollowingV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/following';\n }\n}\nexports.UserFollowingV2Paginator = UserFollowingV2Paginator;\nclass UserListMembersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/:id/members';\n }\n}\nexports.UserListMembersV2Paginator = UserListMembersV2Paginator;\nclass UserListFollowersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/:id/followers';\n }\n}\nexports.UserListFollowersV2Paginator = UserListFollowersV2Paginator;\nclass TweetLikingUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/:id/liking_users';\n }\n}\nexports.TweetLikingUsersV2Paginator = TweetLikingUsersV2Paginator;\nclass TweetRetweetersUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/:id/retweeted_by';\n }\n}\nexports.TweetRetweetersUsersV2Paginator = TweetRetweetersUsersV2Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TimelineV2Paginator = exports.TwitterV2Paginator = void 0;\nconst includes_v2_helper_1 = require(\"../v2/includes.v2.helper\");\nconst TwitterPaginator_1 = require(\"./TwitterPaginator\");\n/** A generic PreviousableTwitterPaginator with common v2 helper methods. */\nclass TwitterV2Paginator extends TwitterPaginator_1.PreviousableTwitterPaginator {\n updateIncludes(data) {\n // Update errors\n if (data.errors) {\n if (!this._realData.errors) {\n this._realData.errors = [];\n }\n this._realData.errors = [...this._realData.errors, ...data.errors];\n }\n // Update includes\n if (!data.includes) {\n return;\n }\n if (!this._realData.includes) {\n this._realData.includes = {};\n }\n const includesRealData = this._realData.includes;\n for (const [includeKey, includeArray] of Object.entries(data.includes)) {\n if (!includesRealData[includeKey]) {\n includesRealData[includeKey] = [];\n }\n includesRealData[includeKey] = [\n ...includesRealData[includeKey],\n ...includeArray,\n ];\n }\n }\n /** Throw if the current paginator is not usable. */\n assertUsable() {\n if (this.unusable) {\n throw new Error('Unable to use this paginator to fetch more data, as it does not contain any metadata.' +\n ' Check .errors property for more details.');\n }\n }\n get meta() {\n return this._realData.meta;\n }\n get includes() {\n var _a;\n if (!((_a = this._realData) === null || _a === void 0 ? void 0 : _a.includes)) {\n return new includes_v2_helper_1.TwitterV2IncludesHelper(this._realData);\n }\n if (this._includesInstance) {\n return this._includesInstance;\n }\n return this._includesInstance = new includes_v2_helper_1.TwitterV2IncludesHelper(this._realData);\n }\n get errors() {\n var _a;\n return (_a = this._realData.errors) !== null && _a !== void 0 ? _a : [];\n }\n /** `true` if this paginator only contains error payload and no metadata found to consume data. */\n get unusable() {\n return this.errors.length > 0 && !this._realData.meta && !this._realData.data;\n }\n}\nexports.TwitterV2Paginator = TwitterV2Paginator;\n/** A generic TwitterV2Paginator able to consume v2 timelines that use max_results and pagination tokens. */\nclass TimelineV2Paginator extends TwitterV2Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n var _a;\n const result = response.data;\n const resultData = (_a = result.data) !== null && _a !== void 0 ? _a : [];\n this._rateLimit = response.rateLimit;\n if (!this._realData.data) {\n this._realData.data = [];\n }\n if (isNextPage) {\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.meta.next_token = result.meta.next_token;\n this._realData.data.push(...resultData);\n }\n else {\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.meta.previous_token = result.meta.previous_token;\n this._realData.data.unshift(...resultData);\n }\n this.updateIncludes(result);\n }\n getNextQueryParams(maxResults) {\n this.assertUsable();\n return {\n ...this.injectQueryParams(maxResults),\n pagination_token: this._realData.meta.next_token,\n };\n }\n getPreviousQueryParams(maxResults) {\n this.assertUsable();\n return {\n ...this.injectQueryParams(maxResults),\n pagination_token: this._realData.meta.previous_token,\n };\n }\n getPageLengthFromRequest(result) {\n var _a, _b;\n return (_b = (_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }\n isFetchLastOver(result) {\n var _a;\n return !((_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) || !this.canFetchNextPage(result.data);\n }\n canFetchNextPage(result) {\n var _a;\n return !!((_a = result.meta) === null || _a === void 0 ? void 0 : _a.next_token);\n }\n}\nexports.TimelineV2Paginator = TimelineV2Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.applyResponseHooks = exports.hasRequestErrorPlugins = void 0;\nconst types_1 = require(\"../types\");\n/* Plugin helpers */\nfunction hasRequestErrorPlugins(client) {\n var _a;\n if (!((_a = client.clientSettings.plugins) === null || _a === void 0 ? void 0 : _a.length)) {\n return false;\n }\n for (const plugin of client.clientSettings.plugins) {\n if (plugin.onRequestError || plugin.onResponseError) {\n return true;\n }\n }\n return false;\n}\nexports.hasRequestErrorPlugins = hasRequestErrorPlugins;\nasync function applyResponseHooks(requestParams, computedParams, requestOptions, error) {\n let override;\n if (error instanceof types_1.ApiRequestError || error instanceof types_1.ApiPartialResponseError) {\n override = await this.applyPluginMethod('onRequestError', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n error,\n });\n }\n else if (error instanceof types_1.ApiResponseError) {\n override = await this.applyPluginMethod('onResponseError', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n error,\n });\n }\n if (override && override instanceof types_1.TwitterApiPluginResponseOverride) {\n return override.value;\n }\n return Promise.reject(error);\n}\nexports.applyResponseHooks = applyResponseHooks;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiV2Settings = void 0;\nexports.TwitterApiV2Settings = {\n debug: false,\n deprecationWarnings: true,\n logger: { log: console.log.bind(console) },\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetStream = void 0;\nconst events_1 = require(\"events\");\nconst request_handler_helper_1 = __importDefault(require(\"../client-mixins/request-handler.helper\"));\nconst types_1 = require(\"../types\");\nconst TweetStreamEventCombiner_1 = __importDefault(require(\"./TweetStreamEventCombiner\"));\nconst TweetStreamParser_1 = __importStar(require(\"./TweetStreamParser\"));\n// In seconds\nconst basicRetriesAttempt = [5, 15, 30, 60, 90, 120, 180, 300, 600, 900];\n// Default retry function\nconst basicReconnectRetry = tryOccurence => tryOccurence > basicRetriesAttempt.length\n ? 901000\n : basicRetriesAttempt[tryOccurence - 1] * 1000;\nclass TweetStream extends events_1.EventEmitter {\n constructor(requestData, connection) {\n super();\n this.requestData = requestData;\n this.autoReconnect = false;\n this.autoReconnectRetries = 5;\n // 2 minutes without any Twitter signal\n this.keepAliveTimeoutMs = 1000 * 120;\n this.nextRetryTimeout = basicReconnectRetry;\n this.parser = new TweetStreamParser_1.default();\n this.connectionProcessRunning = false;\n this.onKeepAliveTimeout = this.onKeepAliveTimeout.bind(this);\n this.initEventsFromParser();\n if (connection) {\n this.req = connection.req;\n this.res = connection.res;\n this.originalResponse = connection.originalResponse;\n this.initEventsFromRequest();\n }\n }\n on(event, handler) {\n return super.on(event, handler);\n }\n initEventsFromRequest() {\n if (!this.req || !this.res) {\n throw new Error('TweetStream error: You cannot init TweetStream without a request and response object.');\n }\n const errorHandler = (err) => {\n this.emit(types_1.ETwitterStreamEvent.ConnectionError, err);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.ConnectionError,\n error: err,\n message: 'Connection lost or closed by Twitter.',\n });\n this.onConnectionError();\n };\n this.req.on('error', errorHandler);\n this.res.on('error', errorHandler);\n // Usually, connection should not be closed by Twitter!\n this.res.on('close', () => errorHandler(new Error('Connection closed by Twitter.')));\n this.res.on('data', (chunk) => {\n this.resetKeepAliveTimeout();\n if (chunk.toString() === '\\r\\n') {\n return this.emit(types_1.ETwitterStreamEvent.DataKeepAlive);\n }\n this.parser.push(chunk.toString());\n });\n // Starts the keep alive timeout\n this.resetKeepAliveTimeout();\n }\n initEventsFromParser() {\n const payloadIsError = this.requestData.payloadIsError;\n this.parser.on(TweetStreamParser_1.EStreamParserEvent.ParsedData, (eventData) => {\n if (payloadIsError && payloadIsError(eventData)) {\n this.emit(types_1.ETwitterStreamEvent.DataError, eventData);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.DataError,\n error: eventData,\n message: 'Twitter sent a payload that is detected as an error payload.',\n });\n }\n else {\n this.emit(types_1.ETwitterStreamEvent.Data, eventData);\n }\n });\n this.parser.on(TweetStreamParser_1.EStreamParserEvent.ParseError, (error) => {\n this.emit(types_1.ETwitterStreamEvent.TweetParseError, error);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.TweetParseError,\n error,\n message: 'Failed to parse stream data.',\n });\n });\n }\n resetKeepAliveTimeout() {\n this.unbindKeepAliveTimeout();\n if (this.keepAliveTimeoutMs !== Infinity) {\n this.keepAliveTimeout = setTimeout(this.onKeepAliveTimeout, this.keepAliveTimeoutMs);\n }\n }\n onKeepAliveTimeout() {\n this.emit(types_1.ETwitterStreamEvent.ConnectionLost);\n this.onConnectionError();\n }\n unbindTimeouts() {\n this.unbindRetryTimeout();\n this.unbindKeepAliveTimeout();\n }\n unbindKeepAliveTimeout() {\n if (this.keepAliveTimeout) {\n clearTimeout(this.keepAliveTimeout);\n this.keepAliveTimeout = undefined;\n }\n }\n unbindRetryTimeout() {\n if (this.retryTimeout) {\n clearTimeout(this.retryTimeout);\n this.retryTimeout = undefined;\n }\n }\n closeWithoutEmit() {\n this.unbindTimeouts();\n if (this.res) {\n this.res.removeAllListeners();\n // Close response silentely\n this.res.destroy();\n }\n if (this.req) {\n this.req.removeAllListeners();\n // Close connection silentely\n this.req.destroy();\n }\n }\n /** Terminate connection to Twitter. */\n close() {\n this.emit(types_1.ETwitterStreamEvent.ConnectionClosed);\n this.closeWithoutEmit();\n }\n /** Unbind all listeners, and close connection. */\n destroy() {\n this.removeAllListeners();\n this.close();\n }\n /**\n * Make a new request that creates a new `TweetStream` instance with\n * the same parameters, and bind current listeners to new stream.\n */\n async clone() {\n const newRequest = new request_handler_helper_1.default(this.requestData);\n const newStream = await newRequest.makeRequestAsStream();\n // Clone attached listeners\n const listenerNames = this.eventNames();\n for (const listener of listenerNames) {\n const callbacks = this.listeners(listener);\n for (const callback of callbacks) {\n newStream.on(listener, callback);\n }\n }\n return newStream;\n }\n /** Start initial stream connection, setup options on current instance and returns itself. */\n async connect(options = {}) {\n if (typeof options.autoReconnect !== 'undefined') {\n this.autoReconnect = options.autoReconnect;\n }\n if (typeof options.autoReconnectRetries !== 'undefined') {\n this.autoReconnectRetries = options.autoReconnectRetries === 'unlimited'\n ? Infinity\n : options.autoReconnectRetries;\n }\n if (typeof options.keepAliveTimeout !== 'undefined') {\n this.keepAliveTimeoutMs = options.keepAliveTimeout === 'disable'\n ? Infinity\n : options.keepAliveTimeout;\n }\n if (typeof options.nextRetryTimeout !== 'undefined') {\n this.nextRetryTimeout = options.nextRetryTimeout;\n }\n // Make the connection\n this.unbindTimeouts();\n try {\n await this.reconnect();\n }\n catch (e) {\n this.emit(types_1.ETwitterStreamEvent.ConnectError, 0);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.ConnectError,\n error: e,\n message: 'Connect error - Initial connection just failed.',\n });\n // Only make a reconnection attempt if autoReconnect is true!\n // Otherwise, let error be propagated\n if (this.autoReconnect) {\n this.makeAutoReconnectRetry(0, e);\n }\n else {\n throw e;\n }\n }\n return this;\n }\n /** Make a new request to (re)connect to Twitter. */\n async reconnect() {\n if (this.connectionProcessRunning) {\n throw new Error('Connection process is already running.');\n }\n this.connectionProcessRunning = true;\n try {\n let initialConnection = true;\n if (this.req) {\n initialConnection = false;\n this.closeWithoutEmit();\n }\n const { req, res, originalResponse } = await new request_handler_helper_1.default(this.requestData).makeRequestAndResolveWhenReady();\n this.req = req;\n this.res = res;\n this.originalResponse = originalResponse;\n this.emit(initialConnection ? types_1.ETwitterStreamEvent.Connected : types_1.ETwitterStreamEvent.Reconnected);\n this.parser.reset();\n this.initEventsFromRequest();\n }\n finally {\n this.connectionProcessRunning = false;\n }\n }\n async onConnectionError(retryOccurence = 0) {\n this.unbindTimeouts();\n // Close the request if necessary\n this.closeWithoutEmit();\n // Terminate stream by events if necessary (no auto-reconnect or retries exceeded)\n if (!this.autoReconnect) {\n this.emit(types_1.ETwitterStreamEvent.ConnectionClosed);\n return;\n }\n if (retryOccurence >= this.autoReconnectRetries) {\n this.emit(types_1.ETwitterStreamEvent.ReconnectLimitExceeded);\n this.emit(types_1.ETwitterStreamEvent.ConnectionClosed);\n return;\n }\n // If all other conditions fails, do a reconnect attempt\n try {\n this.emit(types_1.ETwitterStreamEvent.ReconnectAttempt, retryOccurence);\n await this.reconnect();\n }\n catch (e) {\n this.emit(types_1.ETwitterStreamEvent.ReconnectError, retryOccurence);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.ReconnectError,\n error: e,\n message: `Reconnect error - ${retryOccurence + 1} attempts made yet.`,\n });\n this.makeAutoReconnectRetry(retryOccurence, e);\n }\n }\n makeAutoReconnectRetry(retryOccurence, error) {\n const nextRetry = this.nextRetryTimeout(retryOccurence + 1, error);\n this.retryTimeout = setTimeout(() => {\n this.onConnectionError(retryOccurence + 1);\n }, nextRetry);\n }\n async *[Symbol.asyncIterator]() {\n const eventCombiner = new TweetStreamEventCombiner_1.default(this);\n try {\n while (true) {\n if (!this.req || this.req.aborted) {\n throw new Error('Connection closed');\n }\n if (eventCombiner.hasStack()) {\n yield* eventCombiner.popStack();\n }\n const { type, payload } = await eventCombiner.nextEvent();\n if (type === 'error') {\n throw payload;\n }\n }\n }\n finally {\n eventCombiner.destroy();\n }\n }\n}\nexports.TweetStream = TweetStream;\nexports.default = TweetStream;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetStreamEventCombiner = void 0;\nconst events_1 = require(\"events\");\nconst types_1 = require(\"../types\");\nclass TweetStreamEventCombiner extends events_1.EventEmitter {\n constructor(stream) {\n super();\n this.stream = stream;\n this.stack = [];\n this.onStreamData = this.onStreamData.bind(this);\n this.onStreamError = this.onStreamError.bind(this);\n this.onceNewEvent = this.once.bind(this, 'event');\n // Init events from stream\n stream.on(types_1.ETwitterStreamEvent.Data, this.onStreamData);\n // Ignore reconnect errors: Don't close event combiner until connection error/closed\n stream.on(types_1.ETwitterStreamEvent.ConnectionError, this.onStreamError);\n stream.on(types_1.ETwitterStreamEvent.TweetParseError, this.onStreamError);\n stream.on(types_1.ETwitterStreamEvent.ConnectionClosed, this.onStreamError);\n }\n /** Returns a new `Promise` that will `resolve` on next event (`data` or any sort of error). */\n nextEvent() {\n return new Promise(this.onceNewEvent);\n }\n /** Returns `true` if there's something in the stack. */\n hasStack() {\n return this.stack.length > 0;\n }\n /** Returns stacked data events, and clean the stack. */\n popStack() {\n const stack = this.stack;\n this.stack = [];\n return stack;\n }\n /** Cleanup all the listeners attached on stream. */\n destroy() {\n this.removeAllListeners();\n this.stream.off(types_1.ETwitterStreamEvent.Data, this.onStreamData);\n this.stream.off(types_1.ETwitterStreamEvent.ConnectionError, this.onStreamError);\n this.stream.off(types_1.ETwitterStreamEvent.TweetParseError, this.onStreamError);\n this.stream.off(types_1.ETwitterStreamEvent.ConnectionClosed, this.onStreamError);\n }\n emitEvent(type, payload) {\n this.emit('event', { type, payload });\n }\n onStreamError(payload) {\n this.emitEvent('error', payload);\n }\n onStreamData(payload) {\n this.stack.push(payload);\n this.emitEvent('data', payload);\n }\n}\nexports.TweetStreamEventCombiner = TweetStreamEventCombiner;\nexports.default = TweetStreamEventCombiner;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EStreamParserEvent = void 0;\nconst events_1 = require(\"events\");\nclass TweetStreamParser extends events_1.EventEmitter {\n constructor() {\n super(...arguments);\n this.currentMessage = '';\n }\n // Code partially belongs to twitter-stream-api for this\n // https://github.com/trygve-lie/twitter-stream-api/blob/master/lib/parser.js\n push(chunk) {\n this.currentMessage += chunk;\n chunk = this.currentMessage;\n const size = chunk.length;\n let start = 0;\n let offset = 0;\n while (offset < size) {\n // Take [offset, offset+1] inside a new string\n if (chunk.slice(offset, offset + 2) === '\\r\\n') {\n // If chunk contains \\r\\n after current offset,\n // parse [start, ..., offset] as a tweet\n const piece = chunk.slice(start, offset);\n start = offset += 2;\n // If empty object\n if (!piece.length) {\n continue;\n }\n try {\n const payload = JSON.parse(piece);\n if (payload) {\n this.emit(EStreamParserEvent.ParsedData, payload);\n continue;\n }\n }\n catch (error) {\n this.emit(EStreamParserEvent.ParseError, error);\n }\n }\n offset++;\n }\n this.currentMessage = chunk.slice(start, size);\n }\n /** Reset the currently stored message (f.e. on connection reset) */\n reset() {\n this.currentMessage = '';\n }\n}\nexports.default = TweetStreamParser;\nvar EStreamParserEvent;\n(function (EStreamParserEvent) {\n EStreamParserEvent[\"ParsedData\"] = \"parsed data\";\n EStreamParserEvent[\"ParseError\"] = \"parse error\";\n})(EStreamParserEvent = exports.EStreamParserEvent || (exports.EStreamParserEvent = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ETwitterStreamEvent = void 0;\nvar ETwitterStreamEvent;\n(function (ETwitterStreamEvent) {\n ETwitterStreamEvent[\"Connected\"] = \"connected\";\n ETwitterStreamEvent[\"ConnectError\"] = \"connect error\";\n ETwitterStreamEvent[\"ConnectionError\"] = \"connection error\";\n ETwitterStreamEvent[\"ConnectionClosed\"] = \"connection closed\";\n ETwitterStreamEvent[\"ConnectionLost\"] = \"connection lost\";\n ETwitterStreamEvent[\"ReconnectAttempt\"] = \"reconnect attempt\";\n ETwitterStreamEvent[\"Reconnected\"] = \"reconnected\";\n ETwitterStreamEvent[\"ReconnectError\"] = \"reconnect error\";\n ETwitterStreamEvent[\"ReconnectLimitExceeded\"] = \"reconnect limit exceeded\";\n ETwitterStreamEvent[\"DataKeepAlive\"] = \"data keep-alive\";\n ETwitterStreamEvent[\"Data\"] = \"data event content\";\n ETwitterStreamEvent[\"DataError\"] = \"data twitter error\";\n ETwitterStreamEvent[\"TweetParseError\"] = \"data tweet parse error\";\n ETwitterStreamEvent[\"Error\"] = \"stream error\";\n})(ETwitterStreamEvent = exports.ETwitterStreamEvent || (exports.ETwitterStreamEvent = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EApiV2ErrorCode = exports.EApiV1ErrorCode = exports.ApiResponseError = exports.ApiPartialResponseError = exports.ApiRequestError = exports.ETwitterApiError = void 0;\nvar ETwitterApiError;\n(function (ETwitterApiError) {\n ETwitterApiError[\"Request\"] = \"request\";\n ETwitterApiError[\"PartialResponse\"] = \"partial-response\";\n ETwitterApiError[\"Response\"] = \"response\";\n})(ETwitterApiError = exports.ETwitterApiError || (exports.ETwitterApiError = {}));\n/* ERRORS INSTANCES */\nclass ApiError extends Error {\n constructor() {\n super(...arguments);\n this.error = true;\n }\n}\nclass ApiRequestError extends ApiError {\n constructor(message, options) {\n super(message);\n this.type = ETwitterApiError.Request;\n Error.captureStackTrace(this, this.constructor);\n // Do not show on Node stack trace\n Object.defineProperty(this, '_options', { value: options });\n }\n get request() {\n return this._options.request;\n }\n get requestError() {\n return this._options.requestError;\n }\n toJSON() {\n return {\n type: this.type,\n error: this.requestError,\n };\n }\n}\nexports.ApiRequestError = ApiRequestError;\nclass ApiPartialResponseError extends ApiError {\n constructor(message, options) {\n super(message);\n this.type = ETwitterApiError.PartialResponse;\n Error.captureStackTrace(this, this.constructor);\n // Do not show on Node stack trace\n Object.defineProperty(this, '_options', { value: options });\n }\n get request() {\n return this._options.request;\n }\n get response() {\n return this._options.response;\n }\n get responseError() {\n return this._options.responseError;\n }\n get rawContent() {\n return this._options.rawContent;\n }\n toJSON() {\n return {\n type: this.type,\n error: this.responseError,\n };\n }\n}\nexports.ApiPartialResponseError = ApiPartialResponseError;\nclass ApiResponseError extends ApiError {\n constructor(message, options) {\n super(message);\n this.type = ETwitterApiError.Response;\n Error.captureStackTrace(this, this.constructor);\n // Do not show on Node stack trace\n Object.defineProperty(this, '_options', { value: options });\n this.code = options.code;\n this.headers = options.headers;\n this.rateLimit = options.rateLimit;\n this.data = options.data;\n }\n get request() {\n return this._options.request;\n }\n get response() {\n return this._options.response;\n }\n /** Check for presence of one of given v1/v2 error codes. */\n hasErrorCode(...codes) {\n const errors = this.errors;\n // No errors\n if (!(errors === null || errors === void 0 ? void 0 : errors.length)) {\n return false;\n }\n // v1 errors\n if ('code' in errors[0]) {\n const v1errors = errors;\n return v1errors.some(error => codes.includes(error.code));\n }\n // v2 error\n const v2error = this.data;\n return codes.includes(v2error.type);\n }\n get errors() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.errors;\n }\n get rateLimitError() {\n return this.code === 420 || this.code === 429;\n }\n get isAuthError() {\n if (this.code === 401) {\n return true;\n }\n return this.hasErrorCode(EApiV1ErrorCode.AuthTimestampInvalid, EApiV1ErrorCode.AuthenticationFail, EApiV1ErrorCode.BadAuthenticationData, EApiV1ErrorCode.InvalidOrExpiredToken);\n }\n toJSON() {\n return {\n type: this.type,\n code: this.code,\n error: this.data,\n rateLimit: this.rateLimit,\n headers: this.headers,\n };\n }\n}\nexports.ApiResponseError = ApiResponseError;\nvar EApiV1ErrorCode;\n(function (EApiV1ErrorCode) {\n // Location errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidCoordinates\"] = 3] = \"InvalidCoordinates\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoLocationFound\"] = 13] = \"NoLocationFound\";\n // Authentication failures\n EApiV1ErrorCode[EApiV1ErrorCode[\"AuthenticationFail\"] = 32] = \"AuthenticationFail\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidOrExpiredToken\"] = 89] = \"InvalidOrExpiredToken\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"UnableToVerifyCredentials\"] = 99] = \"UnableToVerifyCredentials\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"AuthTimestampInvalid\"] = 135] = \"AuthTimestampInvalid\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"BadAuthenticationData\"] = 215] = \"BadAuthenticationData\";\n // Resources not found or visible\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoUserMatch\"] = 17] = \"NoUserMatch\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"UserNotFound\"] = 50] = \"UserNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"ResourceNotFound\"] = 34] = \"ResourceNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetNotFound\"] = 144] = \"TweetNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetNotVisible\"] = 179] = \"TweetNotVisible\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NotAllowedResource\"] = 220] = \"NotAllowedResource\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"MediaIdNotFound\"] = 325] = \"MediaIdNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetNoLongerAvailable\"] = 421] = \"TweetNoLongerAvailable\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetViolatedRules\"] = 422] = \"TweetViolatedRules\";\n // Account errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"TargetUserSuspended\"] = 63] = \"TargetUserSuspended\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"YouAreSuspended\"] = 64] = \"YouAreSuspended\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"AccountUpdateFailed\"] = 120] = \"AccountUpdateFailed\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoSelfSpamReport\"] = 36] = \"NoSelfSpamReport\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoSelfMute\"] = 271] = \"NoSelfMute\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"AccountLocked\"] = 326] = \"AccountLocked\";\n // Application live errors / Twitter errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"RateLimitExceeded\"] = 88] = \"RateLimitExceeded\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoDMRightForApp\"] = 93] = \"NoDMRightForApp\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"OverCapacity\"] = 130] = \"OverCapacity\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InternalError\"] = 131] = \"InternalError\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TooManyFollowings\"] = 161] = \"TooManyFollowings\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetLimitExceeded\"] = 185] = \"TweetLimitExceeded\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"DuplicatedTweet\"] = 187] = \"DuplicatedTweet\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TooManySpamReports\"] = 205] = \"TooManySpamReports\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"RequestLooksLikeSpam\"] = 226] = \"RequestLooksLikeSpam\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoWriteRightForApp\"] = 261] = \"NoWriteRightForApp\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetActionsDisabled\"] = 425] = \"TweetActionsDisabled\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetRepliesRestricted\"] = 433] = \"TweetRepliesRestricted\";\n // Invalid request parameters\n EApiV1ErrorCode[EApiV1ErrorCode[\"NamedParameterMissing\"] = 38] = \"NamedParameterMissing\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidAttachmentUrl\"] = 44] = \"InvalidAttachmentUrl\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetTextTooLong\"] = 186] = \"TweetTextTooLong\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"MissingUrlParameter\"] = 195] = \"MissingUrlParameter\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoMultipleGifs\"] = 323] = \"NoMultipleGifs\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidMediaIds\"] = 324] = \"InvalidMediaIds\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidUrl\"] = 407] = \"InvalidUrl\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TooManyTweetAttachments\"] = 386] = \"TooManyTweetAttachments\";\n // Already sent/deleted item\n EApiV1ErrorCode[EApiV1ErrorCode[\"StatusAlreadyFavorited\"] = 139] = \"StatusAlreadyFavorited\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"FollowRequestAlreadySent\"] = 160] = \"FollowRequestAlreadySent\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"CannotUnmuteANonMutedAccount\"] = 272] = \"CannotUnmuteANonMutedAccount\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetAlreadyRetweeted\"] = 327] = \"TweetAlreadyRetweeted\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"ReplyToDeletedTweet\"] = 385] = \"ReplyToDeletedTweet\";\n // DM Errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"DMReceiverNotFollowingYou\"] = 150] = \"DMReceiverNotFollowingYou\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"UnableToSendDM\"] = 151] = \"UnableToSendDM\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"MustAllowDMFromAnyone\"] = 214] = \"MustAllowDMFromAnyone\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"CannotSendDMToThisUser\"] = 349] = \"CannotSendDMToThisUser\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"DMTextTooLong\"] = 354] = \"DMTextTooLong\";\n // Appication misconfiguration\n EApiV1ErrorCode[EApiV1ErrorCode[\"SubscriptionAlreadyExists\"] = 355] = \"SubscriptionAlreadyExists\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"CallbackUrlNotApproved\"] = 415] = \"CallbackUrlNotApproved\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"SuspendedApplication\"] = 416] = \"SuspendedApplication\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"OobOauthIsNotAllowed\"] = 417] = \"OobOauthIsNotAllowed\";\n})(EApiV1ErrorCode = exports.EApiV1ErrorCode || (exports.EApiV1ErrorCode = {}));\nvar EApiV2ErrorCode;\n(function (EApiV2ErrorCode) {\n // Request errors\n EApiV2ErrorCode[\"InvalidRequest\"] = \"https://api.twitter.com/2/problems/invalid-request\";\n EApiV2ErrorCode[\"ClientForbidden\"] = \"https://api.twitter.com/2/problems/client-forbidden\";\n EApiV2ErrorCode[\"UnsupportedAuthentication\"] = \"https://api.twitter.com/2/problems/unsupported-authentication\";\n // Stream rules errors\n EApiV2ErrorCode[\"InvalidRules\"] = \"https://api.twitter.com/2/problems/invalid-rules\";\n EApiV2ErrorCode[\"TooManyRules\"] = \"https://api.twitter.com/2/problems/rule-cap\";\n EApiV2ErrorCode[\"DuplicatedRules\"] = \"https://api.twitter.com/2/problems/duplicate-rules\";\n // Twitter errors\n EApiV2ErrorCode[\"RateLimitExceeded\"] = \"https://api.twitter.com/2/problems/usage-capped\";\n EApiV2ErrorCode[\"ConnectionError\"] = \"https://api.twitter.com/2/problems/streaming-connection\";\n EApiV2ErrorCode[\"ClientDisconnected\"] = \"https://api.twitter.com/2/problems/client-disconnected\";\n EApiV2ErrorCode[\"TwitterDisconnectedYou\"] = \"https://api.twitter.com/2/problems/operational-disconnect\";\n // Resource errors\n EApiV2ErrorCode[\"ResourceNotFound\"] = \"https://api.twitter.com/2/problems/resource-not-found\";\n EApiV2ErrorCode[\"ResourceUnauthorized\"] = \"https://api.twitter.com/2/problems/not-authorized-for-resource\";\n EApiV2ErrorCode[\"DisallowedResource\"] = \"https://api.twitter.com/2/problems/disallowed-resource\";\n})(EApiV2ErrorCode = exports.EApiV2ErrorCode || (exports.EApiV2ErrorCode = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./v1\"), exports);\n__exportStar(require(\"./v2\"), exports);\n__exportStar(require(\"./errors.types\"), exports);\n__exportStar(require(\"./responses.types\"), exports);\n__exportStar(require(\"./client.types\"), exports);\n__exportStar(require(\"./auth.types\"), exports);\n__exportStar(require(\"./plugins\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiPluginResponseOverride = void 0;\nclass TwitterApiPluginResponseOverride {\n constructor(value) {\n this.value = value;\n }\n}\nexports.TwitterApiPluginResponseOverride = TwitterApiPluginResponseOverride;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./client.plugins.types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EDirectMessageEventTypeV1 = void 0;\n// Creation of DMs\nvar EDirectMessageEventTypeV1;\n(function (EDirectMessageEventTypeV1) {\n EDirectMessageEventTypeV1[\"Create\"] = \"message_create\";\n EDirectMessageEventTypeV1[\"WelcomeCreate\"] = \"welcome_message\";\n})(EDirectMessageEventTypeV1 = exports.EDirectMessageEventTypeV1 || (exports.EDirectMessageEventTypeV1 = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./streaming.v1.types\"), exports);\n__exportStar(require(\"./tweet.v1.types\"), exports);\n__exportStar(require(\"./entities.v1.types\"), exports);\n__exportStar(require(\"./user.v1.types\"), exports);\n__exportStar(require(\"./dev-utilities.v1.types\"), exports);\n__exportStar(require(\"./geo.v1.types\"), exports);\n__exportStar(require(\"./trends.v1.types\"), exports);\n__exportStar(require(\"./dm.v1.types\"), exports);\n__exportStar(require(\"./list.v1.types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EUploadMimeType = void 0;\nvar EUploadMimeType;\n(function (EUploadMimeType) {\n EUploadMimeType[\"Jpeg\"] = \"image/jpeg\";\n EUploadMimeType[\"Mp4\"] = \"video/mp4\";\n EUploadMimeType[\"Gif\"] = \"image/gif\";\n EUploadMimeType[\"Png\"] = \"image/png\";\n EUploadMimeType[\"Srt\"] = \"text/plain\";\n EUploadMimeType[\"Webp\"] = \"image/webp\";\n})(EUploadMimeType = exports.EUploadMimeType || (exports.EUploadMimeType = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./streaming.v2.types\"), exports);\n__exportStar(require(\"./tweet.v2.types\"), exports);\n__exportStar(require(\"./tweet.definition.v2\"), exports);\n__exportStar(require(\"./user.v2.types\"), exports);\n__exportStar(require(\"./spaces.v2.types\"), exports);\n__exportStar(require(\"./list.v2.types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\n// ---------------\n// -- Streaming --\n// ---------------\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiv1 = void 0;\nconst globals_1 = require(\"../globals\");\nconst dm_paginator_v1_1 = require(\"../paginators/dm.paginator.v1\");\nconst types_1 = require(\"../types\");\nconst client_v1_write_1 = __importDefault(require(\"./client.v1.write\"));\n/**\n * Twitter v1.1 API client with read/write/DMs rights.\n */\nclass TwitterApiv1 extends client_v1_write_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V1_1_PREFIX;\n }\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n /* Direct messages */\n // Part: Sending and receiving events\n /**\n * Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event\n */\n sendDm({ recipient_id, custom_profile_id, ...params }) {\n const args = {\n event: {\n type: types_1.EDirectMessageEventTypeV1.Create,\n [types_1.EDirectMessageEventTypeV1.Create]: {\n target: { recipient_id },\n message_data: params,\n },\n },\n };\n if (custom_profile_id) {\n args.event[types_1.EDirectMessageEventTypeV1.Create].custom_profile_id = custom_profile_id;\n }\n return this.post('direct_messages/events/new.json', args, {\n forceBodyMode: 'json',\n });\n }\n /**\n * Returns a single Direct Message event by the given id.\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event\n */\n getDmEvent(id) {\n return this.get('direct_messages/events/show.json', { id });\n }\n /**\n * Deletes the direct message specified in the required ID parameter.\n * The authenticating user must be the recipient of the specified direct message.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/delete-message-event\n */\n deleteDm(id) {\n return this.delete('direct_messages/events/destroy.json', { id });\n }\n /**\n * Returns all Direct Message events (both sent and received) within the last 30 days.\n * Sorted in reverse-chronological order.\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events\n */\n async listDmEvents(args = {}) {\n const queryParams = { ...args };\n const initialRq = await this.get('direct_messages/events/list.json', queryParams, { fullResponse: true });\n return new dm_paginator_v1_1.DmEventsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n // Part: Welcome messages (events)\n /**\n * Creates a new Welcome Message that will be stored and sent in the future from the authenticating user in defined circumstances.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message\n */\n newWelcomeDm(name, data) {\n const args = {\n [types_1.EDirectMessageEventTypeV1.WelcomeCreate]: {\n name,\n message_data: data,\n },\n };\n return this.post('direct_messages/welcome_messages/new.json', args, {\n forceBodyMode: 'json',\n });\n }\n /**\n * Returns a Welcome Message by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message\n */\n getWelcomeDm(id) {\n return this.get('direct_messages/welcome_messages/show.json', { id });\n }\n /**\n * Deletes a Welcome Message by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message\n */\n deleteWelcomeDm(id) {\n return this.delete('direct_messages/welcome_messages/destroy.json', { id });\n }\n /**\n * Updates a Welcome Message by the given ID.\n * Updates to the welcome_message object are atomic.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/update-welcome-message\n */\n updateWelcomeDm(id, data) {\n const args = { message_data: data };\n return this.put('direct_messages/welcome_messages/update.json', args, {\n forceBodyMode: 'json',\n query: { id },\n });\n }\n /**\n * Returns all Direct Message events (both sent and received) within the last 30 days.\n * Sorted in reverse-chronological order.\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events\n */\n async listWelcomeDms(args = {}) {\n const queryParams = { ...args };\n const initialRq = await this.get('direct_messages/welcome_messages/list.json', queryParams, { fullResponse: true });\n return new dm_paginator_v1_1.WelcomeDmV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n // Part: Welcome message (rules)\n /**\n * Creates a new Welcome Message Rule that determines which Welcome Message will be shown in a given conversation.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message-rule\n */\n newWelcomeDmRule(welcomeMessageId) {\n return this.post('direct_messages/welcome_messages/rules/new.json', {\n welcome_message_rule: { welcome_message_id: welcomeMessageId },\n }, {\n forceBodyMode: 'json',\n });\n }\n /**\n * Returns a Welcome Message Rule by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message-rule\n */\n getWelcomeDmRule(id) {\n return this.get('direct_messages/welcome_messages/rules/show.json', { id });\n }\n /**\n * Deletes a Welcome Message Rule by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message-rule\n */\n deleteWelcomeDmRule(id) {\n return this.delete('direct_messages/welcome_messages/rules/destroy.json', { id });\n }\n /**\n * Retrieves all welcome DM rules for this account.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/list-welcome-message-rules\n */\n async listWelcomeDmRules(args = {}) {\n const queryParams = { ...args };\n return this.get('direct_messages/welcome_messages/rules/list.json', queryParams);\n }\n /**\n * Set the current showed welcome message for logged account ; wrapper for Welcome DM rules.\n * Test if a rule already exists, delete if any, then create a rule for current message ID.\n *\n * If you don't have already a welcome message, create it with `.newWelcomeMessage`.\n */\n async setWelcomeDm(welcomeMessageId, deleteAssociatedWelcomeDmWhenDeletingRule = true) {\n var _a;\n const existingRules = await this.listWelcomeDmRules();\n if ((_a = existingRules.welcome_message_rules) === null || _a === void 0 ? void 0 : _a.length) {\n for (const rule of existingRules.welcome_message_rules) {\n await this.deleteWelcomeDmRule(rule.id);\n if (deleteAssociatedWelcomeDmWhenDeletingRule) {\n await this.deleteWelcomeDm(rule.welcome_message_id);\n }\n }\n }\n return this.newWelcomeDmRule(welcomeMessageId);\n }\n // Part: Read indicator\n /**\n * Marks a message as read in the recipient’s Direct Message conversation view with the sender.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt\n */\n markDmAsRead(lastEventId, recipientId) {\n return this.post('direct_messages/mark_read.json', {\n last_read_event_id: lastEventId,\n recipient_id: recipientId,\n }, { forceBodyMode: 'url' });\n }\n /**\n * Displays a visual typing indicator in the recipient’s Direct Message conversation view with the sender.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator\n */\n indicateDmTyping(recipientId) {\n return this.post('direct_messages/indicate_typing.json', {\n recipient_id: recipientId,\n }, { forceBodyMode: 'url' });\n }\n // Part: Images\n /**\n * Get a single image attached to a direct message. TwitterApi client must be logged with OAuth 1.0a.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/message-attachments/guides/retrieving-media\n */\n async downloadDmImage(urlOrDm) {\n if (typeof urlOrDm !== 'string') {\n const attachment = urlOrDm[types_1.EDirectMessageEventTypeV1.Create].message_data.attachment;\n if (!attachment) {\n throw new Error('The given direct message doesn\\'t contain any attachment');\n }\n urlOrDm = attachment.media_url_https;\n }\n const data = await this.get(urlOrDm, undefined, { forceParseMode: 'buffer', prefix: '' });\n if (!data.length) {\n throw new Error('Image not found. Make sure you are logged with credentials able to access direct messages, and check the URL.');\n }\n return data;\n }\n}\nexports.TwitterApiv1 = TwitterApiv1;\nexports.default = TwitterApiv1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_subclient_1 = __importDefault(require(\"../client.subclient\"));\nconst globals_1 = require(\"../globals\");\nconst helpers_1 = require(\"../helpers\");\nconst client_v1_1 = __importDefault(require(\"../v1/client.v1\"));\nconst tweet_paginator_v1_1 = require(\"../paginators/tweet.paginator.v1\");\nconst mutes_paginator_v1_1 = require(\"../paginators/mutes.paginator.v1\");\nconst user_paginator_v1_1 = require(\"../paginators/user.paginator.v1\");\nconst list_paginator_v1_1 = require(\"../paginators/list.paginator.v1\");\n/**\n * Base Twitter v1 client with only read right.\n */\nclass TwitterApiv1ReadOnly extends client_subclient_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V1_1_PREFIX;\n }\n /* Tweets */\n /**\n * Returns a single Tweet, specified by the id parameter. The Tweet's author will also be embedded within the Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id\n */\n singleTweet(tweetId, options = {}) {\n return this.get('statuses/show.json', { tweet_mode: 'extended', id: tweetId, ...options });\n }\n tweets(ids, options = {}) {\n return this.post('statuses/lookup.json', { tweet_mode: 'extended', id: ids, ...options });\n }\n /**\n * Returns a single Tweet, specified by either a Tweet web URL or the Tweet ID, in an oEmbed-compatible format.\n * The returned HTML snippet will be automatically recognized as an Embedded Tweet when Twitter's widget JavaScript is included on the page.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed\n */\n oembedTweet(tweetId, options = {}) {\n return this.get('oembed', {\n url: `https://twitter.com/i/statuses/${tweetId}`,\n ...options,\n }, { prefix: 'https://publish.twitter.com/' });\n }\n /* Tweets timelines */\n /**\n * Returns a collection of the most recent Tweets and Retweets posted by the authenticating user and the users they follow.\n * The home timeline is central to how most users interact with the Twitter service.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline\n */\n async homeTimeline(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('statuses/home_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.HomeTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the 20 most recent mentions (Tweets containing a users's @screen_name) for the authenticating user.\n * The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline\n */\n async mentionTimeline(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('statuses/mentions_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.MentionTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a collection of the most recent Tweets posted by the user indicated by the user_id parameters.\n * User timelines belonging to protected users may only be requested when the authenticated user either \"owns\" the timeline or is an approved follower of the owner.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline\n */\n async userTimeline(userId, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n user_id: userId,\n ...options,\n };\n const initialRq = await this.get('statuses/user_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a collection of the most recent Tweets posted by the user indicated by the screen_name parameters.\n * User timelines belonging to protected users may only be requested when the authenticated user either \"owns\" the timeline or is an approved follower of the owner.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline\n */\n async userTimelineByUsername(username, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n screen_name: username,\n ...options,\n };\n const initialRq = await this.get('statuses/user_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the most recent Tweets liked by the authenticating or specified user, 20 tweets by default.\n * Note: favorites are now known as likes.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list\n */\n async favoriteTimeline(userId, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n user_id: userId,\n ...options,\n };\n const initialRq = await this.get('favorites/list.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserFavoritesV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the most recent Tweets liked by the authenticating or specified user, 20 tweets by default.\n * Note: favorites are now known as likes.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list\n */\n async favoriteTimelineByUsername(username, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n screen_name: username,\n ...options,\n };\n const initialRq = await this.get('favorites/list.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserFavoritesV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Users */\n /**\n * Returns a variety of information about the user specified by the required user_id or screen_name parameter.\n * The author's most recent Tweet will be returned inline when possible.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show\n */\n user(user) {\n return this.get('users/show.json', { tweet_mode: 'extended', ...user });\n }\n /**\n * Returns fully-hydrated user objects for up to 100 users per request,\n * as specified by comma-separated values passed to the user_id and/or screen_name parameters.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup\n */\n users(query) {\n return this.get('users/lookup.json', { tweet_mode: 'extended', ...query });\n }\n /**\n * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful;\n * returns a 401 status code and an error message if not.\n * Use this method to test if supplied user credentials are valid.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials\n */\n verifyCredentials(options = {}) {\n return this.get('account/verify_credentials.json', options);\n }\n /**\n * Returns an array of user objects the authenticating user has muted.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list\n */\n async listMutedUsers(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('mutes/users/list.json', queryParams, { fullResponse: true });\n return new mutes_paginator_v1_1.MuteUserListV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns an array of numeric user ids the authenticating user has muted.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-ids\n */\n async listMutedUserIds(options = {}) {\n const queryParams = {\n stringify_ids: true,\n ...options,\n };\n const initialRq = await this.get('mutes/users/ids.json', queryParams, { fullResponse: true });\n return new mutes_paginator_v1_1.MuteUserIdsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Provides a simple, relevance-based search interface to public user accounts on Twitter.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-search\n */\n async searchUsers(query, options = {}) {\n const queryParams = {\n q: query,\n tweet_mode: 'extended',\n page: 1,\n ...options,\n };\n const initialRq = await this.get('users/search.json', queryParams, { fullResponse: true });\n return new user_paginator_v1_1.UserSearchV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Friendship API */\n /**\n * Returns detailed information about the relationship between two arbitrary users.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show\n */\n friendship(sources) {\n return this.get('friendships/show.json', sources);\n }\n /**\n * Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup\n */\n friendships(friendships) {\n return this.get('friendships/lookup.json', friendships);\n }\n /**\n * Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids\n */\n friendshipsNoRetweets() {\n return this.get('friendships/no_retweets/ids.json', { stringify_ids: true });\n }\n /**\n * Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming\n */\n async friendshipsIncoming(options = {}) {\n const queryParams = {\n stringify_ids: true,\n ...options,\n };\n const initialRq = await this.get('friendships/incoming.json', queryParams, { fullResponse: true });\n return new user_paginator_v1_1.FriendshipsIncomingV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing\n */\n async friendshipsOutgoing(options = {}) {\n const queryParams = {\n stringify_ids: true,\n ...options,\n };\n const initialRq = await this.get('friendships/outgoing.json', queryParams, { fullResponse: true });\n return new user_paginator_v1_1.FriendshipsOutgoingV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Account/user API */\n /**\n * Get current account settings for authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings\n */\n accountSettings() {\n return this.get('account/settings.json');\n }\n /**\n * Returns a map of the available size variations of the specified user's profile banner.\n * If the user has not uploaded a profile banner, a HTTP 404 will be served instead.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner\n */\n userProfileBannerSizes(params) {\n return this.get('users/profile_banner.json', params);\n }\n /* Lists */\n /**\n * Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show\n */\n list(options) {\n return this.get('lists/show.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Returns all lists the authenticating or specified user subscribes to, including their own.\n * If no user is given, the authenticating user is used.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list\n */\n lists(options = {}) {\n return this.get('lists/list.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Returns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members\n */\n async listMembers(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/members.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListMembersV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Check if the specified user is a member of the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show\n */\n listGetMember(options) {\n return this.get('lists/members/show.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Returns the lists the specified user has been added to.\n * If user_id or screen_name are not provided, the memberships for the authenticating user are returned.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships\n */\n async listMemberships(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/memberships.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListMembershipsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the lists owned by the specified Twitter user. Private lists will only be shown if the authenticated user is also the owner of the lists.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships\n */\n async listOwnerships(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/ownerships.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListOwnershipsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a timeline of tweets authored by members of the specified list. Retweets are included by default.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses\n */\n async listStatuses(options) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/statuses.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.ListTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers\n */\n async listSubscribers(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/subscribers.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListSubscribersV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Check if the specified user is a subscriber of the specified list. Returns the user if they are a subscriber.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show\n */\n listGetSubscriber(options) {\n return this.get('lists/subscribers/show.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Obtain a collection of the lists the specified user is subscribed to, 20 lists per page by default.\n * Does not include the user's own lists.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions\n */\n async listSubscriptions(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/subscriptions.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListSubscriptionsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Media upload API */\n /**\n * The STATUS command (this method) is used to periodically poll for updates of media processing operation.\n * After the STATUS command response returns succeeded, you can move on to the next step which is usually create Tweet with media_id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/get-media-upload-status\n */\n mediaInfo(mediaId) {\n return this.get('media/upload.json', {\n command: 'STATUS',\n media_id: mediaId,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n }\n filterStream({ autoConnect, ...params } = {}) {\n const parameters = {};\n for (const [key, value] of Object.entries(params)) {\n if (key === 'follow' || key === 'track') {\n parameters[key] = value.toString();\n }\n else if (key === 'locations') {\n const locations = value;\n parameters.locations = (0, helpers_1.arrayWrap)(locations).map(loc => `${loc.lng},${loc.lat}`).join(',');\n }\n else {\n parameters[key] = value;\n }\n }\n const streamClient = this.stream;\n return streamClient.postStream('statuses/filter.json', parameters, { autoConnect });\n }\n sampleStream({ autoConnect, ...params } = {}) {\n const streamClient = this.stream;\n return streamClient.getStream('statuses/sample.json', params, { autoConnect });\n }\n /**\n * Create a client that is prefixed with `https//stream.twitter.com` instead of classic API URL.\n */\n get stream() {\n const copiedClient = new client_v1_1.default(this);\n copiedClient.setPrefix(globals_1.API_V1_1_STREAM_PREFIX);\n return copiedClient;\n }\n /* Trends API */\n /**\n * Returns the top 50 trending topics for a specific id, if trending information is available for it.\n * Note: The id parameter for this endpoint is the \"where on earth identifier\" or WOEID, which is a legacy identifier created by Yahoo and has been deprecated.\n * https://developer.twitter.com/en/docs/twitter-api/v1/trends/trends-for-location/api-reference/get-trends-place\n */\n trendsByPlace(woeId, options = {}) {\n return this.get('trends/place.json', { id: woeId, ...options });\n }\n /**\n * Returns the locations that Twitter has trending topic information for.\n * The response is an array of \"locations\" that encode the location's WOEID\n * and some other human-readable information such as a canonical name and country the location belongs in.\n * https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available\n */\n trendsAvailable() {\n return this.get('trends/available.json');\n }\n /**\n * Returns the locations that Twitter has trending topic information for, closest to a specified location.\n * https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-closest\n */\n trendsClosest(lat, long) {\n return this.get('trends/closest.json', { lat, long });\n }\n /* Geo API */\n /**\n * Returns all the information about a known place.\n * https://developer.twitter.com/en/docs/twitter-api/v1/geo/place-information/api-reference/get-geo-id-place_id\n */\n geoPlace(placeId) {\n return this.get('geo/id/:place_id.json', undefined, { params: { place_id: placeId } });\n }\n /**\n * Search for places that can be attached to a Tweet via POST statuses/update.\n * This request will return a list of all the valid places that can be used as the place_id when updating a status.\n * https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-search\n */\n geoSearch(options) {\n return this.get('geo/search.json', options);\n }\n /**\n * Given a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status.\n * This request is an informative call and will deliver generalized results about geography.\n * https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-reverse_geocode\n */\n geoReverseGeoCode(options) {\n return this.get('geo/reverse_geocode.json', options);\n }\n /* Developer utilities */\n /**\n * Returns the current rate limits for methods belonging to the specified resource families.\n * Each API resource belongs to a \"resource family\" which is indicated in its method documentation.\n * The method's resource family can be determined from the first component of the path after the resource version.\n * https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status\n */\n rateLimitStatuses(...resources) {\n return this.get('application/rate_limit_status.json', { resources });\n }\n /**\n * Returns the list of languages supported by Twitter along with the language code supported by Twitter.\n * https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages\n */\n supportedLanguages() {\n return this.get('help/languages.json');\n }\n}\nexports.default = TwitterApiv1ReadOnly;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globals_1 = require(\"../globals\");\nconst client_v1_read_1 = __importDefault(require(\"./client.v1.read\"));\nconst types_1 = require(\"../types\");\nconst fs = __importStar(require(\"fs\"));\nconst media_helpers_v1_1 = require(\"./media-helpers.v1\");\nconst helpers_1 = require(\"../helpers\");\nconst UPLOAD_ENDPOINT = 'media/upload.json';\n/**\n * Base Twitter v1 client with read/write rights.\n */\nclass TwitterApiv1ReadWrite extends client_v1_read_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V1_1_PREFIX;\n }\n /**\n * Get a client with only read rights.\n */\n get readOnly() {\n return this;\n }\n /* Tweet API */\n /**\n * Post a new tweet.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n tweet(status, payload = {}) {\n const queryParams = {\n status,\n tweet_mode: 'extended',\n ...payload,\n };\n return this.post('statuses/update.json', queryParams);\n }\n /**\n * Quote an existing tweet.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n async quote(status, quotingStatusId, payload = {}) {\n const url = 'https://twitter.com/i/statuses/' + quotingStatusId;\n return this.tweet(status, { ...payload, attachment_url: url });\n }\n /**\n * Post a series of tweets.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n async tweetThread(tweets) {\n const postedTweets = [];\n for (const tweet of tweets) {\n // Retrieve the last sent tweet\n const lastTweet = postedTweets.length ? postedTweets[postedTweets.length - 1] : null;\n // Build the tweet query params\n const queryParams = { ...(typeof tweet === 'string' ? ({ status: tweet }) : tweet) };\n // Reply to an existing tweet if needed\n const inReplyToId = lastTweet ? lastTweet.id_str : queryParams.in_reply_to_status_id;\n const status = queryParams.status;\n if (inReplyToId) {\n postedTweets.push(await this.reply(status, inReplyToId, queryParams));\n }\n else {\n postedTweets.push(await this.tweet(status, queryParams));\n }\n }\n return postedTweets;\n }\n /**\n * Reply to an existing tweet. Shortcut to `.tweet` with tweaked parameters.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n reply(status, in_reply_to_status_id, payload = {}) {\n return this.tweet(status, {\n auto_populate_reply_metadata: true,\n in_reply_to_status_id,\n ...payload,\n });\n }\n /**\n * Delete an existing tweet belonging to you.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id\n */\n deleteTweet(tweetId) {\n return this.post('statuses/destroy/:id.json', { tweet_mode: 'extended' }, { params: { id: tweetId } });\n }\n /* User API */\n /**\n * Report the specified user as a spam account to Twitter.\n * Additionally, optionally performs the equivalent of POST blocks/create on behalf of the authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-users-report_spam\n */\n reportUserAsSpam(options) {\n return this.post('users/report_spam.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Turn on/off Retweets and device notifications from the specified user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-update\n */\n updateFriendship(options) {\n return this.post('friendships/update.json', options);\n }\n /* Account API */\n /**\n * Update current account settings for authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings\n */\n updateAccountSettings(options) {\n return this.post('account/settings.json', options);\n }\n /**\n * Sets some values that users are able to set under the \"Account\" tab of their settings page.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile\n */\n updateAccountProfile(options) {\n return this.post('account/update_profile.json', options);\n }\n /**\n * Uploads a profile banner on behalf of the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner\n */\n async updateAccountProfileBanner(file, options = {}) {\n const queryParams = {\n banner: await (0, media_helpers_v1_1.readFileIntoBuffer)(file),\n ...options,\n };\n return this.post('account/update_profile_banner.json', queryParams, { forceBodyMode: 'form-data' });\n }\n /**\n * Updates the authenticating user's profile image.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image\n */\n async updateAccountProfileImage(file, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n image: await (0, media_helpers_v1_1.readFileIntoBuffer)(file),\n ...options,\n };\n return this.post('account/update_profile_image.json', queryParams, { forceBodyMode: 'form-data' });\n }\n /**\n * Removes the uploaded profile banner for the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-remove_profile_banner\n */\n removeAccountProfileBanner() {\n return this.post('account/remove_profile_banner.json');\n }\n /* Lists */\n /**\n * Creates a new list for the authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create\n */\n createList(options) {\n return this.post('lists/create.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Updates the specified list. The authenticated user must own the list to be able to update it.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-update\n */\n updateList(options) {\n return this.post('lists/update.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Deletes the specified list. The authenticated user must own the list to be able to destroy it.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy\n */\n removeList(options) {\n return this.post('lists/destroy.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.\n * If you add a single `user_id` or `screen_name`, it will target `lists/members/create.json`, otherwise\n * it will target `lists/members/create_all.json`.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create_all\n */\n addListMembers(options) {\n const hasMultiple = (options.user_id && (0, helpers_1.hasMultipleItems)(options.user_id)) || (options.screen_name && (0, helpers_1.hasMultipleItems)(options.screen_name));\n const endpoint = hasMultiple ? 'lists/members/create_all.json' : 'lists/members/create.json';\n return this.post(endpoint, options);\n }\n /**\n * Removes multiple members to a list, by specifying a comma-separated list of member ids or screen names.\n * If you add a single `user_id` or `screen_name`, it will target `lists/members/destroy.json`, otherwise\n * it will target `lists/members/destroy_all.json`.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all\n */\n removeListMembers(options) {\n const hasMultiple = (options.user_id && (0, helpers_1.hasMultipleItems)(options.user_id)) || (options.screen_name && (0, helpers_1.hasMultipleItems)(options.screen_name));\n const endpoint = hasMultiple ? 'lists/members/destroy_all.json' : 'lists/members/destroy.json';\n return this.post(endpoint, options);\n }\n /**\n * Subscribes the authenticated user to the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create\n */\n subscribeToList(options) {\n return this.post('lists/subscribers/create.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Unsubscribes the authenticated user of the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy\n */\n unsubscribeOfList(options) {\n return this.post('lists/subscribers/destroy.json', { tweet_mode: 'extended', ...options });\n }\n /* Media upload API */\n /**\n * This endpoint can be used to provide additional information about the uploaded media_id.\n * This feature is currently only supported for images and GIFs.\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-metadata-create\n */\n createMediaMetadata(mediaId, metadata) {\n return this.post('media/metadata/create.json', { media_id: mediaId, ...metadata }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX, forceBodyMode: 'json' });\n }\n /**\n * Use this endpoint to associate uploaded subtitles to an uploaded video. You can associate subtitles to video before or after Tweeting.\n * **To obtain subtitle media ID, you must upload each subtitle file separately using `.uploadMedia()` method.**\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-create\n */\n createMediaSubtitles(mediaId, subtitles) {\n return this.post('media/subtitles/create.json', { media_id: mediaId, media_category: 'TweetVideo', subtitle_info: { subtitles } }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX, forceBodyMode: 'json' });\n }\n /**\n * Use this endpoint to dissociate subtitles from a video and delete the subtitles. You can dissociate subtitles from a video before or after Tweeting.\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-delete\n */\n deleteMediaSubtitles(mediaId, ...languages) {\n return this.post('media/subtitles/delete.json', {\n media_id: mediaId,\n media_category: 'TweetVideo',\n subtitle_info: { subtitles: languages.map(lang => ({ language_code: lang })) },\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX, forceBodyMode: 'json' });\n }\n /**\n * Upload a media (JPG/PNG/GIF/MP4/WEBP) or subtitle (SRT) to Twitter and return the media_id to use in tweet/DM send.\n *\n * @param file If `string`, filename is supposed.\n * A `Buffer` is a raw file.\n * `fs.promises.FileHandle` or `number` are file pointers.\n *\n * @param options.type File type (Enum 'jpg' | 'longmp4' | 'mp4' | 'png' | 'gif' | 'srt' | 'webp').\n * If filename is given, it could be guessed with file extension, otherwise this parameter is mandatory.\n * If type is not part of the enum, it will be used as mime type.\n *\n * Type `longmp4` is **required** is you try to upload a video higher than 140 seconds.\n *\n * @param options.chunkLength Maximum chunk length sent to Twitter. Default goes to 1 MB.\n *\n * @param options.additionalOwners Other user IDs allowed to use the returned media_id. Default goes to none.\n *\n * @param options.maxConcurrentUploads Maximum uploaded chunks in the same time. Default goes to 3.\n *\n * @param options.target Target type `tweet` or `dm`. Defaults to `tweet`.\n * You must specify it if you send a media to use in DMs.\n */\n async uploadMedia(file, options = {}) {\n var _a;\n const chunkLength = (_a = options.chunkLength) !== null && _a !== void 0 ? _a : (1024 * 1024);\n const { fileHandle, mediaCategory, fileSize, mimeType } = await this.getUploadMediaRequirements(file, options);\n // Get the file handle (if not buffer)\n try {\n // Finally! We can send INIT message.\n const mediaData = await this.post(UPLOAD_ENDPOINT, {\n command: 'INIT',\n total_bytes: fileSize,\n media_type: mimeType,\n media_category: mediaCategory,\n additional_owners: options.additionalOwners,\n shared: options.shared ? true : undefined,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n // Upload the media chunk by chunk\n await this.mediaChunkedUpload(fileHandle, chunkLength, mediaData.media_id_string, options.maxConcurrentUploads);\n // Finalize media\n const fullMediaData = await this.post(UPLOAD_ENDPOINT, {\n command: 'FINALIZE',\n media_id: mediaData.media_id_string,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n if (fullMediaData.processing_info && fullMediaData.processing_info.state !== 'succeeded') {\n // Must wait if video is still computed\n await this.awaitForMediaProcessingCompletion(fullMediaData);\n }\n // Video is ready, return media_id\n return fullMediaData.media_id_string;\n }\n finally {\n // Close file if any\n if (typeof file === 'number') {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n fs.close(file, () => { });\n }\n else if (typeof fileHandle === 'object' && !(fileHandle instanceof Buffer)) {\n fileHandle.close();\n }\n }\n }\n async awaitForMediaProcessingCompletion(fullMediaData) {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n fullMediaData = await this.mediaInfo(fullMediaData.media_id_string);\n const { processing_info } = fullMediaData;\n if (!processing_info || processing_info.state === 'succeeded') {\n // Ok, completed!\n return;\n }\n if (processing_info.state === 'failed') {\n if (processing_info.error) {\n const { name, message } = processing_info.error;\n throw new Error(`Failed to process media: ${name} - ${message}.`);\n }\n throw new Error('Failed to process the media.');\n }\n if (processing_info.check_after_secs) {\n // Await for given seconds\n await (0, media_helpers_v1_1.sleepSecs)(processing_info.check_after_secs);\n }\n else {\n // No info; Await for 5 seconds\n await (0, media_helpers_v1_1.sleepSecs)(5);\n }\n }\n }\n async getUploadMediaRequirements(file, { mimeType, type, target, longVideo } = {}) {\n // Get the file handle (if not buffer)\n let fileHandle;\n try {\n fileHandle = await (0, media_helpers_v1_1.getFileHandle)(file);\n // Get the mimetype\n const realMimeType = (0, media_helpers_v1_1.getMimeType)(file, type, mimeType);\n // Get the media category\n let mediaCategory;\n // If explicit longmp4 OR explicit MIME type and not DM target\n if (realMimeType === types_1.EUploadMimeType.Mp4 && ((!mimeType && !type && target !== 'dm') || longVideo)) {\n mediaCategory = 'amplify_video';\n }\n else {\n mediaCategory = (0, media_helpers_v1_1.getMediaCategoryByMime)(realMimeType, target !== null && target !== void 0 ? target : 'tweet');\n }\n return {\n fileHandle,\n mediaCategory,\n fileSize: await (0, media_helpers_v1_1.getFileSizeFromFileHandle)(fileHandle),\n mimeType: realMimeType,\n };\n }\n catch (e) {\n // Close file if any\n if (typeof file === 'number') {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n fs.close(file, () => { });\n }\n else if (typeof fileHandle === 'object' && !(fileHandle instanceof Buffer)) {\n fileHandle.close();\n }\n throw e;\n }\n }\n async mediaChunkedUpload(fileHandle, chunkLength, mediaId, maxConcurrentUploads = 3) {\n // Send chunk by chunk\n let chunkIndex = 0;\n if (maxConcurrentUploads < 1) {\n throw new RangeError('Bad maxConcurrentUploads parameter.');\n }\n // Creating a buffer for doing file stuff (if we don't have one)\n const buffer = fileHandle instanceof Buffer ? undefined : Buffer.alloc(chunkLength);\n // Sliced/filled buffer returned for each part\n let readBuffer;\n // Needed to know when we should stop reading the file\n let nread;\n // Needed to use the buffer object (file handles always \"remembers\" file position)\n let offset = 0;\n [readBuffer, nread] = await (0, media_helpers_v1_1.readNextPartOf)(fileHandle, chunkLength, offset, buffer);\n offset += nread;\n // Handle max concurrent uploads\n const currentUploads = new Set();\n // Read buffer until file is completely read\n while (nread) {\n const mediaBufferPart = readBuffer.slice(0, nread);\n // Sent part if part has something inside\n if (mediaBufferPart.length) {\n const request = this.post(UPLOAD_ENDPOINT, {\n command: 'APPEND',\n media_id: mediaId,\n segment_index: chunkIndex,\n media: mediaBufferPart,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n currentUploads.add(request);\n request.then(() => {\n currentUploads.delete(request);\n });\n chunkIndex++;\n }\n if (currentUploads.size >= maxConcurrentUploads) {\n // Await for first promise to be finished\n await Promise.race(currentUploads);\n }\n [readBuffer, nread] = await (0, media_helpers_v1_1.readNextPartOf)(fileHandle, chunkLength, offset, buffer);\n offset += nread;\n }\n await Promise.all([...currentUploads]);\n }\n}\nexports.default = TwitterApiv1ReadWrite;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.readNextPartOf = exports.sleepSecs = exports.getMediaCategoryByMime = exports.getMimeType = exports.getFileSizeFromFileHandle = exports.getFileHandle = exports.readFileIntoBuffer = void 0;\nconst fs = __importStar(require(\"fs\"));\nconst helpers_1 = require(\"../helpers\");\nconst types_1 = require(\"../types\");\nasync function readFileIntoBuffer(file) {\n const handle = await getFileHandle(file);\n if (typeof handle === 'number') {\n return new Promise((resolve, reject) => {\n fs.readFile(handle, (err, data) => {\n if (err) {\n return reject(err);\n }\n resolve(data);\n });\n });\n }\n else if (handle instanceof Buffer) {\n return handle;\n }\n else {\n return handle.readFile();\n }\n}\nexports.readFileIntoBuffer = readFileIntoBuffer;\nfunction getFileHandle(file) {\n if (typeof file === 'string') {\n return fs.promises.open(file, 'r');\n }\n else if (typeof file === 'number') {\n return file;\n }\n else if (typeof file === 'object' && !(file instanceof Buffer)) {\n return file;\n }\n else if (!(file instanceof Buffer)) {\n throw new Error('Given file is not valid, please check its type.');\n }\n else {\n return file;\n }\n}\nexports.getFileHandle = getFileHandle;\nasync function getFileSizeFromFileHandle(fileHandle) {\n // Get the file size\n if (typeof fileHandle === 'number') {\n const stats = await new Promise((resolve, reject) => {\n fs.fstat(fileHandle, (err, stats) => {\n if (err)\n reject(err);\n resolve(stats);\n });\n });\n return stats.size;\n }\n else if (fileHandle instanceof Buffer) {\n return fileHandle.length;\n }\n else {\n return (await fileHandle.stat()).size;\n }\n}\nexports.getFileSizeFromFileHandle = getFileSizeFromFileHandle;\nfunction getMimeType(file, type, mimeType) {\n if (typeof mimeType === 'string') {\n return mimeType;\n }\n else if (typeof file === 'string' && !type) {\n return getMimeByName(file);\n }\n else if (typeof type === 'string') {\n return getMimeByType(type);\n }\n throw new Error('You must specify type if file is a file handle or Buffer.');\n}\nexports.getMimeType = getMimeType;\nfunction getMimeByName(name) {\n if (name.endsWith('.jpeg') || name.endsWith('.jpg'))\n return types_1.EUploadMimeType.Jpeg;\n if (name.endsWith('.png'))\n return types_1.EUploadMimeType.Png;\n if (name.endsWith('.webp'))\n return types_1.EUploadMimeType.Webp;\n if (name.endsWith('.gif'))\n return types_1.EUploadMimeType.Gif;\n if (name.endsWith('.mpeg4') || name.endsWith('.mp4'))\n return types_1.EUploadMimeType.Mp4;\n if (name.endsWith('.srt'))\n return types_1.EUploadMimeType.Srt;\n (0, helpers_1.safeDeprecationWarning)({\n instance: 'TwitterApiv1ReadWrite',\n method: 'uploadMedia',\n problem: `options.mimeType is missing and filename couldn't help to resolve MIME type, so it will fallback to image/jpeg`,\n resolution: `If you except to give filenames without extensions, please specify explicitlty the MIME type using options.mimeType`,\n });\n return types_1.EUploadMimeType.Jpeg;\n}\nfunction getMimeByType(type) {\n (0, helpers_1.safeDeprecationWarning)({\n instance: 'TwitterApiv1ReadWrite',\n method: 'uploadMedia',\n problem: `you're using options.type`,\n resolution: `Remove options.type argument and migrate to options.mimeType which takes the real MIME type. ` +\n `If you're using type=longmp4, add options.longVideo alongside of mimeType=EUploadMimeType.Mp4`,\n });\n if (type === 'gif')\n return types_1.EUploadMimeType.Gif;\n if (type === 'jpg')\n return types_1.EUploadMimeType.Jpeg;\n if (type === 'png')\n return types_1.EUploadMimeType.Png;\n if (type === 'webp')\n return types_1.EUploadMimeType.Webp;\n if (type === 'srt')\n return types_1.EUploadMimeType.Srt;\n if (type === 'mp4' || type === 'longmp4')\n return types_1.EUploadMimeType.Mp4;\n return type;\n}\nfunction getMediaCategoryByMime(name, target) {\n if (name === types_1.EUploadMimeType.Mp4)\n return target === 'tweet' ? 'TweetVideo' : 'DmVideo';\n if (name === types_1.EUploadMimeType.Gif)\n return target === 'tweet' ? 'TweetGif' : 'DmGif';\n if (name === types_1.EUploadMimeType.Srt)\n return 'Subtitles';\n else\n return target === 'tweet' ? 'TweetImage' : 'DmImage';\n}\nexports.getMediaCategoryByMime = getMediaCategoryByMime;\nfunction sleepSecs(seconds) {\n return new Promise(resolve => setTimeout(resolve, seconds * 1000));\n}\nexports.sleepSecs = sleepSecs;\nasync function readNextPartOf(file, chunkLength, bufferOffset = 0, buffer) {\n if (file instanceof Buffer) {\n const rt = file.slice(bufferOffset, bufferOffset + chunkLength);\n return [rt, rt.length];\n }\n if (!buffer) {\n throw new Error('Well, we will need a buffer to store file content.');\n }\n let bytesRead;\n if (typeof file === 'number') {\n bytesRead = await new Promise((resolve, reject) => {\n fs.read(file, buffer, 0, chunkLength, bufferOffset, (err, nread) => {\n if (err)\n reject(err);\n resolve(nread);\n });\n });\n }\n else {\n const res = await file.read(buffer, 0, chunkLength, bufferOffset);\n bytesRead = res.bytesRead;\n }\n return [buffer, bytesRead];\n}\nexports.readNextPartOf = readNextPartOf;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiv2Labs = void 0;\nconst globals_1 = require(\"../globals\");\nconst client_v2_labs_write_1 = __importDefault(require(\"./client.v2.labs.write\"));\n/**\n * Twitter v2 labs client with all rights (read/write/DMs)\n */\nclass TwitterApiv2Labs extends client_v2_labs_write_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_LABS_PREFIX;\n }\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n}\nexports.TwitterApiv2Labs = TwitterApiv2Labs;\nexports.default = TwitterApiv2Labs;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_subclient_1 = __importDefault(require(\"../client.subclient\"));\nconst globals_1 = require(\"../globals\");\n/**\n * Base Twitter v2 labs client with only read right.\n */\nclass TwitterApiv2LabsReadOnly extends client_subclient_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_LABS_PREFIX;\n }\n}\nexports.default = TwitterApiv2LabsReadOnly;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globals_1 = require(\"../globals\");\nconst client_v2_labs_read_1 = __importDefault(require(\"./client.v2.labs.read\"));\n/**\n * Base Twitter v2 labs client with read/write rights.\n */\nclass TwitterApiv2LabsReadWrite extends client_v2_labs_read_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_LABS_PREFIX;\n }\n /**\n * Get a client with only read rights.\n */\n get readOnly() {\n return this;\n }\n}\nexports.default = TwitterApiv2LabsReadWrite;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiv2 = void 0;\nconst globals_1 = require(\"../globals\");\nconst client_v2_write_1 = __importDefault(require(\"./client.v2.write\"));\nconst client_v2_labs_1 = __importDefault(require(\"../v2-labs/client.v2.labs\"));\n/**\n * Twitter v2 client with all rights (read/write/DMs)\n */\nclass TwitterApiv2 extends client_v2_write_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_PREFIX;\n }\n /* Sub-clients */\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n /**\n * Get a client for v2 labs endpoints.\n */\n get labs() {\n if (this._labs)\n return this._labs;\n return this._labs = new client_v2_labs_1.default(this);\n }\n}\nexports.TwitterApiv2 = TwitterApiv2;\nexports.default = TwitterApiv2;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_subclient_1 = __importDefault(require(\"../client.subclient\"));\nconst globals_1 = require(\"../globals\");\nconst paginators_1 = require(\"../paginators\");\nconst client_v2_labs_read_1 = __importDefault(require(\"../v2-labs/client.v2.labs.read\"));\nconst user_paginator_v2_1 = require(\"../paginators/user.paginator.v2\");\nconst helpers_1 = require(\"../helpers\");\n/**\n * Base Twitter v2 client with only read right.\n */\nclass TwitterApiv2ReadOnly extends client_subclient_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_PREFIX;\n }\n /* Sub-clients */\n /**\n * Get a client for v2 labs endpoints.\n */\n get labs() {\n if (this._labs)\n return this._labs;\n return this._labs = new client_v2_labs_read_1.default(this);\n }\n async search(queryOrOptions, options = {}) {\n const query = typeof queryOrOptions === 'string' ? queryOrOptions : undefined;\n const realOptions = typeof queryOrOptions === 'object' && queryOrOptions !== null ? queryOrOptions : options;\n const queryParams = { ...realOptions, query };\n const initialRq = await this.get('tweets/search/recent', queryParams, { fullResponse: true });\n return new paginators_1.TweetSearchRecentV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * The full-archive search endpoint returns the complete history of public Tweets matching a search query;\n * since the first Tweet was created March 26, 2006.\n *\n * This endpoint is only available to those users who have been approved for the Academic Research product track.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all\n */\n async searchAll(query, options = {}) {\n const queryParams = { ...options, query };\n const initialRq = await this.get('tweets/search/all', queryParams, { fullResponse: true });\n return new paginators_1.TweetSearchAllV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a variety of information about a single Tweet specified by the requested ID.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id\n *\n * OAuth2 scope: `users.read`, `tweet.read`\n */\n singleTweet(tweetId, options = {}) {\n return this.get('tweets/:id', options, { params: { id: tweetId } });\n }\n /**\n * Returns a variety of information about tweets specified by list of IDs.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets\n *\n * OAuth2 scope: `users.read`, `tweet.read`\n */\n tweets(tweetIds, options = {}) {\n return this.get('tweets', { ids: tweetIds, ...options });\n }\n /**\n * The recent Tweet counts endpoint returns count of Tweets from the last seven days that match a search query.\n * OAuth2 Bearer auth only.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent\n */\n tweetCountRecent(query, options = {}) {\n return this.get('tweets/counts/recent', { query, ...options });\n }\n /**\n * This endpoint is only available to those users who have been approved for the Academic Research product track.\n * The full-archive search endpoint returns the complete history of public Tweets matching a search query;\n * since the first Tweet was created March 26, 2006.\n * OAuth2 Bearer auth only.\n * **This endpoint has pagination, yet it is not supported by bundled paginators. Use `next_token` to fetch next page.**\n * https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all\n */\n tweetCountAll(query, options = {}) {\n return this.get('tweets/counts/all', { query, ...options });\n }\n async tweetRetweetedBy(tweetId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const initialRq = await this.get('tweets/:id/retweeted_by', parameters, {\n fullResponse: true,\n params: { id: tweetId },\n });\n if (!asPaginator) {\n return initialRq.data;\n }\n return new user_paginator_v2_1.TweetRetweetersUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: { id: tweetId },\n });\n }\n async tweetLikedBy(tweetId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const initialRq = await this.get('tweets/:id/liking_users', parameters, {\n fullResponse: true,\n params: { id: tweetId },\n });\n if (!asPaginator) {\n return initialRq.data;\n }\n return new user_paginator_v2_1.TweetLikingUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: { id: tweetId },\n });\n }\n /**\n * Allows you to retrieve a collection of the most recent Tweets and Retweets posted by you and users you follow, also known as home timeline.\n * This endpoint returns up to the last 3200 Tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-reverse-chronological\n *\n * OAuth 2 scopes: `tweet.read` `users.read`\n */\n async homeTimeline(options = {}) {\n const meUser = await this.getCurrentUserV2Object();\n const initialRq = await this.get('users/:id/timelines/reverse_chronological', options, {\n fullResponse: true,\n params: { id: meUser.data.id },\n });\n return new paginators_1.TweetHomeTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: meUser.data.id },\n });\n }\n /**\n * Returns Tweets composed by a single user, specified by the requested user ID.\n * By default, the most recent ten Tweets are returned per request.\n * Using pagination, the most recent 3,200 Tweets can be retrieved.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets\n */\n async userTimeline(userId, options = {}) {\n const initialRq = await this.get('users/:id/tweets', options, {\n fullResponse: true,\n params: { id: userId },\n });\n return new paginators_1.TweetUserTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: userId },\n });\n }\n /**\n * Returns Tweets mentioning a single user specified by the requested user ID.\n * By default, the most recent ten Tweets are returned per request.\n * Using pagination, up to the most recent 800 Tweets can be retrieved.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions\n */\n async userMentionTimeline(userId, options = {}) {\n const initialRq = await this.get('users/:id/mentions', options, {\n fullResponse: true,\n params: { id: userId },\n });\n return new paginators_1.TweetUserMentionTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: userId },\n });\n }\n /**\n * Returns Quote Tweets for a Tweet specified by the requested Tweet ID.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/quote-tweets/api-reference/get-tweets-id-quote_tweets\n *\n * OAuth2 scopes: `users.read` `tweet.read`\n */\n async quotes(tweetId, options = {}) {\n const initialRq = await this.get('tweets/:id/quote_tweets', options, {\n fullResponse: true,\n params: { id: tweetId },\n });\n return new paginators_1.QuotedTweetsTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: tweetId },\n });\n }\n /* Bookmarks */\n /**\n * Allows you to get information about a authenticated user’s 800 most recent bookmarked Tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/get-users-id-bookmarks\n *\n * OAuth2 scopes: `users.read` `tweet.read` `bookmark.read`\n */\n async bookmarks(options = {}) {\n const user = await this.getCurrentUserV2Object();\n const initialRq = await this.get('users/:id/bookmarks', options, {\n fullResponse: true,\n params: { id: user.data.id },\n });\n return new paginators_1.TweetBookmarksTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: user.data.id },\n });\n }\n /* Users */\n /**\n * Returns information about an authorized user.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me\n *\n * OAuth2 scopes: `tweet.read` & `users.read`\n */\n me(options = {}) {\n return this.get('users/me', options);\n }\n /**\n * Returns a variety of information about a single user specified by the requested ID.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id\n */\n user(userId, options = {}) {\n return this.get('users/:id', options, { params: { id: userId } });\n }\n /**\n * Returns a variety of information about one or more users specified by the requested IDs.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users\n */\n users(userIds, options = {}) {\n const ids = Array.isArray(userIds) ? userIds.join(',') : userIds;\n return this.get('users', { ...options, ids });\n }\n /**\n * Returns a variety of information about a single user specified by their username.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username\n */\n userByUsername(username, options = {}) {\n return this.get('users/by/username/:username', options, { params: { username } });\n }\n /**\n * Returns a variety of information about one or more users specified by their usernames.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by\n *\n * OAuth2 scope: `users.read`, `tweet.read`\n */\n usersByUsernames(usernames, options = {}) {\n usernames = Array.isArray(usernames) ? usernames.join(',') : usernames;\n return this.get('users/by', { ...options, usernames });\n }\n async followers(userId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const params = { id: userId };\n if (!asPaginator) {\n return this.get('users/:id/followers', parameters, { params });\n }\n const initialRq = await this.get('users/:id/followers', parameters, { fullResponse: true, params });\n return new user_paginator_v2_1.UserFollowersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: params,\n });\n }\n async following(userId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const params = { id: userId };\n if (!asPaginator) {\n return this.get('users/:id/following', parameters, { params });\n }\n const initialRq = await this.get('users/:id/following', parameters, { fullResponse: true, params });\n return new user_paginator_v2_1.UserFollowingV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: params,\n });\n }\n /**\n * Allows you to get information about a user’s liked Tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/get-users-id-liked_tweets\n */\n async userLikedTweets(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/liked_tweets', options, { fullResponse: true, params });\n return new paginators_1.TweetV2UserLikedTweetsPaginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are blocked by the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking\n */\n async userBlockingUsers(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/blocking', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserBlockingUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are muted by the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/get-users-muting\n */\n async userMutingUsers(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/muting', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserMutingUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /* Lists */\n /**\n * Returns the details of a specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id\n */\n list(id, options = {}) {\n return this.get('lists/:id', options, { params: { id } });\n }\n /**\n * Returns all Lists owned by the specified user.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-users-id-owned_lists\n */\n async listsOwned(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/owned_lists', options, { fullResponse: true, params });\n return new paginators_1.UserOwnedListsV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns all Lists a specified user is a member of.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-users-id-list_memberships\n */\n async listMemberships(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/list_memberships', options, { fullResponse: true, params });\n return new paginators_1.UserListMembershipsV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns all Lists a specified user follows.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-users-id-followed_lists\n */\n async listFollowed(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/followed_lists', options, { fullResponse: true, params });\n return new paginators_1.UserListFollowedV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of Tweets from the specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-tweets/api-reference/get-lists-id-tweets\n */\n async listTweets(listId, options = {}) {\n const params = { id: listId };\n const initialRq = await this.get('lists/:id/tweets', options, { fullResponse: true, params });\n return new paginators_1.TweetV2ListTweetsPaginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are members of the specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-lists-id-members\n */\n async listMembers(listId, options = {}) {\n const params = { id: listId };\n const initialRq = await this.get('lists/:id/members', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserListMembersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are followers of the specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-lists-id-followers\n */\n async listFollowers(listId, options = {}) {\n const params = { id: listId };\n const initialRq = await this.get('lists/:id/followers', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserListFollowersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /* Spaces */\n /**\n * Get a single space by ID.\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n space(spaceId, options = {}) {\n return this.get('spaces/:id', options, { params: { id: spaceId } });\n }\n /**\n * Get spaces using their IDs.\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n spaces(spaceIds, options = {}) {\n return this.get('spaces', { ids: spaceIds, ...options });\n }\n /**\n * Get spaces using their creator user ID(s). (no pagination available)\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n spacesByCreators(creatorIds, options = {}) {\n return this.get('spaces/by/creator_ids', { user_ids: creatorIds, ...options });\n }\n /**\n * Search through spaces using multiple params. (no pagination available)\n * https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search\n */\n searchSpaces(options) {\n return this.get('spaces/search', options);\n }\n /**\n * Returns a list of user who purchased a ticket to the requested Space.\n * You must authenticate the request using the Access Token of the creator of the requested Space.\n *\n * **OAuth 2.0 Access Token required**\n *\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-buyers\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n spaceBuyers(spaceId, options = {}) {\n return this.get('spaces/:id/buyers', options, { params: { id: spaceId } });\n }\n searchStream({ autoConnect, ...options } = {}) {\n return this.getStream('tweets/search/stream', options, { payloadIsError: helpers_1.isTweetStreamV2ErrorPayload, autoConnect });\n }\n /**\n * Return a list of rules currently active on the streaming endpoint, either as a list or individually.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules\n */\n streamRules(options = {}) {\n return this.get('tweets/search/stream/rules', options);\n }\n updateStreamRules(options, query = {}) {\n return this.post('tweets/search/stream/rules', options, { query });\n }\n sampleStream({ autoConnect, ...options } = {}) {\n return this.getStream('tweets/sample/stream', options, { payloadIsError: helpers_1.isTweetStreamV2ErrorPayload, autoConnect });\n }\n /* Batch compliance */\n /**\n * Returns a list of recent compliance jobs.\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs\n */\n complianceJobs(options) {\n return this.get('compliance/jobs', options);\n }\n /**\n * Get a single compliance job with the specified ID.\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs-id\n */\n complianceJob(jobId) {\n return this.get('compliance/jobs/:id', undefined, { params: { id: jobId } });\n }\n /**\n * Creates a new compliance job for Tweet IDs or user IDs, send your file, await result and parse it into an array.\n * You can run one batch job at a time. Returns the created job, but **not the job result!**.\n *\n * You can obtain the result (**after job is completed**) with `.complianceJobResult`.\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs\n */\n async sendComplianceJob(jobParams) {\n const job = await this.post('compliance/jobs', { type: jobParams.type, name: jobParams.name });\n // Send the IDs\n const rawIdsBody = jobParams.ids instanceof Buffer ? jobParams.ids : Buffer.from(jobParams.ids.join('\\n'));\n // Upload the IDs\n await this.put(job.data.upload_url, rawIdsBody, {\n forceBodyMode: 'raw',\n enableAuth: false,\n headers: { 'Content-Type': 'text/plain' },\n prefix: '',\n });\n return job;\n }\n /**\n * Get the result of a running or completed job, obtained through `.complianceJob`, `.complianceJobs` or `.sendComplianceJob`.\n * If job is still running (`in_progress`), it will await until job is completed. **This could be quite long!**\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs\n */\n async complianceJobResult(job) {\n let runningJob = job;\n while (runningJob.status !== 'complete') {\n if (runningJob.status === 'expired' || runningJob.status === 'failed') {\n throw new Error('Job failed to be completed.');\n }\n await new Promise(resolve => setTimeout(resolve, 3500));\n runningJob = (await this.complianceJob(job.id)).data;\n }\n // Download and parse result\n const result = await this.get(job.download_url, undefined, {\n enableAuth: false,\n prefix: '',\n });\n return result\n .trim()\n .split('\\n')\n .filter(line => line)\n .map(line => JSON.parse(line));\n }\n}\nexports.default = TwitterApiv2ReadOnly;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globals_1 = require(\"../globals\");\nconst client_v2_read_1 = __importDefault(require(\"./client.v2.read\"));\nconst client_v2_labs_write_1 = __importDefault(require(\"../v2-labs/client.v2.labs.write\"));\n/**\n * Base Twitter v2 client with read/write rights.\n */\nclass TwitterApiv2ReadWrite extends client_v2_read_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_PREFIX;\n }\n /* Sub-clients */\n /**\n * Get a client with only read rights.\n */\n get readOnly() {\n return this;\n }\n /**\n * Get a client for v2 labs endpoints.\n */\n get labs() {\n if (this._labs)\n return this._labs;\n return this._labs = new client_v2_labs_write_1.default(this);\n }\n /* Tweets */\n /**\n * Hides or unhides a reply to a Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/hide-replies/api-reference/put-tweets-id-hidden\n */\n hideReply(tweetId, makeHidden) {\n return this.put('tweets/:id/hidden', { hidden: makeHidden }, { params: { id: tweetId } });\n }\n /**\n * Causes the user ID identified in the path parameter to Like the target Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-user_id-likes\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n like(loggedUserId, targetTweetId) {\n return this.post('users/:id/likes', { tweet_id: targetTweetId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user or authenticated user ID to unlike a Tweet.\n * The request succeeds with no action when the user sends a request to a user they're not liking the Tweet or have already unliked the Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/delete-users-id-likes-tweet_id\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unlike(loggedUserId, targetTweetId) {\n return this.delete('users/:id/likes/:tweet_id', undefined, {\n params: { id: loggedUserId, tweet_id: targetTweetId },\n });\n }\n /**\n * Causes the user ID identified in the path parameter to Retweet the target Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n retweet(loggedUserId, targetTweetId) {\n return this.post('users/:id/retweets', { tweet_id: targetTweetId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user or authenticated user ID to remove the Retweet of a Tweet.\n * The request succeeds with no action when the user sends a request to a user they're not Retweeting the Tweet or have already removed the Retweet of.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/delete-users-id-retweets-tweet_id\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unretweet(loggedUserId, targetTweetId) {\n return this.delete('users/:id/retweets/:tweet_id', undefined, {\n params: { id: loggedUserId, tweet_id: targetTweetId },\n });\n }\n tweet(status, payload = {}) {\n if (typeof status === 'object') {\n payload = status;\n }\n else {\n payload = { text: status, ...payload };\n }\n return this.post('tweets', payload);\n }\n /**\n * Reply to a Tweet on behalf of an authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets\n */\n reply(status, toTweetId, payload = {}) {\n var _a;\n const reply = { in_reply_to_tweet_id: toTweetId, ...(_a = payload.reply) !== null && _a !== void 0 ? _a : {} };\n return this.post('tweets', { text: status, ...payload, reply });\n }\n /**\n * Quote an existing Tweet on behalf of an authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets\n */\n quote(status, quotedTweetId, payload = {}) {\n return this.tweet(status, { ...payload, quote_tweet_id: quotedTweetId });\n }\n /**\n * Post a series of tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets\n */\n async tweetThread(tweets) {\n var _a, _b;\n const postedTweets = [];\n for (const tweet of tweets) {\n // Retrieve the last sent tweet\n const lastTweet = postedTweets.length ? postedTweets[postedTweets.length - 1] : null;\n // Build the tweet query params\n const queryParams = { ...(typeof tweet === 'string' ? ({ text: tweet }) : tweet) };\n // Reply to an existing tweet if needed\n const inReplyToId = lastTweet ? lastTweet.data.id : (_a = queryParams.reply) === null || _a === void 0 ? void 0 : _a.in_reply_to_tweet_id;\n const status = (_b = queryParams.text) !== null && _b !== void 0 ? _b : '';\n if (inReplyToId) {\n postedTweets.push(await this.reply(status, inReplyToId, queryParams));\n }\n else {\n postedTweets.push(await this.tweet(status, queryParams));\n }\n }\n return postedTweets;\n }\n /**\n * Allows a user or authenticated user ID to delete a Tweet\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id\n */\n deleteTweet(tweetId) {\n return this.delete('tweets/:id', undefined, {\n params: {\n id: tweetId,\n },\n });\n }\n /* Bookmarks */\n /**\n * Causes the user ID of an authenticated user identified in the path parameter to Bookmark the target Tweet provided in the request body.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/post-users-id-bookmarks\n *\n * OAuth2 scopes: `users.read` `tweet.read` `bookmark.write`\n */\n async bookmark(tweetId) {\n const user = await this.getCurrentUserV2Object();\n return this.post('users/:id/bookmarks', { tweet_id: tweetId }, { params: { id: user.data.id } });\n }\n /**\n * Allows a user or authenticated user ID to remove a Bookmark of a Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/delete-users-id-bookmarks-tweet_id\n *\n * OAuth2 scopes: `users.read` `tweet.read` `bookmark.write`\n */\n async deleteBookmark(tweetId) {\n const user = await this.getCurrentUserV2Object();\n return this.delete('users/:id/bookmarks/:tweet_id', undefined, { params: { id: user.data.id, tweet_id: tweetId } });\n }\n /* Users */\n /**\n * Allows a user ID to follow another user.\n * If the target user does not have public Tweets, this endpoint will send a follow request.\n * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following\n *\n * OAuth2 scope: `follows.write`\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n follow(loggedUserId, targetUserId) {\n return this.post('users/:id/following', { target_user_id: targetUserId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user ID to unfollow another user.\n * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/delete-users-source_id-following\n *\n * OAuth2 scope: `follows.write`\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unfollow(loggedUserId, targetUserId) {\n return this.delete('users/:source_user_id/following/:target_user_id', undefined, {\n params: { source_user_id: loggedUserId, target_user_id: targetUserId },\n });\n }\n /**\n * Causes the user (in the path) to block the target user.\n * The user (in the path) must match the user context authorizing the request.\n * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/post-users-user_id-blocking\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n block(loggedUserId, targetUserId) {\n return this.post('users/:id/blocking', { target_user_id: targetUserId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user or authenticated user ID to unblock another user.\n * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/delete-users-user_id-blocking\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unblock(loggedUserId, targetUserId) {\n return this.delete('users/:source_user_id/blocking/:target_user_id', undefined, {\n params: { source_user_id: loggedUserId, target_user_id: targetUserId },\n });\n }\n /**\n * Allows an authenticated user ID to mute the target user.\n * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/post-users-user_id-muting\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n mute(loggedUserId, targetUserId) {\n return this.post('users/:id/muting', { target_user_id: targetUserId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows an authenticated user ID to unmute the target user.\n * The request succeeds with no action when the user sends a request to a user they're not muting or have already unmuted.\n * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/delete-users-user_id-muting\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unmute(loggedUserId, targetUserId) {\n return this.delete('users/:source_user_id/muting/:target_user_id', undefined, {\n params: { source_user_id: loggedUserId, target_user_id: targetUserId },\n });\n }\n /* Lists */\n /**\n * Creates a new list for the authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists\n */\n createList(options) {\n return this.post('lists', options);\n }\n /**\n * Updates the specified list. The authenticated user must own the list to be able to update it.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/put-lists-id\n */\n updateList(listId, options = {}) {\n return this.put('lists/:id', options, { params: { id: listId } });\n }\n /**\n * Deletes the specified list. The authenticated user must own the list to be able to destroy it.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id\n */\n removeList(listId) {\n return this.delete('lists/:id', undefined, { params: { id: listId } });\n }\n /**\n * Adds a member to a list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists-id-members\n */\n addListMember(listId, userId) {\n return this.post('lists/:id/members', { user_id: userId }, { params: { id: listId } });\n }\n /**\n * Remember a member to a list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id-members-user_id\n */\n removeListMember(listId, userId) {\n return this.delete('lists/:id/members/:user_id', undefined, { params: { id: listId, user_id: userId } });\n }\n /**\n * Subscribes the authenticated user to the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-followed-lists\n */\n subscribeToList(loggedUserId, listId) {\n return this.post('users/:id/followed_lists', { list_id: listId }, { params: { id: loggedUserId } });\n }\n /**\n * Unsubscribes the authenticated user to the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-followed-lists-list_id\n */\n unsubscribeOfList(loggedUserId, listId) {\n return this.delete('users/:id/followed_lists/:list_id', undefined, { params: { id: loggedUserId, list_id: listId } });\n }\n /**\n * Enables the authenticated user to pin a List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-pinned-lists\n */\n pinList(loggedUserId, listId) {\n return this.post('users/:id/pinned_lists', { list_id: listId }, { params: { id: loggedUserId } });\n }\n /**\n * Enables the authenticated user to unpin a List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-pinned-lists-list_id\n */\n unpinList(loggedUserId, listId) {\n return this.delete('users/:id/pinned_lists/:list_id', undefined, { params: { id: loggedUserId, list_id: listId } });\n }\n}\nexports.default = TwitterApiv2ReadWrite;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterV2IncludesHelper = void 0;\n/**\n * Provide helpers for `.includes` of a v2 API result.\n * Needed expansions for a method to work are specified (*`like this`*).\n */\nclass TwitterV2IncludesHelper {\n constructor(result) {\n this.result = result;\n }\n /* Tweets */\n get tweets() {\n return TwitterV2IncludesHelper.tweets(this.result);\n }\n static tweets(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.tweets) !== null && _b !== void 0 ? _b : [];\n }\n tweetById(id) {\n return TwitterV2IncludesHelper.tweetById(this.result, id);\n }\n static tweetById(result, id) {\n return this.tweets(result).find(tweet => tweet.id === id);\n }\n /** Retweet associated with the given tweet (*`referenced_tweets.id`*) */\n retweet(tweet) {\n return TwitterV2IncludesHelper.retweet(this.result, tweet);\n }\n /** Retweet associated with the given tweet (*`referenced_tweets.id`*) */\n static retweet(result, tweet) {\n var _a;\n const retweetIds = ((_a = tweet.referenced_tweets) !== null && _a !== void 0 ? _a : [])\n .filter(ref => ref.type === 'retweeted')\n .map(ref => ref.id);\n return this.tweets(result).find(t => retweetIds.includes(t.id));\n }\n /** Quoted tweet associated with the given tweet (*`referenced_tweets.id`*) */\n quote(tweet) {\n return TwitterV2IncludesHelper.quote(this.result, tweet);\n }\n /** Quoted tweet associated with the given tweet (*`referenced_tweets.id`*) */\n static quote(result, tweet) {\n var _a;\n const quoteIds = ((_a = tweet.referenced_tweets) !== null && _a !== void 0 ? _a : [])\n .filter(ref => ref.type === 'quoted')\n .map(ref => ref.id);\n return this.tweets(result).find(t => quoteIds.includes(t.id));\n }\n /** Tweet whose has been answered by the given tweet (*`referenced_tweets.id`*) */\n repliedTo(tweet) {\n return TwitterV2IncludesHelper.repliedTo(this.result, tweet);\n }\n /** Tweet whose has been answered by the given tweet (*`referenced_tweets.id`*) */\n static repliedTo(result, tweet) {\n var _a;\n const repliesIds = ((_a = tweet.referenced_tweets) !== null && _a !== void 0 ? _a : [])\n .filter(ref => ref.type === 'replied_to')\n .map(ref => ref.id);\n return this.tweets(result).find(t => repliesIds.includes(t.id));\n }\n /** Tweet author user object of the given tweet (*`author_id`* or *`referenced_tweets.id.author_id`*) */\n author(tweet) {\n return TwitterV2IncludesHelper.author(this.result, tweet);\n }\n /** Tweet author user object of the given tweet (*`author_id`* or *`referenced_tweets.id.author_id`*) */\n static author(result, tweet) {\n const authorId = tweet.author_id;\n return authorId ? this.users(result).find(u => u.id === authorId) : undefined;\n }\n /** Tweet author user object of the tweet answered by the given tweet (*`in_reply_to_user_id`*) */\n repliedToAuthor(tweet) {\n return TwitterV2IncludesHelper.repliedToAuthor(this.result, tweet);\n }\n /** Tweet author user object of the tweet answered by the given tweet (*`in_reply_to_user_id`*) */\n static repliedToAuthor(result, tweet) {\n const inReplyUserId = tweet.in_reply_to_user_id;\n return inReplyUserId ? this.users(result).find(u => u.id === inReplyUserId) : undefined;\n }\n /* Users */\n get users() {\n return TwitterV2IncludesHelper.users(this.result);\n }\n static users(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.users) !== null && _b !== void 0 ? _b : [];\n }\n userById(id) {\n return TwitterV2IncludesHelper.userById(this.result, id);\n }\n static userById(result, id) {\n return this.users(result).find(u => u.id === id);\n }\n /** Pinned tweet of the given user (*`pinned_tweet_id`*) */\n pinnedTweet(user) {\n return TwitterV2IncludesHelper.pinnedTweet(this.result, user);\n }\n /** Pinned tweet of the given user (*`pinned_tweet_id`*) */\n static pinnedTweet(result, user) {\n return user.pinned_tweet_id ? this.tweets(result).find(t => t.id === user.pinned_tweet_id) : undefined;\n }\n /* Medias */\n get media() {\n return TwitterV2IncludesHelper.media(this.result);\n }\n static media(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.media) !== null && _b !== void 0 ? _b : [];\n }\n /** Medias associated with the given tweet (*`attachments.media_keys`*) */\n medias(tweet) {\n return TwitterV2IncludesHelper.medias(this.result, tweet);\n }\n /** Medias associated with the given tweet (*`attachments.media_keys`*) */\n static medias(result, tweet) {\n var _a, _b;\n const keys = (_b = (_a = tweet.attachments) === null || _a === void 0 ? void 0 : _a.media_keys) !== null && _b !== void 0 ? _b : [];\n return this.media(result).filter(m => keys.includes(m.media_key));\n }\n /* Polls */\n get polls() {\n return TwitterV2IncludesHelper.polls(this.result);\n }\n static polls(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.polls) !== null && _b !== void 0 ? _b : [];\n }\n /** Poll associated with the given tweet (*`attachments.poll_ids`*) */\n poll(tweet) {\n return TwitterV2IncludesHelper.poll(this.result, tweet);\n }\n /** Poll associated with the given tweet (*`attachments.poll_ids`*) */\n static poll(result, tweet) {\n var _a, _b;\n const pollIds = (_b = (_a = tweet.attachments) === null || _a === void 0 ? void 0 : _a.poll_ids) !== null && _b !== void 0 ? _b : [];\n if (pollIds.length) {\n const pollId = pollIds[0];\n return this.polls(result).find(p => p.id === pollId);\n }\n return undefined;\n }\n /* Places */\n get places() {\n return TwitterV2IncludesHelper.places(this.result);\n }\n static places(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.places) !== null && _b !== void 0 ? _b : [];\n }\n /** Place associated with the given tweet (*`geo.place_id`*) */\n place(tweet) {\n return TwitterV2IncludesHelper.place(this.result, tweet);\n }\n /** Place associated with the given tweet (*`geo.place_id`*) */\n static place(result, tweet) {\n var _a;\n const placeId = (_a = tweet.geo) === null || _a === void 0 ? void 0 : _a.place_id;\n return placeId ? this.places(result).find(p => p.id === placeId) : undefined;\n }\n /* Lists */\n /** List owner of the given list (*`owner_id`*) */\n listOwner(list) {\n return TwitterV2IncludesHelper.listOwner(this.result, list);\n }\n /** List owner of the given list (*`owner_id`*) */\n static listOwner(result, list) {\n const creatorId = list.owner_id;\n return creatorId ? this.users(result).find(p => p.id === creatorId) : undefined;\n }\n /* Spaces */\n /** Creator of the given space (*`creator_id`*) */\n spaceCreator(space) {\n return TwitterV2IncludesHelper.spaceCreator(this.result, space);\n }\n /** Creator of the given space (*`creator_id`*) */\n static spaceCreator(result, space) {\n const creatorId = space.creator_id;\n return creatorId ? this.users(result).find(p => p.id === creatorId) : undefined;\n }\n /** Current hosts of the given space (*`host_ids`*) */\n spaceHosts(space) {\n return TwitterV2IncludesHelper.spaceHosts(this.result, space);\n }\n /** Current hosts of the given space (*`host_ids`*) */\n static spaceHosts(result, space) {\n var _a;\n const hostIds = (_a = space.host_ids) !== null && _a !== void 0 ? _a : [];\n return this.users(result).filter(u => hostIds.includes(u.id));\n }\n /** Current speakers of the given space (*`speaker_ids`*) */\n spaceSpeakers(space) {\n return TwitterV2IncludesHelper.spaceSpeakers(this.result, space);\n }\n /** Current speakers of the given space (*`speaker_ids`*) */\n static spaceSpeakers(result, space) {\n var _a;\n const speakerIds = (_a = space.speaker_ids) !== null && _a !== void 0 ? _a : [];\n return this.users(result).filter(u => speakerIds.includes(u.id));\n }\n /** Current invited users of the given space (*`invited_user_ids`*) */\n spaceInvitedUsers(space) {\n return TwitterV2IncludesHelper.spaceInvitedUsers(this.result, space);\n }\n /** Current invited users of the given space (*`invited_user_ids`*) */\n static spaceInvitedUsers(result, space) {\n var _a;\n const invitedUserIds = (_a = space.invited_user_ids) !== null && _a !== void 0 ? _a : [];\n return this.users(result).filter(u => invitedUserIds.includes(u.id));\n }\n}\nexports.TwitterV2IncludesHelper = TwitterV2IncludesHelper;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","module.exports = require(\"assert\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"tls\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(3109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/GA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;;;;;;;;;ACDA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;;;;;;;;;ACDA;AACA;AACA;;;;;;;;;ACFA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACriBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://tweet/./lib/main.js","../webpack://tweet/./lib/tweet.js","../webpack://tweet/./lib/upload-media.js","../webpack://tweet/./node_modules/@actions/core/lib/command.js","../webpack://tweet/./node_modules/@actions/core/lib/core.js","../webpack://tweet/./node_modules/@actions/core/lib/file-command.js","../webpack://tweet/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://tweet/./node_modules/@actions/core/lib/path-utils.js","../webpack://tweet/./node_modules/@actions/core/lib/summary.js","../webpack://tweet/./node_modules/@actions/core/lib/utils.js","../webpack://tweet/./node_modules/@actions/http-client/lib/auth.js","../webpack://tweet/./node_modules/@actions/http-client/lib/index.js","../webpack://tweet/./node_modules/@actions/http-client/lib/proxy.js","../webpack://tweet/./node_modules/dotenv/config.js","../webpack://tweet/./node_modules/dotenv/lib/cli-options.js","../webpack://tweet/./node_modules/dotenv/lib/env-options.js","../webpack://tweet/./node_modules/dotenv/lib/main.js","../webpack://tweet/./node_modules/tunnel/index.js","../webpack://tweet/./node_modules/tunnel/lib/tunnel.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/form-data.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/oauth1.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/oauth2.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/request-handler.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/request-maker.mixin.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client-mixins/request-param.helper.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client.base.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client.subclient.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client/readonly.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/client/readwrite.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/globals.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/helpers.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/TwitterPaginator.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/dm.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/list.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/list.paginator.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/mutes.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/tweet.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/tweet.paginator.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/user.paginator.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/user.paginator.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/paginators/v2.paginator.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/plugins/helpers.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/settings.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/stream/TweetStream.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/stream/TweetStreamEventCombiner.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/stream/TweetStreamParser.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/auth.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/client.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/errors.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/plugins/client.plugins.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/plugins/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/responses.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/dev-utilities.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/dm.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/entities.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/geo.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/list.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/streaming.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/trends.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/tweet.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v1/user.v1.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/index.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/list.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/spaces.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/streaming.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/tweet.definition.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/tweet.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/types/v2/user.v2.types.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/client.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/client.v1.read.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/client.v1.write.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v1/media-helpers.v1.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2-labs/client.v2.labs.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2-labs/client.v2.labs.read.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2-labs/client.v2.labs.write.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/client.v2.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/client.v2.read.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/client.v2.write.js","../webpack://tweet/./node_modules/twitter-api-v2/dist/v2/includes.v2.helper.js","../webpack://tweet/./node_modules/uuid/dist/index.js","../webpack://tweet/./node_modules/uuid/dist/md5.js","../webpack://tweet/./node_modules/uuid/dist/nil.js","../webpack://tweet/./node_modules/uuid/dist/parse.js","../webpack://tweet/./node_modules/uuid/dist/regex.js","../webpack://tweet/./node_modules/uuid/dist/rng.js","../webpack://tweet/./node_modules/uuid/dist/sha1.js","../webpack://tweet/./node_modules/uuid/dist/stringify.js","../webpack://tweet/./node_modules/uuid/dist/v1.js","../webpack://tweet/./node_modules/uuid/dist/v3.js","../webpack://tweet/./node_modules/uuid/dist/v35.js","../webpack://tweet/./node_modules/uuid/dist/v4.js","../webpack://tweet/./node_modules/uuid/dist/v5.js","../webpack://tweet/./node_modules/uuid/dist/validate.js","../webpack://tweet/./node_modules/uuid/dist/version.js","../webpack://tweet/external node-commonjs \"assert\"","../webpack://tweet/external node-commonjs \"crypto\"","../webpack://tweet/external node-commonjs \"events\"","../webpack://tweet/external node-commonjs \"fs\"","../webpack://tweet/external node-commonjs \"http\"","../webpack://tweet/external node-commonjs \"https\"","../webpack://tweet/external node-commonjs \"net\"","../webpack://tweet/external node-commonjs \"os\"","../webpack://tweet/external node-commonjs \"path\"","../webpack://tweet/external node-commonjs \"tls\"","../webpack://tweet/external node-commonjs \"util\"","../webpack://tweet/external node-commonjs \"zlib\"","../webpack://tweet/webpack/bootstrap","../webpack://tweet/webpack/runtime/compat","../webpack://tweet/webpack/before-startup","../webpack://tweet/webpack/startup","../webpack://tweet/webpack/after-startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nrequire(\"dotenv/config\");\nconst core = __importStar(require(\"@actions/core\"));\nconst path = __importStar(require(\"path\"));\nconst tweet_1 = require(\"./tweet\");\nconst upload_media_1 = require(\"./upload-media\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const mediaPaths = core.getInput('media_paths');\n const mediaIds = yield (0, upload_media_1.uploadMedia)(mediaPaths\n .split('\\n')\n .filter(x => x !== '')\n .map(mediaPath => path.join(process.cwd(), mediaPath)));\n core.debug(`Media IDs: ${mediaIds.join(', ')}`);\n const inReplyToStatusId = core.getInput('in_reply_to_status_id');\n const response = yield (0, tweet_1.tweet)(core.getInput('status'), mediaIds, inReplyToStatusId);\n core.setOutput('response', JSON.stringify(response));\n }\n catch (error) {\n if (error instanceof Error)\n core.setFailed(error.message);\n }\n });\n}\nrun();\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tweet = void 0;\nconst twitter_api_v2_1 = __importDefault(require(\"twitter-api-v2\"));\nfunction tweet(status, mediaIds = [], inReplyToStatusId = '') {\n return __awaiter(this, void 0, void 0, function* () {\n const appKey = process.env.CONSUMER_API_KEY;\n const appSecret = process.env.CONSUMER_API_SECRET_KEY;\n const accessToken = process.env.ACCESS_TOKEN;\n const accessSecret = process.env.ACCESS_TOKEN_SECRET;\n const client = new twitter_api_v2_1.default({\n appKey,\n appSecret,\n accessToken,\n accessSecret\n }).v1;\n const parameters = {};\n if (mediaIds.length > 0) {\n parameters['media_ids'] = mediaIds.join(',');\n }\n if (inReplyToStatusId !== '') {\n parameters['in_reply_to_status_id'] = inReplyToStatusId;\n }\n return yield client.tweet(status, parameters);\n });\n}\nexports.tweet = tweet;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uploadMedia = void 0;\nconst twitter_api_v2_1 = __importDefault(require(\"twitter-api-v2\"));\nconst fs = __importStar(require(\"fs\"));\nconst core = __importStar(require(\"@actions/core\"));\nfunction uploadMedia(mediaPaths) {\n return __awaiter(this, void 0, void 0, function* () {\n core.debug(JSON.stringify(mediaPaths));\n for (const path of mediaPaths) {\n if (!fs.existsSync(path)) {\n throw new Error(`${path} not exists`);\n }\n }\n const appKey = process.env.CONSUMER_API_KEY;\n const appSecret = process.env.CONSUMER_API_SECRET_KEY;\n const accessToken = process.env.ACCESS_TOKEN;\n const accessSecret = process.env.ACCESS_TOKEN_SECRET;\n const client = new twitter_api_v2_1.default({\n appKey,\n appSecret,\n accessToken,\n accessSecret\n }).v1;\n const mediaIdsPromise = mediaPaths.map((path) => __awaiter(this, void 0, void 0, function* () {\n return yield client.uploadMedia(path);\n }));\n return yield Promise.all(mediaIdsPromise);\n });\n}\nexports.uploadMedia = uploadMedia;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst uuid_1 = require(\"uuid\");\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.\n if (name.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedVal.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","(function () {\n require('./lib/main').config(\n Object.assign(\n {},\n require('./lib/env-options'),\n require('./lib/cli-options')(process.argv)\n )\n )\n})()\n","const re = /^dotenv_config_(encoding|path|debug|override)=(.+)$/\n\nmodule.exports = function optionMatcher (args) {\n return args.reduce(function (acc, cur) {\n const matches = cur.match(re)\n if (matches) {\n acc[matches[1]] = matches[2]\n }\n return acc\n }, {})\n}\n","// ../config.js accepts options via environment variables\nconst options = {}\n\nif (process.env.DOTENV_CONFIG_ENCODING != null) {\n options.encoding = process.env.DOTENV_CONFIG_ENCODING\n}\n\nif (process.env.DOTENV_CONFIG_PATH != null) {\n options.path = process.env.DOTENV_CONFIG_PATH\n}\n\nif (process.env.DOTENV_CONFIG_DEBUG != null) {\n options.debug = process.env.DOTENV_CONFIG_DEBUG\n}\n\nif (process.env.DOTENV_CONFIG_OVERRIDE != null) {\n options.override = process.env.DOTENV_CONFIG_OVERRIDE\n}\n\nmodule.exports = options\n","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parser src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _log (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (options) {\n if (options.path != null) {\n dotenvPath = _resolveHome(options.path)\n }\n if (options.encoding != null) {\n encoding = options.encoding\n }\n }\n\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }))\n\n Object.keys(parsed).forEach(function (key) {\n if (!Object.prototype.hasOwnProperty.call(process.env, key)) {\n process.env[key] = parsed[key]\n } else {\n if (override === true) {\n process.env[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _log(`\"${key}\" is already defined in \\`process.env\\` and WAS overwritten`)\n } else {\n _log(`\"${key}\" is already defined in \\`process.env\\` and was NOT overwritten`)\n }\n }\n }\n })\n\n return { parsed }\n } catch (e) {\n if (debug) {\n _log(`Failed to load ${dotenvPath} ${e.message}`)\n }\n\n return { error: e }\n }\n}\n\nconst DotenvModule = {\n config,\n parse\n}\n\nmodule.exports.config = DotenvModule.config\nmodule.exports.parse = DotenvModule.parse\nmodule.exports = DotenvModule\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FormDataHelper = void 0;\nconst helpers_1 = require(\"../helpers\");\n// This class is partially inspired by https://github.com/form-data/form-data/blob/master/lib/form_data.js\n// All credits to their authors.\nclass FormDataHelper {\n constructor() {\n this._boundary = '';\n this._chunks = [];\n }\n bodyAppend(...values) {\n const allAsBuffer = values.map(val => val instanceof Buffer ? val : Buffer.from(val));\n this._chunks.push(...allAsBuffer);\n }\n append(field, value, contentType) {\n const convertedValue = value instanceof Buffer ? value : value.toString();\n const header = this.getMultipartHeader(field, convertedValue, contentType);\n this.bodyAppend(header, convertedValue, FormDataHelper.LINE_BREAK);\n }\n getHeaders() {\n return {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary(),\n };\n }\n /** Length of form-data (including footer length). */\n getLength() {\n return this._chunks.reduce((acc, cur) => acc + cur.length, this.getMultipartFooter().length);\n }\n getBuffer() {\n const allChunks = [...this._chunks, this.getMultipartFooter()];\n const totalBuffer = Buffer.alloc(this.getLength());\n let i = 0;\n for (const chunk of allChunks) {\n for (let j = 0; j < chunk.length; i++, j++) {\n totalBuffer[i] = chunk[j];\n }\n }\n return totalBuffer;\n }\n getBoundary() {\n if (!this._boundary) {\n this.generateBoundary();\n }\n return this._boundary;\n }\n generateBoundary() {\n // This generates a 50 character boundary similar to those used by Firefox.\n let boundary = '--------------------------';\n for (let i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n this._boundary = boundary;\n }\n getMultipartHeader(field, value, contentType) {\n // In this lib no need to guess more the content type, octet stream is ok of buffers\n if (!contentType) {\n contentType = value instanceof Buffer ? FormDataHelper.DEFAULT_CONTENT_TYPE : '';\n }\n const headers = {\n 'Content-Disposition': ['form-data', `name=\"${field}\"`],\n 'Content-Type': contentType,\n };\n let contents = '';\n for (const [prop, header] of Object.entries(headers)) {\n // skip nullish headers.\n if (!header.length) {\n continue;\n }\n contents += prop + ': ' + (0, helpers_1.arrayWrap)(header).join('; ') + FormDataHelper.LINE_BREAK;\n }\n return '--' + this.getBoundary() + FormDataHelper.LINE_BREAK + contents + FormDataHelper.LINE_BREAK;\n }\n getMultipartFooter() {\n if (this._footerChunk) {\n return this._footerChunk;\n }\n return this._footerChunk = Buffer.from('--' + this.getBoundary() + '--' + FormDataHelper.LINE_BREAK);\n }\n}\nexports.FormDataHelper = FormDataHelper;\nFormDataHelper.LINE_BREAK = '\\r\\n';\nFormDataHelper.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth1Helper = void 0;\nconst crypto = __importStar(require(\"crypto\"));\nclass OAuth1Helper {\n constructor(options) {\n this.nonceLength = 32;\n this.consumerKeys = options.consumerKeys;\n }\n static percentEncode(str) {\n return encodeURIComponent(str)\n .replace(/!/g, '%21')\n .replace(/\\*/g, '%2A')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29');\n }\n hash(base, key) {\n return crypto\n .createHmac('sha1', key)\n .update(base)\n .digest('base64');\n }\n authorize(request, accessTokens = {}) {\n const oauthInfo = {\n oauth_consumer_key: this.consumerKeys.key,\n oauth_nonce: this.getNonce(),\n oauth_signature_method: 'HMAC-SHA1',\n oauth_timestamp: this.getTimestamp(),\n oauth_version: '1.0',\n };\n if (accessTokens.key !== undefined) {\n oauthInfo.oauth_token = accessTokens.key;\n }\n if (!request.data) {\n request.data = {};\n }\n oauthInfo.oauth_signature = this.getSignature(request, accessTokens.secret, oauthInfo);\n return oauthInfo;\n }\n toHeader(oauthInfo) {\n const sorted = sortObject(oauthInfo);\n let header_value = 'OAuth ';\n for (const element of sorted) {\n if (element.key.indexOf('oauth_') !== 0) {\n continue;\n }\n header_value += OAuth1Helper.percentEncode(element.key) + '=\"' + OAuth1Helper.percentEncode(element.value) + '\",';\n }\n return {\n // Remove the last ,\n Authorization: header_value.slice(0, header_value.length - 1),\n };\n }\n getNonce() {\n const wordCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n let result = '';\n for (let i = 0; i < this.nonceLength; i++) {\n result += wordCharacters[Math.trunc(Math.random() * wordCharacters.length)];\n }\n return result;\n }\n getTimestamp() {\n return Math.trunc(new Date().getTime() / 1000);\n }\n getSignature(request, tokenSecret, oauthInfo) {\n return this.hash(this.getBaseString(request, oauthInfo), this.getSigningKey(tokenSecret));\n }\n getSigningKey(tokenSecret) {\n return OAuth1Helper.percentEncode(this.consumerKeys.secret) + '&' + OAuth1Helper.percentEncode(tokenSecret || '');\n }\n getBaseString(request, oauthInfo) {\n return request.method.toUpperCase() + '&'\n + OAuth1Helper.percentEncode(this.getBaseUrl(request.url)) + '&'\n + OAuth1Helper.percentEncode(this.getParameterString(request, oauthInfo));\n }\n getParameterString(request, oauthInfo) {\n const baseStringData = sortObject(percentEncodeData(mergeObject(oauthInfo, mergeObject(request.data, deParamUrl(request.url)))));\n let dataStr = '';\n for (const { key, value } of baseStringData) {\n // check if the value is an array\n // this means that this key has multiple values\n if (value && Array.isArray(value)) {\n // sort the array first\n value.sort();\n let valString = '';\n // serialize all values for this key: e.g. formkey=formvalue1&formkey=formvalue2\n value.forEach((item, i) => {\n valString += key + '=' + item;\n if (i < value.length) {\n valString += '&';\n }\n });\n dataStr += valString;\n }\n else {\n dataStr += key + '=' + value + '&';\n }\n }\n // Remove the last character\n return dataStr.slice(0, dataStr.length - 1);\n }\n getBaseUrl(url) {\n return url.split('?')[0];\n }\n}\nexports.OAuth1Helper = OAuth1Helper;\nexports.default = OAuth1Helper;\n// Helper functions //\nfunction mergeObject(obj1, obj2) {\n return {\n ...obj1 || {},\n ...obj2 || {},\n };\n}\nfunction sortObject(data) {\n return Object.keys(data)\n .sort()\n .map(key => ({ key, value: data[key] }));\n}\nfunction deParam(string) {\n const splitted = string.split('&');\n const data = {};\n for (const coupleKeyValue of splitted) {\n const [key, value = ''] = coupleKeyValue.split('=');\n // check if the key already exists\n // this can occur if the QS part of the url contains duplicate keys like this: ?formkey=formvalue1&formkey=formvalue2\n if (data[key]) {\n // the key exists already\n if (!Array.isArray(data[key])) {\n // replace the value with an array containing the already present value\n data[key] = [data[key]];\n }\n // and add the new found value to it\n data[key].push(decodeURIComponent(value));\n }\n else {\n // it doesn't exist, just put the found value in the data object\n data[key] = decodeURIComponent(value);\n }\n }\n return data;\n}\nfunction deParamUrl(url) {\n const tmp = url.split('?');\n if (tmp.length === 1)\n return {};\n return deParam(tmp[1]);\n}\nfunction percentEncodeData(data) {\n const result = {};\n for (const key in data) {\n let value = data[key];\n // check if the value is an array\n if (value && Array.isArray(value)) {\n value = value.map(v => OAuth1Helper.percentEncode(v));\n }\n else {\n value = OAuth1Helper.percentEncode(value);\n }\n result[OAuth1Helper.percentEncode(key)] = value;\n }\n return result;\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth2Helper = void 0;\nconst crypto = __importStar(require(\"crypto\"));\nclass OAuth2Helper {\n static getCodeVerifier() {\n return this.generateRandomString(128);\n }\n static getCodeChallengeFromVerifier(verifier) {\n return this.escapeBase64Url(crypto\n .createHash('sha256')\n .update(verifier)\n .digest('base64'));\n }\n static getAuthHeader(clientId, clientSecret) {\n const key = encodeURIComponent(clientId) + ':' + encodeURIComponent(clientSecret);\n return Buffer.from(key).toString('base64');\n }\n static generateRandomString(length) {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n for (let i = 0; i < length; i++) {\n text += possible[Math.floor(Math.random() * possible.length)];\n }\n return text;\n }\n static escapeBase64Url(string) {\n return string.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n}\nexports.OAuth2Helper = OAuth2Helper;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RequestHandlerHelper = void 0;\nconst https_1 = require(\"https\");\nconst settings_1 = require(\"../settings\");\nconst TweetStream_1 = __importDefault(require(\"../stream/TweetStream\"));\nconst types_1 = require(\"../types\");\nconst zlib = __importStar(require(\"zlib\"));\nclass RequestHandlerHelper {\n constructor(requestData) {\n this.requestData = requestData;\n this.requestErrorHandled = false;\n this.responseData = [];\n }\n /* Request helpers */\n get hrefPathname() {\n const url = this.requestData.url;\n return url.hostname + url.pathname;\n }\n isCompressionDisabled() {\n return !this.requestData.compression || this.requestData.compression === 'identity';\n }\n isFormEncodedEndpoint() {\n return this.requestData.url.href.startsWith('https://api.twitter.com/oauth/');\n }\n /* Error helpers */\n createRequestError(error) {\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log('Request error:', error);\n }\n return new types_1.ApiRequestError('Request failed.', {\n request: this.req,\n error,\n });\n }\n createPartialResponseError(error, abortClose) {\n const res = this.res;\n let message = `Request failed with partial response with HTTP code ${res.statusCode}`;\n if (abortClose) {\n message += ' (connection abruptly closed)';\n }\n else {\n message += ' (parse error)';\n }\n return new types_1.ApiPartialResponseError(message, {\n request: this.req,\n response: this.res,\n responseError: error,\n rawContent: Buffer.concat(this.responseData).toString(),\n });\n }\n formatV1Errors(errors) {\n return errors\n .map(({ code, message }) => `${message} (Twitter code ${code})`)\n .join(', ');\n }\n formatV2Error(error) {\n return `${error.title}: ${error.detail} (see ${error.type})`;\n }\n createResponseError({ res, data, rateLimit, code }) {\n var _a;\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log(`Request failed with code ${code}, data:`, data);\n settings_1.TwitterApiV2Settings.logger.log('Response headers:', res.headers);\n }\n // Errors formatting.\n let errorString = `Request failed with code ${code}`;\n if ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a.length) {\n const errors = data.errors;\n if ('code' in errors[0]) {\n errorString += ' - ' + this.formatV1Errors(errors);\n }\n else {\n errorString += ' - ' + this.formatV2Error(data);\n }\n }\n return new types_1.ApiResponseError(errorString, {\n code,\n data,\n headers: res.headers,\n request: this.req,\n response: res,\n rateLimit,\n });\n }\n /* Response helpers */\n getResponseDataStream(res) {\n if (this.isCompressionDisabled()) {\n return res;\n }\n const contentEncoding = (res.headers['content-encoding'] || 'identity').trim().toLowerCase();\n if (contentEncoding === 'br') {\n const brotli = zlib.createBrotliDecompress({\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH,\n });\n res.pipe(brotli);\n return brotli;\n }\n if (contentEncoding === 'gzip') {\n const gunzip = zlib.createGunzip({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH,\n });\n res.pipe(gunzip);\n return gunzip;\n }\n if (contentEncoding === 'deflate') {\n const inflate = zlib.createInflate({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH,\n });\n res.pipe(inflate);\n return inflate;\n }\n return res;\n }\n detectResponseType(res) {\n var _a, _b;\n // Auto parse if server responds with JSON body\n if (((_a = res.headers['content-type']) === null || _a === void 0 ? void 0 : _a.includes('application/json')) || ((_b = res.headers['content-type']) === null || _b === void 0 ? void 0 : _b.includes('application/problem+json'))) {\n return 'json';\n }\n // f-e oauth token endpoints\n else if (this.isFormEncodedEndpoint()) {\n return 'url';\n }\n return 'text';\n }\n getParsedResponse(res) {\n const data = this.responseData;\n const mode = this.requestData.forceParseMode || this.detectResponseType(res);\n if (mode === 'buffer') {\n return Buffer.concat(data);\n }\n else if (mode === 'text') {\n return Buffer.concat(data).toString();\n }\n else if (mode === 'json') {\n const asText = Buffer.concat(data).toString();\n return asText.length ? JSON.parse(asText) : undefined;\n }\n else if (mode === 'url') {\n const asText = Buffer.concat(data).toString();\n const formEntries = {};\n for (const [item, value] of new URLSearchParams(asText)) {\n formEntries[item] = value;\n }\n return formEntries;\n }\n else {\n // mode === 'none'\n return undefined;\n }\n }\n getRateLimitFromResponse(res) {\n let rateLimit = undefined;\n if (res.headers['x-rate-limit-limit']) {\n rateLimit = {\n limit: Number(res.headers['x-rate-limit-limit']),\n remaining: Number(res.headers['x-rate-limit-remaining']),\n reset: Number(res.headers['x-rate-limit-reset']),\n };\n if (this.requestData.rateLimitSaver) {\n this.requestData.rateLimitSaver(rateLimit);\n }\n }\n return rateLimit;\n }\n /* Request event handlers */\n onSocketEventHandler(reject, socket) {\n socket.on('close', this.onSocketCloseHandler.bind(this, reject));\n }\n onSocketCloseHandler(reject) {\n this.req.removeAllListeners('timeout');\n const res = this.res;\n if (res) {\n // Response ok, res.close/res.end can handle request ending\n return;\n }\n if (!this.requestErrorHandled) {\n return reject(this.createRequestError(new Error('Socket closed without any information.')));\n }\n // else: other situation\n }\n requestErrorHandler(reject, requestError) {\n var _a, _b;\n (_b = (_a = this.requestData).requestEventDebugHandler) === null || _b === void 0 ? void 0 : _b.call(_a, 'request-error', { requestError });\n this.requestErrorHandled = true;\n reject(this.createRequestError(requestError));\n }\n timeoutErrorHandler() {\n this.requestErrorHandled = true;\n this.req.destroy(new Error('Request timeout.'));\n }\n /* Response event handlers */\n classicResponseHandler(resolve, reject, res) {\n this.res = res;\n const dataStream = this.getResponseDataStream(res);\n // Register the response data\n dataStream.on('data', chunk => this.responseData.push(chunk));\n dataStream.on('end', this.onResponseEndHandler.bind(this, resolve, reject));\n dataStream.on('close', this.onResponseCloseHandler.bind(this, resolve, reject));\n // Debug handlers\n if (this.requestData.requestEventDebugHandler) {\n this.requestData.requestEventDebugHandler('response', { res });\n res.on('aborted', error => this.requestData.requestEventDebugHandler('response-aborted', { error }));\n res.on('error', error => this.requestData.requestEventDebugHandler('response-error', { error }));\n res.on('close', () => this.requestData.requestEventDebugHandler('response-close', { data: this.responseData }));\n res.on('end', () => this.requestData.requestEventDebugHandler('response-end'));\n }\n }\n onResponseEndHandler(resolve, reject) {\n const rateLimit = this.getRateLimitFromResponse(this.res);\n let data;\n try {\n data = this.getParsedResponse(this.res);\n }\n catch (e) {\n reject(this.createPartialResponseError(e, false));\n return;\n }\n // Handle bad error codes\n const code = this.res.statusCode;\n if (code >= 400) {\n reject(this.createResponseError({ data, res: this.res, rateLimit, code }));\n return;\n }\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${this.res.statusCode}`);\n settings_1.TwitterApiV2Settings.logger.log('Response body:', data);\n }\n resolve({\n data,\n headers: this.res.headers,\n rateLimit,\n });\n }\n onResponseCloseHandler(resolve, reject) {\n const res = this.res;\n if (res.aborted) {\n // Try to parse the request (?)\n try {\n this.getParsedResponse(this.res);\n // Ok, try to resolve normally the request\n return this.onResponseEndHandler(resolve, reject);\n }\n catch (e) {\n // Parse error, just drop with content\n return reject(this.createPartialResponseError(e, true));\n }\n }\n if (!res.complete) {\n return reject(this.createPartialResponseError(new Error('Response has been interrupted before response could be parsed.'), true));\n }\n // else: end has been called\n }\n streamResponseHandler(resolve, reject, res) {\n const code = res.statusCode;\n if (code < 400) {\n if (settings_1.TwitterApiV2Settings.debug) {\n settings_1.TwitterApiV2Settings.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${res.statusCode} (starting stream)`);\n }\n const dataStream = this.getResponseDataStream(res);\n // HTTP code ok, consume stream\n resolve({ req: this.req, res: dataStream, originalResponse: res, requestData: this.requestData });\n }\n else {\n // Handle response normally, can only rejects\n this.classicResponseHandler(() => undefined, reject, res);\n }\n }\n /* Wrappers for request lifecycle */\n debugRequest() {\n const url = this.requestData.url;\n settings_1.TwitterApiV2Settings.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]`, this.requestData.options);\n if (url.search) {\n settings_1.TwitterApiV2Settings.logger.log('Request parameters:', [...url.searchParams.entries()].map(([key, value]) => `${key}: ${value}`));\n }\n if (this.requestData.body) {\n settings_1.TwitterApiV2Settings.logger.log('Request body:', this.requestData.body);\n }\n }\n buildRequest() {\n var _a;\n const url = this.requestData.url;\n const auth = url.username ? `${url.username}:${url.password}` : undefined;\n const headers = (_a = this.requestData.options.headers) !== null && _a !== void 0 ? _a : {};\n if (this.requestData.compression === true || this.requestData.compression === 'brotli') {\n headers['accept-encoding'] = 'br;q=1.0, gzip;q=0.8, deflate;q=0.5, *;q=0.1';\n }\n else if (this.requestData.compression === 'gzip') {\n headers['accept-encoding'] = 'gzip;q=1, deflate;q=0.5, *;q=0.1';\n }\n else if (this.requestData.compression === 'deflate') {\n headers['accept-encoding'] = 'deflate;q=1, *;q=0.1';\n }\n if (settings_1.TwitterApiV2Settings.debug) {\n this.debugRequest();\n }\n this.req = (0, https_1.request)({\n ...this.requestData.options,\n // Define URL params manually, addresses dependencies error https://github.com/PLhery/node-twitter-api-v2/issues/94\n host: url.hostname,\n port: url.port || undefined,\n path: url.pathname + url.search,\n protocol: url.protocol,\n auth,\n headers,\n });\n }\n registerRequestEventDebugHandlers(req) {\n req.on('close', () => this.requestData.requestEventDebugHandler('close'));\n req.on('abort', () => this.requestData.requestEventDebugHandler('abort'));\n req.on('socket', socket => {\n this.requestData.requestEventDebugHandler('socket', { socket });\n socket.on('error', error => this.requestData.requestEventDebugHandler('socket-error', { socket, error }));\n socket.on('connect', () => this.requestData.requestEventDebugHandler('socket-connect', { socket }));\n socket.on('close', withError => this.requestData.requestEventDebugHandler('socket-close', { socket, withError }));\n socket.on('end', () => this.requestData.requestEventDebugHandler('socket-end', { socket }));\n socket.on('lookup', (...data) => this.requestData.requestEventDebugHandler('socket-lookup', { socket, data }));\n socket.on('timeout', () => this.requestData.requestEventDebugHandler('socket-timeout', { socket }));\n });\n }\n makeRequest() {\n this.buildRequest();\n return new Promise((resolve, reject) => {\n const req = this.req;\n // Handle request errors\n req.on('error', this.requestErrorHandler.bind(this, reject));\n req.on('socket', this.onSocketEventHandler.bind(this, reject));\n req.on('response', this.classicResponseHandler.bind(this, resolve, reject));\n if (this.requestData.options.timeout) {\n req.on('timeout', this.timeoutErrorHandler.bind(this));\n }\n // Debug handlers\n if (this.requestData.requestEventDebugHandler) {\n this.registerRequestEventDebugHandlers(req);\n }\n if (this.requestData.body) {\n req.write(this.requestData.body);\n }\n req.end();\n });\n }\n async makeRequestAsStream() {\n const { req, res, requestData, originalResponse } = await this.makeRequestAndResolveWhenReady();\n return new TweetStream_1.default(requestData, { req, res, originalResponse });\n }\n makeRequestAndResolveWhenReady() {\n this.buildRequest();\n return new Promise((resolve, reject) => {\n const req = this.req;\n // Handle request errors\n req.on('error', this.requestErrorHandler.bind(this, reject));\n req.on('response', this.streamResponseHandler.bind(this, resolve, reject));\n if (this.requestData.body) {\n req.write(this.requestData.body);\n }\n req.end();\n });\n }\n}\nexports.RequestHandlerHelper = RequestHandlerHelper;\nexports.default = RequestHandlerHelper;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientRequestMaker = void 0;\nconst types_1 = require(\"../types\");\nconst TweetStream_1 = __importDefault(require(\"../stream/TweetStream\"));\nconst helpers_1 = require(\"../plugins/helpers\");\nconst helpers_2 = require(\"../helpers\");\nconst oauth1_helper_1 = __importDefault(require(\"./oauth1.helper\"));\nconst request_handler_helper_1 = __importDefault(require(\"./request-handler.helper\"));\nconst request_param_helper_1 = __importDefault(require(\"./request-param.helper\"));\nconst oauth2_helper_1 = require(\"./oauth2.helper\");\nclass ClientRequestMaker {\n constructor(settings) {\n this.rateLimits = {};\n this.clientSettings = {};\n if (settings) {\n this.clientSettings = settings;\n }\n }\n /** @deprecated - Switch to `@twitter-api-v2/plugin-rate-limit` */\n getRateLimits() {\n return this.rateLimits;\n }\n saveRateLimit(originalUrl, rateLimit) {\n this.rateLimits[originalUrl] = rateLimit;\n }\n /** Send a new request and returns a wrapped `Promise`. */\n async send(requestParams) {\n var _a, _b, _c, _d, _e;\n // Pre-request config hooks\n if ((_a = this.clientSettings.plugins) === null || _a === void 0 ? void 0 : _a.length) {\n const possibleResponse = await this.applyPreRequestConfigHooks(requestParams);\n if (possibleResponse) {\n return possibleResponse;\n }\n }\n const args = this.getHttpRequestArgs(requestParams);\n const options = {\n method: args.method,\n headers: args.headers,\n timeout: requestParams.timeout,\n agent: this.clientSettings.httpAgent,\n };\n const enableRateLimitSave = requestParams.enableRateLimitSave !== false;\n if (args.body) {\n request_param_helper_1.default.setBodyLengthHeader(options, args.body);\n }\n // Pre-request hooks\n if ((_b = this.clientSettings.plugins) === null || _b === void 0 ? void 0 : _b.length) {\n await this.applyPreRequestHooks(requestParams, args, options);\n }\n let request = new request_handler_helper_1.default({\n url: args.url,\n options,\n body: args.body,\n rateLimitSaver: enableRateLimitSave ? this.saveRateLimit.bind(this, args.rawUrl) : undefined,\n requestEventDebugHandler: requestParams.requestEventDebugHandler,\n compression: (_d = (_c = requestParams.compression) !== null && _c !== void 0 ? _c : this.clientSettings.compression) !== null && _d !== void 0 ? _d : true,\n forceParseMode: requestParams.forceParseMode,\n })\n .makeRequest();\n if ((0, helpers_1.hasRequestErrorPlugins)(this)) {\n request = this.applyResponseErrorHooks(requestParams, args, options, request);\n }\n const response = await request;\n // Post-request hooks\n if ((_e = this.clientSettings.plugins) === null || _e === void 0 ? void 0 : _e.length) {\n const responseOverride = await this.applyPostRequestHooks(requestParams, args, options, response);\n if (responseOverride) {\n return responseOverride.value;\n }\n }\n return response;\n }\n sendStream(requestParams) {\n var _a, _b;\n // Pre-request hooks\n if (this.clientSettings.plugins) {\n this.applyPreStreamRequestConfigHooks(requestParams);\n }\n const args = this.getHttpRequestArgs(requestParams);\n const options = {\n method: args.method,\n headers: args.headers,\n agent: this.clientSettings.httpAgent,\n };\n const enableRateLimitSave = requestParams.enableRateLimitSave !== false;\n const enableAutoConnect = requestParams.autoConnect !== false;\n if (args.body) {\n request_param_helper_1.default.setBodyLengthHeader(options, args.body);\n }\n const requestData = {\n url: args.url,\n options,\n body: args.body,\n rateLimitSaver: enableRateLimitSave ? this.saveRateLimit.bind(this, args.rawUrl) : undefined,\n payloadIsError: requestParams.payloadIsError,\n compression: (_b = (_a = requestParams.compression) !== null && _a !== void 0 ? _a : this.clientSettings.compression) !== null && _b !== void 0 ? _b : true,\n };\n const stream = new TweetStream_1.default(requestData);\n if (!enableAutoConnect) {\n return stream;\n }\n return stream.connect();\n }\n /* Token helpers */\n initializeToken(token) {\n if (typeof token === 'string') {\n this.bearerToken = token;\n }\n else if (typeof token === 'object' && 'appKey' in token) {\n this.consumerToken = token.appKey;\n this.consumerSecret = token.appSecret;\n if (token.accessToken && token.accessSecret) {\n this.accessToken = token.accessToken;\n this.accessSecret = token.accessSecret;\n }\n this._oauth = this.buildOAuth();\n }\n else if (typeof token === 'object' && 'username' in token) {\n const key = encodeURIComponent(token.username) + ':' + encodeURIComponent(token.password);\n this.basicToken = Buffer.from(key).toString('base64');\n }\n else if (typeof token === 'object' && 'clientId' in token) {\n this.clientId = token.clientId;\n this.clientSecret = token.clientSecret;\n }\n }\n getActiveTokens() {\n if (this.bearerToken) {\n return {\n type: 'oauth2',\n bearerToken: this.bearerToken,\n };\n }\n else if (this.basicToken) {\n return {\n type: 'basic',\n token: this.basicToken,\n };\n }\n else if (this.consumerSecret && this._oauth) {\n return {\n type: 'oauth-1.0a',\n appKey: this.consumerToken,\n appSecret: this.consumerSecret,\n accessToken: this.accessToken,\n accessSecret: this.accessSecret,\n };\n }\n else if (this.clientId) {\n return {\n type: 'oauth2-user',\n clientId: this.clientId,\n };\n }\n return { type: 'none' };\n }\n buildOAuth() {\n if (!this.consumerSecret || !this.consumerToken)\n throw new Error('Invalid consumer tokens');\n return new oauth1_helper_1.default({\n consumerKeys: { key: this.consumerToken, secret: this.consumerSecret },\n });\n }\n getOAuthAccessTokens() {\n if (!this.accessSecret || !this.accessToken)\n return;\n return {\n key: this.accessToken,\n secret: this.accessSecret,\n };\n }\n /* Plugin helpers */\n getPlugins() {\n var _a;\n return (_a = this.clientSettings.plugins) !== null && _a !== void 0 ? _a : [];\n }\n hasPlugins() {\n var _a;\n return !!((_a = this.clientSettings.plugins) === null || _a === void 0 ? void 0 : _a.length);\n }\n async applyPluginMethod(method, args) {\n var _a;\n let returnValue;\n for (const plugin of this.getPlugins()) {\n const value = await ((_a = plugin[method]) === null || _a === void 0 ? void 0 : _a.call(plugin, args));\n if (value && value instanceof types_1.TwitterApiPluginResponseOverride) {\n returnValue = value;\n }\n }\n return returnValue;\n }\n /* Request helpers */\n writeAuthHeaders({ headers, bodyInSignature, url, method, query, body }) {\n headers = { ...headers };\n if (this.bearerToken) {\n headers.Authorization = 'Bearer ' + this.bearerToken;\n }\n else if (this.basicToken) {\n // Basic auth, to request a bearer token\n headers.Authorization = 'Basic ' + this.basicToken;\n }\n else if (this.clientId && this.clientSecret) {\n // Basic auth with clientId + clientSecret\n headers.Authorization = 'Basic ' + oauth2_helper_1.OAuth2Helper.getAuthHeader(this.clientId, this.clientSecret);\n }\n else if (this.consumerSecret && this._oauth) {\n // Merge query and body\n const data = bodyInSignature ? request_param_helper_1.default.mergeQueryAndBodyForOAuth(query, body) : query;\n const auth = this._oauth.authorize({\n url: url.toString(),\n method,\n data,\n }, this.getOAuthAccessTokens());\n headers = { ...headers, ...this._oauth.toHeader(auth) };\n }\n return headers;\n }\n getUrlObjectFromUrlString(url) {\n // Add protocol to URL if needed\n if (!url.startsWith('http')) {\n url = 'https://' + url;\n }\n // Convert URL to object that will receive all URL modifications\n return new URL(url);\n }\n getHttpRequestArgs({ url: stringUrl, method, query: rawQuery = {}, body: rawBody = {}, headers, forceBodyMode, enableAuth, params, }) {\n let body = undefined;\n method = method.toUpperCase();\n headers = headers !== null && headers !== void 0 ? headers : {};\n // Add user agent header (Twitter recommends it)\n if (!headers['x-user-agent']) {\n headers['x-user-agent'] = 'Node.twitter-api-v2';\n }\n const url = this.getUrlObjectFromUrlString(stringUrl);\n // URL without query string to save as endpoint name\n const rawUrl = url.origin + url.pathname;\n // Apply URL parameters\n if (params) {\n request_param_helper_1.default.applyRequestParametersToUrl(url, params);\n }\n // Build a URL without anything in QS, and QSP in query\n const query = request_param_helper_1.default.formatQueryToString(rawQuery);\n request_param_helper_1.default.moveUrlQueryParamsIntoObject(url, query);\n // Delete undefined parameters\n if (!(rawBody instanceof Buffer)) {\n (0, helpers_2.trimUndefinedProperties)(rawBody);\n }\n // OAuth signature should not include parameters when using multipart.\n const bodyType = forceBodyMode !== null && forceBodyMode !== void 0 ? forceBodyMode : request_param_helper_1.default.autoDetectBodyType(url);\n // If undefined or true, enable auth by headers\n if (enableAuth !== false) {\n // OAuth needs body signature only if body is URL encoded.\n const bodyInSignature = ClientRequestMaker.BODY_METHODS.has(method) && bodyType === 'url';\n headers = this.writeAuthHeaders({ headers, bodyInSignature, method, query, url, body: rawBody });\n }\n if (ClientRequestMaker.BODY_METHODS.has(method)) {\n body = request_param_helper_1.default.constructBodyParams(rawBody, headers, bodyType) || undefined;\n }\n request_param_helper_1.default.addQueryParamsToUrl(url, query);\n return {\n rawUrl,\n url,\n method,\n headers,\n body,\n };\n }\n /* Plugin helpers */\n async applyPreRequestConfigHooks(requestParams) {\n var _a;\n const url = this.getUrlObjectFromUrlString(requestParams.url);\n for (const plugin of this.getPlugins()) {\n const result = await ((_a = plugin.onBeforeRequestConfig) === null || _a === void 0 ? void 0 : _a.call(plugin, {\n client: this,\n url,\n params: requestParams,\n }));\n if (result) {\n return result;\n }\n }\n }\n applyPreStreamRequestConfigHooks(requestParams) {\n var _a;\n const url = this.getUrlObjectFromUrlString(requestParams.url);\n for (const plugin of this.getPlugins()) {\n (_a = plugin.onBeforeStreamRequestConfig) === null || _a === void 0 ? void 0 : _a.call(plugin, {\n client: this,\n url,\n params: requestParams,\n });\n }\n }\n async applyPreRequestHooks(requestParams, computedParams, requestOptions) {\n await this.applyPluginMethod('onBeforeRequest', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n });\n }\n async applyPostRequestHooks(requestParams, computedParams, requestOptions, response) {\n return await this.applyPluginMethod('onAfterRequest', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n response,\n });\n }\n applyResponseErrorHooks(requestParams, computedParams, requestOptions, promise) {\n return promise.catch(helpers_1.applyResponseHooks.bind(this, requestParams, computedParams, requestOptions));\n }\n}\nexports.ClientRequestMaker = ClientRequestMaker;\nClientRequestMaker.BODY_METHODS = new Set(['POST', 'PUT', 'PATCH']);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RequestParamHelpers = void 0;\nconst form_data_helper_1 = require(\"./form-data.helper\");\nconst oauth1_helper_1 = __importDefault(require(\"./oauth1.helper\"));\n/* Helpers functions that are specific to this class but do not depends on instance */\nclass RequestParamHelpers {\n static formatQueryToString(query) {\n const formattedQuery = {};\n for (const prop in query) {\n if (typeof query[prop] === 'string') {\n formattedQuery[prop] = query[prop];\n }\n else if (typeof query[prop] !== 'undefined') {\n formattedQuery[prop] = String(query[prop]);\n }\n }\n return formattedQuery;\n }\n static autoDetectBodyType(url) {\n if (url.pathname.startsWith('/2/') || url.pathname.startsWith('/labs/2/')) {\n // oauth2 takes url encoded\n if (url.password.startsWith('/2/oauth2')) {\n return 'url';\n }\n // Twitter API v2 has JSON-encoded requests for everything else\n return 'json';\n }\n if (url.hostname === 'upload.twitter.com') {\n if (url.pathname === '/1.1/media/upload.json') {\n return 'form-data';\n }\n // json except for media/upload command, that is form-data.\n return 'json';\n }\n const endpoint = url.pathname.split('/1.1/', 2)[1];\n if (this.JSON_1_1_ENDPOINTS.has(endpoint)) {\n return 'json';\n }\n return 'url';\n }\n static addQueryParamsToUrl(url, query) {\n const queryEntries = Object.entries(query);\n if (queryEntries.length) {\n let search = '';\n for (const [key, value] of queryEntries) {\n search += (search.length ? '&' : '?') + `${oauth1_helper_1.default.percentEncode(key)}=${oauth1_helper_1.default.percentEncode(value)}`;\n }\n url.search = search;\n }\n }\n static constructBodyParams(body, headers, mode) {\n if (body instanceof Buffer) {\n return body;\n }\n if (mode === 'json') {\n headers['content-type'] = 'application/json;charset=UTF-8';\n return JSON.stringify(body);\n }\n else if (mode === 'url') {\n headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';\n if (Object.keys(body).length) {\n return new URLSearchParams(body)\n .toString()\n .replace(/\\*/g, '%2A'); // URLSearchParams doesnt encode '*', but Twitter wants it encoded.\n }\n return '';\n }\n else if (mode === 'raw') {\n throw new Error('You can only use raw body mode with Buffers. To give a string, use Buffer.from(str).');\n }\n else {\n const form = new form_data_helper_1.FormDataHelper();\n for (const parameter in body) {\n form.append(parameter, body[parameter]);\n }\n const formHeaders = form.getHeaders();\n headers['content-type'] = formHeaders['content-type'];\n return form.getBuffer();\n }\n }\n static setBodyLengthHeader(options, body) {\n var _a;\n options.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : {};\n if (typeof body === 'string') {\n options.headers['content-length'] = Buffer.byteLength(body);\n }\n else {\n options.headers['content-length'] = body.length;\n }\n }\n static isOAuthSerializable(item) {\n return !(item instanceof Buffer);\n }\n static mergeQueryAndBodyForOAuth(query, body) {\n const parameters = {};\n for (const prop in query) {\n parameters[prop] = query[prop];\n }\n if (this.isOAuthSerializable(body)) {\n for (const prop in body) {\n const bodyProp = body[prop];\n if (this.isOAuthSerializable(bodyProp)) {\n parameters[prop] = typeof bodyProp === 'object' && bodyProp !== null && 'toString' in bodyProp\n ? bodyProp.toString()\n : bodyProp;\n }\n }\n }\n return parameters;\n }\n static moveUrlQueryParamsIntoObject(url, query) {\n for (const [param, value] of url.searchParams) {\n query[param] = value;\n }\n // Remove the query string\n url.search = '';\n return url;\n }\n /**\n * Replace URL parameters available in pathname, like `:id`, with data given in `parameters`:\n * `https://twitter.com/:id.json` + `{ id: '20' }` => `https://twitter.com/20.json`\n */\n static applyRequestParametersToUrl(url, parameters) {\n url.pathname = url.pathname.replace(/:([A-Z_-]+)/ig, (fullMatch, paramName) => {\n if (parameters[paramName] !== undefined) {\n return String(parameters[paramName]);\n }\n return fullMatch;\n });\n return url;\n }\n}\nexports.RequestParamHelpers = RequestParamHelpers;\nRequestParamHelpers.JSON_1_1_ENDPOINTS = new Set([\n 'direct_messages/events/new.json',\n 'direct_messages/welcome_messages/new.json',\n 'direct_messages/welcome_messages/rules/new.json',\n 'media/metadata/create.json',\n 'collections/entries/curate.json',\n]);\nexports.default = RequestParamHelpers;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst request_maker_mixin_1 = require(\"./client-mixins/request-maker.mixin\");\nconst helpers_1 = require(\"./helpers\");\nconst globals_1 = require(\"./globals\");\n/**\n * Base class for Twitter instances\n */\nclass TwitterApiBase {\n constructor(token, settings = {}) {\n this._currentUser = null;\n this._currentUserV2 = null;\n if (token instanceof TwitterApiBase) {\n this._requestMaker = token._requestMaker;\n }\n else {\n this._requestMaker = new request_maker_mixin_1.ClientRequestMaker(settings);\n this._requestMaker.initializeToken(token);\n }\n }\n /* Prefix/Token handling */\n setPrefix(prefix) {\n this._prefix = prefix;\n }\n cloneWithPrefix(prefix) {\n const clone = this.constructor(this);\n clone.setPrefix(prefix);\n return clone;\n }\n getActiveTokens() {\n return this._requestMaker.getActiveTokens();\n }\n /* Rate limit cache / Plugins */\n getPlugins() {\n return this._requestMaker.getPlugins();\n }\n getPluginOfType(type) {\n return this.getPlugins().find(plugin => plugin instanceof type);\n }\n /**\n * @deprecated - Migrate to plugin `@twitter-api-v2/plugin-rate-limit`\n *\n * Tells if you hit the Twitter rate limit for {endpoint}.\n * (local data only, this should not ask anything to Twitter)\n */\n hasHitRateLimit(endpoint) {\n var _a;\n if (this.isRateLimitStatusObsolete(endpoint)) {\n return false;\n }\n return ((_a = this.getLastRateLimitStatus(endpoint)) === null || _a === void 0 ? void 0 : _a.remaining) === 0;\n }\n /**\n * @deprecated - Migrate to plugin `@twitter-api-v2/plugin-rate-limit`\n *\n * Tells if you hit the returned Twitter rate limit for {endpoint} has expired.\n * If client has no saved rate limit data for {endpoint}, this will gives you `true`.\n */\n isRateLimitStatusObsolete(endpoint) {\n const rateLimit = this.getLastRateLimitStatus(endpoint);\n if (rateLimit === undefined) {\n return true;\n }\n // Timestamps are exprimed in seconds, JS works with ms\n return (rateLimit.reset * 1000) < Date.now();\n }\n /**\n * @deprecated - Migrate to plugin `@twitter-api-v2/plugin-rate-limit`\n *\n * Get the last obtained Twitter rate limit information for {endpoint}.\n * (local data only, this should not ask anything to Twitter)\n */\n getLastRateLimitStatus(endpoint) {\n const endpointWithPrefix = endpoint.match(/^https?:\\/\\//) ? endpoint : (this._prefix + endpoint);\n return this._requestMaker.getRateLimits()[endpointWithPrefix];\n }\n /* Current user cache */\n /** Get cached current user. */\n getCurrentUserObject(forceFetch = false) {\n if (!forceFetch && this._currentUser) {\n if (this._currentUser.value) {\n return Promise.resolve(this._currentUser.value);\n }\n return this._currentUser.promise;\n }\n this._currentUser = (0, helpers_1.sharedPromise)(() => this.get('account/verify_credentials.json', { tweet_mode: 'extended' }, { prefix: globals_1.API_V1_1_PREFIX }));\n return this._currentUser.promise;\n }\n /**\n * Get cached current user from v2 API.\n * This can only be the slimest available `UserV2` object, with only `id`, `name` and `username` properties defined.\n *\n * To get a customized `UserV2Result`, use `.v2.me()`\n *\n * OAuth2 scopes: `tweet.read` & `users.read`\n */\n getCurrentUserV2Object(forceFetch = false) {\n if (!forceFetch && this._currentUserV2) {\n if (this._currentUserV2.value) {\n return Promise.resolve(this._currentUserV2.value);\n }\n return this._currentUserV2.promise;\n }\n this._currentUserV2 = (0, helpers_1.sharedPromise)(() => this.get('users/me', undefined, { prefix: globals_1.API_V2_PREFIX }));\n return this._currentUserV2.promise;\n }\n async get(url, query = {}, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'GET',\n query,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async delete(url, query = {}, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'DELETE',\n query,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async post(url, body, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'POST',\n body,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async put(url, body, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'PUT',\n body,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n async patch(url, body, { fullResponse, prefix = this._prefix, ...rest } = {}) {\n if (prefix)\n url = prefix + url;\n const resp = await this._requestMaker.send({\n url,\n method: 'PATCH',\n body,\n ...rest,\n });\n return fullResponse ? resp : resp.data;\n }\n getStream(url, query, { prefix = this._prefix, ...rest } = {}) {\n return this._requestMaker.sendStream({\n url: prefix ? prefix + url : url,\n method: 'GET',\n query,\n ...rest,\n });\n }\n postStream(url, body, { prefix = this._prefix, ...rest } = {}) {\n return this._requestMaker.sendStream({\n url: prefix ? prefix + url : url,\n method: 'POST',\n body,\n ...rest,\n });\n }\n}\nexports.default = TwitterApiBase;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_base_1 = __importDefault(require(\"./client.base\"));\n/**\n * Base subclient for every v1 and v2 client.\n */\nclass TwitterApiSubClient extends client_base_1.default {\n constructor(instance) {\n if (!(instance instanceof client_base_1.default)) {\n throw new Error('You must instance SubTwitterApi instance from existing TwitterApi instance.');\n }\n super(instance);\n }\n}\nexports.default = TwitterApiSubClient;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiReadOnly = exports.TwitterApiReadWrite = exports.TwitterApi = void 0;\nconst client_v1_1 = __importDefault(require(\"../v1/client.v1\"));\nconst client_v2_1 = __importDefault(require(\"../v2/client.v2\"));\nconst readwrite_1 = __importDefault(require(\"./readwrite\"));\n// \"Real\" exported client for usage of TwitterApi.\n/**\n * Twitter v1.1 and v2 API client.\n */\nclass TwitterApi extends readwrite_1.default {\n /* Direct access to subclients */\n get v1() {\n if (this._v1)\n return this._v1;\n return this._v1 = new client_v1_1.default(this);\n }\n get v2() {\n if (this._v2)\n return this._v2;\n return this._v2 = new client_v2_1.default(this);\n }\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n /* Static helpers */\n static getErrors(error) {\n var _a;\n if (typeof error !== 'object')\n return [];\n if (!('data' in error))\n return [];\n return (_a = error.data.errors) !== null && _a !== void 0 ? _a : [];\n }\n /** Extract another image size than obtained in a `profile_image_url` or `profile_image_url_https` field of a user object. */\n static getProfileImageInSize(profileImageUrl, size) {\n const lastPart = profileImageUrl.split('/').pop();\n const sizes = ['normal', 'bigger', 'mini'];\n let originalUrl = profileImageUrl;\n for (const availableSize of sizes) {\n if (lastPart.includes(`_${availableSize}`)) {\n originalUrl = profileImageUrl.replace(`_${availableSize}`, '');\n break;\n }\n }\n if (size === 'original') {\n return originalUrl;\n }\n const extPos = originalUrl.lastIndexOf('.');\n if (extPos !== -1) {\n const ext = originalUrl.slice(extPos + 1);\n return originalUrl.slice(0, extPos) + '_' + size + '.' + ext;\n }\n else {\n return originalUrl + '_' + size;\n }\n }\n}\nexports.TwitterApi = TwitterApi;\nvar readwrite_2 = require(\"./readwrite\");\nObject.defineProperty(exports, \"TwitterApiReadWrite\", { enumerable: true, get: function () { return __importDefault(readwrite_2).default; } });\nvar readonly_1 = require(\"./readonly\");\nObject.defineProperty(exports, \"TwitterApiReadOnly\", { enumerable: true, get: function () { return __importDefault(readonly_1).default; } });\nexports.default = TwitterApi;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _1 = __importDefault(require(\".\"));\nconst client_base_1 = __importDefault(require(\"../client.base\"));\nconst client_v1_read_1 = __importDefault(require(\"../v1/client.v1.read\"));\nconst client_v2_read_1 = __importDefault(require(\"../v2/client.v2.read\"));\nconst oauth2_helper_1 = require(\"../client-mixins/oauth2.helper\");\nconst request_param_helper_1 = __importDefault(require(\"../client-mixins/request-param.helper\"));\n/**\n * Twitter v1.1 and v2 API client.\n */\nclass TwitterApiReadOnly extends client_base_1.default {\n /* Direct access to subclients */\n get v1() {\n if (this._v1)\n return this._v1;\n return this._v1 = new client_v1_read_1.default(this);\n }\n get v2() {\n if (this._v2)\n return this._v2;\n return this._v2 = new client_v2_read_1.default(this);\n }\n /**\n * Fetch and cache current user.\n * This method can only be called with a OAuth 1.0a user authentication.\n *\n * You can use this method to test if authentication was successful.\n * Next calls to this methods will use the cached user, unless `forceFetch: true` is given.\n */\n async currentUser(forceFetch = false) {\n return await this.getCurrentUserObject(forceFetch);\n }\n /**\n * Fetch and cache current user.\n * This method can only be called with a OAuth 1.0a or OAuth2 user authentication.\n *\n * This can only be the slimest available `UserV2` object, with only id, name and username properties defined.\n * To get a customized `UserV2Result`, use `.v2.me()`\n *\n * You can use this method to test if authentication was successful.\n * Next calls to this methods will use the cached user, unless `forceFetch: true` is given.\n *\n * OAuth2 scopes: `tweet.read` & `users.read`\n */\n async currentUserV2(forceFetch = false) {\n return await this.getCurrentUserV2Object(forceFetch);\n }\n /* Shortcuts to endpoints */\n search(what, options) {\n return this.v2.search(what, options);\n }\n /* Authentication */\n /**\n * Generate the OAuth request token link for user-based OAuth 1.0 auth.\n *\n * ```ts\n * // Instanciate TwitterApi with consumer keys\n * const client = new TwitterApi({ appKey: 'consumer_key', appSecret: 'consumer_secret' });\n *\n * const tokenRequest = await client.generateAuthLink('oob-or-your-callback-url');\n * // redirect end-user to tokenRequest.url\n *\n * // Save tokenRequest.oauth_token_secret somewhere, it will be needed for next auth step.\n * ```\n */\n async generateAuthLink(oauth_callback = 'oob', { authAccessType, linkMode = 'authenticate', forceLogin, screenName, } = {}) {\n const oauthResult = await this.post('https://api.twitter.com/oauth/request_token', { oauth_callback, x_auth_access_type: authAccessType });\n let url = `https://api.twitter.com/oauth/${linkMode}?oauth_token=${encodeURIComponent(oauthResult.oauth_token)}`;\n if (forceLogin !== undefined) {\n url += `&force_login=${encodeURIComponent(forceLogin)}`;\n }\n if (screenName !== undefined) {\n url += `&screen_name=${encodeURIComponent(screenName)}`;\n }\n if (this._requestMaker.hasPlugins()) {\n this._requestMaker.applyPluginMethod('onOAuth1RequestToken', {\n client: this._requestMaker,\n url,\n oauthResult,\n });\n }\n return {\n url,\n ...oauthResult,\n };\n }\n /**\n * Obtain access to user-based OAuth 1.0 auth.\n *\n * After user is redirect from your callback, use obtained oauth_token and oauth_verifier to\n * instanciate the new TwitterApi instance.\n *\n * ```ts\n * // Use the saved oauth_token_secret associated to oauth_token returned by callback\n * const requestClient = new TwitterApi({\n * appKey: 'consumer_key',\n * appSecret: 'consumer_secret',\n * accessToken: 'oauth_token',\n * accessSecret: 'oauth_token_secret'\n * });\n *\n * // Use oauth_verifier obtained from callback request\n * const { client: userClient } = await requestClient.login('oauth_verifier');\n *\n * // {userClient} is a valid {TwitterApi} object you can use for future requests\n * ```\n */\n async login(oauth_verifier) {\n const tokens = this.getActiveTokens();\n if (tokens.type !== 'oauth-1.0a')\n throw new Error('You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login');\n const oauth_result = await this.post('https://api.twitter.com/oauth/access_token', { oauth_token: tokens.accessToken, oauth_verifier });\n const client = new _1.default({\n appKey: tokens.appKey,\n appSecret: tokens.appSecret,\n accessToken: oauth_result.oauth_token,\n accessSecret: oauth_result.oauth_token_secret,\n }, this._requestMaker.clientSettings);\n return {\n accessToken: oauth_result.oauth_token,\n accessSecret: oauth_result.oauth_token_secret,\n userId: oauth_result.user_id,\n screenName: oauth_result.screen_name,\n client,\n };\n }\n /**\n * Enable application-only authentication.\n *\n * To make the request, instanciate TwitterApi with consumer and secret.\n *\n * ```ts\n * const requestClient = new TwitterApi({ appKey: 'consumer', appSecret: 'secret' });\n * const appClient = await requestClient.appLogin();\n *\n * // Use {appClient} to make requests\n * ```\n */\n async appLogin() {\n const tokens = this.getActiveTokens();\n if (tokens.type !== 'oauth-1.0a')\n throw new Error('You must setup TwitterApi instance with consumer keys to accept app-only login');\n // Create a client with Basic authentication\n const basicClient = new _1.default({ username: tokens.appKey, password: tokens.appSecret });\n const res = await basicClient.post('https://api.twitter.com/oauth2/token', { grant_type: 'client_credentials' });\n // New object with Bearer token\n return new _1.default(res.access_token, this._requestMaker.clientSettings);\n }\n /* OAuth 2 user authentication */\n /**\n * Generate the OAuth request token link for user-based OAuth 2.0 auth.\n *\n * - **You can only use v2 API endpoints with this authentication method.**\n * - **You need to specify which scope you want to have when you create your auth link. Make sure it matches your needs.**\n *\n * See https://developer.twitter.com/en/docs/authentication/oauth-2-0/user-access-token for details.\n *\n * ```ts\n * // Instanciate TwitterApi with client ID\n * const client = new TwitterApi({ clientId: 'yourClientId' });\n *\n * // Generate a link to callback URL that will gives a token with tweet+user read access\n * const link = client.generateOAuth2AuthLink('your-callback-url', { scope: ['tweet.read', 'users.read'] });\n *\n * // Extract props from generate link\n * const { url, state, codeVerifier } = link;\n *\n * // redirect end-user to url\n * // Save `state` and `codeVerifier` somewhere, it will be needed for next auth step.\n * ```\n */\n generateOAuth2AuthLink(redirectUri, options = {}) {\n var _a, _b;\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n const state = (_a = options.state) !== null && _a !== void 0 ? _a : oauth2_helper_1.OAuth2Helper.generateRandomString(32);\n const codeVerifier = oauth2_helper_1.OAuth2Helper.getCodeVerifier();\n const codeChallenge = oauth2_helper_1.OAuth2Helper.getCodeChallengeFromVerifier(codeVerifier);\n const rawScope = (_b = options.scope) !== null && _b !== void 0 ? _b : '';\n const scope = Array.isArray(rawScope) ? rawScope.join(' ') : rawScope;\n const url = new URL('https://twitter.com/i/oauth2/authorize');\n const query = {\n response_type: 'code',\n client_id: this._requestMaker.clientId,\n redirect_uri: redirectUri,\n state,\n code_challenge: codeChallenge,\n code_challenge_method: 's256',\n scope,\n };\n request_param_helper_1.default.addQueryParamsToUrl(url, query);\n const result = {\n url: url.toString(),\n state,\n codeVerifier,\n codeChallenge,\n };\n if (this._requestMaker.hasPlugins()) {\n this._requestMaker.applyPluginMethod('onOAuth2RequestToken', {\n client: this._requestMaker,\n result,\n redirectUri,\n });\n }\n return result;\n }\n /**\n * Obtain access to user-based OAuth 2.0 auth.\n *\n * After user is redirect from your callback, use obtained code to\n * instanciate the new TwitterApi instance.\n *\n * You need to obtain `codeVerifier` from a call to `.generateOAuth2AuthLink`.\n *\n * ```ts\n * // Use the saved codeVerifier associated to state (present in query string of callback)\n * const requestClient = new TwitterApi({ clientId: 'yourClientId' });\n *\n * const { client: userClient, refreshToken } = await requestClient.loginWithOAuth2({\n * code: 'codeFromQueryString',\n * // the same URL given to generateOAuth2AuthLink\n * redirectUri,\n * // the verifier returned by generateOAuth2AuthLink\n * codeVerifier,\n * });\n *\n * // {userClient} is a valid {TwitterApi} object you can use for future requests\n * // {refreshToken} is defined if 'offline.access' is in scope.\n * ```\n */\n async loginWithOAuth2({ code, codeVerifier, redirectUri }) {\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n const accessTokenResult = await this.post('https://api.twitter.com/2/oauth2/token', {\n code,\n code_verifier: codeVerifier,\n redirect_uri: redirectUri,\n grant_type: 'authorization_code',\n client_id: this._requestMaker.clientId,\n client_secret: this._requestMaker.clientSecret,\n });\n return this.parseOAuth2AccessTokenResult(accessTokenResult);\n }\n /**\n * Obtain a new access token to user-based OAuth 2.0 auth from a refresh token.\n *\n * ```ts\n * const requestClient = new TwitterApi({ clientId: 'yourClientId' });\n *\n * const { client: userClient } = await requestClient.refreshOAuth2Token('refreshToken');\n * // {userClient} is a valid {TwitterApi} object you can use for future requests\n * ```\n */\n async refreshOAuth2Token(refreshToken) {\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n const accessTokenResult = await this.post('https://api.twitter.com/2/oauth2/token', {\n refresh_token: refreshToken,\n grant_type: 'refresh_token',\n client_id: this._requestMaker.clientId,\n client_secret: this._requestMaker.clientSecret,\n });\n return this.parseOAuth2AccessTokenResult(accessTokenResult);\n }\n /**\n * Revoke a single user-based OAuth 2.0 token.\n *\n * You must specify its source, access token (directly after login)\n * or refresh token (if you've called `.refreshOAuth2Token` before).\n */\n async revokeOAuth2Token(token, tokenType = 'access_token') {\n if (!this._requestMaker.clientId) {\n throw new Error('Twitter API instance is not initialized with client ID. ' +\n 'Please build an instance with: new TwitterApi({ clientId: \\'\\' })');\n }\n return await this.post('https://api.twitter.com/2/oauth2/revoke', {\n client_id: this._requestMaker.clientId,\n client_secret: this._requestMaker.clientSecret,\n token,\n token_type_hint: tokenType,\n });\n }\n parseOAuth2AccessTokenResult(result) {\n const client = new _1.default(result.access_token, this._requestMaker.clientSettings);\n const scope = result.scope.split(' ').filter(e => e);\n return {\n client,\n expiresIn: result.expires_in,\n accessToken: result.access_token,\n scope,\n refreshToken: result.refresh_token,\n };\n }\n}\nexports.default = TwitterApiReadOnly;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_v1_write_1 = __importDefault(require(\"../v1/client.v1.write\"));\nconst client_v2_write_1 = __importDefault(require(\"../v2/client.v2.write\"));\nconst readonly_1 = __importDefault(require(\"./readonly\"));\n/**\n * Twitter v1.1 and v2 API client.\n */\nclass TwitterApiReadWrite extends readonly_1.default {\n /* Direct access to subclients */\n get v1() {\n if (this._v1)\n return this._v1;\n return this._v1 = new client_v1_write_1.default(this);\n }\n get v2() {\n if (this._v2)\n return this._v2;\n return this._v2 = new client_v2_write_1.default(this);\n }\n /**\n * Get a client with read only rights.\n */\n get readOnly() {\n return this;\n }\n}\nexports.default = TwitterApiReadWrite;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.API_V1_1_STREAM_PREFIX = exports.API_V1_1_UPLOAD_PREFIX = exports.API_V1_1_PREFIX = exports.API_V2_LABS_PREFIX = exports.API_V2_PREFIX = void 0;\nexports.API_V2_PREFIX = 'https://api.twitter.com/2/';\nexports.API_V2_LABS_PREFIX = 'https://api.twitter.com/labs/2/';\nexports.API_V1_1_PREFIX = 'https://api.twitter.com/1.1/';\nexports.API_V1_1_UPLOAD_PREFIX = 'https://upload.twitter.com/1.1/';\nexports.API_V1_1_STREAM_PREFIX = 'https://stream.twitter.com/1.1/';\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeDeprecationWarning = exports.hasMultipleItems = exports.isTweetStreamV2ErrorPayload = exports.trimUndefinedProperties = exports.arrayWrap = exports.sharedPromise = void 0;\nconst settings_1 = require(\"./settings\");\nfunction sharedPromise(getter) {\n const sharedPromise = {\n value: undefined,\n promise: getter().then(val => {\n sharedPromise.value = val;\n return val;\n }),\n };\n return sharedPromise;\n}\nexports.sharedPromise = sharedPromise;\nfunction arrayWrap(value) {\n if (Array.isArray(value)) {\n return value;\n }\n return [value];\n}\nexports.arrayWrap = arrayWrap;\nfunction trimUndefinedProperties(object) {\n // Delete undefined parameters\n for (const parameter in object) {\n if (object[parameter] === undefined)\n delete object[parameter];\n }\n}\nexports.trimUndefinedProperties = trimUndefinedProperties;\nfunction isTweetStreamV2ErrorPayload(payload) {\n // Is error only if 'errors' is present and 'data' does not exists\n return typeof payload === 'object'\n && 'errors' in payload\n && !('data' in payload);\n}\nexports.isTweetStreamV2ErrorPayload = isTweetStreamV2ErrorPayload;\nfunction hasMultipleItems(item) {\n if (Array.isArray(item) && item.length > 1) {\n return true;\n }\n return item.toString().includes(',');\n}\nexports.hasMultipleItems = hasMultipleItems;\nconst deprecationWarningsCache = new Set();\nfunction safeDeprecationWarning(message) {\n if (typeof console === 'undefined' || !console.warn || !settings_1.TwitterApiV2Settings.deprecationWarnings) {\n return;\n }\n const hash = `${message.instance}-${message.method}-${message.problem}`;\n if (deprecationWarningsCache.has(hash)) {\n return;\n }\n const formattedMsg = `[twitter-api-v2] Deprecation warning: In ${message.instance}.${message.method}() call` +\n `, ${message.problem}.\\n${message.resolution}.`;\n console.warn(formattedMsg);\n console.warn('To disable this message, import variable TwitterApiV2Settings from twitter-api-v2 and set TwitterApiV2Settings.deprecationWarnings to false.');\n deprecationWarningsCache.add(hash);\n}\nexports.safeDeprecationWarning = safeDeprecationWarning;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = void 0;\nvar client_1 = require(\"./client\");\nObject.defineProperty(exports, \"default\", { enumerable: true, get: function () { return __importDefault(client_1).default; } });\n__exportStar(require(\"./client\"), exports);\n__exportStar(require(\"./v1/client.v1\"), exports);\n__exportStar(require(\"./v2/client.v2\"), exports);\n__exportStar(require(\"./v2/includes.v2.helper\"), exports);\n__exportStar(require(\"./v2-labs/client.v2.labs\"), exports);\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./paginators\"), exports);\n__exportStar(require(\"./stream/TweetStream\"), exports);\n__exportStar(require(\"./settings\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PreviousableTwitterPaginator = exports.TwitterPaginator = void 0;\n/** TwitterPaginator: able to get consume data from initial request, then fetch next data sequentially. */\nclass TwitterPaginator {\n // noinspection TypeScriptAbstractClassConstructorCanBeMadeProtected\n constructor({ realData, rateLimit, instance, queryParams, sharedParams }) {\n this._maxResultsWhenFetchLast = 100;\n this._realData = realData;\n this._rateLimit = rateLimit;\n this._instance = instance;\n this._queryParams = queryParams;\n this._sharedParams = sharedParams;\n }\n get _isRateLimitOk() {\n const resetDate = this._rateLimit.reset * 1000;\n if (resetDate < Date.now()) {\n return true;\n }\n return this._rateLimit.remaining > 0;\n }\n makeRequest(queryParams) {\n return this._instance.get(this.getEndpoint(), queryParams, { fullResponse: true, params: this._sharedParams });\n }\n makeNewInstanceFromResult(result, queryParams) {\n // Construct a subclass\n return new this.constructor({\n realData: result.data,\n rateLimit: result.rateLimit,\n instance: this._instance,\n queryParams,\n sharedParams: this._sharedParams,\n });\n }\n getEndpoint() {\n return this._endpoint;\n }\n injectQueryParams(maxResults) {\n return {\n ...(maxResults ? { max_results: maxResults } : {}),\n ...this._queryParams,\n };\n }\n /* ---------------------- */\n /* Real paginator methods */\n /* ---------------------- */\n /**\n * Next page.\n */\n async next(maxResults) {\n const queryParams = this.getNextQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n return this.makeNewInstanceFromResult(result, queryParams);\n }\n /**\n * Next page, but store it in current instance.\n */\n async fetchNext(maxResults) {\n const queryParams = this.getNextQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n // Await in case of async sub-methods\n await this.refreshInstanceFromResult(result, true);\n return this;\n }\n /**\n * Fetch up to {count} items after current page,\n * as long as rate limit is not hit and Twitter has some results\n */\n async fetchLast(count = Infinity) {\n let queryParams = this.getNextQueryParams(this._maxResultsWhenFetchLast);\n let resultCount = 0;\n // Break at rate limit limit\n while (resultCount < count && this._isRateLimitOk) {\n const response = await this.makeRequest(queryParams);\n await this.refreshInstanceFromResult(response, true);\n resultCount += this.getPageLengthFromRequest(response);\n if (this.isFetchLastOver(response)) {\n break;\n }\n queryParams = this.getNextQueryParams(this._maxResultsWhenFetchLast);\n }\n return this;\n }\n get rateLimit() {\n return { ...this._rateLimit };\n }\n /** Get raw data returned by Twitter API. */\n get data() {\n return this._realData;\n }\n get done() {\n return !this.canFetchNextPage(this._realData);\n }\n /**\n * Iterate over currently fetched items.\n */\n *[Symbol.iterator]() {\n yield* this.getItemArray();\n }\n /**\n * Iterate over items \"undefinitely\" (until rate limit is hit / they're no more items available)\n * This will **mutate the current instance** and fill data, metas, etc. inside this instance.\n *\n * If you need to handle concurrent requests, or you need to rely on immutability, please use `.fetchAndIterate()` instead.\n */\n async *[Symbol.asyncIterator]() {\n yield* this.getItemArray();\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let paginator = this;\n let canFetchNextPage = this.canFetchNextPage(this._realData);\n while (canFetchNextPage && this._isRateLimitOk && paginator.getItemArray().length > 0) {\n const next = await paginator.next(this._maxResultsWhenFetchLast);\n // Store data into current instance [needed to access includes and meta]\n this.refreshInstanceFromResult({ data: next._realData, headers: {}, rateLimit: next._rateLimit }, true);\n canFetchNextPage = this.canFetchNextPage(next._realData);\n const items = next.getItemArray();\n yield* items;\n paginator = next;\n }\n }\n /**\n * Iterate over items \"undefinitely\" without modifying the current instance (until rate limit is hit / they're no more items available)\n *\n * This will **NOT** mutate the current instance, meaning that current instance will not inherit from `includes` and `meta` (v2 API only).\n * Use `Symbol.asyncIterator` (`for-await of`) to directly access items with current instance mutation.\n */\n async *fetchAndIterate() {\n for (const item of this.getItemArray()) {\n yield [item, this];\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let paginator = this;\n let canFetchNextPage = this.canFetchNextPage(this._realData);\n while (canFetchNextPage && this._isRateLimitOk && paginator.getItemArray().length > 0) {\n const next = await paginator.next(this._maxResultsWhenFetchLast);\n // Store data into current instance [needed to access includes and meta]\n this.refreshInstanceFromResult({ data: next._realData, headers: {}, rateLimit: next._rateLimit }, true);\n canFetchNextPage = this.canFetchNextPage(next._realData);\n for (const item of next.getItemArray()) {\n yield [item, next];\n }\n this._rateLimit = next._rateLimit;\n paginator = next;\n }\n }\n}\nexports.TwitterPaginator = TwitterPaginator;\n/** PreviousableTwitterPaginator: a TwitterPaginator able to get consume data from both side, next and previous. */\nclass PreviousableTwitterPaginator extends TwitterPaginator {\n /**\n * Previous page (new tweets)\n */\n async previous(maxResults) {\n const queryParams = this.getPreviousQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n return this.makeNewInstanceFromResult(result, queryParams);\n }\n /**\n * Previous page, but in current instance.\n */\n async fetchPrevious(maxResults) {\n const queryParams = this.getPreviousQueryParams(maxResults);\n const result = await this.makeRequest(queryParams);\n await this.refreshInstanceFromResult(result, false);\n return this;\n }\n}\nexports.PreviousableTwitterPaginator = PreviousableTwitterPaginator;\nexports.default = TwitterPaginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WelcomeDmV1Paginator = exports.DmEventsV1Paginator = void 0;\nconst paginator_v1_1 = require(\"./paginator.v1\");\nclass DmEventsV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'direct_messages/events/list.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.events.push(...result.events);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.events.length;\n }\n getItemArray() {\n return this.events;\n }\n /**\n * Events returned by paginator.\n */\n get events() {\n return this._realData.events;\n }\n}\nexports.DmEventsV1Paginator = DmEventsV1Paginator;\nclass WelcomeDmV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'direct_messages/welcome_messages/list.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.welcome_messages.push(...result.welcome_messages);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.welcome_messages.length;\n }\n getItemArray() {\n return this.welcomeMessages;\n }\n get welcomeMessages() {\n return this._realData.welcome_messages;\n }\n}\nexports.WelcomeDmV1Paginator = WelcomeDmV1Paginator;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./tweet.paginator.v2\"), exports);\n__exportStar(require(\"./TwitterPaginator\"), exports);\n__exportStar(require(\"./dm.paginator.v1\"), exports);\n__exportStar(require(\"./mutes.paginator.v1\"), exports);\n__exportStar(require(\"./tweet.paginator.v1\"), exports);\n__exportStar(require(\"./user.paginator.v1\"), exports);\n__exportStar(require(\"./user.paginator.v2\"), exports);\n__exportStar(require(\"./list.paginator.v1\"), exports);\n__exportStar(require(\"./list.paginator.v2\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ListSubscribersV1Paginator = exports.ListMembersV1Paginator = exports.ListSubscriptionsV1Paginator = exports.ListOwnershipsV1Paginator = exports.ListMembershipsV1Paginator = void 0;\nconst paginator_v1_1 = require(\"./paginator.v1\");\nclass ListListsV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.lists.push(...result.lists);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.lists.length;\n }\n getItemArray() {\n return this.lists;\n }\n /**\n * Lists returned by paginator.\n */\n get lists() {\n return this._realData.lists;\n }\n}\nclass ListMembershipsV1Paginator extends ListListsV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/memberships.json';\n }\n}\nexports.ListMembershipsV1Paginator = ListMembershipsV1Paginator;\nclass ListOwnershipsV1Paginator extends ListListsV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/ownerships.json';\n }\n}\nexports.ListOwnershipsV1Paginator = ListOwnershipsV1Paginator;\nclass ListSubscriptionsV1Paginator extends ListListsV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/subscriptions.json';\n }\n}\nexports.ListSubscriptionsV1Paginator = ListSubscriptionsV1Paginator;\nclass ListUsersV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.users.push(...result.users);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.users.length;\n }\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n return this._realData.users;\n }\n}\nclass ListMembersV1Paginator extends ListUsersV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/members.json';\n }\n}\nexports.ListMembersV1Paginator = ListMembersV1Paginator;\nclass ListSubscribersV1Paginator extends ListUsersV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/subscribers.json';\n }\n}\nexports.ListSubscribersV1Paginator = ListSubscribersV1Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserListFollowedV2Paginator = exports.UserListMembershipsV2Paginator = exports.UserOwnedListsV2Paginator = void 0;\nconst v2_paginator_1 = require(\"./v2.paginator\");\nclass ListTimelineV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n getItemArray() {\n return this.lists;\n }\n /**\n * Lists returned by paginator.\n */\n get lists() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\nclass UserOwnedListsV2Paginator extends ListTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/owned_lists';\n }\n}\nexports.UserOwnedListsV2Paginator = UserOwnedListsV2Paginator;\nclass UserListMembershipsV2Paginator extends ListTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/list_memberships';\n }\n}\nexports.UserListMembershipsV2Paginator = UserListMembershipsV2Paginator;\nclass UserListFollowedV2Paginator extends ListTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/followed_lists';\n }\n}\nexports.UserListFollowedV2Paginator = UserListFollowedV2Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MuteUserIdsV1Paginator = exports.MuteUserListV1Paginator = void 0;\nconst paginator_v1_1 = require(\"./paginator.v1\");\nclass MuteUserListV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'mutes/users/list.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.users.push(...result.users);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.users.length;\n }\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n return this._realData.users;\n }\n}\nexports.MuteUserListV1Paginator = MuteUserListV1Paginator;\nclass MuteUserIdsV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'mutes/users/ids.json';\n this._maxResultsWhenFetchLast = 5000;\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.ids.push(...result.ids);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.ids.length;\n }\n getItemArray() {\n return this.ids;\n }\n /**\n * Users IDs returned by paginator.\n */\n get ids() {\n return this._realData.ids;\n }\n}\nexports.MuteUserIdsV1Paginator = MuteUserIdsV1Paginator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CursoredV1Paginator = void 0;\nconst TwitterPaginator_1 = __importDefault(require(\"./TwitterPaginator\"));\nclass CursoredV1Paginator extends TwitterPaginator_1.default {\n getNextQueryParams(maxResults) {\n var _a;\n return {\n ...this._queryParams,\n cursor: (_a = this._realData.next_cursor_str) !== null && _a !== void 0 ? _a : this._realData.next_cursor,\n ...(maxResults ? { count: maxResults } : {}),\n };\n }\n isFetchLastOver(result) {\n // If we cant fetch next page\n return !this.canFetchNextPage(result.data);\n }\n canFetchNextPage(result) {\n // If one of cursor is valid\n return !this.isNextCursorInvalid(result.next_cursor) || !this.isNextCursorInvalid(result.next_cursor_str);\n }\n isNextCursorInvalid(value) {\n return value === undefined\n || value === 0\n || value === -1\n || value === '0'\n || value === '-1';\n }\n}\nexports.CursoredV1Paginator = CursoredV1Paginator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserFavoritesV1Paginator = exports.ListTimelineV1Paginator = exports.UserTimelineV1Paginator = exports.MentionTimelineV1Paginator = exports.HomeTimelineV1Paginator = void 0;\nconst TwitterPaginator_1 = __importDefault(require(\"./TwitterPaginator\"));\n/** A generic TwitterPaginator able to consume TweetV1 timelines. */\nclass TweetTimelineV1Paginator extends TwitterPaginator_1.default {\n constructor() {\n super(...arguments);\n this.hasFinishedFetch = false;\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.push(...result);\n // HINT: This is an approximation, as \"end\" of pagination cannot be safely determined without cursors.\n this.hasFinishedFetch = result.length === 0;\n }\n }\n getNextQueryParams(maxResults) {\n const lastestId = BigInt(this._realData[this._realData.length - 1].id_str);\n return {\n ...this.injectQueryParams(maxResults),\n max_id: (lastestId - BigInt(1)).toString(),\n };\n }\n getPageLengthFromRequest(result) {\n return result.data.length;\n }\n isFetchLastOver(result) {\n return !result.data.length;\n }\n canFetchNextPage(result) {\n return result.length > 0;\n }\n getItemArray() {\n return this.tweets;\n }\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n return this._realData;\n }\n get done() {\n return super.done || this.hasFinishedFetch;\n }\n}\n// Timelines\n// Home\nclass HomeTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'statuses/home_timeline.json';\n }\n}\nexports.HomeTimelineV1Paginator = HomeTimelineV1Paginator;\n// Mention\nclass MentionTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'statuses/mentions_timeline.json';\n }\n}\nexports.MentionTimelineV1Paginator = MentionTimelineV1Paginator;\n// User\nclass UserTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'statuses/user_timeline.json';\n }\n}\nexports.UserTimelineV1Paginator = UserTimelineV1Paginator;\n// Lists\nclass ListTimelineV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/statuses.json';\n }\n}\nexports.ListTimelineV1Paginator = ListTimelineV1Paginator;\n// Favorites\nclass UserFavoritesV1Paginator extends TweetTimelineV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'favorites/list.json';\n }\n}\nexports.UserFavoritesV1Paginator = UserFavoritesV1Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetV2ListTweetsPaginator = exports.TweetV2UserLikedTweetsPaginator = exports.TweetBookmarksTimelineV2Paginator = exports.TweetUserMentionTimelineV2Paginator = exports.TweetUserTimelineV2Paginator = exports.TweetHomeTimelineV2Paginator = exports.QuotedTweetsTimelineV2Paginator = exports.TweetSearchAllV2Paginator = exports.TweetSearchRecentV2Paginator = void 0;\nconst v2_paginator_1 = require(\"./v2.paginator\");\n/** A generic PreviousableTwitterPaginator able to consume TweetV2 timelines with since_id, until_id and next_token (when available). */\nclass TweetTimelineV2Paginator extends v2_paginator_1.TwitterV2Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n var _a;\n const result = response.data;\n const resultData = (_a = result.data) !== null && _a !== void 0 ? _a : [];\n this._rateLimit = response.rateLimit;\n if (!this._realData.data) {\n this._realData.data = [];\n }\n if (isNextPage) {\n this._realData.meta.oldest_id = result.meta.oldest_id;\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.meta.next_token = result.meta.next_token;\n this._realData.data.push(...resultData);\n }\n else {\n this._realData.meta.newest_id = result.meta.newest_id;\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.data.unshift(...resultData);\n }\n this.updateIncludes(result);\n }\n getNextQueryParams(maxResults) {\n this.assertUsable();\n const params = { ...this.injectQueryParams(maxResults) };\n if (this._realData.meta.next_token) {\n params.next_token = this._realData.meta.next_token;\n }\n else {\n if (params.start_time) {\n // until_id and start_time are forbidden together for some reason, so convert start_time to a since_id.\n params.since_id = this.dateStringToSnowflakeId(params.start_time);\n delete params.start_time;\n }\n if (params.end_time) {\n // until_id overrides end_time, so delete it\n delete params.end_time;\n }\n params.until_id = this._realData.meta.oldest_id;\n }\n return params;\n }\n getPreviousQueryParams(maxResults) {\n this.assertUsable();\n return {\n ...this.injectQueryParams(maxResults),\n since_id: this._realData.meta.newest_id,\n };\n }\n getPageLengthFromRequest(result) {\n var _a, _b;\n return (_b = (_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }\n isFetchLastOver(result) {\n var _a;\n return !((_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) || !this.canFetchNextPage(result.data);\n }\n canFetchNextPage(result) {\n return !!result.meta.next_token;\n }\n getItemArray() {\n return this.tweets;\n }\n dateStringToSnowflakeId(dateStr) {\n const TWITTER_START_EPOCH = BigInt('1288834974657');\n const date = new Date(dateStr);\n if (isNaN(date.valueOf())) {\n throw new Error('Unable to convert start_time/end_time to a valid date. A ISO 8601 DateTime is excepted, please check your input.');\n }\n const dateTimestamp = BigInt(date.valueOf());\n return ((dateTimestamp - TWITTER_START_EPOCH) << BigInt('22')).toString();\n }\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\n/** A generic PreviousableTwitterPaginator able to consume TweetV2 timelines with pagination_tokens. */\nclass TweetPaginableTimelineV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n super.refreshInstanceFromResult(response, isNextPage);\n const result = response.data;\n if (isNextPage) {\n this._realData.meta.oldest_id = result.meta.oldest_id;\n }\n else {\n this._realData.meta.newest_id = result.meta.newest_id;\n }\n }\n getItemArray() {\n return this.tweets;\n }\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\n// ----------------\n// - Tweet search -\n// ----------------\nclass TweetSearchRecentV2Paginator extends TweetTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/search/recent';\n }\n}\nexports.TweetSearchRecentV2Paginator = TweetSearchRecentV2Paginator;\nclass TweetSearchAllV2Paginator extends TweetTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/search/all';\n }\n}\nexports.TweetSearchAllV2Paginator = TweetSearchAllV2Paginator;\nclass QuotedTweetsTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/:id/quote_tweets';\n }\n}\nexports.QuotedTweetsTimelineV2Paginator = QuotedTweetsTimelineV2Paginator;\n// -----------------\n// - Home timeline -\n// -----------------\nclass TweetHomeTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/timelines/reverse_chronological';\n }\n}\nexports.TweetHomeTimelineV2Paginator = TweetHomeTimelineV2Paginator;\nclass TweetUserTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/tweets';\n }\n}\nexports.TweetUserTimelineV2Paginator = TweetUserTimelineV2Paginator;\nclass TweetUserMentionTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/mentions';\n }\n}\nexports.TweetUserMentionTimelineV2Paginator = TweetUserMentionTimelineV2Paginator;\n// -------------\n// - Bookmarks -\n// -------------\nclass TweetBookmarksTimelineV2Paginator extends TweetPaginableTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/bookmarks';\n }\n}\nexports.TweetBookmarksTimelineV2Paginator = TweetBookmarksTimelineV2Paginator;\n// ---------------------------------------------------------------------------------\n// - Tweet lists (consume tweets with pagination tokens instead of since/until id) -\n// ---------------------------------------------------------------------------------\n/** A generic TwitterPaginator able to consume TweetV2 timelines. */\nclass TweetListV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n /**\n * Tweets returned by paginator.\n */\n get tweets() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n getItemArray() {\n return this.tweets;\n }\n}\nclass TweetV2UserLikedTweetsPaginator extends TweetListV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/liked_tweets';\n }\n}\nexports.TweetV2UserLikedTweetsPaginator = TweetV2UserLikedTweetsPaginator;\nclass TweetV2ListTweetsPaginator extends TweetListV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/:id/tweets';\n }\n}\nexports.TweetV2ListTweetsPaginator = TweetV2ListTweetsPaginator;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FriendshipsOutgoingV1Paginator = exports.FriendshipsIncomingV1Paginator = exports.UserSearchV1Paginator = void 0;\nconst TwitterPaginator_1 = __importDefault(require(\"./TwitterPaginator\"));\nconst paginator_v1_1 = require(\"./paginator.v1\");\n/** A generic TwitterPaginator able to consume TweetV1 timelines. */\nclass UserSearchV1Paginator extends TwitterPaginator_1.default {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/search.json';\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.push(...result);\n }\n }\n getNextQueryParams(maxResults) {\n var _a;\n const previousPage = Number((_a = this._queryParams.page) !== null && _a !== void 0 ? _a : '1');\n return {\n ...this._queryParams,\n page: previousPage + 1,\n ...maxResults ? { count: maxResults } : {},\n };\n }\n getPageLengthFromRequest(result) {\n return result.data.length;\n }\n isFetchLastOver(result) {\n return !result.data.length;\n }\n canFetchNextPage(result) {\n return result.length > 0;\n }\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n return this._realData;\n }\n}\nexports.UserSearchV1Paginator = UserSearchV1Paginator;\nclass FriendshipsIncomingV1Paginator extends paginator_v1_1.CursoredV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'friendships/incoming.json';\n this._maxResultsWhenFetchLast = 5000;\n }\n refreshInstanceFromResult(response, isNextPage) {\n const result = response.data;\n this._rateLimit = response.rateLimit;\n if (isNextPage) {\n this._realData.ids.push(...result.ids);\n this._realData.next_cursor = result.next_cursor;\n }\n }\n getPageLengthFromRequest(result) {\n return result.data.ids.length;\n }\n getItemArray() {\n return this.ids;\n }\n /**\n * Users IDs returned by paginator.\n */\n get ids() {\n return this._realData.ids;\n }\n}\nexports.FriendshipsIncomingV1Paginator = FriendshipsIncomingV1Paginator;\nclass FriendshipsOutgoingV1Paginator extends FriendshipsIncomingV1Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'friendships/outgoing.json';\n }\n}\nexports.FriendshipsOutgoingV1Paginator = FriendshipsOutgoingV1Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetRetweetersUsersV2Paginator = exports.TweetLikingUsersV2Paginator = exports.UserListFollowersV2Paginator = exports.UserListMembersV2Paginator = exports.UserFollowingV2Paginator = exports.UserFollowersV2Paginator = exports.UserMutingUsersV2Paginator = exports.UserBlockingUsersV2Paginator = void 0;\nconst v2_paginator_1 = require(\"./v2.paginator\");\n/** A generic PreviousableTwitterPaginator able to consume UserV2 timelines. */\nclass UserTimelineV2Paginator extends v2_paginator_1.TimelineV2Paginator {\n getItemArray() {\n return this.users;\n }\n /**\n * Users returned by paginator.\n */\n get users() {\n var _a;\n return (_a = this._realData.data) !== null && _a !== void 0 ? _a : [];\n }\n get meta() {\n return super.meta;\n }\n}\nclass UserBlockingUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/blocking';\n }\n}\nexports.UserBlockingUsersV2Paginator = UserBlockingUsersV2Paginator;\nclass UserMutingUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/muting';\n }\n}\nexports.UserMutingUsersV2Paginator = UserMutingUsersV2Paginator;\nclass UserFollowersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/followers';\n }\n}\nexports.UserFollowersV2Paginator = UserFollowersV2Paginator;\nclass UserFollowingV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'users/:id/following';\n }\n}\nexports.UserFollowingV2Paginator = UserFollowingV2Paginator;\nclass UserListMembersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/:id/members';\n }\n}\nexports.UserListMembersV2Paginator = UserListMembersV2Paginator;\nclass UserListFollowersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'lists/:id/followers';\n }\n}\nexports.UserListFollowersV2Paginator = UserListFollowersV2Paginator;\nclass TweetLikingUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/:id/liking_users';\n }\n}\nexports.TweetLikingUsersV2Paginator = TweetLikingUsersV2Paginator;\nclass TweetRetweetersUsersV2Paginator extends UserTimelineV2Paginator {\n constructor() {\n super(...arguments);\n this._endpoint = 'tweets/:id/retweeted_by';\n }\n}\nexports.TweetRetweetersUsersV2Paginator = TweetRetweetersUsersV2Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TimelineV2Paginator = exports.TwitterV2Paginator = void 0;\nconst includes_v2_helper_1 = require(\"../v2/includes.v2.helper\");\nconst TwitterPaginator_1 = require(\"./TwitterPaginator\");\n/** A generic PreviousableTwitterPaginator with common v2 helper methods. */\nclass TwitterV2Paginator extends TwitterPaginator_1.PreviousableTwitterPaginator {\n updateIncludes(data) {\n // Update errors\n if (data.errors) {\n if (!this._realData.errors) {\n this._realData.errors = [];\n }\n this._realData.errors = [...this._realData.errors, ...data.errors];\n }\n // Update includes\n if (!data.includes) {\n return;\n }\n if (!this._realData.includes) {\n this._realData.includes = {};\n }\n const includesRealData = this._realData.includes;\n for (const [includeKey, includeArray] of Object.entries(data.includes)) {\n if (!includesRealData[includeKey]) {\n includesRealData[includeKey] = [];\n }\n includesRealData[includeKey] = [\n ...includesRealData[includeKey],\n ...includeArray,\n ];\n }\n }\n /** Throw if the current paginator is not usable. */\n assertUsable() {\n if (this.unusable) {\n throw new Error('Unable to use this paginator to fetch more data, as it does not contain any metadata.' +\n ' Check .errors property for more details.');\n }\n }\n get meta() {\n return this._realData.meta;\n }\n get includes() {\n var _a;\n if (!((_a = this._realData) === null || _a === void 0 ? void 0 : _a.includes)) {\n return new includes_v2_helper_1.TwitterV2IncludesHelper(this._realData);\n }\n if (this._includesInstance) {\n return this._includesInstance;\n }\n return this._includesInstance = new includes_v2_helper_1.TwitterV2IncludesHelper(this._realData);\n }\n get errors() {\n var _a;\n return (_a = this._realData.errors) !== null && _a !== void 0 ? _a : [];\n }\n /** `true` if this paginator only contains error payload and no metadata found to consume data. */\n get unusable() {\n return this.errors.length > 0 && !this._realData.meta && !this._realData.data;\n }\n}\nexports.TwitterV2Paginator = TwitterV2Paginator;\n/** A generic TwitterV2Paginator able to consume v2 timelines that use max_results and pagination tokens. */\nclass TimelineV2Paginator extends TwitterV2Paginator {\n refreshInstanceFromResult(response, isNextPage) {\n var _a;\n const result = response.data;\n const resultData = (_a = result.data) !== null && _a !== void 0 ? _a : [];\n this._rateLimit = response.rateLimit;\n if (!this._realData.data) {\n this._realData.data = [];\n }\n if (isNextPage) {\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.meta.next_token = result.meta.next_token;\n this._realData.data.push(...resultData);\n }\n else {\n this._realData.meta.result_count += result.meta.result_count;\n this._realData.meta.previous_token = result.meta.previous_token;\n this._realData.data.unshift(...resultData);\n }\n this.updateIncludes(result);\n }\n getNextQueryParams(maxResults) {\n this.assertUsable();\n return {\n ...this.injectQueryParams(maxResults),\n pagination_token: this._realData.meta.next_token,\n };\n }\n getPreviousQueryParams(maxResults) {\n this.assertUsable();\n return {\n ...this.injectQueryParams(maxResults),\n pagination_token: this._realData.meta.previous_token,\n };\n }\n getPageLengthFromRequest(result) {\n var _a, _b;\n return (_b = (_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }\n isFetchLastOver(result) {\n var _a;\n return !((_a = result.data.data) === null || _a === void 0 ? void 0 : _a.length) || !this.canFetchNextPage(result.data);\n }\n canFetchNextPage(result) {\n var _a;\n return !!((_a = result.meta) === null || _a === void 0 ? void 0 : _a.next_token);\n }\n}\nexports.TimelineV2Paginator = TimelineV2Paginator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.applyResponseHooks = exports.hasRequestErrorPlugins = void 0;\nconst types_1 = require(\"../types\");\n/* Plugin helpers */\nfunction hasRequestErrorPlugins(client) {\n var _a;\n if (!((_a = client.clientSettings.plugins) === null || _a === void 0 ? void 0 : _a.length)) {\n return false;\n }\n for (const plugin of client.clientSettings.plugins) {\n if (plugin.onRequestError || plugin.onResponseError) {\n return true;\n }\n }\n return false;\n}\nexports.hasRequestErrorPlugins = hasRequestErrorPlugins;\nasync function applyResponseHooks(requestParams, computedParams, requestOptions, error) {\n let override;\n if (error instanceof types_1.ApiRequestError || error instanceof types_1.ApiPartialResponseError) {\n override = await this.applyPluginMethod('onRequestError', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n error,\n });\n }\n else if (error instanceof types_1.ApiResponseError) {\n override = await this.applyPluginMethod('onResponseError', {\n client: this,\n url: this.getUrlObjectFromUrlString(requestParams.url),\n params: requestParams,\n computedParams,\n requestOptions,\n error,\n });\n }\n if (override && override instanceof types_1.TwitterApiPluginResponseOverride) {\n return override.value;\n }\n return Promise.reject(error);\n}\nexports.applyResponseHooks = applyResponseHooks;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiV2Settings = void 0;\nexports.TwitterApiV2Settings = {\n debug: false,\n deprecationWarnings: true,\n logger: { log: console.log.bind(console) },\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetStream = void 0;\nconst events_1 = require(\"events\");\nconst request_handler_helper_1 = __importDefault(require(\"../client-mixins/request-handler.helper\"));\nconst types_1 = require(\"../types\");\nconst TweetStreamEventCombiner_1 = __importDefault(require(\"./TweetStreamEventCombiner\"));\nconst TweetStreamParser_1 = __importStar(require(\"./TweetStreamParser\"));\n// In seconds\nconst basicRetriesAttempt = [5, 15, 30, 60, 90, 120, 180, 300, 600, 900];\n// Default retry function\nconst basicReconnectRetry = tryOccurence => tryOccurence > basicRetriesAttempt.length\n ? 901000\n : basicRetriesAttempt[tryOccurence - 1] * 1000;\nclass TweetStream extends events_1.EventEmitter {\n constructor(requestData, connection) {\n super();\n this.requestData = requestData;\n this.autoReconnect = false;\n this.autoReconnectRetries = 5;\n // 2 minutes without any Twitter signal\n this.keepAliveTimeoutMs = 1000 * 120;\n this.nextRetryTimeout = basicReconnectRetry;\n this.parser = new TweetStreamParser_1.default();\n this.connectionProcessRunning = false;\n this.onKeepAliveTimeout = this.onKeepAliveTimeout.bind(this);\n this.initEventsFromParser();\n if (connection) {\n this.req = connection.req;\n this.res = connection.res;\n this.originalResponse = connection.originalResponse;\n this.initEventsFromRequest();\n }\n }\n on(event, handler) {\n return super.on(event, handler);\n }\n initEventsFromRequest() {\n if (!this.req || !this.res) {\n throw new Error('TweetStream error: You cannot init TweetStream without a request and response object.');\n }\n const errorHandler = (err) => {\n this.emit(types_1.ETwitterStreamEvent.ConnectionError, err);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.ConnectionError,\n error: err,\n message: 'Connection lost or closed by Twitter.',\n });\n this.onConnectionError();\n };\n this.req.on('error', errorHandler);\n this.res.on('error', errorHandler);\n // Usually, connection should not be closed by Twitter!\n this.res.on('close', () => errorHandler(new Error('Connection closed by Twitter.')));\n this.res.on('data', (chunk) => {\n this.resetKeepAliveTimeout();\n if (chunk.toString() === '\\r\\n') {\n return this.emit(types_1.ETwitterStreamEvent.DataKeepAlive);\n }\n this.parser.push(chunk.toString());\n });\n // Starts the keep alive timeout\n this.resetKeepAliveTimeout();\n }\n initEventsFromParser() {\n const payloadIsError = this.requestData.payloadIsError;\n this.parser.on(TweetStreamParser_1.EStreamParserEvent.ParsedData, (eventData) => {\n if (payloadIsError && payloadIsError(eventData)) {\n this.emit(types_1.ETwitterStreamEvent.DataError, eventData);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.DataError,\n error: eventData,\n message: 'Twitter sent a payload that is detected as an error payload.',\n });\n }\n else {\n this.emit(types_1.ETwitterStreamEvent.Data, eventData);\n }\n });\n this.parser.on(TweetStreamParser_1.EStreamParserEvent.ParseError, (error) => {\n this.emit(types_1.ETwitterStreamEvent.TweetParseError, error);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.TweetParseError,\n error,\n message: 'Failed to parse stream data.',\n });\n });\n }\n resetKeepAliveTimeout() {\n this.unbindKeepAliveTimeout();\n if (this.keepAliveTimeoutMs !== Infinity) {\n this.keepAliveTimeout = setTimeout(this.onKeepAliveTimeout, this.keepAliveTimeoutMs);\n }\n }\n onKeepAliveTimeout() {\n this.emit(types_1.ETwitterStreamEvent.ConnectionLost);\n this.onConnectionError();\n }\n unbindTimeouts() {\n this.unbindRetryTimeout();\n this.unbindKeepAliveTimeout();\n }\n unbindKeepAliveTimeout() {\n if (this.keepAliveTimeout) {\n clearTimeout(this.keepAliveTimeout);\n this.keepAliveTimeout = undefined;\n }\n }\n unbindRetryTimeout() {\n if (this.retryTimeout) {\n clearTimeout(this.retryTimeout);\n this.retryTimeout = undefined;\n }\n }\n closeWithoutEmit() {\n this.unbindTimeouts();\n if (this.res) {\n this.res.removeAllListeners();\n // Close response silentely\n this.res.destroy();\n }\n if (this.req) {\n this.req.removeAllListeners();\n // Close connection silentely\n this.req.destroy();\n }\n }\n /** Terminate connection to Twitter. */\n close() {\n this.emit(types_1.ETwitterStreamEvent.ConnectionClosed);\n this.closeWithoutEmit();\n }\n /** Unbind all listeners, and close connection. */\n destroy() {\n this.removeAllListeners();\n this.close();\n }\n /**\n * Make a new request that creates a new `TweetStream` instance with\n * the same parameters, and bind current listeners to new stream.\n */\n async clone() {\n const newRequest = new request_handler_helper_1.default(this.requestData);\n const newStream = await newRequest.makeRequestAsStream();\n // Clone attached listeners\n const listenerNames = this.eventNames();\n for (const listener of listenerNames) {\n const callbacks = this.listeners(listener);\n for (const callback of callbacks) {\n newStream.on(listener, callback);\n }\n }\n return newStream;\n }\n /** Start initial stream connection, setup options on current instance and returns itself. */\n async connect(options = {}) {\n if (typeof options.autoReconnect !== 'undefined') {\n this.autoReconnect = options.autoReconnect;\n }\n if (typeof options.autoReconnectRetries !== 'undefined') {\n this.autoReconnectRetries = options.autoReconnectRetries === 'unlimited'\n ? Infinity\n : options.autoReconnectRetries;\n }\n if (typeof options.keepAliveTimeout !== 'undefined') {\n this.keepAliveTimeoutMs = options.keepAliveTimeout === 'disable'\n ? Infinity\n : options.keepAliveTimeout;\n }\n if (typeof options.nextRetryTimeout !== 'undefined') {\n this.nextRetryTimeout = options.nextRetryTimeout;\n }\n // Make the connection\n this.unbindTimeouts();\n try {\n await this.reconnect();\n }\n catch (e) {\n this.emit(types_1.ETwitterStreamEvent.ConnectError, 0);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.ConnectError,\n error: e,\n message: 'Connect error - Initial connection just failed.',\n });\n // Only make a reconnection attempt if autoReconnect is true!\n // Otherwise, let error be propagated\n if (this.autoReconnect) {\n this.makeAutoReconnectRetry(0, e);\n }\n else {\n throw e;\n }\n }\n return this;\n }\n /** Make a new request to (re)connect to Twitter. */\n async reconnect() {\n if (this.connectionProcessRunning) {\n throw new Error('Connection process is already running.');\n }\n this.connectionProcessRunning = true;\n try {\n let initialConnection = true;\n if (this.req) {\n initialConnection = false;\n this.closeWithoutEmit();\n }\n const { req, res, originalResponse } = await new request_handler_helper_1.default(this.requestData).makeRequestAndResolveWhenReady();\n this.req = req;\n this.res = res;\n this.originalResponse = originalResponse;\n this.emit(initialConnection ? types_1.ETwitterStreamEvent.Connected : types_1.ETwitterStreamEvent.Reconnected);\n this.parser.reset();\n this.initEventsFromRequest();\n }\n finally {\n this.connectionProcessRunning = false;\n }\n }\n async onConnectionError(retryOccurence = 0) {\n this.unbindTimeouts();\n // Close the request if necessary\n this.closeWithoutEmit();\n // Terminate stream by events if necessary (no auto-reconnect or retries exceeded)\n if (!this.autoReconnect) {\n this.emit(types_1.ETwitterStreamEvent.ConnectionClosed);\n return;\n }\n if (retryOccurence >= this.autoReconnectRetries) {\n this.emit(types_1.ETwitterStreamEvent.ReconnectLimitExceeded);\n this.emit(types_1.ETwitterStreamEvent.ConnectionClosed);\n return;\n }\n // If all other conditions fails, do a reconnect attempt\n try {\n this.emit(types_1.ETwitterStreamEvent.ReconnectAttempt, retryOccurence);\n await this.reconnect();\n }\n catch (e) {\n this.emit(types_1.ETwitterStreamEvent.ReconnectError, retryOccurence);\n this.emit(types_1.ETwitterStreamEvent.Error, {\n type: types_1.ETwitterStreamEvent.ReconnectError,\n error: e,\n message: `Reconnect error - ${retryOccurence + 1} attempts made yet.`,\n });\n this.makeAutoReconnectRetry(retryOccurence, e);\n }\n }\n makeAutoReconnectRetry(retryOccurence, error) {\n const nextRetry = this.nextRetryTimeout(retryOccurence + 1, error);\n this.retryTimeout = setTimeout(() => {\n this.onConnectionError(retryOccurence + 1);\n }, nextRetry);\n }\n async *[Symbol.asyncIterator]() {\n const eventCombiner = new TweetStreamEventCombiner_1.default(this);\n try {\n while (true) {\n if (!this.req || this.req.aborted) {\n throw new Error('Connection closed');\n }\n if (eventCombiner.hasStack()) {\n yield* eventCombiner.popStack();\n }\n const { type, payload } = await eventCombiner.nextEvent();\n if (type === 'error') {\n throw payload;\n }\n }\n }\n finally {\n eventCombiner.destroy();\n }\n }\n}\nexports.TweetStream = TweetStream;\nexports.default = TweetStream;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TweetStreamEventCombiner = void 0;\nconst events_1 = require(\"events\");\nconst types_1 = require(\"../types\");\nclass TweetStreamEventCombiner extends events_1.EventEmitter {\n constructor(stream) {\n super();\n this.stream = stream;\n this.stack = [];\n this.onStreamData = this.onStreamData.bind(this);\n this.onStreamError = this.onStreamError.bind(this);\n this.onceNewEvent = this.once.bind(this, 'event');\n // Init events from stream\n stream.on(types_1.ETwitterStreamEvent.Data, this.onStreamData);\n // Ignore reconnect errors: Don't close event combiner until connection error/closed\n stream.on(types_1.ETwitterStreamEvent.ConnectionError, this.onStreamError);\n stream.on(types_1.ETwitterStreamEvent.TweetParseError, this.onStreamError);\n stream.on(types_1.ETwitterStreamEvent.ConnectionClosed, this.onStreamError);\n }\n /** Returns a new `Promise` that will `resolve` on next event (`data` or any sort of error). */\n nextEvent() {\n return new Promise(this.onceNewEvent);\n }\n /** Returns `true` if there's something in the stack. */\n hasStack() {\n return this.stack.length > 0;\n }\n /** Returns stacked data events, and clean the stack. */\n popStack() {\n const stack = this.stack;\n this.stack = [];\n return stack;\n }\n /** Cleanup all the listeners attached on stream. */\n destroy() {\n this.removeAllListeners();\n this.stream.off(types_1.ETwitterStreamEvent.Data, this.onStreamData);\n this.stream.off(types_1.ETwitterStreamEvent.ConnectionError, this.onStreamError);\n this.stream.off(types_1.ETwitterStreamEvent.TweetParseError, this.onStreamError);\n this.stream.off(types_1.ETwitterStreamEvent.ConnectionClosed, this.onStreamError);\n }\n emitEvent(type, payload) {\n this.emit('event', { type, payload });\n }\n onStreamError(payload) {\n this.emitEvent('error', payload);\n }\n onStreamData(payload) {\n this.stack.push(payload);\n this.emitEvent('data', payload);\n }\n}\nexports.TweetStreamEventCombiner = TweetStreamEventCombiner;\nexports.default = TweetStreamEventCombiner;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EStreamParserEvent = void 0;\nconst events_1 = require(\"events\");\nclass TweetStreamParser extends events_1.EventEmitter {\n constructor() {\n super(...arguments);\n this.currentMessage = '';\n }\n // Code partially belongs to twitter-stream-api for this\n // https://github.com/trygve-lie/twitter-stream-api/blob/master/lib/parser.js\n push(chunk) {\n this.currentMessage += chunk;\n chunk = this.currentMessage;\n const size = chunk.length;\n let start = 0;\n let offset = 0;\n while (offset < size) {\n // Take [offset, offset+1] inside a new string\n if (chunk.slice(offset, offset + 2) === '\\r\\n') {\n // If chunk contains \\r\\n after current offset,\n // parse [start, ..., offset] as a tweet\n const piece = chunk.slice(start, offset);\n start = offset += 2;\n // If empty object\n if (!piece.length) {\n continue;\n }\n try {\n const payload = JSON.parse(piece);\n if (payload) {\n this.emit(EStreamParserEvent.ParsedData, payload);\n continue;\n }\n }\n catch (error) {\n this.emit(EStreamParserEvent.ParseError, error);\n }\n }\n offset++;\n }\n this.currentMessage = chunk.slice(start, size);\n }\n /** Reset the currently stored message (f.e. on connection reset) */\n reset() {\n this.currentMessage = '';\n }\n}\nexports.default = TweetStreamParser;\nvar EStreamParserEvent;\n(function (EStreamParserEvent) {\n EStreamParserEvent[\"ParsedData\"] = \"parsed data\";\n EStreamParserEvent[\"ParseError\"] = \"parse error\";\n})(EStreamParserEvent = exports.EStreamParserEvent || (exports.EStreamParserEvent = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ETwitterStreamEvent = void 0;\nvar ETwitterStreamEvent;\n(function (ETwitterStreamEvent) {\n ETwitterStreamEvent[\"Connected\"] = \"connected\";\n ETwitterStreamEvent[\"ConnectError\"] = \"connect error\";\n ETwitterStreamEvent[\"ConnectionError\"] = \"connection error\";\n ETwitterStreamEvent[\"ConnectionClosed\"] = \"connection closed\";\n ETwitterStreamEvent[\"ConnectionLost\"] = \"connection lost\";\n ETwitterStreamEvent[\"ReconnectAttempt\"] = \"reconnect attempt\";\n ETwitterStreamEvent[\"Reconnected\"] = \"reconnected\";\n ETwitterStreamEvent[\"ReconnectError\"] = \"reconnect error\";\n ETwitterStreamEvent[\"ReconnectLimitExceeded\"] = \"reconnect limit exceeded\";\n ETwitterStreamEvent[\"DataKeepAlive\"] = \"data keep-alive\";\n ETwitterStreamEvent[\"Data\"] = \"data event content\";\n ETwitterStreamEvent[\"DataError\"] = \"data twitter error\";\n ETwitterStreamEvent[\"TweetParseError\"] = \"data tweet parse error\";\n ETwitterStreamEvent[\"Error\"] = \"stream error\";\n})(ETwitterStreamEvent = exports.ETwitterStreamEvent || (exports.ETwitterStreamEvent = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EApiV2ErrorCode = exports.EApiV1ErrorCode = exports.ApiResponseError = exports.ApiPartialResponseError = exports.ApiRequestError = exports.ETwitterApiError = void 0;\nvar ETwitterApiError;\n(function (ETwitterApiError) {\n ETwitterApiError[\"Request\"] = \"request\";\n ETwitterApiError[\"PartialResponse\"] = \"partial-response\";\n ETwitterApiError[\"Response\"] = \"response\";\n})(ETwitterApiError = exports.ETwitterApiError || (exports.ETwitterApiError = {}));\n/* ERRORS INSTANCES */\nclass ApiError extends Error {\n constructor() {\n super(...arguments);\n this.error = true;\n }\n}\nclass ApiRequestError extends ApiError {\n constructor(message, options) {\n super(message);\n this.type = ETwitterApiError.Request;\n Error.captureStackTrace(this, this.constructor);\n // Do not show on Node stack trace\n Object.defineProperty(this, '_options', { value: options });\n }\n get request() {\n return this._options.request;\n }\n get requestError() {\n return this._options.requestError;\n }\n toJSON() {\n return {\n type: this.type,\n error: this.requestError,\n };\n }\n}\nexports.ApiRequestError = ApiRequestError;\nclass ApiPartialResponseError extends ApiError {\n constructor(message, options) {\n super(message);\n this.type = ETwitterApiError.PartialResponse;\n Error.captureStackTrace(this, this.constructor);\n // Do not show on Node stack trace\n Object.defineProperty(this, '_options', { value: options });\n }\n get request() {\n return this._options.request;\n }\n get response() {\n return this._options.response;\n }\n get responseError() {\n return this._options.responseError;\n }\n get rawContent() {\n return this._options.rawContent;\n }\n toJSON() {\n return {\n type: this.type,\n error: this.responseError,\n };\n }\n}\nexports.ApiPartialResponseError = ApiPartialResponseError;\nclass ApiResponseError extends ApiError {\n constructor(message, options) {\n super(message);\n this.type = ETwitterApiError.Response;\n Error.captureStackTrace(this, this.constructor);\n // Do not show on Node stack trace\n Object.defineProperty(this, '_options', { value: options });\n this.code = options.code;\n this.headers = options.headers;\n this.rateLimit = options.rateLimit;\n this.data = options.data;\n }\n get request() {\n return this._options.request;\n }\n get response() {\n return this._options.response;\n }\n /** Check for presence of one of given v1/v2 error codes. */\n hasErrorCode(...codes) {\n const errors = this.errors;\n // No errors\n if (!(errors === null || errors === void 0 ? void 0 : errors.length)) {\n return false;\n }\n // v1 errors\n if ('code' in errors[0]) {\n const v1errors = errors;\n return v1errors.some(error => codes.includes(error.code));\n }\n // v2 error\n const v2error = this.data;\n return codes.includes(v2error.type);\n }\n get errors() {\n var _a;\n return (_a = this.data) === null || _a === void 0 ? void 0 : _a.errors;\n }\n get rateLimitError() {\n return this.code === 420 || this.code === 429;\n }\n get isAuthError() {\n if (this.code === 401) {\n return true;\n }\n return this.hasErrorCode(EApiV1ErrorCode.AuthTimestampInvalid, EApiV1ErrorCode.AuthenticationFail, EApiV1ErrorCode.BadAuthenticationData, EApiV1ErrorCode.InvalidOrExpiredToken);\n }\n toJSON() {\n return {\n type: this.type,\n code: this.code,\n error: this.data,\n rateLimit: this.rateLimit,\n headers: this.headers,\n };\n }\n}\nexports.ApiResponseError = ApiResponseError;\nvar EApiV1ErrorCode;\n(function (EApiV1ErrorCode) {\n // Location errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidCoordinates\"] = 3] = \"InvalidCoordinates\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoLocationFound\"] = 13] = \"NoLocationFound\";\n // Authentication failures\n EApiV1ErrorCode[EApiV1ErrorCode[\"AuthenticationFail\"] = 32] = \"AuthenticationFail\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidOrExpiredToken\"] = 89] = \"InvalidOrExpiredToken\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"UnableToVerifyCredentials\"] = 99] = \"UnableToVerifyCredentials\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"AuthTimestampInvalid\"] = 135] = \"AuthTimestampInvalid\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"BadAuthenticationData\"] = 215] = \"BadAuthenticationData\";\n // Resources not found or visible\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoUserMatch\"] = 17] = \"NoUserMatch\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"UserNotFound\"] = 50] = \"UserNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"ResourceNotFound\"] = 34] = \"ResourceNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetNotFound\"] = 144] = \"TweetNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetNotVisible\"] = 179] = \"TweetNotVisible\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NotAllowedResource\"] = 220] = \"NotAllowedResource\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"MediaIdNotFound\"] = 325] = \"MediaIdNotFound\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetNoLongerAvailable\"] = 421] = \"TweetNoLongerAvailable\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetViolatedRules\"] = 422] = \"TweetViolatedRules\";\n // Account errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"TargetUserSuspended\"] = 63] = \"TargetUserSuspended\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"YouAreSuspended\"] = 64] = \"YouAreSuspended\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"AccountUpdateFailed\"] = 120] = \"AccountUpdateFailed\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoSelfSpamReport\"] = 36] = \"NoSelfSpamReport\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoSelfMute\"] = 271] = \"NoSelfMute\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"AccountLocked\"] = 326] = \"AccountLocked\";\n // Application live errors / Twitter errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"RateLimitExceeded\"] = 88] = \"RateLimitExceeded\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoDMRightForApp\"] = 93] = \"NoDMRightForApp\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"OverCapacity\"] = 130] = \"OverCapacity\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InternalError\"] = 131] = \"InternalError\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TooManyFollowings\"] = 161] = \"TooManyFollowings\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetLimitExceeded\"] = 185] = \"TweetLimitExceeded\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"DuplicatedTweet\"] = 187] = \"DuplicatedTweet\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TooManySpamReports\"] = 205] = \"TooManySpamReports\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"RequestLooksLikeSpam\"] = 226] = \"RequestLooksLikeSpam\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoWriteRightForApp\"] = 261] = \"NoWriteRightForApp\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetActionsDisabled\"] = 425] = \"TweetActionsDisabled\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetRepliesRestricted\"] = 433] = \"TweetRepliesRestricted\";\n // Invalid request parameters\n EApiV1ErrorCode[EApiV1ErrorCode[\"NamedParameterMissing\"] = 38] = \"NamedParameterMissing\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidAttachmentUrl\"] = 44] = \"InvalidAttachmentUrl\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetTextTooLong\"] = 186] = \"TweetTextTooLong\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"MissingUrlParameter\"] = 195] = \"MissingUrlParameter\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"NoMultipleGifs\"] = 323] = \"NoMultipleGifs\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidMediaIds\"] = 324] = \"InvalidMediaIds\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"InvalidUrl\"] = 407] = \"InvalidUrl\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TooManyTweetAttachments\"] = 386] = \"TooManyTweetAttachments\";\n // Already sent/deleted item\n EApiV1ErrorCode[EApiV1ErrorCode[\"StatusAlreadyFavorited\"] = 139] = \"StatusAlreadyFavorited\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"FollowRequestAlreadySent\"] = 160] = \"FollowRequestAlreadySent\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"CannotUnmuteANonMutedAccount\"] = 272] = \"CannotUnmuteANonMutedAccount\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"TweetAlreadyRetweeted\"] = 327] = \"TweetAlreadyRetweeted\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"ReplyToDeletedTweet\"] = 385] = \"ReplyToDeletedTweet\";\n // DM Errors\n EApiV1ErrorCode[EApiV1ErrorCode[\"DMReceiverNotFollowingYou\"] = 150] = \"DMReceiverNotFollowingYou\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"UnableToSendDM\"] = 151] = \"UnableToSendDM\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"MustAllowDMFromAnyone\"] = 214] = \"MustAllowDMFromAnyone\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"CannotSendDMToThisUser\"] = 349] = \"CannotSendDMToThisUser\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"DMTextTooLong\"] = 354] = \"DMTextTooLong\";\n // Appication misconfiguration\n EApiV1ErrorCode[EApiV1ErrorCode[\"SubscriptionAlreadyExists\"] = 355] = \"SubscriptionAlreadyExists\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"CallbackUrlNotApproved\"] = 415] = \"CallbackUrlNotApproved\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"SuspendedApplication\"] = 416] = \"SuspendedApplication\";\n EApiV1ErrorCode[EApiV1ErrorCode[\"OobOauthIsNotAllowed\"] = 417] = \"OobOauthIsNotAllowed\";\n})(EApiV1ErrorCode = exports.EApiV1ErrorCode || (exports.EApiV1ErrorCode = {}));\nvar EApiV2ErrorCode;\n(function (EApiV2ErrorCode) {\n // Request errors\n EApiV2ErrorCode[\"InvalidRequest\"] = \"https://api.twitter.com/2/problems/invalid-request\";\n EApiV2ErrorCode[\"ClientForbidden\"] = \"https://api.twitter.com/2/problems/client-forbidden\";\n EApiV2ErrorCode[\"UnsupportedAuthentication\"] = \"https://api.twitter.com/2/problems/unsupported-authentication\";\n // Stream rules errors\n EApiV2ErrorCode[\"InvalidRules\"] = \"https://api.twitter.com/2/problems/invalid-rules\";\n EApiV2ErrorCode[\"TooManyRules\"] = \"https://api.twitter.com/2/problems/rule-cap\";\n EApiV2ErrorCode[\"DuplicatedRules\"] = \"https://api.twitter.com/2/problems/duplicate-rules\";\n // Twitter errors\n EApiV2ErrorCode[\"RateLimitExceeded\"] = \"https://api.twitter.com/2/problems/usage-capped\";\n EApiV2ErrorCode[\"ConnectionError\"] = \"https://api.twitter.com/2/problems/streaming-connection\";\n EApiV2ErrorCode[\"ClientDisconnected\"] = \"https://api.twitter.com/2/problems/client-disconnected\";\n EApiV2ErrorCode[\"TwitterDisconnectedYou\"] = \"https://api.twitter.com/2/problems/operational-disconnect\";\n // Resource errors\n EApiV2ErrorCode[\"ResourceNotFound\"] = \"https://api.twitter.com/2/problems/resource-not-found\";\n EApiV2ErrorCode[\"ResourceUnauthorized\"] = \"https://api.twitter.com/2/problems/not-authorized-for-resource\";\n EApiV2ErrorCode[\"DisallowedResource\"] = \"https://api.twitter.com/2/problems/disallowed-resource\";\n})(EApiV2ErrorCode = exports.EApiV2ErrorCode || (exports.EApiV2ErrorCode = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./v1\"), exports);\n__exportStar(require(\"./v2\"), exports);\n__exportStar(require(\"./errors.types\"), exports);\n__exportStar(require(\"./responses.types\"), exports);\n__exportStar(require(\"./client.types\"), exports);\n__exportStar(require(\"./auth.types\"), exports);\n__exportStar(require(\"./plugins\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiPluginResponseOverride = void 0;\nclass TwitterApiPluginResponseOverride {\n constructor(value) {\n this.value = value;\n }\n}\nexports.TwitterApiPluginResponseOverride = TwitterApiPluginResponseOverride;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./client.plugins.types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EDirectMessageEventTypeV1 = void 0;\n// Creation of DMs\nvar EDirectMessageEventTypeV1;\n(function (EDirectMessageEventTypeV1) {\n EDirectMessageEventTypeV1[\"Create\"] = \"message_create\";\n EDirectMessageEventTypeV1[\"WelcomeCreate\"] = \"welcome_message\";\n})(EDirectMessageEventTypeV1 = exports.EDirectMessageEventTypeV1 || (exports.EDirectMessageEventTypeV1 = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./streaming.v1.types\"), exports);\n__exportStar(require(\"./tweet.v1.types\"), exports);\n__exportStar(require(\"./entities.v1.types\"), exports);\n__exportStar(require(\"./user.v1.types\"), exports);\n__exportStar(require(\"./dev-utilities.v1.types\"), exports);\n__exportStar(require(\"./geo.v1.types\"), exports);\n__exportStar(require(\"./trends.v1.types\"), exports);\n__exportStar(require(\"./dm.v1.types\"), exports);\n__exportStar(require(\"./list.v1.types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EUploadMimeType = void 0;\nvar EUploadMimeType;\n(function (EUploadMimeType) {\n EUploadMimeType[\"Jpeg\"] = \"image/jpeg\";\n EUploadMimeType[\"Mp4\"] = \"video/mp4\";\n EUploadMimeType[\"Gif\"] = \"image/gif\";\n EUploadMimeType[\"Png\"] = \"image/png\";\n EUploadMimeType[\"Srt\"] = \"text/plain\";\n EUploadMimeType[\"Webp\"] = \"image/webp\";\n})(EUploadMimeType = exports.EUploadMimeType || (exports.EUploadMimeType = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./streaming.v2.types\"), exports);\n__exportStar(require(\"./tweet.v2.types\"), exports);\n__exportStar(require(\"./tweet.definition.v2\"), exports);\n__exportStar(require(\"./user.v2.types\"), exports);\n__exportStar(require(\"./spaces.v2.types\"), exports);\n__exportStar(require(\"./list.v2.types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\n// ---------------\n// -- Streaming --\n// ---------------\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiv1 = void 0;\nconst globals_1 = require(\"../globals\");\nconst dm_paginator_v1_1 = require(\"../paginators/dm.paginator.v1\");\nconst types_1 = require(\"../types\");\nconst client_v1_write_1 = __importDefault(require(\"./client.v1.write\"));\n/**\n * Twitter v1.1 API client with read/write/DMs rights.\n */\nclass TwitterApiv1 extends client_v1_write_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V1_1_PREFIX;\n }\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n /* Direct messages */\n // Part: Sending and receiving events\n /**\n * Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event\n */\n sendDm({ recipient_id, custom_profile_id, ...params }) {\n const args = {\n event: {\n type: types_1.EDirectMessageEventTypeV1.Create,\n [types_1.EDirectMessageEventTypeV1.Create]: {\n target: { recipient_id },\n message_data: params,\n },\n },\n };\n if (custom_profile_id) {\n args.event[types_1.EDirectMessageEventTypeV1.Create].custom_profile_id = custom_profile_id;\n }\n return this.post('direct_messages/events/new.json', args, {\n forceBodyMode: 'json',\n });\n }\n /**\n * Returns a single Direct Message event by the given id.\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event\n */\n getDmEvent(id) {\n return this.get('direct_messages/events/show.json', { id });\n }\n /**\n * Deletes the direct message specified in the required ID parameter.\n * The authenticating user must be the recipient of the specified direct message.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/delete-message-event\n */\n deleteDm(id) {\n return this.delete('direct_messages/events/destroy.json', { id });\n }\n /**\n * Returns all Direct Message events (both sent and received) within the last 30 days.\n * Sorted in reverse-chronological order.\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events\n */\n async listDmEvents(args = {}) {\n const queryParams = { ...args };\n const initialRq = await this.get('direct_messages/events/list.json', queryParams, { fullResponse: true });\n return new dm_paginator_v1_1.DmEventsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n // Part: Welcome messages (events)\n /**\n * Creates a new Welcome Message that will be stored and sent in the future from the authenticating user in defined circumstances.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message\n */\n newWelcomeDm(name, data) {\n const args = {\n [types_1.EDirectMessageEventTypeV1.WelcomeCreate]: {\n name,\n message_data: data,\n },\n };\n return this.post('direct_messages/welcome_messages/new.json', args, {\n forceBodyMode: 'json',\n });\n }\n /**\n * Returns a Welcome Message by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message\n */\n getWelcomeDm(id) {\n return this.get('direct_messages/welcome_messages/show.json', { id });\n }\n /**\n * Deletes a Welcome Message by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message\n */\n deleteWelcomeDm(id) {\n return this.delete('direct_messages/welcome_messages/destroy.json', { id });\n }\n /**\n * Updates a Welcome Message by the given ID.\n * Updates to the welcome_message object are atomic.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/update-welcome-message\n */\n updateWelcomeDm(id, data) {\n const args = { message_data: data };\n return this.put('direct_messages/welcome_messages/update.json', args, {\n forceBodyMode: 'json',\n query: { id },\n });\n }\n /**\n * Returns all Direct Message events (both sent and received) within the last 30 days.\n * Sorted in reverse-chronological order.\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events\n */\n async listWelcomeDms(args = {}) {\n const queryParams = { ...args };\n const initialRq = await this.get('direct_messages/welcome_messages/list.json', queryParams, { fullResponse: true });\n return new dm_paginator_v1_1.WelcomeDmV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n // Part: Welcome message (rules)\n /**\n * Creates a new Welcome Message Rule that determines which Welcome Message will be shown in a given conversation.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message-rule\n */\n newWelcomeDmRule(welcomeMessageId) {\n return this.post('direct_messages/welcome_messages/rules/new.json', {\n welcome_message_rule: { welcome_message_id: welcomeMessageId },\n }, {\n forceBodyMode: 'json',\n });\n }\n /**\n * Returns a Welcome Message Rule by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message-rule\n */\n getWelcomeDmRule(id) {\n return this.get('direct_messages/welcome_messages/rules/show.json', { id });\n }\n /**\n * Deletes a Welcome Message Rule by the given id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message-rule\n */\n deleteWelcomeDmRule(id) {\n return this.delete('direct_messages/welcome_messages/rules/destroy.json', { id });\n }\n /**\n * Retrieves all welcome DM rules for this account.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/list-welcome-message-rules\n */\n async listWelcomeDmRules(args = {}) {\n const queryParams = { ...args };\n return this.get('direct_messages/welcome_messages/rules/list.json', queryParams);\n }\n /**\n * Set the current showed welcome message for logged account ; wrapper for Welcome DM rules.\n * Test if a rule already exists, delete if any, then create a rule for current message ID.\n *\n * If you don't have already a welcome message, create it with `.newWelcomeMessage`.\n */\n async setWelcomeDm(welcomeMessageId, deleteAssociatedWelcomeDmWhenDeletingRule = true) {\n var _a;\n const existingRules = await this.listWelcomeDmRules();\n if ((_a = existingRules.welcome_message_rules) === null || _a === void 0 ? void 0 : _a.length) {\n for (const rule of existingRules.welcome_message_rules) {\n await this.deleteWelcomeDmRule(rule.id);\n if (deleteAssociatedWelcomeDmWhenDeletingRule) {\n await this.deleteWelcomeDm(rule.welcome_message_id);\n }\n }\n }\n return this.newWelcomeDmRule(welcomeMessageId);\n }\n // Part: Read indicator\n /**\n * Marks a message as read in the recipient’s Direct Message conversation view with the sender.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt\n */\n markDmAsRead(lastEventId, recipientId) {\n return this.post('direct_messages/mark_read.json', {\n last_read_event_id: lastEventId,\n recipient_id: recipientId,\n }, { forceBodyMode: 'url' });\n }\n /**\n * Displays a visual typing indicator in the recipient’s Direct Message conversation view with the sender.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator\n */\n indicateDmTyping(recipientId) {\n return this.post('direct_messages/indicate_typing.json', {\n recipient_id: recipientId,\n }, { forceBodyMode: 'url' });\n }\n // Part: Images\n /**\n * Get a single image attached to a direct message. TwitterApi client must be logged with OAuth 1.0a.\n * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/message-attachments/guides/retrieving-media\n */\n async downloadDmImage(urlOrDm) {\n if (typeof urlOrDm !== 'string') {\n const attachment = urlOrDm[types_1.EDirectMessageEventTypeV1.Create].message_data.attachment;\n if (!attachment) {\n throw new Error('The given direct message doesn\\'t contain any attachment');\n }\n urlOrDm = attachment.media_url_https;\n }\n const data = await this.get(urlOrDm, undefined, { forceParseMode: 'buffer', prefix: '' });\n if (!data.length) {\n throw new Error('Image not found. Make sure you are logged with credentials able to access direct messages, and check the URL.');\n }\n return data;\n }\n}\nexports.TwitterApiv1 = TwitterApiv1;\nexports.default = TwitterApiv1;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_subclient_1 = __importDefault(require(\"../client.subclient\"));\nconst globals_1 = require(\"../globals\");\nconst helpers_1 = require(\"../helpers\");\nconst client_v1_1 = __importDefault(require(\"../v1/client.v1\"));\nconst tweet_paginator_v1_1 = require(\"../paginators/tweet.paginator.v1\");\nconst mutes_paginator_v1_1 = require(\"../paginators/mutes.paginator.v1\");\nconst user_paginator_v1_1 = require(\"../paginators/user.paginator.v1\");\nconst list_paginator_v1_1 = require(\"../paginators/list.paginator.v1\");\n/**\n * Base Twitter v1 client with only read right.\n */\nclass TwitterApiv1ReadOnly extends client_subclient_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V1_1_PREFIX;\n }\n /* Tweets */\n /**\n * Returns a single Tweet, specified by the id parameter. The Tweet's author will also be embedded within the Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id\n */\n singleTweet(tweetId, options = {}) {\n return this.get('statuses/show.json', { tweet_mode: 'extended', id: tweetId, ...options });\n }\n tweets(ids, options = {}) {\n return this.post('statuses/lookup.json', { tweet_mode: 'extended', id: ids, ...options });\n }\n /**\n * Returns a single Tweet, specified by either a Tweet web URL or the Tweet ID, in an oEmbed-compatible format.\n * The returned HTML snippet will be automatically recognized as an Embedded Tweet when Twitter's widget JavaScript is included on the page.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed\n */\n oembedTweet(tweetId, options = {}) {\n return this.get('oembed', {\n url: `https://twitter.com/i/statuses/${tweetId}`,\n ...options,\n }, { prefix: 'https://publish.twitter.com/' });\n }\n /* Tweets timelines */\n /**\n * Returns a collection of the most recent Tweets and Retweets posted by the authenticating user and the users they follow.\n * The home timeline is central to how most users interact with the Twitter service.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline\n */\n async homeTimeline(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('statuses/home_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.HomeTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the 20 most recent mentions (Tweets containing a users's @screen_name) for the authenticating user.\n * The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline\n */\n async mentionTimeline(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('statuses/mentions_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.MentionTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a collection of the most recent Tweets posted by the user indicated by the user_id parameters.\n * User timelines belonging to protected users may only be requested when the authenticated user either \"owns\" the timeline or is an approved follower of the owner.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline\n */\n async userTimeline(userId, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n user_id: userId,\n ...options,\n };\n const initialRq = await this.get('statuses/user_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a collection of the most recent Tweets posted by the user indicated by the screen_name parameters.\n * User timelines belonging to protected users may only be requested when the authenticated user either \"owns\" the timeline or is an approved follower of the owner.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline\n */\n async userTimelineByUsername(username, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n screen_name: username,\n ...options,\n };\n const initialRq = await this.get('statuses/user_timeline.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the most recent Tweets liked by the authenticating or specified user, 20 tweets by default.\n * Note: favorites are now known as likes.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list\n */\n async favoriteTimeline(userId, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n user_id: userId,\n ...options,\n };\n const initialRq = await this.get('favorites/list.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserFavoritesV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the most recent Tweets liked by the authenticating or specified user, 20 tweets by default.\n * Note: favorites are now known as likes.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list\n */\n async favoriteTimelineByUsername(username, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n screen_name: username,\n ...options,\n };\n const initialRq = await this.get('favorites/list.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.UserFavoritesV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Users */\n /**\n * Returns a variety of information about the user specified by the required user_id or screen_name parameter.\n * The author's most recent Tweet will be returned inline when possible.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show\n */\n user(user) {\n return this.get('users/show.json', { tweet_mode: 'extended', ...user });\n }\n /**\n * Returns fully-hydrated user objects for up to 100 users per request,\n * as specified by comma-separated values passed to the user_id and/or screen_name parameters.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup\n */\n users(query) {\n return this.get('users/lookup.json', { tweet_mode: 'extended', ...query });\n }\n /**\n * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful;\n * returns a 401 status code and an error message if not.\n * Use this method to test if supplied user credentials are valid.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials\n */\n verifyCredentials(options = {}) {\n return this.get('account/verify_credentials.json', options);\n }\n /**\n * Returns an array of user objects the authenticating user has muted.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list\n */\n async listMutedUsers(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('mutes/users/list.json', queryParams, { fullResponse: true });\n return new mutes_paginator_v1_1.MuteUserListV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns an array of numeric user ids the authenticating user has muted.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-ids\n */\n async listMutedUserIds(options = {}) {\n const queryParams = {\n stringify_ids: true,\n ...options,\n };\n const initialRq = await this.get('mutes/users/ids.json', queryParams, { fullResponse: true });\n return new mutes_paginator_v1_1.MuteUserIdsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Provides a simple, relevance-based search interface to public user accounts on Twitter.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-search\n */\n async searchUsers(query, options = {}) {\n const queryParams = {\n q: query,\n tweet_mode: 'extended',\n page: 1,\n ...options,\n };\n const initialRq = await this.get('users/search.json', queryParams, { fullResponse: true });\n return new user_paginator_v1_1.UserSearchV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Friendship API */\n /**\n * Returns detailed information about the relationship between two arbitrary users.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show\n */\n friendship(sources) {\n return this.get('friendships/show.json', sources);\n }\n /**\n * Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup\n */\n friendships(friendships) {\n return this.get('friendships/lookup.json', friendships);\n }\n /**\n * Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids\n */\n friendshipsNoRetweets() {\n return this.get('friendships/no_retweets/ids.json', { stringify_ids: true });\n }\n /**\n * Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming\n */\n async friendshipsIncoming(options = {}) {\n const queryParams = {\n stringify_ids: true,\n ...options,\n };\n const initialRq = await this.get('friendships/incoming.json', queryParams, { fullResponse: true });\n return new user_paginator_v1_1.FriendshipsIncomingV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing\n */\n async friendshipsOutgoing(options = {}) {\n const queryParams = {\n stringify_ids: true,\n ...options,\n };\n const initialRq = await this.get('friendships/outgoing.json', queryParams, { fullResponse: true });\n return new user_paginator_v1_1.FriendshipsOutgoingV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Account/user API */\n /**\n * Get current account settings for authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings\n */\n accountSettings() {\n return this.get('account/settings.json');\n }\n /**\n * Returns a map of the available size variations of the specified user's profile banner.\n * If the user has not uploaded a profile banner, a HTTP 404 will be served instead.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner\n */\n userProfileBannerSizes(params) {\n return this.get('users/profile_banner.json', params);\n }\n /* Lists */\n /**\n * Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show\n */\n list(options) {\n return this.get('lists/show.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Returns all lists the authenticating or specified user subscribes to, including their own.\n * If no user is given, the authenticating user is used.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list\n */\n lists(options = {}) {\n return this.get('lists/list.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Returns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members\n */\n async listMembers(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/members.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListMembersV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Check if the specified user is a member of the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show\n */\n listGetMember(options) {\n return this.get('lists/members/show.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Returns the lists the specified user has been added to.\n * If user_id or screen_name are not provided, the memberships for the authenticating user are returned.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships\n */\n async listMemberships(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/memberships.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListMembershipsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the lists owned by the specified Twitter user. Private lists will only be shown if the authenticated user is also the owner of the lists.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships\n */\n async listOwnerships(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/ownerships.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListOwnershipsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a timeline of tweets authored by members of the specified list. Retweets are included by default.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses\n */\n async listStatuses(options) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/statuses.json', queryParams, { fullResponse: true });\n return new tweet_paginator_v1_1.ListTimelineV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers\n */\n async listSubscribers(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/subscribers.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListSubscribersV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Check if the specified user is a subscriber of the specified list. Returns the user if they are a subscriber.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show\n */\n listGetSubscriber(options) {\n return this.get('lists/subscribers/show.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Obtain a collection of the lists the specified user is subscribed to, 20 lists per page by default.\n * Does not include the user's own lists.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions\n */\n async listSubscriptions(options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n ...options,\n };\n const initialRq = await this.get('lists/subscriptions.json', queryParams, { fullResponse: true });\n return new list_paginator_v1_1.ListSubscriptionsV1Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /* Media upload API */\n /**\n * The STATUS command (this method) is used to periodically poll for updates of media processing operation.\n * After the STATUS command response returns succeeded, you can move on to the next step which is usually create Tweet with media_id.\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/get-media-upload-status\n */\n mediaInfo(mediaId) {\n return this.get('media/upload.json', {\n command: 'STATUS',\n media_id: mediaId,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n }\n filterStream({ autoConnect, ...params } = {}) {\n const parameters = {};\n for (const [key, value] of Object.entries(params)) {\n if (key === 'follow' || key === 'track') {\n parameters[key] = value.toString();\n }\n else if (key === 'locations') {\n const locations = value;\n parameters.locations = (0, helpers_1.arrayWrap)(locations).map(loc => `${loc.lng},${loc.lat}`).join(',');\n }\n else {\n parameters[key] = value;\n }\n }\n const streamClient = this.stream;\n return streamClient.postStream('statuses/filter.json', parameters, { autoConnect });\n }\n sampleStream({ autoConnect, ...params } = {}) {\n const streamClient = this.stream;\n return streamClient.getStream('statuses/sample.json', params, { autoConnect });\n }\n /**\n * Create a client that is prefixed with `https//stream.twitter.com` instead of classic API URL.\n */\n get stream() {\n const copiedClient = new client_v1_1.default(this);\n copiedClient.setPrefix(globals_1.API_V1_1_STREAM_PREFIX);\n return copiedClient;\n }\n /* Trends API */\n /**\n * Returns the top 50 trending topics for a specific id, if trending information is available for it.\n * Note: The id parameter for this endpoint is the \"where on earth identifier\" or WOEID, which is a legacy identifier created by Yahoo and has been deprecated.\n * https://developer.twitter.com/en/docs/twitter-api/v1/trends/trends-for-location/api-reference/get-trends-place\n */\n trendsByPlace(woeId, options = {}) {\n return this.get('trends/place.json', { id: woeId, ...options });\n }\n /**\n * Returns the locations that Twitter has trending topic information for.\n * The response is an array of \"locations\" that encode the location's WOEID\n * and some other human-readable information such as a canonical name and country the location belongs in.\n * https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available\n */\n trendsAvailable() {\n return this.get('trends/available.json');\n }\n /**\n * Returns the locations that Twitter has trending topic information for, closest to a specified location.\n * https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-closest\n */\n trendsClosest(lat, long) {\n return this.get('trends/closest.json', { lat, long });\n }\n /* Geo API */\n /**\n * Returns all the information about a known place.\n * https://developer.twitter.com/en/docs/twitter-api/v1/geo/place-information/api-reference/get-geo-id-place_id\n */\n geoPlace(placeId) {\n return this.get('geo/id/:place_id.json', undefined, { params: { place_id: placeId } });\n }\n /**\n * Search for places that can be attached to a Tweet via POST statuses/update.\n * This request will return a list of all the valid places that can be used as the place_id when updating a status.\n * https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-search\n */\n geoSearch(options) {\n return this.get('geo/search.json', options);\n }\n /**\n * Given a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status.\n * This request is an informative call and will deliver generalized results about geography.\n * https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-reverse_geocode\n */\n geoReverseGeoCode(options) {\n return this.get('geo/reverse_geocode.json', options);\n }\n /* Developer utilities */\n /**\n * Returns the current rate limits for methods belonging to the specified resource families.\n * Each API resource belongs to a \"resource family\" which is indicated in its method documentation.\n * The method's resource family can be determined from the first component of the path after the resource version.\n * https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status\n */\n rateLimitStatuses(...resources) {\n return this.get('application/rate_limit_status.json', { resources });\n }\n /**\n * Returns the list of languages supported by Twitter along with the language code supported by Twitter.\n * https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages\n */\n supportedLanguages() {\n return this.get('help/languages.json');\n }\n}\nexports.default = TwitterApiv1ReadOnly;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globals_1 = require(\"../globals\");\nconst client_v1_read_1 = __importDefault(require(\"./client.v1.read\"));\nconst types_1 = require(\"../types\");\nconst fs = __importStar(require(\"fs\"));\nconst media_helpers_v1_1 = require(\"./media-helpers.v1\");\nconst helpers_1 = require(\"../helpers\");\nconst UPLOAD_ENDPOINT = 'media/upload.json';\n/**\n * Base Twitter v1 client with read/write rights.\n */\nclass TwitterApiv1ReadWrite extends client_v1_read_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V1_1_PREFIX;\n }\n /**\n * Get a client with only read rights.\n */\n get readOnly() {\n return this;\n }\n /* Tweet API */\n /**\n * Post a new tweet.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n tweet(status, payload = {}) {\n const queryParams = {\n status,\n tweet_mode: 'extended',\n ...payload,\n };\n return this.post('statuses/update.json', queryParams);\n }\n /**\n * Quote an existing tweet.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n async quote(status, quotingStatusId, payload = {}) {\n const url = 'https://twitter.com/i/statuses/' + quotingStatusId;\n return this.tweet(status, { ...payload, attachment_url: url });\n }\n /**\n * Post a series of tweets.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n async tweetThread(tweets) {\n const postedTweets = [];\n for (const tweet of tweets) {\n // Retrieve the last sent tweet\n const lastTweet = postedTweets.length ? postedTweets[postedTweets.length - 1] : null;\n // Build the tweet query params\n const queryParams = { ...(typeof tweet === 'string' ? ({ status: tweet }) : tweet) };\n // Reply to an existing tweet if needed\n const inReplyToId = lastTweet ? lastTweet.id_str : queryParams.in_reply_to_status_id;\n const status = queryParams.status;\n if (inReplyToId) {\n postedTweets.push(await this.reply(status, inReplyToId, queryParams));\n }\n else {\n postedTweets.push(await this.tweet(status, queryParams));\n }\n }\n return postedTweets;\n }\n /**\n * Reply to an existing tweet. Shortcut to `.tweet` with tweaked parameters.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update\n */\n reply(status, in_reply_to_status_id, payload = {}) {\n return this.tweet(status, {\n auto_populate_reply_metadata: true,\n in_reply_to_status_id,\n ...payload,\n });\n }\n /**\n * Delete an existing tweet belonging to you.\n * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id\n */\n deleteTweet(tweetId) {\n return this.post('statuses/destroy/:id.json', { tweet_mode: 'extended' }, { params: { id: tweetId } });\n }\n /* User API */\n /**\n * Report the specified user as a spam account to Twitter.\n * Additionally, optionally performs the equivalent of POST blocks/create on behalf of the authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-users-report_spam\n */\n reportUserAsSpam(options) {\n return this.post('users/report_spam.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Turn on/off Retweets and device notifications from the specified user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-update\n */\n updateFriendship(options) {\n return this.post('friendships/update.json', options);\n }\n /* Account API */\n /**\n * Update current account settings for authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings\n */\n updateAccountSettings(options) {\n return this.post('account/settings.json', options);\n }\n /**\n * Sets some values that users are able to set under the \"Account\" tab of their settings page.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile\n */\n updateAccountProfile(options) {\n return this.post('account/update_profile.json', options);\n }\n /**\n * Uploads a profile banner on behalf of the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner\n */\n async updateAccountProfileBanner(file, options = {}) {\n const queryParams = {\n banner: await (0, media_helpers_v1_1.readFileIntoBuffer)(file),\n ...options,\n };\n return this.post('account/update_profile_banner.json', queryParams, { forceBodyMode: 'form-data' });\n }\n /**\n * Updates the authenticating user's profile image.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image\n */\n async updateAccountProfileImage(file, options = {}) {\n const queryParams = {\n tweet_mode: 'extended',\n image: await (0, media_helpers_v1_1.readFileIntoBuffer)(file),\n ...options,\n };\n return this.post('account/update_profile_image.json', queryParams, { forceBodyMode: 'form-data' });\n }\n /**\n * Removes the uploaded profile banner for the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-remove_profile_banner\n */\n removeAccountProfileBanner() {\n return this.post('account/remove_profile_banner.json');\n }\n /* Lists */\n /**\n * Creates a new list for the authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create\n */\n createList(options) {\n return this.post('lists/create.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Updates the specified list. The authenticated user must own the list to be able to update it.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-update\n */\n updateList(options) {\n return this.post('lists/update.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Deletes the specified list. The authenticated user must own the list to be able to destroy it.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy\n */\n removeList(options) {\n return this.post('lists/destroy.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.\n * If you add a single `user_id` or `screen_name`, it will target `lists/members/create.json`, otherwise\n * it will target `lists/members/create_all.json`.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create_all\n */\n addListMembers(options) {\n const hasMultiple = (options.user_id && (0, helpers_1.hasMultipleItems)(options.user_id)) || (options.screen_name && (0, helpers_1.hasMultipleItems)(options.screen_name));\n const endpoint = hasMultiple ? 'lists/members/create_all.json' : 'lists/members/create.json';\n return this.post(endpoint, options);\n }\n /**\n * Removes multiple members to a list, by specifying a comma-separated list of member ids or screen names.\n * If you add a single `user_id` or `screen_name`, it will target `lists/members/destroy.json`, otherwise\n * it will target `lists/members/destroy_all.json`.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all\n */\n removeListMembers(options) {\n const hasMultiple = (options.user_id && (0, helpers_1.hasMultipleItems)(options.user_id)) || (options.screen_name && (0, helpers_1.hasMultipleItems)(options.screen_name));\n const endpoint = hasMultiple ? 'lists/members/destroy_all.json' : 'lists/members/destroy.json';\n return this.post(endpoint, options);\n }\n /**\n * Subscribes the authenticated user to the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create\n */\n subscribeToList(options) {\n return this.post('lists/subscribers/create.json', { tweet_mode: 'extended', ...options });\n }\n /**\n * Unsubscribes the authenticated user of the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy\n */\n unsubscribeOfList(options) {\n return this.post('lists/subscribers/destroy.json', { tweet_mode: 'extended', ...options });\n }\n /* Media upload API */\n /**\n * This endpoint can be used to provide additional information about the uploaded media_id.\n * This feature is currently only supported for images and GIFs.\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-metadata-create\n */\n createMediaMetadata(mediaId, metadata) {\n return this.post('media/metadata/create.json', { media_id: mediaId, ...metadata }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX, forceBodyMode: 'json' });\n }\n /**\n * Use this endpoint to associate uploaded subtitles to an uploaded video. You can associate subtitles to video before or after Tweeting.\n * **To obtain subtitle media ID, you must upload each subtitle file separately using `.uploadMedia()` method.**\n *\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-create\n */\n createMediaSubtitles(mediaId, subtitles) {\n return this.post('media/subtitles/create.json', { media_id: mediaId, media_category: 'TweetVideo', subtitle_info: { subtitles } }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX, forceBodyMode: 'json' });\n }\n /**\n * Use this endpoint to dissociate subtitles from a video and delete the subtitles. You can dissociate subtitles from a video before or after Tweeting.\n * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-delete\n */\n deleteMediaSubtitles(mediaId, ...languages) {\n return this.post('media/subtitles/delete.json', {\n media_id: mediaId,\n media_category: 'TweetVideo',\n subtitle_info: { subtitles: languages.map(lang => ({ language_code: lang })) },\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX, forceBodyMode: 'json' });\n }\n /**\n * Upload a media (JPG/PNG/GIF/MP4/WEBP) or subtitle (SRT) to Twitter and return the media_id to use in tweet/DM send.\n *\n * @param file If `string`, filename is supposed.\n * A `Buffer` is a raw file.\n * `fs.promises.FileHandle` or `number` are file pointers.\n *\n * @param options.type File type (Enum 'jpg' | 'longmp4' | 'mp4' | 'png' | 'gif' | 'srt' | 'webp').\n * If filename is given, it could be guessed with file extension, otherwise this parameter is mandatory.\n * If type is not part of the enum, it will be used as mime type.\n *\n * Type `longmp4` is **required** is you try to upload a video higher than 140 seconds.\n *\n * @param options.chunkLength Maximum chunk length sent to Twitter. Default goes to 1 MB.\n *\n * @param options.additionalOwners Other user IDs allowed to use the returned media_id. Default goes to none.\n *\n * @param options.maxConcurrentUploads Maximum uploaded chunks in the same time. Default goes to 3.\n *\n * @param options.target Target type `tweet` or `dm`. Defaults to `tweet`.\n * You must specify it if you send a media to use in DMs.\n */\n async uploadMedia(file, options = {}) {\n var _a;\n const chunkLength = (_a = options.chunkLength) !== null && _a !== void 0 ? _a : (1024 * 1024);\n const { fileHandle, mediaCategory, fileSize, mimeType } = await this.getUploadMediaRequirements(file, options);\n // Get the file handle (if not buffer)\n try {\n // Finally! We can send INIT message.\n const mediaData = await this.post(UPLOAD_ENDPOINT, {\n command: 'INIT',\n total_bytes: fileSize,\n media_type: mimeType,\n media_category: mediaCategory,\n additional_owners: options.additionalOwners,\n shared: options.shared ? true : undefined,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n // Upload the media chunk by chunk\n await this.mediaChunkedUpload(fileHandle, chunkLength, mediaData.media_id_string, options.maxConcurrentUploads);\n // Finalize media\n const fullMediaData = await this.post(UPLOAD_ENDPOINT, {\n command: 'FINALIZE',\n media_id: mediaData.media_id_string,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n if (fullMediaData.processing_info && fullMediaData.processing_info.state !== 'succeeded') {\n // Must wait if video is still computed\n await this.awaitForMediaProcessingCompletion(fullMediaData);\n }\n // Video is ready, return media_id\n return fullMediaData.media_id_string;\n }\n finally {\n // Close file if any\n if (typeof file === 'number') {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n fs.close(file, () => { });\n }\n else if (typeof fileHandle === 'object' && !(fileHandle instanceof Buffer)) {\n fileHandle.close();\n }\n }\n }\n async awaitForMediaProcessingCompletion(fullMediaData) {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n fullMediaData = await this.mediaInfo(fullMediaData.media_id_string);\n const { processing_info } = fullMediaData;\n if (!processing_info || processing_info.state === 'succeeded') {\n // Ok, completed!\n return;\n }\n if (processing_info.state === 'failed') {\n if (processing_info.error) {\n const { name, message } = processing_info.error;\n throw new Error(`Failed to process media: ${name} - ${message}.`);\n }\n throw new Error('Failed to process the media.');\n }\n if (processing_info.check_after_secs) {\n // Await for given seconds\n await (0, media_helpers_v1_1.sleepSecs)(processing_info.check_after_secs);\n }\n else {\n // No info; Await for 5 seconds\n await (0, media_helpers_v1_1.sleepSecs)(5);\n }\n }\n }\n async getUploadMediaRequirements(file, { mimeType, type, target, longVideo } = {}) {\n // Get the file handle (if not buffer)\n let fileHandle;\n try {\n fileHandle = await (0, media_helpers_v1_1.getFileHandle)(file);\n // Get the mimetype\n const realMimeType = (0, media_helpers_v1_1.getMimeType)(file, type, mimeType);\n // Get the media category\n let mediaCategory;\n // If explicit longmp4 OR explicit MIME type and not DM target\n if (realMimeType === types_1.EUploadMimeType.Mp4 && ((!mimeType && !type && target !== 'dm') || longVideo)) {\n mediaCategory = 'amplify_video';\n }\n else {\n mediaCategory = (0, media_helpers_v1_1.getMediaCategoryByMime)(realMimeType, target !== null && target !== void 0 ? target : 'tweet');\n }\n return {\n fileHandle,\n mediaCategory,\n fileSize: await (0, media_helpers_v1_1.getFileSizeFromFileHandle)(fileHandle),\n mimeType: realMimeType,\n };\n }\n catch (e) {\n // Close file if any\n if (typeof file === 'number') {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n fs.close(file, () => { });\n }\n else if (typeof fileHandle === 'object' && !(fileHandle instanceof Buffer)) {\n fileHandle.close();\n }\n throw e;\n }\n }\n async mediaChunkedUpload(fileHandle, chunkLength, mediaId, maxConcurrentUploads = 3) {\n // Send chunk by chunk\n let chunkIndex = 0;\n if (maxConcurrentUploads < 1) {\n throw new RangeError('Bad maxConcurrentUploads parameter.');\n }\n // Creating a buffer for doing file stuff (if we don't have one)\n const buffer = fileHandle instanceof Buffer ? undefined : Buffer.alloc(chunkLength);\n // Sliced/filled buffer returned for each part\n let readBuffer;\n // Needed to know when we should stop reading the file\n let nread;\n // Needed to use the buffer object (file handles always \"remembers\" file position)\n let offset = 0;\n [readBuffer, nread] = await (0, media_helpers_v1_1.readNextPartOf)(fileHandle, chunkLength, offset, buffer);\n offset += nread;\n // Handle max concurrent uploads\n const currentUploads = new Set();\n // Read buffer until file is completely read\n while (nread) {\n const mediaBufferPart = readBuffer.slice(0, nread);\n // Sent part if part has something inside\n if (mediaBufferPart.length) {\n const request = this.post(UPLOAD_ENDPOINT, {\n command: 'APPEND',\n media_id: mediaId,\n segment_index: chunkIndex,\n media: mediaBufferPart,\n }, { prefix: globals_1.API_V1_1_UPLOAD_PREFIX });\n currentUploads.add(request);\n request.then(() => {\n currentUploads.delete(request);\n });\n chunkIndex++;\n }\n if (currentUploads.size >= maxConcurrentUploads) {\n // Await for first promise to be finished\n await Promise.race(currentUploads);\n }\n [readBuffer, nread] = await (0, media_helpers_v1_1.readNextPartOf)(fileHandle, chunkLength, offset, buffer);\n offset += nread;\n }\n await Promise.all([...currentUploads]);\n }\n}\nexports.default = TwitterApiv1ReadWrite;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.readNextPartOf = exports.sleepSecs = exports.getMediaCategoryByMime = exports.getMimeType = exports.getFileSizeFromFileHandle = exports.getFileHandle = exports.readFileIntoBuffer = void 0;\nconst fs = __importStar(require(\"fs\"));\nconst helpers_1 = require(\"../helpers\");\nconst types_1 = require(\"../types\");\nasync function readFileIntoBuffer(file) {\n const handle = await getFileHandle(file);\n if (typeof handle === 'number') {\n return new Promise((resolve, reject) => {\n fs.readFile(handle, (err, data) => {\n if (err) {\n return reject(err);\n }\n resolve(data);\n });\n });\n }\n else if (handle instanceof Buffer) {\n return handle;\n }\n else {\n return handle.readFile();\n }\n}\nexports.readFileIntoBuffer = readFileIntoBuffer;\nfunction getFileHandle(file) {\n if (typeof file === 'string') {\n return fs.promises.open(file, 'r');\n }\n else if (typeof file === 'number') {\n return file;\n }\n else if (typeof file === 'object' && !(file instanceof Buffer)) {\n return file;\n }\n else if (!(file instanceof Buffer)) {\n throw new Error('Given file is not valid, please check its type.');\n }\n else {\n return file;\n }\n}\nexports.getFileHandle = getFileHandle;\nasync function getFileSizeFromFileHandle(fileHandle) {\n // Get the file size\n if (typeof fileHandle === 'number') {\n const stats = await new Promise((resolve, reject) => {\n fs.fstat(fileHandle, (err, stats) => {\n if (err)\n reject(err);\n resolve(stats);\n });\n });\n return stats.size;\n }\n else if (fileHandle instanceof Buffer) {\n return fileHandle.length;\n }\n else {\n return (await fileHandle.stat()).size;\n }\n}\nexports.getFileSizeFromFileHandle = getFileSizeFromFileHandle;\nfunction getMimeType(file, type, mimeType) {\n if (typeof mimeType === 'string') {\n return mimeType;\n }\n else if (typeof file === 'string' && !type) {\n return getMimeByName(file);\n }\n else if (typeof type === 'string') {\n return getMimeByType(type);\n }\n throw new Error('You must specify type if file is a file handle or Buffer.');\n}\nexports.getMimeType = getMimeType;\nfunction getMimeByName(name) {\n if (name.endsWith('.jpeg') || name.endsWith('.jpg'))\n return types_1.EUploadMimeType.Jpeg;\n if (name.endsWith('.png'))\n return types_1.EUploadMimeType.Png;\n if (name.endsWith('.webp'))\n return types_1.EUploadMimeType.Webp;\n if (name.endsWith('.gif'))\n return types_1.EUploadMimeType.Gif;\n if (name.endsWith('.mpeg4') || name.endsWith('.mp4'))\n return types_1.EUploadMimeType.Mp4;\n if (name.endsWith('.srt'))\n return types_1.EUploadMimeType.Srt;\n (0, helpers_1.safeDeprecationWarning)({\n instance: 'TwitterApiv1ReadWrite',\n method: 'uploadMedia',\n problem: `options.mimeType is missing and filename couldn't help to resolve MIME type, so it will fallback to image/jpeg`,\n resolution: `If you except to give filenames without extensions, please specify explicitlty the MIME type using options.mimeType`,\n });\n return types_1.EUploadMimeType.Jpeg;\n}\nfunction getMimeByType(type) {\n (0, helpers_1.safeDeprecationWarning)({\n instance: 'TwitterApiv1ReadWrite',\n method: 'uploadMedia',\n problem: `you're using options.type`,\n resolution: `Remove options.type argument and migrate to options.mimeType which takes the real MIME type. ` +\n `If you're using type=longmp4, add options.longVideo alongside of mimeType=EUploadMimeType.Mp4`,\n });\n if (type === 'gif')\n return types_1.EUploadMimeType.Gif;\n if (type === 'jpg')\n return types_1.EUploadMimeType.Jpeg;\n if (type === 'png')\n return types_1.EUploadMimeType.Png;\n if (type === 'webp')\n return types_1.EUploadMimeType.Webp;\n if (type === 'srt')\n return types_1.EUploadMimeType.Srt;\n if (type === 'mp4' || type === 'longmp4')\n return types_1.EUploadMimeType.Mp4;\n return type;\n}\nfunction getMediaCategoryByMime(name, target) {\n if (name === types_1.EUploadMimeType.Mp4)\n return target === 'tweet' ? 'TweetVideo' : 'DmVideo';\n if (name === types_1.EUploadMimeType.Gif)\n return target === 'tweet' ? 'TweetGif' : 'DmGif';\n if (name === types_1.EUploadMimeType.Srt)\n return 'Subtitles';\n else\n return target === 'tweet' ? 'TweetImage' : 'DmImage';\n}\nexports.getMediaCategoryByMime = getMediaCategoryByMime;\nfunction sleepSecs(seconds) {\n return new Promise(resolve => setTimeout(resolve, seconds * 1000));\n}\nexports.sleepSecs = sleepSecs;\nasync function readNextPartOf(file, chunkLength, bufferOffset = 0, buffer) {\n if (file instanceof Buffer) {\n const rt = file.slice(bufferOffset, bufferOffset + chunkLength);\n return [rt, rt.length];\n }\n if (!buffer) {\n throw new Error('Well, we will need a buffer to store file content.');\n }\n let bytesRead;\n if (typeof file === 'number') {\n bytesRead = await new Promise((resolve, reject) => {\n fs.read(file, buffer, 0, chunkLength, bufferOffset, (err, nread) => {\n if (err)\n reject(err);\n resolve(nread);\n });\n });\n }\n else {\n const res = await file.read(buffer, 0, chunkLength, bufferOffset);\n bytesRead = res.bytesRead;\n }\n return [buffer, bytesRead];\n}\nexports.readNextPartOf = readNextPartOf;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiv2Labs = void 0;\nconst globals_1 = require(\"../globals\");\nconst client_v2_labs_write_1 = __importDefault(require(\"./client.v2.labs.write\"));\n/**\n * Twitter v2 labs client with all rights (read/write/DMs)\n */\nclass TwitterApiv2Labs extends client_v2_labs_write_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_LABS_PREFIX;\n }\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n}\nexports.TwitterApiv2Labs = TwitterApiv2Labs;\nexports.default = TwitterApiv2Labs;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_subclient_1 = __importDefault(require(\"../client.subclient\"));\nconst globals_1 = require(\"../globals\");\n/**\n * Base Twitter v2 labs client with only read right.\n */\nclass TwitterApiv2LabsReadOnly extends client_subclient_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_LABS_PREFIX;\n }\n}\nexports.default = TwitterApiv2LabsReadOnly;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globals_1 = require(\"../globals\");\nconst client_v2_labs_read_1 = __importDefault(require(\"./client.v2.labs.read\"));\n/**\n * Base Twitter v2 labs client with read/write rights.\n */\nclass TwitterApiv2LabsReadWrite extends client_v2_labs_read_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_LABS_PREFIX;\n }\n /**\n * Get a client with only read rights.\n */\n get readOnly() {\n return this;\n }\n}\nexports.default = TwitterApiv2LabsReadWrite;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterApiv2 = void 0;\nconst globals_1 = require(\"../globals\");\nconst client_v2_write_1 = __importDefault(require(\"./client.v2.write\"));\nconst client_v2_labs_1 = __importDefault(require(\"../v2-labs/client.v2.labs\"));\n/**\n * Twitter v2 client with all rights (read/write/DMs)\n */\nclass TwitterApiv2 extends client_v2_write_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_PREFIX;\n }\n /* Sub-clients */\n /**\n * Get a client with read/write rights.\n */\n get readWrite() {\n return this;\n }\n /**\n * Get a client for v2 labs endpoints.\n */\n get labs() {\n if (this._labs)\n return this._labs;\n return this._labs = new client_v2_labs_1.default(this);\n }\n}\nexports.TwitterApiv2 = TwitterApiv2;\nexports.default = TwitterApiv2;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_subclient_1 = __importDefault(require(\"../client.subclient\"));\nconst globals_1 = require(\"../globals\");\nconst paginators_1 = require(\"../paginators\");\nconst client_v2_labs_read_1 = __importDefault(require(\"../v2-labs/client.v2.labs.read\"));\nconst user_paginator_v2_1 = require(\"../paginators/user.paginator.v2\");\nconst helpers_1 = require(\"../helpers\");\n/**\n * Base Twitter v2 client with only read right.\n */\nclass TwitterApiv2ReadOnly extends client_subclient_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_PREFIX;\n }\n /* Sub-clients */\n /**\n * Get a client for v2 labs endpoints.\n */\n get labs() {\n if (this._labs)\n return this._labs;\n return this._labs = new client_v2_labs_read_1.default(this);\n }\n async search(queryOrOptions, options = {}) {\n const query = typeof queryOrOptions === 'string' ? queryOrOptions : undefined;\n const realOptions = typeof queryOrOptions === 'object' && queryOrOptions !== null ? queryOrOptions : options;\n const queryParams = { ...realOptions, query };\n const initialRq = await this.get('tweets/search/recent', queryParams, { fullResponse: true });\n return new paginators_1.TweetSearchRecentV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * The full-archive search endpoint returns the complete history of public Tweets matching a search query;\n * since the first Tweet was created March 26, 2006.\n *\n * This endpoint is only available to those users who have been approved for the Academic Research product track.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all\n */\n async searchAll(query, options = {}) {\n const queryParams = { ...options, query };\n const initialRq = await this.get('tweets/search/all', queryParams, { fullResponse: true });\n return new paginators_1.TweetSearchAllV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams,\n });\n }\n /**\n * Returns a variety of information about a single Tweet specified by the requested ID.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id\n *\n * OAuth2 scope: `users.read`, `tweet.read`\n */\n singleTweet(tweetId, options = {}) {\n return this.get('tweets/:id', options, { params: { id: tweetId } });\n }\n /**\n * Returns a variety of information about tweets specified by list of IDs.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets\n *\n * OAuth2 scope: `users.read`, `tweet.read`\n */\n tweets(tweetIds, options = {}) {\n return this.get('tweets', { ids: tweetIds, ...options });\n }\n /**\n * The recent Tweet counts endpoint returns count of Tweets from the last seven days that match a search query.\n * OAuth2 Bearer auth only.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent\n */\n tweetCountRecent(query, options = {}) {\n return this.get('tweets/counts/recent', { query, ...options });\n }\n /**\n * This endpoint is only available to those users who have been approved for the Academic Research product track.\n * The full-archive search endpoint returns the complete history of public Tweets matching a search query;\n * since the first Tweet was created March 26, 2006.\n * OAuth2 Bearer auth only.\n * **This endpoint has pagination, yet it is not supported by bundled paginators. Use `next_token` to fetch next page.**\n * https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all\n */\n tweetCountAll(query, options = {}) {\n return this.get('tweets/counts/all', { query, ...options });\n }\n async tweetRetweetedBy(tweetId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const initialRq = await this.get('tweets/:id/retweeted_by', parameters, {\n fullResponse: true,\n params: { id: tweetId },\n });\n if (!asPaginator) {\n return initialRq.data;\n }\n return new user_paginator_v2_1.TweetRetweetersUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: { id: tweetId },\n });\n }\n async tweetLikedBy(tweetId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const initialRq = await this.get('tweets/:id/liking_users', parameters, {\n fullResponse: true,\n params: { id: tweetId },\n });\n if (!asPaginator) {\n return initialRq.data;\n }\n return new user_paginator_v2_1.TweetLikingUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: { id: tweetId },\n });\n }\n /**\n * Allows you to retrieve a collection of the most recent Tweets and Retweets posted by you and users you follow, also known as home timeline.\n * This endpoint returns up to the last 3200 Tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-reverse-chronological\n *\n * OAuth 2 scopes: `tweet.read` `users.read`\n */\n async homeTimeline(options = {}) {\n const meUser = await this.getCurrentUserV2Object();\n const initialRq = await this.get('users/:id/timelines/reverse_chronological', options, {\n fullResponse: true,\n params: { id: meUser.data.id },\n });\n return new paginators_1.TweetHomeTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: meUser.data.id },\n });\n }\n /**\n * Returns Tweets composed by a single user, specified by the requested user ID.\n * By default, the most recent ten Tweets are returned per request.\n * Using pagination, the most recent 3,200 Tweets can be retrieved.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets\n */\n async userTimeline(userId, options = {}) {\n const initialRq = await this.get('users/:id/tweets', options, {\n fullResponse: true,\n params: { id: userId },\n });\n return new paginators_1.TweetUserTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: userId },\n });\n }\n /**\n * Returns Tweets mentioning a single user specified by the requested user ID.\n * By default, the most recent ten Tweets are returned per request.\n * Using pagination, up to the most recent 800 Tweets can be retrieved.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions\n */\n async userMentionTimeline(userId, options = {}) {\n const initialRq = await this.get('users/:id/mentions', options, {\n fullResponse: true,\n params: { id: userId },\n });\n return new paginators_1.TweetUserMentionTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: userId },\n });\n }\n /**\n * Returns Quote Tweets for a Tweet specified by the requested Tweet ID.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/quote-tweets/api-reference/get-tweets-id-quote_tweets\n *\n * OAuth2 scopes: `users.read` `tweet.read`\n */\n async quotes(tweetId, options = {}) {\n const initialRq = await this.get('tweets/:id/quote_tweets', options, {\n fullResponse: true,\n params: { id: tweetId },\n });\n return new paginators_1.QuotedTweetsTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: tweetId },\n });\n }\n /* Bookmarks */\n /**\n * Allows you to get information about a authenticated user’s 800 most recent bookmarked Tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/get-users-id-bookmarks\n *\n * OAuth2 scopes: `users.read` `tweet.read` `bookmark.read`\n */\n async bookmarks(options = {}) {\n const user = await this.getCurrentUserV2Object();\n const initialRq = await this.get('users/:id/bookmarks', options, {\n fullResponse: true,\n params: { id: user.data.id },\n });\n return new paginators_1.TweetBookmarksTimelineV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: options,\n sharedParams: { id: user.data.id },\n });\n }\n /* Users */\n /**\n * Returns information about an authorized user.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me\n *\n * OAuth2 scopes: `tweet.read` & `users.read`\n */\n me(options = {}) {\n return this.get('users/me', options);\n }\n /**\n * Returns a variety of information about a single user specified by the requested ID.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id\n */\n user(userId, options = {}) {\n return this.get('users/:id', options, { params: { id: userId } });\n }\n /**\n * Returns a variety of information about one or more users specified by the requested IDs.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users\n */\n users(userIds, options = {}) {\n const ids = Array.isArray(userIds) ? userIds.join(',') : userIds;\n return this.get('users', { ...options, ids });\n }\n /**\n * Returns a variety of information about a single user specified by their username.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username\n */\n userByUsername(username, options = {}) {\n return this.get('users/by/username/:username', options, { params: { username } });\n }\n /**\n * Returns a variety of information about one or more users specified by their usernames.\n * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by\n *\n * OAuth2 scope: `users.read`, `tweet.read`\n */\n usersByUsernames(usernames, options = {}) {\n usernames = Array.isArray(usernames) ? usernames.join(',') : usernames;\n return this.get('users/by', { ...options, usernames });\n }\n async followers(userId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const params = { id: userId };\n if (!asPaginator) {\n return this.get('users/:id/followers', parameters, { params });\n }\n const initialRq = await this.get('users/:id/followers', parameters, { fullResponse: true, params });\n return new user_paginator_v2_1.UserFollowersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: params,\n });\n }\n async following(userId, options = {}) {\n const { asPaginator, ...parameters } = options;\n const params = { id: userId };\n if (!asPaginator) {\n return this.get('users/:id/following', parameters, { params });\n }\n const initialRq = await this.get('users/:id/following', parameters, { fullResponse: true, params });\n return new user_paginator_v2_1.UserFollowingV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: parameters,\n sharedParams: params,\n });\n }\n /**\n * Allows you to get information about a user’s liked Tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/get-users-id-liked_tweets\n */\n async userLikedTweets(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/liked_tweets', options, { fullResponse: true, params });\n return new paginators_1.TweetV2UserLikedTweetsPaginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are blocked by the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking\n */\n async userBlockingUsers(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/blocking', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserBlockingUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are muted by the authenticating user.\n * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/get-users-muting\n */\n async userMutingUsers(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/muting', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserMutingUsersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /* Lists */\n /**\n * Returns the details of a specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id\n */\n list(id, options = {}) {\n return this.get('lists/:id', options, { params: { id } });\n }\n /**\n * Returns all Lists owned by the specified user.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-users-id-owned_lists\n */\n async listsOwned(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/owned_lists', options, { fullResponse: true, params });\n return new paginators_1.UserOwnedListsV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns all Lists a specified user is a member of.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-users-id-list_memberships\n */\n async listMemberships(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/list_memberships', options, { fullResponse: true, params });\n return new paginators_1.UserListMembershipsV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns all Lists a specified user follows.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-users-id-followed_lists\n */\n async listFollowed(userId, options = {}) {\n const params = { id: userId };\n const initialRq = await this.get('users/:id/followed_lists', options, { fullResponse: true, params });\n return new paginators_1.UserListFollowedV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of Tweets from the specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-tweets/api-reference/get-lists-id-tweets\n */\n async listTweets(listId, options = {}) {\n const params = { id: listId };\n const initialRq = await this.get('lists/:id/tweets', options, { fullResponse: true, params });\n return new paginators_1.TweetV2ListTweetsPaginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are members of the specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-lists-id-members\n */\n async listMembers(listId, options = {}) {\n const params = { id: listId };\n const initialRq = await this.get('lists/:id/members', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserListMembersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /**\n * Returns a list of users who are followers of the specified List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-lists-id-followers\n */\n async listFollowers(listId, options = {}) {\n const params = { id: listId };\n const initialRq = await this.get('lists/:id/followers', options, { fullResponse: true, params });\n return new user_paginator_v2_1.UserListFollowersV2Paginator({\n realData: initialRq.data,\n rateLimit: initialRq.rateLimit,\n instance: this,\n queryParams: { ...options },\n sharedParams: params,\n });\n }\n /* Spaces */\n /**\n * Get a single space by ID.\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n space(spaceId, options = {}) {\n return this.get('spaces/:id', options, { params: { id: spaceId } });\n }\n /**\n * Get spaces using their IDs.\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n spaces(spaceIds, options = {}) {\n return this.get('spaces', { ids: spaceIds, ...options });\n }\n /**\n * Get spaces using their creator user ID(s). (no pagination available)\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n spacesByCreators(creatorIds, options = {}) {\n return this.get('spaces/by/creator_ids', { user_ids: creatorIds, ...options });\n }\n /**\n * Search through spaces using multiple params. (no pagination available)\n * https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search\n */\n searchSpaces(options) {\n return this.get('spaces/search', options);\n }\n /**\n * Returns a list of user who purchased a ticket to the requested Space.\n * You must authenticate the request using the Access Token of the creator of the requested Space.\n *\n * **OAuth 2.0 Access Token required**\n *\n * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-buyers\n *\n * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`.\n */\n spaceBuyers(spaceId, options = {}) {\n return this.get('spaces/:id/buyers', options, { params: { id: spaceId } });\n }\n searchStream({ autoConnect, ...options } = {}) {\n return this.getStream('tweets/search/stream', options, { payloadIsError: helpers_1.isTweetStreamV2ErrorPayload, autoConnect });\n }\n /**\n * Return a list of rules currently active on the streaming endpoint, either as a list or individually.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules\n */\n streamRules(options = {}) {\n return this.get('tweets/search/stream/rules', options);\n }\n updateStreamRules(options, query = {}) {\n return this.post('tweets/search/stream/rules', options, { query });\n }\n sampleStream({ autoConnect, ...options } = {}) {\n return this.getStream('tweets/sample/stream', options, { payloadIsError: helpers_1.isTweetStreamV2ErrorPayload, autoConnect });\n }\n /* Batch compliance */\n /**\n * Returns a list of recent compliance jobs.\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs\n */\n complianceJobs(options) {\n return this.get('compliance/jobs', options);\n }\n /**\n * Get a single compliance job with the specified ID.\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs-id\n */\n complianceJob(jobId) {\n return this.get('compliance/jobs/:id', undefined, { params: { id: jobId } });\n }\n /**\n * Creates a new compliance job for Tweet IDs or user IDs, send your file, await result and parse it into an array.\n * You can run one batch job at a time. Returns the created job, but **not the job result!**.\n *\n * You can obtain the result (**after job is completed**) with `.complianceJobResult`.\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs\n */\n async sendComplianceJob(jobParams) {\n const job = await this.post('compliance/jobs', { type: jobParams.type, name: jobParams.name });\n // Send the IDs\n const rawIdsBody = jobParams.ids instanceof Buffer ? jobParams.ids : Buffer.from(jobParams.ids.join('\\n'));\n // Upload the IDs\n await this.put(job.data.upload_url, rawIdsBody, {\n forceBodyMode: 'raw',\n enableAuth: false,\n headers: { 'Content-Type': 'text/plain' },\n prefix: '',\n });\n return job;\n }\n /**\n * Get the result of a running or completed job, obtained through `.complianceJob`, `.complianceJobs` or `.sendComplianceJob`.\n * If job is still running (`in_progress`), it will await until job is completed. **This could be quite long!**\n * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs\n */\n async complianceJobResult(job) {\n let runningJob = job;\n while (runningJob.status !== 'complete') {\n if (runningJob.status === 'expired' || runningJob.status === 'failed') {\n throw new Error('Job failed to be completed.');\n }\n await new Promise(resolve => setTimeout(resolve, 3500));\n runningJob = (await this.complianceJob(job.id)).data;\n }\n // Download and parse result\n const result = await this.get(job.download_url, undefined, {\n enableAuth: false,\n prefix: '',\n });\n return result\n .trim()\n .split('\\n')\n .filter(line => line)\n .map(line => JSON.parse(line));\n }\n}\nexports.default = TwitterApiv2ReadOnly;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globals_1 = require(\"../globals\");\nconst client_v2_read_1 = __importDefault(require(\"./client.v2.read\"));\nconst client_v2_labs_write_1 = __importDefault(require(\"../v2-labs/client.v2.labs.write\"));\n/**\n * Base Twitter v2 client with read/write rights.\n */\nclass TwitterApiv2ReadWrite extends client_v2_read_1.default {\n constructor() {\n super(...arguments);\n this._prefix = globals_1.API_V2_PREFIX;\n }\n /* Sub-clients */\n /**\n * Get a client with only read rights.\n */\n get readOnly() {\n return this;\n }\n /**\n * Get a client for v2 labs endpoints.\n */\n get labs() {\n if (this._labs)\n return this._labs;\n return this._labs = new client_v2_labs_write_1.default(this);\n }\n /* Tweets */\n /**\n * Hides or unhides a reply to a Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/hide-replies/api-reference/put-tweets-id-hidden\n */\n hideReply(tweetId, makeHidden) {\n return this.put('tweets/:id/hidden', { hidden: makeHidden }, { params: { id: tweetId } });\n }\n /**\n * Causes the user ID identified in the path parameter to Like the target Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-user_id-likes\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n like(loggedUserId, targetTweetId) {\n return this.post('users/:id/likes', { tweet_id: targetTweetId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user or authenticated user ID to unlike a Tweet.\n * The request succeeds with no action when the user sends a request to a user they're not liking the Tweet or have already unliked the Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/delete-users-id-likes-tweet_id\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unlike(loggedUserId, targetTweetId) {\n return this.delete('users/:id/likes/:tweet_id', undefined, {\n params: { id: loggedUserId, tweet_id: targetTweetId },\n });\n }\n /**\n * Causes the user ID identified in the path parameter to Retweet the target Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n retweet(loggedUserId, targetTweetId) {\n return this.post('users/:id/retweets', { tweet_id: targetTweetId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user or authenticated user ID to remove the Retweet of a Tweet.\n * The request succeeds with no action when the user sends a request to a user they're not Retweeting the Tweet or have already removed the Retweet of.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/delete-users-id-retweets-tweet_id\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unretweet(loggedUserId, targetTweetId) {\n return this.delete('users/:id/retweets/:tweet_id', undefined, {\n params: { id: loggedUserId, tweet_id: targetTweetId },\n });\n }\n tweet(status, payload = {}) {\n if (typeof status === 'object') {\n payload = status;\n }\n else {\n payload = { text: status, ...payload };\n }\n return this.post('tweets', payload);\n }\n /**\n * Reply to a Tweet on behalf of an authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets\n */\n reply(status, toTweetId, payload = {}) {\n var _a;\n const reply = { in_reply_to_tweet_id: toTweetId, ...(_a = payload.reply) !== null && _a !== void 0 ? _a : {} };\n return this.post('tweets', { text: status, ...payload, reply });\n }\n /**\n * Quote an existing Tweet on behalf of an authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets\n */\n quote(status, quotedTweetId, payload = {}) {\n return this.tweet(status, { ...payload, quote_tweet_id: quotedTweetId });\n }\n /**\n * Post a series of tweets.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets\n */\n async tweetThread(tweets) {\n var _a, _b;\n const postedTweets = [];\n for (const tweet of tweets) {\n // Retrieve the last sent tweet\n const lastTweet = postedTweets.length ? postedTweets[postedTweets.length - 1] : null;\n // Build the tweet query params\n const queryParams = { ...(typeof tweet === 'string' ? ({ text: tweet }) : tweet) };\n // Reply to an existing tweet if needed\n const inReplyToId = lastTweet ? lastTweet.data.id : (_a = queryParams.reply) === null || _a === void 0 ? void 0 : _a.in_reply_to_tweet_id;\n const status = (_b = queryParams.text) !== null && _b !== void 0 ? _b : '';\n if (inReplyToId) {\n postedTweets.push(await this.reply(status, inReplyToId, queryParams));\n }\n else {\n postedTweets.push(await this.tweet(status, queryParams));\n }\n }\n return postedTweets;\n }\n /**\n * Allows a user or authenticated user ID to delete a Tweet\n * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id\n */\n deleteTweet(tweetId) {\n return this.delete('tweets/:id', undefined, {\n params: {\n id: tweetId,\n },\n });\n }\n /* Bookmarks */\n /**\n * Causes the user ID of an authenticated user identified in the path parameter to Bookmark the target Tweet provided in the request body.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/post-users-id-bookmarks\n *\n * OAuth2 scopes: `users.read` `tweet.read` `bookmark.write`\n */\n async bookmark(tweetId) {\n const user = await this.getCurrentUserV2Object();\n return this.post('users/:id/bookmarks', { tweet_id: tweetId }, { params: { id: user.data.id } });\n }\n /**\n * Allows a user or authenticated user ID to remove a Bookmark of a Tweet.\n * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/delete-users-id-bookmarks-tweet_id\n *\n * OAuth2 scopes: `users.read` `tweet.read` `bookmark.write`\n */\n async deleteBookmark(tweetId) {\n const user = await this.getCurrentUserV2Object();\n return this.delete('users/:id/bookmarks/:tweet_id', undefined, { params: { id: user.data.id, tweet_id: tweetId } });\n }\n /* Users */\n /**\n * Allows a user ID to follow another user.\n * If the target user does not have public Tweets, this endpoint will send a follow request.\n * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following\n *\n * OAuth2 scope: `follows.write`\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n follow(loggedUserId, targetUserId) {\n return this.post('users/:id/following', { target_user_id: targetUserId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user ID to unfollow another user.\n * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/delete-users-source_id-following\n *\n * OAuth2 scope: `follows.write`\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unfollow(loggedUserId, targetUserId) {\n return this.delete('users/:source_user_id/following/:target_user_id', undefined, {\n params: { source_user_id: loggedUserId, target_user_id: targetUserId },\n });\n }\n /**\n * Causes the user (in the path) to block the target user.\n * The user (in the path) must match the user context authorizing the request.\n * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/post-users-user_id-blocking\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n block(loggedUserId, targetUserId) {\n return this.post('users/:id/blocking', { target_user_id: targetUserId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows a user or authenticated user ID to unblock another user.\n * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/delete-users-user_id-blocking\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unblock(loggedUserId, targetUserId) {\n return this.delete('users/:source_user_id/blocking/:target_user_id', undefined, {\n params: { source_user_id: loggedUserId, target_user_id: targetUserId },\n });\n }\n /**\n * Allows an authenticated user ID to mute the target user.\n * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/post-users-user_id-muting\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n mute(loggedUserId, targetUserId) {\n return this.post('users/:id/muting', { target_user_id: targetUserId }, { params: { id: loggedUserId } });\n }\n /**\n * Allows an authenticated user ID to unmute the target user.\n * The request succeeds with no action when the user sends a request to a user they're not muting or have already unmuted.\n * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/delete-users-user_id-muting\n *\n * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API.\n */\n unmute(loggedUserId, targetUserId) {\n return this.delete('users/:source_user_id/muting/:target_user_id', undefined, {\n params: { source_user_id: loggedUserId, target_user_id: targetUserId },\n });\n }\n /* Lists */\n /**\n * Creates a new list for the authenticated user.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists\n */\n createList(options) {\n return this.post('lists', options);\n }\n /**\n * Updates the specified list. The authenticated user must own the list to be able to update it.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/put-lists-id\n */\n updateList(listId, options = {}) {\n return this.put('lists/:id', options, { params: { id: listId } });\n }\n /**\n * Deletes the specified list. The authenticated user must own the list to be able to destroy it.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id\n */\n removeList(listId) {\n return this.delete('lists/:id', undefined, { params: { id: listId } });\n }\n /**\n * Adds a member to a list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists-id-members\n */\n addListMember(listId, userId) {\n return this.post('lists/:id/members', { user_id: userId }, { params: { id: listId } });\n }\n /**\n * Remember a member to a list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id-members-user_id\n */\n removeListMember(listId, userId) {\n return this.delete('lists/:id/members/:user_id', undefined, { params: { id: listId, user_id: userId } });\n }\n /**\n * Subscribes the authenticated user to the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-followed-lists\n */\n subscribeToList(loggedUserId, listId) {\n return this.post('users/:id/followed_lists', { list_id: listId }, { params: { id: loggedUserId } });\n }\n /**\n * Unsubscribes the authenticated user to the specified list.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-followed-lists-list_id\n */\n unsubscribeOfList(loggedUserId, listId) {\n return this.delete('users/:id/followed_lists/:list_id', undefined, { params: { id: loggedUserId, list_id: listId } });\n }\n /**\n * Enables the authenticated user to pin a List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-pinned-lists\n */\n pinList(loggedUserId, listId) {\n return this.post('users/:id/pinned_lists', { list_id: listId }, { params: { id: loggedUserId } });\n }\n /**\n * Enables the authenticated user to unpin a List.\n * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-pinned-lists-list_id\n */\n unpinList(loggedUserId, listId) {\n return this.delete('users/:id/pinned_lists/:list_id', undefined, { params: { id: loggedUserId, list_id: listId } });\n }\n}\nexports.default = TwitterApiv2ReadWrite;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterV2IncludesHelper = void 0;\n/**\n * Provide helpers for `.includes` of a v2 API result.\n * Needed expansions for a method to work are specified (*`like this`*).\n */\nclass TwitterV2IncludesHelper {\n constructor(result) {\n this.result = result;\n }\n /* Tweets */\n get tweets() {\n return TwitterV2IncludesHelper.tweets(this.result);\n }\n static tweets(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.tweets) !== null && _b !== void 0 ? _b : [];\n }\n tweetById(id) {\n return TwitterV2IncludesHelper.tweetById(this.result, id);\n }\n static tweetById(result, id) {\n return this.tweets(result).find(tweet => tweet.id === id);\n }\n /** Retweet associated with the given tweet (*`referenced_tweets.id`*) */\n retweet(tweet) {\n return TwitterV2IncludesHelper.retweet(this.result, tweet);\n }\n /** Retweet associated with the given tweet (*`referenced_tweets.id`*) */\n static retweet(result, tweet) {\n var _a;\n const retweetIds = ((_a = tweet.referenced_tweets) !== null && _a !== void 0 ? _a : [])\n .filter(ref => ref.type === 'retweeted')\n .map(ref => ref.id);\n return this.tweets(result).find(t => retweetIds.includes(t.id));\n }\n /** Quoted tweet associated with the given tweet (*`referenced_tweets.id`*) */\n quote(tweet) {\n return TwitterV2IncludesHelper.quote(this.result, tweet);\n }\n /** Quoted tweet associated with the given tweet (*`referenced_tweets.id`*) */\n static quote(result, tweet) {\n var _a;\n const quoteIds = ((_a = tweet.referenced_tweets) !== null && _a !== void 0 ? _a : [])\n .filter(ref => ref.type === 'quoted')\n .map(ref => ref.id);\n return this.tweets(result).find(t => quoteIds.includes(t.id));\n }\n /** Tweet whose has been answered by the given tweet (*`referenced_tweets.id`*) */\n repliedTo(tweet) {\n return TwitterV2IncludesHelper.repliedTo(this.result, tweet);\n }\n /** Tweet whose has been answered by the given tweet (*`referenced_tweets.id`*) */\n static repliedTo(result, tweet) {\n var _a;\n const repliesIds = ((_a = tweet.referenced_tweets) !== null && _a !== void 0 ? _a : [])\n .filter(ref => ref.type === 'replied_to')\n .map(ref => ref.id);\n return this.tweets(result).find(t => repliesIds.includes(t.id));\n }\n /** Tweet author user object of the given tweet (*`author_id`* or *`referenced_tweets.id.author_id`*) */\n author(tweet) {\n return TwitterV2IncludesHelper.author(this.result, tweet);\n }\n /** Tweet author user object of the given tweet (*`author_id`* or *`referenced_tweets.id.author_id`*) */\n static author(result, tweet) {\n const authorId = tweet.author_id;\n return authorId ? this.users(result).find(u => u.id === authorId) : undefined;\n }\n /** Tweet author user object of the tweet answered by the given tweet (*`in_reply_to_user_id`*) */\n repliedToAuthor(tweet) {\n return TwitterV2IncludesHelper.repliedToAuthor(this.result, tweet);\n }\n /** Tweet author user object of the tweet answered by the given tweet (*`in_reply_to_user_id`*) */\n static repliedToAuthor(result, tweet) {\n const inReplyUserId = tweet.in_reply_to_user_id;\n return inReplyUserId ? this.users(result).find(u => u.id === inReplyUserId) : undefined;\n }\n /* Users */\n get users() {\n return TwitterV2IncludesHelper.users(this.result);\n }\n static users(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.users) !== null && _b !== void 0 ? _b : [];\n }\n userById(id) {\n return TwitterV2IncludesHelper.userById(this.result, id);\n }\n static userById(result, id) {\n return this.users(result).find(u => u.id === id);\n }\n /** Pinned tweet of the given user (*`pinned_tweet_id`*) */\n pinnedTweet(user) {\n return TwitterV2IncludesHelper.pinnedTweet(this.result, user);\n }\n /** Pinned tweet of the given user (*`pinned_tweet_id`*) */\n static pinnedTweet(result, user) {\n return user.pinned_tweet_id ? this.tweets(result).find(t => t.id === user.pinned_tweet_id) : undefined;\n }\n /* Medias */\n get media() {\n return TwitterV2IncludesHelper.media(this.result);\n }\n static media(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.media) !== null && _b !== void 0 ? _b : [];\n }\n /** Medias associated with the given tweet (*`attachments.media_keys`*) */\n medias(tweet) {\n return TwitterV2IncludesHelper.medias(this.result, tweet);\n }\n /** Medias associated with the given tweet (*`attachments.media_keys`*) */\n static medias(result, tweet) {\n var _a, _b;\n const keys = (_b = (_a = tweet.attachments) === null || _a === void 0 ? void 0 : _a.media_keys) !== null && _b !== void 0 ? _b : [];\n return this.media(result).filter(m => keys.includes(m.media_key));\n }\n /* Polls */\n get polls() {\n return TwitterV2IncludesHelper.polls(this.result);\n }\n static polls(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.polls) !== null && _b !== void 0 ? _b : [];\n }\n /** Poll associated with the given tweet (*`attachments.poll_ids`*) */\n poll(tweet) {\n return TwitterV2IncludesHelper.poll(this.result, tweet);\n }\n /** Poll associated with the given tweet (*`attachments.poll_ids`*) */\n static poll(result, tweet) {\n var _a, _b;\n const pollIds = (_b = (_a = tweet.attachments) === null || _a === void 0 ? void 0 : _a.poll_ids) !== null && _b !== void 0 ? _b : [];\n if (pollIds.length) {\n const pollId = pollIds[0];\n return this.polls(result).find(p => p.id === pollId);\n }\n return undefined;\n }\n /* Places */\n get places() {\n return TwitterV2IncludesHelper.places(this.result);\n }\n static places(result) {\n var _a, _b;\n return (_b = (_a = result.includes) === null || _a === void 0 ? void 0 : _a.places) !== null && _b !== void 0 ? _b : [];\n }\n /** Place associated with the given tweet (*`geo.place_id`*) */\n place(tweet) {\n return TwitterV2IncludesHelper.place(this.result, tweet);\n }\n /** Place associated with the given tweet (*`geo.place_id`*) */\n static place(result, tweet) {\n var _a;\n const placeId = (_a = tweet.geo) === null || _a === void 0 ? void 0 : _a.place_id;\n return placeId ? this.places(result).find(p => p.id === placeId) : undefined;\n }\n /* Lists */\n /** List owner of the given list (*`owner_id`*) */\n listOwner(list) {\n return TwitterV2IncludesHelper.listOwner(this.result, list);\n }\n /** List owner of the given list (*`owner_id`*) */\n static listOwner(result, list) {\n const creatorId = list.owner_id;\n return creatorId ? this.users(result).find(p => p.id === creatorId) : undefined;\n }\n /* Spaces */\n /** Creator of the given space (*`creator_id`*) */\n spaceCreator(space) {\n return TwitterV2IncludesHelper.spaceCreator(this.result, space);\n }\n /** Creator of the given space (*`creator_id`*) */\n static spaceCreator(result, space) {\n const creatorId = space.creator_id;\n return creatorId ? this.users(result).find(p => p.id === creatorId) : undefined;\n }\n /** Current hosts of the given space (*`host_ids`*) */\n spaceHosts(space) {\n return TwitterV2IncludesHelper.spaceHosts(this.result, space);\n }\n /** Current hosts of the given space (*`host_ids`*) */\n static spaceHosts(result, space) {\n var _a;\n const hostIds = (_a = space.host_ids) !== null && _a !== void 0 ? _a : [];\n return this.users(result).filter(u => hostIds.includes(u.id));\n }\n /** Current speakers of the given space (*`speaker_ids`*) */\n spaceSpeakers(space) {\n return TwitterV2IncludesHelper.spaceSpeakers(this.result, space);\n }\n /** Current speakers of the given space (*`speaker_ids`*) */\n static spaceSpeakers(result, space) {\n var _a;\n const speakerIds = (_a = space.speaker_ids) !== null && _a !== void 0 ? _a : [];\n return this.users(result).filter(u => speakerIds.includes(u.id));\n }\n /** Current invited users of the given space (*`invited_user_ids`*) */\n spaceInvitedUsers(space) {\n return TwitterV2IncludesHelper.spaceInvitedUsers(this.result, space);\n }\n /** Current invited users of the given space (*`invited_user_ids`*) */\n static spaceInvitedUsers(result, space) {\n var _a;\n const invitedUserIds = (_a = space.invited_user_ids) !== null && _a !== void 0 ? _a : [];\n return this.users(result).filter(u => invitedUserIds.includes(u.id));\n }\n}\nexports.TwitterV2IncludesHelper = TwitterV2IncludesHelper;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","module.exports = require(\"assert\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"tls\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(3109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ae4ce31..b6da411 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", - "dotenv": "^16.0.1", + "dotenv": "^16.0.3", "fs": "0.0.1-security", "path": "^0.12.7", "twitter-api-v2": "^1.12.3" @@ -2225,9 +2225,9 @@ } }, "node_modules/dotenv": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", - "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", "engines": { "node": ">=12" } @@ -8000,9 +8000,9 @@ } }, "dotenv": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", - "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==" + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" }, "electron-to-chromium": { "version": "1.4.215", diff --git a/package.json b/package.json index 692be4f..f47ba31 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", - "dotenv": "^16.0.1", + "dotenv": "^16.0.3", "fs": "0.0.1-security", "path": "^0.12.7", "twitter-api-v2": "^1.12.3"