UNPKG

157 kBJavaScriptView Raw
1/**
2 * @license @scola/worker@3.2.3
3 *
4 * Copyright (c) M.C. van den Boogaart <scola@kvdb.name>
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the root directory of this source tree.
8 *
9 * This source code includes code which is licensed under the licenses
10 * which can be found in LICENSE-THIRDPARTY file in the root directory
11 * of this source tree.
12 */
13
14"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var fs=_interopDefault(require("fs-extra")),cron=_interopDefault(require("node-cron"));function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function _construct(e,t,n){return(_construct=isNativeReflectConstruct()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&_setPrototypeOf(i,n.prototype),i}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var n="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(t,e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,n){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=_superPropBase(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _iterableToArrayLimit(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var LuxonError=function(){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,_getPrototypeOf(e).apply(this,arguments))}return _inherits(e,_wrapNativeSuper(Error)),e}(),InvalidDateTimeError=function(){function t(e){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,"Invalid DateTime: ".concat(e.toMessage())))}return _inherits(t,LuxonError),t}(),InvalidIntervalError=function(){function t(e){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,"Invalid Interval: ".concat(e.toMessage())))}return _inherits(t,LuxonError),t}(),InvalidDurationError=function(){function t(e){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,"Invalid Duration: ".concat(e.toMessage())))}return _inherits(t,LuxonError),t}(),ConflictingSpecificationError=function(){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,_getPrototypeOf(e).apply(this,arguments))}return _inherits(e,LuxonError),e}(),InvalidUnitError=function(){function t(e){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,"Invalid unit ".concat(e)))}return _inherits(t,LuxonError),t}(),InvalidArgumentError=function(){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,_getPrototypeOf(e).apply(this,arguments))}return _inherits(e,LuxonError),e}(),ZoneIsAbstractError=function(){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,_getPrototypeOf(e).call(this,"Zone is an abstract class"))}return _inherits(e,LuxonError),e}();function isUndefined(e){return void 0===e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}function hasIntl(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function hasFormatToParts(){return!isUndefined(Intl.DateTimeFormat.prototype.formatToParts)}function hasRelative(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function maybeArray(e){return Array.isArray(e)?e:[e]}function bestBy(e,r,i){if(0!==e.length)return e.reduce(function(e,t){var n=[r(t),t];return e&&i(e[0],n[0])===e[0]?e:n},null)[1]}function pick(n,e){return e.reduce(function(e,t){return e[t]=n[t],e},{})}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function numberBetween(e,t,n){return isNumber(e)&&t<=e&&e<=n}function floorMod(e,t){return e-t*Math.floor(e/t)}function padStart(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:2;return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function parseInteger(e){return isUndefined(e)||null===e||""===e?void 0:parseInt(e,10)}function parseMillis(e){if(!isUndefined(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function roundTo(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}function daysInYear(e){return isLeapYear(e)?366:365}function daysInMonth(e,t){var n=floorMod(t-1,12)+1;return 2===n?isLeapYear(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function objToLocalTS(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&0<=e.year&&(t=new Date(t)).setUTCFullYear(t.getUTCFullYear()-1900),+t}function weeksInWeekYear(e){var t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4==t||3==r?53:52}function untruncateYear(e){return 99<e?e:60<e?1900+e:2e3+e}function parseZoneInfo(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=new Date(e),a={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);var s=Object.assign({timeZoneName:t},a),o=hasIntl();if(o&&hasFormatToParts()){var u=new Intl.DateTimeFormat(n,s).formatToParts(i).find(function(e){return"timezonename"===e.type.toLowerCase()});return u?u.value:null}if(o){var l=new Intl.DateTimeFormat(n,a).format(i);return new Intl.DateTimeFormat(n,s).format(i).substring(l.length).replace(/^[, \u200e]+/,"")}return null}function signedOffset(e,t){var n=parseInt(e,10)||0,r=parseInt(t,10)||0;return 60*n+(n<0?-r:r)}function asNumber(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new InvalidArgumentError("Invalid unit value ".concat(e));return t}function normalizeObject(e,t,n){var r={};for(var i in e)if(hasOwnProperty(e,i)){if(0<=n.indexOf(i))continue;var a=e[i];if(null==a)continue;r[t(i)]=asNumber(a)}return r}function formatOffset(e,t){var n=Math.trunc(e/60),r=Math.abs(e%60),i=0<=n?"+":"-",a="".concat(i).concat(Math.abs(n));switch(t){case"short":return"".concat(i).concat(padStart(Math.abs(n),2),":").concat(padStart(r,2));case"narrow":return 0<r?"".concat(a,":").concat(r):a;case"techie":return"".concat(i).concat(padStart(Math.abs(n),2)).concat(padStart(r,2));default:throw new RangeError("Value format ".concat(t," is out of range for property format"))}}function timeObject(e){return pick(e,["hour","minute","second","millisecond"])}var ianaRegex=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/,n="numeric",s="short",l="long",d2="2-digit",DATE_SHORT={year:n,month:n,day:n},DATE_MED={year:n,month:s,day:n},DATE_FULL={year:n,month:l,day:n},DATE_HUGE={year:n,month:l,day:n,weekday:l},TIME_SIMPLE={hour:n,minute:d2},TIME_WITH_SECONDS={hour:n,minute:d2,second:d2},TIME_WITH_SHORT_OFFSET={hour:n,minute:d2,second:d2,timeZoneName:s},TIME_WITH_LONG_OFFSET={hour:n,minute:d2,second:d2,timeZoneName:l},TIME_24_SIMPLE={hour:n,minute:d2,hour12:!1},TIME_24_WITH_SECONDS={hour:n,minute:d2,second:d2,hour12:!1},TIME_24_WITH_SHORT_OFFSET={hour:n,minute:d2,second:d2,hour12:!1,timeZoneName:s},TIME_24_WITH_LONG_OFFSET={hour:n,minute:d2,second:d2,hour12:!1,timeZoneName:l},DATETIME_SHORT={year:n,month:n,day:n,hour:n,minute:d2},DATETIME_SHORT_WITH_SECONDS={year:n,month:n,day:n,hour:n,minute:d2,second:d2},DATETIME_MED={year:n,month:s,day:n,hour:n,minute:d2},DATETIME_MED_WITH_SECONDS={year:n,month:s,day:n,hour:n,minute:d2,second:d2},DATETIME_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s,hour:n,minute:d2},DATETIME_FULL={year:n,month:l,day:n,hour:n,minute:d2,timeZoneName:s},DATETIME_FULL_WITH_SECONDS={year:n,month:l,day:n,hour:n,minute:d2,second:d2,timeZoneName:s},DATETIME_HUGE={year:n,month:l,day:n,weekday:l,hour:n,minute:d2,timeZoneName:l},DATETIME_HUGE_WITH_SECONDS={year:n,month:l,day:n,weekday:l,hour:n,minute:d2,second:d2,timeZoneName:l};function stringify(e){return JSON.stringify(e,Object.keys(e).sort())}var monthsLong=["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsNarrow=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return monthsNarrow;case"short":return monthsShort;case"long":return monthsLong;case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var weekdaysLong=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysNarrow=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return weekdaysNarrow;case"short":return weekdaysShort;case"long":return weekdaysLong;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var meridiems=["AM","PM"],erasLong=["Before Christ","Anno Domini"],erasShort=["BC","AD"],erasNarrow=["B","A"];function eras(e){switch(e){case"narrow":return erasNarrow;case"short":return erasShort;case"long":return erasLong;default:return null}}function meridiemForDateTime(e){return meridiems[e.hour<12?0:1]}function weekdayForDateTime(e,t){return weekdays(t)[e.weekday-1]}function monthForDateTime(e,t){return months(t)[e.month-1]}function eraForDateTime(e,t){return eras(t)[e.year<0?0:1]}function formatRelativeTime(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"always",r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&a){var s="days"===e;switch(t){case 1:return s?"tomorrow":"next ".concat(i[e][0]);case-1:return s?"yesterday":"last ".concat(i[e][0]);case 0:return s?"today":"this ".concat(i[e][0])}}var o=Object.is(t,-0)||t<0,u=Math.abs(t),l=1===u,c=i[e],h=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return o?"".concat(u," ").concat(h," ago"):"in ".concat(u," ").concat(h)}function formatString(e){var t="EEEE, LLLL d, yyyy, h:mm a";switch(stringify(pick(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case stringify(DATE_SHORT):return"M/d/yyyy";case stringify(DATE_MED):return"LLL d, yyyy";case stringify(DATE_FULL):return"LLLL d, yyyy";case stringify(DATE_HUGE):return"EEEE, LLLL d, yyyy";case stringify(TIME_SIMPLE):return"h:mm a";case stringify(TIME_WITH_SECONDS):return"h:mm:ss a";case stringify(TIME_WITH_SHORT_OFFSET):case stringify(TIME_WITH_LONG_OFFSET):return"h:mm a";case stringify(TIME_24_SIMPLE):return"HH:mm";case stringify(TIME_24_WITH_SECONDS):return"HH:mm:ss";case stringify(TIME_24_WITH_SHORT_OFFSET):case stringify(TIME_24_WITH_LONG_OFFSET):return"HH:mm";case stringify(DATETIME_SHORT):return"M/d/yyyy, h:mm a";case stringify(DATETIME_MED):return"LLL d, yyyy, h:mm a";case stringify(DATETIME_FULL):return"LLLL d, yyyy, h:mm a";case stringify(DATETIME_HUGE):return t;case stringify(DATETIME_SHORT_WITH_SECONDS):return"M/d/yyyy, h:mm:ss a";case stringify(DATETIME_MED_WITH_SECONDS):return"LLL d, yyyy, h:mm:ss a";case stringify(DATETIME_MED_WITH_WEEKDAY):return"EEE, d LLL yyyy, h:mm a";case stringify(DATETIME_FULL_WITH_SECONDS):return"LLLL d, yyyy, h:mm:ss a";case stringify(DATETIME_HUGE_WITH_SECONDS):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}var Zone=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"offsetName",value:function(e,t){throw new ZoneIsAbstractError}},{key:"formatOffset",value:function(e,t){throw new ZoneIsAbstractError}},{key:"offset",value:function(e){throw new ZoneIsAbstractError}},{key:"equals",value:function(e){throw new ZoneIsAbstractError}},{key:"type",get:function(){throw new ZoneIsAbstractError}},{key:"name",get:function(){throw new ZoneIsAbstractError}},{key:"universal",get:function(){throw new ZoneIsAbstractError}},{key:"isValid",get:function(){throw new ZoneIsAbstractError}}]),e}(),singleton=null,LocalZone=function(){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,_getPrototypeOf(e).apply(this,arguments))}return _inherits(e,Zone),_createClass(e,[{key:"offsetName",value:function(e,t){return parseZoneInfo(e,t.format,t.locale)}},{key:"formatOffset",value:function(e,t){return formatOffset(this.offset(e),t)}},{key:"offset",value:function(e){return-new Date(e).getTimezoneOffset()}},{key:"equals",value:function(e){return"local"===e.type}},{key:"type",get:function(){return"local"}},{key:"name",get:function(){return hasIntl()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===singleton&&(singleton=new e),singleton}}]),e}(),matchingRegex=RegExp("^".concat(ianaRegex.source,"$")),dtfCache={};function makeDTF(e){return dtfCache[e]||(dtfCache[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),dtfCache[e]}var typeToPos={year:0,month:1,day:2,hour:3,minute:4,second:5};function hackyOffset(e,t){var n=e.format(t).replace(/\u200E/g,""),r=_slicedToArray(/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),7),i=r[1],a=r[2];return[r[3],i,a,r[4],r[5],r[6]]}function partsOffset(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var a=n[i],s=a.type,o=a.value,u=typeToPos[s];isUndefined(u)||(r[u]=parseInt(o,10))}return r}var ianaZoneCache={},IANAZone=function(){function n(e){var t;return _classCallCheck(this,n),(t=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this))).zoneName=e,t.valid=n.isValidZone(e),t}return _inherits(n,Zone),_createClass(n,null,[{key:"create",value:function(e){return ianaZoneCache[e]||(ianaZoneCache[e]=new n(e)),ianaZoneCache[e]}},{key:"resetCache",value:function(){ianaZoneCache={},dtfCache={}}},{key:"isValidSpecifier",value:function(e){return!(!e||!e.match(matchingRegex))}},{key:"isValidZone",value:function(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}},{key:"parseGMTOffset",value:function(e){if(e){var t=e.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null}}]),_createClass(n,[{key:"offsetName",value:function(e,t){return parseZoneInfo(e,t.format,t.locale,this.name)}},{key:"formatOffset",value:function(e,t){return formatOffset(this.offset(e),t)}},{key:"offset",value:function(e){var t=new Date(e),n=makeDTF(this.name),r=_slicedToArray(n.formatToParts?partsOffset(n,t):hackyOffset(n,t),6),i=objToLocalTS({year:r[0],month:r[1],day:r[2],hour:r[3],minute:r[4],second:r[5],millisecond:0}),a=t.valueOf();return(i-(a-=a%1e3))/6e4}},{key:"equals",value:function(e){return"iana"===e.type&&e.name===this.name}},{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),n}(),singleton$1=null,FixedOffsetZone=function(){function n(e){var t;return _classCallCheck(this,n),(t=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this))).fixed=e,t}return _inherits(n,Zone),_createClass(n,null,[{key:"instance",value:function(e){return 0===e?n.utcInstance:new n(e)}},{key:"parseSpecifier",value:function(e){if(e){var t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new n(signedOffset(t[1],t[2]))}return null}},{key:"utcInstance",get:function(){return null===singleton$1&&(singleton$1=new n(0)),singleton$1}}]),_createClass(n,[{key:"offsetName",value:function(){return this.name}},{key:"formatOffset",value:function(e,t){return formatOffset(this.fixed,t)}},{key:"offset",value:function(){return this.fixed}},{key:"equals",value:function(e){return"fixed"===e.type&&e.fixed===this.fixed}},{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC".concat(formatOffset(this.fixed,"narrow"))}},{key:"universal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}]),n}(),InvalidZone=function(){function n(e){var t;return _classCallCheck(this,n),(t=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this))).zoneName=e,t}return _inherits(n,Zone),_createClass(n,[{key:"offsetName",value:function(){return null}},{key:"formatOffset",value:function(){return""}},{key:"offset",value:function(){return NaN}},{key:"equals",value:function(){return!1}},{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),n}();function normalizeZone(e,t){var n;if(isUndefined(e)||null===e)return t;if(e instanceof Zone)return e;if(isString(e)){var r=e.toLowerCase();return"local"===r?t:"utc"===r||"gmt"===r?FixedOffsetZone.utcInstance:null!=(n=IANAZone.parseGMTOffset(e))?FixedOffsetZone.instance(n):IANAZone.isValidSpecifier(r)?IANAZone.create(e):FixedOffsetZone.parseSpecifier(r)||new InvalidZone(e)}return isNumber(e)?FixedOffsetZone.instance(e):"object"===_typeof(e)&&e.offset&&"number"==typeof e.offset?e:new InvalidZone(e)}var now=function(){return Date.now()},defaultZone=null,defaultLocale=null,defaultNumberingSystem=null,defaultOutputCalendar=null,throwOnInvalid=!1,Settings=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"resetCaches",value:function(){Locale.resetCache(),IANAZone.resetCache()}},{key:"now",get:function(){return now},set:function(e){now=e}},{key:"defaultZoneName",get:function(){return e.defaultZone.name},set:function(e){defaultZone=e?normalizeZone(e):null}},{key:"defaultZone",get:function(){return defaultZone||LocalZone.instance}},{key:"defaultLocale",get:function(){return defaultLocale},set:function(e){defaultLocale=e}},{key:"defaultNumberingSystem",get:function(){return defaultNumberingSystem},set:function(e){defaultNumberingSystem=e}},{key:"defaultOutputCalendar",get:function(){return defaultOutputCalendar},set:function(e){defaultOutputCalendar=e}},{key:"throwOnInvalid",get:function(){return throwOnInvalid},set:function(e){throwOnInvalid=e}}]),e}();function stringifyTokens(e,t){var n="",r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done);r=!0){var u=s.value;u.literal?n+=u.val:n+=t(u.val)}}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}var tokenToObject={D:DATE_SHORT,DD:DATE_MED,DDD:DATE_FULL,DDDD:DATE_HUGE,t:TIME_SIMPLE,tt:TIME_WITH_SECONDS,ttt:TIME_WITH_SHORT_OFFSET,tttt:TIME_WITH_LONG_OFFSET,T:TIME_24_SIMPLE,TT:TIME_24_WITH_SECONDS,TTT:TIME_24_WITH_SHORT_OFFSET,TTTT:TIME_24_WITH_LONG_OFFSET,f:DATETIME_SHORT,ff:DATETIME_MED,fff:DATETIME_FULL,ffff:DATETIME_HUGE,F:DATETIME_SHORT_WITH_SECONDS,FF:DATETIME_MED_WITH_SECONDS,FFF:DATETIME_FULL_WITH_SECONDS,FFFF:DATETIME_HUGE_WITH_SECONDS},Formatter=function(){function c(e,t){_classCallCheck(this,c),this.opts=t,this.loc=e,this.systemLoc=null}return _createClass(c,null,[{key:"create",value:function(e,t){return new c(e,1<arguments.length&&void 0!==t?t:{})}},{key:"parseFormat",value:function(e){for(var t=null,n="",r=!1,i=[],a=0;a<e.length;a++){var s=e.charAt(a);"'"===s?(0<n.length&&i.push({literal:r,val:n}),t=null,n="",r=!r):r?n+=s:s===t?n+=s:(0<n.length&&i.push({literal:!1,val:n}),t=n=s)}return 0<n.length&&i.push({literal:r,val:n}),i}}]),_createClass(c,[{key:"formatWithSystemDefault",value:function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()}},{key:"formatDateTime",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return this.loc.dtFormatter(e,Object.assign({},this.opts,n)).format()}},{key:"formatDateTimeParts",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return this.loc.dtFormatter(e,Object.assign({},this.opts,n)).formatToParts()}},{key:"resolvedOptions",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return this.loc.dtFormatter(e,Object.assign({},this.opts,n)).resolvedOptions()}},{key:"num",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;if(this.opts.forceSimple)return padStart(e,n);var r=Object.assign({},this.opts);return 0<n&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}},{key:"formatDateTimeFromString",value:function(n,e){function r(e,t){return u.loc.extract(n,e,t)}function i(e){return n.isOffsetFixed&&0===n.offset&&e.allowZ?"Z":n.isValid?n.zone.formatOffset(n.ts,e.format):""}function a(e,t){return l?monthForDateTime(n,e):r(t?{month:e}:{month:e,day:"numeric"},"month")}function s(e,t){return l?weekdayForDateTime(n,e):r(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")}function o(e){return l?eraForDateTime(n,e):r({era:e},"era")}var u=this,l="en"===this.loc.listingMode();return stringifyTokens(c.parseFormat(e),function(e){var t=u.loc.outputCalendar;switch(e){case"S":return u.num(n.millisecond);case"u":case"SSS":return u.num(n.millisecond,3);case"s":return u.num(n.second);case"ss":return u.num(n.second,2);case"m":return u.num(n.minute);case"mm":return u.num(n.minute,2);case"h":return u.num(n.hour%12==0?12:n.hour%12);case"hh":return u.num(n.hour%12==0?12:n.hour%12,2);case"H":return u.num(n.hour);case"HH":return u.num(n.hour,2);case"Z":return i({format:"narrow",allowZ:u.opts.allowZ});case"ZZ":return i({format:"short",allowZ:u.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:!1});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:u.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:u.loc.locale});case"z":return n.zoneName;case"a":return l?meridiemForDateTime(n):r({hour:"numeric",hour12:!0},"dayperiod");case"d":return t?r({day:"numeric"},"day"):u.num(n.day);case"dd":return t?r({day:"2-digit"},"day"):u.num(n.day,2);case"c":return u.num(n.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"E":return u.num(n.weekday);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return t?r({month:"numeric",day:"numeric"},"month"):u.num(n.month);case"LL":return t?r({month:"2-digit",day:"numeric"},"month"):u.num(n.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return t?r({month:"numeric"},"month"):u.num(n.month);case"MM":return t?r({month:"2-digit"},"month"):u.num(n.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return t?r({year:"numeric"},"year"):u.num(n.year);case"yy":return t?r({year:"2-digit"},"year"):u.num(n.year.toString().slice(-2),2);case"yyyy":return t?r({year:"numeric"},"year"):u.num(n.year,4);case"yyyyyy":return t?r({year:"numeric"},"year"):u.num(n.year,6);case"G":return o("short");case"GG":return o("long");case"GGGGG":return o("narrow");case"kk":return u.num(n.weekYear.toString().slice(-2),2);case"kkkk":return u.num(n.weekYear,4);case"W":return u.num(n.weekNumber);case"WW":return u.num(n.weekNumber,2);case"o":return u.num(n.ordinal);case"ooo":return u.num(n.ordinal,3);case"q":return u.num(n.quarter);case"qq":return u.num(n.quarter,2);case"X":return u.num(Math.floor(n.ts/1e3));case"x":return u.num(n.ts);default:return function(e){var t=tokenToObject[e];return t?u.formatWithSystemDefault(n,t):e}(e)}})}},{key:"formatDurationFromString",value:function(e,t){function n(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}}var r,i=this,a=c.parseFormat(t),s=a.reduce(function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)},[]),o=e.shiftTo.apply(e,_toConsumableArray(s.map(n).filter(function(e){return e})));return stringifyTokens(a,(r=o,function(e){var t=n(e);return t?i.num(r.get(t),e.length):e}))}}]),c}(),intlDTCache={};function getCachedDTF(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=JSON.stringify([e,t]),r=intlDTCache[n];return r||(r=new Intl.DateTimeFormat(e,t),intlDTCache[n]=r),r}var intlNumCache={};function getCachendINF(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=JSON.stringify([e,t]),r=intlNumCache[n];return r||(r=new Intl.NumberFormat(e,t),intlNumCache[n]=r),r}var intlRelCache={};function getCachendRTF(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=JSON.stringify([e,t]),r=intlRelCache[n];return r||(r=new Intl.RelativeTimeFormat(e,t),intlRelCache[n]=r),r}var sysLocaleCache=null;function systemLocale(){if(sysLocaleCache)return sysLocaleCache;if(hasIntl()){var e=(new Intl.DateTimeFormat).resolvedOptions().locale;return sysLocaleCache="und"===e?"en-US":e}return sysLocaleCache="en-US"}function parseLocaleString(e){var t=e.indexOf("-u-");if(-1===t)return[e];var n,r=e.substring(0,t);try{n=getCachedDTF(e).resolvedOptions()}catch(e){n=getCachedDTF(r).resolvedOptions()}var i=n;return[r,i.numberingSystem,i.calendar]}function intlConfigString(e,t,n){return hasIntl()?((n||t)&&(e+="-u",n&&(e+="-ca-".concat(n)),t&&(e+="-nu-".concat(t))),e):[]}function mapMonths(e){for(var t=[],n=1;n<=12;n++){var r=DateTime.utc(2016,n,1);t.push(e(r))}return t}function mapWeekdays(e){for(var t=[],n=1;n<=7;n++){var r=DateTime.utc(2016,11,13+n);t.push(e(r))}return t}function listStuff(e,t,n,r,i){var a=e.listingMode(n);return"error"===a?null:"en"===a?r(t):i(t)}function supportsFastNumbers(e){return(!e.numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||hasIntl()&&"latn"===Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)}var PolyNumberFormatter=function(){function i(e,t,n){if(_classCallCheck(this,i),this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&hasIntl()){var r={useGrouping:!1};0<n.padTo&&(r.minimumIntegerDigits=n.padTo),this.inf=getCachendINF(e,r)}}return _createClass(i,[{key:"format",value:function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return padStart(this.floor?Math.floor(e):roundTo(e,3),this.padTo)}}]),i}(),PolyDateFormatter=function(){function a(e,t,n){var r;if(_classCallCheck(this,a),this.opts=n,this.hasIntl=hasIntl(),e.zone.universal&&this.hasIntl?(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:DateTime.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:r=(this.dt=e).zone.name,this.hasIntl){var i=Object.assign({},this.opts);r&&(i.timeZone=r),this.dtf=getCachedDTF(t,i)}}return _createClass(a,[{key:"format",value:function(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());var e=formatString(this.opts),t=Locale.create("en-US");return Formatter.create(t).formatDateTimeFromString(this.dt,e)}},{key:"formatToParts",value:function(){return this.hasIntl&&hasFormatToParts()?this.dtf.formatToParts(this.dt.toJSDate()):[]}},{key:"resolvedOptions",value:function(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}]),a}(),PolyRelFormatter=function(){function r(e,t,n){_classCallCheck(this,r),this.opts=Object.assign({style:"long"},n),!t&&hasRelative()&&(this.rtf=getCachendRTF(e,n))}return _createClass(r,[{key:"format",value:function(e,t){return this.rtf?this.rtf.format(e,t):formatRelativeTime(t,e,this.opts.numeric,"long"!==this.opts.style)}},{key:"formatToParts",value:function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}]),r}(),Locale=function(){function u(e,t,n,r){_classCallCheck(this,u);var i=_slicedToArray(parseLocaleString(e),3),a=i[0],s=i[1],o=i[2];this.locale=a,this.numberingSystem=t||s||null,this.outputCalendar=n||o||null,this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}return _createClass(u,null,[{key:"fromOpts",value:function(e){return u.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}},{key:"create",value:function(e,t,n,r){var i=3<arguments.length&&void 0!==r&&r,a=e||Settings.defaultLocale;return new u(a||(i?"en-US":systemLocale()),t||Settings.defaultNumberingSystem,n||Settings.defaultOutputCalendar,a)}},{key:"resetCache",value:function(){sysLocaleCache=null,intlDTCache={},intlNumCache={},intlRelCache={}}},{key:"fromObject",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return u.create(n,r,i)}}]),_createClass(u,[{key:"listingMode",value:function(e){var t=!(0<arguments.length&&void 0!==e)||e,n=hasIntl()&&hasFormatToParts(),r=this.isEnglish(),i=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return n||r&&i||t?!n||r&&i?"en":"intl":"error"}},{key:"clone",value:function(e){return e&&0!==Object.getOwnPropertyNames(e).length?u.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}},{key:"redefaultToEN",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this.clone(Object.assign({},t,{defaultToEN:!0}))}},{key:"redefaultToSystem",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this.clone(Object.assign({},t,{defaultToEN:!1}))}},{key:"months",value:function(n,e,t){var r=this,i=1<arguments.length&&void 0!==e&&e;return listStuff(this,n,!(2<arguments.length&&void 0!==t)||t,months,function(){var t=i?{month:n,day:"numeric"}:{month:n},e=i?"format":"standalone";return r.monthsCache[e][n]||(r.monthsCache[e][n]=mapMonths(function(e){return r.extract(e,t,"month")})),r.monthsCache[e][n]})}},{key:"weekdays",value:function(n,e,t){var r=this,i=1<arguments.length&&void 0!==e&&e;return listStuff(this,n,!(2<arguments.length&&void 0!==t)||t,weekdays,function(){var t=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},e=i?"format":"standalone";return r.weekdaysCache[e][n]||(r.weekdaysCache[e][n]=mapWeekdays(function(e){return r.extract(e,t,"weekday")})),r.weekdaysCache[e][n]})}},{key:"meridiems",value:function(e){var n=this;return listStuff(this,void 0,!(0<arguments.length&&void 0!==e)||e,function(){return meridiems},function(){if(!n.meridiemCache){var t={hour:"numeric",hour12:!0};n.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map(function(e){return n.extract(e,t,"dayperiod")})}return n.meridiemCache})}},{key:"eras",value:function(e,t){var n=this;return listStuff(this,e,!(1<arguments.length&&void 0!==t)||t,eras,function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map(function(e){return n.extract(e,t,"era")})),n.eraCache[e]})}},{key:"extract",value:function(e,t,n){var r=this.dtFormatter(e,t).formatToParts().find(function(e){return e.type.toLowerCase()===n});return r?r.value:null}},{key:"numberFormatter",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return new PolyNumberFormatter(this.intl,t.forceSimple||this.fastNumbers,t)}},{key:"dtFormatter",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return new PolyDateFormatter(e,this.intl,n)}},{key:"relFormatter",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return new PolyRelFormatter(this.intl,this.isEnglish(),t)}},{key:"isEnglish",value:function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||hasIntl()&&Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}},{key:"equals",value:function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}},{key:"fastNumbers",get:function(){return null==this.fastNumbersCached&&(this.fastNumbersCached=supportsFastNumbers(this)),this.fastNumbersCached}}]),u}();function combineRegexes(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce(function(e,t){return e+t.source},"");return RegExp("^".concat(r,"$"))}function combineExtractors(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(c){return t.reduce(function(e,t){var n=_slicedToArray(e,3),r=n[0],i=n[1],a=n[2],s=_slicedToArray(t(c,a),3),o=s[0],u=s[1],l=s[2];return[Object.assign(r,o),i||u,l]},[{},null,1]).slice(0,2)}}function parse(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,a=n;i<a.length;i++){var s=_slicedToArray(a[i],2),o=s[0],u=s[1],l=o.exec(e);if(l)return u(l)}return[null,null]}function simpleParse(){for(var e=arguments.length,i=new Array(e),t=0;t<e;t++)i[t]=arguments[t];return function(e,t){var n,r={};for(n=0;n<i.length;n++)r[i[n]]=parseInteger(e[t+n]);return[r,null,t+n]}}var offsetRegex=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,isoTimeBaseRegex=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,isoTimeRegex=RegExp("".concat(isoTimeBaseRegex.source).concat(offsetRegex.source,"?")),isoTimeExtensionRegex=RegExp("(?:T".concat(isoTimeRegex.source,")?")),isoYmdRegex=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,isoWeekRegex=/(\d{4})-?W(\d\d)(?:-?(\d))?/,isoOrdinalRegex=/(\d{4})-?(\d{3})/,extractISOWeekData=simpleParse("weekYear","weekNumber","weekDay"),extractISOOrdinalData=simpleParse("year","ordinal"),sqlYmdRegex=/(\d{4})-(\d\d)-(\d\d)/,sqlTimeRegex=RegExp("".concat(isoTimeBaseRegex.source," ?(?:").concat(offsetRegex.source,"|(").concat(ianaRegex.source,"))?")),sqlTimeExtensionRegex=RegExp("(?: ".concat(sqlTimeRegex.source,")?"));function _int(e,t,n){var r=e[t];return isUndefined(r)?n:parseInteger(r)}function extractISOYmd(e,t){return[{year:_int(e,t),month:_int(e,t+1,1),day:_int(e,t+2,1)},null,t+3]}function extractISOTime(e,t){return[{hour:_int(e,t,0),minute:_int(e,t+1,0),second:_int(e,t+2,0),millisecond:parseMillis(e[t+3])},null,t+4]}function extractISOOffset(e,t){var n=!e[t]&&!e[t+1],r=signedOffset(e[t+1],e[t+2]);return[{},n?null:FixedOffsetZone.instance(r),t+3]}function extractIANAZone(e,t){return[{},e[t]?IANAZone.create(e[t]):null,t+1]}var isoDuration=/^P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;function extractISODuration(e){var t=_slicedToArray(e,9),n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],l=t[8];return[{years:parseInteger(n),months:parseInteger(r),weeks:parseInteger(i),days:parseInteger(a),hours:parseInteger(s),minutes:parseInteger(o),seconds:parseInteger(u),milliseconds:parseMillis(l)}]}var obsOffsets={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fromStrings(e,t,n,r,i,a,s){var o={year:2===t.length?untruncateYear(parseInteger(t)):parseInteger(t),month:monthsShort.indexOf(n)+1,day:parseInteger(r),hour:parseInteger(i),minute:parseInteger(a)};return s&&(o.second=parseInteger(s)),e&&(o.weekday=3<e.length?weekdaysLong.indexOf(e)+1:weekdaysShort.indexOf(e)+1),o}var rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(e){var t,n=_slicedToArray(e,12),r=n[1],i=n[2],a=n[3],s=n[4],o=n[5],u=n[6],l=n[7],c=n[8],h=n[9],f=n[10],d=n[11],m=fromStrings(r,s,a,i,o,u,l);return t=c?obsOffsets[c]:h?0:signedOffset(f,d),[m,new FixedOffsetZone(t)]}function preprocessRFC2822(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var rfc1123=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rfc850=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ascii=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(e){var t=_slicedToArray(e,8),n=t[1],r=t[2],i=t[3];return[fromStrings(n,t[4],i,r,t[5],t[6],t[7]),FixedOffsetZone.utcInstance]}function extractASCII(e){var t=_slicedToArray(e,8),n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6];return[fromStrings(n,t[7],r,i,a,s,o),FixedOffsetZone.utcInstance]}var isoYmdWithTimeExtensionRegex=combineRegexes(isoYmdRegex,isoTimeExtensionRegex),isoWeekWithTimeExtensionRegex=combineRegexes(isoWeekRegex,isoTimeExtensionRegex),isoOrdinalWithTimeExtensionRegex=combineRegexes(isoOrdinalRegex,isoTimeExtensionRegex),isoTimeCombinedRegex=combineRegexes(isoTimeRegex),extractISOYmdTimeAndOffset=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset),extractISOWeekTimeAndOffset=combineExtractors(extractISOWeekData,extractISOTime,extractISOOffset),extractISOOrdinalDataAndTime=combineExtractors(extractISOOrdinalData,extractISOTime),extractISOTimeAndOffset=combineExtractors(extractISOTime,extractISOOffset);function parseISODate(e){return parse(e,[isoYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[isoWeekWithTimeExtensionRegex,extractISOWeekTimeAndOffset],[isoOrdinalWithTimeExtensionRegex,extractISOOrdinalDataAndTime],[isoTimeCombinedRegex,extractISOTimeAndOffset])}function parseRFC2822Date(e){return parse(preprocessRFC2822(e),[rfc2822,extractRFC2822])}function parseHTTPDate(e){return parse(e,[rfc1123,extractRFC1123Or850],[rfc850,extractRFC1123Or850],[ascii,extractASCII])}function parseISODuration(e){return parse(e,[isoDuration,extractISODuration])}var sqlYmdWithTimeExtensionRegex=combineRegexes(sqlYmdRegex,sqlTimeExtensionRegex),sqlTimeCombinedRegex=combineRegexes(sqlTimeRegex),extractISOYmdTimeOffsetAndIANAZone=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),extractISOTimeOffsetAndIANAZone=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(e){return parse(e,[sqlYmdWithTimeExtensionRegex,extractISOYmdTimeOffsetAndIANAZone],[sqlTimeCombinedRegex,extractISOTimeOffsetAndIANAZone])}var Invalid=function(){function n(e,t){_classCallCheck(this,n),this.reason=e,this.explanation=t}return _createClass(n,[{key:"toMessage",value:function(){return this.explanation?"".concat(this.reason,": ").concat(this.explanation):this.reason}}]),n}(),INVALID="Invalid Duration",lowOrderMatrix={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},casualMatrix=Object.assign({years:{months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},lowOrderMatrix),daysInYearAccurate=365.2425,daysInMonthAccurate=30.436875,accurateMatrix=Object.assign({years:{months:12,weeks:daysInYearAccurate/7,days:daysInYearAccurate,hours:24*daysInYearAccurate,minutes:24*daysInYearAccurate*60,seconds:24*daysInYearAccurate*60*60,milliseconds:24*daysInYearAccurate*60*60*1e3},quarters:{months:3,weeks:daysInYearAccurate/28,days:daysInYearAccurate/4,hours:24*daysInYearAccurate/4,minutes:24*daysInYearAccurate*60/4,seconds:24*daysInYearAccurate*60*60/4,milliseconds:24*daysInYearAccurate*60*60*1e3/4},months:{weeks:daysInMonthAccurate/7,days:daysInMonthAccurate,hours:24*daysInMonthAccurate,minutes:24*daysInMonthAccurate*60,seconds:24*daysInMonthAccurate*60*60,milliseconds:24*daysInMonthAccurate*60*60*1e3}},lowOrderMatrix),orderedUnits=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],reverseUnits=orderedUnits.slice(0).reverse();function clone(e,t){var n={values:2<arguments.length&&void 0!==arguments[2]&&arguments[2]?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Duration(n)}function antiTrunc(e){return e<0?Math.floor(e):Math.ceil(e)}function convert(e,t,n,r,i){var a=e[i][n],s=t[n]/a,o=!(Math.sign(s)===Math.sign(r[i]))&&0!==r[i]&&Math.abs(s)<=1?antiTrunc(s):Math.trunc(s);r[i]+=o,t[n]-=o*a}function normalizeValues(n,r){reverseUnits.reduce(function(e,t){return isUndefined(r[t])?e:(e&&convert(n,r,e,r,t),t)},null)}var Duration=function(){function y(e){_classCallCheck(this,y);var t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||Locale.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?accurateMatrix:casualMatrix,this.isLuxonDuration=!0}return _createClass(y,[{key:"toFormat",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=Object.assign({},n,{floor:!1!==n.round&&!1!==n.floor});return this.isValid?Formatter.create(this.loc,r).formatDurationFromString(this,e):INVALID}},{key:"toObject",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};if(!this.isValid)return{};var n=Object.assign({},this.values);return t.includeConfig&&(n.conversionAccuracy=this.conversionAccuracy,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}},{key:"toISO",value:function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=this.seconds+this.milliseconds/1e3+"S"),"P"===e&&(e+="T0S"),e}},{key:"toJSON",value:function(){return this.toISO()}},{key:"toString",value:function(){return this.toISO()}},{key:"valueOf",value:function(){return this.as("milliseconds")}},{key:"plus",value:function(e){if(!this.isValid)return this;for(var t=friendlyDuration(e),n={},r=0,i=orderedUnits;r<i.length;r++){var a=i[r];(hasOwnProperty(t.values,a)||hasOwnProperty(this.values,a))&&(n[a]=t.get(a)+this.get(a))}return clone(this,{values:n},!0)}},{key:"minus",value:function(e){if(!this.isValid)return this;var t=friendlyDuration(e);return this.plus(t.negate())}},{key:"get",value:function(e){return this[y.normalizeUnit(e)]}},{key:"set",value:function(e){return this.isValid?clone(this,{values:Object.assign(this.values,normalizeObject(e,y.normalizeUnit,[]))}):this}},{key:"reconfigure",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,a={loc:this.loc.clone({locale:n,numberingSystem:r})};return i&&(a.conversionAccuracy=i),clone(this,a)}},{key:"as",value:function(e){return this.isValid?this.shiftTo(e).get(e):NaN}},{key:"normalize",value:function(){if(!this.isValid)return this;var e=this.toObject();return normalizeValues(this.matrix,e),y.fromObject(e)}},{key:"shiftTo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!this.isValid)return this;if(0===t.length)return this;t=t.map(function(e){return y.normalizeUnit(e)});var r,i={},a={},s=this.toObject();normalizeValues(this.matrix,s);for(var o=0,u=orderedUnits;o<u.length;o++){var l=u[o];if(0<=t.indexOf(l)){r=l;var c=0;for(var h in a)c+=this.matrix[h][l]*a[h],a[h]=0;isNumber(s[l])&&(c+=s[l]);var f=Math.trunc(c);for(var d in i[l]=f,a[l]=c-f,s)orderedUnits.indexOf(d)>orderedUnits.indexOf(l)&&convert(this.matrix,s,d,i,l)}else isNumber(s[l])&&(a[l]=s[l])}for(var m in a)0!==a[m]&&(i[r]+=m===r?a[m]:a[m]/this.matrix[r][m]);return clone(this,{values:i},!0)}},{key:"negate",value:function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=-this.values[r]}return clone(this,{values:e},!0)}},{key:"equals",value:function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=orderedUnits;t<n.length;t++){var r=n[t];if(this.values[r]!==e.values[r])return!1}return!0}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}],[{key:"fromMillis",value:function(e,t){return y.fromObject(Object.assign({milliseconds:e},t))}},{key:"fromObject",value:function(e){if(null==e||"object"!==_typeof(e))throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got ".concat(null===e?"null":_typeof(e)));return new y({values:normalizeObject(e,y.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:Locale.fromObject(e),conversionAccuracy:e.conversionAccuracy})}},{key:"fromISO",value:function(e,t){var n=_slicedToArray(parseISODuration(e),1)[0];if(n){var r=Object.assign(n,t);return y.fromObject(r)}return y.invalid("unparsable",'the input "'.concat(e,"\" can't be parsed as ISO 8601"))}},{key:"invalid",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(!e)throw new InvalidArgumentError("need to specify a reason the Duration is invalid");var n=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid)throw new InvalidDurationError(n);return new y({invalid:n})}},{key:"normalizeUnit",value:function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new InvalidUnitError(e);return t}},{key:"isDuration",value:function(e){return e&&e.isLuxonDuration||!1}}]),y}();function friendlyDuration(e){if(isNumber(e))return Duration.fromMillis(e);if(Duration.isDuration(e))return e;if("object"===_typeof(e))return Duration.fromObject(e);throw new InvalidArgumentError("Unknown duration argument ".concat(e," of type ").concat(_typeof(e)))}var INVALID$1="Invalid Interval";function validateStartEnd(e,t){return e&&e.isValid?t&&t.isValid?t<e?Interval.invalid("end before start","The end of an interval must be after its start, but you had start=".concat(e.toISO()," and end=").concat(t.toISO())):null:Interval.invalid("missing or invalid end"):Interval.invalid("missing or invalid start")}var Interval=function(){function d(e){_classCallCheck(this,d),this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}return _createClass(d,[{key:"length",value:function(e){var t=0<arguments.length&&void 0!==e?e:"milliseconds";return this.isValid?this.toDuration.apply(this,[t]).get(t):NaN}},{key:"count",value:function(e){var t=0<arguments.length&&void 0!==e?e:"milliseconds";if(!this.isValid)return NaN;var n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}},{key:"hasSame",value:function(e){return!!this.isValid&&this.e.minus(1).hasSame(this.s,e)}},{key:"isEmpty",value:function(){return this.s.valueOf()===this.e.valueOf()}},{key:"isAfter",value:function(e){return!!this.isValid&&this.s>e}},{key:"isBefore",value:function(e){return!!this.isValid&&this.e<=e}},{key:"contains",value:function(e){return!!this.isValid&&(this.s<=e&&this.e>e)}},{key:"set",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=t.start,r=t.end;return this.isValid?d.fromDateTimes(n||this.s,r||this.e):this}},{key:"splitAt",value:function(){if(!this.isValid)return[];for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(friendlyDateTime).sort(),i=[],a=this.s,s=0;a<this.e;){var o=r[s]||this.e,u=+o>+this.e?this.e:o;i.push(d.fromDateTimes(a,u)),a=u,s+=1}return i}},{key:"splitBy",value:function(e){var t=friendlyDuration(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var n,r,i=this.s,a=[];i<this.e;)r=+(n=i.plus(t))>+this.e?this.e:n,a.push(d.fromDateTimes(i,r)),i=r;return a}},{key:"divideEqually",value:function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}},{key:"overlaps",value:function(e){return this.e>e.s&&this.s<e.e}},{key:"abutsStart",value:function(e){return!!this.isValid&&+this.e==+e.s}},{key:"abutsEnd",value:function(e){return!!this.isValid&&+e.e==+this.s}},{key:"engulfs",value:function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}},{key:"equals",value:function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}},{key:"intersection",value:function(e){if(!this.isValid)return this;var t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return n<t?null:d.fromDateTimes(t,n)}},{key:"union",value:function(e){if(!this.isValid)return this;var t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return d.fromDateTimes(t,n)}},{key:"difference",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return d.xor([this].concat(n)).map(function(e){return t.intersection(e)}).filter(function(e){return e&&!e.isEmpty()})}},{key:"toString",value:function(){return this.isValid?"[".concat(this.s.toISO()," – ").concat(this.e.toISO(),")"):INVALID$1}},{key:"toISO",value:function(e){return this.isValid?"".concat(this.s.toISO(e),"/").concat(this.e.toISO(e)):INVALID$1}},{key:"toFormat",value:function(e,t){var n=(1<arguments.length&&void 0!==t?t:{}).separator,r=void 0===n?" – ":n;return this.isValid?"".concat(this.s.toFormat(e)).concat(r).concat(this.e.toFormat(e)):INVALID$1}},{key:"toDuration",value:function(e,t){return this.isValid?this.e.diff(this.s,e,t):Duration.invalid(this.invalidReason)}},{key:"mapEndpoints",value:function(e){return d.fromDateTimes(e(this.s),e(this.e))}},{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}],[{key:"invalid",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(!e)throw new InvalidArgumentError("need to specify a reason the Interval is invalid");var n=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid)throw new InvalidIntervalError(n);return new d({invalid:n})}},{key:"fromDateTimes",value:function(e,t){var n=friendlyDateTime(e),r=friendlyDateTime(t),i=validateStartEnd(n,r);return null==i?new d({start:n,end:r}):i}},{key:"after",value:function(e,t){var n=friendlyDuration(t),r=friendlyDateTime(e);return d.fromDateTimes(r,r.plus(n))}},{key:"before",value:function(e,t){var n=friendlyDuration(t),r=friendlyDateTime(e);return d.fromDateTimes(r.minus(n),r)}},{key:"fromISO",value:function(e,t){var n=_slicedToArray((e||"").split("/",2),2),r=n[0],i=n[1];if(r&&i){var a=DateTime.fromISO(r,t),s=DateTime.fromISO(i,t);if(a.isValid&&s.isValid)return d.fromDateTimes(a,s);if(a.isValid){var o=Duration.fromISO(i,t);if(o.isValid)return d.after(a,o)}else if(s.isValid){var u=Duration.fromISO(r,t);if(u.isValid)return d.before(s,u)}}return d.invalid("unparsable",'the input "'.concat(e,"\" can't be parsed asISO 8601"))}},{key:"isInterval",value:function(e){return e&&e.isLuxonInterval||!1}},{key:"merge",value:function(e){var t=_slicedToArray(e.sort(function(e,t){return e.s-t.s}).reduce(function(e,t){var n=_slicedToArray(e,2),r=n[0],i=n[1];return i?i.overlaps(t)||i.abutsStart(t)?[r,i.union(t)]:[r.concat([i]),t]:[r,t]},[[],null]),2),n=t[0],r=t[1];return r&&n.push(r),n}},{key:"xor",value:function(e){var t,n=null,r=0,i=[],a=e.map(function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]}),s=(t=Array.prototype).concat.apply(t,_toConsumableArray(a)).sort(function(e,t){return e.time-t.time}),o=!0,u=!1,l=void 0;try{for(var c,h=s[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var f=c.value;n=1===(r+="s"===f.type?1:-1)?f.time:(n&&+n!=+f.time&&i.push(d.fromDateTimes(n,f.time)),null)}}catch(e){u=!0,l=e}finally{try{o||null==h.return||h.return()}finally{if(u)throw l}}return d.merge(i)}}]),d}(),Info=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"hasDST",value:function(e){var t=0<arguments.length&&void 0!==e?e:Settings.defaultZone,n=DateTime.local().setZone(t).set({month:12});return!t.universal&&n.offset!==n.set({month:6}).offset}},{key:"isValidIANAZone",value:function(e){return IANAZone.isValidSpecifier(e)&&IANAZone.isValidZone(e)}},{key:"normalizeZone",value:function(e){return normalizeZone(e,Settings.defaultZone)}},{key:"months",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:"long",r=1<arguments.length&&void 0!==t?t:{},i=r.locale,a=void 0===i?null:i,s=r.numberingSystem,o=void 0===s?null:s,u=r.outputCalendar,l=void 0===u?"gregory":u;return Locale.create(a,o,l).months(n)}},{key:"monthsFormat",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:"long",r=1<arguments.length&&void 0!==t?t:{},i=r.locale,a=void 0===i?null:i,s=r.numberingSystem,o=void 0===s?null:s,u=r.outputCalendar,l=void 0===u?"gregory":u;return Locale.create(a,o,l).months(n,!0)}},{key:"weekdays",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:"long",r=1<arguments.length&&void 0!==t?t:{},i=r.locale,a=void 0===i?null:i,s=r.numberingSystem,o=void 0===s?null:s;return Locale.create(a,o,null).weekdays(n)}},{key:"weekdaysFormat",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:"long",r=1<arguments.length&&void 0!==t?t:{},i=r.locale,a=void 0===i?null:i,s=r.numberingSystem,o=void 0===s?null:s;return Locale.create(a,o,null).weekdays(n,!0)}},{key:"meridiems",value:function(e){var t=(0<arguments.length&&void 0!==e?e:{}).locale,n=void 0===t?null:t;return Locale.create(n).meridiems()}},{key:"eras",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:"short",r=(1<arguments.length&&void 0!==t?t:{}).locale,i=void 0===r?null:r;return Locale.create(i,null,"gregory").eras(n)}},{key:"features",value:function(){var e=!1,t=!1,n=!1,r=!1;if(hasIntl()){e=!0,t=hasFormatToParts(),r=hasRelative();try{n="America/New_York"===new Intl.DateTimeFormat("en",{timeZone:"America/New_York"}).resolvedOptions().timeZone}catch(e){n=!1}}return{intl:e,intlTokens:t,zones:n,relative:r}}}]),e}();function dayDiff(e,t){function n(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()}var r=n(t)-n(e);return Math.floor(Duration.fromMillis(r).as("days"))}function highOrderDiffs(e,t,n){for(var r,i,a={},s=0,o=[["years",function(e,t){return t.year-e.year}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=dayDiff(e,t);return(n-n%7)/7}],["days",dayDiff]];s<o.length;s++){var u=_slicedToArray(o[s],2),l=u[0],c=u[1];if(0<=n.indexOf(l)){r=l;var h=c(e,t);t<(i=e.plus(_defineProperty({},l,h)))?(e=e.plus(_defineProperty({},l,h-1)),h-=1):e=i,a[l]=h}}return[e,a,i,r]}function _diff(e,t,n,r){var i=_slicedToArray(highOrderDiffs(e,t,n),4),a=i[0],s=i[1],o=i[2],u=i[3],l=t-a,c=n.filter(function(e){return 0<=["hours","minutes","seconds","milliseconds"].indexOf(e)});0===c.length&&(o<t&&(o=a.plus(_defineProperty({},u,1))),o!==a&&(s[u]=(s[u]||0)+l/(o-a)));var h,f=Duration.fromObject(Object.assign(s,r));return 0<c.length?(h=Duration.fromMillis(l,r)).shiftTo.apply(h,_toConsumableArray(c)).plus(f):f}var numberingSystems={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},numberingSystemsUTF16={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hanidecChars=numberingSystems.hanidec.replace(/[\[|\]]/g,"").split("");function parseDigits(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(numberingSystems.hanidec))t+=hanidecChars.indexOf(e[n]);else for(var i in numberingSystemsUTF16){var a=_slicedToArray(numberingSystemsUTF16[i],2),s=a[0],o=a[1];s<=r&&r<=o&&(t+=r-s)}}return parseInt(t,10)}return t}function digitRegex(e){var t=e.numberingSystem,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return new RegExp("".concat(numberingSystems[t||"latn"]).concat(n))}var MISSING_FTP="missing Intl.DateTimeFormat.formatToParts support";function intUnit(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(e){return e};return{regex:e,deser:function(e){var t=_slicedToArray(e,1)[0];return n(parseDigits(t))}}}function fixListRegex(e){return e.replace(/\./,"\\.?")}function stripInsensitivities(e){return e.replace(/\./,"").toLowerCase()}function oneOf(n,r){return null===n?null:{regex:RegExp(n.map(fixListRegex).join("|")),deser:function(e){var t=_slicedToArray(e,1)[0];return n.findIndex(function(e){return stripInsensitivities(t)===stripInsensitivities(e)})+r}}}function offset(e,t){return{regex:e,deser:function(e){var t=_slicedToArray(e,3);return signedOffset(t[1],t[2])},groups:t}}function simple(e){return{regex:e,deser:function(e){return _slicedToArray(e,1)[0]}}}function escapeToken(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function unitForToken(t,n){function r(e){return{regex:RegExp(escapeToken(e.val)),deser:function(e){return _slicedToArray(e,1)[0]},literal:!0}}var i=digitRegex(n),a=digitRegex(n,"{2}"),s=digitRegex(n,"{3}"),o=digitRegex(n,"{4}"),u=digitRegex(n,"{6}"),l=digitRegex(n,"{1,2}"),c=digitRegex(n,"{1,3}"),h=digitRegex(n,"{1,6}"),f=digitRegex(n,"{1,9}"),d=digitRegex(n,"{2,4}"),m=digitRegex(n,"{4,6}"),e=function(e){if(t.literal)return r(e);switch(e.val){case"G":return oneOf(n.eras("short",!1),0);case"GG":return oneOf(n.eras("long",!1),0);case"y":return intUnit(h);case"yy":return intUnit(d,untruncateYear);case"yyyy":return intUnit(o);case"yyyyy":return intUnit(m);case"yyyyyy":return intUnit(u);case"M":return intUnit(l);case"MM":return intUnit(a);case"MMM":return oneOf(n.months("short",!0,!1),1);case"MMMM":return oneOf(n.months("long",!0,!1),1);case"L":return intUnit(l);case"LL":return intUnit(a);case"LLL":return oneOf(n.months("short",!1,!1),1);case"LLLL":return oneOf(n.months("long",!1,!1),1);case"d":return intUnit(l);case"dd":return intUnit(a);case"o":return intUnit(c);case"ooo":return intUnit(s);case"HH":return intUnit(a);case"H":return intUnit(l);case"hh":return intUnit(a);case"h":return intUnit(l);case"mm":return intUnit(a);case"m":case"s":return intUnit(l);case"ss":return intUnit(a);case"S":return intUnit(c);case"SSS":return intUnit(s);case"u":return simple(f);case"a":return oneOf(n.meridiems(),0);case"kkkk":return intUnit(o);case"kk":return intUnit(d,untruncateYear);case"W":return intUnit(l);case"WW":return intUnit(a);case"E":case"c":return intUnit(i);case"EEE":return oneOf(n.weekdays("short",!1,!1),1);case"EEEE":return oneOf(n.weekdays("long",!1,!1),1);case"ccc":return oneOf(n.weekdays("short",!0,!1),1);case"cccc":return oneOf(n.weekdays("long",!0,!1),1);case"Z":case"ZZ":return offset(new RegExp("([+-]".concat(l.source,")(?::(").concat(a.source,"))?")),2);case"ZZZ":return offset(new RegExp("([+-]".concat(l.source,")(").concat(a.source,")?")),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);default:return r(e)}}(t)||{invalidReason:MISSING_FTP};return e.token=t,e}function buildRegex(e){var t=e.map(function(e){return e.regex}).reduce(function(e,t){return"".concat(e,"(").concat(t.source,")")},"");return["^".concat(t,"$"),e]}function match(e,t,n){var r=e.match(t);if(r){var i={},a=1;for(var s in n)if(hasOwnProperty(n,s)){var o=n[s],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(i[o.token.val[0]]=o.deser(r.slice(a,a+u))),a+=u}return[r,i]}return[r,{}]}function dateTimeFromMatches(r){var e;return e=isUndefined(r.Z)?isUndefined(r.z)?null:IANAZone.create(r.z):new FixedOffsetZone(r.Z),isUndefined(r.h)||(r.h<12&&1===r.a?r.h+=12:12===r.h&&0===r.a&&(r.h=0)),0===r.G&&r.y&&(r.y=-r.y),isUndefined(r.u)||(r.S=parseMillis(r.u)),[Object.keys(r).reduce(function(e,t){var n=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";default:return null}}(t);return n&&(e[n]=r[t]),e},{}),e]}function explainFromTokens(t,e,n){var r=Formatter.parseFormat(n),i=r.map(function(e){return unitForToken(e,t)}),a=i.find(function(e){return e.invalidReason});if(a)return{input:e,tokens:r,invalidReason:a.invalidReason};var s=_slicedToArray(buildRegex(i),2),o=s[0],u=s[1],l=RegExp(o,"i"),c=_slicedToArray(match(e,l,u),2),h=c[0],f=c[1],d=_slicedToArray(f?dateTimeFromMatches(f):[null,null],2);return{input:e,tokens:r,regex:l,rawMatches:h,matches:f,result:d[0],zone:d[1]}}function parseFromTokens(e,t,n){var r=explainFromTokens(e,t,n);return[r.result,r.zone,r.invalidReason]}var nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(e,t){return new Invalid("unit out of range","you specified ".concat(t," (of type ").concat(_typeof(t),") as a ").concat(e,", which is invalid"))}function dayOfWeek(e,t,n){var r=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===r?7:r}function computeOrdinal(e,t,n){return n+(isLeapYear(e)?leapLadder:nonLeapLadder)[t-1]}function uncomputeOrdinal(e,t){var n=isLeapYear(e)?leapLadder:nonLeapLadder,r=n.findIndex(function(e){return e<t});return{month:r+1,day:t-n[r]}}function gregorianToWeek(e){var t,n=e.year,r=e.month,i=e.day,a=computeOrdinal(n,r,i),s=dayOfWeek(n,r,i),o=Math.floor((a-s+10)/7);return o<1?o=weeksInWeekYear(t=n-1):o>weeksInWeekYear(n)?(t=n+1,o=1):t=n,Object.assign({weekYear:t,weekNumber:o,weekday:s},timeObject(e))}function weekToGregorian(e){var t,n=e.weekYear,r=e.weekNumber,i=e.weekday,a=dayOfWeek(n,1,4),s=daysInYear(n),o=7*r+i-a-3;o<1?o+=daysInYear(t=n-1):s<o?(t=n+1,o-=daysInYear(n)):t=n;var u=uncomputeOrdinal(t,o),l=u.month,c=u.day;return Object.assign({year:t,month:l,day:c},timeObject(e))}function gregorianToOrdinal(e){var t=e.year,n=computeOrdinal(t,e.month,e.day);return Object.assign({year:t,ordinal:n},timeObject(e))}function ordinalToGregorian(e){var t=e.year,n=uncomputeOrdinal(t,e.ordinal),r=n.month,i=n.day;return Object.assign({year:t,month:r,day:i},timeObject(e))}function hasInvalidWeekData(e){var t=isNumber(e.weekYear),n=numberBetween(e.weekNumber,1,weeksInWeekYear(e.weekYear)),r=numberBetween(e.weekday,1,7);return t?n?!r&&unitOutOfRange("weekday",e.weekday):unitOutOfRange("week",e.week):unitOutOfRange("weekYear",e.weekYear)}function hasInvalidOrdinalData(e){var t=isNumber(e.year),n=numberBetween(e.ordinal,1,daysInYear(e.year));return t?!n&&unitOutOfRange("ordinal",e.ordinal):unitOutOfRange("year",e.year)}function hasInvalidGregorianData(e){var t=isNumber(e.year),n=numberBetween(e.month,1,12),r=numberBetween(e.day,1,daysInMonth(e.year,e.month));return t?n?!r&&unitOutOfRange("day",e.day):unitOutOfRange("month",e.month):unitOutOfRange("year",e.year)}function hasInvalidTimeData(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,a=numberBetween(t,0,23)||24===t&&0===n&&0===r&&0===i,s=numberBetween(n,0,59),o=numberBetween(r,0,59),u=numberBetween(i,0,999);return a?s?o?!u&&unitOutOfRange("millisecond",i):unitOutOfRange("second",r):unitOutOfRange("minute",n):unitOutOfRange("hour",t)}var INVALID$2="Invalid DateTime",MAX_DATE=864e13;function unsupportedZone(e){return new Invalid("unsupported zone",'the zone "'.concat(e.name,'" is not supported'))}function possiblyCachedWeekData(e){return null===e.weekData&&(e.weekData=gregorianToWeek(e.c)),e.weekData}function clone$1(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new DateTime(Object.assign({},n,t,{old:n}))}function fixOffset(e,t,n){var r=e-60*t*1e3,i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;var a=n.offset(r);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}function tsToObj(e,t){var n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function objToTS(e,t,n){return fixOffset(objToLocalTS(e),t,n)}function adjustTime(e,t){var n=e.o,r=e.c.year+t.years,i=e.c.month+t.months+3*t.quarters,a=Object.assign({},e.c,{year:r,month:i,day:Math.min(e.c.day,daysInMonth(r,i))+t.days+7*t.weeks}),s=Duration.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=_slicedToArray(fixOffset(objToLocalTS(a),n,e.zone),2),u=o[0],l=o[1];return 0!==s&&(u+=s,l=e.zone.offset(u)),{ts:u,o:l}}function parseDataToDateTime(e,t,n,r,i){var a=n.setZone,s=n.zone;if(e&&0!==Object.keys(e).length){var o=t||s,u=DateTime.fromObject(Object.assign(e,n,{zone:o,setZone:void 0}));return a?u:u.setZone(s)}return DateTime.invalid(new Invalid("unparsable",'the input "'.concat(i,"\" can't be parsed as ").concat(r)))}function toTechFormat(e,t){return e.isValid?Formatter.create(Locale.create("en-US"),{allowZ:!0,forceSimple:!0}).formatDateTimeFromString(e,t):null}function toTechTimeFormat(e,t){var n=t.suppressSeconds,r=void 0!==n&&n,i=t.suppressMilliseconds,a=void 0!==i&&i,s=t.includeOffset,o=t.includeZone,u=void 0!==o&&o,l=t.spaceZone,c=void 0!==l&&l,h="HH:mm";return r&&0===e.second&&0===e.millisecond||(h+=":ss",a&&0===e.millisecond||(h+=".SSS")),(u||s)&&c&&(h+=" "),u?h+="z":s&&(h+="ZZ"),toTechFormat(e,h)}var defaultUnitValues={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},defaultWeekUnitValues={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},defaultOrdinalUnitValues={ordinal:1,hour:0,minute:0,second:0,millisecond:0},orderedUnits$1=["year","month","day","hour","minute","second","millisecond"],orderedWeekUnits=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],orderedOrdinalUnits=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new InvalidUnitError(e);return t}function quickDT(e,t){for(var n=0,r=orderedUnits$1;n<r.length;n++){var i=r[n];isUndefined(e[i])&&(e[i]=defaultUnitValues[i])}var a=hasInvalidGregorianData(e)||hasInvalidTimeData(e);if(a)return DateTime.invalid(a);var s=Settings.now(),o=_slicedToArray(objToTS(e,t.offset(s),t),2),u=o[0],l=o[1];return new DateTime({ts:u,zone:t,o:l})}function diffRelative(t,n,r){function e(e,t){return e=roundTo(e,a||r.calendary?0:2,!0),n.loc.clone(r).relFormatter(r).format(e,t)}function i(e){return r.calendary?n.hasSame(t,e)?0:n.startOf(e).diff(t.startOf(e),e).get(e):n.diff(t,e).get(e)}var a=!!isUndefined(r.round)||r.round;if(r.unit)return e(i(r.unit),r.unit);var s=!0,o=!1,u=void 0;try{for(var l,c=r.units[Symbol.iterator]();!(s=(l=c.next()).done);s=!0){var h=l.value,f=i(h);if(1<=Math.abs(f))return e(f,h)}}catch(e){o=!0,u=e}finally{try{s||null==c.return||c.return()}finally{if(o)throw u}}return e(0,r.units[r.units.length-1])}var DateTime=function(){function S(e){_classCallCheck(this,S);var t=e.zone||Settings.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new Invalid("invalid input"):null)||(t.isValid?null:unsupportedZone(t));this.ts=isUndefined(e.ts)?Settings.now():e.ts;var r=null,i=null;if(!n){var a=e.old&&e.old.ts===this.ts&&e.old.zone.equals(t);r=a?e.old.c:tsToObj(this.ts,t.offset(this.ts)),i=a?e.old.o:t.offset(this.ts)}this._zone=t,this.loc=e.loc||Locale.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}return _createClass(S,[{key:"get",value:function(e){return this[e]}},{key:"resolvedLocaleOpts",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=Formatter.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n.locale,numberingSystem:n.numberingSystem,outputCalendar:n.calendar}}},{key:"toUTC",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:0,r=1<arguments.length&&void 0!==t?t:{};return this.setZone(FixedOffsetZone.instance(n),r)}},{key:"toLocal",value:function(){return this.setZone(Settings.defaultZone)}},{key:"setZone",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=n.keepLocalTime,i=void 0!==r&&r,a=n.keepCalendarTime,s=void 0!==a&&a;if((e=normalizeZone(e,Settings.defaultZone)).equals(this.zone))return this;if(e.isValid){var o=this.ts;if(i||s){var u=this.o-e.offset(this.ts);o=_slicedToArray(objToTS(this.toObject(),u,e),1)[0]}return clone$1(this,{ts:o,zone:e})}return S.invalid(unsupportedZone(e))}},{key:"reconfigure",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=t.locale,r=t.numberingSystem,i=t.outputCalendar,a=this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i});return clone$1(this,{loc:a})}},{key:"setLocale",value:function(e){return this.reconfigure({locale:e})}},{key:"set",value:function(e){if(!this.isValid)return this;var t,n=normalizeObject(e,normalizeUnit,[]);!isUndefined(n.weekYear)||!isUndefined(n.weekNumber)||!isUndefined(n.weekday)?t=weekToGregorian(Object.assign(gregorianToWeek(this.c),n)):isUndefined(n.ordinal)?(t=Object.assign(this.toObject(),n),isUndefined(n.day)&&(t.day=Math.min(daysInMonth(t.year,t.month),t.day))):t=ordinalToGregorian(Object.assign(gregorianToOrdinal(this.c),n));var r=_slicedToArray(objToTS(t,this.o,this.zone),2);return clone$1(this,{ts:r[0],o:r[1]})}},{key:"plus",value:function(e){return this.isValid?clone$1(this,adjustTime(this,friendlyDuration(e))):this}},{key:"minus",value:function(e){return this.isValid?clone$1(this,adjustTime(this,friendlyDuration(e).negate())):this}},{key:"startOf",value:function(e){if(!this.isValid)return this;var t={},n=Duration.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){var r=Math.ceil(this.month/3);t.month=3*(r-1)+1}return this.set(t)}},{key:"endOf",value:function(e){return this.isValid?this.plus(_defineProperty({},e,1)).startOf(e).minus(1):this}},{key:"toFormat",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return this.isValid?Formatter.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):INVALID$2}},{key:"toLocaleString",value:function(e){var t=0<arguments.length&&void 0!==e?e:DATE_SHORT;return this.isValid?Formatter.create(this.loc.clone(t),t).formatDateTime(this):INVALID$2}},{key:"toLocaleParts",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this.isValid?Formatter.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}},{key:"toISO",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this.isValid?"".concat(this.toISODate(),"T").concat(this.toISOTime(t)):null}},{key:"toISODate",value:function(){var e="yyyy-MM-dd";return 9999<this.year&&(e="+"+e),toTechFormat(this,e)}},{key:"toISOWeekDate",value:function(){return toTechFormat(this,"kkkk-'W'WW-c")}},{key:"toISOTime",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,a=void 0!==i&&i,s=t.includeOffset;return toTechTimeFormat(this,{suppressSeconds:a,suppressMilliseconds:r,includeOffset:void 0===s||s})}},{key:"toRFC2822",value:function(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ")}},{key:"toHTTP",value:function(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}},{key:"toSQLDate",value:function(){return toTechFormat(this,"yyyy-MM-dd")}},{key:"toSQLTime",value:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=t.includeOffset,r=void 0===n||n,i=t.includeZone;return toTechTimeFormat(this,{includeOffset:r,includeZone:void 0!==i&&i,spaceZone:!0})}},{key:"toSQL",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this.isValid?"".concat(this.toSQLDate()," ").concat(this.toSQLTime(t)):null}},{key:"toString",value:function(){return this.isValid?this.toISO():INVALID$2}},{key:"valueOf",value:function(){return this.toMillis()}},{key:"toMillis",value:function(){return this.isValid?this.ts:NaN}},{key:"toSeconds",value:function(){return this.isValid?this.ts/1e3:NaN}},{key:"toJSON",value:function(){return this.toISO()}},{key:"toBSON",value:function(){return this.toJSDate()}},{key:"toObject",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};if(!this.isValid)return{};var n=Object.assign({},this.c);return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}},{key:"toJSDate",value:function(){return new Date(this.isValid?this.ts:NaN)}},{key:"diff",value:function(e,t,n){var r=1<arguments.length&&void 0!==t?t:"milliseconds",i=2<arguments.length&&void 0!==n?n:{};if(!this.isValid||!e.isValid)return Duration.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");var a=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},i),s=maybeArray(r).map(Duration.normalizeUnit),o=e.valueOf()>this.valueOf(),u=_diff(o?this:e,o?e:this,s,a);return o?u.negate():u}},{key:"diffNow",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:"milliseconds",r=1<arguments.length&&void 0!==t?t:{};return this.diff(S.local(),n,r)}},{key:"until",value:function(e){return this.isValid?Interval.fromDateTimes(this,e):this}},{key:"hasSame",value:function(e,t){if(!this.isValid)return!1;if("millisecond"===t)return this.valueOf()===e.valueOf();var n=e.valueOf();return this.startOf(t)<=n&&n<=this.endOf(t)}},{key:"equals",value:function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}},{key:"toRelative",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};if(!this.isValid)return null;var n=t.base||S.fromObject({zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;return diffRelative(n,this.plus(r),Object.assign(t,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}},{key:"toRelativeCalendar",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this.isValid?diffRelative(t.base||S.fromObject({zone:this.zone}),this,Object.assign(t,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}},{key:"ordinal",get:function(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Info.months("short",{locale:this.locale})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Info.months("long",{locale:this.locale})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Info.weekdays("short",{locale:this.locale})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Info.weekdays("long",{locale:this.locale})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?this.zone.offset(this.ts):NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.universal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return isLeapYear(this.year)}},{key:"daysInMonth",get:function(){return daysInMonth(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?daysInYear(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}}],[{key:"local",value:function(e,t,n,r,i,a,s){return isUndefined(e)?new S({ts:Settings.now()}):quickDT({year:e,month:t,day:n,hour:r,minute:i,second:a,millisecond:s},Settings.defaultZone)}},{key:"utc",value:function(e,t,n,r,i,a,s){return isUndefined(e)?new S({ts:Settings.now(),zone:FixedOffsetZone.utcInstance}):quickDT({year:e,month:t,day:n,hour:r,minute:i,second:a,millisecond:s},FixedOffsetZone.utcInstance)}},{key:"fromJSDate",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=isDate(e)?e.valueOf():NaN;if(Number.isNaN(r))return S.invalid("invalid input");var i=normalizeZone(n.zone,Settings.defaultZone);return i.isValid?new S({ts:r,zone:i,loc:Locale.fromObject(n)}):S.invalid(unsupportedZone(i))}},{key:"fromMillis",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};if(isNumber(e))return e<-MAX_DATE||MAX_DATE<e?S.invalid("Timestamp out of range"):new S({ts:e,zone:normalizeZone(n.zone,Settings.defaultZone),loc:Locale.fromObject(n)});throw new InvalidArgumentError("fromMillis requires a numerical input")}},{key:"fromSeconds",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};if(isNumber(e))return new S({ts:1e3*e,zone:normalizeZone(n.zone,Settings.defaultZone),loc:Locale.fromObject(n)});throw new InvalidArgumentError("fromSeconds requires a numerical input")}},{key:"fromObject",value:function(e){var t=normalizeZone(e.zone,Settings.defaultZone);if(!t.isValid)return S.invalid(unsupportedZone(t));var n=Settings.now(),r=t.offset(n),i=normalizeObject(e,normalizeUnit,["zone","locale","outputCalendar","numberingSystem"]),a=!isUndefined(i.ordinal),s=!isUndefined(i.year),o=!isUndefined(i.month)||!isUndefined(i.day),u=s||o,l=i.weekYear||i.weekNumber,c=Locale.fromObject(e);if((u||a)&&l)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&a)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");var h,f,d=l||i.weekday&&!u,m=tsToObj(n,r);d?(h=orderedWeekUnits,f=defaultWeekUnitValues,m=gregorianToWeek(m)):a?(h=orderedOrdinalUnits,f=defaultOrdinalUnitValues,m=gregorianToOrdinal(m)):(h=orderedUnits$1,f=defaultUnitValues);var y=!1,p=!0,g=!1,v=void 0;try{for(var _,k=h[Symbol.iterator]();!(p=(_=k.next()).done);p=!0){var T=_.value;isUndefined(i[T])?i[T]=y?f[T]:m[T]:y=!0}}catch(e){g=!0,v=e}finally{try{p||null==k.return||k.return()}finally{if(g)throw v}}var b=(d?hasInvalidWeekData(i):a?hasInvalidOrdinalData(i):hasInvalidGregorianData(i))||hasInvalidTimeData(i);if(b)return S.invalid(b);var w=_slicedToArray(objToTS(d?weekToGregorian(i):a?ordinalToGregorian(i):i,r,t),2),O=new S({ts:w[0],zone:t,o:w[1],loc:c});return i.weekday&&u&&e.weekday!==O.weekday?S.invalid("mismatched weekday","you can't specify both a weekday of ".concat(i.weekday," and a date of ").concat(O.toISO())):O}},{key:"fromISO",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=_slicedToArray(parseISODate(e),2);return parseDataToDateTime(r[0],r[1],n,"ISO 8601",e)}},{key:"fromRFC2822",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=_slicedToArray(parseRFC2822Date(e),2);return parseDataToDateTime(r[0],r[1],n,"RFC 2822",e)}},{key:"fromHTTP",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=_slicedToArray(parseHTTPDate(e),2);return parseDataToDateTime(r[0],r[1],n,"HTTP",n)}},{key:"fromFormat",value:function(e,t,n){var r=2<arguments.length&&void 0!==n?n:{};if(isUndefined(e)||isUndefined(t))throw new InvalidArgumentError("fromFormat requires an input string and a format");var i=r.locale,a=void 0===i?null:i,s=r.numberingSystem,o=void 0===s?null:s,u=_slicedToArray(parseFromTokens(Locale.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),e,t),3),l=u[0],c=u[1],h=u[2];return h?S.invalid(h):parseDataToDateTime(l,c,r,"format ".concat(t),e)}},{key:"fromString",value:function(e,t,n){return S.fromFormat(e,t,2<arguments.length&&void 0!==n?n:{})}},{key:"fromSQL",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},r=_slicedToArray(parseSQL(e),2);return parseDataToDateTime(r[0],r[1],n,"SQL",e)}},{key:"invalid",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(!e)throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");var n=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid)throw new InvalidDateTimeError(n);return new S({invalid:n})}},{key:"isDateTime",value:function(e){return e&&e.isLuxonDateTime||!1}},{key:"min",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.every(S.isDateTime))throw new InvalidArgumentError("min requires all arguments be DateTimes");return bestBy(t,function(e){return e.valueOf()},Math.min)}},{key:"max",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.every(S.isDateTime))throw new InvalidArgumentError("max requires all arguments be DateTimes");return bestBy(t,function(e){return e.valueOf()},Math.max)}},{key:"fromFormatExplain",value:function(e,t,n){var r=2<arguments.length&&void 0!==n?n:{},i=r.locale,a=void 0===i?null:i,s=r.numberingSystem,o=void 0===s?null:s;return explainFromTokens(Locale.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),e,t)}},{key:"fromStringExplain",value:function(e,t,n){return S.fromFormatExplain(e,t,2<arguments.length&&void 0!==n?n:{})}},{key:"DATE_SHORT",get:function(){return DATE_SHORT}},{key:"DATE_MED",get:function(){return DATE_MED}},{key:"DATE_FULL",get:function(){return DATE_FULL}},{key:"DATE_HUGE",get:function(){return DATE_HUGE}},{key:"TIME_SIMPLE",get:function(){return TIME_SIMPLE}},{key:"TIME_WITH_SECONDS",get:function(){return TIME_WITH_SECONDS}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return TIME_WITH_SHORT_OFFSET}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return TIME_WITH_LONG_OFFSET}},{key:"TIME_24_SIMPLE",get:function(){return TIME_24_SIMPLE}},{key:"TIME_24_WITH_SECONDS",get:function(){return TIME_24_WITH_SECONDS}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return TIME_24_WITH_SHORT_OFFSET}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return TIME_24_WITH_LONG_OFFSET}},{key:"DATETIME_SHORT",get:function(){return DATETIME_SHORT}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return DATETIME_SHORT_WITH_SECONDS}},{key:"DATETIME_MED",get:function(){return DATETIME_MED}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return DATETIME_MED_WITH_SECONDS}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return DATETIME_MED_WITH_WEEKDAY}},{key:"DATETIME_FULL",get:function(){return DATETIME_FULL}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return DATETIME_FULL_WITH_SECONDS}},{key:"DATETIME_HUGE",get:function(){return DATETIME_HUGE}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return DATETIME_HUGE_WITH_SECONDS}}]),S}();function friendlyDateTime(e){if(DateTime.isDateTime(e))return e;if(e&&e.valueOf&&isNumber(e.valueOf()))return DateTime.fromJSDate(e);if(e&&"object"===_typeof(e))return DateTime.fromObject(e);throw new InvalidArgumentError("Unknown datetime argument: ".concat(e,", of type ").concat(_typeof(e)))}function l$1(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"nl_NL";n=n.replace("_","-");var r=_slicedToArray(t=t?t.split(";"):[],1)[0],i=void 0===r?"D":r;return DateTime.fromISO(e).toFormat(i,{locale:n})}function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var marked=createCommonjsModule(function(g,e){!function(){var _={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:h,table:h,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};function u(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||p.defaults,this.rules=_.normal,this.options.pedantic?this.rules=_.pedantic:this.options.gfm&&(this.rules=_.gfm)}_._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_.def=e(_.def).replace("label",_._label).replace("title",_._title).getRegex(),_.bullet=/(?:[*+-]|\d{1,9}\.)/,_.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,_.item=e(_.item,"gm").replace(/bull/g,_.bullet).getRegex(),_.list=e(_.list).replace(/bull/g,_.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_.def.source+")").getRegex(),_._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_._comment=/<!--(?!-?>)[\s\S]*?-->/,_.html=e(_.html,"i").replace("comment",_._comment).replace("tag",_._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_.paragraph=e(_._paragraph).replace("hr",_.hr).replace("heading"," {0,3}#{1,6} +").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",_._tag).getRegex(),_.blockquote=e(_.blockquote).replace("paragraph",_.paragraph).getRegex(),_.normal=d({},_),_.gfm=d({},_.normal,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),_.pedantic=d({},_.normal,{html:e("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:h,paragraph:e(_.normal._paragraph).replace("hr",_.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",_.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),u.rules=_,u.lex=function(e,t){return new u(t).lex(e)},u.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},u.prototype.token=function(e,t){var n,r,i,a,s,o,u,l,c,h,f,d,m,y,p,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),1<i[0].length&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e)){var v=this.tokens[this.tokens.length-1];e=e.substring(i[0].length),v&&"paragraph"===v.type?v.text+="\n"+i[0].trimRight():(i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?i:b(i,"\n")}))}else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2]?i[2].trim():i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if((i=this.rules.nptable.exec(e))&&(o={type:"table",header:T(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===o.align.length){for(e=e.substring(i[0].length),f=0;f<o.align.length;f++)/^ *-+: *$/.test(o.align[f])?o.align[f]="right":/^ *:-+: *$/.test(o.align[f])?o.align[f]="center":/^ *:-+ *$/.test(o.align[f])?o.align[f]="left":o.align[f]=null;for(f=0;f<o.cells.length;f++)o.cells[f]=T(o.cells[f],o.header.length);this.tokens.push(o)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),u={type:"list_start",ordered:y=1<(a=i[2]).length,start:y?+a:"",loose:!1},this.tokens.push(u),n=!(l=[]),m=(i=i[0].match(this.rules.item)).length,f=0;f<m;f++)h=(o=i[f]).length,~(o=o.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(h-=o.length,o=this.options.pedantic?o.replace(/^ {1,4}/gm,""):o.replace(new RegExp("^ {1,"+h+"}","gm"),"")),f!==m-1&&(s=_.bullet.exec(i[f+1])[0],(1<a.length?1===s.length:1<s.length||this.options.smartLists&&s!==a)&&(e=i.slice(f+1).join("\n")+e,f=m-1)),r=n||/\n\n(?!\s*$)/.test(o),f!==m-1&&(n="\n"===o.charAt(o.length-1),r=r||n),r&&(u.loose=!0),g=void 0,(p=/^\[[ xX]\] /.test(o))&&(g=" "!==o[1],o=o.replace(/^\[[ xX]\] +/,"")),c={type:"list_item_start",task:p,checked:g,loose:r},l.push(c),this.tokens.push(c),this.token(o,!1),this.tokens.push({type:"list_item_end"});if(u.loose)for(m=l.length,f=0;f<m;f++)l[f].loose=!0;this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):k(i[0]):i[0]});else if(t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),d=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[d]||(this.tokens.links[d]={href:i[2],title:i[3]});else if((i=this.rules.table.exec(e))&&(o={type:"table",header:T(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===o.align.length){for(e=e.substring(i[0].length),f=0;f<o.align.length;f++)/^ *-+: *$/.test(o.align[f])?o.align[f]="right":/^ *:-+: *$/.test(o.align[f])?o.align[f]="center":/^ *:-+ *$/.test(o.align[f])?o.align[f]="left":o.align[f]=null;for(f=0;f<o.cells.length;f++)o.cells[f]=T(o.cells[f].replace(/^ *\| *| *\| *$/g,""),o.header.length);this.tokens.push(o)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2].charAt(0)?1:2,text:i[1]});else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var n={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:h,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:h,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/};function c(e,t){if(this.options=t||p.defaults,this.links=e,this.rules=n.normal,this.renderer=this.options.renderer||new r,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.breaks?this.rules=n.breaks:this.rules=n.gfm)}function r(e){this.options=e||p.defaults}function i(){}function l(e){this.tokens=[],this.token=null,this.options=e||p.defaults,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new t}function t(){this.seen={}}function k(e,t){if(t){if(k.escapeTest.test(e))return e.replace(k.escapeReplace,function(e){return k.replacements[e]})}else if(k.escapeTestNoEncode.test(e))return e.replace(k.escapeReplaceNoEncode,function(e){return k.replacements[e]});return e}function f(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function e(n,e){return n=n.source||n,e=e||"",{replace:function(e,t){return t=(t=t.source||t).replace(/(^|[^\[])\^/g,"$1"),n=n.replace(e,t),this},getRegex:function(){return new RegExp(n,e)}}}function a(e,t,n){if(e){try{var r=decodeURIComponent(f(n)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!o.test(n)&&(n=function(e,t){s[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?s[" "+e]=e+"/":s[" "+e]=b(e,"/",!0));return e=s[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}n._punctuation="!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~",n.em=e(n.em).replace(/punctuation/g,n._punctuation).getRegex(),n._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=e(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,n.tag=e(n.tag).replace("comment",_._comment).replace("attribute",n._attribute).getRegex(),n._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,n._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,n.link=e(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex(),n.reflink=e(n.reflink).replace("label",n._label).getRegex(),n.normal=d({},n),n.pedantic=d({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:e(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()}),n.gfm=d({},n.normal,{escape:e(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),n.gfm.url=e(n.gfm.url,"i").replace("email",n.gfm._extended_email).getRegex(),n.breaks=d({},n.gfm,{br:e(n.br).replace("{2,}","*").getRegex(),text:e(n.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),c.rules=n,c.output=function(e,t,n){return new c(t,n).output(e)},c.prototype.output=function(e){for(var t,n,r,i,a,s,o="";e;)if(a=this.rules.escape.exec(e))e=e.substring(a[0].length),o+=k(a[1]);else if(a=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(a[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(a[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.inRawBlock=!1),e=e.substring(a[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):k(a[0]):a[0];else if(a=this.rules.link.exec(e)){var u=m(a[2],"()");if(-1<u){var l=4+a[1].length+u;a[2]=a[2].substring(0,u),a[0]=a[0].substring(0,l).trim(),a[3]=""}e=e.substring(a[0].length),this.inLink=!0,r=a[2],i=this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],t[3]):"":a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(a,{href:c.escapes(r),title:c.escapes(i)}),this.inLink=!1}else if((a=this.rules.reflink.exec(e))||(a=this.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=a[0].charAt(0),e=a[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(a,t),this.inLink=!1}else if(a=this.rules.strong.exec(e))e=e.substring(a[0].length),o+=this.renderer.strong(this.output(a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.em.exec(e))e=e.substring(a[0].length),o+=this.renderer.em(this.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.code.exec(e))e=e.substring(a[0].length),o+=this.renderer.codespan(k(a[2].trim(),!0));else if(a=this.rules.br.exec(e))e=e.substring(a[0].length),o+=this.renderer.br();else if(a=this.rules.del.exec(e))e=e.substring(a[0].length),o+=this.renderer.del(this.output(a[1]));else if(a=this.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=k(this.mangle(a[1]))):n=k(a[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(a=this.rules.url.exec(e))){if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.inRawBlock?o+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):k(a[0]):a[0]):o+=this.renderer.text(k(this.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=k(a[0]));else{for(;s=a[0],a[0]=this.rules._backpedal.exec(a[0])[0],s!==a[0];);n=k(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),o+=this.renderer.link(r,null,n)}return o},c.escapes=function(e){return e?e.replace(c.rules._escapes,"$1"):e},c.prototype.outputLink=function(e,t){var n=t.href,r=t.title?k(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,k(e[1]))},c.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},c.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),.5<Math.random()&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},r.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'<pre><code class="'+this.options.langPrefix+k(r,!0)+'">'+(n?e:k(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:k(e,!0))+"</code></pre>"},r.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},r.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},r.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},r.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},r.prototype.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},r.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},r.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n"+(t=t&&"<tbody>"+t+"</tbody>")+"</table>\n"},r.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},r.prototype.strong=function(e){return"<strong>"+e+"</strong>"},r.prototype.em=function(e){return"<em>"+e+"</em>"},r.prototype.codespan=function(e){return"<code>"+e+"</code>"},r.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},r.prototype.del=function(e){return"<del>"+e+"</del>"},r.prototype.link=function(e,t,n){if(null===(e=a(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+k(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"},r.prototype.image=function(e,t,n){if(null===(e=a(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},r.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new c(e.links,this.options),this.inlineText=new c(e.links,d({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop(),this.token},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,f(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",a="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});a+=this.renderer.tablerow(n)}return this.renderer.table(i,a);case"blockquote_start":for(a="";"blockquote_end"!==this.next().type;)a+=this.tok();return this.renderer.blockquote(a);case"list_start":a="";for(var s=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)a+=this.tok();return this.renderer.list(a,s,o);case"list_item_start":a="";var u=this.token.loose,l=this.token.checked,c=this.token.task;for(this.token.task&&(a+=this.renderer.checkbox(l));"list_item_end"!==this.next().type;)a+=u||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(a,c,l);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:var h='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(h);console.log(h)}},t.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t))for(var n=t;this.seen[n]++,t=n+"-"+this.seen[n],this.seen.hasOwnProperty(t););return this.seen[t]=0,t},k.escapeTest=/[&<>"']/,k.escapeReplace=/[&<>"']/g,k.replacements={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},k.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,k.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var s={},o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function T(e,t){var n=e.replace(/\|/g,function(e,t,n){for(var r=!1,i=t;0<=--i&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function b(e,t,n){if(0===e.length)return"";for(var r=0;r<e.length;){var i=e.charAt(e.length-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.substr(0,e.length-r)}function m(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return-1}function y(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function p(e,n,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof n){r||(r=n,n=null),y(n=d({},p.defaults,n||{}));var i,a,s=n.highlight,t=0;try{i=u.lex(e,n)}catch(e){return r(e)}a=i.length;var o=function(t){if(t)return n.highlight=s,r(t);var e;try{e=l.parse(i,n)}catch(e){t=e}return n.highlight=s,t?r(t):r(null,e)};if(!s||s.length<3)return o();if(delete n.highlight,!a)return o();for(;t<i.length;t++)!function(n){"code"!==n.type?--a||o():s(n.text,n.lang,function(e,t){return e?o(e):null==t||t===n.text?--a||o():(n.text=t,n.escaped=!0,void(--a||o()))})}(i[t])}else try{return y(n=n&&d({},p.defaults,n)),l.parse(u.lex(e,n),n)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(n||p.defaults).silent)return"<p>An error occurred:</p><pre>"+k(e.message+"",!0)+"</pre>";throw e}}h.exec=h,p.options=p.setOptions=function(e){return d(p.defaults,e),p},p.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new r,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}},p.defaults=p.getDefaults(),p.Parser=l,p.parser=l.parse,p.Renderer=r,p.TextRenderer=i,p.Lexer=u,p.lexer=u.lex,p.InlineLexer=c,p.inlineLexer=c.output,p.Slugger=t,p.parse=p,g.exports=p}()});function m(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";t=t?t.split(";"):[];for(var n={breaks:!0},r=null,i=null,a=0;a<t.length;a+=1){var s=_slicedToArray(t[a].split("="),2);r=s[0],i=s[1],n[r]="0"!==i}return marked(e,n)}function formatDecimal(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[1<r.length?r[0]+r.slice(2):r,+e.slice(n+1)]}function exponent(e){return(e=formatDecimal(Math.abs(e)))?e[1]:NaN}function formatGroup(o,u){return function(e,t){for(var n=e.length,r=[],i=0,a=o[0],s=0;0<n&&0<a&&(t<s+a+1&&(a=Math.max(1,t-s)),r.push(e.substring(n-=a,n+a)),!((s+=a+1)>t));)a=o[i=(i+1)%o.length];return r.reverse().join(u)}}function formatNumerals(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}var prefixExponent,re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(e){return new FormatSpecifier(e)}function FormatSpecifier(e){if(!(t=re.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function formatTrim(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(0<i){if(!+e[r])break e;i=0}}return 0<i?e.slice(0,i)+e.slice(t+1):e}function formatPrefixAuto(e,t){var n=formatDecimal(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(prefixExponent=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return a===s?r:s<a?r+new Array(a-s+1).join("0"):0<a?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+formatDecimal(e,Math.max(0,t+a-1))[0]}function formatRounded(e,t){var n=formatDecimal(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var formatTypes={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return formatRounded(100*e,t)},r:formatRounded,s:formatPrefixAuto,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function identity(e){return e}var locale,format,formatPrefix,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale(e){var b=e.grouping&&e.thousands?formatGroup(e.grouping,e.thousands):identity,r=e.currency,w=e.decimal,O=e.numerals?formatNumerals(e.numerals):identity,i=e.percent||"%";function s(e){var l=(e=formatSpecifier(e)).fill,c=e.align,h=e.sign,t=e.symbol,f=e.zero,d=e.width,m=e.comma,y=e.precision,p=e.trim,g=e.type;"n"===g?(m=!0,g="g"):formatTypes[g]||(null==y&&(y=12),p=!0,g="g"),(f||"0"===l&&"="===c)&&(f=!0,l="0",c="=");var v="$"===t?r[0]:"#"===t&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_="$"===t?r[1]:/[%p]/.test(g)?i:"",k=formatTypes[g],T=/[defgprs%]/.test(g);function n(e){var t,n,r,i=v,a=_;if("c"===g)a=k(e)+a,e="";else{var s=(e=+e)<0;if(e=k(Math.abs(e),y),p&&(e=formatTrim(e)),s&&0==+e&&(s=!1),i=(s?"("===h?h:"-":"-"===h||"("===h?"":h)+i,a=("s"===g?prefixes[8+prefixExponent/3]:"")+a+(s&&"("===h?")":""),T)for(t=-1,n=e.length;++t<n;)if((r=e.charCodeAt(t))<48||57<r){a=(46===r?w+e.slice(t+1):e.slice(t))+a,e=e.slice(0,t);break}}m&&!f&&(e=b(e,1/0));var o=i.length+e.length+a.length,u=o<d?new Array(d-o+1).join(l):"";switch(m&&f&&(e=b(u+e,u.length?d-a.length:1/0),u=""),c){case"<":e=i+e+a+u;break;case"=":e=i+u+e+a;break;case"^":e=u.slice(0,o=u.length>>1)+i+e+a+u.slice(o);break;default:e=u+i+e+a}return O(e)}return y=null==y?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),n.toString=function(){return e+""},n}return{format:s,formatPrefix:function(e,t){var n=s(((e=formatSpecifier(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(exponent(t)/3))),i=Math.pow(10,-r),a=prefixes[8+r/3];return function(e){return n(i*e)+a}}}}function defaultLocale$1(e){return locale=formatLocale(e),format=locale.format,formatPrefix=locale.formatPrefix,locale}defaultLocale$1({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var defaultFormat={format:format,formatPrefix:formatPrefix},definitions={};function n$1(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"nl_NL",r=_slicedToArray(t=t?t.split(";"):[],3),i=r[0],a=void 0===i?"f":i,s=r[1],o=void 0===s?"":s,u=r[2],l=void 0===u?"":u,c=definitions[n]?formatLocale(definitions[n]):defaultFormat;return e=(""===o?c.format(a):c.formatPrefix(a,o))(e),e=""===l?e:e.slice(0,-1)+l+e.slice(-1)}function s$1(e){return String(e)}n$1.definitions=definitions;var formatters=Object.freeze({l:l$1,m:m,n:n$1,s:s$1}),regexpBase="%((\\((\\w+)\\))?((\\d+)\\$)?)([lmns])(\\[(.+)\\])?",regexpGlobal=new RegExp(regexpBase,"g"),regexpSingle=new RegExp(regexpBase),reductor=function(n){return function(e,t){return t[n]}};function vsprintf(e,t,n){for(var r=e.match(regexpGlobal)||[],i=null,a=null,s=null,o=null,u=null,l=null,c=0;c<r.length;c+=1){var h=_slicedToArray(r[c].match(regexpSingle),9);i=h[0],a=h[3],s=h[5],u=h[6],o=h[8],null==(l=s?t[s-1]:a?t.reduce(reductor(a),""):t[c])?l="":formatters[u]&&(l=formatters[u](l,o,n)),e=e.replace(i,l)}return e}Object.assign(vsprintf,formatters);var id=0,Worker=function(){function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,t),this._act=null,this._bypass=null,this._decide=null,this._downstream=null,this._err=null,this._filter=null,this._id=null,this._log=null,this._merge=null,this._upstream=null,this._wrap=null,this.setAct(e.act),this.setBypass(e.bypass),this.setDecide(e.decide),this.setDownstream(e.downstream),this.setErr(e.err),this.setFilter(e.filter),this.setId(e.id),this.setLog(e.log),this.setMerge(e.merge),this.setUpstream(e.upstream),this.setWrap(e.wrap)}return _createClass(t,[{key:"getOptions",value:function(){return{act:this._act,decide:this._decide,err:this._err,filter:this._filter,log:this._log,merge:this._merge,wrap:this._wrap}}},{key:"getAct",value:function(){return this._act}},{key:"setAct",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._act=t,this}},{key:"getBypass",value:function(){return this._bypass}},{key:"setBypass",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._bypass=t,this}},{key:"getDecide",value:function(){return this._decide}},{key:"setDecide",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._decide=t,this}},{key:"getDownstream",value:function(){return this._downstream}},{key:"setDownstream",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._downstream=t,this}},{key:"getErr",value:function(){return this._err}},{key:"setErr",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._err=t,this}},{key:"getFilter",value:function(){return this._filter}},{key:"setFilter",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._filter=t,this}},{key:"getId",value:function(){return this._id}},{key:"setId",value:function(e){var t=0<arguments.length&&void 0!==e?e:++id;return this._id=t,this}},{key:"getLog",value:function(){return this._log}},{key:"setLog",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._log=t,this}},{key:"getMerge",value:function(){return this._merge}},{key:"setMerge",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._merge=t,this}},{key:"getUpstream",value:function(){return this._upstream}},{key:"setUpstream",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._upstream=t,this}},{key:"getWrap",value:function(){return this._wrap}},{key:"setWrap",value:function(e){var t=0<arguments.length&&void 0!==e&&e;return this._wrap=t,this}},{key:"act",value:function(e,t,n){this._act?this._act(e,t,n):this.pass(e,t,n)}},{key:"bypass",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return null===t||(this._bypass=t),this}},{key:"connect",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return null===t?this:Array.isArray(t)?(this.connect(t[0]),t[1]):(this._downstream=t.setUpstream(this),t)}},{key:"decide",value:function(e,t,n){return!this._decide||this._decide(e,t,n)}},{key:"err",value:function(e,t,n){this._err?this._err(e,t,n):this.fail(e,t,n)}},{key:"fail",value:function(e,t,n){this.log("fail",e,t);try{this._bypass?this._bypass.err(e,t,n):this._downstream&&this._downstream.err(e,t,n)}catch(e){console.error(e)}}},{key:"filter",value:function(e,t){if(this._filter){for(var n=arguments.length,r=new Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._filter.apply(this,[e,t].concat(r))}return t}},{key:"find",value:function(e){return!0===e(this)?this:this._downstream?this._downstream.find(e):null}},{key:"handle",value:function(e,t,n){var r=this.decide(e,t,n);!0===r?this.act(e,t,n):!1===r?this.skip(e,t,n):this._bypass&&this._bypass.handle(e,t,n)}},{key:"log",value:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(this._log||console.out||function(){}).apply(void 0,[e,this].concat(n))}},{key:"merge",value:function(e,t){if(this._merge){for(var n=arguments.length,r=new Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._merge.apply(this,[e,t].concat(r))}return t}},{key:"pass",value:function(t,e,n){this.log("pass",t,e);try{this._downstream&&this._downstream.handle(t,e,n)}catch(e){this.fail(t,e,n)}}},{key:"prepend",value:function(e){return this._upstream.connect(e).connect(this)}},{key:"skip",value:function(e,t,n){this.log("skip",e,t),this._downstream&&this._downstream.handle(e,t,n)}}]),t}(),Broadcaster=function(){function a(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,a),(e=_possibleConstructorReturn(this,_getPrototypeOf(a).call(this,t)))._downstreams=null,e._name=null,e._sync=null,e._unify=null,e.setDownstreams(t.downstreams),e.setName(t.name),e.setSync(t.sync),e.setUnify(t.unify),e}return _inherits(a,Worker),_createClass(a,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(a.prototype),"getOptions",this).call(this),{name:this._name,sync:this._sync,unify:this._unify})}},{key:"getDownstreams",value:function(){return this._downstreams}},{key:"setDownstreams",value:function(e){var t=0<arguments.length&&void 0!==e?e:[];return this._downstreams=t,this}},{key:"getName",value:function(){return this._name}},{key:"setName",value:function(e){var t=0<arguments.length&&void 0!==e?e:"default";return this._name=t,this}},{key:"getSync",value:function(){return this._sync}},{key:"setSync",value:function(e){var t=0<arguments.length&&void 0!==e&&e;return this._sync=t,this}},{key:"getUnify",value:function(){return this._unify}},{key:"setUnify",value:function(e){var t=!(0<arguments.length&&void 0!==e)||e;return this._unify=t,this}},{key:"connect",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return null===t?this:Array.isArray(t)?(this.connect(t[0]),t[1]):(this._downstreams.push(t),_get(_getPrototypeOf(a.prototype),"connect",this).call(this,t))}},{key:"find",value:function(e,t){var n=1<arguments.length&&void 0!==t&&t,r=_get(_getPrototypeOf(a.prototype),"find",this).call(this,e,n);if(null!==r)return r;for(var i=0;i<this._downstreams.length;i+=1)if(r=this.downstreams[i].find(e,n))return r;return r}},{key:"pass",value:function(e,t,n){if(!0===this._wrap&&(e={box:e}),!0===this._unify){var r={count:0,empty:!1,total:this._downstreams.length};e.unify=e.unify||{},e.unify[this._name]=r,this.log("info",e,t,e.unify)}this._sync?this.passSync(e,t,n):this.passAsync(e,t,n)}},{key:"passAsync",value:function(e,t,n){for(var r=0;r<this._downstreams.length;r+=1)this._downstreams[r].handle(e,t,n)}},{key:"passSync",value:function(e,t,n){var r=this,i=e.unify[this._name],a=i.count===i.total-1?n:function(){return r.passSync(e,t,n)};this._downstreams[i.count].handle(e,t,a)}}]),a}(),Builder=function(){function o(){return _classCallCheck(this,o),_possibleConstructorReturn(this,_getPrototypeOf(o).apply(this,arguments))}return _inherits(o,Worker),_createClass(o,null,[{key:"attachFactories",value:function(e,t){for(var n=Object.keys(t),r=null,i=null,a=0;a<n.length;a+=1){r=n[a],i=Object.keys(t[r]);for(var s=0;s<i.length;s+=1)o.attachFactory(e,t,r,i[s])}}},{key:"attachFactory",value:function(e,t,n,r){var i=t[n][r],a=i.object,s=i.options;e.prototype[r]&&(r=n+r),e.prototype[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new a(Object.assign({args:t,builder:this},s))}}}]),o}(),Manager=function(){function r(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,r),(e=_possibleConstructorReturn(this,_getPrototypeOf(r).call(this,t)))._names=null,e._pool=null,e.setNames(t.names),e.setPool(t.pool),e}return _inherits(r,Worker),_createClass(r,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(r.prototype),"getOptions",this).call(this),{names:this._names})}},{key:"getNames",value:function(){return this._names}},{key:"setNames",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._names=t,this}},{key:"getPool",value:function(){return this._pool}},{key:"setPool",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this._pool=t,this}},{key:"act",value:function(e,t,n){if(void 0===e._names&&((e=Object.assign({_original:e},e))._names=this.names(e)),0!==e._names.length){var r=e._names.shift(),i=this._pool[r];this.log("info",e,t,r),i?i.handle(e,t,n):this.handle(e,t,n)}else this.pass(e._original,t,n)}},{key:"fail",value:function(e,t,n){_get(_getPrototypeOf(r.prototype),"fail",this).call(this,e._original||e,t,n)}},{key:"manage",value:function(e,t){return(this._pool[e]=t).connect(this)}},{key:"names",value:function(e){return this._names?this._names(e):[]}}]),r}(),runtime_1=createCommonjsModule(function(e){var t=function(a){var u,e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function s(e,t,n,r){var i=t&&t.prototype instanceof o?t:o,a=Object.create(i.prototype),s=new I(r||[]);return a._invoke=function(a,s,o){var u=h;return function(e,t){if(u===d)throw new Error("Generator is already running");if(u===m){if("throw"===e)throw t;return D()}for(o.method=e,o.arg=t;;){var n=o.delegate;if(n){var r=O(n,o);if(r){if(r===y)continue;return r}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(u===h)throw u=m,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);u=d;var i=c(a,s,o);if("normal"===i.type){if(u=o.done?m:f,i.arg===y)continue;return{value:i.arg,done:o.done}}"throw"===i.type&&(u=m,o.method="throw",o.arg=i.arg)}}}(e,n,s),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var h="suspendedStart",f="suspendedYield",d="executing",m="completed",y={};function o(){}function p(){}function g(){}var v={};v[i]=function(){return this};var _=Object.getPrototypeOf,k=_&&_(_(E([])));k&&k!==e&&l.call(k,i)&&(v=k);var T=g.prototype=o.prototype=Object.create(v);function b(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(u){var t;this._invoke=function(n,r){function e(){return new Promise(function(e,t){!function t(e,n,r,i){var a=c(u[e],u,n);if("throw"!==a.type){var s=a.arg,o=s.value;return o&&"object"===_typeof(o)&&l.call(o,"__await")?Promise.resolve(o.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)}):Promise.resolve(o).then(function(e){s.value=e,r(s)},function(e){return t("throw",e,r,i)})}i(a.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}}function O(e,t){var n=e.iterator[t.method];if(n===u){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=u,O(e,t),"throw"===t.method))return y;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,y;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=u),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(l.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=u,e.done=!0,e};return r.next=r}}return{next:D}}function D(){return{value:u,done:!0}}return p.prototype=T.constructor=g,g.constructor=p,g[r]=p.displayName="GeneratorFunction",a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,r in e||(e[r]="GeneratorFunction")),e.prototype=Object.create(T),e},a.awrap=function(e){return{__await:e}},b(w.prototype),w.prototype[n]=function(){return this},a.AsyncIterator=w,a.async=function(e,t,n,r){var i=new w(s(e,t,n,r));return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},b(T),T[r]="Generator",T[i]=function(){return this},T.toString=function(){return"[object Generator]"},a.keys=function(n){var r=[];for(var e in n)r.push(e);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=E,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return a.type="throw",a.arg=n,r.next=e,t&&(r.method="next",r.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var s=l.call(i,"catchLoc"),o=l.call(i,"finallyLoc");if(s&&o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=u),y}},a}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}),regenerator=runtime_1,onlyOnce_1=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(i){return function(){if(null===i)throw new Error("Callback was already called.");var e=i;i=null;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.apply(this,n)}},e.exports=t.default});unwrapExports(onlyOnce_1);var setImmediate_1=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=a,t.wrap=s;var n,r=t.hasSetImmediate="function"==typeof setImmediate&&setImmediate,i=t.hasNextTick="object"===("undefined"==typeof process?"undefined":_typeof(process))&&"function"==typeof process.nextTick;function a(e){setTimeout(e,0)}function s(i){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i(function(){return e.apply(void 0,n)})}}n=r?setImmediate:i?process.nextTick:a,t.default=s(n)});unwrapExports(setImmediate_1);var setImmediate_2=setImmediate_1.fallback,setImmediate_3=setImmediate_1.wrap,setImmediate_4=setImmediate_1.hasSetImmediate,setImmediate_5=setImmediate_1.hasNextTick,DoublyLinkedList=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){_classCallCheck(this,e),this.head=this.tail=null,this.length=0}return _createClass(e,[{key:"removeLink",value:function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}},{key:"empty",value:function(){for(;this.head;)this.shift();return this}},{key:"insertAfter",value:function(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}},{key:"insertBefore",value:function(e,t){t.prev=e.prev,(t.next=e).prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}},{key:"unshift",value:function(e){this.head?this.insertBefore(this.head,e):r(this,e)}},{key:"push",value:function(e){this.tail?this.insertAfter(this.tail,e):r(this,e)}},{key:"shift",value:function(){return this.head&&this.removeLink(this.head)}},{key:"pop",value:function(){return this.tail&&this.removeLink(this.tail)}},{key:"toArray",value:function(){return _toConsumableArray(this)}},{key:Symbol.iterator,value:regenerator.mark(function e(){var t;return regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(t)return e.next=4,t.data;e.next=7;break;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})},{key:"remove",value:function(e){for(var t=this.head;t;){var n=t.next;e(t)&&this.removeLink(t),t=n}return this}}]),e}();function r(e,t){e.length=1,e.head=e.tail=t}t.default=n,e.exports=t.default});unwrapExports(DoublyLinkedList);var initialParams=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.pop();return i.call(this,t,r)}},e.exports=t.default});unwrapExports(initialParams);var asyncify_1=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(i){if((0,wrapAsync_1.isAsync)(i))return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.pop();return a(i.apply(this,t),r)};return(0,n.default)(function(e,t){var n;try{n=i.apply(this,e)}catch(e){return t(e)}if(n&&"function"==typeof n.then)return a(n,t);t(null,n)})};var n=i(initialParams),r=i(setImmediate_1);function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return e.then(function(e){s(t,null,e)},function(e){s(t,e&&e.message?e:new Error(e))})}function s(e,t,n){try{e(t,n)}catch(e){(0,r.default)(function(e){throw e},e)}}e.exports=t.default});unwrapExports(asyncify_1);var wrapAsync_1=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var n,r=(n=asyncify_1)&&n.__esModule?n:{default:n};function i(e){return"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return i(e)?(0,r.default)(e):e},t.isAsync=i,t.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},t.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}});unwrapExports(wrapAsync_1);var wrapAsync_2=wrapAsync_1.isAsyncIterable,wrapAsync_3=wrapAsync_1.isAsyncGenerator,wrapAsync_4=wrapAsync_1.isAsync,queue_1=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r;if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var s=(0,k.default)(e),l=0,c=[],i={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(e,t){return e?t?void(i[e]=i[e].filter(function(e){return e!==t})):i[e]=[]:Object.keys(i).forEach(function(e){return i[e]=[]})}function h(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i[e].forEach(function(e){return e.apply(void 0,n)})}var u=!1;function o(e,t,i,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var a,s;function r(e){if(e)return i?s(e):a();for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length<=1)return a(n[0]);a(n)}p.started=!0;var o={data:e,callback:i?r:n||r};if(t?p._tasks.unshift(o):p._tasks.push(o),u||(u=!0,(0,v.default)(function(){u=!1,p.process()})),i||!n)return new Promise(function(e,t){a=e,s=t})}function f(u){return function(e){l-=1;for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,a=u.length;i<a;i++){var s=u[i],o=c.indexOf(s);0===o?c.shift():0<o&&c.splice(o,1),s.callback.apply(s,[e].concat(n)),null!=e&&h("error",e,s.data)}l<=p.concurrency-p.buffer&&h("unsaturated"),p.idle()&&h("drain"),p.process()}}function d(e){return!(0!==e.length||!p.idle())&&((0,v.default)(function(){return h("drain")}),!0)}function m(t){return function(e){if(!e)return new Promise(function(n,r){!function(t,n){i[t].push(function e(){a(t,e),n.apply(void 0,arguments)})}(t,function(e,t){if(e)return r(e);n(t)})});a(t),function(e,t){i[e].push(t)}(t,e)}}var y=!1,p=(_defineProperty(r={_tasks:new _.default},Symbol.iterator,regenerator.mark(function e(){return regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(p._tasks[Symbol.iterator](),"t0",1);case 1:case"end":return e.stop()}},e)})),_defineProperty(r,"concurrency",t),_defineProperty(r,"payload",n),_defineProperty(r,"buffer",t/4),_defineProperty(r,"started",!1),_defineProperty(r,"paused",!1),_defineProperty(r,"push",function(e,t){if(Array.isArray(e)){if(d(e))return;return e.map(function(e){return o(e,!1,!1,t)})}return o(e,!1,!1,t)}),_defineProperty(r,"pushAsync",function(e,t){if(Array.isArray(e)){if(d(e))return;return e.map(function(e){return o(e,!1,!0,t)})}return o(e,!1,!0,t)}),_defineProperty(r,"kill",function(){a(),p._tasks.empty()}),_defineProperty(r,"unshift",function(e,t){if(Array.isArray(e)){if(d(e))return;return e.map(function(e){return o(e,!0,!1,t)})}return o(e,!0,!1,t)}),_defineProperty(r,"unshiftAsync",function(e,t){if(Array.isArray(e)){if(d(e))return;return e.map(function(e){return o(e,!0,!0,t)})}return o(e,!0,!0,t)}),_defineProperty(r,"remove",function(e){p._tasks.remove(e)}),_defineProperty(r,"process",function(){if(!y){for(y=!0;!p.paused&&l<p.concurrency&&p._tasks.length;){var e=[],t=[],n=p._tasks.length;p.payload&&(n=Math.min(n,p.payload));for(var r=0;r<n;r++){var i=p._tasks.shift();e.push(i),c.push(i),t.push(i.data)}l+=1,0===p._tasks.length&&h("empty"),l===p.concurrency&&h("saturated");var a=(0,g.default)(f(e));s(t,a)}y=!1}}),_defineProperty(r,"length",function(){return p._tasks.length}),_defineProperty(r,"running",function(){return l}),_defineProperty(r,"workersList",function(){return c}),_defineProperty(r,"idle",function(){return p._tasks.length+l===0}),_defineProperty(r,"pause",function(){p.paused=!0}),_defineProperty(r,"resume",function(){!1!==p.paused&&(p.paused=!1,(0,v.default)(p.process))}),r);return Object.defineProperties(p,{saturated:{writable:!1,value:m("saturated")},unsaturated:{writable:!1,value:m("unsaturated")},empty:{writable:!1,value:m("empty")},drain:{writable:!1,value:m("drain")},error:{writable:!1,value:m("error")}}),p};var g=n(onlyOnce_1),v=n(setImmediate_1),_=n(DoublyLinkedList),k=n(wrapAsync_1);function n(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default});unwrapExports(queue_1);var queue=createCommonjsModule(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,i.default)(e);return(0,r.default)(function(e,t){n(e[0],t)},t,1)};var r=n(queue_1),i=n(wrapAsync_1);function n(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}),_createQueue=unwrapExports(queue),queues={},Queuer=function(){function n(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,n),(e=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this,t)))._concurrency=null,e._drain=null,e._handler=null,e._name=null,e._pub=null,e._queue=null,e._queuer=null,e._sub=null,e._saturated=null,e._unsaturated=null,e.setConcurrency(t.concurrency),e.setDrain(t.drain),e.setName(t.name),e.setQueue(t.queue),e.setSaturated(t.saturated),e.setUnsaturated(t.unsaturated),t.handler&&(e.setHandler(t.handler),e.startHandler()),t.queuer&&(e.setQueuer(t.queuer),e.startQueuer()),e}return _inherits(n,Worker),_createClass(n,null,[{key:"createQueue",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:null;if(queues[n])return queues[n];var r=_createQueue(function(e,t){e(t)},e);return null!==n&&(queues[n]=r),r}}]),_createClass(n,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(n.prototype),"getOptions",this).call(this),{concurrency:this._concurrency,drain:this._drain,handler:this._handler,name:this._name,pub:this._pub,queue:this._queue,queuer:this._queuer,saturated:this._saturated,sub:this._sub,unsaturated:this._unsaturated})}},{key:"getConcurrency",value:function(){return this._concurrency}},{key:"setConcurrency",value:function(e){var t=0<arguments.length&&void 0!==e?e:1;return this._concurrency=t,this}},{key:"getDrain",value:function(){return this._drain}},{key:"setDrain",value:function(e){var t=0<arguments.length&&void 0!==e?e:function(){};return this._drain=t,this}},{key:"getHandler",value:function(){return this._handler}},{key:"setHandler",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._handler=t,this}},{key:"getName",value:function(){return this._name}},{key:"setName",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._name=t,this}},{key:"getPub",value:function(){return this._pub}},{key:"setPub",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._pub=t,this}},{key:"getQueue",value:function(){return this._queue}},{key:"setQueue",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._queue=t,this}},{key:"getQueuer",value:function(){return this._queuer}},{key:"setQueuer",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._queuer=t,this}},{key:"getSaturated",value:function(){return this._saturated}},{key:"setSaturated",value:function(e){var t=0<arguments.length&&void 0!==e?e:function(){};return this._saturated=t,this}},{key:"getSub",value:function(){return this._sub}},{key:"setSub",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._sub=t,this}},{key:"getUnsaturated",value:function(){return this._unsaturated}},{key:"setUnsaturated",value:function(e){var t=0<arguments.length&&void 0!==e?e:function(){};return this._unsaturated=t,this}},{key:"act",value:function(e,t){null!==this._queuer?this.pushToRemote(e,t):null===this._handler&&this.pushToLocal(e,t)}},{key:"createQueue",value:function(e){var t=this;this._queue=n.createQueue(this._concurrency,this._name),this._queue.saturated=function(){t._saturated(e)},this._queue.unsaturated=function(){t._unsaturated(e)},this._queue.drain=function(){t._drain(e)}}},{key:"handleRemote",value:function(n){var r=this;this._handler.rpop(this._name,function(e,t){if(e)return n(),void r.log("fail",null,e);if(null===t)return n(),void(r._queue.unsaturated=function(){});try{t=JSON.parse(t)}catch(e){return n(),void r.log("fail",null,e)}r.pass({},t,n)})}},{key:"pushFromRemote",value:function(){var t=this;null===this._queue&&this.createQueue(),this._queue.length()!==this._concurrency&&(this._queue.unsaturated=function(){t.pushFromRemote()},this._queue.push(function(e){t.handleRemote(e)}))}},{key:"pushToLocal",value:function(t,n){var r=this;null===this._queue&&this.createQueue(t),this._queue.length()===this._concurrency&&this._queue.saturated(),this._queue.push(function(e){r.pass(t,n,e)})}},{key:"pushToRemote",value:function(t,e){var n=this;try{e=JSON.stringify(e)}catch(e){return void this.log("fail",t,e)}this._queuer.lpush(this._name,e,function(e){e?n.log("fail",t,e):n._pub.publish(n._name,1)})}},{key:"startHandler",value:function(){var t=this,e=this._handler.duplicate();e.on("error",function(e){t.log("fail",null,e)}),e.on("message",function(){t.pushFromRemote()}),e.subscribe(this._name),this.setSub(e)}},{key:"startQueuer",value:function(){var t=this,e=this._queuer.duplicate();e.on("error",function(e){t.log("fail",null,e)}),this.setPub(e)}}]),n}(),Router=function(){function s(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,s),(e=_possibleConstructorReturn(this,_getPrototypeOf(s).call(this,t)))._downstreams=null,e.setDownstreams(t.downstreams),e}return _inherits(s,Worker),_createClass(s,[{key:"getDownstreams",value:function(){return this._downstreams}},{key:"setDownstreams",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return this._downstreams=t,this}},{key:"act",value:function(e,t,n){if(this._act)this._act(e,t,n);else{var r=this.filter(e,t);this.pass(r,e,t,n)}}},{key:"connect",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:null;return null===n?this:Array.isArray(n)?(this.connect(e,n[0]),n[1]):(this._downstreams[e]=n,_get(_getPrototypeOf(s.prototype),"connect",this).call(this,n))}},{key:"filter",value:function(e,t,n){return this._filter?this._filter(e,t,n):e.name}},{key:"find",value:function(e,t){var n=1<arguments.length&&void 0!==t&&t,r=_get(_getPrototypeOf(s.prototype),"find",this).call(this,e,n);if(null!==r)return r;for(var i=Object.keys(this._downstreams),a=0;a<i.length;a+=1)if(r=this._downstreams[i[a]].find(e,n))return r;return r}},{key:"pass",value:function(e,t,n,r){this.log("info",t,n,e),this._downstreams[e]?this._downstreams[e].handle(t,n,r):this._bypass&&this._bypass.handle(t,n,r)}}]),s}(),Slicer=function(){function n(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,n),(e=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this,t)))._count=null,e._name=null,e._unify=null,e.setCount(t.count),e.setName(t.name),e.setUnify(t.unify),e}return _inherits(n,Worker),_createClass(n,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(n.prototype),"getOptions",this).call(this),{count:this._count,name:this._name,unify:this._unify})}},{key:"getCount",value:function(){return this._count}},{key:"setCount",value:function(e){var t=0<arguments.length&&void 0!==e?e:1;return this._count=t,this}},{key:"getName",value:function(){return this._name}},{key:"setName",value:function(e){var t=0<arguments.length&&void 0!==e?e:"default";return this._name=t,this}},{key:"getUnify",value:function(){return this._unify}},{key:"setUnify",value:function(e){var t=!(0<arguments.length&&void 0!==e)||e;return this._unify=t,this}},{key:"act",value:function(e,t,n){var r=this.filter(e,t);if(!0===this._wrap&&(e={box:e}),!0===this._unify){var i={count:0,empty:0===r.length,total:Math.ceil(r.length/this._count)};e.unify=e.unify||{},e.unify[this._name]=i,this.log("info",e,t,e.unify)}0===r.length&&this._bypass&&this._bypass.handle(e,t,n);for(var a=0;a<r.length;a+=this._count)this.pass.apply(this,_toConsumableArray(this.merge(e,t,r,a,a+this._count)).concat([n]))}},{key:"merge",value:function(e,t,n,r,i){return this._merge?this._merge(e,t,n,r,i):(t=n.slice(r,i),[e,t=1===this._count?t.pop():t])}}]),n}(),Streamer=function(){function r(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,r),(e=_possibleConstructorReturn(this,_getPrototypeOf(r).call(this,t)))._read=null,e._write=null,e.setRead(t.read),e.setWrite(t.write),e}return _inherits(r,Worker),_createClass(r,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(r.prototype),"getOptions",this).call(this),{read:this._read,write:this._write})}},{key:"getRead",value:function(){return this._read}},{key:"setRead",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._read=t,this}},{key:"getWrite",value:function(){return this._write}},{key:"setWrite",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._write=t,this}},{key:"act",value:function(e,t,n){this._read?this.read(e):this._write&&this.write(e,t,n)}},{key:"createReadStream",value:function(e,t,n){this._read(e,t,n)}},{key:"createWriteStream",value:function(e,t,n){this._write(e,t,n)}},{key:"data",value:function(n,e){var r=this;this._write?this.write(n,e,function(e,t){r.throttle(n,t)}):this.pass(n,e,function(e,t){r.throttle(n,t)})}},{key:"end",value:function(e){this._write?this.write(e,null):this.pass(e,null)}},{key:"fail",value:function(e,t,n){this.throttle(e,!1),_get(_getPrototypeOf(r.prototype),"fail",this).call(this,e,t,n)}},{key:"pause",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:function(){},r=e["writer_"+this._id];r.paused||(r.paused=!0,r.once("drain",function(){r.paused=!1,n(e,!0)}),n(e,!1))}},{key:"read",value:function(t,e){var n=this;this.startRead(t,e,function(e){e&&n.fail(t,e)})}},{key:"startRead",value:function(n,e,t){var r=this,i=2<arguments.length&&void 0!==t?t:function(){};n["reader_"+this._id]?i(null,n["reader_"+this._id]):this.createReadStream(n,e,function(e,t){e?i(e):("string"==typeof t&&(t=fs.createReadStream(t)),0===(n["reader_"+r._id]=t).listenerCount("error")&&t.once("error",function(e){delete n["reader_"+r._id],t.removeAllListeners(),i(e)}),t.on("data",function(e){r.data(n,e)}),t.once("end",function(){delete n["reader_"+r._id],t.removeAllListeners(),r.end(n)}),i(null,t))})}},{key:"startWrite",value:function(n,e,r){var i=this;n["writer_"+this._id]?r(null,n["writer_"+this._id]):this.createWriteStream(n,e,function(e,t){e?r(e):("string"==typeof t&&(t=fs.createWriteStream(t)),(n["writer_"+i._id]=t).paused=!1,0===t.listenerCount("error")&&t.once("error",function(e){delete n["writer_"+i._id],t.removeAllListeners(),r(e)}),t.once("finish",function(){delete n["writer_"+i._id],t.removeAllListeners(),i.pass(n,null)}),r(null,t))})}},{key:"throttle",value:function(e,t){void 0!==e["reader_"+this._id]&&(t?e["reader_"+this._id].resume():e["reader_"+this._id].pause())}},{key:"write",value:function(n,r,i){var a=this;this.startWrite(n,r,function(e,t){e?a.fail(n,e):null!==r?!1===t.write(r)&&a.pause(n,i):t.end()})}}]),r}(),Timer=function(){function n(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,n),(e=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this,t)))._immediate=null,e._interval=null,e._schedule=null,e.setImmediate(t.immediate),e.setInterval(t.interval),e.setSchedule(t.schedule),e}return _inherits(n,Worker),_createClass(n,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(n.prototype),"getOptions",this).call(this),{immediate:this._immediate,interval:this._interval,schedule:this._schedule})}},{key:"getImmediate",value:function(){return this._immediate}},{key:"setImmediate",value:function(e){var t=0<arguments.length&&void 0!==e&&e;return this._immediate=t,this}},{key:"getInterval",value:function(){return this._interval}},{key:"setInterval",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._interval=t,this}},{key:"getSchedule",value:function(){return this._schedule}},{key:"setSchedule",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._schedule=t,this}},{key:"execute",value:function(e){this.handle(e,this.filter(e))}},{key:"executeInterval",value:function(){for(var e="number"==typeof this._interval?{default:this._interval}:this._interval,t=Object.keys(e),n=null,r=0;r<t.length;r+=1)n=t[r],this.makeInterval(n,e[n])}},{key:"executeSchedule",value:function(){for(var e="string"==typeof this._schedule?{default:this._schedule}:this._schedule,t=Object.keys(e),n=null,r=0;r<t.length;r+=1)n=t[r],this.makeSchedule(n,e[n])}},{key:"makeInterval",value:function(e,t){var n=this;setInterval(function(){n.log("info","interval",e,t),n.execute({interval:e})},t)}},{key:"makeSchedule",value:function(e,t){var n=this;cron.schedule(t,function(){n.log("info","schedule",e,t),n.execute({schedule:e})})}},{key:"start",value:function(){null!==this._schedule&&this.executeSchedule(),null!==this._interval&&this.executeInterval(),this._immediate&&this.execute({immediate:!0})}}]),n}(),Unifier=function(){function n(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,n),(e=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this,t)))._collect=null,e._name=null,e._sync=null,e.setCollect(t.collect),e.setName(t.name),e.setSync(t.sync),e}return _inherits(n,Worker),_createClass(n,[{key:"getOptions",value:function(){return Object.assign(_get(_getPrototypeOf(n.prototype),"getOptions",this).call(this),{collect:this._collect,name:this._name})}},{key:"getCollect",value:function(){return this._collect}},{key:"setCollect",value:function(e){var t=0<arguments.length&&void 0!==e&&e;return this._collect=t,this}},{key:"getName",value:function(){return this._name}},{key:"setName",value:function(e){var t=0<arguments.length&&void 0!==e?e:"default";return this._name=t,this}},{key:"getSync",value:function(){return this._sync}},{key:"setSync",value:function(e){var t=0<arguments.length&&void 0!==e&&e;return this._sync=t,this}},{key:"act",value:function(e,t,n){var r=e.unify[this._name];if(r.count+=1,!0===this._collect&&(r.data=r.data||[],!1===r.empty)){var i=void 0===t.index?r.data.length:t.index;r.data[i]=t}var a=!0===r.empty||r.count%r.total==0;this.log("info",e,t,r),!1==a?this._sync&&n():!0==a&&(!0===this._collect&&(t=r.data,delete r.data),!0===this._wrap&&(e=e.box),this.pass(e,t,n))}},{key:"decide",value:function(e,t){return this._decide?this._decide(e,t):void 0!==e.unify}},{key:"err",value:function(e,t,n){this.handle(e,t,n)}}]),n}();exports.Broadcaster=Broadcaster,exports.Builder=Builder,exports.Manager=Manager,exports.Queuer=Queuer,exports.Router=Router,exports.Slicer=Slicer,exports.Streamer=Streamer,exports.Timer=Timer,exports.Unifier=Unifier,exports.Worker=Worker,exports.vsprintf=vsprintf;