From 5741465e8594cea8ac5c1287001fc45f344f90f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20Go=CC=88zel?= Date: Sat, 31 Dec 2022 16:29:17 +0300 Subject: [PATCH] originator and destination fields now supports utf8 chars. The To header is optional now. Headers that longer than 998 chars will raise and error. dependencies updated. added type=module to package.json to fully switch to esmodule format. message content is now chunked to 78 chars per line. this feature cost to two dependencies (runes and underscore:chunk). --- .releaser.json | 25 +- dist/browser/cjs/index.js | 452 ++- dist/browser/cjs/index.js.map | 2 +- dist/browser/es/index.js | 451 ++- dist/browser/es/index.js.map | 2 +- dist/browser/iife/index.js | 2 +- dist/browser/iife/index.js.map | 2 +- dist/gas/iife/index.js | 2 +- dist/gas/iife/index.js.map | 2 +- dist/node/cjs/index.js | 262 +- dist/node/cjs/index.js.map | 2 +- dist/node/es/index.js | 262 +- dist/node/es/index.js.map | 2 +- package-lock.json | 5273 +++++++++++++++++++++++++------- package.json | 19 +- rollup.config.js | 11 +- src/MIMEMessage.js | 16 +- src/MIMEMessageContent.js | 13 +- src/MIMEMessageHeader.js | 39 +- tests/unit.js | 21 +- 20 files changed, 5294 insertions(+), 1566 deletions(-) diff --git a/.releaser.json b/.releaser.json index dbdb38c..048ed4e 100644 --- a/.releaser.json +++ b/.releaser.json @@ -1,14 +1,13 @@ { - "versioning": { - "scheme": "semver" - }, - "npm": { - "enable": true, - "updatePkgJson": true, - "publish": true - }, - "github": { - "enable": true, - "release": true - } -} + "versioningScheme": "semver", + "versioningPrefix": "v", + "npmUpdatePackageVersion": true, + "npmPublishPackage": true, + "githubRelease": true, + "location": ".releaser.json", + "npmPublishPackageArgs": [], + "gitlabRelease": false, + "dockerBuildPath": ".", + "dockerBuildArgs": [], + "dockerPushArgs": [] +} \ No newline at end of file diff --git a/dist/browser/cjs/index.js b/dist/browser/cjs/index.js index e7d675c..3083821 100644 --- a/dist/browser/cjs/index.js +++ b/dist/browser/cjs/index.js @@ -18,6 +18,7 @@ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/f var _Array$from = require('@babel/runtime-corejs3/core-js/array/from'); var _Symbol = require('@babel/runtime-corejs3/core-js/symbol'); var _getIteratorMethod = require('@babel/runtime-corejs3/core-js/get-iterator-method'); +var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral'); var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/reduce'); var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper'); var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/trim'); @@ -40,47 +41,40 @@ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_filte var _Array$from__default = /*#__PURE__*/_interopDefaultLegacy(_Array$from); var _Symbol__default = /*#__PURE__*/_interopDefaultLegacy(_Symbol); var _getIteratorMethod__default = /*#__PURE__*/_interopDefaultLegacy(_getIteratorMethod); +var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral); var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_reduceInstanceProperty); var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy(_wrapNativeSuper); var _trimInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_trimInstanceProperty); function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; } - function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } } - var MIMETextError = /*#__PURE__*/function (_Error) { _inherits__default["default"](MIMETextError, _Error); - var _super = _createSuper$1(MIMETextError); - function MIMETextError(message, description) { var _this; - _classCallCheck__default["default"](this, MIMETextError); - _this = _super.call(this, message); _this.description = description ? _trimInstanceProperty__default["default"](description).call(description).replace(/[\s]{2,}/, ' ') : null; _this.name = 'MIMETextError'; return _this; } - return _createClass__default["default"](MIMETextError); }( /*#__PURE__*/_wrapNativeSuper__default["default"](Error)); +var _templateObject; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol__default["default"] !== "undefined" && _getIteratorMethod__default["default"](o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _unsupportedIterableToArray(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty__default["default"](_context10 = Object.prototype.toString.call(o)).call(_context10, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from__default["default"](o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty__default["default"](_context5 = Object.prototype.toString.call(o)).call(_context5, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from__default["default"](o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /* * Headers are based on: https://www.rfc-editor.org/rfc/rfc4021#section-2.1 * (Some are ignored as they can be added later or as a custom header.) */ - var MIMEMessageHeader = /*#__PURE__*/function () { function MIMEMessageHeader(placement) { _classCallCheck__default["default"](this, MIMEMessageHeader); - + this.maxLineLength = 998; this.placement = placement; this.store = [{ placement: 'header', @@ -99,16 +93,17 @@ var MIMEMessageHeader = /*#__PURE__*/function () { }, { placement: 'header', name: 'From', - // required property indicates that this property must be set required: true, - dump: function dump(v) { - return v.dump(); + dump: function dump(v, ctx) { + var _context; + return !v.name ? v.dump() : _concatInstanceProperty__default["default"](_context = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context, v.addr, ">"); } }, { placement: 'header', name: 'Sender', - dump: function dump(v) { - return v.dump(); + dump: function dump(v, ctx) { + var _context2; + return !v.name ? v.dump() : _concatInstanceProperty__default["default"](_context2 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context2, v.addr, ">"); } }, { placement: 'header', @@ -119,43 +114,43 @@ var MIMEMessageHeader = /*#__PURE__*/function () { }, { placement: 'header', name: 'To', - required: true, - dump: function dump(vs) { - return _mapInstanceProperty__default["default"](vs).call(vs, function (v) { - return v.dump(); - }).join(', '); + // INFO: "To" field is not required according to the RFC-2822 + //required: true, + dump: function dump(arr, ctx) { + return _mapInstanceProperty__default["default"](arr).call(arr, function (v) { + var _context3; + return !v.name ? v.dump() : _concatInstanceProperty__default["default"](_context3 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context3, v.addr, ">"); + }).join(",\n "); } }, { placement: 'header', name: 'Cc', - dump: function dump(vs) { - return _mapInstanceProperty__default["default"](vs).call(vs, function (v) { - return v.dump(); - }).join(', '); + dump: function dump(arr, ctx) { + return _mapInstanceProperty__default["default"](arr).call(arr, function (v) { + var _context4; + return !v.name ? v.dump() : _concatInstanceProperty__default["default"](_context4 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context4, v.addr, ">"); + }).join(",\n "); } }, { placement: 'header', name: 'Bcc', - dump: function dump(vs) { - return _mapInstanceProperty__default["default"](vs).call(vs, function (v) { - return v.dump(); - }).join(', '); + dump: function dump(arr, ctx) { + return _mapInstanceProperty__default["default"](arr).call(arr, function (v) { + var _context5; + return !v.name ? v.dump() : _concatInstanceProperty__default["default"](_context5 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context5, v.addr, ">"); + }).join(",\n "); } }, { placement: 'header', name: 'Message-ID', disabled: false, generator: function generator(ctx) { - var _context, _context2; - + var _context6, _context7; var datestr = Date.now().toString(); - - var randomstr = _sliceInstanceProperty__default["default"](_context = Math.random().toString(36)).call(_context, 2); - - var domain = _filterInstanceProperty__default["default"](_context2 = ctx.store).call(_context2, function (item) { + var randomstr = _sliceInstanceProperty__default["default"](_context6 = Math.random().toString(36)).call(_context6, 2); + var domain = _filterInstanceProperty__default["default"](_context7 = ctx.store).call(_context7, function (item) { return item.name == 'From'; })[0].value.getAddrDomain(); - return '<' + randomstr + '-' + datestr + '@' + domain + '>'; }, dump: function dump(v) { @@ -203,20 +198,18 @@ var MIMEMessageHeader = /*#__PURE__*/function () { } }]; } - _createClass__default["default"](MIMEMessageHeader, [{ key: "set", value: function set(name, value) { + this.validateLength(name, value); var _iterator = _createForOfIteratorHelper(this.store), - _step; - + _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { - var item = _step.value; - - if (item.name.toLowerCase() == name.toLowerCase()) { - item.value = value; - return item; + var _item = _step.value; + if (_item.name.toLowerCase() == name.toLowerCase()) { + _item.value = value; + return _item; } } } catch (err) { @@ -224,7 +217,6 @@ var MIMEMessageHeader = /*#__PURE__*/function () { } finally { _iterator.f(); } - var newHeader = { custom: true, placement: this.placement, @@ -237,18 +229,24 @@ var MIMEMessageHeader = /*#__PURE__*/function () { this.store.push(newHeader); return newHeader; } + }, { + key: "validateLength", + value: function validateLength(name, value) { + var len = name.length + value.length + 2; // 2 is ": " + if (len > this.maxLineLength) { + throw new MIMETextError('INVALID_HEADER', "The \"".concat(item.name, "\" header is too long. ")(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["", " chars allowed at max, \"", "\" was ", " long."])), this.maxLineLength, item.name, len)); + } + } }, { key: "get", value: function get(name) { var _iterator2 = _createForOfIteratorHelper(this.store), - _step2; - + _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var item = _step2.value; - - if (item.name.toLowerCase() == name.toLowerCase()) { - return item.value; + var _item2 = _step2.value; + if (_item2.name.toLowerCase() == name.toLowerCase()) { + return _item2.value; } } } catch (err) { @@ -256,15 +254,13 @@ var MIMEMessageHeader = /*#__PURE__*/function () { } finally { _iterator2.f(); } - return undefined; } }, { key: "toObject", value: function toObject() { - var _context3; - - return _reduceInstanceProperty__default["default"](_context3 = this.store).call(_context3, function (memo, item) { + var _context8; + return _reduceInstanceProperty__default["default"](_context8 = this.store).call(_context8, function (memo, item) { memo[item.name] = item.value; return memo; }, {}); @@ -277,46 +273,234 @@ var MIMEMessageHeader = /*#__PURE__*/function () { store: this.store }; var lines = ''; - var _iterator3 = _createForOfIteratorHelper(this.store), - _step3; - + _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { - var _context4; - - var item = _step3.value; - if (item.placement != this.placement) continue; - var v = item.value ? item.value : !item.disabled && typeof item.generator == 'function' ? item.generator(ctx) : null; - - if (!v && item.required) { - throw new MIMETextError('MISSING_HEADER', "The \"".concat(item.name, "\" header is required.")); + var _context9; + var _item3 = _step3.value; + if (_item3.placement != this.placement) continue; + var v = _item3.value ? _item3.value : !_item3.disabled && typeof _item3.generator == 'function' ? _item3.generator(ctx) : null; + if (!v && _item3.required) { + throw new MIMETextError('MISSING_HEADER', "The \"".concat(_item3.name, "\" header is required.")); } - if (!v) continue; - lines += _concatInstanceProperty__default["default"](_context4 = "".concat(item.name, ": ")).call(_context4, item.dump(v, ctx), "\r\n"); + lines += _concatInstanceProperty__default["default"](_context9 = "".concat(_item3.name, ": ")).call(_context9, _item3.dump(v, ctx), "\r\n"); } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } - return _sliceInstanceProperty__default["default"](lines).call(lines, 0, -2); } }]); - return MIMEMessageHeader; }(); +// Current version. + +// Establish the root object, `window` (`self`) in the browser, `global` +// on the server, or `this` in some virtual machines. We use `self` +// instead of `window` for `WebWorker` support. +(typeof self == 'object' && self.self === self && self) || + (typeof global == 'object' && global.global === global && global) || + Function('return this')() || + {}; + +// Save bytes in the minified (but not gzipped) version: +var ArrayProto = Array.prototype; + +// Create quick reference variables for speed access to core prototypes. +var slice = ArrayProto.slice; + +// Chunk a single array into multiple arrays, each containing `count` or fewer +// items. +function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; +} + +var runesExports = {}; +var runes$1 = { + get exports(){ return runesExports; }, + set exports(v){ runesExports = v; }, +}; + +const HIGH_SURROGATE_START = 0xd800; +const HIGH_SURROGATE_END = 0xdbff; + +const LOW_SURROGATE_START = 0xdc00; + +const REGIONAL_INDICATOR_START = 0x1f1e6; +const REGIONAL_INDICATOR_END = 0x1f1ff; + +const FITZPATRICK_MODIFIER_START = 0x1f3fb; +const FITZPATRICK_MODIFIER_END = 0x1f3ff; + +const VARIATION_MODIFIER_START = 0xfe00; +const VARIATION_MODIFIER_END = 0xfe0f; + +const DIACRITICAL_MARKS_START = 0x20d0; +const DIACRITICAL_MARKS_END = 0x20ff; + +const ZWJ = 0x200d; + +const GRAPHEMS = [ + 0x0308, // ( ◌̈ ) COMBINING DIAERESIS + 0x0937, // ( ष ) DEVANAGARI LETTER SSA + 0x0937, // ( ष ) DEVANAGARI LETTER SSA + 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I + 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I + 0x0BA8, // ( ந ) TAMIL LETTER NA + 0x0BBF, // ( ி ) TAMIL VOWEL SIGN I + 0x0BCD, // ( ◌்) TAMIL SIGN VIRAMA + 0x0E31, // ( ◌ั ) THAI CHARACTER MAI HAN-AKAT + 0x0E33, // ( ำ ) THAI CHARACTER SARA AM + 0x0E40, // ( เ ) THAI CHARACTER SARA E + 0x0E49, // ( เ ) THAI CHARACTER MAI THO + 0x1100, // ( ᄀ ) HANGUL CHOSEONG KIYEOK + 0x1161, // ( ᅡ ) HANGUL JUNGSEONG A + 0x11A8 // ( ᆨ ) HANGUL JONGSEONG KIYEOK +]; + +function runes (string) { + if (typeof string !== 'string') { + throw new Error('string cannot be undefined or null') + } + const result = []; + let i = 0; + let increment = 0; + while (i < string.length) { + increment += nextUnits(i + increment, string); + if (isGraphem(string[i + increment])) { + increment++; + } + if (isVariationSelector(string[i + increment])) { + increment++; + } + if (isDiacriticalMark(string[i + increment])) { + increment++; + } + if (isZeroWidthJoiner(string[i + increment])) { + increment++; + continue + } + result.push(string.substring(i, i + increment)); + i += increment; + increment = 0; + } + return result +} + +// Decide how many code units make up the current character. +// BMP characters: 1 code unit +// Non-BMP characters (represented by surrogate pairs): 2 code units +// Emoji with skin-tone modifiers: 4 code units (2 code points) +// Country flags: 4 code units (2 code points) +// Variations: 2 code units +function nextUnits (i, string) { + const current = string[i]; + // If we don't have a value that is part of a surrogate pair, or we're at + // the end, only take the value at i + if (!isFirstOfSurrogatePair(current) || i === string.length - 1) { + return 1 + } + + const currentPair = current + string[i + 1]; + let nextPair = string.substring(i + 2, i + 5); + + // Country flags are comprised of two regional indicator symbols, + // each represented by a surrogate pair. + // See http://emojipedia.org/flags/ + // If both pairs are regional indicator symbols, take 4 + if (isRegionalIndicator(currentPair) && isRegionalIndicator(nextPair)) { + return 4 + } + + // If the next pair make a Fitzpatrick skin tone + // modifier, take 4 + // See http://emojipedia.org/modifiers/ + // Technically, only some code points are meant to be + // combined with the skin tone modifiers. This function + // does not check the current pair to see if it is + // one of them. + if (isFitzpatrickModifier(nextPair)) { + return 4 + } + return 2 +} + +function isFirstOfSurrogatePair (string) { + return string && betweenInclusive(string[0].charCodeAt(0), HIGH_SURROGATE_START, HIGH_SURROGATE_END) +} + +function isRegionalIndicator (string) { + return betweenInclusive(codePointFromSurrogatePair(string), REGIONAL_INDICATOR_START, REGIONAL_INDICATOR_END) +} + +function isFitzpatrickModifier (string) { + return betweenInclusive(codePointFromSurrogatePair(string), FITZPATRICK_MODIFIER_START, FITZPATRICK_MODIFIER_END) +} + +function isVariationSelector (string) { + return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), VARIATION_MODIFIER_START, VARIATION_MODIFIER_END) +} + +function isDiacriticalMark (string) { + return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), DIACRITICAL_MARKS_START, DIACRITICAL_MARKS_END) +} + +function isGraphem (string) { + return typeof string === 'string' && GRAPHEMS.indexOf(string.charCodeAt(0)) !== -1 +} + +function isZeroWidthJoiner (string) { + return typeof string === 'string' && string.charCodeAt(0) === ZWJ +} + +function codePointFromSurrogatePair (pair) { + const highOffset = pair.charCodeAt(0) - HIGH_SURROGATE_START; + const lowOffset = pair.charCodeAt(1) - LOW_SURROGATE_START; + return (highOffset << 10) + lowOffset + 0x10000 +} + +function betweenInclusive (value, lower, upper) { + return value >= lower && value <= upper +} + +function substring (string, start, width) { + const chars = runes(string); + if (start === undefined) { + return string + } + if (start >= chars.length) { + return '' + } + const rest = chars.length - start; + const stringWidth = width === undefined ? rest : width; + let endIndex = start + stringWidth; + if (endIndex > (start + rest)) { + endIndex = undefined; + } + return chars.slice(start, endIndex).join('') +} + +runes$1.exports = runes; +runesExports.substr = substring; + var MIMEMessageContent = /*#__PURE__*/function () { function MIMEMessageContent(data) { _classCallCheck__default["default"](this, MIMEMessageContent); - + this.maxLineLen = 78; this.data = data; this.headers = new MIMEMessageHeader('content'); } - _createClass__default["default"](MIMEMessageContent, [{ key: "setHeader", value: function setHeader() { @@ -327,12 +511,10 @@ var MIMEMessageContent = /*#__PURE__*/function () { key: "setHeaders", value: function setHeaders(obj) { var _context, - _this = this; - + _this = this; _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](obj)).call(_context, function (prop) { return _this.setHeader(prop, obj[prop]); }); - return this; } }, { @@ -351,23 +533,31 @@ var MIMEMessageContent = /*#__PURE__*/function () { var d = this.headers.get('Content-Disposition'); return d && _indexOfInstanceProperty__default["default"](d).call(d, 'attachment') !== -1 ? true : false; } + }, { + key: "configureLineLength", + value: function configureLineLength(text) { + var _context2, + _this2 = this; + return _mapInstanceProperty__default["default"](_context2 = text.split(/[\r\n]+/)).call(_context2, function (line) { + var _context3; + return !line ? '' : _mapInstanceProperty__default["default"](_context3 = chunk(runesExports(line), _this2.maxLineLen)).call(_context3, function (arr) { + return arr.join(''); + }).join("\r\n"); + }).join("\r\n"); + } }, { key: "dump", value: function dump(envctx, boundaries) { var headerBlock = this.headers.dump(envctx); - if (this.isAttachment()) { - var _context2, _context3; - - return _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "--".concat(boundaries.mixed, "\n")).call(_context3, headerBlock, "\n\n")).call(_context2, this.data, "\n"); + var _context4, _context5; + return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "--".concat(boundaries.mixed, "\n")).call(_context5, headerBlock, "\n\n")).call(_context4, this.configureLineLength(this.data), "\n"); } else { - var _context4; - - return _concatInstanceProperty__default["default"](_context4 = "".concat(headerBlock, "\r\n\r\n")).call(_context4, this.data); + var _context6; + return _concatInstanceProperty__default["default"](_context6 = "".concat(headerBlock, "\r\n\r\n")).call(_context6, this.configureLineLength(this.data)); } } }]); - return MIMEMessageContent; }(); @@ -376,9 +566,7 @@ var Mailbox = /*#__PURE__*/function () { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { type: 'to' }; - _classCallCheck__default["default"](this, Mailbox); - this.reSpecCompliantAddr = /(([^<>\n\r]+)\s)?<[^\n\r]+>/; this.name = null; this.addr = null; @@ -387,7 +575,6 @@ var Mailbox = /*#__PURE__*/function () { this.inputType = this.findInputType(input); this.createMailbox(); } - _createClass__default["default"](Mailbox, [{ key: "findInputType", value: function findInputType(input) { @@ -395,7 +582,6 @@ var Mailbox = /*#__PURE__*/function () { if (!input.addr) { throw new MIMETextError('INVALID_MAILBOX', "\n The input should have an \"addr\" property that specifies the email address of the recipient.\n "); } - return 'OBJECT'; } else if (this.reSpecCompliantAddr.test(input)) { return 'SPEC_COMPLIANT_TEXT'; @@ -409,15 +595,12 @@ var Mailbox = /*#__PURE__*/function () { key: "parseSpecCompliantText", value: function parseSpecCompliantText(text) { var _context, _context2, _context3; - text = _trimInstanceProperty__default["default"](text).call(text); - if (_sliceInstanceProperty__default["default"](text).call(text, 0, 1) == '<' && _sliceInstanceProperty__default["default"](text).call(text, -1) == '>') { return { addr: _sliceInstanceProperty__default["default"](text).call(text, 1, -1) }; } - var arr = text.split(' <'); arr[0] = /^("|')/.test(arr[0]) ? _sliceInstanceProperty__default["default"](_context = arr[0]).call(_context, 1) : arr[0]; arr[0] = /("|')$/.test(arr[0]) ? _sliceInstanceProperty__default["default"](_context2 = arr[0]).call(_context2, 0, -1) : arr[0]; @@ -436,13 +619,11 @@ var Mailbox = /*#__PURE__*/function () { this.name = this.input.name || null; this.type = this.input.type || this.type; break; - case 'SPEC_COMPLIANT_TEXT': var obj = this.parseSpecCompliantText(this.input); this.addr = obj.addr; this.name = obj.name || null; break; - case 'TEXT': this.addr = this.input; break; @@ -454,20 +635,16 @@ var Mailbox = /*#__PURE__*/function () { if (!this.addr) { return ''; } - return this.addr.split('@')[1]; } }, { key: "dump", value: function dump() { var result = "<".concat(this.addr, ">"); - if (this.name) { var _context4; - result = _concatInstanceProperty__default["default"](_context4 = "\"".concat(this.name, "\" ")).call(_context4, result); } - return result; } }, { @@ -480,25 +657,21 @@ var Mailbox = /*#__PURE__*/function () { }; } }]); - return Mailbox; }(); var MIMEMessage = /*#__PURE__*/function () { function MIMEMessage(envctx) { _classCallCheck__default["default"](this, MIMEMessage); - this.envctx = envctx; this.headers = new MIMEMessageHeader('header'); this.messages = []; this.generateBoundaries(); } - _createClass__default["default"](MIMEMessage, [{ key: "generateBoundaries", value: function generateBoundaries() { var _context, _context2; - this.boundaries = { mixed: _sliceInstanceProperty__default["default"](_context = Math.random().toString(36)).call(_context, 2), alt: _sliceInstanceProperty__default["default"](_context2 = Math.random().toString(36)).call(_context2, 2) @@ -525,7 +698,6 @@ var MIMEMessage = /*#__PURE__*/function () { type: 'to' }; var recs = []; - if (Array.isArray(input)) { _mapInstanceProperty__default["default"](input).call(input, function (input) { return recs.push(new Mailbox(input, opts)); @@ -533,7 +705,6 @@ var MIMEMessage = /*#__PURE__*/function () { } else { recs.push(new Mailbox(input, opts)); } - this.setHeader(opts.type, recs); return recs; } @@ -599,12 +770,10 @@ var MIMEMessage = /*#__PURE__*/function () { key: "setHeaders", value: function setHeaders(obj) { var _context3, - _this = this; - + _this = this; _mapInstanceProperty__default["default"](_context3 = _Object$keys__default["default"](obj)).call(_context3, function (prop) { return _this.setHeader(prop, obj[prop]); }); - return this; } }, { @@ -617,17 +786,13 @@ var MIMEMessage = /*#__PURE__*/function () { value: function setMessage(type, data) { var moreHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var validTypes = ['text/html', 'text/plain']; - if (_indexOfInstanceProperty__default["default"](validTypes).call(validTypes, type) === -1) { var _context4; - throw new MIMETextError('INVALID_MESSAGE_TYPE', _concatInstanceProperty__default["default"](_context4 = "\n Invalid content type for the message. Supported content types are ".concat(validTypes.join(', '), " but you specified \"")).call(_context4, type, "\".\n ")); } - var headers = _Object$assign__default["default"]({}, moreHeaders, { 'Content-Type': "".concat(type, "; charset=UTF-8") }); - var msg = new MIMEMessageContent(data); msg.setHeaders(headers); this.messages.push(msg); @@ -637,13 +802,11 @@ var MIMEMessage = /*#__PURE__*/function () { key: "setAttachment", value: function setAttachment(filename, type, data) { var moreHeaders = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var headers = _Object$assign__default["default"]({}, moreHeaders, { 'Content-Type': "".concat(type, "; charset=UTF-8"), 'Content-Transfer-Encoding': 'base64', 'Content-Disposition': "attachment;filename=\"".concat(filename, "\"") }); - var msg = new MIMEMessageContent(data); msg.setHeaders(headers); this.messages.push(msg); @@ -653,13 +816,10 @@ var MIMEMessage = /*#__PURE__*/function () { key: "getMessageByType", value: function getMessageByType(type) { var _context5; - var matches = _filterInstanceProperty__default["default"](_context5 = this.messages).call(_context5, function (m) { var _context6; - return _indexOfInstanceProperty__default["default"](_context6 = m.getHeader('Content-Type')).call(_context6, type) !== -1; }); - if (Array.isArray(matches) && matches.length > 0) { return matches[0]; } else { @@ -670,7 +830,6 @@ var MIMEMessage = /*#__PURE__*/function () { key: "getAttachments", value: function getAttachments() { var _context7; - return _filterInstanceProperty__default["default"](_context7 = this.messages).call(_context7, function (m) { return m.isAttachment() === true; }) || []; @@ -683,16 +842,7 @@ var MIMEMessage = /*#__PURE__*/function () { var htmlMessage = this.getMessageByType('text/html'); var hasAttachments = this.getAttachments().length > 0; var hasPlainTextAlt = plainTextMessage instanceof MIMEMessageContent && htmlMessage instanceof MIMEMessageContent; - - if (hasAttachments && hasPlainTextAlt) { - return this.asRawMixedAlt(lines); - } else if (hasAttachments) { - return this.asRawMixed(lines); - } else if (hasPlainTextAlt) { - return this.asRawAlt(lines); - } else { - return this.asRawMessage(lines); - } + if (hasAttachments && hasPlainTextAlt) return this.asRawMixedAlt(lines);else if (hasAttachments) return this.asRawMixed(lines);else if (hasPlainTextAlt) return this.asRawAlt(lines);else return this.asRawMessage(lines); } }, { key: "asEncoded", @@ -703,7 +853,6 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawMessage", value: function asRawMessage(lines) { var _context8; - var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); var message = htmlMessage || plainTextMessage; @@ -714,7 +863,6 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawAlt", value: function asRawAlt(lines) { var _context9, _context10, _context11, _context12, _context13, _context14; - var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); lines = _concatInstanceProperty__default["default"](_context9 = _concatInstanceProperty__default["default"](_context10 = _concatInstanceProperty__default["default"](_context11 = _concatInstanceProperty__default["default"](_context12 = _concatInstanceProperty__default["default"](_context13 = _concatInstanceProperty__default["default"](_context14 = "".concat(lines, "\nContent-Type: multipart/alternative; boundary=")).call(_context14, this.boundaries.alt, "\n\n--")).call(_context13, this.boundaries.alt, "\n")).call(_context12, plainTextMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context11, this.boundaries.alt, "\n")).call(_context10, htmlMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context9, this.boundaries.alt, "--"); @@ -724,21 +872,18 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawMixed", value: function asRawMixed(lines) { var _context15, - _this2 = this, - _context16, - _context17, - _context18, - _context19, - _context20; - + _this2 = this, + _context16, + _context17, + _context18, + _context19, + _context20; var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); var message = htmlMessage || plainTextMessage; - var attachments = _mapInstanceProperty__default["default"](_context15 = this.getAttachments()).call(_context15, function (a) { return a.dump(_this2.envctx, _this2.boundaries); }).join('').replace(/[\r\n]$/g, ''); - lines = _concatInstanceProperty__default["default"](_context16 = _concatInstanceProperty__default["default"](_context17 = _concatInstanceProperty__default["default"](_context18 = _concatInstanceProperty__default["default"](_context19 = _concatInstanceProperty__default["default"](_context20 = "".concat(lines, "\nContent-Type: multipart/mixed; boundary=")).call(_context20, this.boundaries.mixed, "\n\n--")).call(_context19, this.boundaries.mixed, "\n")).call(_context18, message.dump(this.envctx, this.boundaries), "\n\n")).call(_context17, attachments, "\n\n--")).call(_context16, this.boundaries.mixed, "--"); return lines; } @@ -746,25 +891,22 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawMixedAlt", value: function asRawMixedAlt(lines) { var _context21, - _this3 = this, - _context22, - _context23, - _context24, - _context25, - _context26, - _context27, - _context28, - _context29, - _context30, - _context31; - + _this3 = this, + _context22, + _context23, + _context24, + _context25, + _context26, + _context27, + _context28, + _context29, + _context30, + _context31; var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); - var attachments = _mapInstanceProperty__default["default"](_context21 = this.getAttachments()).call(_context21, function (a) { return a.dump(_this3.envctx, _this3.boundaries); }).join('').replace(/[\r\n]$/g, ''); - lines = _concatInstanceProperty__default["default"](_context22 = _concatInstanceProperty__default["default"](_context23 = _concatInstanceProperty__default["default"](_context24 = _concatInstanceProperty__default["default"](_context25 = _concatInstanceProperty__default["default"](_context26 = _concatInstanceProperty__default["default"](_context27 = _concatInstanceProperty__default["default"](_context28 = _concatInstanceProperty__default["default"](_context29 = _concatInstanceProperty__default["default"](_context30 = _concatInstanceProperty__default["default"](_context31 = "".concat(lines, "\nContent-Type: multipart/mixed; boundary=")).call(_context31, this.boundaries.mixed, "\n\n--")).call(_context30, this.boundaries.mixed, "\nContent-Type: multipart/alternative; boundary=")).call(_context29, this.boundaries.alt, "\n\n--")).call(_context28, this.boundaries.alt, "\n")).call(_context27, plainTextMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context26, this.boundaries.alt, "\n")).call(_context25, htmlMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context24, this.boundaries.alt, "--\n")).call(_context23, attachments, "\n\n--")).call(_context22, this.boundaries.mixed, "--"); return lines; } @@ -774,12 +916,10 @@ var MIMEMessage = /*#__PURE__*/function () { return this.envctx.toBase64(v); } }]); - return MIMEMessage; }(); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; } - function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } } var envctx = { toBase64: function toBase64(data) { @@ -789,21 +929,15 @@ var envctx = { return btoa(data).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); } }; - var NodeMIMEMessage = /*#__PURE__*/function (_MIMEMessage) { _inherits__default["default"](NodeMIMEMessage, _MIMEMessage); - var _super = _createSuper(NodeMIMEMessage); - function NodeMIMEMessage() { _classCallCheck__default["default"](this, NodeMIMEMessage); - return _super.call(this, envctx); } - return _createClass__default["default"](NodeMIMEMessage); }(MIMEMessage); - function createMimeMessage() { return new NodeMIMEMessage(); } diff --git a/dist/browser/cjs/index.js.map b/dist/browser/cjs/index.js.map index 930264f..8316277 100644 --- a/dist/browser/cjs/index.js.map +++ b/dist/browser/cjs/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../../src/MIMETextError.js","../../../src/MIMEMessageHeader.js","../../../src/MIMEMessageContent.js","../../../src/Mailbox.js","../../../src/MIMEMessage.js","../../../src/entrypoints/browser.js"],"sourcesContent":["export default class MIMETextError extends Error {\n constructor(message, description) {\n super(message)\n this.description = description ? description.trim().replace(/[\\s]{2,}/, ' ') : null\n this.name = 'MIMETextError'\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\n/*\n* Headers are based on: https://www.rfc-editor.org/rfc/rfc4021#section-2.1\n* (Some are ignored as they can be added later or as a custom header.)\n*/\n\nexport default class MIMEMessageHeader {\n constructor(placement) {\n this.placement = placement\n this.store = [\n {\n placement: 'header',\n name: 'Date',\n // value property is what user sets for this header\n value: null,\n // the generator function generates a value for this header unless\n // user specified a value or user disabled this property\n generator: () => (new Date().toGMTString()).replace(/GMT|UTC/gi, '+0000'),\n disabled: false,\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'From',\n // required property indicates that this property must be set\n required: true,\n dump: (v) => {\n return v.dump()\n }\n },\n {\n placement: 'header',\n name: 'Sender',\n dump: (v) => {\n return v.dump()\n }\n },\n {\n placement: 'header',\n name: 'Reply-To',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'To',\n required: true,\n dump: (vs) => {\n return vs.map(v => v.dump()).join(', ')\n }\n },\n {\n placement: 'header',\n name: 'Cc',\n dump: (vs) => {\n return vs.map(v => v.dump()).join(', ')\n }\n },\n {\n placement: 'header',\n name: 'Bcc',\n dump: (vs) => {\n return vs.map(v => v.dump()).join(', ')\n }\n },\n {\n placement: 'header',\n name: 'Message-ID',\n disabled: false,\n generator: (ctx) => {\n const datestr = Date.now().toString()\n const randomstr = Math.random().toString(36).slice(2)\n const domain = ctx.store.filter(item => item.name == 'From')[0].value.getAddrDomain()\n return '<' + randomstr + '-' + datestr + '@' + domain + '>'\n },\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'Subject',\n required: true,\n dump: (v, ctx) => {\n return '=?utf-8?B?' + ctx.toBase64(v) + '?='\n }\n },\n {\n placement: 'header',\n name: 'MIME-Version',\n generator: () => '1.0',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-ID',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Type',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Transfer-Encoding',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Disposition',\n dump: (v) => {\n return v\n }\n }\n ]\n }\n\n set(name, value) {\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n item.value = value\n return item\n }\n }\n\n const newHeader = {\n custom: true,\n placement: this.placement,\n name: name,\n value: value,\n dump: (v) => {\n return v\n }\n }\n\n this.store.push(newHeader)\n\n return newHeader\n }\n\n get(name) {\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n return item.value\n }\n }\n return undefined\n }\n\n toObject() {\n return this.store.reduce((memo, item) => {\n memo[item.name] = item.value\n return memo\n }, {})\n }\n\n dump(envctx) {\n const ctx = {\n toBase64: envctx.toBase64,\n store: this.store\n }\n\n let lines = ''\n for (const item of this.store) {\n if (item.placement != this.placement) continue;\n\n const v = item.value\n ? item.value\n : !item.disabled && typeof item.generator == 'function'\n ? item.generator(ctx)\n : null\n\n if (!v && item.required) {\n throw new MIMETextError('MISSING_HEADER', `The \"${item.name}\" header is required.`)\n }\n\n if (!v) continue;\n\n lines += `${item.name}: ${item.dump(v, ctx)}\\r\\n`\n }\n\n return lines.slice(0, -2)\n }\n}\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\n\nexport default class MIMEMessageContent {\n constructor(data) {\n this.data = data\n this.headers = new MIMEMessageHeader('content')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return this\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n isAttachment() {\n const d = this.headers.get('Content-Disposition')\n return d && d.indexOf('attachment') !== -1 ? true : false\n }\n\n dump(envctx, boundaries) {\n const headerBlock = this.headers.dump(envctx)\n\n if (this.isAttachment()) {\n return `--${boundaries.mixed}\n${headerBlock}\n\n${this.data}\n`\n }\n else {\n return `${headerBlock}\\r\\n\\r\\n${this.data}`\n }\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\nexport default class Mailbox {\n constructor(input, opts={type: 'to'}) {\n this.reSpecCompliantAddr = /(([^<>\\n\\r]+)\\s)?<[^\\n\\r]+>/\n\n this.name = null\n this.addr = null\n this.type = opts.type || 'to'\n this.input = input\n this.inputType = this.findInputType(input)\n\n this.createMailbox()\n }\n\n findInputType(input) {\n if (Object.prototype.toString.call(input) === '[object Object]') {\n if (!input.addr) {\n throw new MIMETextError('INVALID_MAILBOX', `\n The input should have an \"addr\" property that specifies the email address \\\n of the recipient.\n `)\n }\n return 'OBJECT'\n }\n else if (this.reSpecCompliantAddr.test(input)) {\n return 'SPEC_COMPLIANT_TEXT'\n }\n else if (typeof input == 'string') {\n return 'TEXT'\n }\n else {\n throw new MIMETextError('INVALID_MAILBOX')\n }\n }\n\n parseSpecCompliantText(text) {\n text = text.trim()\n\n if (text.slice(0, 1) == '<' && text.slice(-1) == '>') {\n return {addr: text.slice(1, -1)}\n }\n\n const arr = text.split(' <')\n arr[0] = /^(\"|')/.test(arr[0]) ? arr[0].slice(1) : arr[0]\n arr[0] = /(\"|')$/.test(arr[0]) ? arr[0].slice(0, -1) : arr[0]\n arr[1] = arr[1].slice(0, -1)\n\n return {name: arr[0], addr: arr[1]}\n }\n\n createMailbox() {\n switch (this.inputType) {\n case 'OBJECT':\n this.addr = this.input.addr\n this.name = this.input.name || null\n this.type = this.input.type || this.type\n break;\n\n case 'SPEC_COMPLIANT_TEXT':\n const obj = this.parseSpecCompliantText(this.input)\n this.addr = obj.addr\n this.name = obj.name || null\n break;\n\n case 'TEXT':\n this.addr = this.input\n break;\n\n default:\n break;\n }\n }\n\n getAddrDomain() {\n if (!this.addr) {\n return ''\n }\n\n return this.addr.split('@')[1]\n }\n\n dump() {\n let result = `<${this.addr}>`\n\n if (this.name) {\n result = `\"${this.name}\" ${result}`\n }\n\n return result\n }\n\n toObject() {\n return {\n name: this.name,\n addr: this.addr,\n type: this.type\n }\n }\n}\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\nimport MIMEMessageContent from './MIMEMessageContent.js'\nimport MIMETextError from './MIMETextError.js'\nimport Mailbox from './Mailbox.js'\n\nexport default class MIMEMessage {\n constructor(envctx) {\n this.envctx = envctx\n this.headers = new MIMEMessageHeader('header')\n this.messages = []\n\n this.generateBoundaries()\n }\n\n generateBoundaries() {\n this.boundaries = {\n mixed: Math.random().toString(36).slice(2),\n alt: Math.random().toString(36).slice(2)\n }\n }\n\n setSender(input) {\n const mailbox = new Mailbox(input, {type: 'from'})\n\n this.setHeader('From', mailbox)\n\n return mailbox\n }\n\n getSender() {\n return this.getHeader('From')\n }\n\n setRecipients(input, opts={type: 'to'}) {\n const recs = []\n\n if (Array.isArray(input)) {\n input.map(input => recs.push( new Mailbox(input, opts) ))\n }\n else {\n recs.push( new Mailbox(input, opts) )\n }\n\n this.setHeader(opts.type, recs)\n\n return recs\n }\n\n getRecipients(opts={type: 'to'}) {\n return this.getHeader(opts.type) || []\n }\n\n setRecipient(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setTo(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setCc(input) {\n return this.setRecipients(input, {type: 'cc'})\n }\n\n setBcc(input) {\n return this.setRecipients(input, {type: 'bcc'})\n }\n\n setSubject(value) {\n this.setHeader('subject', value)\n return value\n }\n\n getSubject() {\n return this.getHeader('subject')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return arguments[0]\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n setMessage(type, data, moreHeaders={}) {\n const validTypes = ['text/html', 'text/plain']\n\n if (validTypes.indexOf(type) === -1) {\n throw new MIMETextError('INVALID_MESSAGE_TYPE', `\n Invalid content type for the message. Supported content types \\\n are ${validTypes.join(', ')} but you specified \"${type}\".\n `)\n }\n\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return msg\n }\n\n setAttachment(filename, type, data, moreHeaders={}) {\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`,\n 'Content-Transfer-Encoding': 'base64',\n 'Content-Disposition': `attachment;filename=\"${filename}\"`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return this\n }\n\n getMessageByType(type) {\n const matches = this.messages.filter(m => m.getHeader('Content-Type').indexOf(type) !== -1)\n if (Array.isArray(matches) && matches.length > 0) {\n return matches[0]\n }\n else {\n return undefined\n }\n }\n\n getAttachments() {\n return this.messages.filter(m => m.isAttachment() === true) || []\n }\n\n asRaw() {\n let lines = this.headers.dump(this.envctx)\n\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const hasAttachments = this.getAttachments().length > 0\n const hasPlainTextAlt = plainTextMessage instanceof MIMEMessageContent && htmlMessage instanceof MIMEMessageContent\n\n if (hasAttachments && hasPlainTextAlt) {\n return this.asRawMixedAlt(lines)\n }\n else if (hasAttachments) {\n return this.asRawMixed(lines)\n }\n else if (hasPlainTextAlt) {\n return this.asRawAlt(lines)\n }\n else {\n return this.asRawMessage(lines)\n }\n }\n\n asEncoded() {\n return this.envctx.toBase64WebSafe( this.asRaw() )\n }\n\n asRawMessage(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n\n lines = `${lines}\n${message.dump(this.envctx, this.boundaries)}`\n\n return lines\n }\n\n asRawAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n\n lines = `${lines}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--`\n\n return lines\n }\n\n asRawMixed(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\n${message.dump(this.envctx, this.boundaries)}\n\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n asRawMixedAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n toBase64(v) {\n return this.envctx.toBase64(v)\n }\n}\n","import MIMEMessage from '../MIMEMessage.js'\n\nconst envctx = {\n toBase64: function toBase64(data) {\n return btoa(data)\n },\n toBase64WebSafe: function toBase64WebSafe(data) {\n return btoa(data)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '')\n }\n}\n\nclass NodeMIMEMessage extends MIMEMessage {\n constructor() {\n super(envctx)\n }\n}\n\nexport function createMimeMessage() {\n return new NodeMIMEMessage()\n}\n"],"names":["MIMETextError","message","description","_classCallCheck","_trimInstanceProperty","replace","name","Error","MIMEMessageHeader","placement","store","value","generator","Date","toGMTString","disabled","dump","v","required","vs","_mapInstanceProperty","join","ctx","datestr","now","toString","randomstr","_sliceInstanceProperty","Math","random","domain","_filterInstanceProperty","item","getAddrDomain","toBase64","toLowerCase","newHeader","custom","push","undefined","_reduceInstanceProperty","memo","envctx","lines","MIMEMessageContent","data","headers","set","arguments","obj","prop","setHeader","toObject","get","d","_indexOfInstanceProperty","boundaries","headerBlock","isAttachment","_concatInstanceProperty","mixed","Mailbox","input","opts","type","reSpecCompliantAddr","addr","inputType","findInputType","createMailbox","Object","prototype","call","test","text","arr","split","parseSpecCompliantText","result","MIMEMessage","messages","generateBoundaries","alt","mailbox","getHeader","recs","Array","isArray","setRecipients","moreHeaders","validTypes","_Object$assign","msg","setHeaders","filename","matches","m","length","plainTextMessage","getMessageByType","htmlMessage","hasAttachments","getAttachments","hasPlainTextAlt","asRawMixedAlt","asRawMixed","asRawAlt","asRawMessage","toBase64WebSafe","asRaw","attachments","a","btoa","NodeMIMEMessage","createMimeMessage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAqBA;;;;;EACnB,SAAYC,aAAAA,CAAAA,OAAZ,EAAqBC,WAArB,EAAkC;AAAA,IAAA,IAAA,KAAA,CAAA;;AAAA,IAAAC,mCAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;;AAChC,IAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAMF,OAAN,CAAA,CAAA;AACA,IAAA,KAAA,CAAKC,WAAL,GAAmBA,WAAW,GAAGE,yCAAA,CAAAF,WAAW,CAAX,CAAA,IAAA,CAAAA,WAAW,CAAA,CAAQG,OAAnB,CAA2B,UAA3B,EAAuC,GAAvC,CAAH,GAAiD,IAA/E,CAAA;IACA,KAAKC,CAAAA,IAAL,GAAY,eAAZ,CAAA;AAHgC,IAAA,OAAA,KAAA,CAAA;AAIjC,GAAA;;;qDALwCC;;;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J,EACW,GADX,CAAA,CAEJA,OAFI,CAEI,KAFJ,EAEW,GAFX,CAAA,CAGJA,OAHI,CAGI,KAHJ,EAGW,EAHX,CAAP,CAAA;AAID,GAAA;AATY,CAAf,CAAA;;IAYM4G;;;;;EACJ,SAAc,eAAA,GAAA;AAAA,IAAA9G,mCAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;;AAAA,IAAA,OAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EACNuC,MADM,CAAA,CAAA;AAEb,GAAA;;;EAH2BqC;;AAMvB,SAASmC,iBAAT,GAA6B;EAClC,OAAO,IAAID,eAAJ,EAAP,CAAA;AACD;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../../../src/MIMETextError.js","../../../src/MIMEMessageHeader.js","../../../node_modules/underscore/modules/_setup.js","../../../node_modules/underscore/modules/chunk.js","../../../node_modules/runes/index.js","../../../src/MIMEMessageContent.js","../../../src/Mailbox.js","../../../src/MIMEMessage.js","../../../src/entrypoints/browser.js"],"sourcesContent":["export default class MIMETextError extends Error {\n constructor(message, description) {\n super(message)\n this.description = description ? description.trim().replace(/[\\s]{2,}/, ' ') : null\n this.name = 'MIMETextError'\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\n/*\n* Headers are based on: https://www.rfc-editor.org/rfc/rfc4021#section-2.1\n* (Some are ignored as they can be added later or as a custom header.)\n*/\n\nexport default class MIMEMessageHeader {\n constructor(placement) {\n this.maxLineLength = 998\n this.placement = placement\n this.store = [\n {\n placement: 'header',\n name: 'Date',\n // value property is what user sets for this header\n value: null,\n // the generator function generates a value for this header unless\n // user specified a value or user disabled this property\n generator: () => (new Date().toGMTString()).replace(/GMT|UTC/gi, '+0000'),\n disabled: false,\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'From',\n required: true,\n dump: (v, ctx) => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`\n },\n {\n placement: 'header',\n name: 'Sender',\n dump: (v, ctx) => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`\n },\n {\n placement: 'header',\n name: 'Reply-To',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'To',\n // INFO: \"To\" field is not required according to the RFC-2822\n //required: true,\n dump: (arr, ctx) => arr.map(v => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`).join(\",\\n \")\n },\n {\n placement: 'header',\n name: 'Cc',\n dump: (arr, ctx) => arr.map(v => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`).join(\",\\n \")\n },\n {\n placement: 'header',\n name: 'Bcc',\n dump: (arr, ctx) => arr.map(v => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`).join(\",\\n \")\n },\n {\n placement: 'header',\n name: 'Message-ID',\n disabled: false,\n generator: (ctx) => {\n const datestr = Date.now().toString()\n const randomstr = Math.random().toString(36).slice(2)\n const domain = ctx.store.filter(item => item.name == 'From')[0].value.getAddrDomain()\n return '<' + randomstr + '-' + datestr + '@' + domain + '>'\n },\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'Subject',\n required: true,\n dump: (v, ctx) => '=?utf-8?B?' + ctx.toBase64(v) + '?='\n },\n {\n placement: 'header',\n name: 'MIME-Version',\n generator: () => '1.0',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-ID',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Type',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Transfer-Encoding',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Disposition',\n dump: (v) => {\n return v\n }\n }\n ]\n }\n\n set(name, value) {\n this.validateLength(name, value)\n\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n item.value = value\n return item\n }\n }\n\n const newHeader = {\n custom: true,\n placement: this.placement,\n name: name,\n value: value,\n dump: (v) => {\n return v\n }\n }\n\n this.store.push(newHeader)\n\n return newHeader\n }\n\n validateLength(name, value) {\n const len = name.length + value.length + 2 // 2 is \": \"\n if (len > this.maxLineLength) {\n throw new MIMETextError('INVALID_HEADER', `The \"${item.name}\" header is too long. `\n `${this.maxLineLength} chars allowed at max, \"${item.name}\" was ${len} long.`)\n }\n }\n\n get(name) {\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n return item.value\n }\n }\n return undefined\n }\n\n toObject() {\n return this.store.reduce((memo, item) => {\n memo[item.name] = item.value\n return memo\n }, {})\n }\n\n dump(envctx) {\n const ctx = {\n toBase64: envctx.toBase64,\n store: this.store\n }\n\n let lines = ''\n for (const item of this.store) {\n if (item.placement != this.placement) continue;\n\n const v = item.value\n ? item.value\n : !item.disabled && typeof item.generator == 'function'\n ? item.generator(ctx)\n : null\n\n if (!v && item.required) {\n throw new MIMETextError('MISSING_HEADER', `The \"${item.name}\" header is required.`)\n }\n\n if (!v) continue;\n\n lines += `${item.name}: ${item.dump(v, ctx)}\\r\\n`\n }\n\n return lines.slice(0, -2)\n }\n}\n","// Current version.\nexport var VERSION = '1.13.6';\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\nexport var root = (typeof self == 'object' && self.self === self && self) ||\n (typeof global == 'object' && global.global === global && global) ||\n Function('return this')() ||\n {};\n\n// Save bytes in the minified (but not gzipped) version:\nexport var ArrayProto = Array.prototype, ObjProto = Object.prototype;\nexport var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n// Create quick reference variables for speed access to core prototypes.\nexport var push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n// Modern feature detection.\nexport var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',\n supportsDataView = typeof DataView !== 'undefined';\n\n// All **ECMAScript 5+** native function implementations that we hope to use\n// are declared here.\nexport var nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create,\n nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n// Create references to these builtin functions because we override them.\nexport var _isNaN = isNaN,\n _isFinite = isFinite;\n\n// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\nexport var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\nexport var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n// The largest integer that can be represented exactly.\nexport var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n","import { slice } from './_setup.js';\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport default function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n","'use strict'\n\nconst HIGH_SURROGATE_START = 0xd800\nconst HIGH_SURROGATE_END = 0xdbff\n\nconst LOW_SURROGATE_START = 0xdc00\n\nconst REGIONAL_INDICATOR_START = 0x1f1e6\nconst REGIONAL_INDICATOR_END = 0x1f1ff\n\nconst FITZPATRICK_MODIFIER_START = 0x1f3fb\nconst FITZPATRICK_MODIFIER_END = 0x1f3ff\n\nconst VARIATION_MODIFIER_START = 0xfe00\nconst VARIATION_MODIFIER_END = 0xfe0f\n\nconst DIACRITICAL_MARKS_START = 0x20d0\nconst DIACRITICAL_MARKS_END = 0x20ff\n\nconst ZWJ = 0x200d\n\nconst GRAPHEMS = [\n 0x0308, // ( ◌̈ ) COMBINING DIAERESIS\n 0x0937, // ( ष ) DEVANAGARI LETTER SSA\n 0x0937, // ( ष ) DEVANAGARI LETTER SSA\n 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I\n 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I\n 0x0BA8, // ( ந ) TAMIL LETTER NA\n 0x0BBF, // ( ி ) TAMIL VOWEL SIGN I\n 0x0BCD, // ( ◌்) TAMIL SIGN VIRAMA\n 0x0E31, // ( ◌ั ) THAI CHARACTER MAI HAN-AKAT\n 0x0E33, // ( ำ ) THAI CHARACTER SARA AM\n 0x0E40, // ( เ ) THAI CHARACTER SARA E\n 0x0E49, // ( เ ) THAI CHARACTER MAI THO\n 0x1100, // ( ᄀ ) HANGUL CHOSEONG KIYEOK\n 0x1161, // ( ᅡ ) HANGUL JUNGSEONG A\n 0x11A8 // ( ᆨ ) HANGUL JONGSEONG KIYEOK\n]\n\nfunction runes (string) {\n if (typeof string !== 'string') {\n throw new Error('string cannot be undefined or null')\n }\n const result = []\n let i = 0\n let increment = 0\n while (i < string.length) {\n increment += nextUnits(i + increment, string)\n if (isGraphem(string[i + increment])) {\n increment++\n }\n if (isVariationSelector(string[i + increment])) {\n increment++\n }\n if (isDiacriticalMark(string[i + increment])) {\n increment++\n }\n if (isZeroWidthJoiner(string[i + increment])) {\n increment++\n continue\n }\n result.push(string.substring(i, i + increment))\n i += increment\n increment = 0\n }\n return result\n}\n\n// Decide how many code units make up the current character.\n// BMP characters: 1 code unit\n// Non-BMP characters (represented by surrogate pairs): 2 code units\n// Emoji with skin-tone modifiers: 4 code units (2 code points)\n// Country flags: 4 code units (2 code points)\n// Variations: 2 code units\nfunction nextUnits (i, string) {\n const current = string[i]\n // If we don't have a value that is part of a surrogate pair, or we're at\n // the end, only take the value at i\n if (!isFirstOfSurrogatePair(current) || i === string.length - 1) {\n return 1\n }\n\n const currentPair = current + string[i + 1]\n let nextPair = string.substring(i + 2, i + 5)\n\n // Country flags are comprised of two regional indicator symbols,\n // each represented by a surrogate pair.\n // See http://emojipedia.org/flags/\n // If both pairs are regional indicator symbols, take 4\n if (isRegionalIndicator(currentPair) && isRegionalIndicator(nextPair)) {\n return 4\n }\n\n // If the next pair make a Fitzpatrick skin tone\n // modifier, take 4\n // See http://emojipedia.org/modifiers/\n // Technically, only some code points are meant to be\n // combined with the skin tone modifiers. This function\n // does not check the current pair to see if it is\n // one of them.\n if (isFitzpatrickModifier(nextPair)) {\n return 4\n }\n return 2\n}\n\nfunction isFirstOfSurrogatePair (string) {\n return string && betweenInclusive(string[0].charCodeAt(0), HIGH_SURROGATE_START, HIGH_SURROGATE_END)\n}\n\nfunction isRegionalIndicator (string) {\n return betweenInclusive(codePointFromSurrogatePair(string), REGIONAL_INDICATOR_START, REGIONAL_INDICATOR_END)\n}\n\nfunction isFitzpatrickModifier (string) {\n return betweenInclusive(codePointFromSurrogatePair(string), FITZPATRICK_MODIFIER_START, FITZPATRICK_MODIFIER_END)\n}\n\nfunction isVariationSelector (string) {\n return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), VARIATION_MODIFIER_START, VARIATION_MODIFIER_END)\n}\n\nfunction isDiacriticalMark (string) {\n return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), DIACRITICAL_MARKS_START, DIACRITICAL_MARKS_END)\n}\n\nfunction isGraphem (string) {\n return typeof string === 'string' && GRAPHEMS.indexOf(string.charCodeAt(0)) !== -1\n}\n\nfunction isZeroWidthJoiner (string) {\n return typeof string === 'string' && string.charCodeAt(0) === ZWJ\n}\n\nfunction codePointFromSurrogatePair (pair) {\n const highOffset = pair.charCodeAt(0) - HIGH_SURROGATE_START\n const lowOffset = pair.charCodeAt(1) - LOW_SURROGATE_START\n return (highOffset << 10) + lowOffset + 0x10000\n}\n\nfunction betweenInclusive (value, lower, upper) {\n return value >= lower && value <= upper\n}\n\nfunction substring (string, start, width) {\n const chars = runes(string)\n if (start === undefined) {\n return string\n }\n if (start >= chars.length) {\n return ''\n }\n const rest = chars.length - start\n const stringWidth = width === undefined ? rest : width\n let endIndex = start + stringWidth\n if (endIndex > (start + rest)) {\n endIndex = undefined\n }\n return chars.slice(start, endIndex).join('')\n}\n\nmodule.exports = runes\nmodule.exports.substr = substring\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\nimport chunk from \"underscore/modules/chunk.js\";\nimport runes from \"runes\";\n\nexport default class MIMEMessageContent {\n constructor(data) {\n this.maxLineLen = 78\n this.data = data\n this.headers = new MIMEMessageHeader('content')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return this\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n isAttachment() {\n const d = this.headers.get('Content-Disposition')\n return d && d.indexOf('attachment') !== -1 ? true : false;\n }\n\n configureLineLength(text) {\n return text.split(/[\\r\\n]+/).map(line => !line ? '' : chunk(runes(line), this.maxLineLen).map(arr => arr.join('')).join(\"\\r\\n\")).join(\"\\r\\n\")\n }\n\n dump(envctx, boundaries) {\n const headerBlock = this.headers.dump(envctx)\n\n if (this.isAttachment()) {\n return `--${boundaries.mixed}\n${headerBlock}\n\n${this.configureLineLength(this.data)}\n`\n }\n else {\n return `${headerBlock}\\r\\n\\r\\n${this.configureLineLength(this.data)}`\n }\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\nexport default class Mailbox {\n constructor(input, opts={type: 'to'}) {\n this.reSpecCompliantAddr = /(([^<>\\n\\r]+)\\s)?<[^\\n\\r]+>/\n\n this.name = null\n this.addr = null\n this.type = opts.type || 'to'\n this.input = input\n this.inputType = this.findInputType(input)\n\n this.createMailbox()\n }\n\n findInputType(input) {\n if (Object.prototype.toString.call(input) === '[object Object]') {\n if (!input.addr) {\n throw new MIMETextError('INVALID_MAILBOX', `\n The input should have an \"addr\" property that specifies the email address \\\n of the recipient.\n `)\n }\n return 'OBJECT'\n }\n else if (this.reSpecCompliantAddr.test(input)) {\n return 'SPEC_COMPLIANT_TEXT'\n }\n else if (typeof input == 'string') {\n return 'TEXT'\n }\n else {\n throw new MIMETextError('INVALID_MAILBOX')\n }\n }\n\n parseSpecCompliantText(text) {\n text = text.trim()\n\n if (text.slice(0, 1) == '<' && text.slice(-1) == '>') {\n return {addr: text.slice(1, -1)}\n }\n\n const arr = text.split(' <')\n arr[0] = /^(\"|')/.test(arr[0]) ? arr[0].slice(1) : arr[0]\n arr[0] = /(\"|')$/.test(arr[0]) ? arr[0].slice(0, -1) : arr[0]\n arr[1] = arr[1].slice(0, -1)\n\n return {name: arr[0], addr: arr[1]}\n }\n\n createMailbox() {\n switch (this.inputType) {\n case 'OBJECT':\n this.addr = this.input.addr\n this.name = this.input.name || null\n this.type = this.input.type || this.type\n break;\n\n case 'SPEC_COMPLIANT_TEXT':\n const obj = this.parseSpecCompliantText(this.input)\n this.addr = obj.addr\n this.name = obj.name || null\n break;\n\n case 'TEXT':\n this.addr = this.input\n break;\n\n default:\n break;\n }\n }\n\n getAddrDomain() {\n if (!this.addr) {\n return ''\n }\n\n return this.addr.split('@')[1]\n }\n\n dump() {\n let result = `<${this.addr}>`\n\n if (this.name) {\n result = `\"${this.name}\" ${result}`\n }\n\n return result\n }\n\n toObject() {\n return {\n name: this.name,\n addr: this.addr,\n type: this.type\n }\n }\n}\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\nimport MIMEMessageContent from './MIMEMessageContent.js'\nimport MIMETextError from './MIMETextError.js'\nimport Mailbox from './Mailbox.js'\n\nexport default class MIMEMessage {\n constructor(envctx) {\n this.envctx = envctx\n this.headers = new MIMEMessageHeader('header')\n this.messages = []\n\n this.generateBoundaries()\n }\n\n generateBoundaries() {\n this.boundaries = {\n mixed: Math.random().toString(36).slice(2),\n alt: Math.random().toString(36).slice(2)\n }\n }\n\n setSender(input) {\n const mailbox = new Mailbox(input, {type: 'from'})\n\n this.setHeader('From', mailbox)\n\n return mailbox\n }\n\n getSender() {\n return this.getHeader('From')\n }\n\n setRecipients(input, opts={type: 'to'}) {\n const recs = []\n\n if (Array.isArray(input)) {\n input.map(input => recs.push( new Mailbox(input, opts) ))\n }\n else {\n recs.push( new Mailbox(input, opts) )\n }\n\n this.setHeader(opts.type, recs)\n\n return recs\n }\n\n getRecipients(opts={type: 'to'}) {\n return this.getHeader(opts.type) || []\n }\n\n setRecipient(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setTo(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setCc(input) {\n return this.setRecipients(input, {type: 'cc'})\n }\n\n setBcc(input) {\n return this.setRecipients(input, {type: 'bcc'})\n }\n\n setSubject(value) {\n this.setHeader('subject', value)\n return value\n }\n\n getSubject() {\n return this.getHeader('subject')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return arguments[0]\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n setMessage(type, data, moreHeaders={}) {\n const validTypes = ['text/html', 'text/plain']\n\n if (validTypes.indexOf(type) === -1) {\n throw new MIMETextError('INVALID_MESSAGE_TYPE', `\n Invalid content type for the message. Supported content types \\\n are ${validTypes.join(', ')} but you specified \"${type}\".\n `)\n }\n\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return msg\n }\n\n setAttachment(filename, type, data, moreHeaders={}) {\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`,\n 'Content-Transfer-Encoding': 'base64',\n 'Content-Disposition': `attachment;filename=\"${filename}\"`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return this\n }\n\n getMessageByType(type) {\n const matches = this.messages.filter(m => m.getHeader('Content-Type').indexOf(type) !== -1)\n if (Array.isArray(matches) && matches.length > 0) {\n return matches[0]\n }\n else {\n return undefined\n }\n }\n\n getAttachments() {\n return this.messages.filter(m => m.isAttachment() === true) || []\n }\n\n asRaw() {\n let lines = this.headers.dump(this.envctx)\n\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const hasAttachments = this.getAttachments().length > 0\n const hasPlainTextAlt = plainTextMessage instanceof MIMEMessageContent && htmlMessage instanceof MIMEMessageContent\n\n if (hasAttachments && hasPlainTextAlt) return this.asRawMixedAlt(lines)\n else if (hasAttachments) return this.asRawMixed(lines)\n else if (hasPlainTextAlt) return this.asRawAlt(lines)\n else return this.asRawMessage(lines)\n }\n\n asEncoded() {\n return this.envctx.toBase64WebSafe( this.asRaw() )\n }\n\n asRawMessage(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n\n lines = `${lines}\n${message.dump(this.envctx, this.boundaries)}`\n\n return lines\n }\n\n asRawAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n\n lines = `${lines}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--`\n\n return lines\n }\n\n asRawMixed(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\n${message.dump(this.envctx, this.boundaries)}\n\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n asRawMixedAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n toBase64(v) {\n return this.envctx.toBase64(v)\n }\n}\n","import MIMEMessage from '../MIMEMessage.js'\n\nconst envctx = {\n toBase64: function toBase64(data) {\n return btoa(data)\n },\n toBase64WebSafe: function toBase64WebSafe(data) {\n return btoa(data)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '')\n }\n}\n\nclass NodeMIMEMessage extends MIMEMessage {\n constructor() {\n super(envctx)\n }\n}\n\nexport function createMimeMessage() {\n return new NodeMIMEMessage()\n}\n"],"names":["MIMETextError","_inherits","_createSuper","message","description","_classCallCheck","_trimInstanceProperty","replace","name","_createClass","_wrapNativeSuper","Error","MIMEMessageHeader","placement","maxLineLength","store","value","generator","Date","toGMTString","disabled","dump","v","required","ctx","toBase64","addr","arr","_mapInstanceProperty","join","datestr","now","toString","randomstr","_sliceInstanceProperty","Math","random","domain","_filterInstanceProperty","item","getAddrDomain","validateLength","toLowerCase","newHeader","custom","push","len","length","_taggedTemplateLiteral","undefined","_reduceInstanceProperty","memo","envctx","lines","runesModule","runes_1","MIMEMessageContent","data","maxLineLen","headers","set","arguments","obj","_Object$keys","prop","setHeader","toObject","get","d","_indexOfInstanceProperty","text","split","line","chunk","runes","boundaries","headerBlock","isAttachment","_concatInstanceProperty","mixed","configureLineLength","Mailbox","input","opts","type","reSpecCompliantAddr","inputType","findInputType","createMailbox","Object","prototype","call","test","parseSpecCompliantText","result","MIMEMessage","messages","generateBoundaries","alt","mailbox","getHeader","recs","Array","isArray","setRecipients","moreHeaders","validTypes","_Object$assign","msg","setHeaders","filename","matches","m","plainTextMessage","getMessageByType","htmlMessage","hasAttachments","getAttachments","hasPlainTextAlt","asRawMixedAlt","asRawMixed","asRawAlt","asRawMessage","toBase64WebSafe","asRaw","attachments","a","btoa","NodeMIMEMessage","createMimeMessage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAqBA,aAAa,gBAAA,UAAA,MAAA,EAAA;AAAA,EAAAC,6BAAA,CAAA,aAAA,EAAA,MAAA,CAAA,CAAA;AAAA,EAAA,IAAA,MAAA,GAAAC,cAAA,CAAA,aAAA,CAAA,CAAA;EAChC,SAAYC,aAAAA,CAAAA,OAAO,EAAEC,WAAW,EAAE;AAAA,IAAA,IAAA,KAAA,CAAA;AAAA,IAAAC,mCAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AAChC,IAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAMF,OAAO,CAAA,CAAA;AACb,IAAA,KAAA,CAAKC,WAAW,GAAGA,WAAW,GAAGE,yCAAA,CAAAF,WAAW,CAAXA,CAAAA,IAAAA,CAAAA,WAAW,CAAO,CAACG,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;IACnF,KAAKC,CAAAA,IAAI,GAAG,eAAe,CAAA;AAAA,IAAA,OAAA,KAAA,CAAA;AAC7B,GAAA;AAAC,EAAA,OAAAC,gCAAA,CAAA,aAAA,CAAA,CAAA;AAAA,CAAA,eAAAC,oCAAA,CALwCC,KAAK,CAAA,CAAA;;;;;;;ACEhD;AACA;AACA;AACA;AAHA,IAKqBC,iBAAiB,gBAAA,YAAA;AACpC,EAAA,SAAA,iBAAA,CAAYC,SAAS,EAAE;AAAA,IAAAR,mCAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;IACrB,IAAI,CAACS,aAAa,GAAG,GAAG,CAAA;IACxB,IAAI,CAACD,SAAS,GAAGA,SAAS,CAA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,gCAAA,CAAA,eAAA,CAAA,CAAA;AAAA,CAAA,CAH2BsF,WAAW,CAAA,CAAA;AAMlC,SAASkC,iBAAiB,GAAG;EAClC,OAAO,IAAID,eAAe,EAAE,CAAA;AAC9B;;;;"} \ No newline at end of file diff --git a/dist/browser/es/index.js b/dist/browser/es/index.js index 2b4725b..70da06f 100644 --- a/dist/browser/es/index.js +++ b/dist/browser/es/index.js @@ -14,47 +14,40 @@ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/fil import _Array$from from '@babel/runtime-corejs3/core-js/array/from'; import _Symbol from '@babel/runtime-corejs3/core-js/symbol'; import _getIteratorMethod from '@babel/runtime-corejs3/core-js/get-iterator-method'; +import _taggedTemplateLiteral from '@babel/runtime-corejs3/helpers/taggedTemplateLiteral'; import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js/instance/reduce'; import _wrapNativeSuper from '@babel/runtime-corejs3/helpers/wrapNativeSuper'; import _trimInstanceProperty from '@babel/runtime-corejs3/core-js/instance/trim'; function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } - var MIMETextError = /*#__PURE__*/function (_Error) { _inherits(MIMETextError, _Error); - var _super = _createSuper$1(MIMETextError); - function MIMETextError(message, description) { var _this; - _classCallCheck(this, MIMETextError); - _this = _super.call(this, message); _this.description = description ? _trimInstanceProperty(description).call(description).replace(/[\s]{2,}/, ' ') : null; _this.name = 'MIMETextError'; return _this; } - return _createClass(MIMETextError); }( /*#__PURE__*/_wrapNativeSuper(Error)); +var _templateObject; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _unsupportedIterableToArray(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context10 = Object.prototype.toString.call(o)).call(_context10, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context5 = Object.prototype.toString.call(o)).call(_context5, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /* * Headers are based on: https://www.rfc-editor.org/rfc/rfc4021#section-2.1 * (Some are ignored as they can be added later or as a custom header.) */ - var MIMEMessageHeader = /*#__PURE__*/function () { function MIMEMessageHeader(placement) { _classCallCheck(this, MIMEMessageHeader); - + this.maxLineLength = 998; this.placement = placement; this.store = [{ placement: 'header', @@ -73,16 +66,17 @@ var MIMEMessageHeader = /*#__PURE__*/function () { }, { placement: 'header', name: 'From', - // required property indicates that this property must be set required: true, - dump: function dump(v) { - return v.dump(); + dump: function dump(v, ctx) { + var _context; + return !v.name ? v.dump() : _concatInstanceProperty(_context = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context, v.addr, ">"); } }, { placement: 'header', name: 'Sender', - dump: function dump(v) { - return v.dump(); + dump: function dump(v, ctx) { + var _context2; + return !v.name ? v.dump() : _concatInstanceProperty(_context2 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context2, v.addr, ">"); } }, { placement: 'header', @@ -93,43 +87,43 @@ var MIMEMessageHeader = /*#__PURE__*/function () { }, { placement: 'header', name: 'To', - required: true, - dump: function dump(vs) { - return _mapInstanceProperty(vs).call(vs, function (v) { - return v.dump(); - }).join(', '); + // INFO: "To" field is not required according to the RFC-2822 + //required: true, + dump: function dump(arr, ctx) { + return _mapInstanceProperty(arr).call(arr, function (v) { + var _context3; + return !v.name ? v.dump() : _concatInstanceProperty(_context3 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context3, v.addr, ">"); + }).join(",\n "); } }, { placement: 'header', name: 'Cc', - dump: function dump(vs) { - return _mapInstanceProperty(vs).call(vs, function (v) { - return v.dump(); - }).join(', '); + dump: function dump(arr, ctx) { + return _mapInstanceProperty(arr).call(arr, function (v) { + var _context4; + return !v.name ? v.dump() : _concatInstanceProperty(_context4 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context4, v.addr, ">"); + }).join(",\n "); } }, { placement: 'header', name: 'Bcc', - dump: function dump(vs) { - return _mapInstanceProperty(vs).call(vs, function (v) { - return v.dump(); - }).join(', '); + dump: function dump(arr, ctx) { + return _mapInstanceProperty(arr).call(arr, function (v) { + var _context5; + return !v.name ? v.dump() : _concatInstanceProperty(_context5 = "=?utf-8?B?".concat(ctx.toBase64(v.name), "?= <")).call(_context5, v.addr, ">"); + }).join(",\n "); } }, { placement: 'header', name: 'Message-ID', disabled: false, generator: function generator(ctx) { - var _context, _context2; - + var _context6, _context7; var datestr = Date.now().toString(); - - var randomstr = _sliceInstanceProperty(_context = Math.random().toString(36)).call(_context, 2); - - var domain = _filterInstanceProperty(_context2 = ctx.store).call(_context2, function (item) { + var randomstr = _sliceInstanceProperty(_context6 = Math.random().toString(36)).call(_context6, 2); + var domain = _filterInstanceProperty(_context7 = ctx.store).call(_context7, function (item) { return item.name == 'From'; })[0].value.getAddrDomain(); - return '<' + randomstr + '-' + datestr + '@' + domain + '>'; }, dump: function dump(v) { @@ -177,20 +171,18 @@ var MIMEMessageHeader = /*#__PURE__*/function () { } }]; } - _createClass(MIMEMessageHeader, [{ key: "set", value: function set(name, value) { + this.validateLength(name, value); var _iterator = _createForOfIteratorHelper(this.store), - _step; - + _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { - var item = _step.value; - - if (item.name.toLowerCase() == name.toLowerCase()) { - item.value = value; - return item; + var _item = _step.value; + if (_item.name.toLowerCase() == name.toLowerCase()) { + _item.value = value; + return _item; } } } catch (err) { @@ -198,7 +190,6 @@ var MIMEMessageHeader = /*#__PURE__*/function () { } finally { _iterator.f(); } - var newHeader = { custom: true, placement: this.placement, @@ -211,18 +202,24 @@ var MIMEMessageHeader = /*#__PURE__*/function () { this.store.push(newHeader); return newHeader; } + }, { + key: "validateLength", + value: function validateLength(name, value) { + var len = name.length + value.length + 2; // 2 is ": " + if (len > this.maxLineLength) { + throw new MIMETextError('INVALID_HEADER', "The \"".concat(item.name, "\" header is too long. ")(_templateObject || (_templateObject = _taggedTemplateLiteral(["", " chars allowed at max, \"", "\" was ", " long."])), this.maxLineLength, item.name, len)); + } + } }, { key: "get", value: function get(name) { var _iterator2 = _createForOfIteratorHelper(this.store), - _step2; - + _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var item = _step2.value; - - if (item.name.toLowerCase() == name.toLowerCase()) { - return item.value; + var _item2 = _step2.value; + if (_item2.name.toLowerCase() == name.toLowerCase()) { + return _item2.value; } } } catch (err) { @@ -230,15 +227,13 @@ var MIMEMessageHeader = /*#__PURE__*/function () { } finally { _iterator2.f(); } - return undefined; } }, { key: "toObject", value: function toObject() { - var _context3; - - return _reduceInstanceProperty(_context3 = this.store).call(_context3, function (memo, item) { + var _context8; + return _reduceInstanceProperty(_context8 = this.store).call(_context8, function (memo, item) { memo[item.name] = item.value; return memo; }, {}); @@ -251,46 +246,234 @@ var MIMEMessageHeader = /*#__PURE__*/function () { store: this.store }; var lines = ''; - var _iterator3 = _createForOfIteratorHelper(this.store), - _step3; - + _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { - var _context4; - - var item = _step3.value; - if (item.placement != this.placement) continue; - var v = item.value ? item.value : !item.disabled && typeof item.generator == 'function' ? item.generator(ctx) : null; - - if (!v && item.required) { - throw new MIMETextError('MISSING_HEADER', "The \"".concat(item.name, "\" header is required.")); + var _context9; + var _item3 = _step3.value; + if (_item3.placement != this.placement) continue; + var v = _item3.value ? _item3.value : !_item3.disabled && typeof _item3.generator == 'function' ? _item3.generator(ctx) : null; + if (!v && _item3.required) { + throw new MIMETextError('MISSING_HEADER', "The \"".concat(_item3.name, "\" header is required.")); } - if (!v) continue; - lines += _concatInstanceProperty(_context4 = "".concat(item.name, ": ")).call(_context4, item.dump(v, ctx), "\r\n"); + lines += _concatInstanceProperty(_context9 = "".concat(_item3.name, ": ")).call(_context9, _item3.dump(v, ctx), "\r\n"); } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } - return _sliceInstanceProperty(lines).call(lines, 0, -2); } }]); - return MIMEMessageHeader; }(); +// Current version. + +// Establish the root object, `window` (`self`) in the browser, `global` +// on the server, or `this` in some virtual machines. We use `self` +// instead of `window` for `WebWorker` support. +(typeof self == 'object' && self.self === self && self) || + (typeof global == 'object' && global.global === global && global) || + Function('return this')() || + {}; + +// Save bytes in the minified (but not gzipped) version: +var ArrayProto = Array.prototype; + +// Create quick reference variables for speed access to core prototypes. +var slice = ArrayProto.slice; + +// Chunk a single array into multiple arrays, each containing `count` or fewer +// items. +function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; +} + +var runesExports = {}; +var runes$1 = { + get exports(){ return runesExports; }, + set exports(v){ runesExports = v; }, +}; + +const HIGH_SURROGATE_START = 0xd800; +const HIGH_SURROGATE_END = 0xdbff; + +const LOW_SURROGATE_START = 0xdc00; + +const REGIONAL_INDICATOR_START = 0x1f1e6; +const REGIONAL_INDICATOR_END = 0x1f1ff; + +const FITZPATRICK_MODIFIER_START = 0x1f3fb; +const FITZPATRICK_MODIFIER_END = 0x1f3ff; + +const VARIATION_MODIFIER_START = 0xfe00; +const VARIATION_MODIFIER_END = 0xfe0f; + +const DIACRITICAL_MARKS_START = 0x20d0; +const DIACRITICAL_MARKS_END = 0x20ff; + +const ZWJ = 0x200d; + +const GRAPHEMS = [ + 0x0308, // ( ◌̈ ) COMBINING DIAERESIS + 0x0937, // ( ष ) DEVANAGARI LETTER SSA + 0x0937, // ( ष ) DEVANAGARI LETTER SSA + 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I + 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I + 0x0BA8, // ( ந ) TAMIL LETTER NA + 0x0BBF, // ( ி ) TAMIL VOWEL SIGN I + 0x0BCD, // ( ◌்) TAMIL SIGN VIRAMA + 0x0E31, // ( ◌ั ) THAI CHARACTER MAI HAN-AKAT + 0x0E33, // ( ำ ) THAI CHARACTER SARA AM + 0x0E40, // ( เ ) THAI CHARACTER SARA E + 0x0E49, // ( เ ) THAI CHARACTER MAI THO + 0x1100, // ( ᄀ ) HANGUL CHOSEONG KIYEOK + 0x1161, // ( ᅡ ) HANGUL JUNGSEONG A + 0x11A8 // ( ᆨ ) HANGUL JONGSEONG KIYEOK +]; + +function runes (string) { + if (typeof string !== 'string') { + throw new Error('string cannot be undefined or null') + } + const result = []; + let i = 0; + let increment = 0; + while (i < string.length) { + increment += nextUnits(i + increment, string); + if (isGraphem(string[i + increment])) { + increment++; + } + if (isVariationSelector(string[i + increment])) { + increment++; + } + if (isDiacriticalMark(string[i + increment])) { + increment++; + } + if (isZeroWidthJoiner(string[i + increment])) { + increment++; + continue + } + result.push(string.substring(i, i + increment)); + i += increment; + increment = 0; + } + return result +} + +// Decide how many code units make up the current character. +// BMP characters: 1 code unit +// Non-BMP characters (represented by surrogate pairs): 2 code units +// Emoji with skin-tone modifiers: 4 code units (2 code points) +// Country flags: 4 code units (2 code points) +// Variations: 2 code units +function nextUnits (i, string) { + const current = string[i]; + // If we don't have a value that is part of a surrogate pair, or we're at + // the end, only take the value at i + if (!isFirstOfSurrogatePair(current) || i === string.length - 1) { + return 1 + } + + const currentPair = current + string[i + 1]; + let nextPair = string.substring(i + 2, i + 5); + + // Country flags are comprised of two regional indicator symbols, + // each represented by a surrogate pair. + // See http://emojipedia.org/flags/ + // If both pairs are regional indicator symbols, take 4 + if (isRegionalIndicator(currentPair) && isRegionalIndicator(nextPair)) { + return 4 + } + + // If the next pair make a Fitzpatrick skin tone + // modifier, take 4 + // See http://emojipedia.org/modifiers/ + // Technically, only some code points are meant to be + // combined with the skin tone modifiers. This function + // does not check the current pair to see if it is + // one of them. + if (isFitzpatrickModifier(nextPair)) { + return 4 + } + return 2 +} + +function isFirstOfSurrogatePair (string) { + return string && betweenInclusive(string[0].charCodeAt(0), HIGH_SURROGATE_START, HIGH_SURROGATE_END) +} + +function isRegionalIndicator (string) { + return betweenInclusive(codePointFromSurrogatePair(string), REGIONAL_INDICATOR_START, REGIONAL_INDICATOR_END) +} + +function isFitzpatrickModifier (string) { + return betweenInclusive(codePointFromSurrogatePair(string), FITZPATRICK_MODIFIER_START, FITZPATRICK_MODIFIER_END) +} + +function isVariationSelector (string) { + return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), VARIATION_MODIFIER_START, VARIATION_MODIFIER_END) +} + +function isDiacriticalMark (string) { + return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), DIACRITICAL_MARKS_START, DIACRITICAL_MARKS_END) +} + +function isGraphem (string) { + return typeof string === 'string' && GRAPHEMS.indexOf(string.charCodeAt(0)) !== -1 +} + +function isZeroWidthJoiner (string) { + return typeof string === 'string' && string.charCodeAt(0) === ZWJ +} + +function codePointFromSurrogatePair (pair) { + const highOffset = pair.charCodeAt(0) - HIGH_SURROGATE_START; + const lowOffset = pair.charCodeAt(1) - LOW_SURROGATE_START; + return (highOffset << 10) + lowOffset + 0x10000 +} + +function betweenInclusive (value, lower, upper) { + return value >= lower && value <= upper +} + +function substring (string, start, width) { + const chars = runes(string); + if (start === undefined) { + return string + } + if (start >= chars.length) { + return '' + } + const rest = chars.length - start; + const stringWidth = width === undefined ? rest : width; + let endIndex = start + stringWidth; + if (endIndex > (start + rest)) { + endIndex = undefined; + } + return chars.slice(start, endIndex).join('') +} + +runes$1.exports = runes; +runesExports.substr = substring; + var MIMEMessageContent = /*#__PURE__*/function () { function MIMEMessageContent(data) { _classCallCheck(this, MIMEMessageContent); - + this.maxLineLen = 78; this.data = data; this.headers = new MIMEMessageHeader('content'); } - _createClass(MIMEMessageContent, [{ key: "setHeader", value: function setHeader() { @@ -301,12 +484,10 @@ var MIMEMessageContent = /*#__PURE__*/function () { key: "setHeaders", value: function setHeaders(obj) { var _context, - _this = this; - + _this = this; _mapInstanceProperty(_context = _Object$keys(obj)).call(_context, function (prop) { return _this.setHeader(prop, obj[prop]); }); - return this; } }, { @@ -325,23 +506,31 @@ var MIMEMessageContent = /*#__PURE__*/function () { var d = this.headers.get('Content-Disposition'); return d && _indexOfInstanceProperty(d).call(d, 'attachment') !== -1 ? true : false; } + }, { + key: "configureLineLength", + value: function configureLineLength(text) { + var _context2, + _this2 = this; + return _mapInstanceProperty(_context2 = text.split(/[\r\n]+/)).call(_context2, function (line) { + var _context3; + return !line ? '' : _mapInstanceProperty(_context3 = chunk(runesExports(line), _this2.maxLineLen)).call(_context3, function (arr) { + return arr.join(''); + }).join("\r\n"); + }).join("\r\n"); + } }, { key: "dump", value: function dump(envctx, boundaries) { var headerBlock = this.headers.dump(envctx); - if (this.isAttachment()) { - var _context2, _context3; - - return _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = "--".concat(boundaries.mixed, "\n")).call(_context3, headerBlock, "\n\n")).call(_context2, this.data, "\n"); + var _context4, _context5; + return _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = "--".concat(boundaries.mixed, "\n")).call(_context5, headerBlock, "\n\n")).call(_context4, this.configureLineLength(this.data), "\n"); } else { - var _context4; - - return _concatInstanceProperty(_context4 = "".concat(headerBlock, "\r\n\r\n")).call(_context4, this.data); + var _context6; + return _concatInstanceProperty(_context6 = "".concat(headerBlock, "\r\n\r\n")).call(_context6, this.configureLineLength(this.data)); } } }]); - return MIMEMessageContent; }(); @@ -350,9 +539,7 @@ var Mailbox = /*#__PURE__*/function () { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { type: 'to' }; - _classCallCheck(this, Mailbox); - this.reSpecCompliantAddr = /(([^<>\n\r]+)\s)?<[^\n\r]+>/; this.name = null; this.addr = null; @@ -361,7 +548,6 @@ var Mailbox = /*#__PURE__*/function () { this.inputType = this.findInputType(input); this.createMailbox(); } - _createClass(Mailbox, [{ key: "findInputType", value: function findInputType(input) { @@ -369,7 +555,6 @@ var Mailbox = /*#__PURE__*/function () { if (!input.addr) { throw new MIMETextError('INVALID_MAILBOX', "\n The input should have an \"addr\" property that specifies the email address of the recipient.\n "); } - return 'OBJECT'; } else if (this.reSpecCompliantAddr.test(input)) { return 'SPEC_COMPLIANT_TEXT'; @@ -383,15 +568,12 @@ var Mailbox = /*#__PURE__*/function () { key: "parseSpecCompliantText", value: function parseSpecCompliantText(text) { var _context, _context2, _context3; - text = _trimInstanceProperty(text).call(text); - if (_sliceInstanceProperty(text).call(text, 0, 1) == '<' && _sliceInstanceProperty(text).call(text, -1) == '>') { return { addr: _sliceInstanceProperty(text).call(text, 1, -1) }; } - var arr = text.split(' <'); arr[0] = /^("|')/.test(arr[0]) ? _sliceInstanceProperty(_context = arr[0]).call(_context, 1) : arr[0]; arr[0] = /("|')$/.test(arr[0]) ? _sliceInstanceProperty(_context2 = arr[0]).call(_context2, 0, -1) : arr[0]; @@ -410,13 +592,11 @@ var Mailbox = /*#__PURE__*/function () { this.name = this.input.name || null; this.type = this.input.type || this.type; break; - case 'SPEC_COMPLIANT_TEXT': var obj = this.parseSpecCompliantText(this.input); this.addr = obj.addr; this.name = obj.name || null; break; - case 'TEXT': this.addr = this.input; break; @@ -428,20 +608,16 @@ var Mailbox = /*#__PURE__*/function () { if (!this.addr) { return ''; } - return this.addr.split('@')[1]; } }, { key: "dump", value: function dump() { var result = "<".concat(this.addr, ">"); - if (this.name) { var _context4; - result = _concatInstanceProperty(_context4 = "\"".concat(this.name, "\" ")).call(_context4, result); } - return result; } }, { @@ -454,25 +630,21 @@ var Mailbox = /*#__PURE__*/function () { }; } }]); - return Mailbox; }(); var MIMEMessage = /*#__PURE__*/function () { function MIMEMessage(envctx) { _classCallCheck(this, MIMEMessage); - this.envctx = envctx; this.headers = new MIMEMessageHeader('header'); this.messages = []; this.generateBoundaries(); } - _createClass(MIMEMessage, [{ key: "generateBoundaries", value: function generateBoundaries() { var _context, _context2; - this.boundaries = { mixed: _sliceInstanceProperty(_context = Math.random().toString(36)).call(_context, 2), alt: _sliceInstanceProperty(_context2 = Math.random().toString(36)).call(_context2, 2) @@ -499,7 +671,6 @@ var MIMEMessage = /*#__PURE__*/function () { type: 'to' }; var recs = []; - if (Array.isArray(input)) { _mapInstanceProperty(input).call(input, function (input) { return recs.push(new Mailbox(input, opts)); @@ -507,7 +678,6 @@ var MIMEMessage = /*#__PURE__*/function () { } else { recs.push(new Mailbox(input, opts)); } - this.setHeader(opts.type, recs); return recs; } @@ -573,12 +743,10 @@ var MIMEMessage = /*#__PURE__*/function () { key: "setHeaders", value: function setHeaders(obj) { var _context3, - _this = this; - + _this = this; _mapInstanceProperty(_context3 = _Object$keys(obj)).call(_context3, function (prop) { return _this.setHeader(prop, obj[prop]); }); - return this; } }, { @@ -591,17 +759,13 @@ var MIMEMessage = /*#__PURE__*/function () { value: function setMessage(type, data) { var moreHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var validTypes = ['text/html', 'text/plain']; - if (_indexOfInstanceProperty(validTypes).call(validTypes, type) === -1) { var _context4; - throw new MIMETextError('INVALID_MESSAGE_TYPE', _concatInstanceProperty(_context4 = "\n Invalid content type for the message. Supported content types are ".concat(validTypes.join(', '), " but you specified \"")).call(_context4, type, "\".\n ")); } - var headers = _Object$assign({}, moreHeaders, { 'Content-Type': "".concat(type, "; charset=UTF-8") }); - var msg = new MIMEMessageContent(data); msg.setHeaders(headers); this.messages.push(msg); @@ -611,13 +775,11 @@ var MIMEMessage = /*#__PURE__*/function () { key: "setAttachment", value: function setAttachment(filename, type, data) { var moreHeaders = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var headers = _Object$assign({}, moreHeaders, { 'Content-Type': "".concat(type, "; charset=UTF-8"), 'Content-Transfer-Encoding': 'base64', 'Content-Disposition': "attachment;filename=\"".concat(filename, "\"") }); - var msg = new MIMEMessageContent(data); msg.setHeaders(headers); this.messages.push(msg); @@ -627,13 +789,10 @@ var MIMEMessage = /*#__PURE__*/function () { key: "getMessageByType", value: function getMessageByType(type) { var _context5; - var matches = _filterInstanceProperty(_context5 = this.messages).call(_context5, function (m) { var _context6; - return _indexOfInstanceProperty(_context6 = m.getHeader('Content-Type')).call(_context6, type) !== -1; }); - if (Array.isArray(matches) && matches.length > 0) { return matches[0]; } else { @@ -644,7 +803,6 @@ var MIMEMessage = /*#__PURE__*/function () { key: "getAttachments", value: function getAttachments() { var _context7; - return _filterInstanceProperty(_context7 = this.messages).call(_context7, function (m) { return m.isAttachment() === true; }) || []; @@ -657,16 +815,7 @@ var MIMEMessage = /*#__PURE__*/function () { var htmlMessage = this.getMessageByType('text/html'); var hasAttachments = this.getAttachments().length > 0; var hasPlainTextAlt = plainTextMessage instanceof MIMEMessageContent && htmlMessage instanceof MIMEMessageContent; - - if (hasAttachments && hasPlainTextAlt) { - return this.asRawMixedAlt(lines); - } else if (hasAttachments) { - return this.asRawMixed(lines); - } else if (hasPlainTextAlt) { - return this.asRawAlt(lines); - } else { - return this.asRawMessage(lines); - } + if (hasAttachments && hasPlainTextAlt) return this.asRawMixedAlt(lines);else if (hasAttachments) return this.asRawMixed(lines);else if (hasPlainTextAlt) return this.asRawAlt(lines);else return this.asRawMessage(lines); } }, { key: "asEncoded", @@ -677,7 +826,6 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawMessage", value: function asRawMessage(lines) { var _context8; - var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); var message = htmlMessage || plainTextMessage; @@ -688,7 +836,6 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawAlt", value: function asRawAlt(lines) { var _context9, _context10, _context11, _context12, _context13, _context14; - var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); lines = _concatInstanceProperty(_context9 = _concatInstanceProperty(_context10 = _concatInstanceProperty(_context11 = _concatInstanceProperty(_context12 = _concatInstanceProperty(_context13 = _concatInstanceProperty(_context14 = "".concat(lines, "\nContent-Type: multipart/alternative; boundary=")).call(_context14, this.boundaries.alt, "\n\n--")).call(_context13, this.boundaries.alt, "\n")).call(_context12, plainTextMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context11, this.boundaries.alt, "\n")).call(_context10, htmlMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context9, this.boundaries.alt, "--"); @@ -698,21 +845,18 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawMixed", value: function asRawMixed(lines) { var _context15, - _this2 = this, - _context16, - _context17, - _context18, - _context19, - _context20; - + _this2 = this, + _context16, + _context17, + _context18, + _context19, + _context20; var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); var message = htmlMessage || plainTextMessage; - var attachments = _mapInstanceProperty(_context15 = this.getAttachments()).call(_context15, function (a) { return a.dump(_this2.envctx, _this2.boundaries); }).join('').replace(/[\r\n]$/g, ''); - lines = _concatInstanceProperty(_context16 = _concatInstanceProperty(_context17 = _concatInstanceProperty(_context18 = _concatInstanceProperty(_context19 = _concatInstanceProperty(_context20 = "".concat(lines, "\nContent-Type: multipart/mixed; boundary=")).call(_context20, this.boundaries.mixed, "\n\n--")).call(_context19, this.boundaries.mixed, "\n")).call(_context18, message.dump(this.envctx, this.boundaries), "\n\n")).call(_context17, attachments, "\n\n--")).call(_context16, this.boundaries.mixed, "--"); return lines; } @@ -720,25 +864,22 @@ var MIMEMessage = /*#__PURE__*/function () { key: "asRawMixedAlt", value: function asRawMixedAlt(lines) { var _context21, - _this3 = this, - _context22, - _context23, - _context24, - _context25, - _context26, - _context27, - _context28, - _context29, - _context30, - _context31; - + _this3 = this, + _context22, + _context23, + _context24, + _context25, + _context26, + _context27, + _context28, + _context29, + _context30, + _context31; var plainTextMessage = this.getMessageByType('text/plain'); var htmlMessage = this.getMessageByType('text/html'); - var attachments = _mapInstanceProperty(_context21 = this.getAttachments()).call(_context21, function (a) { return a.dump(_this3.envctx, _this3.boundaries); }).join('').replace(/[\r\n]$/g, ''); - lines = _concatInstanceProperty(_context22 = _concatInstanceProperty(_context23 = _concatInstanceProperty(_context24 = _concatInstanceProperty(_context25 = _concatInstanceProperty(_context26 = _concatInstanceProperty(_context27 = _concatInstanceProperty(_context28 = _concatInstanceProperty(_context29 = _concatInstanceProperty(_context30 = _concatInstanceProperty(_context31 = "".concat(lines, "\nContent-Type: multipart/mixed; boundary=")).call(_context31, this.boundaries.mixed, "\n\n--")).call(_context30, this.boundaries.mixed, "\nContent-Type: multipart/alternative; boundary=")).call(_context29, this.boundaries.alt, "\n\n--")).call(_context28, this.boundaries.alt, "\n")).call(_context27, plainTextMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context26, this.boundaries.alt, "\n")).call(_context25, htmlMessage.dump(this.envctx, this.boundaries), "\n\n--")).call(_context24, this.boundaries.alt, "--\n")).call(_context23, attachments, "\n\n--")).call(_context22, this.boundaries.mixed, "--"); return lines; } @@ -748,12 +889,10 @@ var MIMEMessage = /*#__PURE__*/function () { return this.envctx.toBase64(v); } }]); - return MIMEMessage; }(); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } var envctx = { toBase64: function toBase64(data) { @@ -763,21 +902,15 @@ var envctx = { return btoa(data).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); } }; - var NodeMIMEMessage = /*#__PURE__*/function (_MIMEMessage) { _inherits(NodeMIMEMessage, _MIMEMessage); - var _super = _createSuper(NodeMIMEMessage); - function NodeMIMEMessage() { _classCallCheck(this, NodeMIMEMessage); - return _super.call(this, envctx); } - return _createClass(NodeMIMEMessage); }(MIMEMessage); - function createMimeMessage() { return new NodeMIMEMessage(); } diff --git a/dist/browser/es/index.js.map b/dist/browser/es/index.js.map index 96e8cb1..876b93c 100644 --- a/dist/browser/es/index.js.map +++ b/dist/browser/es/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../../src/MIMETextError.js","../../../src/MIMEMessageHeader.js","../../../src/MIMEMessageContent.js","../../../src/Mailbox.js","../../../src/MIMEMessage.js","../../../src/entrypoints/browser.js"],"sourcesContent":["export default class MIMETextError extends Error {\n constructor(message, description) {\n super(message)\n this.description = description ? description.trim().replace(/[\\s]{2,}/, ' ') : null\n this.name = 'MIMETextError'\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\n/*\n* Headers are based on: https://www.rfc-editor.org/rfc/rfc4021#section-2.1\n* (Some are ignored as they can be added later or as a custom header.)\n*/\n\nexport default class MIMEMessageHeader {\n constructor(placement) {\n this.placement = placement\n this.store = [\n {\n placement: 'header',\n name: 'Date',\n // value property is what user sets for this header\n value: null,\n // the generator function generates a value for this header unless\n // user specified a value or user disabled this property\n generator: () => (new Date().toGMTString()).replace(/GMT|UTC/gi, '+0000'),\n disabled: false,\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'From',\n // required property indicates that this property must be set\n required: true,\n dump: (v) => {\n return v.dump()\n }\n },\n {\n placement: 'header',\n name: 'Sender',\n dump: (v) => {\n return v.dump()\n }\n },\n {\n placement: 'header',\n name: 'Reply-To',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'To',\n required: true,\n dump: (vs) => {\n return vs.map(v => v.dump()).join(', ')\n }\n },\n {\n placement: 'header',\n name: 'Cc',\n dump: (vs) => {\n return vs.map(v => v.dump()).join(', ')\n }\n },\n {\n placement: 'header',\n name: 'Bcc',\n dump: (vs) => {\n return vs.map(v => v.dump()).join(', ')\n }\n },\n {\n placement: 'header',\n name: 'Message-ID',\n disabled: false,\n generator: (ctx) => {\n const datestr = Date.now().toString()\n const randomstr = Math.random().toString(36).slice(2)\n const domain = ctx.store.filter(item => item.name == 'From')[0].value.getAddrDomain()\n return '<' + randomstr + '-' + datestr + '@' + domain + '>'\n },\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'Subject',\n required: true,\n dump: (v, ctx) => {\n return '=?utf-8?B?' + ctx.toBase64(v) + '?='\n }\n },\n {\n placement: 'header',\n name: 'MIME-Version',\n generator: () => '1.0',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-ID',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Type',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Transfer-Encoding',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Disposition',\n dump: (v) => {\n return v\n }\n }\n ]\n }\n\n set(name, value) {\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n item.value = value\n return item\n }\n }\n\n const newHeader = {\n custom: true,\n placement: this.placement,\n name: name,\n value: value,\n dump: (v) => {\n return v\n }\n }\n\n this.store.push(newHeader)\n\n return newHeader\n }\n\n get(name) {\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n return item.value\n }\n }\n return undefined\n }\n\n toObject() {\n return this.store.reduce((memo, item) => {\n memo[item.name] = item.value\n return memo\n }, {})\n }\n\n dump(envctx) {\n const ctx = {\n toBase64: envctx.toBase64,\n store: this.store\n }\n\n let lines = ''\n for (const item of this.store) {\n if (item.placement != this.placement) continue;\n\n const v = item.value\n ? item.value\n : !item.disabled && typeof item.generator == 'function'\n ? item.generator(ctx)\n : null\n\n if (!v && item.required) {\n throw new MIMETextError('MISSING_HEADER', `The \"${item.name}\" header is required.`)\n }\n\n if (!v) continue;\n\n lines += `${item.name}: ${item.dump(v, ctx)}\\r\\n`\n }\n\n return lines.slice(0, -2)\n }\n}\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\n\nexport default class MIMEMessageContent {\n constructor(data) {\n this.data = data\n this.headers = new MIMEMessageHeader('content')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return this\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n isAttachment() {\n const d = this.headers.get('Content-Disposition')\n return d && d.indexOf('attachment') !== -1 ? true : false\n }\n\n dump(envctx, boundaries) {\n const headerBlock = this.headers.dump(envctx)\n\n if (this.isAttachment()) {\n return `--${boundaries.mixed}\n${headerBlock}\n\n${this.data}\n`\n }\n else {\n return `${headerBlock}\\r\\n\\r\\n${this.data}`\n }\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\nexport default class Mailbox {\n constructor(input, opts={type: 'to'}) {\n this.reSpecCompliantAddr = /(([^<>\\n\\r]+)\\s)?<[^\\n\\r]+>/\n\n this.name = null\n this.addr = null\n this.type = opts.type || 'to'\n this.input = input\n this.inputType = this.findInputType(input)\n\n this.createMailbox()\n }\n\n findInputType(input) {\n if (Object.prototype.toString.call(input) === '[object Object]') {\n if (!input.addr) {\n throw new MIMETextError('INVALID_MAILBOX', `\n The input should have an \"addr\" property that specifies the email address \\\n of the recipient.\n `)\n }\n return 'OBJECT'\n }\n else if (this.reSpecCompliantAddr.test(input)) {\n return 'SPEC_COMPLIANT_TEXT'\n }\n else if (typeof input == 'string') {\n return 'TEXT'\n }\n else {\n throw new MIMETextError('INVALID_MAILBOX')\n }\n }\n\n parseSpecCompliantText(text) {\n text = text.trim()\n\n if (text.slice(0, 1) == '<' && text.slice(-1) == '>') {\n return {addr: text.slice(1, -1)}\n }\n\n const arr = text.split(' <')\n arr[0] = /^(\"|')/.test(arr[0]) ? arr[0].slice(1) : arr[0]\n arr[0] = /(\"|')$/.test(arr[0]) ? arr[0].slice(0, -1) : arr[0]\n arr[1] = arr[1].slice(0, -1)\n\n return {name: arr[0], addr: arr[1]}\n }\n\n createMailbox() {\n switch (this.inputType) {\n case 'OBJECT':\n this.addr = this.input.addr\n this.name = this.input.name || null\n this.type = this.input.type || this.type\n break;\n\n case 'SPEC_COMPLIANT_TEXT':\n const obj = this.parseSpecCompliantText(this.input)\n this.addr = obj.addr\n this.name = obj.name || null\n break;\n\n case 'TEXT':\n this.addr = this.input\n break;\n\n default:\n break;\n }\n }\n\n getAddrDomain() {\n if (!this.addr) {\n return ''\n }\n\n return this.addr.split('@')[1]\n }\n\n dump() {\n let result = `<${this.addr}>`\n\n if (this.name) {\n result = `\"${this.name}\" ${result}`\n }\n\n return result\n }\n\n toObject() {\n return {\n name: this.name,\n addr: this.addr,\n type: this.type\n }\n }\n}\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\nimport MIMEMessageContent from './MIMEMessageContent.js'\nimport MIMETextError from './MIMETextError.js'\nimport Mailbox from './Mailbox.js'\n\nexport default class MIMEMessage {\n constructor(envctx) {\n this.envctx = envctx\n this.headers = new MIMEMessageHeader('header')\n this.messages = []\n\n this.generateBoundaries()\n }\n\n generateBoundaries() {\n this.boundaries = {\n mixed: Math.random().toString(36).slice(2),\n alt: Math.random().toString(36).slice(2)\n }\n }\n\n setSender(input) {\n const mailbox = new Mailbox(input, {type: 'from'})\n\n this.setHeader('From', mailbox)\n\n return mailbox\n }\n\n getSender() {\n return this.getHeader('From')\n }\n\n setRecipients(input, opts={type: 'to'}) {\n const recs = []\n\n if (Array.isArray(input)) {\n input.map(input => recs.push( new Mailbox(input, opts) ))\n }\n else {\n recs.push( new Mailbox(input, opts) )\n }\n\n this.setHeader(opts.type, recs)\n\n return recs\n }\n\n getRecipients(opts={type: 'to'}) {\n return this.getHeader(opts.type) || []\n }\n\n setRecipient(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setTo(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setCc(input) {\n return this.setRecipients(input, {type: 'cc'})\n }\n\n setBcc(input) {\n return this.setRecipients(input, {type: 'bcc'})\n }\n\n setSubject(value) {\n this.setHeader('subject', value)\n return value\n }\n\n getSubject() {\n return this.getHeader('subject')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return arguments[0]\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n setMessage(type, data, moreHeaders={}) {\n const validTypes = ['text/html', 'text/plain']\n\n if (validTypes.indexOf(type) === -1) {\n throw new MIMETextError('INVALID_MESSAGE_TYPE', `\n Invalid content type for the message. Supported content types \\\n are ${validTypes.join(', ')} but you specified \"${type}\".\n `)\n }\n\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return msg\n }\n\n setAttachment(filename, type, data, moreHeaders={}) {\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`,\n 'Content-Transfer-Encoding': 'base64',\n 'Content-Disposition': `attachment;filename=\"${filename}\"`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return this\n }\n\n getMessageByType(type) {\n const matches = this.messages.filter(m => m.getHeader('Content-Type').indexOf(type) !== -1)\n if (Array.isArray(matches) && matches.length > 0) {\n return matches[0]\n }\n else {\n return undefined\n }\n }\n\n getAttachments() {\n return this.messages.filter(m => m.isAttachment() === true) || []\n }\n\n asRaw() {\n let lines = this.headers.dump(this.envctx)\n\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const hasAttachments = this.getAttachments().length > 0\n const hasPlainTextAlt = plainTextMessage instanceof MIMEMessageContent && htmlMessage instanceof MIMEMessageContent\n\n if (hasAttachments && hasPlainTextAlt) {\n return this.asRawMixedAlt(lines)\n }\n else if (hasAttachments) {\n return this.asRawMixed(lines)\n }\n else if (hasPlainTextAlt) {\n return this.asRawAlt(lines)\n }\n else {\n return this.asRawMessage(lines)\n }\n }\n\n asEncoded() {\n return this.envctx.toBase64WebSafe( this.asRaw() )\n }\n\n asRawMessage(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n\n lines = `${lines}\n${message.dump(this.envctx, this.boundaries)}`\n\n return lines\n }\n\n asRawAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n\n lines = `${lines}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--`\n\n return lines\n }\n\n asRawMixed(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\n${message.dump(this.envctx, this.boundaries)}\n\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n asRawMixedAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n toBase64(v) {\n return this.envctx.toBase64(v)\n }\n}\n","import MIMEMessage from '../MIMEMessage.js'\n\nconst envctx = {\n toBase64: function toBase64(data) {\n return btoa(data)\n },\n toBase64WebSafe: function toBase64WebSafe(data) {\n return btoa(data)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '')\n }\n}\n\nclass NodeMIMEMessage extends MIMEMessage {\n constructor() {\n super(envctx)\n }\n}\n\nexport function createMimeMessage() {\n return new NodeMIMEMessage()\n}\n"],"names":["MIMETextError","message","description","replace","name","Error","MIMEMessageHeader","placement","store","value","generator","Date","toGMTString","disabled","dump","v","required","vs","join","ctx","datestr","now","toString","randomstr","Math","random","domain","item","getAddrDomain","toBase64","toLowerCase","newHeader","custom","push","undefined","memo","envctx","lines","MIMEMessageContent","data","headers","set","arguments","obj","prop","setHeader","toObject","get","d","boundaries","headerBlock","isAttachment","mixed","Mailbox","input","opts","type","reSpecCompliantAddr","addr","inputType","findInputType","createMailbox","Object","prototype","call","test","text","arr","split","parseSpecCompliantText","result","MIMEMessage","messages","generateBoundaries","alt","mailbox","getHeader","recs","Array","isArray","setRecipients","moreHeaders","validTypes","msg","setHeaders","filename","matches","m","length","plainTextMessage","getMessageByType","htmlMessage","hasAttachments","getAttachments","hasPlainTextAlt","asRawMixedAlt","asRawMixed","asRawAlt","asRawMessage","toBase64WebSafe","asRaw","attachments","a","btoa","NodeMIMEMessage","createMimeMessage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IAAqBA;;;;;EACnB,SAAYC,aAAAA,CAAAA,OAAZ,EAAqBC,WAArB,EAAkC;AAAA,IAAA,IAAA,KAAA,CAAA;;AAAA,IAAA,eAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;;AAChC,IAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAMD,OAAN,CAAA,CAAA;AACA,IAAA,KAAA,CAAKC,WAAL,GAAm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CAAyB5D,IAAzB,EAA+B;IAC9C,OAAOgE,IAAI,CAAChE,IAAD,CAAJ,CACJpC,OADI,CACI,KADJ,EACW,GADX,CAAA,CAEJA,OAFI,CAEI,KAFJ,EAEW,GAFX,CAAA,CAGJA,OAHI,CAGI,KAHJ,EAGW,EAHX,CAAP,CAAA;AAID,GAAA;AATY,CAAf,CAAA;;IAYMqG;;;;;EACJ,SAAc,eAAA,GAAA;AAAA,IAAA,eAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;;AAAA,IAAA,OAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EACNpE,MADM,CAAA,CAAA;AAEb,GAAA;;;EAH2BmC;;AAMvB,SAASkC,iBAAT,GAA6B;EAClC,OAAO,IAAID,eAAJ,EAAP,CAAA;AACD;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../../../src/MIMETextError.js","../../../src/MIMEMessageHeader.js","../../../node_modules/underscore/modules/_setup.js","../../../node_modules/underscore/modules/chunk.js","../../../node_modules/runes/index.js","../../../src/MIMEMessageContent.js","../../../src/Mailbox.js","../../../src/MIMEMessage.js","../../../src/entrypoints/browser.js"],"sourcesContent":["export default class MIMETextError extends Error {\n constructor(message, description) {\n super(message)\n this.description = description ? description.trim().replace(/[\\s]{2,}/, ' ') : null\n this.name = 'MIMETextError'\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\n/*\n* Headers are based on: https://www.rfc-editor.org/rfc/rfc4021#section-2.1\n* (Some are ignored as they can be added later or as a custom header.)\n*/\n\nexport default class MIMEMessageHeader {\n constructor(placement) {\n this.maxLineLength = 998\n this.placement = placement\n this.store = [\n {\n placement: 'header',\n name: 'Date',\n // value property is what user sets for this header\n value: null,\n // the generator function generates a value for this header unless\n // user specified a value or user disabled this property\n generator: () => (new Date().toGMTString()).replace(/GMT|UTC/gi, '+0000'),\n disabled: false,\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'From',\n required: true,\n dump: (v, ctx) => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`\n },\n {\n placement: 'header',\n name: 'Sender',\n dump: (v, ctx) => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`\n },\n {\n placement: 'header',\n name: 'Reply-To',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'To',\n // INFO: \"To\" field is not required according to the RFC-2822\n //required: true,\n dump: (arr, ctx) => arr.map(v => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`).join(\",\\n \")\n },\n {\n placement: 'header',\n name: 'Cc',\n dump: (arr, ctx) => arr.map(v => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`).join(\",\\n \")\n },\n {\n placement: 'header',\n name: 'Bcc',\n dump: (arr, ctx) => arr.map(v => !v.name ? v.dump() : `=?utf-8?B?${ctx.toBase64(v.name)}?= <${v.addr}>`).join(\",\\n \")\n },\n {\n placement: 'header',\n name: 'Message-ID',\n disabled: false,\n generator: (ctx) => {\n const datestr = Date.now().toString()\n const randomstr = Math.random().toString(36).slice(2)\n const domain = ctx.store.filter(item => item.name == 'From')[0].value.getAddrDomain()\n return '<' + randomstr + '-' + datestr + '@' + domain + '>'\n },\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'header',\n name: 'Subject',\n required: true,\n dump: (v, ctx) => '=?utf-8?B?' + ctx.toBase64(v) + '?='\n },\n {\n placement: 'header',\n name: 'MIME-Version',\n generator: () => '1.0',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-ID',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Type',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Transfer-Encoding',\n dump: (v) => {\n return v\n }\n },\n {\n placement: 'content',\n name: 'Content-Disposition',\n dump: (v) => {\n return v\n }\n }\n ]\n }\n\n set(name, value) {\n this.validateLength(name, value)\n\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n item.value = value\n return item\n }\n }\n\n const newHeader = {\n custom: true,\n placement: this.placement,\n name: name,\n value: value,\n dump: (v) => {\n return v\n }\n }\n\n this.store.push(newHeader)\n\n return newHeader\n }\n\n validateLength(name, value) {\n const len = name.length + value.length + 2 // 2 is \": \"\n if (len > this.maxLineLength) {\n throw new MIMETextError('INVALID_HEADER', `The \"${item.name}\" header is too long. `\n `${this.maxLineLength} chars allowed at max, \"${item.name}\" was ${len} long.`)\n }\n }\n\n get(name) {\n for (const item of this.store) {\n if (item.name.toLowerCase() == name.toLowerCase()) {\n return item.value\n }\n }\n return undefined\n }\n\n toObject() {\n return this.store.reduce((memo, item) => {\n memo[item.name] = item.value\n return memo\n }, {})\n }\n\n dump(envctx) {\n const ctx = {\n toBase64: envctx.toBase64,\n store: this.store\n }\n\n let lines = ''\n for (const item of this.store) {\n if (item.placement != this.placement) continue;\n\n const v = item.value\n ? item.value\n : !item.disabled && typeof item.generator == 'function'\n ? item.generator(ctx)\n : null\n\n if (!v && item.required) {\n throw new MIMETextError('MISSING_HEADER', `The \"${item.name}\" header is required.`)\n }\n\n if (!v) continue;\n\n lines += `${item.name}: ${item.dump(v, ctx)}\\r\\n`\n }\n\n return lines.slice(0, -2)\n }\n}\n","// Current version.\nexport var VERSION = '1.13.6';\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\nexport var root = (typeof self == 'object' && self.self === self && self) ||\n (typeof global == 'object' && global.global === global && global) ||\n Function('return this')() ||\n {};\n\n// Save bytes in the minified (but not gzipped) version:\nexport var ArrayProto = Array.prototype, ObjProto = Object.prototype;\nexport var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n// Create quick reference variables for speed access to core prototypes.\nexport var push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n// Modern feature detection.\nexport var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',\n supportsDataView = typeof DataView !== 'undefined';\n\n// All **ECMAScript 5+** native function implementations that we hope to use\n// are declared here.\nexport var nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create,\n nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n// Create references to these builtin functions because we override them.\nexport var _isNaN = isNaN,\n _isFinite = isFinite;\n\n// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\nexport var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\nexport var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n// The largest integer that can be represented exactly.\nexport var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n","import { slice } from './_setup.js';\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport default function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n","'use strict'\n\nconst HIGH_SURROGATE_START = 0xd800\nconst HIGH_SURROGATE_END = 0xdbff\n\nconst LOW_SURROGATE_START = 0xdc00\n\nconst REGIONAL_INDICATOR_START = 0x1f1e6\nconst REGIONAL_INDICATOR_END = 0x1f1ff\n\nconst FITZPATRICK_MODIFIER_START = 0x1f3fb\nconst FITZPATRICK_MODIFIER_END = 0x1f3ff\n\nconst VARIATION_MODIFIER_START = 0xfe00\nconst VARIATION_MODIFIER_END = 0xfe0f\n\nconst DIACRITICAL_MARKS_START = 0x20d0\nconst DIACRITICAL_MARKS_END = 0x20ff\n\nconst ZWJ = 0x200d\n\nconst GRAPHEMS = [\n 0x0308, // ( ◌̈ ) COMBINING DIAERESIS\n 0x0937, // ( ष ) DEVANAGARI LETTER SSA\n 0x0937, // ( ष ) DEVANAGARI LETTER SSA\n 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I\n 0x093F, // ( ि ) DEVANAGARI VOWEL SIGN I\n 0x0BA8, // ( ந ) TAMIL LETTER NA\n 0x0BBF, // ( ி ) TAMIL VOWEL SIGN I\n 0x0BCD, // ( ◌்) TAMIL SIGN VIRAMA\n 0x0E31, // ( ◌ั ) THAI CHARACTER MAI HAN-AKAT\n 0x0E33, // ( ำ ) THAI CHARACTER SARA AM\n 0x0E40, // ( เ ) THAI CHARACTER SARA E\n 0x0E49, // ( เ ) THAI CHARACTER MAI THO\n 0x1100, // ( ᄀ ) HANGUL CHOSEONG KIYEOK\n 0x1161, // ( ᅡ ) HANGUL JUNGSEONG A\n 0x11A8 // ( ᆨ ) HANGUL JONGSEONG KIYEOK\n]\n\nfunction runes (string) {\n if (typeof string !== 'string') {\n throw new Error('string cannot be undefined or null')\n }\n const result = []\n let i = 0\n let increment = 0\n while (i < string.length) {\n increment += nextUnits(i + increment, string)\n if (isGraphem(string[i + increment])) {\n increment++\n }\n if (isVariationSelector(string[i + increment])) {\n increment++\n }\n if (isDiacriticalMark(string[i + increment])) {\n increment++\n }\n if (isZeroWidthJoiner(string[i + increment])) {\n increment++\n continue\n }\n result.push(string.substring(i, i + increment))\n i += increment\n increment = 0\n }\n return result\n}\n\n// Decide how many code units make up the current character.\n// BMP characters: 1 code unit\n// Non-BMP characters (represented by surrogate pairs): 2 code units\n// Emoji with skin-tone modifiers: 4 code units (2 code points)\n// Country flags: 4 code units (2 code points)\n// Variations: 2 code units\nfunction nextUnits (i, string) {\n const current = string[i]\n // If we don't have a value that is part of a surrogate pair, or we're at\n // the end, only take the value at i\n if (!isFirstOfSurrogatePair(current) || i === string.length - 1) {\n return 1\n }\n\n const currentPair = current + string[i + 1]\n let nextPair = string.substring(i + 2, i + 5)\n\n // Country flags are comprised of two regional indicator symbols,\n // each represented by a surrogate pair.\n // See http://emojipedia.org/flags/\n // If both pairs are regional indicator symbols, take 4\n if (isRegionalIndicator(currentPair) && isRegionalIndicator(nextPair)) {\n return 4\n }\n\n // If the next pair make a Fitzpatrick skin tone\n // modifier, take 4\n // See http://emojipedia.org/modifiers/\n // Technically, only some code points are meant to be\n // combined with the skin tone modifiers. This function\n // does not check the current pair to see if it is\n // one of them.\n if (isFitzpatrickModifier(nextPair)) {\n return 4\n }\n return 2\n}\n\nfunction isFirstOfSurrogatePair (string) {\n return string && betweenInclusive(string[0].charCodeAt(0), HIGH_SURROGATE_START, HIGH_SURROGATE_END)\n}\n\nfunction isRegionalIndicator (string) {\n return betweenInclusive(codePointFromSurrogatePair(string), REGIONAL_INDICATOR_START, REGIONAL_INDICATOR_END)\n}\n\nfunction isFitzpatrickModifier (string) {\n return betweenInclusive(codePointFromSurrogatePair(string), FITZPATRICK_MODIFIER_START, FITZPATRICK_MODIFIER_END)\n}\n\nfunction isVariationSelector (string) {\n return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), VARIATION_MODIFIER_START, VARIATION_MODIFIER_END)\n}\n\nfunction isDiacriticalMark (string) {\n return typeof string === 'string' && betweenInclusive(string.charCodeAt(0), DIACRITICAL_MARKS_START, DIACRITICAL_MARKS_END)\n}\n\nfunction isGraphem (string) {\n return typeof string === 'string' && GRAPHEMS.indexOf(string.charCodeAt(0)) !== -1\n}\n\nfunction isZeroWidthJoiner (string) {\n return typeof string === 'string' && string.charCodeAt(0) === ZWJ\n}\n\nfunction codePointFromSurrogatePair (pair) {\n const highOffset = pair.charCodeAt(0) - HIGH_SURROGATE_START\n const lowOffset = pair.charCodeAt(1) - LOW_SURROGATE_START\n return (highOffset << 10) + lowOffset + 0x10000\n}\n\nfunction betweenInclusive (value, lower, upper) {\n return value >= lower && value <= upper\n}\n\nfunction substring (string, start, width) {\n const chars = runes(string)\n if (start === undefined) {\n return string\n }\n if (start >= chars.length) {\n return ''\n }\n const rest = chars.length - start\n const stringWidth = width === undefined ? rest : width\n let endIndex = start + stringWidth\n if (endIndex > (start + rest)) {\n endIndex = undefined\n }\n return chars.slice(start, endIndex).join('')\n}\n\nmodule.exports = runes\nmodule.exports.substr = substring\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\nimport chunk from \"underscore/modules/chunk.js\";\nimport runes from \"runes\";\n\nexport default class MIMEMessageContent {\n constructor(data) {\n this.maxLineLen = 78\n this.data = data\n this.headers = new MIMEMessageHeader('content')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return this\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n isAttachment() {\n const d = this.headers.get('Content-Disposition')\n return d && d.indexOf('attachment') !== -1 ? true : false;\n }\n\n configureLineLength(text) {\n return text.split(/[\\r\\n]+/).map(line => !line ? '' : chunk(runes(line), this.maxLineLen).map(arr => arr.join('')).join(\"\\r\\n\")).join(\"\\r\\n\")\n }\n\n dump(envctx, boundaries) {\n const headerBlock = this.headers.dump(envctx)\n\n if (this.isAttachment()) {\n return `--${boundaries.mixed}\n${headerBlock}\n\n${this.configureLineLength(this.data)}\n`\n }\n else {\n return `${headerBlock}\\r\\n\\r\\n${this.configureLineLength(this.data)}`\n }\n }\n}\n","import MIMETextError from './MIMETextError.js'\n\nexport default class Mailbox {\n constructor(input, opts={type: 'to'}) {\n this.reSpecCompliantAddr = /(([^<>\\n\\r]+)\\s)?<[^\\n\\r]+>/\n\n this.name = null\n this.addr = null\n this.type = opts.type || 'to'\n this.input = input\n this.inputType = this.findInputType(input)\n\n this.createMailbox()\n }\n\n findInputType(input) {\n if (Object.prototype.toString.call(input) === '[object Object]') {\n if (!input.addr) {\n throw new MIMETextError('INVALID_MAILBOX', `\n The input should have an \"addr\" property that specifies the email address \\\n of the recipient.\n `)\n }\n return 'OBJECT'\n }\n else if (this.reSpecCompliantAddr.test(input)) {\n return 'SPEC_COMPLIANT_TEXT'\n }\n else if (typeof input == 'string') {\n return 'TEXT'\n }\n else {\n throw new MIMETextError('INVALID_MAILBOX')\n }\n }\n\n parseSpecCompliantText(text) {\n text = text.trim()\n\n if (text.slice(0, 1) == '<' && text.slice(-1) == '>') {\n return {addr: text.slice(1, -1)}\n }\n\n const arr = text.split(' <')\n arr[0] = /^(\"|')/.test(arr[0]) ? arr[0].slice(1) : arr[0]\n arr[0] = /(\"|')$/.test(arr[0]) ? arr[0].slice(0, -1) : arr[0]\n arr[1] = arr[1].slice(0, -1)\n\n return {name: arr[0], addr: arr[1]}\n }\n\n createMailbox() {\n switch (this.inputType) {\n case 'OBJECT':\n this.addr = this.input.addr\n this.name = this.input.name || null\n this.type = this.input.type || this.type\n break;\n\n case 'SPEC_COMPLIANT_TEXT':\n const obj = this.parseSpecCompliantText(this.input)\n this.addr = obj.addr\n this.name = obj.name || null\n break;\n\n case 'TEXT':\n this.addr = this.input\n break;\n\n default:\n break;\n }\n }\n\n getAddrDomain() {\n if (!this.addr) {\n return ''\n }\n\n return this.addr.split('@')[1]\n }\n\n dump() {\n let result = `<${this.addr}>`\n\n if (this.name) {\n result = `\"${this.name}\" ${result}`\n }\n\n return result\n }\n\n toObject() {\n return {\n name: this.name,\n addr: this.addr,\n type: this.type\n }\n }\n}\n","import MIMEMessageHeader from './MIMEMessageHeader.js'\nimport MIMEMessageContent from './MIMEMessageContent.js'\nimport MIMETextError from './MIMETextError.js'\nimport Mailbox from './Mailbox.js'\n\nexport default class MIMEMessage {\n constructor(envctx) {\n this.envctx = envctx\n this.headers = new MIMEMessageHeader('header')\n this.messages = []\n\n this.generateBoundaries()\n }\n\n generateBoundaries() {\n this.boundaries = {\n mixed: Math.random().toString(36).slice(2),\n alt: Math.random().toString(36).slice(2)\n }\n }\n\n setSender(input) {\n const mailbox = new Mailbox(input, {type: 'from'})\n\n this.setHeader('From', mailbox)\n\n return mailbox\n }\n\n getSender() {\n return this.getHeader('From')\n }\n\n setRecipients(input, opts={type: 'to'}) {\n const recs = []\n\n if (Array.isArray(input)) {\n input.map(input => recs.push( new Mailbox(input, opts) ))\n }\n else {\n recs.push( new Mailbox(input, opts) )\n }\n\n this.setHeader(opts.type, recs)\n\n return recs\n }\n\n getRecipients(opts={type: 'to'}) {\n return this.getHeader(opts.type) || []\n }\n\n setRecipient(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setTo(input) {\n return this.setRecipients(input, {type: 'to'})\n }\n\n setCc(input) {\n return this.setRecipients(input, {type: 'cc'})\n }\n\n setBcc(input) {\n return this.setRecipients(input, {type: 'bcc'})\n }\n\n setSubject(value) {\n this.setHeader('subject', value)\n return value\n }\n\n getSubject() {\n return this.getHeader('subject')\n }\n\n setHeader() {\n this.headers.set(arguments[0], arguments[1])\n return arguments[0]\n }\n\n getHeader(name) {\n return this.headers.get(name)\n }\n\n setHeaders(obj) {\n Object.keys(obj).map(prop => this.setHeader(prop, obj[prop]))\n return this\n }\n\n getHeaders() {\n return this.headers.toObject()\n }\n\n setMessage(type, data, moreHeaders={}) {\n const validTypes = ['text/html', 'text/plain']\n\n if (validTypes.indexOf(type) === -1) {\n throw new MIMETextError('INVALID_MESSAGE_TYPE', `\n Invalid content type for the message. Supported content types \\\n are ${validTypes.join(', ')} but you specified \"${type}\".\n `)\n }\n\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return msg\n }\n\n setAttachment(filename, type, data, moreHeaders={}) {\n const headers = Object.assign({}, moreHeaders, {\n 'Content-Type': `${type}; charset=UTF-8`,\n 'Content-Transfer-Encoding': 'base64',\n 'Content-Disposition': `attachment;filename=\"${filename}\"`\n })\n const msg = new MIMEMessageContent(data)\n\n msg.setHeaders(headers)\n\n this.messages.push(msg)\n\n return this\n }\n\n getMessageByType(type) {\n const matches = this.messages.filter(m => m.getHeader('Content-Type').indexOf(type) !== -1)\n if (Array.isArray(matches) && matches.length > 0) {\n return matches[0]\n }\n else {\n return undefined\n }\n }\n\n getAttachments() {\n return this.messages.filter(m => m.isAttachment() === true) || []\n }\n\n asRaw() {\n let lines = this.headers.dump(this.envctx)\n\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const hasAttachments = this.getAttachments().length > 0\n const hasPlainTextAlt = plainTextMessage instanceof MIMEMessageContent && htmlMessage instanceof MIMEMessageContent\n\n if (hasAttachments && hasPlainTextAlt) return this.asRawMixedAlt(lines)\n else if (hasAttachments) return this.asRawMixed(lines)\n else if (hasPlainTextAlt) return this.asRawAlt(lines)\n else return this.asRawMessage(lines)\n }\n\n asEncoded() {\n return this.envctx.toBase64WebSafe( this.asRaw() )\n }\n\n asRawMessage(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n\n lines = `${lines}\n${message.dump(this.envctx, this.boundaries)}`\n\n return lines\n }\n\n asRawAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n\n lines = `${lines}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--`\n\n return lines\n }\n\n asRawMixed(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const message = htmlMessage || plainTextMessage\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\n${message.dump(this.envctx, this.boundaries)}\n\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n asRawMixedAlt(lines) {\n const plainTextMessage = this.getMessageByType('text/plain')\n const htmlMessage = this.getMessageByType('text/html')\n const attachments = this.getAttachments()\n .map(a => a.dump(this.envctx, this.boundaries))\n .join('')\n .replace(/[\\r\\n]$/g, '')\n\n lines = `${lines}\nContent-Type: multipart/mixed; boundary=${this.boundaries.mixed}\n\n--${this.boundaries.mixed}\nContent-Type: multipart/alternative; boundary=${this.boundaries.alt}\n\n--${this.boundaries.alt}\n${plainTextMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}\n${htmlMessage.dump(this.envctx, this.boundaries)}\n\n--${this.boundaries.alt}--\n${attachments}\n\n--${this.boundaries.mixed}--`\n\n return lines\n }\n\n toBase64(v) {\n return this.envctx.toBase64(v)\n }\n}\n","import MIMEMessage from '../MIMEMessage.js'\n\nconst envctx = {\n toBase64: function toBase64(data) {\n return btoa(data)\n },\n toBase64WebSafe: function toBase64WebSafe(data) {\n return btoa(data)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '')\n }\n}\n\nclass NodeMIMEMessage extends MIMEMessage {\n constructor() {\n super(envctx)\n }\n}\n\nexport function createMimeMessage() {\n return new NodeMIMEMessage()\n}\n"],"names":["MIMETextError","_createSuper","message","description","replace","name","Error","MIMEMessageHeader","placement","maxLineLength","store","value","generator","Date","toGMTString","disabled","dump","v","required","ctx","toBase64","addr","arr","join","datestr","now","toString","randomstr","Math","random","domain","item","getAddrDomain","validateLength","toLowerCase","newHeader","custom","push","len","length","undefined","memo","envctx","lines","runesModule","runes_1","MIMEMessageContent","data","maxLineLen","headers","set","arguments","obj","prop","setHeader","toObject","get","d","text","split","line","chunk","runes","boundaries","headerBlock","isAttachment","mixed","configureLineLength","Mailbox","input","opts","type","reSpecCompliantAddr","inputType","findInputType","createMailbox","Object","prototype","call","test","parseSpecCompliantText","result","MIMEMessage","messages","generateBoundaries","alt","mailbox","getHeader","recs","Array","isArray","setRecipients","moreHeaders","validTypes","msg","setHeaders","filename","matches","m","plainTextMessage","getMessageByType","htmlMessage","hasAttachments","getAttachments","hasPlainTextAl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AED,EAAA,SAAA,QAAA,CAAS1B,CAAC,EAAE;AACV,MAAA,OAAO,IAAI,CAACyB,MAAM,CAACtB,QAAQ,CAACH,CAAC,CAAC,CAAA;AAChC,KAAA;AAAC,GAAA,CAAA,CAAA,CAAA;AAAA,EAAA,OAAA,WAAA,CAAA;AAAA,CAAA,EAAA;;;;ACnPH,IAAMyB,MAAM,GAAG;AACbtB,EAAAA,QAAQ,EAAE,SAASA,QAAQ,CAAC2B,IAAI,EAAE;IAChC,OAAOkE,IAAI,CAAClE,IAAI,CAAC,CAAA;GAClB;AACD8D,EAAAA,eAAe,EAAE,SAASA,eAAe,CAAC9D,IAAI,EAAE;IAC9C,OAAOkE,IAAI,CAAClE,IAAI,CAAC,CACd3C,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CACnBA,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CACnBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;AACvB,GAAA;AACF,CAAC,CAAA;AAAA,IAEK8G,eAAe,gBAAA,UAAA,YAAA,EAAA;AAAA,EAAA,SAAA,CAAA,eAAA,EAAA,YAAA,CAAA,CAAA;AAAA,EAAA,IAAA,MAAA,GAAA,YAAA,CAAA,eAAA,CAAA,CAAA;EACnB,SAAc,eAAA,GAAA;AAAA,IAAA,eAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AAAA,IAAA,OAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EACNxE,MAAM,CAAA,CAAA;AACd,GAAA;AAAC,EAAA,OAAA,YAAA,CAAA,eAAA,CAAA,CAAA;AAAA,CAAA,CAH2BwC,WAAW,CAAA,CAAA;AAMlC,SAASiC,iBAAiB,GAAG;EAClC,OAAO,IAAID,eAAe,EAAE,CAAA;AAC9B;;;;"} \ No newline at end of file diff --git a/dist/browser/iife/index.js b/dist/browser/iife/index.js index 6ee8164..2bbef15 100644 --- a/dist/browser/iife/index.js +++ b/dist/browser/iife/index.js @@ -1,2 +1,2 @@ -var MimeText=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(t){return t&&t.Math==Math&&t},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")(),o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),u=i,a=Function.prototype,c=a.apply,f=a.call,s="object"==typeof Reflect&&Reflect.apply||(u?f.bind(c):function(){return f.apply(c,arguments)}),l=i,p=Function.prototype,v=p.bind,d=p.call,h=l&&v.bind(d,d),y=l?function(t){return t&&h(t)}:function(t){return t&&function(){return d.apply(t,arguments)}},g=function(t){return"function"==typeof t},b={},m=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),S=i,w=Function.prototype.call,O=S?w.bind(w):function(){return w.apply(w,arguments)},x={},E={}.propertyIsEnumerable,T=Object.getOwnPropertyDescriptor,j=T&&!E.call({1:2},1);x.f=j?function(t){var e=T(this,t);return!!e&&e.enumerable}:E;var A,R,I=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},P=y,M=P({}.toString),k=P("".slice),C=function(t){return k(M(t),8,-1)},_=o,F=C,D=Object,N=y("".split),L=_((function(){return!D("z").propertyIsEnumerable(0)}))?function(t){return"String"==F(t)?N(t,""):D(t)}:D,B=function(t){return null==t},z=B,$=TypeError,H=function(t){if(z(t))throw $("Can't call method on "+t);return t},G=L,U=H,W=function(t){return G(U(t))},V=g,X="object"==typeof document&&document.all,q=void 0===X&&void 0!==X?function(t){return"object"==typeof t?null!==t:V(t)||t===X}:function(t){return"object"==typeof t?null!==t:V(t)},K={},J=K,Y=n,Q=g,Z=function(t){return Q(t)?t:void 0},tt=function(t,e){return arguments.length<2?Z(J[t])||Z(Y[t]):J[t]&&J[t][e]||Y[t]&&Y[t][e]},et=y({}.isPrototypeOf),rt=n,nt=tt("navigator","userAgent")||"",ot=rt.process,it=rt.Deno,ut=ot&&ot.versions||it&&it.version,at=ut&&ut.v8;at&&(R=(A=at.split("."))[0]>0&&A[0]<4?1:+(A[0]+A[1])),!R&&nt&&(!(A=nt.match(/Edge\/(\d+)/))||A[1]>=74)&&(A=nt.match(/Chrome\/(\d+)/))&&(R=+A[1]);var ct=R,ft=ct,st=o,lt=!!Object.getOwnPropertySymbols&&!st((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ft&&ft<41})),pt=lt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,vt=tt,dt=g,ht=et,yt=Object,gt=pt?function(t){return"symbol"==typeof t}:function(t){var e=vt("Symbol");return dt(e)&&ht(e.prototype,yt(t))},bt=String,mt=function(t){try{return bt(t)}catch(t){return"Object"}},St=g,wt=mt,Ot=TypeError,xt=function(t){if(St(t))return t;throw Ot(wt(t)+" is not a function")},Et=xt,Tt=B,jt=function(t,e){var r=t[e];return Tt(r)?void 0:Et(r)},At=O,Rt=g,It=q,Pt=TypeError,Mt={exports:{}},kt=n,Ct=Object.defineProperty,_t=function(t,e){try{Ct(kt,t,{value:e,configurable:!0,writable:!0})}catch(r){kt[t]=e}return e},Ft="__core-js_shared__",Dt=n[Ft]||_t(Ft,{}),Nt=Dt;(Mt.exports=function(t,e){return Nt[t]||(Nt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Lt=H,Bt=Object,zt=function(t){return Bt(Lt(t))},$t=zt,Ht=y({}.hasOwnProperty),Gt=Object.hasOwn||function(t,e){return Ht($t(t),e)},Ut=y,Wt=0,Vt=Math.random(),Xt=Ut(1..toString),qt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Xt(++Wt+Vt,36)},Kt=n,Jt=Mt.exports,Yt=Gt,Qt=qt,Zt=lt,te=pt,ee=Jt("wks"),re=Kt.Symbol,ne=re&&re.for,oe=te?re:re&&re.withoutSetter||Qt,ie=function(t){if(!Yt(ee,t)||!Zt&&"string"!=typeof ee[t]){var e="Symbol."+t;Zt&&Yt(re,t)?ee[t]=re[t]:ee[t]=te&&ne?ne(e):oe(e)}return ee[t]},ue=O,ae=q,ce=gt,fe=jt,se=function(t,e){var r,n;if("string"===e&&Rt(r=t.toString)&&!It(n=At(r,t)))return n;if(Rt(r=t.valueOf)&&!It(n=At(r,t)))return n;if("string"!==e&&Rt(r=t.toString)&&!It(n=At(r,t)))return n;throw Pt("Can't convert object to primitive value")},le=TypeError,pe=ie("toPrimitive"),ve=function(t,e){if(!ae(t)||ce(t))return t;var r,n=fe(t,pe);if(n){if(void 0===e&&(e="default"),r=ue(n,t,e),!ae(r)||ce(r))return r;throw le("Can't convert object to primitive value")}return void 0===e&&(e="number"),se(t,e)},de=gt,he=function(t){var e=ve(t,"string");return de(e)?e:e+""},ye=q,ge=n.document,be=ye(ge)&&ye(ge.createElement),me=function(t){return be?ge.createElement(t):{}},Se=me,we=!m&&!o((function(){return 7!=Object.defineProperty(Se("div"),"a",{get:function(){return 7}}).a})),Oe=m,xe=O,Ee=x,Te=I,je=W,Ae=he,Re=Gt,Ie=we,Pe=Object.getOwnPropertyDescriptor;b.f=Oe?Pe:function(t,e){if(t=je(t),e=Ae(e),Ie)try{return Pe(t,e)}catch(t){}if(Re(t,e))return Te(!xe(Ee.f,t,e),t[e])};var Me=o,ke=g,Ce=/#|\.prototype\./,_e=function(t,e){var r=De[Fe(t)];return r==Le||r!=Ne&&(ke(e)?Me(e):!!e)},Fe=_e.normalize=function(t){return String(t).replace(Ce,".").toLowerCase()},De=_e.data={},Ne=_e.NATIVE="N",Le=_e.POLYFILL="P",Be=_e,ze=xt,$e=i,He=y(y.bind),Ge=function(t,e){return ze(t),void 0===e?t:$e?He(t,e):function(){return t.apply(e,arguments)}},Ue={},We=m&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ve=q,Xe=String,qe=TypeError,Ke=function(t){if(Ve(t))return t;throw qe(Xe(t)+" is not an object")},Je=m,Ye=we,Qe=We,Ze=Ke,tr=he,er=TypeError,rr=Object.defineProperty,nr=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",ur="writable";Ue.f=Je?Qe?function(t,e,r){if(Ze(t),e=tr(e),Ze(r),"function"==typeof t&&"prototype"===e&&"value"in r&&ur in r&&!r.writable){var n=nr(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:ir in r?r.configurable:n.configurable,enumerable:or in r?r.enumerable:n.enumerable,writable:!1})}return rr(t,e,r)}:rr:function(t,e,r){if(Ze(t),e=tr(e),Ze(r),Ye)try{return rr(t,e,r)}catch(t){}if("get"in r||"set"in r)throw er("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var ar=Ue,cr=I,fr=m?function(t,e,r){return ar.f(t,e,cr(1,r))}:function(t,e,r){return t[e]=r,t},sr=n,lr=s,pr=y,vr=g,dr=b.f,hr=Be,yr=K,gr=Ge,br=fr,mr=Gt,Sr=function(t){var e=function(r,n,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,n)}return new t(r,n,o)}return lr(t,this,arguments)};return e.prototype=t.prototype,e},wr=function(t,e){var r,n,o,i,u,a,c,f,s=t.target,l=t.global,p=t.stat,v=t.proto,d=l?sr:p?sr[s]:(sr[s]||{}).prototype,h=l?yr:yr[s]||br(yr,s,{})[s],y=h.prototype;for(o in e)r=!hr(l?o:s+(p?".":"#")+o,t.forced)&&d&&mr(d,o),u=h[o],r&&(a=t.dontCallGetSet?(f=dr(d,o))&&f.value:d[o]),i=r&&a?a:e[o],r&&typeof u==typeof i||(c=t.bind&&r?gr(i,sr):t.wrap&&r?Sr(i):v&&vr(i)?pr(i):i,(t.sham||i&&i.sham||u&&u.sham)&&br(c,"sham",!0),br(h,o,c),v&&(mr(yr,n=s+"Prototype")||br(yr,n,{}),br(yr[n],o,i),t.real&&y&&!y[o]&&br(y,o,i)))},Or=y([].slice),xr=y,Er=xt,Tr=q,jr=Gt,Ar=Or,Rr=i,Ir=Function,Pr=xr([].concat),Mr=xr([].join),kr={},Cr=function(t,e,r){if(!jr(kr,e)){for(var n=[],o=0;o0?hn:dn)(e)},gn=function(t){var e=+t;return e!=e||0===e?0:yn(e)},bn=gn,mn=Math.max,Sn=Math.min,wn=function(t,e){var r=bn(t);return r<0?mn(r+e,0):Sn(r,e)},On=gn,xn=Math.min,En=function(t){return t>0?xn(On(t),9007199254740991):0},Tn=function(t){return En(t.length)},jn=W,An=wn,Rn=Tn,In=function(t){return function(e,r,n){var o,i=jn(e),u=Rn(i),a=An(n,u);if(t&&r!=r){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},Pn={includes:In(!0),indexOf:In(!1)},Mn={},kn=Gt,Cn=W,_n=Pn.indexOf,Fn=Mn,Dn=y([].push),Nn=function(t,e){var r,n=Cn(t),o=0,i=[];for(r in n)!kn(Fn,r)&&kn(n,r)&&Dn(i,r);for(;e.length>o;)kn(n,r=e[o++])&&(~_n(i,r)||Dn(i,r));return i},Ln=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bn=Nn,zn=Ln,$n=Object.keys||function(t){return Bn(t,zn)},Hn=m,Gn=We,Un=Ue,Wn=Ke,Vn=W,Xn=$n;vn.f=Hn&&!Gn?Object.defineProperties:function(t,e){Wn(t);for(var r,n=Vn(e),o=Xn(e),i=o.length,u=0;i>u;)Un.f(t,r=o[u++],n[r]);return t};var qn,Kn=tt("document","documentElement"),Jn=Mt.exports,Yn=qt,Qn=Jn("keys"),Zn=function(t){return Qn[t]||(Qn[t]=Yn(t))},to=Ke,eo=vn,ro=Ln,no=Mn,oo=Kn,io=me,uo=Zn("IE_PROTO"),ao=function(){},co=function(t){return"