UNPKG

@nocobase/plugin-workflow

Version:

A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.

1 lines • 93.9 kB
(function(){"use strict";var e={558:function(e,t,n){var r=n(334);CronDate.prototype.addYear=function(){this._date=this._date.plus({years:1})};CronDate.prototype.addMonth=function(){this._date=this._date.plus({months:1}).startOf("month")};CronDate.prototype.addDay=function(){this._date=this._date.plus({days:1}).startOf("day")};CronDate.prototype.addHour=function(){var e=this._date;this._date=this._date.plus({hours:1}).startOf("hour");if(this._date<=e){this._date=this._date.plus({hours:1})}};CronDate.prototype.addMinute=function(){var e=this._date;this._date=this._date.plus({minutes:1}).startOf("minute");if(this._date<e){this._date=this._date.plus({hours:1})}};CronDate.prototype.addSecond=function(){var e=this._date;this._date=this._date.plus({seconds:1}).startOf("second");if(this._date<e){this._date=this._date.plus({hours:1})}};CronDate.prototype.subtractYear=function(){this._date=this._date.minus({years:1})};CronDate.prototype.subtractMonth=function(){this._date=this._date.minus({months:1}).endOf("month").startOf("second")};CronDate.prototype.subtractDay=function(){this._date=this._date.minus({days:1}).endOf("day").startOf("second")};CronDate.prototype.subtractHour=function(){var e=this._date;this._date=this._date.minus({hours:1}).endOf("hour").startOf("second");if(this._date>=e){this._date=this._date.minus({hours:1})}};CronDate.prototype.subtractMinute=function(){var e=this._date;this._date=this._date.minus({minutes:1}).endOf("minute").startOf("second");if(this._date>e){this._date=this._date.minus({hours:1})}};CronDate.prototype.subtractSecond=function(){var e=this._date;this._date=this._date.minus({seconds:1}).startOf("second");if(this._date>e){this._date=this._date.minus({hours:1})}};CronDate.prototype.getDate=function(){return this._date.day};CronDate.prototype.getFullYear=function(){return this._date.year};CronDate.prototype.getDay=function(){var e=this._date.weekday;return e==7?0:e};CronDate.prototype.getMonth=function(){return this._date.month-1};CronDate.prototype.getHours=function(){return this._date.hour};CronDate.prototype.getMinutes=function(){return this._date.minute};CronDate.prototype.getSeconds=function(){return this._date.second};CronDate.prototype.getMilliseconds=function(){return this._date.millisecond};CronDate.prototype.getTime=function(){return this._date.valueOf()};CronDate.prototype.getUTCDate=function(){return this._getUTC().day};CronDate.prototype.getUTCFullYear=function(){return this._getUTC().year};CronDate.prototype.getUTCDay=function(){var e=this._getUTC().weekday;return e==7?0:e};CronDate.prototype.getUTCMonth=function(){return this._getUTC().month-1};CronDate.prototype.getUTCHours=function(){return this._getUTC().hour};CronDate.prototype.getUTCMinutes=function(){return this._getUTC().minute};CronDate.prototype.getUTCSeconds=function(){return this._getUTC().second};CronDate.prototype.toISOString=function(){return this._date.toUTC().toISO()};CronDate.prototype.toJSON=function(){return this._date.toJSON()};CronDate.prototype.setDate=function(e){this._date=this._date.set({day:e})};CronDate.prototype.setFullYear=function(e){this._date=this._date.set({year:e})};CronDate.prototype.setDay=function(e){this._date=this._date.set({weekday:e})};CronDate.prototype.setMonth=function(e){this._date=this._date.set({month:e+1})};CronDate.prototype.setHours=function(e){this._date=this._date.set({hour:e})};CronDate.prototype.setMinutes=function(e){this._date=this._date.set({minute:e})};CronDate.prototype.setSeconds=function(e){this._date=this._date.set({second:e})};CronDate.prototype.setMilliseconds=function(e){this._date=this._date.set({millisecond:e})};CronDate.prototype._getUTC=function(){return this._date.toUTC()};CronDate.prototype.toString=function(){return this.toDate().toString()};CronDate.prototype.toDate=function(){return this._date.toJSDate()};CronDate.prototype.isLastDayOfMonth=function(){var e=this._date.plus({days:1}).startOf("day");return this._date.month!==e.month};CronDate.prototype.isLastWeekdayOfMonth=function(){var e=this._date.plus({days:7}).startOf("day");return this._date.month!==e.month};function CronDate(e,t){var n={zone:t};if(!e){this._date=r.DateTime.local()}else if(e instanceof CronDate){this._date=e._date}else if(e instanceof Date){this._date=r.DateTime.fromJSDate(e,n)}else if(typeof e==="number"){this._date=r.DateTime.fromMillis(e,n)}else if(typeof e==="string"){this._date=r.DateTime.fromISO(e,n);this._date.isValid||(this._date=r.DateTime.fromRFC2822(e,n));this._date.isValid||(this._date=r.DateTime.fromSQL(e,n));this._date.isValid||(this._date=r.DateTime.fromFormat(e,"EEE, d MMM yyyy HH:mm:ss",n))}if(!this._date||!this._date.isValid){throw new Error("CronDate: unhandled timestamp: "+JSON.stringify(e))}if(t&&t!==this._date.zoneName){this._date=this._date.setZone(t)}}e.exports=CronDate},656:function(e,t,n){var r=n(558);var s=n(171);var i=1e4;function CronExpression(e,t){this._options=t;this._utc=t.utc||false;this._tz=this._utc?"UTC":t.tz;this._currentDate=new r(t.currentDate,this._tz);this._startDate=t.startDate?new r(t.startDate,this._tz):null;this._endDate=t.endDate?new r(t.endDate,this._tz):null;this._isIterator=t.iterator||false;this._hasIterated=false;this._nthDayOfWeek=t.nthDayOfWeek||0;this.fields=CronExpression._freezeFields(e)}CronExpression.map=["second","minute","hour","dayOfMonth","month","dayOfWeek"];CronExpression.predefined={"@yearly":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@hourly":"0 * * * *"};CronExpression.constraints=[{min:0,max:59,chars:[]},{min:0,max:59,chars:[]},{min:0,max:23,chars:[]},{min:1,max:31,chars:["L"]},{min:1,max:12,chars:[]},{min:0,max:7,chars:["L"]}];CronExpression.daysInMonth=[31,29,31,30,31,30,31,31,30,31,30,31];CronExpression.aliases={month:{jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},dayOfWeek:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6}};CronExpression.parseDefaults=["0","*","*","*","*","*"];CronExpression.standardValidCharacters=/^[,*\d/-]+$/;CronExpression.dayOfWeekValidCharacters=/^[?,*\dL#/-]+$/;CronExpression.dayOfMonthValidCharacters=/^[?,*\dL/-]+$/;CronExpression.validCharacters={second:CronExpression.standardValidCharacters,minute:CronExpression.standardValidCharacters,hour:CronExpression.standardValidCharacters,dayOfMonth:CronExpression.dayOfMonthValidCharacters,month:CronExpression.standardValidCharacters,dayOfWeek:CronExpression.dayOfWeekValidCharacters};CronExpression._isValidConstraintChar=function _isValidConstraintChar(e,t){if(typeof t!=="string"){return false}return e.chars.some((function(e){return t.indexOf(e)>-1}))};CronExpression._parseField=function _parseField(e,t,n){switch(e){case"month":case"dayOfWeek":var r=CronExpression.aliases[e];t=t.replace(/[a-z]{3}/gi,(function(e){e=e.toLowerCase();if(typeof r[e]!=="undefined"){return r[e]}else{throw new Error('Validation error, cannot resolve alias "'+e+'"')}}));break}if(!CronExpression.validCharacters[e].test(t)){throw new Error("Invalid characters, got value: "+t)}if(t.indexOf("*")!==-1){t=t.replace(/\*/g,n.min+"-"+n.max)}else if(t.indexOf("?")!==-1){t=t.replace(/\?/g,n.min+"-"+n.max)}function parseSequence(t){var r=[];function handleResult(t){if(t instanceof Array){for(var s=0,i=t.length;s<i;s++){var a=t[s];if(CronExpression._isValidConstraintChar(n,a)){r.push(a);continue}if(typeof a!=="number"||Number.isNaN(a)||a<n.min||a>n.max){throw new Error("Constraint error, got value "+a+" expected range "+n.min+"-"+n.max)}r.push(a)}}else{if(CronExpression._isValidConstraintChar(n,t)){r.push(t);return}var o=+t;if(Number.isNaN(o)||o<n.min||o>n.max){throw new Error("Constraint error, got value "+t+" expected range "+n.min+"-"+n.max)}if(e==="dayOfWeek"){o=o%7}r.push(o)}}var s=t.split(",");if(!s.every((function(e){return e.length>0}))){throw new Error("Invalid list value format")}if(s.length>1){for(var i=0,a=s.length;i<a;i++){handleResult(parseRepeat(s[i]))}}else{handleResult(parseRepeat(t))}r.sort(CronExpression._sortCompareFn);return r}function parseRepeat(e){var t=1;var r=e.split("/");if(r.length>1){if(r[0]==+r[0]){r=[r[0]+"-"+n.max,r[1]]}return parseRange(r[0],r[r.length-1])}return parseRange(e,t)}function parseRange(e,t){var r=[];var s=e.split("-");if(s.length>1){if(s.length<2){return+e}if(!s[0].length){if(!s[1].length){throw new Error("Invalid range: "+e)}return+e}var i=+s[0];var a=+s[1];if(Number.isNaN(i)||Number.isNaN(a)||i<n.min||a>n.max){throw new Error("Constraint error, got range "+i+"-"+a+" expected range "+n.min+"-"+n.max)}else if(i>=a){throw new Error("Invalid range: "+e)}var o=+t;if(Number.isNaN(o)||o<=0){throw new Error("Constraint error, cannot repeat at every "+o+" time.")}for(var u=i,l=a;u<=l;u++){if(o>0&&o%t===0){o=1;r.push(u)}else{o++}}return r}return Number.isNaN(+e)?e:+e}return parseSequence(t)};CronExpression._sortCompareFn=function(e,t){var n=typeof e==="number";var r=typeof t==="number";if(n&&r){return e-t}if(!n&&r){return 1}if(n&&!r){return-1}return e.localeCompare(t)};CronExpression._handleMaxDaysInMonth=function(e){if(e.month.length===1){var t=CronExpression.daysInMonth[e.month[0]-1];if(e.dayOfMonth[0]>t){throw new Error("Invalid explicit day of month definition")}return e.dayOfMonth.filter((function(e){return e==="L"?true:e<=t})).sort(CronExpression._sortCompareFn)}};CronExpression._freezeFields=function(e){for(var t=0,n=CronExpression.map.length;t<n;++t){var r=CronExpression.map[t];var s=e[r];e[r]=Object.freeze(s)}return Object.freeze(e)};CronExpression.prototype._applyTimezoneShift=function(e,t,n){if(n==="Month"||n==="Day"){var r=e.getTime();e[t+n]();var s=e.getTime();if(r===s){if(e.getMinutes()===0&&e.getSeconds()===0){e.addHour()}else if(e.getMinutes()===59&&e.getSeconds()===59){e.subtractHour()}}}else{var i=e.getHours();e[t+n]();var a=e.getHours();var o=a-i;if(o===2){if(this.fields.hour.length!==24){this._dstStart=a}}else if(o===0&&e.getMinutes()===0&&e.getSeconds()===0){if(this.fields.hour.length!==24){this._dstEnd=a}}}};CronExpression.prototype._findSchedule=function _findSchedule(e){function matchSchedule(e,t){for(var n=0,r=t.length;n<r;n++){if(t[n]>=e){return t[n]===e}}return t[0]===e}function isNthDayMatch(e,t){if(t<6){if(e.getDate()<8&&t===1){return true}var n=e.getDate()%7?1:0;var r=e.getDate()-e.getDate()%7;var s=Math.floor(r/7)+n;return s===t}return false}function isLInExpressions(e){return e.length>0&&e.some((function(e){return typeof e==="string"&&e.indexOf("L")>=0}))}e=e||false;var t=e?"subtract":"add";var n=new r(this._currentDate,this._tz);var s=this._startDate;var a=this._endDate;var o=n.getTime();var u=0;function isLastWeekdayOfMonthMatch(e){return e.some((function(e){if(!isLInExpressions([e])){return false}var t=Number.parseInt(e[0])%7;if(Number.isNaN(t)){throw new Error("Invalid last weekday of the month expression: "+e)}return n.getDay()===t&&n.isLastWeekdayOfMonth()}))}while(u<i){u++;if(e){if(s&&n.getTime()-s.getTime()<0){throw new Error("Out of the timespan range")}}else{if(a&&a.getTime()-n.getTime()<0){throw new Error("Out of the timespan range")}}var l=matchSchedule(n.getDate(),this.fields.dayOfMonth);if(isLInExpressions(this.fields.dayOfMonth)){l=l||n.isLastDayOfMonth()}var c=matchSchedule(n.getDay(),this.fields.dayOfWeek);if(isLInExpressions(this.fields.dayOfWeek)){c=c||isLastWeekdayOfMonthMatch(this.fields.dayOfWeek)}var f=this.fields.dayOfMonth.length>=CronExpression.daysInMonth[n.getMonth()];var d=this.fields.dayOfWeek.length===CronExpression.constraints[5].max-CronExpression.constraints[5].min+1;var h=n.getHours();if(!l&&(!c||d)){this._applyTimezoneShift(n,t,"Day");continue}if(!f&&d&&!l){this._applyTimezoneShift(n,t,"Day");continue}if(f&&!d&&!c){this._applyTimezoneShift(n,t,"Day");continue}if(this._nthDayOfWeek>0&&!isNthDayMatch(n,this._nthDayOfWeek)){this._applyTimezoneShift(n,t,"Day");continue}if(!matchSchedule(n.getMonth()+1,this.fields.month)){this._applyTimezoneShift(n,t,"Month");continue}if(!matchSchedule(h,this.fields.hour)){if(this._dstStart!==h){this._dstStart=null;this._applyTimezoneShift(n,t,"Hour");continue}else if(!matchSchedule(h-1,this.fields.hour)){n[t+"Hour"]();continue}}else if(this._dstEnd===h){if(!e){this._dstEnd=null;this._applyTimezoneShift(n,"add","Hour");continue}}if(!matchSchedule(n.getMinutes(),this.fields.minute)){this._applyTimezoneShift(n,t,"Minute");continue}if(!matchSchedule(n.getSeconds(),this.fields.second)){this._applyTimezoneShift(n,t,"Second");continue}if(o===n.getTime()){if(t==="add"||n.getMilliseconds()===0){this._applyTimezoneShift(n,t,"Second")}else{n.setMilliseconds(0)}continue}break}if(u>=i){throw new Error("Invalid expression, loop limit exceeded")}this._currentDate=new r(n,this._tz);this._hasIterated=true;return n};CronExpression.prototype.next=function next(){var e=this._findSchedule();if(this._isIterator){return{value:e,done:!this.hasNext()}}return e};CronExpression.prototype.prev=function prev(){var e=this._findSchedule(true);if(this._isIterator){return{value:e,done:!this.hasPrev()}}return e};CronExpression.prototype.hasNext=function(){var e=this._currentDate;var t=this._hasIterated;try{this._findSchedule();return true}catch(e){return false}finally{this._currentDate=e;this._hasIterated=t}};CronExpression.prototype.hasPrev=function(){var e=this._currentDate;var t=this._hasIterated;try{this._findSchedule(true);return true}catch(e){return false}finally{this._currentDate=e;this._hasIterated=t}};CronExpression.prototype.iterate=function iterate(e,t){var n=[];if(e>=0){for(var r=0,s=e;r<s;r++){try{var i=this.next();n.push(i);if(t){t(i,r)}}catch(e){break}}}else{for(var r=0,s=e;r>s;r--){try{var i=this.prev();n.push(i);if(t){t(i,r)}}catch(e){break}}}return n};CronExpression.prototype.reset=function reset(e){this._currentDate=new r(e||this._options.currentDate)};CronExpression.prototype.stringify=function stringify(e){var t=[];for(var n=e?0:1,r=CronExpression.map.length;n<r;++n){var i=CronExpression.map[n];var a=this.fields[i];var o=CronExpression.constraints[n];t.push(s(a,o.min,o.max))}return t.join(" ")};CronExpression.parse=function parse(e,t){var n=this;if(typeof t==="function"){t={}}function parse(e,t){if(!t){t={}}if(typeof t.currentDate==="undefined"){t.currentDate=new r(undefined,n._tz)}if(CronExpression.predefined[e]){e=CronExpression.predefined[e]}var s=[];var i=(e+"").trim().split(/\s+/);if(i.length>6){throw new Error("Invalid cron expression")}var a=CronExpression.map.length-i.length;for(var o=0,u=CronExpression.map.length;o<u;++o){var l=CronExpression.map[o];var c=i[i.length>u?o:o-a];if(o<a||!c){s.push(CronExpression._parseField(l,CronExpression.parseDefaults[o],CronExpression.constraints[o]))}else{var f=l==="dayOfWeek"?parseNthDay(c):c;s.push(CronExpression._parseField(l,f,CronExpression.constraints[o]))}}var d={};for(var o=0,u=CronExpression.map.length;o<u;o++){var h=CronExpression.map[o];d[h]=s[o]}var m=CronExpression._handleMaxDaysInMonth(d);d.dayOfMonth=m||d.dayOfMonth;return new CronExpression(d,t);function parseNthDay(e){var n=e.split("#");if(n.length>1){var r=+n[n.length-1];if(/,/.test(e)){throw new Error("Constraint error, invalid dayOfWeek `#` and `,` "+"special characters are incompatible")}if(/\//.test(e)){throw new Error("Constraint error, invalid dayOfWeek `#` and `/` "+"special characters are incompatible")}if(/-/.test(e)){throw new Error("Constraint error, invalid dayOfWeek `#` and `-` "+"special characters are incompatible")}if(n.length>2||Number.isNaN(r)||(r<1||r>5)){throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)")}t.nthDayOfWeek=r;return n[0]}return e}}return parse(e,t)};CronExpression.fieldsToExpression=function fieldsToExpression(e,t){function validateConstraints(e,t,n){if(!t){throw new Error("Validation error, Field "+e+" is missing")}if(t.length===0){throw new Error("Validation error, Field "+e+" contains no values")}for(var r=0,s=t.length;r<s;r++){var i=t[r];if(CronExpression._isValidConstraintChar(n,i)){continue}if(typeof i!=="number"||Number.isNaN(i)||i<n.min||i>n.max){throw new Error("Constraint error, got value "+i+" expected range "+n.min+"-"+n.max)}}}var n={};for(var r=0,s=CronExpression.map.length;r<s;++r){var i=CronExpression.map[r];var a=e[i];validateConstraints(i,a,CronExpression.constraints[r]);var o=[];var u=-1;while(++u<a.length){o[u]=a[u]}a=o.sort(CronExpression._sortCompareFn).filter((function(e,t,n){return!t||e!==n[t-1]}));if(a.length!==o.length){throw new Error("Validation error, Field "+i+" contains duplicate values")}n[i]=a}var l=CronExpression._handleMaxDaysInMonth(n);n.dayOfMonth=l||n.dayOfMonth;return new CronExpression(n,t||{})};e.exports=CronExpression},818:function(e){function buildRange(e){return{start:e,count:1}}function completeRangeWithItem(e,t){e.end=t;e.step=t-e.start;e.count=2}function finalizeCurrentRange(e,t,n){if(t){if(t.count===2){e.push(buildRange(t.start));e.push(buildRange(t.end))}else{e.push(t)}}if(n){e.push(n)}}function compactField(e){var t=[];var n=undefined;for(var r=0;r<e.length;r++){var s=e[r];if(typeof s!=="number"){finalizeCurrentRange(t,n,buildRange(s));n=undefined}else if(!n){n=buildRange(s)}else if(n.count===1){completeRangeWithItem(n,s)}else{if(n.step===s-n.end){n.count++;n.end=s}else if(n.count===2){t.push(buildRange(n.start));n=buildRange(n.end);completeRangeWithItem(n,s)}else{finalizeCurrentRange(t,n);n=buildRange(s)}}}finalizeCurrentRange(t,n);return t}e.exports=compactField},171:function(e,t,n){var r=n(818);function stringifyField(e,t,n){var s=r(e);if(s.length===1){var i=s[0];var a=i.step;if(a===1&&i.start===t&&i.end===n){return"*"}if(a!==1&&i.start===t&&i.end===n-a+1){return"*/"+a}}var o=[];for(var u=0,l=s.length;u<l;++u){var c=s[u];if(c.count===1){o.push(c.start)}else{var a=c.step;if(a===1){o.push(c.start+"-"+c.end)}else{if(c.end===n-a+1){o.push(c.start+"/"+a)}else{o.push(c.start+"-"+c.end+"/"+a)}}}}return o.join(",")}e.exports=stringifyField},855:function(e,t,n){var r=n(656);function CronParser(){}CronParser._parseEntry=function _parseEntry(e){var t=e.split(" ");if(t.length===6){return{interval:r.parse(e)}}else if(t.length>6){return{interval:r.parse(t.slice(0,6).join(" ")),command:t.slice(6,t.length)}}else{throw new Error("Invalid entry: "+e)}};CronParser.parseExpression=function parseExpression(e,t){return r.parse(e,t)};CronParser.fieldsToExpression=function fieldsToExpression(e,t){return r.fieldsToExpression(e,t)};CronParser.parseString=function parseString(e){var t=e.split("\n");var n={variables:{},expressions:[],errors:{}};for(var r=0,s=t.length;r<s;r++){var i=t[r];var a=null;var o=i.trim();if(o.length>0){if(o.match(/^#/)){continue}else if(a=o.match(/^(.*)=(.*)$/)){n.variables[a[1]]=a[2]}else{var u=null;try{u=CronParser._parseEntry("0 "+o);n.expressions.push(u.interval)}catch(e){n.errors[o]=e}}}}return n};CronParser.parseFile=function parseFile(e,t){n(147).readFile(e,(function(e,n){if(e){t(e);return}return t(null,CronParser.parseString(n.toString()))}))};e.exports=CronParser},334:function(e,t){Object.defineProperty(t,"__esModule",{value:true});class LuxonError extends Error{}class InvalidDateTimeError extends LuxonError{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class InvalidIntervalError extends LuxonError{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class InvalidDurationError extends LuxonError{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class ConflictingSpecificationError extends LuxonError{}class InvalidUnitError extends LuxonError{constructor(e){super(`Invalid unit ${e}`)}}class InvalidArgumentError extends LuxonError{}class ZoneIsAbstractError extends LuxonError{constructor(){super("Zone is an abstract class")}}const n="numeric",r="short",s="long";const i={year:n,month:n,day:n};const a={year:n,month:r,day:n};const o={year:n,month:r,day:n,weekday:r};const u={year:n,month:s,day:n};const l={year:n,month:s,day:n,weekday:s};const c={hour:n,minute:n};const f={hour:n,minute:n,second:n};const d={hour:n,minute:n,second:n,timeZoneName:r};const h={hour:n,minute:n,second:n,timeZoneName:s};const m={hour:n,minute:n,hour12:false};const y={hour:n,minute:n,second:n,hour12:false};const p={hour:n,minute:n,second:n,hour12:false,timeZoneName:r};const g={hour:n,minute:n,second:n,hour12:false,timeZoneName:s};const v={year:n,month:n,day:n,hour:n,minute:n};const T={year:n,month:n,day:n,hour:n,minute:n,second:n};const O={year:n,month:r,day:n,hour:n,minute:n};const w={year:n,month:r,day:n,hour:n,minute:n,second:n};const D={year:n,month:r,day:n,weekday:r,hour:n,minute:n};const S={year:n,month:s,day:n,hour:n,minute:n,timeZoneName:r};const I={year:n,month:s,day:n,hour:n,minute:n,second:n,timeZoneName:r};const b={year:n,month:s,day:n,weekday:s,hour:n,minute:n,timeZoneName:s};const x={year:n,month:s,day:n,weekday:s,hour:n,minute:n,second:n,timeZoneName:s};function isUndefined(e){return typeof e==="undefined"}function isNumber(e){return typeof e==="number"}function isInteger(e){return typeof e==="number"&&e%1===0}function isString(e){return typeof e==="string"}function isDate(e){return Object.prototype.toString.call(e)==="[object Date]"}function hasIntl(){try{return typeof Intl!=="undefined"&&Intl.DateTimeFormat}catch(e){return false}}function hasFormatToParts(){return!isUndefined(Intl.DateTimeFormat.prototype.formatToParts)}function hasRelative(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(e){return false}}function maybeArray(e){return Array.isArray(e)?e:[e]}function bestBy(e,t,n){if(e.length===0){return undefined}return e.reduce(((e,r)=>{const s=[t(r),r];if(!e){return s}else if(n(e[0],s[0])===e[0]){return e}else{return s}}),null)[1]}function pick(e,t){return t.reduce(((t,n)=>{t[n]=e[n];return t}),{})}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function integerBetween(e,t,n){return isInteger(e)&&e>=t&&e<=n}function floorMod(e,t){return e-t*Math.floor(e/t)}function padStart(e,t=2){const n=e<0?"-":"";const r=n?e*-1:e;let s;if(r.toString().length<t){s=("0".repeat(t)+r).slice(-t)}else{s=r.toString()}return`${n}${s}`}function parseInteger(e){if(isUndefined(e)||e===null||e===""){return undefined}else{return parseInt(e,10)}}function parseMillis(e){if(isUndefined(e)||e===null||e===""){return undefined}else{const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function roundTo(e,t,n=false){const r=Math.pow(10,t),s=n?Math.trunc:Math.round;return s(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){const n=floorMod(t-1,12)+1,r=e+(t-n)/12;if(n===2){return isLeapYear(r)?29:28}else{return[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}}function objToLocalTS(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);if(e.year<100&&e.year>=0){t=new Date(t);t.setUTCFullYear(t.getUTCFullYear()-1900)}return+t}function weeksInWeekYear(e){const 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 t===4||r===3?53:52}function untruncateYear(e){if(e>99){return e}else return e>60?1900+e:2e3+e}function parseZoneInfo(e,t,n,r=null){const s=new Date(e),i={hour12:false,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(r){i.timeZone=r}const a=Object.assign({timeZoneName:t},i),o=hasIntl();if(o&&hasFormatToParts()){const e=new Intl.DateTimeFormat(n,a).formatToParts(s).find((e=>e.type.toLowerCase()==="timezonename"));return e?e.value:null}else if(o){const e=new Intl.DateTimeFormat(n,i).format(s),t=new Intl.DateTimeFormat(n,a).format(s),r=t.substring(e.length),o=r.replace(/^[, \u200e]+/,"");return o}else{return null}}function signedOffset(e,t){let n=parseInt(e,10);if(Number.isNaN(n)){n=0}const r=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-r:r;return n*60+s}function asNumber(e){const t=Number(e);if(typeof e==="boolean"||e===""||Number.isNaN(t))throw new InvalidArgumentError(`Invalid unit value ${e}`);return t}function normalizeObject(e,t,n){const r={};for(const s in e){if(hasOwnProperty(e,s)){if(n.indexOf(s)>=0)continue;const i=e[s];if(i===undefined||i===null)continue;r[t(s)]=asNumber(i)}}return r}function formatOffset(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${padStart(n,2)}:${padStart(r,2)}`;case"narrow":return`${s}${n}${r>0?`:${r}`:""}`;case"techie":return`${s}${padStart(n,2)}${padStart(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function timeObject(e){return pick(e,["hour","minute","second","millisecond"])}const E=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function stringify(e){return JSON.stringify(e,Object.keys(e).sort())}const C=["January","February","March","April","May","June","July","August","September","October","November","December"];const k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const _=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return[..._];case"short":return[...k];case"long":return[...C];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}}const M=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];const N=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];const F=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return[...F];case"short":return[...N];case"long":return[...M];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const L=["AM","PM"];const Z=["Before Christ","Anno Domini"];const V=["BC","AD"];const U=["B","A"];function eras(e){switch(e){case"narrow":return[...U];case"short":return[...V];case"long":return[...Z];default:return null}}function meridiemForDateTime(e){return L[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,n="always",r=false){const s={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."]};const i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const n=e==="days";switch(t){case 1:return n?"tomorrow":`next ${s[e][0]}`;case-1:return n?"yesterday":`last ${s[e][0]}`;case 0:return n?"today":`this ${s[e][0]}`}}const a=Object.is(t,-0)||t<0,o=Math.abs(t),u=o===1,l=s[e],c=r?u?l[1]:l[2]||l[1]:u?s[e][0]:e;return a?`${o} ${c} ago`:`in ${o} ${c}`}function formatString(e){const t=pick(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]),n=stringify(t),r="EEEE, LLLL d, yyyy, h:mm a";switch(n){case stringify(i):return"M/d/yyyy";case stringify(a):return"LLL d, yyyy";case stringify(o):return"EEE, LLL d, yyyy";case stringify(u):return"LLLL d, yyyy";case stringify(l):return"EEEE, LLLL d, yyyy";case stringify(c):return"h:mm a";case stringify(f):return"h:mm:ss a";case stringify(d):return"h:mm a";case stringify(h):return"h:mm a";case stringify(m):return"HH:mm";case stringify(y):return"HH:mm:ss";case stringify(p):return"HH:mm";case stringify(g):return"HH:mm";case stringify(v):return"M/d/yyyy, h:mm a";case stringify(O):return"LLL d, yyyy, h:mm a";case stringify(S):return"LLLL d, yyyy, h:mm a";case stringify(b):return r;case stringify(T):return"M/d/yyyy, h:mm:ss a";case stringify(w):return"LLL d, yyyy, h:mm:ss a";case stringify(D):return"EEE, d LLL yyyy, h:mm a";case stringify(I):return"LLLL d, yyyy, h:mm:ss a";case stringify(x):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return r}}function stringifyTokens(e,t){let n="";for(const r of e){if(r.literal){n+=r.val}else{n+=t(r.val)}}return n}const j={D:i,DD:a,DDD:u,DDDD:l,t:c,tt:f,ttt:d,tttt:h,T:m,TT:y,TTT:p,TTTT:g,f:v,ff:O,fff:S,ffff:b,F:T,FF:w,FFF:I,FFFF:x};class Formatter{static create(e,t={}){return new Formatter(e,t)}static parseFormat(e){let t=null,n="",r=false;const s=[];for(let i=0;i<e.length;i++){const a=e.charAt(i);if(a==="'"){if(n.length>0){s.push({literal:r,val:n})}t=null;n="";r=!r}else if(r){n+=a}else if(a===t){n+=a}else{if(n.length>0){s.push({literal:false,val:n})}n=a;t=a}}if(n.length>0){s.push({literal:r,val:n})}return s}static macroTokenToFormatOpts(e){return j[e]}constructor(e,t){this.opts=t;this.loc=e;this.systemLoc=null}formatWithSystemDefault(e,t){if(this.systemLoc===null){this.systemLoc=this.loc.redefaultToSystem()}const n=this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t));return n.format()}formatDateTime(e,t={}){const n=this.loc.dtFormatter(e,Object.assign({},this.opts,t));return n.format()}formatDateTimeParts(e,t={}){const n=this.loc.dtFormatter(e,Object.assign({},this.opts,t));return n.formatToParts()}resolvedOptions(e,t={}){const n=this.loc.dtFormatter(e,Object.assign({},this.opts,t));return n.resolvedOptions()}num(e,t=0){if(this.opts.forceSimple){return padStart(e,t)}const n=Object.assign({},this.opts);if(t>0){n.padTo=t}return this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory"&&hasFormatToParts(),string=(t,n)=>this.loc.extract(e,t,n),formatOffset=t=>{if(e.isOffsetFixed&&e.offset===0&&t.allowZ){return"Z"}return e.isValid?e.zone.formatOffset(e.ts,t.format):""},meridiem=()=>n?meridiemForDateTime(e):string({hour:"numeric",hour12:true},"dayperiod"),month=(t,r)=>n?monthForDateTime(e,t):string(r?{month:t}:{month:t,day:"numeric"},"month"),weekday=(t,r)=>n?weekdayForDateTime(e,t):string(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),maybeMacro=t=>{const n=Formatter.macroTokenToFormatOpts(t);if(n){return this.formatWithSystemDefault(e,n)}else{return t}},era=t=>n?eraForDateTime(e,t):string({era:t},"era"),tokenToString=t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return formatOffset({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return formatOffset({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return formatOffset({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return meridiem();case"d":return r?string({day:"numeric"},"day"):this.num(e.day);case"dd":return r?string({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return weekday("short",true);case"cccc":return weekday("long",true);case"ccccc":return weekday("narrow",true);case"E":return this.num(e.weekday);case"EEE":return weekday("short",false);case"EEEE":return weekday("long",false);case"EEEEE":return weekday("narrow",false);case"L":return r?string({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?string({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return month("short",true);case"LLLL":return month("long",true);case"LLLLL":return month("narrow",true);case"M":return r?string({month:"numeric"},"month"):this.num(e.month);case"MM":return r?string({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return month("short",false);case"MMMM":return month("long",false);case"MMMMM":return month("narrow",false);case"y":return r?string({year:"numeric"},"year"):this.num(e.year);case"yy":return r?string({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?string({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?string({year:"numeric"},"year"):this.num(e.year,6);case"G":return era("short");case"GG":return era("long");case"GGGGG":return era("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return maybeMacro(t)}};return stringifyTokens(Formatter.parseFormat(t),tokenToString)}formatDurationFromString(e,t){const tokenToField=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}},tokenToString=e=>t=>{const n=tokenToField(t);if(n){return this.num(e.get(n),t.length)}else{return t}},n=Formatter.parseFormat(t),r=n.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]),s=e.shiftTo(...r.map(tokenToField).filter((e=>e)));return stringifyTokens(n,tokenToString(s))}}class Invalid{constructor(e,t){this.reason=e;this.explanation=t}toMessage(){if(this.explanation){return`${this.reason}: ${this.explanation}`}else{return this.reason}}}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}class Zone{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get universal(){throw new ZoneIsAbstractError}offsetName(e,t){throw new ZoneIsAbstractError}formatOffset(e,t){throw new ZoneIsAbstractError}offset(e){throw new ZoneIsAbstractError}equals(e){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}}let z=null;class LocalZone extends Zone{static get instance(){if(z===null){z=new LocalZone}return z}get type(){return"local"}get name(){if(hasIntl()){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}else return"local"}get universal(){return false}offsetName(e,{format:t,locale:n}){return parseZoneInfo(e,t,n)}formatOffset(e,t){return formatOffset(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="local"}get isValid(){return true}}const A=RegExp(`^${E.source}$`);let R={};function makeDTF(e){if(!R[e]){R[e]=new Intl.DateTimeFormat("en-US",{hour12:false,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return R[e]}const $={year:0,month:1,day:2,hour:3,minute:4,second:5};function hackyOffset(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,s,i,a,o,u,l]=r;return[a,s,i,o,u,l]}function partsOffset(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:s}=n[e],i=$[t];if(!isUndefined(i)){r[i]=parseInt(s,10)}}return r}let W={};class IANAZone extends Zone{static create(e){if(!W[e]){W[e]=new IANAZone(e)}return W[e]}static resetCache(){W={};R={}}static isValidSpecifier(e){return!!(e&&e.match(A))}static isValidZone(e){try{new Intl.DateTimeFormat("en-US",{timeZone:e}).format();return true}catch(e){return false}}static parseGMTOffset(e){if(e){const t=e.match(/^Etc\/GMT(0|[+-]\d{1,2})$/i);if(t){return-60*parseInt(t[1])}}return null}constructor(e){super();this.zoneName=e;this.valid=IANAZone.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return false}offsetName(e,{format:t,locale:n}){return parseZoneInfo(e,t,n,this.name)}formatOffset(e,t){return formatOffset(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=makeDTF(this.name),[r,s,i,a,o,u]=n.formatToParts?partsOffset(n,t):hackyOffset(n,t),l=a===24?0:a;const c=objToLocalTS({year:r,month:s,day:i,hour:l,minute:o,second:u,millisecond:0});let f=+t;const d=f%1e3;f-=d>=0?d:1e3+d;return(c-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let q=null;class FixedOffsetZone extends Zone{static get utcInstance(){if(q===null){q=new FixedOffsetZone(0)}return q}static instance(e){return e===0?FixedOffsetZone.utcInstance:new FixedOffsetZone(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t){return new FixedOffsetZone(signedOffset(t[1],t[2]))}}return null}constructor(e){super();this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return formatOffset(this.fixed,t)}get universal(){return true}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return true}}class InvalidZone extends Zone{constructor(e){super();this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get universal(){return false}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return false}get isValid(){return false}}function normalizeZone(e,t){let n;if(isUndefined(e)||e===null){return t}else if(e instanceof Zone){return e}else if(isString(e)){const r=e.toLowerCase();if(r==="local")return t;else if(r==="utc"||r==="gmt")return FixedOffsetZone.utcInstance;else if((n=IANAZone.parseGMTOffset(e))!=null){return FixedOffsetZone.instance(n)}else if(IANAZone.isValidSpecifier(r))return IANAZone.create(e);else return FixedOffsetZone.parseSpecifier(r)||new InvalidZone(e)}else if(isNumber(e)){return FixedOffsetZone.instance(e)}else if(typeof e==="object"&&e.offset&&typeof e.offset==="number"){return e}else{return new InvalidZone(e)}}let now=()=>Date.now(),P=null,H=null,Y=null,J=null,G=false;class Settings{static get now(){return now}static set now(e){now=e}static get defaultZoneName(){return Settings.defaultZone.name}static set defaultZoneName(e){if(!e){P=null}else{P=normalizeZone(e)}}static get defaultZone(){return P||LocalZone.instance}static get defaultLocale(){return H}static set defaultLocale(e){H=e}static get defaultNumberingSystem(){return Y}static set defaultNumberingSystem(e){Y=e}static get defaultOutputCalendar(){return J}static set defaultOutputCalendar(e){J=e}static get throwOnInvalid(){return G}static set throwOnInvalid(e){G=e}static resetCaches(){Locale.resetCache();IANAZone.resetCache()}}let B={};function getCachedDTF(e,t={}){const n=JSON.stringify([e,t]);let r=B[n];if(!r){r=new Intl.DateTimeFormat(e,t);B[n]=r}return r}let Q={};function getCachedINF(e,t={}){const n=JSON.stringify([e,t]);let r=Q[n];if(!r){r=new Intl.NumberFormat(e,t);Q[n]=r}return r}let K={};function getCachedRTF(e,t={}){const n=_objectWithoutPropertiesLoose(t,["base"]);const r=JSON.stringify([e,n]);let s=K[r];if(!s){s=new Intl.RelativeTimeFormat(e,t);K[r]=s}return s}let X=null;function systemLocale(){if(X){return X}else if(hasIntl()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;X=!e||e==="und"?"en-US":e;return X}else{X="en-US";return X}}function parseLocaleString(e){const t=e.indexOf("-u-");if(t===-1){return[e]}else{let n;const r=e.substring(0,t);try{n=getCachedDTF(e).resolvedOptions()}catch(e){n=getCachedDTF(r).resolvedOptions()}const{numberingSystem:s,calendar:i}=n;return[r,s,i]}}function intlConfigString(e,t,n){if(hasIntl()){if(n||t){e+="-u";if(n){e+=`-ca-${n}`}if(t){e+=`-nu-${t}`}return e}else{return e}}else{return[]}}function mapMonths(e){const t=[];for(let n=1;n<=12;n++){const r=DateTime.utc(2016,n,1);t.push(e(r))}return t}function mapWeekdays(e){const t=[];for(let n=1;n<=7;n++){const r=DateTime.utc(2016,11,13+n);t.push(e(r))}return t}function listStuff(e,t,n,r,s){const i=e.listingMode(n);if(i==="error"){return null}else if(i==="en"){return r(t)}else{return s(t)}}function supportsFastNumbers(e){if(e.numberingSystem&&e.numberingSystem!=="latn"){return false}else{return e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||hasIntl()&&new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}}class PolyNumberFormatter{constructor(e,t,n){this.padTo=n.padTo||0;this.floor=n.floor||false;if(!t&&hasIntl()){const t={useGrouping:false};if(n.padTo>0)t.minimumIntegerDigits=n.padTo;this.inf=getCachedINF(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):roundTo(e,3);return padStart(t,this.padTo)}}}class PolyDateFormatter{constructor(e,t,n){this.opts=n;this.hasIntl=hasIntl();let r;if(e.zone.universal&&this.hasIntl){const t=-1*(e.offset/60);const s=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;const i=IANAZone.isValidZone(s);if(e.offset!==0&&i){r=s;this.dt=e}else{r="UTC";if(n.timeZoneName){this.dt=e}else{this.dt=e.offset===0?e:DateTime.fromMillis(e.ts+e.offset*60*1e3)}}}else if(e.zone.type==="local"){this.dt=e}else{this.dt=e;r=e.zone.name}if(this.hasIntl){const e=Object.assign({},this.opts);if(r){e.timeZone=r}this.dtf=getCachedDTF(t,e)}}format(){if(this.hasIntl){return this.dtf.format(this.dt.toJSDate())}else{const e=formatString(this.opts),t=Locale.create("en-US");return Formatter.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){if(this.hasIntl&&hasFormatToParts()){return this.dtf.formatToParts(this.dt.toJSDate())}else{return[]}}resolvedOptions(){if(this.hasIntl){return this.dtf.resolvedOptions()}else{return{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}}class PolyRelFormatter{constructor(e,t,n){this.opts=Object.assign({style:"long"},n);if(!t&&hasRelative()){this.rtf=getCachedRTF(e,n)}}format(e,t){if(this.rtf){return this.rtf.format(e,t)}else{return formatRelativeTime(t,e,this.opts.numeric,this.opts.style!=="long")}}formatToParts(e,t){if(this.rtf){return this.rtf.formatToParts(e,t)}else{return[]}}}class Locale{static fromOpts(e){return Locale.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=false){const s=e||Settings.defaultLocale,i=s||(r?"en-US":systemLocale()),a=t||Settings.defaultNumberingSystem,o=n||Settings.defaultOutputCalendar;return new Locale(i,a,o,s)}static resetCache(){X=null;B={};Q={};K={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Locale.create(e,t,n)}constructor(e,t,n,r){const[s,i,a]=parseLocaleString(e);this.locale=s;this.numberingSystem=t||i||null;this.outputCalendar=n||a||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}get fastNumbers(){if(this.fastNumbersCached==null){this.fastNumbersCached=supportsFastNumbers(this)}return this.fastNumbersCached}listingMode(e=true){const t=hasIntl(),n=t&&hasFormatToParts(),r=this.isEnglish(),s=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");if(!n&&!(r&&s)&&!e){return"error"}else if(!n||r&&s){return"en"}else{return"intl"}}clone(e){if(!e||Object.getOwnPropertyNames(e).length===0){return this}else{return Locale.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||false)}}redefaultToEN(e={}){return this.clone(Object.assign({},e,{defaultToEN:true}))}redefaultToSystem(e={}){return this.clone(Object.assign({},e,{defaultToEN:false}))}months(e,t=false,n=true){return listStuff(this,e,n,months,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";if(!this.monthsCache[r][e]){this.monthsCache[r][e]=mapMonths((e=>this.extract(e,n,"month")))}return this.monthsCache[r][e]}))}weekdays(e,t=false,n=true){return listStuff(this,e,n,weekdays,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";if(!this.weekdaysCache[r][e]){this.weekdaysCache[r][e]=mapWeekdays((e=>this.extract(e,n,"weekday")))}return this.weekdaysCache[r][e]}))}meridiems(e=true){return listStuff(this,undefined,e,(()=>L),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:true};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=true){return listStuff(this,e,t,eras,(()=>{const t={era:e};if(!this.eraCache[e]){this.eraCache[e]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))}return this.eraCache[e]}))}extract(e,t,n){const r=this.dtFormatter(e,t),s=r.formatToParts(),i=s.find((e=>e.type.toLowerCase()===n));return i?i.value:null}numberFormatter(e={}){return new PolyNumberFormatter(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new PolyDateFormatter(e,this.intl,t)}relFormatter(e={}){return new PolyRelFormatter(this.intl,this.isEnglish(),e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||hasIntl()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function combineRegexes(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function combineExtractors(...e){return t=>e.reduce((([e,n,r],s)=>{const[i,a,o]=s(t,r);return[Object.assign(e,i),n||a,o]}),[{},null,1]).slice(0,2)}function parse(e,...t){if(e==null){return[null,null]}for(const[n,r]of t){const t=n.exec(e);if(t){return r(t)}}return[null,null]}function simpleParse(...e){return(t,n)=>{const r={};let s;for(s=0;s<e.length;s++){r[e[s]]=parseInteger(t[n+s])}return[r,null,n+s]}}const ee=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,te=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ne=RegExp(`${te.source}${ee.source}?`),re=RegExp(`(?:T${ne.source})?`),se=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ie=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ae=/(\d{4})-?(\d{3})/,oe=simpleParse("weekYear","weekNumber","weekDay"),ue=simpleParse("year","ordinal"),le=/(\d{4})-(\d\d)-(\d\d)/,ce=RegExp(`${te.source} ?(?:${ee.source}|(${E.source}))?`),fe=RegExp(`(?: ${ce.source})?`);function int(e,t,n){const r=e[t];return isUndefined(r)?n:parseInteger(r)}function extractISOYmd(e,t){const n={year:int(e,t),month:int(e,t+1,1),day:int(e,t+2,1)};return[n,null,t+3]}function extractISOTime(e,t){const n={hours:int(e,t,0),minutes:int(e,t+1,0),seconds:int(e,t+2,0),milliseconds:parseMillis(e[t+3])};return[n,null,t+4]}function extractISOOffset(e,t){const n=!e[t]&&!e[t+1],r=signedOffset(e[t+1],e[t+2]),s=n?null:FixedOffsetZone.instance(r);return[{},s,t+3]}function extractIANAZone(e,t){const n=e[t]?IANAZone.create(e[t]):null;return[{},n,t+1]}const de=RegExp(`^T?${te.source}$`);const he=/^-?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,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function extractISODuration(e){const[t,n,r,s,i,a,o,u,l]=e;const c=t[0]==="-";const f=u&&u[0]==="-";const maybeNegate=(e,t=false)=>e!==undefined&&(t||e&&c)?-e:e;return[{years:maybeNegate(parseInteger(n)),months:maybeNegate(parseInteger(r)),weeks:maybeNegate(parseInteger(s)),days:maybeNegate(parseInteger(i)),hours:maybeNegate(parseInteger(a)),minutes:maybeNegate(parseInteger(o)),seconds:maybeNegate(parseInteger(u),u==="-0"),milliseconds:maybeNegate(parseMillis(l),f)}]}const me={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fromStrings(e,t,n,r,s,i,a){const o={year:t.length===2?untruncateYear(parseInteger(t)):parseInteger(t),month:k.indexOf(n)+1,day:parseInteger(r),hour:parseInteger(s),minute:parseInteger(i)};if(a)o.second=parseInteger(a);if(e){o.weekday=e.length>3?M.indexOf(e)+1:N.indexOf(e)+1}return o}const ye=/^(?:(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){const[,t,n,r,s,i,a,o,u,l,c,f]=e,d=fromStrings(t,s,r,n,i,a,o);let h;if(u){h=me[u]}else if(l){h=0}else{h=signedOffset(c,f)}return[d,new FixedOffsetZone(h)]}function preprocessRFC2822(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const pe=/^(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$/,ge=/^(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$/,ve=/^(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){const[,t,n,r,s,i,a,o]=e,u=fromStrings(t,s,r,n,i,a,o);return[u,FixedOffsetZone.utcInstance]}function extractASCII(e){const[,t,n,r,s,i,a,o]=e,u=fromStrings(t,o,n,r,s,i,a);return[u,FixedOffsetZone.utcInstance]}const Te=combineRegexes(se,re);const Oe=combineRegexes(ie,re);const we=combineRegexes(ae,re);const De=combineRegexes(ne);const Se=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset);const Ie=combineExtractors(oe,extractISOTime,extractISOOffset);const be=combineExtractors(ue,extractISOTime,extractISOOffset);const xe=combineExtractors(extractISOTime,extractISOOffset);function parseISODate(e){return parse(e,[Te,Se],[Oe,Ie],[we,be],[De,xe])}function parseRFC2822Date(e){return parse(preprocessRFC2822(e),[ye,extractRFC2822])}function parseHTTPDate(e){return parse(e,[pe,extractRFC1123Or850],[ge,extractRFC1123Or850],[ve,extractASCII])}function parseISODuration(e){return parse(e,[he,extractISODuration])}const Ee=combineExtractors(extractISOTime);function parseISOTimeOnly(e){return parse(e,[de,Ee])}const Ce=combineRegexes(le,fe);const ke=combineRegexes(ce);const _e=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone);const Me=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(e){return parse(e,[Ce,_e],[ke,Me])}const Ne="Invalid Duration";const Fe={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1