From 66efdd4edc31fbe3a56ecc4f550cd4e389d33305 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Sun, 13 Dec 2020 00:23:05 -0500 Subject: [PATCH 1/6] wip --- dist/index.js | 27 +++++++++++++++++++++++++++ package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/index.js | 28 ++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9192615..b04efde 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10839,12 +10839,39 @@ async function isBaseDiffFromHead(baseRef) { return exitCode !== 0; } +const lockFiles = { + 'package-lock.json': 'npm ci', + 'yarn.lock': 'yarn install --frozen-lockfile', + 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', +}; + +async function findLockFile(directory) { + for (const lockFile in lockFiles) { // eslint-disable-line guard-for-in + const lockFilePath = path__default['default'].join(directory, lockFile); + if (fs__default['default'].existsSync(lockFilePath)) { + return { + lockFilePath, + command: lockFiles[lockFile], + }; + } + } + + return { + lockFilePath: undefined, + command: 'npm i', + }; +} + async function npmCi({cwd} = {}) { if (fs__default['default'].existsSync('node_modules')) { core.info('Cleaning node_modules'); await rmRF_1(path__default['default'].join(cwd, 'node_modules')); } + const packageManager = findLockFile(cwd); + + console.log(JSON.stringify(packageManager, null, 4)); + if (fs__default['default'].existsSync('package-lock.json')) { core.info('Installing dependencies with npm'); return await exec$2('npm ci', {cwd}); diff --git a/package.json b/package.json index b88d65a..1d42047 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ ] }, "devDependencies": { - "@actions/cache": "^1.0.4", + "@actions/cache": "^1.0.5", "@actions/core": "^1.2.6", "@actions/exec": "^1.0.4", "@actions/github": "^4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0224d31..84ee6c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,5 @@ devDependencies: - '@actions/cache': 1.0.4 + '@actions/cache': 1.0.5 '@actions/core': 1.2.6 '@actions/exec': 1.0.4 '@actions/github': 4.0.0 @@ -18,7 +18,7 @@ devDependencies: xo: 0.35.0 lockfileVersion: 5.2 packages: - /@actions/cache/1.0.4: + /@actions/cache/1.0.5: dependencies: '@actions/core': 1.2.6 '@actions/exec': 1.0.4 @@ -31,7 +31,7 @@ packages: uuid: 3.4.0 dev: true resolution: - integrity: sha512-1grYfbu8P6JDDHc40eOI5tQDRcAxMwq5HBWhaCqEg9o/ixDRZfwPHlQvQAop2ZzFCjF2ns0ENQOIBAH8GNn+zA== + integrity: sha512-TcvJOduwsPP27KLmIa5cqXsQYFK2GzILcEpnhvYmhGwi1aYx9XwhKmp6Im8X6DJMBxbvupKPsOntG6f6sSkIPA== /@actions/core/1.2.6: dev: true resolution: @@ -5366,7 +5366,7 @@ packages: resolution: integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== specifiers: - '@actions/cache': ^1.0.4 + '@actions/cache': ^1.0.5 '@actions/core': ^1.2.6 '@actions/exec': ^1.0.4 '@actions/github': ^4.0.0 diff --git a/src/index.js b/src/index.js index 22e0d9f..95787a5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ import * as core from '@actions/core'; import {context} from '@actions/github'; import {rmRF} from '@actions/io'; +// import cache from '@actions/cache'; import assert from 'assert'; import fs from 'fs'; import path from 'path'; @@ -30,12 +31,39 @@ async function isBaseDiffFromHead(baseRef) { return exitCode !== 0; } +const lockFiles = { + 'package-lock.json': 'npm ci', + 'yarn.lock': 'yarn install --frozen-lockfile', + 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', +}; + +async function findLockFile(directory) { + for (const lockFile in lockFiles) { // eslint-disable-line guard-for-in + const lockFilePath = path.join(directory, lockFile); + if (fs.existsSync(lockFilePath)) { + return { + lockFilePath, + command: lockFiles[lockFile], + }; + } + } + + return { + lockFilePath: undefined, + command: 'npm i', + }; +} + async function npmCi({cwd} = {}) { if (fs.existsSync('node_modules')) { core.info('Cleaning node_modules'); await rmRF(path.join(cwd, 'node_modules')); } + const packageManager = findLockFile(cwd); + + console.log(JSON.stringify(packageManager, null, 4)); + if (fs.existsSync('package-lock.json')) { core.info('Installing dependencies with npm'); return await exec('npm ci', {cwd}); From d116a5fdfbb2eac800900f42638e8547e8f13a34 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Sun, 13 Dec 2020 00:25:38 -0500 Subject: [PATCH 2/6] wip --- dist/index.js | 2 +- src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b04efde..b32b5a9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10845,7 +10845,7 @@ const lockFiles = { 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', }; -async function findLockFile(directory) { +function findLockFile(directory) { for (const lockFile in lockFiles) { // eslint-disable-line guard-for-in const lockFilePath = path__default['default'].join(directory, lockFile); if (fs__default['default'].existsSync(lockFilePath)) { diff --git a/src/index.js b/src/index.js index 95787a5..d8215ce 100644 --- a/src/index.js +++ b/src/index.js @@ -37,7 +37,7 @@ const lockFiles = { 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', }; -async function findLockFile(directory) { +function findLockFile(directory) { for (const lockFile in lockFiles) { // eslint-disable-line guard-for-in const lockFilePath = path.join(directory, lockFile); if (fs.existsSync(lockFilePath)) { From db266257daed26f39343e12e2fac164f568e35a5 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Sun, 13 Dec 2020 00:35:39 -0500 Subject: [PATCH 3/6] wip --- dist/index.js | 50 ++++++++++++++++++++++++++++++++------------------ src/index.js | 49 +++++++++++++++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/dist/index.js b/dist/index.js index b32b5a9..32cd017 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14,6 +14,7 @@ var Stream = require('stream'); var Url = require('url'); var zlib = require('zlib'); var childProcess = require('child_process'); +var crypto = require('crypto'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -30,6 +31,7 @@ var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream); var Url__default = /*#__PURE__*/_interopDefaultLegacy(Url); var zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); var childProcess__default = /*#__PURE__*/_interopDefaultLegacy(childProcess); +var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -10841,8 +10843,8 @@ async function isBaseDiffFromHead(baseRef) { const lockFiles = { 'package-lock.json': 'npm ci', - 'yarn.lock': 'yarn install --frozen-lockfile', - 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', + 'yarn.lock': 'yarn install --frozen-lockfile', // yarn is installed on GitHub Actions by default + 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', // pnpm is not installed on GitHub Actions by default }; function findLockFile(directory) { @@ -10862,6 +10864,13 @@ function findLockFile(directory) { }; } +const getHash = filePath => new Promise(resolve => { + const hash = crypto__default['default'].createHash('md5'); + fs__default['default'].createReadStream(filePath) + .on('data', data => hash.update(data)) + .on('end', () => resolve(hash.digest('hex'))); +}); + async function npmCi({cwd} = {}) { if (fs__default['default'].existsSync('node_modules')) { core.info('Cleaning node_modules'); @@ -10872,27 +10881,32 @@ async function npmCi({cwd} = {}) { console.log(JSON.stringify(packageManager, null, 4)); - if (fs__default['default'].existsSync('package-lock.json')) { - core.info('Installing dependencies with npm'); - return await exec$2('npm ci', {cwd}); - } + console.log(await getHash(packageManager.lockFilePath)); - if (fs__default['default'].existsSync('yarn.lock')) { - core.info('Installing dependencies with yarn'); + core.info(`Installing dependencies with ${packageManager.command}`); + return await exec$2(packageManager.command, {cwd}); - // yarn is installed on GitHub Actions by default - return await exec$2('yarn install --frozen-lockfile', {cwd}); - } + // if (fs.existsSync('package-lock.json')) { + // core.info('Installing dependencies with npm'); + // return await exec('npm ci', {cwd}); + // } - if (fs__default['default'].existsSync('pnpm-lock.yaml')) { - core.info('Installing dependencies with pnpm'); + // if (fs.existsSync('yarn.lock')) { + // core.info('Installing dependencies with yarn'); - // pnpm is not installed on GitHub Actions by default - return await exec$2('npx pnpm i --frozen-lockfile', {cwd}); - } + // // yarn is installed on GitHub Actions by default + // return await exec('yarn install --frozen-lockfile', {cwd}); + // } + + // if (fs.existsSync('pnpm-lock.yaml')) { + // core.info('Installing dependencies with pnpm'); + + // // pnpm is not installed on GitHub Actions by default + // return await exec('npx pnpm i --frozen-lockfile', {cwd}); + // } - core.info('No lock file detected. Installing dependencies with npm'); - return await exec$2('npm i', {cwd}); + // core.info('No lock file detected. Installing dependencies with npm'); + // return await exec('npm i', {cwd}); } async function isFileTracked(filePath) { diff --git a/src/index.js b/src/index.js index d8215ce..bcd3796 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import * as core from '@actions/core'; import {context} from '@actions/github'; import {rmRF} from '@actions/io'; // import cache from '@actions/cache'; +import crypto from 'crypto'; import assert from 'assert'; import fs from 'fs'; import path from 'path'; @@ -33,8 +34,8 @@ async function isBaseDiffFromHead(baseRef) { const lockFiles = { 'package-lock.json': 'npm ci', - 'yarn.lock': 'yarn install --frozen-lockfile', - 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', + 'yarn.lock': 'yarn install --frozen-lockfile', // yarn is installed on GitHub Actions by default + 'pnpm-lock.yaml': 'npx pnpm i --frozen-lockfile', // pnpm is not installed on GitHub Actions by default }; function findLockFile(directory) { @@ -54,6 +55,13 @@ function findLockFile(directory) { }; } +const getHash = filePath => new Promise(resolve => { + const hash = crypto.createHash('md5'); + fs.createReadStream(filePath) + .on('data', data => hash.update(data)) + .on('end', () => resolve(hash.digest('hex'))); +}); + async function npmCi({cwd} = {}) { if (fs.existsSync('node_modules')) { core.info('Cleaning node_modules'); @@ -64,27 +72,32 @@ async function npmCi({cwd} = {}) { console.log(JSON.stringify(packageManager, null, 4)); - if (fs.existsSync('package-lock.json')) { - core.info('Installing dependencies with npm'); - return await exec('npm ci', {cwd}); - } + console.log(await getHash(packageManager.lockFilePath)); - if (fs.existsSync('yarn.lock')) { - core.info('Installing dependencies with yarn'); + core.info(`Installing dependencies with ${packageManager.command}`); + return await exec(packageManager.command, {cwd}); - // yarn is installed on GitHub Actions by default - return await exec('yarn install --frozen-lockfile', {cwd}); - } + // if (fs.existsSync('package-lock.json')) { + // core.info('Installing dependencies with npm'); + // return await exec('npm ci', {cwd}); + // } - if (fs.existsSync('pnpm-lock.yaml')) { - core.info('Installing dependencies with pnpm'); + // if (fs.existsSync('yarn.lock')) { + // core.info('Installing dependencies with yarn'); - // pnpm is not installed on GitHub Actions by default - return await exec('npx pnpm i --frozen-lockfile', {cwd}); - } + // // yarn is installed on GitHub Actions by default + // return await exec('yarn install --frozen-lockfile', {cwd}); + // } + + // if (fs.existsSync('pnpm-lock.yaml')) { + // core.info('Installing dependencies with pnpm'); + + // // pnpm is not installed on GitHub Actions by default + // return await exec('npx pnpm i --frozen-lockfile', {cwd}); + // } - core.info('No lock file detected. Installing dependencies with npm'); - return await exec('npm i', {cwd}); + // core.info('No lock file detected. Installing dependencies with npm'); + // return await exec('npm i', {cwd}); } async function isFileTracked(filePath) { From 51cdd0465de3df31da3d680383847490fc8dcb29 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Sun, 13 Dec 2020 00:52:17 -0500 Subject: [PATCH 4/6] wip --- dist/index.js | 69910 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + pnpm-lock.yaml | 11 + rollup.config.js | 2 + src/index.js | 7 +- 5 files changed, 68613 insertions(+), 1318 deletions(-) diff --git a/dist/index.js b/dist/index.js index 32cd017..4bae819 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,37 +1,45 @@ 'use strict'; -var require$$0 = require('os'); -var fs$1 = require('fs'); -var path$1 = require('path'); +var os$4 = require('os'); +var fs$5 = require('fs'); +var path$9 = require('path'); var http = require('http'); var https = require('https'); require('net'); var tls = require('tls'); -var events$1 = require('events'); -var assert_1 = require('assert'); -var util = require('util'); -var Stream = require('stream'); +var require$$1$1 = require('events'); +var assert_1$3 = require('assert'); +var util$2 = require('util'); +var Stream$2 = require('stream'); var Url = require('url'); var zlib = require('zlib'); var childProcess = require('child_process'); -var crypto = require('crypto'); +var crypto$2 = require('crypto'); +var Punycode = require('punycode'); +var require$$1$2 = require('string_decoder'); +var require$$4 = require('timers'); +var require$$1$3 = require('buffer'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } -var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs$1); -var path__default = /*#__PURE__*/_interopDefaultLegacy(path$1); +var os__default = /*#__PURE__*/_interopDefaultLegacy(os$4); +var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs$5); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path$9); var http__default = /*#__PURE__*/_interopDefaultLegacy(http); var https__default = /*#__PURE__*/_interopDefaultLegacy(https); var tls__default = /*#__PURE__*/_interopDefaultLegacy(tls); -var events__default = /*#__PURE__*/_interopDefaultLegacy(events$1); -var assert_1__default = /*#__PURE__*/_interopDefaultLegacy(assert_1); -var util__default = /*#__PURE__*/_interopDefaultLegacy(util); -var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream); +var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$1); +var assert_1__default = /*#__PURE__*/_interopDefaultLegacy(assert_1$3); +var util__default = /*#__PURE__*/_interopDefaultLegacy(util$2); +var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream$2); var Url__default = /*#__PURE__*/_interopDefaultLegacy(Url); var zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); var childProcess__default = /*#__PURE__*/_interopDefaultLegacy(childProcess); -var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); +var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto$2); +var Punycode__default = /*#__PURE__*/_interopDefaultLegacy(Punycode); +var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$2); +var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4); +var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$3); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -86,7 +94,7 @@ var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function ( return result; }; -const os = __importStar(require$$0__default['default']); +const os = __importStar(os__default['default']); /** * Commands @@ -174,7 +182,7 @@ var __importStar$1 = (commonjsGlobal && commonjsGlobal.__importStar) || function // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar$1(fs__default['default']); -const os$1 = __importStar$1(require$$0__default['default']); +const os$1 = __importStar$1(os__default['default']); function issueCommand$1(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -216,7 +224,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -const os = __importStar(require$$0__default['default']); +const os = __importStar(os__default['default']); const path = __importStar(path__default['default']); /** * The code to exit an action @@ -452,7 +460,7 @@ class Context { } else { const path = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${require$$0__default['default'].EOL}`); + process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os__default['default'].EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -607,7 +615,7 @@ function TunnelingAgent(options) { self.removeSocket(socket); }); } -util__default['default'].inherits(TunnelingAgent, events__default['default'].EventEmitter); +util__default['default'].inherits(TunnelingAgent, require$$1__default['default'].EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; @@ -1972,7 +1980,7 @@ const Readable = Stream__default['default'].Readable; const BUFFER = Symbol('buffer'); const TYPE = Symbol('type'); -class Blob { +class Blob$1 { constructor() { this[TYPE] = ''; @@ -1994,7 +2002,7 @@ class Blob { buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); - } else if (element instanceof Blob) { + } else if (element instanceof Blob$1) { buffer = element[BUFFER]; } else { buffer = Buffer.from(typeof element === 'string' ? element : String(element)); @@ -2059,19 +2067,19 @@ class Blob { const buffer = this[BUFFER]; const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); + const blob = new Blob$1([], { type: arguments[2] }); blob[BUFFER] = slicedBuffer; return blob; } } -Object.defineProperties(Blob.prototype, { +Object.defineProperties(Blob$1.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { +Object.defineProperty(Blob$1.prototype, Symbol.toStringTag, { value: 'Blob', writable: false, enumerable: false, @@ -2203,7 +2211,7 @@ Body.prototype = { return consumeBody.call(this).then(function (buf) { return Object.assign( // Prevent copying - new Blob([], { + new Blob$1([], { type: ct.toLowerCase() }), { [BUFFER]: buf @@ -6175,705 +6183,612 @@ var io = /*#__PURE__*/Object.defineProperty({ which: which_1 }, '__esModule', {value: true}); -var dist = createCommonjsModule(function (module, exports) { -(function (global, factory) { - module.exports = factory() ; -}(commonjsGlobal, (function () { - /** - * @module byte-size - */ - - let defaultOptions = {}; - const _options = new WeakMap(); - - class ByteSize { - constructor (bytes, options) { - options = Object.assign({ - units: 'metric', - precision: 1 - }, defaultOptions, options); - _options.set(this, options); - - const tables = { - metric: [ - { from: 0 , to: 1e3 , unit: 'B' , long: 'bytes' }, - { from: 1e3 , to: 1e6 , unit: 'kB', long: 'kilobytes' }, - { from: 1e6 , to: 1e9 , unit: 'MB', long: 'megabytes' }, - { from: 1e9 , to: 1e12, unit: 'GB', long: 'gigabytes' }, - { from: 1e12, to: 1e15, unit: 'TB', long: 'terabytes' }, - { from: 1e15, to: 1e18, unit: 'PB', long: 'petabytes' }, - { from: 1e18, to: 1e21, unit: 'EB', long: 'exabytes' }, - { from: 1e21, to: 1e24, unit: 'ZB', long: 'zettabytes' }, - { from: 1e24, to: 1e27, unit: 'YB', long: 'yottabytes' }, - ], - metric_octet: [ - { from: 0 , to: 1e3 , unit: 'o' , long: 'octets' }, - { from: 1e3 , to: 1e6 , unit: 'ko', long: 'kilooctets' }, - { from: 1e6 , to: 1e9 , unit: 'Mo', long: 'megaoctets' }, - { from: 1e9 , to: 1e12, unit: 'Go', long: 'gigaoctets' }, - { from: 1e12, to: 1e15, unit: 'To', long: 'teraoctets' }, - { from: 1e15, to: 1e18, unit: 'Po', long: 'petaoctets' }, - { from: 1e18, to: 1e21, unit: 'Eo', long: 'exaoctets' }, - { from: 1e21, to: 1e24, unit: 'Zo', long: 'zettaoctets' }, - { from: 1e24, to: 1e27, unit: 'Yo', long: 'yottaoctets' }, - ], - iec: [ - { from: 0 , to: Math.pow(1024, 1), unit: 'B' , long: 'bytes' }, - { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'KiB', long: 'kibibytes' }, - { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'MiB', long: 'mebibytes' }, - { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'GiB', long: 'gibibytes' }, - { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'TiB', long: 'tebibytes' }, - { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'PiB', long: 'pebibytes' }, - { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'EiB', long: 'exbibytes' }, - { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'ZiB', long: 'zebibytes' }, - { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'YiB', long: 'yobibytes' }, - ], - iec_octet: [ - { from: 0 , to: Math.pow(1024, 1), unit: 'o' , long: 'octets' }, - { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'Kio', long: 'kibioctets' }, - { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'Mio', long: 'mebioctets' }, - { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'Gio', long: 'gibioctets' }, - { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'Tio', long: 'tebioctets' }, - { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'Pio', long: 'pebioctets' }, - { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'Eio', long: 'exbioctets' }, - { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'Zio', long: 'zebioctets' }, - { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'Yio', long: 'yobioctets' }, - ], - }; - Object.assign(tables, options.customUnits); +var __awaiter$1 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar$2 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; - const prefix = bytes < 0 ? '-' : ''; - bytes = Math.abs(bytes); - const table = tables[options.units]; - if (table) { - const units = table.find(u => bytes >= u.from && bytes < u.to); - if (units) { - const value = units.from === 0 - ? prefix + bytes - : prefix + (bytes / units.from).toFixed(options.precision); - this.value = value; - this.unit = units.unit; - this.long = units.long; - } else { - this.value = prefix + bytes; - this.unit = ''; - this.long = ''; +const os$2 = __importStar$2(os__default['default']); +const events = __importStar$2(require$$1__default['default']); +const child = __importStar$2(childProcess__default['default']); +const path = __importStar$2(path__default['default']); +const io$1 = __importStar$2(io); +const ioUtil$1 = __importStar$2(ioUtil); +/* eslint-disable @typescript-eslint/unbound-method */ +const IS_WINDOWS = process.platform === 'win32'; +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); } - } else { - throw new Error(`Invalid units specified: ${options.units}`) - } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; } - - toString () { - const options = _options.get(this); - return options.toStringFn ? options.toStringFn.bind(this)() : `${this.value} ${this.unit}` + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - } - - /** - * Returns an object with the spec `{ value: string, unit: string, long: string }`. The returned object defines a `toString` method meaning it can be used in any string context. - * @param {number} - The bytes value to convert. - * @param [options] {object} - Optional config. - * @param [options.precision] {number} - Number of decimal places. Defaults to `1`. - * @param [options.units] {string} - Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`. - * @param [options.customUnits] {object} - An object containing one or more custom unit lookup tables. - * @param [options.toStringFn] {function} - A `toString` function to override the default. - * @returns {object} - * @alias module:byte-size - */ - function byteSize (bytes, options) { - return new ByteSize(bytes, options) - } - - /** - * Set the default `byteSize` options for the duration of the process. - * @param options {object} - A `byteSize` options object. - */ - byteSize.defaultOptions = function (options) { - defaultOptions = options; - }; - - return byteSize; - -}))); -}); - -/*! - * repeat-string - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -/** - * Results cache - */ - -var res = ''; -var cache; - -/** - * Expose `repeat` - */ - -var repeatString = repeat; - -/** - * Repeat the given `string` the specified `number` - * of times. - * - * **Example:** - * - * ```js - * var repeat = require('repeat-string'); - * repeat('A', 5); - * //=> AAAAA - * ``` - * - * @param {String} `string` The string to repeat - * @param {Number} `number` The number of times to repeat the string - * @return {String} Repeated string - * @api public - */ - -function repeat(str, num) { - if (typeof str !== 'string') { - throw new TypeError('expected a string'); - } - - // cover common, quick use cases - if (num === 1) return str; - if (num === 2) return str + str; - - var max = str.length * num; - if (cache !== str || typeof cache === 'undefined') { - cache = str; - res = ''; - } else if (res.length >= max) { - return res.substr(0, max); - } - - while (max > res.length && num > 1) { - if (num & 1) { - res += str; + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; } - - num >>= 1; - str += str; - } - - res += str; - res = res.substr(0, max); - return res; -} - -var markdownTable_1 = markdownTable; - -var trailingWhitespace = / +$/; - -// Characters. -var space = ' '; -var lineFeed = '\n'; -var dash = '-'; -var colon = ':'; -var verticalBar = '|'; - -var x = 0; -var C = 67; -var L = 76; -var R = 82; -var c = 99; -var l = 108; -var r = 114; - -// Create a table from a matrix of strings. -function markdownTable(table, options) { - var settings = options || {}; - var padding = settings.padding !== false; - var start = settings.delimiterStart !== false; - var end = settings.delimiterEnd !== false; - var align = (settings.align || []).concat(); - var alignDelimiters = settings.alignDelimiters !== false; - var alignments = []; - var stringLength = settings.stringLength || defaultStringLength; - var rowIndex = -1; - var rowLength = table.length; - var cellMatrix = []; - var sizeMatrix = []; - var row = []; - var sizes = []; - var longestCellByColumn = []; - var mostCellsPerRow = 0; - var cells; - var columnIndex; - var columnLength; - var largest; - var size; - var cell; - var lines; - var line; - var before; - var after; - var code; - - // This is a superfluous loop if we don’t align delimiters, but otherwise we’d - // do superfluous work when aligning, so optimize for aligning. - while (++rowIndex < rowLength) { - cells = table[rowIndex]; - columnIndex = -1; - columnLength = cells.length; - row = []; - sizes = []; - - if (columnLength > mostCellsPerRow) { - mostCellsPerRow = columnLength; - } - - while (++columnIndex < columnLength) { - cell = serialize(cells[columnIndex]); - - if (alignDelimiters === true) { - size = stringLength(cell); - sizes[columnIndex] = size; - - largest = longestCellByColumn[columnIndex]; - - if (largest === undefined || size > largest) { - longestCellByColumn[columnIndex] = size; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os$2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os$2.EOL.length); + n = s.indexOf(os$2.EOL); + } + strBuffer = s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); } - } - - row.push(cell); } - - cellMatrix[rowIndex] = row; - sizeMatrix[rowIndex] = sizes; - } - - // Figure out which alignments to use. - columnIndex = -1; - columnLength = mostCellsPerRow; - - if (typeof align === 'object' && 'length' in align) { - while (++columnIndex < columnLength) { - alignments[columnIndex] = toAlignment(align[columnIndex]); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; } - } else { - code = toAlignment(align); - - while (++columnIndex < columnLength) { - alignments[columnIndex] = code; + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; } - } - - // Inject the alignment row. - columnIndex = -1; - columnLength = mostCellsPerRow; - row = []; - sizes = []; - - while (++columnIndex < columnLength) { - code = alignments[columnIndex]; - before = ''; - after = ''; - - if (code === l) { - before = colon; - } else if (code === r) { - after = colon; - } else if (code === c) { - before = colon; - after = colon; + _endsWith(str, end) { + return str.endsWith(end); } - - // There *must* be at least one hyphen-minus in each alignment cell. - size = alignDelimiters - ? Math.max( - 1, - longestCellByColumn[columnIndex] - before.length - after.length - ) - : 1; - - cell = before + repeatString(dash, size) + after; - - if (alignDelimiters === true) { - size = before.length + size + after.length; - - if (size > longestCellByColumn[columnIndex]) { - longestCellByColumn[columnIndex] = size; - } - - sizes[columnIndex] = size; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); } - - row[columnIndex] = cell; - } - - // Inject the alignment row. - cellMatrix.splice(1, 0, row); - sizeMatrix.splice(1, 0, sizes); - - rowIndex = -1; - rowLength = cellMatrix.length; - lines = []; - - while (++rowIndex < rowLength) { - row = cellMatrix[rowIndex]; - sizes = sizeMatrix[rowIndex]; - columnIndex = -1; - columnLength = mostCellsPerRow; - line = []; - - while (++columnIndex < columnLength) { - cell = row[columnIndex] || ''; - before = ''; - after = ''; - - if (alignDelimiters === true) { - size = longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0); - code = alignments[columnIndex]; - - if (code === r) { - before = repeatString(space, size); - } else if (code === c) { - if (size % 2 === 0) { - before = repeatString(space, size / 2); - after = before; - } else { - before = repeatString(space, size / 2 + 0.5); - after = repeatString(space, size / 2 - 0.5); - } - } else { - after = repeatString(space, size); + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } - - if (start === true && columnIndex === 0) { - line.push(verticalBar); - } - - if ( - padding === true && - // Don’t add the opening space if we’re not aligning and the cell is - // empty: there will be a closing space. - !(alignDelimiters === false && cell === '') && - (start === true || columnIndex !== 0) - ) { - line.push(space); - } - - if (alignDelimiters === true) { - line.push(before); - } - - line.push(cell); - - if (alignDelimiters === true) { - line.push(after); - } - - if (padding === true) { - line.push(space); - } - - if (end === true || columnIndex !== columnLength - 1) { - line.push(verticalBar); - } - } - - line = line.join(''); - - if (end === false) { - line = line.replace(trailingWhitespace, ''); - } - - lines.push(line); - } - - return lines.join(lineFeed) -} - -function serialize(value) { - return value === null || value === undefined ? '' : String(value) -} - -function defaultStringLength(value) { - return value.length -} - -function toAlignment(value) { - var code = typeof value === 'string' ? value.charCodeAt(0) : x; - - return code === L || code === l - ? l - : code === R || code === r - ? r - : code === C || code === c - ? c - : x -} - -// In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either. -function noop() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } -} -function createWeakMap() { - if (typeof WeakMap !== 'undefined') { - return new WeakMap(); - } - else { - return fakeSetOrMap(); - } -} -/** - * Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything. - */ -function fakeSetOrMap() { - return { - add: noop, - delete: noop, - get: noop, - set: noop, - has: function (k) { return false; }, - }; -} -// Safe hasOwnProperty -var hop = Object.prototype.hasOwnProperty; -var has = function (obj, prop) { - return hop.call(obj, prop); -}; -// Copy all own enumerable properties from source to target -function extend(target, source) { - for (var prop in source) { - if (has(source, prop)) { - target[prop] = source[prop]; - } - } - return target; -} -var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/; -var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/; -var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/; -var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/; -var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/; -function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) { - // If first interpolated value is a reference to outdent, - // determine indentation level from the indentation of the interpolated value. - var indentationLevel = 0; - var match = strings[0].match(reDetectIndentation); - if (match) { - indentationLevel = match[1].length; - } - var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}"; - var reMatchIndent = new RegExp(reSource, 'g'); - if (firstInterpolatedValueSetsIndentationLevel) { - strings = strings.slice(1); - } - var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline; - var normalizeNewlines = typeof newline === 'string'; - var l = strings.length; - var outdentedStrings = strings.map(function (v, i) { - // Remove leading indentation from all lines - v = v.replace(reMatchIndent, '$1'); - // Trim a leading newline from the first string - if (i === 0 && trimLeadingNewline) { - v = v.replace(reLeadingNewline, ''); + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; } - // Trim a trailing newline from the last string - if (i === l - 1 && trimTrailingNewline) { - v = v.replace(reTrailingNewline, ''); + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } } - // Normalize newlines - if (normalizeNewlines) { - v = v.replace(/\r\n|\n|\r/g, function (_) { return newline; }); + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; } - return v; - }); - return outdentedStrings; -} -function concatStringsAndValues(strings, values) { - var ret = ''; - for (var i = 0, l = strings.length; i < l; i++) { - ret += strings[i]; - if (i < l - 1) { - ret += values[i]; + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); } - return ret; -} -function isTemplateStringsArray(v) { - return has(v, 'raw') && has(v, 'length'); -} -/** - * It is assumed that opts will not change. If this is a problem, clone your options object and pass the clone to - * makeInstance - * @param options - * @return {outdent} - */ -function createInstance(options) { - /** Cache of pre-processed template literal arrays */ - var arrayAutoIndentCache = createWeakMap(); - /** - * Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent, - * before interpolated values are injected. - */ - var arrayFirstInterpSetsIndentCache = createWeakMap(); - function outdent(stringsOrOptions) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - /* tslint:enable:no-shadowed-variable */ - if (isTemplateStringsArray(stringsOrOptions)) { - var strings = stringsOrOptions; - // Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace? - var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && - reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && - reStartsWithNewlineOrIsEmpty.test(strings[1]); - // Perform outdentation - var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache; - var renderedArray = cache.get(strings); - if (!renderedArray) { - renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options); - cache.set(strings, renderedArray); + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; } - /** If no interpolated values, skip concatenation step */ - if (values.length === 0) { - return renderedArray[0]; + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; } - /** Concatenate string literals with interpolated values */ - var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values); - return rendered; } - else { - // Create and return a new instance of outdent with the given options - return createInstance(extend(extend({}, options), stringsOrOptions || {})); + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; } + return result; } - var fullOutdent = extend(outdent, { - string: function (str) { - return _outdentArray([str], false, options)[0]; - }, - }); - return fullOutdent; -} -var defaultOutdent = createInstance({ - trimLeadingNewline: true, - trimTrailingNewline: true, -}); -if (typeof module !== 'undefined') { - // In webpack harmony-modules environments, module.exports is read-only, - // so we fail gracefully. - try { - module.exports = defaultOutdent; - Object.defineProperty(defaultOutdent, '__esModule', { value: true }); - defaultOutdent.default = defaultOutdent; - defaultOutdent.outdent = defaultOutdent; + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter$1(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil$1.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io$1.which(this.toolPath, true); + return new Promise((resolve, reject) => { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os$2.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + const stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + const errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); + } + cp.stdin.end(this.options.input); + } + }); + }); + } +} +var ToolRunner_1 = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; +} +var argStringToArray_1 = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); } - catch (e) { } } -const c$1 = string => `\`${string}\``; -const link = (text, href) => `[${text}](${href})`; -const sub = string => `${string}`; -const sup = string => `${string}`; -const strong = string => `**${string}**`; - -const directionSymbol = value => { - if (value < 0) { - return '↓'; - } - - if (value > 0) { - return '↑'; - } - - return ''; -}; - -const formatSize = ({delta, percent}) => delta ? (percent + directionSymbol(delta)) : ''; - -function generateComment({ - unchangedFiles, - pkgComparison, -}) { - const {changed, unchanged, hidden} = pkgComparison.files; - const totalDelta = formatSize(pkgComparison.diff.size); - - const table = markdownTable_1([ - ['File', 'Before', 'After'], - ...[ - ...changed, - ...(unchangedFiles === 'show' ? unchanged : []), - ].map(file => [ - file.link, - file.base && file.base.size ? c$1(dist(file.base.size)) : '—', - file.head && file.head.size ? ( - (file.base && file.base.size ? sup(formatSize(file.diff.size)) : '') + c$1(dist(file.head.size)) - ) : '—', - ]), - [ - `${strong('Total')} ${(unchangedFiles === 'show' ? '' : sub('_(Includes all files)_'))}`, - c$1(dist(pkgComparison.base.size)), - sup(totalDelta) + c$1(dist(pkgComparison.head.size)), - ], - [ - strong('Tarball size'), - c$1(dist(pkgComparison.base.tarballSize)), - sup(formatSize(pkgComparison.diff.tarballSize)) + c$1(dist(pkgComparison.head.tarballSize)), - ], - ], { - align: ['', 'r', 'r'], - }); - - let unchangedTable = ''; - if (unchangedFiles === 'collapse' && unchanged.length > 0) { - unchangedTable = markdownTable_1([ - ['File', 'Size'], - ...unchanged.map(file => [ - file.link, - c$1(dist(file.base.size)), - ]), - ], { - align: ['', 'r'], - }); - - unchangedTable = `
Unchanged files\n\n${unchangedTable}\n
`; - } - - let hiddenTable = ''; - if (hidden.length > 0) { - hiddenTable = markdownTable_1([ - ['File', 'Before', 'After'], - ...hidden.map(file => [ - file.link, - file.base && file.base.size ? c$1(dist(file.base.size)) : '—', - file.head && file.head.size ? ( - (file.base && file.base.size ? sup(formatSize(file.diff.size)) : '') + c$1(dist(file.head.size)) - ) : '—', - ]), - ], { - align: ['', 'r', 'r'], - }); - - hiddenTable = `
Hidden files\n\n${hiddenTable}\n
`; - } - - return defaultOutdent` - ### 📊 Package size report   ${totalDelta || 'No changes'} - - ${table} - - ${unchangedTable} - ${hiddenTable} - `; -} +var toolrunner = /*#__PURE__*/Object.defineProperty({ + ToolRunner: ToolRunner_1, + argStringToArray: argStringToArray_1 +}, '__esModule', {value: true}); -var __awaiter$1 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { +var __awaiter$2 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -6882,7 +6797,7 @@ var __awaiter$1 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar$2 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { +var __importStar$3 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; @@ -6890,638 +6805,67998 @@ var __importStar$2 = (commonjsGlobal && commonjsGlobal.__importStar) || function return result; }; -const os$2 = __importStar$2(require$$0__default['default']); -const events = __importStar$2(events__default['default']); -const child = __importStar$2(childProcess__default['default']); -const path = __importStar$2(path__default['default']); -const io$1 = __importStar$2(io); -const ioUtil$1 = __importStar$2(ioUtil); -/* eslint-disable @typescript-eslint/unbound-method */ -const IS_WINDOWS = process.platform === 'win32'; -/* - * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. +const tr = __importStar$3(toolrunner); +/** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code */ -class ToolRunner extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); +function exec$1(commandLine, args, options) { + return __awaiter$2(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); +} +var exec_2 = exec$1; + + +var exec_1 = /*#__PURE__*/Object.defineProperty({ + exec: exec_2 +}, '__esModule', {value: true}); + +var __importStar$4 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; + +const core$1 = __importStar$4(core); +/** + * Returns a copy with defaults filled in. + */ +function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === 'boolean') { + result.followSymbolicLinks = copy.followSymbolicLinks; + core$1.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === 'boolean') { + result.implicitDescendants = copy.implicitDescendants; + core$1.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core$1.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (IS_WINDOWS) { - // Windows + cmd file - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; + return result; +} +var getOptions_1 = getOptions; + + +var internalGlobOptionsHelper = /*#__PURE__*/Object.defineProperty({ + getOptions: getOptions_1 +}, '__esModule', {value: true}); + +var __importStar$5 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; + +const path$1 = __importStar$5(path__default['default']); +const assert_1 = __importDefault(assert_1__default['default']); +const IS_WINDOWS$1 = process.platform === 'win32'; +/** + * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. + * + * For example, on Linux/macOS: + * - `/ => /` + * - `/hello => /` + * + * For example, on Windows: + * - `C:\ => C:\` + * - `C:\hello => C:\` + * - `C: => C:` + * - `C:hello => C:` + * - `\ => \` + * - `\hello => \` + * - `\\hello => \\hello` + * - `\\hello\world => \\hello\world` + */ +function dirname(p) { + // Normalize slashes and trim unnecessary trailing slash + p = safeTrimTrailingSeparator(p); + // Windows UNC root, e.g. \\hello or \\hello\world + if (IS_WINDOWS$1 && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; + } + // Get dirname + let result = path$1.dirname(p); + // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ + if (IS_WINDOWS$1 && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; +} +var dirname_1 = dirname; +/** + * Roots the path if not already rooted. On Windows, relative roots like `\` + * or `C:` are expanded based on the current working directory. + */ +function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + // Already rooted + if (hasAbsoluteRoot(itemPath)) { + return itemPath; + } + // Windows + if (IS_WINDOWS$1) { + // Check for itemPath like C: or C:foo + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + // Drive letter matches cwd? Expand to cwd + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + // Drive only, e.g. C: + if (itemPath.length === 2) { + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}`; } - } - // Windows + verbatim - else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; + // Drive + path, e.g. C:foo + else { + if (!cwd.endsWith('\\')) { + cwd += '\\'; + } + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } } - // Windows (regular) + // Different drive else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } + return `${itemPath[0]}:\\${itemPath.substr(2)}`; } } - else { - // OSX/Linux - this can likely be improved with some form of quoting. - // creating processes on Unix is fundamentally different than Windows. - // on Unix, execvp() takes an arg array. - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } + // Check for itemPath like \ or \foo + else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; } - return cmd; } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os$2.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os$2.EOL.length); - n = s.indexOf(os$2.EOL); - } - strBuffer = s; - } - catch (err) { - // streaming lines to console is best effort. Don't fail a build. - this._debug(`error processing line. Failed with error ${err}`); - } + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + // Otherwise ensure root ends with a separator + if (root.endsWith('/') || (IS_WINDOWS$1 && root.endsWith('\\'))) ; + else { + // Append separator + root += path$1.sep; } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; - } - } - return this.toolPath; + return root + itemPath; +} +var ensureAbsoluteRoot_1 = ensureAbsoluteRoot; +/** + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\\hello\share` and `C:\hello` (and using alternate separator). + */ +function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS$1) { + // E.g. \\hello\share or C:\hello + return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += ' '; - argline += options.windowsVerbatimArguments - ? a - : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } - } - return this.args; + // E.g. /hello + return itemPath.startsWith('/'); +} +var hasAbsoluteRoot_1 = hasAbsoluteRoot; +/** + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). + */ +function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS$1) { + // E.g. \ or \hello or \\hello + // E.g. C: or C:\hello + return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); } - _endsWith(str, end) { - return str.endsWith(end); + // E.g. /hello + return itemPath.startsWith('/'); +} +var hasRoot_1 = hasRoot; +/** + * Removes redundant slashes and converts `/` to `\` on Windows + */ +function normalizeSeparators(p) { + p = p || ''; + // Windows + if (IS_WINDOWS$1) { + // Convert slashes on Windows + p = p.replace(/\//g, '\\'); + // Remove redundant slashes + const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return (this._endsWith(upperToolPath, '.CMD') || - this._endsWith(upperToolPath, '.BAT')); + // Remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +var normalizeSeparators_1 = normalizeSeparators; +/** + * Normalizes the path separators and trims the trailing separator (when safe). + * For example, `/foo/ => /foo` but `/ => /` + */ +function safeTrimTrailingSeparator(p) { + // Short-circuit if empty + if (!p) { + return ''; } - _windowsQuoteCmdArg(arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); - } - // otherwise apply quoting rules specific to the cmd.exe command line parser. - // the libuv rules are generic and are not designed specifically for cmd.exe - // command line parser. - // - // for a detailed description of the cmd.exe command line parser, refer to - // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 - // need quotes for empty arg - if (!arg) { - return '""'; + // Normalize separators + p = normalizeSeparators(p); + // No trailing slash + if (!p.endsWith(path$1.sep)) { + return p; + } + // Check '/' on Linux/macOS and '\' on Windows + if (p === path$1.sep) { + return p; + } + // On Windows check if drive root. E.g. C:\ + if (IS_WINDOWS$1 && /^[A-Z]:\\$/i.test(p)) { + return p; + } + // Otherwise trim trailing slash + return p.substr(0, p.length - 1); +} +var safeTrimTrailingSeparator_1 = safeTrimTrailingSeparator; + + +var internalPathHelper = /*#__PURE__*/Object.defineProperty({ + dirname: dirname_1, + ensureAbsoluteRoot: ensureAbsoluteRoot_1, + hasAbsoluteRoot: hasAbsoluteRoot_1, + hasRoot: hasRoot_1, + normalizeSeparators: normalizeSeparators_1, + safeTrimTrailingSeparator: safeTrimTrailingSeparator_1 +}, '__esModule', {value: true}); + +var internalMatchKind = createCommonjsModule(function (module, exports) { +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Indicates whether a pattern matches a path + */ +var MatchKind; +(function (MatchKind) { + /** Not matched */ + MatchKind[MatchKind["None"] = 0] = "None"; + /** Matched if the path is a directory */ + MatchKind[MatchKind["Directory"] = 1] = "Directory"; + /** Matched if the path is a regular file */ + MatchKind[MatchKind["File"] = 2] = "File"; + /** Matched */ + MatchKind[MatchKind["All"] = 3] = "All"; +})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); + +}); + +var __importStar$6 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; + +const pathHelper = __importStar$6(internalPathHelper); + +const IS_WINDOWS$2 = process.platform === 'win32'; +/** + * Given an array of patterns, returns an array of paths to search. + * Duplicates and paths under other included paths are filtered out. + */ +function getSearchPaths(patterns) { + // Ignore negate patterns + patterns = patterns.filter(x => !x.negate); + // Create a map of all search paths + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS$2 + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + searchPathMap[key] = 'candidate'; + } + const result = []; + for (const pattern of patterns) { + // Check if already included + const key = IS_WINDOWS$2 + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + if (searchPathMap[key] === 'included') { + continue; } - // determine whether the arg needs to be quoted - const cmdSpecialChars = [ - ' ', - '\t', - '&', - '(', - ')', - '[', - ']', - '{', - '}', - '^', - '=', - ';', - '!', - "'", - '+', - ',', - '`', - '~', - '|', - '<', - '>', - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some(x => x === char)) { - needsQuotes = true; + // Check for an ancestor search path + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; break; } + tempKey = parent; + parent = pathHelper.dirname(tempKey); } - // short-circuit if quotes not needed - if (!needsQuotes) { - return arg; + // Include the search pattern in the result + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = 'included'; } - // the following quoting rules are very similar to the rules that by libuv applies. - // - // 1) wrap the string in quotes - // - // 2) double-up quotes - i.e. " => "" - // - // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately - // doesn't work well with a cmd.exe command line. - // - // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. - // for example, the command line: - // foo.exe "myarg:""my val""" - // is parsed by a .NET console app into an arg array: - // [ "myarg:\"my val\"" ] - // which is the same end result when applying libuv quoting rules. although the actual - // command line from libuv quoting rules would look like: - // foo.exe "myarg:\"my val\"" - // - // 3) double-up slashes that precede a quote, - // e.g. hello \world => "hello \world" - // hello\"world => "hello\\""world" - // hello\\"world => "hello\\\\""world" - // hello world\ => "hello world\\" - // - // technically this is not required for a cmd.exe command line, or the batch argument parser. - // the reasons for including this as a .cmd quoting rule are: - // - // a) this is optimized for the scenario where the argument is passed from the .cmd file to an - // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. - // - // b) it's what we've been doing previously (by deferring to node default behavior) and we - // haven't heard any complaints about that aspect. - // - // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be - // escaped when used on the command line directly - even though within a .cmd file % can be escaped - // by using %%. - // - // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts - // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. - // - // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would - // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the - // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args - // to an external program. - // - // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. - // % can be escaped within a .cmd file. - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; // double the quote - } - else { - quoteHit = false; - } - } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); } - _uvQuoteCmdArg(arg) { - // Tool runner wraps child_process.spawn() and needs to apply the same quoting as - // Node in certain cases where the undocumented spawn option windowsVerbatimArguments - // is used. - // - // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, - // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), - // pasting copyright notice from Node within this function: - // - // Copyright Joyent, Inc. and other Node contributors. All rights reserved. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to - // deal in the Software without restriction, including without limitation the - // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - // sell copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - // IN THE SOFTWARE. - if (!arg) { - // Need double quotation for empty argument - return '""'; + return result; +} +var getSearchPaths_1 = getSearchPaths; +/** + * Matches the patterns against the path + */ +function match(patterns, itemPath) { + let result = internalMatchKind.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); } - if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { - // No quotation needed - return arg; + else { + result |= pattern.match(itemPath); } - if (!arg.includes('"') && !arg.includes('\\')) { - // No embedded double quotes or backslashes, so I can just wrap - // quote marks around the whole thing. - return `"${arg}"`; + } + return result; +} +var match_1 = match; +/** + * Checks whether to descend further into the directory + */ +function partialMatch(patterns, itemPath) { + return patterns.some(x => !x.negate && x.partialMatch(itemPath)); +} +var partialMatch_1 = partialMatch; + + +var internalPatternHelper = /*#__PURE__*/Object.defineProperty({ + getSearchPaths: getSearchPaths_1, + match: match_1, + partialMatch: partialMatch_1 +}, '__esModule', {value: true}); + +var concatMap = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +var balancedMatch = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - // Expected input/output: - // input : hello"world - // output: "hello\"world" - // input : hello""world - // output: "hello\"\"world" - // input : hello\world - // output: hello\world - // input : hello\\world - // output: hello\\world - // input : hello\"world - // output: "hello\\\"world" - // input : hello\\"world - // output: "hello\\\\\"world" - // input : hello world\ - // output: "hello world\\" - note the comment in libuv actually reads "hello world\" - // but it appears the comment is wrong, it should be "hello world\\" - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '\\'; - } - else { - quoteHit = false; - } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} + +var braceExpansion = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balancedMatch('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand$1(escapeBraces(str), true).map(unescapeBraces); +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand$1(str, isTop) { + var expansions = []; + + var m = balancedMatch('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand$1(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand$1(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand$1(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand$1(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); + } + N.push(c); } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 10000 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; + } else { + N = concatMap(n, function(el) { return expand$1(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + +var minimatch_1 = minimatch; +minimatch.Minimatch = Minimatch; + +var path$2 = { sep: '/' }; +try { + path$2 = path__default['default']; +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +}; + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]'; + +// * => any number of characters +var star = qmark + '*?'; + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'; + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'; + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!'); + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true; + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/; + +minimatch.filter = filter; +function filter (pattern, options) { + options = options || {}; + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {}; + b = b || {}; + var t = {}; + Object.keys(b).forEach(function (k) { + t[k] = b[k]; + }); + Object.keys(a).forEach(function (k) { + t[k] = a[k]; + }); + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch; + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + }; + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + }; + + return m +}; + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +}; + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {}; + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {}; + pattern = pattern.trim(); + + // windows support: need to use /, not \ + if (path$2.sep !== '/') { + pattern = pattern.split(path$2.sep).join('/'); + } + + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + + // make the set of regexps etc. + this.make(); +} + +Minimatch.prototype.debug = function () {}; + +Minimatch.prototype.make = make; +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern; + var options = this.options; + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return + } + if (!pattern) { + this.empty = true; + return + } + + // step 1: figure out negation, etc. + this.parseNegate(); + + // step 2: expand braces + var set = this.globSet = this.braceExpand(); + + if (options.debug) this.debug = console.error; + + this.debug(this.pattern, set); + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }); + + this.debug(this.pattern, set); + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this); + + this.debug(this.pattern, set); + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }); + + this.debug(this.pattern, set); + + this.set = set; +} + +Minimatch.prototype.parseNegate = parseNegate; +function parseNegate () { + var pattern = this.pattern; + var negate = false; + var options = this.options; + var negateOffset = 0; + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate; + negateOffset++; + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +}; + +Minimatch.prototype.braceExpand = braceExpand; + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern; + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return braceExpansion(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse$1; +var SUBPARSE = {}; +function parse$1 (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options; + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = ''; + var hasMagic = !!options.nocase; + var escaping = false; + // ? => one single character + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)'; + var self = this; + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star; + hasMagic = true; + break + case '?': + re += qmark; + hasMagic = true; + break + default: + re += '\\' + stateChar; + break + } + self.debug('clearStateChar %j %j', stateChar, re); + stateChar = false; + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c); + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c; + escaping = false; + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar(); + escaping = true; + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class'); + if (c === '!' && i === classStart + 1) c = '^'; + re += c; + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar); + clearStateChar(); + stateChar = c; + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar(); + continue + + case '(': + if (inClass) { + re += '('; + continue + } + + if (!stateChar) { + re += '\\('; + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:'; + this.debug('plType %j %j', stateChar, re); + stateChar = false; + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)'; + continue + } + + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close; + if (pl.type === '!') { + negativeLists.push(pl); + } + pl.reEnd = re.length; + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|'; + escaping = false; + continue + } + + clearStateChar(); + re += '|'; + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar(); + + if (inClass) { + re += '\\' + c; + continue + } + + inClass = true; + classStart = i; + reClassStart = re.length; + re += c; + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c; + escaping = false; + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i); + try { + RegExp('[' + cs + ']'); + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue + } + } + + // finish up the class. + hasMagic = true; + inClass = false; + re += c; + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar(); + + if (escaping) { + // no need + escaping = false; + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\'; + } + + re += c; + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + '\\[' + sp[0]; + hasMagic = hasMagic || sp[1]; + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length); + this.debug('setting tail', re, pl); + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\'; + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }); + + this.debug('tail=%j\n %s', tail, tail, pl, re); + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type; + + hasMagic = true; + re = re.slice(0, pl.reStart) + t + '\\(' + tail; + } + + // handle trailing things that only matter at the very end. + clearStateChar(); + if (escaping) { + // trailing \\ + re += '\\\\'; + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false; + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true; + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n]; + + var nlBefore = re.slice(0, nl.reStart); + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re.slice(nl.reEnd); + + nlLast += nlAfter; + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1; + var cleanAfter = nlAfter; + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); + } + nlAfter = cleanAfter; + + var dollar = ''; + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$'; + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re = newRe; + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re; + } + + if (addPatternStart) { + re = patternStart + re; + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : ''; + try { + var regExp = new RegExp('^' + re + '$', flags); + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern; + regExp._src = re; + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +}; + +Minimatch.prototype.makeRe = makeRe; +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set; + + if (!set.length) { + this.regexp = false; + return this.regexp + } + var options = this.options; + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot; + var flags = options.nocase ? 'i' : ''; + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|'); + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$'; + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$'; + + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function (f) { + return mm.match(f) + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list +}; + +Minimatch.prototype.match = match$1; +function match$1 (f, partial) { + this.debug('match', f, this.pattern); + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options; + + // windows: need to use /, not \ + if (path$2.sep !== '/') { + f = f.split(path$2.sep).join('/'); + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit); + this.debug(this.pattern, 'split', f); + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set; + this.debug(this.pattern, 'set', set); + + // Find the basename of the path by looking for the last non-empty segment + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i]; + var file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + var hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options; + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }); + + this.debug('matchOne', file.length, pattern.length); + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop'); + var p = pattern[pi]; + var f = file[fi]; + + this.debug(pattern, p, f); + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]); + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug('** at the end'); + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr]; + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee); + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr); + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue'); + fr++; + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr); + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit; + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase(); + } else { + hit = f === p; + } + this.debug('string match', p, f, hit); + } else { + hit = f.match(p); + this.debug('pattern match', p, f, hit); + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === ''); + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +}; + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + +var __importStar$7 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; + +const path$3 = __importStar$7(path__default['default']); +const pathHelper$1 = __importStar$7(internalPathHelper); +const assert_1$1 = __importDefault$1(assert_1__default['default']); +const IS_WINDOWS$3 = process.platform === 'win32'; +/** + * Helper class for parsing paths into segments + */ +class Path { + /** + * Constructs a Path + * @param itemPath Path or array of segments + */ + constructor(itemPath) { + this.segments = []; + // String + if (typeof itemPath === 'string') { + assert_1$1.default(itemPath, `Parameter 'itemPath' must not be empty`); + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper$1.safeTrimTrailingSeparator(itemPath); + // Not rooted + if (!pathHelper$1.hasRoot(itemPath)) { + this.segments = itemPath.split(path$3.sep); + } + // Rooted + else { + // Add all segments, while not at the root + let remaining = itemPath; + let dir = pathHelper$1.dirname(remaining); + while (dir !== remaining) { + // Add the segment + const basename = path$3.basename(remaining); + this.segments.unshift(basename); + // Truncate the last segment + remaining = dir; + dir = pathHelper$1.dirname(remaining); + } + // Remainder is the root + this.segments.unshift(remaining); + } + } + // Array + else { + // Must not be empty + assert_1$1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + // Each segment + for (let i = 0; i < itemPath.length; i++) { + let segment = itemPath[i]; + // Must not be empty + assert_1$1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + // Normalize slashes + segment = pathHelper$1.normalizeSeparators(itemPath[i]); + // Root segment + if (i === 0 && pathHelper$1.hasRoot(segment)) { + segment = pathHelper$1.safeTrimTrailingSeparator(segment); + assert_1$1.default(segment === pathHelper$1.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); + } + // All other segments + else { + // Must not contain slash + assert_1$1.default(!segment.includes(path$3.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } + } + /** + * Converts the path to it's string representation + */ + toString() { + // First segment + let result = this.segments[0]; + // All others + let skipSlash = result.endsWith(path$3.sep) || (IS_WINDOWS$3 && /^[A-Z]:$/i.test(result)); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } + else { + result += path$3.sep; + } + result += this.segments[i]; + } + return result; + } +} +var Path_1 = Path; + + +var internalPath = /*#__PURE__*/Object.defineProperty({ + Path: Path_1 +}, '__esModule', {value: true}); + +var __importStar$8 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; + +const os$3 = __importStar$8(os__default['default']); +const path$4 = __importStar$8(path__default['default']); +const pathHelper$2 = __importStar$8(internalPathHelper); +const assert_1$2 = __importDefault$2(assert_1__default['default']); + + + +const IS_WINDOWS$4 = process.platform === 'win32'; +class Pattern { + constructor(patternOrNegate, segments, homedir) { + /** + * Indicates whether matches should be excluded from the result set + */ + this.negate = false; + // Pattern overload + let pattern; + if (typeof patternOrNegate === 'string') { + pattern = patternOrNegate.trim(); + } + // Segments overload + else { + // Convert to pattern + segments = segments || []; + assert_1$2.default(segments.length, `Parameter 'segments' must not empty`); + const root = Pattern.getLiteral(segments[0]); + assert_1$2.default(root && pathHelper$2.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internalPath.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; + } + } + // Negate + while (pattern.startsWith('!')) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + // Normalize slashes and ensures absolute root + pattern = Pattern.fixupPattern(pattern, homedir); + // Segments + this.segments = new internalPath.Path(pattern).segments; + // Trailing slash indicates the pattern should only match directories, not regular files + this.trailingSeparator = pathHelper$2 + .normalizeSeparators(pattern) + .endsWith(path$4.sep); + pattern = pathHelper$2.safeTrimTrailingSeparator(pattern); + // Search path (literal path prior to the first glob segment) + let foundGlob = false; + const searchSegments = this.segments + .map(x => Pattern.getLiteral(x)) + .filter(x => !foundGlob && !(foundGlob = x === '')); + this.searchPath = new internalPath.Path(searchSegments).toString(); + // Root RegExp (required when determining partial match) + this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS$4 ? 'i' : ''); + // Create minimatch + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS$4, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS$4 ? pattern.replace(/\\/g, '/') : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + } + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + // Last segment is globstar? + if (this.segments[this.segments.length - 1] === '**') { + // Normalize slashes + itemPath = pathHelper$2.normalizeSeparators(itemPath); + // Append a trailing slash. Otherwise Minimatch will not match the directory immediately + // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns + // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. + if (!itemPath.endsWith(path$4.sep)) { + // Note, this is safe because the constructor ensures the pattern has an absolute root. + // For example, formats like C: and C:foo on Windows are resolved to an absolute root. + itemPath = `${itemPath}${path$4.sep}`; + } + } + else { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper$2.safeTrimTrailingSeparator(itemPath); + } + // Match + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internalMatchKind.MatchKind.Directory : internalMatchKind.MatchKind.All; + } + return internalMatchKind.MatchKind.None; + } + /** + * Indicates whether the pattern may match descendants of the specified path + */ + partialMatch(itemPath) { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper$2.safeTrimTrailingSeparator(itemPath); + // matchOne does not handle root path correctly + if (pathHelper$2.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); + } + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS$4 ? /\\+/ : /\/+/), this.minimatch.set[0], true); + } + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS$4 ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS + .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment + .replace(/\?/g, '[?]') // escape '?' + .replace(/\*/g, '[*]'); // escape '*' + } + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + // Empty + assert_1$2.default(pattern, 'pattern cannot be empty'); + // Must not contain `.` segment, unless first segment + // Must not contain `..` segment + const literalSegments = new internalPath.Path(pattern).segments.map(x => Pattern.getLiteral(x)); + assert_1$2.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r + assert_1$2.default(!pathHelper$2.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + // Normalize slashes + pattern = pathHelper$2.normalizeSeparators(pattern); + // Replace leading `.` segment + if (pattern === '.' || pattern.startsWith(`.${path$4.sep}`)) { + pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); + } + // Replace leading `~` segment + else if (pattern === '~' || pattern.startsWith(`~${path$4.sep}`)) { + homedir = homedir || os$3.homedir(); + assert_1$2.default(homedir, 'Unable to determine HOME directory'); + assert_1$2.default(pathHelper$2.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = Pattern.globEscape(homedir) + pattern.substr(1); + } + // Replace relative drive root, e.g. pattern is C: or C:foo + else if (IS_WINDOWS$4 && + (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper$2.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith('\\')) { + root += '\\'; + } + pattern = Pattern.globEscape(root) + pattern.substr(2); + } + // Replace relative root, e.g. pattern is \ or \foo + else if (IS_WINDOWS$4 && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { + let root = pathHelper$2.ensureAbsoluteRoot('C:\\dummy-root', '\\'); + if (!root.endsWith('\\')) { + root += '\\'; + } + pattern = Pattern.globEscape(root) + pattern.substr(1); + } + // Otherwise ensure absolute root + else { + pattern = pathHelper$2.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); + } + return pathHelper$2.normalizeSeparators(pattern); + } + /** + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. + */ + static getLiteral(segment) { + let literal = ''; + for (let i = 0; i < segment.length; i++) { + const c = segment[i]; + // Escape + if (c === '\\' && !IS_WINDOWS$4 && i + 1 < segment.length) { + literal += segment[++i]; + continue; + } + // Wildcard + else if (c === '*' || c === '?') { + return ''; + } + // Character set + else if (c === '[' && i + 1 < segment.length) { + let set = ''; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + // Escape + if (c2 === '\\' && !IS_WINDOWS$4 && i2 + 1 < segment.length) { + set += segment[++i2]; + continue; + } + // Closed + else if (c2 === ']') { + closed = i2; + break; + } + // Otherwise + else { + set += c2; + } + } + // Closed? + if (closed >= 0) { + // Cannot convert + if (set.length > 1) { + return ''; + } + // Convert to literal + if (set) { + literal += set; + i = closed; + continue; + } + } + // Otherwise fall thru + } + // Append + literal += c; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); + } +} +var Pattern_1 = Pattern; + + +var internalPattern = /*#__PURE__*/Object.defineProperty({ + Pattern: Pattern_1 +}, '__esModule', {value: true}); + +class SearchState { + constructor(path, level) { + this.path = path; + this.level = level; + } +} +var SearchState_1 = SearchState; + + +var internalSearchState = /*#__PURE__*/Object.defineProperty({ + SearchState: SearchState_1 +}, '__esModule', {value: true}); + +var __awaiter$3 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __asyncValues = (commonjsGlobal && commonjsGlobal.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (commonjsGlobal && commonjsGlobal.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }; +var __asyncGenerator = (commonjsGlobal && commonjsGlobal.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +var __importStar$9 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; + +const core$2 = __importStar$9(core); +const fs$1 = __importStar$9(fs__default['default']); +const globOptionsHelper = __importStar$9(internalGlobOptionsHelper); +const path$5 = __importStar$9(path__default['default']); +const patternHelper = __importStar$9(internalPatternHelper); + + + +const IS_WINDOWS$5 = process.platform === 'win32'; +class DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); + } + getSearchPaths() { + // Return a copy + return this.searchPaths.slice(); + } + glob() { + var e_1, _a; + return __awaiter$3(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { + const itemPath = _c.value; + result.push(itemPath); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return result; + }); + } + globGenerator() { + return __asyncGenerator(this, arguments, function* globGenerator_1() { + // Fill in defaults options + const options = globOptionsHelper.getOptions(this.options); + // Implicit descendants? + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && + (pattern.trailingSeparator || + pattern.segments[pattern.segments.length - 1] !== '**')) { + patterns.push(new internalPattern.Pattern(pattern.negate, pattern.segments.concat('**'))); + } + } + // Push the search paths + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core$2.debug(`Search path '${searchPath}'`); + // Exists? + try { + // Intentionally using lstat. Detection for broken symlink + // will be performed later (if following symlinks). + yield __await(fs$1.promises.lstat(searchPath)); + } + catch (err) { + if (err.code === 'ENOENT') { + continue; + } + throw err; + } + stack.unshift(new internalSearchState.SearchState(searchPath, 1)); + } + // Search + const traversalChain = []; // used to detect cycles + while (stack.length) { + // Pop + const item = stack.pop(); + // Match? + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; + } + // Stat + const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + // Broken symlink, or symlink cycle detected, or no longer exists + if (!stats) { + continue; + } + // Directory + if (stats.isDirectory()) { + // Matched + if (match & internalMatchKind.MatchKind.Directory) { + yield yield __await(item.path); + } + // Descend? + else if (!partialMatch) { + continue; + } + // Push the child items in reverse + const childLevel = item.level + 1; + const childItems = (yield __await(fs$1.promises.readdir(item.path))).map(x => new internalSearchState.SearchState(path$5.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } + // File + else if (match & internalMatchKind.MatchKind.File) { + yield yield __await(item.path); + } + } + }); + } + /** + * Constructs a DefaultGlobber + */ + static create(patterns, options) { + return __awaiter$3(this, void 0, void 0, function* () { + const result = new DefaultGlobber(options); + if (IS_WINDOWS$5) { + patterns = patterns.replace(/\r\n/g, '\n'); + patterns = patterns.replace(/\r/g, '\n'); + } + const lines = patterns.split('\n').map(x => x.trim()); + for (const line of lines) { + // Empty or comment + if (!line || line.startsWith('#')) { + continue; + } + // Pattern + else { + result.patterns.push(new internalPattern.Pattern(line)); + } + } + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; + }); + } + static stat(item, options, traversalChain) { + return __awaiter$3(this, void 0, void 0, function* () { + // Note: + // `stat` returns info about the target of a symlink (or symlink chain) + // `lstat` returns info about a symlink itself + let stats; + if (options.followSymbolicLinks) { + try { + // Use `stat` (following symlinks) + stats = yield fs$1.promises.stat(item.path); + } + catch (err) { + if (err.code === 'ENOENT') { + if (options.omitBrokenSymbolicLinks) { + core$2.debug(`Broken symlink '${item.path}'`); + return undefined; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); + } + throw err; + } + } + else { + // Use `lstat` (not following symlinks) + stats = yield fs$1.promises.lstat(item.path); + } + // Note, isDirectory() returns false for the lstat of a symlink + if (stats.isDirectory() && options.followSymbolicLinks) { + // Get the realpath + const realPath = yield fs$1.promises.realpath(item.path); + // Fixup the traversal chain to match the item level + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + // Test for a cycle + if (traversalChain.some((x) => x === realPath)) { + core$2.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return undefined; + } + // Update the traversal chain + traversalChain.push(realPath); + } + return stats; + }); + } +} +var DefaultGlobber_1 = DefaultGlobber; + + +var internalGlobber = /*#__PURE__*/Object.defineProperty({ + DefaultGlobber: DefaultGlobber_1 +}, '__esModule', {value: true}); + +var __awaiter$4 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + + +/** + * Constructs a globber + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function create(patterns, options) { + return __awaiter$4(this, void 0, void 0, function* () { + return yield internalGlobber.DefaultGlobber.create(patterns, options); + }); +} +var create_1 = create; + + +var glob = /*#__PURE__*/Object.defineProperty({ + create: create_1 +}, '__esModule', {value: true}); + +var semver = createCommonjsModule(function (module, exports) { +exports = module.exports = SemVer; + +var debug; +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift('SEMVER'); + console.log.apply(console, args); + }; +} else { + debug = function () {}; +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +var MAX_LENGTH = 256; +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991; + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var t = exports.tokens = {}; +var R = 0; + +function tok (n) { + t[n] = R++; +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +tok('NUMERICIDENTIFIER'); +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +tok('NUMERICIDENTIFIERLOOSE'); +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +tok('NONNUMERICIDENTIFIER'); +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + +// ## Main Version +// Three dot-separated numeric identifiers. + +tok('MAINVERSION'); +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')'; + +tok('MAINVERSIONLOOSE'); +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +tok('PRERELEASEIDENTIFIER'); +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')'; + +tok('PRERELEASEIDENTIFIERLOOSE'); +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')'; + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +tok('PRERELEASE'); +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'; + +tok('PRERELEASELOOSE'); +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +tok('BUILDIDENTIFIER'); +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +tok('BUILD'); +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'; + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +tok('FULL'); +tok('FULLPLAIN'); +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?'; + +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN'); +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?'; + +tok('LOOSE'); +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'; + +tok('GTLT'); +src[t.GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE'); +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +tok('XRANGEIDENTIFIER'); +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'; + +tok('XRANGEPLAIN'); +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?'; + +tok('XRANGEPLAINLOOSE'); +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?'; + +tok('XRANGE'); +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'; +tok('XRANGELOOSE'); +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'; + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE'); +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])'; +tok('COERCERTL'); +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g'); + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE'); +src[t.LONETILDE] = '(?:~>?)'; + +tok('TILDETRIM'); +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'; +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +tok('TILDE'); +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'; +tok('TILDELOOSE'); +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET'); +src[t.LONECARET] = '(?:\\^)'; + +tok('CARETTRIM'); +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'; +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +tok('CARET'); +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'; +tok('CARETLOOSE'); +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE'); +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'; +tok('COMPARATOR'); +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'; + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM'); +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE'); +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$'; + +tok('HYPHENRANGELOOSE'); +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +tok('STAR'); +src[t.STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + } +} + +exports.parse = parse; +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + }; + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? re[t.LOOSE] : re[t.FULL]; + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid; +function valid (version, options) { + var v = parse(version, options); + return v ? v.version : null +} + +exports.clean = clean; +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options); + return s ? s.version : null +} + +exports.SemVer = SemVer; + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version; + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options); + this.options = options; + this.loose = !!options.loose; + + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }); + } + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.'); + } + return this.version +}; + +SemVer.prototype.toString = function () { + return this.version +}; + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + + return this.compareMain(other) || this.comparePre(other) +}; + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +}; + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +}; + +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + + var i = 0; + do { + var a = this.build[i]; + var b = other.build[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier); + } + this.inc('pre', identifier); + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0]; + } else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0); + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0]; + } + } else { + this.prerelease = [identifier, 0]; + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format(); + this.raw = this.version; + return this +}; + +exports.inc = inc; +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff; +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1); + var v2 = parse(version2); + var prefix = ''; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre'; + var defaultResult = 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers (a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major; +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor; +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch; +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare; +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose; +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.compareBuild = compareBuild; +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose); + var versionB = new SemVer(b, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} + +exports.rcompare = rcompare; +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort; +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} + +exports.rsort = rsort; +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} + +exports.gt = gt; +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt; +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq; +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq; +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte; +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte; +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp; +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version; + if (typeof b === 'object') + b = b.version; + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version; + if (typeof b === 'object') + b = b.version; + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator; +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + }; + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value; + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + debug('comparator', comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + + if (this.semver === ANY) { + this.value = ''; + } else { + this.value = this.operator + this.semver.version; + } + + debug('comp', this); +} + +var ANY = {}; +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + var m = comp.match(r); + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] !== undefined ? m[1] : ''; + if (this.operator === '=') { + this.operator = ''; + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m[2], this.options.loose); + } +}; + +Comparator.prototype.toString = function () { + return this.value +}; + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose); + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) +}; + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + }; + } + + var rangeTmp; + + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options); + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options); + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>'); + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<'); + var sameSemVer = this.semver.version === comp.semver.version; + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<='); + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')); + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')); + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +}; + +exports.Range = Range; +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + }; + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } + + this.format(); +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim(); + return this.range +}; + +Range.prototype.toString = function () { + return this.range +}; + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose; + range = range.trim(); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[t.COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/); + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }); + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this); + + return set +}; + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) +}; + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true; + var remainingComparators = comparators.slice(); + var testComparator = remainingComparators.pop(); + + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }); + + testComparator = remainingComparators.pop(); + } + + return result +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options); + comp = replaceCarets(comp, options); + debug('caret', comp); + comp = replaceTildes(comp, options); + debug('tildes', comp); + comp = replaceXRanges(comp, options); + debug('xrange', comp); + comp = replaceStars(comp, options); + debug('stars', comp); + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) { + ret = ''; + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } else if (pr) { + debug('replaceTilde pr', pr); + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } + + debug('tilde return', ret); + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options); + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) { + ret = ''; + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } + } else if (pr) { + debug('replaceCaret pr', pr); + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0'; + } + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + } + + debug('caret return', ret); + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options); + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim(); + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) { + gtlt = ''; + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0; + } + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<'; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr; + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr; + } + + debug('xRange return', ret); + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = ''; + } else if (isX(fm)) { + from = '>=' + fM + '.0.0'; + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0'; + } else { + from = '>=' + from; + } + + if (isX(tM)) { + to = ''; + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0'; + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0'; + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + } else { + to = '<=' + to; + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false + } + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +}; + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies; +function satisfies (version, range, options) { + try { + range = new Range(range, options); + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying (versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range(range, options); + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v; + maxSV = new SemVer(max, options); + } + } + }); + return max +} + +exports.minSatisfying = minSatisfying; +function minSatisfying (versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range(range, options); + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v; + minSV = new SemVer(min, options); + } + } + }); + return min +} + +exports.minVersion = minVersion; +function minVersion (range, loose) { + range = new Range(range, loose); + + var minver = new SemVer('0.0.0'); + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0'); + if (range.test(minver)) { + return minver + } + + minver = null; + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver; + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }); + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange; +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside; +function outside (version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range(range, options); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0'); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease; +function prerelease (version, options) { + var parsed = parse(version, options); + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects; +function intersects (r1, r2, options) { + r1 = new Range(r1, options); + r2 = new Range(r2, options); + return r1.intersects(r2) +} + +exports.coerce = coerce; +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version); + } + + if (typeof version !== 'string') { + return null + } + + options = options || {}; + + var match = null; + if (!options.rtl) { + match = version.match(re[t.COERCE]); + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next; + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1; + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} +}); + +// Unique ID creation requires a high quality random # generator. In node.js +// this is pretty straight-forward - we use the crypto API. + + + +var rng = function nodeRNG() { + return crypto__default['default'].randomBytes(16); +}; + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +var byteToHex = []; +for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} + +function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; + // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + return ([ + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]] + ]).join(''); +} + +var bytesToUuid_1 = bytesToUuid; + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +var _nodeId; +var _clockseq; + +// Previous uuid creation time +var _lastMSecs = 0; +var _lastNSecs = 0; + +// See https://github.com/uuidjs/uuid for API details +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; + + // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + if (node == null || clockseq == null) { + var seedBytes = rng(); + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [ + seedBytes[0] | 0x01, + seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] + ]; + } + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf ? buf : bytesToUuid_1(b); +} + +var v1_1 = v1; + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid_1(rnds); +} + +var v4_1 = v4; + +var uuid = v4_1; +uuid.v1 = v1_1; +uuid.v4 = v4_1; + +var uuid_1 = uuid; + +var constants = createCommonjsModule(function (module, exports) { +Object.defineProperty(exports, "__esModule", { value: true }); +var CacheFilename; +(function (CacheFilename) { + CacheFilename["Gzip"] = "cache.tgz"; + CacheFilename["Zstd"] = "cache.tzst"; +})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {})); +var CompressionMethod; +(function (CompressionMethod) { + CompressionMethod["Gzip"] = "gzip"; + // Long range mode was added to zstd in v1.3.2. + // This enum is for earlier version of zstd that does not have --long support + CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; + CompressionMethod["Zstd"] = "zstd"; +})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {})); +// The default number of retry attempts. +exports.DefaultRetryAttempts = 2; +// The default delay in milliseconds between retry attempts. +exports.DefaultRetryDelay = 5000; +// Socket timeout in milliseconds during download. If no traffic is received +// over the socket during this period, the socket is destroyed and the download +// is aborted. +exports.SocketTimeout = 5000; + +}); + +var __awaiter$5 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __asyncValues$1 = (commonjsGlobal && commonjsGlobal.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __importStar$a = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; + +const core$3 = __importStar$a(core); +const exec$2 = __importStar$a(exec_1); +const glob$1 = __importStar$a(glob); +const io$2 = __importStar$a(io); +const fs$2 = __importStar$a(fs__default['default']); +const path$6 = __importStar$a(path__default['default']); +const semver$1 = __importStar$a(semver); +const util = __importStar$a(util__default['default']); + + +// From https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L23 +function createTempDirectory() { + return __awaiter$5(this, void 0, void 0, function* () { + const IS_WINDOWS = process.platform === 'win32'; + let tempDirectory = process.env['RUNNER_TEMP'] || ''; + if (!tempDirectory) { + let baseLocation; + if (IS_WINDOWS) { + // On Windows use the USERPROFILE env variable + baseLocation = process.env['USERPROFILE'] || 'C:\\'; + } + else { + if (process.platform === 'darwin') { + baseLocation = '/Users'; + } + else { + baseLocation = '/home'; + } + } + tempDirectory = path$6.join(baseLocation, 'actions', 'temp'); + } + const dest = path$6.join(tempDirectory, uuid_1.v4()); + yield io$2.mkdirP(dest); + return dest; + }); +} +var createTempDirectory_1 = createTempDirectory; +function getArchiveFileSizeIsBytes(filePath) { + return fs$2.statSync(filePath).size; +} +var getArchiveFileSizeIsBytes_1 = getArchiveFileSizeIsBytes; +function resolvePaths(patterns) { + var e_1, _a; + var _b; + return __awaiter$5(this, void 0, void 0, function* () { + const paths = []; + const workspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd(); + const globber = yield glob$1.create(patterns.join('\n'), { + implicitDescendants: false + }); + try { + for (var _c = __asyncValues$1(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) { + const file = _d.value; + const relativeFile = path$6 + .relative(workspace, file) + .replace(new RegExp(`\\${path$6.sep}`, 'g'), '/'); + core$3.debug(`Matched: ${relativeFile}`); + // Paths are made relative so the tar entries are all relative to the root of the workspace. + paths.push(`${relativeFile}`); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) yield _a.call(_c); + } + finally { if (e_1) throw e_1.error; } + } + return paths; + }); +} +var resolvePaths_1 = resolvePaths; +function unlinkFile(filePath) { + return __awaiter$5(this, void 0, void 0, function* () { + return util.promisify(fs$2.unlink)(filePath); + }); +} +var unlinkFile_1 = unlinkFile; +function getVersion(app) { + return __awaiter$5(this, void 0, void 0, function* () { + core$3.debug(`Checking ${app} --version`); + let versionOutput = ''; + try { + yield exec$2.exec(`${app} --version`, [], { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => (versionOutput += data.toString()), + stderr: (data) => (versionOutput += data.toString()) + } + }); + } + catch (err) { + core$3.debug(err.message); + } + versionOutput = versionOutput.trim(); + core$3.debug(versionOutput); + return versionOutput; + }); +} +// Use zstandard if possible to maximize cache performance +function getCompressionMethod() { + return __awaiter$5(this, void 0, void 0, function* () { + if (process.platform === 'win32' && !(yield isGnuTarInstalled())) { + // Disable zstd due to bug https://github.com/actions/cache/issues/301 + return constants.CompressionMethod.Gzip; + } + const versionOutput = yield getVersion('zstd'); + const version = semver$1.clean(versionOutput); + if (!versionOutput.toLowerCase().includes('zstd command line interface')) { + // zstd is not installed + return constants.CompressionMethod.Gzip; + } + else if (!version || semver$1.lt(version, 'v1.3.2')) { + // zstd is installed but using a version earlier than v1.3.2 + // v1.3.2 is required to use the `--long` options in zstd + return constants.CompressionMethod.ZstdWithoutLong; + } + else { + return constants.CompressionMethod.Zstd; + } + }); +} +var getCompressionMethod_1 = getCompressionMethod; +function getCacheFileName(compressionMethod) { + return compressionMethod === constants.CompressionMethod.Gzip + ? constants.CacheFilename.Gzip + : constants.CacheFilename.Zstd; +} +var getCacheFileName_1 = getCacheFileName; +function isGnuTarInstalled() { + return __awaiter$5(this, void 0, void 0, function* () { + const versionOutput = yield getVersion('tar'); + return versionOutput.toLowerCase().includes('gnu tar'); + }); +} +var isGnuTarInstalled_1 = isGnuTarInstalled; +function assertDefined(name, value) { + if (value === undefined) { + throw Error(`Expected ${name} but value was undefiend`); + } + return value; +} +var assertDefined_1 = assertDefined; + + +var cacheUtils = /*#__PURE__*/Object.defineProperty({ + createTempDirectory: createTempDirectory_1, + getArchiveFileSizeIsBytes: getArchiveFileSizeIsBytes_1, + resolvePaths: resolvePaths_1, + unlinkFile: unlinkFile_1, + getCompressionMethod: getCompressionMethod_1, + getCacheFileName: getCacheFileName_1, + isGnuTarInstalled: isGnuTarInstalled_1, + assertDefined: assertDefined_1 +}, '__esModule', {value: true}); + +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + + Buffer.from(this.username + ':' + this.password).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +var BasicCredentialHandler_1 = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = 'Bearer ' + this.token; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +var BearerCredentialHandler_1 = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +var PersonalAccessTokenCredentialHandler_1 = PersonalAccessTokenCredentialHandler; + +var auth$1 = /*#__PURE__*/Object.defineProperty({ + BasicCredentialHandler: BasicCredentialHandler_1, + BearerCredentialHandler: BearerCredentialHandler_1, + PersonalAccessTokenCredentialHandler: PersonalAccessTokenCredentialHandler_1 +}, '__esModule', {value: true}); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * A collection of HttpHeaders that can be sent with a HTTP request. + */ +function getHeaderKey(headerName) { + return headerName.toLowerCase(); +} +function isHttpHeadersLike(object) { + if (!object || typeof object !== "object") { + return false; + } + if (typeof object.rawHeaders === "function" && + typeof object.clone === "function" && + typeof object.get === "function" && + typeof object.set === "function" && + typeof object.contains === "function" && + typeof object.remove === "function" && + typeof object.headersArray === "function" && + typeof object.headerValues === "function" && + typeof object.headerNames === "function" && + typeof object.toJson === "function") { + return true; + } + return false; +} +/** + * A collection of HTTP header key/value pairs. + */ +var HttpHeaders = /** @class */ (function () { + function HttpHeaders(rawHeaders) { + this._headersMap = {}; + if (rawHeaders) { + for (var headerName in rawHeaders) { + this.set(headerName, rawHeaders[headerName]); + } + } + } + /** + * Set a header in this collection with the provided name and value. The name is + * case-insensitive. + * @param headerName The name of the header to set. This value is case-insensitive. + * @param headerValue The value of the header to set. + */ + HttpHeaders.prototype.set = function (headerName, headerValue) { + this._headersMap[getHeaderKey(headerName)] = { + name: headerName, + value: headerValue.toString() + }; + }; + /** + * Get the header value for the provided header name, or undefined if no header exists in this + * collection with the provided name. + * @param headerName The name of the header. + */ + HttpHeaders.prototype.get = function (headerName) { + var header = this._headersMap[getHeaderKey(headerName)]; + return !header ? undefined : header.value; + }; + /** + * Get whether or not this header collection contains a header entry for the provided header name. + */ + HttpHeaders.prototype.contains = function (headerName) { + return !!this._headersMap[getHeaderKey(headerName)]; + }; + /** + * Remove the header with the provided headerName. Return whether or not the header existed and + * was removed. + * @param headerName The name of the header to remove. + */ + HttpHeaders.prototype.remove = function (headerName) { + var result = this.contains(headerName); + delete this._headersMap[getHeaderKey(headerName)]; + return result; + }; + /** + * Get the headers that are contained this collection as an object. + */ + HttpHeaders.prototype.rawHeaders = function () { + var result = {}; + for (var headerKey in this._headersMap) { + var header = this._headersMap[headerKey]; + result[header.name.toLowerCase()] = header.value; + } + return result; + }; + /** + * Get the headers that are contained in this collection as an array. + */ + HttpHeaders.prototype.headersArray = function () { + var headers = []; + for (var headerKey in this._headersMap) { + headers.push(this._headersMap[headerKey]); + } + return headers; + }; + /** + * Get the header names that are contained in this collection. + */ + HttpHeaders.prototype.headerNames = function () { + var headerNames = []; + var headers = this.headersArray(); + for (var i = 0; i < headers.length; ++i) { + headerNames.push(headers[i].name); + } + return headerNames; + }; + /** + * Get the header values that are contained in this collection. + */ + HttpHeaders.prototype.headerValues = function () { + var headerValues = []; + var headers = this.headersArray(); + for (var i = 0; i < headers.length; ++i) { + headerValues.push(headers[i].value); + } + return headerValues; + }; + /** + * Get the JSON object representation of this HTTP header collection. + */ + HttpHeaders.prototype.toJson = function () { + return this.rawHeaders(); + }; + /** + * Get the string representation of this HTTP header collection. + */ + HttpHeaders.prototype.toString = function () { + return JSON.stringify(this.toJson()); + }; + /** + * Create a deep clone/copy of this HttpHeaders collection. + */ + HttpHeaders.prototype.clone = function () { + return new HttpHeaders(this.rawHeaders()); + }; + return HttpHeaders; +}()); + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +function __awaiter$6(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __values$1(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} +function __await$1(v) { + return this instanceof __await$1 ? (this.v = v, this) : new __await$1(v); +} + +function __asyncGenerator$1(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await$1 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await$1(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues$2(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values$1 === "function" ? __values$1(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +// Copyright (c) Microsoft Corporation. +/** + * Encodes a byte array in base64 format. + * @param value the Uint8Aray to encode + */ +function encodeByteArray(value) { + // Buffer.from accepts | -- the TypeScript definition is off here + // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length + var bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); + return bufferValue.toString("base64"); +} +/** + * Decodes a base64 string into a byte array. + * @param value the base64 string to decode + */ +function decodeString(value) { + return Buffer.from(value, "base64"); +} + +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +var getRandomValues; +var rnds8 = new Uint8Array(16); +function rng$1() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, + // find the complete implementation of crypto (msCrypto) on IE11. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} + +var REGEX = /^(?:[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; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +var byteToHex$1 = []; + +for (var i$1 = 0; i$1 < 256; ++i$1) { + byteToHex$1.push((i$1 + 0x100).toString(16).substr(1)); +} + +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + var uuid = (byteToHex$1[arr[offset + 0]] + byteToHex$1[arr[offset + 1]] + byteToHex$1[arr[offset + 2]] + byteToHex$1[arr[offset + 3]] + '-' + byteToHex$1[arr[offset + 4]] + byteToHex$1[arr[offset + 5]] + '-' + byteToHex$1[arr[offset + 6]] + byteToHex$1[arr[offset + 7]] + '-' + byteToHex$1[arr[offset + 8]] + byteToHex$1[arr[offset + 9]] + '-' + byteToHex$1[arr[offset + 10]] + byteToHex$1[arr[offset + 11]] + byteToHex$1[arr[offset + 12]] + byteToHex$1[arr[offset + 13]] + byteToHex$1[arr[offset + 14]] + byteToHex$1[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +function v4$1(options, buf, offset) { + options = options || {}; + var rnds = options.random || (options.rng || rng$1)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var Constants = { + /** + * The core-http version + * @const + * @type {string} + */ + coreHttpVersion: "1.2.0", + /** + * Specifies HTTP. + * + * @const + * @type {string} + */ + HTTP: "http:", + /** + * Specifies HTTPS. + * + * @const + * @type {string} + */ + HTTPS: "https:", + /** + * Specifies HTTP Proxy. + * + * @const + * @type {string} + */ + HTTP_PROXY: "HTTP_PROXY", + /** + * Specifies HTTPS Proxy. + * + * @const + * @type {string} + */ + HTTPS_PROXY: "HTTPS_PROXY", + /** + * Specifies NO Proxy. + * + * @const + * @type {string} + */ + NO_PROXY: "NO_PROXY", + /** + * Specifies ALL Proxy. + * + * @const + * @type {string} + */ + ALL_PROXY: "ALL_PROXY", + HttpConstants: { + /** + * Http Verbs + * + * @const + * @enum {string} + */ + HttpVerbs: { + PUT: "PUT", + GET: "GET", + DELETE: "DELETE", + POST: "POST", + MERGE: "MERGE", + HEAD: "HEAD", + PATCH: "PATCH" + }, + StatusCodes: { + TooManyRequests: 429 + } + }, + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + * + * @const + * @type {string} + */ + AUTHORIZATION: "authorization", + AUTHORIZATION_SCHEME: "Bearer", + /** + * The Retry-After response-header field can be used with a 503 (Service + * Unavailable) or 349 (Too Many Requests) responses to indicate how long + * the service is expected to be unavailable to the requesting client. + * + * @const + * @type {string} + */ + RETRY_AFTER: "Retry-After", + /** + * The UserAgent header. + * + * @const + * @type {string} + */ + USER_AGENT: "User-Agent" + } +}; + +// Copyright (c) Microsoft Corporation. +var validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; +/** + * A constant that indicates whether the environment is node.js or browser based. + */ +var isNode = typeof process !== "undefined" && + !!process.version && + !!process.versions && + !!process.versions.node; +/** + * Validates the given uuid as a string + * + * @param {string} uuid The uuid as a string that needs to be validated + * + * @return {boolean} True if the uuid is valid; false otherwise. + */ +function isValidUuid(uuid) { + return validUuidRegex.test(uuid); +} +/** + * Generated UUID + * + * @return {string} RFC4122 v4 UUID. + */ +function generateUuid() { + return v4$1(); +} +/** + * A wrapper for setTimeout that resolves a promise after t milliseconds. + * @param {number} t The number of milliseconds to be delayed. + * @param {T} value The value to be resolved with after a timeout of t milliseconds. + * @returns {Promise} Resolved promise + */ +function delay(t, value) { + return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); }); +} +function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + var _a, _b, _c; + if (!Array.isArray(obj)) { + obj = [obj]; + } + if (!xmlNamespaceKey || !xmlNamespace) { + return _a = {}, _a[elementName] = obj, _a; + } + return _b = {}, _b[elementName] = obj, _b.$ = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c), _b; +} +var validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; +/** + * Indicates whether the given string is in ISO 8601 format. + * @param {string} value The value to be validated for ISO 8601 duration format. + * @return {boolean} `true` if valid, `false` otherwise. + */ +function isDuration(value) { + return validateISODuration.test(value); +} +/** + * Replace all of the instances of searchValue in value with the provided replaceValue. + * @param {string | undefined} value The value to search and replace in. + * @param {string} searchValue The value to search for in the value argument. + * @param {string} replaceValue The value to replace searchValue with in the value argument. + * @returns {string | undefined} The value where each instance of searchValue was replaced with replacedValue. + */ +function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); +} +/** + * Determines whether the given entity is a basic/primitive type + * (string, number, boolean, null, undefined). + * @param {any} value Any entity + * @return {boolean} - true is it is primitive type, false otherwise. + */ +function isPrimitiveType(value) { + return (typeof value !== "object" && typeof value !== "function") || value === null; +} +function getEnvironmentValue(name) { + if (process.env[name]) { + return process.env[name]; + } + else if (process.env[name.toLowerCase()]) { + return process.env[name.toLowerCase()]; + } + return undefined; +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * Default key used to access the XML attributes. + */ +var XML_ATTRKEY = "$"; +/** + * Default key used to access the XML value content. + */ +var XML_CHARKEY = "_"; + +// Copyright (c) Microsoft Corporation. +var Serializer = /** @class */ (function () { + function Serializer(modelMappers, isXML) { + if (modelMappers === void 0) { modelMappers = {}; } + this.modelMappers = modelMappers; + this.isXML = isXML; + } + Serializer.prototype.validateConstraints = function (mapper, value, objectName) { + var failValidation = function (constraintName, constraintValue) { + throw new Error("\"" + objectName + "\" with value \"" + value + "\" should satisfy the constraint \"" + constraintName + "\": " + constraintValue + "."); + }; + if (mapper.constraints && value != undefined) { + var _a = mapper.constraints, ExclusiveMaximum = _a.ExclusiveMaximum, ExclusiveMinimum = _a.ExclusiveMinimum, InclusiveMaximum = _a.InclusiveMaximum, InclusiveMinimum = _a.InclusiveMinimum, MaxItems = _a.MaxItems, MaxLength = _a.MaxLength, MinItems = _a.MinItems, MinLength = _a.MinLength, MultipleOf = _a.MultipleOf, Pattern = _a.Pattern, UniqueItems = _a.UniqueItems; + if (ExclusiveMaximum != undefined && value >= ExclusiveMaximum) { + failValidation("ExclusiveMaximum", ExclusiveMaximum); + } + if (ExclusiveMinimum != undefined && value <= ExclusiveMinimum) { + failValidation("ExclusiveMinimum", ExclusiveMinimum); + } + if (InclusiveMaximum != undefined && value > InclusiveMaximum) { + failValidation("InclusiveMaximum", InclusiveMaximum); + } + if (InclusiveMinimum != undefined && value < InclusiveMinimum) { + failValidation("InclusiveMinimum", InclusiveMinimum); + } + if (MaxItems != undefined && value.length > MaxItems) { + failValidation("MaxItems", MaxItems); + } + if (MaxLength != undefined && value.length > MaxLength) { + failValidation("MaxLength", MaxLength); + } + if (MinItems != undefined && value.length < MinItems) { + failValidation("MinItems", MinItems); + } + if (MinLength != undefined && value.length < MinLength) { + failValidation("MinLength", MinLength); + } + if (MultipleOf != undefined && value % MultipleOf !== 0) { + failValidation("MultipleOf", MultipleOf); + } + if (Pattern) { + var pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; + if (typeof value !== "string" || value.match(pattern) === null) { + failValidation("Pattern", Pattern); + } + } + if (UniqueItems && + value.some(function (item, i, ar) { return ar.indexOf(item) !== i; })) { + failValidation("UniqueItems", UniqueItems); + } + } + }; + /** + * Serialize the given object based on its metadata defined in the mapper + * + * @param {Mapper} mapper The mapper which defines the metadata of the serializable object + * + * @param {object|string|Array|number|boolean|Date|stream} object A valid Javascript object to be serialized + * + * @param {string} objectName Name of the serialized object + * + * @param {options} options additional options to deserialization + * + * @returns {object|string|Array|number|boolean|Date|stream} A valid serialized Javascript object + */ + Serializer.prototype.serialize = function (mapper, object, objectName, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + }; + var payload = {}; + var mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; + } + if (mapper.isConstant) { + object = mapper.defaultValue; + } + // This table of allowed values should help explain + // the mapper.required and mapper.nullable properties. + // X means "neither undefined or null are allowed". + // || required + // || true | false + // nullable || ========================== + // true || null | undefined/null + // false || X | undefined + // undefined || X | undefined/null + var required = mapper.required, nullable = mapper.nullable; + if (required && nullable && object === undefined) { + throw new Error(objectName + " cannot be undefined."); + } + if (required && !nullable && object == undefined) { + throw new Error(objectName + " cannot be null or undefined."); + } + if (!required && nullable === false && object === null) { + throw new Error(objectName + " cannot be null."); + } + if (object == undefined) { + payload = object; + } + else { + // Validate Constraints if any + this.validateConstraints(mapper, object, objectName); + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } + else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } + else if (mapperType.match(/^Enum$/i) !== null) { + var enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } + else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } + else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } + else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } + else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; + }; + /** + * Deserialize the given object based on its metadata defined in the mapper + * + * @param {object} mapper The mapper which defines the metadata of the serializable object + * + * @param {object|string|Array|number|boolean|Date|stream} responseBody A valid Javascript entity to be deserialized + * + * @param {string} objectName Name of the deserialized object + * + * @param options Controls behavior of XML parser and builder. + * + * @returns {object|string|Array|number|boolean|Date|stream} A valid deserialized Javascript object + */ + Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + }; + if (responseBody == undefined) { + if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { + // Edge case for empty XML non-wrapped lists. xml2js can't distinguish + // between the list being empty versus being missing, + // so let's do the more user-friendly thing and return an empty list. + responseBody = []; + } + // specifically check for undefined as default value can be a falsey value `0, "", false, null` + if (mapper.defaultValue !== undefined) { + responseBody = mapper.defaultValue; + } + return responseBody; + } + var payload; + var mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Composite$/i) !== null) { + payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); + } + else { + if (this.isXML) { + var xmlCharKey = updatedOptions.xmlCharKey; + /** + * If the mapper specifies this as a non-composite type value but the responseBody contains + * both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties, + * then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property. + */ + if (responseBody[XML_ATTRKEY] != undefined && responseBody[xmlCharKey] != undefined) { + responseBody = responseBody[xmlCharKey]; + } + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; + } + } + else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } + else if (responseBody === "false") { + payload = false; + } + else { + payload = responseBody; + } + } + else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { + payload = responseBody; + } + else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { + payload = new Date(responseBody); + } + else if (mapperType.match(/^UnixTime$/i) !== null) { + payload = unixTimeToDate(responseBody); + } + else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = decodeString(responseBody); + } + else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = base64UrlToByteArray(responseBody); + } + else if (mapperType.match(/^Sequence$/i) !== null) { + payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); + } + else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); + } + } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + }; + return Serializer; +}()); +function trimEnd(str, ch) { + var len = str.length; + while (len - 1 >= 0 && str[len - 1] === ch) { + --len; + } + return str.substr(0, len); +} +function bufferToBase64Url(buffer) { + if (!buffer) { + return undefined; + } + if (!(buffer instanceof Uint8Array)) { + throw new Error("Please provide an input of type Uint8Array for converting to Base64Url."); + } + // Uint8Array to Base64. + var str = encodeByteArray(buffer); + // Base64 to Base64Url. + return trimEnd(str, "=") + .replace(/\+/g, "-") + .replace(/\//g, "_"); +} +function base64UrlToByteArray(str) { + if (!str) { + return undefined; + } + if (str && typeof str.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + // Base64Url to Base64. + str = str.replace(/-/g, "+").replace(/_/g, "/"); + // Base64 to Uint8Array. + return decodeString(str); +} +function splitSerializeName(prop) { + var classes = []; + var partialclass = ""; + if (prop) { + var subwords = prop.split("."); + for (var _i = 0, subwords_1 = subwords; _i < subwords_1.length; _i++) { + var item = subwords_1[_i]; + if (item.charAt(item.length - 1) === "\\") { + partialclass += item.substr(0, item.length - 1) + "."; + } + else { + partialclass += item; + classes.push(partialclass); + partialclass = ""; + } + } + } + return classes; +} +function dateToUnixTime(d) { + if (!d) { + return undefined; + } + if (typeof d.valueOf() === "string") { + d = new Date(d); + } + return Math.floor(d.getTime() / 1000); +} +function unixTimeToDate(n) { + if (!n) { + return undefined; + } + return new Date(n * 1000); +} +function serializeBasicTypes(typeName, objectName, value) { + if (value !== null && value !== undefined) { + if (typeName.match(/^Number$/i) !== null) { + if (typeof value !== "number") { + throw new Error(objectName + " with value " + value + " must be of type number."); + } + } + else if (typeName.match(/^String$/i) !== null) { + if (typeof value.valueOf() !== "string") { + throw new Error(objectName + " with value \"" + value + "\" must be of type string."); + } + } + else if (typeName.match(/^Uuid$/i) !== null) { + if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { + throw new Error(objectName + " with value \"" + value + "\" must be of type string and a valid uuid."); + } + } + else if (typeName.match(/^Boolean$/i) !== null) { + if (typeof value !== "boolean") { + throw new Error(objectName + " with value " + value + " must be of type boolean."); + } + } + else if (typeName.match(/^Stream$/i) !== null) { + var objectType = typeof value; + if (objectType !== "string" && + objectType !== "function" && + !(value instanceof ArrayBuffer) && + !ArrayBuffer.isView(value) && + !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { + throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."); + } + } + } + return value; +} +function serializeEnumType(objectName, allowedValues, value) { + if (!allowedValues) { + throw new Error("Please provide a set of allowedValues to validate " + objectName + " as an Enum Type."); + } + var isPresent = allowedValues.some(function (item) { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); + } + return item === value; + }); + if (!isPresent) { + throw new Error(value + " is not a valid value for " + objectName + ". The valid values are: " + JSON.stringify(allowedValues) + "."); + } + return value; +} +function serializeByteArrayType(objectName, value) { + var returnValue = ""; + if (value != undefined) { + if (!(value instanceof Uint8Array)) { + throw new Error(objectName + " must be of type Uint8Array."); + } + returnValue = encodeByteArray(value); + } + return returnValue; +} +function serializeBase64UrlType(objectName, value) { + var returnValue = ""; + if (value != undefined) { + if (!(value instanceof Uint8Array)) { + throw new Error(objectName + " must be of type Uint8Array."); + } + returnValue = bufferToBase64Url(value) || ""; + } + return returnValue; +} +function serializeDateTypes(typeName, value, objectName) { + if (value != undefined) { + if (typeName.match(/^Date$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); + } + value = + value instanceof Date + ? value.toISOString().substring(0, 10) + : new Date(value).toISOString().substring(0, 10); + } + else if (typeName.match(/^DateTime$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); + } + value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); + } + else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123 format."); + } + value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); + } + else if (typeName.match(/^UnixTime$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123/ISO8601 format " + + "for it to be serialized in UnixTime/Epoch format."); + } + value = dateToUnixTime(value); + } + else if (typeName.match(/^TimeSpan$/i) !== null) { + if (!isDuration(value)) { + throw new Error(objectName + " must be a string in ISO 8601 format. Instead was \"" + value + "\"."); + } + } + } + return value; +} +function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + var _a, _b; + if (!Array.isArray(object)) { + throw new Error(objectName + " must be of type Array."); + } + var elementType = mapper.type.element; + if (!elementType || typeof elementType !== "object") { + throw new Error("element\" metadata for an Array must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName + ".")); + } + var tempArray = []; + for (var i = 0; i < object.length; i++) { + var serializedValue = serializer.serialize(elementType, object[i], objectName, options); + if (isXml && elementType.xmlNamespace) { + var xmlnsKey = elementType.xmlNamespacePrefix + ? "xmlns:" + elementType.xmlNamespacePrefix + : "xmlns"; + if (elementType.type.name === "Composite") { + tempArray[i] = __assign({}, serializedValue); + tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a); + } + else { + tempArray[i] = {}; + tempArray[i][options.xmlCharKey] = serializedValue; + tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b); + } + } + else { + tempArray[i] = serializedValue; + } + } + return tempArray; +} +function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + var _a; + if (typeof object !== "object") { + throw new Error(objectName + " must be of type object."); + } + var valueType = mapper.type.value; + if (!valueType || typeof valueType !== "object") { + throw new Error("\"value\" metadata for a Dictionary must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName + ".")); + } + var tempDictionary = {}; + for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { + var key = _b[_i]; + var serializedValue = serializer.serialize(valueType, object[key], objectName, options); + // If the element needs an XML namespace we need to add it within the $ property + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + } + // Add the namespace to the root element if needed + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; + return __assign(__assign({}, tempDictionary), { $: (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a) }); + } + return tempDictionary; +} +/** + * Resolves the additionalProperties property from a referenced mapper + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + * @param objectName name of the object being serialized + */ +function resolveAdditionalProperties(serializer, mapper, objectName) { + var additionalProperties = mapper.type.additionalProperties; + if (!additionalProperties && mapper.type.className) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + } + return additionalProperties; +} +/** + * Finds the mapper referenced by className + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + * @param objectName name of the object being serialized + */ +function resolveReferencedMapper(serializer, mapper, objectName) { + var className = mapper.type.className; + if (!className) { + throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); + } + return serializer.modelMappers[className]; +} +/** + * Resolves a composite mapper's modelProperties. + * @param serializer the serializer containing the entire set of mappers + * @param mapper the composite mapper to resolve + */ +function resolveModelProperties(serializer, mapper, objectName) { + var modelProps = mapper.type.modelProperties; + if (!modelProps) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + if (!modelMapper) { + throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); + } + modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; + if (!modelProps) { + throw new Error("modelProperties cannot be null or undefined in the " + + ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); + } + } + return modelProps; +} +function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + var _a, _b; + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + } + if (object != undefined) { + var payload = {}; + var modelProps = resolveModelProperties(serializer, mapper, objectName); + for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { + var key = _c[_i]; + var propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; + } + var propName = void 0; + var parentObject = payload; + if (serializer.isXML) { + if (propertyMapper.xmlIsWrapped) { + propName = propertyMapper.xmlName; + } + else { + propName = propertyMapper.xmlElementName || propertyMapper.xmlName; + } + } + else { + var paths = splitSerializeName(propertyMapper.serializedName); + propName = paths.pop(); + for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { + var pathName = paths_1[_d]; + var childObject = parentObject[pathName]; + if (childObject == undefined && + (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { + parentObject[pathName] = {}; + } + parentObject = parentObject[pathName]; + } + } + if (parentObject != undefined) { + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix + ? "xmlns:" + mapper.xmlNamespacePrefix + : "xmlns"; + parentObject[XML_ATTRKEY] = __assign(__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); + } + var propertyObjectName = propertyMapper.serializedName !== "" + ? objectName + "." + propertyMapper.serializedName + : objectName; + var toSerialize = object[key]; + var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator && + polymorphicDiscriminator.clientName === key && + toSerialize == undefined) { + toSerialize = mapper.serializedName; + } + var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); + if (serializedValue !== undefined && propName != undefined) { + var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); + if (isXml && propertyMapper.xmlIsAttribute) { + // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js. + // This keeps things simple while preventing name collision + // with names in user documents. + parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; + parentObject[XML_ATTRKEY][propName] = serializedValue; + } + else if (isXml && propertyMapper.xmlIsWrapped) { + parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); + } + else { + parentObject[propName] = value; + } + } + } + } + var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + var propNames = Object.keys(modelProps); + var _loop_1 = function (clientPropName) { + var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; }); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + }; + for (var clientPropName in object) { + _loop_1(clientPropName); + } + } + return payload; + } + return object; +} +function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + var _a; + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; + } + var xmlnsKey = propertyMapper.xmlNamespacePrefix + ? "xmlns:" + propertyMapper.xmlNamespacePrefix + : "xmlns"; + var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); + if (["Composite"].includes(propertyMapper.type.name)) { + if (serializedValue[XML_ATTRKEY]) { + return serializedValue; + } + else { + var result_1 = __assign({}, serializedValue); + result_1[XML_ATTRKEY] = xmlNamespace; + return result_1; + } + } + var result = {}; + result[options.xmlCharKey] = serializedValue; + result[XML_ATTRKEY] = xmlNamespace; + return result; +} +function isSpecialXmlProperty(propertyName, options) { + return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); +} +function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { + var _a; + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + } + var modelProps = resolveModelProperties(serializer, mapper, objectName); + var instance = {}; + var handledPropertyNames = []; + for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { + var key = _b[_i]; + var propertyMapper = modelProps[key]; + var paths = splitSerializeName(modelProps[key].serializedName); + handledPropertyNames.push(paths[0]); + var serializedName = propertyMapper.serializedName, xmlName = propertyMapper.xmlName, xmlElementName = propertyMapper.xmlElementName; + var propertyObjectName = objectName; + if (serializedName !== "" && serializedName !== undefined) { + propertyObjectName = objectName + "." + serializedName; + } + var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; + if (headerCollectionPrefix) { + var dictionary = {}; + for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { + var headerKey = _d[_c]; + if (headerKey.startsWith(headerCollectionPrefix)) { + dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); + } + handledPropertyNames.push(headerKey); + } + instance[key] = dictionary; + } + else if (serializer.isXML) { + if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { + instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); + } + else { + var propertyName = xmlElementName || xmlName || serializedName; + if (propertyMapper.xmlIsWrapped) { + /* a list of wrapped by + For the xml example below + + ... + ... + + the responseBody has + { + Cors: { + CorsRule: [{...}, {...}] + } + } + xmlName is "Cors" and xmlElementName is"CorsRule". + */ + var wrapped = responseBody[xmlName]; + var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; + instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); + } + else { + var property = responseBody[propertyName]; + instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); + } + } + } + else { + // deserialize the property if it is present in the provided responseBody instance + var propertyInstance = void 0; + var res = responseBody; + // traversing the object step by step. + for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { + var item = paths_2[_e]; + if (!res) + break; + res = res[item]; + } + propertyInstance = res; + var polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; + // checking that the model property name (key)(ex: "fishtype") and the + // clientName of the polymorphicDiscriminator {metadata} (ex: "fishtype") + // instead of the serializedName of the polymorphicDiscriminator (ex: "fish.type") + // is a better approach. The generator is not consistent with escaping '\.' in the + // serializedName of the property (ex: "fish\.type") that is marked as polymorphic discriminator + // and the serializedName of the metadata polymorphicDiscriminator (ex: "fish.type"). However, + // the clientName transformation of the polymorphicDiscriminator (ex: "fishtype") and + // the transformation of model property name (ex: "fishtype") is done consistently. + // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator. + if (polymorphicDiscriminator && + key === polymorphicDiscriminator.clientName && + propertyInstance == undefined) { + propertyInstance = mapper.serializedName; + } + var serializedValue = void 0; + // paging + if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { + propertyInstance = responseBody[key]; + instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + } + else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) { + serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + instance[key] = serializedValue; + } + } + } + var additionalPropertiesMapper = mapper.type.additionalProperties; + if (additionalPropertiesMapper) { + var isAdditionalProperty = function (responsePropName) { + for (var clientPropName in modelProps) { + var paths = splitSerializeName(modelProps[clientPropName].serializedName); + if (paths[0] === responsePropName) { + return false; + } + } + return true; + }; + for (var responsePropName in responseBody) { + if (isAdditionalProperty(responsePropName)) { + instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + } + } + } + else if (responseBody) { + for (var _f = 0, _g = Object.keys(responseBody); _f < _g.length; _f++) { + var key = _g[_f]; + if (instance[key] === undefined && + !handledPropertyNames.includes(key) && + !isSpecialXmlProperty(key, options)) { + instance[key] = responseBody[key]; + } + } + } + return instance; +} +function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { + var value = mapper.type.value; + if (!value || typeof value !== "object") { + throw new Error("\"value\" metadata for a Dictionary must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName)); + } + if (responseBody) { + var tempDictionary = {}; + for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) { + var key = _a[_i]; + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + return tempDictionary; + } + return responseBody; +} +function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { + var element = mapper.type.element; + if (!element || typeof element !== "object") { + throw new Error("element\" metadata for an Array must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName)); + } + if (responseBody) { + if (!Array.isArray(responseBody)) { + // xml2js will interpret a single element array as just the element, so force it to be an array + responseBody = [responseBody]; + } + var tempArray = []; + for (var i = 0; i < responseBody.length; i++) { + tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options); + } + return tempArray; + } + return responseBody; +} +function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + var discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName != undefined) { + var discriminatorValue = object[discriminatorName]; + if (discriminatorValue != undefined) { + var typeName = mapper.type.uberParent || mapper.type.className; + var indexDiscriminator = discriminatorValue === typeName + ? discriminatorValue + : typeName + "." + discriminatorValue; + var polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator]; + if (polymorphicMapper) { + mapper = polymorphicMapper; + } + } + } + } + return mapper; +} +function getPolymorphicDiscriminatorRecursively(serializer, mapper) { + return (mapper.type.polymorphicDiscriminator || + getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || + getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)); +} +function getPolymorphicDiscriminatorSafely(serializer, typeName) { + return (typeName && + serializer.modelMappers[typeName] && + serializer.modelMappers[typeName].type.polymorphicDiscriminator); +} +/** + * Utility function to create a K:V from a list of strings + */ +function strEnum(o) { + var result = {}; + for (var _i = 0, o_1 = o; _i < o_1.length; _i++) { + var key = o_1[_i]; + result[key] = key; + } + return result; +} +var MapperType = strEnum([ + "Base64Url", + "Boolean", + "ByteArray", + "Composite", + "Date", + "DateTime", + "DateTimeRfc1123", + "Dictionary", + "Enum", + "Number", + "Object", + "Sequence", + "String", + "Stream", + "TimeSpan", + "UnixTime" +]); + +// Copyright (c) Microsoft Corporation. +function isWebResourceLike(object) { + if (typeof object !== "object") { + return false; + } + if (typeof object.url === "string" && + typeof object.method === "string" && + typeof object.headers === "object" && + isHttpHeadersLike(object.headers) && + typeof object.validateRequestProperties === "function" && + typeof object.prepare === "function" && + typeof object.clone === "function") { + return true; + } + return false; +} +/** + * Creates a new WebResource object. + * + * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary + * properties to initiate a request. + * + * @constructor + */ +var WebResource = /** @class */ (function () { + function WebResource(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse) { + this.streamResponseBody = streamResponseBody; + this.url = url || ""; + this.method = method || "GET"; + this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); + this.body = body; + this.query = query; + this.formData = undefined; + this.withCredentials = withCredentials || false; + this.abortSignal = abortSignal; + this.timeout = timeout || 0; + this.onUploadProgress = onUploadProgress; + this.onDownloadProgress = onDownloadProgress; + this.proxySettings = proxySettings; + this.keepAlive = keepAlive; + this.decompressResponse = decompressResponse; + this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); + } + /** + * Validates that the required properties such as method, url, headers["Content-Type"], + * headers["accept-language"] are defined. It will throw an error if one of the above + * mentioned properties are not defined. + */ + WebResource.prototype.validateRequestProperties = function () { + if (!this.method) { + throw new Error("WebResource.method is required."); + } + if (!this.url) { + throw new Error("WebResource.url is required."); + } + }; + /** + * Prepares the request. + * @param {RequestPrepareOptions} options Options to provide for preparing the request. + * @returns {WebResource} Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + */ + WebResource.prototype.prepare = function (options) { + if (!options) { + throw new Error("options object is required"); + } + if (options.method === undefined || + options.method === null || + typeof options.method.valueOf() !== "string") { + throw new Error("options.method must be a string."); + } + if (options.url && options.pathTemplate) { + throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); + } + if ((options.pathTemplate === undefined || + options.pathTemplate === null || + typeof options.pathTemplate.valueOf() !== "string") && + (options.url === undefined || + options.url === null || + typeof options.url.valueOf() !== "string")) { + throw new Error("Please provide exactly one of options.pathTemplate or options.url."); + } + // set the url if it is provided. + if (options.url) { + if (typeof options.url !== "string") { + throw new Error('options.url must be of type "string".'); + } + this.url = options.url; + } + // set the method + if (options.method) { + var validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; + if (validMethods.indexOf(options.method.toUpperCase()) === -1) { + throw new Error('The provided method "' + + options.method + + '" is invalid. Supported HTTP methods are: ' + + JSON.stringify(validMethods)); + } + } + this.method = options.method.toUpperCase(); + // construct the url if path template is provided + if (options.pathTemplate) { + var pathTemplate_1 = options.pathTemplate, pathParameters_1 = options.pathParameters; + if (typeof pathTemplate_1 !== "string") { + throw new Error('options.pathTemplate must be of type "string".'); + } + if (!options.baseUrl) { + options.baseUrl = "https://management.azure.com"; + } + var baseUrl = options.baseUrl; + var url_1 = baseUrl + + (baseUrl.endsWith("/") ? "" : "/") + + (pathTemplate_1.startsWith("/") ? pathTemplate_1.slice(1) : pathTemplate_1); + var segments = url_1.match(/({[\w-]*\s*[\w-]*})/gi); + if (segments && segments.length) { + if (!pathParameters_1) { + throw new Error("pathTemplate: " + pathTemplate_1 + " has been provided. Hence, options.pathParameters must also be provided."); + } + segments.forEach(function (item) { + var pathParamName = item.slice(1, -1); + var pathParam = pathParameters_1[pathParamName]; + if (pathParam === null || + pathParam === undefined || + !(typeof pathParam === "string" || typeof pathParam === "object")) { + var stringifiedPathParameters = JSON.stringify(pathParameters_1, undefined, 2); + throw new Error("pathTemplate: " + pathTemplate_1 + " contains the path parameter " + pathParamName + + (" however, it is not present in parameters: " + stringifiedPathParameters + ".") + + ("The value of the path parameter can either be a \"string\" of the form { " + pathParamName + ": \"some sample value\" } or ") + + ("it can be an \"object\" of the form { \"" + pathParamName + "\": { value: \"some sample value\", skipUrlEncoding: true } }.")); + } + if (typeof pathParam.valueOf() === "string") { + url_1 = url_1.replace(item, encodeURIComponent(pathParam)); + } + if (typeof pathParam.valueOf() === "object") { + if (!pathParam.value) { + throw new Error("options.pathParameters[" + pathParamName + "] is of type \"object\" but it does not contain a \"value\" property."); + } + if (pathParam.skipUrlEncoding) { + url_1 = url_1.replace(item, pathParam.value); + } + else { + url_1 = url_1.replace(item, encodeURIComponent(pathParam.value)); + } + } + }); + } + this.url = url_1; + } + // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option. + if (options.queryParameters) { + var queryParameters = options.queryParameters; + if (typeof queryParameters !== "object") { + throw new Error("options.queryParameters must be of type object. It should be a JSON object " + + "of \"query-parameter-name\" as the key and the \"query-parameter-value\" as the value. " + + "The \"query-parameter-value\" may be fo type \"string\" or an \"object\" of the form { value: \"query-parameter-value\", skipUrlEncoding: true }."); + } + // append question mark if it is not present in the url + if (this.url && this.url.indexOf("?") === -1) { + this.url += "?"; + } + // construct queryString + var queryParams = []; + // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest(). + this.query = {}; + for (var queryParamName in queryParameters) { + var queryParam = queryParameters[queryParamName]; + if (queryParam) { + if (typeof queryParam === "string") { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); + this.query[queryParamName] = encodeURIComponent(queryParam); + } + else if (typeof queryParam === "object") { + if (!queryParam.value) { + throw new Error("options.queryParameters[" + queryParamName + "] is of type \"object\" but it does not contain a \"value\" property."); + } + if (queryParam.skipUrlEncoding) { + queryParams.push(queryParamName + "=" + queryParam.value); + this.query[queryParamName] = queryParam.value; + } + else { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); + this.query[queryParamName] = encodeURIComponent(queryParam.value); + } + } + } + } // end-of-for + // append the queryString + this.url += queryParams.join("&"); + } + // add headers to the request if they are provided + if (options.headers) { + var headers = options.headers; + for (var _i = 0, _a = Object.keys(options.headers); _i < _a.length; _i++) { + var headerName = _a[_i]; + this.headers.set(headerName, headers[headerName]); + } + } + // ensure accept-language is set correctly + if (!this.headers.get("accept-language")) { + this.headers.set("accept-language", "en-US"); + } + // ensure the request-id is set correctly + if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { + this.headers.set("x-ms-client-request-id", this.requestId); + } + // default + if (!this.headers.get("Content-Type")) { + this.headers.set("Content-Type", "application/json; charset=utf-8"); + } + // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicilty + this.body = options.body; + if (options.body !== undefined && options.body !== null) { + // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream. + if (options.bodyIsStream) { + if (!this.headers.get("Transfer-Encoding")) { + this.headers.set("Transfer-Encoding", "chunked"); + } + if (this.headers.get("Content-Type") !== "application/octet-stream") { + this.headers.set("Content-Type", "application/octet-stream"); + } + } + else { + if (options.serializationMapper) { + this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); + } + if (!options.disableJsonStringifyOnBody) { + this.body = JSON.stringify(options.body); + } + } + } + if (options.spanOptions) { + this.spanOptions = options.spanOptions; + } + this.abortSignal = options.abortSignal; + this.onDownloadProgress = options.onDownloadProgress; + this.onUploadProgress = options.onUploadProgress; + return this; + }; + /** + * Clone this WebResource HTTP request object. + * @returns {WebResource} The clone of this WebResource HTTP request object. + */ + WebResource.prototype.clone = function () { + var result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse); + if (this.formData) { + result.formData = this.formData; + } + if (this.operationSpec) { + result.operationSpec = this.operationSpec; + } + if (this.shouldDeserialize) { + result.shouldDeserialize = this.shouldDeserialize; + } + if (this.operationResponseGetter) { + result.operationResponseGetter = this.operationResponseGetter; + } + return result; + }; + return WebResource; +}()); + +var require$$0 = [ + "ac", + "com.ac", + "edu.ac", + "gov.ac", + "net.ac", + "mil.ac", + "org.ac", + "ad", + "nom.ad", + "ae", + "co.ae", + "net.ae", + "org.ae", + "sch.ae", + "ac.ae", + "gov.ae", + "mil.ae", + "aero", + "accident-investigation.aero", + "accident-prevention.aero", + "aerobatic.aero", + "aeroclub.aero", + "aerodrome.aero", + "agents.aero", + "aircraft.aero", + "airline.aero", + "airport.aero", + "air-surveillance.aero", + "airtraffic.aero", + "air-traffic-control.aero", + "ambulance.aero", + "amusement.aero", + "association.aero", + "author.aero", + "ballooning.aero", + "broker.aero", + "caa.aero", + "cargo.aero", + "catering.aero", + "certification.aero", + "championship.aero", + "charter.aero", + "civilaviation.aero", + "club.aero", + "conference.aero", + "consultant.aero", + "consulting.aero", + "control.aero", + "council.aero", + "crew.aero", + "design.aero", + "dgca.aero", + "educator.aero", + "emergency.aero", + "engine.aero", + "engineer.aero", + "entertainment.aero", + "equipment.aero", + "exchange.aero", + "express.aero", + "federation.aero", + "flight.aero", + "freight.aero", + "fuel.aero", + "gliding.aero", + "government.aero", + "groundhandling.aero", + "group.aero", + "hanggliding.aero", + "homebuilt.aero", + "insurance.aero", + "journal.aero", + "journalist.aero", + "leasing.aero", + "logistics.aero", + "magazine.aero", + "maintenance.aero", + "media.aero", + "microlight.aero", + "modelling.aero", + "navigation.aero", + "parachuting.aero", + "paragliding.aero", + "passenger-association.aero", + "pilot.aero", + "press.aero", + "production.aero", + "recreation.aero", + "repbody.aero", + "res.aero", + "research.aero", + "rotorcraft.aero", + "safety.aero", + "scientist.aero", + "services.aero", + "show.aero", + "skydiving.aero", + "software.aero", + "student.aero", + "trader.aero", + "trading.aero", + "trainer.aero", + "union.aero", + "workinggroup.aero", + "works.aero", + "af", + "gov.af", + "com.af", + "org.af", + "net.af", + "edu.af", + "ag", + "com.ag", + "org.ag", + "net.ag", + "co.ag", + "nom.ag", + "ai", + "off.ai", + "com.ai", + "net.ai", + "org.ai", + "al", + "com.al", + "edu.al", + "gov.al", + "mil.al", + "net.al", + "org.al", + "am", + "co.am", + "com.am", + "commune.am", + "net.am", + "org.am", + "ao", + "ed.ao", + "gv.ao", + "og.ao", + "co.ao", + "pb.ao", + "it.ao", + "aq", + "ar", + "com.ar", + "edu.ar", + "gob.ar", + "gov.ar", + "int.ar", + "mil.ar", + "musica.ar", + "net.ar", + "org.ar", + "tur.ar", + "arpa", + "e164.arpa", + "in-addr.arpa", + "ip6.arpa", + "iris.arpa", + "uri.arpa", + "urn.arpa", + "as", + "gov.as", + "asia", + "at", + "ac.at", + "co.at", + "gv.at", + "or.at", + "au", + "com.au", + "net.au", + "org.au", + "edu.au", + "gov.au", + "asn.au", + "id.au", + "info.au", + "conf.au", + "oz.au", + "act.au", + "nsw.au", + "nt.au", + "qld.au", + "sa.au", + "tas.au", + "vic.au", + "wa.au", + "act.edu.au", + "catholic.edu.au", + "nsw.edu.au", + "nt.edu.au", + "qld.edu.au", + "sa.edu.au", + "tas.edu.au", + "vic.edu.au", + "wa.edu.au", + "qld.gov.au", + "sa.gov.au", + "tas.gov.au", + "vic.gov.au", + "wa.gov.au", + "education.tas.edu.au", + "schools.nsw.edu.au", + "aw", + "com.aw", + "ax", + "az", + "com.az", + "net.az", + "int.az", + "gov.az", + "org.az", + "edu.az", + "info.az", + "pp.az", + "mil.az", + "name.az", + "pro.az", + "biz.az", + "ba", + "com.ba", + "edu.ba", + "gov.ba", + "mil.ba", + "net.ba", + "org.ba", + "bb", + "biz.bb", + "co.bb", + "com.bb", + "edu.bb", + "gov.bb", + "info.bb", + "net.bb", + "org.bb", + "store.bb", + "tv.bb", + "*.bd", + "be", + "ac.be", + "bf", + "gov.bf", + "bg", + "a.bg", + "b.bg", + "c.bg", + "d.bg", + "e.bg", + "f.bg", + "g.bg", + "h.bg", + "i.bg", + "j.bg", + "k.bg", + "l.bg", + "m.bg", + "n.bg", + "o.bg", + "p.bg", + "q.bg", + "r.bg", + "s.bg", + "t.bg", + "u.bg", + "v.bg", + "w.bg", + "x.bg", + "y.bg", + "z.bg", + "0.bg", + "1.bg", + "2.bg", + "3.bg", + "4.bg", + "5.bg", + "6.bg", + "7.bg", + "8.bg", + "9.bg", + "bh", + "com.bh", + "edu.bh", + "net.bh", + "org.bh", + "gov.bh", + "bi", + "co.bi", + "com.bi", + "edu.bi", + "or.bi", + "org.bi", + "biz", + "bj", + "asso.bj", + "barreau.bj", + "gouv.bj", + "bm", + "com.bm", + "edu.bm", + "gov.bm", + "net.bm", + "org.bm", + "bn", + "com.bn", + "edu.bn", + "gov.bn", + "net.bn", + "org.bn", + "bo", + "com.bo", + "edu.bo", + "gob.bo", + "int.bo", + "org.bo", + "net.bo", + "mil.bo", + "tv.bo", + "web.bo", + "academia.bo", + "agro.bo", + "arte.bo", + "blog.bo", + "bolivia.bo", + "ciencia.bo", + "cooperativa.bo", + "democracia.bo", + "deporte.bo", + "ecologia.bo", + "economia.bo", + "empresa.bo", + "indigena.bo", + "industria.bo", + "info.bo", + "medicina.bo", + "movimiento.bo", + "musica.bo", + "natural.bo", + "nombre.bo", + "noticias.bo", + "patria.bo", + "politica.bo", + "profesional.bo", + "plurinacional.bo", + "pueblo.bo", + "revista.bo", + "salud.bo", + "tecnologia.bo", + "tksat.bo", + "transporte.bo", + "wiki.bo", + "br", + "9guacu.br", + "abc.br", + "adm.br", + "adv.br", + "agr.br", + "aju.br", + "am.br", + "anani.br", + "aparecida.br", + "arq.br", + "art.br", + "ato.br", + "b.br", + "barueri.br", + "belem.br", + "bhz.br", + "bio.br", + "blog.br", + "bmd.br", + "boavista.br", + "bsb.br", + "campinagrande.br", + "campinas.br", + "caxias.br", + "cim.br", + "cng.br", + "cnt.br", + "com.br", + "contagem.br", + "coop.br", + "cri.br", + "cuiaba.br", + "curitiba.br", + "def.br", + "ecn.br", + "eco.br", + "edu.br", + "emp.br", + "eng.br", + "esp.br", + "etc.br", + "eti.br", + "far.br", + "feira.br", + "flog.br", + "floripa.br", + "fm.br", + "fnd.br", + "fortal.br", + "fot.br", + "foz.br", + "fst.br", + "g12.br", + "ggf.br", + "goiania.br", + "gov.br", + "ac.gov.br", + "al.gov.br", + "am.gov.br", + "ap.gov.br", + "ba.gov.br", + "ce.gov.br", + "df.gov.br", + "es.gov.br", + "go.gov.br", + "ma.gov.br", + "mg.gov.br", + "ms.gov.br", + "mt.gov.br", + "pa.gov.br", + "pb.gov.br", + "pe.gov.br", + "pi.gov.br", + "pr.gov.br", + "rj.gov.br", + "rn.gov.br", + "ro.gov.br", + "rr.gov.br", + "rs.gov.br", + "sc.gov.br", + "se.gov.br", + "sp.gov.br", + "to.gov.br", + "gru.br", + "imb.br", + "ind.br", + "inf.br", + "jab.br", + "jampa.br", + "jdf.br", + "joinville.br", + "jor.br", + "jus.br", + "leg.br", + "lel.br", + "londrina.br", + "macapa.br", + "maceio.br", + "manaus.br", + "maringa.br", + "mat.br", + "med.br", + "mil.br", + "morena.br", + "mp.br", + "mus.br", + "natal.br", + "net.br", + "niteroi.br", + "*.nom.br", + "not.br", + "ntr.br", + "odo.br", + "ong.br", + "org.br", + "osasco.br", + "palmas.br", + "poa.br", + "ppg.br", + "pro.br", + "psc.br", + "psi.br", + "pvh.br", + "qsl.br", + "radio.br", + "rec.br", + "recife.br", + "ribeirao.br", + "rio.br", + "riobranco.br", + "riopreto.br", + "salvador.br", + "sampa.br", + "santamaria.br", + "santoandre.br", + "saobernardo.br", + "saogonca.br", + "sjc.br", + "slg.br", + "slz.br", + "sorocaba.br", + "srv.br", + "taxi.br", + "tc.br", + "teo.br", + "the.br", + "tmp.br", + "trd.br", + "tur.br", + "tv.br", + "udi.br", + "vet.br", + "vix.br", + "vlog.br", + "wiki.br", + "zlg.br", + "bs", + "com.bs", + "net.bs", + "org.bs", + "edu.bs", + "gov.bs", + "bt", + "com.bt", + "edu.bt", + "gov.bt", + "net.bt", + "org.bt", + "bv", + "bw", + "co.bw", + "org.bw", + "by", + "gov.by", + "mil.by", + "com.by", + "of.by", + "bz", + "com.bz", + "net.bz", + "org.bz", + "edu.bz", + "gov.bz", + "ca", + "ab.ca", + "bc.ca", + "mb.ca", + "nb.ca", + "nf.ca", + "nl.ca", + "ns.ca", + "nt.ca", + "nu.ca", + "on.ca", + "pe.ca", + "qc.ca", + "sk.ca", + "yk.ca", + "gc.ca", + "cat", + "cc", + "cd", + "gov.cd", + "cf", + "cg", + "ch", + "ci", + "org.ci", + "or.ci", + "com.ci", + "co.ci", + "edu.ci", + "ed.ci", + "ac.ci", + "net.ci", + "go.ci", + "asso.ci", + "aéroport.ci", + "int.ci", + "presse.ci", + "md.ci", + "gouv.ci", + "*.ck", + "!www.ck", + "cl", + "aprendemas.cl", + "co.cl", + "gob.cl", + "gov.cl", + "mil.cl", + "cm", + "co.cm", + "com.cm", + "gov.cm", + "net.cm", + "cn", + "ac.cn", + "com.cn", + "edu.cn", + "gov.cn", + "net.cn", + "org.cn", + "mil.cn", + "公司.cn", + "网络.cn", + "網絡.cn", + "ah.cn", + "bj.cn", + "cq.cn", + "fj.cn", + "gd.cn", + "gs.cn", + "gz.cn", + "gx.cn", + "ha.cn", + "hb.cn", + "he.cn", + "hi.cn", + "hl.cn", + "hn.cn", + "jl.cn", + "js.cn", + "jx.cn", + "ln.cn", + "nm.cn", + "nx.cn", + "qh.cn", + "sc.cn", + "sd.cn", + "sh.cn", + "sn.cn", + "sx.cn", + "tj.cn", + "xj.cn", + "xz.cn", + "yn.cn", + "zj.cn", + "hk.cn", + "mo.cn", + "tw.cn", + "co", + "arts.co", + "com.co", + "edu.co", + "firm.co", + "gov.co", + "info.co", + "int.co", + "mil.co", + "net.co", + "nom.co", + "org.co", + "rec.co", + "web.co", + "com", + "coop", + "cr", + "ac.cr", + "co.cr", + "ed.cr", + "fi.cr", + "go.cr", + "or.cr", + "sa.cr", + "cu", + "com.cu", + "edu.cu", + "org.cu", + "net.cu", + "gov.cu", + "inf.cu", + "cv", + "cw", + "com.cw", + "edu.cw", + "net.cw", + "org.cw", + "cx", + "gov.cx", + "cy", + "ac.cy", + "biz.cy", + "com.cy", + "ekloges.cy", + "gov.cy", + "ltd.cy", + "name.cy", + "net.cy", + "org.cy", + "parliament.cy", + "press.cy", + "pro.cy", + "tm.cy", + "cz", + "de", + "dj", + "dk", + "dm", + "com.dm", + "net.dm", + "org.dm", + "edu.dm", + "gov.dm", + "do", + "art.do", + "com.do", + "edu.do", + "gob.do", + "gov.do", + "mil.do", + "net.do", + "org.do", + "sld.do", + "web.do", + "dz", + "com.dz", + "org.dz", + "net.dz", + "gov.dz", + "edu.dz", + "asso.dz", + "pol.dz", + "art.dz", + "ec", + "com.ec", + "info.ec", + "net.ec", + "fin.ec", + "k12.ec", + "med.ec", + "pro.ec", + "org.ec", + "edu.ec", + "gov.ec", + "gob.ec", + "mil.ec", + "edu", + "ee", + "edu.ee", + "gov.ee", + "riik.ee", + "lib.ee", + "med.ee", + "com.ee", + "pri.ee", + "aip.ee", + "org.ee", + "fie.ee", + "eg", + "com.eg", + "edu.eg", + "eun.eg", + "gov.eg", + "mil.eg", + "name.eg", + "net.eg", + "org.eg", + "sci.eg", + "*.er", + "es", + "com.es", + "nom.es", + "org.es", + "gob.es", + "edu.es", + "et", + "com.et", + "gov.et", + "org.et", + "edu.et", + "biz.et", + "name.et", + "info.et", + "net.et", + "eu", + "fi", + "aland.fi", + "fj", + "ac.fj", + "biz.fj", + "com.fj", + "gov.fj", + "info.fj", + "mil.fj", + "name.fj", + "net.fj", + "org.fj", + "pro.fj", + "*.fk", + "fm", + "fo", + "fr", + "asso.fr", + "com.fr", + "gouv.fr", + "nom.fr", + "prd.fr", + "tm.fr", + "aeroport.fr", + "avocat.fr", + "avoues.fr", + "cci.fr", + "chambagri.fr", + "chirurgiens-dentistes.fr", + "experts-comptables.fr", + "geometre-expert.fr", + "greta.fr", + "huissier-justice.fr", + "medecin.fr", + "notaires.fr", + "pharmacien.fr", + "port.fr", + "veterinaire.fr", + "ga", + "gb", + "gd", + "ge", + "com.ge", + "edu.ge", + "gov.ge", + "org.ge", + "mil.ge", + "net.ge", + "pvt.ge", + "gf", + "gg", + "co.gg", + "net.gg", + "org.gg", + "gh", + "com.gh", + "edu.gh", + "gov.gh", + "org.gh", + "mil.gh", + "gi", + "com.gi", + "ltd.gi", + "gov.gi", + "mod.gi", + "edu.gi", + "org.gi", + "gl", + "co.gl", + "com.gl", + "edu.gl", + "net.gl", + "org.gl", + "gm", + "gn", + "ac.gn", + "com.gn", + "edu.gn", + "gov.gn", + "org.gn", + "net.gn", + "gov", + "gp", + "com.gp", + "net.gp", + "mobi.gp", + "edu.gp", + "org.gp", + "asso.gp", + "gq", + "gr", + "com.gr", + "edu.gr", + "net.gr", + "org.gr", + "gov.gr", + "gs", + "gt", + "com.gt", + "edu.gt", + "gob.gt", + "ind.gt", + "mil.gt", + "net.gt", + "org.gt", + "gu", + "com.gu", + "edu.gu", + "gov.gu", + "guam.gu", + "info.gu", + "net.gu", + "org.gu", + "web.gu", + "gw", + "gy", + "co.gy", + "com.gy", + "edu.gy", + "gov.gy", + "net.gy", + "org.gy", + "hk", + "com.hk", + "edu.hk", + "gov.hk", + "idv.hk", + "net.hk", + "org.hk", + "公司.hk", + "教育.hk", + "敎育.hk", + "政府.hk", + "個人.hk", + "个人.hk", + "箇人.hk", + "網络.hk", + "网络.hk", + "组織.hk", + "網絡.hk", + "网絡.hk", + "组织.hk", + "組織.hk", + "組织.hk", + "hm", + "hn", + "com.hn", + "edu.hn", + "org.hn", + "net.hn", + "mil.hn", + "gob.hn", + "hr", + "iz.hr", + "from.hr", + "name.hr", + "com.hr", + "ht", + "com.ht", + "shop.ht", + "firm.ht", + "info.ht", + "adult.ht", + "net.ht", + "pro.ht", + "org.ht", + "med.ht", + "art.ht", + "coop.ht", + "pol.ht", + "asso.ht", + "edu.ht", + "rel.ht", + "gouv.ht", + "perso.ht", + "hu", + "co.hu", + "info.hu", + "org.hu", + "priv.hu", + "sport.hu", + "tm.hu", + "2000.hu", + "agrar.hu", + "bolt.hu", + "casino.hu", + "city.hu", + "erotica.hu", + "erotika.hu", + "film.hu", + "forum.hu", + "games.hu", + "hotel.hu", + "ingatlan.hu", + "jogasz.hu", + "konyvelo.hu", + "lakas.hu", + "media.hu", + "news.hu", + "reklam.hu", + "sex.hu", + "shop.hu", + "suli.hu", + "szex.hu", + "tozsde.hu", + "utazas.hu", + "video.hu", + "id", + "ac.id", + "biz.id", + "co.id", + "desa.id", + "go.id", + "mil.id", + "my.id", + "net.id", + "or.id", + "ponpes.id", + "sch.id", + "web.id", + "ie", + "gov.ie", + "il", + "ac.il", + "co.il", + "gov.il", + "idf.il", + "k12.il", + "muni.il", + "net.il", + "org.il", + "im", + "ac.im", + "co.im", + "com.im", + "ltd.co.im", + "net.im", + "org.im", + "plc.co.im", + "tt.im", + "tv.im", + "in", + "co.in", + "firm.in", + "net.in", + "org.in", + "gen.in", + "ind.in", + "nic.in", + "ac.in", + "edu.in", + "res.in", + "gov.in", + "mil.in", + "info", + "int", + "eu.int", + "io", + "com.io", + "iq", + "gov.iq", + "edu.iq", + "mil.iq", + "com.iq", + "org.iq", + "net.iq", + "ir", + "ac.ir", + "co.ir", + "gov.ir", + "id.ir", + "net.ir", + "org.ir", + "sch.ir", + "ایران.ir", + "ايران.ir", + "is", + "net.is", + "com.is", + "edu.is", + "gov.is", + "org.is", + "int.is", + "it", + "gov.it", + "edu.it", + "abr.it", + "abruzzo.it", + "aosta-valley.it", + "aostavalley.it", + "bas.it", + "basilicata.it", + "cal.it", + "calabria.it", + "cam.it", + "campania.it", + "emilia-romagna.it", + "emiliaromagna.it", + "emr.it", + "friuli-v-giulia.it", + "friuli-ve-giulia.it", + "friuli-vegiulia.it", + "friuli-venezia-giulia.it", + "friuli-veneziagiulia.it", + "friuli-vgiulia.it", + "friuliv-giulia.it", + "friulive-giulia.it", + "friulivegiulia.it", + "friulivenezia-giulia.it", + "friuliveneziagiulia.it", + "friulivgiulia.it", + "fvg.it", + "laz.it", + "lazio.it", + "lig.it", + "liguria.it", + "lom.it", + "lombardia.it", + "lombardy.it", + "lucania.it", + "mar.it", + "marche.it", + "mol.it", + "molise.it", + "piedmont.it", + "piemonte.it", + "pmn.it", + "pug.it", + "puglia.it", + "sar.it", + "sardegna.it", + "sardinia.it", + "sic.it", + "sicilia.it", + "sicily.it", + "taa.it", + "tos.it", + "toscana.it", + "trentin-sud-tirol.it", + "trentin-süd-tirol.it", + "trentin-sudtirol.it", + "trentin-südtirol.it", + "trentin-sued-tirol.it", + "trentin-suedtirol.it", + "trentino-a-adige.it", + "trentino-aadige.it", + "trentino-alto-adige.it", + "trentino-altoadige.it", + "trentino-s-tirol.it", + "trentino-stirol.it", + "trentino-sud-tirol.it", + "trentino-süd-tirol.it", + "trentino-sudtirol.it", + "trentino-südtirol.it", + "trentino-sued-tirol.it", + "trentino-suedtirol.it", + "trentino.it", + "trentinoa-adige.it", + "trentinoaadige.it", + "trentinoalto-adige.it", + "trentinoaltoadige.it", + "trentinos-tirol.it", + "trentinostirol.it", + "trentinosud-tirol.it", + "trentinosüd-tirol.it", + "trentinosudtirol.it", + "trentinosüdtirol.it", + "trentinosued-tirol.it", + "trentinosuedtirol.it", + "trentinsud-tirol.it", + "trentinsüd-tirol.it", + "trentinsudtirol.it", + "trentinsüdtirol.it", + "trentinsued-tirol.it", + "trentinsuedtirol.it", + "tuscany.it", + "umb.it", + "umbria.it", + "val-d-aosta.it", + "val-daosta.it", + "vald-aosta.it", + "valdaosta.it", + "valle-aosta.it", + "valle-d-aosta.it", + "valle-daosta.it", + "valleaosta.it", + "valled-aosta.it", + "valledaosta.it", + "vallee-aoste.it", + "vallée-aoste.it", + "vallee-d-aoste.it", + "vallée-d-aoste.it", + "valleeaoste.it", + "valléeaoste.it", + "valleedaoste.it", + "valléedaoste.it", + "vao.it", + "vda.it", + "ven.it", + "veneto.it", + "ag.it", + "agrigento.it", + "al.it", + "alessandria.it", + "alto-adige.it", + "altoadige.it", + "an.it", + "ancona.it", + "andria-barletta-trani.it", + "andria-trani-barletta.it", + "andriabarlettatrani.it", + "andriatranibarletta.it", + "ao.it", + "aosta.it", + "aoste.it", + "ap.it", + "aq.it", + "aquila.it", + "ar.it", + "arezzo.it", + "ascoli-piceno.it", + "ascolipiceno.it", + "asti.it", + "at.it", + "av.it", + "avellino.it", + "ba.it", + "balsan-sudtirol.it", + "balsan-südtirol.it", + "balsan-suedtirol.it", + "balsan.it", + "bari.it", + "barletta-trani-andria.it", + "barlettatraniandria.it", + "belluno.it", + "benevento.it", + "bergamo.it", + "bg.it", + "bi.it", + "biella.it", + "bl.it", + "bn.it", + "bo.it", + "bologna.it", + "bolzano-altoadige.it", + "bolzano.it", + "bozen-sudtirol.it", + "bozen-südtirol.it", + "bozen-suedtirol.it", + "bozen.it", + "br.it", + "brescia.it", + "brindisi.it", + "bs.it", + "bt.it", + "bulsan-sudtirol.it", + "bulsan-südtirol.it", + "bulsan-suedtirol.it", + "bulsan.it", + "bz.it", + "ca.it", + "cagliari.it", + "caltanissetta.it", + "campidano-medio.it", + "campidanomedio.it", + "campobasso.it", + "carbonia-iglesias.it", + "carboniaiglesias.it", + "carrara-massa.it", + "carraramassa.it", + "caserta.it", + "catania.it", + "catanzaro.it", + "cb.it", + "ce.it", + "cesena-forli.it", + "cesena-forlì.it", + "cesenaforli.it", + "cesenaforlì.it", + "ch.it", + "chieti.it", + "ci.it", + "cl.it", + "cn.it", + "co.it", + "como.it", + "cosenza.it", + "cr.it", + "cremona.it", + "crotone.it", + "cs.it", + "ct.it", + "cuneo.it", + "cz.it", + "dell-ogliastra.it", + "dellogliastra.it", + "en.it", + "enna.it", + "fc.it", + "fe.it", + "fermo.it", + "ferrara.it", + "fg.it", + "fi.it", + "firenze.it", + "florence.it", + "fm.it", + "foggia.it", + "forli-cesena.it", + "forlì-cesena.it", + "forlicesena.it", + "forlìcesena.it", + "fr.it", + "frosinone.it", + "ge.it", + "genoa.it", + "genova.it", + "go.it", + "gorizia.it", + "gr.it", + "grosseto.it", + "iglesias-carbonia.it", + "iglesiascarbonia.it", + "im.it", + "imperia.it", + "is.it", + "isernia.it", + "kr.it", + "la-spezia.it", + "laquila.it", + "laspezia.it", + "latina.it", + "lc.it", + "le.it", + "lecce.it", + "lecco.it", + "li.it", + "livorno.it", + "lo.it", + "lodi.it", + "lt.it", + "lu.it", + "lucca.it", + "macerata.it", + "mantova.it", + "massa-carrara.it", + "massacarrara.it", + "matera.it", + "mb.it", + "mc.it", + "me.it", + "medio-campidano.it", + "mediocampidano.it", + "messina.it", + "mi.it", + "milan.it", + "milano.it", + "mn.it", + "mo.it", + "modena.it", + "monza-brianza.it", + "monza-e-della-brianza.it", + "monza.it", + "monzabrianza.it", + "monzaebrianza.it", + "monzaedellabrianza.it", + "ms.it", + "mt.it", + "na.it", + "naples.it", + "napoli.it", + "no.it", + "novara.it", + "nu.it", + "nuoro.it", + "og.it", + "ogliastra.it", + "olbia-tempio.it", + "olbiatempio.it", + "or.it", + "oristano.it", + "ot.it", + "pa.it", + "padova.it", + "padua.it", + "palermo.it", + "parma.it", + "pavia.it", + "pc.it", + "pd.it", + "pe.it", + "perugia.it", + "pesaro-urbino.it", + "pesarourbino.it", + "pescara.it", + "pg.it", + "pi.it", + "piacenza.it", + "pisa.it", + "pistoia.it", + "pn.it", + "po.it", + "pordenone.it", + "potenza.it", + "pr.it", + "prato.it", + "pt.it", + "pu.it", + "pv.it", + "pz.it", + "ra.it", + "ragusa.it", + "ravenna.it", + "rc.it", + "re.it", + "reggio-calabria.it", + "reggio-emilia.it", + "reggiocalabria.it", + "reggioemilia.it", + "rg.it", + "ri.it", + "rieti.it", + "rimini.it", + "rm.it", + "rn.it", + "ro.it", + "roma.it", + "rome.it", + "rovigo.it", + "sa.it", + "salerno.it", + "sassari.it", + "savona.it", + "si.it", + "siena.it", + "siracusa.it", + "so.it", + "sondrio.it", + "sp.it", + "sr.it", + "ss.it", + "suedtirol.it", + "südtirol.it", + "sv.it", + "ta.it", + "taranto.it", + "te.it", + "tempio-olbia.it", + "tempioolbia.it", + "teramo.it", + "terni.it", + "tn.it", + "to.it", + "torino.it", + "tp.it", + "tr.it", + "trani-andria-barletta.it", + "trani-barletta-andria.it", + "traniandriabarletta.it", + "tranibarlettaandria.it", + "trapani.it", + "trento.it", + "treviso.it", + "trieste.it", + "ts.it", + "turin.it", + "tv.it", + "ud.it", + "udine.it", + "urbino-pesaro.it", + "urbinopesaro.it", + "va.it", + "varese.it", + "vb.it", + "vc.it", + "ve.it", + "venezia.it", + "venice.it", + "verbania.it", + "vercelli.it", + "verona.it", + "vi.it", + "vibo-valentia.it", + "vibovalentia.it", + "vicenza.it", + "viterbo.it", + "vr.it", + "vs.it", + "vt.it", + "vv.it", + "je", + "co.je", + "net.je", + "org.je", + "*.jm", + "jo", + "com.jo", + "org.jo", + "net.jo", + "edu.jo", + "sch.jo", + "gov.jo", + "mil.jo", + "name.jo", + "jobs", + "jp", + "ac.jp", + "ad.jp", + "co.jp", + "ed.jp", + "go.jp", + "gr.jp", + "lg.jp", + "ne.jp", + "or.jp", + "aichi.jp", + "akita.jp", + "aomori.jp", + "chiba.jp", + "ehime.jp", + "fukui.jp", + "fukuoka.jp", + "fukushima.jp", + "gifu.jp", + "gunma.jp", + "hiroshima.jp", + "hokkaido.jp", + "hyogo.jp", + "ibaraki.jp", + "ishikawa.jp", + "iwate.jp", + "kagawa.jp", + "kagoshima.jp", + "kanagawa.jp", + "kochi.jp", + "kumamoto.jp", + "kyoto.jp", + "mie.jp", + "miyagi.jp", + "miyazaki.jp", + "nagano.jp", + "nagasaki.jp", + "nara.jp", + "niigata.jp", + "oita.jp", + "okayama.jp", + "okinawa.jp", + "osaka.jp", + "saga.jp", + "saitama.jp", + "shiga.jp", + "shimane.jp", + "shizuoka.jp", + "tochigi.jp", + "tokushima.jp", + "tokyo.jp", + "tottori.jp", + "toyama.jp", + "wakayama.jp", + "yamagata.jp", + "yamaguchi.jp", + "yamanashi.jp", + "栃木.jp", + "愛知.jp", + "愛媛.jp", + "兵庫.jp", + "熊本.jp", + "茨城.jp", + "北海道.jp", + "千葉.jp", + "和歌山.jp", + "長崎.jp", + "長野.jp", + "新潟.jp", + "青森.jp", + "静岡.jp", + "東京.jp", + "石川.jp", + "埼玉.jp", + "三重.jp", + "京都.jp", + "佐賀.jp", + "大分.jp", + "大阪.jp", + "奈良.jp", + "宮城.jp", + "宮崎.jp", + "富山.jp", + "山口.jp", + "山形.jp", + "山梨.jp", + "岩手.jp", + "岐阜.jp", + "岡山.jp", + "島根.jp", + "広島.jp", + "徳島.jp", + "沖縄.jp", + "滋賀.jp", + "神奈川.jp", + "福井.jp", + "福岡.jp", + "福島.jp", + "秋田.jp", + "群馬.jp", + "香川.jp", + "高知.jp", + "鳥取.jp", + "鹿児島.jp", + "*.kawasaki.jp", + "*.kitakyushu.jp", + "*.kobe.jp", + "*.nagoya.jp", + "*.sapporo.jp", + "*.sendai.jp", + "*.yokohama.jp", + "!city.kawasaki.jp", + "!city.kitakyushu.jp", + "!city.kobe.jp", + "!city.nagoya.jp", + "!city.sapporo.jp", + "!city.sendai.jp", + "!city.yokohama.jp", + "aisai.aichi.jp", + "ama.aichi.jp", + "anjo.aichi.jp", + "asuke.aichi.jp", + "chiryu.aichi.jp", + "chita.aichi.jp", + "fuso.aichi.jp", + "gamagori.aichi.jp", + "handa.aichi.jp", + "hazu.aichi.jp", + "hekinan.aichi.jp", + "higashiura.aichi.jp", + "ichinomiya.aichi.jp", + "inazawa.aichi.jp", + "inuyama.aichi.jp", + "isshiki.aichi.jp", + "iwakura.aichi.jp", + "kanie.aichi.jp", + "kariya.aichi.jp", + "kasugai.aichi.jp", + "kira.aichi.jp", + "kiyosu.aichi.jp", + "komaki.aichi.jp", + "konan.aichi.jp", + "kota.aichi.jp", + "mihama.aichi.jp", + "miyoshi.aichi.jp", + "nishio.aichi.jp", + "nisshin.aichi.jp", + "obu.aichi.jp", + "oguchi.aichi.jp", + "oharu.aichi.jp", + "okazaki.aichi.jp", + "owariasahi.aichi.jp", + "seto.aichi.jp", + "shikatsu.aichi.jp", + "shinshiro.aichi.jp", + "shitara.aichi.jp", + "tahara.aichi.jp", + "takahama.aichi.jp", + "tobishima.aichi.jp", + "toei.aichi.jp", + "togo.aichi.jp", + "tokai.aichi.jp", + "tokoname.aichi.jp", + "toyoake.aichi.jp", + "toyohashi.aichi.jp", + "toyokawa.aichi.jp", + "toyone.aichi.jp", + "toyota.aichi.jp", + "tsushima.aichi.jp", + "yatomi.aichi.jp", + "akita.akita.jp", + "daisen.akita.jp", + "fujisato.akita.jp", + "gojome.akita.jp", + "hachirogata.akita.jp", + "happou.akita.jp", + "higashinaruse.akita.jp", + "honjo.akita.jp", + "honjyo.akita.jp", + "ikawa.akita.jp", + "kamikoani.akita.jp", + "kamioka.akita.jp", + "katagami.akita.jp", + "kazuno.akita.jp", + "kitaakita.akita.jp", + "kosaka.akita.jp", + "kyowa.akita.jp", + "misato.akita.jp", + "mitane.akita.jp", + "moriyoshi.akita.jp", + "nikaho.akita.jp", + "noshiro.akita.jp", + "odate.akita.jp", + "oga.akita.jp", + "ogata.akita.jp", + "semboku.akita.jp", + "yokote.akita.jp", + "yurihonjo.akita.jp", + "aomori.aomori.jp", + "gonohe.aomori.jp", + "hachinohe.aomori.jp", + "hashikami.aomori.jp", + "hiranai.aomori.jp", + "hirosaki.aomori.jp", + "itayanagi.aomori.jp", + "kuroishi.aomori.jp", + "misawa.aomori.jp", + "mutsu.aomori.jp", + "nakadomari.aomori.jp", + "noheji.aomori.jp", + "oirase.aomori.jp", + "owani.aomori.jp", + "rokunohe.aomori.jp", + "sannohe.aomori.jp", + "shichinohe.aomori.jp", + "shingo.aomori.jp", + "takko.aomori.jp", + "towada.aomori.jp", + "tsugaru.aomori.jp", + "tsuruta.aomori.jp", + "abiko.chiba.jp", + "asahi.chiba.jp", + "chonan.chiba.jp", + "chosei.chiba.jp", + "choshi.chiba.jp", + "chuo.chiba.jp", + "funabashi.chiba.jp", + "futtsu.chiba.jp", + "hanamigawa.chiba.jp", + "ichihara.chiba.jp", + "ichikawa.chiba.jp", + "ichinomiya.chiba.jp", + "inzai.chiba.jp", + "isumi.chiba.jp", + "kamagaya.chiba.jp", + "kamogawa.chiba.jp", + "kashiwa.chiba.jp", + "katori.chiba.jp", + "katsuura.chiba.jp", + "kimitsu.chiba.jp", + "kisarazu.chiba.jp", + "kozaki.chiba.jp", + "kujukuri.chiba.jp", + "kyonan.chiba.jp", + "matsudo.chiba.jp", + "midori.chiba.jp", + "mihama.chiba.jp", + "minamiboso.chiba.jp", + "mobara.chiba.jp", + "mutsuzawa.chiba.jp", + "nagara.chiba.jp", + "nagareyama.chiba.jp", + "narashino.chiba.jp", + "narita.chiba.jp", + "noda.chiba.jp", + "oamishirasato.chiba.jp", + "omigawa.chiba.jp", + "onjuku.chiba.jp", + "otaki.chiba.jp", + "sakae.chiba.jp", + "sakura.chiba.jp", + "shimofusa.chiba.jp", + "shirako.chiba.jp", + "shiroi.chiba.jp", + "shisui.chiba.jp", + "sodegaura.chiba.jp", + "sosa.chiba.jp", + "tako.chiba.jp", + "tateyama.chiba.jp", + "togane.chiba.jp", + "tohnosho.chiba.jp", + "tomisato.chiba.jp", + "urayasu.chiba.jp", + "yachimata.chiba.jp", + "yachiyo.chiba.jp", + "yokaichiba.chiba.jp", + "yokoshibahikari.chiba.jp", + "yotsukaido.chiba.jp", + "ainan.ehime.jp", + "honai.ehime.jp", + "ikata.ehime.jp", + "imabari.ehime.jp", + "iyo.ehime.jp", + "kamijima.ehime.jp", + "kihoku.ehime.jp", + "kumakogen.ehime.jp", + "masaki.ehime.jp", + "matsuno.ehime.jp", + "matsuyama.ehime.jp", + "namikata.ehime.jp", + "niihama.ehime.jp", + "ozu.ehime.jp", + "saijo.ehime.jp", + "seiyo.ehime.jp", + "shikokuchuo.ehime.jp", + "tobe.ehime.jp", + "toon.ehime.jp", + "uchiko.ehime.jp", + "uwajima.ehime.jp", + "yawatahama.ehime.jp", + "echizen.fukui.jp", + "eiheiji.fukui.jp", + "fukui.fukui.jp", + "ikeda.fukui.jp", + "katsuyama.fukui.jp", + "mihama.fukui.jp", + "minamiechizen.fukui.jp", + "obama.fukui.jp", + "ohi.fukui.jp", + "ono.fukui.jp", + "sabae.fukui.jp", + "sakai.fukui.jp", + "takahama.fukui.jp", + "tsuruga.fukui.jp", + "wakasa.fukui.jp", + "ashiya.fukuoka.jp", + "buzen.fukuoka.jp", + "chikugo.fukuoka.jp", + "chikuho.fukuoka.jp", + "chikujo.fukuoka.jp", + "chikushino.fukuoka.jp", + "chikuzen.fukuoka.jp", + "chuo.fukuoka.jp", + "dazaifu.fukuoka.jp", + "fukuchi.fukuoka.jp", + "hakata.fukuoka.jp", + "higashi.fukuoka.jp", + "hirokawa.fukuoka.jp", + "hisayama.fukuoka.jp", + "iizuka.fukuoka.jp", + "inatsuki.fukuoka.jp", + "kaho.fukuoka.jp", + "kasuga.fukuoka.jp", + "kasuya.fukuoka.jp", + "kawara.fukuoka.jp", + "keisen.fukuoka.jp", + "koga.fukuoka.jp", + "kurate.fukuoka.jp", + "kurogi.fukuoka.jp", + "kurume.fukuoka.jp", + "minami.fukuoka.jp", + "miyako.fukuoka.jp", + "miyama.fukuoka.jp", + "miyawaka.fukuoka.jp", + "mizumaki.fukuoka.jp", + "munakata.fukuoka.jp", + "nakagawa.fukuoka.jp", + "nakama.fukuoka.jp", + "nishi.fukuoka.jp", + "nogata.fukuoka.jp", + "ogori.fukuoka.jp", + "okagaki.fukuoka.jp", + "okawa.fukuoka.jp", + "oki.fukuoka.jp", + "omuta.fukuoka.jp", + "onga.fukuoka.jp", + "onojo.fukuoka.jp", + "oto.fukuoka.jp", + "saigawa.fukuoka.jp", + "sasaguri.fukuoka.jp", + "shingu.fukuoka.jp", + "shinyoshitomi.fukuoka.jp", + "shonai.fukuoka.jp", + "soeda.fukuoka.jp", + "sue.fukuoka.jp", + "tachiarai.fukuoka.jp", + "tagawa.fukuoka.jp", + "takata.fukuoka.jp", + "toho.fukuoka.jp", + "toyotsu.fukuoka.jp", + "tsuiki.fukuoka.jp", + "ukiha.fukuoka.jp", + "umi.fukuoka.jp", + "usui.fukuoka.jp", + "yamada.fukuoka.jp", + "yame.fukuoka.jp", + "yanagawa.fukuoka.jp", + "yukuhashi.fukuoka.jp", + "aizubange.fukushima.jp", + "aizumisato.fukushima.jp", + "aizuwakamatsu.fukushima.jp", + "asakawa.fukushima.jp", + "bandai.fukushima.jp", + "date.fukushima.jp", + "fukushima.fukushima.jp", + "furudono.fukushima.jp", + "futaba.fukushima.jp", + "hanawa.fukushima.jp", + "higashi.fukushima.jp", + "hirata.fukushima.jp", + "hirono.fukushima.jp", + "iitate.fukushima.jp", + "inawashiro.fukushima.jp", + "ishikawa.fukushima.jp", + "iwaki.fukushima.jp", + "izumizaki.fukushima.jp", + "kagamiishi.fukushima.jp", + "kaneyama.fukushima.jp", + "kawamata.fukushima.jp", + "kitakata.fukushima.jp", + "kitashiobara.fukushima.jp", + "koori.fukushima.jp", + "koriyama.fukushima.jp", + "kunimi.fukushima.jp", + "miharu.fukushima.jp", + "mishima.fukushima.jp", + "namie.fukushima.jp", + "nango.fukushima.jp", + "nishiaizu.fukushima.jp", + "nishigo.fukushima.jp", + "okuma.fukushima.jp", + "omotego.fukushima.jp", + "ono.fukushima.jp", + "otama.fukushima.jp", + "samegawa.fukushima.jp", + "shimogo.fukushima.jp", + "shirakawa.fukushima.jp", + "showa.fukushima.jp", + "soma.fukushima.jp", + "sukagawa.fukushima.jp", + "taishin.fukushima.jp", + "tamakawa.fukushima.jp", + "tanagura.fukushima.jp", + "tenei.fukushima.jp", + "yabuki.fukushima.jp", + "yamato.fukushima.jp", + "yamatsuri.fukushima.jp", + "yanaizu.fukushima.jp", + "yugawa.fukushima.jp", + "anpachi.gifu.jp", + "ena.gifu.jp", + "gifu.gifu.jp", + "ginan.gifu.jp", + "godo.gifu.jp", + "gujo.gifu.jp", + "hashima.gifu.jp", + "hichiso.gifu.jp", + "hida.gifu.jp", + "higashishirakawa.gifu.jp", + "ibigawa.gifu.jp", + "ikeda.gifu.jp", + "kakamigahara.gifu.jp", + "kani.gifu.jp", + "kasahara.gifu.jp", + "kasamatsu.gifu.jp", + "kawaue.gifu.jp", + "kitagata.gifu.jp", + "mino.gifu.jp", + "minokamo.gifu.jp", + "mitake.gifu.jp", + "mizunami.gifu.jp", + "motosu.gifu.jp", + "nakatsugawa.gifu.jp", + "ogaki.gifu.jp", + "sakahogi.gifu.jp", + "seki.gifu.jp", + "sekigahara.gifu.jp", + "shirakawa.gifu.jp", + "tajimi.gifu.jp", + "takayama.gifu.jp", + "tarui.gifu.jp", + "toki.gifu.jp", + "tomika.gifu.jp", + "wanouchi.gifu.jp", + "yamagata.gifu.jp", + "yaotsu.gifu.jp", + "yoro.gifu.jp", + "annaka.gunma.jp", + "chiyoda.gunma.jp", + "fujioka.gunma.jp", + "higashiagatsuma.gunma.jp", + "isesaki.gunma.jp", + "itakura.gunma.jp", + "kanna.gunma.jp", + "kanra.gunma.jp", + "katashina.gunma.jp", + "kawaba.gunma.jp", + "kiryu.gunma.jp", + "kusatsu.gunma.jp", + "maebashi.gunma.jp", + "meiwa.gunma.jp", + "midori.gunma.jp", + "minakami.gunma.jp", + "naganohara.gunma.jp", + "nakanojo.gunma.jp", + "nanmoku.gunma.jp", + "numata.gunma.jp", + "oizumi.gunma.jp", + "ora.gunma.jp", + "ota.gunma.jp", + "shibukawa.gunma.jp", + "shimonita.gunma.jp", + "shinto.gunma.jp", + "showa.gunma.jp", + "takasaki.gunma.jp", + "takayama.gunma.jp", + "tamamura.gunma.jp", + "tatebayashi.gunma.jp", + "tomioka.gunma.jp", + "tsukiyono.gunma.jp", + "tsumagoi.gunma.jp", + "ueno.gunma.jp", + "yoshioka.gunma.jp", + "asaminami.hiroshima.jp", + "daiwa.hiroshima.jp", + "etajima.hiroshima.jp", + "fuchu.hiroshima.jp", + "fukuyama.hiroshima.jp", + "hatsukaichi.hiroshima.jp", + "higashihiroshima.hiroshima.jp", + "hongo.hiroshima.jp", + "jinsekikogen.hiroshima.jp", + "kaita.hiroshima.jp", + "kui.hiroshima.jp", + "kumano.hiroshima.jp", + "kure.hiroshima.jp", + "mihara.hiroshima.jp", + "miyoshi.hiroshima.jp", + "naka.hiroshima.jp", + "onomichi.hiroshima.jp", + "osakikamijima.hiroshima.jp", + "otake.hiroshima.jp", + "saka.hiroshima.jp", + "sera.hiroshima.jp", + "seranishi.hiroshima.jp", + "shinichi.hiroshima.jp", + "shobara.hiroshima.jp", + "takehara.hiroshima.jp", + "abashiri.hokkaido.jp", + "abira.hokkaido.jp", + "aibetsu.hokkaido.jp", + "akabira.hokkaido.jp", + "akkeshi.hokkaido.jp", + "asahikawa.hokkaido.jp", + "ashibetsu.hokkaido.jp", + "ashoro.hokkaido.jp", + "assabu.hokkaido.jp", + "atsuma.hokkaido.jp", + "bibai.hokkaido.jp", + "biei.hokkaido.jp", + "bifuka.hokkaido.jp", + "bihoro.hokkaido.jp", + "biratori.hokkaido.jp", + "chippubetsu.hokkaido.jp", + "chitose.hokkaido.jp", + "date.hokkaido.jp", + "ebetsu.hokkaido.jp", + "embetsu.hokkaido.jp", + "eniwa.hokkaido.jp", + "erimo.hokkaido.jp", + "esan.hokkaido.jp", + "esashi.hokkaido.jp", + "fukagawa.hokkaido.jp", + "fukushima.hokkaido.jp", + "furano.hokkaido.jp", + "furubira.hokkaido.jp", + "haboro.hokkaido.jp", + "hakodate.hokkaido.jp", + "hamatonbetsu.hokkaido.jp", + "hidaka.hokkaido.jp", + "higashikagura.hokkaido.jp", + "higashikawa.hokkaido.jp", + "hiroo.hokkaido.jp", + "hokuryu.hokkaido.jp", + "hokuto.hokkaido.jp", + "honbetsu.hokkaido.jp", + "horokanai.hokkaido.jp", + "horonobe.hokkaido.jp", + "ikeda.hokkaido.jp", + "imakane.hokkaido.jp", + "ishikari.hokkaido.jp", + "iwamizawa.hokkaido.jp", + "iwanai.hokkaido.jp", + "kamifurano.hokkaido.jp", + "kamikawa.hokkaido.jp", + "kamishihoro.hokkaido.jp", + "kamisunagawa.hokkaido.jp", + "kamoenai.hokkaido.jp", + "kayabe.hokkaido.jp", + "kembuchi.hokkaido.jp", + "kikonai.hokkaido.jp", + "kimobetsu.hokkaido.jp", + "kitahiroshima.hokkaido.jp", + "kitami.hokkaido.jp", + "kiyosato.hokkaido.jp", + "koshimizu.hokkaido.jp", + "kunneppu.hokkaido.jp", + "kuriyama.hokkaido.jp", + "kuromatsunai.hokkaido.jp", + "kushiro.hokkaido.jp", + "kutchan.hokkaido.jp", + "kyowa.hokkaido.jp", + "mashike.hokkaido.jp", + "matsumae.hokkaido.jp", + "mikasa.hokkaido.jp", + "minamifurano.hokkaido.jp", + "mombetsu.hokkaido.jp", + "moseushi.hokkaido.jp", + "mukawa.hokkaido.jp", + "muroran.hokkaido.jp", + "naie.hokkaido.jp", + "nakagawa.hokkaido.jp", + "nakasatsunai.hokkaido.jp", + "nakatombetsu.hokkaido.jp", + "nanae.hokkaido.jp", + "nanporo.hokkaido.jp", + "nayoro.hokkaido.jp", + "nemuro.hokkaido.jp", + "niikappu.hokkaido.jp", + "niki.hokkaido.jp", + "nishiokoppe.hokkaido.jp", + "noboribetsu.hokkaido.jp", + "numata.hokkaido.jp", + "obihiro.hokkaido.jp", + "obira.hokkaido.jp", + "oketo.hokkaido.jp", + "okoppe.hokkaido.jp", + "otaru.hokkaido.jp", + "otobe.hokkaido.jp", + "otofuke.hokkaido.jp", + "otoineppu.hokkaido.jp", + "oumu.hokkaido.jp", + "ozora.hokkaido.jp", + "pippu.hokkaido.jp", + "rankoshi.hokkaido.jp", + "rebun.hokkaido.jp", + "rikubetsu.hokkaido.jp", + "rishiri.hokkaido.jp", + "rishirifuji.hokkaido.jp", + "saroma.hokkaido.jp", + "sarufutsu.hokkaido.jp", + "shakotan.hokkaido.jp", + "shari.hokkaido.jp", + "shibecha.hokkaido.jp", + "shibetsu.hokkaido.jp", + "shikabe.hokkaido.jp", + "shikaoi.hokkaido.jp", + "shimamaki.hokkaido.jp", + "shimizu.hokkaido.jp", + "shimokawa.hokkaido.jp", + "shinshinotsu.hokkaido.jp", + "shintoku.hokkaido.jp", + "shiranuka.hokkaido.jp", + "shiraoi.hokkaido.jp", + "shiriuchi.hokkaido.jp", + "sobetsu.hokkaido.jp", + "sunagawa.hokkaido.jp", + "taiki.hokkaido.jp", + "takasu.hokkaido.jp", + "takikawa.hokkaido.jp", + "takinoue.hokkaido.jp", + "teshikaga.hokkaido.jp", + "tobetsu.hokkaido.jp", + "tohma.hokkaido.jp", + "tomakomai.hokkaido.jp", + "tomari.hokkaido.jp", + "toya.hokkaido.jp", + "toyako.hokkaido.jp", + "toyotomi.hokkaido.jp", + "toyoura.hokkaido.jp", + "tsubetsu.hokkaido.jp", + "tsukigata.hokkaido.jp", + "urakawa.hokkaido.jp", + "urausu.hokkaido.jp", + "uryu.hokkaido.jp", + "utashinai.hokkaido.jp", + "wakkanai.hokkaido.jp", + "wassamu.hokkaido.jp", + "yakumo.hokkaido.jp", + "yoichi.hokkaido.jp", + "aioi.hyogo.jp", + "akashi.hyogo.jp", + "ako.hyogo.jp", + "amagasaki.hyogo.jp", + "aogaki.hyogo.jp", + "asago.hyogo.jp", + "ashiya.hyogo.jp", + "awaji.hyogo.jp", + "fukusaki.hyogo.jp", + "goshiki.hyogo.jp", + "harima.hyogo.jp", + "himeji.hyogo.jp", + "ichikawa.hyogo.jp", + "inagawa.hyogo.jp", + "itami.hyogo.jp", + "kakogawa.hyogo.jp", + "kamigori.hyogo.jp", + "kamikawa.hyogo.jp", + "kasai.hyogo.jp", + "kasuga.hyogo.jp", + "kawanishi.hyogo.jp", + "miki.hyogo.jp", + "minamiawaji.hyogo.jp", + "nishinomiya.hyogo.jp", + "nishiwaki.hyogo.jp", + "ono.hyogo.jp", + "sanda.hyogo.jp", + "sannan.hyogo.jp", + "sasayama.hyogo.jp", + "sayo.hyogo.jp", + "shingu.hyogo.jp", + "shinonsen.hyogo.jp", + "shiso.hyogo.jp", + "sumoto.hyogo.jp", + "taishi.hyogo.jp", + "taka.hyogo.jp", + "takarazuka.hyogo.jp", + "takasago.hyogo.jp", + "takino.hyogo.jp", + "tamba.hyogo.jp", + "tatsuno.hyogo.jp", + "toyooka.hyogo.jp", + "yabu.hyogo.jp", + "yashiro.hyogo.jp", + "yoka.hyogo.jp", + "yokawa.hyogo.jp", + "ami.ibaraki.jp", + "asahi.ibaraki.jp", + "bando.ibaraki.jp", + "chikusei.ibaraki.jp", + "daigo.ibaraki.jp", + "fujishiro.ibaraki.jp", + "hitachi.ibaraki.jp", + "hitachinaka.ibaraki.jp", + "hitachiomiya.ibaraki.jp", + "hitachiota.ibaraki.jp", + "ibaraki.ibaraki.jp", + "ina.ibaraki.jp", + "inashiki.ibaraki.jp", + "itako.ibaraki.jp", + "iwama.ibaraki.jp", + "joso.ibaraki.jp", + "kamisu.ibaraki.jp", + "kasama.ibaraki.jp", + "kashima.ibaraki.jp", + "kasumigaura.ibaraki.jp", + "koga.ibaraki.jp", + "miho.ibaraki.jp", + "mito.ibaraki.jp", + "moriya.ibaraki.jp", + "naka.ibaraki.jp", + "namegata.ibaraki.jp", + "oarai.ibaraki.jp", + "ogawa.ibaraki.jp", + "omitama.ibaraki.jp", + "ryugasaki.ibaraki.jp", + "sakai.ibaraki.jp", + "sakuragawa.ibaraki.jp", + "shimodate.ibaraki.jp", + "shimotsuma.ibaraki.jp", + "shirosato.ibaraki.jp", + "sowa.ibaraki.jp", + "suifu.ibaraki.jp", + "takahagi.ibaraki.jp", + "tamatsukuri.ibaraki.jp", + "tokai.ibaraki.jp", + "tomobe.ibaraki.jp", + "tone.ibaraki.jp", + "toride.ibaraki.jp", + "tsuchiura.ibaraki.jp", + "tsukuba.ibaraki.jp", + "uchihara.ibaraki.jp", + "ushiku.ibaraki.jp", + "yachiyo.ibaraki.jp", + "yamagata.ibaraki.jp", + "yawara.ibaraki.jp", + "yuki.ibaraki.jp", + "anamizu.ishikawa.jp", + "hakui.ishikawa.jp", + "hakusan.ishikawa.jp", + "kaga.ishikawa.jp", + "kahoku.ishikawa.jp", + "kanazawa.ishikawa.jp", + "kawakita.ishikawa.jp", + "komatsu.ishikawa.jp", + "nakanoto.ishikawa.jp", + "nanao.ishikawa.jp", + "nomi.ishikawa.jp", + "nonoichi.ishikawa.jp", + "noto.ishikawa.jp", + "shika.ishikawa.jp", + "suzu.ishikawa.jp", + "tsubata.ishikawa.jp", + "tsurugi.ishikawa.jp", + "uchinada.ishikawa.jp", + "wajima.ishikawa.jp", + "fudai.iwate.jp", + "fujisawa.iwate.jp", + "hanamaki.iwate.jp", + "hiraizumi.iwate.jp", + "hirono.iwate.jp", + "ichinohe.iwate.jp", + "ichinoseki.iwate.jp", + "iwaizumi.iwate.jp", + "iwate.iwate.jp", + "joboji.iwate.jp", + "kamaishi.iwate.jp", + "kanegasaki.iwate.jp", + "karumai.iwate.jp", + "kawai.iwate.jp", + "kitakami.iwate.jp", + "kuji.iwate.jp", + "kunohe.iwate.jp", + "kuzumaki.iwate.jp", + "miyako.iwate.jp", + "mizusawa.iwate.jp", + "morioka.iwate.jp", + "ninohe.iwate.jp", + "noda.iwate.jp", + "ofunato.iwate.jp", + "oshu.iwate.jp", + "otsuchi.iwate.jp", + "rikuzentakata.iwate.jp", + "shiwa.iwate.jp", + "shizukuishi.iwate.jp", + "sumita.iwate.jp", + "tanohata.iwate.jp", + "tono.iwate.jp", + "yahaba.iwate.jp", + "yamada.iwate.jp", + "ayagawa.kagawa.jp", + "higashikagawa.kagawa.jp", + "kanonji.kagawa.jp", + "kotohira.kagawa.jp", + "manno.kagawa.jp", + "marugame.kagawa.jp", + "mitoyo.kagawa.jp", + "naoshima.kagawa.jp", + "sanuki.kagawa.jp", + "tadotsu.kagawa.jp", + "takamatsu.kagawa.jp", + "tonosho.kagawa.jp", + "uchinomi.kagawa.jp", + "utazu.kagawa.jp", + "zentsuji.kagawa.jp", + "akune.kagoshima.jp", + "amami.kagoshima.jp", + "hioki.kagoshima.jp", + "isa.kagoshima.jp", + "isen.kagoshima.jp", + "izumi.kagoshima.jp", + "kagoshima.kagoshima.jp", + "kanoya.kagoshima.jp", + "kawanabe.kagoshima.jp", + "kinko.kagoshima.jp", + "kouyama.kagoshima.jp", + "makurazaki.kagoshima.jp", + "matsumoto.kagoshima.jp", + "minamitane.kagoshima.jp", + "nakatane.kagoshima.jp", + "nishinoomote.kagoshima.jp", + "satsumasendai.kagoshima.jp", + "soo.kagoshima.jp", + "tarumizu.kagoshima.jp", + "yusui.kagoshima.jp", + "aikawa.kanagawa.jp", + "atsugi.kanagawa.jp", + "ayase.kanagawa.jp", + "chigasaki.kanagawa.jp", + "ebina.kanagawa.jp", + "fujisawa.kanagawa.jp", + "hadano.kanagawa.jp", + "hakone.kanagawa.jp", + "hiratsuka.kanagawa.jp", + "isehara.kanagawa.jp", + "kaisei.kanagawa.jp", + "kamakura.kanagawa.jp", + "kiyokawa.kanagawa.jp", + "matsuda.kanagawa.jp", + "minamiashigara.kanagawa.jp", + "miura.kanagawa.jp", + "nakai.kanagawa.jp", + "ninomiya.kanagawa.jp", + "odawara.kanagawa.jp", + "oi.kanagawa.jp", + "oiso.kanagawa.jp", + "sagamihara.kanagawa.jp", + "samukawa.kanagawa.jp", + "tsukui.kanagawa.jp", + "yamakita.kanagawa.jp", + "yamato.kanagawa.jp", + "yokosuka.kanagawa.jp", + "yugawara.kanagawa.jp", + "zama.kanagawa.jp", + "zushi.kanagawa.jp", + "aki.kochi.jp", + "geisei.kochi.jp", + "hidaka.kochi.jp", + "higashitsuno.kochi.jp", + "ino.kochi.jp", + "kagami.kochi.jp", + "kami.kochi.jp", + "kitagawa.kochi.jp", + "kochi.kochi.jp", + "mihara.kochi.jp", + "motoyama.kochi.jp", + "muroto.kochi.jp", + "nahari.kochi.jp", + "nakamura.kochi.jp", + "nankoku.kochi.jp", + "nishitosa.kochi.jp", + "niyodogawa.kochi.jp", + "ochi.kochi.jp", + "okawa.kochi.jp", + "otoyo.kochi.jp", + "otsuki.kochi.jp", + "sakawa.kochi.jp", + "sukumo.kochi.jp", + "susaki.kochi.jp", + "tosa.kochi.jp", + "tosashimizu.kochi.jp", + "toyo.kochi.jp", + "tsuno.kochi.jp", + "umaji.kochi.jp", + "yasuda.kochi.jp", + "yusuhara.kochi.jp", + "amakusa.kumamoto.jp", + "arao.kumamoto.jp", + "aso.kumamoto.jp", + "choyo.kumamoto.jp", + "gyokuto.kumamoto.jp", + "kamiamakusa.kumamoto.jp", + "kikuchi.kumamoto.jp", + "kumamoto.kumamoto.jp", + "mashiki.kumamoto.jp", + "mifune.kumamoto.jp", + "minamata.kumamoto.jp", + "minamioguni.kumamoto.jp", + "nagasu.kumamoto.jp", + "nishihara.kumamoto.jp", + "oguni.kumamoto.jp", + "ozu.kumamoto.jp", + "sumoto.kumamoto.jp", + "takamori.kumamoto.jp", + "uki.kumamoto.jp", + "uto.kumamoto.jp", + "yamaga.kumamoto.jp", + "yamato.kumamoto.jp", + "yatsushiro.kumamoto.jp", + "ayabe.kyoto.jp", + "fukuchiyama.kyoto.jp", + "higashiyama.kyoto.jp", + "ide.kyoto.jp", + "ine.kyoto.jp", + "joyo.kyoto.jp", + "kameoka.kyoto.jp", + "kamo.kyoto.jp", + "kita.kyoto.jp", + "kizu.kyoto.jp", + "kumiyama.kyoto.jp", + "kyotamba.kyoto.jp", + "kyotanabe.kyoto.jp", + "kyotango.kyoto.jp", + "maizuru.kyoto.jp", + "minami.kyoto.jp", + "minamiyamashiro.kyoto.jp", + "miyazu.kyoto.jp", + "muko.kyoto.jp", + "nagaokakyo.kyoto.jp", + "nakagyo.kyoto.jp", + "nantan.kyoto.jp", + "oyamazaki.kyoto.jp", + "sakyo.kyoto.jp", + "seika.kyoto.jp", + "tanabe.kyoto.jp", + "uji.kyoto.jp", + "ujitawara.kyoto.jp", + "wazuka.kyoto.jp", + "yamashina.kyoto.jp", + "yawata.kyoto.jp", + "asahi.mie.jp", + "inabe.mie.jp", + "ise.mie.jp", + "kameyama.mie.jp", + "kawagoe.mie.jp", + "kiho.mie.jp", + "kisosaki.mie.jp", + "kiwa.mie.jp", + "komono.mie.jp", + "kumano.mie.jp", + "kuwana.mie.jp", + "matsusaka.mie.jp", + "meiwa.mie.jp", + "mihama.mie.jp", + "minamiise.mie.jp", + "misugi.mie.jp", + "miyama.mie.jp", + "nabari.mie.jp", + "shima.mie.jp", + "suzuka.mie.jp", + "tado.mie.jp", + "taiki.mie.jp", + "taki.mie.jp", + "tamaki.mie.jp", + "toba.mie.jp", + "tsu.mie.jp", + "udono.mie.jp", + "ureshino.mie.jp", + "watarai.mie.jp", + "yokkaichi.mie.jp", + "furukawa.miyagi.jp", + "higashimatsushima.miyagi.jp", + "ishinomaki.miyagi.jp", + "iwanuma.miyagi.jp", + "kakuda.miyagi.jp", + "kami.miyagi.jp", + "kawasaki.miyagi.jp", + "marumori.miyagi.jp", + "matsushima.miyagi.jp", + "minamisanriku.miyagi.jp", + "misato.miyagi.jp", + "murata.miyagi.jp", + "natori.miyagi.jp", + "ogawara.miyagi.jp", + "ohira.miyagi.jp", + "onagawa.miyagi.jp", + "osaki.miyagi.jp", + "rifu.miyagi.jp", + "semine.miyagi.jp", + "shibata.miyagi.jp", + "shichikashuku.miyagi.jp", + "shikama.miyagi.jp", + "shiogama.miyagi.jp", + "shiroishi.miyagi.jp", + "tagajo.miyagi.jp", + "taiwa.miyagi.jp", + "tome.miyagi.jp", + "tomiya.miyagi.jp", + "wakuya.miyagi.jp", + "watari.miyagi.jp", + "yamamoto.miyagi.jp", + "zao.miyagi.jp", + "aya.miyazaki.jp", + "ebino.miyazaki.jp", + "gokase.miyazaki.jp", + "hyuga.miyazaki.jp", + "kadogawa.miyazaki.jp", + "kawaminami.miyazaki.jp", + "kijo.miyazaki.jp", + "kitagawa.miyazaki.jp", + "kitakata.miyazaki.jp", + "kitaura.miyazaki.jp", + "kobayashi.miyazaki.jp", + "kunitomi.miyazaki.jp", + "kushima.miyazaki.jp", + "mimata.miyazaki.jp", + "miyakonojo.miyazaki.jp", + "miyazaki.miyazaki.jp", + "morotsuka.miyazaki.jp", + "nichinan.miyazaki.jp", + "nishimera.miyazaki.jp", + "nobeoka.miyazaki.jp", + "saito.miyazaki.jp", + "shiiba.miyazaki.jp", + "shintomi.miyazaki.jp", + "takaharu.miyazaki.jp", + "takanabe.miyazaki.jp", + "takazaki.miyazaki.jp", + "tsuno.miyazaki.jp", + "achi.nagano.jp", + "agematsu.nagano.jp", + "anan.nagano.jp", + "aoki.nagano.jp", + "asahi.nagano.jp", + "azumino.nagano.jp", + "chikuhoku.nagano.jp", + "chikuma.nagano.jp", + "chino.nagano.jp", + "fujimi.nagano.jp", + "hakuba.nagano.jp", + "hara.nagano.jp", + "hiraya.nagano.jp", + "iida.nagano.jp", + "iijima.nagano.jp", + "iiyama.nagano.jp", + "iizuna.nagano.jp", + "ikeda.nagano.jp", + "ikusaka.nagano.jp", + "ina.nagano.jp", + "karuizawa.nagano.jp", + "kawakami.nagano.jp", + "kiso.nagano.jp", + "kisofukushima.nagano.jp", + "kitaaiki.nagano.jp", + "komagane.nagano.jp", + "komoro.nagano.jp", + "matsukawa.nagano.jp", + "matsumoto.nagano.jp", + "miasa.nagano.jp", + "minamiaiki.nagano.jp", + "minamimaki.nagano.jp", + "minamiminowa.nagano.jp", + "minowa.nagano.jp", + "miyada.nagano.jp", + "miyota.nagano.jp", + "mochizuki.nagano.jp", + "nagano.nagano.jp", + "nagawa.nagano.jp", + "nagiso.nagano.jp", + "nakagawa.nagano.jp", + "nakano.nagano.jp", + "nozawaonsen.nagano.jp", + "obuse.nagano.jp", + "ogawa.nagano.jp", + "okaya.nagano.jp", + "omachi.nagano.jp", + "omi.nagano.jp", + "ookuwa.nagano.jp", + "ooshika.nagano.jp", + "otaki.nagano.jp", + "otari.nagano.jp", + "sakae.nagano.jp", + "sakaki.nagano.jp", + "saku.nagano.jp", + "sakuho.nagano.jp", + "shimosuwa.nagano.jp", + "shinanomachi.nagano.jp", + "shiojiri.nagano.jp", + "suwa.nagano.jp", + "suzaka.nagano.jp", + "takagi.nagano.jp", + "takamori.nagano.jp", + "takayama.nagano.jp", + "tateshina.nagano.jp", + "tatsuno.nagano.jp", + "togakushi.nagano.jp", + "togura.nagano.jp", + "tomi.nagano.jp", + "ueda.nagano.jp", + "wada.nagano.jp", + "yamagata.nagano.jp", + "yamanouchi.nagano.jp", + "yasaka.nagano.jp", + "yasuoka.nagano.jp", + "chijiwa.nagasaki.jp", + "futsu.nagasaki.jp", + "goto.nagasaki.jp", + "hasami.nagasaki.jp", + "hirado.nagasaki.jp", + "iki.nagasaki.jp", + "isahaya.nagasaki.jp", + "kawatana.nagasaki.jp", + "kuchinotsu.nagasaki.jp", + "matsuura.nagasaki.jp", + "nagasaki.nagasaki.jp", + "obama.nagasaki.jp", + "omura.nagasaki.jp", + "oseto.nagasaki.jp", + "saikai.nagasaki.jp", + "sasebo.nagasaki.jp", + "seihi.nagasaki.jp", + "shimabara.nagasaki.jp", + "shinkamigoto.nagasaki.jp", + "togitsu.nagasaki.jp", + "tsushima.nagasaki.jp", + "unzen.nagasaki.jp", + "ando.nara.jp", + "gose.nara.jp", + "heguri.nara.jp", + "higashiyoshino.nara.jp", + "ikaruga.nara.jp", + "ikoma.nara.jp", + "kamikitayama.nara.jp", + "kanmaki.nara.jp", + "kashiba.nara.jp", + "kashihara.nara.jp", + "katsuragi.nara.jp", + "kawai.nara.jp", + "kawakami.nara.jp", + "kawanishi.nara.jp", + "koryo.nara.jp", + "kurotaki.nara.jp", + "mitsue.nara.jp", + "miyake.nara.jp", + "nara.nara.jp", + "nosegawa.nara.jp", + "oji.nara.jp", + "ouda.nara.jp", + "oyodo.nara.jp", + "sakurai.nara.jp", + "sango.nara.jp", + "shimoichi.nara.jp", + "shimokitayama.nara.jp", + "shinjo.nara.jp", + "soni.nara.jp", + "takatori.nara.jp", + "tawaramoto.nara.jp", + "tenkawa.nara.jp", + "tenri.nara.jp", + "uda.nara.jp", + "yamatokoriyama.nara.jp", + "yamatotakada.nara.jp", + "yamazoe.nara.jp", + "yoshino.nara.jp", + "aga.niigata.jp", + "agano.niigata.jp", + "gosen.niigata.jp", + "itoigawa.niigata.jp", + "izumozaki.niigata.jp", + "joetsu.niigata.jp", + "kamo.niigata.jp", + "kariwa.niigata.jp", + "kashiwazaki.niigata.jp", + "minamiuonuma.niigata.jp", + "mitsuke.niigata.jp", + "muika.niigata.jp", + "murakami.niigata.jp", + "myoko.niigata.jp", + "nagaoka.niigata.jp", + "niigata.niigata.jp", + "ojiya.niigata.jp", + "omi.niigata.jp", + "sado.niigata.jp", + "sanjo.niigata.jp", + "seiro.niigata.jp", + "seirou.niigata.jp", + "sekikawa.niigata.jp", + "shibata.niigata.jp", + "tagami.niigata.jp", + "tainai.niigata.jp", + "tochio.niigata.jp", + "tokamachi.niigata.jp", + "tsubame.niigata.jp", + "tsunan.niigata.jp", + "uonuma.niigata.jp", + "yahiko.niigata.jp", + "yoita.niigata.jp", + "yuzawa.niigata.jp", + "beppu.oita.jp", + "bungoono.oita.jp", + "bungotakada.oita.jp", + "hasama.oita.jp", + "hiji.oita.jp", + "himeshima.oita.jp", + "hita.oita.jp", + "kamitsue.oita.jp", + "kokonoe.oita.jp", + "kuju.oita.jp", + "kunisaki.oita.jp", + "kusu.oita.jp", + "oita.oita.jp", + "saiki.oita.jp", + "taketa.oita.jp", + "tsukumi.oita.jp", + "usa.oita.jp", + "usuki.oita.jp", + "yufu.oita.jp", + "akaiwa.okayama.jp", + "asakuchi.okayama.jp", + "bizen.okayama.jp", + "hayashima.okayama.jp", + "ibara.okayama.jp", + "kagamino.okayama.jp", + "kasaoka.okayama.jp", + "kibichuo.okayama.jp", + "kumenan.okayama.jp", + "kurashiki.okayama.jp", + "maniwa.okayama.jp", + "misaki.okayama.jp", + "nagi.okayama.jp", + "niimi.okayama.jp", + "nishiawakura.okayama.jp", + "okayama.okayama.jp", + "satosho.okayama.jp", + "setouchi.okayama.jp", + "shinjo.okayama.jp", + "shoo.okayama.jp", + "soja.okayama.jp", + "takahashi.okayama.jp", + "tamano.okayama.jp", + "tsuyama.okayama.jp", + "wake.okayama.jp", + "yakage.okayama.jp", + "aguni.okinawa.jp", + "ginowan.okinawa.jp", + "ginoza.okinawa.jp", + "gushikami.okinawa.jp", + "haebaru.okinawa.jp", + "higashi.okinawa.jp", + "hirara.okinawa.jp", + "iheya.okinawa.jp", + "ishigaki.okinawa.jp", + "ishikawa.okinawa.jp", + "itoman.okinawa.jp", + "izena.okinawa.jp", + "kadena.okinawa.jp", + "kin.okinawa.jp", + "kitadaito.okinawa.jp", + "kitanakagusuku.okinawa.jp", + "kumejima.okinawa.jp", + "kunigami.okinawa.jp", + "minamidaito.okinawa.jp", + "motobu.okinawa.jp", + "nago.okinawa.jp", + "naha.okinawa.jp", + "nakagusuku.okinawa.jp", + "nakijin.okinawa.jp", + "nanjo.okinawa.jp", + "nishihara.okinawa.jp", + "ogimi.okinawa.jp", + "okinawa.okinawa.jp", + "onna.okinawa.jp", + "shimoji.okinawa.jp", + "taketomi.okinawa.jp", + "tarama.okinawa.jp", + "tokashiki.okinawa.jp", + "tomigusuku.okinawa.jp", + "tonaki.okinawa.jp", + "urasoe.okinawa.jp", + "uruma.okinawa.jp", + "yaese.okinawa.jp", + "yomitan.okinawa.jp", + "yonabaru.okinawa.jp", + "yonaguni.okinawa.jp", + "zamami.okinawa.jp", + "abeno.osaka.jp", + "chihayaakasaka.osaka.jp", + "chuo.osaka.jp", + "daito.osaka.jp", + "fujiidera.osaka.jp", + "habikino.osaka.jp", + "hannan.osaka.jp", + "higashiosaka.osaka.jp", + "higashisumiyoshi.osaka.jp", + "higashiyodogawa.osaka.jp", + "hirakata.osaka.jp", + "ibaraki.osaka.jp", + "ikeda.osaka.jp", + "izumi.osaka.jp", + "izumiotsu.osaka.jp", + "izumisano.osaka.jp", + "kadoma.osaka.jp", + "kaizuka.osaka.jp", + "kanan.osaka.jp", + "kashiwara.osaka.jp", + "katano.osaka.jp", + "kawachinagano.osaka.jp", + "kishiwada.osaka.jp", + "kita.osaka.jp", + "kumatori.osaka.jp", + "matsubara.osaka.jp", + "minato.osaka.jp", + "minoh.osaka.jp", + "misaki.osaka.jp", + "moriguchi.osaka.jp", + "neyagawa.osaka.jp", + "nishi.osaka.jp", + "nose.osaka.jp", + "osakasayama.osaka.jp", + "sakai.osaka.jp", + "sayama.osaka.jp", + "sennan.osaka.jp", + "settsu.osaka.jp", + "shijonawate.osaka.jp", + "shimamoto.osaka.jp", + "suita.osaka.jp", + "tadaoka.osaka.jp", + "taishi.osaka.jp", + "tajiri.osaka.jp", + "takaishi.osaka.jp", + "takatsuki.osaka.jp", + "tondabayashi.osaka.jp", + "toyonaka.osaka.jp", + "toyono.osaka.jp", + "yao.osaka.jp", + "ariake.saga.jp", + "arita.saga.jp", + "fukudomi.saga.jp", + "genkai.saga.jp", + "hamatama.saga.jp", + "hizen.saga.jp", + "imari.saga.jp", + "kamimine.saga.jp", + "kanzaki.saga.jp", + "karatsu.saga.jp", + "kashima.saga.jp", + "kitagata.saga.jp", + "kitahata.saga.jp", + "kiyama.saga.jp", + "kouhoku.saga.jp", + "kyuragi.saga.jp", + "nishiarita.saga.jp", + "ogi.saga.jp", + "omachi.saga.jp", + "ouchi.saga.jp", + "saga.saga.jp", + "shiroishi.saga.jp", + "taku.saga.jp", + "tara.saga.jp", + "tosu.saga.jp", + "yoshinogari.saga.jp", + "arakawa.saitama.jp", + "asaka.saitama.jp", + "chichibu.saitama.jp", + "fujimi.saitama.jp", + "fujimino.saitama.jp", + "fukaya.saitama.jp", + "hanno.saitama.jp", + "hanyu.saitama.jp", + "hasuda.saitama.jp", + "hatogaya.saitama.jp", + "hatoyama.saitama.jp", + "hidaka.saitama.jp", + "higashichichibu.saitama.jp", + "higashimatsuyama.saitama.jp", + "honjo.saitama.jp", + "ina.saitama.jp", + "iruma.saitama.jp", + "iwatsuki.saitama.jp", + "kamiizumi.saitama.jp", + "kamikawa.saitama.jp", + "kamisato.saitama.jp", + "kasukabe.saitama.jp", + "kawagoe.saitama.jp", + "kawaguchi.saitama.jp", + "kawajima.saitama.jp", + "kazo.saitama.jp", + "kitamoto.saitama.jp", + "koshigaya.saitama.jp", + "kounosu.saitama.jp", + "kuki.saitama.jp", + "kumagaya.saitama.jp", + "matsubushi.saitama.jp", + "minano.saitama.jp", + "misato.saitama.jp", + "miyashiro.saitama.jp", + "miyoshi.saitama.jp", + "moroyama.saitama.jp", + "nagatoro.saitama.jp", + "namegawa.saitama.jp", + "niiza.saitama.jp", + "ogano.saitama.jp", + "ogawa.saitama.jp", + "ogose.saitama.jp", + "okegawa.saitama.jp", + "omiya.saitama.jp", + "otaki.saitama.jp", + "ranzan.saitama.jp", + "ryokami.saitama.jp", + "saitama.saitama.jp", + "sakado.saitama.jp", + "satte.saitama.jp", + "sayama.saitama.jp", + "shiki.saitama.jp", + "shiraoka.saitama.jp", + "soka.saitama.jp", + "sugito.saitama.jp", + "toda.saitama.jp", + "tokigawa.saitama.jp", + "tokorozawa.saitama.jp", + "tsurugashima.saitama.jp", + "urawa.saitama.jp", + "warabi.saitama.jp", + "yashio.saitama.jp", + "yokoze.saitama.jp", + "yono.saitama.jp", + "yorii.saitama.jp", + "yoshida.saitama.jp", + "yoshikawa.saitama.jp", + "yoshimi.saitama.jp", + "aisho.shiga.jp", + "gamo.shiga.jp", + "higashiomi.shiga.jp", + "hikone.shiga.jp", + "koka.shiga.jp", + "konan.shiga.jp", + "kosei.shiga.jp", + "koto.shiga.jp", + "kusatsu.shiga.jp", + "maibara.shiga.jp", + "moriyama.shiga.jp", + "nagahama.shiga.jp", + "nishiazai.shiga.jp", + "notogawa.shiga.jp", + "omihachiman.shiga.jp", + "otsu.shiga.jp", + "ritto.shiga.jp", + "ryuoh.shiga.jp", + "takashima.shiga.jp", + "takatsuki.shiga.jp", + "torahime.shiga.jp", + "toyosato.shiga.jp", + "yasu.shiga.jp", + "akagi.shimane.jp", + "ama.shimane.jp", + "gotsu.shimane.jp", + "hamada.shimane.jp", + "higashiizumo.shimane.jp", + "hikawa.shimane.jp", + "hikimi.shimane.jp", + "izumo.shimane.jp", + "kakinoki.shimane.jp", + "masuda.shimane.jp", + "matsue.shimane.jp", + "misato.shimane.jp", + "nishinoshima.shimane.jp", + "ohda.shimane.jp", + "okinoshima.shimane.jp", + "okuizumo.shimane.jp", + "shimane.shimane.jp", + "tamayu.shimane.jp", + "tsuwano.shimane.jp", + "unnan.shimane.jp", + "yakumo.shimane.jp", + "yasugi.shimane.jp", + "yatsuka.shimane.jp", + "arai.shizuoka.jp", + "atami.shizuoka.jp", + "fuji.shizuoka.jp", + "fujieda.shizuoka.jp", + "fujikawa.shizuoka.jp", + "fujinomiya.shizuoka.jp", + "fukuroi.shizuoka.jp", + "gotemba.shizuoka.jp", + "haibara.shizuoka.jp", + "hamamatsu.shizuoka.jp", + "higashiizu.shizuoka.jp", + "ito.shizuoka.jp", + "iwata.shizuoka.jp", + "izu.shizuoka.jp", + "izunokuni.shizuoka.jp", + "kakegawa.shizuoka.jp", + "kannami.shizuoka.jp", + "kawanehon.shizuoka.jp", + "kawazu.shizuoka.jp", + "kikugawa.shizuoka.jp", + "kosai.shizuoka.jp", + "makinohara.shizuoka.jp", + "matsuzaki.shizuoka.jp", + "minamiizu.shizuoka.jp", + "mishima.shizuoka.jp", + "morimachi.shizuoka.jp", + "nishiizu.shizuoka.jp", + "numazu.shizuoka.jp", + "omaezaki.shizuoka.jp", + "shimada.shizuoka.jp", + "shimizu.shizuoka.jp", + "shimoda.shizuoka.jp", + "shizuoka.shizuoka.jp", + "susono.shizuoka.jp", + "yaizu.shizuoka.jp", + "yoshida.shizuoka.jp", + "ashikaga.tochigi.jp", + "bato.tochigi.jp", + "haga.tochigi.jp", + "ichikai.tochigi.jp", + "iwafune.tochigi.jp", + "kaminokawa.tochigi.jp", + "kanuma.tochigi.jp", + "karasuyama.tochigi.jp", + "kuroiso.tochigi.jp", + "mashiko.tochigi.jp", + "mibu.tochigi.jp", + "moka.tochigi.jp", + "motegi.tochigi.jp", + "nasu.tochigi.jp", + "nasushiobara.tochigi.jp", + "nikko.tochigi.jp", + "nishikata.tochigi.jp", + "nogi.tochigi.jp", + "ohira.tochigi.jp", + "ohtawara.tochigi.jp", + "oyama.tochigi.jp", + "sakura.tochigi.jp", + "sano.tochigi.jp", + "shimotsuke.tochigi.jp", + "shioya.tochigi.jp", + "takanezawa.tochigi.jp", + "tochigi.tochigi.jp", + "tsuga.tochigi.jp", + "ujiie.tochigi.jp", + "utsunomiya.tochigi.jp", + "yaita.tochigi.jp", + "aizumi.tokushima.jp", + "anan.tokushima.jp", + "ichiba.tokushima.jp", + "itano.tokushima.jp", + "kainan.tokushima.jp", + "komatsushima.tokushima.jp", + "matsushige.tokushima.jp", + "mima.tokushima.jp", + "minami.tokushima.jp", + "miyoshi.tokushima.jp", + "mugi.tokushima.jp", + "nakagawa.tokushima.jp", + "naruto.tokushima.jp", + "sanagochi.tokushima.jp", + "shishikui.tokushima.jp", + "tokushima.tokushima.jp", + "wajiki.tokushima.jp", + "adachi.tokyo.jp", + "akiruno.tokyo.jp", + "akishima.tokyo.jp", + "aogashima.tokyo.jp", + "arakawa.tokyo.jp", + "bunkyo.tokyo.jp", + "chiyoda.tokyo.jp", + "chofu.tokyo.jp", + "chuo.tokyo.jp", + "edogawa.tokyo.jp", + "fuchu.tokyo.jp", + "fussa.tokyo.jp", + "hachijo.tokyo.jp", + "hachioji.tokyo.jp", + "hamura.tokyo.jp", + "higashikurume.tokyo.jp", + "higashimurayama.tokyo.jp", + "higashiyamato.tokyo.jp", + "hino.tokyo.jp", + "hinode.tokyo.jp", + "hinohara.tokyo.jp", + "inagi.tokyo.jp", + "itabashi.tokyo.jp", + "katsushika.tokyo.jp", + "kita.tokyo.jp", + "kiyose.tokyo.jp", + "kodaira.tokyo.jp", + "koganei.tokyo.jp", + "kokubunji.tokyo.jp", + "komae.tokyo.jp", + "koto.tokyo.jp", + "kouzushima.tokyo.jp", + "kunitachi.tokyo.jp", + "machida.tokyo.jp", + "meguro.tokyo.jp", + "minato.tokyo.jp", + "mitaka.tokyo.jp", + "mizuho.tokyo.jp", + "musashimurayama.tokyo.jp", + "musashino.tokyo.jp", + "nakano.tokyo.jp", + "nerima.tokyo.jp", + "ogasawara.tokyo.jp", + "okutama.tokyo.jp", + "ome.tokyo.jp", + "oshima.tokyo.jp", + "ota.tokyo.jp", + "setagaya.tokyo.jp", + "shibuya.tokyo.jp", + "shinagawa.tokyo.jp", + "shinjuku.tokyo.jp", + "suginami.tokyo.jp", + "sumida.tokyo.jp", + "tachikawa.tokyo.jp", + "taito.tokyo.jp", + "tama.tokyo.jp", + "toshima.tokyo.jp", + "chizu.tottori.jp", + "hino.tottori.jp", + "kawahara.tottori.jp", + "koge.tottori.jp", + "kotoura.tottori.jp", + "misasa.tottori.jp", + "nanbu.tottori.jp", + "nichinan.tottori.jp", + "sakaiminato.tottori.jp", + "tottori.tottori.jp", + "wakasa.tottori.jp", + "yazu.tottori.jp", + "yonago.tottori.jp", + "asahi.toyama.jp", + "fuchu.toyama.jp", + "fukumitsu.toyama.jp", + "funahashi.toyama.jp", + "himi.toyama.jp", + "imizu.toyama.jp", + "inami.toyama.jp", + "johana.toyama.jp", + "kamiichi.toyama.jp", + "kurobe.toyama.jp", + "nakaniikawa.toyama.jp", + "namerikawa.toyama.jp", + "nanto.toyama.jp", + "nyuzen.toyama.jp", + "oyabe.toyama.jp", + "taira.toyama.jp", + "takaoka.toyama.jp", + "tateyama.toyama.jp", + "toga.toyama.jp", + "tonami.toyama.jp", + "toyama.toyama.jp", + "unazuki.toyama.jp", + "uozu.toyama.jp", + "yamada.toyama.jp", + "arida.wakayama.jp", + "aridagawa.wakayama.jp", + "gobo.wakayama.jp", + "hashimoto.wakayama.jp", + "hidaka.wakayama.jp", + "hirogawa.wakayama.jp", + "inami.wakayama.jp", + "iwade.wakayama.jp", + "kainan.wakayama.jp", + "kamitonda.wakayama.jp", + "katsuragi.wakayama.jp", + "kimino.wakayama.jp", + "kinokawa.wakayama.jp", + "kitayama.wakayama.jp", + "koya.wakayama.jp", + "koza.wakayama.jp", + "kozagawa.wakayama.jp", + "kudoyama.wakayama.jp", + "kushimoto.wakayama.jp", + "mihama.wakayama.jp", + "misato.wakayama.jp", + "nachikatsuura.wakayama.jp", + "shingu.wakayama.jp", + "shirahama.wakayama.jp", + "taiji.wakayama.jp", + "tanabe.wakayama.jp", + "wakayama.wakayama.jp", + "yuasa.wakayama.jp", + "yura.wakayama.jp", + "asahi.yamagata.jp", + "funagata.yamagata.jp", + "higashine.yamagata.jp", + "iide.yamagata.jp", + "kahoku.yamagata.jp", + "kaminoyama.yamagata.jp", + "kaneyama.yamagata.jp", + "kawanishi.yamagata.jp", + "mamurogawa.yamagata.jp", + "mikawa.yamagata.jp", + "murayama.yamagata.jp", + "nagai.yamagata.jp", + "nakayama.yamagata.jp", + "nanyo.yamagata.jp", + "nishikawa.yamagata.jp", + "obanazawa.yamagata.jp", + "oe.yamagata.jp", + "oguni.yamagata.jp", + "ohkura.yamagata.jp", + "oishida.yamagata.jp", + "sagae.yamagata.jp", + "sakata.yamagata.jp", + "sakegawa.yamagata.jp", + "shinjo.yamagata.jp", + "shirataka.yamagata.jp", + "shonai.yamagata.jp", + "takahata.yamagata.jp", + "tendo.yamagata.jp", + "tozawa.yamagata.jp", + "tsuruoka.yamagata.jp", + "yamagata.yamagata.jp", + "yamanobe.yamagata.jp", + "yonezawa.yamagata.jp", + "yuza.yamagata.jp", + "abu.yamaguchi.jp", + "hagi.yamaguchi.jp", + "hikari.yamaguchi.jp", + "hofu.yamaguchi.jp", + "iwakuni.yamaguchi.jp", + "kudamatsu.yamaguchi.jp", + "mitou.yamaguchi.jp", + "nagato.yamaguchi.jp", + "oshima.yamaguchi.jp", + "shimonoseki.yamaguchi.jp", + "shunan.yamaguchi.jp", + "tabuse.yamaguchi.jp", + "tokuyama.yamaguchi.jp", + "toyota.yamaguchi.jp", + "ube.yamaguchi.jp", + "yuu.yamaguchi.jp", + "chuo.yamanashi.jp", + "doshi.yamanashi.jp", + "fuefuki.yamanashi.jp", + "fujikawa.yamanashi.jp", + "fujikawaguchiko.yamanashi.jp", + "fujiyoshida.yamanashi.jp", + "hayakawa.yamanashi.jp", + "hokuto.yamanashi.jp", + "ichikawamisato.yamanashi.jp", + "kai.yamanashi.jp", + "kofu.yamanashi.jp", + "koshu.yamanashi.jp", + "kosuge.yamanashi.jp", + "minami-alps.yamanashi.jp", + "minobu.yamanashi.jp", + "nakamichi.yamanashi.jp", + "nanbu.yamanashi.jp", + "narusawa.yamanashi.jp", + "nirasaki.yamanashi.jp", + "nishikatsura.yamanashi.jp", + "oshino.yamanashi.jp", + "otsuki.yamanashi.jp", + "showa.yamanashi.jp", + "tabayama.yamanashi.jp", + "tsuru.yamanashi.jp", + "uenohara.yamanashi.jp", + "yamanakako.yamanashi.jp", + "yamanashi.yamanashi.jp", + "ke", + "ac.ke", + "co.ke", + "go.ke", + "info.ke", + "me.ke", + "mobi.ke", + "ne.ke", + "or.ke", + "sc.ke", + "kg", + "org.kg", + "net.kg", + "com.kg", + "edu.kg", + "gov.kg", + "mil.kg", + "*.kh", + "ki", + "edu.ki", + "biz.ki", + "net.ki", + "org.ki", + "gov.ki", + "info.ki", + "com.ki", + "km", + "org.km", + "nom.km", + "gov.km", + "prd.km", + "tm.km", + "edu.km", + "mil.km", + "ass.km", + "com.km", + "coop.km", + "asso.km", + "presse.km", + "medecin.km", + "notaires.km", + "pharmaciens.km", + "veterinaire.km", + "gouv.km", + "kn", + "net.kn", + "org.kn", + "edu.kn", + "gov.kn", + "kp", + "com.kp", + "edu.kp", + "gov.kp", + "org.kp", + "rep.kp", + "tra.kp", + "kr", + "ac.kr", + "co.kr", + "es.kr", + "go.kr", + "hs.kr", + "kg.kr", + "mil.kr", + "ms.kr", + "ne.kr", + "or.kr", + "pe.kr", + "re.kr", + "sc.kr", + "busan.kr", + "chungbuk.kr", + "chungnam.kr", + "daegu.kr", + "daejeon.kr", + "gangwon.kr", + "gwangju.kr", + "gyeongbuk.kr", + "gyeonggi.kr", + "gyeongnam.kr", + "incheon.kr", + "jeju.kr", + "jeonbuk.kr", + "jeonnam.kr", + "seoul.kr", + "ulsan.kr", + "kw", + "com.kw", + "edu.kw", + "emb.kw", + "gov.kw", + "ind.kw", + "net.kw", + "org.kw", + "ky", + "edu.ky", + "gov.ky", + "com.ky", + "org.ky", + "net.ky", + "kz", + "org.kz", + "edu.kz", + "net.kz", + "gov.kz", + "mil.kz", + "com.kz", + "la", + "int.la", + "net.la", + "info.la", + "edu.la", + "gov.la", + "per.la", + "com.la", + "org.la", + "lb", + "com.lb", + "edu.lb", + "gov.lb", + "net.lb", + "org.lb", + "lc", + "com.lc", + "net.lc", + "co.lc", + "org.lc", + "edu.lc", + "gov.lc", + "li", + "lk", + "gov.lk", + "sch.lk", + "net.lk", + "int.lk", + "com.lk", + "org.lk", + "edu.lk", + "ngo.lk", + "soc.lk", + "web.lk", + "ltd.lk", + "assn.lk", + "grp.lk", + "hotel.lk", + "ac.lk", + "lr", + "com.lr", + "edu.lr", + "gov.lr", + "org.lr", + "net.lr", + "ls", + "ac.ls", + "biz.ls", + "co.ls", + "edu.ls", + "gov.ls", + "info.ls", + "net.ls", + "org.ls", + "sc.ls", + "lt", + "gov.lt", + "lu", + "lv", + "com.lv", + "edu.lv", + "gov.lv", + "org.lv", + "mil.lv", + "id.lv", + "net.lv", + "asn.lv", + "conf.lv", + "ly", + "com.ly", + "net.ly", + "gov.ly", + "plc.ly", + "edu.ly", + "sch.ly", + "med.ly", + "org.ly", + "id.ly", + "ma", + "co.ma", + "net.ma", + "gov.ma", + "org.ma", + "ac.ma", + "press.ma", + "mc", + "tm.mc", + "asso.mc", + "md", + "me", + "co.me", + "net.me", + "org.me", + "edu.me", + "ac.me", + "gov.me", + "its.me", + "priv.me", + "mg", + "org.mg", + "nom.mg", + "gov.mg", + "prd.mg", + "tm.mg", + "edu.mg", + "mil.mg", + "com.mg", + "co.mg", + "mh", + "mil", + "mk", + "com.mk", + "org.mk", + "net.mk", + "edu.mk", + "gov.mk", + "inf.mk", + "name.mk", + "ml", + "com.ml", + "edu.ml", + "gouv.ml", + "gov.ml", + "net.ml", + "org.ml", + "presse.ml", + "*.mm", + "mn", + "gov.mn", + "edu.mn", + "org.mn", + "mo", + "com.mo", + "net.mo", + "org.mo", + "edu.mo", + "gov.mo", + "mobi", + "mp", + "mq", + "mr", + "gov.mr", + "ms", + "com.ms", + "edu.ms", + "gov.ms", + "net.ms", + "org.ms", + "mt", + "com.mt", + "edu.mt", + "net.mt", + "org.mt", + "mu", + "com.mu", + "net.mu", + "org.mu", + "gov.mu", + "ac.mu", + "co.mu", + "or.mu", + "museum", + "academy.museum", + "agriculture.museum", + "air.museum", + "airguard.museum", + "alabama.museum", + "alaska.museum", + "amber.museum", + "ambulance.museum", + "american.museum", + "americana.museum", + "americanantiques.museum", + "americanart.museum", + "amsterdam.museum", + "and.museum", + "annefrank.museum", + "anthro.museum", + "anthropology.museum", + "antiques.museum", + "aquarium.museum", + "arboretum.museum", + "archaeological.museum", + "archaeology.museum", + "architecture.museum", + "art.museum", + "artanddesign.museum", + "artcenter.museum", + "artdeco.museum", + "arteducation.museum", + "artgallery.museum", + "arts.museum", + "artsandcrafts.museum", + "asmatart.museum", + "assassination.museum", + "assisi.museum", + "association.museum", + "astronomy.museum", + "atlanta.museum", + "austin.museum", + "australia.museum", + "automotive.museum", + "aviation.museum", + "axis.museum", + "badajoz.museum", + "baghdad.museum", + "bahn.museum", + "bale.museum", + "baltimore.museum", + "barcelona.museum", + "baseball.museum", + "basel.museum", + "baths.museum", + "bauern.museum", + "beauxarts.museum", + "beeldengeluid.museum", + "bellevue.museum", + "bergbau.museum", + "berkeley.museum", + "berlin.museum", + "bern.museum", + "bible.museum", + "bilbao.museum", + "bill.museum", + "birdart.museum", + "birthplace.museum", + "bonn.museum", + "boston.museum", + "botanical.museum", + "botanicalgarden.museum", + "botanicgarden.museum", + "botany.museum", + "brandywinevalley.museum", + "brasil.museum", + "bristol.museum", + "british.museum", + "britishcolumbia.museum", + "broadcast.museum", + "brunel.museum", + "brussel.museum", + "brussels.museum", + "bruxelles.museum", + "building.museum", + "burghof.museum", + "bus.museum", + "bushey.museum", + "cadaques.museum", + "california.museum", + "cambridge.museum", + "can.museum", + "canada.museum", + "capebreton.museum", + "carrier.museum", + "cartoonart.museum", + "casadelamoneda.museum", + "castle.museum", + "castres.museum", + "celtic.museum", + "center.museum", + "chattanooga.museum", + "cheltenham.museum", + "chesapeakebay.museum", + "chicago.museum", + "children.museum", + "childrens.museum", + "childrensgarden.museum", + "chiropractic.museum", + "chocolate.museum", + "christiansburg.museum", + "cincinnati.museum", + "cinema.museum", + "circus.museum", + "civilisation.museum", + "civilization.museum", + "civilwar.museum", + "clinton.museum", + "clock.museum", + "coal.museum", + "coastaldefence.museum", + "cody.museum", + "coldwar.museum", + "collection.museum", + "colonialwilliamsburg.museum", + "coloradoplateau.museum", + "columbia.museum", + "columbus.museum", + "communication.museum", + "communications.museum", + "community.museum", + "computer.museum", + "computerhistory.museum", + "comunicações.museum", + "contemporary.museum", + "contemporaryart.museum", + "convent.museum", + "copenhagen.museum", + "corporation.museum", + "correios-e-telecomunicações.museum", + "corvette.museum", + "costume.museum", + "countryestate.museum", + "county.museum", + "crafts.museum", + "cranbrook.museum", + "creation.museum", + "cultural.museum", + "culturalcenter.museum", + "culture.museum", + "cyber.museum", + "cymru.museum", + "dali.museum", + "dallas.museum", + "database.museum", + "ddr.museum", + "decorativearts.museum", + "delaware.museum", + "delmenhorst.museum", + "denmark.museum", + "depot.museum", + "design.museum", + "detroit.museum", + "dinosaur.museum", + "discovery.museum", + "dolls.museum", + "donostia.museum", + "durham.museum", + "eastafrica.museum", + "eastcoast.museum", + "education.museum", + "educational.museum", + "egyptian.museum", + "eisenbahn.museum", + "elburg.museum", + "elvendrell.museum", + "embroidery.museum", + "encyclopedic.museum", + "england.museum", + "entomology.museum", + "environment.museum", + "environmentalconservation.museum", + "epilepsy.museum", + "essex.museum", + "estate.museum", + "ethnology.museum", + "exeter.museum", + "exhibition.museum", + "family.museum", + "farm.museum", + "farmequipment.museum", + "farmers.museum", + "farmstead.museum", + "field.museum", + "figueres.museum", + "filatelia.museum", + "film.museum", + "fineart.museum", + "finearts.museum", + "finland.museum", + "flanders.museum", + "florida.museum", + "force.museum", + "fortmissoula.museum", + "fortworth.museum", + "foundation.museum", + "francaise.museum", + "frankfurt.museum", + "franziskaner.museum", + "freemasonry.museum", + "freiburg.museum", + "fribourg.museum", + "frog.museum", + "fundacio.museum", + "furniture.museum", + "gallery.museum", + "garden.museum", + "gateway.museum", + "geelvinck.museum", + "gemological.museum", + "geology.museum", + "georgia.museum", + "giessen.museum", + "glas.museum", + "glass.museum", + "gorge.museum", + "grandrapids.museum", + "graz.museum", + "guernsey.museum", + "halloffame.museum", + "hamburg.museum", + "handson.museum", + "harvestcelebration.museum", + "hawaii.museum", + "health.museum", + "heimatunduhren.museum", + "hellas.museum", + "helsinki.museum", + "hembygdsforbund.museum", + "heritage.museum", + "histoire.museum", + "historical.museum", + "historicalsociety.museum", + "historichouses.museum", + "historisch.museum", + "historisches.museum", + "history.museum", + "historyofscience.museum", + "horology.museum", + "house.museum", + "humanities.museum", + "illustration.museum", + "imageandsound.museum", + "indian.museum", + "indiana.museum", + "indianapolis.museum", + "indianmarket.museum", + "intelligence.museum", + "interactive.museum", + "iraq.museum", + "iron.museum", + "isleofman.museum", + "jamison.museum", + "jefferson.museum", + "jerusalem.museum", + "jewelry.museum", + "jewish.museum", + "jewishart.museum", + "jfk.museum", + "journalism.museum", + "judaica.museum", + "judygarland.museum", + "juedisches.museum", + "juif.museum", + "karate.museum", + "karikatur.museum", + "kids.museum", + "koebenhavn.museum", + "koeln.museum", + "kunst.museum", + "kunstsammlung.museum", + "kunstunddesign.museum", + "labor.museum", + "labour.museum", + "lajolla.museum", + "lancashire.museum", + "landes.museum", + "lans.museum", + "läns.museum", + "larsson.museum", + "lewismiller.museum", + "lincoln.museum", + "linz.museum", + "living.museum", + "livinghistory.museum", + "localhistory.museum", + "london.museum", + "losangeles.museum", + "louvre.museum", + "loyalist.museum", + "lucerne.museum", + "luxembourg.museum", + "luzern.museum", + "mad.museum", + "madrid.museum", + "mallorca.museum", + "manchester.museum", + "mansion.museum", + "mansions.museum", + "manx.museum", + "marburg.museum", + "maritime.museum", + "maritimo.museum", + "maryland.museum", + "marylhurst.museum", + "media.museum", + "medical.museum", + "medizinhistorisches.museum", + "meeres.museum", + "memorial.museum", + "mesaverde.museum", + "michigan.museum", + "midatlantic.museum", + "military.museum", + "mill.museum", + "miners.museum", + "mining.museum", + "minnesota.museum", + "missile.museum", + "missoula.museum", + "modern.museum", + "moma.museum", + "money.museum", + "monmouth.museum", + "monticello.museum", + "montreal.museum", + "moscow.museum", + "motorcycle.museum", + "muenchen.museum", + "muenster.museum", + "mulhouse.museum", + "muncie.museum", + "museet.museum", + "museumcenter.museum", + "museumvereniging.museum", + "music.museum", + "national.museum", + "nationalfirearms.museum", + "nationalheritage.museum", + "nativeamerican.museum", + "naturalhistory.museum", + "naturalhistorymuseum.museum", + "naturalsciences.museum", + "nature.museum", + "naturhistorisches.museum", + "natuurwetenschappen.museum", + "naumburg.museum", + "naval.museum", + "nebraska.museum", + "neues.museum", + "newhampshire.museum", + "newjersey.museum", + "newmexico.museum", + "newport.museum", + "newspaper.museum", + "newyork.museum", + "niepce.museum", + "norfolk.museum", + "north.museum", + "nrw.museum", + "nyc.museum", + "nyny.museum", + "oceanographic.museum", + "oceanographique.museum", + "omaha.museum", + "online.museum", + "ontario.museum", + "openair.museum", + "oregon.museum", + "oregontrail.museum", + "otago.museum", + "oxford.museum", + "pacific.museum", + "paderborn.museum", + "palace.museum", + "paleo.museum", + "palmsprings.museum", + "panama.museum", + "paris.museum", + "pasadena.museum", + "pharmacy.museum", + "philadelphia.museum", + "philadelphiaarea.museum", + "philately.museum", + "phoenix.museum", + "photography.museum", + "pilots.museum", + "pittsburgh.museum", + "planetarium.museum", + "plantation.museum", + "plants.museum", + "plaza.museum", + "portal.museum", + "portland.museum", + "portlligat.museum", + "posts-and-telecommunications.museum", + "preservation.museum", + "presidio.museum", + "press.museum", + "project.museum", + "public.museum", + "pubol.museum", + "quebec.museum", + "railroad.museum", + "railway.museum", + "research.museum", + "resistance.museum", + "riodejaneiro.museum", + "rochester.museum", + "rockart.museum", + "roma.museum", + "russia.museum", + "saintlouis.museum", + "salem.museum", + "salvadordali.museum", + "salzburg.museum", + "sandiego.museum", + "sanfrancisco.museum", + "santabarbara.museum", + "santacruz.museum", + "santafe.museum", + "saskatchewan.museum", + "satx.museum", + "savannahga.museum", + "schlesisches.museum", + "schoenbrunn.museum", + "schokoladen.museum", + "school.museum", + "schweiz.museum", + "science.museum", + "scienceandhistory.museum", + "scienceandindustry.museum", + "sciencecenter.museum", + "sciencecenters.museum", + "science-fiction.museum", + "sciencehistory.museum", + "sciences.museum", + "sciencesnaturelles.museum", + "scotland.museum", + "seaport.museum", + "settlement.museum", + "settlers.museum", + "shell.museum", + "sherbrooke.museum", + "sibenik.museum", + "silk.museum", + "ski.museum", + "skole.museum", + "society.museum", + "sologne.museum", + "soundandvision.museum", + "southcarolina.museum", + "southwest.museum", + "space.museum", + "spy.museum", + "square.museum", + "stadt.museum", + "stalbans.museum", + "starnberg.museum", + "state.museum", + "stateofdelaware.museum", + "station.museum", + "steam.museum", + "steiermark.museum", + "stjohn.museum", + "stockholm.museum", + "stpetersburg.museum", + "stuttgart.museum", + "suisse.museum", + "surgeonshall.museum", + "surrey.museum", + "svizzera.museum", + "sweden.museum", + "sydney.museum", + "tank.museum", + "tcm.museum", + "technology.museum", + "telekommunikation.museum", + "television.museum", + "texas.museum", + "textile.museum", + "theater.museum", + "time.museum", + "timekeeping.museum", + "topology.museum", + "torino.museum", + "touch.museum", + "town.museum", + "transport.museum", + "tree.museum", + "trolley.museum", + "trust.museum", + "trustee.museum", + "uhren.museum", + "ulm.museum", + "undersea.museum", + "university.museum", + "usa.museum", + "usantiques.museum", + "usarts.museum", + "uscountryestate.museum", + "usculture.museum", + "usdecorativearts.museum", + "usgarden.museum", + "ushistory.museum", + "ushuaia.museum", + "uslivinghistory.museum", + "utah.museum", + "uvic.museum", + "valley.museum", + "vantaa.museum", + "versailles.museum", + "viking.museum", + "village.museum", + "virginia.museum", + "virtual.museum", + "virtuel.museum", + "vlaanderen.museum", + "volkenkunde.museum", + "wales.museum", + "wallonie.museum", + "war.museum", + "washingtondc.museum", + "watchandclock.museum", + "watch-and-clock.museum", + "western.museum", + "westfalen.museum", + "whaling.museum", + "wildlife.museum", + "williamsburg.museum", + "windmill.museum", + "workshop.museum", + "york.museum", + "yorkshire.museum", + "yosemite.museum", + "youth.museum", + "zoological.museum", + "zoology.museum", + "ירושלים.museum", + "иком.museum", + "mv", + "aero.mv", + "biz.mv", + "com.mv", + "coop.mv", + "edu.mv", + "gov.mv", + "info.mv", + "int.mv", + "mil.mv", + "museum.mv", + "name.mv", + "net.mv", + "org.mv", + "pro.mv", + "mw", + "ac.mw", + "biz.mw", + "co.mw", + "com.mw", + "coop.mw", + "edu.mw", + "gov.mw", + "int.mw", + "museum.mw", + "net.mw", + "org.mw", + "mx", + "com.mx", + "org.mx", + "gob.mx", + "edu.mx", + "net.mx", + "my", + "com.my", + "net.my", + "org.my", + "gov.my", + "edu.my", + "mil.my", + "name.my", + "mz", + "ac.mz", + "adv.mz", + "co.mz", + "edu.mz", + "gov.mz", + "mil.mz", + "net.mz", + "org.mz", + "na", + "info.na", + "pro.na", + "name.na", + "school.na", + "or.na", + "dr.na", + "us.na", + "mx.na", + "ca.na", + "in.na", + "cc.na", + "tv.na", + "ws.na", + "mobi.na", + "co.na", + "com.na", + "org.na", + "name", + "nc", + "asso.nc", + "nom.nc", + "ne", + "net", + "nf", + "com.nf", + "net.nf", + "per.nf", + "rec.nf", + "web.nf", + "arts.nf", + "firm.nf", + "info.nf", + "other.nf", + "store.nf", + "ng", + "com.ng", + "edu.ng", + "gov.ng", + "i.ng", + "mil.ng", + "mobi.ng", + "name.ng", + "net.ng", + "org.ng", + "sch.ng", + "ni", + "ac.ni", + "biz.ni", + "co.ni", + "com.ni", + "edu.ni", + "gob.ni", + "in.ni", + "info.ni", + "int.ni", + "mil.ni", + "net.ni", + "nom.ni", + "org.ni", + "web.ni", + "nl", + "no", + "fhs.no", + "vgs.no", + "fylkesbibl.no", + "folkebibl.no", + "museum.no", + "idrett.no", + "priv.no", + "mil.no", + "stat.no", + "dep.no", + "kommune.no", + "herad.no", + "aa.no", + "ah.no", + "bu.no", + "fm.no", + "hl.no", + "hm.no", + "jan-mayen.no", + "mr.no", + "nl.no", + "nt.no", + "of.no", + "ol.no", + "oslo.no", + "rl.no", + "sf.no", + "st.no", + "svalbard.no", + "tm.no", + "tr.no", + "va.no", + "vf.no", + "gs.aa.no", + "gs.ah.no", + "gs.bu.no", + "gs.fm.no", + "gs.hl.no", + "gs.hm.no", + "gs.jan-mayen.no", + "gs.mr.no", + "gs.nl.no", + "gs.nt.no", + "gs.of.no", + "gs.ol.no", + "gs.oslo.no", + "gs.rl.no", + "gs.sf.no", + "gs.st.no", + "gs.svalbard.no", + "gs.tm.no", + "gs.tr.no", + "gs.va.no", + "gs.vf.no", + "akrehamn.no", + "åkrehamn.no", + "algard.no", + "ålgård.no", + "arna.no", + "brumunddal.no", + "bryne.no", + "bronnoysund.no", + "brønnøysund.no", + "drobak.no", + "drøbak.no", + "egersund.no", + "fetsund.no", + "floro.no", + "florø.no", + "fredrikstad.no", + "hokksund.no", + "honefoss.no", + "hønefoss.no", + "jessheim.no", + "jorpeland.no", + "jørpeland.no", + "kirkenes.no", + "kopervik.no", + "krokstadelva.no", + "langevag.no", + "langevåg.no", + "leirvik.no", + "mjondalen.no", + "mjøndalen.no", + "mo-i-rana.no", + "mosjoen.no", + "mosjøen.no", + "nesoddtangen.no", + "orkanger.no", + "osoyro.no", + "osøyro.no", + "raholt.no", + "råholt.no", + "sandnessjoen.no", + "sandnessjøen.no", + "skedsmokorset.no", + "slattum.no", + "spjelkavik.no", + "stathelle.no", + "stavern.no", + "stjordalshalsen.no", + "stjørdalshalsen.no", + "tananger.no", + "tranby.no", + "vossevangen.no", + "afjord.no", + "åfjord.no", + "agdenes.no", + "al.no", + "ål.no", + "alesund.no", + "ålesund.no", + "alstahaug.no", + "alta.no", + "áltá.no", + "alaheadju.no", + "álaheadju.no", + "alvdal.no", + "amli.no", + "åmli.no", + "amot.no", + "åmot.no", + "andebu.no", + "andoy.no", + "andøy.no", + "andasuolo.no", + "ardal.no", + "årdal.no", + "aremark.no", + "arendal.no", + "ås.no", + "aseral.no", + "åseral.no", + "asker.no", + "askim.no", + "askvoll.no", + "askoy.no", + "askøy.no", + "asnes.no", + "åsnes.no", + "audnedaln.no", + "aukra.no", + "aure.no", + "aurland.no", + "aurskog-holand.no", + "aurskog-høland.no", + "austevoll.no", + "austrheim.no", + "averoy.no", + "averøy.no", + "balestrand.no", + "ballangen.no", + "balat.no", + "bálát.no", + "balsfjord.no", + "bahccavuotna.no", + "báhccavuotna.no", + "bamble.no", + "bardu.no", + "beardu.no", + "beiarn.no", + "bajddar.no", + "bájddar.no", + "baidar.no", + "báidár.no", + "berg.no", + "bergen.no", + "berlevag.no", + "berlevåg.no", + "bearalvahki.no", + "bearalváhki.no", + "bindal.no", + "birkenes.no", + "bjarkoy.no", + "bjarkøy.no", + "bjerkreim.no", + "bjugn.no", + "bodo.no", + "bodø.no", + "badaddja.no", + "bådåddjå.no", + "budejju.no", + "bokn.no", + "bremanger.no", + "bronnoy.no", + "brønnøy.no", + "bygland.no", + "bykle.no", + "barum.no", + "bærum.no", + "bo.telemark.no", + "bø.telemark.no", + "bo.nordland.no", + "bø.nordland.no", + "bievat.no", + "bievát.no", + "bomlo.no", + "bømlo.no", + "batsfjord.no", + "båtsfjord.no", + "bahcavuotna.no", + "báhcavuotna.no", + "dovre.no", + "drammen.no", + "drangedal.no", + "dyroy.no", + "dyrøy.no", + "donna.no", + "dønna.no", + "eid.no", + "eidfjord.no", + "eidsberg.no", + "eidskog.no", + "eidsvoll.no", + "eigersund.no", + "elverum.no", + "enebakk.no", + "engerdal.no", + "etne.no", + "etnedal.no", + "evenes.no", + "evenassi.no", + "evenášši.no", + "evje-og-hornnes.no", + "farsund.no", + "fauske.no", + "fuossko.no", + "fuoisku.no", + "fedje.no", + "fet.no", + "finnoy.no", + "finnøy.no", + "fitjar.no", + "fjaler.no", + "fjell.no", + "flakstad.no", + "flatanger.no", + "flekkefjord.no", + "flesberg.no", + "flora.no", + "fla.no", + "flå.no", + "folldal.no", + "forsand.no", + "fosnes.no", + "frei.no", + "frogn.no", + "froland.no", + "frosta.no", + "frana.no", + "fræna.no", + "froya.no", + "frøya.no", + "fusa.no", + "fyresdal.no", + "forde.no", + "førde.no", + "gamvik.no", + "gangaviika.no", + "gáŋgaviika.no", + "gaular.no", + "gausdal.no", + "gildeskal.no", + "gildeskål.no", + "giske.no", + "gjemnes.no", + "gjerdrum.no", + "gjerstad.no", + "gjesdal.no", + "gjovik.no", + "gjøvik.no", + "gloppen.no", + "gol.no", + "gran.no", + "grane.no", + "granvin.no", + "gratangen.no", + "grimstad.no", + "grong.no", + "kraanghke.no", + "kråanghke.no", + "grue.no", + "gulen.no", + "hadsel.no", + "halden.no", + "halsa.no", + "hamar.no", + "hamaroy.no", + "habmer.no", + "hábmer.no", + "hapmir.no", + "hápmir.no", + "hammerfest.no", + "hammarfeasta.no", + "hámmárfeasta.no", + "haram.no", + "hareid.no", + "harstad.no", + "hasvik.no", + "aknoluokta.no", + "ákŋoluokta.no", + "hattfjelldal.no", + "aarborte.no", + "haugesund.no", + "hemne.no", + "hemnes.no", + "hemsedal.no", + "heroy.more-og-romsdal.no", + "herøy.møre-og-romsdal.no", + "heroy.nordland.no", + "herøy.nordland.no", + "hitra.no", + "hjartdal.no", + "hjelmeland.no", + "hobol.no", + "hobøl.no", + "hof.no", + "hol.no", + "hole.no", + "holmestrand.no", + "holtalen.no", + "holtålen.no", + "hornindal.no", + "horten.no", + "hurdal.no", + "hurum.no", + "hvaler.no", + "hyllestad.no", + "hagebostad.no", + "hægebostad.no", + "hoyanger.no", + "høyanger.no", + "hoylandet.no", + "høylandet.no", + "ha.no", + "hå.no", + "ibestad.no", + "inderoy.no", + "inderøy.no", + "iveland.no", + "jevnaker.no", + "jondal.no", + "jolster.no", + "jølster.no", + "karasjok.no", + "karasjohka.no", + "kárášjohka.no", + "karlsoy.no", + "galsa.no", + "gálsá.no", + "karmoy.no", + "karmøy.no", + "kautokeino.no", + "guovdageaidnu.no", + "klepp.no", + "klabu.no", + "klæbu.no", + "kongsberg.no", + "kongsvinger.no", + "kragero.no", + "kragerø.no", + "kristiansand.no", + "kristiansund.no", + "krodsherad.no", + "krødsherad.no", + "kvalsund.no", + "rahkkeravju.no", + "ráhkkerávju.no", + "kvam.no", + "kvinesdal.no", + "kvinnherad.no", + "kviteseid.no", + "kvitsoy.no", + "kvitsøy.no", + "kvafjord.no", + "kvæfjord.no", + "giehtavuoatna.no", + "kvanangen.no", + "kvænangen.no", + "navuotna.no", + "návuotna.no", + "kafjord.no", + "kåfjord.no", + "gaivuotna.no", + "gáivuotna.no", + "larvik.no", + "lavangen.no", + "lavagis.no", + "loabat.no", + "loabát.no", + "lebesby.no", + "davvesiida.no", + "leikanger.no", + "leirfjord.no", + "leka.no", + "leksvik.no", + "lenvik.no", + "leangaviika.no", + "leaŋgaviika.no", + "lesja.no", + "levanger.no", + "lier.no", + "lierne.no", + "lillehammer.no", + "lillesand.no", + "lindesnes.no", + "lindas.no", + "lindås.no", + "lom.no", + "loppa.no", + "lahppi.no", + "láhppi.no", + "lund.no", + "lunner.no", + "luroy.no", + "lurøy.no", + "luster.no", + "lyngdal.no", + "lyngen.no", + "ivgu.no", + "lardal.no", + "lerdal.no", + "lærdal.no", + "lodingen.no", + "lødingen.no", + "lorenskog.no", + "lørenskog.no", + "loten.no", + "løten.no", + "malvik.no", + "masoy.no", + "måsøy.no", + "muosat.no", + "muosát.no", + "mandal.no", + "marker.no", + "marnardal.no", + "masfjorden.no", + "meland.no", + "meldal.no", + "melhus.no", + "meloy.no", + "meløy.no", + "meraker.no", + "meråker.no", + "moareke.no", + "moåreke.no", + "midsund.no", + "midtre-gauldal.no", + "modalen.no", + "modum.no", + "molde.no", + "moskenes.no", + "moss.no", + "mosvik.no", + "malselv.no", + "målselv.no", + "malatvuopmi.no", + "málatvuopmi.no", + "namdalseid.no", + "aejrie.no", + "namsos.no", + "namsskogan.no", + "naamesjevuemie.no", + "nååmesjevuemie.no", + "laakesvuemie.no", + "nannestad.no", + "narvik.no", + "narviika.no", + "naustdal.no", + "nedre-eiker.no", + "nes.akershus.no", + "nes.buskerud.no", + "nesna.no", + "nesodden.no", + "nesseby.no", + "unjarga.no", + "unjárga.no", + "nesset.no", + "nissedal.no", + "nittedal.no", + "nord-aurdal.no", + "nord-fron.no", + "nord-odal.no", + "norddal.no", + "nordkapp.no", + "davvenjarga.no", + "davvenjárga.no", + "nordre-land.no", + "nordreisa.no", + "raisa.no", + "ráisa.no", + "nore-og-uvdal.no", + "notodden.no", + "naroy.no", + "nærøy.no", + "notteroy.no", + "nøtterøy.no", + "odda.no", + "oksnes.no", + "øksnes.no", + "oppdal.no", + "oppegard.no", + "oppegård.no", + "orkdal.no", + "orland.no", + "ørland.no", + "orskog.no", + "ørskog.no", + "orsta.no", + "ørsta.no", + "os.hedmark.no", + "os.hordaland.no", + "osen.no", + "osteroy.no", + "osterøy.no", + "ostre-toten.no", + "østre-toten.no", + "overhalla.no", + "ovre-eiker.no", + "øvre-eiker.no", + "oyer.no", + "øyer.no", + "oygarden.no", + "øygarden.no", + "oystre-slidre.no", + "øystre-slidre.no", + "porsanger.no", + "porsangu.no", + "porsáŋgu.no", + "porsgrunn.no", + "radoy.no", + "radøy.no", + "rakkestad.no", + "rana.no", + "ruovat.no", + "randaberg.no", + "rauma.no", + "rendalen.no", + "rennebu.no", + "rennesoy.no", + "rennesøy.no", + "rindal.no", + "ringebu.no", + "ringerike.no", + "ringsaker.no", + "rissa.no", + "risor.no", + "risør.no", + "roan.no", + "rollag.no", + "rygge.no", + "ralingen.no", + "rælingen.no", + "rodoy.no", + "rødøy.no", + "romskog.no", + "rømskog.no", + "roros.no", + "røros.no", + "rost.no", + "røst.no", + "royken.no", + "røyken.no", + "royrvik.no", + "røyrvik.no", + "rade.no", + "råde.no", + "salangen.no", + "siellak.no", + "saltdal.no", + "salat.no", + "sálát.no", + "sálat.no", + "samnanger.no", + "sande.more-og-romsdal.no", + "sande.møre-og-romsdal.no", + "sande.vestfold.no", + "sandefjord.no", + "sandnes.no", + "sandoy.no", + "sandøy.no", + "sarpsborg.no", + "sauda.no", + "sauherad.no", + "sel.no", + "selbu.no", + "selje.no", + "seljord.no", + "sigdal.no", + "siljan.no", + "sirdal.no", + "skaun.no", + "skedsmo.no", + "ski.no", + "skien.no", + "skiptvet.no", + "skjervoy.no", + "skjervøy.no", + "skierva.no", + "skiervá.no", + "skjak.no", + "skjåk.no", + "skodje.no", + "skanland.no", + "skånland.no", + "skanit.no", + "skánit.no", + "smola.no", + "smøla.no", + "snillfjord.no", + "snasa.no", + "snåsa.no", + "snoasa.no", + "snaase.no", + "snåase.no", + "sogndal.no", + "sokndal.no", + "sola.no", + "solund.no", + "songdalen.no", + "sortland.no", + "spydeberg.no", + "stange.no", + "stavanger.no", + "steigen.no", + "steinkjer.no", + "stjordal.no", + "stjørdal.no", + "stokke.no", + "stor-elvdal.no", + "stord.no", + "stordal.no", + "storfjord.no", + "omasvuotna.no", + "strand.no", + "stranda.no", + "stryn.no", + "sula.no", + "suldal.no", + "sund.no", + "sunndal.no", + "surnadal.no", + "sveio.no", + "svelvik.no", + "sykkylven.no", + "sogne.no", + "søgne.no", + "somna.no", + "sømna.no", + "sondre-land.no", + "søndre-land.no", + "sor-aurdal.no", + "sør-aurdal.no", + "sor-fron.no", + "sør-fron.no", + "sor-odal.no", + "sør-odal.no", + "sor-varanger.no", + "sør-varanger.no", + "matta-varjjat.no", + "mátta-várjjat.no", + "sorfold.no", + "sørfold.no", + "sorreisa.no", + "sørreisa.no", + "sorum.no", + "sørum.no", + "tana.no", + "deatnu.no", + "time.no", + "tingvoll.no", + "tinn.no", + "tjeldsund.no", + "dielddanuorri.no", + "tjome.no", + "tjøme.no", + "tokke.no", + "tolga.no", + "torsken.no", + "tranoy.no", + "tranøy.no", + "tromso.no", + "tromsø.no", + "tromsa.no", + "romsa.no", + "trondheim.no", + "troandin.no", + "trysil.no", + "trana.no", + "træna.no", + "trogstad.no", + "trøgstad.no", + "tvedestrand.no", + "tydal.no", + "tynset.no", + "tysfjord.no", + "divtasvuodna.no", + "divttasvuotna.no", + "tysnes.no", + "tysvar.no", + "tysvær.no", + "tonsberg.no", + "tønsberg.no", + "ullensaker.no", + "ullensvang.no", + "ulvik.no", + "utsira.no", + "vadso.no", + "vadsø.no", + "cahcesuolo.no", + "čáhcesuolo.no", + "vaksdal.no", + "valle.no", + "vang.no", + "vanylven.no", + "vardo.no", + "vardø.no", + "varggat.no", + "várggát.no", + "vefsn.no", + "vaapste.no", + "vega.no", + "vegarshei.no", + "vegårshei.no", + "vennesla.no", + "verdal.no", + "verran.no", + "vestby.no", + "vestnes.no", + "vestre-slidre.no", + "vestre-toten.no", + "vestvagoy.no", + "vestvågøy.no", + "vevelstad.no", + "vik.no", + "vikna.no", + "vindafjord.no", + "volda.no", + "voss.no", + "varoy.no", + "værøy.no", + "vagan.no", + "vågan.no", + "voagat.no", + "vagsoy.no", + "vågsøy.no", + "vaga.no", + "vågå.no", + "valer.ostfold.no", + "våler.østfold.no", + "valer.hedmark.no", + "våler.hedmark.no", + "*.np", + "nr", + "biz.nr", + "info.nr", + "gov.nr", + "edu.nr", + "org.nr", + "net.nr", + "com.nr", + "nu", + "nz", + "ac.nz", + "co.nz", + "cri.nz", + "geek.nz", + "gen.nz", + "govt.nz", + "health.nz", + "iwi.nz", + "kiwi.nz", + "maori.nz", + "mil.nz", + "māori.nz", + "net.nz", + "org.nz", + "parliament.nz", + "school.nz", + "om", + "co.om", + "com.om", + "edu.om", + "gov.om", + "med.om", + "museum.om", + "net.om", + "org.om", + "pro.om", + "onion", + "org", + "pa", + "ac.pa", + "gob.pa", + "com.pa", + "org.pa", + "sld.pa", + "edu.pa", + "net.pa", + "ing.pa", + "abo.pa", + "med.pa", + "nom.pa", + "pe", + "edu.pe", + "gob.pe", + "nom.pe", + "mil.pe", + "org.pe", + "com.pe", + "net.pe", + "pf", + "com.pf", + "org.pf", + "edu.pf", + "*.pg", + "ph", + "com.ph", + "net.ph", + "org.ph", + "gov.ph", + "edu.ph", + "ngo.ph", + "mil.ph", + "i.ph", + "pk", + "com.pk", + "net.pk", + "edu.pk", + "org.pk", + "fam.pk", + "biz.pk", + "web.pk", + "gov.pk", + "gob.pk", + "gok.pk", + "gon.pk", + "gop.pk", + "gos.pk", + "info.pk", + "pl", + "com.pl", + "net.pl", + "org.pl", + "aid.pl", + "agro.pl", + "atm.pl", + "auto.pl", + "biz.pl", + "edu.pl", + "gmina.pl", + "gsm.pl", + "info.pl", + "mail.pl", + "miasta.pl", + "media.pl", + "mil.pl", + "nieruchomosci.pl", + "nom.pl", + "pc.pl", + "powiat.pl", + "priv.pl", + "realestate.pl", + "rel.pl", + "sex.pl", + "shop.pl", + "sklep.pl", + "sos.pl", + "szkola.pl", + "targi.pl", + "tm.pl", + "tourism.pl", + "travel.pl", + "turystyka.pl", + "gov.pl", + "ap.gov.pl", + "ic.gov.pl", + "is.gov.pl", + "us.gov.pl", + "kmpsp.gov.pl", + "kppsp.gov.pl", + "kwpsp.gov.pl", + "psp.gov.pl", + "wskr.gov.pl", + "kwp.gov.pl", + "mw.gov.pl", + "ug.gov.pl", + "um.gov.pl", + "umig.gov.pl", + "ugim.gov.pl", + "upow.gov.pl", + "uw.gov.pl", + "starostwo.gov.pl", + "pa.gov.pl", + "po.gov.pl", + "psse.gov.pl", + "pup.gov.pl", + "rzgw.gov.pl", + "sa.gov.pl", + "so.gov.pl", + "sr.gov.pl", + "wsa.gov.pl", + "sko.gov.pl", + "uzs.gov.pl", + "wiih.gov.pl", + "winb.gov.pl", + "pinb.gov.pl", + "wios.gov.pl", + "witd.gov.pl", + "wzmiuw.gov.pl", + "piw.gov.pl", + "wiw.gov.pl", + "griw.gov.pl", + "wif.gov.pl", + "oum.gov.pl", + "sdn.gov.pl", + "zp.gov.pl", + "uppo.gov.pl", + "mup.gov.pl", + "wuoz.gov.pl", + "konsulat.gov.pl", + "oirm.gov.pl", + "augustow.pl", + "babia-gora.pl", + "bedzin.pl", + "beskidy.pl", + "bialowieza.pl", + "bialystok.pl", + "bielawa.pl", + "bieszczady.pl", + "boleslawiec.pl", + "bydgoszcz.pl", + "bytom.pl", + "cieszyn.pl", + "czeladz.pl", + "czest.pl", + "dlugoleka.pl", + "elblag.pl", + "elk.pl", + "glogow.pl", + "gniezno.pl", + "gorlice.pl", + "grajewo.pl", + "ilawa.pl", + "jaworzno.pl", + "jelenia-gora.pl", + "jgora.pl", + "kalisz.pl", + "kazimierz-dolny.pl", + "karpacz.pl", + "kartuzy.pl", + "kaszuby.pl", + "katowice.pl", + "kepno.pl", + "ketrzyn.pl", + "klodzko.pl", + "kobierzyce.pl", + "kolobrzeg.pl", + "konin.pl", + "konskowola.pl", + "kutno.pl", + "lapy.pl", + "lebork.pl", + "legnica.pl", + "lezajsk.pl", + "limanowa.pl", + "lomza.pl", + "lowicz.pl", + "lubin.pl", + "lukow.pl", + "malbork.pl", + "malopolska.pl", + "mazowsze.pl", + "mazury.pl", + "mielec.pl", + "mielno.pl", + "mragowo.pl", + "naklo.pl", + "nowaruda.pl", + "nysa.pl", + "olawa.pl", + "olecko.pl", + "olkusz.pl", + "olsztyn.pl", + "opoczno.pl", + "opole.pl", + "ostroda.pl", + "ostroleka.pl", + "ostrowiec.pl", + "ostrowwlkp.pl", + "pila.pl", + "pisz.pl", + "podhale.pl", + "podlasie.pl", + "polkowice.pl", + "pomorze.pl", + "pomorskie.pl", + "prochowice.pl", + "pruszkow.pl", + "przeworsk.pl", + "pulawy.pl", + "radom.pl", + "rawa-maz.pl", + "rybnik.pl", + "rzeszow.pl", + "sanok.pl", + "sejny.pl", + "slask.pl", + "slupsk.pl", + "sosnowiec.pl", + "stalowa-wola.pl", + "skoczow.pl", + "starachowice.pl", + "stargard.pl", + "suwalki.pl", + "swidnica.pl", + "swiebodzin.pl", + "swinoujscie.pl", + "szczecin.pl", + "szczytno.pl", + "tarnobrzeg.pl", + "tgory.pl", + "turek.pl", + "tychy.pl", + "ustka.pl", + "walbrzych.pl", + "warmia.pl", + "warszawa.pl", + "waw.pl", + "wegrow.pl", + "wielun.pl", + "wlocl.pl", + "wloclawek.pl", + "wodzislaw.pl", + "wolomin.pl", + "wroclaw.pl", + "zachpomor.pl", + "zagan.pl", + "zarow.pl", + "zgora.pl", + "zgorzelec.pl", + "pm", + "pn", + "gov.pn", + "co.pn", + "org.pn", + "edu.pn", + "net.pn", + "post", + "pr", + "com.pr", + "net.pr", + "org.pr", + "gov.pr", + "edu.pr", + "isla.pr", + "pro.pr", + "biz.pr", + "info.pr", + "name.pr", + "est.pr", + "prof.pr", + "ac.pr", + "pro", + "aaa.pro", + "aca.pro", + "acct.pro", + "avocat.pro", + "bar.pro", + "cpa.pro", + "eng.pro", + "jur.pro", + "law.pro", + "med.pro", + "recht.pro", + "ps", + "edu.ps", + "gov.ps", + "sec.ps", + "plo.ps", + "com.ps", + "org.ps", + "net.ps", + "pt", + "net.pt", + "gov.pt", + "org.pt", + "edu.pt", + "int.pt", + "publ.pt", + "com.pt", + "nome.pt", + "pw", + "co.pw", + "ne.pw", + "or.pw", + "ed.pw", + "go.pw", + "belau.pw", + "py", + "com.py", + "coop.py", + "edu.py", + "gov.py", + "mil.py", + "net.py", + "org.py", + "qa", + "com.qa", + "edu.qa", + "gov.qa", + "mil.qa", + "name.qa", + "net.qa", + "org.qa", + "sch.qa", + "re", + "asso.re", + "com.re", + "nom.re", + "ro", + "arts.ro", + "com.ro", + "firm.ro", + "info.ro", + "nom.ro", + "nt.ro", + "org.ro", + "rec.ro", + "store.ro", + "tm.ro", + "www.ro", + "rs", + "ac.rs", + "co.rs", + "edu.rs", + "gov.rs", + "in.rs", + "org.rs", + "ru", + "rw", + "ac.rw", + "co.rw", + "coop.rw", + "gov.rw", + "mil.rw", + "net.rw", + "org.rw", + "sa", + "com.sa", + "net.sa", + "org.sa", + "gov.sa", + "med.sa", + "pub.sa", + "edu.sa", + "sch.sa", + "sb", + "com.sb", + "edu.sb", + "gov.sb", + "net.sb", + "org.sb", + "sc", + "com.sc", + "gov.sc", + "net.sc", + "org.sc", + "edu.sc", + "sd", + "com.sd", + "net.sd", + "org.sd", + "edu.sd", + "med.sd", + "tv.sd", + "gov.sd", + "info.sd", + "se", + "a.se", + "ac.se", + "b.se", + "bd.se", + "brand.se", + "c.se", + "d.se", + "e.se", + "f.se", + "fh.se", + "fhsk.se", + "fhv.se", + "g.se", + "h.se", + "i.se", + "k.se", + "komforb.se", + "kommunalforbund.se", + "komvux.se", + "l.se", + "lanbib.se", + "m.se", + "n.se", + "naturbruksgymn.se", + "o.se", + "org.se", + "p.se", + "parti.se", + "pp.se", + "press.se", + "r.se", + "s.se", + "t.se", + "tm.se", + "u.se", + "w.se", + "x.se", + "y.se", + "z.se", + "sg", + "com.sg", + "net.sg", + "org.sg", + "gov.sg", + "edu.sg", + "per.sg", + "sh", + "com.sh", + "net.sh", + "gov.sh", + "org.sh", + "mil.sh", + "si", + "sj", + "sk", + "sl", + "com.sl", + "net.sl", + "edu.sl", + "gov.sl", + "org.sl", + "sm", + "sn", + "art.sn", + "com.sn", + "edu.sn", + "gouv.sn", + "org.sn", + "perso.sn", + "univ.sn", + "so", + "com.so", + "edu.so", + "gov.so", + "me.so", + "net.so", + "org.so", + "sr", + "ss", + "biz.ss", + "com.ss", + "edu.ss", + "gov.ss", + "net.ss", + "org.ss", + "st", + "co.st", + "com.st", + "consulado.st", + "edu.st", + "embaixada.st", + "gov.st", + "mil.st", + "net.st", + "org.st", + "principe.st", + "saotome.st", + "store.st", + "su", + "sv", + "com.sv", + "edu.sv", + "gob.sv", + "org.sv", + "red.sv", + "sx", + "gov.sx", + "sy", + "edu.sy", + "gov.sy", + "net.sy", + "mil.sy", + "com.sy", + "org.sy", + "sz", + "co.sz", + "ac.sz", + "org.sz", + "tc", + "td", + "tel", + "tf", + "tg", + "th", + "ac.th", + "co.th", + "go.th", + "in.th", + "mi.th", + "net.th", + "or.th", + "tj", + "ac.tj", + "biz.tj", + "co.tj", + "com.tj", + "edu.tj", + "go.tj", + "gov.tj", + "int.tj", + "mil.tj", + "name.tj", + "net.tj", + "nic.tj", + "org.tj", + "test.tj", + "web.tj", + "tk", + "tl", + "gov.tl", + "tm", + "com.tm", + "co.tm", + "org.tm", + "net.tm", + "nom.tm", + "gov.tm", + "mil.tm", + "edu.tm", + "tn", + "com.tn", + "ens.tn", + "fin.tn", + "gov.tn", + "ind.tn", + "intl.tn", + "nat.tn", + "net.tn", + "org.tn", + "info.tn", + "perso.tn", + "tourism.tn", + "edunet.tn", + "rnrt.tn", + "rns.tn", + "rnu.tn", + "mincom.tn", + "agrinet.tn", + "defense.tn", + "turen.tn", + "to", + "com.to", + "gov.to", + "net.to", + "org.to", + "edu.to", + "mil.to", + "tr", + "av.tr", + "bbs.tr", + "bel.tr", + "biz.tr", + "com.tr", + "dr.tr", + "edu.tr", + "gen.tr", + "gov.tr", + "info.tr", + "mil.tr", + "k12.tr", + "kep.tr", + "name.tr", + "net.tr", + "org.tr", + "pol.tr", + "tel.tr", + "tsk.tr", + "tv.tr", + "web.tr", + "nc.tr", + "gov.nc.tr", + "tt", + "co.tt", + "com.tt", + "org.tt", + "net.tt", + "biz.tt", + "info.tt", + "pro.tt", + "int.tt", + "coop.tt", + "jobs.tt", + "mobi.tt", + "travel.tt", + "museum.tt", + "aero.tt", + "name.tt", + "gov.tt", + "edu.tt", + "tv", + "tw", + "edu.tw", + "gov.tw", + "mil.tw", + "com.tw", + "net.tw", + "org.tw", + "idv.tw", + "game.tw", + "ebiz.tw", + "club.tw", + "網路.tw", + "組織.tw", + "商業.tw", + "tz", + "ac.tz", + "co.tz", + "go.tz", + "hotel.tz", + "info.tz", + "me.tz", + "mil.tz", + "mobi.tz", + "ne.tz", + "or.tz", + "sc.tz", + "tv.tz", + "ua", + "com.ua", + "edu.ua", + "gov.ua", + "in.ua", + "net.ua", + "org.ua", + "cherkassy.ua", + "cherkasy.ua", + "chernigov.ua", + "chernihiv.ua", + "chernivtsi.ua", + "chernovtsy.ua", + "ck.ua", + "cn.ua", + "cr.ua", + "crimea.ua", + "cv.ua", + "dn.ua", + "dnepropetrovsk.ua", + "dnipropetrovsk.ua", + "dominic.ua", + "donetsk.ua", + "dp.ua", + "if.ua", + "ivano-frankivsk.ua", + "kh.ua", + "kharkiv.ua", + "kharkov.ua", + "kherson.ua", + "khmelnitskiy.ua", + "khmelnytskyi.ua", + "kiev.ua", + "kirovograd.ua", + "km.ua", + "kr.ua", + "krym.ua", + "ks.ua", + "kv.ua", + "kyiv.ua", + "lg.ua", + "lt.ua", + "lugansk.ua", + "lutsk.ua", + "lv.ua", + "lviv.ua", + "mk.ua", + "mykolaiv.ua", + "nikolaev.ua", + "od.ua", + "odesa.ua", + "odessa.ua", + "pl.ua", + "poltava.ua", + "rivne.ua", + "rovno.ua", + "rv.ua", + "sb.ua", + "sebastopol.ua", + "sevastopol.ua", + "sm.ua", + "sumy.ua", + "te.ua", + "ternopil.ua", + "uz.ua", + "uzhgorod.ua", + "vinnica.ua", + "vinnytsia.ua", + "vn.ua", + "volyn.ua", + "yalta.ua", + "zaporizhzhe.ua", + "zaporizhzhia.ua", + "zhitomir.ua", + "zhytomyr.ua", + "zp.ua", + "zt.ua", + "ug", + "co.ug", + "or.ug", + "ac.ug", + "sc.ug", + "go.ug", + "ne.ug", + "com.ug", + "org.ug", + "uk", + "ac.uk", + "co.uk", + "gov.uk", + "ltd.uk", + "me.uk", + "net.uk", + "nhs.uk", + "org.uk", + "plc.uk", + "police.uk", + "*.sch.uk", + "us", + "dni.us", + "fed.us", + "isa.us", + "kids.us", + "nsn.us", + "ak.us", + "al.us", + "ar.us", + "as.us", + "az.us", + "ca.us", + "co.us", + "ct.us", + "dc.us", + "de.us", + "fl.us", + "ga.us", + "gu.us", + "hi.us", + "ia.us", + "id.us", + "il.us", + "in.us", + "ks.us", + "ky.us", + "la.us", + "ma.us", + "md.us", + "me.us", + "mi.us", + "mn.us", + "mo.us", + "ms.us", + "mt.us", + "nc.us", + "nd.us", + "ne.us", + "nh.us", + "nj.us", + "nm.us", + "nv.us", + "ny.us", + "oh.us", + "ok.us", + "or.us", + "pa.us", + "pr.us", + "ri.us", + "sc.us", + "sd.us", + "tn.us", + "tx.us", + "ut.us", + "vi.us", + "vt.us", + "va.us", + "wa.us", + "wi.us", + "wv.us", + "wy.us", + "k12.ak.us", + "k12.al.us", + "k12.ar.us", + "k12.as.us", + "k12.az.us", + "k12.ca.us", + "k12.co.us", + "k12.ct.us", + "k12.dc.us", + "k12.de.us", + "k12.fl.us", + "k12.ga.us", + "k12.gu.us", + "k12.ia.us", + "k12.id.us", + "k12.il.us", + "k12.in.us", + "k12.ks.us", + "k12.ky.us", + "k12.la.us", + "k12.ma.us", + "k12.md.us", + "k12.me.us", + "k12.mi.us", + "k12.mn.us", + "k12.mo.us", + "k12.ms.us", + "k12.mt.us", + "k12.nc.us", + "k12.ne.us", + "k12.nh.us", + "k12.nj.us", + "k12.nm.us", + "k12.nv.us", + "k12.ny.us", + "k12.oh.us", + "k12.ok.us", + "k12.or.us", + "k12.pa.us", + "k12.pr.us", + "k12.ri.us", + "k12.sc.us", + "k12.tn.us", + "k12.tx.us", + "k12.ut.us", + "k12.vi.us", + "k12.vt.us", + "k12.va.us", + "k12.wa.us", + "k12.wi.us", + "k12.wy.us", + "cc.ak.us", + "cc.al.us", + "cc.ar.us", + "cc.as.us", + "cc.az.us", + "cc.ca.us", + "cc.co.us", + "cc.ct.us", + "cc.dc.us", + "cc.de.us", + "cc.fl.us", + "cc.ga.us", + "cc.gu.us", + "cc.hi.us", + "cc.ia.us", + "cc.id.us", + "cc.il.us", + "cc.in.us", + "cc.ks.us", + "cc.ky.us", + "cc.la.us", + "cc.ma.us", + "cc.md.us", + "cc.me.us", + "cc.mi.us", + "cc.mn.us", + "cc.mo.us", + "cc.ms.us", + "cc.mt.us", + "cc.nc.us", + "cc.nd.us", + "cc.ne.us", + "cc.nh.us", + "cc.nj.us", + "cc.nm.us", + "cc.nv.us", + "cc.ny.us", + "cc.oh.us", + "cc.ok.us", + "cc.or.us", + "cc.pa.us", + "cc.pr.us", + "cc.ri.us", + "cc.sc.us", + "cc.sd.us", + "cc.tn.us", + "cc.tx.us", + "cc.ut.us", + "cc.vi.us", + "cc.vt.us", + "cc.va.us", + "cc.wa.us", + "cc.wi.us", + "cc.wv.us", + "cc.wy.us", + "lib.ak.us", + "lib.al.us", + "lib.ar.us", + "lib.as.us", + "lib.az.us", + "lib.ca.us", + "lib.co.us", + "lib.ct.us", + "lib.dc.us", + "lib.fl.us", + "lib.ga.us", + "lib.gu.us", + "lib.hi.us", + "lib.ia.us", + "lib.id.us", + "lib.il.us", + "lib.in.us", + "lib.ks.us", + "lib.ky.us", + "lib.la.us", + "lib.ma.us", + "lib.md.us", + "lib.me.us", + "lib.mi.us", + "lib.mn.us", + "lib.mo.us", + "lib.ms.us", + "lib.mt.us", + "lib.nc.us", + "lib.nd.us", + "lib.ne.us", + "lib.nh.us", + "lib.nj.us", + "lib.nm.us", + "lib.nv.us", + "lib.ny.us", + "lib.oh.us", + "lib.ok.us", + "lib.or.us", + "lib.pa.us", + "lib.pr.us", + "lib.ri.us", + "lib.sc.us", + "lib.sd.us", + "lib.tn.us", + "lib.tx.us", + "lib.ut.us", + "lib.vi.us", + "lib.vt.us", + "lib.va.us", + "lib.wa.us", + "lib.wi.us", + "lib.wy.us", + "pvt.k12.ma.us", + "chtr.k12.ma.us", + "paroch.k12.ma.us", + "ann-arbor.mi.us", + "cog.mi.us", + "dst.mi.us", + "eaton.mi.us", + "gen.mi.us", + "mus.mi.us", + "tec.mi.us", + "washtenaw.mi.us", + "uy", + "com.uy", + "edu.uy", + "gub.uy", + "mil.uy", + "net.uy", + "org.uy", + "uz", + "co.uz", + "com.uz", + "net.uz", + "org.uz", + "va", + "vc", + "com.vc", + "net.vc", + "org.vc", + "gov.vc", + "mil.vc", + "edu.vc", + "ve", + "arts.ve", + "co.ve", + "com.ve", + "e12.ve", + "edu.ve", + "firm.ve", + "gob.ve", + "gov.ve", + "info.ve", + "int.ve", + "mil.ve", + "net.ve", + "org.ve", + "rec.ve", + "store.ve", + "tec.ve", + "web.ve", + "vg", + "vi", + "co.vi", + "com.vi", + "k12.vi", + "net.vi", + "org.vi", + "vn", + "com.vn", + "net.vn", + "org.vn", + "edu.vn", + "gov.vn", + "int.vn", + "ac.vn", + "biz.vn", + "info.vn", + "name.vn", + "pro.vn", + "health.vn", + "vu", + "com.vu", + "edu.vu", + "net.vu", + "org.vu", + "wf", + "ws", + "com.ws", + "net.ws", + "org.ws", + "gov.ws", + "edu.ws", + "yt", + "امارات", + "հայ", + "বাংলা", + "бг", + "бел", + "中国", + "中國", + "الجزائر", + "مصر", + "ею", + "ευ", + "موريتانيا", + "გე", + "ελ", + "香港", + "公司.香港", + "教育.香港", + "政府.香港", + "個人.香港", + "網絡.香港", + "組織.香港", + "ಭಾರತ", + "ଭାରତ", + "ভাৰত", + "भारतम्", + "भारोत", + "ڀارت", + "ഭാരതം", + "भारत", + "بارت", + "بھارت", + "భారత్", + "ભારત", + "ਭਾਰਤ", + "ভারত", + "இந்தியா", + "ایران", + "ايران", + "عراق", + "الاردن", + "한국", + "қаз", + "ලංකා", + "இலங்கை", + "المغرب", + "мкд", + "мон", + "澳門", + "澳门", + "مليسيا", + "عمان", + "پاکستان", + "پاكستان", + "فلسطين", + "срб", + "пр.срб", + "орг.срб", + "обр.срб", + "од.срб", + "упр.срб", + "ак.срб", + "рф", + "قطر", + "السعودية", + "السعودیة", + "السعودیۃ", + "السعوديه", + "سودان", + "新加坡", + "சிங்கப்பூர்", + "سورية", + "سوريا", + "ไทย", + "ศึกษา.ไทย", + "ธุรกิจ.ไทย", + "รัฐบาล.ไทย", + "ทหาร.ไทย", + "เน็ต.ไทย", + "องค์กร.ไทย", + "تونس", + "台灣", + "台湾", + "臺灣", + "укр", + "اليمن", + "xxx", + "*.ye", + "ac.za", + "agric.za", + "alt.za", + "co.za", + "edu.za", + "gov.za", + "grondar.za", + "law.za", + "mil.za", + "net.za", + "ngo.za", + "nic.za", + "nis.za", + "nom.za", + "org.za", + "school.za", + "tm.za", + "web.za", + "zm", + "ac.zm", + "biz.zm", + "co.zm", + "com.zm", + "edu.zm", + "gov.zm", + "info.zm", + "mil.zm", + "net.zm", + "org.zm", + "sch.zm", + "zw", + "ac.zw", + "co.zw", + "gov.zw", + "mil.zw", + "org.zw", + "aaa", + "aarp", + "abarth", + "abb", + "abbott", + "abbvie", + "abc", + "able", + "abogado", + "abudhabi", + "academy", + "accenture", + "accountant", + "accountants", + "aco", + "actor", + "adac", + "ads", + "adult", + "aeg", + "aetna", + "afamilycompany", + "afl", + "africa", + "agakhan", + "agency", + "aig", + "aigo", + "airbus", + "airforce", + "airtel", + "akdn", + "alfaromeo", + "alibaba", + "alipay", + "allfinanz", + "allstate", + "ally", + "alsace", + "alstom", + "amazon", + "americanexpress", + "americanfamily", + "amex", + "amfam", + "amica", + "amsterdam", + "analytics", + "android", + "anquan", + "anz", + "aol", + "apartments", + "app", + "apple", + "aquarelle", + "arab", + "aramco", + "archi", + "army", + "art", + "arte", + "asda", + "associates", + "athleta", + "attorney", + "auction", + "audi", + "audible", + "audio", + "auspost", + "author", + "auto", + "autos", + "avianca", + "aws", + "axa", + "azure", + "baby", + "baidu", + "banamex", + "bananarepublic", + "band", + "bank", + "bar", + "barcelona", + "barclaycard", + "barclays", + "barefoot", + "bargains", + "baseball", + "basketball", + "bauhaus", + "bayern", + "bbc", + "bbt", + "bbva", + "bcg", + "bcn", + "beats", + "beauty", + "beer", + "bentley", + "berlin", + "best", + "bestbuy", + "bet", + "bharti", + "bible", + "bid", + "bike", + "bing", + "bingo", + "bio", + "black", + "blackfriday", + "blockbuster", + "blog", + "bloomberg", + "blue", + "bms", + "bmw", + "bnpparibas", + "boats", + "boehringer", + "bofa", + "bom", + "bond", + "boo", + "book", + "booking", + "bosch", + "bostik", + "boston", + "bot", + "boutique", + "box", + "bradesco", + "bridgestone", + "broadway", + "broker", + "brother", + "brussels", + "budapest", + "bugatti", + "build", + "builders", + "business", + "buy", + "buzz", + "bzh", + "cab", + "cafe", + "cal", + "call", + "calvinklein", + "cam", + "camera", + "camp", + "cancerresearch", + "canon", + "capetown", + "capital", + "capitalone", + "car", + "caravan", + "cards", + "care", + "career", + "careers", + "cars", + "casa", + "case", + "caseih", + "cash", + "casino", + "catering", + "catholic", + "cba", + "cbn", + "cbre", + "cbs", + "ceb", + "center", + "ceo", + "cern", + "cfa", + "cfd", + "chanel", + "channel", + "charity", + "chase", + "chat", + "cheap", + "chintai", + "christmas", + "chrome", + "church", + "cipriani", + "circle", + "cisco", + "citadel", + "citi", + "citic", + "city", + "cityeats", + "claims", + "cleaning", + "click", + "clinic", + "clinique", + "clothing", + "cloud", + "club", + "clubmed", + "coach", + "codes", + "coffee", + "college", + "cologne", + "comcast", + "commbank", + "community", + "company", + "compare", + "computer", + "comsec", + "condos", + "construction", + "consulting", + "contact", + "contractors", + "cooking", + "cookingchannel", + "cool", + "corsica", + "country", + "coupon", + "coupons", + "courses", + "cpa", + "credit", + "creditcard", + "creditunion", + "cricket", + "crown", + "crs", + "cruise", + "cruises", + "csc", + "cuisinella", + "cymru", + "cyou", + "dabur", + "dad", + "dance", + "data", + "date", + "dating", + "datsun", + "day", + "dclk", + "dds", + "deal", + "dealer", + "deals", + "degree", + "delivery", + "dell", + "deloitte", + "delta", + "democrat", + "dental", + "dentist", + "desi", + "design", + "dev", + "dhl", + "diamonds", + "diet", + "digital", + "direct", + "directory", + "discount", + "discover", + "dish", + "diy", + "dnp", + "docs", + "doctor", + "dog", + "domains", + "dot", + "download", + "drive", + "dtv", + "dubai", + "duck", + "dunlop", + "dupont", + "durban", + "dvag", + "dvr", + "earth", + "eat", + "eco", + "edeka", + "education", + "email", + "emerck", + "energy", + "engineer", + "engineering", + "enterprises", + "epson", + "equipment", + "ericsson", + "erni", + "esq", + "estate", + "esurance", + "etisalat", + "eurovision", + "eus", + "events", + "exchange", + "expert", + "exposed", + "express", + "extraspace", + "fage", + "fail", + "fairwinds", + "faith", + "family", + "fan", + "fans", + "farm", + "farmers", + "fashion", + "fast", + "fedex", + "feedback", + "ferrari", + "ferrero", + "fiat", + "fidelity", + "fido", + "film", + "final", + "finance", + "financial", + "fire", + "firestone", + "firmdale", + "fish", + "fishing", + "fit", + "fitness", + "flickr", + "flights", + "flir", + "florist", + "flowers", + "fly", + "foo", + "food", + "foodnetwork", + "football", + "ford", + "forex", + "forsale", + "forum", + "foundation", + "fox", + "free", + "fresenius", + "frl", + "frogans", + "frontdoor", + "frontier", + "ftr", + "fujitsu", + "fujixerox", + "fun", + "fund", + "furniture", + "futbol", + "fyi", + "gal", + "gallery", + "gallo", + "gallup", + "game", + "games", + "gap", + "garden", + "gay", + "gbiz", + "gdn", + "gea", + "gent", + "genting", + "george", + "ggee", + "gift", + "gifts", + "gives", + "giving", + "glade", + "glass", + "gle", + "global", + "globo", + "gmail", + "gmbh", + "gmo", + "gmx", + "godaddy", + "gold", + "goldpoint", + "golf", + "goo", + "goodyear", + "goog", + "google", + "gop", + "got", + "grainger", + "graphics", + "gratis", + "green", + "gripe", + "grocery", + "group", + "guardian", + "gucci", + "guge", + "guide", + "guitars", + "guru", + "hair", + "hamburg", + "hangout", + "haus", + "hbo", + "hdfc", + "hdfcbank", + "health", + "healthcare", + "help", + "helsinki", + "here", + "hermes", + "hgtv", + "hiphop", + "hisamitsu", + "hitachi", + "hiv", + "hkt", + "hockey", + "holdings", + "holiday", + "homedepot", + "homegoods", + "homes", + "homesense", + "honda", + "horse", + "hospital", + "host", + "hosting", + "hot", + "hoteles", + "hotels", + "hotmail", + "house", + "how", + "hsbc", + "hughes", + "hyatt", + "hyundai", + "ibm", + "icbc", + "ice", + "icu", + "ieee", + "ifm", + "ikano", + "imamat", + "imdb", + "immo", + "immobilien", + "inc", + "industries", + "infiniti", + "ing", + "ink", + "institute", + "insurance", + "insure", + "intel", + "international", + "intuit", + "investments", + "ipiranga", + "irish", + "ismaili", + "ist", + "istanbul", + "itau", + "itv", + "iveco", + "jaguar", + "java", + "jcb", + "jcp", + "jeep", + "jetzt", + "jewelry", + "jio", + "jll", + "jmp", + "jnj", + "joburg", + "jot", + "joy", + "jpmorgan", + "jprs", + "juegos", + "juniper", + "kaufen", + "kddi", + "kerryhotels", + "kerrylogistics", + "kerryproperties", + "kfh", + "kia", + "kim", + "kinder", + "kindle", + "kitchen", + "kiwi", + "koeln", + "komatsu", + "kosher", + "kpmg", + "kpn", + "krd", + "kred", + "kuokgroup", + "kyoto", + "lacaixa", + "lamborghini", + "lamer", + "lancaster", + "lancia", + "land", + "landrover", + "lanxess", + "lasalle", + "lat", + "latino", + "latrobe", + "law", + "lawyer", + "lds", + "lease", + "leclerc", + "lefrak", + "legal", + "lego", + "lexus", + "lgbt", + "lidl", + "life", + "lifeinsurance", + "lifestyle", + "lighting", + "like", + "lilly", + "limited", + "limo", + "lincoln", + "linde", + "link", + "lipsy", + "live", + "living", + "lixil", + "llc", + "llp", + "loan", + "loans", + "locker", + "locus", + "loft", + "lol", + "london", + "lotte", + "lotto", + "love", + "lpl", + "lplfinancial", + "ltd", + "ltda", + "lundbeck", + "lupin", + "luxe", + "luxury", + "macys", + "madrid", + "maif", + "maison", + "makeup", + "man", + "management", + "mango", + "map", + "market", + "marketing", + "markets", + "marriott", + "marshalls", + "maserati", + "mattel", + "mba", + "mckinsey", + "med", + "media", + "meet", + "melbourne", + "meme", + "memorial", + "men", + "menu", + "merckmsd", + "metlife", + "miami", + "microsoft", + "mini", + "mint", + "mit", + "mitsubishi", + "mlb", + "mls", + "mma", + "mobile", + "moda", + "moe", + "moi", + "mom", + "monash", + "money", + "monster", + "mormon", + "mortgage", + "moscow", + "moto", + "motorcycles", + "mov", + "movie", + "msd", + "mtn", + "mtr", + "mutual", + "nab", + "nadex", + "nagoya", + "nationwide", + "natura", + "navy", + "nba", + "nec", + "netbank", + "netflix", + "network", + "neustar", + "new", + "newholland", + "news", + "next", + "nextdirect", + "nexus", + "nfl", + "ngo", + "nhk", + "nico", + "nike", + "nikon", + "ninja", + "nissan", + "nissay", + "nokia", + "northwesternmutual", + "norton", + "now", + "nowruz", + "nowtv", + "nra", + "nrw", + "ntt", + "nyc", + "obi", + "observer", + "off", + "office", + "okinawa", + "olayan", + "olayangroup", + "oldnavy", + "ollo", + "omega", + "one", + "ong", + "onl", + "online", + "onyourside", + "ooo", + "open", + "oracle", + "orange", + "organic", + "origins", + "osaka", + "otsuka", + "ott", + "ovh", + "page", + "panasonic", + "paris", + "pars", + "partners", + "parts", + "party", + "passagens", + "pay", + "pccw", + "pet", + "pfizer", + "pharmacy", + "phd", + "philips", + "phone", + "photo", + "photography", + "photos", + "physio", + "pics", + "pictet", + "pictures", + "pid", + "pin", + "ping", + "pink", + "pioneer", + "pizza", + "place", + "play", + "playstation", + "plumbing", + "plus", + "pnc", + "pohl", + "poker", + "politie", + "porn", + "pramerica", + "praxi", + "press", + "prime", + "prod", + "productions", + "prof", + "progressive", + "promo", + "properties", + "property", + "protection", + "pru", + "prudential", + "pub", + "pwc", + "qpon", + "quebec", + "quest", + "qvc", + "racing", + "radio", + "raid", + "read", + "realestate", + "realtor", + "realty", + "recipes", + "red", + "redstone", + "redumbrella", + "rehab", + "reise", + "reisen", + "reit", + "reliance", + "ren", + "rent", + "rentals", + "repair", + "report", + "republican", + "rest", + "restaurant", + "review", + "reviews", + "rexroth", + "rich", + "richardli", + "ricoh", + "rightathome", + "ril", + "rio", + "rip", + "rmit", + "rocher", + "rocks", + "rodeo", + "rogers", + "room", + "rsvp", + "rugby", + "ruhr", + "run", + "rwe", + "ryukyu", + "saarland", + "safe", + "safety", + "sakura", + "sale", + "salon", + "samsclub", + "samsung", + "sandvik", + "sandvikcoromant", + "sanofi", + "sap", + "sarl", + "sas", + "save", + "saxo", + "sbi", + "sbs", + "sca", + "scb", + "schaeffler", + "schmidt", + "scholarships", + "school", + "schule", + "schwarz", + "science", + "scjohnson", + "scor", + "scot", + "search", + "seat", + "secure", + "security", + "seek", + "select", + "sener", + "services", + "ses", + "seven", + "sew", + "sex", + "sexy", + "sfr", + "shangrila", + "sharp", + "shaw", + "shell", + "shia", + "shiksha", + "shoes", + "shop", + "shopping", + "shouji", + "show", + "showtime", + "shriram", + "silk", + "sina", + "singles", + "site", + "ski", + "skin", + "sky", + "skype", + "sling", + "smart", + "smile", + "sncf", + "soccer", + "social", + "softbank", + "software", + "sohu", + "solar", + "solutions", + "song", + "sony", + "soy", + "spa", + "space", + "sport", + "spot", + "spreadbetting", + "srl", + "stada", + "staples", + "star", + "statebank", + "statefarm", + "stc", + "stcgroup", + "stockholm", + "storage", + "store", + "stream", + "studio", + "study", + "style", + "sucks", + "supplies", + "supply", + "support", + "surf", + "surgery", + "suzuki", + "swatch", + "swiftcover", + "swiss", + "sydney", + "symantec", + "systems", + "tab", + "taipei", + "talk", + "taobao", + "target", + "tatamotors", + "tatar", + "tattoo", + "tax", + "taxi", + "tci", + "tdk", + "team", + "tech", + "technology", + "temasek", + "tennis", + "teva", + "thd", + "theater", + "theatre", + "tiaa", + "tickets", + "tienda", + "tiffany", + "tips", + "tires", + "tirol", + "tjmaxx", + "tjx", + "tkmaxx", + "tmall", + "today", + "tokyo", + "tools", + "top", + "toray", + "toshiba", + "total", + "tours", + "town", + "toyota", + "toys", + "trade", + "trading", + "training", + "travel", + "travelchannel", + "travelers", + "travelersinsurance", + "trust", + "trv", + "tube", + "tui", + "tunes", + "tushu", + "tvs", + "ubank", + "ubs", + "unicom", + "university", + "uno", + "uol", + "ups", + "vacations", + "vana", + "vanguard", + "vegas", + "ventures", + "verisign", + "versicherung", + "vet", + "viajes", + "video", + "vig", + "viking", + "villas", + "vin", + "vip", + "virgin", + "visa", + "vision", + "viva", + "vivo", + "vlaanderen", + "vodka", + "volkswagen", + "volvo", + "vote", + "voting", + "voto", + "voyage", + "vuelos", + "wales", + "walmart", + "walter", + "wang", + "wanggou", + "watch", + "watches", + "weather", + "weatherchannel", + "webcam", + "weber", + "website", + "wed", + "wedding", + "weibo", + "weir", + "whoswho", + "wien", + "wiki", + "williamhill", + "win", + "windows", + "wine", + "winners", + "wme", + "wolterskluwer", + "woodside", + "work", + "works", + "world", + "wow", + "wtc", + "wtf", + "xbox", + "xerox", + "xfinity", + "xihuan", + "xin", + "कॉम", + "セール", + "佛山", + "慈善", + "集团", + "在线", + "大众汽车", + "点看", + "คอม", + "八卦", + "موقع", + "公益", + "公司", + "香格里拉", + "网站", + "移动", + "我爱你", + "москва", + "католик", + "онлайн", + "сайт", + "联通", + "קום", + "时尚", + "微博", + "淡马锡", + "ファッション", + "орг", + "नेट", + "ストア", + "アマゾン", + "삼성", + "商标", + "商店", + "商城", + "дети", + "ポイント", + "新闻", + "工行", + "家電", + "كوم", + "中文网", + "中信", + "娱乐", + "谷歌", + "電訊盈科", + "购物", + "クラウド", + "通販", + "网店", + "संगठन", + "餐厅", + "网络", + "ком", + "亚马逊", + "诺基亚", + "食品", + "飞利浦", + "手表", + "手机", + "ارامكو", + "العليان", + "اتصالات", + "بازار", + "ابوظبي", + "كاثوليك", + "همراه", + "닷컴", + "政府", + "شبكة", + "بيتك", + "عرب", + "机构", + "组织机构", + "健康", + "招聘", + "рус", + "珠宝", + "大拿", + "みんな", + "グーグル", + "世界", + "書籍", + "网址", + "닷넷", + "コム", + "天主教", + "游戏", + "vermögensberater", + "vermögensberatung", + "企业", + "信息", + "嘉里大酒店", + "嘉里", + "广东", + "政务", + "xyz", + "yachts", + "yahoo", + "yamaxun", + "yandex", + "yodobashi", + "yoga", + "yokohama", + "you", + "youtube", + "yun", + "zappos", + "zara", + "zero", + "zip", + "zone", + "zuerich", + "cc.ua", + "inf.ua", + "ltd.ua", + "adobeaemcloud.com", + "adobeaemcloud.net", + "*.dev.adobeaemcloud.com", + "beep.pl", + "barsy.ca", + "*.compute.estate", + "*.alces.network", + "altervista.org", + "alwaysdata.net", + "cloudfront.net", + "*.compute.amazonaws.com", + "*.compute-1.amazonaws.com", + "*.compute.amazonaws.com.cn", + "us-east-1.amazonaws.com", + "cn-north-1.eb.amazonaws.com.cn", + "cn-northwest-1.eb.amazonaws.com.cn", + "elasticbeanstalk.com", + "ap-northeast-1.elasticbeanstalk.com", + "ap-northeast-2.elasticbeanstalk.com", + "ap-northeast-3.elasticbeanstalk.com", + "ap-south-1.elasticbeanstalk.com", + "ap-southeast-1.elasticbeanstalk.com", + "ap-southeast-2.elasticbeanstalk.com", + "ca-central-1.elasticbeanstalk.com", + "eu-central-1.elasticbeanstalk.com", + "eu-west-1.elasticbeanstalk.com", + "eu-west-2.elasticbeanstalk.com", + "eu-west-3.elasticbeanstalk.com", + "sa-east-1.elasticbeanstalk.com", + "us-east-1.elasticbeanstalk.com", + "us-east-2.elasticbeanstalk.com", + "us-gov-west-1.elasticbeanstalk.com", + "us-west-1.elasticbeanstalk.com", + "us-west-2.elasticbeanstalk.com", + "*.elb.amazonaws.com", + "*.elb.amazonaws.com.cn", + "s3.amazonaws.com", + "s3-ap-northeast-1.amazonaws.com", + "s3-ap-northeast-2.amazonaws.com", + "s3-ap-south-1.amazonaws.com", + "s3-ap-southeast-1.amazonaws.com", + "s3-ap-southeast-2.amazonaws.com", + "s3-ca-central-1.amazonaws.com", + "s3-eu-central-1.amazonaws.com", + "s3-eu-west-1.amazonaws.com", + "s3-eu-west-2.amazonaws.com", + "s3-eu-west-3.amazonaws.com", + "s3-external-1.amazonaws.com", + "s3-fips-us-gov-west-1.amazonaws.com", + "s3-sa-east-1.amazonaws.com", + "s3-us-gov-west-1.amazonaws.com", + "s3-us-east-2.amazonaws.com", + "s3-us-west-1.amazonaws.com", + "s3-us-west-2.amazonaws.com", + "s3.ap-northeast-2.amazonaws.com", + "s3.ap-south-1.amazonaws.com", + "s3.cn-north-1.amazonaws.com.cn", + "s3.ca-central-1.amazonaws.com", + "s3.eu-central-1.amazonaws.com", + "s3.eu-west-2.amazonaws.com", + "s3.eu-west-3.amazonaws.com", + "s3.us-east-2.amazonaws.com", + "s3.dualstack.ap-northeast-1.amazonaws.com", + "s3.dualstack.ap-northeast-2.amazonaws.com", + "s3.dualstack.ap-south-1.amazonaws.com", + "s3.dualstack.ap-southeast-1.amazonaws.com", + "s3.dualstack.ap-southeast-2.amazonaws.com", + "s3.dualstack.ca-central-1.amazonaws.com", + "s3.dualstack.eu-central-1.amazonaws.com", + "s3.dualstack.eu-west-1.amazonaws.com", + "s3.dualstack.eu-west-2.amazonaws.com", + "s3.dualstack.eu-west-3.amazonaws.com", + "s3.dualstack.sa-east-1.amazonaws.com", + "s3.dualstack.us-east-1.amazonaws.com", + "s3.dualstack.us-east-2.amazonaws.com", + "s3-website-us-east-1.amazonaws.com", + "s3-website-us-west-1.amazonaws.com", + "s3-website-us-west-2.amazonaws.com", + "s3-website-ap-northeast-1.amazonaws.com", + "s3-website-ap-southeast-1.amazonaws.com", + "s3-website-ap-southeast-2.amazonaws.com", + "s3-website-eu-west-1.amazonaws.com", + "s3-website-sa-east-1.amazonaws.com", + "s3-website.ap-northeast-2.amazonaws.com", + "s3-website.ap-south-1.amazonaws.com", + "s3-website.ca-central-1.amazonaws.com", + "s3-website.eu-central-1.amazonaws.com", + "s3-website.eu-west-2.amazonaws.com", + "s3-website.eu-west-3.amazonaws.com", + "s3-website.us-east-2.amazonaws.com", + "amsw.nl", + "t3l3p0rt.net", + "tele.amune.org", + "apigee.io", + "on-aptible.com", + "user.aseinet.ne.jp", + "gv.vc", + "d.gv.vc", + "user.party.eus", + "pimienta.org", + "poivron.org", + "potager.org", + "sweetpepper.org", + "myasustor.com", + "myfritz.net", + "*.awdev.ca", + "*.advisor.ws", + "b-data.io", + "backplaneapp.io", + "balena-devices.com", + "app.banzaicloud.io", + "betainabox.com", + "bnr.la", + "blackbaudcdn.net", + "boomla.net", + "boxfuse.io", + "square7.ch", + "bplaced.com", + "bplaced.de", + "square7.de", + "bplaced.net", + "square7.net", + "browsersafetymark.io", + "uk0.bigv.io", + "dh.bytemark.co.uk", + "vm.bytemark.co.uk", + "mycd.eu", + "carrd.co", + "crd.co", + "uwu.ai", + "ae.org", + "ar.com", + "br.com", + "cn.com", + "com.de", + "com.se", + "de.com", + "eu.com", + "gb.com", + "gb.net", + "hu.com", + "hu.net", + "jp.net", + "jpn.com", + "kr.com", + "mex.com", + "no.com", + "qc.com", + "ru.com", + "sa.com", + "se.net", + "uk.com", + "uk.net", + "us.com", + "uy.com", + "za.bz", + "za.com", + "africa.com", + "gr.com", + "in.net", + "us.org", + "co.com", + "c.la", + "certmgr.org", + "xenapponazure.com", + "discourse.group", + "discourse.team", + "virtueeldomein.nl", + "cleverapps.io", + "*.lcl.dev", + "*.stg.dev", + "c66.me", + "cloud66.ws", + "cloud66.zone", + "jdevcloud.com", + "wpdevcloud.com", + "cloudaccess.host", + "freesite.host", + "cloudaccess.net", + "cloudcontrolled.com", + "cloudcontrolapp.com", + "cloudera.site", + "trycloudflare.com", + "workers.dev", + "wnext.app", + "co.ca", + "*.otap.co", + "co.cz", + "c.cdn77.org", + "cdn77-ssl.net", + "r.cdn77.net", + "rsc.cdn77.org", + "ssl.origin.cdn77-secure.org", + "cloudns.asia", + "cloudns.biz", + "cloudns.club", + "cloudns.cc", + "cloudns.eu", + "cloudns.in", + "cloudns.info", + "cloudns.org", + "cloudns.pro", + "cloudns.pw", + "cloudns.us", + "cloudeity.net", + "cnpy.gdn", + "co.nl", + "co.no", + "webhosting.be", + "hosting-cluster.nl", + "ac.ru", + "edu.ru", + "gov.ru", + "int.ru", + "mil.ru", + "test.ru", + "dyn.cosidns.de", + "dynamisches-dns.de", + "dnsupdater.de", + "internet-dns.de", + "l-o-g-i-n.de", + "dynamic-dns.info", + "feste-ip.net", + "knx-server.net", + "static-access.net", + "realm.cz", + "*.cryptonomic.net", + "cupcake.is", + "*.customer-oci.com", + "*.oci.customer-oci.com", + "*.ocp.customer-oci.com", + "*.ocs.customer-oci.com", + "cyon.link", + "cyon.site", + "daplie.me", + "localhost.daplie.me", + "dattolocal.com", + "dattorelay.com", + "dattoweb.com", + "mydatto.com", + "dattolocal.net", + "mydatto.net", + "biz.dk", + "co.dk", + "firm.dk", + "reg.dk", + "store.dk", + "*.dapps.earth", + "*.bzz.dapps.earth", + "builtwithdark.com", + "edgestack.me", + "debian.net", + "dedyn.io", + "dnshome.de", + "online.th", + "shop.th", + "drayddns.com", + "dreamhosters.com", + "mydrobo.com", + "drud.io", + "drud.us", + "duckdns.org", + "dy.fi", + "tunk.org", + "dyndns-at-home.com", + "dyndns-at-work.com", + "dyndns-blog.com", + "dyndns-free.com", + "dyndns-home.com", + "dyndns-ip.com", + "dyndns-mail.com", + "dyndns-office.com", + "dyndns-pics.com", + "dyndns-remote.com", + "dyndns-server.com", + "dyndns-web.com", + "dyndns-wiki.com", + "dyndns-work.com", + "dyndns.biz", + "dyndns.info", + "dyndns.org", + "dyndns.tv", + "at-band-camp.net", + "ath.cx", + "barrel-of-knowledge.info", + "barrell-of-knowledge.info", + "better-than.tv", + "blogdns.com", + "blogdns.net", + "blogdns.org", + "blogsite.org", + "boldlygoingnowhere.org", + "broke-it.net", + "buyshouses.net", + "cechire.com", + "dnsalias.com", + "dnsalias.net", + "dnsalias.org", + "dnsdojo.com", + "dnsdojo.net", + "dnsdojo.org", + "does-it.net", + "doesntexist.com", + "doesntexist.org", + "dontexist.com", + "dontexist.net", + "dontexist.org", + "doomdns.com", + "doomdns.org", + "dvrdns.org", + "dyn-o-saur.com", + "dynalias.com", + "dynalias.net", + "dynalias.org", + "dynathome.net", + "dyndns.ws", + "endofinternet.net", + "endofinternet.org", + "endoftheinternet.org", + "est-a-la-maison.com", + "est-a-la-masion.com", + "est-le-patron.com", + "est-mon-blogueur.com", + "for-better.biz", + "for-more.biz", + "for-our.info", + "for-some.biz", + "for-the.biz", + "forgot.her.name", + "forgot.his.name", + "from-ak.com", + "from-al.com", + "from-ar.com", + "from-az.net", + "from-ca.com", + "from-co.net", + "from-ct.com", + "from-dc.com", + "from-de.com", + "from-fl.com", + "from-ga.com", + "from-hi.com", + "from-ia.com", + "from-id.com", + "from-il.com", + "from-in.com", + "from-ks.com", + "from-ky.com", + "from-la.net", + "from-ma.com", + "from-md.com", + "from-me.org", + "from-mi.com", + "from-mn.com", + "from-mo.com", + "from-ms.com", + "from-mt.com", + "from-nc.com", + "from-nd.com", + "from-ne.com", + "from-nh.com", + "from-nj.com", + "from-nm.com", + "from-nv.com", + "from-ny.net", + "from-oh.com", + "from-ok.com", + "from-or.com", + "from-pa.com", + "from-pr.com", + "from-ri.com", + "from-sc.com", + "from-sd.com", + "from-tn.com", + "from-tx.com", + "from-ut.com", + "from-va.com", + "from-vt.com", + "from-wa.com", + "from-wi.com", + "from-wv.com", + "from-wy.com", + "ftpaccess.cc", + "fuettertdasnetz.de", + "game-host.org", + "game-server.cc", + "getmyip.com", + "gets-it.net", + "go.dyndns.org", + "gotdns.com", + "gotdns.org", + "groks-the.info", + "groks-this.info", + "ham-radio-op.net", + "here-for-more.info", + "hobby-site.com", + "hobby-site.org", + "home.dyndns.org", + "homedns.org", + "homeftp.net", + "homeftp.org", + "homeip.net", + "homelinux.com", + "homelinux.net", + "homelinux.org", + "homeunix.com", + "homeunix.net", + "homeunix.org", + "iamallama.com", + "in-the-band.net", + "is-a-anarchist.com", + "is-a-blogger.com", + "is-a-bookkeeper.com", + "is-a-bruinsfan.org", + "is-a-bulls-fan.com", + "is-a-candidate.org", + "is-a-caterer.com", + "is-a-celticsfan.org", + "is-a-chef.com", + "is-a-chef.net", + "is-a-chef.org", + "is-a-conservative.com", + "is-a-cpa.com", + "is-a-cubicle-slave.com", + "is-a-democrat.com", + "is-a-designer.com", + "is-a-doctor.com", + "is-a-financialadvisor.com", + "is-a-geek.com", + "is-a-geek.net", + "is-a-geek.org", + "is-a-green.com", + "is-a-guru.com", + "is-a-hard-worker.com", + "is-a-hunter.com", + "is-a-knight.org", + "is-a-landscaper.com", + "is-a-lawyer.com", + "is-a-liberal.com", + "is-a-libertarian.com", + "is-a-linux-user.org", + "is-a-llama.com", + "is-a-musician.com", + "is-a-nascarfan.com", + "is-a-nurse.com", + "is-a-painter.com", + "is-a-patsfan.org", + "is-a-personaltrainer.com", + "is-a-photographer.com", + "is-a-player.com", + "is-a-republican.com", + "is-a-rockstar.com", + "is-a-socialist.com", + "is-a-soxfan.org", + "is-a-student.com", + "is-a-teacher.com", + "is-a-techie.com", + "is-a-therapist.com", + "is-an-accountant.com", + "is-an-actor.com", + "is-an-actress.com", + "is-an-anarchist.com", + "is-an-artist.com", + "is-an-engineer.com", + "is-an-entertainer.com", + "is-by.us", + "is-certified.com", + "is-found.org", + "is-gone.com", + "is-into-anime.com", + "is-into-cars.com", + "is-into-cartoons.com", + "is-into-games.com", + "is-leet.com", + "is-lost.org", + "is-not-certified.com", + "is-saved.org", + "is-slick.com", + "is-uberleet.com", + "is-very-bad.org", + "is-very-evil.org", + "is-very-good.org", + "is-very-nice.org", + "is-very-sweet.org", + "is-with-theband.com", + "isa-geek.com", + "isa-geek.net", + "isa-geek.org", + "isa-hockeynut.com", + "issmarterthanyou.com", + "isteingeek.de", + "istmein.de", + "kicks-ass.net", + "kicks-ass.org", + "knowsitall.info", + "land-4-sale.us", + "lebtimnetz.de", + "leitungsen.de", + "likes-pie.com", + "likescandy.com", + "merseine.nu", + "mine.nu", + "misconfused.org", + "mypets.ws", + "myphotos.cc", + "neat-url.com", + "office-on-the.net", + "on-the-web.tv", + "podzone.net", + "podzone.org", + "readmyblog.org", + "saves-the-whales.com", + "scrapper-site.net", + "scrapping.cc", + "selfip.biz", + "selfip.com", + "selfip.info", + "selfip.net", + "selfip.org", + "sells-for-less.com", + "sells-for-u.com", + "sells-it.net", + "sellsyourhome.org", + "servebbs.com", + "servebbs.net", + "servebbs.org", + "serveftp.net", + "serveftp.org", + "servegame.org", + "shacknet.nu", + "simple-url.com", + "space-to-rent.com", + "stuff-4-sale.org", + "stuff-4-sale.us", + "teaches-yoga.com", + "thruhere.net", + "traeumtgerade.de", + "webhop.biz", + "webhop.info", + "webhop.net", + "webhop.org", + "worse-than.tv", + "writesthisblog.com", + "ddnss.de", + "dyn.ddnss.de", + "dyndns.ddnss.de", + "dyndns1.de", + "dyn-ip24.de", + "home-webserver.de", + "dyn.home-webserver.de", + "myhome-server.de", + "ddnss.org", + "definima.net", + "definima.io", + "bci.dnstrace.pro", + "ddnsfree.com", + "ddnsgeek.com", + "giize.com", + "gleeze.com", + "kozow.com", + "loseyourip.com", + "ooguy.com", + "theworkpc.com", + "casacam.net", + "dynu.net", + "accesscam.org", + "camdvr.org", + "freeddns.org", + "mywire.org", + "webredirect.org", + "myddns.rocks", + "blogsite.xyz", + "dynv6.net", + "e4.cz", + "en-root.fr", + "mytuleap.com", + "onred.one", + "staging.onred.one", + "enonic.io", + "customer.enonic.io", + "eu.org", + "al.eu.org", + "asso.eu.org", + "at.eu.org", + "au.eu.org", + "be.eu.org", + "bg.eu.org", + "ca.eu.org", + "cd.eu.org", + "ch.eu.org", + "cn.eu.org", + "cy.eu.org", + "cz.eu.org", + "de.eu.org", + "dk.eu.org", + "edu.eu.org", + "ee.eu.org", + "es.eu.org", + "fi.eu.org", + "fr.eu.org", + "gr.eu.org", + "hr.eu.org", + "hu.eu.org", + "ie.eu.org", + "il.eu.org", + "in.eu.org", + "int.eu.org", + "is.eu.org", + "it.eu.org", + "jp.eu.org", + "kr.eu.org", + "lt.eu.org", + "lu.eu.org", + "lv.eu.org", + "mc.eu.org", + "me.eu.org", + "mk.eu.org", + "mt.eu.org", + "my.eu.org", + "net.eu.org", + "ng.eu.org", + "nl.eu.org", + "no.eu.org", + "nz.eu.org", + "paris.eu.org", + "pl.eu.org", + "pt.eu.org", + "q-a.eu.org", + "ro.eu.org", + "ru.eu.org", + "se.eu.org", + "si.eu.org", + "sk.eu.org", + "tr.eu.org", + "uk.eu.org", + "us.eu.org", + "eu-1.evennode.com", + "eu-2.evennode.com", + "eu-3.evennode.com", + "eu-4.evennode.com", + "us-1.evennode.com", + "us-2.evennode.com", + "us-3.evennode.com", + "us-4.evennode.com", + "twmail.cc", + "twmail.net", + "twmail.org", + "mymailer.com.tw", + "url.tw", + "apps.fbsbx.com", + "ru.net", + "adygeya.ru", + "bashkiria.ru", + "bir.ru", + "cbg.ru", + "com.ru", + "dagestan.ru", + "grozny.ru", + "kalmykia.ru", + "kustanai.ru", + "marine.ru", + "mordovia.ru", + "msk.ru", + "mytis.ru", + "nalchik.ru", + "nov.ru", + "pyatigorsk.ru", + "spb.ru", + "vladikavkaz.ru", + "vladimir.ru", + "abkhazia.su", + "adygeya.su", + "aktyubinsk.su", + "arkhangelsk.su", + "armenia.su", + "ashgabad.su", + "azerbaijan.su", + "balashov.su", + "bashkiria.su", + "bryansk.su", + "bukhara.su", + "chimkent.su", + "dagestan.su", + "east-kazakhstan.su", + "exnet.su", + "georgia.su", + "grozny.su", + "ivanovo.su", + "jambyl.su", + "kalmykia.su", + "kaluga.su", + "karacol.su", + "karaganda.su", + "karelia.su", + "khakassia.su", + "krasnodar.su", + "kurgan.su", + "kustanai.su", + "lenug.su", + "mangyshlak.su", + "mordovia.su", + "msk.su", + "murmansk.su", + "nalchik.su", + "navoi.su", + "north-kazakhstan.su", + "nov.su", + "obninsk.su", + "penza.su", + "pokrovsk.su", + "sochi.su", + "spb.su", + "tashkent.su", + "termez.su", + "togliatti.su", + "troitsk.su", + "tselinograd.su", + "tula.su", + "tuva.su", + "vladikavkaz.su", + "vladimir.su", + "vologda.su", + "channelsdvr.net", + "u.channelsdvr.net", + "fastly-terrarium.com", + "fastlylb.net", + "map.fastlylb.net", + "freetls.fastly.net", + "map.fastly.net", + "a.prod.fastly.net", + "global.prod.fastly.net", + "a.ssl.fastly.net", + "b.ssl.fastly.net", + "global.ssl.fastly.net", + "fastpanel.direct", + "fastvps-server.com", + "fhapp.xyz", + "fedorainfracloud.org", + "fedorapeople.org", + "cloud.fedoraproject.org", + "app.os.fedoraproject.org", + "app.os.stg.fedoraproject.org", + "mydobiss.com", + "filegear.me", + "filegear-au.me", + "filegear-de.me", + "filegear-gb.me", + "filegear-ie.me", + "filegear-jp.me", + "filegear-sg.me", + "firebaseapp.com", + "flynnhub.com", + "flynnhosting.net", + "0e.vc", + "freebox-os.com", + "freeboxos.com", + "fbx-os.fr", + "fbxos.fr", + "freebox-os.fr", + "freeboxos.fr", + "freedesktop.org", + "*.futurecms.at", + "*.ex.futurecms.at", + "*.in.futurecms.at", + "futurehosting.at", + "futuremailing.at", + "*.ex.ortsinfo.at", + "*.kunden.ortsinfo.at", + "*.statics.cloud", + "service.gov.uk", + "gehirn.ne.jp", + "usercontent.jp", + "gentapps.com", + "lab.ms", + "github.io", + "githubusercontent.com", + "gitlab.io", + "glitch.me", + "lolipop.io", + "cloudapps.digital", + "london.cloudapps.digital", + "homeoffice.gov.uk", + "ro.im", + "shop.ro", + "goip.de", + "run.app", + "a.run.app", + "web.app", + "*.0emm.com", + "appspot.com", + "*.r.appspot.com", + "blogspot.ae", + "blogspot.al", + "blogspot.am", + "blogspot.ba", + "blogspot.be", + "blogspot.bg", + "blogspot.bj", + "blogspot.ca", + "blogspot.cf", + "blogspot.ch", + "blogspot.cl", + "blogspot.co.at", + "blogspot.co.id", + "blogspot.co.il", + "blogspot.co.ke", + "blogspot.co.nz", + "blogspot.co.uk", + "blogspot.co.za", + "blogspot.com", + "blogspot.com.ar", + "blogspot.com.au", + "blogspot.com.br", + "blogspot.com.by", + "blogspot.com.co", + "blogspot.com.cy", + "blogspot.com.ee", + "blogspot.com.eg", + "blogspot.com.es", + "blogspot.com.mt", + "blogspot.com.ng", + "blogspot.com.tr", + "blogspot.com.uy", + "blogspot.cv", + "blogspot.cz", + "blogspot.de", + "blogspot.dk", + "blogspot.fi", + "blogspot.fr", + "blogspot.gr", + "blogspot.hk", + "blogspot.hr", + "blogspot.hu", + "blogspot.ie", + "blogspot.in", + "blogspot.is", + "blogspot.it", + "blogspot.jp", + "blogspot.kr", + "blogspot.li", + "blogspot.lt", + "blogspot.lu", + "blogspot.md", + "blogspot.mk", + "blogspot.mr", + "blogspot.mx", + "blogspot.my", + "blogspot.nl", + "blogspot.no", + "blogspot.pe", + "blogspot.pt", + "blogspot.qa", + "blogspot.re", + "blogspot.ro", + "blogspot.rs", + "blogspot.ru", + "blogspot.se", + "blogspot.sg", + "blogspot.si", + "blogspot.sk", + "blogspot.sn", + "blogspot.td", + "blogspot.tw", + "blogspot.ug", + "blogspot.vn", + "cloudfunctions.net", + "cloud.goog", + "codespot.com", + "googleapis.com", + "googlecode.com", + "pagespeedmobilizer.com", + "publishproxy.com", + "withgoogle.com", + "withyoutube.com", + "awsmppl.com", + "fin.ci", + "free.hr", + "caa.li", + "ua.rs", + "conf.se", + "hs.zone", + "hs.run", + "hashbang.sh", + "hasura.app", + "hasura-app.io", + "hepforge.org", + "herokuapp.com", + "herokussl.com", + "myravendb.com", + "ravendb.community", + "ravendb.me", + "development.run", + "ravendb.run", + "bpl.biz", + "orx.biz", + "ng.city", + "biz.gl", + "ng.ink", + "col.ng", + "firm.ng", + "gen.ng", + "ltd.ng", + "ngo.ng", + "ng.school", + "sch.so", + "häkkinen.fi", + "*.moonscale.io", + "moonscale.net", + "iki.fi", + "dyn-berlin.de", + "in-berlin.de", + "in-brb.de", + "in-butter.de", + "in-dsl.de", + "in-dsl.net", + "in-dsl.org", + "in-vpn.de", + "in-vpn.net", + "in-vpn.org", + "biz.at", + "info.at", + "info.cx", + "ac.leg.br", + "al.leg.br", + "am.leg.br", + "ap.leg.br", + "ba.leg.br", + "ce.leg.br", + "df.leg.br", + "es.leg.br", + "go.leg.br", + "ma.leg.br", + "mg.leg.br", + "ms.leg.br", + "mt.leg.br", + "pa.leg.br", + "pb.leg.br", + "pe.leg.br", + "pi.leg.br", + "pr.leg.br", + "rj.leg.br", + "rn.leg.br", + "ro.leg.br", + "rr.leg.br", + "rs.leg.br", + "sc.leg.br", + "se.leg.br", + "sp.leg.br", + "to.leg.br", + "pixolino.com", + "ipifony.net", + "mein-iserv.de", + "test-iserv.de", + "iserv.dev", + "iobb.net", + "myjino.ru", + "*.hosting.myjino.ru", + "*.landing.myjino.ru", + "*.spectrum.myjino.ru", + "*.vps.myjino.ru", + "*.triton.zone", + "*.cns.joyent.com", + "js.org", + "kaas.gg", + "khplay.nl", + "keymachine.de", + "kinghost.net", + "uni5.net", + "knightpoint.systems", + "oya.to", + "co.krd", + "edu.krd", + "git-repos.de", + "lcube-server.de", + "svn-repos.de", + "leadpages.co", + "lpages.co", + "lpusercontent.com", + "lelux.site", + "co.business", + "co.education", + "co.events", + "co.financial", + "co.network", + "co.place", + "co.technology", + "app.lmpm.com", + "linkitools.space", + "linkyard.cloud", + "linkyard-cloud.ch", + "members.linode.com", + "nodebalancer.linode.com", + "we.bs", + "loginline.app", + "loginline.dev", + "loginline.io", + "loginline.services", + "loginline.site", + "krasnik.pl", + "leczna.pl", + "lubartow.pl", + "lublin.pl", + "poniatowa.pl", + "swidnik.pl", + "uklugs.org", + "glug.org.uk", + "lug.org.uk", + "lugs.org.uk", + "barsy.bg", + "barsy.co.uk", + "barsyonline.co.uk", + "barsycenter.com", + "barsyonline.com", + "barsy.club", + "barsy.de", + "barsy.eu", + "barsy.in", + "barsy.info", + "barsy.io", + "barsy.me", + "barsy.menu", + "barsy.mobi", + "barsy.net", + "barsy.online", + "barsy.org", + "barsy.pro", + "barsy.pub", + "barsy.shop", + "barsy.site", + "barsy.support", + "barsy.uk", + "*.magentosite.cloud", + "mayfirst.info", + "mayfirst.org", + "hb.cldmail.ru", + "miniserver.com", + "memset.net", + "cloud.metacentrum.cz", + "custom.metacentrum.cz", + "flt.cloud.muni.cz", + "usr.cloud.muni.cz", + "meteorapp.com", + "eu.meteorapp.com", + "co.pl", + "azurecontainer.io", + "azurewebsites.net", + "azure-mobile.net", + "cloudapp.net", + "mozilla-iot.org", + "bmoattachments.org", + "net.ru", + "org.ru", + "pp.ru", + "ui.nabu.casa", + "pony.club", + "of.fashion", + "on.fashion", + "of.football", + "in.london", + "of.london", + "for.men", + "and.mom", + "for.mom", + "for.one", + "for.sale", + "of.work", + "to.work", + "nctu.me", + "bitballoon.com", + "netlify.com", + "4u.com", + "ngrok.io", + "nh-serv.co.uk", + "nfshost.com", + "dnsking.ch", + "mypi.co", + "n4t.co", + "001www.com", + "ddnslive.com", + "myiphost.com", + "forumz.info", + "16-b.it", + "32-b.it", + "64-b.it", + "soundcast.me", + "tcp4.me", + "dnsup.net", + "hicam.net", + "now-dns.net", + "ownip.net", + "vpndns.net", + "dynserv.org", + "now-dns.org", + "x443.pw", + "now-dns.top", + "ntdll.top", + "freeddns.us", + "crafting.xyz", + "zapto.xyz", + "nsupdate.info", + "nerdpol.ovh", + "blogsyte.com", + "brasilia.me", + "cable-modem.org", + "ciscofreak.com", + "collegefan.org", + "couchpotatofries.org", + "damnserver.com", + "ddns.me", + "ditchyourip.com", + "dnsfor.me", + "dnsiskinky.com", + "dvrcam.info", + "dynns.com", + "eating-organic.net", + "fantasyleague.cc", + "geekgalaxy.com", + "golffan.us", + "health-carereform.com", + "homesecuritymac.com", + "homesecuritypc.com", + "hopto.me", + "ilovecollege.info", + "loginto.me", + "mlbfan.org", + "mmafan.biz", + "myactivedirectory.com", + "mydissent.net", + "myeffect.net", + "mymediapc.net", + "mypsx.net", + "mysecuritycamera.com", + "mysecuritycamera.net", + "mysecuritycamera.org", + "net-freaks.com", + "nflfan.org", + "nhlfan.net", + "no-ip.ca", + "no-ip.co.uk", + "no-ip.net", + "noip.us", + "onthewifi.com", + "pgafan.net", + "point2this.com", + "pointto.us", + "privatizehealthinsurance.net", + "quicksytes.com", + "read-books.org", + "securitytactics.com", + "serveexchange.com", + "servehumour.com", + "servep2p.com", + "servesarcasm.com", + "stufftoread.com", + "ufcfan.org", + "unusualperson.com", + "workisboring.com", + "3utilities.com", + "bounceme.net", + "ddns.net", + "ddnsking.com", + "gotdns.ch", + "hopto.org", + "myftp.biz", + "myftp.org", + "myvnc.com", + "no-ip.biz", + "no-ip.info", + "no-ip.org", + "noip.me", + "redirectme.net", + "servebeer.com", + "serveblog.net", + "servecounterstrike.com", + "serveftp.com", + "servegame.com", + "servehalflife.com", + "servehttp.com", + "serveirc.com", + "serveminecraft.net", + "servemp3.com", + "servepics.com", + "servequake.com", + "sytes.net", + "webhop.me", + "zapto.org", + "stage.nodeart.io", + "nodum.co", + "nodum.io", + "pcloud.host", + "nyc.mn", + "nom.ae", + "nom.af", + "nom.ai", + "nom.al", + "nym.by", + "nom.bz", + "nym.bz", + "nom.cl", + "nym.ec", + "nom.gd", + "nom.ge", + "nom.gl", + "nym.gr", + "nom.gt", + "nym.gy", + "nym.hk", + "nom.hn", + "nym.ie", + "nom.im", + "nom.ke", + "nym.kz", + "nym.la", + "nym.lc", + "nom.li", + "nym.li", + "nym.lt", + "nym.lu", + "nom.lv", + "nym.me", + "nom.mk", + "nym.mn", + "nym.mx", + "nom.nu", + "nym.nz", + "nym.pe", + "nym.pt", + "nom.pw", + "nom.qa", + "nym.ro", + "nom.rs", + "nom.si", + "nym.sk", + "nom.st", + "nym.su", + "nym.sx", + "nom.tj", + "nym.tw", + "nom.ug", + "nom.uy", + "nom.vc", + "nom.vg", + "static.observableusercontent.com", + "cya.gg", + "cloudycluster.net", + "nid.io", + "opencraft.hosting", + "operaunite.com", + "skygearapp.com", + "outsystemscloud.com", + "ownprovider.com", + "own.pm", + "ox.rs", + "oy.lc", + "pgfog.com", + "pagefrontapp.com", + "art.pl", + "gliwice.pl", + "krakow.pl", + "poznan.pl", + "wroc.pl", + "zakopane.pl", + "pantheonsite.io", + "gotpantheon.com", + "mypep.link", + "perspecta.cloud", + "on-web.fr", + "*.platform.sh", + "*.platformsh.site", + "dyn53.io", + "co.bn", + "xen.prgmr.com", + "priv.at", + "prvcy.page", + "*.dweb.link", + "protonet.io", + "chirurgiens-dentistes-en-france.fr", + "byen.site", + "pubtls.org", + "qualifioapp.com", + "qbuser.com", + "instantcloud.cn", + "ras.ru", + "qa2.com", + "qcx.io", + "*.sys.qcx.io", + "dev-myqnapcloud.com", + "alpha-myqnapcloud.com", + "myqnapcloud.com", + "*.quipelements.com", + "vapor.cloud", + "vaporcloud.io", + "rackmaze.com", + "rackmaze.net", + "*.on-k3s.io", + "*.on-rancher.cloud", + "*.on-rio.io", + "readthedocs.io", + "rhcloud.com", + "app.render.com", + "onrender.com", + "repl.co", + "repl.run", + "resindevice.io", + "devices.resinstaging.io", + "hzc.io", + "wellbeingzone.eu", + "ptplus.fit", + "wellbeingzone.co.uk", + "git-pages.rit.edu", + "sandcats.io", + "logoip.de", + "logoip.com", + "schokokeks.net", + "gov.scot", + "scrysec.com", + "firewall-gateway.com", + "firewall-gateway.de", + "my-gateway.de", + "my-router.de", + "spdns.de", + "spdns.eu", + "firewall-gateway.net", + "my-firewall.org", + "myfirewall.org", + "spdns.org", + "senseering.net", + "biz.ua", + "co.ua", + "pp.ua", + "shiftedit.io", + "myshopblocks.com", + "shopitsite.com", + "mo-siemens.io", + "1kapp.com", + "appchizi.com", + "applinzi.com", + "sinaapp.com", + "vipsinaapp.com", + "siteleaf.net", + "bounty-full.com", + "alpha.bounty-full.com", + "beta.bounty-full.com", + "stackhero-network.com", + "static.land", + "dev.static.land", + "sites.static.land", + "apps.lair.io", + "*.stolos.io", + "spacekit.io", + "customer.speedpartner.de", + "api.stdlib.com", + "storj.farm", + "utwente.io", + "soc.srcf.net", + "user.srcf.net", + "temp-dns.com", + "applicationcloud.io", + "scapp.io", + "*.s5y.io", + "*.sensiosite.cloud", + "syncloud.it", + "diskstation.me", + "dscloud.biz", + "dscloud.me", + "dscloud.mobi", + "dsmynas.com", + "dsmynas.net", + "dsmynas.org", + "familyds.com", + "familyds.net", + "familyds.org", + "i234.me", + "myds.me", + "synology.me", + "vpnplus.to", + "direct.quickconnect.to", + "taifun-dns.de", + "gda.pl", + "gdansk.pl", + "gdynia.pl", + "med.pl", + "sopot.pl", + "edugit.org", + "telebit.app", + "telebit.io", + "*.telebit.xyz", + "gwiddle.co.uk", + "thingdustdata.com", + "cust.dev.thingdust.io", + "cust.disrec.thingdust.io", + "cust.prod.thingdust.io", + "cust.testing.thingdust.io", + "arvo.network", + "azimuth.network", + "bloxcms.com", + "townnews-staging.com", + "12hp.at", + "2ix.at", + "4lima.at", + "lima-city.at", + "12hp.ch", + "2ix.ch", + "4lima.ch", + "lima-city.ch", + "trafficplex.cloud", + "de.cool", + "12hp.de", + "2ix.de", + "4lima.de", + "lima-city.de", + "1337.pictures", + "clan.rip", + "lima-city.rocks", + "webspace.rocks", + "lima.zone", + "*.transurl.be", + "*.transurl.eu", + "*.transurl.nl", + "tuxfamily.org", + "dd-dns.de", + "diskstation.eu", + "diskstation.org", + "dray-dns.de", + "draydns.de", + "dyn-vpn.de", + "dynvpn.de", + "mein-vigor.de", + "my-vigor.de", + "my-wan.de", + "syno-ds.de", + "synology-diskstation.de", + "synology-ds.de", + "uber.space", + "*.uberspace.de", + "hk.com", + "hk.org", + "ltd.hk", + "inc.hk", + "virtualuser.de", + "virtual-user.de", + "urown.cloud", + "dnsupdate.info", + "lib.de.us", + "2038.io", + "router.management", + "v-info.info", + "voorloper.cloud", + "v.ua", + "wafflecell.com", + "*.webhare.dev", + "wedeploy.io", + "wedeploy.me", + "wedeploy.sh", + "remotewd.com", + "wmflabs.org", + "myforum.community", + "community-pro.de", + "diskussionsbereich.de", + "community-pro.net", + "meinforum.net", + "half.host", + "xnbay.com", + "u2.xnbay.com", + "u2-local.xnbay.com", + "cistron.nl", + "demon.nl", + "xs4all.space", + "yandexcloud.net", + "storage.yandexcloud.net", + "website.yandexcloud.net", + "official.academy", + "yolasite.com", + "ybo.faith", + "yombo.me", + "homelink.one", + "ybo.party", + "ybo.review", + "ybo.science", + "ybo.trade", + "nohost.me", + "noho.st", + "za.net", + "za.org", + "now.sh", + "bss.design", + "basicserver.io", + "virtualserver.io", + "enterprisecloud.nu" +]; + +/*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */ + +var psl = createCommonjsModule(function (module, exports) { + + + + + +var internals = {}; + + +// +// Read rules from file. +// +internals.rules = require$$0.map(function (rule) { + + return { + rule: rule, + suffix: rule.replace(/^(\*\.|\!)/, ''), + punySuffix: -1, + wildcard: rule.charAt(0) === '*', + exception: rule.charAt(0) === '!' + }; +}); + + +// +// Check is given string ends with `suffix`. +// +internals.endsWith = function (str, suffix) { + + return str.indexOf(suffix, str.length - suffix.length) !== -1; +}; + + +// +// Find rule for a given domain. +// +internals.findRule = function (domain) { + + var punyDomain = Punycode__default['default'].toASCII(domain); + return internals.rules.reduce(function (memo, rule) { + + if (rule.punySuffix === -1){ + rule.punySuffix = Punycode__default['default'].toASCII(rule.suffix); + } + if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) { + return memo; + } + // This has been commented out as it never seems to run. This is because + // sub tlds always appear after their parents and we never find a shorter + // match. + //if (memo) { + // var memoSuffix = Punycode.toASCII(memo.suffix); + // if (memoSuffix.length >= punySuffix.length) { + // return memo; + // } + //} + return rule; + }, null); +}; + + +// +// Error codes and messages. +// +exports.errorCodes = { + DOMAIN_TOO_SHORT: 'Domain name too short.', + DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.', + LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.', + LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.', + LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.', + LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.', + LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.' +}; + + +// +// Validate domain name and throw if not valid. +// +// From wikipedia: +// +// Hostnames are composed of series of labels concatenated with dots, as are all +// domain names. Each label must be between 1 and 63 characters long, and the +// entire hostname (including the delimiting dots) has a maximum of 255 chars. +// +// Allowed chars: +// +// * `a-z` +// * `0-9` +// * `-` but not as a starting or ending character +// * `.` as a separator for the textual portions of a domain name +// +// * http://en.wikipedia.org/wiki/Domain_name +// * http://en.wikipedia.org/wiki/Hostname +// +internals.validate = function (input) { + + // Before we can validate we need to take care of IDNs with unicode chars. + var ascii = Punycode__default['default'].toASCII(input); + + if (ascii.length < 1) { + return 'DOMAIN_TOO_SHORT'; + } + if (ascii.length > 255) { + return 'DOMAIN_TOO_LONG'; + } + + // Check each part's length and allowed chars. + var labels = ascii.split('.'); + var label; + + for (var i = 0; i < labels.length; ++i) { + label = labels[i]; + if (!label.length) { + return 'LABEL_TOO_SHORT'; + } + if (label.length > 63) { + return 'LABEL_TOO_LONG'; + } + if (label.charAt(0) === '-') { + return 'LABEL_STARTS_WITH_DASH'; + } + if (label.charAt(label.length - 1) === '-') { + return 'LABEL_ENDS_WITH_DASH'; + } + if (!/^[a-z0-9\-]+$/.test(label)) { + return 'LABEL_INVALID_CHARS'; + } + } +}; + + +// +// Public API +// + + +// +// Parse domain. +// +exports.parse = function (input) { + + if (typeof input !== 'string') { + throw new TypeError('Domain name must be a string.'); + } + + // Force domain to lowercase. + var domain = input.slice(0).toLowerCase(); + + // Handle FQDN. + // TODO: Simply remove trailing dot? + if (domain.charAt(domain.length - 1) === '.') { + domain = domain.slice(0, domain.length - 1); + } + + // Validate and sanitise input. + var error = internals.validate(domain); + if (error) { + return { + input: input, + error: { + message: exports.errorCodes[error], + code: error + } + }; + } + + var parsed = { + input: input, + tld: null, + sld: null, + domain: null, + subdomain: null, + listed: false + }; + + var domainParts = domain.split('.'); + + // Non-Internet TLD + if (domainParts[domainParts.length - 1] === 'local') { + return parsed; + } + + var handlePunycode = function () { + + if (!/xn--/.test(domain)) { + return parsed; + } + if (parsed.domain) { + parsed.domain = Punycode__default['default'].toASCII(parsed.domain); + } + if (parsed.subdomain) { + parsed.subdomain = Punycode__default['default'].toASCII(parsed.subdomain); + } + return parsed; + }; + + var rule = internals.findRule(domain); + + // Unlisted tld. + if (!rule) { + if (domainParts.length < 2) { + return parsed; + } + parsed.tld = domainParts.pop(); + parsed.sld = domainParts.pop(); + parsed.domain = [parsed.sld, parsed.tld].join('.'); + if (domainParts.length) { + parsed.subdomain = domainParts.pop(); + } + return handlePunycode(); + } + + // At this point we know the public suffix is listed. + parsed.listed = true; + + var tldParts = rule.suffix.split('.'); + var privateParts = domainParts.slice(0, domainParts.length - tldParts.length); + + if (rule.exception) { + privateParts.push(tldParts.shift()); + } + + parsed.tld = tldParts.join('.'); + + if (!privateParts.length) { + return handlePunycode(); + } + + if (rule.wildcard) { + tldParts.unshift(privateParts.pop()); + parsed.tld = tldParts.join('.'); + } + + if (!privateParts.length) { + return handlePunycode(); + } + + parsed.sld = privateParts.pop(); + parsed.domain = [parsed.sld, parsed.tld].join('.'); + + if (privateParts.length) { + parsed.subdomain = privateParts.join('.'); + } + + return handlePunycode(); +}; + + +// +// Get domain. +// +exports.get = function (domain) { + + if (!domain) { + return null; + } + return exports.parse(domain).domain || null; +}; + + +// +// Check whether domain belongs to a known public suffix. +// +exports.isValid = function (domain) { + + var parsed = exports.parse(domain); + return Boolean(parsed.domain && parsed.listed); +}; +}); + +/*! + * Copyright (c) 2018, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +function getPublicSuffix(domain) { + return psl.get(domain); +} + +var getPublicSuffix_1 = getPublicSuffix; + +var pubsuffixPsl = { + getPublicSuffix: getPublicSuffix_1 +}; + +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/*jshint unused:false */ + +class Store { + constructor() { + this.synchronous = false; + } + + findCookie(domain, path, key, cb) { + throw new Error("findCookie is not implemented"); + } + + findCookies(domain, path, allowSpecialUseDomain, cb) { + throw new Error("findCookies is not implemented"); + } + + putCookie(cookie, cb) { + throw new Error("putCookie is not implemented"); + } + + updateCookie(oldCookie, newCookie, cb) { + // recommended default implementation: + // return this.putCookie(newCookie, cb); + throw new Error("updateCookie is not implemented"); + } + + removeCookie(domain, path, key, cb) { + throw new Error("removeCookie is not implemented"); + } + + removeCookies(domain, path, cb) { + throw new Error("removeCookies is not implemented"); + } + + removeAllCookies(cb) { + throw new Error("removeAllCookies is not implemented"); + } + + getAllCookies(cb) { + throw new Error( + "getAllCookies is not implemented (therefore jar cannot be serialized)" + ); + } +} + +var Store_1 = Store; + +var store = { + Store: Store_1 +}; + +var fromCallback = function (fn) { + return Object.defineProperty(function () { + if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments); + else { + return new Promise((resolve, reject) => { + arguments[arguments.length] = (err, res) => { + if (err) return reject(err) + resolve(res); + }; + arguments.length++; + fn.apply(this, arguments); + }) + } + }, 'name', { value: fn.name }) +}; + +var fromPromise = function (fn) { + return Object.defineProperty(function () { + const cb = arguments[arguments.length - 1]; + if (typeof cb !== 'function') return fn.apply(this, arguments) + else fn.apply(this, arguments).then(r => cb(null, r), cb); + }, 'name', { value: fn.name }) +}; + +var universalify = { + fromCallback: fromCallback, + fromPromise: fromPromise +}; + +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +// Gives the permutation of all possible domainMatch()es of a given domain. The +// array is in shortest-to-longest order. Handy for indexing. +const SPECIAL_USE_DOMAINS = ["local"]; // RFC 6761 +function permuteDomain(domain, allowSpecialUseDomain) { + let pubSuf = null; + if (allowSpecialUseDomain) { + const domainParts = domain.split("."); + if (SPECIAL_USE_DOMAINS.includes(domainParts[domainParts.length - 1])) { + pubSuf = `${domainParts[domainParts.length - 2]}.${ + domainParts[domainParts.length - 1] + }`; + } else { + pubSuf = pubsuffixPsl.getPublicSuffix(domain); + } + } else { + pubSuf = pubsuffixPsl.getPublicSuffix(domain); + } + + if (!pubSuf) { + return null; + } + if (pubSuf == domain) { + return [domain]; + } + + const prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" + const parts = prefix.split(".").reverse(); + let cur = pubSuf; + const permutations = [cur]; + while (parts.length) { + cur = `${parts.shift()}.${cur}`; + permutations.push(cur); + } + return permutations; +} + +var permuteDomain_2 = permuteDomain; + +var permuteDomain_1 = { + permuteDomain: permuteDomain_2 +}; + +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* + * "A request-path path-matches a given cookie-path if at least one of the + * following conditions holds:" + */ +function pathMatch(reqPath, cookiePath) { + // "o The cookie-path and the request-path are identical." + if (cookiePath === reqPath) { + return true; + } + + const idx = reqPath.indexOf(cookiePath); + if (idx === 0) { + // "o The cookie-path is a prefix of the request-path, and the last + // character of the cookie-path is %x2F ("/")." + if (cookiePath.substr(-1) === "/") { + return true; + } + + // " o The cookie-path is a prefix of the request-path, and the first + // character of the request-path that is not included in the cookie- path + // is a %x2F ("/") character." + if (reqPath.substr(cookiePath.length, 1) === "/") { + return true; + } + } + + return false; +} + +var pathMatch_2 = pathMatch; + +var pathMatch_1 = { + pathMatch: pathMatch_2 +}; + +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +const { fromCallback: fromCallback$1 } = universalify; +const Store$1 = store.Store; +const permuteDomain$1 = permuteDomain_1.permuteDomain; +const pathMatch$1 = pathMatch_1.pathMatch; + + +class MemoryCookieStore extends Store$1 { + constructor() { + super(); + this.synchronous = true; + this.idx = {}; + if (util__default['default'].inspect.custom) { + this[util__default['default'].inspect.custom] = this.inspect; + } + } + + inspect() { + return `{ idx: ${util__default['default'].inspect(this.idx, false, 2)} }`; + } + + findCookie(domain, path, key, cb) { + if (!this.idx[domain]) { + return cb(null, undefined); + } + if (!this.idx[domain][path]) { + return cb(null, undefined); + } + return cb(null, this.idx[domain][path][key] || null); + } + findCookies(domain, path, allowSpecialUseDomain, cb) { + const results = []; + if (typeof allowSpecialUseDomain === "function") { + cb = allowSpecialUseDomain; + allowSpecialUseDomain = false; + } + if (!domain) { + return cb(null, []); + } + + let pathMatcher; + if (!path) { + // null means "all paths" + pathMatcher = function matchAll(domainIndex) { + for (const curPath in domainIndex) { + const pathIndex = domainIndex[curPath]; + for (const key in pathIndex) { + results.push(pathIndex[key]); + } + } + }; + } else { + pathMatcher = function matchRFC(domainIndex) { + //NOTE: we should use path-match algorithm from S5.1.4 here + //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299) + Object.keys(domainIndex).forEach(cookiePath => { + if (pathMatch$1(path, cookiePath)) { + const pathIndex = domainIndex[cookiePath]; + for (const key in pathIndex) { + results.push(pathIndex[key]); + } + } + }); + }; + } + + const domains = permuteDomain$1(domain, allowSpecialUseDomain) || [domain]; + const idx = this.idx; + domains.forEach(curDomain => { + const domainIndex = idx[curDomain]; + if (!domainIndex) { + return; + } + pathMatcher(domainIndex); + }); + + cb(null, results); + } + + putCookie(cookie, cb) { + if (!this.idx[cookie.domain]) { + this.idx[cookie.domain] = {}; + } + if (!this.idx[cookie.domain][cookie.path]) { + this.idx[cookie.domain][cookie.path] = {}; + } + this.idx[cookie.domain][cookie.path][cookie.key] = cookie; + cb(null); + } + updateCookie(oldCookie, newCookie, cb) { + // updateCookie() may avoid updating cookies that are identical. For example, + // lastAccessed may not be important to some stores and an equality + // comparison could exclude that field. + this.putCookie(newCookie, cb); + } + removeCookie(domain, path, key, cb) { + if ( + this.idx[domain] && + this.idx[domain][path] && + this.idx[domain][path][key] + ) { + delete this.idx[domain][path][key]; + } + cb(null); + } + removeCookies(domain, path, cb) { + if (this.idx[domain]) { + if (path) { + delete this.idx[domain][path]; + } else { + delete this.idx[domain]; + } + } + return cb(null); + } + removeAllCookies(cb) { + this.idx = {}; + return cb(null); + } + getAllCookies(cb) { + const cookies = []; + const idx = this.idx; + + const domains = Object.keys(idx); + domains.forEach(domain => { + const paths = Object.keys(idx[domain]); + paths.forEach(path => { + const keys = Object.keys(idx[domain][path]); + keys.forEach(key => { + if (key !== null) { + cookies.push(idx[domain][path][key]); + } + }); + }); + }); + + // Sort by creationIndex so deserializing retains the creation order. + // When implementing your own store, this SHOULD retain the order too + cookies.sort((a, b) => { + return (a.creationIndex || 0) - (b.creationIndex || 0); + }); + + cb(null, cookies); + } +} + +[ + "findCookie", + "findCookies", + "putCookie", + "updateCookie", + "removeCookie", + "removeCookies", + "removeAllCookies", + "getAllCookies" +].forEach(name => { + MemoryCookieStore[name] = fromCallback$1(MemoryCookieStore.prototype[name]); +}); + +var MemoryCookieStore_1 = MemoryCookieStore; + +var memstore = { + MemoryCookieStore: MemoryCookieStore_1 +}; + +// generated by genversion +var version = '4.0.0'; + +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +const urlParse = Url__default['default'].parse; + + +const Store$2 = store.Store; +const MemoryCookieStore$1 = memstore.MemoryCookieStore; +const pathMatch$2 = pathMatch_1.pathMatch; + +const { fromCallback: fromCallback$2 } = universalify; + +// From RFC6265 S4.1.1 +// note that it excludes \x3B ";" +const COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/; + +const CONTROL_CHARS = /[\x00-\x1F]/; + +// From Chromium // '\r', '\n' and '\0' should be treated as a terminator in +// the "relaxed" mode, see: +// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60 +const TERMINATORS = ["\n", "\r", "\0"]; + +// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' +// Note ';' is \x3B +const PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; + +// date-time parsing constants (RFC6265 S5.1.1) + +const DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; + +const MONTH_TO_NUM = { + jan: 0, + feb: 1, + mar: 2, + apr: 3, + may: 4, + jun: 5, + jul: 6, + aug: 7, + sep: 8, + oct: 9, + nov: 10, + dec: 11 +}; + +const MAX_TIME = 2147483647000; // 31-bit max +const MIN_TIME = 0; // 31-bit min +const SAME_SITE_CONTEXT_VAL_ERR = + 'Invalid sameSiteContext option for getCookies(); expected one of "strict", "lax", or "none"'; + +function checkSameSiteContext(value) { + const context = String(value).toLowerCase(); + if (context === "none" || context === "lax" || context === "strict") { + return context; + } else { + return null; + } +} + +const PrefixSecurityEnum = Object.freeze({ + SILENT: "silent", + STRICT: "strict", + DISABLED: "unsafe-disabled" +}); + +// Dumped from ip-regex@4.0.0, with the following changes: +// * all capturing groups converted to non-capturing -- "(?:)" +// * support for IPv6 Scoped Literal ("%eth1") removed +// * lowercase hexadecimal only +var IP_REGEX_LOWERCASE =/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|(?:[a-f\d]{1,4}:){1}(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|(?::(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:)))$)/; + +/* + * Parses a Natural number (i.e., non-negative integer) with either the + * *DIGIT ( non-digit *OCTET ) + * or + * *DIGIT + * grammar (RFC6265 S5.1.1). + * + * The "trailingOK" boolean controls if the grammar accepts a + * "( non-digit *OCTET )" trailer. + */ +function parseDigits(token, minDigits, maxDigits, trailingOK) { + let count = 0; + while (count < token.length) { + const c = token.charCodeAt(count); + // "non-digit = %x00-2F / %x3A-FF" + if (c <= 0x2f || c >= 0x3a) { + break; + } + count++; + } + + // constrain to a minimum and maximum number of digits. + if (count < minDigits || count > maxDigits) { + return null; + } + + if (!trailingOK && count != token.length) { + return null; + } + + return parseInt(token.substr(0, count), 10); +} + +function parseTime(token) { + const parts = token.split(":"); + const result = [0, 0, 0]; + + /* RF6256 S5.1.1: + * time = hms-time ( non-digit *OCTET ) + * hms-time = time-field ":" time-field ":" time-field + * time-field = 1*2DIGIT + */ + + if (parts.length !== 3) { + return null; + } + + for (let i = 0; i < 3; i++) { + // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be + // followed by "( non-digit *OCTET )" so therefore the last time-field can + // have a trailer + const trailingOK = i == 2; + const num = parseDigits(parts[i], 1, 2, trailingOK); + if (num === null) { + return null; + } + result[i] = num; + } + + return result; +} + +function parseMonth(token) { + token = String(token) + .substr(0, 3) + .toLowerCase(); + const num = MONTH_TO_NUM[token]; + return num >= 0 ? num : null; +} + +/* + * RFC6265 S5.1.1 date parser (see RFC for full grammar) + */ +function parseDate(str) { + if (!str) { + return; + } + + /* RFC6265 S5.1.1: + * 2. Process each date-token sequentially in the order the date-tokens + * appear in the cookie-date + */ + const tokens = str.split(DATE_DELIM); + if (!tokens) { + return; + } + + let hour = null; + let minute = null; + let second = null; + let dayOfMonth = null; + let month = null; + let year = null; + + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i].trim(); + if (!token.length) { + continue; + } + + let result; + + /* 2.1. If the found-time flag is not set and the token matches the time + * production, set the found-time flag and set the hour- value, + * minute-value, and second-value to the numbers denoted by the digits in + * the date-token, respectively. Skip the remaining sub-steps and continue + * to the next date-token. + */ + if (second === null) { + result = parseTime(token); + if (result) { + hour = result[0]; + minute = result[1]; + second = result[2]; + continue; + } + } + + /* 2.2. If the found-day-of-month flag is not set and the date-token matches + * the day-of-month production, set the found-day-of- month flag and set + * the day-of-month-value to the number denoted by the date-token. Skip + * the remaining sub-steps and continue to the next date-token. + */ + if (dayOfMonth === null) { + // "day-of-month = 1*2DIGIT ( non-digit *OCTET )" + result = parseDigits(token, 1, 2, true); + if (result !== null) { + dayOfMonth = result; + continue; + } + } + + /* 2.3. If the found-month flag is not set and the date-token matches the + * month production, set the found-month flag and set the month-value to + * the month denoted by the date-token. Skip the remaining sub-steps and + * continue to the next date-token. + */ + if (month === null) { + result = parseMonth(token); + if (result !== null) { + month = result; + continue; + } + } + + /* 2.4. If the found-year flag is not set and the date-token matches the + * year production, set the found-year flag and set the year-value to the + * number denoted by the date-token. Skip the remaining sub-steps and + * continue to the next date-token. + */ + if (year === null) { + // "year = 2*4DIGIT ( non-digit *OCTET )" + result = parseDigits(token, 2, 4, true); + if (result !== null) { + year = result; + /* From S5.1.1: + * 3. If the year-value is greater than or equal to 70 and less + * than or equal to 99, increment the year-value by 1900. + * 4. If the year-value is greater than or equal to 0 and less + * than or equal to 69, increment the year-value by 2000. + */ + if (year >= 70 && year <= 99) { + year += 1900; + } else if (year >= 0 && year <= 69) { + year += 2000; + } + } + } + } + + /* RFC 6265 S5.1.1 + * "5. Abort these steps and fail to parse the cookie-date if: + * * at least one of the found-day-of-month, found-month, found- + * year, or found-time flags is not set, + * * the day-of-month-value is less than 1 or greater than 31, + * * the year-value is less than 1601, + * * the hour-value is greater than 23, + * * the minute-value is greater than 59, or + * * the second-value is greater than 59. + * (Note that leap seconds cannot be represented in this syntax.)" + * + * So, in order as above: + */ + if ( + dayOfMonth === null || + month === null || + year === null || + second === null || + dayOfMonth < 1 || + dayOfMonth > 31 || + year < 1601 || + hour > 23 || + minute > 59 || + second > 59 + ) { + return; + } + + return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); +} + +function formatDate(date) { + return date.toUTCString(); +} + +// S5.1.2 Canonicalized Host Names +function canonicalDomain(str) { + if (str == null) { + return null; + } + str = str.trim().replace(/^\./, ""); // S4.1.2.3 & S5.2.3: ignore leading . + + // convert to IDN if any non-ASCII characters + if (Punycode__default['default'] && /[^\u0001-\u007f]/.test(str)) { + str = Punycode__default['default'].toASCII(str); + } + + return str.toLowerCase(); +} + +// S5.1.3 Domain Matching +function domainMatch(str, domStr, canonicalize) { + if (str == null || domStr == null) { + return null; + } + if (canonicalize !== false) { + str = canonicalDomain(str); + domStr = canonicalDomain(domStr); + } + + /* + * S5.1.3: + * "A string domain-matches a given domain string if at least one of the + * following conditions hold:" + * + * " o The domain string and the string are identical. (Note that both the + * domain string and the string will have been canonicalized to lower case at + * this point)" + */ + if (str == domStr) { + return true; + } + + /* " o All of the following [three] conditions hold:" */ + + /* "* The domain string is a suffix of the string" */ + const idx = str.indexOf(domStr); + if (idx <= 0) { + return false; // it's a non-match (-1) or prefix (0) + } + + // next, check it's a proper suffix + // e.g., "a.b.c".indexOf("b.c") === 2 + // 5 === 3+2 + if (str.length !== domStr.length + idx) { + return false; // it's not a suffix + } + + /* " * The last character of the string that is not included in the + * domain string is a %x2E (".") character." */ + if (str.substr(idx-1,1) !== '.') { + return false; // doesn't align on "." + } + + /* " * The string is a host name (i.e., not an IP address)." */ + if (IP_REGEX_LOWERCASE.test(str)) { + return false; // it's an IP address + } + + return true; +} + +// RFC6265 S5.1.4 Paths and Path-Match + +/* + * "The user agent MUST use an algorithm equivalent to the following algorithm + * to compute the default-path of a cookie:" + * + * Assumption: the path (and not query part or absolute uri) is passed in. + */ +function defaultPath(path) { + // "2. If the uri-path is empty or if the first character of the uri-path is not + // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. + if (!path || path.substr(0, 1) !== "/") { + return "/"; + } + + // "3. If the uri-path contains no more than one %x2F ("/") character, output + // %x2F ("/") and skip the remaining step." + if (path === "/") { + return path; + } + + const rightSlash = path.lastIndexOf("/"); + if (rightSlash === 0) { + return "/"; + } + + // "4. Output the characters of the uri-path from the first character up to, + // but not including, the right-most %x2F ("/")." + return path.slice(0, rightSlash); +} + +function trimTerminator(str) { + for (let t = 0; t < TERMINATORS.length; t++) { + const terminatorIdx = str.indexOf(TERMINATORS[t]); + if (terminatorIdx !== -1) { + str = str.substr(0, terminatorIdx); + } + } + + return str; +} + +function parseCookiePair(cookiePair, looseMode) { + cookiePair = trimTerminator(cookiePair); + + let firstEq = cookiePair.indexOf("="); + if (looseMode) { + if (firstEq === 0) { + // '=' is immediately at start + cookiePair = cookiePair.substr(1); + firstEq = cookiePair.indexOf("="); // might still need to split on '=' + } + } else { + // non-loose mode + if (firstEq <= 0) { + // no '=' or is at start + return; // needs to have non-empty "cookie-name" + } + } + + let cookieName, cookieValue; + if (firstEq <= 0) { + cookieName = ""; + cookieValue = cookiePair.trim(); + } else { + cookieName = cookiePair.substr(0, firstEq).trim(); + cookieValue = cookiePair.substr(firstEq + 1).trim(); + } + + if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) { + return; + } + + const c = new Cookie(); + c.key = cookieName; + c.value = cookieValue; + return c; +} + +function parse$2(str, options) { + if (!options || typeof options !== "object") { + options = {}; + } + str = str.trim(); + + // We use a regex to parse the "name-value-pair" part of S5.2 + const firstSemi = str.indexOf(";"); // S5.2 step 1 + const cookiePair = firstSemi === -1 ? str : str.substr(0, firstSemi); + const c = parseCookiePair(cookiePair, !!options.loose); + if (!c) { + return; + } + + if (firstSemi === -1) { + return c; + } + + // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question)." plus later on in the same section + // "discard the first ";" and trim". + const unparsed = str.slice(firstSemi + 1).trim(); + + // "If the unparsed-attributes string is empty, skip the rest of these + // steps." + if (unparsed.length === 0) { + return c; + } + + /* + * S5.2 says that when looping over the items "[p]rocess the attribute-name + * and attribute-value according to the requirements in the following + * subsections" for every item. Plus, for many of the individual attributes + * in S5.3 it says to use the "attribute-value of the last attribute in the + * cookie-attribute-list". Therefore, in this implementation, we overwrite + * the previous value. + */ + const cookie_avs = unparsed.split(";"); + while (cookie_avs.length) { + const av = cookie_avs.shift().trim(); + if (av.length === 0) { + // happens if ";;" appears + continue; + } + const av_sep = av.indexOf("="); + let av_key, av_value; + + if (av_sep === -1) { + av_key = av; + av_value = null; + } else { + av_key = av.substr(0, av_sep); + av_value = av.substr(av_sep + 1); + } + + av_key = av_key.trim().toLowerCase(); + + if (av_value) { + av_value = av_value.trim(); + } + + switch (av_key) { + case "expires": // S5.2.1 + if (av_value) { + const exp = parseDate(av_value); + // "If the attribute-value failed to parse as a cookie date, ignore the + // cookie-av." + if (exp) { + // over and underflow not realistically a concern: V8's getTime() seems to + // store something larger than a 32-bit time_t (even with 32-bit node) + c.expires = exp; + } + } + break; + + case "max-age": // S5.2.2 + if (av_value) { + // "If the first character of the attribute-value is not a DIGIT or a "-" + // character ...[or]... If the remainder of attribute-value contains a + // non-DIGIT character, ignore the cookie-av." + if (/^-?[0-9]+$/.test(av_value)) { + const delta = parseInt(av_value, 10); + // "If delta-seconds is less than or equal to zero (0), let expiry-time + // be the earliest representable date and time." + c.setMaxAge(delta); + } + } + break; + + case "domain": // S5.2.3 + // "If the attribute-value is empty, the behavior is undefined. However, + // the user agent SHOULD ignore the cookie-av entirely." + if (av_value) { + // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E + // (".") character." + const domain = av_value.trim().replace(/^\./, ""); + if (domain) { + // "Convert the cookie-domain to lower case." + c.domain = domain.toLowerCase(); + } + } + break; + + case "path": // S5.2.4 + /* + * "If the attribute-value is empty or if the first character of the + * attribute-value is not %x2F ("/"): + * Let cookie-path be the default-path. + * Otherwise: + * Let cookie-path be the attribute-value." + * + * We'll represent the default-path as null since it depends on the + * context of the parsing. + */ + c.path = av_value && av_value[0] === "/" ? av_value : null; + break; + + case "secure": // S5.2.5 + /* + * "If the attribute-name case-insensitively matches the string "Secure", + * the user agent MUST append an attribute to the cookie-attribute-list + * with an attribute-name of Secure and an empty attribute-value." + */ + c.secure = true; + break; + + case "httponly": // S5.2.6 -- effectively the same as 'secure' + c.httpOnly = true; + break; + + case "samesite": // RFC6265bis-02 S5.3.7 + const enforcement = av_value ? av_value.toLowerCase() : ""; + switch (enforcement) { + case "strict": + c.sameSite = "strict"; + break; + case "lax": + c.sameSite = "lax"; + break; + } + break; + + default: + c.extensions = c.extensions || []; + c.extensions.push(av); + break; + } + } + + return c; +} + +/** + * If the cookie-name begins with a case-sensitive match for the + * string "__Secure-", abort these steps and ignore the cookie + * entirely unless the cookie's secure-only-flag is true. + * @param cookie + * @returns boolean + */ +function isSecurePrefixConditionMet(cookie) { + return !cookie.key.startsWith("__Secure-") || cookie.secure; +} + +/** + * If the cookie-name begins with a case-sensitive match for the + * string "__Host-", abort these steps and ignore the cookie + * entirely unless the cookie meets all the following criteria: + * 1. The cookie's secure-only-flag is true. + * 2. The cookie's host-only-flag is true. + * 3. The cookie-attribute-list contains an attribute with an + * attribute-name of "Path", and the cookie's path is "/". + * @param cookie + * @returns boolean + */ +function isHostPrefixConditionMet(cookie) { + return ( + !cookie.key.startsWith("__Host-") || + (cookie.secure && + cookie.hostOnly && + cookie.path != null && + cookie.path === "/") + ); +} + +// avoid the V8 deoptimization monster! +function jsonParse(str) { + let obj; + try { + obj = JSON.parse(str); + } catch (e) { + return e; + } + return obj; +} + +function fromJSON(str) { + if (!str) { + return null; + } + + let obj; + if (typeof str === "string") { + obj = jsonParse(str); + if (obj instanceof Error) { + return null; + } + } else { + // assume it's an Object + obj = str; + } + + const c = new Cookie(); + for (let i = 0; i < Cookie.serializableProperties.length; i++) { + const prop = Cookie.serializableProperties[i]; + if (obj[prop] === undefined || obj[prop] === cookieDefaults[prop]) { + continue; // leave as prototype default + } + + if (prop === "expires" || prop === "creation" || prop === "lastAccessed") { + if (obj[prop] === null) { + c[prop] = null; + } else { + c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]); + } + } else { + c[prop] = obj[prop]; + } + } + + return c; +} + +/* Section 5.4 part 2: + * "* Cookies with longer paths are listed before cookies with + * shorter paths. + * + * * Among cookies that have equal-length path fields, cookies with + * earlier creation-times are listed before cookies with later + * creation-times." + */ + +function cookieCompare(a, b) { + let cmp = 0; + + // descending for length: b CMP a + const aPathLen = a.path ? a.path.length : 0; + const bPathLen = b.path ? b.path.length : 0; + cmp = bPathLen - aPathLen; + if (cmp !== 0) { + return cmp; + } + + // ascending for time: a CMP b + const aTime = a.creation ? a.creation.getTime() : MAX_TIME; + const bTime = b.creation ? b.creation.getTime() : MAX_TIME; + cmp = aTime - bTime; + if (cmp !== 0) { + return cmp; + } + + // break ties for the same millisecond (precision of JavaScript's clock) + cmp = a.creationIndex - b.creationIndex; + + return cmp; +} + +function getCookieContext(url) { + if (url instanceof Object) { + return url; + } + // NOTE: decodeURI will throw on malformed URIs (see GH-32). + // Therefore, we will just skip decoding for such URIs. + try { + url = decodeURI(url); + } catch (err) { + // Silently swallow error + } + + return urlParse(url); +} + +const cookieDefaults = { + // the order in which the RFC has them: + key: "", + value: "", + expires: "Infinity", + maxAge: null, + domain: null, + path: null, + secure: false, + httpOnly: false, + extensions: null, + // set by the CookieJar: + hostOnly: null, + pathIsDefault: null, + creation: null, + lastAccessed: null, + sameSite: "none" +}; + +class Cookie { + constructor(options = {}) { + if (util__default['default'].inspect.custom) { + this[util__default['default'].inspect.custom] = this.inspect; + } + + Object.assign(this, cookieDefaults, options); + this.creation = this.creation || new Date(); + + // used to break creation ties in cookieCompare(): + Object.defineProperty(this, "creationIndex", { + configurable: false, + enumerable: false, // important for assert.deepEqual checks + writable: true, + value: ++Cookie.cookiesCreated + }); + } + + inspect() { + const now = Date.now(); + const hostOnly = this.hostOnly != null ? this.hostOnly : "?"; + const createAge = this.creation + ? `${now - this.creation.getTime()}ms` + : "?"; + const accessAge = this.lastAccessed + ? `${now - this.lastAccessed.getTime()}ms` + : "?"; + return `Cookie="${this.toString()}; hostOnly=${hostOnly}; aAge=${accessAge}; cAge=${createAge}"`; + } + + toJSON() { + const obj = {}; + + for (const prop of Cookie.serializableProperties) { + if (this[prop] === cookieDefaults[prop]) { + continue; // leave as prototype default + } + + if ( + prop === "expires" || + prop === "creation" || + prop === "lastAccessed" + ) { + if (this[prop] === null) { + obj[prop] = null; + } else { + obj[prop] = + this[prop] == "Infinity" // intentionally not === + ? "Infinity" + : this[prop].toISOString(); + } + } else if (prop === "maxAge") { + if (this[prop] !== null) { + // again, intentionally not === + obj[prop] = + this[prop] == Infinity || this[prop] == -Infinity + ? this[prop].toString() + : this[prop]; + } + } else { + if (this[prop] !== cookieDefaults[prop]) { + obj[prop] = this[prop]; + } + } + } + + return obj; + } + + clone() { + return fromJSON(this.toJSON()); + } + + validate() { + if (!COOKIE_OCTETS.test(this.value)) { + return false; + } + if ( + this.expires != Infinity && + !(this.expires instanceof Date) && + !parseDate(this.expires) + ) { + return false; + } + if (this.maxAge != null && this.maxAge <= 0) { + return false; // "Max-Age=" non-zero-digit *DIGIT + } + if (this.path != null && !PATH_VALUE.test(this.path)) { + return false; + } + + const cdomain = this.cdomain(); + if (cdomain) { + if (cdomain.match(/\.$/)) { + return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this + } + const suffix = pubsuffixPsl.getPublicSuffix(cdomain); + if (suffix == null) { + // it's a public suffix + return false; + } + } + return true; + } + + setExpires(exp) { + if (exp instanceof Date) { + this.expires = exp; + } else { + this.expires = parseDate(exp) || "Infinity"; + } + } + + setMaxAge(age) { + if (age === Infinity || age === -Infinity) { + this.maxAge = age.toString(); // so JSON.stringify() works + } else { + this.maxAge = age; + } + } + + cookieString() { + let val = this.value; + if (val == null) { + val = ""; + } + if (this.key === "") { + return val; + } + return `${this.key}=${val}`; + } + + // gives Set-Cookie header format + toString() { + let str = this.cookieString(); + + if (this.expires != Infinity) { + if (this.expires instanceof Date) { + str += `; Expires=${formatDate(this.expires)}`; + } else { + str += `; Expires=${this.expires}`; + } + } + + if (this.maxAge != null && this.maxAge != Infinity) { + str += `; Max-Age=${this.maxAge}`; + } + + if (this.domain && !this.hostOnly) { + str += `; Domain=${this.domain}`; + } + if (this.path) { + str += `; Path=${this.path}`; + } + + if (this.secure) { + str += "; Secure"; + } + if (this.httpOnly) { + str += "; HttpOnly"; + } + if (this.sameSite && this.sameSite !== "none") { + const ssCanon = Cookie.sameSiteCanonical[this.sameSite.toLowerCase()]; + str += `; SameSite=${ssCanon ? ssCanon : this.sameSite}`; + } + if (this.extensions) { + this.extensions.forEach(ext => { + str += `; ${ext}`; + }); + } + + return str; + } + + // TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie() + // elsewhere) + // S5.3 says to give the "latest representable date" for which we use Infinity + // For "expired" we use 0 + TTL(now) { + /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires + * attribute, the Max-Age attribute has precedence and controls the + * expiration date of the cookie. + * (Concurs with S5.3 step 3) + */ + if (this.maxAge != null) { + return this.maxAge <= 0 ? 0 : this.maxAge * 1000; + } + + let expires = this.expires; + if (expires != Infinity) { + if (!(expires instanceof Date)) { + expires = parseDate(expires) || Infinity; + } + + if (expires == Infinity) { + return Infinity; + } + + return expires.getTime() - (now || Date.now()); + } + + return Infinity; + } + + // expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() + // elsewhere) + expiryTime(now) { + if (this.maxAge != null) { + const relativeTo = now || this.creation || new Date(); + const age = this.maxAge <= 0 ? -Infinity : this.maxAge * 1000; + return relativeTo.getTime() + age; + } + + if (this.expires == Infinity) { + return Infinity; + } + return this.expires.getTime(); + } + + // expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() + // elsewhere), except it returns a Date + expiryDate(now) { + const millisec = this.expiryTime(now); + if (millisec == Infinity) { + return new Date(MAX_TIME); + } else if (millisec == -Infinity) { + return new Date(MIN_TIME); + } else { + return new Date(millisec); + } + } + + // This replaces the "persistent-flag" parts of S5.3 step 3 + isPersistent() { + return this.maxAge != null || this.expires != Infinity; + } + + // Mostly S5.1.2 and S5.2.3: + canonicalizedDomain() { + if (this.domain == null) { + return null; + } + return canonicalDomain(this.domain); + } + + cdomain() { + return this.canonicalizedDomain(); + } +} + +Cookie.cookiesCreated = 0; +Cookie.parse = parse$2; +Cookie.fromJSON = fromJSON; +Cookie.serializableProperties = Object.keys(cookieDefaults); +Cookie.sameSiteLevel = { + strict: 3, + lax: 2, + none: 1 +}; + +Cookie.sameSiteCanonical = { + strict: "Strict", + lax: "Lax" +}; + +function getNormalizedPrefixSecurity(prefixSecurity) { + if (prefixSecurity != null) { + const normalizedPrefixSecurity = prefixSecurity.toLowerCase(); + /* The three supported options */ + switch (normalizedPrefixSecurity) { + case PrefixSecurityEnum.STRICT: + case PrefixSecurityEnum.SILENT: + case PrefixSecurityEnum.DISABLED: + return normalizedPrefixSecurity; + } + } + /* Default is SILENT */ + return PrefixSecurityEnum.SILENT; +} + +class CookieJar { + constructor(store, options = { rejectPublicSuffixes: true }) { + if (typeof options === "boolean") { + options = { rejectPublicSuffixes: options }; + } + this.rejectPublicSuffixes = options.rejectPublicSuffixes; + this.enableLooseMode = !!options.looseMode; + this.allowSpecialUseDomain = !!options.allowSpecialUseDomain; + this.store = store || new MemoryCookieStore$1(); + this.prefixSecurity = getNormalizedPrefixSecurity(options.prefixSecurity); + this._cloneSync = syncWrap("clone"); + this._importCookiesSync = syncWrap("_importCookies"); + this.getCookiesSync = syncWrap("getCookies"); + this.getCookieStringSync = syncWrap("getCookieString"); + this.getSetCookieStringsSync = syncWrap("getSetCookieStrings"); + this.removeAllCookiesSync = syncWrap("removeAllCookies"); + this.setCookieSync = syncWrap("setCookie"); + this.serializeSync = syncWrap("serialize"); + } + + setCookie(cookie, url, options, cb) { + let err; + const context = getCookieContext(url); + if (typeof options === "function") { + cb = options; + options = {}; + } + + const host = canonicalDomain(context.hostname); + const loose = options.loose || this.enableLooseMode; + + let sameSiteContext = null; + if (options.sameSiteContext) { + sameSiteContext = checkSameSiteContext(options.sameSiteContext); + if (!sameSiteContext) { + return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR)); + } + } + + // S5.3 step 1 + if (typeof cookie === "string" || cookie instanceof String) { + cookie = Cookie.parse(cookie, { loose: loose }); + if (!cookie) { + err = new Error("Cookie failed to parse"); + return cb(options.ignoreError ? null : err); + } + } else if (!(cookie instanceof Cookie)) { + // If you're seeing this error, and are passing in a Cookie object, + // it *might* be a Cookie object from another loaded version of tough-cookie. + err = new Error( + "First argument to setCookie must be a Cookie object or string" + ); + return cb(options.ignoreError ? null : err); + } + + // S5.3 step 2 + const now = options.now || new Date(); // will assign later to save effort in the face of errors + + // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie() + + // S5.3 step 4: NOOP; domain is null by default + + // S5.3 step 5: public suffixes + if (this.rejectPublicSuffixes && cookie.domain) { + const suffix = pubsuffixPsl.getPublicSuffix(cookie.cdomain()); + if (suffix == null) { + // e.g. "com" + err = new Error("Cookie has domain set to a public suffix"); + return cb(options.ignoreError ? null : err); + } + } + + // S5.3 step 6: + if (cookie.domain) { + if (!domainMatch(host, cookie.cdomain(), false)) { + err = new Error( + `Cookie not in this host's domain. Cookie:${cookie.cdomain()} Request:${host}` + ); + return cb(options.ignoreError ? null : err); + } + + if (cookie.hostOnly == null) { + // don't reset if already set + cookie.hostOnly = false; + } + } else { + cookie.hostOnly = true; + cookie.domain = host; + } + + //S5.2.4 If the attribute-value is empty or if the first character of the + //attribute-value is not %x2F ("/"): + //Let cookie-path be the default-path. + if (!cookie.path || cookie.path[0] !== "/") { + cookie.path = defaultPath(context.pathname); + cookie.pathIsDefault = true; + } + + // S5.3 step 8: NOOP; secure attribute + // S5.3 step 9: NOOP; httpOnly attribute + + // S5.3 step 10 + if (options.http === false && cookie.httpOnly) { + err = new Error("Cookie is HttpOnly and this isn't an HTTP API"); + return cb(options.ignoreError ? null : err); + } + + // 6252bis-02 S5.4 Step 13 & 14: + if (cookie.sameSite !== "none" && sameSiteContext) { + // "If the cookie's "same-site-flag" is not "None", and the cookie + // is being set from a context whose "site for cookies" is not an + // exact match for request-uri's host's registered domain, then + // abort these steps and ignore the newly created cookie entirely." + if (sameSiteContext === "none") { + err = new Error( + "Cookie is SameSite but this is a cross-origin request" + ); + return cb(options.ignoreError ? null : err); + } + } + + /* 6265bis-02 S5.4 Steps 15 & 16 */ + const ignoreErrorForPrefixSecurity = + this.prefixSecurity === PrefixSecurityEnum.SILENT; + const prefixSecurityDisabled = + this.prefixSecurity === PrefixSecurityEnum.DISABLED; + /* If prefix checking is not disabled ...*/ + if (!prefixSecurityDisabled) { + let errorFound = false; + let errorMsg; + /* Check secure prefix condition */ + if (!isSecurePrefixConditionMet(cookie)) { + errorFound = true; + errorMsg = "Cookie has __Secure prefix but Secure attribute is not set"; + } else if (!isHostPrefixConditionMet(cookie)) { + /* Check host prefix condition */ + errorFound = true; + errorMsg = + "Cookie has __Host prefix but either Secure or HostOnly attribute is not set or Path is not '/'"; + } + if (errorFound) { + return cb( + options.ignoreError || ignoreErrorForPrefixSecurity + ? null + : new Error(errorMsg) + ); + } + } + + const store = this.store; + + if (!store.updateCookie) { + store.updateCookie = function(oldCookie, newCookie, cb) { + this.putCookie(newCookie, cb); + }; + } + + function withCookie(err, oldCookie) { + if (err) { + return cb(err); + } + + const next = function(err) { + if (err) { + return cb(err); + } else { + cb(null, cookie); + } + }; + + if (oldCookie) { + // S5.3 step 11 - "If the cookie store contains a cookie with the same name, + // domain, and path as the newly created cookie:" + if (options.http === false && oldCookie.httpOnly) { + // step 11.2 + err = new Error("old Cookie is HttpOnly and this isn't an HTTP API"); + return cb(options.ignoreError ? null : err); + } + cookie.creation = oldCookie.creation; // step 11.3 + cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker + cookie.lastAccessed = now; + // Step 11.4 (delete cookie) is implied by just setting the new one: + store.updateCookie(oldCookie, cookie, next); // step 12 + } else { + cookie.creation = cookie.lastAccessed = now; + store.putCookie(cookie, next); // step 12 + } + } + + store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie); + } + + // RFC6365 S5.4 + getCookies(url, options, cb) { + const context = getCookieContext(url); + if (typeof options === "function") { + cb = options; + options = {}; + } + + const host = canonicalDomain(context.hostname); + const path = context.pathname || "/"; + + let secure = options.secure; + if ( + secure == null && + context.protocol && + (context.protocol == "https:" || context.protocol == "wss:") + ) { + secure = true; + } + + let sameSiteLevel = 0; + if (options.sameSiteContext) { + const sameSiteContext = checkSameSiteContext(options.sameSiteContext); + sameSiteLevel = Cookie.sameSiteLevel[sameSiteContext]; + if (!sameSiteLevel) { + return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR)); + } + } + + let http = options.http; + if (http == null) { + http = true; + } + + const now = options.now || Date.now(); + const expireCheck = options.expire !== false; + const allPaths = !!options.allPaths; + const store = this.store; + + function matchingCookie(c) { + // "Either: + // The cookie's host-only-flag is true and the canonicalized + // request-host is identical to the cookie's domain. + // Or: + // The cookie's host-only-flag is false and the canonicalized + // request-host domain-matches the cookie's domain." + if (c.hostOnly) { + if (c.domain != host) { + return false; + } + } else { + if (!domainMatch(host, c.domain, false)) { + return false; + } + } + + // "The request-uri's path path-matches the cookie's path." + if (!allPaths && !pathMatch$2(path, c.path)) { + return false; + } + + // "If the cookie's secure-only-flag is true, then the request-uri's + // scheme must denote a "secure" protocol" + if (c.secure && !secure) { + return false; + } + + // "If the cookie's http-only-flag is true, then exclude the cookie if the + // cookie-string is being generated for a "non-HTTP" API" + if (c.httpOnly && !http) { + return false; + } + + // RFC6265bis-02 S5.3.7 + if (sameSiteLevel) { + const cookieLevel = Cookie.sameSiteLevel[c.sameSite || "none"]; + if (cookieLevel > sameSiteLevel) { + // only allow cookies at or below the request level + return false; + } + } + + // deferred from S5.3 + // non-RFC: allow retention of expired cookies by choice + if (expireCheck && c.expiryTime() <= now) { + store.removeCookie(c.domain, c.path, c.key, () => {}); // result ignored + return false; + } + + return true; + } + + store.findCookies( + host, + allPaths ? null : path, + this.allowSpecialUseDomain, + (err, cookies) => { + if (err) { + return cb(err); + } + + cookies = cookies.filter(matchingCookie); + + // sorting of S5.4 part 2 + if (options.sort !== false) { + cookies = cookies.sort(cookieCompare); + } + + // S5.4 part 3 + const now = new Date(); + for (const cookie of cookies) { + cookie.lastAccessed = now; + } + // TODO persist lastAccessed + + cb(null, cookies); + } + ); + } + + getCookieString(...args) { + const cb = args.pop(); + const next = function(err, cookies) { + if (err) { + cb(err); + } else { + cb( + null, + cookies + .sort(cookieCompare) + .map(c => c.cookieString()) + .join("; ") + ); + } + }; + args.push(next); + this.getCookies.apply(this, args); + } + + getSetCookieStrings(...args) { + const cb = args.pop(); + const next = function(err, cookies) { + if (err) { + cb(err); + } else { + cb( + null, + cookies.map(c => { + return c.toString(); + }) + ); + } + }; + args.push(next); + this.getCookies.apply(this, args); + } + + serialize(cb) { + let type = this.store.constructor.name; + if (type === "Object") { + type = null; + } + + // update README.md "Serialization Format" if you change this, please! + const serialized = { + // The version of tough-cookie that serialized this jar. Generally a good + // practice since future versions can make data import decisions based on + // known past behavior. When/if this matters, use `semver`. + version: `tough-cookie@${version}`, + + // add the store type, to make humans happy: + storeType: type, + + // CookieJar configuration: + rejectPublicSuffixes: !!this.rejectPublicSuffixes, + + // this gets filled from getAllCookies: + cookies: [] + }; + + if ( + !( + this.store.getAllCookies && + typeof this.store.getAllCookies === "function" + ) + ) { + return cb( + new Error( + "store does not support getAllCookies and cannot be serialized" + ) + ); + } + + this.store.getAllCookies((err, cookies) => { + if (err) { + return cb(err); + } + + serialized.cookies = cookies.map(cookie => { + // convert to serialized 'raw' cookies + cookie = cookie instanceof Cookie ? cookie.toJSON() : cookie; + + // Remove the index so new ones get assigned during deserialization + delete cookie.creationIndex; + + return cookie; + }); + + return cb(null, serialized); + }); + } + + toJSON() { + return this.serializeSync(); + } + + // use the class method CookieJar.deserialize instead of calling this directly + _importCookies(serialized, cb) { + let cookies = serialized.cookies; + if (!cookies || !Array.isArray(cookies)) { + return cb(new Error("serialized jar has no cookies array")); + } + cookies = cookies.slice(); // do not modify the original + + const putNext = err => { + if (err) { + return cb(err); + } + + if (!cookies.length) { + return cb(err, this); + } + + let cookie; + try { + cookie = fromJSON(cookies.shift()); + } catch (e) { + return cb(e); + } + + if (cookie === null) { + return putNext(null); // skip this cookie + } + + this.store.putCookie(cookie, putNext); + }; + + putNext(); + } + + clone(newStore, cb) { + if (arguments.length === 1) { + cb = newStore; + newStore = null; + } + + this.serialize((err, serialized) => { + if (err) { + return cb(err); + } + CookieJar.deserialize(serialized, newStore, cb); + }); + } + + cloneSync(newStore) { + if (arguments.length === 0) { + return this._cloneSync(); + } + if (!newStore.synchronous) { + throw new Error( + "CookieJar clone destination store is not synchronous; use async API instead." + ); + } + return this._cloneSync(newStore); + } + + removeAllCookies(cb) { + const store = this.store; + + // Check that the store implements its own removeAllCookies(). The default + // implementation in Store will immediately call the callback with a "not + // implemented" Error. + if ( + typeof store.removeAllCookies === "function" && + store.removeAllCookies !== Store$2.prototype.removeAllCookies + ) { + return store.removeAllCookies(cb); + } + + store.getAllCookies((err, cookies) => { + if (err) { + return cb(err); + } + + if (cookies.length === 0) { + return cb(null); + } + + let completedCount = 0; + const removeErrors = []; + + function removeCookieCb(removeErr) { + if (removeErr) { + removeErrors.push(removeErr); + } + + completedCount++; + + if (completedCount === cookies.length) { + return cb(removeErrors.length ? removeErrors[0] : null); + } + } + + cookies.forEach(cookie => { + store.removeCookie( + cookie.domain, + cookie.path, + cookie.key, + removeCookieCb + ); + }); + }); + } + + static deserialize(strOrObj, store, cb) { + if (arguments.length !== 3) { + // store is optional + cb = store; + store = null; + } + + let serialized; + if (typeof strOrObj === "string") { + serialized = jsonParse(strOrObj); + if (serialized instanceof Error) { + return cb(serialized); + } + } else { + serialized = strOrObj; + } + + const jar = new CookieJar(store, serialized.rejectPublicSuffixes); + jar._importCookies(serialized, err => { + if (err) { + return cb(err); + } + cb(null, jar); + }); + } + + static deserializeSync(strOrObj, store) { + const serialized = + typeof strOrObj === "string" ? JSON.parse(strOrObj) : strOrObj; + const jar = new CookieJar(store, serialized.rejectPublicSuffixes); + + // catch this mistake early: + if (!jar.store.synchronous) { + throw new Error( + "CookieJar store is not synchronous; use async API instead." + ); + } + + jar._importCookiesSync(serialized); + return jar; + } +} +CookieJar.fromJSON = CookieJar.deserializeSync; + +[ + "_importCookies", + "clone", + "getCookies", + "getCookieString", + "getSetCookieStrings", + "removeAllCookies", + "serialize", + "setCookie" +].forEach(name => { + CookieJar.prototype[name] = fromCallback$2(CookieJar.prototype[name]); +}); +CookieJar.deserialize = fromCallback$2(CookieJar.deserialize); + +// Use a closure to provide a true imperative API for synchronous stores. +function syncWrap(method) { + return function(...args) { + if (!this.store.synchronous) { + throw new Error( + "CookieJar store is not synchronous; use async API instead." + ); + } + + let syncErr, syncResult; + this[method](...args, (err, result) => { + syncErr = err; + syncResult = result; + }); + + if (syncErr) { + throw syncErr; + } + return syncResult; + }; +} +var CookieJar_1 = CookieJar; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics$1 = function(d, b) { + extendStatics$1 = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics$1(d, b); +}; + +function __extends$1(d, b) { + extendStatics$1(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +function __awaiter$7(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator$1(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __values$2(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +var listenersMap = new WeakMap(); +var abortedMap = new WeakMap(); +/** + * An aborter instance implements AbortSignal interface, can abort HTTP requests. + * + * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled. + * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation + * cannot or will not ever be cancelled. + * + * @example + * // Abort without timeout + * await doAsyncWork(AbortSignal.none); + * + * @export + * @class AbortSignal + * @implements {AbortSignalLike} + */ +var AbortSignal = /** @class */ (function () { + function AbortSignal() { + /** + * onabort event listener. + * + * @memberof AbortSignal + */ + this.onabort = null; + listenersMap.set(this, []); + abortedMap.set(this, false); + } + Object.defineProperty(AbortSignal.prototype, "aborted", { + /** + * Status of whether aborted or not. + * + * @readonly + * @type {boolean} + * @memberof AbortSignal + */ + get: function () { + if (!abortedMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + return abortedMap.get(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbortSignal, "none", { + /** + * Creates a new AbortSignal instance that will never be aborted. + * + * @readonly + * @static + * @type {AbortSignal} + * @memberof AbortSignal + */ + get: function () { + return new AbortSignal(); + }, + enumerable: true, + configurable: true + }); + /** + * Added new "abort" event listener, only support "abort" event. + * + * @param {"abort"} _type Only support "abort" event + * @param {(this: AbortSignalLike, ev: any) => any} listener + * @memberof AbortSignal + */ + AbortSignal.prototype.addEventListener = function ( + // tslint:disable-next-line:variable-name + _type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + var listeners = listenersMap.get(this); + listeners.push(listener); + }; + /** + * Remove "abort" event listener, only support "abort" event. + * + * @param {"abort"} _type Only support "abort" event + * @param {(this: AbortSignalLike, ev: any) => any} listener + * @memberof AbortSignal + */ + AbortSignal.prototype.removeEventListener = function ( + // tslint:disable-next-line:variable-name + _type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + var listeners = listenersMap.get(this); + var index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); + } + }; + /** + * Dispatches a synthetic event to the AbortSignal. + */ + AbortSignal.prototype.dispatchEvent = function (_event) { + throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); + }; + return AbortSignal; +}()); +/** + * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered. + * Will try to trigger abort event for all linked AbortSignal nodes. + * + * - If there is a timeout, the timer will be cancelled. + * - If aborted is true, nothing will happen. + * + * @returns + * @internal + */ +function abortSignal(signal) { + if (signal.aborted) { + return; + } + if (signal.onabort) { + signal.onabort.call(signal); + } + var listeners = listenersMap.get(signal); + if (listeners) { + listeners.forEach(function (listener) { + listener.call(signal, { type: "abort" }); + }); + } + abortedMap.set(signal, true); +} + +/** + * This error is thrown when an asynchronous operation has been aborted. + * Check for this error by testing the `name` that the name property of the + * error matches `"AbortError"`. + * + * @example + * const controller = new AbortController(); + * controller.abort(); + * try { + * doAsyncWork(controller.signal) + * } catch (e) { + * if (e.name === 'AbortError') { + * // handle abort error here. + * } + * } + */ +var AbortError$1 = /** @class */ (function (_super) { + __extends$1(AbortError, _super); + function AbortError(message) { + var _this = _super.call(this, message) || this; + _this.name = "AbortError"; + return _this; + } + return AbortError; +}(Error)); +/** + * An AbortController provides an AbortSignal and the associated controls to signal + * that an asynchronous operation should be aborted. + * + * @example + * // Abort an operation when another event fires + * const controller = new AbortController(); + * const signal = controller.signal; + * doAsyncWork(signal); + * button.addEventListener('click', () => controller.abort()); + * + * @example + * // Share aborter cross multiple operations in 30s + * // Upload the same data to 2 different data centers at the same time, + * // abort another when any of them is finished + * const controller = AbortController.withTimeout(30 * 1000); + * doAsyncWork(controller.signal).then(controller.abort); + * doAsyncWork(controller.signal).then(controller.abort); + * + * @example + * // Cascaded aborting + * // All operations can't take more than 30 seconds + * const aborter = Aborter.timeout(30 * 1000); + * + * // Following 2 operations can't take more than 25 seconds + * await doAsyncWork(aborter.withTimeout(25 * 1000)); + * await doAsyncWork(aborter.withTimeout(25 * 1000)); + * + * @export + * @class AbortController + * @implements {AbortSignalLike} + */ +var AbortController = /** @class */ (function () { + function AbortController(parentSignals) { + var _this = this; + this._signal = new AbortSignal(); + if (!parentSignals) { + return; + } + // coerce parentSignals into an array + if (!Array.isArray(parentSignals)) { + parentSignals = arguments; + } + for (var _i = 0, parentSignals_1 = parentSignals; _i < parentSignals_1.length; _i++) { + var parentSignal = parentSignals_1[_i]; + // if the parent signal has already had abort() called, + // then call abort on this signal as well. + if (parentSignal.aborted) { + this.abort(); + } + else { + // when the parent signal aborts, this signal should as well. + parentSignal.addEventListener("abort", function () { + _this.abort(); + }); + } + } + } + Object.defineProperty(AbortController.prototype, "signal", { + /** + * The AbortSignal associated with this controller that will signal aborted + * when the abort method is called on this controller. + * + * @readonly + * @type {AbortSignal} + * @memberof AbortController + */ + get: function () { + return this._signal; + }, + enumerable: true, + configurable: true + }); + /** + * Signal that any operations passed this controller's associated abort signal + * to cancel any remaining work and throw an `AbortError`. + * + * @memberof AbortController + */ + AbortController.prototype.abort = function () { + abortSignal(this._signal); + }; + /** + * Creates a new AbortSignal instance that will abort after the provided ms. + * + * @static + * @params {number} ms Elapsed time in milliseconds to trigger an abort. + * @returns {AbortSignal} + */ + AbortController.timeout = function (ms) { + var signal = new AbortSignal(); + var timer = setTimeout(abortSignal, ms, signal); + // Prevent the active Timer from keeping the Node.js event loop active. + if (typeof timer.unref === "function") { + timer.unref(); + } + return signal; + }; + return AbortController; +}()); + +var Stream = Stream__default['default'].Stream; + + +var delayed_stream = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util__default['default'].inherits(DelayedStream, Stream); + +DelayedStream.create = function(source, options) { + var delayedStream = new this(); + + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + + delayedStream.source = source; + + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } + + return delayedStream; +}; + +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); + +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; + +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } + + this.source.resume(); +}; + +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; + +DelayedStream.prototype.release = function() { + this._released = true; + + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; + +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; + +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } + + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + + this._bufferedEvents.push(args); +}; + +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this.emit('error', new Error(message)); +}; + +var Stream$1 = Stream__default['default'].Stream; + + +var combined_stream = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util__default['default'].inherits(CombinedStream, Stream$1); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof delayed_stream)) { + var newStream = delayed_stream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream$1.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } + + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; + +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; + +var require$$0$1 = { + "application/1d-interleaved-parityfec": { + source: "iana" +}, + "application/3gpdash-qoe-report+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/3gpp-ims+xml": { + source: "iana", + compressible: true +}, + "application/a2l": { + source: "iana" +}, + "application/activemessage": { + source: "iana" +}, + "application/activity+json": { + source: "iana", + compressible: true +}, + "application/alto-costmap+json": { + source: "iana", + compressible: true +}, + "application/alto-costmapfilter+json": { + source: "iana", + compressible: true +}, + "application/alto-directory+json": { + source: "iana", + compressible: true +}, + "application/alto-endpointcost+json": { + source: "iana", + compressible: true +}, + "application/alto-endpointcostparams+json": { + source: "iana", + compressible: true +}, + "application/alto-endpointprop+json": { + source: "iana", + compressible: true +}, + "application/alto-endpointpropparams+json": { + source: "iana", + compressible: true +}, + "application/alto-error+json": { + source: "iana", + compressible: true +}, + "application/alto-networkmap+json": { + source: "iana", + compressible: true +}, + "application/alto-networkmapfilter+json": { + source: "iana", + compressible: true +}, + "application/alto-updatestreamcontrol+json": { + source: "iana", + compressible: true +}, + "application/alto-updatestreamparams+json": { + source: "iana", + compressible: true +}, + "application/aml": { + source: "iana" +}, + "application/andrew-inset": { + source: "iana", + extensions: [ + "ez" + ] +}, + "application/applefile": { + source: "iana" +}, + "application/applixware": { + source: "apache", + extensions: [ + "aw" + ] +}, + "application/atf": { + source: "iana" +}, + "application/atfx": { + source: "iana" +}, + "application/atom+xml": { + source: "iana", + compressible: true, + extensions: [ + "atom" + ] +}, + "application/atomcat+xml": { + source: "iana", + compressible: true, + extensions: [ + "atomcat" + ] +}, + "application/atomdeleted+xml": { + source: "iana", + compressible: true, + extensions: [ + "atomdeleted" + ] +}, + "application/atomicmail": { + source: "iana" +}, + "application/atomsvc+xml": { + source: "iana", + compressible: true, + extensions: [ + "atomsvc" + ] +}, + "application/atsc-dwd+xml": { + source: "iana", + compressible: true, + extensions: [ + "dwd" + ] +}, + "application/atsc-dynamic-event-message": { + source: "iana" +}, + "application/atsc-held+xml": { + source: "iana", + compressible: true, + extensions: [ + "held" + ] +}, + "application/atsc-rdt+json": { + source: "iana", + compressible: true +}, + "application/atsc-rsat+xml": { + source: "iana", + compressible: true, + extensions: [ + "rsat" + ] +}, + "application/atxml": { + source: "iana" +}, + "application/auth-policy+xml": { + source: "iana", + compressible: true +}, + "application/bacnet-xdd+zip": { + source: "iana", + compressible: false +}, + "application/batch-smtp": { + source: "iana" +}, + "application/bdoc": { + compressible: false, + extensions: [ + "bdoc" + ] +}, + "application/beep+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/calendar+json": { + source: "iana", + compressible: true +}, + "application/calendar+xml": { + source: "iana", + compressible: true, + extensions: [ + "xcs" + ] +}, + "application/call-completion": { + source: "iana" +}, + "application/cals-1840": { + source: "iana" +}, + "application/cap+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/cbor": { + source: "iana" +}, + "application/cbor-seq": { + source: "iana" +}, + "application/cccex": { + source: "iana" +}, + "application/ccmp+xml": { + source: "iana", + compressible: true +}, + "application/ccxml+xml": { + source: "iana", + compressible: true, + extensions: [ + "ccxml" + ] +}, + "application/cdfx+xml": { + source: "iana", + compressible: true, + extensions: [ + "cdfx" + ] +}, + "application/cdmi-capability": { + source: "iana", + extensions: [ + "cdmia" + ] +}, + "application/cdmi-container": { + source: "iana", + extensions: [ + "cdmic" + ] +}, + "application/cdmi-domain": { + source: "iana", + extensions: [ + "cdmid" + ] +}, + "application/cdmi-object": { + source: "iana", + extensions: [ + "cdmio" + ] +}, + "application/cdmi-queue": { + source: "iana", + extensions: [ + "cdmiq" + ] +}, + "application/cdni": { + source: "iana" +}, + "application/cea": { + source: "iana" +}, + "application/cea-2018+xml": { + source: "iana", + compressible: true +}, + "application/cellml+xml": { + source: "iana", + compressible: true +}, + "application/cfw": { + source: "iana" +}, + "application/clue+xml": { + source: "iana", + compressible: true +}, + "application/clue_info+xml": { + source: "iana", + compressible: true +}, + "application/cms": { + source: "iana" +}, + "application/cnrp+xml": { + source: "iana", + compressible: true +}, + "application/coap-group+json": { + source: "iana", + compressible: true +}, + "application/coap-payload": { + source: "iana" +}, + "application/commonground": { + source: "iana" +}, + "application/conference-info+xml": { + source: "iana", + compressible: true +}, + "application/cose": { + source: "iana" +}, + "application/cose-key": { + source: "iana" +}, + "application/cose-key-set": { + source: "iana" +}, + "application/cpl+xml": { + source: "iana", + compressible: true +}, + "application/csrattrs": { + source: "iana" +}, + "application/csta+xml": { + source: "iana", + compressible: true +}, + "application/cstadata+xml": { + source: "iana", + compressible: true +}, + "application/csvm+json": { + source: "iana", + compressible: true +}, + "application/cu-seeme": { + source: "apache", + extensions: [ + "cu" + ] +}, + "application/cwt": { + source: "iana" +}, + "application/cybercash": { + source: "iana" +}, + "application/dart": { + compressible: true +}, + "application/dash+xml": { + source: "iana", + compressible: true, + extensions: [ + "mpd" + ] +}, + "application/dashdelta": { + source: "iana" +}, + "application/davmount+xml": { + source: "iana", + compressible: true, + extensions: [ + "davmount" + ] +}, + "application/dca-rft": { + source: "iana" +}, + "application/dcd": { + source: "iana" +}, + "application/dec-dx": { + source: "iana" +}, + "application/dialog-info+xml": { + source: "iana", + compressible: true +}, + "application/dicom": { + source: "iana" +}, + "application/dicom+json": { + source: "iana", + compressible: true +}, + "application/dicom+xml": { + source: "iana", + compressible: true +}, + "application/dii": { + source: "iana" +}, + "application/dit": { + source: "iana" +}, + "application/dns": { + source: "iana" +}, + "application/dns+json": { + source: "iana", + compressible: true +}, + "application/dns-message": { + source: "iana" +}, + "application/docbook+xml": { + source: "apache", + compressible: true, + extensions: [ + "dbk" + ] +}, + "application/dots+cbor": { + source: "iana" +}, + "application/dskpp+xml": { + source: "iana", + compressible: true +}, + "application/dssc+der": { + source: "iana", + extensions: [ + "dssc" + ] +}, + "application/dssc+xml": { + source: "iana", + compressible: true, + extensions: [ + "xdssc" + ] +}, + "application/dvcs": { + source: "iana" +}, + "application/ecmascript": { + source: "iana", + compressible: true, + extensions: [ + "ecma", + "es" + ] +}, + "application/edi-consent": { + source: "iana" +}, + "application/edi-x12": { + source: "iana", + compressible: false +}, + "application/edifact": { + source: "iana", + compressible: false +}, + "application/efi": { + source: "iana" +}, + "application/emergencycalldata.comment+xml": { + source: "iana", + compressible: true +}, + "application/emergencycalldata.control+xml": { + source: "iana", + compressible: true +}, + "application/emergencycalldata.deviceinfo+xml": { + source: "iana", + compressible: true +}, + "application/emergencycalldata.ecall.msd": { + source: "iana" +}, + "application/emergencycalldata.providerinfo+xml": { + source: "iana", + compressible: true +}, + "application/emergencycalldata.serviceinfo+xml": { + source: "iana", + compressible: true +}, + "application/emergencycalldata.subscriberinfo+xml": { + source: "iana", + compressible: true +}, + "application/emergencycalldata.veds+xml": { + source: "iana", + compressible: true +}, + "application/emma+xml": { + source: "iana", + compressible: true, + extensions: [ + "emma" + ] +}, + "application/emotionml+xml": { + source: "iana", + compressible: true, + extensions: [ + "emotionml" + ] +}, + "application/encaprtp": { + source: "iana" +}, + "application/epp+xml": { + source: "iana", + compressible: true +}, + "application/epub+zip": { + source: "iana", + compressible: false, + extensions: [ + "epub" + ] +}, + "application/eshop": { + source: "iana" +}, + "application/exi": { + source: "iana", + extensions: [ + "exi" + ] +}, + "application/expect-ct-report+json": { + source: "iana", + compressible: true +}, + "application/fastinfoset": { + source: "iana" +}, + "application/fastsoap": { + source: "iana" +}, + "application/fdt+xml": { + source: "iana", + compressible: true, + extensions: [ + "fdt" + ] +}, + "application/fhir+json": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/fhir+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/fido.trusted-apps+json": { + compressible: true +}, + "application/fits": { + source: "iana" +}, + "application/flexfec": { + source: "iana" +}, + "application/font-sfnt": { + source: "iana" +}, + "application/font-tdpfr": { + source: "iana", + extensions: [ + "pfr" + ] +}, + "application/font-woff": { + source: "iana", + compressible: false +}, + "application/framework-attributes+xml": { + source: "iana", + compressible: true +}, + "application/geo+json": { + source: "iana", + compressible: true, + extensions: [ + "geojson" + ] +}, + "application/geo+json-seq": { + source: "iana" +}, + "application/geopackage+sqlite3": { + source: "iana" +}, + "application/geoxacml+xml": { + source: "iana", + compressible: true +}, + "application/gltf-buffer": { + source: "iana" +}, + "application/gml+xml": { + source: "iana", + compressible: true, + extensions: [ + "gml" + ] +}, + "application/gpx+xml": { + source: "apache", + compressible: true, + extensions: [ + "gpx" + ] +}, + "application/gxf": { + source: "apache", + extensions: [ + "gxf" + ] +}, + "application/gzip": { + source: "iana", + compressible: false, + extensions: [ + "gz" + ] +}, + "application/h224": { + source: "iana" +}, + "application/held+xml": { + source: "iana", + compressible: true +}, + "application/hjson": { + extensions: [ + "hjson" + ] +}, + "application/http": { + source: "iana" +}, + "application/hyperstudio": { + source: "iana", + extensions: [ + "stk" + ] +}, + "application/ibe-key-request+xml": { + source: "iana", + compressible: true +}, + "application/ibe-pkg-reply+xml": { + source: "iana", + compressible: true +}, + "application/ibe-pp-data": { + source: "iana" +}, + "application/iges": { + source: "iana" +}, + "application/im-iscomposing+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/index": { + source: "iana" +}, + "application/index.cmd": { + source: "iana" +}, + "application/index.obj": { + source: "iana" +}, + "application/index.response": { + source: "iana" +}, + "application/index.vnd": { + source: "iana" +}, + "application/inkml+xml": { + source: "iana", + compressible: true, + extensions: [ + "ink", + "inkml" + ] +}, + "application/iotp": { + source: "iana" +}, + "application/ipfix": { + source: "iana", + extensions: [ + "ipfix" + ] +}, + "application/ipp": { + source: "iana" +}, + "application/isup": { + source: "iana" +}, + "application/its+xml": { + source: "iana", + compressible: true, + extensions: [ + "its" + ] +}, + "application/java-archive": { + source: "apache", + compressible: false, + extensions: [ + "jar", + "war", + "ear" + ] +}, + "application/java-serialized-object": { + source: "apache", + compressible: false, + extensions: [ + "ser" + ] +}, + "application/java-vm": { + source: "apache", + compressible: false, + extensions: [ + "class" + ] +}, + "application/javascript": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "js", + "mjs" + ] +}, + "application/jf2feed+json": { + source: "iana", + compressible: true +}, + "application/jose": { + source: "iana" +}, + "application/jose+json": { + source: "iana", + compressible: true +}, + "application/jrd+json": { + source: "iana", + compressible: true +}, + "application/json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "json", + "map" + ] +}, + "application/json-patch+json": { + source: "iana", + compressible: true +}, + "application/json-seq": { + source: "iana" +}, + "application/json5": { + extensions: [ + "json5" + ] +}, + "application/jsonml+json": { + source: "apache", + compressible: true, + extensions: [ + "jsonml" + ] +}, + "application/jwk+json": { + source: "iana", + compressible: true +}, + "application/jwk-set+json": { + source: "iana", + compressible: true +}, + "application/jwt": { + source: "iana" +}, + "application/kpml-request+xml": { + source: "iana", + compressible: true +}, + "application/kpml-response+xml": { + source: "iana", + compressible: true +}, + "application/ld+json": { + source: "iana", + compressible: true, + extensions: [ + "jsonld" + ] +}, + "application/lgr+xml": { + source: "iana", + compressible: true, + extensions: [ + "lgr" + ] +}, + "application/link-format": { + source: "iana" +}, + "application/load-control+xml": { + source: "iana", + compressible: true +}, + "application/lost+xml": { + source: "iana", + compressible: true, + extensions: [ + "lostxml" + ] +}, + "application/lostsync+xml": { + source: "iana", + compressible: true +}, + "application/lpf+zip": { + source: "iana", + compressible: false +}, + "application/lxf": { + source: "iana" +}, + "application/mac-binhex40": { + source: "iana", + extensions: [ + "hqx" + ] +}, + "application/mac-compactpro": { + source: "apache", + extensions: [ + "cpt" + ] +}, + "application/macwriteii": { + source: "iana" +}, + "application/mads+xml": { + source: "iana", + compressible: true, + extensions: [ + "mads" + ] +}, + "application/manifest+json": { + charset: "UTF-8", + compressible: true, + extensions: [ + "webmanifest" + ] +}, + "application/marc": { + source: "iana", + extensions: [ + "mrc" + ] +}, + "application/marcxml+xml": { + source: "iana", + compressible: true, + extensions: [ + "mrcx" + ] +}, + "application/mathematica": { + source: "iana", + extensions: [ + "ma", + "nb", + "mb" + ] +}, + "application/mathml+xml": { + source: "iana", + compressible: true, + extensions: [ + "mathml" + ] +}, + "application/mathml-content+xml": { + source: "iana", + compressible: true +}, + "application/mathml-presentation+xml": { + source: "iana", + compressible: true +}, + "application/mbms-associated-procedure-description+xml": { + source: "iana", + compressible: true +}, + "application/mbms-deregister+xml": { + source: "iana", + compressible: true +}, + "application/mbms-envelope+xml": { + source: "iana", + compressible: true +}, + "application/mbms-msk+xml": { + source: "iana", + compressible: true +}, + "application/mbms-msk-response+xml": { + source: "iana", + compressible: true +}, + "application/mbms-protection-description+xml": { + source: "iana", + compressible: true +}, + "application/mbms-reception-report+xml": { + source: "iana", + compressible: true +}, + "application/mbms-register+xml": { + source: "iana", + compressible: true +}, + "application/mbms-register-response+xml": { + source: "iana", + compressible: true +}, + "application/mbms-schedule+xml": { + source: "iana", + compressible: true +}, + "application/mbms-user-service-description+xml": { + source: "iana", + compressible: true +}, + "application/mbox": { + source: "iana", + extensions: [ + "mbox" + ] +}, + "application/media-policy-dataset+xml": { + source: "iana", + compressible: true +}, + "application/media_control+xml": { + source: "iana", + compressible: true +}, + "application/mediaservercontrol+xml": { + source: "iana", + compressible: true, + extensions: [ + "mscml" + ] +}, + "application/merge-patch+json": { + source: "iana", + compressible: true +}, + "application/metalink+xml": { + source: "apache", + compressible: true, + extensions: [ + "metalink" + ] +}, + "application/metalink4+xml": { + source: "iana", + compressible: true, + extensions: [ + "meta4" + ] +}, + "application/mets+xml": { + source: "iana", + compressible: true, + extensions: [ + "mets" + ] +}, + "application/mf4": { + source: "iana" +}, + "application/mikey": { + source: "iana" +}, + "application/mipc": { + source: "iana" +}, + "application/mmt-aei+xml": { + source: "iana", + compressible: true, + extensions: [ + "maei" + ] +}, + "application/mmt-usd+xml": { + source: "iana", + compressible: true, + extensions: [ + "musd" + ] +}, + "application/mods+xml": { + source: "iana", + compressible: true, + extensions: [ + "mods" + ] +}, + "application/moss-keys": { + source: "iana" +}, + "application/moss-signature": { + source: "iana" +}, + "application/mosskey-data": { + source: "iana" +}, + "application/mosskey-request": { + source: "iana" +}, + "application/mp21": { + source: "iana", + extensions: [ + "m21", + "mp21" + ] +}, + "application/mp4": { + source: "iana", + extensions: [ + "mp4s", + "m4p" + ] +}, + "application/mpeg4-generic": { + source: "iana" +}, + "application/mpeg4-iod": { + source: "iana" +}, + "application/mpeg4-iod-xmt": { + source: "iana" +}, + "application/mrb-consumer+xml": { + source: "iana", + compressible: true, + extensions: [ + "xdf" + ] +}, + "application/mrb-publish+xml": { + source: "iana", + compressible: true, + extensions: [ + "xdf" + ] +}, + "application/msc-ivr+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/msc-mixer+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/msword": { + source: "iana", + compressible: false, + extensions: [ + "doc", + "dot" + ] +}, + "application/mud+json": { + source: "iana", + compressible: true +}, + "application/multipart-core": { + source: "iana" +}, + "application/mxf": { + source: "iana", + extensions: [ + "mxf" + ] +}, + "application/n-quads": { + source: "iana", + extensions: [ + "nq" + ] +}, + "application/n-triples": { + source: "iana", + extensions: [ + "nt" + ] +}, + "application/nasdata": { + source: "iana" +}, + "application/news-checkgroups": { + source: "iana", + charset: "US-ASCII" +}, + "application/news-groupinfo": { + source: "iana", + charset: "US-ASCII" +}, + "application/news-transmission": { + source: "iana" +}, + "application/nlsml+xml": { + source: "iana", + compressible: true +}, + "application/node": { + source: "iana", + extensions: [ + "cjs" + ] +}, + "application/nss": { + source: "iana" +}, + "application/ocsp-request": { + source: "iana" +}, + "application/ocsp-response": { + source: "iana" +}, + "application/octet-stream": { + source: "iana", + compressible: false, + extensions: [ + "bin", + "dms", + "lrf", + "mar", + "so", + "dist", + "distz", + "pkg", + "bpk", + "dump", + "elc", + "deploy", + "exe", + "dll", + "deb", + "dmg", + "iso", + "img", + "msi", + "msp", + "msm", + "buffer" + ] +}, + "application/oda": { + source: "iana", + extensions: [ + "oda" + ] +}, + "application/odm+xml": { + source: "iana", + compressible: true +}, + "application/odx": { + source: "iana" +}, + "application/oebps-package+xml": { + source: "iana", + compressible: true, + extensions: [ + "opf" + ] +}, + "application/ogg": { + source: "iana", + compressible: false, + extensions: [ + "ogx" + ] +}, + "application/omdoc+xml": { + source: "apache", + compressible: true, + extensions: [ + "omdoc" + ] +}, + "application/onenote": { + source: "apache", + extensions: [ + "onetoc", + "onetoc2", + "onetmp", + "onepkg" + ] +}, + "application/oscore": { + source: "iana" +}, + "application/oxps": { + source: "iana", + extensions: [ + "oxps" + ] +}, + "application/p2p-overlay+xml": { + source: "iana", + compressible: true, + extensions: [ + "relo" + ] +}, + "application/parityfec": { + source: "iana" +}, + "application/passport": { + source: "iana" +}, + "application/patch-ops-error+xml": { + source: "iana", + compressible: true, + extensions: [ + "xer" + ] +}, + "application/pdf": { + source: "iana", + compressible: false, + extensions: [ + "pdf" + ] +}, + "application/pdx": { + source: "iana" +}, + "application/pem-certificate-chain": { + source: "iana" +}, + "application/pgp-encrypted": { + source: "iana", + compressible: false, + extensions: [ + "pgp" + ] +}, + "application/pgp-keys": { + source: "iana" +}, + "application/pgp-signature": { + source: "iana", + extensions: [ + "asc", + "sig" + ] +}, + "application/pics-rules": { + source: "apache", + extensions: [ + "prf" + ] +}, + "application/pidf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/pidf-diff+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/pkcs10": { + source: "iana", + extensions: [ + "p10" + ] +}, + "application/pkcs12": { + source: "iana" +}, + "application/pkcs7-mime": { + source: "iana", + extensions: [ + "p7m", + "p7c" + ] +}, + "application/pkcs7-signature": { + source: "iana", + extensions: [ + "p7s" + ] +}, + "application/pkcs8": { + source: "iana", + extensions: [ + "p8" + ] +}, + "application/pkcs8-encrypted": { + source: "iana" +}, + "application/pkix-attr-cert": { + source: "iana", + extensions: [ + "ac" + ] +}, + "application/pkix-cert": { + source: "iana", + extensions: [ + "cer" + ] +}, + "application/pkix-crl": { + source: "iana", + extensions: [ + "crl" + ] +}, + "application/pkix-pkipath": { + source: "iana", + extensions: [ + "pkipath" + ] +}, + "application/pkixcmp": { + source: "iana", + extensions: [ + "pki" + ] +}, + "application/pls+xml": { + source: "iana", + compressible: true, + extensions: [ + "pls" + ] +}, + "application/poc-settings+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/postscript": { + source: "iana", + compressible: true, + extensions: [ + "ai", + "eps", + "ps" + ] +}, + "application/ppsp-tracker+json": { + source: "iana", + compressible: true +}, + "application/problem+json": { + source: "iana", + compressible: true +}, + "application/problem+xml": { + source: "iana", + compressible: true +}, + "application/provenance+xml": { + source: "iana", + compressible: true, + extensions: [ + "provx" + ] +}, + "application/prs.alvestrand.titrax-sheet": { + source: "iana" +}, + "application/prs.cww": { + source: "iana", + extensions: [ + "cww" + ] +}, + "application/prs.hpub+zip": { + source: "iana", + compressible: false +}, + "application/prs.nprend": { + source: "iana" +}, + "application/prs.plucker": { + source: "iana" +}, + "application/prs.rdf-xml-crypt": { + source: "iana" +}, + "application/prs.xsf+xml": { + source: "iana", + compressible: true +}, + "application/pskc+xml": { + source: "iana", + compressible: true, + extensions: [ + "pskcxml" + ] +}, + "application/pvd+json": { + source: "iana", + compressible: true +}, + "application/qsig": { + source: "iana" +}, + "application/raml+yaml": { + compressible: true, + extensions: [ + "raml" + ] +}, + "application/raptorfec": { + source: "iana" +}, + "application/rdap+json": { + source: "iana", + compressible: true +}, + "application/rdf+xml": { + source: "iana", + compressible: true, + extensions: [ + "rdf", + "owl" + ] +}, + "application/reginfo+xml": { + source: "iana", + compressible: true, + extensions: [ + "rif" + ] +}, + "application/relax-ng-compact-syntax": { + source: "iana", + extensions: [ + "rnc" + ] +}, + "application/remote-printing": { + source: "iana" +}, + "application/reputon+json": { + source: "iana", + compressible: true +}, + "application/resource-lists+xml": { + source: "iana", + compressible: true, + extensions: [ + "rl" + ] +}, + "application/resource-lists-diff+xml": { + source: "iana", + compressible: true, + extensions: [ + "rld" + ] +}, + "application/rfc+xml": { + source: "iana", + compressible: true +}, + "application/riscos": { + source: "iana" +}, + "application/rlmi+xml": { + source: "iana", + compressible: true +}, + "application/rls-services+xml": { + source: "iana", + compressible: true, + extensions: [ + "rs" + ] +}, + "application/route-apd+xml": { + source: "iana", + compressible: true, + extensions: [ + "rapd" + ] +}, + "application/route-s-tsid+xml": { + source: "iana", + compressible: true, + extensions: [ + "sls" + ] +}, + "application/route-usd+xml": { + source: "iana", + compressible: true, + extensions: [ + "rusd" + ] +}, + "application/rpki-ghostbusters": { + source: "iana", + extensions: [ + "gbr" + ] +}, + "application/rpki-manifest": { + source: "iana", + extensions: [ + "mft" + ] +}, + "application/rpki-publication": { + source: "iana" +}, + "application/rpki-roa": { + source: "iana", + extensions: [ + "roa" + ] +}, + "application/rpki-updown": { + source: "iana" +}, + "application/rsd+xml": { + source: "apache", + compressible: true, + extensions: [ + "rsd" + ] +}, + "application/rss+xml": { + source: "apache", + compressible: true, + extensions: [ + "rss" + ] +}, + "application/rtf": { + source: "iana", + compressible: true, + extensions: [ + "rtf" + ] +}, + "application/rtploopback": { + source: "iana" +}, + "application/rtx": { + source: "iana" +}, + "application/samlassertion+xml": { + source: "iana", + compressible: true +}, + "application/samlmetadata+xml": { + source: "iana", + compressible: true +}, + "application/sbe": { + source: "iana" +}, + "application/sbml+xml": { + source: "iana", + compressible: true, + extensions: [ + "sbml" + ] +}, + "application/scaip+xml": { + source: "iana", + compressible: true +}, + "application/scim+json": { + source: "iana", + compressible: true +}, + "application/scvp-cv-request": { + source: "iana", + extensions: [ + "scq" + ] +}, + "application/scvp-cv-response": { + source: "iana", + extensions: [ + "scs" + ] +}, + "application/scvp-vp-request": { + source: "iana", + extensions: [ + "spq" + ] +}, + "application/scvp-vp-response": { + source: "iana", + extensions: [ + "spp" + ] +}, + "application/sdp": { + source: "iana", + extensions: [ + "sdp" + ] +}, + "application/secevent+jwt": { + source: "iana" +}, + "application/senml+cbor": { + source: "iana" +}, + "application/senml+json": { + source: "iana", + compressible: true +}, + "application/senml+xml": { + source: "iana", + compressible: true, + extensions: [ + "senmlx" + ] +}, + "application/senml-etch+cbor": { + source: "iana" +}, + "application/senml-etch+json": { + source: "iana", + compressible: true +}, + "application/senml-exi": { + source: "iana" +}, + "application/sensml+cbor": { + source: "iana" +}, + "application/sensml+json": { + source: "iana", + compressible: true +}, + "application/sensml+xml": { + source: "iana", + compressible: true, + extensions: [ + "sensmlx" + ] +}, + "application/sensml-exi": { + source: "iana" +}, + "application/sep+xml": { + source: "iana", + compressible: true +}, + "application/sep-exi": { + source: "iana" +}, + "application/session-info": { + source: "iana" +}, + "application/set-payment": { + source: "iana" +}, + "application/set-payment-initiation": { + source: "iana", + extensions: [ + "setpay" + ] +}, + "application/set-registration": { + source: "iana" +}, + "application/set-registration-initiation": { + source: "iana", + extensions: [ + "setreg" + ] +}, + "application/sgml": { + source: "iana" +}, + "application/sgml-open-catalog": { + source: "iana" +}, + "application/shf+xml": { + source: "iana", + compressible: true, + extensions: [ + "shf" + ] +}, + "application/sieve": { + source: "iana", + extensions: [ + "siv", + "sieve" + ] +}, + "application/simple-filter+xml": { + source: "iana", + compressible: true +}, + "application/simple-message-summary": { + source: "iana" +}, + "application/simplesymbolcontainer": { + source: "iana" +}, + "application/sipc": { + source: "iana" +}, + "application/slate": { + source: "iana" +}, + "application/smil": { + source: "iana" +}, + "application/smil+xml": { + source: "iana", + compressible: true, + extensions: [ + "smi", + "smil" + ] +}, + "application/smpte336m": { + source: "iana" +}, + "application/soap+fastinfoset": { + source: "iana" +}, + "application/soap+xml": { + source: "iana", + compressible: true +}, + "application/sparql-query": { + source: "iana", + extensions: [ + "rq" + ] +}, + "application/sparql-results+xml": { + source: "iana", + compressible: true, + extensions: [ + "srx" + ] +}, + "application/spirits-event+xml": { + source: "iana", + compressible: true +}, + "application/sql": { + source: "iana" +}, + "application/srgs": { + source: "iana", + extensions: [ + "gram" + ] +}, + "application/srgs+xml": { + source: "iana", + compressible: true, + extensions: [ + "grxml" + ] +}, + "application/sru+xml": { + source: "iana", + compressible: true, + extensions: [ + "sru" + ] +}, + "application/ssdl+xml": { + source: "apache", + compressible: true, + extensions: [ + "ssdl" + ] +}, + "application/ssml+xml": { + source: "iana", + compressible: true, + extensions: [ + "ssml" + ] +}, + "application/stix+json": { + source: "iana", + compressible: true +}, + "application/swid+xml": { + source: "iana", + compressible: true, + extensions: [ + "swidtag" + ] +}, + "application/tamp-apex-update": { + source: "iana" +}, + "application/tamp-apex-update-confirm": { + source: "iana" +}, + "application/tamp-community-update": { + source: "iana" +}, + "application/tamp-community-update-confirm": { + source: "iana" +}, + "application/tamp-error": { + source: "iana" +}, + "application/tamp-sequence-adjust": { + source: "iana" +}, + "application/tamp-sequence-adjust-confirm": { + source: "iana" +}, + "application/tamp-status-query": { + source: "iana" +}, + "application/tamp-status-response": { + source: "iana" +}, + "application/tamp-update": { + source: "iana" +}, + "application/tamp-update-confirm": { + source: "iana" +}, + "application/tar": { + compressible: true +}, + "application/taxii+json": { + source: "iana", + compressible: true +}, + "application/td+json": { + source: "iana", + compressible: true +}, + "application/tei+xml": { + source: "iana", + compressible: true, + extensions: [ + "tei", + "teicorpus" + ] +}, + "application/tetra_isi": { + source: "iana" +}, + "application/thraud+xml": { + source: "iana", + compressible: true, + extensions: [ + "tfi" + ] +}, + "application/timestamp-query": { + source: "iana" +}, + "application/timestamp-reply": { + source: "iana" +}, + "application/timestamped-data": { + source: "iana", + extensions: [ + "tsd" + ] +}, + "application/tlsrpt+gzip": { + source: "iana" +}, + "application/tlsrpt+json": { + source: "iana", + compressible: true +}, + "application/tnauthlist": { + source: "iana" +}, + "application/toml": { + compressible: true, + extensions: [ + "toml" + ] +}, + "application/trickle-ice-sdpfrag": { + source: "iana" +}, + "application/trig": { + source: "iana" +}, + "application/ttml+xml": { + source: "iana", + compressible: true, + extensions: [ + "ttml" + ] +}, + "application/tve-trigger": { + source: "iana" +}, + "application/tzif": { + source: "iana" +}, + "application/tzif-leap": { + source: "iana" +}, + "application/ulpfec": { + source: "iana" +}, + "application/urc-grpsheet+xml": { + source: "iana", + compressible: true +}, + "application/urc-ressheet+xml": { + source: "iana", + compressible: true, + extensions: [ + "rsheet" + ] +}, + "application/urc-targetdesc+xml": { + source: "iana", + compressible: true +}, + "application/urc-uisocketdesc+xml": { + source: "iana", + compressible: true +}, + "application/vcard+json": { + source: "iana", + compressible: true +}, + "application/vcard+xml": { + source: "iana", + compressible: true +}, + "application/vemmi": { + source: "iana" +}, + "application/vividence.scriptfile": { + source: "apache" +}, + "application/vnd.1000minds.decision-model+xml": { + source: "iana", + compressible: true, + extensions: [ + "1km" + ] +}, + "application/vnd.3gpp-prose+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp-prose-pc3ch+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp-v2x-local-service-information": { + source: "iana" +}, + "application/vnd.3gpp.access-transfer-events+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.bsf+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.gmop+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mc-signalling-ear": { + source: "iana" +}, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcdata-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcdata-payload": { + source: "iana" +}, + "application/vnd.3gpp.mcdata-service-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcdata-signalling": { + source: "iana" +}, + "application/vnd.3gpp.mcdata-ue-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcdata-user-profile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-floor-request+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-location-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-service-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-signed+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-ue-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcptt-user-profile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-location-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-service-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.mid-call+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.pic-bw-large": { + source: "iana", + extensions: [ + "plb" + ] +}, + "application/vnd.3gpp.pic-bw-small": { + source: "iana", + extensions: [ + "psb" + ] +}, + "application/vnd.3gpp.pic-bw-var": { + source: "iana", + extensions: [ + "pvb" + ] +}, + "application/vnd.3gpp.sms": { + source: "iana" +}, + "application/vnd.3gpp.sms+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.srvcc-ext+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.srvcc-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.state-and-event-info+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp.ussd+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp2.bcmcsinfo+xml": { + source: "iana", + compressible: true +}, + "application/vnd.3gpp2.sms": { + source: "iana" +}, + "application/vnd.3gpp2.tcap": { + source: "iana", + extensions: [ + "tcap" + ] +}, + "application/vnd.3lightssoftware.imagescal": { + source: "iana" +}, + "application/vnd.3m.post-it-notes": { + source: "iana", + extensions: [ + "pwn" + ] +}, + "application/vnd.accpac.simply.aso": { + source: "iana", + extensions: [ + "aso" + ] +}, + "application/vnd.accpac.simply.imp": { + source: "iana", + extensions: [ + "imp" + ] +}, + "application/vnd.acucobol": { + source: "iana", + extensions: [ + "acu" + ] +}, + "application/vnd.acucorp": { + source: "iana", + extensions: [ + "atc", + "acutc" + ] +}, + "application/vnd.adobe.air-application-installer-package+zip": { + source: "apache", + compressible: false, + extensions: [ + "air" + ] +}, + "application/vnd.adobe.flash.movie": { + source: "iana" +}, + "application/vnd.adobe.formscentral.fcdt": { + source: "iana", + extensions: [ + "fcdt" + ] +}, + "application/vnd.adobe.fxp": { + source: "iana", + extensions: [ + "fxp", + "fxpl" + ] +}, + "application/vnd.adobe.partial-upload": { + source: "iana" +}, + "application/vnd.adobe.xdp+xml": { + source: "iana", + compressible: true, + extensions: [ + "xdp" + ] +}, + "application/vnd.adobe.xfdf": { + source: "iana", + extensions: [ + "xfdf" + ] +}, + "application/vnd.aether.imp": { + source: "iana" +}, + "application/vnd.afpc.afplinedata": { + source: "iana" +}, + "application/vnd.afpc.afplinedata-pagedef": { + source: "iana" +}, + "application/vnd.afpc.foca-charset": { + source: "iana" +}, + "application/vnd.afpc.foca-codedfont": { + source: "iana" +}, + "application/vnd.afpc.foca-codepage": { + source: "iana" +}, + "application/vnd.afpc.modca": { + source: "iana" +}, + "application/vnd.afpc.modca-formdef": { + source: "iana" +}, + "application/vnd.afpc.modca-mediummap": { + source: "iana" +}, + "application/vnd.afpc.modca-objectcontainer": { + source: "iana" +}, + "application/vnd.afpc.modca-overlay": { + source: "iana" +}, + "application/vnd.afpc.modca-pagesegment": { + source: "iana" +}, + "application/vnd.ah-barcode": { + source: "iana" +}, + "application/vnd.ahead.space": { + source: "iana", + extensions: [ + "ahead" + ] +}, + "application/vnd.airzip.filesecure.azf": { + source: "iana", + extensions: [ + "azf" + ] +}, + "application/vnd.airzip.filesecure.azs": { + source: "iana", + extensions: [ + "azs" + ] +}, + "application/vnd.amadeus+json": { + source: "iana", + compressible: true +}, + "application/vnd.amazon.ebook": { + source: "apache", + extensions: [ + "azw" + ] +}, + "application/vnd.amazon.mobi8-ebook": { + source: "iana" +}, + "application/vnd.americandynamics.acc": { + source: "iana", + extensions: [ + "acc" + ] +}, + "application/vnd.amiga.ami": { + source: "iana", + extensions: [ + "ami" + ] +}, + "application/vnd.amundsen.maze+xml": { + source: "iana", + compressible: true +}, + "application/vnd.android.ota": { + source: "iana" +}, + "application/vnd.android.package-archive": { + source: "apache", + compressible: false, + extensions: [ + "apk" + ] +}, + "application/vnd.anki": { + source: "iana" +}, + "application/vnd.anser-web-certificate-issue-initiation": { + source: "iana", + extensions: [ + "cii" + ] +}, + "application/vnd.anser-web-funds-transfer-initiation": { + source: "apache", + extensions: [ + "fti" + ] +}, + "application/vnd.antix.game-component": { + source: "iana", + extensions: [ + "atx" + ] +}, + "application/vnd.apache.thrift.binary": { + source: "iana" +}, + "application/vnd.apache.thrift.compact": { + source: "iana" +}, + "application/vnd.apache.thrift.json": { + source: "iana" +}, + "application/vnd.api+json": { + source: "iana", + compressible: true +}, + "application/vnd.aplextor.warrp+json": { + source: "iana", + compressible: true +}, + "application/vnd.apothekende.reservation+json": { + source: "iana", + compressible: true +}, + "application/vnd.apple.installer+xml": { + source: "iana", + compressible: true, + extensions: [ + "mpkg" + ] +}, + "application/vnd.apple.keynote": { + source: "iana", + extensions: [ + "keynote" + ] +}, + "application/vnd.apple.mpegurl": { + source: "iana", + extensions: [ + "m3u8" + ] +}, + "application/vnd.apple.numbers": { + source: "iana", + extensions: [ + "numbers" + ] +}, + "application/vnd.apple.pages": { + source: "iana", + extensions: [ + "pages" + ] +}, + "application/vnd.apple.pkpass": { + compressible: false, + extensions: [ + "pkpass" + ] +}, + "application/vnd.arastra.swi": { + source: "iana" +}, + "application/vnd.aristanetworks.swi": { + source: "iana", + extensions: [ + "swi" + ] +}, + "application/vnd.artisan+json": { + source: "iana", + compressible: true +}, + "application/vnd.artsquare": { + source: "iana" +}, + "application/vnd.astraea-software.iota": { + source: "iana", + extensions: [ + "iota" + ] +}, + "application/vnd.audiograph": { + source: "iana", + extensions: [ + "aep" + ] +}, + "application/vnd.autopackage": { + source: "iana" +}, + "application/vnd.avalon+json": { + source: "iana", + compressible: true +}, + "application/vnd.avistar+xml": { + source: "iana", + compressible: true +}, + "application/vnd.balsamiq.bmml+xml": { + source: "iana", + compressible: true, + extensions: [ + "bmml" + ] +}, + "application/vnd.balsamiq.bmpr": { + source: "iana" +}, + "application/vnd.banana-accounting": { + source: "iana" +}, + "application/vnd.bbf.usp.error": { + source: "iana" +}, + "application/vnd.bbf.usp.msg": { + source: "iana" +}, + "application/vnd.bbf.usp.msg+json": { + source: "iana", + compressible: true +}, + "application/vnd.bekitzur-stech+json": { + source: "iana", + compressible: true +}, + "application/vnd.bint.med-content": { + source: "iana" +}, + "application/vnd.biopax.rdf+xml": { + source: "iana", + compressible: true +}, + "application/vnd.blink-idb-value-wrapper": { + source: "iana" +}, + "application/vnd.blueice.multipass": { + source: "iana", + extensions: [ + "mpm" + ] +}, + "application/vnd.bluetooth.ep.oob": { + source: "iana" +}, + "application/vnd.bluetooth.le.oob": { + source: "iana" +}, + "application/vnd.bmi": { + source: "iana", + extensions: [ + "bmi" + ] +}, + "application/vnd.bpf": { + source: "iana" +}, + "application/vnd.bpf3": { + source: "iana" +}, + "application/vnd.businessobjects": { + source: "iana", + extensions: [ + "rep" + ] +}, + "application/vnd.byu.uapi+json": { + source: "iana", + compressible: true +}, + "application/vnd.cab-jscript": { + source: "iana" +}, + "application/vnd.canon-cpdl": { + source: "iana" +}, + "application/vnd.canon-lips": { + source: "iana" +}, + "application/vnd.capasystems-pg+json": { + source: "iana", + compressible: true +}, + "application/vnd.cendio.thinlinc.clientconf": { + source: "iana" +}, + "application/vnd.century-systems.tcp_stream": { + source: "iana" +}, + "application/vnd.chemdraw+xml": { + source: "iana", + compressible: true, + extensions: [ + "cdxml" + ] +}, + "application/vnd.chess-pgn": { + source: "iana" +}, + "application/vnd.chipnuts.karaoke-mmd": { + source: "iana", + extensions: [ + "mmd" + ] +}, + "application/vnd.ciedi": { + source: "iana" +}, + "application/vnd.cinderella": { + source: "iana", + extensions: [ + "cdy" + ] +}, + "application/vnd.cirpack.isdn-ext": { + source: "iana" +}, + "application/vnd.citationstyles.style+xml": { + source: "iana", + compressible: true, + extensions: [ + "csl" + ] +}, + "application/vnd.claymore": { + source: "iana", + extensions: [ + "cla" + ] +}, + "application/vnd.cloanto.rp9": { + source: "iana", + extensions: [ + "rp9" + ] +}, + "application/vnd.clonk.c4group": { + source: "iana", + extensions: [ + "c4g", + "c4d", + "c4f", + "c4p", + "c4u" + ] +}, + "application/vnd.cluetrust.cartomobile-config": { + source: "iana", + extensions: [ + "c11amc" + ] +}, + "application/vnd.cluetrust.cartomobile-config-pkg": { + source: "iana", + extensions: [ + "c11amz" + ] +}, + "application/vnd.coffeescript": { + source: "iana" +}, + "application/vnd.collabio.xodocuments.document": { + source: "iana" +}, + "application/vnd.collabio.xodocuments.document-template": { + source: "iana" +}, + "application/vnd.collabio.xodocuments.presentation": { + source: "iana" +}, + "application/vnd.collabio.xodocuments.presentation-template": { + source: "iana" +}, + "application/vnd.collabio.xodocuments.spreadsheet": { + source: "iana" +}, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + source: "iana" +}, + "application/vnd.collection+json": { + source: "iana", + compressible: true +}, + "application/vnd.collection.doc+json": { + source: "iana", + compressible: true +}, + "application/vnd.collection.next+json": { + source: "iana", + compressible: true +}, + "application/vnd.comicbook+zip": { + source: "iana", + compressible: false +}, + "application/vnd.comicbook-rar": { + source: "iana" +}, + "application/vnd.commerce-battelle": { + source: "iana" +}, + "application/vnd.commonspace": { + source: "iana", + extensions: [ + "csp" + ] +}, + "application/vnd.contact.cmsg": { + source: "iana", + extensions: [ + "cdbcmsg" + ] +}, + "application/vnd.coreos.ignition+json": { + source: "iana", + compressible: true +}, + "application/vnd.cosmocaller": { + source: "iana", + extensions: [ + "cmc" + ] +}, + "application/vnd.crick.clicker": { + source: "iana", + extensions: [ + "clkx" + ] +}, + "application/vnd.crick.clicker.keyboard": { + source: "iana", + extensions: [ + "clkk" + ] +}, + "application/vnd.crick.clicker.palette": { + source: "iana", + extensions: [ + "clkp" + ] +}, + "application/vnd.crick.clicker.template": { + source: "iana", + extensions: [ + "clkt" + ] +}, + "application/vnd.crick.clicker.wordbank": { + source: "iana", + extensions: [ + "clkw" + ] +}, + "application/vnd.criticaltools.wbs+xml": { + source: "iana", + compressible: true, + extensions: [ + "wbs" + ] +}, + "application/vnd.cryptii.pipe+json": { + source: "iana", + compressible: true +}, + "application/vnd.crypto-shade-file": { + source: "iana" +}, + "application/vnd.ctc-posml": { + source: "iana", + extensions: [ + "pml" + ] +}, + "application/vnd.ctct.ws+xml": { + source: "iana", + compressible: true +}, + "application/vnd.cups-pdf": { + source: "iana" +}, + "application/vnd.cups-postscript": { + source: "iana" +}, + "application/vnd.cups-ppd": { + source: "iana", + extensions: [ + "ppd" + ] +}, + "application/vnd.cups-raster": { + source: "iana" +}, + "application/vnd.cups-raw": { + source: "iana" +}, + "application/vnd.curl": { + source: "iana" +}, + "application/vnd.curl.car": { + source: "apache", + extensions: [ + "car" + ] +}, + "application/vnd.curl.pcurl": { + source: "apache", + extensions: [ + "pcurl" + ] +}, + "application/vnd.cyan.dean.root+xml": { + source: "iana", + compressible: true +}, + "application/vnd.cybank": { + source: "iana" +}, + "application/vnd.d2l.coursepackage1p0+zip": { + source: "iana", + compressible: false +}, + "application/vnd.dart": { + source: "iana", + compressible: true, + extensions: [ + "dart" + ] +}, + "application/vnd.data-vision.rdz": { + source: "iana", + extensions: [ + "rdz" + ] +}, + "application/vnd.datapackage+json": { + source: "iana", + compressible: true +}, + "application/vnd.dataresource+json": { + source: "iana", + compressible: true +}, + "application/vnd.dbf": { + source: "iana" +}, + "application/vnd.debian.binary-package": { + source: "iana" +}, + "application/vnd.dece.data": { + source: "iana", + extensions: [ + "uvf", + "uvvf", + "uvd", + "uvvd" + ] +}, + "application/vnd.dece.ttml+xml": { + source: "iana", + compressible: true, + extensions: [ + "uvt", + "uvvt" + ] +}, + "application/vnd.dece.unspecified": { + source: "iana", + extensions: [ + "uvx", + "uvvx" + ] +}, + "application/vnd.dece.zip": { + source: "iana", + extensions: [ + "uvz", + "uvvz" + ] +}, + "application/vnd.denovo.fcselayout-link": { + source: "iana", + extensions: [ + "fe_launch" + ] +}, + "application/vnd.desmume.movie": { + source: "iana" +}, + "application/vnd.dir-bi.plate-dl-nosuffix": { + source: "iana" +}, + "application/vnd.dm.delegation+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dna": { + source: "iana", + extensions: [ + "dna" + ] +}, + "application/vnd.document+json": { + source: "iana", + compressible: true +}, + "application/vnd.dolby.mlp": { + source: "apache", + extensions: [ + "mlp" + ] +}, + "application/vnd.dolby.mobile.1": { + source: "iana" +}, + "application/vnd.dolby.mobile.2": { + source: "iana" +}, + "application/vnd.doremir.scorecloud-binary-document": { + source: "iana" +}, + "application/vnd.dpgraph": { + source: "iana", + extensions: [ + "dpg" + ] +}, + "application/vnd.dreamfactory": { + source: "iana", + extensions: [ + "dfac" + ] +}, + "application/vnd.drive+json": { + source: "iana", + compressible: true +}, + "application/vnd.ds-keypoint": { + source: "apache", + extensions: [ + "kpxx" + ] +}, + "application/vnd.dtg.local": { + source: "iana" +}, + "application/vnd.dtg.local.flash": { + source: "iana" +}, + "application/vnd.dtg.local.html": { + source: "iana" +}, + "application/vnd.dvb.ait": { + source: "iana", + extensions: [ + "ait" + ] +}, + "application/vnd.dvb.dvbisl+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.dvbj": { + source: "iana" +}, + "application/vnd.dvb.esgcontainer": { + source: "iana" +}, + "application/vnd.dvb.ipdcdftnotifaccess": { + source: "iana" +}, + "application/vnd.dvb.ipdcesgaccess": { + source: "iana" +}, + "application/vnd.dvb.ipdcesgaccess2": { + source: "iana" +}, + "application/vnd.dvb.ipdcesgpdd": { + source: "iana" +}, + "application/vnd.dvb.ipdcroaming": { + source: "iana" +}, + "application/vnd.dvb.iptv.alfec-base": { + source: "iana" +}, + "application/vnd.dvb.iptv.alfec-enhancement": { + source: "iana" +}, + "application/vnd.dvb.notif-aggregate-root+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.notif-container+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.notif-generic+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.notif-ia-msglist+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.notif-ia-registration-request+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.notif-ia-registration-response+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.notif-init+xml": { + source: "iana", + compressible: true +}, + "application/vnd.dvb.pfr": { + source: "iana" +}, + "application/vnd.dvb.service": { + source: "iana", + extensions: [ + "svc" + ] +}, + "application/vnd.dxr": { + source: "iana" +}, + "application/vnd.dynageo": { + source: "iana", + extensions: [ + "geo" + ] +}, + "application/vnd.dzr": { + source: "iana" +}, + "application/vnd.easykaraoke.cdgdownload": { + source: "iana" +}, + "application/vnd.ecdis-update": { + source: "iana" +}, + "application/vnd.ecip.rlp": { + source: "iana" +}, + "application/vnd.ecowin.chart": { + source: "iana", + extensions: [ + "mag" + ] +}, + "application/vnd.ecowin.filerequest": { + source: "iana" +}, + "application/vnd.ecowin.fileupdate": { + source: "iana" +}, + "application/vnd.ecowin.series": { + source: "iana" +}, + "application/vnd.ecowin.seriesrequest": { + source: "iana" +}, + "application/vnd.ecowin.seriesupdate": { + source: "iana" +}, + "application/vnd.efi.img": { + source: "iana" +}, + "application/vnd.efi.iso": { + source: "iana" +}, + "application/vnd.emclient.accessrequest+xml": { + source: "iana", + compressible: true +}, + "application/vnd.enliven": { + source: "iana", + extensions: [ + "nml" + ] +}, + "application/vnd.enphase.envoy": { + source: "iana" +}, + "application/vnd.eprints.data+xml": { + source: "iana", + compressible: true +}, + "application/vnd.epson.esf": { + source: "iana", + extensions: [ + "esf" + ] +}, + "application/vnd.epson.msf": { + source: "iana", + extensions: [ + "msf" + ] +}, + "application/vnd.epson.quickanime": { + source: "iana", + extensions: [ + "qam" + ] +}, + "application/vnd.epson.salt": { + source: "iana", + extensions: [ + "slt" + ] +}, + "application/vnd.epson.ssf": { + source: "iana", + extensions: [ + "ssf" + ] +}, + "application/vnd.ericsson.quickcall": { + source: "iana" +}, + "application/vnd.espass-espass+zip": { + source: "iana", + compressible: false +}, + "application/vnd.eszigno3+xml": { + source: "iana", + compressible: true, + extensions: [ + "es3", + "et3" + ] +}, + "application/vnd.etsi.aoc+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.asic-e+zip": { + source: "iana", + compressible: false +}, + "application/vnd.etsi.asic-s+zip": { + source: "iana", + compressible: false +}, + "application/vnd.etsi.cug+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvcommand+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvdiscovery+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvprofile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvsad-bc+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvsad-cod+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvsad-npvr+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvservice+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvsync+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.iptvueprofile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.mcid+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.mheg5": { + source: "iana" +}, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.pstn+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.sci+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.simservs+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.timestamp-token": { + source: "iana" +}, + "application/vnd.etsi.tsl+xml": { + source: "iana", + compressible: true +}, + "application/vnd.etsi.tsl.der": { + source: "iana" +}, + "application/vnd.eudora.data": { + source: "iana" +}, + "application/vnd.evolv.ecig.profile": { + source: "iana" +}, + "application/vnd.evolv.ecig.settings": { + source: "iana" +}, + "application/vnd.evolv.ecig.theme": { + source: "iana" +}, + "application/vnd.exstream-empower+zip": { + source: "iana", + compressible: false +}, + "application/vnd.exstream-package": { + source: "iana" +}, + "application/vnd.ezpix-album": { + source: "iana", + extensions: [ + "ez2" + ] +}, + "application/vnd.ezpix-package": { + source: "iana", + extensions: [ + "ez3" + ] +}, + "application/vnd.f-secure.mobile": { + source: "iana" +}, + "application/vnd.fastcopy-disk-image": { + source: "iana" +}, + "application/vnd.fdf": { + source: "iana", + extensions: [ + "fdf" + ] +}, + "application/vnd.fdsn.mseed": { + source: "iana", + extensions: [ + "mseed" + ] +}, + "application/vnd.fdsn.seed": { + source: "iana", + extensions: [ + "seed", + "dataless" + ] +}, + "application/vnd.ffsns": { + source: "iana" +}, + "application/vnd.ficlab.flb+zip": { + source: "iana", + compressible: false +}, + "application/vnd.filmit.zfc": { + source: "iana" +}, + "application/vnd.fints": { + source: "iana" +}, + "application/vnd.firemonkeys.cloudcell": { + source: "iana" +}, + "application/vnd.flographit": { + source: "iana", + extensions: [ + "gph" + ] +}, + "application/vnd.fluxtime.clip": { + source: "iana", + extensions: [ + "ftc" + ] +}, + "application/vnd.font-fontforge-sfd": { + source: "iana" +}, + "application/vnd.framemaker": { + source: "iana", + extensions: [ + "fm", + "frame", + "maker", + "book" + ] +}, + "application/vnd.frogans.fnc": { + source: "iana", + extensions: [ + "fnc" + ] +}, + "application/vnd.frogans.ltf": { + source: "iana", + extensions: [ + "ltf" + ] +}, + "application/vnd.fsc.weblaunch": { + source: "iana", + extensions: [ + "fsc" + ] +}, + "application/vnd.fujitsu.oasys": { + source: "iana", + extensions: [ + "oas" + ] +}, + "application/vnd.fujitsu.oasys2": { + source: "iana", + extensions: [ + "oa2" + ] +}, + "application/vnd.fujitsu.oasys3": { + source: "iana", + extensions: [ + "oa3" + ] +}, + "application/vnd.fujitsu.oasysgp": { + source: "iana", + extensions: [ + "fg5" + ] +}, + "application/vnd.fujitsu.oasysprs": { + source: "iana", + extensions: [ + "bh2" + ] +}, + "application/vnd.fujixerox.art-ex": { + source: "iana" +}, + "application/vnd.fujixerox.art4": { + source: "iana" +}, + "application/vnd.fujixerox.ddd": { + source: "iana", + extensions: [ + "ddd" + ] +}, + "application/vnd.fujixerox.docuworks": { + source: "iana", + extensions: [ + "xdw" + ] +}, + "application/vnd.fujixerox.docuworks.binder": { + source: "iana", + extensions: [ + "xbd" + ] +}, + "application/vnd.fujixerox.docuworks.container": { + source: "iana" +}, + "application/vnd.fujixerox.hbpl": { + source: "iana" +}, + "application/vnd.fut-misnet": { + source: "iana" +}, + "application/vnd.futoin+cbor": { + source: "iana" +}, + "application/vnd.futoin+json": { + source: "iana", + compressible: true +}, + "application/vnd.fuzzysheet": { + source: "iana", + extensions: [ + "fzs" + ] +}, + "application/vnd.genomatix.tuxedo": { + source: "iana", + extensions: [ + "txd" + ] +}, + "application/vnd.gentics.grd+json": { + source: "iana", + compressible: true +}, + "application/vnd.geo+json": { + source: "iana", + compressible: true +}, + "application/vnd.geocube+xml": { + source: "iana", + compressible: true +}, + "application/vnd.geogebra.file": { + source: "iana", + extensions: [ + "ggb" + ] +}, + "application/vnd.geogebra.tool": { + source: "iana", + extensions: [ + "ggt" + ] +}, + "application/vnd.geometry-explorer": { + source: "iana", + extensions: [ + "gex", + "gre" + ] +}, + "application/vnd.geonext": { + source: "iana", + extensions: [ + "gxt" + ] +}, + "application/vnd.geoplan": { + source: "iana", + extensions: [ + "g2w" + ] +}, + "application/vnd.geospace": { + source: "iana", + extensions: [ + "g3w" + ] +}, + "application/vnd.gerber": { + source: "iana" +}, + "application/vnd.globalplatform.card-content-mgt": { + source: "iana" +}, + "application/vnd.globalplatform.card-content-mgt-response": { + source: "iana" +}, + "application/vnd.gmx": { + source: "iana", + extensions: [ + "gmx" + ] +}, + "application/vnd.google-apps.document": { + compressible: false, + extensions: [ + "gdoc" + ] +}, + "application/vnd.google-apps.presentation": { + compressible: false, + extensions: [ + "gslides" + ] +}, + "application/vnd.google-apps.spreadsheet": { + compressible: false, + extensions: [ + "gsheet" + ] +}, + "application/vnd.google-earth.kml+xml": { + source: "iana", + compressible: true, + extensions: [ + "kml" + ] +}, + "application/vnd.google-earth.kmz": { + source: "iana", + compressible: false, + extensions: [ + "kmz" + ] +}, + "application/vnd.gov.sk.e-form+xml": { + source: "iana", + compressible: true +}, + "application/vnd.gov.sk.e-form+zip": { + source: "iana", + compressible: false +}, + "application/vnd.gov.sk.xmldatacontainer+xml": { + source: "iana", + compressible: true +}, + "application/vnd.grafeq": { + source: "iana", + extensions: [ + "gqf", + "gqs" + ] +}, + "application/vnd.gridmp": { + source: "iana" +}, + "application/vnd.groove-account": { + source: "iana", + extensions: [ + "gac" + ] +}, + "application/vnd.groove-help": { + source: "iana", + extensions: [ + "ghf" + ] +}, + "application/vnd.groove-identity-message": { + source: "iana", + extensions: [ + "gim" + ] +}, + "application/vnd.groove-injector": { + source: "iana", + extensions: [ + "grv" + ] +}, + "application/vnd.groove-tool-message": { + source: "iana", + extensions: [ + "gtm" + ] +}, + "application/vnd.groove-tool-template": { + source: "iana", + extensions: [ + "tpl" + ] +}, + "application/vnd.groove-vcard": { + source: "iana", + extensions: [ + "vcg" + ] +}, + "application/vnd.hal+json": { + source: "iana", + compressible: true +}, + "application/vnd.hal+xml": { + source: "iana", + compressible: true, + extensions: [ + "hal" + ] +}, + "application/vnd.handheld-entertainment+xml": { + source: "iana", + compressible: true, + extensions: [ + "zmm" + ] +}, + "application/vnd.hbci": { + source: "iana", + extensions: [ + "hbci" + ] +}, + "application/vnd.hc+json": { + source: "iana", + compressible: true +}, + "application/vnd.hcl-bireports": { + source: "iana" +}, + "application/vnd.hdt": { + source: "iana" +}, + "application/vnd.heroku+json": { + source: "iana", + compressible: true +}, + "application/vnd.hhe.lesson-player": { + source: "iana", + extensions: [ + "les" + ] +}, + "application/vnd.hp-hpgl": { + source: "iana", + extensions: [ + "hpgl" + ] +}, + "application/vnd.hp-hpid": { + source: "iana", + extensions: [ + "hpid" + ] +}, + "application/vnd.hp-hps": { + source: "iana", + extensions: [ + "hps" + ] +}, + "application/vnd.hp-jlyt": { + source: "iana", + extensions: [ + "jlt" + ] +}, + "application/vnd.hp-pcl": { + source: "iana", + extensions: [ + "pcl" + ] +}, + "application/vnd.hp-pclxl": { + source: "iana", + extensions: [ + "pclxl" + ] +}, + "application/vnd.httphone": { + source: "iana" +}, + "application/vnd.hydrostatix.sof-data": { + source: "iana", + extensions: [ + "sfd-hdstx" + ] +}, + "application/vnd.hyper+json": { + source: "iana", + compressible: true +}, + "application/vnd.hyper-item+json": { + source: "iana", + compressible: true +}, + "application/vnd.hyperdrive+json": { + source: "iana", + compressible: true +}, + "application/vnd.hzn-3d-crossword": { + source: "iana" +}, + "application/vnd.ibm.afplinedata": { + source: "iana" +}, + "application/vnd.ibm.electronic-media": { + source: "iana" +}, + "application/vnd.ibm.minipay": { + source: "iana", + extensions: [ + "mpy" + ] +}, + "application/vnd.ibm.modcap": { + source: "iana", + extensions: [ + "afp", + "listafp", + "list3820" + ] +}, + "application/vnd.ibm.rights-management": { + source: "iana", + extensions: [ + "irm" + ] +}, + "application/vnd.ibm.secure-container": { + source: "iana", + extensions: [ + "sc" + ] +}, + "application/vnd.iccprofile": { + source: "iana", + extensions: [ + "icc", + "icm" + ] +}, + "application/vnd.ieee.1905": { + source: "iana" +}, + "application/vnd.igloader": { + source: "iana", + extensions: [ + "igl" + ] +}, + "application/vnd.imagemeter.folder+zip": { + source: "iana", + compressible: false +}, + "application/vnd.imagemeter.image+zip": { + source: "iana", + compressible: false +}, + "application/vnd.immervision-ivp": { + source: "iana", + extensions: [ + "ivp" + ] +}, + "application/vnd.immervision-ivu": { + source: "iana", + extensions: [ + "ivu" + ] +}, + "application/vnd.ims.imsccv1p1": { + source: "iana" +}, + "application/vnd.ims.imsccv1p2": { + source: "iana" +}, + "application/vnd.ims.imsccv1p3": { + source: "iana" +}, + "application/vnd.ims.lis.v2.result+json": { + source: "iana", + compressible: true +}, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + source: "iana", + compressible: true +}, + "application/vnd.ims.lti.v2.toolproxy+json": { + source: "iana", + compressible: true +}, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + source: "iana", + compressible: true +}, + "application/vnd.ims.lti.v2.toolsettings+json": { + source: "iana", + compressible: true +}, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + source: "iana", + compressible: true +}, + "application/vnd.informedcontrol.rms+xml": { + source: "iana", + compressible: true +}, + "application/vnd.informix-visionary": { + source: "iana" +}, + "application/vnd.infotech.project": { + source: "iana" +}, + "application/vnd.infotech.project+xml": { + source: "iana", + compressible: true +}, + "application/vnd.innopath.wamp.notification": { + source: "iana" +}, + "application/vnd.insors.igm": { + source: "iana", + extensions: [ + "igm" + ] +}, + "application/vnd.intercon.formnet": { + source: "iana", + extensions: [ + "xpw", + "xpx" + ] +}, + "application/vnd.intergeo": { + source: "iana", + extensions: [ + "i2g" + ] +}, + "application/vnd.intertrust.digibox": { + source: "iana" +}, + "application/vnd.intertrust.nncp": { + source: "iana" +}, + "application/vnd.intu.qbo": { + source: "iana", + extensions: [ + "qbo" + ] +}, + "application/vnd.intu.qfx": { + source: "iana", + extensions: [ + "qfx" + ] +}, + "application/vnd.iptc.g2.catalogitem+xml": { + source: "iana", + compressible: true +}, + "application/vnd.iptc.g2.conceptitem+xml": { + source: "iana", + compressible: true +}, + "application/vnd.iptc.g2.knowledgeitem+xml": { + source: "iana", + compressible: true +}, + "application/vnd.iptc.g2.newsitem+xml": { + source: "iana", + compressible: true +}, + "application/vnd.iptc.g2.newsmessage+xml": { + source: "iana", + compressible: true +}, + "application/vnd.iptc.g2.packageitem+xml": { + source: "iana", + compressible: true +}, + "application/vnd.iptc.g2.planningitem+xml": { + source: "iana", + compressible: true +}, + "application/vnd.ipunplugged.rcprofile": { + source: "iana", + extensions: [ + "rcprofile" + ] +}, + "application/vnd.irepository.package+xml": { + source: "iana", + compressible: true, + extensions: [ + "irp" + ] +}, + "application/vnd.is-xpr": { + source: "iana", + extensions: [ + "xpr" + ] +}, + "application/vnd.isac.fcs": { + source: "iana", + extensions: [ + "fcs" + ] +}, + "application/vnd.iso11783-10+zip": { + source: "iana", + compressible: false +}, + "application/vnd.jam": { + source: "iana", + extensions: [ + "jam" + ] +}, + "application/vnd.japannet-directory-service": { + source: "iana" +}, + "application/vnd.japannet-jpnstore-wakeup": { + source: "iana" +}, + "application/vnd.japannet-payment-wakeup": { + source: "iana" +}, + "application/vnd.japannet-registration": { + source: "iana" +}, + "application/vnd.japannet-registration-wakeup": { + source: "iana" +}, + "application/vnd.japannet-setstore-wakeup": { + source: "iana" +}, + "application/vnd.japannet-verification": { + source: "iana" +}, + "application/vnd.japannet-verification-wakeup": { + source: "iana" +}, + "application/vnd.jcp.javame.midlet-rms": { + source: "iana", + extensions: [ + "rms" + ] +}, + "application/vnd.jisp": { + source: "iana", + extensions: [ + "jisp" + ] +}, + "application/vnd.joost.joda-archive": { + source: "iana", + extensions: [ + "joda" + ] +}, + "application/vnd.jsk.isdn-ngn": { + source: "iana" +}, + "application/vnd.kahootz": { + source: "iana", + extensions: [ + "ktz", + "ktr" + ] +}, + "application/vnd.kde.karbon": { + source: "iana", + extensions: [ + "karbon" + ] +}, + "application/vnd.kde.kchart": { + source: "iana", + extensions: [ + "chrt" + ] +}, + "application/vnd.kde.kformula": { + source: "iana", + extensions: [ + "kfo" + ] +}, + "application/vnd.kde.kivio": { + source: "iana", + extensions: [ + "flw" + ] +}, + "application/vnd.kde.kontour": { + source: "iana", + extensions: [ + "kon" + ] +}, + "application/vnd.kde.kpresenter": { + source: "iana", + extensions: [ + "kpr", + "kpt" + ] +}, + "application/vnd.kde.kspread": { + source: "iana", + extensions: [ + "ksp" + ] +}, + "application/vnd.kde.kword": { + source: "iana", + extensions: [ + "kwd", + "kwt" + ] +}, + "application/vnd.kenameaapp": { + source: "iana", + extensions: [ + "htke" + ] +}, + "application/vnd.kidspiration": { + source: "iana", + extensions: [ + "kia" + ] +}, + "application/vnd.kinar": { + source: "iana", + extensions: [ + "kne", + "knp" + ] +}, + "application/vnd.koan": { + source: "iana", + extensions: [ + "skp", + "skd", + "skt", + "skm" + ] +}, + "application/vnd.kodak-descriptor": { + source: "iana", + extensions: [ + "sse" + ] +}, + "application/vnd.las": { + source: "iana" +}, + "application/vnd.las.las+json": { + source: "iana", + compressible: true +}, + "application/vnd.las.las+xml": { + source: "iana", + compressible: true, + extensions: [ + "lasxml" + ] +}, + "application/vnd.laszip": { + source: "iana" +}, + "application/vnd.leap+json": { + source: "iana", + compressible: true +}, + "application/vnd.liberty-request+xml": { + source: "iana", + compressible: true +}, + "application/vnd.llamagraphics.life-balance.desktop": { + source: "iana", + extensions: [ + "lbd" + ] +}, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + source: "iana", + compressible: true, + extensions: [ + "lbe" + ] +}, + "application/vnd.logipipe.circuit+zip": { + source: "iana", + compressible: false +}, + "application/vnd.loom": { + source: "iana" +}, + "application/vnd.lotus-1-2-3": { + source: "iana", + extensions: [ + "123" + ] +}, + "application/vnd.lotus-approach": { + source: "iana", + extensions: [ + "apr" + ] +}, + "application/vnd.lotus-freelance": { + source: "iana", + extensions: [ + "pre" + ] +}, + "application/vnd.lotus-notes": { + source: "iana", + extensions: [ + "nsf" + ] +}, + "application/vnd.lotus-organizer": { + source: "iana", + extensions: [ + "org" + ] +}, + "application/vnd.lotus-screencam": { + source: "iana", + extensions: [ + "scm" + ] +}, + "application/vnd.lotus-wordpro": { + source: "iana", + extensions: [ + "lwp" + ] +}, + "application/vnd.macports.portpkg": { + source: "iana", + extensions: [ + "portpkg" + ] +}, + "application/vnd.mapbox-vector-tile": { + source: "iana" +}, + "application/vnd.marlin.drm.actiontoken+xml": { + source: "iana", + compressible: true +}, + "application/vnd.marlin.drm.conftoken+xml": { + source: "iana", + compressible: true +}, + "application/vnd.marlin.drm.license+xml": { + source: "iana", + compressible: true +}, + "application/vnd.marlin.drm.mdcf": { + source: "iana" +}, + "application/vnd.mason+json": { + source: "iana", + compressible: true +}, + "application/vnd.maxmind.maxmind-db": { + source: "iana" +}, + "application/vnd.mcd": { + source: "iana", + extensions: [ + "mcd" + ] +}, + "application/vnd.medcalcdata": { + source: "iana", + extensions: [ + "mc1" + ] +}, + "application/vnd.mediastation.cdkey": { + source: "iana", + extensions: [ + "cdkey" + ] +}, + "application/vnd.meridian-slingshot": { + source: "iana" +}, + "application/vnd.mfer": { + source: "iana", + extensions: [ + "mwf" + ] +}, + "application/vnd.mfmp": { + source: "iana", + extensions: [ + "mfm" + ] +}, + "application/vnd.micro+json": { + source: "iana", + compressible: true +}, + "application/vnd.micrografx.flo": { + source: "iana", + extensions: [ + "flo" + ] +}, + "application/vnd.micrografx.igx": { + source: "iana", + extensions: [ + "igx" + ] +}, + "application/vnd.microsoft.portable-executable": { + source: "iana" +}, + "application/vnd.microsoft.windows.thumbnail-cache": { + source: "iana" +}, + "application/vnd.miele+json": { + source: "iana", + compressible: true +}, + "application/vnd.mif": { + source: "iana", + extensions: [ + "mif" + ] +}, + "application/vnd.minisoft-hp3000-save": { + source: "iana" +}, + "application/vnd.mitsubishi.misty-guard.trustweb": { + source: "iana" +}, + "application/vnd.mobius.daf": { + source: "iana", + extensions: [ + "daf" + ] +}, + "application/vnd.mobius.dis": { + source: "iana", + extensions: [ + "dis" + ] +}, + "application/vnd.mobius.mbk": { + source: "iana", + extensions: [ + "mbk" + ] +}, + "application/vnd.mobius.mqy": { + source: "iana", + extensions: [ + "mqy" + ] +}, + "application/vnd.mobius.msl": { + source: "iana", + extensions: [ + "msl" + ] +}, + "application/vnd.mobius.plc": { + source: "iana", + extensions: [ + "plc" + ] +}, + "application/vnd.mobius.txf": { + source: "iana", + extensions: [ + "txf" + ] +}, + "application/vnd.mophun.application": { + source: "iana", + extensions: [ + "mpn" + ] +}, + "application/vnd.mophun.certificate": { + source: "iana", + extensions: [ + "mpc" + ] +}, + "application/vnd.motorola.flexsuite": { + source: "iana" +}, + "application/vnd.motorola.flexsuite.adsi": { + source: "iana" +}, + "application/vnd.motorola.flexsuite.fis": { + source: "iana" +}, + "application/vnd.motorola.flexsuite.gotap": { + source: "iana" +}, + "application/vnd.motorola.flexsuite.kmr": { + source: "iana" +}, + "application/vnd.motorola.flexsuite.ttc": { + source: "iana" +}, + "application/vnd.motorola.flexsuite.wem": { + source: "iana" +}, + "application/vnd.motorola.iprm": { + source: "iana" +}, + "application/vnd.mozilla.xul+xml": { + source: "iana", + compressible: true, + extensions: [ + "xul" + ] +}, + "application/vnd.ms-3mfdocument": { + source: "iana" +}, + "application/vnd.ms-artgalry": { + source: "iana", + extensions: [ + "cil" + ] +}, + "application/vnd.ms-asf": { + source: "iana" +}, + "application/vnd.ms-cab-compressed": { + source: "iana", + extensions: [ + "cab" + ] +}, + "application/vnd.ms-color.iccprofile": { + source: "apache" +}, + "application/vnd.ms-excel": { + source: "iana", + compressible: false, + extensions: [ + "xls", + "xlm", + "xla", + "xlc", + "xlt", + "xlw" + ] +}, + "application/vnd.ms-excel.addin.macroenabled.12": { + source: "iana", + extensions: [ + "xlam" + ] +}, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + source: "iana", + extensions: [ + "xlsb" + ] +}, + "application/vnd.ms-excel.sheet.macroenabled.12": { + source: "iana", + extensions: [ + "xlsm" + ] +}, + "application/vnd.ms-excel.template.macroenabled.12": { + source: "iana", + extensions: [ + "xltm" + ] +}, + "application/vnd.ms-fontobject": { + source: "iana", + compressible: true, + extensions: [ + "eot" + ] +}, + "application/vnd.ms-htmlhelp": { + source: "iana", + extensions: [ + "chm" + ] +}, + "application/vnd.ms-ims": { + source: "iana", + extensions: [ + "ims" + ] +}, + "application/vnd.ms-lrm": { + source: "iana", + extensions: [ + "lrm" + ] +}, + "application/vnd.ms-office.activex+xml": { + source: "iana", + compressible: true +}, + "application/vnd.ms-officetheme": { + source: "iana", + extensions: [ + "thmx" + ] +}, + "application/vnd.ms-opentype": { + source: "apache", + compressible: true +}, + "application/vnd.ms-outlook": { + compressible: false, + extensions: [ + "msg" + ] +}, + "application/vnd.ms-package.obfuscated-opentype": { + source: "apache" +}, + "application/vnd.ms-pki.seccat": { + source: "apache", + extensions: [ + "cat" + ] +}, + "application/vnd.ms-pki.stl": { + source: "apache", + extensions: [ + "stl" + ] +}, + "application/vnd.ms-playready.initiator+xml": { + source: "iana", + compressible: true +}, + "application/vnd.ms-powerpoint": { + source: "iana", + compressible: false, + extensions: [ + "ppt", + "pps", + "pot" + ] +}, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + source: "iana", + extensions: [ + "ppam" + ] +}, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + source: "iana", + extensions: [ + "pptm" + ] +}, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + source: "iana", + extensions: [ + "sldm" + ] +}, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + source: "iana", + extensions: [ + "ppsm" + ] +}, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + source: "iana", + extensions: [ + "potm" + ] +}, + "application/vnd.ms-printdevicecapabilities+xml": { + source: "iana", + compressible: true +}, + "application/vnd.ms-printing.printticket+xml": { + source: "apache", + compressible: true +}, + "application/vnd.ms-printschematicket+xml": { + source: "iana", + compressible: true +}, + "application/vnd.ms-project": { + source: "iana", + extensions: [ + "mpp", + "mpt" + ] +}, + "application/vnd.ms-tnef": { + source: "iana" +}, + "application/vnd.ms-windows.devicepairing": { + source: "iana" +}, + "application/vnd.ms-windows.nwprinting.oob": { + source: "iana" +}, + "application/vnd.ms-windows.printerpairing": { + source: "iana" +}, + "application/vnd.ms-windows.wsd.oob": { + source: "iana" +}, + "application/vnd.ms-wmdrm.lic-chlg-req": { + source: "iana" +}, + "application/vnd.ms-wmdrm.lic-resp": { + source: "iana" +}, + "application/vnd.ms-wmdrm.meter-chlg-req": { + source: "iana" +}, + "application/vnd.ms-wmdrm.meter-resp": { + source: "iana" +}, + "application/vnd.ms-word.document.macroenabled.12": { + source: "iana", + extensions: [ + "docm" + ] +}, + "application/vnd.ms-word.template.macroenabled.12": { + source: "iana", + extensions: [ + "dotm" + ] +}, + "application/vnd.ms-works": { + source: "iana", + extensions: [ + "wps", + "wks", + "wcm", + "wdb" + ] +}, + "application/vnd.ms-wpl": { + source: "iana", + extensions: [ + "wpl" + ] +}, + "application/vnd.ms-xpsdocument": { + source: "iana", + compressible: false, + extensions: [ + "xps" + ] +}, + "application/vnd.msa-disk-image": { + source: "iana" +}, + "application/vnd.mseq": { + source: "iana", + extensions: [ + "mseq" + ] +}, + "application/vnd.msign": { + source: "iana" +}, + "application/vnd.multiad.creator": { + source: "iana" +}, + "application/vnd.multiad.creator.cif": { + source: "iana" +}, + "application/vnd.music-niff": { + source: "iana" +}, + "application/vnd.musician": { + source: "iana", + extensions: [ + "mus" + ] +}, + "application/vnd.muvee.style": { + source: "iana", + extensions: [ + "msty" + ] +}, + "application/vnd.mynfc": { + source: "iana", + extensions: [ + "taglet" + ] +}, + "application/vnd.ncd.control": { + source: "iana" +}, + "application/vnd.ncd.reference": { + source: "iana" +}, + "application/vnd.nearst.inv+json": { + source: "iana", + compressible: true +}, + "application/vnd.nervana": { + source: "iana" +}, + "application/vnd.netfpx": { + source: "iana" +}, + "application/vnd.neurolanguage.nlu": { + source: "iana", + extensions: [ + "nlu" + ] +}, + "application/vnd.nimn": { + source: "iana" +}, + "application/vnd.nintendo.nitro.rom": { + source: "iana" +}, + "application/vnd.nintendo.snes.rom": { + source: "iana" +}, + "application/vnd.nitf": { + source: "iana", + extensions: [ + "ntf", + "nitf" + ] +}, + "application/vnd.noblenet-directory": { + source: "iana", + extensions: [ + "nnd" + ] +}, + "application/vnd.noblenet-sealer": { + source: "iana", + extensions: [ + "nns" + ] +}, + "application/vnd.noblenet-web": { + source: "iana", + extensions: [ + "nnw" + ] +}, + "application/vnd.nokia.catalogs": { + source: "iana" +}, + "application/vnd.nokia.conml+wbxml": { + source: "iana" +}, + "application/vnd.nokia.conml+xml": { + source: "iana", + compressible: true +}, + "application/vnd.nokia.iptv.config+xml": { + source: "iana", + compressible: true +}, + "application/vnd.nokia.isds-radio-presets": { + source: "iana" +}, + "application/vnd.nokia.landmark+wbxml": { + source: "iana" +}, + "application/vnd.nokia.landmark+xml": { + source: "iana", + compressible: true +}, + "application/vnd.nokia.landmarkcollection+xml": { + source: "iana", + compressible: true +}, + "application/vnd.nokia.n-gage.ac+xml": { + source: "iana", + compressible: true, + extensions: [ + "ac" + ] +}, + "application/vnd.nokia.n-gage.data": { + source: "iana", + extensions: [ + "ngdat" + ] +}, + "application/vnd.nokia.n-gage.symbian.install": { + source: "iana", + extensions: [ + "n-gage" + ] +}, + "application/vnd.nokia.ncd": { + source: "iana" +}, + "application/vnd.nokia.pcd+wbxml": { + source: "iana" +}, + "application/vnd.nokia.pcd+xml": { + source: "iana", + compressible: true +}, + "application/vnd.nokia.radio-preset": { + source: "iana", + extensions: [ + "rpst" + ] +}, + "application/vnd.nokia.radio-presets": { + source: "iana", + extensions: [ + "rpss" + ] +}, + "application/vnd.novadigm.edm": { + source: "iana", + extensions: [ + "edm" + ] +}, + "application/vnd.novadigm.edx": { + source: "iana", + extensions: [ + "edx" + ] +}, + "application/vnd.novadigm.ext": { + source: "iana", + extensions: [ + "ext" + ] +}, + "application/vnd.ntt-local.content-share": { + source: "iana" +}, + "application/vnd.ntt-local.file-transfer": { + source: "iana" +}, + "application/vnd.ntt-local.ogw_remote-access": { + source: "iana" +}, + "application/vnd.ntt-local.sip-ta_remote": { + source: "iana" +}, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + source: "iana" +}, + "application/vnd.oasis.opendocument.chart": { + source: "iana", + extensions: [ + "odc" + ] +}, + "application/vnd.oasis.opendocument.chart-template": { + source: "iana", + extensions: [ + "otc" + ] +}, + "application/vnd.oasis.opendocument.database": { + source: "iana", + extensions: [ + "odb" + ] +}, + "application/vnd.oasis.opendocument.formula": { + source: "iana", + extensions: [ + "odf" + ] +}, + "application/vnd.oasis.opendocument.formula-template": { + source: "iana", + extensions: [ + "odft" + ] +}, + "application/vnd.oasis.opendocument.graphics": { + source: "iana", + compressible: false, + extensions: [ + "odg" + ] +}, + "application/vnd.oasis.opendocument.graphics-template": { + source: "iana", + extensions: [ + "otg" + ] +}, + "application/vnd.oasis.opendocument.image": { + source: "iana", + extensions: [ + "odi" + ] +}, + "application/vnd.oasis.opendocument.image-template": { + source: "iana", + extensions: [ + "oti" + ] +}, + "application/vnd.oasis.opendocument.presentation": { + source: "iana", + compressible: false, + extensions: [ + "odp" + ] +}, + "application/vnd.oasis.opendocument.presentation-template": { + source: "iana", + extensions: [ + "otp" + ] +}, + "application/vnd.oasis.opendocument.spreadsheet": { + source: "iana", + compressible: false, + extensions: [ + "ods" + ] +}, + "application/vnd.oasis.opendocument.spreadsheet-template": { + source: "iana", + extensions: [ + "ots" + ] +}, + "application/vnd.oasis.opendocument.text": { + source: "iana", + compressible: false, + extensions: [ + "odt" + ] +}, + "application/vnd.oasis.opendocument.text-master": { + source: "iana", + extensions: [ + "odm" + ] +}, + "application/vnd.oasis.opendocument.text-template": { + source: "iana", + extensions: [ + "ott" + ] +}, + "application/vnd.oasis.opendocument.text-web": { + source: "iana", + extensions: [ + "oth" + ] +}, + "application/vnd.obn": { + source: "iana" +}, + "application/vnd.ocf+cbor": { + source: "iana" +}, + "application/vnd.oci.image.manifest.v1+json": { + source: "iana", + compressible: true +}, + "application/vnd.oftn.l10n+json": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.contentaccessdownload+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.contentaccessstreaming+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.cspg-hexbinary": { + source: "iana" +}, + "application/vnd.oipf.dae.svg+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.dae.xhtml+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.mippvcontrolmessage+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.pae.gem": { + source: "iana" +}, + "application/vnd.oipf.spdiscovery+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.spdlist+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.ueprofile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oipf.userprofile+xml": { + source: "iana", + compressible: true +}, + "application/vnd.olpc-sugar": { + source: "iana", + extensions: [ + "xo" + ] +}, + "application/vnd.oma-scws-config": { + source: "iana" +}, + "application/vnd.oma-scws-http-request": { + source: "iana" +}, + "application/vnd.oma-scws-http-response": { + source: "iana" +}, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.drm-trigger+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.imd+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.ltkm": { + source: "iana" +}, + "application/vnd.oma.bcast.notification+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.provisioningtrigger": { + source: "iana" +}, + "application/vnd.oma.bcast.sgboot": { + source: "iana" +}, + "application/vnd.oma.bcast.sgdd+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.sgdu": { + source: "iana" +}, + "application/vnd.oma.bcast.simple-symbol-container": { + source: "iana" +}, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.sprov+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.bcast.stkm": { + source: "iana" +}, + "application/vnd.oma.cab-address-book+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.cab-feature-handler+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.cab-pcc+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.cab-subs-invite+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.cab-user-prefs+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.dcd": { + source: "iana" +}, + "application/vnd.oma.dcdc": { + source: "iana" +}, + "application/vnd.oma.dd2+xml": { + source: "iana", + compressible: true, + extensions: [ + "dd2" + ] +}, + "application/vnd.oma.drm.risd+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.group-usage-list+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.lwm2m+json": { + source: "iana", + compressible: true +}, + "application/vnd.oma.lwm2m+tlv": { + source: "iana" +}, + "application/vnd.oma.pal+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.poc.detailed-progress-report+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.poc.final-report+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.poc.groups+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.poc.invocation-descriptor+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.poc.optimized-progress-report+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.push": { + source: "iana" +}, + "application/vnd.oma.scidm.messages+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oma.xcap-directory+xml": { + source: "iana", + compressible: true +}, + "application/vnd.omads-email+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/vnd.omads-file+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/vnd.omads-folder+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/vnd.omaloc-supl-init": { + source: "iana" +}, + "application/vnd.onepager": { + source: "iana" +}, + "application/vnd.onepagertamp": { + source: "iana" +}, + "application/vnd.onepagertamx": { + source: "iana" +}, + "application/vnd.onepagertat": { + source: "iana" +}, + "application/vnd.onepagertatp": { + source: "iana" +}, + "application/vnd.onepagertatx": { + source: "iana" +}, + "application/vnd.openblox.game+xml": { + source: "iana", + compressible: true, + extensions: [ + "obgx" + ] +}, + "application/vnd.openblox.game-binary": { + source: "iana" +}, + "application/vnd.openeye.oeb": { + source: "iana" +}, + "application/vnd.openofficeorg.extension": { + source: "apache", + extensions: [ + "oxt" + ] +}, + "application/vnd.openstreetmap.data+xml": { + source: "iana", + compressible: true, + extensions: [ + "osm" + ] +}, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + source: "iana", + compressible: false, + extensions: [ + "pptx" + ] +}, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + source: "iana", + extensions: [ + "sldx" + ] +}, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + source: "iana", + extensions: [ + "ppsx" + ] +}, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + source: "iana", + extensions: [ + "potx" + ] +}, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + source: "iana", + compressible: false, + extensions: [ + "xlsx" + ] +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + source: "iana", + extensions: [ + "xltx" + ] +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.theme+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + source: "iana" +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + source: "iana", + compressible: false, + extensions: [ + "docx" + ] +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + source: "iana", + extensions: [ + "dotx" + ] +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-package.core-properties+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + source: "iana", + compressible: true +}, + "application/vnd.openxmlformats-package.relationships+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oracle.resource+json": { + source: "iana", + compressible: true +}, + "application/vnd.orange.indata": { + source: "iana" +}, + "application/vnd.osa.netdeploy": { + source: "iana" +}, + "application/vnd.osgeo.mapguide.package": { + source: "iana", + extensions: [ + "mgp" + ] +}, + "application/vnd.osgi.bundle": { + source: "iana" +}, + "application/vnd.osgi.dp": { + source: "iana", + extensions: [ + "dp" + ] +}, + "application/vnd.osgi.subsystem": { + source: "iana", + extensions: [ + "esa" + ] +}, + "application/vnd.otps.ct-kip+xml": { + source: "iana", + compressible: true +}, + "application/vnd.oxli.countgraph": { + source: "iana" +}, + "application/vnd.pagerduty+json": { + source: "iana", + compressible: true +}, + "application/vnd.palm": { + source: "iana", + extensions: [ + "pdb", + "pqa", + "oprc" + ] +}, + "application/vnd.panoply": { + source: "iana" +}, + "application/vnd.paos.xml": { + source: "iana" +}, + "application/vnd.patentdive": { + source: "iana" +}, + "application/vnd.patientecommsdoc": { + source: "iana" +}, + "application/vnd.pawaafile": { + source: "iana", + extensions: [ + "paw" + ] +}, + "application/vnd.pcos": { + source: "iana" +}, + "application/vnd.pg.format": { + source: "iana", + extensions: [ + "str" + ] +}, + "application/vnd.pg.osasli": { + source: "iana", + extensions: [ + "ei6" + ] +}, + "application/vnd.piaccess.application-licence": { + source: "iana" +}, + "application/vnd.picsel": { + source: "iana", + extensions: [ + "efif" + ] +}, + "application/vnd.pmi.widget": { + source: "iana", + extensions: [ + "wg" + ] +}, + "application/vnd.poc.group-advertisement+xml": { + source: "iana", + compressible: true +}, + "application/vnd.pocketlearn": { + source: "iana", + extensions: [ + "plf" + ] +}, + "application/vnd.powerbuilder6": { + source: "iana", + extensions: [ + "pbd" + ] +}, + "application/vnd.powerbuilder6-s": { + source: "iana" +}, + "application/vnd.powerbuilder7": { + source: "iana" +}, + "application/vnd.powerbuilder7-s": { + source: "iana" +}, + "application/vnd.powerbuilder75": { + source: "iana" +}, + "application/vnd.powerbuilder75-s": { + source: "iana" +}, + "application/vnd.preminet": { + source: "iana" +}, + "application/vnd.previewsystems.box": { + source: "iana", + extensions: [ + "box" + ] +}, + "application/vnd.proteus.magazine": { + source: "iana", + extensions: [ + "mgz" + ] +}, + "application/vnd.psfs": { + source: "iana" +}, + "application/vnd.publishare-delta-tree": { + source: "iana", + extensions: [ + "qps" + ] +}, + "application/vnd.pvi.ptid1": { + source: "iana", + extensions: [ + "ptid" + ] +}, + "application/vnd.pwg-multiplexed": { + source: "iana" +}, + "application/vnd.pwg-xhtml-print+xml": { + source: "iana", + compressible: true +}, + "application/vnd.qualcomm.brew-app-res": { + source: "iana" +}, + "application/vnd.quarantainenet": { + source: "iana" +}, + "application/vnd.quark.quarkxpress": { + source: "iana", + extensions: [ + "qxd", + "qxt", + "qwd", + "qwt", + "qxl", + "qxb" + ] +}, + "application/vnd.quobject-quoxdocument": { + source: "iana" +}, + "application/vnd.radisys.moml+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-audit+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-audit-conf+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-audit-conn+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-audit-dialog+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-audit-stream+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-conf+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog-base+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog-group+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog-speech+xml": { + source: "iana", + compressible: true +}, + "application/vnd.radisys.msml-dialog-transform+xml": { + source: "iana", + compressible: true +}, + "application/vnd.rainstor.data": { + source: "iana" +}, + "application/vnd.rapid": { + source: "iana" +}, + "application/vnd.rar": { + source: "iana" +}, + "application/vnd.realvnc.bed": { + source: "iana", + extensions: [ + "bed" + ] +}, + "application/vnd.recordare.musicxml": { + source: "iana", + extensions: [ + "mxl" + ] +}, + "application/vnd.recordare.musicxml+xml": { + source: "iana", + compressible: true, + extensions: [ + "musicxml" + ] +}, + "application/vnd.renlearn.rlprint": { + source: "iana" +}, + "application/vnd.restful+json": { + source: "iana", + compressible: true +}, + "application/vnd.rig.cryptonote": { + source: "iana", + extensions: [ + "cryptonote" + ] +}, + "application/vnd.rim.cod": { + source: "apache", + extensions: [ + "cod" + ] +}, + "application/vnd.rn-realmedia": { + source: "apache", + extensions: [ + "rm" + ] +}, + "application/vnd.rn-realmedia-vbr": { + source: "apache", + extensions: [ + "rmvb" + ] +}, + "application/vnd.route66.link66+xml": { + source: "iana", + compressible: true, + extensions: [ + "link66" + ] +}, + "application/vnd.rs-274x": { + source: "iana" +}, + "application/vnd.ruckus.download": { + source: "iana" +}, + "application/vnd.s3sms": { + source: "iana" +}, + "application/vnd.sailingtracker.track": { + source: "iana", + extensions: [ + "st" + ] +}, + "application/vnd.sar": { + source: "iana" +}, + "application/vnd.sbm.cid": { + source: "iana" +}, + "application/vnd.sbm.mid2": { + source: "iana" +}, + "application/vnd.scribus": { + source: "iana" +}, + "application/vnd.sealed.3df": { + source: "iana" +}, + "application/vnd.sealed.csf": { + source: "iana" +}, + "application/vnd.sealed.doc": { + source: "iana" +}, + "application/vnd.sealed.eml": { + source: "iana" +}, + "application/vnd.sealed.mht": { + source: "iana" +}, + "application/vnd.sealed.net": { + source: "iana" +}, + "application/vnd.sealed.ppt": { + source: "iana" +}, + "application/vnd.sealed.tiff": { + source: "iana" +}, + "application/vnd.sealed.xls": { + source: "iana" +}, + "application/vnd.sealedmedia.softseal.html": { + source: "iana" +}, + "application/vnd.sealedmedia.softseal.pdf": { + source: "iana" +}, + "application/vnd.seemail": { + source: "iana", + extensions: [ + "see" + ] +}, + "application/vnd.sema": { + source: "iana", + extensions: [ + "sema" + ] +}, + "application/vnd.semd": { + source: "iana", + extensions: [ + "semd" + ] +}, + "application/vnd.semf": { + source: "iana", + extensions: [ + "semf" + ] +}, + "application/vnd.shade-save-file": { + source: "iana" +}, + "application/vnd.shana.informed.formdata": { + source: "iana", + extensions: [ + "ifm" + ] +}, + "application/vnd.shana.informed.formtemplate": { + source: "iana", + extensions: [ + "itp" + ] +}, + "application/vnd.shana.informed.interchange": { + source: "iana", + extensions: [ + "iif" + ] +}, + "application/vnd.shana.informed.package": { + source: "iana", + extensions: [ + "ipk" + ] +}, + "application/vnd.shootproof+json": { + source: "iana", + compressible: true +}, + "application/vnd.shopkick+json": { + source: "iana", + compressible: true +}, + "application/vnd.shp": { + source: "iana" +}, + "application/vnd.shx": { + source: "iana" +}, + "application/vnd.sigrok.session": { + source: "iana" +}, + "application/vnd.simtech-mindmapper": { + source: "iana", + extensions: [ + "twd", + "twds" + ] +}, + "application/vnd.siren+json": { + source: "iana", + compressible: true +}, + "application/vnd.smaf": { + source: "iana", + extensions: [ + "mmf" + ] +}, + "application/vnd.smart.notebook": { + source: "iana" +}, + "application/vnd.smart.teacher": { + source: "iana", + extensions: [ + "teacher" + ] +}, + "application/vnd.snesdev-page-table": { + source: "iana" +}, + "application/vnd.software602.filler.form+xml": { + source: "iana", + compressible: true, + extensions: [ + "fo" + ] +}, + "application/vnd.software602.filler.form-xml-zip": { + source: "iana" +}, + "application/vnd.solent.sdkm+xml": { + source: "iana", + compressible: true, + extensions: [ + "sdkm", + "sdkd" + ] +}, + "application/vnd.spotfire.dxp": { + source: "iana", + extensions: [ + "dxp" + ] +}, + "application/vnd.spotfire.sfs": { + source: "iana", + extensions: [ + "sfs" + ] +}, + "application/vnd.sqlite3": { + source: "iana" +}, + "application/vnd.sss-cod": { + source: "iana" +}, + "application/vnd.sss-dtf": { + source: "iana" +}, + "application/vnd.sss-ntf": { + source: "iana" +}, + "application/vnd.stardivision.calc": { + source: "apache", + extensions: [ + "sdc" + ] +}, + "application/vnd.stardivision.draw": { + source: "apache", + extensions: [ + "sda" + ] +}, + "application/vnd.stardivision.impress": { + source: "apache", + extensions: [ + "sdd" + ] +}, + "application/vnd.stardivision.math": { + source: "apache", + extensions: [ + "smf" + ] +}, + "application/vnd.stardivision.writer": { + source: "apache", + extensions: [ + "sdw", + "vor" + ] +}, + "application/vnd.stardivision.writer-global": { + source: "apache", + extensions: [ + "sgl" + ] +}, + "application/vnd.stepmania.package": { + source: "iana", + extensions: [ + "smzip" + ] +}, + "application/vnd.stepmania.stepchart": { + source: "iana", + extensions: [ + "sm" + ] +}, + "application/vnd.street-stream": { + source: "iana" +}, + "application/vnd.sun.wadl+xml": { + source: "iana", + compressible: true, + extensions: [ + "wadl" + ] +}, + "application/vnd.sun.xml.calc": { + source: "apache", + extensions: [ + "sxc" + ] +}, + "application/vnd.sun.xml.calc.template": { + source: "apache", + extensions: [ + "stc" + ] +}, + "application/vnd.sun.xml.draw": { + source: "apache", + extensions: [ + "sxd" + ] +}, + "application/vnd.sun.xml.draw.template": { + source: "apache", + extensions: [ + "std" + ] +}, + "application/vnd.sun.xml.impress": { + source: "apache", + extensions: [ + "sxi" + ] +}, + "application/vnd.sun.xml.impress.template": { + source: "apache", + extensions: [ + "sti" + ] +}, + "application/vnd.sun.xml.math": { + source: "apache", + extensions: [ + "sxm" + ] +}, + "application/vnd.sun.xml.writer": { + source: "apache", + extensions: [ + "sxw" + ] +}, + "application/vnd.sun.xml.writer.global": { + source: "apache", + extensions: [ + "sxg" + ] +}, + "application/vnd.sun.xml.writer.template": { + source: "apache", + extensions: [ + "stw" + ] +}, + "application/vnd.sus-calendar": { + source: "iana", + extensions: [ + "sus", + "susp" + ] +}, + "application/vnd.svd": { + source: "iana", + extensions: [ + "svd" + ] +}, + "application/vnd.swiftview-ics": { + source: "iana" +}, + "application/vnd.symbian.install": { + source: "apache", + extensions: [ + "sis", + "sisx" + ] +}, + "application/vnd.syncml+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "xsm" + ] +}, + "application/vnd.syncml.dm+wbxml": { + source: "iana", + charset: "UTF-8", + extensions: [ + "bdm" + ] +}, + "application/vnd.syncml.dm+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "xdm" + ] +}, + "application/vnd.syncml.dm.notification": { + source: "iana" +}, + "application/vnd.syncml.dmddf+wbxml": { + source: "iana" +}, + "application/vnd.syncml.dmddf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "ddf" + ] +}, + "application/vnd.syncml.dmtnds+wbxml": { + source: "iana" +}, + "application/vnd.syncml.dmtnds+xml": { + source: "iana", + charset: "UTF-8", + compressible: true +}, + "application/vnd.syncml.ds.notification": { + source: "iana" +}, + "application/vnd.tableschema+json": { + source: "iana", + compressible: true +}, + "application/vnd.tao.intent-module-archive": { + source: "iana", + extensions: [ + "tao" + ] +}, + "application/vnd.tcpdump.pcap": { + source: "iana", + extensions: [ + "pcap", + "cap", + "dmp" + ] +}, + "application/vnd.think-cell.ppttc+json": { + source: "iana", + compressible: true +}, + "application/vnd.tmd.mediaflex.api+xml": { + source: "iana", + compressible: true +}, + "application/vnd.tml": { + source: "iana" +}, + "application/vnd.tmobile-livetv": { + source: "iana", + extensions: [ + "tmo" + ] +}, + "application/vnd.tri.onesource": { + source: "iana" +}, + "application/vnd.trid.tpt": { + source: "iana", + extensions: [ + "tpt" + ] +}, + "application/vnd.triscape.mxs": { + source: "iana", + extensions: [ + "mxs" + ] +}, + "application/vnd.trueapp": { + source: "iana", + extensions: [ + "tra" + ] +}, + "application/vnd.truedoc": { + source: "iana" +}, + "application/vnd.ubisoft.webplayer": { + source: "iana" +}, + "application/vnd.ufdl": { + source: "iana", + extensions: [ + "ufd", + "ufdl" + ] +}, + "application/vnd.uiq.theme": { + source: "iana", + extensions: [ + "utz" + ] +}, + "application/vnd.umajin": { + source: "iana", + extensions: [ + "umj" + ] +}, + "application/vnd.unity": { + source: "iana", + extensions: [ + "unityweb" + ] +}, + "application/vnd.uoml+xml": { + source: "iana", + compressible: true, + extensions: [ + "uoml" + ] +}, + "application/vnd.uplanet.alert": { + source: "iana" +}, + "application/vnd.uplanet.alert-wbxml": { + source: "iana" +}, + "application/vnd.uplanet.bearer-choice": { + source: "iana" +}, + "application/vnd.uplanet.bearer-choice-wbxml": { + source: "iana" +}, + "application/vnd.uplanet.cacheop": { + source: "iana" +}, + "application/vnd.uplanet.cacheop-wbxml": { + source: "iana" +}, + "application/vnd.uplanet.channel": { + source: "iana" +}, + "application/vnd.uplanet.channel-wbxml": { + source: "iana" +}, + "application/vnd.uplanet.list": { + source: "iana" +}, + "application/vnd.uplanet.list-wbxml": { + source: "iana" +}, + "application/vnd.uplanet.listcmd": { + source: "iana" +}, + "application/vnd.uplanet.listcmd-wbxml": { + source: "iana" +}, + "application/vnd.uplanet.signal": { + source: "iana" +}, + "application/vnd.uri-map": { + source: "iana" +}, + "application/vnd.valve.source.material": { + source: "iana" +}, + "application/vnd.vcx": { + source: "iana", + extensions: [ + "vcx" + ] +}, + "application/vnd.vd-study": { + source: "iana" +}, + "application/vnd.vectorworks": { + source: "iana" +}, + "application/vnd.vel+json": { + source: "iana", + compressible: true +}, + "application/vnd.verimatrix.vcas": { + source: "iana" +}, + "application/vnd.veryant.thin": { + source: "iana" +}, + "application/vnd.ves.encrypted": { + source: "iana" +}, + "application/vnd.vidsoft.vidconference": { + source: "iana" +}, + "application/vnd.visio": { + source: "iana", + extensions: [ + "vsd", + "vst", + "vss", + "vsw" + ] +}, + "application/vnd.visionary": { + source: "iana", + extensions: [ + "vis" + ] +}, + "application/vnd.vividence.scriptfile": { + source: "iana" +}, + "application/vnd.vsf": { + source: "iana", + extensions: [ + "vsf" + ] +}, + "application/vnd.wap.sic": { + source: "iana" +}, + "application/vnd.wap.slc": { + source: "iana" +}, + "application/vnd.wap.wbxml": { + source: "iana", + charset: "UTF-8", + extensions: [ + "wbxml" + ] +}, + "application/vnd.wap.wmlc": { + source: "iana", + extensions: [ + "wmlc" + ] +}, + "application/vnd.wap.wmlscriptc": { + source: "iana", + extensions: [ + "wmlsc" + ] +}, + "application/vnd.webturbo": { + source: "iana", + extensions: [ + "wtb" + ] +}, + "application/vnd.wfa.p2p": { + source: "iana" +}, + "application/vnd.wfa.wsc": { + source: "iana" +}, + "application/vnd.windows.devicepairing": { + source: "iana" +}, + "application/vnd.wmc": { + source: "iana" +}, + "application/vnd.wmf.bootstrap": { + source: "iana" +}, + "application/vnd.wolfram.mathematica": { + source: "iana" +}, + "application/vnd.wolfram.mathematica.package": { + source: "iana" +}, + "application/vnd.wolfram.player": { + source: "iana", + extensions: [ + "nbp" + ] +}, + "application/vnd.wordperfect": { + source: "iana", + extensions: [ + "wpd" + ] +}, + "application/vnd.wqd": { + source: "iana", + extensions: [ + "wqd" + ] +}, + "application/vnd.wrq-hp3000-labelled": { + source: "iana" +}, + "application/vnd.wt.stf": { + source: "iana", + extensions: [ + "stf" + ] +}, + "application/vnd.wv.csp+wbxml": { + source: "iana" +}, + "application/vnd.wv.csp+xml": { + source: "iana", + compressible: true +}, + "application/vnd.wv.ssp+xml": { + source: "iana", + compressible: true +}, + "application/vnd.xacml+json": { + source: "iana", + compressible: true +}, + "application/vnd.xara": { + source: "iana", + extensions: [ + "xar" + ] +}, + "application/vnd.xfdl": { + source: "iana", + extensions: [ + "xfdl" + ] +}, + "application/vnd.xfdl.webform": { + source: "iana" +}, + "application/vnd.xmi+xml": { + source: "iana", + compressible: true +}, + "application/vnd.xmpie.cpkg": { + source: "iana" +}, + "application/vnd.xmpie.dpkg": { + source: "iana" +}, + "application/vnd.xmpie.plan": { + source: "iana" +}, + "application/vnd.xmpie.ppkg": { + source: "iana" +}, + "application/vnd.xmpie.xlim": { + source: "iana" +}, + "application/vnd.yamaha.hv-dic": { + source: "iana", + extensions: [ + "hvd" + ] +}, + "application/vnd.yamaha.hv-script": { + source: "iana", + extensions: [ + "hvs" + ] +}, + "application/vnd.yamaha.hv-voice": { + source: "iana", + extensions: [ + "hvp" + ] +}, + "application/vnd.yamaha.openscoreformat": { + source: "iana", + extensions: [ + "osf" + ] +}, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + source: "iana", + compressible: true, + extensions: [ + "osfpvg" + ] +}, + "application/vnd.yamaha.remote-setup": { + source: "iana" +}, + "application/vnd.yamaha.smaf-audio": { + source: "iana", + extensions: [ + "saf" + ] +}, + "application/vnd.yamaha.smaf-phrase": { + source: "iana", + extensions: [ + "spf" + ] +}, + "application/vnd.yamaha.through-ngn": { + source: "iana" +}, + "application/vnd.yamaha.tunnel-udpencap": { + source: "iana" +}, + "application/vnd.yaoweme": { + source: "iana" +}, + "application/vnd.yellowriver-custom-menu": { + source: "iana", + extensions: [ + "cmp" + ] +}, + "application/vnd.youtube.yt": { + source: "iana" +}, + "application/vnd.zul": { + source: "iana", + extensions: [ + "zir", + "zirz" + ] +}, + "application/vnd.zzazz.deck+xml": { + source: "iana", + compressible: true, + extensions: [ + "zaz" + ] +}, + "application/voicexml+xml": { + source: "iana", + compressible: true, + extensions: [ + "vxml" + ] +}, + "application/voucher-cms+json": { + source: "iana", + compressible: true +}, + "application/vq-rtcpxr": { + source: "iana" +}, + "application/wasm": { + compressible: true, + extensions: [ + "wasm" + ] +}, + "application/watcherinfo+xml": { + source: "iana", + compressible: true +}, + "application/webpush-options+json": { + source: "iana", + compressible: true +}, + "application/whoispp-query": { + source: "iana" +}, + "application/whoispp-response": { + source: "iana" +}, + "application/widget": { + source: "iana", + extensions: [ + "wgt" + ] +}, + "application/winhlp": { + source: "apache", + extensions: [ + "hlp" + ] +}, + "application/wita": { + source: "iana" +}, + "application/wordperfect5.1": { + source: "iana" +}, + "application/wsdl+xml": { + source: "iana", + compressible: true, + extensions: [ + "wsdl" + ] +}, + "application/wspolicy+xml": { + source: "iana", + compressible: true, + extensions: [ + "wspolicy" + ] +}, + "application/x-7z-compressed": { + source: "apache", + compressible: false, + extensions: [ + "7z" + ] +}, + "application/x-abiword": { + source: "apache", + extensions: [ + "abw" + ] +}, + "application/x-ace-compressed": { + source: "apache", + extensions: [ + "ace" + ] +}, + "application/x-amf": { + source: "apache" +}, + "application/x-apple-diskimage": { + source: "apache", + extensions: [ + "dmg" + ] +}, + "application/x-arj": { + compressible: false, + extensions: [ + "arj" + ] +}, + "application/x-authorware-bin": { + source: "apache", + extensions: [ + "aab", + "x32", + "u32", + "vox" + ] +}, + "application/x-authorware-map": { + source: "apache", + extensions: [ + "aam" + ] +}, + "application/x-authorware-seg": { + source: "apache", + extensions: [ + "aas" + ] +}, + "application/x-bcpio": { + source: "apache", + extensions: [ + "bcpio" + ] +}, + "application/x-bdoc": { + compressible: false, + extensions: [ + "bdoc" + ] +}, + "application/x-bittorrent": { + source: "apache", + extensions: [ + "torrent" + ] +}, + "application/x-blorb": { + source: "apache", + extensions: [ + "blb", + "blorb" + ] +}, + "application/x-bzip": { + source: "apache", + compressible: false, + extensions: [ + "bz" + ] +}, + "application/x-bzip2": { + source: "apache", + compressible: false, + extensions: [ + "bz2", + "boz" + ] +}, + "application/x-cbr": { + source: "apache", + extensions: [ + "cbr", + "cba", + "cbt", + "cbz", + "cb7" + ] +}, + "application/x-cdlink": { + source: "apache", + extensions: [ + "vcd" + ] +}, + "application/x-cfs-compressed": { + source: "apache", + extensions: [ + "cfs" + ] +}, + "application/x-chat": { + source: "apache", + extensions: [ + "chat" + ] +}, + "application/x-chess-pgn": { + source: "apache", + extensions: [ + "pgn" + ] +}, + "application/x-chrome-extension": { + extensions: [ + "crx" + ] +}, + "application/x-cocoa": { + source: "nginx", + extensions: [ + "cco" + ] +}, + "application/x-compress": { + source: "apache" +}, + "application/x-conference": { + source: "apache", + extensions: [ + "nsc" + ] +}, + "application/x-cpio": { + source: "apache", + extensions: [ + "cpio" + ] +}, + "application/x-csh": { + source: "apache", + extensions: [ + "csh" + ] +}, + "application/x-deb": { + compressible: false +}, + "application/x-debian-package": { + source: "apache", + extensions: [ + "deb", + "udeb" + ] +}, + "application/x-dgc-compressed": { + source: "apache", + extensions: [ + "dgc" + ] +}, + "application/x-director": { + source: "apache", + extensions: [ + "dir", + "dcr", + "dxr", + "cst", + "cct", + "cxt", + "w3d", + "fgd", + "swa" + ] +}, + "application/x-doom": { + source: "apache", + extensions: [ + "wad" + ] +}, + "application/x-dtbncx+xml": { + source: "apache", + compressible: true, + extensions: [ + "ncx" + ] +}, + "application/x-dtbook+xml": { + source: "apache", + compressible: true, + extensions: [ + "dtb" + ] +}, + "application/x-dtbresource+xml": { + source: "apache", + compressible: true, + extensions: [ + "res" + ] +}, + "application/x-dvi": { + source: "apache", + compressible: false, + extensions: [ + "dvi" + ] +}, + "application/x-envoy": { + source: "apache", + extensions: [ + "evy" + ] +}, + "application/x-eva": { + source: "apache", + extensions: [ + "eva" + ] +}, + "application/x-font-bdf": { + source: "apache", + extensions: [ + "bdf" + ] +}, + "application/x-font-dos": { + source: "apache" +}, + "application/x-font-framemaker": { + source: "apache" +}, + "application/x-font-ghostscript": { + source: "apache", + extensions: [ + "gsf" + ] +}, + "application/x-font-libgrx": { + source: "apache" +}, + "application/x-font-linux-psf": { + source: "apache", + extensions: [ + "psf" + ] +}, + "application/x-font-pcf": { + source: "apache", + extensions: [ + "pcf" + ] +}, + "application/x-font-snf": { + source: "apache", + extensions: [ + "snf" + ] +}, + "application/x-font-speedo": { + source: "apache" +}, + "application/x-font-sunos-news": { + source: "apache" +}, + "application/x-font-type1": { + source: "apache", + extensions: [ + "pfa", + "pfb", + "pfm", + "afm" + ] +}, + "application/x-font-vfont": { + source: "apache" +}, + "application/x-freearc": { + source: "apache", + extensions: [ + "arc" + ] +}, + "application/x-futuresplash": { + source: "apache", + extensions: [ + "spl" + ] +}, + "application/x-gca-compressed": { + source: "apache", + extensions: [ + "gca" + ] +}, + "application/x-glulx": { + source: "apache", + extensions: [ + "ulx" + ] +}, + "application/x-gnumeric": { + source: "apache", + extensions: [ + "gnumeric" + ] +}, + "application/x-gramps-xml": { + source: "apache", + extensions: [ + "gramps" + ] +}, + "application/x-gtar": { + source: "apache", + extensions: [ + "gtar" + ] +}, + "application/x-gzip": { + source: "apache" +}, + "application/x-hdf": { + source: "apache", + extensions: [ + "hdf" + ] +}, + "application/x-httpd-php": { + compressible: true, + extensions: [ + "php" + ] +}, + "application/x-install-instructions": { + source: "apache", + extensions: [ + "install" + ] +}, + "application/x-iso9660-image": { + source: "apache", + extensions: [ + "iso" + ] +}, + "application/x-java-archive-diff": { + source: "nginx", + extensions: [ + "jardiff" + ] +}, + "application/x-java-jnlp-file": { + source: "apache", + compressible: false, + extensions: [ + "jnlp" + ] +}, + "application/x-javascript": { + compressible: true +}, + "application/x-keepass2": { + extensions: [ + "kdbx" + ] +}, + "application/x-latex": { + source: "apache", + compressible: false, + extensions: [ + "latex" + ] +}, + "application/x-lua-bytecode": { + extensions: [ + "luac" + ] +}, + "application/x-lzh-compressed": { + source: "apache", + extensions: [ + "lzh", + "lha" + ] +}, + "application/x-makeself": { + source: "nginx", + extensions: [ + "run" + ] +}, + "application/x-mie": { + source: "apache", + extensions: [ + "mie" + ] +}, + "application/x-mobipocket-ebook": { + source: "apache", + extensions: [ + "prc", + "mobi" + ] +}, + "application/x-mpegurl": { + compressible: false +}, + "application/x-ms-application": { + source: "apache", + extensions: [ + "application" + ] +}, + "application/x-ms-shortcut": { + source: "apache", + extensions: [ + "lnk" + ] +}, + "application/x-ms-wmd": { + source: "apache", + extensions: [ + "wmd" + ] +}, + "application/x-ms-wmz": { + source: "apache", + extensions: [ + "wmz" + ] +}, + "application/x-ms-xbap": { + source: "apache", + extensions: [ + "xbap" + ] +}, + "application/x-msaccess": { + source: "apache", + extensions: [ + "mdb" + ] +}, + "application/x-msbinder": { + source: "apache", + extensions: [ + "obd" + ] +}, + "application/x-mscardfile": { + source: "apache", + extensions: [ + "crd" + ] +}, + "application/x-msclip": { + source: "apache", + extensions: [ + "clp" + ] +}, + "application/x-msdos-program": { + extensions: [ + "exe" + ] +}, + "application/x-msdownload": { + source: "apache", + extensions: [ + "exe", + "dll", + "com", + "bat", + "msi" + ] +}, + "application/x-msmediaview": { + source: "apache", + extensions: [ + "mvb", + "m13", + "m14" + ] +}, + "application/x-msmetafile": { + source: "apache", + extensions: [ + "wmf", + "wmz", + "emf", + "emz" + ] +}, + "application/x-msmoney": { + source: "apache", + extensions: [ + "mny" + ] +}, + "application/x-mspublisher": { + source: "apache", + extensions: [ + "pub" + ] +}, + "application/x-msschedule": { + source: "apache", + extensions: [ + "scd" + ] +}, + "application/x-msterminal": { + source: "apache", + extensions: [ + "trm" + ] +}, + "application/x-mswrite": { + source: "apache", + extensions: [ + "wri" + ] +}, + "application/x-netcdf": { + source: "apache", + extensions: [ + "nc", + "cdf" + ] +}, + "application/x-ns-proxy-autoconfig": { + compressible: true, + extensions: [ + "pac" + ] +}, + "application/x-nzb": { + source: "apache", + extensions: [ + "nzb" + ] +}, + "application/x-perl": { + source: "nginx", + extensions: [ + "pl", + "pm" + ] +}, + "application/x-pilot": { + source: "nginx", + extensions: [ + "prc", + "pdb" + ] +}, + "application/x-pkcs12": { + source: "apache", + compressible: false, + extensions: [ + "p12", + "pfx" + ] +}, + "application/x-pkcs7-certificates": { + source: "apache", + extensions: [ + "p7b", + "spc" + ] +}, + "application/x-pkcs7-certreqresp": { + source: "apache", + extensions: [ + "p7r" + ] +}, + "application/x-pki-message": { + source: "iana" +}, + "application/x-rar-compressed": { + source: "apache", + compressible: false, + extensions: [ + "rar" + ] +}, + "application/x-redhat-package-manager": { + source: "nginx", + extensions: [ + "rpm" + ] +}, + "application/x-research-info-systems": { + source: "apache", + extensions: [ + "ris" + ] +}, + "application/x-sea": { + source: "nginx", + extensions: [ + "sea" + ] +}, + "application/x-sh": { + source: "apache", + compressible: true, + extensions: [ + "sh" + ] +}, + "application/x-shar": { + source: "apache", + extensions: [ + "shar" + ] +}, + "application/x-shockwave-flash": { + source: "apache", + compressible: false, + extensions: [ + "swf" + ] +}, + "application/x-silverlight-app": { + source: "apache", + extensions: [ + "xap" + ] +}, + "application/x-sql": { + source: "apache", + extensions: [ + "sql" + ] +}, + "application/x-stuffit": { + source: "apache", + compressible: false, + extensions: [ + "sit" + ] +}, + "application/x-stuffitx": { + source: "apache", + extensions: [ + "sitx" + ] +}, + "application/x-subrip": { + source: "apache", + extensions: [ + "srt" + ] +}, + "application/x-sv4cpio": { + source: "apache", + extensions: [ + "sv4cpio" + ] +}, + "application/x-sv4crc": { + source: "apache", + extensions: [ + "sv4crc" + ] +}, + "application/x-t3vm-image": { + source: "apache", + extensions: [ + "t3" + ] +}, + "application/x-tads": { + source: "apache", + extensions: [ + "gam" + ] +}, + "application/x-tar": { + source: "apache", + compressible: true, + extensions: [ + "tar" + ] +}, + "application/x-tcl": { + source: "apache", + extensions: [ + "tcl", + "tk" + ] +}, + "application/x-tex": { + source: "apache", + extensions: [ + "tex" + ] +}, + "application/x-tex-tfm": { + source: "apache", + extensions: [ + "tfm" + ] +}, + "application/x-texinfo": { + source: "apache", + extensions: [ + "texinfo", + "texi" + ] +}, + "application/x-tgif": { + source: "apache", + extensions: [ + "obj" + ] +}, + "application/x-ustar": { + source: "apache", + extensions: [ + "ustar" + ] +}, + "application/x-virtualbox-hdd": { + compressible: true, + extensions: [ + "hdd" + ] +}, + "application/x-virtualbox-ova": { + compressible: true, + extensions: [ + "ova" + ] +}, + "application/x-virtualbox-ovf": { + compressible: true, + extensions: [ + "ovf" + ] +}, + "application/x-virtualbox-vbox": { + compressible: true, + extensions: [ + "vbox" + ] +}, + "application/x-virtualbox-vbox-extpack": { + compressible: false, + extensions: [ + "vbox-extpack" + ] +}, + "application/x-virtualbox-vdi": { + compressible: true, + extensions: [ + "vdi" + ] +}, + "application/x-virtualbox-vhd": { + compressible: true, + extensions: [ + "vhd" + ] +}, + "application/x-virtualbox-vmdk": { + compressible: true, + extensions: [ + "vmdk" + ] +}, + "application/x-wais-source": { + source: "apache", + extensions: [ + "src" + ] +}, + "application/x-web-app-manifest+json": { + compressible: true, + extensions: [ + "webapp" + ] +}, + "application/x-www-form-urlencoded": { + source: "iana", + compressible: true +}, + "application/x-x509-ca-cert": { + source: "iana", + extensions: [ + "der", + "crt", + "pem" + ] +}, + "application/x-x509-ca-ra-cert": { + source: "iana" +}, + "application/x-x509-next-ca-cert": { + source: "iana" +}, + "application/x-xfig": { + source: "apache", + extensions: [ + "fig" + ] +}, + "application/x-xliff+xml": { + source: "apache", + compressible: true, + extensions: [ + "xlf" + ] +}, + "application/x-xpinstall": { + source: "apache", + compressible: false, + extensions: [ + "xpi" + ] +}, + "application/x-xz": { + source: "apache", + extensions: [ + "xz" + ] +}, + "application/x-zmachine": { + source: "apache", + extensions: [ + "z1", + "z2", + "z3", + "z4", + "z5", + "z6", + "z7", + "z8" + ] +}, + "application/x400-bp": { + source: "iana" +}, + "application/xacml+xml": { + source: "iana", + compressible: true +}, + "application/xaml+xml": { + source: "apache", + compressible: true, + extensions: [ + "xaml" + ] +}, + "application/xcap-att+xml": { + source: "iana", + compressible: true, + extensions: [ + "xav" + ] +}, + "application/xcap-caps+xml": { + source: "iana", + compressible: true, + extensions: [ + "xca" + ] +}, + "application/xcap-diff+xml": { + source: "iana", + compressible: true, + extensions: [ + "xdf" + ] +}, + "application/xcap-el+xml": { + source: "iana", + compressible: true, + extensions: [ + "xel" + ] +}, + "application/xcap-error+xml": { + source: "iana", + compressible: true, + extensions: [ + "xer" + ] +}, + "application/xcap-ns+xml": { + source: "iana", + compressible: true, + extensions: [ + "xns" + ] +}, + "application/xcon-conference-info+xml": { + source: "iana", + compressible: true +}, + "application/xcon-conference-info-diff+xml": { + source: "iana", + compressible: true +}, + "application/xenc+xml": { + source: "iana", + compressible: true, + extensions: [ + "xenc" + ] +}, + "application/xhtml+xml": { + source: "iana", + compressible: true, + extensions: [ + "xhtml", + "xht" + ] +}, + "application/xhtml-voice+xml": { + source: "apache", + compressible: true +}, + "application/xliff+xml": { + source: "iana", + compressible: true, + extensions: [ + "xlf" + ] +}, + "application/xml": { + source: "iana", + compressible: true, + extensions: [ + "xml", + "xsl", + "xsd", + "rng" + ] +}, + "application/xml-dtd": { + source: "iana", + compressible: true, + extensions: [ + "dtd" + ] +}, + "application/xml-external-parsed-entity": { + source: "iana" +}, + "application/xml-patch+xml": { + source: "iana", + compressible: true +}, + "application/xmpp+xml": { + source: "iana", + compressible: true +}, + "application/xop+xml": { + source: "iana", + compressible: true, + extensions: [ + "xop" + ] +}, + "application/xproc+xml": { + source: "apache", + compressible: true, + extensions: [ + "xpl" + ] +}, + "application/xslt+xml": { + source: "iana", + compressible: true, + extensions: [ + "xslt" + ] +}, + "application/xspf+xml": { + source: "apache", + compressible: true, + extensions: [ + "xspf" + ] +}, + "application/xv+xml": { + source: "iana", + compressible: true, + extensions: [ + "mxml", + "xhvml", + "xvml", + "xvm" + ] +}, + "application/yang": { + source: "iana", + extensions: [ + "yang" + ] +}, + "application/yang-data+json": { + source: "iana", + compressible: true +}, + "application/yang-data+xml": { + source: "iana", + compressible: true +}, + "application/yang-patch+json": { + source: "iana", + compressible: true +}, + "application/yang-patch+xml": { + source: "iana", + compressible: true +}, + "application/yin+xml": { + source: "iana", + compressible: true, + extensions: [ + "yin" + ] +}, + "application/zip": { + source: "iana", + compressible: false, + extensions: [ + "zip" + ] +}, + "application/zlib": { + source: "iana" +}, + "application/zstd": { + source: "iana" +}, + "audio/1d-interleaved-parityfec": { + source: "iana" +}, + "audio/32kadpcm": { + source: "iana" +}, + "audio/3gpp": { + source: "iana", + compressible: false, + extensions: [ + "3gpp" + ] +}, + "audio/3gpp2": { + source: "iana" +}, + "audio/aac": { + source: "iana" +}, + "audio/ac3": { + source: "iana" +}, + "audio/adpcm": { + source: "apache", + extensions: [ + "adp" + ] +}, + "audio/amr": { + source: "iana" +}, + "audio/amr-wb": { + source: "iana" +}, + "audio/amr-wb+": { + source: "iana" +}, + "audio/aptx": { + source: "iana" +}, + "audio/asc": { + source: "iana" +}, + "audio/atrac-advanced-lossless": { + source: "iana" +}, + "audio/atrac-x": { + source: "iana" +}, + "audio/atrac3": { + source: "iana" +}, + "audio/basic": { + source: "iana", + compressible: false, + extensions: [ + "au", + "snd" + ] +}, + "audio/bv16": { + source: "iana" +}, + "audio/bv32": { + source: "iana" +}, + "audio/clearmode": { + source: "iana" +}, + "audio/cn": { + source: "iana" +}, + "audio/dat12": { + source: "iana" +}, + "audio/dls": { + source: "iana" +}, + "audio/dsr-es201108": { + source: "iana" +}, + "audio/dsr-es202050": { + source: "iana" +}, + "audio/dsr-es202211": { + source: "iana" +}, + "audio/dsr-es202212": { + source: "iana" +}, + "audio/dv": { + source: "iana" +}, + "audio/dvi4": { + source: "iana" +}, + "audio/eac3": { + source: "iana" +}, + "audio/encaprtp": { + source: "iana" +}, + "audio/evrc": { + source: "iana" +}, + "audio/evrc-qcp": { + source: "iana" +}, + "audio/evrc0": { + source: "iana" +}, + "audio/evrc1": { + source: "iana" +}, + "audio/evrcb": { + source: "iana" +}, + "audio/evrcb0": { + source: "iana" +}, + "audio/evrcb1": { + source: "iana" +}, + "audio/evrcnw": { + source: "iana" +}, + "audio/evrcnw0": { + source: "iana" +}, + "audio/evrcnw1": { + source: "iana" +}, + "audio/evrcwb": { + source: "iana" +}, + "audio/evrcwb0": { + source: "iana" +}, + "audio/evrcwb1": { + source: "iana" +}, + "audio/evs": { + source: "iana" +}, + "audio/flexfec": { + source: "iana" +}, + "audio/fwdred": { + source: "iana" +}, + "audio/g711-0": { + source: "iana" +}, + "audio/g719": { + source: "iana" +}, + "audio/g722": { + source: "iana" +}, + "audio/g7221": { + source: "iana" +}, + "audio/g723": { + source: "iana" +}, + "audio/g726-16": { + source: "iana" +}, + "audio/g726-24": { + source: "iana" +}, + "audio/g726-32": { + source: "iana" +}, + "audio/g726-40": { + source: "iana" +}, + "audio/g728": { + source: "iana" +}, + "audio/g729": { + source: "iana" +}, + "audio/g7291": { + source: "iana" +}, + "audio/g729d": { + source: "iana" +}, + "audio/g729e": { + source: "iana" +}, + "audio/gsm": { + source: "iana" +}, + "audio/gsm-efr": { + source: "iana" +}, + "audio/gsm-hr-08": { + source: "iana" +}, + "audio/ilbc": { + source: "iana" +}, + "audio/ip-mr_v2.5": { + source: "iana" +}, + "audio/isac": { + source: "apache" +}, + "audio/l16": { + source: "iana" +}, + "audio/l20": { + source: "iana" +}, + "audio/l24": { + source: "iana", + compressible: false +}, + "audio/l8": { + source: "iana" +}, + "audio/lpc": { + source: "iana" +}, + "audio/melp": { + source: "iana" +}, + "audio/melp1200": { + source: "iana" +}, + "audio/melp2400": { + source: "iana" +}, + "audio/melp600": { + source: "iana" +}, + "audio/mhas": { + source: "iana" +}, + "audio/midi": { + source: "apache", + extensions: [ + "mid", + "midi", + "kar", + "rmi" + ] +}, + "audio/mobile-xmf": { + source: "iana", + extensions: [ + "mxmf" + ] +}, + "audio/mp3": { + compressible: false, + extensions: [ + "mp3" + ] +}, + "audio/mp4": { + source: "iana", + compressible: false, + extensions: [ + "m4a", + "mp4a" + ] +}, + "audio/mp4a-latm": { + source: "iana" +}, + "audio/mpa": { + source: "iana" +}, + "audio/mpa-robust": { + source: "iana" +}, + "audio/mpeg": { + source: "iana", + compressible: false, + extensions: [ + "mpga", + "mp2", + "mp2a", + "mp3", + "m2a", + "m3a" + ] +}, + "audio/mpeg4-generic": { + source: "iana" +}, + "audio/musepack": { + source: "apache" +}, + "audio/ogg": { + source: "iana", + compressible: false, + extensions: [ + "oga", + "ogg", + "spx" + ] +}, + "audio/opus": { + source: "iana" +}, + "audio/parityfec": { + source: "iana" +}, + "audio/pcma": { + source: "iana" +}, + "audio/pcma-wb": { + source: "iana" +}, + "audio/pcmu": { + source: "iana" +}, + "audio/pcmu-wb": { + source: "iana" +}, + "audio/prs.sid": { + source: "iana" +}, + "audio/qcelp": { + source: "iana" +}, + "audio/raptorfec": { + source: "iana" +}, + "audio/red": { + source: "iana" +}, + "audio/rtp-enc-aescm128": { + source: "iana" +}, + "audio/rtp-midi": { + source: "iana" +}, + "audio/rtploopback": { + source: "iana" +}, + "audio/rtx": { + source: "iana" +}, + "audio/s3m": { + source: "apache", + extensions: [ + "s3m" + ] +}, + "audio/silk": { + source: "apache", + extensions: [ + "sil" + ] +}, + "audio/smv": { + source: "iana" +}, + "audio/smv-qcp": { + source: "iana" +}, + "audio/smv0": { + source: "iana" +}, + "audio/sp-midi": { + source: "iana" +}, + "audio/speex": { + source: "iana" +}, + "audio/t140c": { + source: "iana" +}, + "audio/t38": { + source: "iana" +}, + "audio/telephone-event": { + source: "iana" +}, + "audio/tetra_acelp": { + source: "iana" +}, + "audio/tetra_acelp_bb": { + source: "iana" +}, + "audio/tone": { + source: "iana" +}, + "audio/uemclip": { + source: "iana" +}, + "audio/ulpfec": { + source: "iana" +}, + "audio/usac": { + source: "iana" +}, + "audio/vdvi": { + source: "iana" +}, + "audio/vmr-wb": { + source: "iana" +}, + "audio/vnd.3gpp.iufp": { + source: "iana" +}, + "audio/vnd.4sb": { + source: "iana" +}, + "audio/vnd.audiokoz": { + source: "iana" +}, + "audio/vnd.celp": { + source: "iana" +}, + "audio/vnd.cisco.nse": { + source: "iana" +}, + "audio/vnd.cmles.radio-events": { + source: "iana" +}, + "audio/vnd.cns.anp1": { + source: "iana" +}, + "audio/vnd.cns.inf1": { + source: "iana" +}, + "audio/vnd.dece.audio": { + source: "iana", + extensions: [ + "uva", + "uvva" + ] +}, + "audio/vnd.digital-winds": { + source: "iana", + extensions: [ + "eol" + ] +}, + "audio/vnd.dlna.adts": { + source: "iana" +}, + "audio/vnd.dolby.heaac.1": { + source: "iana" +}, + "audio/vnd.dolby.heaac.2": { + source: "iana" +}, + "audio/vnd.dolby.mlp": { + source: "iana" +}, + "audio/vnd.dolby.mps": { + source: "iana" +}, + "audio/vnd.dolby.pl2": { + source: "iana" +}, + "audio/vnd.dolby.pl2x": { + source: "iana" +}, + "audio/vnd.dolby.pl2z": { + source: "iana" +}, + "audio/vnd.dolby.pulse.1": { + source: "iana" +}, + "audio/vnd.dra": { + source: "iana", + extensions: [ + "dra" + ] +}, + "audio/vnd.dts": { + source: "iana", + extensions: [ + "dts" + ] +}, + "audio/vnd.dts.hd": { + source: "iana", + extensions: [ + "dtshd" + ] +}, + "audio/vnd.dts.uhd": { + source: "iana" +}, + "audio/vnd.dvb.file": { + source: "iana" +}, + "audio/vnd.everad.plj": { + source: "iana" +}, + "audio/vnd.hns.audio": { + source: "iana" +}, + "audio/vnd.lucent.voice": { + source: "iana", + extensions: [ + "lvp" + ] +}, + "audio/vnd.ms-playready.media.pya": { + source: "iana", + extensions: [ + "pya" + ] +}, + "audio/vnd.nokia.mobile-xmf": { + source: "iana" +}, + "audio/vnd.nortel.vbk": { + source: "iana" +}, + "audio/vnd.nuera.ecelp4800": { + source: "iana", + extensions: [ + "ecelp4800" + ] +}, + "audio/vnd.nuera.ecelp7470": { + source: "iana", + extensions: [ + "ecelp7470" + ] +}, + "audio/vnd.nuera.ecelp9600": { + source: "iana", + extensions: [ + "ecelp9600" + ] +}, + "audio/vnd.octel.sbc": { + source: "iana" +}, + "audio/vnd.presonus.multitrack": { + source: "iana" +}, + "audio/vnd.qcelp": { + source: "iana" +}, + "audio/vnd.rhetorex.32kadpcm": { + source: "iana" +}, + "audio/vnd.rip": { + source: "iana", + extensions: [ + "rip" + ] +}, + "audio/vnd.rn-realaudio": { + compressible: false +}, + "audio/vnd.sealedmedia.softseal.mpeg": { + source: "iana" +}, + "audio/vnd.vmx.cvsd": { + source: "iana" +}, + "audio/vnd.wave": { + compressible: false +}, + "audio/vorbis": { + source: "iana", + compressible: false +}, + "audio/vorbis-config": { + source: "iana" +}, + "audio/wav": { + compressible: false, + extensions: [ + "wav" + ] +}, + "audio/wave": { + compressible: false, + extensions: [ + "wav" + ] +}, + "audio/webm": { + source: "apache", + compressible: false, + extensions: [ + "weba" + ] +}, + "audio/x-aac": { + source: "apache", + compressible: false, + extensions: [ + "aac" + ] +}, + "audio/x-aiff": { + source: "apache", + extensions: [ + "aif", + "aiff", + "aifc" + ] +}, + "audio/x-caf": { + source: "apache", + compressible: false, + extensions: [ + "caf" + ] +}, + "audio/x-flac": { + source: "apache", + extensions: [ + "flac" + ] +}, + "audio/x-m4a": { + source: "nginx", + extensions: [ + "m4a" + ] +}, + "audio/x-matroska": { + source: "apache", + extensions: [ + "mka" + ] +}, + "audio/x-mpegurl": { + source: "apache", + extensions: [ + "m3u" + ] +}, + "audio/x-ms-wax": { + source: "apache", + extensions: [ + "wax" + ] +}, + "audio/x-ms-wma": { + source: "apache", + extensions: [ + "wma" + ] +}, + "audio/x-pn-realaudio": { + source: "apache", + extensions: [ + "ram", + "ra" + ] +}, + "audio/x-pn-realaudio-plugin": { + source: "apache", + extensions: [ + "rmp" + ] +}, + "audio/x-realaudio": { + source: "nginx", + extensions: [ + "ra" + ] +}, + "audio/x-tta": { + source: "apache" +}, + "audio/x-wav": { + source: "apache", + extensions: [ + "wav" + ] +}, + "audio/xm": { + source: "apache", + extensions: [ + "xm" + ] +}, + "chemical/x-cdx": { + source: "apache", + extensions: [ + "cdx" + ] +}, + "chemical/x-cif": { + source: "apache", + extensions: [ + "cif" + ] +}, + "chemical/x-cmdf": { + source: "apache", + extensions: [ + "cmdf" + ] +}, + "chemical/x-cml": { + source: "apache", + extensions: [ + "cml" + ] +}, + "chemical/x-csml": { + source: "apache", + extensions: [ + "csml" + ] +}, + "chemical/x-pdb": { + source: "apache" +}, + "chemical/x-xyz": { + source: "apache", + extensions: [ + "xyz" + ] +}, + "font/collection": { + source: "iana", + extensions: [ + "ttc" + ] +}, + "font/otf": { + source: "iana", + compressible: true, + extensions: [ + "otf" + ] +}, + "font/sfnt": { + source: "iana" +}, + "font/ttf": { + source: "iana", + compressible: true, + extensions: [ + "ttf" + ] +}, + "font/woff": { + source: "iana", + extensions: [ + "woff" + ] +}, + "font/woff2": { + source: "iana", + extensions: [ + "woff2" + ] +}, + "image/aces": { + source: "iana", + extensions: [ + "exr" + ] +}, + "image/apng": { + compressible: false, + extensions: [ + "apng" + ] +}, + "image/avci": { + source: "iana" +}, + "image/avcs": { + source: "iana" +}, + "image/bmp": { + source: "iana", + compressible: true, + extensions: [ + "bmp" + ] +}, + "image/cgm": { + source: "iana", + extensions: [ + "cgm" + ] +}, + "image/dicom-rle": { + source: "iana", + extensions: [ + "drle" + ] +}, + "image/emf": { + source: "iana", + extensions: [ + "emf" + ] +}, + "image/fits": { + source: "iana", + extensions: [ + "fits" + ] +}, + "image/g3fax": { + source: "iana", + extensions: [ + "g3" + ] +}, + "image/gif": { + source: "iana", + compressible: false, + extensions: [ + "gif" + ] +}, + "image/heic": { + source: "iana", + extensions: [ + "heic" + ] +}, + "image/heic-sequence": { + source: "iana", + extensions: [ + "heics" + ] +}, + "image/heif": { + source: "iana", + extensions: [ + "heif" + ] +}, + "image/heif-sequence": { + source: "iana", + extensions: [ + "heifs" + ] +}, + "image/hej2k": { + source: "iana", + extensions: [ + "hej2" + ] +}, + "image/hsj2": { + source: "iana", + extensions: [ + "hsj2" + ] +}, + "image/ief": { + source: "iana", + extensions: [ + "ief" + ] +}, + "image/jls": { + source: "iana", + extensions: [ + "jls" + ] +}, + "image/jp2": { + source: "iana", + compressible: false, + extensions: [ + "jp2", + "jpg2" + ] +}, + "image/jpeg": { + source: "iana", + compressible: false, + extensions: [ + "jpeg", + "jpg", + "jpe" + ] +}, + "image/jph": { + source: "iana", + extensions: [ + "jph" + ] +}, + "image/jphc": { + source: "iana", + extensions: [ + "jhc" + ] +}, + "image/jpm": { + source: "iana", + compressible: false, + extensions: [ + "jpm" + ] +}, + "image/jpx": { + source: "iana", + compressible: false, + extensions: [ + "jpx", + "jpf" + ] +}, + "image/jxr": { + source: "iana", + extensions: [ + "jxr" + ] +}, + "image/jxra": { + source: "iana", + extensions: [ + "jxra" + ] +}, + "image/jxrs": { + source: "iana", + extensions: [ + "jxrs" + ] +}, + "image/jxs": { + source: "iana", + extensions: [ + "jxs" + ] +}, + "image/jxsc": { + source: "iana", + extensions: [ + "jxsc" + ] +}, + "image/jxsi": { + source: "iana", + extensions: [ + "jxsi" + ] +}, + "image/jxss": { + source: "iana", + extensions: [ + "jxss" + ] +}, + "image/ktx": { + source: "iana", + extensions: [ + "ktx" + ] +}, + "image/naplps": { + source: "iana" +}, + "image/pjpeg": { + compressible: false +}, + "image/png": { + source: "iana", + compressible: false, + extensions: [ + "png" + ] +}, + "image/prs.btif": { + source: "iana", + extensions: [ + "btif" + ] +}, + "image/prs.pti": { + source: "iana", + extensions: [ + "pti" + ] +}, + "image/pwg-raster": { + source: "iana" +}, + "image/sgi": { + source: "apache", + extensions: [ + "sgi" + ] +}, + "image/svg+xml": { + source: "iana", + compressible: true, + extensions: [ + "svg", + "svgz" + ] +}, + "image/t38": { + source: "iana", + extensions: [ + "t38" + ] +}, + "image/tiff": { + source: "iana", + compressible: false, + extensions: [ + "tif", + "tiff" + ] +}, + "image/tiff-fx": { + source: "iana", + extensions: [ + "tfx" + ] +}, + "image/vnd.adobe.photoshop": { + source: "iana", + compressible: true, + extensions: [ + "psd" + ] +}, + "image/vnd.airzip.accelerator.azv": { + source: "iana", + extensions: [ + "azv" + ] +}, + "image/vnd.cns.inf2": { + source: "iana" +}, + "image/vnd.dece.graphic": { + source: "iana", + extensions: [ + "uvi", + "uvvi", + "uvg", + "uvvg" + ] +}, + "image/vnd.djvu": { + source: "iana", + extensions: [ + "djvu", + "djv" + ] +}, + "image/vnd.dvb.subtitle": { + source: "iana", + extensions: [ + "sub" + ] +}, + "image/vnd.dwg": { + source: "iana", + extensions: [ + "dwg" + ] +}, + "image/vnd.dxf": { + source: "iana", + extensions: [ + "dxf" + ] +}, + "image/vnd.fastbidsheet": { + source: "iana", + extensions: [ + "fbs" + ] +}, + "image/vnd.fpx": { + source: "iana", + extensions: [ + "fpx" + ] +}, + "image/vnd.fst": { + source: "iana", + extensions: [ + "fst" + ] +}, + "image/vnd.fujixerox.edmics-mmr": { + source: "iana", + extensions: [ + "mmr" + ] +}, + "image/vnd.fujixerox.edmics-rlc": { + source: "iana", + extensions: [ + "rlc" + ] +}, + "image/vnd.globalgraphics.pgb": { + source: "iana" +}, + "image/vnd.microsoft.icon": { + source: "iana", + extensions: [ + "ico" + ] +}, + "image/vnd.mix": { + source: "iana" +}, + "image/vnd.mozilla.apng": { + source: "iana" +}, + "image/vnd.ms-dds": { + extensions: [ + "dds" + ] +}, + "image/vnd.ms-modi": { + source: "iana", + extensions: [ + "mdi" + ] +}, + "image/vnd.ms-photo": { + source: "apache", + extensions: [ + "wdp" + ] +}, + "image/vnd.net-fpx": { + source: "iana", + extensions: [ + "npx" + ] +}, + "image/vnd.radiance": { + source: "iana" +}, + "image/vnd.sealed.png": { + source: "iana" +}, + "image/vnd.sealedmedia.softseal.gif": { + source: "iana" +}, + "image/vnd.sealedmedia.softseal.jpg": { + source: "iana" +}, + "image/vnd.svf": { + source: "iana" +}, + "image/vnd.tencent.tap": { + source: "iana", + extensions: [ + "tap" + ] +}, + "image/vnd.valve.source.texture": { + source: "iana", + extensions: [ + "vtf" + ] +}, + "image/vnd.wap.wbmp": { + source: "iana", + extensions: [ + "wbmp" + ] +}, + "image/vnd.xiff": { + source: "iana", + extensions: [ + "xif" + ] +}, + "image/vnd.zbrush.pcx": { + source: "iana", + extensions: [ + "pcx" + ] +}, + "image/webp": { + source: "apache", + extensions: [ + "webp" + ] +}, + "image/wmf": { + source: "iana", + extensions: [ + "wmf" + ] +}, + "image/x-3ds": { + source: "apache", + extensions: [ + "3ds" + ] +}, + "image/x-cmu-raster": { + source: "apache", + extensions: [ + "ras" + ] +}, + "image/x-cmx": { + source: "apache", + extensions: [ + "cmx" + ] +}, + "image/x-freehand": { + source: "apache", + extensions: [ + "fh", + "fhc", + "fh4", + "fh5", + "fh7" + ] +}, + "image/x-icon": { + source: "apache", + compressible: true, + extensions: [ + "ico" + ] +}, + "image/x-jng": { + source: "nginx", + extensions: [ + "jng" + ] +}, + "image/x-mrsid-image": { + source: "apache", + extensions: [ + "sid" + ] +}, + "image/x-ms-bmp": { + source: "nginx", + compressible: true, + extensions: [ + "bmp" + ] +}, + "image/x-pcx": { + source: "apache", + extensions: [ + "pcx" + ] +}, + "image/x-pict": { + source: "apache", + extensions: [ + "pic", + "pct" + ] +}, + "image/x-portable-anymap": { + source: "apache", + extensions: [ + "pnm" + ] +}, + "image/x-portable-bitmap": { + source: "apache", + extensions: [ + "pbm" + ] +}, + "image/x-portable-graymap": { + source: "apache", + extensions: [ + "pgm" + ] +}, + "image/x-portable-pixmap": { + source: "apache", + extensions: [ + "ppm" + ] +}, + "image/x-rgb": { + source: "apache", + extensions: [ + "rgb" + ] +}, + "image/x-tga": { + source: "apache", + extensions: [ + "tga" + ] +}, + "image/x-xbitmap": { + source: "apache", + extensions: [ + "xbm" + ] +}, + "image/x-xcf": { + compressible: false +}, + "image/x-xpixmap": { + source: "apache", + extensions: [ + "xpm" + ] +}, + "image/x-xwindowdump": { + source: "apache", + extensions: [ + "xwd" + ] +}, + "message/cpim": { + source: "iana" +}, + "message/delivery-status": { + source: "iana" +}, + "message/disposition-notification": { + source: "iana", + extensions: [ + "disposition-notification" + ] +}, + "message/external-body": { + source: "iana" +}, + "message/feedback-report": { + source: "iana" +}, + "message/global": { + source: "iana", + extensions: [ + "u8msg" + ] +}, + "message/global-delivery-status": { + source: "iana", + extensions: [ + "u8dsn" + ] +}, + "message/global-disposition-notification": { + source: "iana", + extensions: [ + "u8mdn" + ] +}, + "message/global-headers": { + source: "iana", + extensions: [ + "u8hdr" + ] +}, + "message/http": { + source: "iana", + compressible: false +}, + "message/imdn+xml": { + source: "iana", + compressible: true +}, + "message/news": { + source: "iana" +}, + "message/partial": { + source: "iana", + compressible: false +}, + "message/rfc822": { + source: "iana", + compressible: true, + extensions: [ + "eml", + "mime" + ] +}, + "message/s-http": { + source: "iana" +}, + "message/sip": { + source: "iana" +}, + "message/sipfrag": { + source: "iana" +}, + "message/tracking-status": { + source: "iana" +}, + "message/vnd.si.simp": { + source: "iana" +}, + "message/vnd.wfa.wsc": { + source: "iana", + extensions: [ + "wsc" + ] +}, + "model/3mf": { + source: "iana", + extensions: [ + "3mf" + ] +}, + "model/gltf+json": { + source: "iana", + compressible: true, + extensions: [ + "gltf" + ] +}, + "model/gltf-binary": { + source: "iana", + compressible: true, + extensions: [ + "glb" + ] +}, + "model/iges": { + source: "iana", + compressible: false, + extensions: [ + "igs", + "iges" + ] +}, + "model/mesh": { + source: "iana", + compressible: false, + extensions: [ + "msh", + "mesh", + "silo" + ] +}, + "model/mtl": { + source: "iana", + extensions: [ + "mtl" + ] +}, + "model/obj": { + source: "iana", + extensions: [ + "obj" + ] +}, + "model/stl": { + source: "iana", + extensions: [ + "stl" + ] +}, + "model/vnd.collada+xml": { + source: "iana", + compressible: true, + extensions: [ + "dae" + ] +}, + "model/vnd.dwf": { + source: "iana", + extensions: [ + "dwf" + ] +}, + "model/vnd.flatland.3dml": { + source: "iana" +}, + "model/vnd.gdl": { + source: "iana", + extensions: [ + "gdl" + ] +}, + "model/vnd.gs-gdl": { + source: "apache" +}, + "model/vnd.gs.gdl": { + source: "iana" +}, + "model/vnd.gtw": { + source: "iana", + extensions: [ + "gtw" + ] +}, + "model/vnd.moml+xml": { + source: "iana", + compressible: true +}, + "model/vnd.mts": { + source: "iana", + extensions: [ + "mts" + ] +}, + "model/vnd.opengex": { + source: "iana", + extensions: [ + "ogex" + ] +}, + "model/vnd.parasolid.transmit.binary": { + source: "iana", + extensions: [ + "x_b" + ] +}, + "model/vnd.parasolid.transmit.text": { + source: "iana", + extensions: [ + "x_t" + ] +}, + "model/vnd.rosette.annotated-data-model": { + source: "iana" +}, + "model/vnd.usdz+zip": { + source: "iana", + compressible: false, + extensions: [ + "usdz" + ] +}, + "model/vnd.valve.source.compiled-map": { + source: "iana", + extensions: [ + "bsp" + ] +}, + "model/vnd.vtu": { + source: "iana", + extensions: [ + "vtu" + ] +}, + "model/vrml": { + source: "iana", + compressible: false, + extensions: [ + "wrl", + "vrml" + ] +}, + "model/x3d+binary": { + source: "apache", + compressible: false, + extensions: [ + "x3db", + "x3dbz" + ] +}, + "model/x3d+fastinfoset": { + source: "iana", + extensions: [ + "x3db" + ] +}, + "model/x3d+vrml": { + source: "apache", + compressible: false, + extensions: [ + "x3dv", + "x3dvz" + ] +}, + "model/x3d+xml": { + source: "iana", + compressible: true, + extensions: [ + "x3d", + "x3dz" + ] +}, + "model/x3d-vrml": { + source: "iana", + extensions: [ + "x3dv" + ] +}, + "multipart/alternative": { + source: "iana", + compressible: false +}, + "multipart/appledouble": { + source: "iana" +}, + "multipart/byteranges": { + source: "iana" +}, + "multipart/digest": { + source: "iana" +}, + "multipart/encrypted": { + source: "iana", + compressible: false +}, + "multipart/form-data": { + source: "iana", + compressible: false +}, + "multipart/header-set": { + source: "iana" +}, + "multipart/mixed": { + source: "iana" +}, + "multipart/multilingual": { + source: "iana" +}, + "multipart/parallel": { + source: "iana" +}, + "multipart/related": { + source: "iana", + compressible: false +}, + "multipart/report": { + source: "iana" +}, + "multipart/signed": { + source: "iana", + compressible: false +}, + "multipart/vnd.bint.med-plus": { + source: "iana" +}, + "multipart/voice-message": { + source: "iana" +}, + "multipart/x-mixed-replace": { + source: "iana" +}, + "text/1d-interleaved-parityfec": { + source: "iana" +}, + "text/cache-manifest": { + source: "iana", + compressible: true, + extensions: [ + "appcache", + "manifest" + ] +}, + "text/calendar": { + source: "iana", + extensions: [ + "ics", + "ifb" + ] +}, + "text/calender": { + compressible: true +}, + "text/cmd": { + compressible: true +}, + "text/coffeescript": { + extensions: [ + "coffee", + "litcoffee" + ] +}, + "text/css": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "css" + ] +}, + "text/csv": { + source: "iana", + compressible: true, + extensions: [ + "csv" + ] +}, + "text/csv-schema": { + source: "iana" +}, + "text/directory": { + source: "iana" +}, + "text/dns": { + source: "iana" +}, + "text/ecmascript": { + source: "iana" +}, + "text/encaprtp": { + source: "iana" +}, + "text/enriched": { + source: "iana" +}, + "text/flexfec": { + source: "iana" +}, + "text/fwdred": { + source: "iana" +}, + "text/grammar-ref-list": { + source: "iana" +}, + "text/html": { + source: "iana", + compressible: true, + extensions: [ + "html", + "htm", + "shtml" + ] +}, + "text/jade": { + extensions: [ + "jade" + ] +}, + "text/javascript": { + source: "iana", + compressible: true +}, + "text/jcr-cnd": { + source: "iana" +}, + "text/jsx": { + compressible: true, + extensions: [ + "jsx" + ] +}, + "text/less": { + compressible: true, + extensions: [ + "less" + ] +}, + "text/markdown": { + source: "iana", + compressible: true, + extensions: [ + "markdown", + "md" + ] +}, + "text/mathml": { + source: "nginx", + extensions: [ + "mml" + ] +}, + "text/mdx": { + compressible: true, + extensions: [ + "mdx" + ] +}, + "text/mizar": { + source: "iana" +}, + "text/n3": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "n3" + ] +}, + "text/parameters": { + source: "iana", + charset: "UTF-8" +}, + "text/parityfec": { + source: "iana" +}, + "text/plain": { + source: "iana", + compressible: true, + extensions: [ + "txt", + "text", + "conf", + "def", + "list", + "log", + "in", + "ini" + ] +}, + "text/provenance-notation": { + source: "iana", + charset: "UTF-8" +}, + "text/prs.fallenstein.rst": { + source: "iana" +}, + "text/prs.lines.tag": { + source: "iana", + extensions: [ + "dsc" + ] +}, + "text/prs.prop.logic": { + source: "iana" +}, + "text/raptorfec": { + source: "iana" +}, + "text/red": { + source: "iana" +}, + "text/rfc822-headers": { + source: "iana" +}, + "text/richtext": { + source: "iana", + compressible: true, + extensions: [ + "rtx" + ] +}, + "text/rtf": { + source: "iana", + compressible: true, + extensions: [ + "rtf" + ] +}, + "text/rtp-enc-aescm128": { + source: "iana" +}, + "text/rtploopback": { + source: "iana" +}, + "text/rtx": { + source: "iana" +}, + "text/sgml": { + source: "iana", + extensions: [ + "sgml", + "sgm" + ] +}, + "text/shex": { + extensions: [ + "shex" + ] +}, + "text/slim": { + extensions: [ + "slim", + "slm" + ] +}, + "text/strings": { + source: "iana" +}, + "text/stylus": { + extensions: [ + "stylus", + "styl" + ] +}, + "text/t140": { + source: "iana" +}, + "text/tab-separated-values": { + source: "iana", + compressible: true, + extensions: [ + "tsv" + ] +}, + "text/troff": { + source: "iana", + extensions: [ + "t", + "tr", + "roff", + "man", + "me", + "ms" + ] +}, + "text/turtle": { + source: "iana", + charset: "UTF-8", + extensions: [ + "ttl" + ] +}, + "text/ulpfec": { + source: "iana" +}, + "text/uri-list": { + source: "iana", + compressible: true, + extensions: [ + "uri", + "uris", + "urls" + ] +}, + "text/vcard": { + source: "iana", + compressible: true, + extensions: [ + "vcard" + ] +}, + "text/vnd.a": { + source: "iana" +}, + "text/vnd.abc": { + source: "iana" +}, + "text/vnd.ascii-art": { + source: "iana" +}, + "text/vnd.curl": { + source: "iana", + extensions: [ + "curl" + ] +}, + "text/vnd.curl.dcurl": { + source: "apache", + extensions: [ + "dcurl" + ] +}, + "text/vnd.curl.mcurl": { + source: "apache", + extensions: [ + "mcurl" + ] +}, + "text/vnd.curl.scurl": { + source: "apache", + extensions: [ + "scurl" + ] +}, + "text/vnd.debian.copyright": { + source: "iana", + charset: "UTF-8" +}, + "text/vnd.dmclientscript": { + source: "iana" +}, + "text/vnd.dvb.subtitle": { + source: "iana", + extensions: [ + "sub" + ] +}, + "text/vnd.esmertec.theme-descriptor": { + source: "iana", + charset: "UTF-8" +}, + "text/vnd.ficlab.flt": { + source: "iana" +}, + "text/vnd.fly": { + source: "iana", + extensions: [ + "fly" + ] +}, + "text/vnd.fmi.flexstor": { + source: "iana", + extensions: [ + "flx" + ] +}, + "text/vnd.gml": { + source: "iana" +}, + "text/vnd.graphviz": { + source: "iana", + extensions: [ + "gv" + ] +}, + "text/vnd.hgl": { + source: "iana" +}, + "text/vnd.in3d.3dml": { + source: "iana", + extensions: [ + "3dml" + ] +}, + "text/vnd.in3d.spot": { + source: "iana", + extensions: [ + "spot" + ] +}, + "text/vnd.iptc.newsml": { + source: "iana" +}, + "text/vnd.iptc.nitf": { + source: "iana" +}, + "text/vnd.latex-z": { + source: "iana" +}, + "text/vnd.motorola.reflex": { + source: "iana" +}, + "text/vnd.ms-mediapackage": { + source: "iana" +}, + "text/vnd.net2phone.commcenter.command": { + source: "iana" +}, + "text/vnd.radisys.msml-basic-layout": { + source: "iana" +}, + "text/vnd.senx.warpscript": { + source: "iana" +}, + "text/vnd.si.uricatalogue": { + source: "iana" +}, + "text/vnd.sosi": { + source: "iana" +}, + "text/vnd.sun.j2me.app-descriptor": { + source: "iana", + charset: "UTF-8", + extensions: [ + "jad" + ] +}, + "text/vnd.trolltech.linguist": { + source: "iana", + charset: "UTF-8" +}, + "text/vnd.wap.si": { + source: "iana" +}, + "text/vnd.wap.sl": { + source: "iana" +}, + "text/vnd.wap.wml": { + source: "iana", + extensions: [ + "wml" + ] +}, + "text/vnd.wap.wmlscript": { + source: "iana", + extensions: [ + "wmls" + ] +}, + "text/vtt": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: [ + "vtt" + ] +}, + "text/x-asm": { + source: "apache", + extensions: [ + "s", + "asm" + ] +}, + "text/x-c": { + source: "apache", + extensions: [ + "c", + "cc", + "cxx", + "cpp", + "h", + "hh", + "dic" + ] +}, + "text/x-component": { + source: "nginx", + extensions: [ + "htc" + ] +}, + "text/x-fortran": { + source: "apache", + extensions: [ + "f", + "for", + "f77", + "f90" + ] +}, + "text/x-gwt-rpc": { + compressible: true +}, + "text/x-handlebars-template": { + extensions: [ + "hbs" + ] +}, + "text/x-java-source": { + source: "apache", + extensions: [ + "java" + ] +}, + "text/x-jquery-tmpl": { + compressible: true +}, + "text/x-lua": { + extensions: [ + "lua" + ] +}, + "text/x-markdown": { + compressible: true, + extensions: [ + "mkd" + ] +}, + "text/x-nfo": { + source: "apache", + extensions: [ + "nfo" + ] +}, + "text/x-opml": { + source: "apache", + extensions: [ + "opml" + ] +}, + "text/x-org": { + compressible: true, + extensions: [ + "org" + ] +}, + "text/x-pascal": { + source: "apache", + extensions: [ + "p", + "pas" + ] +}, + "text/x-processing": { + compressible: true, + extensions: [ + "pde" + ] +}, + "text/x-sass": { + extensions: [ + "sass" + ] +}, + "text/x-scss": { + extensions: [ + "scss" + ] +}, + "text/x-setext": { + source: "apache", + extensions: [ + "etx" + ] +}, + "text/x-sfv": { + source: "apache", + extensions: [ + "sfv" + ] +}, + "text/x-suse-ymp": { + compressible: true, + extensions: [ + "ymp" + ] +}, + "text/x-uuencode": { + source: "apache", + extensions: [ + "uu" + ] +}, + "text/x-vcalendar": { + source: "apache", + extensions: [ + "vcs" + ] +}, + "text/x-vcard": { + source: "apache", + extensions: [ + "vcf" + ] +}, + "text/xml": { + source: "iana", + compressible: true, + extensions: [ + "xml" + ] +}, + "text/xml-external-parsed-entity": { + source: "iana" +}, + "text/yaml": { + extensions: [ + "yaml", + "yml" + ] +}, + "video/1d-interleaved-parityfec": { + source: "iana" +}, + "video/3gpp": { + source: "iana", + extensions: [ + "3gp", + "3gpp" + ] +}, + "video/3gpp-tt": { + source: "iana" +}, + "video/3gpp2": { + source: "iana", + extensions: [ + "3g2" + ] +}, + "video/bmpeg": { + source: "iana" +}, + "video/bt656": { + source: "iana" +}, + "video/celb": { + source: "iana" +}, + "video/dv": { + source: "iana" +}, + "video/encaprtp": { + source: "iana" +}, + "video/flexfec": { + source: "iana" +}, + "video/h261": { + source: "iana", + extensions: [ + "h261" + ] +}, + "video/h263": { + source: "iana", + extensions: [ + "h263" + ] +}, + "video/h263-1998": { + source: "iana" +}, + "video/h263-2000": { + source: "iana" +}, + "video/h264": { + source: "iana", + extensions: [ + "h264" + ] +}, + "video/h264-rcdo": { + source: "iana" +}, + "video/h264-svc": { + source: "iana" +}, + "video/h265": { + source: "iana" +}, + "video/iso.segment": { + source: "iana" +}, + "video/jpeg": { + source: "iana", + extensions: [ + "jpgv" + ] +}, + "video/jpeg2000": { + source: "iana" +}, + "video/jpm": { + source: "apache", + extensions: [ + "jpm", + "jpgm" + ] +}, + "video/mj2": { + source: "iana", + extensions: [ + "mj2", + "mjp2" + ] +}, + "video/mp1s": { + source: "iana" +}, + "video/mp2p": { + source: "iana" +}, + "video/mp2t": { + source: "iana", + extensions: [ + "ts" + ] +}, + "video/mp4": { + source: "iana", + compressible: false, + extensions: [ + "mp4", + "mp4v", + "mpg4" + ] +}, + "video/mp4v-es": { + source: "iana" +}, + "video/mpeg": { + source: "iana", + compressible: false, + extensions: [ + "mpeg", + "mpg", + "mpe", + "m1v", + "m2v" + ] +}, + "video/mpeg4-generic": { + source: "iana" +}, + "video/mpv": { + source: "iana" +}, + "video/nv": { + source: "iana" +}, + "video/ogg": { + source: "iana", + compressible: false, + extensions: [ + "ogv" + ] +}, + "video/parityfec": { + source: "iana" +}, + "video/pointer": { + source: "iana" +}, + "video/quicktime": { + source: "iana", + compressible: false, + extensions: [ + "qt", + "mov" + ] +}, + "video/raptorfec": { + source: "iana" +}, + "video/raw": { + source: "iana" +}, + "video/rtp-enc-aescm128": { + source: "iana" +}, + "video/rtploopback": { + source: "iana" +}, + "video/rtx": { + source: "iana" +}, + "video/smpte291": { + source: "iana" +}, + "video/smpte292m": { + source: "iana" +}, + "video/ulpfec": { + source: "iana" +}, + "video/vc1": { + source: "iana" +}, + "video/vc2": { + source: "iana" +}, + "video/vnd.cctv": { + source: "iana" +}, + "video/vnd.dece.hd": { + source: "iana", + extensions: [ + "uvh", + "uvvh" + ] +}, + "video/vnd.dece.mobile": { + source: "iana", + extensions: [ + "uvm", + "uvvm" + ] +}, + "video/vnd.dece.mp4": { + source: "iana" +}, + "video/vnd.dece.pd": { + source: "iana", + extensions: [ + "uvp", + "uvvp" + ] +}, + "video/vnd.dece.sd": { + source: "iana", + extensions: [ + "uvs", + "uvvs" + ] +}, + "video/vnd.dece.video": { + source: "iana", + extensions: [ + "uvv", + "uvvv" + ] +}, + "video/vnd.directv.mpeg": { + source: "iana" +}, + "video/vnd.directv.mpeg-tts": { + source: "iana" +}, + "video/vnd.dlna.mpeg-tts": { + source: "iana" +}, + "video/vnd.dvb.file": { + source: "iana", + extensions: [ + "dvb" + ] +}, + "video/vnd.fvt": { + source: "iana", + extensions: [ + "fvt" + ] +}, + "video/vnd.hns.video": { + source: "iana" +}, + "video/vnd.iptvforum.1dparityfec-1010": { + source: "iana" +}, + "video/vnd.iptvforum.1dparityfec-2005": { + source: "iana" +}, + "video/vnd.iptvforum.2dparityfec-1010": { + source: "iana" +}, + "video/vnd.iptvforum.2dparityfec-2005": { + source: "iana" +}, + "video/vnd.iptvforum.ttsavc": { + source: "iana" +}, + "video/vnd.iptvforum.ttsmpeg2": { + source: "iana" +}, + "video/vnd.motorola.video": { + source: "iana" +}, + "video/vnd.motorola.videop": { + source: "iana" +}, + "video/vnd.mpegurl": { + source: "iana", + extensions: [ + "mxu", + "m4u" + ] +}, + "video/vnd.ms-playready.media.pyv": { + source: "iana", + extensions: [ + "pyv" + ] +}, + "video/vnd.nokia.interleaved-multimedia": { + source: "iana" +}, + "video/vnd.nokia.mp4vr": { + source: "iana" +}, + "video/vnd.nokia.videovoip": { + source: "iana" +}, + "video/vnd.objectvideo": { + source: "iana" +}, + "video/vnd.radgamettools.bink": { + source: "iana" +}, + "video/vnd.radgamettools.smacker": { + source: "iana" +}, + "video/vnd.sealed.mpeg1": { + source: "iana" +}, + "video/vnd.sealed.mpeg4": { + source: "iana" +}, + "video/vnd.sealed.swf": { + source: "iana" +}, + "video/vnd.sealedmedia.softseal.mov": { + source: "iana" +}, + "video/vnd.uvvu.mp4": { + source: "iana", + extensions: [ + "uvu", + "uvvu" + ] +}, + "video/vnd.vivo": { + source: "iana", + extensions: [ + "viv" + ] +}, + "video/vnd.youtube.yt": { + source: "iana" +}, + "video/vp8": { + source: "iana" +}, + "video/webm": { + source: "apache", + compressible: false, + extensions: [ + "webm" + ] +}, + "video/x-f4v": { + source: "apache", + extensions: [ + "f4v" + ] +}, + "video/x-fli": { + source: "apache", + extensions: [ + "fli" + ] +}, + "video/x-flv": { + source: "apache", + compressible: false, + extensions: [ + "flv" + ] +}, + "video/x-m4v": { + source: "apache", + extensions: [ + "m4v" + ] +}, + "video/x-matroska": { + source: "apache", + compressible: false, + extensions: [ + "mkv", + "mk3d", + "mks" + ] +}, + "video/x-mng": { + source: "apache", + extensions: [ + "mng" + ] +}, + "video/x-ms-asf": { + source: "apache", + extensions: [ + "asf", + "asx" + ] +}, + "video/x-ms-vob": { + source: "apache", + extensions: [ + "vob" + ] +}, + "video/x-ms-wm": { + source: "apache", + extensions: [ + "wm" + ] +}, + "video/x-ms-wmv": { + source: "apache", + compressible: false, + extensions: [ + "wmv" + ] +}, + "video/x-ms-wmx": { + source: "apache", + extensions: [ + "wmx" + ] +}, + "video/x-ms-wvx": { + source: "apache", + extensions: [ + "wvx" + ] +}, + "video/x-msvideo": { + source: "apache", + extensions: [ + "avi" + ] +}, + "video/x-sgi-movie": { + source: "apache", + extensions: [ + "movie" + ] +}, + "video/x-smv": { + source: "apache", + extensions: [ + "smv" + ] +}, + "x-conference/x-cooltalk": { + source: "apache", + extensions: [ + "ice" + ] +}, + "x-shader/x-fragment": { + compressible: true +}, + "x-shader/x-vertex": { + compressible: true +} +}; + +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +/** + * Module exports. + */ + +var mimeDb = require$$0$1; + +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +var mimeTypes = createCommonjsModule(function (module, exports) { + +/** + * Module dependencies. + * @private + */ + + +var extname = path__default['default'].extname; + +/** + * Module variables. + * @private + */ + +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; +var TEXT_TYPE_REGEXP = /^text\//i; + +/** + * Module exports. + * @public + */ + +exports.charset = charset; +exports.charsets = { lookup: charset }; +exports.contentType = contentType; +exports.extension = extension; +exports.extensions = Object.create(null); +exports.lookup = lookup; +exports.types = Object.create(null); + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types); + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type); + var mime = match && mimeDb[match[1].toLowerCase()]; + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {boolean|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str; + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime); + if (charset) mime += '; charset=' + charset.toLowerCase(); + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type); + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()]; + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {boolean|string} + */ + +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .substr(1); + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps (extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana']; + + Object.keys(mimeDb).forEach(function forEachMimeType (type) { + var mime = mimeDb[type]; + var exts = mime.extensions; + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts; + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i]; + + if (types[extension]) { + var from = preference.indexOf(mimeDb[types[extension]].source); + var to = preference.indexOf(mime.source); + + if (types[extension] !== 'application/octet-stream' && + (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { + // skip the remapping + continue + } + } + + // set the extension -> mime + types[extension] = type; + } + }); +} +}); + +var defer_1 = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} + +// API +var async_1 = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer_1(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer_1(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} + +// API +var abort_1 = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} + +// API +var iterate_1 = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort_1(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async_1(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async_1(callback)); + } + + return aborter; +} + +// API +var state_1 = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} + +// API +var terminator_1 = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort_1(this); + + // send back results we have so far + async_1(callback)(null, this.results); +} + +// Public API +var parallel_1 = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = state_1(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate_1(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator_1.bind(state, callback); +} + +// Public API +var serialOrdered_1 = serialOrdered; +// sorting helpers +var ascending_1 = ascending; +var descending_1 = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = state_1(list, sortMethod); + + iterate_1(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate_1(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator_1.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} +serialOrdered_1.ascending = ascending_1; +serialOrdered_1.descending = descending_1; + +// Public API +var serial_1 = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered_1(list, iterator, null, callback); +} + +var asynckit = +{ + parallel : parallel_1, + serial : serial_1, + serialOrdered : serialOrdered_1 +}; + +// populates missing values +var populate = function(dst, src) { + + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); + + return dst; +}; + +var parseUrl$1 = Url__default['default'].parse; + + + + + +// Public API +var form_data = FormData; + +// make it a Stream +util__default['default'].inherits(FormData, combined_stream); + +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); + } + + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; + + combined_stream.call(this); + + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } +} + +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + +FormData.prototype.append = function(field, value, options) { + + options = options || {}; + + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } + + var append = combined_stream.prototype.append.bind(this); + + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; + } + + // https://github.com/felixge/node-form-data/issues/38 + if (util__default['default'].isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } + + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + + append(header); + append(value); + append(footer); + + // pass along options.knownLength + this._trackLength(header, value, options); +}; + +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } + + this._valueLength += valueLength; + + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; + + // empty or either doesn't have path or not an http response + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { + return; + } + + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } +}; + +FormData.prototype._lengthRetriever = function(value, callback) { + + if (value.hasOwnProperty('fd')) { + + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs__default['default'].stat(value.path, function(err, stat) { + + var fileSize; + + if (err) { + callback(err); + return; + } + + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } + + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + callback(null, +value.headers['content-length']); + + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + callback(null, +response.headers['content-length']); + }); + value.resume(); + + // something else + } else { + callback('Unknown stream'); + } +}; + +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (typeof options.header == 'string') { + return options.header; + } + + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; + + // allow custom headers. + if (typeof options.header == 'object') { + populate(headers, options.header); + } + + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; + header = headers[prop]; + + // skip nullish headers. + if (header == null) { + continue; + } + + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } + + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } + + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; + +FormData.prototype._getContentDisposition = function(value, options) { + + var filename + , contentDisposition + ; + + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path__default['default'].normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path__default['default'].basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path__default['default'].basename(value.client._httpMessage.path || ''); + } + + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } + + return contentDisposition; +}; + +FormData.prototype._getContentType = function(value, options) { + + // use custom content-type above all + var contentType = options.contentType; + + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mimeTypes.lookup(value.name); + } + + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mimeTypes.lookup(value.path); + } + + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } + + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mimeTypes.lookup(options.filepath || options.filename); + } + + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } + + return contentType; +}; + +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; + + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } + + next(footer); + }.bind(this); +}; + +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; + +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; + + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + + return formHeaders; +}; + +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + + return this._boundary; +}; + +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); + + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { + + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } + + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } + } + } + + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; + +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } + + this._boundary = boundary; +}; + +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; +}; + +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; + + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + + return hasKnownLength; +}; + +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + + values.forEach(function(length) { + knownLength += length; + }); + + cb(null, knownLength); + }); +}; + +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; + + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { + + params = parseUrl$1(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + + // use custom params + } else { + + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } + + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https__default['default'].request(options); + } else { + request = http__default['default'].request(options); + } + + // get content length and fire away + this.getLength(function(err, length) { + if (err) { + this._error(err); + return; + } + + // add content length + request.setHeader('Content-Length', length); + + this.pipe(request); + if (cb) { + var onResponse; + + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); + + return cb.call(this, error, responce); + }; + + onResponse = callback.bind(this, null); + + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; + +FormData.prototype.toString = function () { + return '[object FormData]'; +}; + +// Copyright (c) Microsoft Corporation. +var custom = util$2.inspect.custom; + +// Copyright (c) Microsoft Corporation. +/** + * A class that handles the query portion of a URLBuilder. + */ +var URLQuery = /** @class */ (function () { + function URLQuery() { + this._rawQuery = {}; + } + /** + * Get whether or not there any query parameters in this URLQuery. + */ + URLQuery.prototype.any = function () { + return Object.keys(this._rawQuery).length > 0; + }; + /** + * Get the keys of the query string. + */ + URLQuery.prototype.keys = function () { + return Object.keys(this._rawQuery); + }; + /** + * Set a query parameter with the provided name and value. If the parameterValue is undefined or + * empty, then this will attempt to remove an existing query parameter with the provided + * parameterName. + */ + URLQuery.prototype.set = function (parameterName, parameterValue) { + if (parameterName) { + if (parameterValue !== undefined && parameterValue !== null) { + var newValue = Array.isArray(parameterValue) ? parameterValue : parameterValue.toString(); + this._rawQuery[parameterName] = newValue; + } + else { + delete this._rawQuery[parameterName]; + } + } + }; + /** + * Get the value of the query parameter with the provided name. If no parameter exists with the + * provided parameter name, then undefined will be returned. + */ + URLQuery.prototype.get = function (parameterName) { + return parameterName ? this._rawQuery[parameterName] : undefined; + }; + /** + * Get the string representation of this query. The return value will not start with a "?". + */ + URLQuery.prototype.toString = function () { + var result = ""; + for (var parameterName in this._rawQuery) { + if (result) { + result += "&"; + } + var parameterValue = this._rawQuery[parameterName]; + if (Array.isArray(parameterValue)) { + var parameterStrings = []; + for (var _i = 0, parameterValue_1 = parameterValue; _i < parameterValue_1.length; _i++) { + var parameterValueElement = parameterValue_1[_i]; + parameterStrings.push(parameterName + "=" + parameterValueElement); + } + result += parameterStrings.join("&"); + } + else { + result += parameterName + "=" + parameterValue; + } + } + return result; + }; + /** + * Parse a URLQuery from the provided text. + */ + URLQuery.parse = function (text) { + var result = new URLQuery(); + if (text) { + if (text.startsWith("?")) { + text = text.substring(1); + } + var currentState = "ParameterName"; + var parameterName = ""; + var parameterValue = ""; + for (var i = 0; i < text.length; ++i) { + var currentCharacter = text[i]; + switch (currentState) { + case "ParameterName": + switch (currentCharacter) { + case "=": + currentState = "ParameterValue"; + break; + case "&": + parameterName = ""; + parameterValue = ""; + break; + default: + parameterName += currentCharacter; + break; + } + break; + case "ParameterValue": + switch (currentCharacter) { + case "&": + result.set(parameterName, parameterValue); + parameterName = ""; + parameterValue = ""; + currentState = "ParameterName"; + break; + default: + parameterValue += currentCharacter; + break; + } + break; + default: + throw new Error("Unrecognized URLQuery parse state: " + currentState); + } + } + if (currentState === "ParameterValue") { + result.set(parameterName, parameterValue); + } + } + return result; + }; + return URLQuery; +}()); +/** + * A class that handles creating, modifying, and parsing URLs. + */ +var URLBuilder = /** @class */ (function () { + function URLBuilder() { + } + /** + * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL + * (such as a host, port, path, or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setScheme = function (scheme) { + if (!scheme) { + this._scheme = undefined; + } + else { + this.set(scheme, "SCHEME"); + } + }; + /** + * Get the scheme that has been set in this URL. + */ + URLBuilder.prototype.getScheme = function () { + return this._scheme; + }; + /** + * Set the host for this URL. If the provided host contains other parts of a URL (such as a + * port, path, or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setHost = function (host) { + if (!host) { + this._host = undefined; + } + else { + this.set(host, "SCHEME_OR_HOST"); + } + }; + /** + * Get the host that has been set in this URL. + */ + URLBuilder.prototype.getHost = function () { + return this._host; + }; + /** + * Set the port for this URL. If the provided port contains other parts of a URL (such as a + * path or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setPort = function (port) { + if (port === undefined || port === null || port === "") { + this._port = undefined; + } + else { + this.set(port.toString(), "PORT"); + } + }; + /** + * Get the port that has been set in this URL. + */ + URLBuilder.prototype.getPort = function () { + return this._port; + }; + /** + * Set the path for this URL. If the provided path contains a query, then it will be added to + * this URL as well. + */ + URLBuilder.prototype.setPath = function (path) { + if (!path) { + this._path = undefined; + } + else { + var schemeIndex = path.indexOf("://"); + if (schemeIndex !== -1) { + var schemeStart = path.lastIndexOf("/", schemeIndex); + // Make sure to only grab the URL part of the path before setting the state back to SCHEME + // this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com" + this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), "SCHEME"); + } + else { + this.set(path, "PATH"); + } + } + }; + /** + * Append the provided path to this URL's existing path. If the provided path contains a query, + * then it will be added to this URL as well. + */ + URLBuilder.prototype.appendPath = function (path) { + if (path) { + var currentPath = this.getPath(); + if (currentPath) { + if (!currentPath.endsWith("/")) { + currentPath += "/"; + } + if (path.startsWith("/")) { + path = path.substring(1); + } + path = currentPath + path; + } + this.set(path, "PATH"); + } + }; + /** + * Get the path that has been set in this URL. + */ + URLBuilder.prototype.getPath = function () { + return this._path; + }; + /** + * Set the query in this URL. + */ + URLBuilder.prototype.setQuery = function (query) { + if (!query) { + this._query = undefined; + } + else { + this._query = URLQuery.parse(query); + } + }; + /** + * Set a query parameter with the provided name and value in this URL's query. If the provided + * query parameter value is undefined or empty, then the query parameter will be removed if it + * existed. + */ + URLBuilder.prototype.setQueryParameter = function (queryParameterName, queryParameterValue) { + if (queryParameterName) { + if (!this._query) { + this._query = new URLQuery(); + } + this._query.set(queryParameterName, queryParameterValue); + } + }; + /** + * Get the value of the query parameter with the provided query parameter name. If no query + * parameter exists with the provided name, then undefined will be returned. + */ + URLBuilder.prototype.getQueryParameterValue = function (queryParameterName) { + return this._query ? this._query.get(queryParameterName) : undefined; + }; + /** + * Get the query in this URL. + */ + URLBuilder.prototype.getQuery = function () { + return this._query ? this._query.toString() : undefined; + }; + /** + * Set the parts of this URL by parsing the provided text using the provided startState. + */ + URLBuilder.prototype.set = function (text, startState) { + var tokenizer = new URLTokenizer(text, startState); + while (tokenizer.next()) { + var token = tokenizer.current(); + var tokenPath = void 0; + if (token) { + switch (token.type) { + case "SCHEME": + this._scheme = token.text || undefined; + break; + case "HOST": + this._host = token.text || undefined; + break; + case "PORT": + this._port = token.text || undefined; + break; + case "PATH": + tokenPath = token.text || undefined; + if (!this._path || this._path === "/" || tokenPath !== "/") { + this._path = tokenPath; + } + break; + case "QUERY": + this._query = URLQuery.parse(token.text); + break; + default: + throw new Error("Unrecognized URLTokenType: " + token.type); + } + } + } + }; + URLBuilder.prototype.toString = function () { + var result = ""; + if (this._scheme) { + result += this._scheme + "://"; + } + if (this._host) { + result += this._host; + } + if (this._port) { + result += ":" + this._port; + } + if (this._path) { + if (!this._path.startsWith("/")) { + result += "/"; + } + result += this._path; + } + if (this._query && this._query.any()) { + result += "?" + this._query.toString(); + } + return result; + }; + /** + * If the provided searchValue is found in this URLBuilder, then replace it with the provided + * replaceValue. + */ + URLBuilder.prototype.replaceAll = function (searchValue, replaceValue) { + if (searchValue) { + this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); + this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); + this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); + this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); + this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); + } + }; + URLBuilder.parse = function (text) { + var result = new URLBuilder(); + result.set(text, "SCHEME_OR_HOST"); + return result; + }; + return URLBuilder; +}()); +var URLToken = /** @class */ (function () { + function URLToken(text, type) { + this.text = text; + this.type = type; + } + URLToken.scheme = function (text) { + return new URLToken(text, "SCHEME"); + }; + URLToken.host = function (text) { + return new URLToken(text, "HOST"); + }; + URLToken.port = function (text) { + return new URLToken(text, "PORT"); + }; + URLToken.path = function (text) { + return new URLToken(text, "PATH"); + }; + URLToken.query = function (text) { + return new URLToken(text, "QUERY"); + }; + return URLToken; +}()); +/** + * Get whether or not the provided character (single character string) is an alphanumeric (letter or + * digit) character. + */ +function isAlphaNumericCharacter(character) { + var characterCode = character.charCodeAt(0); + return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ || + (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ || + (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */); +} +/** + * A class that tokenizes URL strings. + */ +var URLTokenizer = /** @class */ (function () { + function URLTokenizer(_text, state) { + this._text = _text; + this._textLength = _text ? _text.length : 0; + this._currentState = state !== undefined && state !== null ? state : "SCHEME_OR_HOST"; + this._currentIndex = 0; + } + /** + * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer + * hasn't started or has finished tokenizing. + */ + URLTokenizer.prototype.current = function () { + return this._currentToken; + }; + /** + * Advance to the next URLToken and return whether or not a URLToken was found. + */ + URLTokenizer.prototype.next = function () { + if (!hasCurrentCharacter(this)) { + this._currentToken = undefined; + } + else { + switch (this._currentState) { + case "SCHEME": + nextScheme(this); + break; + case "SCHEME_OR_HOST": + nextSchemeOrHost(this); + break; + case "HOST": + nextHost(this); + break; + case "PORT": + nextPort(this); + break; + case "PATH": + nextPath(this); + break; + case "QUERY": + nextQuery(this); + break; + default: + throw new Error("Unrecognized URLTokenizerState: " + this._currentState); + } + } + return !!this._currentToken; + }; + return URLTokenizer; +}()); +/** + * Read the remaining characters from this Tokenizer's character stream. + */ +function readRemaining(tokenizer) { + var result = ""; + if (tokenizer._currentIndex < tokenizer._textLength) { + result = tokenizer._text.substring(tokenizer._currentIndex); + tokenizer._currentIndex = tokenizer._textLength; + } + return result; +} +/** + * Whether or not this URLTokenizer has a current character. + */ +function hasCurrentCharacter(tokenizer) { + return tokenizer._currentIndex < tokenizer._textLength; +} +/** + * Get the character in the text string at the current index. + */ +function getCurrentCharacter(tokenizer) { + return tokenizer._text[tokenizer._currentIndex]; +} +/** + * Advance to the character in text that is "step" characters ahead. If no step value is provided, + * then step will default to 1. + */ +function nextCharacter(tokenizer, step) { + if (hasCurrentCharacter(tokenizer)) { + if (!step) { + step = 1; + } + tokenizer._currentIndex += step; + } +} +/** + * Starting with the current character, peek "charactersToPeek" number of characters ahead in this + * Tokenizer's stream of characters. + */ +function peekCharacters(tokenizer, charactersToPeek) { + var endIndex = tokenizer._currentIndex + charactersToPeek; + if (tokenizer._textLength < endIndex) { + endIndex = tokenizer._textLength; + } + return tokenizer._text.substring(tokenizer._currentIndex, endIndex); +} +/** + * Read characters from this Tokenizer until the end of the stream or until the provided condition + * is false when provided the current character. + */ +function readWhile(tokenizer, condition) { + var result = ""; + while (hasCurrentCharacter(tokenizer)) { + var currentCharacter = getCurrentCharacter(tokenizer); + if (!condition(currentCharacter)) { + break; + } + else { + result += currentCharacter; + nextCharacter(tokenizer); + } + } + return result; +} +/** + * Read characters from this Tokenizer until a non-alphanumeric character or the end of the + * character stream is reached. + */ +function readWhileLetterOrDigit(tokenizer) { + return readWhile(tokenizer, function (character) { return isAlphaNumericCharacter(character); }); +} +/** + * Read characters from this Tokenizer until one of the provided terminating characters is read or + * the end of the character stream is reached. + */ +function readUntilCharacter(tokenizer) { + var terminatingCharacters = []; + for (var _i = 1; _i < arguments.length; _i++) { + terminatingCharacters[_i - 1] = arguments[_i]; + } + return readWhile(tokenizer, function (character) { return terminatingCharacters.indexOf(character) === -1; }); +} +function nextScheme(tokenizer) { + var scheme = readWhileLetterOrDigit(tokenizer); + tokenizer._currentToken = URLToken.scheme(scheme); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else { + tokenizer._currentState = "HOST"; + } +} +function nextSchemeOrHost(tokenizer) { + var schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === ":") { + if (peekCharacters(tokenizer, 3) === "://") { + tokenizer._currentToken = URLToken.scheme(schemeOrHost); + tokenizer._currentState = "HOST"; + } + else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "PORT"; + } + } + else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } + } +} +function nextHost(tokenizer) { + if (peekCharacters(tokenizer, 3) === "://") { + nextCharacter(tokenizer, 3); + } + var host = readUntilCharacter(tokenizer, ":", "/", "?"); + tokenizer._currentToken = URLToken.host(host); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === ":") { + tokenizer._currentState = "PORT"; + } + else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } +} +function nextPort(tokenizer) { + if (getCurrentCharacter(tokenizer) === ":") { + nextCharacter(tokenizer); + } + var port = readUntilCharacter(tokenizer, "/", "?"); + tokenizer._currentToken = URLToken.port(port); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } +} +function nextPath(tokenizer) { + var path = readUntilCharacter(tokenizer, "?"); + tokenizer._currentToken = URLToken.path(path); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else { + tokenizer._currentState = "QUERY"; + } +} +function nextQuery(tokenizer) { + if (getCurrentCharacter(tokenizer) === "?") { + nextCharacter(tokenizer); + } + var query = readRemaining(tokenizer); + tokenizer._currentToken = URLToken.query(query); + tokenizer._currentState = "DONE"; +} + +// Copyright (c) Microsoft Corporation. +var RedactedString = "REDACTED"; +var defaultAllowedHeaderNames = [ + "x-ms-client-request-id", + "x-ms-return-client-request-id", + "x-ms-useragent", + "x-ms-correlation-request-id", + "x-ms-request-id", + "client-request-id", + "return-client-request-id", + "traceparent", + "Access-Control-Allow-Credentials", + "Access-Control-Allow-Headers", + "Access-Control-Allow-Methods", + "Access-Control-Allow-Origin", + "Access-Control-Expose-Headers", + "Access-Control-Max-Age", + "Access-Control-Request-Headers", + "Access-Control-Request-Method", + "Origin", + "Accept", + "Cache-Control", + "Connection", + "Content-Length", + "Content-Type", + "Date", + "ETag", + "Expires", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "Last-Modified", + "Pragma", + "Request-Id", + "Retry-After", + "Server", + "Transfer-Encoding", + "User-Agent" +]; +var defaultAllowedQueryParameters = ["api-version"]; +var Sanitizer = /** @class */ (function () { + function Sanitizer(_a) { + var _b = _a === void 0 ? {} : _a, _c = _b.allowedHeaderNames, allowedHeaderNames = _c === void 0 ? [] : _c, _d = _b.allowedQueryParameters, allowedQueryParameters = _d === void 0 ? [] : _d; + allowedHeaderNames = Array.isArray(allowedHeaderNames) + ? defaultAllowedHeaderNames.concat(allowedHeaderNames) + : defaultAllowedHeaderNames; + allowedQueryParameters = Array.isArray(allowedQueryParameters) + ? defaultAllowedQueryParameters.concat(allowedQueryParameters) + : defaultAllowedQueryParameters; + this.allowedHeaderNames = new Set(allowedHeaderNames.map(function (n) { return n.toLowerCase(); })); + this.allowedQueryParameters = new Set(allowedQueryParameters.map(function (p) { return p.toLowerCase(); })); + } + Sanitizer.prototype.sanitize = function (obj) { + return JSON.stringify(obj, this.replacer.bind(this), 2); + }; + Sanitizer.prototype.replacer = function (key, value) { + // Ensure Errors include their interesting non-enumerable members + if (value instanceof Error) { + return __assign(__assign({}, value), { name: value.name, message: value.message }); + } + if (key === "_headersMap") { + return this.sanitizeHeaders(key, value); + } + else if (key === "url") { + return this.sanitizeUrl(value); + } + else if (key === "query") { + return this.sanitizeQuery(value); + } + else if (key === "body") { + // Don't log the request body + return undefined; + } + else if (key === "response") { + // Don't log response again + return undefined; + } + else if (key === "operationSpec") { + // When using sendOperationRequest, the request carries a massive + // field with the autorest spec. No need to log it. + return undefined; + } + return value; + }; + Sanitizer.prototype.sanitizeHeaders = function (_, value) { + return this.sanitizeObject(value, this.allowedHeaderNames, function (v, k) { return v[k].value; }); + }; + Sanitizer.prototype.sanitizeQuery = function (value) { + return this.sanitizeObject(value, this.allowedQueryParameters, function (v, k) { return v[k]; }); + }; + Sanitizer.prototype.sanitizeObject = function (value, allowedKeys, accessor) { + if (typeof value !== "object" || value === null) { + return value; + } + var sanitized = {}; + for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) { + var k = _a[_i]; + if (allowedKeys.has(k.toLowerCase())) { + sanitized[k] = accessor(value, k); + } + else { + sanitized[k] = RedactedString; + } + } + return sanitized; + }; + Sanitizer.prototype.sanitizeUrl = function (value) { + if (typeof value !== "string" || value === null) { + return value; + } + var urlBuilder = URLBuilder.parse(value); + var queryString = urlBuilder.getQuery(); + if (!queryString) { + return value; + } + var query = URLQuery.parse(queryString); + for (var _i = 0, _a = query.keys(); _i < _a.length; _i++) { + var k = _a[_i]; + if (!this.allowedQueryParameters.has(k.toLowerCase())) { + query.set(k, RedactedString); + } + } + urlBuilder.setQuery(query.toString()); + return urlBuilder.toString(); + }; + return Sanitizer; +}()); + +// Copyright (c) Microsoft Corporation. +var errorSanitizer = new Sanitizer(); +var RestError = /** @class */ (function (_super) { + __extends(RestError, _super); + function RestError(message, code, statusCode, request, response) { + var _this = _super.call(this, message) || this; + _this.name = "RestError"; + _this.code = code; + _this.statusCode = statusCode; + _this.request = request; + _this.response = response; + Object.setPrototypeOf(_this, RestError.prototype); + return _this; + } + /** + * Logging method for util.inspect in Node + */ + RestError.prototype[custom] = function () { + return "RestError: " + this.message + " \n " + errorSanitizer.sanitize(this); + }; + RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; + RestError.PARSE_ERROR = "PARSE_ERROR"; + return RestError; +}(Error)); + +// Copyright (c) Microsoft Corporation. +var ReportTransform = /** @class */ (function (_super) { + __extends(ReportTransform, _super); + function ReportTransform(progressCallback) { + var _this = _super.call(this) || this; + _this.progressCallback = progressCallback; + _this.loadedBytes = 0; + return _this; + } + ReportTransform.prototype._transform = function (chunk, _encoding, callback) { + this.push(chunk); + this.loadedBytes += chunk.length; + this.progressCallback({ loadedBytes: this.loadedBytes }); + callback(undefined); + }; + return ReportTransform; +}(Stream$2.Transform)); +var FetchHttpClient = /** @class */ (function () { + function FetchHttpClient() { + } + FetchHttpClient.prototype.sendRequest = function (httpRequest) { + return __awaiter$6(this, void 0, void 0, function () { + var abortController, abortListener, formData, requestForm_1, appendFormValue, _i, _a, formKey, formValue, j, contentType, body, onUploadProgress, uploadReportStream, platformSpecificRequestInit, requestInit, response, headers, operationResponse, _b, _c, onDownloadProgress, responseBody, downloadReportStream, length_1, error_1, fetchError; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + if (!httpRequest && typeof httpRequest !== "object") { + throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); + } + abortController = new AbortController(); + if (httpRequest.abortSignal) { + if (httpRequest.abortSignal.aborted) { + throw new AbortError$1("The operation was aborted."); + } + abortListener = function (event) { + if (event.type === "abort") { + abortController.abort(); + } + }; + httpRequest.abortSignal.addEventListener("abort", abortListener); + } + if (httpRequest.timeout) { + setTimeout(function () { + abortController.abort(); + }, httpRequest.timeout); + } + if (httpRequest.formData) { + formData = httpRequest.formData; + requestForm_1 = new form_data(); + appendFormValue = function (key, value) { + // value function probably returns a stream so we can provide a fresh stream on each retry + if (typeof value === "function") { + value = value(); + } + // eslint-disable-next-line no-prototype-builtins + if (value && value.hasOwnProperty("value") && value.hasOwnProperty("options")) { + requestForm_1.append(key, value.value, value.options); + } + else { + requestForm_1.append(key, value); + } + }; + for (_i = 0, _a = Object.keys(formData); _i < _a.length; _i++) { + formKey = _a[_i]; + formValue = formData[formKey]; + if (Array.isArray(formValue)) { + for (j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]); + } + } + else { + appendFormValue(formKey, formValue); + } + } + httpRequest.body = requestForm_1; + httpRequest.formData = undefined; + contentType = httpRequest.headers.get("Content-Type"); + if (contentType && contentType.indexOf("multipart/form-data") !== -1) { + if (typeof requestForm_1.getBoundary === "function") { + httpRequest.headers.set("Content-Type", "multipart/form-data; boundary=" + requestForm_1.getBoundary()); + } + else { + // browser will automatically apply a suitable content-type header + httpRequest.headers.remove("Content-Type"); + } + } + } + body = httpRequest.body + ? typeof httpRequest.body === "function" + ? httpRequest.body() + : httpRequest.body + : undefined; + if (httpRequest.onUploadProgress && httpRequest.body) { + onUploadProgress = httpRequest.onUploadProgress; + uploadReportStream = new ReportTransform(onUploadProgress); + if (isReadableStream(body)) { + body.pipe(uploadReportStream); + } + else { + uploadReportStream.end(body); + } + body = uploadReportStream; + } + return [4 /*yield*/, this.prepareRequest(httpRequest)]; + case 1: + platformSpecificRequestInit = _d.sent(); + requestInit = __assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController.signal, redirect: "manual" }, platformSpecificRequestInit); + _d.label = 2; + case 2: + _d.trys.push([2, 8, 9, 10]); + return [4 /*yield*/, this.fetch(httpRequest.url, requestInit)]; + case 3: + response = _d.sent(); + headers = parseHeaders(response.headers); + _b = { + headers: headers, + request: httpRequest, + status: response.status, + readableStreamBody: httpRequest.streamResponseBody + ? response.body + : undefined + }; + if (!!httpRequest.streamResponseBody) return [3 /*break*/, 5]; + return [4 /*yield*/, response.text()]; + case 4: + _c = _d.sent(); + return [3 /*break*/, 6]; + case 5: + _c = undefined; + _d.label = 6; + case 6: + operationResponse = (_b.bodyAsText = _c, + _b); + onDownloadProgress = httpRequest.onDownloadProgress; + if (onDownloadProgress) { + responseBody = response.body || undefined; + if (isReadableStream(responseBody)) { + downloadReportStream = new ReportTransform(onDownloadProgress); + responseBody.pipe(downloadReportStream); + operationResponse.readableStreamBody = downloadReportStream; + } + else { + length_1 = parseInt(headers.get("Content-Length")) || undefined; + if (length_1) { + // Calling callback for non-stream response for consistency with browser + onDownloadProgress({ loadedBytes: length_1 }); + } + } + } + return [4 /*yield*/, this.processRequest(operationResponse)]; + case 7: + _d.sent(); + return [2 /*return*/, operationResponse]; + case 8: + error_1 = _d.sent(); + fetchError = error_1; + if (fetchError.code === "ENOTFOUND") { + throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest); + } + else if (fetchError.type === "aborted") { + throw new AbortError$1("The operation was aborted."); + } + throw fetchError; + case 9: + // clean up event listener + if (httpRequest.abortSignal && abortListener) { + httpRequest.abortSignal.removeEventListener("abort", abortListener); + } + return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); + }; + return FetchHttpClient; +}()); +function isReadableStream(body) { + return body && typeof body.pipe === "function"; +} +function parseHeaders(headers) { + var httpHeaders = new HttpHeaders(); + headers.forEach(function (value, key) { + httpHeaders.set(key, value); + }); + return httpHeaders; +} + +// Copyright (c) Microsoft Corporation. +function createProxyAgent(requestUrl, proxySettings, headers) { + var host = URLBuilder.parse(proxySettings.host).getHost(); + if (!host) { + throw new Error("Expecting a non-empty host in proxy settings."); + } + if (!isValidPort(proxySettings.port)) { + throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); + } + var tunnelOptions = { + proxy: { + host: host, + port: proxySettings.port, + headers: (headers && headers.rawHeaders()) || {} + } + }; + if (proxySettings.username && proxySettings.password) { + tunnelOptions.proxy.proxyAuth = proxySettings.username + ":" + proxySettings.password; + } + var isRequestHttps = isUrlHttps(requestUrl); + var isProxyHttps = isUrlHttps(proxySettings.host); + var proxyAgent = { + isHttps: isRequestHttps, + agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) + }; + return proxyAgent; +} +function isUrlHttps(url) { + var urlScheme = URLBuilder.parse(url).getScheme() || ""; + return urlScheme.toLowerCase() === "https"; +} +function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { + if (isRequestHttps && isProxyHttps) { + return tunnel$1.httpsOverHttps(tunnelOptions); + } + else if (isRequestHttps && !isProxyHttps) { + return tunnel$1.httpsOverHttp(tunnelOptions); + } + else if (!isRequestHttps && isProxyHttps) { + return tunnel$1.httpOverHttps(tunnelOptions); + } + else { + return tunnel$1.httpOverHttp(tunnelOptions); + } +} +function isValidPort(port) { + // any port in 0-65535 range is valid (RFC 793) even though almost all implementations + // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports + return 0 <= port && port <= 65535; +} + +// Copyright (c) Microsoft Corporation. +function getCachedAgent(isHttps, agentCache) { + return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; +} +var NodeFetchHttpClient = /** @class */ (function (_super) { + __extends(NodeFetchHttpClient, _super); + function NodeFetchHttpClient() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.proxyAgents = {}; + _this.keepAliveAgents = {}; + _this.cookieJar = new CookieJar_1(undefined, { looseMode: true }); + return _this; + } + NodeFetchHttpClient.prototype.getOrCreateAgent = function (httpRequest) { + var isHttps = isUrlHttps(httpRequest.url); + // At the moment, proxy settings and keepAlive are mutually + // exclusive because the 'tunnel' library currently lacks the + // ability to create a proxy with keepAlive turned on. + if (httpRequest.proxySettings) { + var agent = getCachedAgent(isHttps, this.proxyAgents); + if (agent) { + return agent; + } + var tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers); + agent = tunnel.agent; + if (tunnel.isHttps) { + this.proxyAgents.httpsAgent = tunnel.agent; + } + else { + this.proxyAgents.httpAgent = tunnel.agent; + } + return agent; + } + else if (httpRequest.keepAlive) { + var agent = getCachedAgent(isHttps, this.keepAliveAgents); + if (agent) { + return agent; + } + var agentOptions = { + keepAlive: httpRequest.keepAlive + }; + if (isHttps) { + agent = this.keepAliveAgents.httpsAgent = new https.Agent(agentOptions); + } + else { + agent = this.keepAliveAgents.httpAgent = new http.Agent(agentOptions); + } + return agent; + } + else { + return isHttps ? https.globalAgent : http.globalAgent; + } + }; + // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs + NodeFetchHttpClient.prototype.fetch = function (input, init) { + return __awaiter$6(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, fetch(input, init)]; + }); + }); + }; + NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) { + return __awaiter$6(this, void 0, void 0, function () { + var requestInit, cookieString; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + requestInit = {}; + if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2]; + return [4 /*yield*/, new Promise(function (resolve, reject) { + _this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) { + if (err) { + reject(err); + } + else { + resolve(cookie); + } + }); + })]; + case 1: + cookieString = _a.sent(); + httpRequest.headers.set("Cookie", cookieString); + _a.label = 2; + case 2: + // Set the http(s) agent + requestInit.agent = this.getOrCreateAgent(httpRequest); + requestInit.compress = httpRequest.decompressResponse; + return [2 /*return*/, requestInit]; + } + }); + }); + }; + NodeFetchHttpClient.prototype.processRequest = function (operationResponse) { + return __awaiter$6(this, void 0, void 0, function () { + var setCookieHeader_1; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.cookieJar) return [3 /*break*/, 2]; + setCookieHeader_1 = operationResponse.headers.get("Set-Cookie"); + if (!(setCookieHeader_1 !== undefined)) return [3 /*break*/, 2]; + return [4 /*yield*/, new Promise(function (resolve, reject) { + _this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) { + if (err) { + reject(err); + } + else { + resolve(); + } + }); + })]; + case 1: + _a.sent(); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); + }; + return NodeFetchHttpClient; +}(FetchHttpClient)); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * The different levels of logs that can be used with the HttpPipelineLogger. + */ +var HttpPipelineLogLevel; +(function (HttpPipelineLogLevel) { + /** + * A log level that indicates that no logs will be logged. + */ + HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF"; + /** + * An error log. + */ + HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR"; + /** + * A warning log. + */ + HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING"; + /** + * An information log. + */ + HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO"; +})(HttpPipelineLogLevel || (HttpPipelineLogLevel = {})); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Tests an object to determine whether it implements TokenCredential. + * + * @param credential The assumed TokenCredential to be tested. + */ +function isTokenCredential(credential) { + // Check for an object with a 'getToken' function and possibly with + // a 'signRequest' function. We do this check to make sure that + // a ServiceClientCredentials implementor (like TokenClientCredentials + // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if + // it doesn't actually implement TokenCredential also. + return (credential && + typeof credential.getToken === "function" && + (credential.signRequest === undefined || credential.getToken.length > 0)); +} + +// Copyright (c) Microsoft Corporation. +var BaseRequestPolicy = /** @class */ (function () { + function BaseRequestPolicy(_nextPolicy, _options) { + this._nextPolicy = _nextPolicy; + this._options = _options; + } + /** + * Get whether or not a log with the provided log level should be logged. + * @param logLevel The log level of the log that will be logged. + * @returns Whether or not a log with the provided log level should be logged. + */ + BaseRequestPolicy.prototype.shouldLog = function (logLevel) { + return this._options.shouldLog(logLevel); + }; + /** + * Attempt to log the provided message to the provided logger. If no logger was provided or if + * the log level does not meat the logger's threshold, then nothing will be logged. + * @param logLevel The log level of this log. + * @param message The message of this log. + */ + BaseRequestPolicy.prototype.log = function (logLevel, message) { + this._options.log(logLevel, message); + }; + return BaseRequestPolicy; +}()); +/** + * Optional properties that can be used when creating a RequestPolicy. + */ +var RequestPolicyOptions = /** @class */ (function () { + function RequestPolicyOptions(_logger) { + this._logger = _logger; + } + /** + * Get whether or not a log with the provided log level should be logged. + * @param logLevel The log level of the log that will be logged. + * @returns Whether or not a log with the provided log level should be logged. + */ + RequestPolicyOptions.prototype.shouldLog = function (logLevel) { + return (!!this._logger && + logLevel !== HttpPipelineLogLevel.OFF && + logLevel <= this._logger.minimumLogLevel); + }; + /** + * Attempt to log the provided message to the provided logger. If no logger was provided or if + * the log level does not meet the logger's threshold, then nothing will be logged. + * @param logLevel The log level of this log. + * @param message The message of this log. + */ + RequestPolicyOptions.prototype.log = function (logLevel, message) { + if (this._logger && this.shouldLog(logLevel)) { + this._logger.log(logLevel, message); + } + }; + return RequestPolicyOptions; +}()); + +// Copyright (c) Microsoft Corporation. All rights reserved. +function log(message) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + process.stderr.write("" + util__default['default'].format.apply(util__default['default'], __spread([message], args)) + os$4.EOL); +} + +// Copyright (c) Microsoft Corporation. All rights reserved. +var debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; +var enabledString; +var enabledNamespaces = []; +var skippedNamespaces = []; +var debuggers = []; +if (debugEnvVariable) { + enable(debugEnvVariable); +} +function enable(namespaces) { + var e_1, _a, e_2, _b; + enabledString = namespaces; + enabledNamespaces = []; + skippedNamespaces = []; + var wildcard = /\*/g; + var namespaceList = namespaces.split(",").map(function (ns) { return ns.trim().replace(wildcard, ".*?"); }); + try { + for (var namespaceList_1 = __values$2(namespaceList), namespaceList_1_1 = namespaceList_1.next(); !namespaceList_1_1.done; namespaceList_1_1 = namespaceList_1.next()) { + var ns = namespaceList_1_1.value; + if (ns.startsWith("-")) { + skippedNamespaces.push(new RegExp("^" + ns.substr(1) + "$")); + } + else { + enabledNamespaces.push(new RegExp("^" + ns + "$")); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (namespaceList_1_1 && !namespaceList_1_1.done && (_a = namespaceList_1.return)) _a.call(namespaceList_1); + } + finally { if (e_1) throw e_1.error; } + } + try { + for (var debuggers_1 = __values$2(debuggers), debuggers_1_1 = debuggers_1.next(); !debuggers_1_1.done; debuggers_1_1 = debuggers_1.next()) { + var instance = debuggers_1_1.value; + instance.enabled = enabled(instance.namespace); + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (debuggers_1_1 && !debuggers_1_1.done && (_b = debuggers_1.return)) _b.call(debuggers_1); + } + finally { if (e_2) throw e_2.error; } + } +} +function enabled(namespace) { + var e_3, _a, e_4, _b; + if (namespace.endsWith("*")) { + return true; + } + try { + for (var skippedNamespaces_1 = __values$2(skippedNamespaces), skippedNamespaces_1_1 = skippedNamespaces_1.next(); !skippedNamespaces_1_1.done; skippedNamespaces_1_1 = skippedNamespaces_1.next()) { + var skipped = skippedNamespaces_1_1.value; + if (skipped.test(namespace)) { + return false; + } + } + } + catch (e_3_1) { e_3 = { error: e_3_1 }; } + finally { + try { + if (skippedNamespaces_1_1 && !skippedNamespaces_1_1.done && (_a = skippedNamespaces_1.return)) _a.call(skippedNamespaces_1); + } + finally { if (e_3) throw e_3.error; } + } + try { + for (var enabledNamespaces_1 = __values$2(enabledNamespaces), enabledNamespaces_1_1 = enabledNamespaces_1.next(); !enabledNamespaces_1_1.done; enabledNamespaces_1_1 = enabledNamespaces_1.next()) { + var enabled_1 = enabledNamespaces_1_1.value; + if (enabled_1.test(namespace)) { + return true; + } + } + } + catch (e_4_1) { e_4 = { error: e_4_1 }; } + finally { + try { + if (enabledNamespaces_1_1 && !enabledNamespaces_1_1.done && (_b = enabledNamespaces_1.return)) _b.call(enabledNamespaces_1); + } + finally { if (e_4) throw e_4.error; } + } + return false; +} +function disable() { + var result = enabledString || ""; + enable(""); + return result; +} +function createDebugger(namespace) { + function debug() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!newDebugger.enabled) { + return; + } + if (args.length > 0) { + args[0] = namespace + " " + args[0]; + } + newDebugger.log.apply(newDebugger, __spread(args)); + } + var newDebugger = Object.assign(debug, { + enabled: enabled(namespace), + destroy: destroy, + log: debugObj.log, + namespace: namespace, + extend: extend + }); + debuggers.push(newDebugger); + return newDebugger; +} +function destroy() { + var index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; +} +function extend(namespace) { + var newDebugger = createDebugger(this.namespace + ":" + namespace); + newDebugger.log = this.log; + return newDebugger; +} +var debugObj = Object.assign(function (namespace) { + return createDebugger(namespace); +}, { + enable: enable, + enabled: enabled, + disable: disable, + log: log +}); + +// Copyright (c) Microsoft Corporation. All rights reserved. +var registeredLoggers = new Set(); +var logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; +var azureLogLevel; +/** + * The AzureLogger provides a mechanism for overriding where logs are output to. + * By default, logs are sent to stderr. + * Override the `log` method to redirect logs to another location. + */ +var AzureLogger = debugObj("azure"); +AzureLogger.log = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + debugObj.log.apply(debugObj, __spread(args)); +}; +var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; +if (logLevelFromEnv) { + // avoid calling setLogLevel because we don't want a mis-set environment variable to crash + if (isAzureLogLevel(logLevelFromEnv)) { + setLogLevel(logLevelFromEnv); + } + else { + console.error("AZURE_LOG_LEVEL set to unknown log level '" + logLevelFromEnv + "'; logging is not enabled. Acceptable values: " + AZURE_LOG_LEVELS.join(", ") + "."); + } +} +/** + * Immediately enables logging at the specified log level. + * @param level The log level to enable for logging. + * Options from most verbose to least verbose are: + * - verbose + * - info + * - warning + * - error + */ +function setLogLevel(level) { + var e_1, _a; + if (level && !isAzureLogLevel(level)) { + throw new Error("Unknown log level '" + level + "'. Acceptable values: " + AZURE_LOG_LEVELS.join(",")); + } + azureLogLevel = level; + var enabledNamespaces = []; + try { + for (var registeredLoggers_1 = __values$2(registeredLoggers), registeredLoggers_1_1 = registeredLoggers_1.next(); !registeredLoggers_1_1.done; registeredLoggers_1_1 = registeredLoggers_1.next()) { + var logger = registeredLoggers_1_1.value; + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (registeredLoggers_1_1 && !registeredLoggers_1_1.done && (_a = registeredLoggers_1.return)) _a.call(registeredLoggers_1); + } + finally { if (e_1) throw e_1.error; } + } + debugObj.enable(enabledNamespaces.join(",")); +} +var levelMap = { + verbose: 400, + info: 300, + warning: 200, + error: 100 +}; +/** + * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. + * @param namespace The name of the SDK package. + * @ignore + */ +function createClientLogger(namespace) { + var clientRootLogger = AzureLogger.extend(namespace); + patchLogMethod(AzureLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; +} +function patchLogMethod(parent, child) { + child.log = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + parent.log.apply(parent, __spread(args)); + }; +} +function createLogger(parent, level) { + var logger = Object.assign(parent.extend(level), { + level: level + }); + patchLogMethod(parent, logger); + if (shouldEnable(logger)) { + var enabledNamespaces = debugObj.disable(); + debugObj.enable(enabledNamespaces + "," + logger.namespace); + } + registeredLoggers.add(logger); + return logger; +} +function shouldEnable(logger) { + if (azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]) { + return true; + } + else { + return false; + } +} +function isAzureLogLevel(logLevel) { + return AZURE_LOG_LEVELS.includes(logLevel); +} + +// Copyright (c) Microsoft Corporation. +var logger = createClientLogger("core-http"); + +// Copyright (c) Microsoft Corporation. +function logPolicy(loggingOptions) { + if (loggingOptions === void 0) { loggingOptions = {}; } + return { + create: function (nextPolicy, options) { + return new LogPolicy(nextPolicy, options, loggingOptions); + } + }; +} +var LogPolicy = /** @class */ (function (_super) { + __extends(LogPolicy, _super); + function LogPolicy(nextPolicy, options, _a) { + var _b = _a === void 0 ? {} : _a, _c = _b.logger, logger$1 = _c === void 0 ? logger.info : _c, _d = _b.allowedHeaderNames, allowedHeaderNames = _d === void 0 ? [] : _d, _e = _b.allowedQueryParameters, allowedQueryParameters = _e === void 0 ? [] : _e; + var _this = _super.call(this, nextPolicy, options) || this; + _this.logger = logger$1; + _this.sanitizer = new Sanitizer({ allowedHeaderNames: allowedHeaderNames, allowedQueryParameters: allowedQueryParameters }); + return _this; + } + Object.defineProperty(LogPolicy.prototype, "allowedHeaderNames", { + /** + * Header names whose values will be logged when logging is enabled. Defaults to + * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers + * specified in this field will be added to that list. Any other values will + * be written to logs as "REDACTED". + * @deprecated Pass these into the constructor instead. + */ + get: function () { + return this.sanitizer.allowedHeaderNames; + }, + /** + * Header names whose values will be logged when logging is enabled. Defaults to + * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers + * specified in this field will be added to that list. Any other values will + * be written to logs as "REDACTED". + * @deprecated Pass these into the constructor instead. + */ + set: function (allowedHeaderNames) { + this.sanitizer.allowedHeaderNames = allowedHeaderNames; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(LogPolicy.prototype, "allowedQueryParameters", { + /** + * Query string names whose values will be logged when logging is enabled. By default no + * query string values are logged. + * @deprecated Pass these into the constructor instead. + */ + get: function () { + return this.sanitizer.allowedQueryParameters; + }, + /** + * Query string names whose values will be logged when logging is enabled. By default no + * query string values are logged. + * @deprecated Pass these into the constructor instead. + */ + set: function (allowedQueryParameters) { + this.sanitizer.allowedQueryParameters = allowedQueryParameters; + }, + enumerable: false, + configurable: true + }); + LogPolicy.prototype.sendRequest = function (request) { + var _this = this; + if (!this.logger.enabled) + return this._nextPolicy.sendRequest(request); + this.logRequest(request); + return this._nextPolicy.sendRequest(request).then(function (response) { return _this.logResponse(response); }); + }; + LogPolicy.prototype.logRequest = function (request) { + this.logger("Request: " + this.sanitizer.sanitize(request)); + }; + LogPolicy.prototype.logResponse = function (response) { + this.logger("Response status code: " + response.status); + this.logger("Headers: " + this.sanitizer.sanitize(response.headers)); + return response; + }; + return LogPolicy; +}(BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Get the path to this parameter's value as a dotted string (a.b.c). + * @param parameter The parameter to get the path string for. + * @returns The path to this parameter's value as a dotted string. + */ +function getPathStringFromParameter(parameter) { + return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper); +} +function getPathStringFromParameterPath(parameterPath, mapper) { + var result; + if (typeof parameterPath === "string") { + result = parameterPath; + } + else if (Array.isArray(parameterPath)) { + result = parameterPath.join("."); + } + else { + result = mapper.serializedName; + } + return result; +} + +// Copyright (c) Microsoft Corporation. +function isStreamOperation(operationSpec) { + var result = false; + for (var statusCode in operationSpec.responses) { + var operationResponse = operationSpec.responses[statusCode]; + if (operationResponse.bodyMapper && + operationResponse.bodyMapper.type.name === MapperType.Stream) { + result = true; + break; + } + } + return result; +} + +var defaults = createCommonjsModule(function (module, exports) { +// Generated by CoffeeScript 1.12.7 +(function() { + exports.defaults = { + "0.1": { + explicitCharkey: false, + trim: true, + normalize: true, + normalizeTags: false, + attrkey: "@", + charkey: "#", + explicitArray: false, + ignoreAttrs: false, + mergeAttrs: false, + explicitRoot: false, + validator: null, + xmlns: false, + explicitChildren: false, + childkey: '@@', + charsAsChildren: false, + includeWhiteChars: false, + async: false, + strict: true, + attrNameProcessors: null, + attrValueProcessors: null, + tagNameProcessors: null, + valueProcessors: null, + emptyTag: '' + }, + "0.2": { + explicitCharkey: false, + trim: false, + normalize: false, + normalizeTags: false, + attrkey: "$", + charkey: "_", + explicitArray: true, + ignoreAttrs: false, + mergeAttrs: false, + explicitRoot: true, + validator: null, + xmlns: false, + explicitChildren: false, + preserveChildrenOrder: false, + childkey: '$$', + charsAsChildren: false, + includeWhiteChars: false, + async: false, + strict: true, + attrNameProcessors: null, + attrValueProcessors: null, + tagNameProcessors: null, + valueProcessors: null, + rootName: 'root', + xmldec: { + 'version': '1.0', + 'encoding': 'UTF-8', + 'standalone': true + }, + doctype: null, + renderOpts: { + 'pretty': true, + 'indent': ' ', + 'newline': '\n' + }, + headless: false, + chunkSize: 10000, + emptyTag: '', + cdata: false + } + }; + +}).call(commonjsGlobal); +}); + +var Utility = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, + slice = [].slice, + hasProp = {}.hasOwnProperty; + + assign = function() { + var i, key, len, source, sources, target; + target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : []; + if (isFunction(Object.assign)) { + Object.assign.apply(null, arguments); + } else { + for (i = 0, len = sources.length; i < len; i++) { + source = sources[i]; + if (source != null) { + for (key in source) { + if (!hasProp.call(source, key)) continue; + target[key] = source[key]; + } + } + } + } + return target; + }; + + isFunction = function(val) { + return !!val && Object.prototype.toString.call(val) === '[object Function]'; + }; + + isObject = function(val) { + var ref; + return !!val && ((ref = typeof val) === 'function' || ref === 'object'); + }; + + isArray = function(val) { + if (isFunction(Array.isArray)) { + return Array.isArray(val); + } else { + return Object.prototype.toString.call(val) === '[object Array]'; + } + }; + + isEmpty = function(val) { + var key; + if (isArray(val)) { + return !val.length; + } else { + for (key in val) { + if (!hasProp.call(val, key)) continue; + return false; + } + return true; + } + }; + + isPlainObject = function(val) { + var ctor, proto; + return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object)); + }; + + getValue = function(obj) { + if (isFunction(obj.valueOf)) { + return obj.valueOf(); + } else { + return obj; + } + }; + + module.exports.assign = assign; + + module.exports.isFunction = isFunction; + + module.exports.isObject = isObject; + + module.exports.isArray = isArray; + + module.exports.isEmpty = isEmpty; + + module.exports.isPlainObject = isPlainObject; + + module.exports.getValue = getValue; + +}).call(commonjsGlobal); +}); + +var XMLDOMImplementation = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMImplementation; + + module.exports = XMLDOMImplementation = (function() { + function XMLDOMImplementation() {} + + XMLDOMImplementation.prototype.hasFeature = function(feature, version) { + return true; + }; + + XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) { + throw new Error("This DOM method is not implemented."); + }; + + XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) { + throw new Error("This DOM method is not implemented."); + }; + + XMLDOMImplementation.prototype.createHTMLDocument = function(title) { + throw new Error("This DOM method is not implemented."); + }; + + XMLDOMImplementation.prototype.getFeature = function(feature, version) { + throw new Error("This DOM method is not implemented."); + }; + + return XMLDOMImplementation; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLDOMErrorHandler = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMErrorHandler; + + module.exports = XMLDOMErrorHandler = (function() { + function XMLDOMErrorHandler() {} + + XMLDOMErrorHandler.prototype.handleError = function(error) { + throw new Error(error); + }; + + return XMLDOMErrorHandler; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLDOMStringList = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMStringList; + + module.exports = XMLDOMStringList = (function() { + function XMLDOMStringList(arr) { + this.arr = arr || []; + } + + Object.defineProperty(XMLDOMStringList.prototype, 'length', { + get: function() { + return this.arr.length; + } + }); + + XMLDOMStringList.prototype.item = function(index) { + return this.arr[index] || null; + }; + + XMLDOMStringList.prototype.contains = function(str) { + return this.arr.indexOf(str) !== -1; + }; + + return XMLDOMStringList; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLDOMConfiguration = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMConfiguration, XMLDOMErrorHandler$1, XMLDOMStringList$1; + + XMLDOMErrorHandler$1 = XMLDOMErrorHandler; + + XMLDOMStringList$1 = XMLDOMStringList; + + module.exports = XMLDOMConfiguration = (function() { + function XMLDOMConfiguration() { + var clonedSelf; + this.defaultParams = { + "canonical-form": false, + "cdata-sections": false, + "comments": false, + "datatype-normalization": false, + "element-content-whitespace": true, + "entities": true, + "error-handler": new XMLDOMErrorHandler$1(), + "infoset": true, + "validate-if-schema": false, + "namespaces": true, + "namespace-declarations": true, + "normalize-characters": false, + "schema-location": '', + "schema-type": '', + "split-cdata-sections": true, + "validate": false, + "well-formed": true + }; + this.params = clonedSelf = Object.create(this.defaultParams); + } + + Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', { + get: function() { + return new XMLDOMStringList$1(Object.keys(this.defaultParams)); + } + }); + + XMLDOMConfiguration.prototype.getParameter = function(name) { + if (this.params.hasOwnProperty(name)) { + return this.params[name]; + } else { + return null; + } + }; + + XMLDOMConfiguration.prototype.canSetParameter = function(name, value) { + return true; + }; + + XMLDOMConfiguration.prototype.setParameter = function(name, value) { + if (value != null) { + return this.params[name] = value; + } else { + return delete this.params[name]; + } + }; + + return XMLDOMConfiguration; + + })(); + +}).call(commonjsGlobal); +}); + +var NodeType = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + Element: 1, + Attribute: 2, + Text: 3, + CData: 4, + EntityReference: 5, + EntityDeclaration: 6, + ProcessingInstruction: 7, + Comment: 8, + Document: 9, + DocType: 10, + DocumentFragment: 11, + NotationDeclaration: 12, + Declaration: 201, + Raw: 202, + AttributeDeclaration: 203, + ElementDeclaration: 204, + Dummy: 205 + }; + +}).call(commonjsGlobal); +}); + +var XMLAttribute = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLAttribute; + + NodeType$1 = NodeType; + + module.exports = XMLAttribute = (function() { + function XMLAttribute(parent, name, value) { + this.parent = parent; + if (this.parent) { + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + if (name == null) { + throw new Error("Missing attribute name. " + this.debugInfo(name)); + } + this.name = this.stringify.name(name); + this.value = this.stringify.attValue(value); + this.type = NodeType$1.Attribute; + this.isId = false; + this.schemaTypeInfo = null; + } + + Object.defineProperty(XMLAttribute.prototype, 'nodeType', { + get: function() { + return this.type; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'ownerElement', { + get: function() { + return this.parent; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'textContent', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'prefix', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'localName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'specified', { + get: function() { + return true; + } + }); + + XMLAttribute.prototype.clone = function() { + return Object.create(this); + }; + + XMLAttribute.prototype.toString = function(options) { + return this.options.writer.attribute(this, this.options.writer.filterOptions(options)); + }; + + XMLAttribute.prototype.debugInfo = function(name) { + name = name || this.name; + if (name == null) { + return "parent: <" + this.parent.name + ">"; + } else { + return "attribute: {" + name + "}, parent: <" + this.parent.name + ">"; + } + }; + + XMLAttribute.prototype.isEqualNode = function(node) { + if (node.namespaceURI !== this.namespaceURI) { + return false; + } + if (node.prefix !== this.prefix) { + return false; + } + if (node.localName !== this.localName) { + return false; + } + if (node.value !== this.value) { + return false; + } + return true; + }; + + return XMLAttribute; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLNamedNodeMap = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLNamedNodeMap; + + module.exports = XMLNamedNodeMap = (function() { + function XMLNamedNodeMap(nodes) { + this.nodes = nodes; + } + + Object.defineProperty(XMLNamedNodeMap.prototype, 'length', { + get: function() { + return Object.keys(this.nodes).length || 0; + } + }); + + XMLNamedNodeMap.prototype.clone = function() { + return this.nodes = null; + }; + + XMLNamedNodeMap.prototype.getNamedItem = function(name) { + return this.nodes[name]; + }; + + XMLNamedNodeMap.prototype.setNamedItem = function(node) { + var oldNode; + oldNode = this.nodes[node.nodeName]; + this.nodes[node.nodeName] = node; + return oldNode || null; + }; + + XMLNamedNodeMap.prototype.removeNamedItem = function(name) { + var oldNode; + oldNode = this.nodes[name]; + delete this.nodes[name]; + return oldNode || null; + }; + + XMLNamedNodeMap.prototype.item = function(index) { + return this.nodes[Object.keys(this.nodes)[index]] || null; + }; + + XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented."); + }; + + XMLNamedNodeMap.prototype.setNamedItemNS = function(node) { + throw new Error("This DOM method is not implemented."); + }; + + XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented."); + }; + + return XMLNamedNodeMap; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLElement = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLAttribute$1, XMLElement, XMLNamedNodeMap$1, XMLNode$1, getValue, isFunction, isObject, ref, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + ref = Utility, isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + XMLAttribute$1 = XMLAttribute; + + XMLNamedNodeMap$1 = XMLNamedNodeMap; + + module.exports = XMLElement = (function(superClass) { + extend(XMLElement, superClass); + + function XMLElement(parent, name, attributes) { + var child, j, len, ref1; + XMLElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing element name. " + this.debugInfo()); + } + this.name = this.stringify.name(name); + this.type = NodeType$1.Element; + this.attribs = {}; + this.schemaTypeInfo = null; + if (attributes != null) { + this.attribute(attributes); + } + if (parent.type === NodeType$1.Document) { + this.isRoot = true; + this.documentObject = parent; + parent.rootObject = this; + if (parent.children) { + ref1 = parent.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + if (child.type === NodeType$1.DocType) { + child.name = this.name; + break; + } + } + } + } + } + + Object.defineProperty(XMLElement.prototype, 'tagName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLElement.prototype, 'namespaceURI', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLElement.prototype, 'prefix', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLElement.prototype, 'localName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLElement.prototype, 'id', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'className', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'classList', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'attributes', { + get: function() { + if (!this.attributeMap || !this.attributeMap.nodes) { + this.attributeMap = new XMLNamedNodeMap$1(this.attribs); + } + return this.attributeMap; + } + }); + + XMLElement.prototype.clone = function() { + var att, attName, clonedSelf, ref1; + clonedSelf = Object.create(this); + if (clonedSelf.isRoot) { + clonedSelf.documentObject = null; + } + clonedSelf.attribs = {}; + ref1 = this.attribs; + for (attName in ref1) { + if (!hasProp.call(ref1, attName)) continue; + att = ref1[attName]; + clonedSelf.attribs[attName] = att.clone(); + } + clonedSelf.children = []; + this.children.forEach(function(child) { + var clonedChild; + clonedChild = child.clone(); + clonedChild.parent = clonedSelf; + return clonedSelf.children.push(clonedChild); + }); + return clonedSelf; + }; + + XMLElement.prototype.attribute = function(name, value) { + var attName, attValue; + if (name != null) { + name = getValue(name); + } + if (isObject(name)) { + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (this.options.keepNullAttributes && (value == null)) { + this.attribs[name] = new XMLAttribute$1(this, name, ""); + } else if (value != null) { + this.attribs[name] = new XMLAttribute$1(this, name, value); + } + } + return this; + }; + + XMLElement.prototype.removeAttribute = function(name) { + var attName, j, len; + if (name == null) { + throw new Error("Missing attribute name. " + this.debugInfo()); + } + name = getValue(name); + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + attName = name[j]; + delete this.attribs[attName]; + } + } else { + delete this.attribs[name]; + } + return this; + }; + + XMLElement.prototype.toString = function(options) { + return this.options.writer.element(this, this.options.writer.filterOptions(options)); + }; + + XMLElement.prototype.att = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.a = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.getAttribute = function(name) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name].value; + } else { + return null; + } + }; + + XMLElement.prototype.setAttribute = function(name, value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getAttributeNode = function(name) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name]; + } else { + return null; + } + }; + + XMLElement.prototype.setAttributeNode = function(newAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.removeAttributeNode = function(oldAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagName = function(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setAttributeNodeNS = function(newAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.hasAttribute = function(name) { + return this.attribs.hasOwnProperty(name); + }; + + XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setIdAttribute = function(name, isId) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name].isId; + } else { + return isId; + } + }; + + XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagName = function(tagname) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByClassName = function(classNames) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.isEqualNode = function(node) { + var i, j, ref1; + if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.namespaceURI !== this.namespaceURI) { + return false; + } + if (node.prefix !== this.prefix) { + return false; + } + if (node.localName !== this.localName) { + return false; + } + if (node.attribs.length !== this.attribs.length) { + return false; + } + for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) { + if (!this.attribs[i].isEqualNode(node.attribs[i])) { + return false; + } + } + return true; + }; + + return XMLElement; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLCharacterData = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLCharacterData, XMLNode$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode$1 = XMLNode; + + module.exports = XMLCharacterData = (function(superClass) { + extend(XMLCharacterData, superClass); + + function XMLCharacterData(parent) { + XMLCharacterData.__super__.constructor.call(this, parent); + this.value = ''; + } + + Object.defineProperty(XMLCharacterData.prototype, 'data', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + Object.defineProperty(XMLCharacterData.prototype, 'length', { + get: function() { + return this.value.length; + } + }); + + Object.defineProperty(XMLCharacterData.prototype, 'textContent', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + XMLCharacterData.prototype.clone = function() { + return Object.create(this); + }; + + XMLCharacterData.prototype.substringData = function(offset, count) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.appendData = function(arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.insertData = function(offset, arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.deleteData = function(offset, count) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.replaceData = function(offset, count, arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.isEqualNode = function(node) { + if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.data !== this.data) { + return false; + } + return true; + }; + + return XMLCharacterData; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLCData = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLCData, XMLCharacterData$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType$1 = NodeType; + + XMLCharacterData$1 = XMLCharacterData; + + module.exports = XMLCData = (function(superClass) { + extend(XMLCData, superClass); + + function XMLCData(parent, text) { + XMLCData.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing CDATA text. " + this.debugInfo()); + } + this.name = "#cdata-section"; + this.type = NodeType$1.CData; + this.value = this.stringify.cdata(text); + } + + XMLCData.prototype.clone = function() { + return Object.create(this); + }; + + XMLCData.prototype.toString = function(options) { + return this.options.writer.cdata(this, this.options.writer.filterOptions(options)); + }; + + return XMLCData; + + })(XMLCharacterData$1); + +}).call(commonjsGlobal); +}); + +var XMLComment = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLCharacterData$1, XMLComment, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType$1 = NodeType; + + XMLCharacterData$1 = XMLCharacterData; + + module.exports = XMLComment = (function(superClass) { + extend(XMLComment, superClass); + + function XMLComment(parent, text) { + XMLComment.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing comment text. " + this.debugInfo()); + } + this.name = "#comment"; + this.type = NodeType$1.Comment; + this.value = this.stringify.comment(text); + } + + XMLComment.prototype.clone = function() { + return Object.create(this); + }; + + XMLComment.prototype.toString = function(options) { + return this.options.writer.comment(this, this.options.writer.filterOptions(options)); + }; + + return XMLComment; + + })(XMLCharacterData$1); + +}).call(commonjsGlobal); +}); + +var XMLDeclaration = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDeclaration, XMLNode$1, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isObject = Utility.isObject; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + module.exports = XMLDeclaration = (function(superClass) { + extend(XMLDeclaration, superClass); + + function XMLDeclaration(parent, version, encoding, standalone) { + var ref; + XMLDeclaration.__super__.constructor.call(this, parent); + if (isObject(version)) { + ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone; + } + if (!version) { + version = '1.0'; + } + this.type = NodeType$1.Declaration; + this.version = this.stringify.xmlVersion(version); + if (encoding != null) { + this.encoding = this.stringify.xmlEncoding(encoding); + } + if (standalone != null) { + this.standalone = this.stringify.xmlStandalone(standalone); + } + } + + XMLDeclaration.prototype.toString = function(options) { + return this.options.writer.declaration(this, this.options.writer.filterOptions(options)); + }; + + return XMLDeclaration; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLDTDAttList = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDTDAttList, XMLNode$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + module.exports = XMLDTDAttList = (function(superClass) { + extend(XMLDTDAttList, superClass); + + function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + XMLDTDAttList.__super__.constructor.call(this, parent); + if (elementName == null) { + throw new Error("Missing DTD element name. " + this.debugInfo()); + } + if (attributeName == null) { + throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName)); + } + if (!attributeType) { + throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName)); + } + if (!defaultValueType) { + throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName)); + } + if (defaultValueType.indexOf('#') !== 0) { + defaultValueType = '#' + defaultValueType; + } + if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { + throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName)); + } + if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { + throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName)); + } + this.elementName = this.stringify.name(elementName); + this.type = NodeType$1.AttributeDeclaration; + this.attributeName = this.stringify.name(attributeName); + this.attributeType = this.stringify.dtdAttType(attributeType); + if (defaultValue) { + this.defaultValue = this.stringify.dtdAttDefault(defaultValue); + } + this.defaultValueType = defaultValueType; + } + + XMLDTDAttList.prototype.toString = function(options) { + return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDAttList; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLDTDEntity = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDTDEntity, XMLNode$1, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isObject = Utility.isObject; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + module.exports = XMLDTDEntity = (function(superClass) { + extend(XMLDTDEntity, superClass); + + function XMLDTDEntity(parent, pe, name, value) { + XMLDTDEntity.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing DTD entity name. " + this.debugInfo(name)); + } + if (value == null) { + throw new Error("Missing DTD entity value. " + this.debugInfo(name)); + } + this.pe = !!pe; + this.name = this.stringify.name(name); + this.type = NodeType$1.EntityDeclaration; + if (!isObject(value)) { + this.value = this.stringify.dtdEntityValue(value); + this.internal = true; + } else { + if (!value.pubID && !value.sysID) { + throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name)); + } + if (value.pubID && !value.sysID) { + throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name)); + } + this.internal = false; + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + if (value.nData != null) { + this.nData = this.stringify.dtdNData(value.nData); + } + if (this.pe && this.nData) { + throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name)); + } + } + } + + Object.defineProperty(XMLDTDEntity.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'notationName', { + get: function() { + return this.nData || null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', { + get: function() { + return null; + } + }); + + XMLDTDEntity.prototype.toString = function(options) { + return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDEntity; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLDTDElement = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDTDElement, XMLNode$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + module.exports = XMLDTDElement = (function(superClass) { + extend(XMLDTDElement, superClass); + + function XMLDTDElement(parent, name, value) { + XMLDTDElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing DTD element name. " + this.debugInfo()); + } + if (!value) { + value = '(#PCDATA)'; + } + if (Array.isArray(value)) { + value = '(' + value.join(',') + ')'; + } + this.name = this.stringify.name(name); + this.type = NodeType$1.ElementDeclaration; + this.value = this.stringify.dtdElementValue(value); + } + + XMLDTDElement.prototype.toString = function(options) { + return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDElement; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLDTDNotation = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDTDNotation, XMLNode$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + module.exports = XMLDTDNotation = (function(superClass) { + extend(XMLDTDNotation, superClass); + + function XMLDTDNotation(parent, name, value) { + XMLDTDNotation.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing DTD notation name. " + this.debugInfo(name)); + } + if (!value.pubID && !value.sysID) { + throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name)); + } + this.name = this.stringify.name(name); + this.type = NodeType$1.NotationDeclaration; + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + } + + Object.defineProperty(XMLDTDNotation.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDTDNotation.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + XMLDTDNotation.prototype.toString = function(options) { + return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDNotation; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLDocType = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDTDAttList$1, XMLDTDElement$1, XMLDTDEntity$1, XMLDTDNotation$1, XMLDocType, XMLNamedNodeMap$1, XMLNode$1, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isObject = Utility.isObject; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + XMLDTDAttList$1 = XMLDTDAttList; + + XMLDTDEntity$1 = XMLDTDEntity; + + XMLDTDElement$1 = XMLDTDElement; + + XMLDTDNotation$1 = XMLDTDNotation; + + XMLNamedNodeMap$1 = XMLNamedNodeMap; + + module.exports = XMLDocType = (function(superClass) { + extend(XMLDocType, superClass); + + function XMLDocType(parent, pubID, sysID) { + var child, i, len, ref, ref1, ref2; + XMLDocType.__super__.constructor.call(this, parent); + this.type = NodeType$1.DocType; + if (parent.children) { + ref = parent.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType$1.Element) { + this.name = child.name; + break; + } + } + } + this.documentObject = parent; + if (isObject(pubID)) { + ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID; + } + if (sysID == null) { + ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1]; + } + if (pubID != null) { + this.pubID = this.stringify.dtdPubID(pubID); + } + if (sysID != null) { + this.sysID = this.stringify.dtdSysID(sysID); + } + } + + Object.defineProperty(XMLDocType.prototype, 'entities', { + get: function() { + var child, i, len, nodes, ref; + nodes = {}; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if ((child.type === NodeType$1.EntityDeclaration) && !child.pe) { + nodes[child.name] = child; + } + } + return new XMLNamedNodeMap$1(nodes); + } + }); + + Object.defineProperty(XMLDocType.prototype, 'notations', { + get: function() { + var child, i, len, nodes, ref; + nodes = {}; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType$1.NotationDeclaration) { + nodes[child.name] = child; + } + } + return new XMLNamedNodeMap$1(nodes); + } + }); + + Object.defineProperty(XMLDocType.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDocType.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + Object.defineProperty(XMLDocType.prototype, 'internalSubset', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + XMLDocType.prototype.element = function(name, value) { + var child; + child = new XMLDTDElement$1(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var child; + child = new XMLDTDAttList$1(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.entity = function(name, value) { + var child; + child = new XMLDTDEntity$1(this, false, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.pEntity = function(name, value) { + var child; + child = new XMLDTDEntity$1(this, true, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.notation = function(name, value) { + var child; + child = new XMLDTDNotation$1(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.toString = function(options) { + return this.options.writer.docType(this, this.options.writer.filterOptions(options)); + }; + + XMLDocType.prototype.ele = function(name, value) { + return this.element(name, value); + }; + + XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); + }; + + XMLDocType.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocType.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocType.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + XMLDocType.prototype.up = function() { + return this.root() || this.documentObject; + }; + + XMLDocType.prototype.isEqualNode = function(node) { + if (!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.name !== this.name) { + return false; + } + if (node.publicId !== this.publicId) { + return false; + } + if (node.systemId !== this.systemId) { + return false; + } + return true; + }; + + return XMLDocType; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLRaw = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLNode$1, XMLRaw, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType$1 = NodeType; + + XMLNode$1 = XMLNode; + + module.exports = XMLRaw = (function(superClass) { + extend(XMLRaw, superClass); + + function XMLRaw(parent, text) { + XMLRaw.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing raw text. " + this.debugInfo()); + } + this.type = NodeType$1.Raw; + this.value = this.stringify.raw(text); + } + + XMLRaw.prototype.clone = function() { + return Object.create(this); + }; + + XMLRaw.prototype.toString = function(options) { + return this.options.writer.raw(this, this.options.writer.filterOptions(options)); + }; + + return XMLRaw; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLText = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLCharacterData$1, XMLText, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType$1 = NodeType; + + XMLCharacterData$1 = XMLCharacterData; + + module.exports = XMLText = (function(superClass) { + extend(XMLText, superClass); + + function XMLText(parent, text) { + XMLText.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing element text. " + this.debugInfo()); + } + this.name = "#text"; + this.type = NodeType$1.Text; + this.value = this.stringify.text(text); + } + + Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLText.prototype, 'wholeText', { + get: function() { + var next, prev, str; + str = ''; + prev = this.previousSibling; + while (prev) { + str = prev.data + str; + prev = prev.previousSibling; + } + str += this.data; + next = this.nextSibling; + while (next) { + str = str + next.data; + next = next.nextSibling; + } + return str; + } + }); + + XMLText.prototype.clone = function() { + return Object.create(this); + }; + + XMLText.prototype.toString = function(options) { + return this.options.writer.text(this, this.options.writer.filterOptions(options)); + }; + + XMLText.prototype.splitText = function(offset) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLText.prototype.replaceWholeText = function(content) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + return XMLText; + + })(XMLCharacterData$1); + +}).call(commonjsGlobal); +}); + +var XMLProcessingInstruction = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLCharacterData$1, XMLProcessingInstruction, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType$1 = NodeType; + + XMLCharacterData$1 = XMLCharacterData; + + module.exports = XMLProcessingInstruction = (function(superClass) { + extend(XMLProcessingInstruction, superClass); + + function XMLProcessingInstruction(parent, target, value) { + XMLProcessingInstruction.__super__.constructor.call(this, parent); + if (target == null) { + throw new Error("Missing instruction target. " + this.debugInfo()); + } + this.type = NodeType$1.ProcessingInstruction; + this.target = this.stringify.insTarget(target); + this.name = this.target; + if (value) { + this.value = this.stringify.insValue(value); + } + } + + XMLProcessingInstruction.prototype.clone = function() { + return Object.create(this); + }; + + XMLProcessingInstruction.prototype.toString = function(options) { + return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options)); + }; + + XMLProcessingInstruction.prototype.isEqualNode = function(node) { + if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.target !== this.target) { + return false; + } + return true; + }; + + return XMLProcessingInstruction; + + })(XMLCharacterData$1); + +}).call(commonjsGlobal); +}); + +var XMLDummy = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDummy, XMLNode$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + module.exports = XMLDummy = (function(superClass) { + extend(XMLDummy, superClass); + + function XMLDummy(parent) { + XMLDummy.__super__.constructor.call(this, parent); + this.type = NodeType$1.Dummy; + } + + XMLDummy.prototype.clone = function() { + return Object.create(this); + }; + + XMLDummy.prototype.toString = function(options) { + return ''; + }; + + return XMLDummy; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLNodeList = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLNodeList; + + module.exports = XMLNodeList = (function() { + function XMLNodeList(nodes) { + this.nodes = nodes; + } + + Object.defineProperty(XMLNodeList.prototype, 'length', { + get: function() { + return this.nodes.length || 0; + } + }); + + XMLNodeList.prototype.clone = function() { + return this.nodes = null; + }; + + XMLNodeList.prototype.item = function(index) { + return this.nodes[index] || null; + }; + + return XMLNodeList; + + })(); + +}).call(commonjsGlobal); +}); + +var DocumentPosition = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + Disconnected: 1, + Preceding: 2, + Following: 4, + Contains: 8, + ContainedBy: 16, + ImplementationSpecific: 32 + }; + +}).call(commonjsGlobal); +}); + +var XMLNode = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var DocumentPosition$1, NodeType$1, XMLCData$1, XMLComment$1, XMLDeclaration$1, XMLDocType$1, XMLDummy$1, XMLElement$1, XMLNode, XMLNodeList$1, XMLProcessingInstruction$1, XMLRaw$1, XMLText$1, getValue, isEmpty, isFunction, isObject, ref1, + hasProp = {}.hasOwnProperty; + + ref1 = Utility, isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue; + + XMLElement$1 = null; + + XMLCData$1 = null; + + XMLComment$1 = null; + + XMLDeclaration$1 = null; + + XMLDocType$1 = null; + + XMLRaw$1 = null; + + XMLText$1 = null; + + XMLProcessingInstruction$1 = null; + + XMLDummy$1 = null; + + NodeType$1 = null; + + XMLNodeList$1 = null; + + DocumentPosition$1 = null; + + module.exports = XMLNode = (function() { + function XMLNode(parent1) { + this.parent = parent1; + if (this.parent) { + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + this.value = null; + this.children = []; + this.baseURI = null; + if (!XMLElement$1) { + XMLElement$1 = XMLElement; + XMLCData$1 = XMLCData; + XMLComment$1 = XMLComment; + XMLDeclaration$1 = XMLDeclaration; + XMLDocType$1 = XMLDocType; + XMLRaw$1 = XMLRaw; + XMLText$1 = XMLText; + XMLProcessingInstruction$1 = XMLProcessingInstruction; + XMLDummy$1 = XMLDummy; + NodeType$1 = NodeType; + XMLNodeList$1 = XMLNodeList; + DocumentPosition$1 = DocumentPosition; + } + } + + Object.defineProperty(XMLNode.prototype, 'nodeName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nodeType', { + get: function() { + return this.type; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nodeValue', { + get: function() { + return this.value; + } + }); + + Object.defineProperty(XMLNode.prototype, 'parentNode', { + get: function() { + return this.parent; + } + }); + + Object.defineProperty(XMLNode.prototype, 'childNodes', { + get: function() { + if (!this.childNodeList || !this.childNodeList.nodes) { + this.childNodeList = new XMLNodeList$1(this.children); + } + return this.childNodeList; + } + }); + + Object.defineProperty(XMLNode.prototype, 'firstChild', { + get: function() { + return this.children[0] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'lastChild', { + get: function() { + return this.children[this.children.length - 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'previousSibling', { + get: function() { + var i; + i = this.parent.children.indexOf(this); + return this.parent.children[i - 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nextSibling', { + get: function() { + var i; + i = this.parent.children.indexOf(this); + return this.parent.children[i + 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'ownerDocument', { + get: function() { + return this.document() || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'textContent', { + get: function() { + var child, j, len, ref2, str; + if (this.nodeType === NodeType$1.Element || this.nodeType === NodeType$1.DocumentFragment) { + str = ''; + ref2 = this.children; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + if (child.textContent) { + str += child.textContent; + } + } + return str; + } else { + return null; + } + }, + set: function(value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + XMLNode.prototype.setParent = function(parent) { + var child, j, len, ref2, results; + this.parent = parent; + if (parent) { + this.options = parent.options; + this.stringify = parent.stringify; + } + ref2 = this.children; + results = []; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + results.push(child.setParent(this)); + } + return results; + }; + + XMLNode.prototype.element = function(name, attributes, text) { + var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val; + lastChild = null; + if (attributes === null && (text == null)) { + ref2 = [{}, null], attributes = ref2[0], text = ref2[1]; + } + if (attributes == null) { + attributes = {}; + } + attributes = getValue(attributes); + if (!isObject(attributes)) { + ref3 = [attributes, text], text = ref3[0], attributes = ref3[1]; + } + if (name != null) { + name = getValue(name); + } + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + item = name[j]; + lastChild = this.element(item); + } + } else if (isFunction(name)) { + lastChild = this.element(name.apply()); + } else if (isObject(name)) { + for (key in name) { + if (!hasProp.call(name, key)) continue; + val = name[key]; + if (isFunction(val)) { + val = val.apply(); + } + if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { + lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); + } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) { + lastChild = this.dummy(); + } else if (isObject(val) && isEmpty(val)) { + lastChild = this.element(key); + } else if (!this.options.keepNullNodes && (val == null)) { + lastChild = this.dummy(); + } else if (!this.options.separateArrayItems && Array.isArray(val)) { + for (k = 0, len1 = val.length; k < len1; k++) { + item = val[k]; + childNode = {}; + childNode[key] = item; + lastChild = this.element(childNode); + } + } else if (isObject(val)) { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.element(val); + } else { + lastChild = this.element(key); + lastChild.element(val); + } + } else { + lastChild = this.element(key, val); + } + } + } else if (!this.options.keepNullNodes && text === null) { + lastChild = this.dummy(); + } else { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.text(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { + lastChild = this.cdata(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { + lastChild = this.comment(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { + lastChild = this.raw(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) { + lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text); + } else { + lastChild = this.node(name, attributes, text); + } + } + if (lastChild == null) { + throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo()); + } + return lastChild; + }; + + XMLNode.prototype.insertBefore = function(name, attributes, text) { + var child, i, newChild, refChild, removed; + if (name != null ? name.type : void 0) { + newChild = name; + refChild = attributes; + newChild.setParent(this); + if (refChild) { + i = children.indexOf(refChild); + removed = children.splice(i); + children.push(newChild); + Array.prototype.push.apply(children, removed); + } else { + children.push(newChild); + } + return newChild; + } else { + if (this.isRoot) { + throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + } + }; + + XMLNode.prototype.insertAfter = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.remove = function() { + var i, ref2; + if (this.isRoot) { + throw new Error("Cannot remove the root element. " + this.debugInfo()); + } + i = this.parent.children.indexOf(this); + [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2; + return this.parent; + }; + + XMLNode.prototype.node = function(name, attributes, text) { + var child, ref2; + if (name != null) { + name = getValue(name); + } + attributes || (attributes = {}); + attributes = getValue(attributes); + if (!isObject(attributes)) { + ref2 = [attributes, text], text = ref2[0], attributes = ref2[1]; + } + child = new XMLElement$1(this, name, attributes); + if (text != null) { + child.text(text); + } + this.children.push(child); + return child; + }; + + XMLNode.prototype.text = function(value) { + var child; + if (isObject(value)) { + this.element(value); + } + child = new XMLText$1(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.cdata = function(value) { + var child; + child = new XMLCData$1(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.comment = function(value) { + var child; + child = new XMLComment$1(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.commentBefore = function(value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.comment(value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.commentAfter = function(value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.comment(value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.raw = function(value) { + var child; + child = new XMLRaw$1(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.dummy = function() { + var child; + child = new XMLDummy$1(this); + return child; + }; + + XMLNode.prototype.instruction = function(target, value) { + var insTarget, insValue, instruction, j, len; + if (target != null) { + target = getValue(target); + } + if (value != null) { + value = getValue(value); + } + if (Array.isArray(target)) { + for (j = 0, len = target.length; j < len; j++) { + insTarget = target[j]; + this.instruction(insTarget); + } + } else if (isObject(target)) { + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + instruction = new XMLProcessingInstruction$1(this, target, value); + this.children.push(instruction); + } + return this; + }; + + XMLNode.prototype.instructionBefore = function(target, value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.instruction(target, value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.instructionAfter = function(target, value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.instruction(target, value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.declaration = function(version, encoding, standalone) { + var doc, xmldec; + doc = this.document(); + xmldec = new XMLDeclaration$1(doc, version, encoding, standalone); + if (doc.children.length === 0) { + doc.children.unshift(xmldec); + } else if (doc.children[0].type === NodeType$1.Declaration) { + doc.children[0] = xmldec; + } else { + doc.children.unshift(xmldec); + } + return doc.root() || doc; + }; + + XMLNode.prototype.dtd = function(pubID, sysID) { + var child, doc, doctype, i, j, k, len, len1, ref2, ref3; + doc = this.document(); + doctype = new XMLDocType$1(doc, pubID, sysID); + ref2 = doc.children; + for (i = j = 0, len = ref2.length; j < len; i = ++j) { + child = ref2[i]; + if (child.type === NodeType$1.DocType) { + doc.children[i] = doctype; + return doctype; + } + } + ref3 = doc.children; + for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) { + child = ref3[i]; + if (child.isRoot) { + doc.children.splice(i, 0, doctype); + return doctype; + } + } + doc.children.push(doctype); + return doctype; + }; + + XMLNode.prototype.up = function() { + if (this.isRoot) { + throw new Error("The root node has no parent. Use doc() if you need to get the document object."); + } + return this.parent; + }; + + XMLNode.prototype.root = function() { + var node; + node = this; + while (node) { + if (node.type === NodeType$1.Document) { + return node.rootObject; + } else if (node.isRoot) { + return node; + } else { + node = node.parent; + } + } + }; + + XMLNode.prototype.document = function() { + var node; + node = this; + while (node) { + if (node.type === NodeType$1.Document) { + return node; + } else { + node = node.parent; + } + } + }; + + XMLNode.prototype.end = function(options) { + return this.document().end(options); + }; + + XMLNode.prototype.prev = function() { + var i; + i = this.parent.children.indexOf(this); + if (i < 1) { + throw new Error("Already at the first node. " + this.debugInfo()); + } + return this.parent.children[i - 1]; + }; + + XMLNode.prototype.next = function() { + var i; + i = this.parent.children.indexOf(this); + if (i === -1 || i === this.parent.children.length - 1) { + throw new Error("Already at the last node. " + this.debugInfo()); + } + return this.parent.children[i + 1]; + }; + + XMLNode.prototype.importDocument = function(doc) { + var clonedRoot; + clonedRoot = doc.root().clone(); + clonedRoot.parent = this; + clonedRoot.isRoot = false; + this.children.push(clonedRoot); + return this; + }; + + XMLNode.prototype.debugInfo = function(name) { + var ref2, ref3; + name = name || this.name; + if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) { + return ""; + } else if (name == null) { + return "parent: <" + this.parent.name + ">"; + } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) { + return "node: <" + name + ">"; + } else { + return "node: <" + name + ">, parent: <" + this.parent.name + ">"; + } + }; + + XMLNode.prototype.ele = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.txt = function(value) { + return this.text(value); + }; + + XMLNode.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.com = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLNode.prototype.doc = function() { + return this.document(); + }; + + XMLNode.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLNode.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.t = function(value) { + return this.text(value); + }; + + XMLNode.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.c = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.r = function(value) { + return this.raw(value); + }; + + XMLNode.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + XMLNode.prototype.u = function() { + return this.up(); + }; + + XMLNode.prototype.importXMLBuilder = function(doc) { + return this.importDocument(doc); + }; + + XMLNode.prototype.replaceChild = function(newChild, oldChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.removeChild = function(oldChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.appendChild = function(newChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.hasChildNodes = function() { + return this.children.length !== 0; + }; + + XMLNode.prototype.cloneNode = function(deep) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.normalize = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.isSupported = function(feature, version) { + return true; + }; + + XMLNode.prototype.hasAttributes = function() { + return this.attribs.length !== 0; + }; + + XMLNode.prototype.compareDocumentPosition = function(other) { + var ref, res; + ref = this; + if (ref === other) { + return 0; + } else if (this.document() !== other.document()) { + res = DocumentPosition$1.Disconnected | DocumentPosition$1.ImplementationSpecific; + if (Math.random() < 0.5) { + res |= DocumentPosition$1.Preceding; + } else { + res |= DocumentPosition$1.Following; + } + return res; + } else if (ref.isAncestor(other)) { + return DocumentPosition$1.Contains | DocumentPosition$1.Preceding; + } else if (ref.isDescendant(other)) { + return DocumentPosition$1.Contains | DocumentPosition$1.Following; + } else if (ref.isPreceding(other)) { + return DocumentPosition$1.Preceding; + } else { + return DocumentPosition$1.Following; + } + }; + + XMLNode.prototype.isSameNode = function(other) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.lookupPrefix = function(namespaceURI) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.isDefaultNamespace = function(namespaceURI) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.lookupNamespaceURI = function(prefix) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.isEqualNode = function(node) { + var i, j, ref2; + if (node.nodeType !== this.nodeType) { + return false; + } + if (node.children.length !== this.children.length) { + return false; + } + for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) { + if (!this.children[i].isEqualNode(node.children[i])) { + return false; + } + } + return true; + }; + + XMLNode.prototype.getFeature = function(feature, version) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.setUserData = function(key, data, handler) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.getUserData = function(key) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.contains = function(other) { + if (!other) { + return false; + } + return other === this || this.isDescendant(other); + }; + + XMLNode.prototype.isDescendant = function(node) { + var child, isDescendantChild, j, len, ref2; + ref2 = this.children; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + if (node === child) { + return true; + } + isDescendantChild = child.isDescendant(node); + if (isDescendantChild) { + return true; + } + } + return false; + }; + + XMLNode.prototype.isAncestor = function(node) { + return node.isDescendant(this); + }; + + XMLNode.prototype.isPreceding = function(node) { + var nodePos, thisPos; + nodePos = this.treePosition(node); + thisPos = this.treePosition(this); + if (nodePos === -1 || thisPos === -1) { + return false; + } else { + return nodePos < thisPos; + } + }; + + XMLNode.prototype.isFollowing = function(node) { + var nodePos, thisPos; + nodePos = this.treePosition(node); + thisPos = this.treePosition(this); + if (nodePos === -1 || thisPos === -1) { + return false; + } else { + return nodePos > thisPos; + } + }; + + XMLNode.prototype.treePosition = function(node) { + var found, pos; + pos = 0; + found = false; + this.foreachTreeNode(this.document(), function(childNode) { + pos++; + if (!found && childNode === node) { + return found = true; + } + }); + if (found) { + return pos; + } else { + return -1; + } + }; + + XMLNode.prototype.foreachTreeNode = function(node, func) { + var child, j, len, ref2, res; + node || (node = this.document()); + ref2 = node.children; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + if (res = func(child)) { + return res; + } else { + res = this.foreachTreeNode(child, func); + if (res) { + return res; + } + } + } + }; + + return XMLNode; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLStringifier = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLStringifier, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + hasProp = {}.hasOwnProperty; + + module.exports = XMLStringifier = (function() { + function XMLStringifier(options) { + this.assertLegalName = bind(this.assertLegalName, this); + this.assertLegalChar = bind(this.assertLegalChar, this); + var key, ref, value; + options || (options = {}); + this.options = options; + if (!this.options.version) { + this.options.version = '1.0'; + } + ref = options.stringify || {}; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this[key] = value; + } + } + + XMLStringifier.prototype.name = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalName('' + val || ''); + }; + + XMLStringifier.prototype.text = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar(this.textEscape('' + val || '')); + }; + + XMLStringifier.prototype.cdata = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + val = val.replace(']]>', ']]]]>'); + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.comment = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (val.match(/--/)) { + throw new Error("Comment text cannot contain double-hypen: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.raw = function(val) { + if (this.options.noValidation) { + return val; + } + return '' + val || ''; + }; + + XMLStringifier.prototype.attValue = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar(this.attEscape(val = '' + val || '')); + }; + + XMLStringifier.prototype.insTarget = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.insValue = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (val.match(/\?>/)) { + throw new Error("Invalid processing instruction value: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.xmlVersion = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (!val.match(/1\.[0-9]+/)) { + throw new Error("Invalid version number: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlEncoding = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) { + throw new Error("Invalid encoding: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.xmlStandalone = function(val) { + if (this.options.noValidation) { + return val; + } + if (val) { + return "yes"; + } else { + return "no"; + } + }; + + XMLStringifier.prototype.dtdPubID = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdSysID = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdElementValue = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdAttType = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdAttDefault = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdEntityValue = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdNData = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.convertAttKey = '@'; + + XMLStringifier.prototype.convertPIKey = '?'; + + XMLStringifier.prototype.convertTextKey = '#text'; + + XMLStringifier.prototype.convertCDataKey = '#cdata'; + + XMLStringifier.prototype.convertCommentKey = '#comment'; + + XMLStringifier.prototype.convertRawKey = '#raw'; + + XMLStringifier.prototype.assertLegalChar = function(str) { + var regex, res; + if (this.options.noValidation) { + return str; + } + regex = ''; + if (this.options.version === '1.0') { + regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex)) { + throw new Error("Invalid character in string: " + str + " at index " + res.index); + } + } else if (this.options.version === '1.1') { + regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex)) { + throw new Error("Invalid character in string: " + str + " at index " + res.index); + } + } + return str; + }; + + XMLStringifier.prototype.assertLegalName = function(str) { + var regex; + if (this.options.noValidation) { + return str; + } + this.assertLegalChar(str); + regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/; + if (!str.match(regex)) { + throw new Error("Invalid character in name"); + } + return str; + }; + + XMLStringifier.prototype.textEscape = function(str) { + var ampregex; + if (this.options.noValidation) { + return str; + } + ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; + return str.replace(ampregex, '&').replace(//g, '>').replace(/\r/g, ' '); + }; + + XMLStringifier.prototype.attEscape = function(str) { + var ampregex; + if (this.options.noValidation) { + return str; + } + ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; + return str.replace(ampregex, '&').replace(/ 0) { + return new Array(indentLevel).join(options.indent); + } + } + return ''; + }; + + XMLWriterBase.prototype.endline = function(node, options, level) { + if (!options.pretty || options.suppressPrettyCount) { + return ''; + } else { + return options.newline; + } + }; + + XMLWriterBase.prototype.attribute = function(att, options, level) { + var r; + this.openAttribute(att, options, level); + r = ' ' + att.name + '="' + att.value + '"'; + this.closeAttribute(att, options, level); + return r; + }; + + XMLWriterBase.prototype.cdata = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.comment = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.declaration = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + ''; + r += this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.docType = function(node, options, level) { + var child, i, len, r, ref; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level); + r += ' 0) { + r += ' ['; + r += this.endline(node, options, level); + options.state = WriterState$1.InsideTag; + ref = node.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + r += this.writeChildNode(child, options, level + 1); + } + options.state = WriterState$1.CloseTag; + r += ']'; + } + options.state = WriterState$1.CloseTag; + r += options.spaceBeforeSlash + '>'; + r += this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.element = function(node, options, level) { + var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2; + level || (level = 0); + prettySuppressed = false; + r = ''; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r += this.indent(node, options, level) + '<' + node.name; + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + r += this.attribute(att, options, level); + } + childNodeCount = node.children.length; + firstChildNode = childNodeCount === 0 ? null : node.children[0]; + if (childNodeCount === 0 || node.children.every(function(e) { + return (e.type === NodeType$1.Text || e.type === NodeType$1.Raw) && e.value === ''; + })) { + if (options.allowEmpty) { + r += '>'; + options.state = WriterState$1.CloseTag; + r += '' + this.endline(node, options, level); + } else { + options.state = WriterState$1.CloseTag; + r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level); + } + } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType$1.Text || firstChildNode.type === NodeType$1.Raw) && (firstChildNode.value != null)) { + r += '>'; + options.state = WriterState$1.InsideTag; + options.suppressPrettyCount++; + prettySuppressed = true; + r += this.writeChildNode(firstChildNode, options, level + 1); + options.suppressPrettyCount--; + prettySuppressed = false; + options.state = WriterState$1.CloseTag; + r += '' + this.endline(node, options, level); + } else { + if (options.dontPrettyTextNodes) { + ref1 = node.children; + for (i = 0, len = ref1.length; i < len; i++) { + child = ref1[i]; + if ((child.type === NodeType$1.Text || child.type === NodeType$1.Raw) && (child.value != null)) { + options.suppressPrettyCount++; + prettySuppressed = true; + break; + } + } + } + r += '>' + this.endline(node, options, level); + options.state = WriterState$1.InsideTag; + ref2 = node.children; + for (j = 0, len1 = ref2.length; j < len1; j++) { + child = ref2[j]; + r += this.writeChildNode(child, options, level + 1); + } + options.state = WriterState$1.CloseTag; + r += this.indent(node, options, level) + ''; + if (prettySuppressed) { + options.suppressPrettyCount--; + } + r += this.endline(node, options, level); + options.state = WriterState$1.None; + } + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.writeChildNode = function(node, options, level) { + switch (node.type) { + case NodeType$1.CData: + return this.cdata(node, options, level); + case NodeType$1.Comment: + return this.comment(node, options, level); + case NodeType$1.Element: + return this.element(node, options, level); + case NodeType$1.Raw: + return this.raw(node, options, level); + case NodeType$1.Text: + return this.text(node, options, level); + case NodeType$1.ProcessingInstruction: + return this.processingInstruction(node, options, level); + case NodeType$1.Dummy: + return ''; + case NodeType$1.Declaration: + return this.declaration(node, options, level); + case NodeType$1.DocType: + return this.docType(node, options, level); + case NodeType$1.AttributeDeclaration: + return this.dtdAttList(node, options, level); + case NodeType$1.ElementDeclaration: + return this.dtdElement(node, options, level); + case NodeType$1.EntityDeclaration: + return this.dtdEntity(node, options, level); + case NodeType$1.NotationDeclaration: + return this.dtdNotation(node, options, level); + default: + throw new Error("Unknown XML node type: " + node.constructor.name); + } + }; + + XMLWriterBase.prototype.processingInstruction = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + ''; + r += this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.raw = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level); + options.state = WriterState$1.InsideTag; + r += node.value; + options.state = WriterState$1.CloseTag; + r += this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.text = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level); + options.state = WriterState$1.InsideTag; + r += node.value; + options.state = WriterState$1.CloseTag; + r += this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdAttList = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdElement = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdEntity = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdNotation = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState$1.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.openNode = function(node, options, level) {}; + + XMLWriterBase.prototype.closeNode = function(node, options, level) {}; + + XMLWriterBase.prototype.openAttribute = function(att, options, level) {}; + + XMLWriterBase.prototype.closeAttribute = function(att, options, level) {}; + + return XMLWriterBase; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLStringWriter = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLStringWriter, XMLWriterBase$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLWriterBase$1 = XMLWriterBase; + + module.exports = XMLStringWriter = (function(superClass) { + extend(XMLStringWriter, superClass); + + function XMLStringWriter(options) { + XMLStringWriter.__super__.constructor.call(this, options); + } + + XMLStringWriter.prototype.document = function(doc, options) { + var child, i, len, r, ref; + options = this.filterOptions(options); + r = ''; + ref = doc.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + r += this.writeChildNode(child, options, 0); + } + if (options.pretty && r.slice(-options.newline.length) === options.newline) { + r = r.slice(0, -options.newline.length); + } + return r; + }; + + return XMLStringWriter; + + })(XMLWriterBase$1); + +}).call(commonjsGlobal); +}); + +var XMLDocument = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, XMLDOMConfiguration$1, XMLDOMImplementation$1, XMLDocument, XMLNode$1, XMLStringWriter$1, XMLStringifier$1, isPlainObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isPlainObject = Utility.isPlainObject; + + XMLDOMImplementation$1 = XMLDOMImplementation; + + XMLDOMConfiguration$1 = XMLDOMConfiguration; + + XMLNode$1 = XMLNode; + + NodeType$1 = NodeType; + + XMLStringifier$1 = XMLStringifier; + + XMLStringWriter$1 = XMLStringWriter; + + module.exports = XMLDocument = (function(superClass) { + extend(XMLDocument, superClass); + + function XMLDocument(options) { + XMLDocument.__super__.constructor.call(this, null); + this.name = "#document"; + this.type = NodeType$1.Document; + this.documentURI = null; + this.domConfig = new XMLDOMConfiguration$1(); + options || (options = {}); + if (!options.writer) { + options.writer = new XMLStringWriter$1(); + } + this.options = options; + this.stringify = new XMLStringifier$1(options); + } + + Object.defineProperty(XMLDocument.prototype, 'implementation', { + value: new XMLDOMImplementation$1() + }); + + Object.defineProperty(XMLDocument.prototype, 'doctype', { + get: function() { + var child, i, len, ref; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType$1.DocType) { + return child; + } + } + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'documentElement', { + get: function() { + return this.rootObject || null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'inputEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', { + get: function() { + return false; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType$1.Declaration) { + return this.children[0].encoding; + } else { + return null; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType$1.Declaration) { + return this.children[0].standalone === 'yes'; + } else { + return false; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlVersion', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType$1.Declaration) { + return this.children[0].version; + } else { + return "1.0"; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'URL', { + get: function() { + return this.documentURI; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'origin', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'compatMode', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'characterSet', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'contentType', { + get: function() { + return null; + } + }); + + XMLDocument.prototype.end = function(writer) { + var writerOptions; + writerOptions = {}; + if (!writer) { + writer = this.options.writer; + } else if (isPlainObject(writer)) { + writerOptions = writer; + writer = this.options.writer; + } + return writer.document(this, writer.filterOptions(writerOptions)); + }; + + XMLDocument.prototype.toString = function(options) { + return this.options.writer.document(this, this.options.writer.filterOptions(options)); + }; + + XMLDocument.prototype.createElement = function(tagName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createDocumentFragment = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createTextNode = function(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createComment = function(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createCDATASection = function(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createProcessingInstruction = function(target, data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createAttribute = function(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createEntityReference = function(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementsByTagName = function(tagname) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.importNode = function(importedNode, deep) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementById = function(elementId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.adoptNode = function(source) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.normalizeDocument = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementsByClassName = function(classNames) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createEvent = function(eventInterface) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createRange = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + return XMLDocument; + + })(XMLNode$1); + +}).call(commonjsGlobal); +}); + +var XMLDocumentCB = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, WriterState$1, XMLAttribute$1, XMLCData$1, XMLComment$1, XMLDTDAttList$1, XMLDTDElement$1, XMLDTDEntity$1, XMLDTDNotation$1, XMLDeclaration$1, XMLDocType$1, XMLDocument$1, XMLDocumentCB, XMLElement$1, XMLProcessingInstruction$1, XMLRaw$1, XMLStringWriter$1, XMLStringifier$1, XMLText$1, getValue, isFunction, isObject, isPlainObject, ref, + hasProp = {}.hasOwnProperty; + + ref = Utility, isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue; + + NodeType$1 = NodeType; + + XMLDocument$1 = XMLDocument; + + XMLElement$1 = XMLElement; + + XMLCData$1 = XMLCData; + + XMLComment$1 = XMLComment; + + XMLRaw$1 = XMLRaw; + + XMLText$1 = XMLText; + + XMLProcessingInstruction$1 = XMLProcessingInstruction; + + XMLDeclaration$1 = XMLDeclaration; + + XMLDocType$1 = XMLDocType; + + XMLDTDAttList$1 = XMLDTDAttList; + + XMLDTDEntity$1 = XMLDTDEntity; + + XMLDTDElement$1 = XMLDTDElement; + + XMLDTDNotation$1 = XMLDTDNotation; + + XMLAttribute$1 = XMLAttribute; + + XMLStringifier$1 = XMLStringifier; + + XMLStringWriter$1 = XMLStringWriter; + + WriterState$1 = WriterState; + + module.exports = XMLDocumentCB = (function() { + function XMLDocumentCB(options, onData, onEnd) { + var writerOptions; + this.name = "?xml"; + this.type = NodeType$1.Document; + options || (options = {}); + writerOptions = {}; + if (!options.writer) { + options.writer = new XMLStringWriter$1(); + } else if (isPlainObject(options.writer)) { + writerOptions = options.writer; + options.writer = new XMLStringWriter$1(); + } + this.options = options; + this.writer = options.writer; + this.writerOptions = this.writer.filterOptions(writerOptions); + this.stringify = new XMLStringifier$1(options); + this.onDataCallback = onData || function() {}; + this.onEndCallback = onEnd || function() {}; + this.currentNode = null; + this.currentLevel = -1; + this.openTags = {}; + this.documentStarted = false; + this.documentCompleted = false; + this.root = null; + } + + XMLDocumentCB.prototype.createChildNode = function(node) { + var att, attName, attributes, child, i, len, ref1, ref2; + switch (node.type) { + case NodeType$1.CData: + this.cdata(node.value); + break; + case NodeType$1.Comment: + this.comment(node.value); + break; + case NodeType$1.Element: + attributes = {}; + ref1 = node.attribs; + for (attName in ref1) { + if (!hasProp.call(ref1, attName)) continue; + att = ref1[attName]; + attributes[attName] = att.value; + } + this.node(node.name, attributes); + break; + case NodeType$1.Dummy: + this.dummy(); + break; + case NodeType$1.Raw: + this.raw(node.value); + break; + case NodeType$1.Text: + this.text(node.value); + break; + case NodeType$1.ProcessingInstruction: + this.instruction(node.target, node.value); + break; + default: + throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name); + } + ref2 = node.children; + for (i = 0, len = ref2.length; i < len; i++) { + child = ref2[i]; + this.createChildNode(child); + if (child.type === NodeType$1.Element) { + this.up(); + } + } + return this; + }; + + XMLDocumentCB.prototype.dummy = function() { + return this; + }; + + XMLDocumentCB.prototype.node = function(name, attributes, text) { + var ref1; + if (name == null) { + throw new Error("Missing node name."); + } + if (this.root && this.currentLevel === -1) { + throw new Error("Document can only have one root node. " + this.debugInfo(name)); + } + this.openCurrent(); + name = getValue(name); + if (attributes == null) { + attributes = {}; + } + attributes = getValue(attributes); + if (!isObject(attributes)) { + ref1 = [attributes, text], text = ref1[0], attributes = ref1[1]; + } + this.currentNode = new XMLElement$1(this, name, attributes); + this.currentNode.children = false; + this.currentLevel++; + this.openTags[this.currentLevel] = this.currentNode; + if (text != null) { + this.text(text); + } + return this; + }; + + XMLDocumentCB.prototype.element = function(name, attributes, text) { + var child, i, len, oldValidationFlag, ref1, root; + if (this.currentNode && this.currentNode.type === NodeType$1.DocType) { + this.dtdElement.apply(this, arguments); + } else { + if (Array.isArray(name) || isObject(name) || isFunction(name)) { + oldValidationFlag = this.options.noValidation; + this.options.noValidation = true; + root = new XMLDocument$1(this.options).element('TEMP_ROOT'); + root.element(name); + this.options.noValidation = oldValidationFlag; + ref1 = root.children; + for (i = 0, len = ref1.length; i < len; i++) { + child = ref1[i]; + this.createChildNode(child); + if (child.type === NodeType$1.Element) { + this.up(); + } + } + } else { + this.node(name, attributes, text); + } + } + return this; + }; + + XMLDocumentCB.prototype.attribute = function(name, value) { + var attName, attValue; + if (!this.currentNode || this.currentNode.children) { + throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name)); + } + if (name != null) { + name = getValue(name); + } + if (isObject(name)) { + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (this.options.keepNullAttributes && (value == null)) { + this.currentNode.attribs[name] = new XMLAttribute$1(this, name, ""); + } else if (value != null) { + this.currentNode.attribs[name] = new XMLAttribute$1(this, name, value); + } + } + return this; + }; + + XMLDocumentCB.prototype.text = function(value) { + var node; + this.openCurrent(); + node = new XMLText$1(this, value); + this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.cdata = function(value) { + var node; + this.openCurrent(); + node = new XMLCData$1(this, value); + this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.comment = function(value) { + var node; + this.openCurrent(); + node = new XMLComment$1(this, value); + this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.raw = function(value) { + var node; + this.openCurrent(); + node = new XMLRaw$1(this, value); + this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.instruction = function(target, value) { + var i, insTarget, insValue, len, node; + this.openCurrent(); + if (target != null) { + target = getValue(target); + } + if (value != null) { + value = getValue(value); + } + if (Array.isArray(target)) { + for (i = 0, len = target.length; i < len; i++) { + insTarget = target[i]; + this.instruction(insTarget); + } + } else if (isObject(target)) { + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + node = new XMLProcessingInstruction$1(this, target, value); + this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + } + return this; + }; + + XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) { + var node; + this.openCurrent(); + if (this.documentStarted) { + throw new Error("declaration() must be the first node."); + } + node = new XMLDeclaration$1(this, version, encoding, standalone); + this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) { + this.openCurrent(); + if (root == null) { + throw new Error("Missing root node name."); + } + if (this.root) { + throw new Error("dtd() must come before the root node."); + } + this.currentNode = new XMLDocType$1(this, pubID, sysID); + this.currentNode.rootNodeName = root; + this.currentNode.children = false; + this.currentLevel++; + this.openTags[this.currentLevel] = this.currentNode; + return this; + }; + + XMLDocumentCB.prototype.dtdElement = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDElement$1(this, name, value); + this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var node; + this.openCurrent(); + node = new XMLDTDAttList$1(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.entity = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDEntity$1(this, false, name, value); + this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.pEntity = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDEntity$1(this, true, name, value); + this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.notation = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDNotation$1(this, name, value); + this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.up = function() { + if (this.currentLevel < 0) { + throw new Error("The document node has no parent."); + } + if (this.currentNode) { + if (this.currentNode.children) { + this.closeNode(this.currentNode); + } else { + this.openNode(this.currentNode); + } + this.currentNode = null; + } else { + this.closeNode(this.openTags[this.currentLevel]); + } + delete this.openTags[this.currentLevel]; + this.currentLevel--; + return this; + }; + + XMLDocumentCB.prototype.end = function() { + while (this.currentLevel >= 0) { + this.up(); + } + return this.onEnd(); + }; + + XMLDocumentCB.prototype.openCurrent = function() { + if (this.currentNode) { + this.currentNode.children = true; + return this.openNode(this.currentNode); + } + }; + + XMLDocumentCB.prototype.openNode = function(node) { + var att, chunk, name, ref1; + if (!node.isOpen) { + if (!this.root && this.currentLevel === 0 && node.type === NodeType$1.Element) { + this.root = node; + } + chunk = ''; + if (node.type === NodeType$1.Element) { + this.writerOptions.state = WriterState$1.OpenTag; + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name; + ref1 = node.attribs; + for (name in ref1) { + if (!hasProp.call(ref1, name)) continue; + att = ref1[name]; + chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel); + } + chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel); + this.writerOptions.state = WriterState$1.InsideTag; + } else { + this.writerOptions.state = WriterState$1.OpenTag; + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ''; + } + chunk += this.writer.endline(node, this.writerOptions, this.currentLevel); + } + this.onData(chunk, this.currentLevel); + return node.isOpen = true; + } + }; + + XMLDocumentCB.prototype.closeNode = function(node) { + var chunk; + if (!node.isClosed) { + chunk = ''; + this.writerOptions.state = WriterState$1.CloseTag; + if (node.type === NodeType$1.Element) { + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '' + this.writer.endline(node, this.writerOptions, this.currentLevel); + } else { + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel); + } + this.writerOptions.state = WriterState$1.None; + this.onData(chunk, this.currentLevel); + return node.isClosed = true; + } + }; + + XMLDocumentCB.prototype.onData = function(chunk, level) { + this.documentStarted = true; + return this.onDataCallback(chunk, level + 1); + }; + + XMLDocumentCB.prototype.onEnd = function() { + this.documentCompleted = true; + return this.onEndCallback(); + }; + + XMLDocumentCB.prototype.debugInfo = function(name) { + if (name == null) { + return ""; + } else { + return "node: <" + name + ">"; + } + }; + + XMLDocumentCB.prototype.ele = function() { + return this.element.apply(this, arguments); + }; + + XMLDocumentCB.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLDocumentCB.prototype.txt = function(value) { + return this.text(value); + }; + + XMLDocumentCB.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLDocumentCB.prototype.com = function(value) { + return this.comment(value); + }; + + XMLDocumentCB.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocumentCB.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) { + return this.doctype(root, pubID, sysID); + }; + + XMLDocumentCB.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLDocumentCB.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLDocumentCB.prototype.t = function(value) { + return this.text(value); + }; + + XMLDocumentCB.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLDocumentCB.prototype.c = function(value) { + return this.comment(value); + }; + + XMLDocumentCB.prototype.r = function(value) { + return this.raw(value); + }; + + XMLDocumentCB.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocumentCB.prototype.att = function() { + if (this.currentNode && this.currentNode.type === NodeType$1.DocType) { + return this.attList.apply(this, arguments); + } else { + return this.attribute.apply(this, arguments); + } + }; + + XMLDocumentCB.prototype.a = function() { + if (this.currentNode && this.currentNode.type === NodeType$1.DocType) { + return this.attList.apply(this, arguments); + } else { + return this.attribute.apply(this, arguments); + } + }; + + XMLDocumentCB.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocumentCB.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocumentCB.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + return XMLDocumentCB; + + })(); + +}).call(commonjsGlobal); +}); + +var XMLStreamWriter = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, WriterState$1, XMLStreamWriter, XMLWriterBase$1, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType$1 = NodeType; + + XMLWriterBase$1 = XMLWriterBase; + + WriterState$1 = WriterState; + + module.exports = XMLStreamWriter = (function(superClass) { + extend(XMLStreamWriter, superClass); + + function XMLStreamWriter(stream, options) { + this.stream = stream; + XMLStreamWriter.__super__.constructor.call(this, options); + } + + XMLStreamWriter.prototype.endline = function(node, options, level) { + if (node.isLastRootNode && options.state === WriterState$1.CloseTag) { + return ''; + } else { + return XMLStreamWriter.__super__.endline.call(this, node, options, level); + } + }; + + XMLStreamWriter.prototype.document = function(doc, options) { + var child, i, j, k, len, len1, ref, ref1, results; + ref = doc.children; + for (i = j = 0, len = ref.length; j < len; i = ++j) { + child = ref[i]; + child.isLastRootNode = i === doc.children.length - 1; + } + options = this.filterOptions(options); + ref1 = doc.children; + results = []; + for (k = 0, len1 = ref1.length; k < len1; k++) { + child = ref1[k]; + results.push(this.writeChildNode(child, options, 0)); + } + return results; + }; + + XMLStreamWriter.prototype.attribute = function(att, options, level) { + return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level)); + }; + + XMLStreamWriter.prototype.cdata = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.comment = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.declaration = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.docType = function(node, options, level) { + var child, j, len, ref; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + this.stream.write(this.indent(node, options, level)); + this.stream.write(' 0) { + this.stream.write(' ['); + this.stream.write(this.endline(node, options, level)); + options.state = WriterState$1.InsideTag; + ref = node.children; + for (j = 0, len = ref.length; j < len; j++) { + child = ref[j]; + this.writeChildNode(child, options, level + 1); + } + options.state = WriterState$1.CloseTag; + this.stream.write(']'); + } + options.state = WriterState$1.CloseTag; + this.stream.write(options.spaceBeforeSlash + '>'); + this.stream.write(this.endline(node, options, level)); + options.state = WriterState$1.None; + return this.closeNode(node, options, level); + }; + + XMLStreamWriter.prototype.element = function(node, options, level) { + var att, child, childNodeCount, firstChildNode, j, len, name, ref, ref1; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState$1.OpenTag; + this.stream.write(this.indent(node, options, level) + '<' + node.name); + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + this.attribute(att, options, level); + } + childNodeCount = node.children.length; + firstChildNode = childNodeCount === 0 ? null : node.children[0]; + if (childNodeCount === 0 || node.children.every(function(e) { + return (e.type === NodeType$1.Text || e.type === NodeType$1.Raw) && e.value === ''; + })) { + if (options.allowEmpty) { + this.stream.write('>'); + options.state = WriterState$1.CloseTag; + this.stream.write(''); + } else { + options.state = WriterState$1.CloseTag; + this.stream.write(options.spaceBeforeSlash + '/>'); + } + } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType$1.Text || firstChildNode.type === NodeType$1.Raw) && (firstChildNode.value != null)) { + this.stream.write('>'); + options.state = WriterState$1.InsideTag; + options.suppressPrettyCount++; + this.writeChildNode(firstChildNode, options, level + 1); + options.suppressPrettyCount--; + options.state = WriterState$1.CloseTag; + this.stream.write(''); + } else { + this.stream.write('>' + this.endline(node, options, level)); + options.state = WriterState$1.InsideTag; + ref1 = node.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + this.writeChildNode(child, options, level + 1); + } + options.state = WriterState$1.CloseTag; + this.stream.write(this.indent(node, options, level) + ''); + } + this.stream.write(this.endline(node, options, level)); + options.state = WriterState$1.None; + return this.closeNode(node, options, level); + }; + + XMLStreamWriter.prototype.processingInstruction = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.raw = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.text = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdAttList = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdElement = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdEntity = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdNotation = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level)); + }; + + return XMLStreamWriter; + + })(XMLWriterBase$1); + +}).call(commonjsGlobal); +}); + +var lib = createCommonjsModule(function (module) { +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType$1, WriterState$1, XMLDOMImplementation$1, XMLDocument$1, XMLDocumentCB$1, XMLStreamWriter$1, XMLStringWriter$1, assign, isFunction, ref; + + ref = Utility, assign = ref.assign, isFunction = ref.isFunction; + + XMLDOMImplementation$1 = XMLDOMImplementation; + + XMLDocument$1 = XMLDocument; + + XMLDocumentCB$1 = XMLDocumentCB; + + XMLStringWriter$1 = XMLStringWriter; + + XMLStreamWriter$1 = XMLStreamWriter; + + NodeType$1 = NodeType; + + WriterState$1 = WriterState; + + module.exports.create = function(name, xmldec, doctype, options) { + var doc, root; + if (name == null) { + throw new Error("Root element needs a name."); + } + options = assign({}, xmldec, doctype, options); + doc = new XMLDocument$1(options); + root = doc.element(name); + if (!options.headless) { + doc.declaration(options); + if ((options.pubID != null) || (options.sysID != null)) { + doc.dtd(options); + } + } + return root; + }; + + module.exports.begin = function(options, onData, onEnd) { + var ref1; + if (isFunction(options)) { + ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1]; + options = {}; + } + if (onData) { + return new XMLDocumentCB$1(options, onData, onEnd); + } else { + return new XMLDocument$1(options); + } + }; + + module.exports.stringWriter = function(options) { + return new XMLStringWriter$1(options); + }; + + module.exports.streamWriter = function(stream, options) { + return new XMLStreamWriter$1(stream, options); + }; + + module.exports.implementation = new XMLDOMImplementation$1(); + + module.exports.nodeType = NodeType$1; + + module.exports.writerState = WriterState$1; + +}).call(commonjsGlobal); +}); + +var builder = createCommonjsModule(function (module, exports) { +// Generated by CoffeeScript 1.12.7 +(function() { + var builder, defaults$1, escapeCDATA, requiresCDATA, wrapCDATA, + hasProp = {}.hasOwnProperty; + + builder = lib; + + defaults$1 = defaults.defaults; + + requiresCDATA = function(entry) { + return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0); + }; + + wrapCDATA = function(entry) { + return ""; + }; + + escapeCDATA = function(entry) { + return entry.replace(']]>', ']]]]>'); + }; + + exports.Builder = (function() { + function Builder(opts) { + var key, ref, value; + this.options = {}; + ref = defaults$1["0.2"]; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this.options[key] = value; + } + for (key in opts) { + if (!hasProp.call(opts, key)) continue; + value = opts[key]; + this.options[key] = value; + } + } + + Builder.prototype.buildObject = function(rootObj) { + var attrkey, charkey, render, rootElement, rootName; + attrkey = this.options.attrkey; + charkey = this.options.charkey; + if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults$1['0.2'].rootName)) { + rootName = Object.keys(rootObj)[0]; + rootObj = rootObj[rootName]; + } else { + rootName = this.options.rootName; + } + render = (function(_this) { + return function(element, obj) { + var attr, child, entry, index, key, value; + if (typeof obj !== 'object') { + if (_this.options.cdata && requiresCDATA(obj)) { + element.raw(wrapCDATA(obj)); + } else { + element.txt(obj); + } + } else if (Array.isArray(obj)) { + for (index in obj) { + if (!hasProp.call(obj, index)) continue; + child = obj[index]; + for (key in child) { + entry = child[key]; + element = render(element.ele(key), entry).up(); + } + } + } else { + for (key in obj) { + if (!hasProp.call(obj, key)) continue; + child = obj[key]; + if (key === attrkey) { + if (typeof child === "object") { + for (attr in child) { + value = child[attr]; + element = element.att(attr, value); + } + } + } else if (key === charkey) { + if (_this.options.cdata && requiresCDATA(child)) { + element = element.raw(wrapCDATA(child)); + } else { + element = element.txt(child); + } + } else if (Array.isArray(child)) { + for (index in child) { + if (!hasProp.call(child, index)) continue; + entry = child[index]; + if (typeof entry === 'string') { + if (_this.options.cdata && requiresCDATA(entry)) { + element = element.ele(key).raw(wrapCDATA(entry)).up(); + } else { + element = element.ele(key, entry).up(); + } + } else { + element = render(element.ele(key), entry).up(); + } + } + } else if (typeof child === "object") { + element = render(element.ele(key), child).up(); + } else { + if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) { + element = element.ele(key).raw(wrapCDATA(child)).up(); + } else { + if (child == null) { + child = ''; + } + element = element.ele(key, child.toString()).up(); + } + } + } + } + return element; + }; + })(this); + rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { + headless: this.options.headless, + allowSurrogateChars: this.options.allowSurrogateChars + }); + return render(rootElement, rootObj).end(this.options.renderOpts); + }; + + return Builder; + + })(); + +}).call(commonjsGlobal); +}); + +var sax = createCommonjsModule(function (module, exports) { +(function (sax) { // wrapper for non-node envs + sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }; + sax.SAXParser = SAXParser; + sax.SAXStream = SAXStream; + sax.createStream = createStream; + + // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. + // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), + // since that's the earliest that a buffer overrun could occur. This way, checks are + // as rare as required, but as often as necessary to ensure never crossing this bound. + // Furthermore, buffers are only tested at most once per write(), so passing a very + // large string into write() might have undesirable effects, but this is manageable by + // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme + // edge case, result in creating at most one complete copy of the string passed in. + // Set to Infinity to have unlimited buffers. + sax.MAX_BUFFER_LENGTH = 64 * 1024; + + var buffers = [ + 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', + 'procInstName', 'procInstBody', 'entity', 'attribName', + 'attribValue', 'cdata', 'script' + ]; + + sax.EVENTS = [ + 'text', + 'processinginstruction', + 'sgmldeclaration', + 'doctype', + 'comment', + 'opentagstart', + 'attribute', + 'opentag', + 'closetag', + 'opencdata', + 'cdata', + 'closecdata', + 'error', + 'end', + 'ready', + 'script', + 'opennamespace', + 'closenamespace' + ]; + + function SAXParser (strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt) + } + + var parser = this; + clearBuffers(parser); + parser.q = parser.c = ''; + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH; + parser.opt = opt || {}; + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags; + parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'; + parser.tags = []; + parser.closed = parser.closedRoot = parser.sawRoot = false; + parser.tag = parser.error = null; + parser.strict = !!strict; + parser.noscript = !!(strict || parser.opt.noscript); + parser.state = S.BEGIN; + parser.strictEntities = parser.opt.strictEntities; + parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES); + parser.attribList = []; + + // namespaces form a prototype chain. + // it always points at the current tag, + // which protos to its parent tag. + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS); + } + + // mostly just for error reporting + parser.trackPosition = parser.opt.position !== false; + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0; + } + emit(parser, 'onready'); + } + + if (!Object.create) { + Object.create = function (o) { + function F () {} + F.prototype = o; + var newf = new F(); + return newf + }; + } + + if (!Object.keys) { + Object.keys = function (o) { + var a = []; + for (var i in o) if (o.hasOwnProperty(i)) a.push(i); + return a + }; + } + + function checkBufferLength (parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10); + var maxActual = 0; + for (var i = 0, l = buffers.length; i < l; i++) { + var len = parser[buffers[i]].length; + if (len > maxAllowed) { + // Text/cdata nodes can get big, and since they're buffered, + // we can get here under normal conditions. + // Avoid issues by emitting the text node now, + // so at least it won't get any bigger. + switch (buffers[i]) { + case 'textNode': + closeText(parser); + break + + case 'cdata': + emitNode(parser, 'oncdata', parser.cdata); + parser.cdata = ''; + break + + case 'script': + emitNode(parser, 'onscript', parser.script); + parser.script = ''; + break + + default: + error(parser, 'Max buffer length exceeded: ' + buffers[i]); + } + } + maxActual = Math.max(maxActual, len); + } + // schedule the next check for the earliest possible buffer overrun. + var m = sax.MAX_BUFFER_LENGTH - maxActual; + parser.bufferCheckPosition = m + parser.position; + } + + function clearBuffers (parser) { + for (var i = 0, l = buffers.length; i < l; i++) { + parser[buffers[i]] = ''; + } + } + + function flushBuffers (parser) { + closeText(parser); + if (parser.cdata !== '') { + emitNode(parser, 'oncdata', parser.cdata); + parser.cdata = ''; + } + if (parser.script !== '') { + emitNode(parser, 'onscript', parser.script); + parser.script = ''; + } + } + + SAXParser.prototype = { + end: function () { end(this); }, + write: write, + resume: function () { this.error = null; return this }, + close: function () { return this.write(null) }, + flush: function () { flushBuffers(this); } + }; + + var Stream; + try { + Stream = Stream__default['default'].Stream; + } catch (ex) { + Stream = function () {}; + } + + var streamWraps = sax.EVENTS.filter(function (ev) { + return ev !== 'error' && ev !== 'end' + }); + + function createStream (strict, opt) { + return new SAXStream(strict, opt) + } + + function SAXStream (strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt) + } + + Stream.apply(this); + + this._parser = new SAXParser(strict, opt); + this.writable = true; + this.readable = true; + + var me = this; + + this._parser.onend = function () { + me.emit('end'); + }; + + this._parser.onerror = function (er) { + me.emit('error', er); + + // if didn't throw, then means error was handled. + // go ahead and clear error, so we can write again. + me._parser.error = null; + }; + + this._decoder = null; + + streamWraps.forEach(function (ev) { + Object.defineProperty(me, 'on' + ev, { + get: function () { + return me._parser['on' + ev] + }, + set: function (h) { + if (!h) { + me.removeAllListeners(ev); + me._parser['on' + ev] = h; + return h + } + me.on(ev, h); + }, + enumerable: true, + configurable: false + }); + }); + } + + SAXStream.prototype = Object.create(Stream.prototype, { + constructor: { + value: SAXStream + } + }); + + SAXStream.prototype.write = function (data) { + if (typeof Buffer === 'function' && + typeof Buffer.isBuffer === 'function' && + Buffer.isBuffer(data)) { + if (!this._decoder) { + var SD = require$$1__default$1['default'].StringDecoder; + this._decoder = new SD('utf8'); + } + data = this._decoder.write(data); + } + + this._parser.write(data.toString()); + this.emit('data', data); + return true + }; + + SAXStream.prototype.end = function (chunk) { + if (chunk && chunk.length) { + this.write(chunk); + } + this._parser.end(); + return true + }; + + SAXStream.prototype.on = function (ev, handler) { + var me = this; + if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser['on' + ev] = function () { + var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments); + args.splice(0, 0, ev); + me.emit.apply(me, args); + }; + } + + return Stream.prototype.on.call(me, ev, handler) + }; + + // this really needs to be replaced with character classes. + // XML allows all manner of ridiculous numbers and digits. + var CDATA = '[CDATA['; + var DOCTYPE = 'DOCTYPE'; + var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'; + var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'; + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }; + + // http://www.w3.org/TR/REC-xml/#NT-NameStartChar + // This implementation works on strings, a single character at a time + // as such, it cannot ever support astral-plane characters (10000-EFFFF) + // without a significant breaking change to either this parser, or the + // JavaScript language. Implementation of an emoji-capable xml parser + // is left as an exercise for the reader. + var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; + + var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; + + var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; + var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; + + function isWhitespace (c) { + return c === ' ' || c === '\n' || c === '\r' || c === '\t' + } + + function isQuote (c) { + return c === '"' || c === '\'' + } + + function isAttribEnd (c) { + return c === '>' || isWhitespace(c) + } + + function isMatch (regex, c) { + return regex.test(c) + } + + function notMatch (regex, c) { + return !isMatch(regex, c) + } + + var S = 0; + sax.STATE = { + BEGIN: S++, // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, // leading whitespace + TEXT: S++, // general stuff + TEXT_ENTITY: S++, // & and such. + OPEN_WAKA: S++, // < + SGML_DECL: S++, // + SCRIPT: S++, //