Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rrule.min.js 47KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rrule=e():t.rrule=e()}("undefined"!=typeof self?self:this,function(){return r={},i.m=n=[function(t,e,n){"use strict";n.r(e);var r=["MO","TU","WE","TH","FR","SA","SU"],f=(i.fromStr=function(t){return new i(r.indexOf(t))},i.prototype.nth=function(t){return this.n===t?this:new i(this.weekday,t)},i.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},i.prototype.toString=function(){var t=r[this.weekday];return this.n&&(t=(0<this.n?"+":"")+String(this.n)+t),t},i.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},i);function i(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}function a(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}function Y(t,e){var n=0,r=[];if(b(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r}var D=function(t){return null!=t},p=function(t){return"number"==typeof t},h=function(t){return 0<=r.indexOf(t)},b=Array.isArray;function o(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+=Y(n,e/n.length)),n.slice(0,e)+String(r))}function u(t,e){return{div:Math.floor(t/e),mod:U(t,e)}}function S(t){return!D(t)||0===t.length}var s,y,c=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},U=function(t,e){var n=t%e;return n*e<0?n+e:n},x=function(t){return!S(t)},L=function(t,e){return x(t)&&-1!==t.indexOf(e)};(y=s=s||{}).MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],y.ONE_DAY=864e5,y.MAXYEAR=9999,y.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),y.PY_WEEKDAYS=[6,0,1,2,3,4,5],y.getYearDay=function(t){var e=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.ceil((e.valueOf()-new Date(t.getUTCFullYear(),0,1).valueOf())/y.ONE_DAY)+1},y.isLeapYear=function(t){return t%4==0&&t%100!=0||t%400==0},y.isDate=function(t){return t instanceof Date},y.isValidDate=function(t){return y.isDate(t)&&!isNaN(t.getTime())},y.tzOffset=function(t){return 60*t.getTimezoneOffset()*1e3},y.daysBetween=function(t,e){var n=t.getTime()-y.tzOffset(t)-(e.getTime()-y.tzOffset(e));return Math.round(n/y.ONE_DAY)},y.toOrdinal=function(t){return y.daysBetween(t,y.ORDINAL_BASE)},y.fromOrdinal=function(t){return new Date(y.ORDINAL_BASE.getTime()+t*y.ONE_DAY)},y.getMonthDays=function(t){var e=t.getUTCMonth();return 1===e&&y.isLeapYear(t.getUTCFullYear())?29:y.MONTH_DAYS[e]},y.getWeekday=function(t){return y.PY_WEEKDAYS[t.getUTCDay()]},y.monthRange=function(t,e){var n=new Date(Date.UTC(t,e,1));return[y.getWeekday(n),y.getMonthDays(n)]},y.combine=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},y.clone=function(t){return new Date(t.getTime())},y.cloneDates=function(t){for(var e=[],n=0;n<t.length;n++)e.push(y.clone(t[n]));return e},y.sort=function(t){t.sort(function(t,e){return t.getTime()-e.getTime()})},y.timeToUntilString=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[o(n.getUTCFullYear().toString(),4,"0"),o(n.getUTCMonth()+1,2,"0"),o(n.getUTCDate(),2,"0"),"T",o(n.getUTCHours(),2,"0"),o(n.getUTCMinutes(),2,"0"),o(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},y.untilStringToDate=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: "+t);return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))};var M=s;function d(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}var l=(d.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)},d.prototype.add=function(t){return this._result.push(t),!0},d.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},d.prototype.clone=function(){return new d(this.method,this.args)},d),m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};
  2. /*! *****************************************************************************
  3. Copyright (c) Microsoft Corporation. All rights reserved.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  5. this file except in compliance with the License. You may obtain a copy of the
  6. License at http://www.apache.org/licenses/LICENSE-2.0
  7. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  9. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  10. MERCHANTABLITY OR NON-INFRINGEMENT.
  11. See the Apache Version 2.0 License for specific language governing permissions
  12. and limitations under the License.
  13. ***************************************************************************** */function w(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v,_=function(){return(_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function k(t,e,n){var r=v.call(this,t,e)||this;return r.iterator=n,r}function E(t,e){return-1!==t.indexOf(e)}function T(t){return t.toString()}function O(t,e,n){return e+" "+n+", "+t}var R=(w(k,v=l),k.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},k),N={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}};function A(t,e,n,r){if(void 0===e&&(e=T),void 0===n&&(n=N),void 0===r&&(r=O),this.text=[],this.language=n||N,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);i.sort(function(t,e){return t-e}),a.sort(function(t,e){return e-t}),this.bymonthday=i.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(D(this.origOptions.byweekday)){var o=b(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],s=String(o);this.byweekday={allWeeks:o.filter(function(t){return!t.n}),someWeeks:o.filter(function(t){return Boolean(t.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 u=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(u),this.byweekday.someWeeks.sort(u),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}var C,I,W=(A.isFullyConvertible=function(t){if(!(t.options.freq in A.IMPLEMENTED))return!1;if(t.origOptions.until&&t.origOptions.count)return!1;for(var e in t.origOptions){if(E(["dtstart","wkst","freq"],e))return!0;if(!E(A.IMPLEMENTED[t.options.freq],e))return!1}return!0},A.prototype.isFullyConvertible=function(){return A.isFullyConvertible(this.rrule)},A.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in A.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[Jt.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var e=this.options.until;this.add(this.dateFormatter(e.getUTCFullYear(),this.language.monthNames[e.getUTCMonth()],e.getUTCDate()))}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},A.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"))},A.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"))},A.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()},A.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())},A.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()},A.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")))},A.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")))},A.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"))))},A.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},A.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},A.prototype.nth=function(t){var e,n;t=parseInt(t.toString(),10);var r=this.gettext;if(-1===t)return r("last");switch(n=Math.abs(t)){case 1:case 21:case 31:e=n+r("st");break;case 2:case 22:e=n+r("nd");break;case 3:case 23:e=n+r("rd");break;default:e=n+r("th")}return t<0?e+" "+r("last"):e},A.prototype.monthtext=function(t){return this.language.monthNames[t-1]},A.prototype.weekdaytext=function(t){var e=p(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},A.prototype.plural=function(t){return t%100!=1},A.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},A.prototype.list=function(t,e,n,r){function i(t){return e&&e.call(a,t)}void 0===r&&(r=","),b(t)||(t=[t]),e=e||function(t){return t.toString()};var a=this;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(i),r,n):t.map(i).join(r+" ")},A),j=(H.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},H.prototype.isDone=function(){return this.done&&null===this.symbol},H.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},H.prototype.accept=function(t){if(this.symbol!==t)return!1;if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0},H.prototype.acceptNumber=function(){return this.accept("number")},H.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},H);function H(t){this.done=!0,this.rules=t}function q(t,e){void 0===e&&(e=N);var o={},s=new j(e.tokens);return s.start(t)?(function(){s.expect("every");var t=s.acceptNumber();t&&(o.interval=parseInt(t[0],10));if(s.isDone())throw new Error("Unexpected end");switch(s.symbol){case"day(s)":o.freq=Jt.DAILY,s.nextSymbol()&&(function(){if(!s.accept("at"))return;do{var t=s.acceptNumber();if(!t)throw new Error("Unexpected symbol "+s.symbol+", expected hour");for(o.byhour=[parseInt(t[0],10)];s.accept("comma");){if(!(t=s.acceptNumber()))throw new Error("Unexpected symbol "+s.symbol+"; expected hour");o.byhour.push(parseInt(t[0],10))}}while(s.accept("comma")||s.accept("at"))}(),a());break;case"weekday(s)":o.freq=Jt.WEEKLY,o.byweekday=[Jt.MO,Jt.TU,Jt.WE,Jt.TH,Jt.FR],s.nextSymbol(),a();break;case"week(s)":o.freq=Jt.WEEKLY,s.nextSymbol()&&(i(),a());break;case"hour(s)":o.freq=Jt.HOURLY,s.nextSymbol()&&(i(),a());break;case"minute(s)":o.freq=Jt.MINUTELY,s.nextSymbol()&&(i(),a());break;case"month(s)":o.freq=Jt.MONTHLY,s.nextSymbol()&&(i(),a());break;case"year(s)":o.freq=Jt.YEARLY,s.nextSymbol()&&(i(),a());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":o.freq=Jt.WEEKLY;var e=s.symbol.substr(0,2).toUpperCase();if(o.byweekday=[Jt[e]],!s.nextSymbol())return;for(;s.accept("comma");){if(s.isDone())throw new Error("Unexpected end");var n=h();if(!n)throw new Error("Unexpected symbol "+s.symbol+", expected weekday");o.byweekday.push(Jt[n]),s.nextSymbol()}!function(){s.accept("on"),s.accept("the");var t=y();if(!t)return;o.bymonthday=[t],s.nextSymbol();for(;s.accept("comma");){if(!(t=y()))throw new Error("Unexpected symbol "+s.symbol+"; expected monthday");o.bymonthday.push(t),s.nextSymbol()}}(),a();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(o.freq=Jt.YEARLY,o.bymonth=[u()],!s.nextSymbol())return;for(;s.accept("comma");){if(s.isDone())throw new Error("Unexpected end");var r=u();if(!r)throw new Error("Unexpected symbol "+s.symbol+", expected month");o.bymonth.push(r),s.nextSymbol()}i(),a();break;default:throw new Error("Unknown symbol")}}(),o):null;function i(){var t=s.accept("on"),e=s.accept("the");if(t||e)do{var n=y(),r=h(),i=u();if(n)r?(s.nextSymbol(),o.byweekday||(o.byweekday=[]),o.byweekday.push(Jt[r].nth(n))):(o.bymonthday||(o.bymonthday=[]),o.bymonthday.push(n),s.accept("day(s)"));else if(r)s.nextSymbol(),o.byweekday||(o.byweekday=[]),o.byweekday.push(Jt[r]);else if("weekday(s)"===s.symbol)s.nextSymbol(),o.byweekday||(o.byweekday=[Jt.MO,Jt.TU,Jt.WE,Jt.TH,Jt.FR]);else if("week(s)"===s.symbol){s.nextSymbol();var a=s.acceptNumber();if(!a)throw new Error("Unexpected symbol "+s.symbol+", expected week number");for(o.byweekno=[parseInt(a[0],10)];s.accept("comma");){if(!(a=s.acceptNumber()))throw new Error("Unexpected symbol "+s.symbol+"; expected monthday");o.byweekno.push(parseInt(a[0],10))}}else{if(!i)return;s.nextSymbol(),o.bymonth||(o.bymonth=[]),o.bymonth.push(i)}}while(s.accept("comma")||s.accept("the")||s.accept("on"))}function u(){switch(s.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 h(){switch(s.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return s.symbol.substr(0,2).toUpperCase();default:return!1}}function y(){switch(s.symbol){case"last":return s.nextSymbol(),-1;case"first":return s.nextSymbol(),1;case"second":return s.nextSymbol(),s.accept("last")?-2:2;case"third":return s.nextSymbol(),s.accept("last")?-3:3;case"nth":var t=parseInt(s.value[1],10);if(t<-366||366<t)throw new Error("Nth out of range: "+t);return s.nextSymbol(),s.accept("last")?-t:t;default:return!1}}function a(){if("until"===s.symbol){var t=Date.parse(s.text);if(!t)throw new Error("Cannot parse until date:"+s.text);o.until=new Date(t)}else s.accept("for")&&(o.count=parseInt(s.value[0],10),s.expect("number"))}}function P(t){return t<C.HOURLY}
  14. /*!
  15. * rrule.js - Library for working with recurrence rules for calendar dates.
  16. * https://github.com/jakubroztocil/rrule
  17. *
  18. * Copyright 2010, Jakub Roztocil and Lars Schoning
  19. * Licenced under the BSD licence.
  20. * https://github.com/jakubroztocil/rrule/blob/master/LICENCE
  21. *
  22. */(I=C=C||{})[I.YEARLY=0]="YEARLY",I[I.MONTHLY=1]="MONTHLY",I[I.WEEKLY=2]="WEEKLY",I[I.DAILY=3]="DAILY",I[I.HOURLY=4]="HOURLY",I[I.MINUTELY=5]="MINUTELY",I[I.SECONDLY=6]="SECONDLY";var z=["count","until","interval","byweekday","bymonthday","bymonth"];W.IMPLEMENTED=[],W.IMPLEMENTED[C.HOURLY]=z,W.IMPLEMENTED[C.MINUTELY]=z,W.IMPLEMENTED[C.DAILY]=["byhour"].concat(z),W.IMPLEMENTED[C.WEEKLY]=z,W.IMPLEMENTED[C.MONTHLY]=z,W.IMPLEMENTED[C.YEARLY]=["byweekno","byyearday"].concat(z);var F=W.isFullyConvertible,K=(B.prototype.getHours=function(){return this.hour},B.prototype.getMinutes=function(){return this.minute},B.prototype.getSeconds=function(){return this.second},B.prototype.getMilliseconds=function(){return this.millisecond},B.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},B);function B(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}var Z,V=(w(X,Z=K),X.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},X.prototype.getWeekday=function(){return s.getWeekday(new Date(this.getTime()))},X.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},X.prototype.getDay=function(){return this.day},X.prototype.getMonth=function(){return this.month},X.prototype.getYear=function(){return this.year},X.prototype.addYears=function(t){this.year+=t},X.prototype.addMonths=function(t){if(this.month+=t,12<this.month){var e=Math.floor(this.month/12),n=U(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},X.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()},X.prototype.addDaily=function(t){this.day+=t,this.fixDay()},X.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=u(this.hour,24),i=r.div,a=r.mod;if(i&&(this.hour=a,this.addDaily(i)),S(n)||L(n,this.hour))break}},X.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=u(this.minute,60),a=i.div,o=i.mod;if(a&&(this.minute=o,this.addHours(a,!1,n)),(S(n)||L(n,this.hour))&&(S(r)||L(r,this.minute)))break}},X.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var a=u(this.second,60),o=a.div,s=a.mod;if(o&&(this.second=s,this.addMinutes(o,!1,n,r)),(S(n)||L(n,this.hour))&&(S(r)||L(r,this.minute))&&(S(i)||L(i,this.second)))break}},X.prototype.fixDay=function(){if(!(this.day<=28)){var t=s.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>s.MAXYEAR))return;t=s.monthRange(this.year,this.month-1)[1]}}},X.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,a=t.byhour,o=t.byminute,s=t.bysecond;switch(n){case C.YEARLY:return this.addYears(r);case C.MONTHLY:return this.addMonths(r);case C.WEEKLY:return this.addWeekly(r,i);case C.DAILY:return this.addDaily(r);case C.HOURLY:return this.addHours(r,e,a);case C.MINUTELY:return this.addMinutes(r,e,a,o);case C.SECONDLY:return this.addSeconds(r,e,a,o,s)}},X);function X(t,e,n,r,i,a,o){var s=Z.call(this,r,i,a,o)||this;return s.year=t,s.month=e,s.day=n,s}function G(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];L(Ct,i)||e.push(i),M.isDate(t[i])&&!M.isValidDate(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return _({},t)}function J(t){var e=t.split("\n").map($).filter(function(t){return null!==t});return _(_({},e[0]),e[1])}function Q(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;n[0];var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=M.untilStringToDate(i),e}function $(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return tt(t);e[0];var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return tt(t);case"DTSTART":return Q(t);default:throw new Error("Unsupported RFC prop "+n+" in "+t)}}function tt(u){var h=Q(u.replace(/^RRULE:/i,""));return u.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(t){var e,n=t.split("="),r=n[0],i=n[1];switch(r.toUpperCase()){case"FREQ":h.freq=C[i.toUpperCase()];break;case"WKST":h.wkst=Nt[i.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var a=-1===(e=i).indexOf(",")?et(e):e.split(",").map(et),o=r.toLowerCase();h[o]=a;break;case"BYWEEKDAY":case"BYDAY":h.byweekday=i.split(",").map(function(t){if(2===t.length)return Nt[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/),n=Number(e[1]),r=e[2],i=Nt[r].weekday;return new f(i,n)});break;case"DTSTART":case"TZID":var s=Q(u);h.tzid=s.tzid,h.dtstart=s.dtstart;break;case"UNTIL":h.until=M.untilStringToDate(i);break;case"BYEASTER":h.byeaster=Number(i);break;default:throw new Error("Unknown RRULE property '"+r+"'")}}),h}function et(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var nt=function(){throw new TypeError},rt=(Object.defineProperty(it.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!0,configurable:!0}),it.prototype.toString=function(){var t=M.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":"+t:";TZID="+this.tzid+":"+t},it.prototype.getTime=function(){return this.date.getTime()},it.prototype.rezonedDate=function(){if(this.isUTC)return this.date;try{return nt(this.date).setZone(this.tzid,{keepLocalTime:!0}).toJSDate()}catch(t){return t instanceof TypeError&&console.error("Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone"),this.date}},it);function it(t,e){this.date=t,this.tzid=e}function at(t){for(var e,n=[],r="",i=Object.keys(t),a=Object.keys(At),o=0;o<i.length;o++)if("tzid"!==i[o]&&L(a,i[o])){var s=i[o].toUpperCase(),u=t[i[o]],h="";if(D(u)&&(!b(u)||u.length)){switch(s){case"FREQ":h=Wt.FREQUENCIES[t.freq];break;case"WKST":h=p(u)?new f(u).toString():u.toString();break;case"BYWEEKDAY":s="BYDAY",h=(b(e=u)?e:[e]).map(function(t){return t instanceof f?t:b(t)?new f(t[0],t[1]):new f(t)}).toString();break;case"DTSTART":r=ot(u,t.tzid);break;case"UNTIL":h=M.timeToUntilString(u,!t.tzid);break;default:if(b(u)){for(var y=[],d=0;d<u.length;d++)y[d]=String(u[d]);h=y.toString()}else h=String(u)}h&&n.push([s,h])}}var c=n.map(function(t){return t[0]+"="+t[1].toString()}).join(";"),l="";return""!==c&&(l="RRULE:"+c),[r,l].filter(function(t){return!!t}).join("\n")}function ot(t,e){return t?"DTSTART"+new rt(new Date(t),e).toString():""}var st=(ut.prototype._cacheAdd=function(t,e,n){e=e&&(e instanceof Date?M.clone(e):M.cloneDates(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},ut.prototype._cacheGet=function(t,r){function e(t){for(var e=0;e<i.length;e++){var n=i[e];if(String(r[n])!==String(t[n]))return!0}return!1}var n=!1,i=r?Object.keys(r):[],a=this[t];if("all"===t)n=this.all;else if(b(a))for(var o=0;o<a.length;o++){var s=a[o];if(!i.length||!e(s)){n=s._value;break}}if(!n&&this.all){var u=new l(t,r);for(o=0;o<this.all.length&&u.accept(this.all[o]);o++);n=u.getValue(),this._cacheAdd(t,n,r)}return b(n)?M.cloneDates(n):n instanceof Date?M.clone(n):n},ut);function ut(){this.all=!1,this.before=[],this.after=[],this.between=[]}var ht=g(Y(1,31),Y(2,28),Y(3,31),Y(4,30),Y(5,31),Y(6,30),Y(7,31),Y(8,31),Y(9,30),Y(10,31),Y(11,30),Y(12,31),Y(1,7)),yt=g(Y(1,31),Y(2,29),Y(3,31),Y(4,30),Y(5,31),Y(6,30),Y(7,31),Y(8,31),Y(9,30),Y(10,31),Y(11,30),Y(12,31),Y(1,7)),dt=a(1,29),ct=a(1,30),lt=a(1,31),ft=a(1,32),pt=g(ft,ct,ft,lt,ft,lt,ft,ft,lt,ft,lt,ft,ft.slice(0,7)),bt=g(ft,dt,ft,lt,ft,lt,ft,ft,lt,ft,lt,ft,ft.slice(0,7)),mt=a(-28,0),wt=a(-29,0),vt=a(-30,0),gt=a(-31,0),kt=g(gt,wt,gt,vt,gt,vt,gt,gt,vt,gt,vt,gt,gt.slice(0,7)),Et=g(gt,mt,gt,vt,gt,vt,gt,gt,vt,gt,vt,gt,gt.slice(0,7)),Tt=[0,31,60,91,121,152,182,213,244,274,305,335,366],Dt=[0,31,59,90,120,151,181,212,243,273,304,334,365],xt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(a(7));return t}();function Ot(t,e){var n,r,i,a,o,s,u=new Date(Date.UTC(t,0,1)),h=M.isLeapYear(t)?366:365,y=M.isLeapYear(t+1)?366:365,d=M.toOrdinal(u),c=M.getWeekday(u),l=_(_({yearlen:h,nextyearlen:y,yearordinal:d,yearweekday:c},(n=t,r=M.isLeapYear(n)?366:365,i=new Date(Date.UTC(n,0,1)),a=M.getWeekday(i),365!=r?{mmask:yt,mdaymask:pt,nmdaymask:kt,wdaymask:xt.slice(a),mrange:Tt}:{mmask:ht,mdaymask:bt,nmdaymask:Et,wdaymask:xt.slice(a),mrange:Dt})),{wnomask:null});if(S(e.byweekno))return l;l.wnomask=Y(0,7+h);var f=o=U(7-c+e.wkst,7);s=4<=f?(f=0,l.yearlen+U(c-e.wkst,7)):h-f;for(var p=Math.floor(s/7),b=U(s,7),m=Math.floor(p+b/4),w=0;w<e.byweekno.length;w++){var v=e.byweekno[w];if(v<0&&(v+=m+1),0<v&&v<=m){var g=void 0;1<v?(g=f+7*(v-1),f!==o&&(g-=7-o)):g=f;for(var k=0;k<7&&(l.wnomask[g]=1,g++,l.wdaymask[g]!==e.wkst);k++);}}if(L(e.byweekno,1)){g=f+7*m;if(f!==o&&(g-=7-o),g<h)for(w=0;w<7&&(g+=l.wnomask[g]=1,l.wdaymask[g]!==e.wkst);w++);}if(f){var E=void 0;if(L(e.byweekno,-1))E=-1;else{var T=M.getWeekday(new Date(Date.UTC(t-1,0,1))),D=U(7-T.valueOf()+e.wkst,7),x=M.isLeapYear(t-1)?366:365,O=void 0;O=4<=D?(D=0,x+U(T-e.wkst,7)):h-f,E=Math.floor(52+U(O,7)/4)}if(L(e.byweekno,E))for(g=0;g<f;g++)l.wnomask[g]=1}return l}function Yt(t){this.options=t}var St=(Yt.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=Ot(t,n)),x(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,i=r.yearlen,a=r.mrange,o=r.wdaymask;this.monthinfo=function(t,e,n,r,i,a){var o={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(a.freq===Wt.YEARLY)if(S(a.bymonth))s=[[0,n]];else for(var u=0;u<a.bymonth.length;u++)e=a.bymonth[u],s.push(r.slice(e-1,e+1));else a.freq===Wt.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(S(s))return o;for(o.nwdaymask=Y(0,n),u=0;u<s.length;u++)for(var h=s[u],y=h[0],d=h[1]-1,c=0;c<a.bynweekday.length;c++){var l=void 0,f=a.bynweekday[c],p=f[0],b=f[1];b<0?(l=d+7*(b+1),l-=U(i[l]-p,7)):(l=y+7*(b-1),l+=U(7-i[l]+p,7)),y<=l&&l<=d&&(o.nwdaymask[l]=1)}return o}(t,e,i,a,o,n)}D(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,a=Math.floor(r/4),o=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-a-u+15)%30,y=Math.floor(i/4),d=i%4,c=Math.floor(32+2*o+2*y-h-d)%7,l=Math.floor((n+11*h+22*c)/451),f=Math.floor((h+c-7*l+114)/31),p=(h+c-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(Yt.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(Yt.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!0,configurable:!0}),Yt.prototype.ydayset=function(){return[a(this.yearlen),0,this.yearlen]},Yt.prototype.mdayset=function(t,e,n){for(var r=this.mrange[e-1],i=this.mrange[e],a=Y(null,this.yearlen),o=r;o<i;o++)a[o]=o;return[a,r,i]},Yt.prototype.wdayset=function(t,e,n){for(var r=Y(null,this.yearlen+7),i=M.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,a=i,o=0;o<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);o++);return[r,a,i]},Yt.prototype.ddayset=function(t,e,n){var r=Y(null,this.yearlen),i=M.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[i]=i,[r,i,1+i]},Yt.prototype.htimeset=function(e,t,n,r){var i=this,a=[];return this.options.byminute.forEach(function(t){a=a.concat(i.mtimeset(e,t,n,r))}),M.sort(a),a},Yt.prototype.mtimeset=function(e,n,t,r){var i=this.options.bysecond.map(function(t){return new K(e,n,t,r)});return M.sort(i),i},Yt.prototype.stimeset=function(t,e,n,r){return[new K(t,e,n,r)]},Yt.prototype.getdayset=function(t){switch(t){case C.YEARLY:return this.ydayset.bind(this);case C.MONTHLY:return this.mdayset.bind(this);case C.WEEKLY:return this.wdayset.bind(this);case C.DAILY:default:return this.ddayset.bind(this)}},Yt.prototype.gettimeset=function(t){switch(t){case C.HOURLY:return this.htimeset.bind(this);case C.MINUTELY:return this.mtimeset.bind(this);case C.SECONDLY:return this.stimeset.bind(this)}},Yt);function Ut(t,e,n,r,i,a){for(var o=[],s=0;s<t.length;s++){var u=void 0,h=void 0,y=t[s];h=y<0?(u=Math.floor(y/e.length),U(y,e.length)):(u=Math.floor((y-1)/e.length),U(y-1,e.length));for(var d=[],c=n;c<r;c++){var l=a[c];D(l)&&d.push(l)}var f=void 0;f=u<0?d.slice(u)[0]:d[u];var p=e[h],b=M.fromOrdinal(i.yearordinal+f),m=M.combine(b,p);L(o,m)||o.push(m)}return M.sort(o),o}function Lt(t,e){var n=e.dtstart,r=e.freq,i=e.interval,a=e.until,o=e.bysetpos,s=e.count;if(0===s||0===i)return _t(t);var u=V.fromDate(n),h=new St(e);h.rebuild(u.year,u.month);for(var y=function(t,e,n){var r=n.freq,i=n.byhour,a=n.byminute,o=n.bysecond;if(P(r))return function(t){var r=t.dtstart.getTime()%1e3;if(!P(t.freq))return[];var i=[];return t.byhour.forEach(function(n){t.byminute.forEach(function(e){t.bysecond.forEach(function(t){i.push(new K(n,e,t,r))})})}),i}(n);if(r>=Wt.HOURLY&&x(i)&&!L(i,e.hour)||r>=Wt.MINUTELY&&x(a)&&!L(a,e.minute)||r>=Wt.SECONDLY&&x(o)&&!L(o,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(h,u,e);;){var d=h.getdayset(r)(u.year,u.month,u.day),c=d[0],l=d[1],f=d[2],p=Rt(c,l,f,h,e);if(x(o))for(var b=Ut(o,y,l,f,h,c),m=0;m<b.length;m++){var w=b[m];if(a&&a<w)return _t(t);if(n<=w){var v=Mt(w,e);if(!t.accept(v))return _t(t);if(s&&!--s)return _t(t)}}else for(m=l;m<f;m++){var g=c[m];if(D(g))for(var k=M.fromOrdinal(h.yearordinal+g),E=0;E<y.length;E++){var T=y[E];w=M.combine(k,T);if(a&&a<w)return _t(t);if(n<=w){v=Mt(w,e);if(!t.accept(v))return _t(t);if(s&&!--s)return _t(t)}}}if(0===e.interval)return _t(t);if(u.add(e,p),u.year>M.MAXYEAR)return _t(t);P(r)||(y=h.gettimeset(r)(u.hour,u.minute,u.second,0)),h.rebuild(u.year,u.month)}}function Mt(t,e){return new rt(t,e.tzid).rezonedDate()}function _t(t){return t.getValue()}function Rt(t,e,n,r,i){for(var a,o,s,u,h,y,d,c,l,f,p=!1,b=e;b<n;b++){var m=t[b];a=r,o=m,void 0,u=(s=i).bymonth,h=s.byweekno,y=s.byweekday,d=s.byeaster,c=s.bymonthday,l=s.bynmonthday,f=s.byyearday,(p=x(u)&&!L(u,a.mmask[o])||x(h)&&!a.wnomask[o]||x(y)&&!L(y,a.wdaymask[o])||x(a.nwdaymask)&&!a.nwdaymask[o]||null!==d&&!L(a.eastermask,o)||(x(c)||x(l))&&!L(c,a.mdaymask[o])&&!L(l,a.nmdaymask[o])||x(f)&&(o<a.yearlen&&!L(f,o+1)&&!L(f,-a.yearlen+o)||o>=a.yearlen&&!L(f,o+1-a.yearlen)&&!L(f,-a.nextyearlen+o-a.yearlen)))&&(t[m]=null)}return p}var Nt={MO:new f(0),TU:new f(1),WE:new f(2),TH:new f(3),FR:new f(4),SA:new f(5),SU:new f(6)},At={freq:C.YEARLY,dtstart:null,interval:1,wkst:Nt.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},Ct=Object.keys(At);function It(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new st,this.origOptions=G(t);var n=function(t){var e=_(_({},At),G(t));if(D(e.byeaster)&&(e.freq=Wt.YEARLY),!D(e.freq)||!Wt.FREQUENCIES[e.freq])throw new Error("Invalid frequency: "+e.freq+" "+t.freq);if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),D(e.wkst)?p(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Wt.MO.weekday,D(e.bysetpos)){p(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(a=e.bysetpos[n])||!(-366<=a&&a<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||x(e.byweekno)||x(e.byyearday)||Boolean(e.bymonthday)||x(e.bymonthday)||D(e.byweekday)||D(e.byeaster)))switch(e.freq){case Wt.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Wt.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Wt.WEEKLY:e.byweekday=[M.getWeekday(e.dtstart)]}if(D(e.bymonth)&&!b(e.bymonth)&&(e.bymonth=[e.bymonth]),D(e.byyearday)&&!b(e.byyearday)&&p(e.byyearday)&&(e.byyearday=[e.byyearday]),D(e.bymonthday))if(b(e.bymonthday)){var r=[],i=[];for(n=0;n<e.bymonthday.length;n++){var a;0<(a=e.bymonthday[n])?r.push(a):a<0&&i.push(a)}e.bymonthday=r,e.bynmonthday=i}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(D(e.byweekno)&&!b(e.byweekno)&&(e.byweekno=[e.byweekno]),D(e.byweekday))if(p(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(h(e.byweekday))e.byweekday=[f.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof f)!e.byweekday.n||e.freq>Wt.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var o=[],s=[];for(n=0;n<e.byweekday.length;n++){var u=e.byweekday[n];p(u)?o.push(u):h(u)?o.push(f.fromStr(u).weekday):!u.n||e.freq>Wt.MONTHLY?o.push(u.weekday):s.push([u.weekday,u.n])}e.byweekday=x(o)?o:null,e.bynweekday=x(s)?s:null}else e.bynweekday=null;return D(e.byhour)?p(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Wt.HOURLY?[e.dtstart.getUTCHours()]:null,D(e.byminute)?p(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Wt.MINUTELY?[e.dtstart.getUTCMinutes()]:null,D(e.bysecond)?p(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Wt.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}(t).parsedOptions;this.options=n}var Wt=(It.parseText=function(t,e){return q(t,e)},It.fromText=function(t,e){return void 0===(n=e)&&(n=N),new Jt(q(t,n)||void 0);var n},It.fromString=function(t){return new It(It.parseString(t)||void 0)},It.prototype._iter=function(t){return Lt(t,this.options)},It.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},It.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},It.prototype.all=function(t){if(t)return this._iter(new R("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new l("all",{})),this._cacheAdd("all",e)),e},It.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!M.isValidDate(t)||!M.isValidDate(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new R("between",i,r));var a=this._cacheGet("between",i);return!1===a&&(a=this._iter(new l("between",i)),this._cacheAdd("between",a,i)),a},It.prototype.before=function(t,e){if(void 0===e&&(e=!1),!M.isValidDate(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new l("before",n)),this._cacheAdd("before",r,n)),r},It.prototype.after=function(t,e){if(void 0===e&&(e=!1),!M.isValidDate(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new l("after",n)),this._cacheAdd("after",r,n)),r},It.prototype.count=function(){return this.all().length},It.prototype.toString=function(){return at(this.origOptions)},It.prototype.toText=function(t,e,n){return new W(this,t,e,n).toString()},It.prototype.isFullyConvertibleToText=function(){return F(this)},It.prototype.clone=function(){return new It(this.origOptions)},It.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],It.YEARLY=C.YEARLY,It.MONTHLY=C.MONTHLY,It.WEEKLY=C.WEEKLY,It.DAILY=C.DAILY,It.HOURLY=C.HOURLY,It.MINUTELY=C.MINUTELY,It.SECONDLY=C.SECONDLY,It.MO=Nt.MO,It.TU=Nt.TU,It.WE=Nt.WE,It.TH=Nt.TH,It.FR=Nt.FR,It.SA=Nt.SA,It.SU=Nt.SU,It.parseString=J,It.optionsToString=at,It);var jt,Ht={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function qt(t,e){var s=[],u=[],h=[],y=[],n=Q(t),r=n.dtstart,d=n.tzid;return function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?0<r&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold).forEach(function(t){if(t){var e=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=c(t,":",1),n=e[0],r=e[1];return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),n=e.name,r=e.parms,i=e.value;switch(n.toUpperCase()){case"RRULE":if(r.length)throw new Error("unsupported RRULE parm: "+r.join(","));s.push(J(t));break;case"RDATE":var a=/RDATE(?:;TZID=([^:=]+))?/i.exec(t),o=(a[0],a[1]);o&&!d&&(d=o),u=u.concat(Ft(i,r));break;case"EXRULE":if(r.length)throw new Error("unsupported EXRULE parm: "+r.join(","));h.push(J(i));break;case"EXDATE":y=y.concat(Ft(i,r));break;case"DTSTART":break;default:throw new Error("unsupported property: "+n)}}}),{dtstart:r,tzid:d,rrulevals:s,rdatevals:u,exrulevals:h,exdatevals:y}}function Pt(t,e){return void 0===e&&(e={}),function(t,e){var n=qt(t,e),r=n.rrulevals,i=n.rdatevals,a=n.exrulevals,o=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||1<r.length||i.length||a.length||o.length){var y=new Zt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach(function(t){y.rrule(new Wt(zt(t,s,u),h))}),i.forEach(function(t){y.rdate(t)}),a.forEach(function(t){y.exrule(new Wt(zt(t,s,u),h))}),o.forEach(function(t){y.exdate(t)}),e.compatible&&e.dtstart&&y.rdate(s),y}var d=r[0]||{};return new Wt(zt(d,d.dtstart||e.dtstart||s,d.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(Ht);if(n.forEach(function(t){L(r,t)||e.push(t)}),e.length)throw new Error("Invalid options: "+e.join(", "));return _(_({},Ht),t)}(e))}function zt(t,e,n){return _(_({},t),{dtstart:e,tzid:n})}function Ft(t,e){return e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}),t.split(",").map(function(t){return M.untilStringToDate(t)})}function Kt(r){var i=this;return function(t){if(void 0!==t&&(i["_"+r]=t),void 0!==i["_"+r])return i["_"+r];for(var e=0;e<i._rrule.length;e++){var n=i._rrule[e].origOptions[r];if(n)return n}}}function Bt(t){void 0===t&&(t=!1);var e=jt.call(this,{},t)||this;return e.dtstart=Kt.apply(e,["dtstart"]),e.tzid=Kt.apply(e,["tzid"]),e._rrule=[],e._rdate=[],e._exrule=[],e._exdate=[],e}var Zt=(w(Bt,jt=Wt),Bt.prototype._iter=function(t){return function(e,t,r,n,i,a){var o={},s=e.accept;function u(e,n){r.forEach(function(t){t.between(e,n,!0).forEach(function(t){o[Number(t)]=!0})})}i.forEach(function(t){var e=new rt(t,a).rezonedDate();o[Number(e)]=!0}),e.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!o[e]&&(u(new Date(e-1),new Date(e+1)),!o[e]))||(o[e]=!0,s.call(this,t))},"between"===e.method&&(u(e.args.after,e.args.before),e.accept=function(t){var e=Number(t);return!!o[e]||(o[e]=!0,s.call(this,t))});for(var h=0;h<n.length;h++){var y=new rt(n[h],a).rezonedDate();if(!e.accept(new Date(y.getTime())))break}t.forEach(function(t){Lt(e,t.options)});var d=e._result;switch(M.sort(d),e.method){case"all":case"between":return d;case"before":return d.length&&d[d.length-1]||null;case"after":default:return d.length&&d[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},Bt.prototype.rrule=function(t){Vt(t,this._rrule)},Bt.prototype.exrule=function(t){Vt(t,this._exrule)},Bt.prototype.rdate=function(t){Xt(t,this._rdate)},Bt.prototype.exdate=function(t){Xt(t,this._exdate)},Bt.prototype.rrules=function(){return this._rrule.map(function(t){return Pt(t.toString())})},Bt.prototype.exrules=function(){return this._exrule.map(function(t){return Pt(t.toString())})},Bt.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},Bt.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},Bt.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(at({dtstart:this._dtstart}))),this._rrule.forEach(function(t){e=e.concat(t.toString().split("\n"))}),this._exrule.forEach(function(t){e=e.concat(t.toString().split("\n").map(function(t){return t.replace(/^RRULE:/,"EXRULE:")}).filter(function(t){return!/^DTSTART/.test(t)}))}),this._rdate.length&&e.push(Gt("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(Gt("EXDATE",this._exdate,this.tzid())),e},Bt.prototype.toString=function(){return this.valueOf().join("\n")},Bt.prototype.clone=function(){var e=new Bt(!!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},Bt);function Vt(t,e){if(!(t instanceof Wt))throw new TypeError(String(t)+" is not RRule instance");L(e.map(String),String(t))||e.push(t)}function Xt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");L(e.map(Number),Number(t))||(e.push(t),M.sort(e))}function Gt(t,e,n){var r=!n||"UTC"===n.toUpperCase();return(r?t+":":t+";TZID="+n+":")+e.map(function(t){return M.timeToUntilString(t.valueOf(),r)}).join(",")}n.d(e,"rrulestr",function(){return Pt}),n.d(e,"Frequency",function(){return C}),n.d(e,"Weekday",function(){return f}),n.d(e,"RRule",function(){return Wt}),n.d(e,"RRuleSet",function(){return Zt});
  23. /*!
  24. * rrule.js - Library for working with recurrence rules for calendar dates.
  25. * https://github.com/jakubroztocil/rrule
  26. *
  27. * Copyright 2010, Jakub Roztocil and Lars Schoning
  28. * Licenced under the BSD licence.
  29. * https://github.com/jakubroztocil/rrule/blob/master/LICENCE
  30. *
  31. * Based on:
  32. * python-dateutil - Extensions to the standard Python datetime module.
  33. * Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
  34. * Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
  35. * https://github.com/jakubroztocil/rrule/blob/master/LICENCE
  36. *
  37. */var Jt=e.default=Wt}],i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0);function i(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var n,r});