Build 589089stable
Module 902537
44,823 characters · in 29609.b896f2d9d6398168.jsDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{p3:()=>eR,Bw:()=>a});var r,o,i=["MO","TU","WE","TH","FR","SA","SU"],a=function(){function e(e,t){if(0===t)throw Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return e.fromStr=function(t){return new e(i.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},e.prototype.toString=function(){var e=i[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},e.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},e}(),u=function(e){return null!=e},s=function(e){return"number"==typeof e},l=function(e){return"string"==typeof e&&i.includes(e)},c=Array.isArray,f=function(e,t){void 0===t&&(t=e),1==arguments.length&&(t=e,e=0);for(var n=[],r=e;r<t;r++)n.push(r);return n},d=function(e,t){var n=0,r=[];if(c(e))for(;n<t;n++)r[n]=[].concat(e);else for(;n<t;n++)r[n]=e;return r};function h(e,t,n){void 0===n&&(n=" ");var r=String(e);return(t|=0,r.length>t)?String(r):((t-=r.length)>n.length&&(n+=d(n,t/n.length)),n.slice(0,t)+String(r))}var p=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},m=function(e,t){var n=e%t;return n*t<0?n+t:n},v=function(e,t){return{div:Math.floor(e/t),mod:m(e,t)}},y=function(e){return!u(e)||0===e.length},g=function(e){return!y(e)},b=function(e,t){return g(e)&&-1!==e.indexOf(t)},w=function(e,t,n,r,o,i){return void 0===r&&(r=0),void 0===o&&(o=0),void 0===i&&(i=0),new Date(Date.UTC(e,t-1,n,r,o,i))},_=[31,28,31,30,31,30,31,31,30,31,30,31],D=w(1970,1,1),k=[6,0,1,2,3,4,5],E=function(e){return e%4==0&&e%100!=0||e%400==0},x=function(e){return e instanceof Date},C=function(e){return x(e)&&!isNaN(e.getTime())},S=function(e){return 60*e.getTimezoneOffset()*1e3},A=function(e){var t,n;return t=e,n=D,Math.round((t.getTime()-S(t)-(n.getTime()-S(n)))/864e5)},O=function(e){return new Date(D.getTime()+864e5*e)},B=function(e){var t=e.getUTCMonth();return 1===t&&E(e.getUTCFullYear())?29:_[t]},T=function(e){return k[e.getUTCDay()]},F=function(e,t){var n=w(e,t+1,1);return[T(n),B(n)]},P=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},z=function(e){return new Date(e.getTime())},R=function(e){for(var t=[],n=0;n<e.length;n++)t.push(z(e[n]));return t},M=function(e){e.sort(function(e,t){return e.getTime()-t.getTime()})},N=function(e,t){void 0===t&&(t=!0);var n=new Date(e);return[h(n.getUTCFullYear().toString(),4,"0"),h(n.getUTCMonth()+1,2,"0"),h(n.getUTCDate(),2,"0"),"T",h(n.getUTCHours(),2,"0"),h(n.getUTCMinutes(),2,"0"),h(n.getUTCSeconds(),2,"0"),t?"Z":""].join("")},j=function(e){var t=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!t)throw Error("Invalid UNTIL value: ".concat(e));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},L=function(e,t){return e.toLocaleString("sv-SE",{timeZone:t}).replace(" ","T")+"Z"},I=function(e,t){var n=new Date(L(e,Intl.DateTimeFormat().resolvedOptions().timeZone)),r=new Date(L(e,null!=t?t:"UTC")).getTime()-n.getTime();return new Date(e.getTime()-r)},U=function(){function e(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,"between"===e?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):"before"===e?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):"after"===e&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return e.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if("between"===this.method){if(t)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!t||(this.add(e),!1);return this.add(e)},e.prototype.add=function(e){return this._result.push(e),!0},e.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;default:return e.length?e[e.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Y=n(56636),$=function(e){function t(t,n,r){var o=e.call(this,t,n)||this;return o.iterator=r,o}return(0,Y.C6)(t,e),t.prototype.add=function(e){return!!this.iterator(e,this._result.length)&&(this._result.push(e),!0)},t}(U);let W={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(e,t){return -1!==e.indexOf(t)},H=function(e){return e.toString()},q=function(e,t,n){return"".concat(t," ").concat(n,", ").concat(e)},V=function(){function e(e,t,n,r){if(void 0===t&&(t=H),void 0===n&&(n=W),void 0===r&&(r=q),this.text=[],this.language=n||W,this.gettext=t,this.dateFormatter=r,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),i=[].concat(this.options.bynmonthday);o.sort(function(e,t){return e-t}),i.sort(function(e,t){return t-e}),this.bymonthday=o.concat(i),this.bymonthday.length||(this.bymonthday=null)}if(u(this.origOptions.byweekday)){var a=c(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],s=String(a);this.byweekday={allWeeks:a.filter(function(e){return!e.n}),someWeeks:a.filter(function(e){return!!e.n}),isWeekdays:-1!==s.indexOf("MO")&&-1!==s.indexOf("TU")&&-1!==s.indexOf("WE")&&-1!==s.indexOf("TH")&&-1!==s.indexOf("FR")&&-1===s.indexOf("SA")&&-1===s.indexOf("SU"),isEveryDay:-1!==s.indexOf("MO")&&-1!==s.indexOf("TU")&&-1!==s.indexOf("WE")&&-1!==s.indexOf("TH")&&-1!==s.indexOf("FR")&&-1!==s.indexOf("SA")&&-1!==s.indexOf("SU")};var l=function(e,t){return e.weekday-t.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){if(!(t.options.freq in e.IMPLEMENTED)||t.origOptions.until&&t.origOptions.count)return!1;for(var n in t.origOptions){if(Z(["dtstart","wkst","freq"],n))break;if(!Z(e.IMPLEMENTED[t.options.freq],n))return!1}return!0},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[eR.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("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(t("for")).add(this.options.count.toString()).add(t(this.plural(this.options.count)?"times":"time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(e(this.plural(this.options.interval)?"hours":"hour"))},e.prototype.MINUTELY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(e(this.plural(this.options.interval)?"minutes":"minute"))},e.prototype.DAILY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(e(this.plural(this.options.interval)?"weekdays":"weekday")):this.add(e(this.plural(this.options.interval)?"days":"day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(e(this.plural(this.options.interval)?"weeks":"week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(e(this.plural(this.options.interval)?"weekdays":"weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(e(this.plural(this.options.interval)?"days":"day")):(1===this.options.interval&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},e.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(e(this.plural(this.options.interval)?"months":"month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(e(this.plural(this.options.interval)?"years":"year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(e(this.plural(this.options.byweekno.length)?"weeks":"week")).add(this.list(this.options.byweekno,void 0,e("and")))},e.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},e.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},e.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(-1===e)return n("last");var r=Math.abs(e);switch(r){case 1:case 21:case 31:t=r+n("st");break;case 2:case 22:t=r+n("nd");break;case 3:case 23:t=r+n("rd");break;default:t=r+n("th")}return e<0?t+" "+n("last"):t},e.prototype.monthtext=function(e){return this.language.monthNames[e-1]},e.prototype.weekdaytext=function(e){var t=s(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},e.prototype.plural=function(e){return e%100!=1},e.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},e.prototype.list=function(e,t,n,r){var o=this;void 0===r&&(r=","),c(e)||(e=[e]),t=t||function(e){return e.toString()};var i=function(e){return t&&t.call(o,e)};if(!n)return e.map(i).join(r+" ");for(var a=e.map(i),u=r,s="",l=0;l<a.length;l++)0!==l&&(l===a.length-1?s+=" "+n+" ":s+=u+" "),s+=a[l];return s},e}(),K=function(){function e(e){this.done=!0,this.rules=e}return e.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},e.prototype.isDone=function(){return this.done&&null===this.symbol},e.prototype.nextSymbol=function(){this.symbol=null,this.value=null;do{if(this.done)return!1;for(var e in t=null,this.rules){var t,n,r=this.rules[e].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,n=e)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t){this.done=!0,this.symbol=null,this.value=null;return}}while("SKIP"===n);return this.symbol=n,this.value=t,!0},e.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(e){if(this.accept(e))return!0;throw Error("expected "+e+" but found "+this.symbol)},e}();function Q(e,t){void 0===t&&(t=W);var n={},r=new K(t.tokens);if(!r.start(e))return null;return function(){r.expect("every");var e=r.acceptNumber();if(e&&(n.interval=parseInt(e[0],10)),r.isDone())throw Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=eR.DAILY,r.nextSymbol()&&(function(){if(r.accept("at"))do{var e=r.acceptNumber();if(!e)throw Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(e[0],10)];r.accept("comma");){if(!(e=r.acceptNumber()))throw Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(e[0],10))}}while(r.accept("comma")||r.accept("at"))}(),s());break;case"weekday(s)":n.freq=eR.WEEKLY,n.byweekday=[eR.MO,eR.TU,eR.WE,eR.TH,eR.FR],r.nextSymbol(),s();break;case"week(s)":n.freq=eR.WEEKLY,r.nextSymbol()&&(o(),s());break;case"hour(s)":n.freq=eR.HOURLY,r.nextSymbol()&&(o(),s());break;case"minute(s)":n.freq=eR.MINUTELY,r.nextSymbol()&&(o(),s());break;case"month(s)":n.freq=eR.MONTHLY,r.nextSymbol()&&(o(),s());break;case"year(s)":n.freq=eR.YEARLY,r.nextSymbol()&&(o(),s());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":if(n.freq=eR.WEEKLY,n.byweekday=[eR[r.symbol.substr(0,2).toUpperCase()]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw Error("Unexpected end");var t=a();if(!t)throw Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(eR[t]),r.nextSymbol()}(function(){r.accept("on"),r.accept("the");var e=u();if(e)for(n.bymonthday=[e],r.nextSymbol();r.accept("comma");){if(!(e=u()))throw Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(e),r.nextSymbol()}})(),s();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=eR.YEARLY,n.bymonth=[i()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw Error("Unexpected end");var l=i();if(!l)throw Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(l),r.nextSymbol()}o(),s();break;default:throw Error("Unknown symbol")}}(),n;function o(){var e=r.accept("on"),t=r.accept("the");if(e||t)do{var o=u(),s=a(),l=i();if(o)s?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(eR[s].nth(o))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(o),r.accept("day(s)"));else if(s)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(eR[s]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[eR.MO,eR.TU,eR.WE,eR.TH,eR.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var c=r.acceptNumber();if(!c)throw Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(c[0],10)];r.accept("comma");){if(!(c=r.acceptNumber()))throw Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(c[0],10))}}else{if(!l)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(l)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function i(){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 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 e=parseInt(r.value[1],10);if(e<-366||e>366)throw Error("Nth out of range: "+e);return r.nextSymbol(),r.accept("last")?-e:e;default:return!1}}function s(){if("until"===r.symbol){var e=Date.parse(r.text);if(!e)throw Error("Cannot parse until date:"+r.text);n.until=new Date(e)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function X(e){return e<o.HOURLY}(r=o||(o={}))[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY";var G=["count","until","interval","byweekday","bymonthday","bymonth"];V.IMPLEMENTED=[],V.IMPLEMENTED[o.HOURLY]=G,V.IMPLEMENTED[o.MINUTELY]=G,V.IMPLEMENTED[o.DAILY]=["byhour"].concat(G),V.IMPLEMENTED[o.WEEKLY]=G,V.IMPLEMENTED[o.MONTHLY]=G,V.IMPLEMENTED[o.YEARLY]=["byweekno","byyearday"].concat(G);var J=V.isFullyConvertible,ee=function(){function e(e,t,n,r){this.hour=e,this.minute=t,this.second=n,this.millisecond=r||0}return e.prototype.getHours=function(){return this.hour},e.prototype.getMinutes=function(){return this.minute},e.prototype.getSeconds=function(){return this.second},e.prototype.getMilliseconds=function(){return this.millisecond},e.prototype.getTime=function(){return(60*this.hour*60+60*this.minute+this.second)*1e3+this.millisecond},e}(),et=function(e){function t(t,n,r,o,i,a,u){var s=e.call(this,o,i,a,u)||this;return s.year=t,s.month=n,s.day=r,s}return(0,Y.C6)(t,e),t.fromDate=function(e){return new this(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.valueOf()%1e3)},t.prototype.getWeekday=function(){return T(new Date(this.getTime()))},t.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},t.prototype.getDay=function(){return this.day},t.prototype.getMonth=function(){return this.month},t.prototype.getYear=function(){return this.year},t.prototype.addYears=function(e){this.year+=e},t.prototype.addMonths=function(e){if(this.month+=e,this.month>12){var t=Math.floor(this.month/12),n=m(this.month,12);this.month=n,this.year+=t,0===this.month&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(e,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+7*e:this.day+=-(this.getWeekday()-t)+7*e,this.fixDay()},t.prototype.addDaily=function(e){this.day+=e,this.fixDay()},t.prototype.addHours=function(e,t,n){for(t&&(this.hour+=Math.floor((23-this.hour)/e)*e);;){this.hour+=e;var r=v(this.hour,24),o=r.div,i=r.mod;if(o&&(this.hour=i,this.addDaily(o)),y(n)||b(n,this.hour))break}},t.prototype.addMinutes=function(e,t,n,r){for(t&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/e)*e);;){this.minute+=e;var o=v(this.minute,60),i=o.div,a=o.mod;if(i&&(this.minute=a,this.addHours(i,!1,n)),(y(n)||b(n,this.hour))&&(y(r)||b(r,this.minute)))break}},t.prototype.addSeconds=function(e,t,n,r,o){for(t&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/e)*e);;){this.second+=e;var i=v(this.second,60),a=i.div,u=i.mod;if(a&&(this.second=u,this.addMinutes(a,!1,n,r)),(y(n)||b(n,this.hour))&&(y(r)||b(r,this.minute))&&(y(o)||b(o,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var e=F(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,13===this.month&&(this.month=1,++this.year,this.year>9999))return;e=F(this.year,this.month-1)[1]}}},t.prototype.add=function(e,t){var n=e.freq,r=e.interval,i=e.wkst,a=e.byhour,u=e.byminute,s=e.bysecond;switch(n){case o.YEARLY:return this.addYears(r);case o.MONTHLY:return this.addMonths(r);case o.WEEKLY:return this.addWeekly(r,i);case o.DAILY:return this.addDaily(r);case o.HOURLY:return this.addHours(r,t,a);case o.MINUTELY:return this.addMinutes(r,t,a,u);case o.SECONDLY:return this.addSeconds(r,t,a,u,s)}},t}(ee);function en(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++){var o=n[r];b(ez,o)||t.push(o),x(e[o])&&!C(e[o])&&t.push(o)}if(t.length)throw Error("Invalid options: "+t.join(", "));return(0,Y.Cl)({},e)}function er(e){var t=e.split("\n").map(ei).filter(function(e){return null!==e});return(0,Y.Cl)((0,Y.Cl)({},t[0]),t[1])}function eo(e){var t={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(e);if(!n)return t;var r=n[1],o=n[2];return r&&(t.tzid=r),t.dtstart=j(o),t}function ei(e){if(!(e=e.replace(/^\s+|\s+$/,"")).length)return null;var t=/^([A-Z]+?)[:;]/.exec(e.toUpperCase());if(!t)return ea(e);var n=t[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return ea(e);case"DTSTART":return eo(e);default:throw Error("Unsupported RFC prop ".concat(n," in ").concat(e))}}function ea(e){var t=eo(e.replace(/^RRULE:/i,""));return e.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(n){var r=n.split("="),i=r[0],u=r[1];switch(i.toUpperCase()){case"FREQ":t.freq=o[u.toUpperCase()];break;case"WKST":t.wkst=eF[u.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s,l=-1!==(s=u).indexOf(",")?s.split(",").map(eu):eu(s);t[i.toLowerCase()]=l;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=u.split(",").map(function(e){if(2===e.length)return eF[e];var t=e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!t||t.length<3)throw SyntaxError("Invalid weekday string: ".concat(e));var n=Number(t[1]);return new a(eF[t[2]].weekday,n)});break;case"DTSTART":case"TZID":var c=eo(e);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=j(u);break;case"BYEASTER":t.byeaster=Number(u);break;default:throw Error("Unknown RRULE property '"+i+"'")}}),t}function eu(e){return/^[+-]?\d+$/.test(e)?Number(e):e}var es=function(){function e(e,t){if(isNaN(e.getTime()))throw RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(e.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var e=N(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},e.prototype.getTime=function(){return this.date.getTime()},e.prototype.rezonedDate=function(){return this.isUTC?this.date:I(this.date,this.tzid)},e}();function el(e){for(var t=[],n="",r=Object.keys(e),o=Object.keys(eP),i=0;i<r.length;i++)if("tzid"!==r[i]&&b(o,r[i])){var l,f,d=r[i].toUpperCase(),h=e[r[i]],p="";if(!(!u(h)||c(h)&&!h.length)){switch(d){case"FREQ":p=eR.FREQUENCIES[e.freq];break;case"WKST":p=s(h)?new a(h).toString():h.toString();break;case"BYWEEKDAY":d="BYDAY",p=(c(h)?h:[h]).map(function(e){return e instanceof a?e:c(e)?new a(e[0],e[1]):new a(e)}).toString();break;case"DTSTART":l=h,f=e.tzid,n=l?"DTSTART"+new es(new Date(l),f).toString():"";break;case"UNTIL":p=N(h,!e.tzid);break;default:if(c(h)){for(var m=[],v=0;v<h.length;v++)m[v]=String(h[v]);p=m.toString()}else p=String(h)}p&&t.push([d,p])}}var y=t.map(function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n.toString())}).join(";"),g="";return""!==y&&(g="RRULE:".concat(y)),[n,g].filter(function(e){return!!e}).join("\n")}var ec=function(){function e(){this.all=!1,this.before=[],this.after=[],this.between=[]}return e.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?z(t):R(t)),"all"===e?this.all=t:(n._value=t,this[e].push(n))},e.prototype._cacheGet=function(e,t){var n=!1,r=t?Object.keys(t):[],o=this[e];if("all"===e)n=this.all;else if(c(o))for(var i=0;i<o.length;i++){var a=o[i];if(!(r.length&&function(e){for(var n=0;n<r.length;n++){var o=r[n];if(!function(e,t){return Array.isArray(e)?!!Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return e.getTime()===t[n].getTime()}):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():e===t}(t[o],e[o]))return!0}return!1}(a))){n=a._value;break}}if(!n&&this.all){for(var u=new U(e,t),i=0;i<this.all.length&&u.accept(this.all[i]);i++);n=u.getValue(),this._cacheAdd(e,n,t)}return c(n)?R(n):n instanceof Date?z(n):n},e}(),ef=(0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)([],d(1,31),!0),d(2,28),!0),d(3,31),!0),d(4,30),!0),d(5,31),!0),d(6,30),!0),d(7,31),!0),d(8,31),!0),d(9,30),!0),d(10,31),!0),d(11,30),!0),d(12,31),!0),d(1,7),!0),ed=(0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)([],d(1,31),!0),d(2,29),!0),d(3,31),!0),d(4,30),!0),d(5,31),!0),d(6,30),!0),d(7,31),!0),d(8,31),!0),d(9,30),!0),d(10,31),!0),d(11,30),!0),d(12,31),!0),d(1,7),!0),eh=f(1,29),ep=f(1,30),em=f(1,31),ev=f(1,32),ey=(0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)([],ev,!0),ep,!0),ev,!0),em,!0),ev,!0),em,!0),ev,!0),ev,!0),em,!0),ev,!0),em,!0),ev,!0),ev.slice(0,7),!0),eg=(0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)([],ev,!0),eh,!0),ev,!0),em,!0),ev,!0),em,!0),ev,!0),ev,!0),em,!0),ev,!0),em,!0),ev,!0),ev.slice(0,7),!0),eb=f(-28,0),ew=f(-29,0),e_=f(-30,0),eD=f(-31,0),ek=(0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)([],eD,!0),ew,!0),eD,!0),e_,!0),eD,!0),e_,!0),eD,!0),eD,!0),e_,!0),eD,!0),e_,!0),eD,!0),eD.slice(0,7),!0),eE=(0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)((0,Y.fX)([],eD,!0),eb,!0),eD,!0),e_,!0),eD,!0),e_,!0),eD,!0),eD,!0),e_,!0),eD,!0),e_,!0),eD,!0),eD.slice(0,7),!0),ex=[0,31,60,91,121,152,182,213,244,274,305,335,366],eC=[0,31,59,90,120,151,181,212,243,273,304,334,365],eS=function(){for(var e=[],t=0;t<55;t++)e=e.concat(f(7));return e}(),eA=function(){function e(e){this.options=e}return e.prototype.rebuild=function(e,t){var n,r,o,i,a,s,l,c,f,h,p=this.options;if(e!==this.lastyear&&(this.yearinfo=function(e,t){var n,r,o,i,a,u=w(e,1,1),s=E(e)?366:365,l=E(e+1)?366:365,c=A(u),f=T(u),h=(0,Y.Cl)((0,Y.Cl)({yearlen:s,nextyearlen:l,yearordinal:c,yearweekday:f},(r=E(n=e)?366:365,o=T(w(n,1,1)),365===r?{mmask:ef,mdaymask:eg,nmdaymask:eE,wdaymask:eS.slice(o),mrange:eC}:{mmask:ed,mdaymask:ey,nmdaymask:ek,wdaymask:eS.slice(o),mrange:ex})),{wnomask:null});if(y(t.byweekno))return h;h.wnomask=d(0,s+7);var p=i=m(7-f+t.wkst,7);p>=4?(p=0,a=h.yearlen+m(f-t.wkst,7)):a=s-p;for(var v=Math.floor(Math.floor(a/7)+m(a,7)/4),g=0;g<t.byweekno.length;g++){var _=t.byweekno[g];if(_<0&&(_+=v+1),_>0&&_<=v){var D=void 0;_>1?(D=p+(_-1)*7,p!==i&&(D-=7-i)):D=p;for(var k=0;k<7&&(h.wnomask[D]=1,D++,h.wdaymask[D]!==t.wkst);k++);}}if(b(t.byweekno,1)){var D=p+7*v;if(p!==i&&(D-=7-i),D<s)for(var g=0;g<7&&(h.wnomask[D]=1,D+=1,h.wdaymask[D]!==t.wkst);g++);}if(p){var x=void 0;if(b(t.byweekno,-1))x=-1;else{var C=T(w(e-1,1,1)),S=m(7-C.valueOf()+t.wkst,7),O=E(e-1)?366:365,B=void 0;S>=4?(S=0,B=O+m(C-t.wkst,7)):B=s-p,x=Math.floor(52+m(B,7)/4)}if(b(t.byweekno,x))for(var D=0;D<p;D++)h.wnomask[D]=1}return h}(e,p)),g(p.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var v=this.yearinfo,_=v.yearlen,D=v.mrange,k=v.wdaymask;this.monthinfo=function(e,t,n,r,o,i){var a={lastyear:e,lastmonth:t,nwdaymask:[]},u=[];if(i.freq===eR.YEARLY)if(y(i.bymonth))u=[[0,n]];else for(var s=0;s<i.bymonth.length;s++)t=i.bymonth[s],u.push(r.slice(t-1,t+1));else i.freq===eR.MONTHLY&&(u=[r.slice(t-1,t+1)]);if(y(u))return a;a.nwdaymask=d(0,n);for(var s=0;s<u.length;s++)for(var l=u[s],c=l[0],f=l[1]-1,h=0;h<i.bynweekday.length;h++){var p=void 0,v=i.bynweekday[h],g=v[0],b=v[1];b<0?(p=f+(b+1)*7,p-=m(o[p]-g,7)):(p=c+(b-1)*7,p+=m(7-o[p]+g,7)),c<=p&&p<=f&&(a.nwdaymask[p]=1)}return a}(e,t,_,D,k,p)}u(p.byeaster)&&(this.eastermask=(void 0===(n=p.byeaster)&&(n=0),r=e%19,o=Math.floor(e/100),i=e%100,a=Math.floor(o/4),s=Math.floor((o+8)/25),l=Math.floor((o-s+1)/3),c=Math.floor(19*r+o-a-l+15)%30,f=Math.floor(32+o%4*2+2*Math.floor(i/4)-c-i%4)%7,h=Math.floor((r+11*c+22*f)/451),[Math.ceil((Date.UTC(e,Math.floor((c+f-7*h+114)/31)-1,(c+f-7*h+114)%31+1+n)-Date.UTC(e,0,1))/864e5)]))},Object.defineProperty(e.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),e.prototype.ydayset=function(){return[f(this.yearlen),0,this.yearlen]},e.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],r=this.mrange[t],o=d(null,this.yearlen),i=n;i<r;i++)o[i]=i;return[o,n,r]},e.prototype.wdayset=function(e,t,n){for(var r=d(null,this.yearlen+7),o=A(w(e,t,n))-this.yearordinal,i=o,a=0;a<7&&(r[o]=o,++o,this.wdaymask[o]!==this.options.wkst);a++);return[r,i,o]},e.prototype.ddayset=function(e,t,n){var r=d(null,this.yearlen),o=A(w(e,t,n))-this.yearordinal;return r[o]=o,[r,o,o+1]},e.prototype.htimeset=function(e,t,n,r){var o=this,i=[];return this.options.byminute.forEach(function(t){i=i.concat(o.mtimeset(e,t,n,r))}),M(i),i},e.prototype.mtimeset=function(e,t,n,r){var o=this.options.bysecond.map(function(n){return new ee(e,t,n,r)});return M(o),o},e.prototype.stimeset=function(e,t,n,r){return[new ee(e,t,n,r)]},e.prototype.getdayset=function(e){switch(e){case o.YEARLY:return this.ydayset.bind(this);case o.MONTHLY:return this.mdayset.bind(this);case o.WEEKLY:return this.wdayset.bind(this);case o.DAILY:default:return this.ddayset.bind(this)}},e.prototype.gettimeset=function(e){switch(e){case o.HOURLY:return this.htimeset.bind(this);case o.MINUTELY:return this.mtimeset.bind(this);case o.SECONDLY:return this.stimeset.bind(this)}},e}();function eO(e,t){var n=t.dtstart,r=t.freq,o=t.interval,i=t.until,a=t.bysetpos,s=t.count;if(0===s||0===o)return eT(e);var l=et.fromDate(n),c=new eA(t);c.rebuild(l.year,l.month);for(var f=function(e,t,n){var r=n.freq,o=n.byhour,i=n.byminute,a=n.bysecond;if(X(r)){var u=n.dtstart.getTime()%1e3;if(!X(n.freq))return[];var s=[];return n.byhour.forEach(function(e){n.byminute.forEach(function(t){n.bysecond.forEach(function(n){s.push(new ee(e,t,n,u))})})}),s}return r>=eR.HOURLY&&g(o)&&!b(o,t.hour)||r>=eR.MINUTELY&&g(i)&&!b(i,t.minute)||r>=eR.SECONDLY&&g(a)&&!b(a,t.second)?[]:e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}(c,l,t);;){var d=c.getdayset(r)(l.year,l.month,l.day),h=d[0],p=d[1],v=d[2],y=function(e,t,n,r,o){for(var i=!1,a=t;a<n;a++){var u=e[a];(i=function(e,t,n){var r=n.bymonth,o=n.byweekno,i=n.byweekday,a=n.byeaster,u=n.bymonthday,s=n.bynmonthday,l=n.byyearday;return g(r)&&!b(r,e.mmask[t])||g(o)&&!e.wnomask[t]||g(i)&&!b(i,e.wdaymask[t])||g(e.nwdaymask)&&!e.nwdaymask[t]||null!==a&&!b(e.eastermask,t)||(g(u)||g(s))&&!b(u,e.mdaymask[t])&&!b(s,e.nmdaymask[t])||g(l)&&(t<e.yearlen&&!b(l,t+1)&&!b(l,-e.yearlen+t)||t>=e.yearlen&&!b(l,t+1-e.yearlen)&&!b(l,-e.nextyearlen+t-e.yearlen))}(r,u,o))&&(e[u]=null)}return i}(h,p,v,c,t);if(g(a))for(var w=function(e,t,n,r,o,i){for(var a=[],s=0;s<e.length;s++){var l=void 0,c=void 0,f=e[s];f<0?(l=Math.floor(f/t.length),c=m(f,t.length)):(l=Math.floor((f-1)/t.length),c=m(f-1,t.length));for(var d=[],h=n;h<r;h++){var p=i[h];u(p)&&d.push(p)}var v=void 0;v=l<0?d.slice(l)[0]:d[l];var y=t[c],g=P(O(o.yearordinal+v),y);b(a,g)||a.push(g)}return M(a),a}(a,f,p,v,c,h),_=0;_<w.length;_++){var D=w[_];if(i&&D>i)return eT(e);if(D>=n){var k=eB(D,t);if(!e.accept(k)||s&&!--s)return eT(e)}}else for(var _=p;_<v;_++){var E=h[_];if(u(E))for(var x=O(c.yearordinal+E),C=0;C<f.length;C++){var D=P(x,f[C]);if(i&&D>i)return eT(e);if(D>=n){var k=eB(D,t);if(!e.accept(k)||s&&!--s)return eT(e)}}}if(0===t.interval||(l.add(t,y),l.year>9999))return eT(e);X(r)||(f=c.gettimeset(r)(l.hour,l.minute,l.second,0)),c.rebuild(l.year,l.month)}}function eB(e,t){return new es(e,t.tzid).rezonedDate()}function eT(e){return e.getValue()}var eF={MO:new a(0),TU:new a(1),WE:new a(2),TH:new a(3),FR:new a(4),SA:new a(5),SU:new a(6)},eP={freq:o.YEARLY,dtstart:null,interval:1,wkst:eF.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},ez=Object.keys(eP),eR=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this._cache=t?null:new ec,this.origOptions=en(e);var n=function(e){var t=(0,Y.Cl)((0,Y.Cl)({},eP),en(e));if(u(t.byeaster)&&(t.freq=eR.YEARLY),!(u(t.freq)&&eR.FREQUENCIES[t.freq]))throw Error("Invalid frequency: ".concat(t.freq," ").concat(e.freq));if(t.dtstart||(t.dtstart=new Date(new Date().setMilliseconds(0))),u(t.wkst)?s(t.wkst)||(t.wkst=t.wkst.weekday):t.wkst=eR.MO.weekday,u(t.bysetpos)){s(t.bysetpos)&&(t.bysetpos=[t.bysetpos]);for(var n=0;n<t.bysetpos.length;n++){var r=t.bysetpos[n];if(0===r||!(r>=-366&&r<=366))throw Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||g(t.byweekno)||g(t.byyearday)||t.bymonthday||g(t.bymonthday)||u(t.byweekday)||u(t.byeaster)))switch(t.freq){case eR.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case eR.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case eR.WEEKLY:t.byweekday=[T(t.dtstart)]}if(u(t.bymonth)&&!c(t.bymonth)&&(t.bymonth=[t.bymonth]),u(t.byyearday)&&!c(t.byyearday)&&s(t.byyearday)&&(t.byyearday=[t.byyearday]),u(t.bymonthday))if(c(t.bymonthday)){for(var o=[],i=[],n=0;n<t.bymonthday.length;n++){var r=t.bymonthday[n];r>0?o.push(r):r<0&&i.push(r)}t.bymonthday=o,t.bynmonthday=i}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);else t.bymonthday=[],t.bynmonthday=[];if(u(t.byweekno)&&!c(t.byweekno)&&(t.byweekno=[t.byweekno]),u(t.byweekday))if(s(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(l(t.byweekday))t.byweekday=[a.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof a)!t.byweekday.n||t.freq>eR.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var f=[],d=[],n=0;n<t.byweekday.length;n++){var h=t.byweekday[n];if(s(h)){f.push(h);continue}if(l(h)){f.push(a.fromStr(h).weekday);continue}!h.n||t.freq>eR.MONTHLY?f.push(h.weekday):d.push([h.weekday,h.n])}t.byweekday=g(f)?f:null,t.bynweekday=g(d)?d:null}else t.bynweekday=null;return u(t.byhour)?s(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq<eR.HOURLY?[t.dtstart.getUTCHours()]:null,u(t.byminute)?s(t.byminute)&&(t.byminute=[t.byminute]):t.byminute=t.freq<eR.MINUTELY?[t.dtstart.getUTCMinutes()]:null,u(t.bysecond)?s(t.bysecond)&&(t.bysecond=[t.bysecond]):t.bysecond=t.freq<eR.SECONDLY?[t.dtstart.getUTCSeconds()]:null,{parsedOptions:t}}(e).parsedOptions;this.options=n}return e.parseText=function(e,t){return Q(e,t)},e.fromText=function(e,t){var n;return void 0===(n=t)&&(n=W),new eR(Q(e,n)||void 0)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(e){return eO(e,this.options)},e.prototype._cacheGet=function(e,t){return!!this._cache&&this._cache._cacheGet(e,t)},e.prototype._cacheAdd=function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n)},e.prototype.all=function(e){if(e)return this._iter(new $("all",{},e));var t=this._cacheGet("all");return!1===t&&(t=this._iter(new U("all",{})),this._cacheAdd("all",t)),t},e.prototype.between=function(e,t,n,r){if(void 0===n&&(n=!1),!C(e)||!C(t))throw Error("Invalid date passed in to RRule.between");var o={before:t,after:e,inc:n};if(r)return this._iter(new $("between",o,r));var i=this._cacheGet("between",o);return!1===i&&(i=this._iter(new U("between",o)),this._cacheAdd("between",i,o)),i},e.prototype.before=function(e,t){if(void 0===t&&(t=!1),!C(e))throw Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new U("before",n)),this._cacheAdd("before",r,n)),r},e.prototype.after=function(e,t){if(void 0===t&&(t=!1),!C(e))throw Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new U("after",n)),this._cacheAdd("after",r,n)),r},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return el(this.origOptions)},e.prototype.toText=function(e,t,n){return new V(this,e,t,n).toString()},e.prototype.isFullyConvertibleToText=function(){return J(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=o.YEARLY,e.MONTHLY=o.MONTHLY,e.WEEKLY=o.WEEKLY,e.DAILY=o.DAILY,e.HOURLY=o.HOURLY,e.MINUTELY=o.MINUTELY,e.SECONDLY=o.SECONDLY,e.MO=eF.MO,e.TU=eF.TU,e.WE=eF.WE,e.TH=eF.TH,e.FR=eF.FR,e.SA=eF.SA,e.SU=eF.SU,e.parseString=er,e.optionsToString=el,e}(),eM={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function eN(e,t){return void 0===t&&(t={}),function(e,t){var n,r,o,i,a,u,s,l=(n=[],r=[],o=[],i=[],u=(a=eo(e)).dtstart,s=a.tzid,(function(e,t){if(void 0===t&&(t=!1),!(e=e&&e.trim()))throw Error("Invalid empty string");if(!t)return e.split(/\s/);for(var n=e.split("\n"),r=0;r<n.length;){var o=n[r]=n[r].replace(/\s+$/g,"");o?r>0&&" "===o[0]?(n[r-1]+=o.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n})(e,t.unfold).forEach(function(e){if(e){var t,a=function(e){var t=function(e){if(-1===e.indexOf(":"))return{name:"RRULE",value:e};var t=p(e,":",1);return{name:t[0],value:t[1]}}(e),n=t.name,r=t.value,o=n.split(";");if(!o)throw Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:r}}(e),u=a.name,l=a.parms,c=a.value;switch(u.toUpperCase()){case"RRULE":if(l.length)throw Error("unsupported RRULE parm: ".concat(l.join(",")));n.push(er(e));break;case"RDATE":var f=(null!=(t=/RDATE(?:;TZID=([^:=]+))?/i.exec(e))?t:[])[1];f&&!s&&(s=f),r=r.concat(eL(c,l));break;case"EXRULE":if(l.length)throw Error("unsupported EXRULE parm: ".concat(l.join(",")));o.push(er(c));break;case"EXDATE":i=i.concat(eL(c,l));break;case"DTSTART":break;default:throw Error("unsupported property: "+u)}}}),{dtstart:u,tzid:s,rrulevals:n,rdatevals:r,exrulevals:o,exdatevals:i}),c=l.rrulevals,f=l.rdatevals,d=l.exrulevals,h=l.exdatevals,m=l.dtstart,v=l.tzid,y=!1===t.cache;if(t.compatible&&(t.forceset=!0,t.unfold=!0),t.forceset||c.length>1||f.length||d.length||h.length){var g=new eU(y);return g.dtstart(m),g.tzid(v||void 0),c.forEach(function(e){g.rrule(new eR(ej(e,m,v),y))}),f.forEach(function(e){g.rdate(e)}),d.forEach(function(e){g.exrule(new eR(ej(e,m,v),y))}),h.forEach(function(e){g.exdate(e)}),t.compatible&&t.dtstart&&g.rdate(m),g}var b=c[0]||{};return new eR(ej(b,b.dtstart||t.dtstart||m,b.tzid||t.tzid||v),y)}(e,function(e){var t=[],n=Object.keys(e),r=Object.keys(eM);if(n.forEach(function(e){b(r,e)||t.push(e)}),t.length)throw Error("Invalid options: "+t.join(", "));return(0,Y.Cl)((0,Y.Cl)({},eM),e)}(t))}function ej(e,t,n){return(0,Y.Cl)((0,Y.Cl)({},e),{dtstart:t,tzid:n})}function eL(e,t){return t.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw Error("unsupported RDATE/EXDATE parm: "+e)}),e.split(",").map(function(e){return j(e)})}function eI(e){var t=this;return function(n){if(void 0!==n&&(t["_".concat(e)]=n),void 0!==t["_".concat(e)])return t["_".concat(e)];for(var r=0;r<t._rrule.length;r++){var o=t._rrule[r].origOptions[e];if(o)return o}}}var eU=function(e){function t(t){void 0===t&&(t=!1);var n=e.call(this,{},t)||this;return n.dtstart=eI.apply(n,["dtstart"]),n.tzid=eI.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return(0,Y.C6)(t,e),t.prototype._iter=function(e){return function(e,t,n,r,o,i){var a={},u=e.accept;function s(e,t){n.forEach(function(n){n.between(e,t,!0).forEach(function(e){a[Number(e)]=!0})})}o.forEach(function(e){a[Number(new es(e,i).rezonedDate())]=!0}),e.accept=function(e){var t=Number(e);return isNaN(t)?u.call(this,e):!!a[t]||(s(new Date(t-1),new Date(t+1)),!!a[t])||(a[t]=!0,u.call(this,e))},"between"===e.method&&(s(e.args.after,e.args.before),e.accept=function(e){var t=Number(e);return!!a[t]||(a[t]=!0,u.call(this,e))});for(var l=0;l<r.length;l++){var c=new es(r[l],i).rezonedDate();if(!e.accept(new Date(c.getTime())))break}t.forEach(function(t){eO(e,t.options)});var f=e._result;switch(M(f),e.method){case"all":case"between":return f;case"before":return f.length&&f[f.length-1]||null;default:return f.length&&f[0]||null}}(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){eY(e,this._rrule)},t.prototype.exrule=function(e){eY(e,this._exrule)},t.prototype.rdate=function(e){e$(e,this._rdate)},t.prototype.exdate=function(e){e$(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(e){return eN(e.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(e){return eN(e.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(e){return new Date(e.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(e){return new Date(e.getTime())})},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(el({dtstart:this._dtstart}))),this._rrule.forEach(function(t){e=e.concat(t.toString().split("\n"))}),this._exrule.forEach(function(t){e=e.concat(t.toString().split("\n").map(function(e){return e.replace(/^RRULE:/,"EXRULE:")}).filter(function(e){return!/^DTSTART/.test(e)}))}),this._rdate.length&&e.push(eW("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(eW("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join("\n")},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(t){return e.rrule(t.clone())}),this._exrule.forEach(function(t){return e.exrule(t.clone())}),this._rdate.forEach(function(t){return e.rdate(new Date(t.getTime()))}),this._exdate.forEach(function(t){return e.exdate(new Date(t.getTime()))}),e},t}(eR);function eY(e,t){if(!(e instanceof eR))throw TypeError(String(e)+" is not RRule instance");b(t.map(String),String(e))||t.push(e)}function e$(e,t){if(!(e instanceof Date))throw TypeError(String(e)+" is not Date instance");b(t.map(Number),Number(e))||(t.push(e),M(t))}function eW(e,t,n){var r=!n||"UTC"===n.toUpperCase(),o=r?"".concat(e,":"):"".concat(e,";TZID=").concat(n,":"),i=t.map(function(e){return N(e.valueOf(),r)}).join(",");return"".concat(o).concat(i)}}