UNPKG

@coast/rrule

Version:

JavaScript library for working with recurrence rules for calendar dates.

30 lines (28 loc) 120 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rrule=e():t.rrule=e()}("undefined"!=typeof self?self:this,function(){return r={},i.m=n=[function(t,e,n){"use strict";n.d(e,"f",function(){return i}),n.d(e,"e",function(){return a}),n.d(e,"g",function(){return o}),n.d(e,"d",function(){return s}),n.d(e,"k",function(){return u}),n.d(e,"l",function(){return c}),n.d(e,"n",function(){return l}),n.d(e,"i",function(){return h}),n.d(e,"m",function(){return d}),n.d(e,"j",function(){return f}),n.d(e,"a",function(){return y}),n.d(e,"b",function(){return m}),n.d(e,"h",function(){return p}),n.d(e,"c",function(){return v});var r=n(2),i=function(t){return null!=t},a=function(t){return"number"==typeof t},o=function(t){return 0<=r.a.indexOf(t)},s=Array.isArray,u=function(t,e){void 0===e&&(e=t),1===arguments.length&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n},c=function(t,e){var n=0,r=[];if(s(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r},l=function(t){return s(t)?t:[t]};function h(t,e,n){void 0===n&&(n=" ");var r=String(t);return e>>=0,r.length>e?String(r):((e-=r.length)>n.length&&(n+=c(n,e/n.length)),n.slice(0,e)+String(r))}var d=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},f=function(t,e){var n=t%e;return n*e<0?n+e:n},y=function(t,e){return{div:Math.floor(t/e),mod:f(t,e)}},m=function(t){return!i(t)||0===t.length},p=function(t){return!m(t)},v=function(t,e){return p(t)&&-1!==t.indexOf(e)}},function(t,e,n){"use strict";n.r(e);var r,i,j=n(0);(i=r=r||{}).MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],i.ONE_DAY=864e5,i.MAXYEAR=9999,i.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),i.PY_WEEKDAYS=[6,0,1,2,3,4,5],i.getYearDay=function(t){var e=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.ceil((e.valueOf()-new Date(t.getUTCFullYear(),0,1).valueOf())/i.ONE_DAY)+1},i.isLeapYear=function(t){return t%4==0&&t%100!=0||t%400==0},i.isDate=function(t){return t instanceof Date},i.isValidDate=function(t){return i.isDate(t)&&!isNaN(t.getTime())},i.tzOffset=function(t){return 60*t.getTimezoneOffset()*1e3},i.daysBetween=function(t,e){var n=t.getTime()-i.tzOffset(t)-(e.getTime()-i.tzOffset(e));return Math.round(n/i.ONE_DAY)},i.toOrdinal=function(t){return i.daysBetween(t,i.ORDINAL_BASE)},i.fromOrdinal=function(t){return new Date(i.ORDINAL_BASE.getTime()+t*i.ONE_DAY)},i.getMonthDays=function(t){var e=t.getUTCMonth();return 1===e&&i.isLeapYear(t.getUTCFullYear())?29:i.MONTH_DAYS[e]},i.getWeekday=function(t){return i.PY_WEEKDAYS[t.getUTCDay()]},i.monthRange=function(t,e){var n=new Date(Date.UTC(t,e,1));return[i.getWeekday(n),i.getMonthDays(n)]},i.combine=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},i.clone=function(t){return new Date(t.getTime())},i.cloneDates=function(t){for(var e=[],n=0;n<t.length;n++)e.push(i.clone(t[n]));return e},i.sort=function(t){t.sort(function(t,e){return t.getTime()-e.getTime()})},i.timeToUntilString=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[Object(j.i)(n.getUTCFullYear().toString(),4,"0"),Object(j.i)(n.getUTCMonth()+1,2,"0"),Object(j.i)(n.getUTCDate(),2,"0"),"T",Object(j.i)(n.getUTCHours(),2,"0"),Object(j.i)(n.getUTCMinutes(),2,"0"),Object(j.i)(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},i.untilStringToDate=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: "+t);return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))};var M=r;function a(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}var c=(a.prototype.accept=function(t){++this.total;var e=this.minDate&&t<this.minDate,n=this.maxDate&&t>this.maxDate;if("between"===this.method){if(e)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!e||(this.add(t),!1);return this.add(t)},a.prototype.add=function(t){return this._result.push(t),!0},a.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},a.prototype.clone=function(){return new a(this.method,this.args)},a),o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function s(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u,N=function(){return(N=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function l(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function h(t,e,n){var r=u.call(this,t,e)||this;return r.iterator=n,r}var d,f,y=(s(h,u=c),h.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},h);function S(t){return t<d.HOURLY}(f=d=d||{})[f.YEARLY=0]="YEARLY",f[f.MONTHLY=1]="MONTHLY",f[f.WEEKLY=2]="WEEKLY",f[f.DAILY=3]="DAILY",f[f.HOURLY=4]="HOURLY",f[f.MINUTELY=5]="MINUTELY",f[f.SECONDLY=6]="SECONDLY";var m=n(2),E=(p.prototype.getHours=function(){return this.hour},p.prototype.getMinutes=function(){return this.minute},p.prototype.getSeconds=function(){return this.second},p.prototype.getMilliseconds=function(){return this.millisecond},p.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},p);function p(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}var v,D=(s(b,v=E),b.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},b.prototype.getWeekday=function(){return r.getWeekday(new Date(this.getTime()))},b.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},b.prototype.getDay=function(){return this.day},b.prototype.getMonth=function(){return this.month},b.prototype.getYear=function(){return this.year},b.prototype.addYears=function(t){this.year+=t},b.prototype.addMonths=function(t){if(this.month+=t,12<this.month){var e=Math.floor(this.month/12),n=Object(j.j)(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},b.prototype.addWeekly=function(t,e){e>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-e))+7*t:this.day+=-(this.getWeekday()-e)+7*t,this.fixDay()},b.prototype.addDaily=function(t){this.day+=t,this.fixDay()},b.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=Object(j.a)(this.hour,24),i=r.div,a=r.mod;if(i&&(this.hour=a,this.addDaily(i)),Object(j.b)(n)||Object(j.c)(n,this.hour))break}},b.prototype.addMinutes=function(t,e,n,r){for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var i=Object(j.a)(this.minute,60),a=i.div,o=i.mod;if(a&&(this.minute=o,this.addHours(a,!1,n)),(Object(j.b)(n)||Object(j.c)(n,this.hour))&&(Object(j.b)(r)||Object(j.c)(r,this.minute)))break}},b.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var a=Object(j.a)(this.second,60),o=a.div,s=a.mod;if(o&&(this.second=s,this.addMinutes(o,!1,n,r)),(Object(j.b)(n)||Object(j.c)(n,this.hour))&&(Object(j.b)(r)||Object(j.c)(r,this.minute))&&(Object(j.b)(i)||Object(j.c)(i,this.second)))break}},b.prototype.fixDay=function(){if(!(this.day<=28)){var t=r.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>r.MAXYEAR))return;t=r.monthRange(this.year,this.month-1)[1]}}},b.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,a=t.byhour,o=t.byminute,s=t.bysecond;switch(n){case d.YEARLY:return this.addYears(r);case d.MONTHLY:return this.addMonths(r);case d.WEEKLY:return this.addWeekly(r,i);case d.DAILY:return this.addDaily(r);case d.HOURLY:return this.addHours(r,e,a);case d.MINUTELY:return this.addMinutes(r,e,a,o);case d.SECONDLY:return this.addSeconds(r,e,a,o,s)}},b);function b(t,e,n,r,i,a,o){var s=v.call(this,r,i,a,o)||this;return s.year=t,s.month=e,s.day=n,s}function g(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object(j.c)(dt,i)||e.push(i),M.isDate(t[i])&&!M.isValidDate(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return N({},t)}function w(t){var e=t.split("\n").map(O).filter(function(t){return null!==t});return N(N({},e[0]),e[1])}function k(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;n[0];var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=M.untilStringToDate(i),e}function O(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return T(t);e[0];var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return T(t);case"DTSTART":return k(t);default:throw new Error("Unsupported RFC prop "+n+" in "+t)}}function T(u){var c=k(u.replace(/^RRULE:/i,""));return u.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(t){var e,n=t.split("="),r=n[0],i=n[1];switch(r.toUpperCase()){case"FREQ":c.freq=d[i.toUpperCase()];break;case"WKST":c.wkst=lt[i.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var a=-1===(e=i).indexOf(",")?x(e):e.split(",").map(x),o=r.toLowerCase();c[o]=a;break;case"BYWEEKDAY":case"BYDAY":c.byweekday=i.split(",").map(function(t){if(2===t.length)return lt[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/),n=Number(e[1]),r=e[2],i=lt[r].weekday;return new m.b(i,n)});break;case"DTSTART":case"TZID":var s=k(u);c.tzid=s.tzid,c.dtstart=s.dtstart;break;case"UNTIL":c.until=M.untilStringToDate(i);break;case"BYEASTER":c.byeaster=Number(i);break;default:throw new Error("Unknown RRULE property '"+r+"'")}}),c}function x(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var L=n(3),I=(Object.defineProperty(U.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!0,configurable:!0}),U.prototype.toString=function(){var t=M.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":"+t:";TZID="+this.tzid+":"+t},U.prototype.getTime=function(){return this.date.getTime()},U.prototype.rezonedDate=function(){if(this.isUTC)return this.date;try{return L.DateTime.fromJSDate(this.date).setZone(this.tzid,{keepLocalTime:!0}).toJSDate()}catch(t){return t instanceof TypeError&&console.error("Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone"),this.date}},U);function U(t,e){this.date=t,this.tzid=e}function C(t){for(var e=[],n="",r=Object.keys(t),i=Object.keys(ht),a=0;a<r.length;a++)if("tzid"!==r[a]&&Object(j.c)(i,r[a])){var o=r[a].toUpperCase(),s=t[r[a]],u="";if(Object(j.f)(s)&&(!Object(j.d)(s)||s.length)){switch(o){case"FREQ":u=yt.FREQUENCIES[t.freq];break;case"WKST":u=Object(j.e)(s)?new m.b(s).toString():s.toString();break;case"BYWEEKDAY":o="BYDAY",u=Object(j.n)(s).map(function(t){return t instanceof m.b?t:Object(j.d)(t)?new m.b(t[0],t[1]):new m.b(t)}).toString();break;case"DTSTART":n=_(s,t.tzid);break;case"UNTIL":u=M.timeToUntilString(s,!t.tzid);break;default:if(Object(j.d)(s)){for(var c=[],l=0;l<s.length;l++)c[l]=String(s[l]);u=c.toString()}else u=String(s)}u&&e.push([o,u])}}var h=e.map(function(t){return t[0]+"="+t[1].toString()}).join(";"),d="";return""!==h&&(d="RRULE:"+h),[n,d].filter(function(t){return!!t}).join("\n")}function _(t,e){return t?"DTSTART"+new I(new Date(t),e).toString():""}var Y=(A.prototype._cacheAdd=function(t,e,n){e=e&&(e instanceof Date?M.clone(e):M.cloneDates(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},A.prototype._cacheGet=function(t,r){function e(t){for(var e=0;e<i.length;e++){var n=i[e];if(String(r[n])!==String(t[n]))return!0}return!1}var n=!1,i=r?Object.keys(r):[],a=this[t];if("all"===t)n=this.all;else if(Object(j.d)(a))for(var o=0;o<a.length;o++){var s=a[o];if(!i.length||!e(s)){n=s._value;break}}if(!n&&this.all){var u=new c(t,r);for(o=0;o<this.all.length&&u.accept(this.all[o]);o++);n=u.getValue(),this._cacheAdd(t,n,r)}return Object(j.d)(n)?M.cloneDates(n):n instanceof Date?M.clone(n):n},A);function A(){this.all=!1,this.before=[],this.after=[],this.between=[]}var R=l(Object(j.l)(1,31),Object(j.l)(2,28),Object(j.l)(3,31),Object(j.l)(4,30),Object(j.l)(5,31),Object(j.l)(6,30),Object(j.l)(7,31),Object(j.l)(8,31),Object(j.l)(9,30),Object(j.l)(10,31),Object(j.l)(11,30),Object(j.l)(12,31),Object(j.l)(1,7)),V=l(Object(j.l)(1,31),Object(j.l)(2,29),Object(j.l)(3,31),Object(j.l)(4,30),Object(j.l)(5,31),Object(j.l)(6,30),Object(j.l)(7,31),Object(j.l)(8,31),Object(j.l)(9,30),Object(j.l)(10,31),Object(j.l)(11,30),Object(j.l)(12,31),Object(j.l)(1,7)),F=Object(j.k)(1,29),z=Object(j.k)(1,30),Z=Object(j.k)(1,31),W=Object(j.k)(1,32),q=l(W,z,W,Z,W,Z,W,W,Z,W,Z,W,W.slice(0,7)),H=l(W,F,W,Z,W,Z,W,W,Z,W,Z,W,W.slice(0,7)),P=Object(j.k)(-28,0),J=Object(j.k)(-29,0),G=Object(j.k)(-30,0),B=Object(j.k)(-31,0),K=l(B,J,B,G,B,G,B,B,G,B,G,B,B.slice(0,7)),$=l(B,P,B,G,B,G,B,B,G,B,G,B,B.slice(0,7)),Q=[0,31,60,91,121,152,182,213,244,274,305,335,366],X=[0,31,59,90,120,151,181,212,243,273,304,334,365],tt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(Object(j.k)(7));return t}();function et(t,e){var n,r,i,a,o,s,u=new Date(Date.UTC(t,0,1)),c=M.isLeapYear(t)?366:365,l=M.isLeapYear(t+1)?366:365,h=M.toOrdinal(u),d=M.getWeekday(u),f=N(N({yearlen:c,nextyearlen:l,yearordinal:h,yearweekday:d},(n=t,r=M.isLeapYear(n)?366:365,i=new Date(Date.UTC(n,0,1)),a=M.getWeekday(i),365!=r?{mmask:V,mdaymask:q,nmdaymask:K,wdaymask:tt.slice(a),mrange:Q}:{mmask:R,mdaymask:H,nmdaymask:$,wdaymask:tt.slice(a),mrange:X})),{wnomask:null});if(Object(j.b)(e.byweekno))return f;f.wnomask=Object(j.l)(0,7+c);var y=o=Object(j.j)(7-d+e.wkst,7);s=4<=y?(y=0,f.yearlen+Object(j.j)(d-e.wkst,7)):c-y;for(var m=Math.floor(s/7),p=Object(j.j)(s,7),v=Math.floor(m+p/4),b=0;b<e.byweekno.length;b++){var g=e.byweekno[b];if(g<0&&(g+=v+1),0<g&&g<=v){var w=void 0;1<g?(w=y+7*(g-1),y!==o&&(w-=7-o)):w=y;for(var k=0;k<7&&(f.wnomask[w]=1,w++,f.wdaymask[w]!==e.wkst);k++);}}if(Object(j.c)(e.byweekno,1)){w=y+7*v;if(y!==o&&(w-=7-o),w<c)for(b=0;b<7&&(w+=f.wnomask[w]=1,f.wdaymask[w]!==e.wkst);b++);}if(y){var O=void 0;if(Object(j.c)(e.byweekno,-1))O=-1;else{var T=M.getWeekday(new Date(Date.UTC(t-1,0,1))),S=Object(j.j)(7-T.valueOf()+e.wkst,7),E=M.isLeapYear(t-1)?366:365,D=void 0;D=4<=S?(S=0,E+Object(j.j)(T-e.wkst,7)):c-y,O=Math.floor(52+Object(j.j)(D,7)/4)}if(Object(j.c)(e.byweekno,O))for(w=0;w<y;w++)f.wnomask[w]=1}return f}function nt(t){this.options=t}var rt=(nt.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=et(t,n)),Object(j.h)(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,i=r.yearlen,a=r.mrange,o=r.wdaymask;this.monthinfo=function(t,e,n,r,i,a){var o={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(a.freq===yt.YEARLY)if(Object(j.b)(a.bymonth))s=[[0,n]];else for(var u=0;u<a.bymonth.length;u++)e=a.bymonth[u],s.push(r.slice(e-1,e+1));else a.freq===yt.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(Object(j.b)(s))return o;for(o.nwdaymask=Object(j.l)(0,n),u=0;u<s.length;u++)for(var c=s[u],l=c[0],h=c[1]-1,d=0;d<a.bynweekday.length;d++){var f=void 0,y=a.bynweekday[d],m=y[0],p=y[1];p<0?(f=h+7*(p+1),f-=Object(j.j)(i[f]-m,7)):(f=l+7*(p-1),f+=Object(j.j)(7-i[f]+m,7)),l<=f&&f<=h&&(o.nwdaymask[f]=1)}return o}(t,e,i,a,o,n)}Object(j.f)(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,a=Math.floor(r/4),o=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),c=Math.floor(19*n+r-a-u+15)%30,l=Math.floor(i/4),h=i%4,d=Math.floor(32+2*o+2*l-c-h)%7,f=Math.floor((n+11*c+22*d)/451),y=Math.floor((c+d-7*f+114)/31),m=(c+d-7*f+114)%31+1,p=Date.UTC(t,y-1,m+e),v=Date.UTC(t,0,1);return[Math.ceil((p-v)/864e5)]}(t,n.byeaster))},Object.defineProperty(nt.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(nt.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!0,configurable:!0}),nt.prototype.ydayset=function(){return[Object(j.k)(this.yearlen),0,this.yearlen]},nt.prototype.mdayset=function(t,e,n){for(var r=this.mrange[e-1],i=this.mrange[e],a=Object(j.l)(null,this.yearlen),o=r;o<i;o++)a[o]=o;return[a,r,i]},nt.prototype.wdayset=function(t,e,n){for(var r=Object(j.l)(null,this.yearlen+7),i=M.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,a=i,o=0;o<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);o++);return[r,a,i]},nt.prototype.ddayset=function(t,e,n){var r=Object(j.l)(null,this.yearlen),i=M.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[i]=i,[r,i,1+i]},nt.prototype.htimeset=function(e,t,n,r){var i=this,a=[];return this.options.byminute.forEach(function(t){a=a.concat(i.mtimeset(e,t,n,r))}),M.sort(a),a},nt.prototype.mtimeset=function(e,n,t,r){var i=this.options.bysecond.map(function(t){return new E(e,n,t,r)});return M.sort(i),i},nt.prototype.stimeset=function(t,e,n,r){return[new E(t,e,n,r)]},nt.prototype.getdayset=function(t){switch(t){case d.YEARLY:return this.ydayset.bind(this);case d.MONTHLY:return this.mdayset.bind(this);case d.WEEKLY:return this.wdayset.bind(this);case d.DAILY:default:return this.ddayset.bind(this)}},nt.prototype.gettimeset=function(t){switch(t){case d.HOURLY:return this.htimeset.bind(this);case d.MINUTELY:return this.mtimeset.bind(this);case d.SECONDLY:return this.stimeset.bind(this)}},nt);function it(t,e,n,r,i,a){for(var o=[],s=0;s<t.length;s++){var u=void 0,c=void 0,l=t[s];c=l<0?(u=Math.floor(l/e.length),Object(j.j)(l,e.length)):(u=Math.floor((l-1)/e.length),Object(j.j)(l-1,e.length));for(var h=[],d=n;d<r;d++){var f=a[d];Object(j.f)(f)&&h.push(f)}var y=void 0;y=u<0?h.slice(u)[0]:h[u];var m=e[c],p=M.fromOrdinal(i.yearordinal+y),v=M.combine(p,m);Object(j.c)(o,v)||o.push(v)}return M.sort(o),o}function at(t,e){var n=e.dtstart,r=e.freq,i=e.interval,a=e.until,o=e.bysetpos,s=e.count;if(0===s||0===i)return st(t);var u=D.fromDate(n),c=new rt(e);c.rebuild(u.year,u.month);for(var l=function(t,e,n){var r=n.freq,i=n.byhour,a=n.byminute,o=n.bysecond;if(S(r))return function(t){var r=t.dtstart.getTime()%1e3;if(!S(t.freq))return[];var i=[];return t.byhour.forEach(function(n){t.byminute.forEach(function(e){t.bysecond.forEach(function(t){i.push(new E(n,e,t,r))})})}),i}(n);if(r>=yt.HOURLY&&Object(j.h)(i)&&!Object(j.c)(i,e.hour)||r>=yt.MINUTELY&&Object(j.h)(a)&&!Object(j.c)(a,e.minute)||r>=yt.SECONDLY&&Object(j.h)(o)&&!Object(j.c)(o,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(c,u,e);;){var h=c.getdayset(r)(u.year,u.month,u.day),d=h[0],f=h[1],y=h[2],m=ut(d,f,y,c,e);if(Object(j.h)(o))for(var p=it(o,l,f,y,c,d),v=0;v<p.length;v++){var b=p[v];if(a&&a<b)return st(t);if(n<=b){var g=ot(b,e);if(!t.accept(g))return st(t);if(s&&!--s)return st(t)}}else for(v=f;v<y;v++){var w=d[v];if(Object(j.f)(w))for(var k=M.fromOrdinal(c.yearordinal+w),O=0;O<l.length;O++){var T=l[O];b=M.combine(k,T);if(a&&a<b)return st(t);if(n<=b){g=ot(b,e);if(!t.accept(g))return st(t);if(s&&!--s)return st(t)}}}if(0===e.interval)return st(t);if(u.add(e,m),u.year>M.MAXYEAR)return st(t);S(r)||(l=c.gettimeset(r)(u.hour,u.minute,u.second,0)),c.rebuild(u.year,u.month)}}function ot(t,e){return new I(t,e.tzid).rezonedDate()}function st(t){return t.getValue()}function ut(t,e,n,r,i){for(var a,o,s,u,c,l,h,d,f,y,m=!1,p=e;p<n;p++){var v=t[p];a=r,o=v,void 0,u=(s=i).bymonth,c=s.byweekno,l=s.byweekday,h=s.byeaster,d=s.bymonthday,f=s.bynmonthday,y=s.byyearday,(m=Object(j.h)(u)&&!Object(j.c)(u,a.mmask[o])||Object(j.h)(c)&&!a.wnomask[o]||Object(j.h)(l)&&!Object(j.c)(l,a.wdaymask[o])||Object(j.h)(a.nwdaymask)&&!a.nwdaymask[o]||null!==h&&!Object(j.c)(a.eastermask,o)||(Object(j.h)(d)||Object(j.h)(f))&&!Object(j.c)(d,a.mdaymask[o])&&!Object(j.c)(f,a.nmdaymask[o])||Object(j.h)(y)&&(o<a.yearlen&&!Object(j.c)(y,o+1)&&!Object(j.c)(y,-a.yearlen+o)||o>=a.yearlen&&!Object(j.c)(y,o+1-a.yearlen)&&!Object(j.c)(y,-a.nextyearlen+o-a.yearlen)))&&(t[v]=null)}return m}var ct=function(){return ct._nlp||(ct._nlp=n(4)),ct._nlp},lt={MO:new m.b(0),TU:new m.b(1),WE:new m.b(2),TH:new m.b(3),FR:new m.b(4),SA:new m.b(5),SU:new m.b(6)},ht={freq:d.YEARLY,dtstart:null,interval:1,wkst:lt.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},dt=Object.keys(ht);function ft(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new Y,this.origOptions=g(t);var n=function(t){var e=N(N({},ht),g(t));if(Object(j.f)(e.byeaster)&&(e.freq=yt.YEARLY),!Object(j.f)(e.freq)||!yt.FREQUENCIES[e.freq])throw new Error("Invalid frequency: "+e.freq+" "+t.freq);if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),Object(j.f)(e.wkst)?Object(j.e)(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=yt.MO.weekday,Object(j.f)(e.bysetpos)){Object(j.e)(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(a=e.bysetpos[n])||!(-366<=a&&a<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||Object(j.h)(e.byweekno)||Object(j.h)(e.byyearday)||Boolean(e.bymonthday)||Object(j.h)(e.bymonthday)||Object(j.f)(e.byweekday)||Object(j.f)(e.byeaster)))switch(e.freq){case yt.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case yt.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case yt.WEEKLY:e.byweekday=[M.getWeekday(e.dtstart)]}if(Object(j.f)(e.bymonth)&&!Object(j.d)(e.bymonth)&&(e.bymonth=[e.bymonth]),Object(j.f)(e.byyearday)&&!Object(j.d)(e.byyearday)&&Object(j.e)(e.byyearday)&&(e.byyearday=[e.byyearday]),Object(j.f)(e.bymonthday))if(Object(j.d)(e.bymonthday)){var r=[],i=[];for(n=0;n<e.bymonthday.length;n++){var a;0<(a=e.bymonthday[n])?r.push(a):a<0&&i.push(a)}e.bymonthday=r,e.bynmonthday=i}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(Object(j.f)(e.byweekno)&&!Object(j.d)(e.byweekno)&&(e.byweekno=[e.byweekno]),Object(j.f)(e.byweekday))if(Object(j.e)(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Object(j.g)(e.byweekday))e.byweekday=[m.b.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof m.b)!e.byweekday.n||e.freq>yt.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var o=[],s=[];for(n=0;n<e.byweekday.length;n++){var u=e.byweekday[n];Object(j.e)(u)?o.push(u):Object(j.g)(u)?o.push(m.b.fromStr(u).weekday):!u.n||e.freq>yt.MONTHLY?o.push(u.weekday):s.push([u.weekday,u.n])}e.byweekday=Object(j.h)(o)?o:null,e.bynweekday=Object(j.h)(s)?s:null}else e.bynweekday=null;return Object(j.f)(e.byhour)?Object(j.e)(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<yt.HOURLY?[e.dtstart.getUTCHours()]:null,Object(j.f)(e.byminute)?Object(j.e)(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<yt.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Object(j.f)(e.bysecond)?Object(j.e)(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<yt.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}(t).parsedOptions;this.options=n}var yt=(ft.parseText=function(t,e){return ct().parseText(t,e)},ft.fromText=function(t,e){return ct().fromText(t,e)},ft.fromString=function(t){return new ft(ft.parseString(t)||void 0)},ft.prototype._iter=function(t){return at(t,this.options)},ft.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},ft.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},ft.prototype.all=function(t){if(t)return this._iter(new y("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new c("all",{})),this._cacheAdd("all",e)),e},ft.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!M.isValidDate(t)||!M.isValidDate(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new y("between",i,r));var a=this._cacheGet("between",i);return!1===a&&(a=this._iter(new c("between",i)),this._cacheAdd("between",a,i)),a},ft.prototype.before=function(t,e){if(void 0===e&&(e=!1),!M.isValidDate(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new c("before",n)),this._cacheAdd("before",r,n)),r},ft.prototype.after=function(t,e){if(void 0===e&&(e=!1),!M.isValidDate(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new c("after",n)),this._cacheAdd("after",r,n)),r},ft.prototype.count=function(){return this.all().length},ft.prototype.toString=function(){return C(this.origOptions)},ft.prototype.toText=function(t,e,n){return ct().toText(this,t,e,n)},ft.prototype.isFullyConvertibleToText=function(){return ct().isFullyConvertible(this)},ft.prototype.clone=function(){return new ft(this.origOptions)},ft.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],ft.YEARLY=d.YEARLY,ft.MONTHLY=d.MONTHLY,ft.WEEKLY=d.WEEKLY,ft.DAILY=d.DAILY,ft.HOURLY=d.HOURLY,ft.MINUTELY=d.MINUTELY,ft.SECONDLY=d.SECONDLY,ft.MO=lt.MO,ft.TU=lt.TU,ft.WE=lt.WE,ft.TH=lt.TH,ft.FR=lt.FR,ft.SA=lt.SA,ft.SU=lt.SU,ft.parseString=w,ft.optionsToString=C,ft);var mt,pt={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function vt(t,e){var s=[],u=[],c=[],l=[],n=k(t),r=n.dtstart,h=n.tzid;return function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?0<r&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold).forEach(function(t){if(t){var e=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=Object(j.m)(t,":",1),n=e[0],r=e[1];return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),n=e.name,r=e.parms,i=e.value;switch(n.toUpperCase()){case"RRULE":if(r.length)throw new Error("unsupported RRULE parm: "+r.join(","));s.push(w(t));break;case"RDATE":var a=/RDATE(?:;TZID=([^:=]+))?/i.exec(t),o=(a[0],a[1]);o&&!h&&(h=o),u=u.concat(wt(i,r));break;case"EXRULE":if(r.length)throw new Error("unsupported EXRULE parm: "+r.join(","));c.push(w(i));break;case"EXDATE":l=l.concat(wt(i,r));break;case"DTSTART":break;default:throw new Error("unsupported property: "+n)}}}),{dtstart:r,tzid:h,rrulevals:s,rdatevals:u,exrulevals:c,exdatevals:l}}function bt(t,e){return void 0===e&&(e={}),function(t,e){var n=vt(t,e),r=n.rrulevals,i=n.rdatevals,a=n.exrulevals,o=n.exdatevals,s=n.dtstart,u=n.tzid,c=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||1<r.length||i.length||a.length||o.length){var l=new Tt(c);return l.dtstart(s),l.tzid(u||void 0),r.forEach(function(t){l.rrule(new yt(gt(t,s,u),c))}),i.forEach(function(t){l.rdate(t)}),a.forEach(function(t){l.exrule(new yt(gt(t,s,u),c))}),o.forEach(function(t){l.exdate(t)}),e.compatible&&e.dtstart&&l.rdate(s),l}var h=r[0]||{};return new yt(gt(h,h.dtstart||e.dtstart||s,h.tzid||e.tzid||u),c)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(pt);if(n.forEach(function(t){Object(j.c)(r,t)||e.push(t)}),e.length)throw new Error("Invalid options: "+e.join(", "));return N(N({},pt),t)}(e))}function gt(t,e,n){return N(N({},t),{dtstart:e,tzid:n})}function wt(t,e){return e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}),t.split(",").map(function(t){return M.untilStringToDate(t)})}function kt(r){var i=this;return function(t){if(void 0!==t&&(i["_"+r]=t),void 0!==i["_"+r])return i["_"+r];for(var e=0;e<i._rrule.length;e++){var n=i._rrule[e].origOptions[r];if(n)return n}}}function Ot(t){void 0===t&&(t=!1);var e=mt.call(this,{},t)||this;return e.dtstart=kt.apply(e,["dtstart"]),e.tzid=kt.apply(e,["tzid"]),e._rrule=[],e._rdate=[],e._exrule=[],e._exdate=[],e}var Tt=(s(Ot,mt=yt),Ot.prototype._iter=function(t){return function(e,t,r,n,i,a){var o={},s=e.accept;function u(e,n){r.forEach(function(t){t.between(e,n,!0).forEach(function(t){o[Number(t)]=!0})})}i.forEach(function(t){var e=new I(t,a).rezonedDate();o[Number(e)]=!0}),e.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!o[e]&&(u(new Date(e-1),new Date(e+1)),!o[e]))||(o[e]=!0,s.call(this,t))},"between"===e.method&&(u(e.args.after,e.args.before),e.accept=function(t){var e=Number(t);return!!o[e]||(o[e]=!0,s.call(this,t))});for(var c=0;c<n.length;c++){var l=new I(n[c],a).rezonedDate();if(!e.accept(new Date(l.getTime())))break}t.forEach(function(t){at(e,t.options)});var h=e._result;switch(M.sort(h),e.method){case"all":case"between":return h;case"before":return h.length&&h[h.length-1]||null;case"after":default:return h.length&&h[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},Ot.prototype.rrule=function(t){St(t,this._rrule)},Ot.prototype.exrule=function(t){St(t,this._exrule)},Ot.prototype.rdate=function(t){Et(t,this._rdate)},Ot.prototype.exdate=function(t){Et(t,this._exdate)},Ot.prototype.rrules=function(){return this._rrule.map(function(t){return bt(t.toString())})},Ot.prototype.exrules=function(){return this._exrule.map(function(t){return bt(t.toString())})},Ot.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},Ot.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},Ot.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(C({dtstart:this._dtstart}))),this._rrule.forEach(function(t){e=e.concat(t.toString().split("\n"))}),this._exrule.forEach(function(t){e=e.concat(t.toString().split("\n").map(function(t){return t.replace(/^RRULE:/,"EXRULE:")}).filter(function(t){return!/^DTSTART/.test(t)}))}),this._rdate.length&&e.push(Dt("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(Dt("EXDATE",this._exdate,this.tzid())),e},Ot.prototype.toString=function(){return this.valueOf().join("\n")},Ot.prototype.clone=function(){var e=new Ot(!!this._cache);return this._rrule.forEach(function(t){return e.rrule(t.clone())}),this._exrule.forEach(function(t){return e.exrule(t.clone())}),this._rdate.forEach(function(t){return e.rdate(new Date(t.getTime()))}),this._exdate.forEach(function(t){return e.exdate(new Date(t.getTime()))}),e},Ot);function St(t,e){if(!(t instanceof yt))throw new TypeError(String(t)+" is not RRule instance");Object(j.c)(e.map(String),String(t))||e.push(t)}function Et(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");Object(j.c)(e.map(Number),Number(t))||(e.push(t),M.sort(e))}function Dt(t,e,n){var r=!n||"UTC"===n.toUpperCase();return(r?t+":":t+";TZID="+n+":")+e.map(function(t){return M.timeToUntilString(t.valueOf(),r)}).join(",")}n.d(e,"Frequency",function(){return d}),n.d(e,"Weekday",function(){return m.b}),n.d(e,"RRule",function(){return yt}),n.d(e,"RRuleSet",function(){return Tt}),n.d(e,"rrulestr",function(){return bt}); /*! * rrule.js - Library for working with recurrence rules for calendar dates. * https://github.com/jakubroztocil/rrule * * Copyright 2010, Jakub Roztocil and Lars Schoning * Licenced under the BSD licence. * https://github.com/jakubroztocil/rrule/blob/master/LICENCE * * Based on: * python-dateutil - Extensions to the standard Python datetime module. * Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net> * Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi> * https://github.com/jakubroztocil/rrule/blob/master/LICENCE * */e.default=yt},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return i});var r=["MO","TU","WE","TH","FR","SA","SU"],i=(a.fromStr=function(t){return new a(r.indexOf(t))},a.prototype.nth=function(t){return this.n===t?this:new a(this.weekday,t)},a.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},a.prototype.toString=function(){var t=r[this.weekday];return this.n&&(t=(0<this.n?"+":"")+String(this.n)+t),t},a.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},a);function a(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function a(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t,e,n){return(u=function(){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(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&s(i,n.prototype),i}).apply(null,arguments)}function c(t){var r="function"==typeof Map?new Map:void 0;return(c=function(t){if(null===t||(e=t,-1===Function.toString.call(e).indexOf("[native code]")))return t;var e;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,n)}function n(){return u(t,arguments,o(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)})(t)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(c(Error)),h=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return a(t,e),t}(l),d=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return a(t,e),t}(l),f=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return a(t,e),t}(l),I=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(l),y=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return a(t,e),t}(l),p=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(l),m=function(t){function e(){return t.call(this,"Zone is an abstract class")||this}return a(e,t),e}(l),v="numeric",b="short",g="long",w={year:v,month:v,day:v},k={year:v,month:b,day:v},O={year:v,month:g,day:v},T={year:v,month:g,day:v,weekday:g},S={hour:v,minute:v},E={hour:v,minute:v,second:v},D={hour:v,minute:v,second:v,timeZoneName:b},j={hour:v,minute:v,second:v,timeZoneName:g},M={hour:v,minute:v,hour12:!1},N={hour:v,minute:v,second:v,hour12:!1},x={hour:v,minute:v,second:v,hour12:!1,timeZoneName:b},U={hour:v,minute:v,second:v,hour12:!1,timeZoneName:g},C={year:v,month:v,day:v,hour:v,minute:v},_={year:v,month:v,day:v,hour:v,minute:v,second:v},Y={year:v,month:b,day:v,hour:v,minute:v},A={year:v,month:b,day:v,hour:v,minute:v,second:v},R={year:v,month:b,day:v,weekday:b,hour:v,minute:v},V={year:v,month:g,day:v,hour:v,minute:v,timeZoneName:b},F={year:v,month:g,day:v,hour:v,minute:v,second:v,timeZoneName:b},z={year:v,month:g,day:v,weekday:g,hour:v,minute:v,timeZoneName:g},Z={year:v,month:g,day:v,weekday:g,hour:v,minute:v,second:v,timeZoneName:g};function W(t){return void 0===t}function q(t){return"number"==typeof t}function H(t){return"number"==typeof t&&t%1==0}function L(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(t){return!1}}function P(){return!W(Intl.DateTimeFormat.prototype.formatToParts)}function J(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function G(t,r,i){if(0!==t.length)return t.reduce(function(t,e){var n=[r(e),e];return t&&i(t[0],n[0])===t[0]?t:n},null)[1]}function B(n,t){return t.reduce(function(t,e){return t[e]=n[e],t},{})}function K(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function $(t,e,n){return H(t)&&e<=t&&t<=n}function Q(t,e){return void 0===e&&(e=2),t.toString().length<e?("0".repeat(e)+t).slice(-e):t.toString()}function X(t){return W(t)||null===t||""===t?void 0:parseInt(t,10)}function tt(t){if(!W(t)&&null!==t&&""!==t){var e=1e3*parseFloat("0."+t);return Math.floor(e)}}function et(t,e,n){void 0===n&&(n=!1);var r=Math.pow(10,e);return(n?Math.trunc:Math.round)(t*r)/r}function nt(t){return t%4==0&&(t%100!=0||t%400==0)}function rt(t){return nt(t)?366:365}function it(t,e){var n,r,i=(n=e-1)-(r=12)*Math.floor(n/r)+1;return 2==i?nt(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function at(t){var e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&0<=t.year&&(e=new Date(e)).setUTCFullYear(e.getUTCFullYear()-1900),+e}function ot(t){var e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,n=t-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4==e||3==r?53:52}function st(t){return 99<t?t:60<t?1900+t:2e3+t}function ut(t,e,n,r){void 0===r&&(r=null);var i=new Date(t),a={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);var o=Object.assign({timeZoneName:e},a),s=L();if(s&&P()){var u=new Intl.DateTimeFormat(n,o).formatToParts(i).find(function(t){return"timezonename"===t.type.toLowerCase()});return u?u.value:null}if(s){var c=new Intl.DateTimeFormat(n,a).format(i);return new Intl.DateTimeFormat(n,o).format(i).substring(c.length).replace(/^[, \u200e]+/,"")}return null}function ct(t,e){var n=parseInt(t,10);Number.isNaN(n)&&(n=0);var r=parseInt(e,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function lt(t){var e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new p("Invalid unit value "+t);return e}function ht(t,e,n){var r={};for(var i in t)if(K(t,i)){if(0<=n.indexOf(i))continue;var a=t[i];if(null==a)continue;r[e(i)]=lt(a)}return r}function dt(t,e){var n=Math.trunc(t/60),r=Math.abs(t%60),i=0<=n&&!Object.is(n,-0)?"+":"-",a=i+Math.abs(n);switch(e){case"short":return i+Q(Math.abs(n),2)+":"+Q(r,2);case"narrow":return 0<r?a+":"+r:a;case"techie":return i+Q(Math.abs(n),2)+Q(r,2);default:throw new RangeError("Value format "+e+" is out of range for property format")}}function ft(t){return B(t,["hour","minute","second","millisecond"])}var yt=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function mt(t){return JSON.stringify(t,Object.keys(t).sort())}var pt=["January","February","March","April","May","June","July","August","September","October","November","December"],vt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bt=["J","F","M","A","M","J","J","A","S","O","N","D"];function gt(t){switch(t){case"narrow":return bt;case"short":return vt;case"long":return pt;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 wt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],kt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ot=["M","T","W","T","F","S","S"];function Tt(t){switch(t){case"narrow":return Ot;case"short":return kt;case"long":return wt;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var St=["AM","PM"],Et=["Before Christ","Anno Domini"],Dt=["BC","AD"],jt=["B","A"];function Mt(t){switch(t){case"narrow":return jt;case"short":return Dt;case"long":return Et;default:return null}}function Nt(t,e){var n="",r=t,i=Array.isArray(r),a=0;for(r=i?r:r[Symbol.iterator]();;){var o;if(i){if(a>=r.length)break;o=r[a++]}else{if((a=r.next()).done)break;o=a.value}o.literal?n+=o.val:n+=e(o.val)}return n}var xt={D:w,DD:k,DDD:O,DDDD:T,t:S,tt:E,ttt:D,tttt:j,T:M,TT:N,TTT:x,TTTT:U,f:C,ff:Y,fff:V,ffff:z,F:_,FF:A,FFF:F,FFFF:Z},Lt=function(){function f(t,e){this.opts=e,this.loc=t,this.systemLoc=null}f.create=function(t,e){return void 0===e&&(e={}),new f(t,e)},f.parseFormat=function(t){for(var e=null,n="",r=!1,i=[],a=0;a<t.length;a++){var o=t.charAt(a);"'"===o?(0<n.length&&i.push({literal:r,val:n}),e=null,n="",r=!r):r?n+=o:o===e?n+=o:(0<n.length&&i.push({literal:!1,val:n}),e=n=o)}return 0<n.length&&i.push({literal:r,val:n}),i},f.macroTokenToFormatOpts=function(t){return xt[t]};var t=f.prototype;return t.formatWithSystemDefault=function(t,e){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,Object.assign({},this.opts,e)).format()},t.formatDateTime=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,Object.assign({},this.opts,e)).format()},t.formatDateTimeParts=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,Object.assign({},this.opts,e)).formatToParts()},t.resolvedOptions=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,Object.assign({},this.opts,e)).resolvedOptions()},t.num=function(t,e){if(void 0===e&&(e=0),this.opts.forceSimple)return Q(t,e);var n=Object.assign({},this.opts);return 0<e&&(n.padTo=e),this.loc.numberFormatter(n).format(t)},t.formatDateTimeFromString=function(r,t){function i(t,e){return l.loc.extract(r,t,e)}function a(t){return r.isOffsetFixed&&0===r.offset&&t.allowZ?"Z":r.isValid?r.zone.formatOffset(r.ts,t.format):""}function o(){return h?St[r.hour<12?0:1]:i({hour:"numeric",hour12:!0},"dayperiod")}function s(t,e){return h?(n=r,gt(t)[n.month-1]):i(e?{month:t}:{month:t,day:"numeric"},"month");var n}function u(t,e){return h?(n=r,Tt(t)[n.weekday-1]):i(e?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday");var n}function c(t){return h?(e=r,Mt(t)[e.year<0?0:1]):i({era:t},"era");var e}var l=this,h="en"===this.loc.listingMode(),d=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&P();return Nt(f.parseFormat(t),function(t){switch(t){case"S":return l.num(r.millisecond);case"u":case"SSS":return l.num(r.millisecond,3);case"s":return l.num(r.second);case"ss":return l.num(r.second,2);case"m":return l.num(r.minute);case"mm":return l.num(r.minute,2);case"h":return l.num(r.hour%12==0?12:r.hour%12);case"hh":return l.num(r.hour%12==0?12:r.hour%12,2);case"H":return l.num(r.hour);case"HH":return l.num(r.hour,2);case"Z":return a({format:"narrow",allowZ:l.opts.allowZ});case"ZZ":return a({format:"short",allowZ:l.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:!1});case"ZZZZ":return r.zone.offsetName(r.ts,{format:"short",locale:l.loc.locale});case"ZZZZZ":return r.zone.offsetName(r.ts,{format:"long",locale:l.loc.locale});case"z":return r.zoneName;case"a":return o();case"d":return d?i({day:"numeric"},"day"):l.num(r.day);case"dd":return d?i({day:"2-digit"},"day"):l.num(r.day,2);case"c":return l.num(r.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return l.num(r.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return d?i({month:"numeric",day:"numeric"},"month"):l.num(r.month);case"LL":return d?i({month:"2-digit",day:"numeric"},"month"):l.num(r.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return d?i({month:"numeric"},"month"):l.num(r.month);case"MM":return d?i({month:"2-digit"},"month"):l.num(r.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return d?i({year:"numeric"},"year"):l.num(r.year);case"yy":return d?i({year:"2-digit"},"year"):l.num(r.year.toString().slice(-2),2);case"yyyy":return d?i({year:"numeric"},"year"):l.num(r.year,4);case"yyyyyy":return d?i({year:"numeric"},"year"):l.num(r.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return l.num(r.weekYear.toString().slice(-2),2);case"kkkk":return l.num(r.weekYear,4);case"W":return l.num(r.weekNumber);case"WW":return l.num(r.weekNumber,2);case"o":return l.num(r.ordinal);case"ooo":return l.num(r.ordinal,3);case"q":return l.num(r.quarter);case"qq":return l.num(r.quarter,2);case"X":return l.num(Math.floor(r.ts/1e3));case"x":return l.num(r.ts);default:return(n=f.macroTokenToFormatOpts(e=t))?l.formatWithSystemDefault(r,n):e}var e,n})},t.formatDurationFromString=function(t,e){function n(t){switch(t[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=f.parseFormat(e),o=a.reduce(function(t,e){var n=e.literal,r=e.val;return n?t:t.concat(r)},[]),s=t.shiftTo.apply(t,o.map(n).filter(function(t){return t}));return Nt(a,(r=s,function(t){var e=n(t);return e?i.num(r.get(e),t.length):t}))},f}(),It=function(){function t(t,e){this.reason=t,this.explanation=e}return t.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},t}(),Ut=function(){function t(){}var e=t.prototype;return e.offsetName=function(){throw new m},e.formatOffset=function(){throw new m},e.offset=function(){throw new m},e.equals=function(){throw new m},i(t,[{key:"type",get:function(){throw new m}},{key:"name",get:function(){throw new m}},{key:"universal",get:function(){throw new m}},{key:"isValid",get:function(){throw new m}}]),t}(),Ct=null,_t=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.offsetName=function(t,e){return ut(t,e.format,e.locale)},n.formatOffset=function(t,e){return dt(this.offset(t),e)},n.offset=function(t){return-new Date(t).getTimezoneOffset()},n.equals=function(t){return"local"===t.type},i(e,[{key:"type",get:function(){return"local"}},{key:"name",get:function(){return L()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===Ct&&(Ct=new e),Ct}}]),e}(Ut),Yt=RegExp("^"+yt.source+"$"),At={};var Rt={year:0,month:1,day:2,hour:3,minute:4,second:5};var Vt={},Ft=function(n){function r(t){var e;return(e=n.call(this)||this).zoneName=t,e.valid=r.isValidZone(t),e}a(r,n),r.create=function(t){return Vt[t]||(Vt[t]=new r(t)),Vt[t]},r.resetCache=function(){Vt={},At={}},r.isValidSpecifier=function(t){return!(!t||!t.match(Yt))},r.isValidZone=function(t){try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}},r.parseGMTOffset=function(t){if(t){var e=t.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(e)return-60*parseInt(e[1])}return nul