Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rrule

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrule - npm Package Compare versions

Comparing version 2.7.2 to 2.8.0

16

CHANGELOG.md
### Changelog
- 2.8.0 (2023-11-10)
- Bugfixes:
- Don't minify `rrule.js` (minified version is still at `rrule.min.js`) ([#606](https://github.com/jkbrzt/rrule/pull/606))
- Ignore tzid in NLP ([#528](https://github.com/jkbrzt/rrule/pull/528))
- Remove unnecessary offset in daysBetween() ([#539](https://github.com/jkbrzt/rrule/pull/539))
- Convert test suite from mocha to jest ([#605](https://github.com/jkbrzt/rrule/pull/605))
- Export `ALL_WEEKDAYS` ([#591](https://github.com/jkbrzt/rrule/pull/591))
- Support weekly by hour texts ([#590](https://github.com/jkbrzt/rrule/pull/590))
- 2.7.2 (2023-02-10)
- Fix rezonedDate (#523)
- Bugfixes:
- Fix rezonedDate ([#523](https://github.com/jakubroztocil/rrule/issues/523))
- Export datetime ([#551](https://github.com/jakubroztocil/rrule/issues/551))
- Fixes types for `before()` and `after()` ([#560](https://github.com/jakubroztocil/rrule/issues/560))
- Update README (https://github.com/jakubroztocil/rrule/pull/543)

@@ -7,0 +21,0 @@ - 2.7.1 (2022-07-10)

2

dist/es5/rrule.min.js

@@ -1,2 +0,2 @@

!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,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Frequency:()=>X,RRule:()=>Ft,RRuleSet:()=>Qt,Weekday:()=>r,datetime:()=>b,rrulestr:()=>Bt});var n=["MO","TU","WE","TH","FR","SA","SU"],r=function(){function t(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return t.fromStr=function(e){return new t(n.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},t.prototype.toString=function(){var t=n[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},t.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},t}(),i=function(t){return null!=t},o=function(t){return"number"==typeof t},a=function(t){return"string"==typeof t&&n.includes(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},h=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};function y(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+=h(n,e/n.length)),n.slice(0,e)+String(r))}var c=function(t,e){var n=t%e;return n*e<0?n+e:n},d=function(t,e){return{div:Math.floor(t/e),mod:c(t,e)}},l=function(t){return!i(t)||0===t.length},f=function(t){return!l(t)},p=function(t,e){return f(t)&&-1!==t.indexOf(e)},b=function(t,e,n,r,i,o){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),new Date(Date.UTC(t,e-1,n,r,i,o))},m=[31,28,31,30,31,30,31,31,30,31,30,31],w=864e5,v=b(1970,1,1),g=[6,0,1,2,3,4,5],k=function(t){return t%4==0&&t%100!=0||t%400==0},E=function(t){return t instanceof Date},T=function(t){return E(t)&&!isNaN(t.getTime())},x=function(t){return 60*t.getTimezoneOffset()*1e3},O=function(t){return n=v,r=(e=t).getTime()-x(e)-(n.getTime()-x(n)),Math.round(r/w);var e,n,r},D=function(t){return new Date(v.getTime()+t*w)},S=function(t){var e=t.getUTCMonth();return 1===e&&k(t.getUTCFullYear())?29:m[e]},U=function(t){return g[t.getUTCDay()]},Y=function(t,e){var n=b(t,e+1,1);return[U(n),S(n)]},L=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()))},M=function(t){return new Date(t.getTime())},_=function(t){for(var e=[],n=0;n<t.length;n++)e.push(M(t[n]));return e},R=function(t){t.sort((function(t,e){return t.getTime()-e.getTime()}))},N=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[y(n.getUTCFullYear().toString(),4,"0"),y(n.getUTCMonth()+1,2,"0"),y(n.getUTCDate(),2,"0"),"T",y(n.getUTCHours(),2,"0"),y(n.getUTCMinutes(),2,"0"),y(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},A=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: ".concat(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))},C=function(t,e){return t.toLocaleString("sv-SE",{timeZone:e}).replace(" ","T")+"Z"};const I=function(){function t(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))}return t.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)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}();var j=function(t,e){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},j(t,e)};function W(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var H=function(){return H=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},H.apply(this,arguments)};Object.create;function q(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;const P=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return W(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(I);const F={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}};var z=function(t,e){return-1!==t.indexOf(e)},K=function(t){return t.toString()},B=function(t,e,n){return"".concat(e," ").concat(n,", ").concat(t)};const Z=function(){function t(t,e,n,r){if(void 0===e&&(e=K),void 0===n&&(n=F),void 0===r&&(r=B),this.text=[],this.language=n||F,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort((function(t,e){return t-e})),a.sort((function(t,e){return e-t})),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(i(this.origOptions.byweekday)){var u=s(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(u);this.byweekday={allWeeks:u.filter((function(t){return!t.n})),someWeeks:u.filter((function(t){return Boolean(t.n)})),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var y=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(y),this.byweekday.someWeeks.sort(y),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){if(!(e.options.freq in t.IMPLEMENTED))return!1;if(e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(z(["dtstart","wkst","freq"],n))return!0;if(!z(t.IMPLEMENTED[e.options.freq],n))return!1}return!0},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Ft.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},t.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},t.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},t.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},t.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},t.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},t.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(t){var e;t=parseInt(t.toString(),10);var n=this.gettext;if(-1===t)return n("last");var r=Math.abs(t);switch(r){case 1:case 21:case 31:e=r+n("st");break;case 2:case 22:e=r+n("nd");break;case 3:case 23:e=r+n("rd");break;default:e=r+n("th")}return t<0?e+" "+n("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=o(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},t.prototype.plural=function(t){return t%100!=1},t.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},t.prototype.list=function(t,e,n,r){var i=this;void 0===r&&(r=","),s(t)||(t=[t]);e=e||function(t){return t.toString()};var o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},t}();var X,G=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol===t){if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function Q(t,e){void 0===e&&(e=F);var n={},r=new G(e.tokens);return r.start(t)?(function(){r.expect("every");var t=r.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Ft.DAILY,r.nextSymbol()&&(!function(){if(!r.accept("at"))return;do{var t=r.acceptNumber();if(!t)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];r.accept("comma");){if(!(t=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(r.accept("comma")||r.accept("at"))}(),u());break;case"weekday(s)":n.freq=Ft.WEEKLY,n.byweekday=[Ft.MO,Ft.TU,Ft.WE,Ft.TH,Ft.FR],r.nextSymbol(),u();break;case"week(s)":n.freq=Ft.WEEKLY,r.nextSymbol()&&(i(),u());break;case"hour(s)":n.freq=Ft.HOURLY,r.nextSymbol()&&(i(),u());break;case"minute(s)":n.freq=Ft.MINUTELY,r.nextSymbol()&&(i(),u());break;case"month(s)":n.freq=Ft.MONTHLY,r.nextSymbol()&&(i(),u());break;case"year(s)":n.freq=Ft.YEARLY,r.nextSymbol()&&(i(),u());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Ft.WEEKLY;var e=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Ft[e]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var h=a();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Ft[h]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var t=s();if(!t)return;n.bymonthday=[t],r.nextSymbol();for(;r.accept("comma");){if(!(t=s()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(t),r.nextSymbol()}}(),u();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Ft.YEARLY,n.bymonth=[o()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=o();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}i(),u();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var t=r.accept("on"),e=r.accept("the");if(t||e)do{var i=s(),u=a(),h=o();if(i)u?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Ft[u].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(u)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Ft[u]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[Ft.MO,Ft.TU,Ft.WE,Ft.TH,Ft.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(!(y=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else{if(!h)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(h)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function a(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function s(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var t=parseInt(r.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return r.nextSymbol(),r.accept("last")?-t:t;default:return!1}}function u(){if("until"===r.symbol){var t=Date.parse(r.text);if(!t)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(t)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function $(t){return t<X.HOURLY}!function(t){t[t.YEARLY=0]="YEARLY",t[t.MONTHLY=1]="MONTHLY",t[t.WEEKLY=2]="WEEKLY",t[t.DAILY=3]="DAILY",t[t.HOURLY=4]="HOURLY",t[t.MINUTELY=5]="MINUTELY",t[t.SECONDLY=6]="SECONDLY"}(X||(X={}));var J=function(t,e){return void 0===e&&(e=F),new Ft(Q(t,e)||void 0)},V=["count","until","interval","byweekday","bymonthday","bymonth"];Z.IMPLEMENTED=[],Z.IMPLEMENTED[X.HOURLY]=V,Z.IMPLEMENTED[X.MINUTELY]=V,Z.IMPLEMENTED[X.DAILY]=["byhour"].concat(V),Z.IMPLEMENTED[X.WEEKLY]=V,Z.IMPLEMENTED[X.MONTHLY]=V,Z.IMPLEMENTED[X.YEARLY]=["byweekno","byyearday"].concat(V);var tt=Z.isFullyConvertible,et=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),nt=function(t){function e(e,n,r,i,o,a,s){var u=t.call(this,i,o,a,s)||this;return u.year=e,u.month=n,u.day=r,u}return W(e,t),e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return U(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=c(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},e.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()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=d(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),l(n)||p(n,this.hour))break}},e.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=d(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute)))break}},e.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 o=d(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute))&&(l(i)||p(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Y(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>9999))return;t=Y(this.year,this.month-1)[1]}}},e.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case X.YEARLY:return this.addYears(r);case X.MONTHLY:return this.addMonths(r);case X.WEEKLY:return this.addWeekly(r,i);case X.DAILY:return this.addDaily(r);case X.HOURLY:return this.addHours(r,e,o);case X.MINUTELY:return this.addMinutes(r,e,o,a);case X.SECONDLY:return this.addSeconds(r,e,o,a,s)}},e}(et);function rt(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];p(Pt,i)||e.push(i),E(t[i])&&!T(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return H({},t)}function it(t){var e=H(H({},qt),rt(t));if(i(e.byeaster)&&(e.freq=Ft.YEARLY),!i(e.freq)||!Ft.FREQUENCIES[e.freq])throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),i(e.wkst)?o(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Ft.MO.weekday,i(e.bysetpos)){o(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(y=e.bysetpos[n])||!(y>=-366&&y<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||f(e.byweekno)||f(e.byyearday)||Boolean(e.bymonthday)||f(e.bymonthday)||i(e.byweekday)||i(e.byeaster)))switch(e.freq){case Ft.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Ft.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Ft.WEEKLY:e.byweekday=[U(e.dtstart)]}if(i(e.bymonth)&&!s(e.bymonth)&&(e.bymonth=[e.bymonth]),i(e.byyearday)&&!s(e.byyearday)&&o(e.byyearday)&&(e.byyearday=[e.byyearday]),i(e.bymonthday))if(s(e.bymonthday)){var u=[],h=[];for(n=0;n<e.bymonthday.length;n++){var y;(y=e.bymonthday[n])>0?u.push(y):y<0&&h.push(y)}e.bymonthday=u,e.bynmonthday=h}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(i(e.byweekno)&&!s(e.byweekno)&&(e.byweekno=[e.byweekno]),i(e.byweekday))if(o(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(a(e.byweekday))e.byweekday=[r.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof r)!e.byweekday.n||e.freq>Ft.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var c=[],d=[];for(n=0;n<e.byweekday.length;n++){var l=e.byweekday[n];o(l)?c.push(l):a(l)?c.push(r.fromStr(l).weekday):!l.n||e.freq>Ft.MONTHLY?c.push(l.weekday):d.push([l.weekday,l.n])}e.byweekday=f(c)?c:null,e.bynweekday=f(d)?d:null}else e.bynweekday=null;return i(e.byhour)?o(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Ft.HOURLY?[e.dtstart.getUTCHours()]:null,i(e.byminute)?o(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Ft.MINUTELY?[e.dtstart.getUTCMinutes()]:null,i(e.bysecond)?o(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Ft.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function ot(t){var e=t.split("\n").map(st).filter((function(t){return null!==t}));return H(H({},e[0]),e[1])}function at(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=A(i),e}function st(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return ut(t);var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return ut(t);case"DTSTART":return at(t);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(t))}}function ut(t){var e=at(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var i=n.split("="),o=i[0],a=i[1];switch(o.toUpperCase()){case"FREQ":e.freq=X[a.toUpperCase()];break;case"WKST":e.wkst=Ht[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s=function(t){if(-1!==t.indexOf(",")){return t.split(",").map(ht)}return ht(t)}(a),u=o.toLowerCase();e[u]=s;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map((function(t){if(2===t.length)return Ht[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!e||e.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var n=Number(e[1]),i=e[2],o=Ht[i].weekday;return new r(o,n)}))}(a);break;case"DTSTART":case"TZID":var h=at(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=A(a);break;case"BYEASTER":e.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+o+"'")}})),e}function ht(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var yt=function(){function t(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=N(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){return this.isUTC?this.date:function(t,e){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(C(t,n)),i=new Date(C(t,null!=e?e:"UTC")).getTime()-r.getTime();return new Date(t.getTime()-i)}(this.date,this.tzid)},t}();function ct(t){for(var e,n=[],a="",u=Object.keys(t),h=Object.keys(qt),y=0;y<u.length;y++)if("tzid"!==u[y]&&p(h,u[y])){var c=u[y].toUpperCase(),d=t[u[y]],l="";if(i(d)&&(!s(d)||d.length)){switch(c){case"FREQ":l=Ft.FREQUENCIES[t.freq];break;case"WKST":l=o(d)?new r(d).toString():d.toString();break;case"BYWEEKDAY":c="BYDAY",l=(e=d,s(e)?e:[e]).map((function(t){return t instanceof r?t:s(t)?new r(t[0],t[1]):new r(t)})).toString();break;case"DTSTART":a=dt(d,t.tzid);break;case"UNTIL":l=N(d,!t.tzid);break;default:if(s(d)){for(var f=[],b=0;b<d.length;b++)f[b]=String(d[b]);l=f.toString()}else l=String(d)}l&&n.push([c,l])}}var m=n.map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n.toString())})).join(";"),w="";return""!==m&&(w="RRULE:".concat(m)),[a,w].filter((function(t){return!!t})).join("\n")}function dt(t,e){return t?"DTSTART"+new yt(new Date(t),e).toString():""}function lt(t,e){return Array.isArray(t)?!!Array.isArray(e)&&(t.length===e.length&&t.every((function(t,n){return t.getTime()===e[n].getTime()}))):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var ft=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?M(e):_(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,e){var n=!1,r=e?Object.keys(e):[],i=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(!lt(e[i],t[i]))return!0}return!1},o=this[t];if("all"===t)n=this.all;else if(s(o))for(var a=0;a<o.length;a++){var u=o[a];if(!r.length||!i(u)){n=u._value;break}}if(!n&&this.all){var h=new I(t,e);for(a=0;a<this.all.length&&h.accept(this.all[a]);a++);n=h.getValue(),this._cacheAdd(t,n,e)}return s(n)?_(n):n instanceof Date?M(n):n},t}(),pt=q(q(q(q(q(q(q(q(q(q(q(q(q([],h(1,31),!0),h(2,28),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),bt=q(q(q(q(q(q(q(q(q(q(q(q(q([],h(1,31),!0),h(2,29),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),mt=u(1,29),wt=u(1,30),vt=u(1,31),gt=u(1,32),kt=q(q(q(q(q(q(q(q(q(q(q(q(q([],gt,!0),wt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt.slice(0,7),!0),Et=q(q(q(q(q(q(q(q(q(q(q(q(q([],gt,!0),mt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt.slice(0,7),!0),Tt=u(-28,0),xt=u(-29,0),Ot=u(-30,0),Dt=u(-31,0),St=q(q(q(q(q(q(q(q(q(q(q(q(q([],Dt,!0),xt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt.slice(0,7),!0),Ut=q(q(q(q(q(q(q(q(q(q(q(q(q([],Dt,!0),Tt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt.slice(0,7),!0),Yt=[0,31,60,91,121,152,182,213,244,274,305,335,366],Lt=[0,31,59,90,120,151,181,212,243,273,304,334,365],Mt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(u(7));return t}();function _t(t,e){var n,r,i=b(t,1,1),o=k(t)?366:365,a=k(t+1)?366:365,s=O(i),u=U(i),y=H(H({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:u},function(t){var e=k(t)?366:365,n=b(t,1,1),r=U(n);if(365===e)return{mmask:pt,mdaymask:Et,nmdaymask:Ut,wdaymask:Mt.slice(r),mrange:Lt};return{mmask:bt,mdaymask:kt,nmdaymask:St,wdaymask:Mt.slice(r),mrange:Yt}}(t)),{wnomask:null});if(l(e.byweekno))return y;y.wnomask=h(0,o+7);var d=n=c(7-u+e.wkst,7);d>=4?(d=0,r=y.yearlen+c(u-e.wkst,7)):r=o-d;for(var f=Math.floor(r/7),m=c(r,7),w=Math.floor(f+m/4),v=0;v<e.byweekno.length;v++){var g=e.byweekno[v];if(g<0&&(g+=w+1),g>0&&g<=w){var E=void 0;g>1?(E=d+7*(g-1),d!==n&&(E-=7-n)):E=d;for(var T=0;T<7&&(y.wnomask[E]=1,E++,y.wdaymask[E]!==e.wkst);T++);}}if(p(e.byweekno,1)){E=d+7*w;if(d!==n&&(E-=7-n),E<o)for(v=0;v<7&&(y.wnomask[E]=1,E+=1,y.wdaymask[E]!==e.wkst);v++);}if(d){var x=void 0;if(p(e.byweekno,-1))x=-1;else{var D=U(b(t-1,1,1)),S=c(7-D.valueOf()+e.wkst,7),Y=k(t-1)?366:365,L=void 0;S>=4?(S=0,L=Y+c(D-e.wkst,7)):L=o-d,x=Math.floor(52+c(L,7)/4)}if(p(e.byweekno,x))for(E=0;E<d;E++)y.wnomask[E]=1}return y}const Rt=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=_t(t,n)),f(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,o=r.yearlen,a=r.mrange,s=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===Ft.YEARLY)if(l(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===Ft.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(l(s))return a;for(a.nwdaymask=h(0,n),u=0;u<s.length;u++)for(var y=s[u],d=y[0],f=y[1]-1,p=0;p<o.bynweekday.length;p++){var b=void 0,m=o.bynweekday[p],w=m[0],v=m[1];v<0?(b=f+7*(v+1),b-=c(i[b]-w,7)):(b=d+7*(v-1),b+=c(7-i[b]+w,7)),d<=b&&b<=f&&(a.nwdaymask[b]=1)}return a}(t,e,o,a,s,n)}i(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-o-u+15)%30,y=Math.floor(i/4),c=i%4,d=Math.floor(32+2*a+2*y-h-c)%7,l=Math.floor((n+11*h+22*d)/451),f=Math.floor((h+d-7*l+114)/31),p=(h+d-7*l+114)%31+1,b=Date.UTC(t,f-1,p+e),m=Date.UTC(t,0,1);return[Math.ceil((b-m)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[u(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e){for(var n=this.mrange[e-1],r=this.mrange[e],i=h(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},t.prototype.wdayset=function(t,e,n){for(var r=h(null,this.yearlen+7),i=O(b(t,e,n))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=h(null,this.yearlen),i=O(b(t,e,n))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(t,e,n,r){var i=this,o=[];return this.options.byminute.forEach((function(e){o=o.concat(i.mtimeset(t,e,n,r))})),R(o),o},t.prototype.mtimeset=function(t,e,n,r){var i=this.options.bysecond.map((function(n){return new et(t,e,n,r)}));return R(i),i},t.prototype.stimeset=function(t,e,n,r){return[new et(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case X.YEARLY:return this.ydayset.bind(this);case X.MONTHLY:return this.mdayset.bind(this);case X.WEEKLY:return this.wdayset.bind(this);case X.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case X.HOURLY:return this.htimeset.bind(this);case X.MINUTELY:return this.mtimeset.bind(this);case X.SECONDLY:return this.stimeset.bind(this)}},t}();function Nt(t,e,n,r,o,a){for(var s=[],u=0;u<t.length;u++){var h=void 0,y=void 0,d=t[u];d<0?(h=Math.floor(d/e.length),y=c(d,e.length)):(h=Math.floor((d-1)/e.length),y=c(d-1,e.length));for(var l=[],f=n;f<r;f++){var b=a[f];i(b)&&l.push(b)}var m=void 0;m=h<0?l.slice(h)[0]:l[h];var w=e[y],v=D(o.yearordinal+m),g=L(v,w);p(s,g)||s.push(g)}return R(s),s}function At(t,e){var n=e.dtstart,r=e.freq,o=e.interval,a=e.until,s=e.bysetpos,u=e.count;if(0===u||0===o)return jt(t);var h=nt.fromDate(n),y=new Rt(e);y.rebuild(h.year,h.month);for(var c=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if($(r))return function(t){var e=t.dtstart.getTime()%1e3;if(!$(t.freq))return[];var n=[];return t.byhour.forEach((function(r){t.byminute.forEach((function(i){t.bysecond.forEach((function(t){n.push(new et(r,i,t,e))}))}))})),n}(n);if(r>=Ft.HOURLY&&f(i)&&!p(i,e.hour)||r>=Ft.MINUTELY&&f(o)&&!p(o,e.minute)||r>=Ft.SECONDLY&&f(a)&&!p(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(y,h,e);;){var d=y.getdayset(r)(h.year,h.month,h.day),l=d[0],b=d[1],m=d[2],w=Wt(l,b,m,y,e);if(f(s))for(var v=Nt(s,c,b,m,y,l),g=0;g<v.length;g++){var k=v[g];if(a&&k>a)return jt(t);if(k>=n){var E=It(k,e);if(!t.accept(E))return jt(t);if(u&&!--u)return jt(t)}}else for(g=b;g<m;g++){var T=l[g];if(i(T))for(var x=D(y.yearordinal+T),O=0;O<c.length;O++){var S=c[O];k=L(x,S);if(a&&k>a)return jt(t);if(k>=n){E=It(k,e);if(!t.accept(E))return jt(t);if(u&&!--u)return jt(t)}}}if(0===e.interval)return jt(t);if(h.add(e,w),h.year>9999)return jt(t);$(r)||(c=y.gettimeset(r)(h.hour,h.minute,h.second,0)),y.rebuild(h.year,h.month)}}function Ct(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,u=n.bynmonthday,h=n.byyearday;return f(r)&&!p(r,t.mmask[e])||f(i)&&!t.wnomask[e]||f(o)&&!p(o,t.wdaymask[e])||f(t.nwdaymask)&&!t.nwdaymask[e]||null!==a&&!p(t.eastermask,e)||(f(s)||f(u))&&!p(s,t.mdaymask[e])&&!p(u,t.nmdaymask[e])||f(h)&&(e<t.yearlen&&!p(h,e+1)&&!p(h,-t.yearlen+e)||e>=t.yearlen&&!p(h,e+1-t.yearlen)&&!p(h,-t.nextyearlen+e-t.yearlen))}function It(t,e){return new yt(t,e.tzid).rezonedDate()}function jt(t){return t.getValue()}function Wt(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var s=t[a];(o=Ct(r,s,i))&&(t[s]=null)}return o}var Ht={MO:new r(0),TU:new r(1),WE:new r(2),TH:new r(3),FR:new r(4),SA:new r(5),SU:new r(6)},qt={freq:X.YEARLY,dtstart:null,interval:1,wkst:Ht.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},Pt=Object.keys(qt),Ft=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new ft,this.origOptions=rt(t);var n=it(t).parsedOptions;this.options=n}return t.parseText=function(t,e){return Q(t,e)},t.fromText=function(t,e){return J(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(t){return At(t,this.options)},t.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},t.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},t.prototype.all=function(t){if(t)return this._iter(new P("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new I("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!T(t)||!T(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 P("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new I("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){if(void 0===e&&(e=!1),!T(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 I("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){if(void 0===e&&(e=!1),!T(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 I("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return ct(this.origOptions)},t.prototype.toText=function(t,e,n){return function(t,e,n,r){return new Z(t,e,n,r).toString()}(this,t,e,n)},t.prototype.isFullyConvertibleToText=function(){return tt(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=X.YEARLY,t.MONTHLY=X.MONTHLY,t.WEEKLY=X.WEEKLY,t.DAILY=X.DAILY,t.HOURLY=X.HOURLY,t.MINUTELY=X.MINUTELY,t.SECONDLY=X.SECONDLY,t.MO=Ht.MO,t.TU=Ht.TU,t.WE=Ht.WE,t.TH=Ht.TH,t.FR=Ht.FR,t.SA=Ht.SA,t.SU=Ht.SU,t.parseString=ot,t.optionsToString=ct,t}();var zt={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Kt(t,e){var n=[],r=[],i=[],o=[],a=at(t),s=a.dtstart,u=a.tzid,h=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?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold);return h.forEach((function(t){var e;if(t){var a=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=(i=t,o=":",a=1,s=i.split(o),a?s.slice(0,a).concat([s.slice(a).join(o)]):s),n=e[0],r=e[1];var i,o,a,s;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),s=a.name,h=a.parms,y=a.value;switch(s.toUpperCase()){case"RRULE":if(h.length)throw new Error("unsupported RRULE parm: ".concat(h.join(",")));n.push(ot(t));break;case"RDATE":var c=(null!==(e=/RDATE(?:;TZID=([^:=]+))?/i.exec(t))&&void 0!==e?e:[])[1];c&&!u&&(u=c),r=r.concat(Xt(y,h));break;case"EXRULE":if(h.length)throw new Error("unsupported EXRULE parm: ".concat(h.join(",")));i.push(ot(y));break;case"EXDATE":o=o.concat(Xt(y,h));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:u,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Bt(t,e){return void 0===e&&(e={}),function(t,e){var n=Kt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var y=new Qt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach((function(t){y.rrule(new Ft(Zt(t,s,u),h))})),i.forEach((function(t){y.rdate(t)})),o.forEach((function(t){y.exrule(new Ft(Zt(t,s,u),h))})),a.forEach((function(t){y.exdate(t)})),e.compatible&&e.dtstart&&y.rdate(s),y}var c=r[0]||{};return new Ft(Zt(c,c.dtstart||e.dtstart||s,c.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(zt);if(n.forEach((function(t){p(r,t)||e.push(t)})),e.length)throw new Error("Invalid options: "+e.join(", "));return H(H({},zt),t)}(e))}function Zt(t,e,n){return H(H({},t),{dtstart:e,tzid:n})}function Xt(t,e){return function(t){t.forEach((function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}))}(e),t.split(",").map((function(t){return A(t)}))}function Gt(t){var e=this;return function(n){if(void 0!==n&&(e["_".concat(t)]=n),void 0!==e["_".concat(t)])return e["_".concat(t)];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var Qt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n.dtstart=Gt.apply(n,["dtstart"]),n.tzid=Gt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return W(e,t),e.prototype._iter=function(t){return function(t,e,n,r,i,o){var a={},s=t.accept;function u(t,e){n.forEach((function(n){n.between(t,e,!0).forEach((function(t){a[Number(t)]=!0}))}))}i.forEach((function(t){var e=new yt(t,o).rezonedDate();a[Number(e)]=!0})),t.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===t.method&&(u(t.args.after,t.args.before),t.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var h=0;h<r.length;h++){var y=new yt(r[h],o).rezonedDate();if(!t.accept(new Date(y.getTime())))break}e.forEach((function(e){At(t,e.options)}));var c=t._result;switch(R(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;default:return c.length&&c[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){$t(t,this._rrule)},e.prototype.exrule=function(t){$t(t,this._exrule)},e.prototype.rdate=function(t){Jt(t,this._rdate)},e.prototype.exdate=function(t){Jt(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map((function(t){return Bt(t.toString())}))},e.prototype.exrules=function(){return this._exrule.map((function(t){return Bt(t.toString())}))},e.prototype.rdates=function(){return this._rdate.map((function(t){return new Date(t.getTime())}))},e.prototype.exdates=function(){return this._exdate.map((function(t){return new Date(t.getTime())}))},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(ct({dtstart:this._dtstart}))),this._rrule.forEach((function(e){t=t.concat(e.toString().split("\n"))})),this._exrule.forEach((function(e){t=t.concat(e.toString().split("\n").map((function(t){return t.replace(/^RRULE:/,"EXRULE:")})).filter((function(t){return!/^DTSTART/.test(t)})))})),this._rdate.length&&t.push(Vt("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Vt("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach((function(e){return t.rrule(e.clone())})),this._exrule.forEach((function(e){return t.exrule(e.clone())})),this._rdate.forEach((function(e){return t.rdate(new Date(e.getTime()))})),this._exdate.forEach((function(e){return t.exdate(new Date(e.getTime()))})),t},e}(Ft);function $t(t,e){if(!(t instanceof Ft))throw new TypeError(String(t)+" is not RRule instance");p(e.map(String),String(t))||e.push(t)}function Jt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");p(e.map(Number),Number(t))||(e.push(t),R(e))}function Vt(t,e,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(t,":"):"".concat(t,";TZID=").concat(n,":"),o=e.map((function(t){return N(t.valueOf(),r)})).join(",");return"".concat(i).concat(o)}return e})()));
!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,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ALL_WEEKDAYS:()=>n,Frequency:()=>Z,RRule:()=>Pt,RRuleSet:()=>Gt,Weekday:()=>r,datetime:()=>b,rrulestr:()=>Kt});var n=["MO","TU","WE","TH","FR","SA","SU"],r=function(){function t(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return t.fromStr=function(e){return new t(n.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},t.prototype.toString=function(){var t=n[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},t.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},t}(),i=function(t){return null!=t},o=function(t){return"number"==typeof t},a=function(t){return"string"==typeof t&&n.includes(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},h=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};function y(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+=h(n,e/n.length)),n.slice(0,e)+String(r))}var c=function(t,e){var n=t%e;return n*e<0?n+e:n},d=function(t,e){return{div:Math.floor(t/e),mod:c(t,e)}},l=function(t){return!i(t)||0===t.length},f=function(t){return!l(t)},p=function(t,e){return f(t)&&-1!==t.indexOf(e)},b=function(t,e,n,r,i,o){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),new Date(Date.UTC(t,e-1,n,r,i,o))},m=[31,28,31,30,31,30,31,31,30,31,30,31],w=864e5,v=b(1970,1,1),g=[6,0,1,2,3,4,5],k=function(t){return t%4==0&&t%100!=0||t%400==0},E=function(t){return t instanceof Date},T=function(t){return E(t)&&!isNaN(t.getTime())},x=function(t){return e=v,n=t.getTime()-e.getTime(),Math.round(n/w);var e,n},D=function(t){return new Date(v.getTime()+t*w)},O=function(t){var e=t.getUTCMonth();return 1===e&&k(t.getUTCFullYear())?29:m[e]},S=function(t){return g[t.getUTCDay()]},U=function(t,e){var n=b(t,e+1,1);return[S(n),O(n)]},Y=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()))},L=function(t){return new Date(t.getTime())},M=function(t){for(var e=[],n=0;n<t.length;n++)e.push(L(t[n]));return e},_=function(t){t.sort((function(t,e){return t.getTime()-e.getTime()}))},R=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[y(n.getUTCFullYear().toString(),4,"0"),y(n.getUTCMonth()+1,2,"0"),y(n.getUTCDate(),2,"0"),"T",y(n.getUTCHours(),2,"0"),y(n.getUTCMinutes(),2,"0"),y(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},N=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: ".concat(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))},A=function(t,e){return t.toLocaleString("sv-SE",{timeZone:e}).replace(" ","T")+"Z"};const C=function(){function t(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))}return t.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)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}();var I=function(t,e){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},I(t,e)};function j(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var W=function(){return W=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},W.apply(this,arguments)};Object.create;function H(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;const q=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return j(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(C);const P={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}};var F=function(t,e){return-1!==t.indexOf(e)},z=function(t){return t.toString()},K=function(t,e,n){return"".concat(e," ").concat(n,", ").concat(t)};const B=function(){function t(t,e,n,r){if(void 0===e&&(e=z),void 0===n&&(n=P),void 0===r&&(r=K),this.text=[],this.language=n||P,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort((function(t,e){return t-e})),a.sort((function(t,e){return e-t})),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(i(this.origOptions.byweekday)){var u=s(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(u);this.byweekday={allWeeks:u.filter((function(t){return!t.n})),someWeeks:u.filter((function(t){return Boolean(t.n)})),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var y=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(y),this.byweekday.someWeeks.sort(y),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){if(!(e.options.freq in t.IMPLEMENTED))return!1;if(e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(F(["dtstart","tzid","wkst","freq"],n))return!0;if(!F(t.IMPLEMENTED[e.options.freq],n))return!1}return!0},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Pt.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},t.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},t.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},t.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},t.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},t.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},t.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(t){var e;t=parseInt(t.toString(),10);var n=this.gettext;if(-1===t)return n("last");var r=Math.abs(t);switch(r){case 1:case 21:case 31:e=r+n("st");break;case 2:case 22:e=r+n("nd");break;case 3:case 23:e=r+n("rd");break;default:e=r+n("th")}return t<0?e+" "+n("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=o(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},t.prototype.plural=function(t){return t%100!=1},t.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},t.prototype.list=function(t,e,n,r){var i=this;void 0===r&&(r=","),s(t)||(t=[t]);e=e||function(t){return t.toString()};var o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},t}();var Z,X=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol===t){if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function G(t,e){void 0===e&&(e=P);var n={},r=new X(e.tokens);return r.start(t)?(function(){r.expect("every");var t=r.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Pt.DAILY,r.nextSymbol()&&(o(),h());break;case"weekday(s)":n.freq=Pt.WEEKLY,n.byweekday=[Pt.MO,Pt.TU,Pt.WE,Pt.TH,Pt.FR],r.nextSymbol(),o(),h();break;case"week(s)":n.freq=Pt.WEEKLY,r.nextSymbol()&&(i(),o(),h());break;case"hour(s)":n.freq=Pt.HOURLY,r.nextSymbol()&&(i(),h());break;case"minute(s)":n.freq=Pt.MINUTELY,r.nextSymbol()&&(i(),h());break;case"month(s)":n.freq=Pt.MONTHLY,r.nextSymbol()&&(i(),h());break;case"year(s)":n.freq=Pt.YEARLY,r.nextSymbol()&&(i(),h());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Pt.WEEKLY;var e=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Pt[e]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=s();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Pt[y]),r.nextSymbol()}o(),function(){r.accept("on"),r.accept("the");var t=u();if(!t)return;n.bymonthday=[t],r.nextSymbol();for(;r.accept("comma");){if(!(t=u()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(t),r.nextSymbol()}}(),h();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Pt.YEARLY,n.bymonth=[a()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var c=a();if(!c)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(c),r.nextSymbol()}i(),h();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var t=r.accept("on"),e=r.accept("the");if(t||e)do{var i=u(),o=s(),h=a();if(i)o?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Pt[o].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(o)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Pt[o]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[Pt.MO,Pt.TU,Pt.WE,Pt.TH,Pt.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(!(y=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else{if(!h)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(h)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){if(r.accept("at"))do{var t=r.acceptNumber();if(!t)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];r.accept("comma");){if(!(t=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(r.accept("comma")||r.accept("at"))}function a(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function s(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function u(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var t=parseInt(r.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return r.nextSymbol(),r.accept("last")?-t:t;default:return!1}}function h(){if("until"===r.symbol){var t=Date.parse(r.text);if(!t)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(t)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function Q(t){return t<Z.HOURLY}!function(t){t[t.YEARLY=0]="YEARLY",t[t.MONTHLY=1]="MONTHLY",t[t.WEEKLY=2]="WEEKLY",t[t.DAILY=3]="DAILY",t[t.HOURLY=4]="HOURLY",t[t.MINUTELY=5]="MINUTELY",t[t.SECONDLY=6]="SECONDLY"}(Z||(Z={}));var $=function(t,e){return void 0===e&&(e=P),new Pt(G(t,e)||void 0)},J=["count","until","interval","byweekday","bymonthday","bymonth"];B.IMPLEMENTED=[],B.IMPLEMENTED[Z.HOURLY]=J,B.IMPLEMENTED[Z.MINUTELY]=J,B.IMPLEMENTED[Z.DAILY]=["byhour"].concat(J),B.IMPLEMENTED[Z.WEEKLY]=J,B.IMPLEMENTED[Z.MONTHLY]=J,B.IMPLEMENTED[Z.YEARLY]=["byweekno","byyearday"].concat(J);var V=B.isFullyConvertible,tt=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),et=function(t){function e(e,n,r,i,o,a,s){var u=t.call(this,i,o,a,s)||this;return u.year=e,u.month=n,u.day=r,u}return j(e,t),e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return S(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=c(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},e.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()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=d(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),l(n)||p(n,this.hour))break}},e.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=d(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute)))break}},e.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 o=d(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute))&&(l(i)||p(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=U(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>9999))return;t=U(this.year,this.month-1)[1]}}},e.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case Z.YEARLY:return this.addYears(r);case Z.MONTHLY:return this.addMonths(r);case Z.WEEKLY:return this.addWeekly(r,i);case Z.DAILY:return this.addDaily(r);case Z.HOURLY:return this.addHours(r,e,o);case Z.MINUTELY:return this.addMinutes(r,e,o,a);case Z.SECONDLY:return this.addSeconds(r,e,o,a,s)}},e}(tt);function nt(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];p(qt,i)||e.push(i),E(t[i])&&!T(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return W({},t)}function rt(t){var e=W(W({},Ht),nt(t));if(i(e.byeaster)&&(e.freq=Pt.YEARLY),!i(e.freq)||!Pt.FREQUENCIES[e.freq])throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),i(e.wkst)?o(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Pt.MO.weekday,i(e.bysetpos)){o(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(y=e.bysetpos[n])||!(y>=-366&&y<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||f(e.byweekno)||f(e.byyearday)||Boolean(e.bymonthday)||f(e.bymonthday)||i(e.byweekday)||i(e.byeaster)))switch(e.freq){case Pt.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Pt.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Pt.WEEKLY:e.byweekday=[S(e.dtstart)]}if(i(e.bymonth)&&!s(e.bymonth)&&(e.bymonth=[e.bymonth]),i(e.byyearday)&&!s(e.byyearday)&&o(e.byyearday)&&(e.byyearday=[e.byyearday]),i(e.bymonthday))if(s(e.bymonthday)){var u=[],h=[];for(n=0;n<e.bymonthday.length;n++){var y;(y=e.bymonthday[n])>0?u.push(y):y<0&&h.push(y)}e.bymonthday=u,e.bynmonthday=h}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(i(e.byweekno)&&!s(e.byweekno)&&(e.byweekno=[e.byweekno]),i(e.byweekday))if(o(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(a(e.byweekday))e.byweekday=[r.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof r)!e.byweekday.n||e.freq>Pt.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var c=[],d=[];for(n=0;n<e.byweekday.length;n++){var l=e.byweekday[n];o(l)?c.push(l):a(l)?c.push(r.fromStr(l).weekday):!l.n||e.freq>Pt.MONTHLY?c.push(l.weekday):d.push([l.weekday,l.n])}e.byweekday=f(c)?c:null,e.bynweekday=f(d)?d:null}else e.bynweekday=null;return i(e.byhour)?o(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Pt.HOURLY?[e.dtstart.getUTCHours()]:null,i(e.byminute)?o(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Pt.MINUTELY?[e.dtstart.getUTCMinutes()]:null,i(e.bysecond)?o(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Pt.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function it(t){var e=t.split("\n").map(at).filter((function(t){return null!==t}));return W(W({},e[0]),e[1])}function ot(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=N(i),e}function at(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return st(t);var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return st(t);case"DTSTART":return ot(t);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(t))}}function st(t){var e=ot(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var i=n.split("="),o=i[0],a=i[1];switch(o.toUpperCase()){case"FREQ":e.freq=Z[a.toUpperCase()];break;case"WKST":e.wkst=Wt[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s=function(t){if(-1!==t.indexOf(",")){return t.split(",").map(ut)}return ut(t)}(a),u=o.toLowerCase();e[u]=s;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map((function(t){if(2===t.length)return Wt[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!e||e.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var n=Number(e[1]),i=e[2],o=Wt[i].weekday;return new r(o,n)}))}(a);break;case"DTSTART":case"TZID":var h=ot(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=N(a);break;case"BYEASTER":e.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+o+"'")}})),e}function ut(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var ht=function(){function t(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=R(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){return this.isUTC?this.date:function(t,e){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(A(t,n)),i=new Date(A(t,null!=e?e:"UTC")).getTime()-r.getTime();return new Date(t.getTime()-i)}(this.date,this.tzid)},t}();function yt(t){for(var e,n=[],a="",u=Object.keys(t),h=Object.keys(Ht),y=0;y<u.length;y++)if("tzid"!==u[y]&&p(h,u[y])){var c=u[y].toUpperCase(),d=t[u[y]],l="";if(i(d)&&(!s(d)||d.length)){switch(c){case"FREQ":l=Pt.FREQUENCIES[t.freq];break;case"WKST":l=o(d)?new r(d).toString():d.toString();break;case"BYWEEKDAY":c="BYDAY",l=(e=d,s(e)?e:[e]).map((function(t){return t instanceof r?t:s(t)?new r(t[0],t[1]):new r(t)})).toString();break;case"DTSTART":a=ct(d,t.tzid);break;case"UNTIL":l=R(d,!t.tzid);break;default:if(s(d)){for(var f=[],b=0;b<d.length;b++)f[b]=String(d[b]);l=f.toString()}else l=String(d)}l&&n.push([c,l])}}var m=n.map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n.toString())})).join(";"),w="";return""!==m&&(w="RRULE:".concat(m)),[a,w].filter((function(t){return!!t})).join("\n")}function ct(t,e){return t?"DTSTART"+new ht(new Date(t),e).toString():""}function dt(t,e){return Array.isArray(t)?!!Array.isArray(e)&&(t.length===e.length&&t.every((function(t,n){return t.getTime()===e[n].getTime()}))):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var lt=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?L(e):M(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,e){var n=!1,r=e?Object.keys(e):[],i=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(!dt(e[i],t[i]))return!0}return!1},o=this[t];if("all"===t)n=this.all;else if(s(o))for(var a=0;a<o.length;a++){var u=o[a];if(!r.length||!i(u)){n=u._value;break}}if(!n&&this.all){var h=new C(t,e);for(a=0;a<this.all.length&&h.accept(this.all[a]);a++);n=h.getValue(),this._cacheAdd(t,n,e)}return s(n)?M(n):n instanceof Date?L(n):n},t}(),ft=H(H(H(H(H(H(H(H(H(H(H(H(H([],h(1,31),!0),h(2,28),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),pt=H(H(H(H(H(H(H(H(H(H(H(H(H([],h(1,31),!0),h(2,29),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),bt=u(1,29),mt=u(1,30),wt=u(1,31),vt=u(1,32),gt=H(H(H(H(H(H(H(H(H(H(H(H(H([],vt,!0),mt,!0),vt,!0),wt,!0),vt,!0),wt,!0),vt,!0),vt,!0),wt,!0),vt,!0),wt,!0),vt,!0),vt.slice(0,7),!0),kt=H(H(H(H(H(H(H(H(H(H(H(H(H([],vt,!0),bt,!0),vt,!0),wt,!0),vt,!0),wt,!0),vt,!0),vt,!0),wt,!0),vt,!0),wt,!0),vt,!0),vt.slice(0,7),!0),Et=u(-28,0),Tt=u(-29,0),xt=u(-30,0),Dt=u(-31,0),Ot=H(H(H(H(H(H(H(H(H(H(H(H(H([],Dt,!0),Tt,!0),Dt,!0),xt,!0),Dt,!0),xt,!0),Dt,!0),Dt,!0),xt,!0),Dt,!0),xt,!0),Dt,!0),Dt.slice(0,7),!0),St=H(H(H(H(H(H(H(H(H(H(H(H(H([],Dt,!0),Et,!0),Dt,!0),xt,!0),Dt,!0),xt,!0),Dt,!0),Dt,!0),xt,!0),Dt,!0),xt,!0),Dt,!0),Dt.slice(0,7),!0),Ut=[0,31,60,91,121,152,182,213,244,274,305,335,366],Yt=[0,31,59,90,120,151,181,212,243,273,304,334,365],Lt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(u(7));return t}();function Mt(t,e){var n,r,i=b(t,1,1),o=k(t)?366:365,a=k(t+1)?366:365,s=x(i),u=S(i),y=W(W({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:u},function(t){var e=k(t)?366:365,n=b(t,1,1),r=S(n);if(365===e)return{mmask:ft,mdaymask:kt,nmdaymask:St,wdaymask:Lt.slice(r),mrange:Yt};return{mmask:pt,mdaymask:gt,nmdaymask:Ot,wdaymask:Lt.slice(r),mrange:Ut}}(t)),{wnomask:null});if(l(e.byweekno))return y;y.wnomask=h(0,o+7);var d=n=c(7-u+e.wkst,7);d>=4?(d=0,r=y.yearlen+c(u-e.wkst,7)):r=o-d;for(var f=Math.floor(r/7),m=c(r,7),w=Math.floor(f+m/4),v=0;v<e.byweekno.length;v++){var g=e.byweekno[v];if(g<0&&(g+=w+1),g>0&&g<=w){var E=void 0;g>1?(E=d+7*(g-1),d!==n&&(E-=7-n)):E=d;for(var T=0;T<7&&(y.wnomask[E]=1,E++,y.wdaymask[E]!==e.wkst);T++);}}if(p(e.byweekno,1)){E=d+7*w;if(d!==n&&(E-=7-n),E<o)for(v=0;v<7&&(y.wnomask[E]=1,E+=1,y.wdaymask[E]!==e.wkst);v++);}if(d){var D=void 0;if(p(e.byweekno,-1))D=-1;else{var O=S(b(t-1,1,1)),U=c(7-O.valueOf()+e.wkst,7),Y=k(t-1)?366:365,L=void 0;U>=4?(U=0,L=Y+c(O-e.wkst,7)):L=o-d,D=Math.floor(52+c(L,7)/4)}if(p(e.byweekno,D))for(E=0;E<d;E++)y.wnomask[E]=1}return y}const _t=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=Mt(t,n)),f(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,o=r.yearlen,a=r.mrange,s=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===Pt.YEARLY)if(l(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===Pt.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(l(s))return a;for(a.nwdaymask=h(0,n),u=0;u<s.length;u++)for(var y=s[u],d=y[0],f=y[1]-1,p=0;p<o.bynweekday.length;p++){var b=void 0,m=o.bynweekday[p],w=m[0],v=m[1];v<0?(b=f+7*(v+1),b-=c(i[b]-w,7)):(b=d+7*(v-1),b+=c(7-i[b]+w,7)),d<=b&&b<=f&&(a.nwdaymask[b]=1)}return a}(t,e,o,a,s,n)}i(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-o-u+15)%30,y=Math.floor(i/4),c=i%4,d=Math.floor(32+2*a+2*y-h-c)%7,l=Math.floor((n+11*h+22*d)/451),f=Math.floor((h+d-7*l+114)/31),p=(h+d-7*l+114)%31+1,b=Date.UTC(t,f-1,p+e),m=Date.UTC(t,0,1);return[Math.ceil((b-m)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[u(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e){for(var n=this.mrange[e-1],r=this.mrange[e],i=h(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},t.prototype.wdayset=function(t,e,n){for(var r=h(null,this.yearlen+7),i=x(b(t,e,n))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=h(null,this.yearlen),i=x(b(t,e,n))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(t,e,n,r){var i=this,o=[];return this.options.byminute.forEach((function(e){o=o.concat(i.mtimeset(t,e,n,r))})),_(o),o},t.prototype.mtimeset=function(t,e,n,r){var i=this.options.bysecond.map((function(n){return new tt(t,e,n,r)}));return _(i),i},t.prototype.stimeset=function(t,e,n,r){return[new tt(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case Z.YEARLY:return this.ydayset.bind(this);case Z.MONTHLY:return this.mdayset.bind(this);case Z.WEEKLY:return this.wdayset.bind(this);case Z.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case Z.HOURLY:return this.htimeset.bind(this);case Z.MINUTELY:return this.mtimeset.bind(this);case Z.SECONDLY:return this.stimeset.bind(this)}},t}();function Rt(t,e,n,r,o,a){for(var s=[],u=0;u<t.length;u++){var h=void 0,y=void 0,d=t[u];d<0?(h=Math.floor(d/e.length),y=c(d,e.length)):(h=Math.floor((d-1)/e.length),y=c(d-1,e.length));for(var l=[],f=n;f<r;f++){var b=a[f];i(b)&&l.push(b)}var m=void 0;m=h<0?l.slice(h)[0]:l[h];var w=e[y],v=D(o.yearordinal+m),g=Y(v,w);p(s,g)||s.push(g)}return _(s),s}function Nt(t,e){var n=e.dtstart,r=e.freq,o=e.interval,a=e.until,s=e.bysetpos,u=e.count;if(0===u||0===o)return It(t);var h=et.fromDate(n),y=new _t(e);y.rebuild(h.year,h.month);for(var c=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if(Q(r))return function(t){var e=t.dtstart.getTime()%1e3;if(!Q(t.freq))return[];var n=[];return t.byhour.forEach((function(r){t.byminute.forEach((function(i){t.bysecond.forEach((function(t){n.push(new tt(r,i,t,e))}))}))})),n}(n);if(r>=Pt.HOURLY&&f(i)&&!p(i,e.hour)||r>=Pt.MINUTELY&&f(o)&&!p(o,e.minute)||r>=Pt.SECONDLY&&f(a)&&!p(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(y,h,e);;){var d=y.getdayset(r)(h.year,h.month,h.day),l=d[0],b=d[1],m=d[2],w=jt(l,b,m,y,e);if(f(s))for(var v=Rt(s,c,b,m,y,l),g=0;g<v.length;g++){var k=v[g];if(a&&k>a)return It(t);if(k>=n){var E=Ct(k,e);if(!t.accept(E))return It(t);if(u&&!--u)return It(t)}}else for(g=b;g<m;g++){var T=l[g];if(i(T))for(var x=D(y.yearordinal+T),O=0;O<c.length;O++){var S=c[O];k=Y(x,S);if(a&&k>a)return It(t);if(k>=n){E=Ct(k,e);if(!t.accept(E))return It(t);if(u&&!--u)return It(t)}}}if(0===e.interval)return It(t);if(h.add(e,w),h.year>9999)return It(t);Q(r)||(c=y.gettimeset(r)(h.hour,h.minute,h.second,0)),y.rebuild(h.year,h.month)}}function At(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,u=n.bynmonthday,h=n.byyearday;return f(r)&&!p(r,t.mmask[e])||f(i)&&!t.wnomask[e]||f(o)&&!p(o,t.wdaymask[e])||f(t.nwdaymask)&&!t.nwdaymask[e]||null!==a&&!p(t.eastermask,e)||(f(s)||f(u))&&!p(s,t.mdaymask[e])&&!p(u,t.nmdaymask[e])||f(h)&&(e<t.yearlen&&!p(h,e+1)&&!p(h,-t.yearlen+e)||e>=t.yearlen&&!p(h,e+1-t.yearlen)&&!p(h,-t.nextyearlen+e-t.yearlen))}function Ct(t,e){return new ht(t,e.tzid).rezonedDate()}function It(t){return t.getValue()}function jt(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var s=t[a];(o=At(r,s,i))&&(t[s]=null)}return o}var Wt={MO:new r(0),TU:new r(1),WE:new r(2),TH:new r(3),FR:new r(4),SA:new r(5),SU:new r(6)},Ht={freq:Z.YEARLY,dtstart:null,interval:1,wkst:Wt.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},qt=Object.keys(Ht),Pt=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new lt,this.origOptions=nt(t);var n=rt(t).parsedOptions;this.options=n}return t.parseText=function(t,e){return G(t,e)},t.fromText=function(t,e){return $(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(t){return Nt(t,this.options)},t.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},t.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},t.prototype.all=function(t){if(t)return this._iter(new q("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new C("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!T(t)||!T(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 q("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new C("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){if(void 0===e&&(e=!1),!T(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},t.prototype.after=function(t,e){if(void 0===e&&(e=!1),!T(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},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return yt(this.origOptions)},t.prototype.toText=function(t,e,n){return function(t,e,n,r){return new B(t,e,n,r).toString()}(this,t,e,n)},t.prototype.isFullyConvertibleToText=function(){return V(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=Z.YEARLY,t.MONTHLY=Z.MONTHLY,t.WEEKLY=Z.WEEKLY,t.DAILY=Z.DAILY,t.HOURLY=Z.HOURLY,t.MINUTELY=Z.MINUTELY,t.SECONDLY=Z.SECONDLY,t.MO=Wt.MO,t.TU=Wt.TU,t.WE=Wt.WE,t.TH=Wt.TH,t.FR=Wt.FR,t.SA=Wt.SA,t.SU=Wt.SU,t.parseString=it,t.optionsToString=yt,t}();var Ft={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function zt(t,e){var n=[],r=[],i=[],o=[],a=ot(t),s=a.dtstart,u=a.tzid,h=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?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold);return h.forEach((function(t){var e;if(t){var a=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=(i=t,o=":",a=1,s=i.split(o),a?s.slice(0,a).concat([s.slice(a).join(o)]):s),n=e[0],r=e[1];var i,o,a,s;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),s=a.name,h=a.parms,y=a.value;switch(s.toUpperCase()){case"RRULE":if(h.length)throw new Error("unsupported RRULE parm: ".concat(h.join(",")));n.push(it(t));break;case"RDATE":var c=(null!==(e=/RDATE(?:;TZID=([^:=]+))?/i.exec(t))&&void 0!==e?e:[])[1];c&&!u&&(u=c),r=r.concat(Zt(y,h));break;case"EXRULE":if(h.length)throw new Error("unsupported EXRULE parm: ".concat(h.join(",")));i.push(it(y));break;case"EXDATE":o=o.concat(Zt(y,h));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:u,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Kt(t,e){return void 0===e&&(e={}),function(t,e){var n=zt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var y=new Gt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach((function(t){y.rrule(new Pt(Bt(t,s,u),h))})),i.forEach((function(t){y.rdate(t)})),o.forEach((function(t){y.exrule(new Pt(Bt(t,s,u),h))})),a.forEach((function(t){y.exdate(t)})),e.compatible&&e.dtstart&&y.rdate(s),y}var c=r[0]||{};return new Pt(Bt(c,c.dtstart||e.dtstart||s,c.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(Ft);if(n.forEach((function(t){p(r,t)||e.push(t)})),e.length)throw new Error("Invalid options: "+e.join(", "));return W(W({},Ft),t)}(e))}function Bt(t,e,n){return W(W({},t),{dtstart:e,tzid:n})}function Zt(t,e){return function(t){t.forEach((function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}))}(e),t.split(",").map((function(t){return N(t)}))}function Xt(t){var e=this;return function(n){if(void 0!==n&&(e["_".concat(t)]=n),void 0!==e["_".concat(t)])return e["_".concat(t)];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var Gt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n.dtstart=Xt.apply(n,["dtstart"]),n.tzid=Xt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return j(e,t),e.prototype._iter=function(t){return function(t,e,n,r,i,o){var a={},s=t.accept;function u(t,e){n.forEach((function(n){n.between(t,e,!0).forEach((function(t){a[Number(t)]=!0}))}))}i.forEach((function(t){var e=new ht(t,o).rezonedDate();a[Number(e)]=!0})),t.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===t.method&&(u(t.args.after,t.args.before),t.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var h=0;h<r.length;h++){var y=new ht(r[h],o).rezonedDate();if(!t.accept(new Date(y.getTime())))break}e.forEach((function(e){Nt(t,e.options)}));var c=t._result;switch(_(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;default:return c.length&&c[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){Qt(t,this._rrule)},e.prototype.exrule=function(t){Qt(t,this._exrule)},e.prototype.rdate=function(t){$t(t,this._rdate)},e.prototype.exdate=function(t){$t(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map((function(t){return Kt(t.toString())}))},e.prototype.exrules=function(){return this._exrule.map((function(t){return Kt(t.toString())}))},e.prototype.rdates=function(){return this._rdate.map((function(t){return new Date(t.getTime())}))},e.prototype.exdates=function(){return this._exdate.map((function(t){return new Date(t.getTime())}))},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(yt({dtstart:this._dtstart}))),this._rrule.forEach((function(e){t=t.concat(e.toString().split("\n"))})),this._exrule.forEach((function(e){t=t.concat(e.toString().split("\n").map((function(t){return t.replace(/^RRULE:/,"EXRULE:")})).filter((function(t){return!/^DTSTART/.test(t)})))})),this._rdate.length&&t.push(Jt("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Jt("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach((function(e){return t.rrule(e.clone())})),this._exrule.forEach((function(e){return t.exrule(e.clone())})),this._rdate.forEach((function(e){return t.rdate(new Date(e.getTime()))})),this._exdate.forEach((function(e){return t.exdate(new Date(e.getTime()))})),t},e}(Pt);function Qt(t,e){if(!(t instanceof Pt))throw new TypeError(String(t)+" is not RRule instance");p(e.map(String),String(t))||e.push(t)}function $t(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");p(e.map(Number),Number(t))||(e.push(t),_(e))}function Jt(t,e,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(t,":"):"".concat(t,";TZID=").concat(n,":"),o=e.map((function(t){return R(t.valueOf(),r)})).join(",");return"".concat(i).concat(o)}return e})()));
//# sourceMappingURL=rrule.min.js.map

@@ -62,4 +62,4 @@ import { padStart } from './helpers';

// Convert both dates to milliseconds
var date1ms = date1.getTime() - tzOffset(date1);
var date2ms = date2.getTime() - tzOffset(date2);
var date1ms = date1.getTime();
var date2ms = date2.getTime();
// Calculate the difference in milliseconds

@@ -66,0 +66,0 @@ var differencems = date1ms - date2ms;

@@ -5,5 +5,5 @@ export { RRule } from './rrule';

export { Frequency, ByWeekday, Options } from './types';
export { Weekday, WeekdayStr } from './weekday';
export { Weekday, WeekdayStr, ALL_WEEKDAYS } from './weekday';
export { RRuleStrOptions } from './rrulestr';
export { datetime } from './dateutil';
//# sourceMappingURL=index.d.ts.map

@@ -20,4 +20,4 @@ /* !

export { Frequency } from './types';
export { Weekday } from './weekday';
export { Weekday, ALL_WEEKDAYS } from './weekday';
export { datetime } from './dateutil';
//# sourceMappingURL=index.js.map

@@ -107,2 +107,3 @@ import ENGLISH from './i18n';

ttr.nextSymbol();
AT();
F();

@@ -114,2 +115,3 @@ break;

ON();
AT();
F();

@@ -171,2 +173,3 @@ }

}
AT();
MDAYs();

@@ -173,0 +176,0 @@ F();

@@ -99,3 +99,3 @@ import ENGLISH from './i18n';

for (var key in rrule.origOptions) {
if (contains(['dtstart', 'wkst', 'freq'], key))
if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))
return true;

@@ -211,2 +211,5 @@ if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))

}
if (this.origOptions.byhour) {
this._byhour();
}
}

@@ -213,0 +216,0 @@ };

{
"name": "rrule",
"version": "2.7.2",
"version": "2.8.0",
"description": "JavaScript library for working with recurrence rules for calendar dates.",

@@ -24,2 +24,3 @@ "homepage": "http://jakubroztocil.github.io/rrule/",

"prebuild": "yarn clean",
"prepublish": "yarn build",
"build": "yarn lint && yarn format-check && tsc -b tsconfig.build.json && webpack && tsc dist/esm/**/*.d.ts",

@@ -31,4 +32,4 @@ "clean": "rm -rf dist/",

"run-ts": "TS_NODE_PROJECT=tsconfig.json node --loader ts-node/esm",
"test": "yarn run-ts ./node_modules/.bin/mocha **/*.test.ts",
"test-ci": "yarn run-ts ./node_modules/.bin/nyc yarn run-ts ./node_modules/.bin/mocha **/*.test.ts"
"test": "jest **/*.test.ts",
"test-ci": "yarn run-ts ./node_modules/.bin/nyc jest **/*.test.ts"
},

@@ -56,4 +57,3 @@ "nyc": {

"@types/assert": "^1.4.3",
"@types/chai": "^4.2.7",
"@types/mocha": "^9.1.1",
"@types/jest": "^29.5.8",
"@types/mockdate": "^3.0.0",

@@ -63,3 +63,2 @@ "@types/node": "^17.0.41",

"@typescript-eslint/parser": "^5.27.1",
"chai": "^4.2.0",
"coverage": "^0.4.1",

@@ -72,4 +71,4 @@ "eslint": "^8.17.0",

"husky": "^8.0.1",
"jest": "^29.7.0",
"lint-staged": "^13.0.1",
"mocha": "^10.0.0",
"mockdate": "^3.0.5",

@@ -81,5 +80,7 @@ "nyc": "^15.1.0",

"terser-webpack-plugin": "^5.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.3.0",
"ts-node": "^10.8.1",
"typescript": "^4.7.3",
"unminified-webpack-plugin": "^3.0.0",
"webpack": "^5.73.0",

@@ -86,0 +87,0 @@ "webpack-cli": "^4.9.2"

@@ -10,3 +10,3 @@ # rrule.js

[![Gitter][gitter-image]][gitter-url]
[![codecov.io](http://codecov.io/github/jakubroztocil/rrule/coverage.svg?branch=master)](http://codecov.io/github/jakubroztocil/rrule?branch=master)
[![codecov.io](http://codecov.io/github/jkbrzt/rrule/coverage.svg?branch=master)](http://codecov.io/github/jkbrzt/rrule?branch=master)

@@ -25,3 +25,3 @@ rrule.js supports recurrence rules as defined in the [iCalendar

- [Demo app](http://jakubroztocil.github.io/rrule/)
- [Demo app](http://jkbrzt.github.io/rrule/)
- # For contributors and maintainers: the code for the demo app is only on `gh-pages` branch

@@ -37,4 +37,4 @@

- [rrule.min.js](https://jakubroztocil.github.io/rrule/dist/es5/rrule.min.js) (bundled, minified)
- [rrule.js](https://jakubroztocil.github.io/rrule/dist/es5/rrule.js) (bundled, not minified)
- [rrule.min.js](https://jkbrzt.github.io/rrule/dist/es5/rrule.min.js) (bundled, minified)
- [rrule.js](https://jkbrzt.github.io/rrule/dist/es5/rrule.js) (bundled, not minified)

@@ -826,3 +826,3 @@ ```html

- [Jakub Roztocil](http://roztocil.co)
([@jakubroztocil](http://twitter.com/jakubroztocil))
([@jkbrzt](http://twitter.com/jkbrzt))
- Lars Schöning ([@lyschoening](http://twitter.com/lyschoening))

@@ -834,3 +834,3 @@ - David Golightly ([@davigoli](http://twitter.com/davigoli))

See [LICENCE](https://github.com/jakubroztocil/rrule/blob/master/LICENCE) for
See [LICENCE](https://github.com/jkbrzt/rrule/blob/master/LICENCE) for
more details.

@@ -840,4 +840,4 @@

[npm-image]: http://img.shields.io/npm/v/rrule.svg
[ci-url]: https://github.com/jakubroztocil/rrule/actions
[ci-image]: https://github.com/jakubroztocil/rrule/workflows/Node%20CI/badge.svg
[ci-url]: https://github.com/jkbrzt/rrule/actions
[ci-image]: https://github.com/jkbrzt/rrule/workflows/Node%20CI/badge.svg
[downloads-url]: https://npmjs.org/package/rrule

@@ -844,0 +844,0 @@ [downloads-image]: http://img.shields.io/npm/dm/rrule.svg?style=flat-square

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc