Files
2026-07-23 20:36:13 +08:00

101 lines
280 KiB
JavaScript
Executable File

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var b_=Object.create;var ys=Object.defineProperty;var v_=Object.getOwnPropertyDescriptor;var y_=Object.getOwnPropertyNames;var __=Object.getPrototypeOf,I_=Object.prototype.hasOwnProperty;var Lf=r=>{throw TypeError(r)};var w_=(r,e,t)=>e in r?ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var C_=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},x_=(r,e)=>{for(var t in e)ys(r,t,{get:e[t],enumerable:!0})},Of=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y_(e))!I_.call(r,o)&&o!==t&&ys(r,o,{get:()=>e[o],enumerable:!(n=v_(e,o))||n.enumerable});return r};var Nr=(r,e,t)=>(t=r!=null?b_(__(r)):{},Of(e||!r||!r.__esModule?ys(t,"default",{value:r,enumerable:!0}):t,r)),A_=r=>Of(ys({},"__esModule",{value:!0}),r);var h=(r,e,t)=>w_(r,typeof e!="symbol"?e+"":e,t),Hu=(r,e,t)=>e.has(r)||Lf("Cannot "+t);var C=(r,e,t)=>(Hu(r,e,"read from private field"),t?t.call(r):e.get(r)),q=(r,e,t)=>e.has(r)?Lf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),j=(r,e,t,n)=>(Hu(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),le=(r,e,t)=>(Hu(r,e,"access private method"),t);var wr=C_((ju,io)=>{(function(r,e){typeof ju=="object"&&typeof io!="undefined"?io.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(ju,(function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function o(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,s){return Object.prototype.hasOwnProperty.call(i,s)}function c(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var s;for(s in i)if(a(i,s))return!1;return!0}function u(i){return i===void 0}function f(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function p(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function b(i,s){var l=[],d,m=i.length;for(d=0;d<m;++d)l.push(s(i[d],d));return l}function I(i,s){for(var l in s)a(s,l)&&(i[l]=s[l]);return a(s,"toString")&&(i.toString=s.toString),a(s,"valueOf")&&(i.valueOf=s.valueOf),i}function g(i,s,l,d){return If(i,s,l,d,!0).utc()}function v(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function y(i){return i._pf==null&&(i._pf=v()),i._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(i){var s=Object(this),l=s.length>>>0,d;for(d=0;d<l;d++)if(d in s&&i.call(this,s[d],d,s))return!0;return!1};function x(i){var s=null,l=!1,d=i._d&&!isNaN(i._d.getTime());if(d&&(s=y(i),l=w.call(s.parsedDateParts,function(m){return m!=null}),d=s.overflow<0&&!s.empty&&!s.invalidEra&&!s.invalidMonth&&!s.invalidWeekday&&!s.weekdayMismatch&&!s.nullInput&&!s.invalidFormat&&!s.userInvalidated&&(!s.meridiem||s.meridiem&&l),i._strict&&(d=d&&s.charsLeftOver===0&&s.unusedTokens.length===0&&s.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(i))i._isValid=d;else return d;return i._isValid}function k(i){var s=g(NaN);return i!=null?I(y(s),i):y(s).userInvalidated=!0,s}var E=e.momentProperties=[],Z=!1;function te(i,s){var l,d,m,_=E.length;if(u(s._isAMomentObject)||(i._isAMomentObject=s._isAMomentObject),u(s._i)||(i._i=s._i),u(s._f)||(i._f=s._f),u(s._l)||(i._l=s._l),u(s._strict)||(i._strict=s._strict),u(s._tzm)||(i._tzm=s._tzm),u(s._isUTC)||(i._isUTC=s._isUTC),u(s._offset)||(i._offset=s._offset),u(s._pf)||(i._pf=y(s)),u(s._locale)||(i._locale=s._locale),_>0)for(l=0;l<_;l++)d=E[l],m=s[d],u(m)||(i[d]=m);return i}function ae(i){te(this,i),this._d=new Date(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Z===!1&&(Z=!0,e.updateOffset(this),Z=!1)}function M(i){return i instanceof ae||i!=null&&i._isAMomentObject!=null}function pe(i){e.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+i)}function ye(i,s){var l=!0;return I(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,i),l){var d=[],m,_,R,N=arguments.length;for(_=0;_<N;_++){if(m="",typeof arguments[_]=="object"){m+=`
[`+_+"] ";for(R in arguments[0])a(arguments[0],R)&&(m+=R+": "+arguments[0][R]+", ");m=m.slice(0,-2)}else m=arguments[_];d.push(m)}pe(i+`
Arguments: `+Array.prototype.slice.call(d).join("")+`
`+new Error().stack),l=!1}return s.apply(this,arguments)},s)}var Te={};function He(i,s){e.deprecationHandler!=null&&e.deprecationHandler(i,s),Te[i]||(pe(s),Te[i]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function he(i){return typeof Function!="undefined"&&i instanceof Function||Object.prototype.toString.call(i)==="[object Function]"}function Lt(i){var s,l;for(l in i)a(i,l)&&(s=i[l],he(s)?this[l]=s:this["_"+l]=s);this._config=i,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Ne(i,s){var l=I({},i),d;for(d in s)a(s,d)&&(o(i[d])&&o(s[d])?(l[d]={},I(l[d],i[d]),I(l[d],s[d])):s[d]!=null?l[d]=s[d]:delete l[d]);for(d in i)a(i,d)&&!a(s,d)&&o(i[d])&&(l[d]=I({},l[d]));return l}function tt(i){i!=null&&this.set(i)}var xt;Object.keys?xt=Object.keys:xt=function(i){var s,l=[];for(s in i)a(i,s)&&l.push(s);return l};var Kt={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Q(i,s,l){var d=this._calendar[i]||this._calendar.sameElse;return he(d)?d.call(s,l):d}function ie(i,s,l){var d=""+Math.abs(i),m=s-d.length,_=i>=0;return(_?l?"+":"":"-")+Math.pow(10,Math.max(0,m)).toString().substr(1)+d}var D=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,se=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Be={},T={};function G(i,s,l,d){var m=d;typeof d=="string"&&(m=function(){return this[d]()}),i&&(T[i]=m),s&&(T[s[0]]=function(){return ie(m.apply(this,arguments),s[1],s[2])}),l&&(T[l]=function(){return this.localeData().ordinal(m.apply(this,arguments),i)})}function _t(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function Je(i){var s=i.match(D),l,d;for(l=0,d=s.length;l<d;l++)T[s[l]]?s[l]=T[s[l]]:s[l]=_t(s[l]);return function(m){var _="",R;for(R=0;R<d;R++)_+=he(s[R])?s[R].call(m,i):s[R];return _}}function lt(i,s){return i.isValid()?(s=Ve(s,i.localeData()),Be[s]=Be[s]||Je(s),Be[s](i)):i.localeData().invalidDate()}function Ve(i,s){var l=5;function d(m){return s.longDateFormat(m)||m}for(se.lastIndex=0;l>=0&&se.test(i);)i=i.replace(se,d),se.lastIndex=0,l-=1;return i}var wi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function qt(i){var s=this._longDateFormat[i],l=this._longDateFormat[i.toUpperCase()];return s||!l?s:(this._longDateFormat[i]=l.match(D).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[i])}var vn="Invalid date";function ei(){return this._invalidDate}var us="%d",xu=/\d{1,2}/;function Tg(i){return this._ordinal.replace("%d",i)}var Gg={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Eg(i,s,l,d){var m=this._relativeTime[l];return he(m)?m(i,s,l,d):m.replace(/%d/i,i)}function Bg(i,s){var l=this._relativeTime[i>0?"future":"past"];return he(l)?l(s):l.replace(/%s/i,s)}var qd={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function _r(i){return typeof i=="string"?qd[i]||qd[i.toLowerCase()]:void 0}function Au(i){var s={},l,d;for(d in i)a(i,d)&&(l=_r(d),l&&(s[l]=i[d]));return s}var Dg={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ng(i){var s=[],l;for(l in i)a(i,l)&&s.push({unit:l,priority:Dg[l]});return s.sort(function(d,m){return d.priority-m.priority}),s}var ef=/\d/,ir=/\d\d/,tf=/\d{3}/,ku=/\d{4}/,ha=/[+-]?\d{6}/,We=/\d\d?/,rf=/\d\d\d\d?/,nf=/\d\d\d\d\d\d?/,ga=/\d{1,3}/,Ru=/\d{1,4}/,ba=/[+-]?\d{1,6}/,Hi=/\d+/,va=/[+-]?\d+/,Wg=/Z|[+-]\d\d:?\d\d/gi,ya=/Z|[+-]\d\d(?::?\d\d)?/gi,Zg=/[+-]?\d+(\.\d{1,3})?/,cs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ji=/^[1-9]\d?/,Su=/^([1-9]\d|\d)/,_a;_a={};function W(i,s,l){_a[i]=he(s)?s:function(d,m){return d&&l?l:s}}function Yg(i,s){return a(_a,i)?_a[i](s._strict,s._locale):new RegExp(Mg(i))}function Mg(i){return yn(i.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(s,l,d,m,_){return l||d||m||_}))}function yn(i){return i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ir(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function fe(i){var s=+i,l=0;return s!==0&&isFinite(s)&&(l=Ir(s)),l}var Fu={};function Re(i,s){var l,d=s,m;for(typeof i=="string"&&(i=[i]),f(s)&&(d=function(_,R){R[s]=fe(_)}),m=i.length,l=0;l<m;l++)Fu[i[l]]=d}function ds(i,s){Re(i,function(l,d,m,_){m._w=m._w||{},s(l,m._w,m,_)})}function Xg(i,s,l){s!=null&&a(Fu,i)&&Fu[i](s,l._a,l,i)}function Ia(i){return i%4===0&&i%100!==0||i%400===0}var Dt=0,_n=1,Hr=2,ut=3,Br=4,In=5,Ci=6,Ug=7,Qg=8;G("Y",0,0,function(){var i=this.year();return i<=9999?ie(i,4):"+"+i}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),W("Y",va),W("YY",We,ir),W("YYYY",Ru,ku),W("YYYYY",ba,ha),W("YYYYYY",ba,ha),Re(["YYYYY","YYYYYY"],Dt),Re("YYYY",function(i,s){s[Dt]=i.length===2?e.parseTwoDigitYear(i):fe(i)}),Re("YY",function(i,s){s[Dt]=e.parseTwoDigitYear(i)}),Re("Y",function(i,s){s[Dt]=parseInt(i,10)});function fs(i){return Ia(i)?366:365}e.parseTwoDigitYear=function(i){return fe(i)+(fe(i)>68?1900:2e3)};var of=ji("FullYear",!0);function Vg(){return Ia(this.year())}function ji(i,s){return function(l){return l!=null?(sf(this,i,l),e.updateOffset(this,s),this):ms(this,i)}}function ms(i,s){if(!i.isValid())return NaN;var l=i._d,d=i._isUTC;switch(s){case"Milliseconds":return d?l.getUTCMilliseconds():l.getMilliseconds();case"Seconds":return d?l.getUTCSeconds():l.getSeconds();case"Minutes":return d?l.getUTCMinutes():l.getMinutes();case"Hours":return d?l.getUTCHours():l.getHours();case"Date":return d?l.getUTCDate():l.getDate();case"Day":return d?l.getUTCDay():l.getDay();case"Month":return d?l.getUTCMonth():l.getMonth();case"FullYear":return d?l.getUTCFullYear():l.getFullYear();default:return NaN}}function sf(i,s,l){var d,m,_,R,N;if(!(!i.isValid()||isNaN(l))){switch(d=i._d,m=i._isUTC,s){case"Milliseconds":return void(m?d.setUTCMilliseconds(l):d.setMilliseconds(l));case"Seconds":return void(m?d.setUTCSeconds(l):d.setSeconds(l));case"Minutes":return void(m?d.setUTCMinutes(l):d.setMinutes(l));case"Hours":return void(m?d.setUTCHours(l):d.setHours(l));case"Date":return void(m?d.setUTCDate(l):d.setDate(l));case"FullYear":break;default:return}_=l,R=i.month(),N=i.date(),N=N===29&&R===1&&!Ia(_)?28:N,m?d.setUTCFullYear(_,R,N):d.setFullYear(_,R,N)}}function Lg(i){return i=_r(i),he(this[i])?this[i]():this}function Og(i,s){if(typeof i=="object"){i=Au(i);var l=Ng(i),d,m=l.length;for(d=0;d<m;d++)this[l[d].unit](i[l[d].unit])}else if(i=_r(i),he(this[i]))return this[i](s);return this}function $g(i,s){return(i%s+s)%s}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(i){var s;for(s=0;s<this.length;++s)if(this[s]===i)return s;return-1};function Tu(i,s){if(isNaN(i)||isNaN(s))return NaN;var l=$g(s,12);return i+=(s-l)/12,l===1?Ia(i)?29:28:31-l%7%2}G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(i){return this.localeData().monthsShort(this,i)}),G("MMMM",0,0,function(i){return this.localeData().months(this,i)}),W("M",We,Ji),W("MM",We,ir),W("MMM",function(i,s){return s.monthsShortRegex(i)}),W("MMMM",function(i,s){return s.monthsRegex(i)}),Re(["M","MM"],function(i,s){s[_n]=fe(i)-1}),Re(["MMM","MMMM"],function(i,s,l,d){var m=l._locale.monthsParse(i,d,l._strict);m!=null?s[_n]=m:y(l).invalidMonth=i});var Pg="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),af="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),lf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Hg=cs,Jg=cs;function jg(i,s){return i?n(this._months)?this._months[i.month()]:this._months[(this._months.isFormat||lf).test(s)?"format":"standalone"][i.month()]:n(this._months)?this._months:this._months.standalone}function zg(i,s){return i?n(this._monthsShort)?this._monthsShort[i.month()]:this._monthsShort[lf.test(s)?"format":"standalone"][i.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Kg(i,s,l){var d,m,_,R=i.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)_=g([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(_,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(_,"").toLocaleLowerCase();return l?s==="MMM"?(m=je.call(this._shortMonthsParse,R),m!==-1?m:null):(m=je.call(this._longMonthsParse,R),m!==-1?m:null):s==="MMM"?(m=je.call(this._shortMonthsParse,R),m!==-1?m:(m=je.call(this._longMonthsParse,R),m!==-1?m:null)):(m=je.call(this._longMonthsParse,R),m!==-1?m:(m=je.call(this._shortMonthsParse,R),m!==-1?m:null))}function qg(i,s,l){var d,m,_;if(this._monthsParseExact)return Kg.call(this,i,s,l);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){if(m=g([2e3,d]),l&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(m,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(m,"").replace(".","")+"$","i")),!l&&!this._monthsParse[d]&&(_="^"+this.months(m,"")+"|^"+this.monthsShort(m,""),this._monthsParse[d]=new RegExp(_.replace(".",""),"i")),l&&s==="MMMM"&&this._longMonthsParse[d].test(i))return d;if(l&&s==="MMM"&&this._shortMonthsParse[d].test(i))return d;if(!l&&this._monthsParse[d].test(i))return d}}function uf(i,s){if(!i.isValid())return i;if(typeof s=="string"){if(/^\d+$/.test(s))s=fe(s);else if(s=i.localeData().monthsParse(s),!f(s))return i}var l=s,d=i.date();return d=d<29?d:Math.min(d,Tu(i.year(),l)),i._isUTC?i._d.setUTCMonth(l,d):i._d.setMonth(l,d),i}function cf(i){return i!=null?(uf(this,i),e.updateOffset(this,!0),this):ms(this,"Month")}function eb(){return Tu(this.year(),this.month())}function tb(i){return this._monthsParseExact?(a(this,"_monthsRegex")||df.call(this),i?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=Hg),this._monthsShortStrictRegex&&i?this._monthsShortStrictRegex:this._monthsShortRegex)}function rb(i){return this._monthsParseExact?(a(this,"_monthsRegex")||df.call(this),i?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Jg),this._monthsStrictRegex&&i?this._monthsStrictRegex:this._monthsRegex)}function df(){function i(ee,ge){return ge.length-ee.length}var s=[],l=[],d=[],m,_,R,N;for(m=0;m<12;m++)_=g([2e3,m]),R=yn(this.monthsShort(_,"")),N=yn(this.months(_,"")),s.push(R),l.push(N),d.push(N),d.push(R);s.sort(i),l.sort(i),d.sort(i),this._monthsRegex=new RegExp("^("+d.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function nb(i,s,l,d,m,_,R){var N;return i<100&&i>=0?(N=new Date(i+400,s,l,d,m,_,R),isFinite(N.getFullYear())&&N.setFullYear(i)):N=new Date(i,s,l,d,m,_,R),N}function ps(i){var s,l;return i<100&&i>=0?(l=Array.prototype.slice.call(arguments),l[0]=i+400,s=new Date(Date.UTC.apply(null,l)),isFinite(s.getUTCFullYear())&&s.setUTCFullYear(i)):s=new Date(Date.UTC.apply(null,arguments)),s}function wa(i,s,l){var d=7+s-l,m=(7+ps(i,0,d).getUTCDay()-s)%7;return-m+d-1}function ff(i,s,l,d,m){var _=(7+l-d)%7,R=wa(i,d,m),N=1+7*(s-1)+_+R,ee,ge;return N<=0?(ee=i-1,ge=fs(ee)+N):N>fs(i)?(ee=i+1,ge=N-fs(i)):(ee=i,ge=N),{year:ee,dayOfYear:ge}}function hs(i,s,l){var d=wa(i.year(),s,l),m=Math.floor((i.dayOfYear()-d-1)/7)+1,_,R;return m<1?(R=i.year()-1,_=m+wn(R,s,l)):m>wn(i.year(),s,l)?(_=m-wn(i.year(),s,l),R=i.year()+1):(R=i.year(),_=m),{week:_,year:R}}function wn(i,s,l){var d=wa(i,s,l),m=wa(i+1,s,l);return(fs(i)-d+m)/7}G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),W("w",We,Ji),W("ww",We,ir),W("W",We,Ji),W("WW",We,ir),ds(["w","ww","W","WW"],function(i,s,l,d){s[d.substr(0,1)]=fe(i)});function ib(i){return hs(i,this._week.dow,this._week.doy).week}var ob={dow:0,doy:6};function sb(){return this._week.dow}function ab(){return this._week.doy}function lb(i){var s=this.localeData().week(this);return i==null?s:this.add((i-s)*7,"d")}function ub(i){var s=hs(this,1,4).week;return i==null?s:this.add((i-s)*7,"d")}G("d",0,"do","day"),G("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),G("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),G("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),W("d",We),W("e",We),W("E",We),W("dd",function(i,s){return s.weekdaysMinRegex(i)}),W("ddd",function(i,s){return s.weekdaysShortRegex(i)}),W("dddd",function(i,s){return s.weekdaysRegex(i)}),ds(["dd","ddd","dddd"],function(i,s,l,d){var m=l._locale.weekdaysParse(i,d,l._strict);m!=null?s.d=m:y(l).invalidWeekday=i}),ds(["d","e","E"],function(i,s,l,d){s[d]=fe(i)});function cb(i,s){return typeof i!="string"?i:isNaN(i)?(i=s.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function db(i,s){return typeof i=="string"?s.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Gu(i,s){return i.slice(s,7).concat(i.slice(0,s))}var fb="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),mb="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),pb=cs,hb=cs,gb=cs;function bb(i,s){var l=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(s)?"format":"standalone"];return i===!0?Gu(l,this._week.dow):i?l[i.day()]:l}function vb(i){return i===!0?Gu(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function yb(i){return i===!0?Gu(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function _b(i,s,l){var d,m,_,R=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)_=g([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(_,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(_,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(_,"").toLocaleLowerCase();return l?s==="dddd"?(m=je.call(this._weekdaysParse,R),m!==-1?m:null):s==="ddd"?(m=je.call(this._shortWeekdaysParse,R),m!==-1?m:null):(m=je.call(this._minWeekdaysParse,R),m!==-1?m:null):s==="dddd"?(m=je.call(this._weekdaysParse,R),m!==-1||(m=je.call(this._shortWeekdaysParse,R),m!==-1)?m:(m=je.call(this._minWeekdaysParse,R),m!==-1?m:null)):s==="ddd"?(m=je.call(this._shortWeekdaysParse,R),m!==-1||(m=je.call(this._weekdaysParse,R),m!==-1)?m:(m=je.call(this._minWeekdaysParse,R),m!==-1?m:null)):(m=je.call(this._minWeekdaysParse,R),m!==-1||(m=je.call(this._weekdaysParse,R),m!==-1)?m:(m=je.call(this._shortWeekdaysParse,R),m!==-1?m:null))}function Ib(i,s,l){var d,m,_;if(this._weekdaysParseExact)return _b.call(this,i,s,l);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(m=g([2e3,1]).day(d),l&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(m,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(m,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(m,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[d]||(_="^"+this.weekdays(m,"")+"|^"+this.weekdaysShort(m,"")+"|^"+this.weekdaysMin(m,""),this._weekdaysParse[d]=new RegExp(_.replace(".",""),"i")),l&&s==="dddd"&&this._fullWeekdaysParse[d].test(i))return d;if(l&&s==="ddd"&&this._shortWeekdaysParse[d].test(i))return d;if(l&&s==="dd"&&this._minWeekdaysParse[d].test(i))return d;if(!l&&this._weekdaysParse[d].test(i))return d}}function wb(i){if(!this.isValid())return i!=null?this:NaN;var s=ms(this,"Day");return i!=null?(i=cb(i,this.localeData()),this.add(i-s,"d")):s}function Cb(i){if(!this.isValid())return i!=null?this:NaN;var s=(this.day()+7-this.localeData()._week.dow)%7;return i==null?s:this.add(i-s,"d")}function xb(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var s=db(i,this.localeData());return this.day(this.day()%7?s:s-7)}else return this.day()||7}function Ab(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Eu.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=pb),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function kb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Eu.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=hb),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Rb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Eu.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=gb),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Eu(){function i(Ot,Rn){return Rn.length-Ot.length}var s=[],l=[],d=[],m=[],_,R,N,ee,ge;for(_=0;_<7;_++)R=g([2e3,1]).day(_),N=yn(this.weekdaysMin(R,"")),ee=yn(this.weekdaysShort(R,"")),ge=yn(this.weekdays(R,"")),s.push(N),l.push(ee),d.push(ge),m.push(N),m.push(ee),m.push(ge);s.sort(i),l.sort(i),d.sort(i),m.sort(i),this._weekdaysRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Bu(){return this.hours()%12||12}function Sb(){return this.hours()||24}G("H",["HH",2],0,"hour"),G("h",["hh",2],0,Bu),G("k",["kk",2],0,Sb),G("hmm",0,0,function(){return""+Bu.apply(this)+ie(this.minutes(),2)}),G("hmmss",0,0,function(){return""+Bu.apply(this)+ie(this.minutes(),2)+ie(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+ie(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+ie(this.minutes(),2)+ie(this.seconds(),2)});function pf(i,s){G(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),s)})}pf("a",!0),pf("A",!1);function hf(i,s){return s._meridiemParse}W("a",hf),W("A",hf),W("H",We,Su),W("h",We,Ji),W("k",We,Ji),W("HH",We,ir),W("hh",We,ir),W("kk",We,ir),W("hmm",rf),W("hmmss",nf),W("Hmm",rf),W("Hmmss",nf),Re(["H","HH"],ut),Re(["k","kk"],function(i,s,l){var d=fe(i);s[ut]=d===24?0:d}),Re(["a","A"],function(i,s,l){l._isPm=l._locale.isPM(i),l._meridiem=i}),Re(["h","hh"],function(i,s,l){s[ut]=fe(i),y(l).bigHour=!0}),Re("hmm",function(i,s,l){var d=i.length-2;s[ut]=fe(i.substr(0,d)),s[Br]=fe(i.substr(d)),y(l).bigHour=!0}),Re("hmmss",function(i,s,l){var d=i.length-4,m=i.length-2;s[ut]=fe(i.substr(0,d)),s[Br]=fe(i.substr(d,2)),s[In]=fe(i.substr(m)),y(l).bigHour=!0}),Re("Hmm",function(i,s,l){var d=i.length-2;s[ut]=fe(i.substr(0,d)),s[Br]=fe(i.substr(d))}),Re("Hmmss",function(i,s,l){var d=i.length-4,m=i.length-2;s[ut]=fe(i.substr(0,d)),s[Br]=fe(i.substr(d,2)),s[In]=fe(i.substr(m))});function Fb(i){return(i+"").toLowerCase().charAt(0)==="p"}var Tb=/[ap]\.?m?\.?/i,Gb=ji("Hours",!0);function Eb(i,s,l){return i>11?l?"pm":"PM":l?"am":"AM"}var gf={calendar:Kt,longDateFormat:wi,invalidDate:vn,ordinal:us,dayOfMonthOrdinalParse:xu,relativeTime:Gg,months:Pg,monthsShort:af,week:ob,weekdays:fb,weekdaysMin:mb,weekdaysShort:mf,meridiemParse:Tb},Ue={},gs={},bs;function Bb(i,s){var l,d=Math.min(i.length,s.length);for(l=0;l<d;l+=1)if(i[l]!==s[l])return l;return d}function bf(i){return i&&i.toLowerCase().replace("_","-")}function Db(i){for(var s=0,l,d,m,_;s<i.length;){for(_=bf(i[s]).split("-"),l=_.length,d=bf(i[s+1]),d=d?d.split("-"):null;l>0;){if(m=Ca(_.slice(0,l).join("-")),m)return m;if(d&&d.length>=l&&Bb(_,d)>=l-1)break;l--}s++}return bs}function Nb(i){return!!(i&&i.match("^[^/\\\\]*$"))}function Ca(i){var s=null,l;if(Ue[i]===void 0&&typeof io!="undefined"&&io&&io.exports&&Nb(i))try{s=bs._abbr,l=require,l("./locale/"+i),ti(s)}catch(d){Ue[i]=null}return Ue[i]}function ti(i,s){var l;return i&&(u(s)?l=Cn(i):l=Du(i,s),l?bs=l:typeof console!="undefined"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),bs._abbr}function Du(i,s){if(s!==null){var l,d=gf;if(s.abbr=i,Ue[i]!=null)He("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),d=Ue[i]._config;else if(s.parentLocale!=null)if(Ue[s.parentLocale]!=null)d=Ue[s.parentLocale]._config;else if(l=Ca(s.parentLocale),l!=null)d=l._config;else return gs[s.parentLocale]||(gs[s.parentLocale]=[]),gs[s.parentLocale].push({name:i,config:s}),null;return Ue[i]=new tt(Ne(d,s)),gs[i]&&gs[i].forEach(function(m){Du(m.name,m.config)}),ti(i),Ue[i]}else return delete Ue[i],null}function Wb(i,s){if(s!=null){var l,d,m=gf;Ue[i]!=null&&Ue[i].parentLocale!=null?Ue[i].set(Ne(Ue[i]._config,s)):(d=Ca(i),d!=null&&(m=d._config),s=Ne(m,s),d==null&&(s.abbr=i),l=new tt(s),l.parentLocale=Ue[i],Ue[i]=l),ti(i)}else Ue[i]!=null&&(Ue[i].parentLocale!=null?(Ue[i]=Ue[i].parentLocale,i===ti()&&ti(i)):Ue[i]!=null&&delete Ue[i]);return Ue[i]}function Cn(i){var s;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return bs;if(!n(i)){if(s=Ca(i),s)return s;i=[i]}return Db(i)}function Zb(){return xt(Ue)}function Nu(i){var s,l=i._a;return l&&y(i).overflow===-2&&(s=l[_n]<0||l[_n]>11?_n:l[Hr]<1||l[Hr]>Tu(l[Dt],l[_n])?Hr:l[ut]<0||l[ut]>24||l[ut]===24&&(l[Br]!==0||l[In]!==0||l[Ci]!==0)?ut:l[Br]<0||l[Br]>59?Br:l[In]<0||l[In]>59?In:l[Ci]<0||l[Ci]>999?Ci:-1,y(i)._overflowDayOfYear&&(s<Dt||s>Hr)&&(s=Hr),y(i)._overflowWeeks&&s===-1&&(s=Ug),y(i)._overflowWeekday&&s===-1&&(s=Qg),y(i).overflow=s),i}var Yb=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Mb=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Xb=/Z|[+-]\d\d(?::?\d\d)?/,xa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Wu=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ub=/^\/?Date\((-?\d+)/i,Qb=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Vb={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vf(i){var s,l,d=i._i,m=Yb.exec(d)||Mb.exec(d),_,R,N,ee,ge=xa.length,Ot=Wu.length;if(m){for(y(i).iso=!0,s=0,l=ge;s<l;s++)if(xa[s][1].exec(m[1])){R=xa[s][0],_=xa[s][2]!==!1;break}if(R==null){i._isValid=!1;return}if(m[3]){for(s=0,l=Ot;s<l;s++)if(Wu[s][1].exec(m[3])){N=(m[2]||" ")+Wu[s][0];break}if(N==null){i._isValid=!1;return}}if(!_&&N!=null){i._isValid=!1;return}if(m[4])if(Xb.exec(m[4]))ee="Z";else{i._isValid=!1;return}i._f=R+(N||"")+(ee||""),Yu(i)}else i._isValid=!1}function Lb(i,s,l,d,m,_){var R=[Ob(i),af.indexOf(s),parseInt(l,10),parseInt(d,10),parseInt(m,10)];return _&&R.push(parseInt(_,10)),R}function Ob(i){var s=parseInt(i,10);return s<=49?2e3+s:s<=999?1900+s:s}function $b(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Pb(i,s,l){if(i){var d=mf.indexOf(i),m=new Date(s[0],s[1],s[2]).getDay();if(d!==m)return y(l).weekdayMismatch=!0,l._isValid=!1,!1}return!0}function Hb(i,s,l){if(i)return Vb[i];if(s)return 0;var d=parseInt(l,10),m=d%100,_=(d-m)/100;return _*60+m}function yf(i){var s=Qb.exec($b(i._i)),l;if(s){if(l=Lb(s[4],s[3],s[2],s[5],s[6],s[7]),!Pb(s[1],l,i))return;i._a=l,i._tzm=Hb(s[8],s[9],s[10]),i._d=ps.apply(null,i._a),i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),y(i).rfc2822=!0}else i._isValid=!1}function Jb(i){var s=Ub.exec(i._i);if(s!==null){i._d=new Date(+s[1]);return}if(vf(i),i._isValid===!1)delete i._isValid;else return;if(yf(i),i._isValid===!1)delete i._isValid;else return;i._strict?i._isValid=!1:e.createFromInputFallback(i)}e.createFromInputFallback=ye("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(i){i._d=new Date(i._i+(i._useUTC?" UTC":""))});function zi(i,s,l){return i!=null?i:s!=null?s:l}function jb(i){var s=new Date(e.now());return i._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}function Zu(i){var s,l,d=[],m,_,R;if(!i._d){for(m=jb(i),i._w&&i._a[Hr]==null&&i._a[_n]==null&&zb(i),i._dayOfYear!=null&&(R=zi(i._a[Dt],m[Dt]),(i._dayOfYear>fs(R)||i._dayOfYear===0)&&(y(i)._overflowDayOfYear=!0),l=ps(R,0,i._dayOfYear),i._a[_n]=l.getUTCMonth(),i._a[Hr]=l.getUTCDate()),s=0;s<3&&i._a[s]==null;++s)i._a[s]=d[s]=m[s];for(;s<7;s++)i._a[s]=d[s]=i._a[s]==null?s===2?1:0:i._a[s];i._a[ut]===24&&i._a[Br]===0&&i._a[In]===0&&i._a[Ci]===0&&(i._nextDay=!0,i._a[ut]=0),i._d=(i._useUTC?ps:nb).apply(null,d),_=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[ut]=24),i._w&&typeof i._w.d!="undefined"&&i._w.d!==_&&(y(i).weekdayMismatch=!0)}}function zb(i){var s,l,d,m,_,R,N,ee,ge;s=i._w,s.GG!=null||s.W!=null||s.E!=null?(_=1,R=4,l=zi(s.GG,i._a[Dt],hs(Ze(),1,4).year),d=zi(s.W,1),m=zi(s.E,1),(m<1||m>7)&&(ee=!0)):(_=i._locale._week.dow,R=i._locale._week.doy,ge=hs(Ze(),_,R),l=zi(s.gg,i._a[Dt],ge.year),d=zi(s.w,ge.week),s.d!=null?(m=s.d,(m<0||m>6)&&(ee=!0)):s.e!=null?(m=s.e+_,(s.e<0||s.e>6)&&(ee=!0)):m=_),d<1||d>wn(l,_,R)?y(i)._overflowWeeks=!0:ee!=null?y(i)._overflowWeekday=!0:(N=ff(l,d,m,_,R),i._a[Dt]=N.year,i._dayOfYear=N.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Yu(i){if(i._f===e.ISO_8601){vf(i);return}if(i._f===e.RFC_2822){yf(i);return}i._a=[],y(i).empty=!0;var s=""+i._i,l,d,m,_,R,N=s.length,ee=0,ge,Ot;for(m=Ve(i._f,i._locale).match(D)||[],Ot=m.length,l=0;l<Ot;l++)_=m[l],d=(s.match(Yg(_,i))||[])[0],d&&(R=s.substr(0,s.indexOf(d)),R.length>0&&y(i).unusedInput.push(R),s=s.slice(s.indexOf(d)+d.length),ee+=d.length),T[_]?(d?y(i).empty=!1:y(i).unusedTokens.push(_),Xg(_,d,i)):i._strict&&!d&&y(i).unusedTokens.push(_);y(i).charsLeftOver=N-ee,s.length>0&&y(i).unusedInput.push(s),i._a[ut]<=12&&y(i).bigHour===!0&&i._a[ut]>0&&(y(i).bigHour=void 0),y(i).parsedDateParts=i._a.slice(0),y(i).meridiem=i._meridiem,i._a[ut]=Kb(i._locale,i._a[ut],i._meridiem),ge=y(i).era,ge!==null&&(i._a[Dt]=i._locale.erasConvertYear(ge,i._a[Dt])),Zu(i),Nu(i)}function Kb(i,s,l){var d;return l==null?s:i.meridiemHour!=null?i.meridiemHour(s,l):(i.isPM!=null&&(d=i.isPM(l),d&&s<12&&(s+=12),!d&&s===12&&(s=0)),s)}function qb(i){var s,l,d,m,_,R,N=!1,ee=i._f.length;if(ee===0){y(i).invalidFormat=!0,i._d=new Date(NaN);return}for(m=0;m<ee;m++)_=0,R=!1,s=te({},i),i._useUTC!=null&&(s._useUTC=i._useUTC),s._f=i._f[m],Yu(s),x(s)&&(R=!0),_+=y(s).charsLeftOver,_+=y(s).unusedTokens.length*10,y(s).score=_,N?_<d&&(d=_,l=s):(d==null||_<d||R)&&(d=_,l=s,R&&(N=!0));I(i,l||s)}function ev(i){if(!i._d){var s=Au(i._i),l=s.day===void 0?s.date:s.day;i._a=b([s.year,s.month,l,s.hour,s.minute,s.second,s.millisecond],function(d){return d&&parseInt(d,10)}),Zu(i)}}function tv(i){var s=new ae(Nu(_f(i)));return s._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function _f(i){var s=i._i,l=i._f;return i._locale=i._locale||Cn(i._l),s===null||l===void 0&&s===""?k({nullInput:!0}):(typeof s=="string"&&(i._i=s=i._locale.preparse(s)),M(s)?new ae(Nu(s)):(p(s)?i._d=s:n(l)?qb(i):l?Yu(i):rv(i),x(i)||(i._d=null),i))}function rv(i){var s=i._i;u(s)?i._d=new Date(e.now()):p(s)?i._d=new Date(s.valueOf()):typeof s=="string"?Jb(i):n(s)?(i._a=b(s.slice(0),function(l){return parseInt(l,10)}),Zu(i)):o(s)?ev(i):f(s)?i._d=new Date(s):e.createFromInputFallback(i)}function If(i,s,l,d,m){var _={};return(s===!0||s===!1)&&(d=s,s=void 0),(l===!0||l===!1)&&(d=l,l=void 0),(o(i)&&c(i)||n(i)&&i.length===0)&&(i=void 0),_._isAMomentObject=!0,_._useUTC=_._isUTC=m,_._l=l,_._i=i,_._f=s,_._strict=d,tv(_)}function Ze(i,s,l,d){return If(i,s,l,d,!1)}var nv=ye("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var i=Ze.apply(null,arguments);return this.isValid()&&i.isValid()?i<this?this:i:k()}),iv=ye("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var i=Ze.apply(null,arguments);return this.isValid()&&i.isValid()?i>this?this:i:k()});function wf(i,s){var l,d;if(s.length===1&&n(s[0])&&(s=s[0]),!s.length)return Ze();for(l=s[0],d=1;d<s.length;++d)(!s[d].isValid()||s[d][i](l))&&(l=s[d]);return l}function ov(){var i=[].slice.call(arguments,0);return wf("isBefore",i)}function sv(){var i=[].slice.call(arguments,0);return wf("isAfter",i)}var av=function(){return Date.now?Date.now():+new Date},vs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function lv(i){var s,l=!1,d,m=vs.length;for(s in i)if(a(i,s)&&!(je.call(vs,s)!==-1&&(i[s]==null||!isNaN(i[s]))))return!1;for(d=0;d<m;++d)if(i[vs[d]]){if(l)return!1;parseFloat(i[vs[d]])!==fe(i[vs[d]])&&(l=!0)}return!0}function uv(){return this._isValid}function cv(){return Dr(NaN)}function Aa(i){var s=Au(i),l=s.year||0,d=s.quarter||0,m=s.month||0,_=s.week||s.isoWeek||0,R=s.day||0,N=s.hour||0,ee=s.minute||0,ge=s.second||0,Ot=s.millisecond||0;this._isValid=lv(s),this._milliseconds=+Ot+ge*1e3+ee*6e4+N*1e3*60*60,this._days=+R+_*7,this._months=+m+d*3+l*12,this._data={},this._locale=Cn(),this._bubble()}function ka(i){return i instanceof Aa}function Mu(i){return i<0?Math.round(-1*i)*-1:Math.round(i)}function dv(i,s,l){var d=Math.min(i.length,s.length),m=Math.abs(i.length-s.length),_=0,R;for(R=0;R<d;R++)(l&&i[R]!==s[R]||!l&&fe(i[R])!==fe(s[R]))&&_++;return _+m}function Cf(i,s){G(i,0,0,function(){var l=this.utcOffset(),d="+";return l<0&&(l=-l,d="-"),d+ie(~~(l/60),2)+s+ie(~~l%60,2)})}Cf("Z",":"),Cf("ZZ",""),W("Z",ya),W("ZZ",ya),Re(["Z","ZZ"],function(i,s,l){l._useUTC=!0,l._tzm=Xu(ya,i)});var fv=/([\+\-]|\d\d)/gi;function Xu(i,s){var l=(s||"").match(i),d,m,_;return l===null?null:(d=l[l.length-1]||[],m=(d+"").match(fv)||["-",0,0],_=+(m[1]*60)+fe(m[2]),_===0?0:m[0]==="+"?_:-_)}function Uu(i,s){var l,d;return s._isUTC?(l=s.clone(),d=(M(i)||p(i)?i.valueOf():Ze(i).valueOf())-l.valueOf(),l._d.setTime(l._d.valueOf()+d),e.updateOffset(l,!1),l):Ze(i).local()}function Qu(i){return-Math.round(i._d.getTimezoneOffset())}e.updateOffset=function(){};function mv(i,s,l){var d=this._offset||0,m;if(!this.isValid())return i!=null?this:NaN;if(i!=null){if(typeof i=="string"){if(i=Xu(ya,i),i===null)return this}else Math.abs(i)<16&&!l&&(i=i*60);return!this._isUTC&&s&&(m=Qu(this)),this._offset=i,this._isUTC=!0,m!=null&&this.add(m,"m"),d!==i&&(!s||this._changeInProgress?Rf(this,Dr(i-d,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?d:Qu(this)}function pv(i,s){return i!=null?(typeof i!="string"&&(i=-i),this.utcOffset(i,s),this):-this.utcOffset()}function hv(i){return this.utcOffset(0,i)}function gv(i){return this._isUTC&&(this.utcOffset(0,i),this._isUTC=!1,i&&this.subtract(Qu(this),"m")),this}function bv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var i=Xu(Wg,this._i);i!=null?this.utcOffset(i):this.utcOffset(0,!0)}return this}function vv(i){return this.isValid()?(i=i?Ze(i).utcOffset():0,(this.utcOffset()-i)%60===0):!1}function yv(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _v(){if(!u(this._isDSTShifted))return this._isDSTShifted;var i={},s;return te(i,this),i=_f(i),i._a?(s=i._isUTC?g(i._a):Ze(i._a),this._isDSTShifted=this.isValid()&&dv(i._a,s.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Iv(){return this.isValid()?!this._isUTC:!1}function wv(){return this.isValid()?this._isUTC:!1}function xf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Cv=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,xv=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(i,s){var l=i,d=null,m,_,R;return ka(i)?l={ms:i._milliseconds,d:i._days,M:i._months}:f(i)||!isNaN(+i)?(l={},s?l[s]=+i:l.milliseconds=+i):(d=Cv.exec(i))?(m=d[1]==="-"?-1:1,l={y:0,d:fe(d[Hr])*m,h:fe(d[ut])*m,m:fe(d[Br])*m,s:fe(d[In])*m,ms:fe(Mu(d[Ci]*1e3))*m}):(d=xv.exec(i))?(m=d[1]==="-"?-1:1,l={y:xi(d[2],m),M:xi(d[3],m),w:xi(d[4],m),d:xi(d[5],m),h:xi(d[6],m),m:xi(d[7],m),s:xi(d[8],m)}):l==null?l={}:typeof l=="object"&&("from"in l||"to"in l)&&(R=Av(Ze(l.from),Ze(l.to)),l={},l.ms=R.milliseconds,l.M=R.months),_=new Aa(l),ka(i)&&a(i,"_locale")&&(_._locale=i._locale),ka(i)&&a(i,"_isValid")&&(_._isValid=i._isValid),_}Dr.fn=Aa.prototype,Dr.invalid=cv;function xi(i,s){var l=i&&parseFloat(i.replace(",","."));return(isNaN(l)?0:l)*s}function Af(i,s){var l={};return l.months=s.month()-i.month()+(s.year()-i.year())*12,i.clone().add(l.months,"M").isAfter(s)&&--l.months,l.milliseconds=+s-+i.clone().add(l.months,"M"),l}function Av(i,s){var l;return i.isValid()&&s.isValid()?(s=Uu(s,i),i.isBefore(s)?l=Af(i,s):(l=Af(s,i),l.milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0}}function kf(i,s){return function(l,d){var m,_;return d!==null&&!isNaN(+d)&&(He(s,"moment()."+s+"(period, number) is deprecated. Please use moment()."+s+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),_=l,l=d,d=_),m=Dr(l,d),Rf(this,m,i),this}}function Rf(i,s,l,d){var m=s._milliseconds,_=Mu(s._days),R=Mu(s._months);i.isValid()&&(d=d==null?!0:d,R&&uf(i,ms(i,"Month")+R*l),_&&sf(i,"Date",ms(i,"Date")+_*l),m&&i._d.setTime(i._d.valueOf()+m*l),d&&e.updateOffset(i,_||R))}var kv=kf(1,"add"),Rv=kf(-1,"subtract");function Sf(i){return typeof i=="string"||i instanceof String}function Sv(i){return M(i)||p(i)||Sf(i)||f(i)||Tv(i)||Fv(i)||i===null||i===void 0}function Fv(i){var s=o(i)&&!c(i),l=!1,d=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],m,_,R=d.length;for(m=0;m<R;m+=1)_=d[m],l=l||a(i,_);return s&&l}function Tv(i){var s=n(i),l=!1;return s&&(l=i.filter(function(d){return!f(d)&&Sf(i)}).length===0),s&&l}function Gv(i){var s=o(i)&&!c(i),l=!1,d=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],m,_;for(m=0;m<d.length;m+=1)_=d[m],l=l||a(i,_);return s&&l}function Ev(i,s){var l=i.diff(s,"days",!0);return l<-6?"sameElse":l<-1?"lastWeek":l<0?"lastDay":l<1?"sameDay":l<2?"nextDay":l<7?"nextWeek":"sameElse"}function Bv(i,s){arguments.length===1&&(arguments[0]?Sv(arguments[0])?(i=arguments[0],s=void 0):Gv(arguments[0])&&(s=arguments[0],i=void 0):(i=void 0,s=void 0));var l=i||Ze(),d=Uu(l,this).startOf("day"),m=e.calendarFormat(this,d)||"sameElse",_=s&&(he(s[m])?s[m].call(this,l):s[m]);return this.format(_||this.localeData().calendar(m,this,Ze(l)))}function Dv(){return new ae(this)}function Nv(i,s){var l=M(i)?i:Ze(i);return this.isValid()&&l.isValid()?(s=_r(s)||"millisecond",s==="millisecond"?this.valueOf()>l.valueOf():l.valueOf()<this.clone().startOf(s).valueOf()):!1}function Wv(i,s){var l=M(i)?i:Ze(i);return this.isValid()&&l.isValid()?(s=_r(s)||"millisecond",s==="millisecond"?this.valueOf()<l.valueOf():this.clone().endOf(s).valueOf()<l.valueOf()):!1}function Zv(i,s,l,d){var m=M(i)?i:Ze(i),_=M(s)?s:Ze(s);return this.isValid()&&m.isValid()&&_.isValid()?(d=d||"()",(d[0]==="("?this.isAfter(m,l):!this.isBefore(m,l))&&(d[1]===")"?this.isBefore(_,l):!this.isAfter(_,l))):!1}function Yv(i,s){var l=M(i)?i:Ze(i),d;return this.isValid()&&l.isValid()?(s=_r(s)||"millisecond",s==="millisecond"?this.valueOf()===l.valueOf():(d=l.valueOf(),this.clone().startOf(s).valueOf()<=d&&d<=this.clone().endOf(s).valueOf())):!1}function Mv(i,s){return this.isSame(i,s)||this.isAfter(i,s)}function Xv(i,s){return this.isSame(i,s)||this.isBefore(i,s)}function Uv(i,s,l){var d,m,_;if(!this.isValid())return NaN;if(d=Uu(i,this),!d.isValid())return NaN;switch(m=(d.utcOffset()-this.utcOffset())*6e4,s=_r(s),s){case"year":_=Ra(this,d)/12;break;case"month":_=Ra(this,d);break;case"quarter":_=Ra(this,d)/3;break;case"second":_=(this-d)/1e3;break;case"minute":_=(this-d)/6e4;break;case"hour":_=(this-d)/36e5;break;case"day":_=(this-d-m)/864e5;break;case"week":_=(this-d-m)/6048e5;break;default:_=this-d}return l?_:Ir(_)}function Ra(i,s){if(i.date()<s.date())return-Ra(s,i);var l=(s.year()-i.year())*12+(s.month()-i.month()),d=i.clone().add(l,"months"),m,_;return s-d<0?(m=i.clone().add(l-1,"months"),_=(s-d)/(d-m)):(m=i.clone().add(l+1,"months"),_=(s-d)/(m-d)),-(l+_)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Qv(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Vv(i){if(!this.isValid())return null;var s=i!==!0,l=s?this.clone().utc():this;return l.year()<0||l.year()>9999?lt(l,s?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):he(Date.prototype.toISOString)?s?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",lt(l,"Z")):lt(l,s?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Lv(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",s="",l,d,m,_;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",s="Z"),l="["+i+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",m="-MM-DD[T]HH:mm:ss.SSS",_=s+'[")]',this.format(l+d+m+_)}function Ov(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var s=lt(this,i);return this.localeData().postformat(s)}function $v(i,s){return this.isValid()&&(M(i)&&i.isValid()||Ze(i).isValid())?Dr({to:this,from:i}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function Pv(i){return this.from(Ze(),i)}function Hv(i,s){return this.isValid()&&(M(i)&&i.isValid()||Ze(i).isValid())?Dr({from:this,to:i}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function Jv(i){return this.to(Ze(),i)}function Ff(i){var s;return i===void 0?this._locale._abbr:(s=Cn(i),s!=null&&(this._locale=s),this)}var Tf=ye("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Gf(){return this._locale}var Sa=1e3,Ki=60*Sa,Fa=60*Ki,Ef=(365*400+97)*24*Fa;function qi(i,s){return(i%s+s)%s}function Bf(i,s,l){return i<100&&i>=0?new Date(i+400,s,l)-Ef:new Date(i,s,l).valueOf()}function Df(i,s,l){return i<100&&i>=0?Date.UTC(i+400,s,l)-Ef:Date.UTC(i,s,l)}function jv(i){var s,l;if(i=_r(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(l=this._isUTC?Df:Bf,i){case"year":s=l(this.year(),0,1);break;case"quarter":s=l(this.year(),this.month()-this.month()%3,1);break;case"month":s=l(this.year(),this.month(),1);break;case"week":s=l(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":s=l(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":s=l(this.year(),this.month(),this.date());break;case"hour":s=this._d.valueOf(),s-=qi(s+(this._isUTC?0:this.utcOffset()*Ki),Fa);break;case"minute":s=this._d.valueOf(),s-=qi(s,Ki);break;case"second":s=this._d.valueOf(),s-=qi(s,Sa);break}return this._d.setTime(s),e.updateOffset(this,!0),this}function zv(i){var s,l;if(i=_r(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(l=this._isUTC?Df:Bf,i){case"year":s=l(this.year()+1,0,1)-1;break;case"quarter":s=l(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":s=l(this.year(),this.month()+1,1)-1;break;case"week":s=l(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":s=l(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":s=l(this.year(),this.month(),this.date()+1)-1;break;case"hour":s=this._d.valueOf(),s+=Fa-qi(s+(this._isUTC?0:this.utcOffset()*Ki),Fa)-1;break;case"minute":s=this._d.valueOf(),s+=Ki-qi(s,Ki)-1;break;case"second":s=this._d.valueOf(),s+=Sa-qi(s,Sa)-1;break}return this._d.setTime(s),e.updateOffset(this,!0),this}function Kv(){return this._d.valueOf()-(this._offset||0)*6e4}function qv(){return Math.floor(this.valueOf()/1e3)}function ey(){return new Date(this.valueOf())}function ty(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function ry(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function ny(){return this.isValid()?this.toISOString():null}function iy(){return x(this)}function oy(){return I({},y(this))}function sy(){return y(this).overflow}function ay(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}G("N",0,0,"eraAbbr"),G("NN",0,0,"eraAbbr"),G("NNN",0,0,"eraAbbr"),G("NNNN",0,0,"eraName"),G("NNNNN",0,0,"eraNarrow"),G("y",["y",1],"yo","eraYear"),G("y",["yy",2],0,"eraYear"),G("y",["yyy",3],0,"eraYear"),G("y",["yyyy",4],0,"eraYear"),W("N",Vu),W("NN",Vu),W("NNN",Vu),W("NNNN",vy),W("NNNNN",yy),Re(["N","NN","NNN","NNNN","NNNNN"],function(i,s,l,d){var m=l._locale.erasParse(i,d,l._strict);m?y(l).era=m:y(l).invalidEra=i}),W("y",Hi),W("yy",Hi),W("yyy",Hi),W("yyyy",Hi),W("yo",_y),Re(["y","yy","yyy","yyyy"],Dt),Re(["yo"],function(i,s,l,d){var m;l._locale._eraYearOrdinalRegex&&(m=i.match(l._locale._eraYearOrdinalRegex)),l._locale.eraYearOrdinalParse?s[Dt]=l._locale.eraYearOrdinalParse(i,m):s[Dt]=parseInt(i,10)});function ly(i,s){var l,d,m,_=this._eras||Cn("en")._eras;for(l=0,d=_.length;l<d;++l)switch(typeof _[l].since==="string"&&(m=e(_[l].since).startOf("day"),_[l].since=m.valueOf()),typeof _[l].until){case"undefined":_[l].until=1/0;break;case"string":m=e(_[l].until).startOf("day").valueOf(),_[l].until=m.valueOf();break}return _}function uy(i,s,l){var d,m,_=this.eras(),R,N,ee;for(i=i.toUpperCase(),d=0,m=_.length;d<m;++d)if(R=_[d].name.toUpperCase(),N=_[d].abbr.toUpperCase(),ee=_[d].narrow.toUpperCase(),l)switch(s){case"N":case"NN":case"NNN":if(N===i)return _[d];break;case"NNNN":if(R===i)return _[d];break;case"NNNNN":if(ee===i)return _[d];break}else if([R,N,ee].indexOf(i)>=0)return _[d]}function cy(i,s){var l=i.since<=i.until?1:-1;return s===void 0?e(i.since).year():e(i.since).year()+(s-i.offset)*l}function dy(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;i<s;++i)if(l=this.clone().startOf("day").valueOf(),d[i].since<=l&&l<=d[i].until||d[i].until<=l&&l<=d[i].since)return d[i].name;return""}function fy(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;i<s;++i)if(l=this.clone().startOf("day").valueOf(),d[i].since<=l&&l<=d[i].until||d[i].until<=l&&l<=d[i].since)return d[i].narrow;return""}function my(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;i<s;++i)if(l=this.clone().startOf("day").valueOf(),d[i].since<=l&&l<=d[i].until||d[i].until<=l&&l<=d[i].since)return d[i].abbr;return""}function py(){var i,s,l,d,m=this.localeData().eras();for(i=0,s=m.length;i<s;++i)if(l=m[i].since<=m[i].until?1:-1,d=this.clone().startOf("day").valueOf(),m[i].since<=d&&d<=m[i].until||m[i].until<=d&&d<=m[i].since)return(this.year()-e(m[i].since).year())*l+m[i].offset;return this.year()}function hy(i){return a(this,"_erasNameRegex")||Lu.call(this),i?this._erasNameRegex:this._erasRegex}function gy(i){return a(this,"_erasAbbrRegex")||Lu.call(this),i?this._erasAbbrRegex:this._erasRegex}function by(i){return a(this,"_erasNarrowRegex")||Lu.call(this),i?this._erasNarrowRegex:this._erasRegex}function Vu(i,s){return s.erasAbbrRegex(i)}function vy(i,s){return s.erasNameRegex(i)}function yy(i,s){return s.erasNarrowRegex(i)}function _y(i,s){return s._eraYearOrdinalRegex||Hi}function Lu(){var i=[],s=[],l=[],d=[],m,_,R,N,ee,ge=this.eras();for(m=0,_=ge.length;m<_;++m)R=yn(ge[m].name),N=yn(ge[m].abbr),ee=yn(ge[m].narrow),s.push(R),i.push(N),l.push(ee),d.push(R),d.push(N),d.push(ee);this._erasRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+l.join("|")+")","i")}G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ta(i,s){G(0,[i,i.length],0,s)}Ta("gggg","weekYear"),Ta("ggggg","weekYear"),Ta("GGGG","isoWeekYear"),Ta("GGGGG","isoWeekYear"),W("G",va),W("g",va),W("GG",We,ir),W("gg",We,ir),W("GGGG",Ru,ku),W("gggg",Ru,ku),W("GGGGG",ba,ha),W("ggggg",ba,ha),ds(["gggg","ggggg","GGGG","GGGGG"],function(i,s,l,d){s[d.substr(0,2)]=fe(i)}),ds(["gg","GG"],function(i,s,l,d){s[d]=e.parseTwoDigitYear(i)});function Iy(i){return Nf.call(this,i,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function wy(i){return Nf.call(this,i,this.isoWeek(),this.isoWeekday(),1,4)}function Cy(){return wn(this.year(),1,4)}function xy(){return wn(this.isoWeekYear(),1,4)}function Ay(){var i=this.localeData()._week;return wn(this.year(),i.dow,i.doy)}function ky(){var i=this.localeData()._week;return wn(this.weekYear(),i.dow,i.doy)}function Nf(i,s,l,d,m){var _;return i==null?hs(this,d,m).year:(_=wn(i,d,m),s>_&&(s=_),Ry.call(this,i,s,l,d,m))}function Ry(i,s,l,d,m){var _=ff(i,s,l,d,m),R=ps(_.year,0,_.dayOfYear);return this.year(R.getUTCFullYear()),this.month(R.getUTCMonth()),this.date(R.getUTCDate()),this}G("Q",0,"Qo","quarter"),W("Q",ef),Re("Q",function(i,s){s[_n]=(fe(i)-1)*3});function Sy(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}G("D",["DD",2],"Do","date"),W("D",We,Ji),W("DD",We,ir),W("Do",function(i,s){return i?s._dayOfMonthOrdinalParse||s._ordinalParse:s._dayOfMonthOrdinalParseLenient}),Re(["D","DD"],Hr),Re("Do",function(i,s){s[Hr]=fe(i.match(We)[0])});var Wf=ji("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),W("DDD",ga),W("DDDD",tf),Re(["DDD","DDDD"],function(i,s,l){l._dayOfYear=fe(i)});function Fy(i){var s=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?s:this.add(i-s,"d")}G("m",["mm",2],0,"minute"),W("m",We,Su),W("mm",We,ir),Re(["m","mm"],Br);var Ty=ji("Minutes",!1);G("s",["ss",2],0,"second"),W("s",We,Su),W("ss",We,ir),Re(["s","ss"],In);var Gy=ji("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return this.millisecond()*10}),G(0,["SSSSS",5],0,function(){return this.millisecond()*100}),G(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),G(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),G(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),G(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),W("S",ga,ef),W("SS",ga,ir),W("SSS",ga,tf);var ri,Zf;for(ri="SSSS";ri.length<=9;ri+="S")W(ri,Hi);function Ey(i,s){s[Ci]=fe(("0."+i)*1e3)}for(ri="S";ri.length<=9;ri+="S")Re(ri,Ey);Zf=ji("Milliseconds",!1),G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");function By(){return this._isUTC?"UTC":""}function Dy(){return this._isUTC?"Coordinated Universal Time":""}var F=ae.prototype;F.add=kv,F.calendar=Bv,F.clone=Dv,F.diff=Uv,F.endOf=zv,F.format=Ov,F.from=$v,F.fromNow=Pv,F.to=Hv,F.toNow=Jv,F.get=Lg,F.invalidAt=sy,F.isAfter=Nv,F.isBefore=Wv,F.isBetween=Zv,F.isSame=Yv,F.isSameOrAfter=Mv,F.isSameOrBefore=Xv,F.isValid=iy,F.lang=Tf,F.locale=Ff,F.localeData=Gf,F.max=iv,F.min=nv,F.parsingFlags=oy,F.set=Og,F.startOf=jv,F.subtract=Rv,F.toArray=ty,F.toObject=ry,F.toDate=ey,F.toISOString=Vv,F.inspect=Lv,typeof Symbol!="undefined"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=ny,F.toString=Qv,F.unix=qv,F.valueOf=Kv,F.creationData=ay,F.eraName=dy,F.eraNarrow=fy,F.eraAbbr=my,F.eraYear=py,F.year=of,F.isLeapYear=Vg,F.weekYear=Iy,F.isoWeekYear=wy,F.quarter=F.quarters=Sy,F.month=cf,F.daysInMonth=eb,F.week=F.weeks=lb,F.isoWeek=F.isoWeeks=ub,F.weeksInYear=Ay,F.weeksInWeekYear=ky,F.isoWeeksInYear=Cy,F.isoWeeksInISOWeekYear=xy,F.date=Wf,F.day=F.days=wb,F.weekday=Cb,F.isoWeekday=xb,F.dayOfYear=Fy,F.hour=F.hours=Gb,F.minute=F.minutes=Ty,F.second=F.seconds=Gy,F.millisecond=F.milliseconds=Zf,F.utcOffset=mv,F.utc=hv,F.local=gv,F.parseZone=bv,F.hasAlignedHourOffset=vv,F.isDST=yv,F.isLocal=Iv,F.isUtcOffset=wv,F.isUtc=xf,F.isUTC=xf,F.zoneAbbr=By,F.zoneName=Dy,F.dates=ye("dates accessor is deprecated. Use date instead.",Wf),F.months=ye("months accessor is deprecated. Use month instead",cf),F.years=ye("years accessor is deprecated. Use year instead",of),F.zone=ye("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",pv),F.isDSTShifted=ye("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_v);function Ny(i){return Ze(i*1e3)}function Wy(){return Ze.apply(null,arguments).parseZone()}function Yf(i){return i}var we=tt.prototype;we.calendar=Q,we.longDateFormat=qt,we.invalidDate=ei,we.ordinal=Tg,we.preparse=Yf,we.postformat=Yf,we.relativeTime=Eg,we.pastFuture=Bg,we.set=Lt,we.eras=ly,we.erasParse=uy,we.erasConvertYear=cy,we.erasAbbrRegex=gy,we.erasNameRegex=hy,we.erasNarrowRegex=by,we.months=jg,we.monthsShort=zg,we.monthsParse=qg,we.monthsRegex=rb,we.monthsShortRegex=tb,we.week=ib,we.firstDayOfYear=ab,we.firstDayOfWeek=sb,we.weekdays=bb,we.weekdaysMin=yb,we.weekdaysShort=vb,we.weekdaysParse=Ib,we.weekdaysRegex=Ab,we.weekdaysShortRegex=kb,we.weekdaysMinRegex=Rb,we.isPM=Fb,we.meridiem=Eb;function Ga(i,s,l,d){var m=Cn(),_=g().set(d,s);return m[l](_,i)}function Mf(i,s,l){if(f(i)&&(s=i,i=void 0),i=i||"",s!=null)return Ga(i,s,l,"month");var d,m=[];for(d=0;d<12;d++)m[d]=Ga(i,d,l,"month");return m}function Ou(i,s,l,d){typeof i=="boolean"?(f(s)&&(l=s,s=void 0),s=s||""):(s=i,l=s,i=!1,f(s)&&(l=s,s=void 0),s=s||"");var m=Cn(),_=i?m._week.dow:0,R,N=[];if(l!=null)return Ga(s,(l+_)%7,d,"day");for(R=0;R<7;R++)N[R]=Ga(s,(R+_)%7,d,"day");return N}function Zy(i,s){return Mf(i,s,"months")}function Yy(i,s){return Mf(i,s,"monthsShort")}function My(i,s,l){return Ou(i,s,l,"weekdays")}function Xy(i,s,l){return Ou(i,s,l,"weekdaysShort")}function Uy(i,s,l){return Ou(i,s,l,"weekdaysMin")}ti("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var s=i%10,l=fe(i%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th";return i+l}}),e.lang=ye("moment.lang is deprecated. Use moment.locale instead.",ti),e.langData=ye("moment.langData is deprecated. Use moment.localeData instead.",Cn);var xn=Math.abs;function Qy(){var i=this._data;return this._milliseconds=xn(this._milliseconds),this._days=xn(this._days),this._months=xn(this._months),i.milliseconds=xn(i.milliseconds),i.seconds=xn(i.seconds),i.minutes=xn(i.minutes),i.hours=xn(i.hours),i.months=xn(i.months),i.years=xn(i.years),this}function Xf(i,s,l,d){var m=Dr(s,l);return i._milliseconds+=d*m._milliseconds,i._days+=d*m._days,i._months+=d*m._months,i._bubble()}function Vy(i,s){return Xf(this,i,s,1)}function Ly(i,s){return Xf(this,i,s,-1)}function Uf(i){return i<0?Math.floor(i):Math.ceil(i)}function Oy(){var i=this._milliseconds,s=this._days,l=this._months,d=this._data,m,_,R,N,ee;return i>=0&&s>=0&&l>=0||i<=0&&s<=0&&l<=0||(i+=Uf($u(l)+s)*864e5,s=0,l=0),d.milliseconds=i%1e3,m=Ir(i/1e3),d.seconds=m%60,_=Ir(m/60),d.minutes=_%60,R=Ir(_/60),d.hours=R%24,s+=Ir(R/24),ee=Ir(Qf(s)),l+=ee,s-=Uf($u(ee)),N=Ir(l/12),l%=12,d.days=s,d.months=l,d.years=N,this}function Qf(i){return i*4800/146097}function $u(i){return i*146097/4800}function $y(i){if(!this.isValid())return NaN;var s,l,d=this._milliseconds;if(i=_r(i),i==="month"||i==="quarter"||i==="year")switch(s=this._days+d/864e5,l=this._months+Qf(s),i){case"month":return l;case"quarter":return l/3;case"year":return l/12}else switch(s=this._days+Math.round($u(this._months)),i){case"week":return s/7+d/6048e5;case"day":return s+d/864e5;case"hour":return s*24+d/36e5;case"minute":return s*1440+d/6e4;case"second":return s*86400+d/1e3;case"millisecond":return Math.floor(s*864e5)+d;default:throw new Error("Unknown unit "+i)}}function An(i){return function(){return this.as(i)}}var Vf=An("ms"),Py=An("s"),Hy=An("m"),Jy=An("h"),jy=An("d"),zy=An("w"),Ky=An("M"),qy=An("Q"),e_=An("y"),t_=Vf;function r_(){return Dr(this)}function n_(i){return i=_r(i),this.isValid()?this[i+"s"]():NaN}function Ai(i){return function(){return this.isValid()?this._data[i]:NaN}}var i_=Ai("milliseconds"),o_=Ai("seconds"),s_=Ai("minutes"),a_=Ai("hours"),l_=Ai("days"),u_=Ai("months"),c_=Ai("years");function d_(){return Ir(this.days()/7)}var kn=Math.round,eo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function f_(i,s,l,d,m){return m.relativeTime(s||1,!!l,i,d)}function m_(i,s,l,d){var m=Dr(i).abs(),_=kn(m.as("s")),R=kn(m.as("m")),N=kn(m.as("h")),ee=kn(m.as("d")),ge=kn(m.as("M")),Ot=kn(m.as("w")),Rn=kn(m.as("y")),ni=_<=l.ss&&["s",_]||_<l.s&&["ss",_]||R<=1&&["m"]||R<l.m&&["mm",R]||N<=1&&["h"]||N<l.h&&["hh",N]||ee<=1&&["d"]||ee<l.d&&["dd",ee];return l.w!=null&&(ni=ni||Ot<=1&&["w"]||Ot<l.w&&["ww",Ot]),ni=ni||ge<=1&&["M"]||ge<l.M&&["MM",ge]||Rn<=1&&["y"]||["yy",Rn],ni[2]=s,ni[3]=+i>0,ni[4]=d,f_.apply(null,ni)}function p_(i){return i===void 0?kn:typeof i=="function"?(kn=i,!0):!1}function h_(i,s){return eo[i]===void 0?!1:s===void 0?eo[i]:(eo[i]=s,i==="s"&&(eo.ss=s-1),!0)}function g_(i,s){if(!this.isValid())return this.localeData().invalidDate();var l=!1,d=eo,m,_;return typeof i=="object"&&(s=i,i=!1),typeof i=="boolean"&&(l=i),typeof s=="object"&&(d=Object.assign({},eo,s),s.s!=null&&s.ss==null&&(d.ss=s.s-1)),m=this.localeData(),_=m_(this,!l,d,m),l&&(_=m.pastFuture(+this,_)),m.postformat(_)}var Pu=Math.abs;function to(i){return(i>0)-(i<0)||+i}function Ea(){if(!this.isValid())return this.localeData().invalidDate();var i=Pu(this._milliseconds)/1e3,s=Pu(this._days),l=Pu(this._months),d,m,_,R,N=this.asSeconds(),ee,ge,Ot,Rn;return N?(d=Ir(i/60),m=Ir(d/60),i%=60,d%=60,_=Ir(l/12),l%=12,R=i?i.toFixed(3).replace(/\.?0+$/,""):"",ee=N<0?"-":"",ge=to(this._months)!==to(N)?"-":"",Ot=to(this._days)!==to(N)?"-":"",Rn=to(this._milliseconds)!==to(N)?"-":"",ee+"P"+(_?ge+_+"Y":"")+(l?ge+l+"M":"")+(s?Ot+s+"D":"")+(m||d||i?"T":"")+(m?Rn+m+"H":"")+(d?Rn+d+"M":"")+(i?Rn+R+"S":"")):"P0D"}var _e=Aa.prototype;_e.isValid=uv,_e.abs=Qy,_e.add=Vy,_e.subtract=Ly,_e.as=$y,_e.asMilliseconds=Vf,_e.asSeconds=Py,_e.asMinutes=Hy,_e.asHours=Jy,_e.asDays=jy,_e.asWeeks=zy,_e.asMonths=Ky,_e.asQuarters=qy,_e.asYears=e_,_e.valueOf=t_,_e._bubble=Oy,_e.clone=r_,_e.get=n_,_e.milliseconds=i_,_e.seconds=o_,_e.minutes=s_,_e.hours=a_,_e.days=l_,_e.weeks=d_,_e.months=u_,_e.years=c_,_e.humanize=g_,_e.toISOString=Ea,_e.toString=Ea,_e.toJSON=Ea,_e.locale=Ff,_e.localeData=Gf,_e.toIsoString=ye("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ea),_e.lang=Tf,G("X",0,0,"unix"),G("x",0,0,"valueOf"),W("x",va),W("X",Zg),Re("X",function(i,s,l){l._d=new Date(parseFloat(i)*1e3)}),Re("x",function(i,s,l){l._d=new Date(fe(i))});return e.version="2.30.1",t(Ze),e.fn=F,e.min=ov,e.max=sv,e.now=av,e.utc=g,e.unix=Ny,e.months=Zy,e.isDate=p,e.locale=ti,e.invalid=k,e.duration=Dr,e.isMoment=M,e.weekdays=My,e.parseZone=Wy,e.localeData=Cn,e.isDuration=ka,e.monthsShort=Yy,e.weekdaysMin=Uy,e.defineLocale=Du,e.updateLocale=Wb,e.locales=Zb,e.weekdaysShort=Xy,e.normalizeUnits=_r,e.relativeTimeRounding=p_,e.relativeTimeThreshold=h_,e.calendarFormat=Ev,e.prototype=F,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var dC={};x_(dC,{default:()=>Cu});module.exports=A_(dC);var _s=class{constructor(e){h(this,"deps",e);h(this,"lastExpiredKeys",new Set)}startPeriodicTask(){let e=!0;this.periodicTask().finally(()=>{e=!1}),this.deps.registerInterval(window.setInterval(()=>{if(e){console.debug("Skip reminder interval task because task is already running.");return}e=!0,this.periodicTask().finally(()=>{e=!1})},this.deps.checkIntervalSec()*1e3))}async periodicTask(){if(this.deps.reloadUI(!1),this.deps.isScanned()||this.deps.reloadRemindersInAllFiles().then(()=>{this.deps.markScanned(),this.deps.saveData()}),this.deps.saveData(!1),this.deps.isPopupIntrusive()&&this.deps.isEditing())return;let e=this.deps.getExpiredReminders(),t=new Set(e.map(o=>o.key()));for(let o of t)if(!this.lastExpiredKeys.has(o)){this.deps.reloadUI(!0);break}if(this.lastExpiredKeys=t,!this.deps.isNotificationEnabled()||this.deps.isNotificationPaused())return;let n;for(let o of e)if(this.deps.isLayoutReady()){if(o.muteNotification)continue;if(n)for(;n.beingDisplayed;)await this.sleep(100);this.deps.showReminder(o),n=o}}async sleep(e){return new Promise(t=>setTimeout(t,e))}};var bn=require("obsidian");var cp=require("obsidian");var $f=require("obsidian");function Pf(r,e){if(!e.reminders.getExpiredReminders(e.settings.reminderTime.value).some(o=>!o.muteNotification))return!1;if(r)return!0;let n=e.reminders.muteExpiredReminders(e.settings.reminderTime.value);return e.ui.reload(!0),e.data.save(!0),new $f.Notice(`Muted ${n} reminder${n===1?"":"s"}`),!0}var Ju=require("obsidian");var Hf=require("obsidian");var Ba=class extends Hf.SuggestModal{constructor(t,n,o){super(t);h(this,"laters",n);h(this,"onSelect",o);this.setPlaceholder("Pause reminder notifications for...")}getSuggestions(t){return this.laters.filter(n=>n.label.toLowerCase().includes(t.toLowerCase()))}renderSuggestion(t,n){n.createEl("div",{text:t.label})}onChooseSuggestion(t){this.onSelect(t)}};function k_(r,e){let t=e.later();r.data.dndUntil.value=t,r.data.save(!0),r.ui.refreshDndStatusBar(),new Ju.Notice(`Reminder notifications paused until ${t.format("YYYY-MM-DD HH:mm")}`)}function Da(r){r.data.dndUntil.value=null,r.data.save(!0),r.ui.refreshDndStatusBar(),new Ju.Notice("Reminder notifications resumed")}function Na(r){new Ba(r.app,r.settings.laters.value,e=>{k_(r,e)}).open()}function Jf(r,e){return r||Na(e),!0}function ro(r,e){return r==null?!1:e.getTimeInMillis()<r.getTimeInMillis()}var no=class{constructor(e){h(this,"_value",e)}get value(){return this._value}},ii=class{constructor(e){h(this,"_value",e);h(this,"onChangeFunctions",[])}onChanged(e){this.onChangeFunctions.push(e)}get value(){return this._value}set value(e){let t=this._value;this._value=e,this.onChangeFunctions.forEach(n=>{n(t,e)})}};var or=Nr(wr(),1);var P=class r{constructor(e,t){h(this,"time",e);h(this,"_hasTimePart",t)}static now(){return new r((0,or.default)(),!0)}static parse(e){return e.length>10?new r((0,or.default)(e,"YYYY-MM-DD HH:mm"),!0):new r((0,or.default)(e,"YYYY-MM-DD"),!1)}static ofEpochMillis(e){return new r((0,or.default)(e),!0)}static duration(e,t,n,o){return t.fixedTime(o).diff(e.fixedTime(o),n)}getTimeInMillis(e){return this.fixedTime(e).valueOf()}format(e,t){return this.fixedTime(t).format(e)}toYYYYMMMM(e){return this.fixedTime(e).format("YYYY, MMMM")}toYYYYMMDD(e){return this.fixedTime(e).format("YYYY-MM-DD")}add(e,t,n){return new r(this.fixedTime(n).clone().add(e,t),this._hasTimePart)}fixedTime(e){return this._hasTimePart?this.time:e===void 0?this.time:this.time.clone().add(e.minutes,"minutes")}get hasTimePart(){return this._hasTimePart}moment(){return this.time}isValid(){return this.time.isValid()}clone(e){let t=e==null?this._hasTimePart:e,n=this.time.clone();return new r(n,t)}toString(){return this._hasTimePart?this.format("YYYY-MM-DD HH:mm"):this.format("YYYY-MM-DD")}equals(e){return this._hasTimePart===e._hasTimePart&&this.time.isSame(e.time)}},Wa=class r{constructor(e,t){h(this,"hour",e);h(this,"minute",t)}static parse(e){if(!e.match(/^\d{1,2}:\d{1,2}$/))throw`Unexpected format time(${e}). Time must be HH:mm.`;let t=e.split(":");if(t.length!==2)throw`Unexpected format time(${e}). time must be HH:mm.`;let n=parseInt(t[0]),o=parseInt(t[1]);if(n>23||n<0)throw"hour must be 0~23";if(o>59||o<0)throw"minute must be 0~59";return new r(n,o)}get minutes(){return this.hour*60+this.minute}toString(){let e=t=>t<10?"0"+t:""+t;return`${e(this.hour)}:${e(this.minute)}`}};function oo(r,e){return()=>new P((0,or.default)(),!0).add(r,e)}function jf(r){return oo(r,"minutes")}function zu(r){return oo(r,"hours")}function R_(r){return oo(r,"days")}function S_(r){return oo(r,"weeks")}function F_(r){return oo(r,"months")}function T_(r){return oo(r,"years")}function ki(r){return()=>{let e=(0,or.default)();return e.isoWeekday()<=r?new P(e.isoWeekday(r),!1):new P(e.add(1,"weeks").isoWeekday(r),!1)}}function Ku(){return()=>new P((0,or.default)().add(1,"days"),!1)}function zf(){return()=>new P((0,or.default)().add(1,"weeks"),!1)}function G_(){return()=>new P((0,or.default)().add(1,"months"),!1)}function E_(){return()=>new P((0,or.default)().add(1,"years"),!1)}var Ye=class{constructor(e,t){h(this,"label",e);h(this,"later",t)}};function Kf(r){return r.split(`
`).map(e=>B_(e.trim()))}function B_(r){if(r=r.toLowerCase(),r.startsWith("in")){let e=r.split(" ");if(e.length!==3)throw"Unsupported format. Should be 'In N (minutes|hours)'";let t=e[1]==="a"||e[1]==="an"?1:parseInt(e[1]);switch(e[2]){case"minute":case"minutes":{let n=t==1?"minute":"minutes";return new Ye(`In ${t} ${n}`,jf(t))}case"hour":case"hours":{let n=t==1?"hour":"hours";return new Ye(`In ${t} ${n}`,zu(t))}case"day":case"days":{let n=t==1?"day":"days";return new Ye(`In ${t} ${n}`,R_(t))}case"week":case"weeks":{let n=t==1?"week":"weeks";return new Ye(`In ${t} ${n}`,S_(t))}case"month":case"months":{let n=t==1?"month":"months";return new Ye(`In ${t} ${n}`,F_(t))}case"year":case"years":{let n=t==1?"year":"years";return new Ye(`In ${t} ${n}`,T_(t))}}}else if(r.startsWith("next")){let e=r.substring(5);switch(e){case"sunday":return new Ye("Next Sunday",ki(0));case"monday":return new Ye("Next Monday",ki(1));case"tuesday":return new Ye("Next Tuesday",ki(2));case"wednesday":return new Ye("Next Wednesday",ki(3));case"thursday":return new Ye("Next Thursday",ki(4));case"friday":return new Ye("Next Friday",ki(5));case"saturday":return new Ye("Next Saturday",ki(6));case"day":return new Ye("Tomorrow",Ku());case"week":return new Ye("Next week",zf());case"month":return new Ye("Next month",G_());case"year":return new Ye("Next year",E_());default:throw`Unsupported weekday: ${e}`}}else if(r==="tomorrow")return new Ye("Tomorrow",Ku());throw`Unsupported format: ${r}`}var ec=[new Ye("In 30 minutes",jf(30)),new Ye("In 1 hours",zu(1)),new Ye("In 3 hours",zu(3)),new Ye("Tomorrow",Ku()),new Ye("Next week",zf())],qu=class{constructor(){h(this,"dateFormat",new no("YYYY-MM-DD"));h(this,"dateTimeFormat",new no("YYYY-MM-DD HH:mm"));h(this,"strict",new no(!1))}setTimeFormat(e,t,n){this.dateFormat=e,this.dateTimeFormat=t,this.strict=n}parse(e){let t=this.doParse(e,!0);return t!=null?t:this.strict.value?null:this.doParse(e,!1)}doParse(e,t){let n=(0,or.default)(e,this.dateTimeFormat.value,t);if(n.isValid())return new P(n,!0);let o=(0,or.default)(e,this.dateFormat.value,t);return o.isValid()?new P(o,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},Jr=new qu;function qf(r,e){return ro(e.data.dndUntil.value,P.now())?(r||Da(e),!0):!1}function em(r,e){return r||e.fileSystem.reloadRemindersInAllFiles(),!0}function tm(r,e){return r||e.showReminderList(),!0}var oi=class oi{constructor(e,t,n,o,a){h(this,"lineIndex",e);h(this,"prefix",t);h(this,"check",n);h(this,"suffix",o);h(this,"body",a)}static parse(e,t){let n=oi.regexp.exec(t);return n?new oi(e,n.groups.prefix,n.groups.check,n.groups.suffix,n.groups.body):null}toMarkdown(){return`${this.prefix}${this.check}${this.suffix}${this.body}`}isChecked(){return oi.checkedStatuses.some(e=>e===this.check)}setChecked(e){this.check=e?"x":" "}getHeaderLength(){return this.prefix.length+this.check.length+this.suffix.length}clone(){return oi.parse(this.lineIndex,this.toMarkdown())}};h(oi,"regexp",/^(?<prefix>((> ?)*)?\s*[-*+][ ]+\[)(?<check>.)(?<suffix>\]\s+)(?<body>.*)$/),h(oi,"checkedStatuses",["x","-"]);var so=oi;function rm(r){if(so.parse(0,r)!==null)return r;let e=/^(?<lead>(?:> ?)*\s*)(?<rest>.*)$/.exec(r),t=e.groups.lead,n=e.groups.rest;if(/^#{1,6}[ ]/.test(n)||/^\d+[.)][ ]/.test(n)||n.startsWith("|")||n.startsWith("```"))return null;let o=/^(?<marker>[-*+])[ ]+(?<content>.*)$/.exec(n);if(o){let a=o.groups.marker,c=o.groups.content;return`${t}${a} [ ] ${c}`}return`${t}- [ ] ${n}`}var Sn=class{constructor(e,t){h(this,"file",e);h(this,"lines",[]);h(this,"todos",[]);this.parse(t)}parse(e){this.lines=e.split(`
`),this.todos=[],this.lines.forEach((t,n)=>{let o=so.parse(n,t);o&&this.todos.push(o)})}getTodos(){return this.todos}insertTodo(e,t){t.lineIndex=e,this.lines.splice(e,0,t.toMarkdown());let n=-1;for(let o in this.todos){let a=this.todos[o];a.lineIndex>=e&&(n<0&&(n=parseInt(o)),a.lineIndex++)}n<=0?this.todos.splice(0,0,t):this.todos.splice(n,0,t)}getTodo(e){let t=this.todos.find(n=>n.lineIndex===e);return t==null?null:t}applyChanges(){this.todos.forEach(e=>{this.lines[e.lineIndex]=e.toMarkdown()})}toMarkdown(){return this.applyChanges(),this.lines.join(`
`)}};var im=require("obsidian"),nm=window.require?window.require("electron"):void 0;function Za(){new im.Notice('Cannot insert a reminder here. Reminders can only be added to task lines such as "- [ ] Task".')}function Ya(r,e,t,n,o){let a=r.appendReminder(e,t,n);if(a!=null)return a;if(!o)return null;let c=rm(e);if(c==null)return null;let u=n==null?void 0:n+(c.length-e.length);return r.appendReminder(c,t,u)}async function om(r,e){return nm&&(await nm.remote.dialog.showMessageBox({type:"question",title:"Obsidian Reminder",message:r,detail:e,buttons:["OK","Cancel"],cancelId:1})).response===0?0:1}var ao=class r{constructor(e,t,n,o,a){h(this,"file",e);h(this,"title",t);h(this,"time",n);h(this,"rowNumber",o);h(this,"done",a);h(this,"muteNotification",!1);h(this,"beingDisplayed",!1)}key(){return this.file+this.title+this.time.toString()}isExpired(e,t){return this.time.getTimeInMillis(t)<=e}equals(e){return this.rowNumber===e.rowNumber&&this.title===e.title&&this.time.equals(e.time)&&this.file===e.file}getFileName(){return r.extractFileName(this.file)}static extractFileName(e){let t=e.split(/[/\\]/);return t[t.length-1].replace(/^(.*?)(\..+)?$/,"$1")}},Ma=class{constructor(e){h(this,"onChange",e);h(this,"fileToReminders",new Map);h(this,"reminders",[]);h(this,"reminderTime")}getExpiredReminders(e){let t=new Date().getTime(),n=[];for(let o=0;o<this.reminders.length;o++){let a=this.reminders[o];if(a.isExpired(t,e))n.push(a);else break}return n}muteExpiredReminders(e){let t=0;for(let n of this.getExpiredReminders(e))n.muteNotification||(n.muteNotification=!0,t++);return t}byDate(e){return this.reminders.filter(t=>t.time.toYYYYMMDD()===e.toYYYYMMDD())}removeReminder(e){console.debug("Remove reminder: %o",e),this.reminders.remove(e);let t=this.fileToReminders.get(e.file);t&&(t.remove(e),t.length===0&&this.fileToReminders.delete(e.file)),this.onChange()}clear(){this.fileToReminders.clear(),this.reminders=[],this.onChange()}removeByFile(e){return this.fileToReminders.delete(e)?(this.sortReminders(),!0):!1}replaceFile(e,t){let n=this.fileToReminders.get(e);if(n){if(this.equals(n,t))return!1;let o=new Map;for(let a of n)o.set(a.key(),a.muteNotification);for(let a of t){let c=o.get(a.key());o.set(a.key(),a.muteNotification),c!==void 0&&(a.muteNotification=c)}}return this.fileToReminders.set(e,t),this.sortReminders(),!0}equals(e,t){if(e.length!==t.length)return!1;let n=[...e],o=[...t];return this.sort(n),this.sort(o),n.every((a,c)=>a.equals(o[c]))}sortReminders(){let e=[];for(let t of this.fileToReminders.values())e.push(...t);this.sort(e),this.reminders=e,this.onChange()}sort(e){e.sort((t,n)=>{var a,c;let o=t.time.getTimeInMillis((a=this.reminderTime)==null?void 0:a.value)-n.time.getTimeInMillis((c=this.reminderTime)==null?void 0:c.value);return o>0?1:o<0?-1:0})}},am=[{name:"US Style (12h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M/DD (ddd)",timeFormat:"h:mm A"}},{name:"US Style (24h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M/DD (ddd)",timeFormat:"HH:mm"}},{name:"EU Style (24h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"DD/MM",shortDateWithWeekdayFormat:"D/MM (ddd)",timeFormat:"HH:mm"}},{name:"EU Style (12h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"DD/MM",shortDateWithWeekdayFormat:"D/MM (ddd)",timeFormat:"h:mm A"}},{name:"JP Style (24h)",format:{yearMonthFormat:"YYYY\u5E74MM\u6708",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M\u6708D\u65E5 (ddd)",timeFormat:"HH:mm"}},{name:"JP Style (12h)",format:{yearMonthFormat:"YYYY\u5E74MM\u6708",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M\u6708D\u65E5 (ddd)",timeFormat:"h:mm A"}}];function sm(r,e,t,n){let o=P.duration(e,r,"days",t);if(o>30)return new si(r.format(n.yearMonthFormat,t),a=>a.format(n.monthDayFormat,t));if(o>=7)return new si("Over 1 week",a=>a.format(n.monthDayFormat,t));if(r.toYYYYMMDD(t)===e.toYYYYMMDD(t)){let a=new si("Today",c=>c.format(n.timeFormat,t));return a.isToday=!0,a}return r.toYYYYMMDD(t)===e.add(1,"days",t).toYYYYMMDD()?new si("Tomorrow",a=>a.format(n.timeFormat,t)):new si(r.format(n.shortDateWithWeekdayFormat,t),a=>a.format(n.timeFormat,t))}var si=class{constructor(e,t){h(this,"name",e);h(this,"timeToStringFunc",t);h(this,"isToday",!1);h(this,"isOverdue",!1)}timeToString(e){return this.timeToStringFunc(e)}};function lm(r,e,t){let n=P.now(),o=n.getTimeInMillis(),a=[],c=[],u=[],f=sm(n,n,e,t);for(let p=0;p<r.length;p++){let b=r[p];if(b.muteNotification||b.isExpired(o,e)){u.push(b);continue}let I=sm(b.time,n,e,t);I.name!==f.name&&((c.length>0||f.isToday)&&a.push(new Is(f,c)),c=[]),c.push(b),f=I}if(c.length>0&&a.push(new Is(f,c)),u.length>0){let p=new si("Overdue",b=>b.toYYYYMMDD(e)===n.toYYYYMMDD(e)?b.format(t.timeFormat,e):b.format(t.monthDayFormat,e));p.isOverdue=!0,a.splice(0,0,new Is(p,u))}return a}var Is=class{constructor(e,t){h(this,"group",e);h(this,"reminders",t)}get name(){return this.group.name}get isOverdue(){return this.group.isOverdue}timeToString(e){return this.group.timeToString(e)}};var Nt=class Nt{constructor(e,t){h(this,"key",e);h(this,"defaultValue",t)}};h(Nt,"now",new Nt("now",P.now())),h(Nt,"useCustomEmojiForTasksPlugin",new Nt("useCustomEmojiForTasksPlugin",!1)),h(Nt,"removeTagsForTasksPlugin",new Nt("removeTagsForTasksPlugin",!1)),h(Nt,"useReminderTimeFallbackForTasksPlugin",new Nt("useReminderTimeFallbackForTasksPlugin",!1)),h(Nt,"dataviewReminderFieldName",new Nt("dataviewReminderFieldName","reminder")),h(Nt,"linkDatesToDailyNotes",new Nt("linkDatesToDailyNotes",!1)),h(Nt,"strictDateFormat",new Nt("strictDateFormat",!1));var Qe=Nt,ws=class{constructor(){h(this,"parameters",new Map)}setParameter(e,t){this.parameters.set(e.key,()=>t.value)}setParameterFunc(e,t){this.parameters.set(e.key,t)}setParameterValue(e,t){this.parameters.set(e.key,()=>t)}getParameter(e){let t=this.parameters.get(e.key);return t==null?e.defaultValue:t()}},ai=class{constructor(){h(this,"config",new ws)}setConfig(e){this.config=e}parse(e){return e.getTodos().map(t=>{let n=this.parseValidReminder(t);if(n==null)return null;let o=n.getTitle();if(o==null)return null;let a=n.getTime();if(a==null)return null;let c=new ao(e.file,o,a,t.lineIndex,t.isChecked()),u=n.computeSpan(),f=t.getHeaderLength();return{reminder:c,columnStart:u.start+f,columnEnd:u.end+f}}).filter(t=>t!=null)}async modify(e,t,n){let o=e.getTodo(t.rowNumber);if(o===null)return console.warn("Not a todo: reminder=%o",t),!1;let a=this.parseValidReminder(o);return a===null||!this.modifyReminder(e,o,a,n)?!1:(o.body=a.toMarkdown(),!0)}parseValidReminder(e){let t=this.parseReminder(e);return t===null||!this.isValidReminder(t)?null:t}isValidReminder(e){return e.getTime()!==null}modifyReminder(e,t,n,o){if(o.rawTime!==void 0){if(!n.setRawTime(o.rawTime))return console.warn("The reminder doesn't support raw time: parsed=%o",n),!1}else o.time!==void 0&&n.setTime(o.time);return o.checked!==void 0&&t.setChecked(o.checked),!0}appendReminder(e,t,n){let o=so.parse(0,e);if(o==null)return null;let a=this.parseReminder(o),c=o.getHeaderLength();return n!=null&&(n-=c),a!=null?a.setTime(t,n):(a=this.newReminder(o.body,t,n),a.setTime(t)),o.body=a.toMarkdown(),{insertedLine:o.toMarkdown(),caretPosition:c+a.getEndOfTimeTextIndex()}}isStrictDateFormat(){return this.config.getParameter(Qe.strictDateFormat)}},Xa=class{constructor(){h(this,"config");h(this,"formats",[])}setConfig(e){this.config=e,this.syncConfig()}parse(e){let t=[];for(let n of this.formats){let o=n.parse(e);o!=null&&t.push(...o)}return t}async modify(e,t,n){for(let o of this.formats)if(await o.modify(e,t,n))return!0;return!1}resetFormat(e){this.formats=e,this.syncConfig()}syncConfig(){this.config!=null&&this.formats.forEach(e=>e.setConfig(this.config))}appendReminder(e,t){return this.formats[0]==null?null:this.formats[0].appendReminder(e,t)}};var mc=Nr(wr(),1);var um="(?<open>[[(])(?<pre>\\s*)(?<key>[\\p{L}\\p{N}_-]+)::(?<mid>\\s*)(?<value>[^[\\]()]*?)(?<post>\\s*)(?<close>[)\\]])";function D_(r,e){return r==="["&&e==="]"?"bracket":r==="("&&e===")"?"paren":null}function cm(r){let e=new RegExp(um,"gu"),t=[],n;for(;(n=e.exec(r))!==null;){let o=n.groups,a=D_(o.open,o.close);a!=null&&t.push({key:o.key,value:o.value,style:a,start:n.index,end:n.index+n[0].length})}return t}function dm(r,e,t){let n=r.slice(e.start,e.end),a=new RegExp(`^${um}$`,"u").exec(n);if(a==null)return r;let c=a.groups,u=c.open.length+c.pre.length+c.key.length+2+c.mid.length,f=c.value.length,p=n.slice(0,u)+t+n.slice(u+f);return r.slice(0,e.start)+p+r.slice(e.end)}function fm(r,e,t,n="bracket"){let[o,a]=n==="bracket"?["[","]"]:["(",")"],c=`${o}${e}:: ${t}${a}`;if(r.length===0)return c;let u=/\s$/.test(r)?"":" ";return`${r}${u}${c}`}function tc(r,e){let t=e.start,n=e.end;return t>0&&r[t-1]===" "?t-=1:n<r.length&&r[n]===" "&&(n+=1),r.slice(0,t)+r.slice(n)}var Ha=Nr(wr(),1);var Cs=["MO","TU","WE","TH","FR","SA","SU"],rt=(function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Cs.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Cs[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r})();var De=function(r){return r!=null},sr=function(r){return typeof r=="number"},rc=function(r){return typeof r=="string"&&Cs.includes(r)},At=Array.isArray,Cr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n<e;n++)t.push(n);return t};var me=function(r,e){var t=0,n=[];if(At(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},mm=function(r){return At(r)?r:[r]};function Ri(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=me(t,e/t.length)),t.slice(0,e)+String(n))}var pm=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Wt=function(r,e){var t=r%e;return t*e<0?t+e:t},Ua=function(r,e){return{div:Math.floor(r/e),mod:Wt(r,e)}},ar=function(r){return!De(r)||r.length===0},ze=function(r){return!ar(r)},be=function(r,e){return ze(r)&&r.indexOf(e)!==-1};var jr=function(r,e,t,n,o,a){return n===void 0&&(n=0),o===void 0&&(o=0),a===void 0&&(a=0),new Date(Date.UTC(r,e-1,t,n,o,a))},N_=[31,28,31,30,31,30,31,31,30,31,30,31],gm=1e3*60*60*24,Qa=9999,bm=jr(1970,1,1),W_=[6,0,1,2,3,4,5];var lo=function(r){return r%4===0&&r%100!==0||r%400===0},nc=function(r){return r instanceof Date},Si=function(r){return nc(r)&&!isNaN(r.getTime())};var Z_=function(r,e){var t=r.getTime(),n=e.getTime(),o=t-n;return Math.round(o/gm)},xs=function(r){return Z_(r,bm)},Va=function(r){return new Date(bm.getTime()+r*gm)},Y_=function(r){var e=r.getUTCMonth();return e===1&&lo(r.getUTCFullYear())?29:N_[e]},Fn=function(r){return W_[r.getUTCDay()]},ic=function(r,e){var t=jr(r,e+1,1);return[Fn(t),Y_(t)]},La=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Oa=function(r){var e=new Date(r.getTime());return e},oc=function(r){for(var e=[],t=0;t<r.length;t++)e.push(Oa(r[t]));return e},Tn=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},uo=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Ri(t.getUTCFullYear().toString(),4,"0"),Ri(t.getUTCMonth()+1,2,"0"),Ri(t.getUTCDate(),2,"0"),"T",Ri(t.getUTCHours(),2,"0"),Ri(t.getUTCMinutes(),2,"0"),Ri(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},As=function(r){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,t=e.exec(r);if(!t)throw new Error("Invalid UNTIL value: ".concat(r));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))},hm=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},vm=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(hm(r,t)),o=new Date(hm(r,e!=null?e:"UTC")),a=o.getTime()-n.getTime();return new Date(r.getTime()-a)};var M_=(function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.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}},r.prototype.clone=function(){return new r(this.method,this.args)},r})(),Gn=M_;var sc=function(r,e){return sc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},sc(r,e)};function co(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sc(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var kt=function(){return kt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},kt.apply(this,arguments)};function B(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,a;n<o;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var X_=(function(r){co(e,r);function e(t,n,o){var a=r.call(this,t,n)||this;return a.iterator=o,a}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e})(Gn),ac=X_;var U_={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}},Fi=U_;var ym=function(r,e){return r.indexOf(e)!==-1},Q_=function(r){return r.toString()},V_=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},L_=(function(){function r(e,t,n,o){if(t===void 0&&(t=Q_),n===void 0&&(n=Fi),o===void 0&&(o=V_),this.text=[],this.language=n||Fi,this.gettext=t,this.dateFormatter=o,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),c=[].concat(this.options.bynmonthday);a.sort(function(b,I){return b-I}),c.sort(function(b,I){return I-b}),this.bymonthday=a.concat(c),this.bymonthday.length||(this.bymonthday=null)}if(De(this.origOptions.byweekday)){var u=At(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],f=String(u);this.byweekday={allWeeks:u.filter(function(b){return!b.n}),someWeeks:u.filter(function(b){return!!b.n}),isWeekdays:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")===-1&&f.indexOf("SU")===-1,isEveryDay:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")!==-1&&f.indexOf("SU")!==-1};var p=function(b,I){return b.weekday-I.weekday};this.byweekday.allWeeks.sort(p),this.byweekday.someWeeks.sort(p),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(ym(["dtstart","tzid","wkst","freq"],n))return!0;if(!ym(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[U.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("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(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.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")))},r.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"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var o=Math.abs(e);switch(o){case 1:case 21:case 31:t=o+n("st");break;case 2:case 22:t=o+n("nd");break;case 3:case 23:t=o+n("rd");break;default:t=o+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=sr(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,o){var a=this;o===void 0&&(o=","),At(e)||(e=[e]);var c=function(f,p,b){for(var I="",g=0;g<f.length;g++)g!==0&&(g===f.length-1?I+=" "+b+" ":I+=p+" "),I+=f[g];return I};t=t||function(f){return f.toString()};var u=function(f){return t&&t.call(a,f)};return n?c(e.map(u),o,n):e.map(u).join(o+" ")},r})(),zr=L_;var O_=(function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var o in this.rules){n=this.rules[o];var a=n.exec(this.text);a&&(e===null||a[0].length>e[0].length)&&(e=a,t=o)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.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},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r})();function ks(r,e){e===void 0&&(e=Fi);var t={},n=new O_(e.tokens);if(!n.start(r))return null;return o(),t;function o(){n.expect("every");var g=n.acceptNumber();if(g&&(t.interval=parseInt(g[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=U.DAILY,n.nextSymbol()&&(c(),I());break;case"weekday(s)":t.freq=U.WEEKLY,t.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR],n.nextSymbol(),c(),I();break;case"week(s)":t.freq=U.WEEKLY,n.nextSymbol()&&(a(),c(),I());break;case"hour(s)":t.freq=U.HOURLY,n.nextSymbol()&&(a(),I());break;case"minute(s)":t.freq=U.MINUTELY,n.nextSymbol()&&(a(),I());break;case"month(s)":t.freq=U.MONTHLY,n.nextSymbol()&&(a(),I());break;case"year(s)":t.freq=U.YEARLY,n.nextSymbol()&&(a(),I());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=U.WEEKLY;var v=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[U[v]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=f();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(U[y]),n.nextSymbol()}c(),b(),I();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(t.freq=U.YEARLY,t.bymonth=[u()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var w=u();if(!w)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(w),n.nextSymbol()}a(),I();break;default:throw new Error("Unknown symbol")}}function a(){var g=n.accept("on"),v=n.accept("the");if(g||v)do{var y=p(),w=f(),x=u();if(y)w?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(U[w].nth(y))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(y),n.accept("day(s)"));else if(w)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(U[w]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var k=n.acceptNumber();if(!k)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(k[0],10)];n.accept("comma");){if(k=n.acceptNumber(),!k)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(k[0],10))}}else if(x)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(x);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function c(){var g=n.accept("at");if(g)do{var v=n.acceptNumber();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(v[0],10)];n.accept("comma");){if(v=n.acceptNumber(),!v)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(v[0],10))}}while(n.accept("comma")||n.accept("at"))}function u(){switch(n.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 f(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function p(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var g=parseInt(n.value[1],10);if(g<-366||g>366)throw new Error("Nth out of range: "+g);return n.nextSymbol(),n.accept("last")?-g:g;default:return!1}}function b(){n.accept("on"),n.accept("the");var g=p();if(g)for(t.bymonthday=[g],n.nextSymbol();n.accept("comma");){if(g=p(),!g)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(g),n.nextSymbol()}}function I(){if(n.symbol==="until"){var g=Date.parse(n.text);if(!g)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(g)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var ue;(function(r){r[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"})(ue||(ue={}));function Rs(r){return r<ue.HOURLY}var _m=function(r,e){return e===void 0&&(e=Fi),new U(ks(r,e)||void 0)},fo=["count","until","interval","byweekday","bymonthday","bymonth"];zr.IMPLEMENTED=[];zr.IMPLEMENTED[ue.HOURLY]=fo;zr.IMPLEMENTED[ue.MINUTELY]=fo;zr.IMPLEMENTED[ue.DAILY]=["byhour"].concat(fo);zr.IMPLEMENTED[ue.WEEKLY]=fo;zr.IMPLEMENTED[ue.MONTHLY]=fo;zr.IMPLEMENTED[ue.YEARLY]=["byweekno","byyearday"].concat(fo);var Im=function(r,e,t,n){return new zr(r,e,t,n).toString()},wm=zr.isFullyConvertible;var mo=(function(){function r(e,t,n,o){this.hour=e,this.minute=t,this.second=n,this.millisecond=o||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r})();var Cm=(function(r){co(e,r);function e(t,n,o,a,c,u,f){var p=r.call(this,a,c,u,f)||this;return p.year=t,p.month=n,p.day=o,p}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return Fn(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),o=Wt(this.month,12);this.month=o,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,o){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=Ua(this.hour,24),c=a.div,u=a.mod;if(c&&(this.hour=u,this.addDaily(c)),ar(o)||be(o,this.hour))break}},e.prototype.addMinutes=function(t,n,o,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var c=Ua(this.minute,60),u=c.div,f=c.mod;if(u&&(this.minute=f,this.addHours(u,!1,o)),(ar(o)||be(o,this.hour))&&(ar(a)||be(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,o,a,c){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var u=Ua(this.second,60),f=u.div,p=u.mod;if(f&&(this.second=p,this.addMinutes(f,!1,o,a)),(ar(o)||be(o,this.hour))&&(ar(a)||be(a,this.minute))&&(ar(c)||be(c,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=ic(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Qa))return;t=ic(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var o=t.freq,a=t.interval,c=t.wkst,u=t.byhour,f=t.byminute,p=t.bysecond;switch(o){case ue.YEARLY:return this.addYears(a);case ue.MONTHLY:return this.addMonths(a);case ue.WEEKLY:return this.addWeekly(a,c);case ue.DAILY:return this.addDaily(a);case ue.HOURLY:return this.addHours(a,n,u);case ue.MINUTELY:return this.addMinutes(a,n,u,f);case ue.SECONDLY:return this.addSeconds(a,n,u,f,p)}},e})(mo);function lc(r){for(var e=[],t=Object.keys(r),n=0,o=t;n<o.length;n++){var a=o[n];be(km,a)||e.push(a),nc(r[a])&&!Si(r[a])&&e.push(a)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return kt({},r)}function xm(r){var e=kt(kt({},Ss),lc(r));if(De(e.byeaster)&&(e.freq=U.YEARLY),!(De(e.freq)&&U.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(r.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),De(e.wkst)?sr(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=U.MO.weekday,De(e.bysetpos)){sr(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var t=0;t<e.bysetpos.length;t++){var n=e.bysetpos[t];if(n===0||!(n>=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||ze(e.byweekno)||ze(e.byyearday)||e.bymonthday||ze(e.bymonthday)||De(e.byweekday)||De(e.byeaster)))switch(e.freq){case U.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case U.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case U.WEEKLY:e.byweekday=[Fn(e.dtstart)];break}if(De(e.bymonth)&&!At(e.bymonth)&&(e.bymonth=[e.bymonth]),De(e.byyearday)&&!At(e.byyearday)&&sr(e.byyearday)&&(e.byyearday=[e.byyearday]),!De(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(At(e.bymonthday)){for(var o=[],a=[],t=0;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?o.push(n):n<0&&a.push(n)}e.bymonthday=o,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(De(e.byweekno)&&!At(e.byweekno)&&(e.byweekno=[e.byweekno]),!De(e.byweekday))e.bynweekday=null;else if(sr(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(rc(e.byweekday))e.byweekday=[rt.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof rt)!e.byweekday.n||e.freq>U.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var c=[],u=[],t=0;t<e.byweekday.length;t++){var f=e.byweekday[t];if(sr(f)){c.push(f);continue}else if(rc(f)){c.push(rt.fromStr(f).weekday);continue}!f.n||e.freq>U.MONTHLY?c.push(f.weekday):u.push([f.weekday,f.n])}e.byweekday=ze(c)?c:null,e.bynweekday=ze(u)?u:null}return De(e.byhour)?sr(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<U.HOURLY?[e.dtstart.getUTCHours()]:null,De(e.byminute)?sr(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<U.MINUTELY?[e.dtstart.getUTCMinutes()]:null,De(e.bysecond)?sr(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<U.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function Am(r){var e=r.dtstart.getTime()%1e3;if(!Rs(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(o){r.bysecond.forEach(function(a){t.push(new mo(n,o,a,e))})})}),t}function Ts(r){var e=r.split(`
`).map($_).filter(function(t){return t!==null});return kt(kt({},e[0]),e[1])}function Fs(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],o=t[2];return n&&(e.tzid=n),e.dtstart=As(o),e}function $_(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Rm(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Rm(r);case"DTSTART":return Fs(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Rm(r){var e=r.replace(/^RRULE:/i,""),t=Fs(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(o){var a=o.split("="),c=a[0],u=a[1];switch(c.toUpperCase()){case"FREQ":t.freq=ue[u.toUpperCase()];break;case"WKST":t.wkst=xr[u.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var f=P_(u),p=c.toLowerCase();t[p]=f;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=H_(u);break;case"DTSTART":case"TZID":var b=Fs(r);t.tzid=b.tzid,t.dtstart=b.dtstart;break;case"UNTIL":t.until=As(u);break;case"BYEASTER":t.byeaster=Number(u);break;default:throw new Error("Unknown RRULE property '"+c+"'")}}),t}function P_(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Sm)}return Sm(r)}function Sm(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function H_(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return xr[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var o=Number(n[1]),a=n[2],c=xr[a].weekday;return new rt(c,o)})}var Ti=(function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=uo(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:vm(this.date,this.tzid)},r})();function Gs(r){for(var e=[],t="",n=Object.keys(r),o=Object.keys(Ss),a=0;a<n.length;a++)if(n[a]!=="tzid"&&be(o,n[a])){var c=n[a].toUpperCase(),u=r[n[a]],f="";if(!(!De(u)||At(u)&&!u.length)){switch(c){case"FREQ":f=U.FREQUENCIES[r.freq];break;case"WKST":sr(u)?f=new rt(u).toString():f=u.toString();break;case"BYWEEKDAY":c="BYDAY",f=mm(u).map(function(v){return v instanceof rt?v:At(v)?new rt(v[0],v[1]):new rt(v)}).toString();break;case"DTSTART":t=J_(u,r.tzid);break;case"UNTIL":f=uo(u,!r.tzid);break;default:if(At(u)){for(var p=[],b=0;b<u.length;b++)p[b]=String(u[b]);f=p.toString()}else f=String(u)}f&&e.push([c,f])}}var I=e.map(function(v){var y=v[0],w=v[1];return"".concat(y,"=").concat(w.toString())}).join(";"),g="";return I!==""&&(g="RRULE:".concat(I)),[t,g].filter(function(v){return!!v}).join(`
`)}function J_(r,e){return r?"DTSTART"+new Ti(new Date(r),e).toString():""}function j_(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var Fm=(function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?Oa(t):oc(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,o=t?Object.keys(t):[],a=function(b){for(var I=0;I<o.length;I++){var g=o[I];if(!j_(t[g],b[g]))return!0}return!1},c=this[e];if(e==="all")n=this.all;else if(At(c))for(var u=0;u<c.length;u++){var f=c[u];if(!(o.length&&a(f))){n=f._value;break}}if(!n&&this.all){for(var p=new Gn(e,t),u=0;u<this.all.length&&p.accept(this.all[u]);u++);n=p.getValue(),this._cacheAdd(e,n,t)}return At(n)?oc(n):n instanceof Date?Oa(n):n},r})();var Tm=B(B(B(B(B(B(B(B(B(B(B(B(B([],me(1,31),!0),me(2,28),!0),me(3,31),!0),me(4,30),!0),me(5,31),!0),me(6,30),!0),me(7,31),!0),me(8,31),!0),me(9,30),!0),me(10,31),!0),me(11,30),!0),me(12,31),!0),me(1,7),!0),Gm=B(B(B(B(B(B(B(B(B(B(B(B(B([],me(1,31),!0),me(2,29),!0),me(3,31),!0),me(4,30),!0),me(5,31),!0),me(6,30),!0),me(7,31),!0),me(8,31),!0),me(9,30),!0),me(10,31),!0),me(11,30),!0),me(12,31),!0),me(1,7),!0),z_=Cr(1,29),K_=Cr(1,30),li=Cr(1,31),Zt=Cr(1,32),Em=B(B(B(B(B(B(B(B(B(B(B(B(B([],Zt,!0),K_,!0),Zt,!0),li,!0),Zt,!0),li,!0),Zt,!0),Zt,!0),li,!0),Zt,!0),li,!0),Zt,!0),Zt.slice(0,7),!0),Bm=B(B(B(B(B(B(B(B(B(B(B(B(B([],Zt,!0),z_,!0),Zt,!0),li,!0),Zt,!0),li,!0),Zt,!0),Zt,!0),li,!0),Zt,!0),li,!0),Zt,!0),Zt.slice(0,7),!0),q_=Cr(-28,0),eI=Cr(-29,0),ui=Cr(-30,0),Yt=Cr(-31,0),Dm=B(B(B(B(B(B(B(B(B(B(B(B(B([],Yt,!0),eI,!0),Yt,!0),ui,!0),Yt,!0),ui,!0),Yt,!0),Yt,!0),ui,!0),Yt,!0),ui,!0),Yt,!0),Yt.slice(0,7),!0),Nm=B(B(B(B(B(B(B(B(B(B(B(B(B([],Yt,!0),q_,!0),Yt,!0),ui,!0),Yt,!0),ui,!0),Yt,!0),Yt,!0),ui,!0),Yt,!0),ui,!0),Yt,!0),Yt.slice(0,7),!0),Wm=[0,31,60,91,121,152,182,213,244,274,305,335,366],Zm=[0,31,59,90,120,151,181,212,243,273,304,334,365],uc=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(Cr(7));return r})();function Ym(r,e){var t=jr(r,1,1),n=lo(r)?366:365,o=lo(r+1)?366:365,a=xs(t),c=Fn(t),u=kt(kt({yearlen:n,nextyearlen:o,yearordinal:a,yearweekday:c},tI(r)),{wnomask:null});if(ar(e.byweekno))return u;u.wnomask=me(0,n+7);var f,p,b=f=Wt(7-c+e.wkst,7);b>=4?(b=0,p=u.yearlen+Wt(c-e.wkst,7)):p=n-b;for(var I=Math.floor(p/7),g=Wt(p,7),v=Math.floor(I+g/4),y=0;y<e.byweekno.length;y++){var w=e.byweekno[y];if(w<0&&(w+=v+1),w>0&&w<=v){var x=void 0;w>1?(x=b+(w-1)*7,b!==f&&(x-=7-f)):x=b;for(var k=0;k<7&&(u.wnomask[x]=1,x++,u.wdaymask[x]!==e.wkst);k++);}}if(be(e.byweekno,1)){var x=b+v*7;if(b!==f&&(x-=7-f),x<n)for(var y=0;y<7&&(u.wnomask[x]=1,x+=1,u.wdaymask[x]!==e.wkst);y++);}if(b){var E=void 0;if(be(e.byweekno,-1))E=-1;else{var Z=Fn(jr(r-1,1,1)),te=Wt(7-Z.valueOf()+e.wkst,7),ae=lo(r-1)?366:365,M=void 0;te>=4?(te=0,M=ae+Wt(Z-e.wkst,7)):M=n-b,E=Math.floor(52+Wt(M,7)/4)}if(be(e.byweekno,E))for(var x=0;x<b;x++)u.wnomask[x]=1}return u}function tI(r){var e=lo(r)?366:365,t=jr(r,1,1),n=Fn(t);return e===365?{mmask:Tm,mdaymask:Bm,nmdaymask:Nm,wdaymask:uc.slice(n),mrange:Zm}:{mmask:Gm,mdaymask:Em,nmdaymask:Dm,wdaymask:uc.slice(n),mrange:Wm}}function Mm(r,e,t,n,o,a){var c={lastyear:r,lastmonth:e,nwdaymask:[]},u=[];if(a.freq===U.YEARLY)if(ar(a.bymonth))u=[[0,t]];else for(var f=0;f<a.bymonth.length;f++)e=a.bymonth[f],u.push(n.slice(e-1,e+1));else a.freq===U.MONTHLY&&(u=[n.slice(e-1,e+1)]);if(ar(u))return c;c.nwdaymask=me(0,t);for(var f=0;f<u.length;f++)for(var p=u[f],b=p[0],I=p[1]-1,g=0;g<a.bynweekday.length;g++){var v=void 0,y=a.bynweekday[g],w=y[0],x=y[1];x<0?(v=I+(x+1)*7,v-=Wt(o[v]-w,7)):(v=b+(x-1)*7,v+=Wt(7-o[v]+w,7)),b<=v&&v<=I&&(c.nwdaymask[v]=1)}return c}function Xm(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),o=r%100,a=Math.floor(n/4),c=n%4,u=Math.floor((n+8)/25),f=Math.floor((n-u+1)/3),p=Math.floor(19*t+n-a-f+15)%30,b=Math.floor(o/4),I=o%4,g=Math.floor(32+2*c+2*b-p-I)%7,v=Math.floor((t+11*p+22*g)/451),y=Math.floor((p+g-7*v+114)/31),w=(p+g-7*v+114)%31+1,x=Date.UTC(r,y-1,w+e),k=Date.UTC(r,0,1);return[Math.ceil((x-k)/(1e3*60*60*24))]}var rI=(function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=Ym(e,n)),ze(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var o=this.yearinfo,a=o.yearlen,c=o.mrange,u=o.wdaymask;this.monthinfo=Mm(e,t,a,c,u,n)}De(n.byeaster)&&(this.eastermask=Xm(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[Cr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],o=this.mrange[t],a=me(null,this.yearlen),c=n;c<o;c++)a[c]=c;return[a,n,o]},r.prototype.wdayset=function(e,t,n){for(var o=me(null,this.yearlen+7),a=xs(jr(e,t,n))-this.yearordinal,c=a,u=0;u<7&&(o[a]=a,++a,this.wdaymask[a]!==this.options.wkst);u++);return[o,c,a]},r.prototype.ddayset=function(e,t,n){var o=me(null,this.yearlen),a=xs(jr(e,t,n))-this.yearordinal;return o[a]=a,[o,a,a+1]},r.prototype.htimeset=function(e,t,n,o){var a=this,c=[];return this.options.byminute.forEach(function(u){c=c.concat(a.mtimeset(e,u,n,o))}),Tn(c),c},r.prototype.mtimeset=function(e,t,n,o){var a=this.options.bysecond.map(function(c){return new mo(e,t,c,o)});return Tn(a),a},r.prototype.stimeset=function(e,t,n,o){return[new mo(e,t,n,o)]},r.prototype.getdayset=function(e){switch(e){case ue.YEARLY:return this.ydayset.bind(this);case ue.MONTHLY:return this.mdayset.bind(this);case ue.WEEKLY:return this.wdayset.bind(this);case ue.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case ue.HOURLY:return this.htimeset.bind(this);case ue.MINUTELY:return this.mtimeset.bind(this);case ue.SECONDLY:return this.stimeset.bind(this)}},r})(),Um=rI;function Qm(r,e,t,n,o,a){for(var c=[],u=0;u<r.length;u++){var f=void 0,p=void 0,b=r[u];b<0?(f=Math.floor(b/e.length),p=Wt(b,e.length)):(f=Math.floor((b-1)/e.length),p=Wt(b-1,e.length));for(var I=[],g=t;g<n;g++){var v=a[g];De(v)&&I.push(v)}var y=void 0;f<0?y=I.slice(f)[0]:y=I[f];var w=e[p],x=Va(o.yearordinal+y),k=La(x,w);be(c,k)||c.push(k)}return Tn(c),c}function $a(r,e){var t=e.dtstart,n=e.freq,o=e.interval,a=e.until,c=e.bysetpos,u=e.count;if(u===0||o===0)return En(r);var f=Cm.fromDate(t),p=new Um(e);p.rebuild(f.year,f.month);for(var b=oI(p,f,e);;){var I=p.getdayset(n)(f.year,f.month,f.day),g=I[0],v=I[1],y=I[2],w=iI(g,v,y,p,e);if(ze(c))for(var x=Qm(c,b,v,y,p,g),k=0;k<x.length;k++){var E=x[k];if(a&&E>a)return En(r);if(E>=t){var Z=Vm(E,e);if(!r.accept(Z)||u&&(--u,!u))return En(r)}}else for(var k=v;k<y;k++){var te=g[k];if(De(te))for(var ae=Va(p.yearordinal+te),M=0;M<b.length;M++){var pe=b[M],E=La(ae,pe);if(a&&E>a)return En(r);if(E>=t){var Z=Vm(E,e);if(!r.accept(Z)||u&&(--u,!u))return En(r)}}}if(e.interval===0||(f.add(e,w),f.year>Qa))return En(r);Rs(n)||(b=p.gettimeset(n)(f.hour,f.minute,f.second,0)),p.rebuild(f.year,f.month)}}function nI(r,e,t){var n=t.bymonth,o=t.byweekno,a=t.byweekday,c=t.byeaster,u=t.bymonthday,f=t.bynmonthday,p=t.byyearday;return ze(n)&&!be(n,r.mmask[e])||ze(o)&&!r.wnomask[e]||ze(a)&&!be(a,r.wdaymask[e])||ze(r.nwdaymask)&&!r.nwdaymask[e]||c!==null&&!be(r.eastermask,e)||(ze(u)||ze(f))&&!be(u,r.mdaymask[e])&&!be(f,r.nmdaymask[e])||ze(p)&&(e<r.yearlen&&!be(p,e+1)&&!be(p,-r.yearlen+e)||e>=r.yearlen&&!be(p,e+1-r.yearlen)&&!be(p,-r.nextyearlen+e-r.yearlen))}function Vm(r,e){return new Ti(r,e.tzid).rezonedDate()}function En(r){return r.getValue()}function iI(r,e,t,n,o){for(var a=!1,c=e;c<t;c++){var u=r[c];a=nI(n,u,o),a&&(r[u]=null)}return a}function oI(r,e,t){var n=t.freq,o=t.byhour,a=t.byminute,c=t.bysecond;return Rs(n)?Am(t):n>=U.HOURLY&&ze(o)&&!be(o,e.hour)||n>=U.MINUTELY&&ze(a)&&!be(a,e.minute)||n>=U.SECONDLY&&ze(c)&&!be(c,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var xr={MO:new rt(0),TU:new rt(1),WE:new rt(2),TH:new rt(3),FR:new rt(4),SA:new rt(5),SU:new rt(6)},Ss={freq:ue.YEARLY,dtstart:null,interval:1,wkst:xr.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},km=Object.keys(Ss),U=(function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new Fm,this.origOptions=lc(e);var n=xm(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return ks(e,t)},r.fromText=function(e,t){return _m(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return $a(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new ac("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Gn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,o){if(n===void 0&&(n=!1),!Si(e)||!Si(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:e,inc:n};if(o)return this._iter(new ac("between",a,o));var c=this._cacheGet("between",a);return c===!1&&(c=this._iter(new Gn("between",a)),this._cacheAdd("between",c,a)),c},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Si(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},o=this._cacheGet("before",n);return o===!1&&(o=this._iter(new Gn("before",n)),this._cacheAdd("before",o,n)),o},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Si(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},o=this._cacheGet("after",n);return o===!1&&(o=this._iter(new Gn("after",n)),this._cacheAdd("after",o,n)),o},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return Gs(this.origOptions)},r.prototype.toText=function(e,t,n){return Im(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return wm(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ue.YEARLY,r.MONTHLY=ue.MONTHLY,r.WEEKLY=ue.WEEKLY,r.DAILY=ue.DAILY,r.HOURLY=ue.HOURLY,r.MINUTELY=ue.MINUTELY,r.SECONDLY=ue.SECONDLY,r.MO=xr.MO,r.TU=xr.TU,r.WE=xr.WE,r.TH=xr.TH,r.FR=xr.FR,r.SA=xr.SA,r.SU=xr.SU,r.parseString=Ts,r.optionsToString=Gs,r})();function Lm(r,e,t,n,o,a){var c={},u=r.accept;function f(g,v){t.forEach(function(y){y.between(g,v,!0).forEach(function(w){c[Number(w)]=!0})})}o.forEach(function(g){var v=new Ti(g,a).rezonedDate();c[Number(v)]=!0}),r.accept=function(g){var v=Number(g);return isNaN(v)?u.call(this,g):!c[v]&&(f(new Date(v-1),new Date(v+1)),!c[v])?(c[v]=!0,u.call(this,g)):!0},r.method==="between"&&(f(r.args.after,r.args.before),r.accept=function(g){var v=Number(g);return c[v]?!0:(c[v]=!0,u.call(this,g))});for(var p=0;p<n.length;p++){var b=new Ti(n[p],a).rezonedDate();if(!r.accept(new Date(b.getTime())))break}e.forEach(function(g){$a(r,g.options)});var I=r._result;switch(Tn(I),r.method){case"all":case"between":return I;case"before":return I.length&&I[I.length-1]||null;default:return I.length&&I[0]||null}}var Om={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function sI(r,e){var t=[],n=[],o=[],a=[],c=Fs(r),u=c.dtstart,f=c.tzid,p=dI(r,e.unfold);return p.forEach(function(b){var I;if(b){var g=cI(b),v=g.name,y=g.parms,w=g.value;switch(v.toUpperCase()){case"RRULE":if(y.length)throw new Error("unsupported RRULE parm: ".concat(y.join(",")));t.push(Ts(b));break;case"RDATE":var x=(I=/RDATE(?:;TZID=([^:=]+))?/i.exec(b))!==null&&I!==void 0?I:[],k=x[1];k&&!f&&(f=k),n=n.concat($m(w,y));break;case"EXRULE":if(y.length)throw new Error("unsupported EXRULE parm: ".concat(y.join(",")));o.push(Ts(w));break;case"EXDATE":a=a.concat($m(w,y));break;case"DTSTART":break;default:throw new Error("unsupported property: "+v)}}}),{dtstart:u,tzid:f,rrulevals:t,rdatevals:n,exrulevals:o,exdatevals:a}}function aI(r,e){var t=sI(r,e),n=t.rrulevals,o=t.rdatevals,a=t.exrulevals,c=t.exdatevals,u=t.dtstart,f=t.tzid,p=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||o.length||a.length||c.length){var b=new dc(p);return b.dtstart(u),b.tzid(f||void 0),n.forEach(function(g){b.rrule(new U(cc(g,u,f),p))}),o.forEach(function(g){b.rdate(g)}),a.forEach(function(g){b.exrule(new U(cc(g,u,f),p))}),c.forEach(function(g){b.exdate(g)}),e.compatible&&e.dtstart&&b.rdate(u),b}var I=n[0]||{};return new U(cc(I,I.dtstart||e.dtstart||u,I.tzid||e.tzid||f),p)}function Pa(r,e){return e===void 0&&(e={}),aI(r,lI(e))}function cc(r,e,t){return kt(kt({},r),{dtstart:e,tzid:t})}function lI(r){var e=[],t=Object.keys(r),n=Object.keys(Om);if(t.forEach(function(o){be(n,o)||e.push(o)}),e.length)throw new Error("Invalid options: "+e.join(", "));return kt(kt({},Om),r)}function uI(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=pm(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function cI(r){var e=uI(r),t=e.name,n=e.value,o=t.split(";");if(!o)throw new Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:n}}function dI(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(`
`),n=0;n<t.length;){var o=t[n]=t[n].replace(/\s+$/g,"");o?n>0&&o[0]===" "?(t[n-1]+=o.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function fI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function $m(r,e){return fI(e),r.split(",").map(function(t){return As(t)})}function Pm(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n<e._rrule.length;n++){var o=e._rrule[n].origOptions[r];if(o)return o}}}var dc=(function(r){co(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=Pm.apply(n,["dtstart"]),n.tzid=Pm.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return Lm(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){Hm(t,this._rrule)},e.prototype.exrule=function(t){Hm(t,this._exrule)},e.prototype.rdate=function(t){Jm(t,this._rdate)},e.prototype.exdate=function(t){Jm(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return Pa(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return Pa(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(Gs({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&t.push(jm("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(jm("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e})(U);function Hm(r,e){if(!(r instanceof U))throw new TypeError(String(r)+" is not RRule instance");be(e.map(String),String(r))||e.push(r)}function Jm(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");be(e.map(Number),Number(r))||(e.push(r),Tn(e))}function jm(r,e,t){var n=!t||t.toUpperCase()==="UTC",o=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(c){return uo(c.valueOf(),n)}).join(",");return"".concat(o).concat(a)}function po(r,e,t){let n;try{n=U.parseText(r)}catch(p){console.warn("Failed to parse recurrence text: recurrence=%s, error=%o",r,p);return}if(!n)return;e=e.clone();let o=t.moment().clone();o.set("hour",e.get("hour")),o.set("minute",e.get("minute")),o.set("second",e.get("second")),o.set("millisecond",e.get("millisecond")),o.isAfter(e)&&(e=o);let a=e.clone();n.dtstart=e.utc(!0).toDate();let u=new U(n).after(e.toDate(),!1);if(u==null)return;let f=u.getTime()-n.dtstart.getTime();return a.add(f,"millisecond"),a.toDate()}function Ja(r){return r.replace(/#[\p{L}\p{N}\p{M}_/-]+/gu,"").trim()}var ho=class extends ai{modifyReminder(e,t,n,o){if(!super.modifyReminder(e,t,n,o))return!1;if(o.checked!==void 0)if(o.checked){let a=n.getRecurrence();if(a!==null){let c=t.clone(),u=n.clone(),f=n.getDueDate(),p=this.config.getParameter(Qe.now);if(this.usesSeparateReminderDate(n)){let b=n.getTime();if(b==null)return!1;let I=po(a,b.moment(),p);if(I==null)return!1;if(u.setTime(new P((0,Ha.default)(I),b.hasTimePart)),f!=null){let g=po(a,f.moment(),p);if(g==null)return!1;u.setDueDate(new P((0,Ha.default)(g),f.hasTimePart))}}else{if(f==null)return!1;let b=po(a,f.moment(),p);if(b==null)return!1;let I=new P((0,Ha.default)(b),f.hasTimePart);u.setTime(I)}c.body=u.toMarkdown(),c.setChecked(!1),e.insertTodo(t.lineIndex,c)}n.setDoneDate(this.config.getParameter(Qe.now))}else n.setDoneDate(void 0);return!0}};var mI=["YYYY-MM-DDTHH:mm","YYYY-MM-DD HH:mm"],pc="YYYY-MM-DD";function fc(r){for(let t of mI){let n=(0,mc.default)(r,t,!0);if(n.isValid())return new P(n,!0)}let e=(0,mc.default)(r,pc,!0);return e.isValid()?new P(e,!1):null}function zm(r){return r.hasTimePart?r.format("YYYY-MM-DDTHH:mm"):r.format(pc)}var Gi="due",ja="completion",Km="repeat",pI="scheduled",hI="start",gI=[Gi,ja,Km,pI,hI],za=class r{constructor(e,t,n){h(this,"text",e);h(this,"reminderFieldName",t);h(this,"removeTags",n)}static parse(e,t,n){return new r(e,t.toLowerCase(),n!=null?n:!1)}fields(){return cm(this.text)}fieldsByKey(e){return this.fields().filter(t=>t.key.toLowerCase()===e)}firstField(e){var t;return(t=this.fieldsByKey(e)[0])!=null?t:null}hasReminderField(){return this.firstField(this.reminderFieldName)!=null}hasAnySourceField(){return this.hasReminderField()||this.firstField(Gi)!=null}reminderSourceField(){var e;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Gi)}getTitle(){let e=new Set([...gI,this.reminderFieldName]),t=this.fields().filter(o=>e.has(o.key.toLowerCase())).sort((o,a)=>a.start-o.start),n=this.text;for(let o of t)n=tc(n,o);return n=n.trim(),this.removeTags&&(n=Ja(n)),n}getTime(){let e=this.reminderSourceField();return e==null?null:fc(e.value)}setTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Gi;this.setFieldValue(n,zm(e))}setRawTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Gi;return this.setFieldValue(n,e),!0}getDueDate(){let e=this.firstField(Gi);return e==null?null:fc(e.value)}setDueDate(e){this.setFieldValue(Gi,zm(e))}getRecurrence(){var t;let e=this.firstField(Km);return(t=e==null?void 0:e.value)!=null?t:null}getDoneDate(){let e=this.firstField(ja);return e==null?null:fc(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(ja);return}let t=e instanceof P?e.format(pc):e;this.setFieldValue(ja,t)}getEndOfTimeTextIndex(){let e=this.reminderSourceField();return e!=null?e.end:this.toMarkdown().length}computeSpan(){let e=this.reminderSourceField();return e==null?{start:0,end:0}:{start:e.start,end:e.end}}toMarkdown(){return this.text}clone(){return r.parse(this.toMarkdown(),this.reminderFieldName,this.removeTags)}setFieldValue(e,t){let n=this.firstField(e);n!=null?this.text=dm(this.text,n,t):this.text=fm(this.text,e,t,"bracket")}removeFieldByKey(e){let t=this.firstField(e);t!=null&&(this.text=tc(this.text,t))}},qa=class qa extends ho{parseReminder(e){let t=za.parse(e.body,this.reminderFieldName(),this.removeTagsEnabled());return t.hasAnySourceField()?t:null}reminderFieldName(){return this.config.getParameter(Qe.dataviewReminderFieldName)}removeTagsEnabled(){return this.config.getParameter(Qe.removeTagsForTasksPlugin)}usesSeparateReminderDate(e){return e.hasReminderField()}newReminder(e,t){let n=za.parse(e,this.reminderFieldName(),this.removeTagsEnabled());return n.setTime(t),n}};h(qa,"instance",new qa);var Ka=qa;var qm=Nr(wr(),1);var Kr=class Kr{constructor(e,t,n,o,a=null){h(this,"linkDatesToDailyNotes",e);h(this,"title1",t);h(this,"time",n);h(this,"title2",o);h(this,"recurrence",a)}static parse(e,t){t==null&&(t=!1);let n=Kr.regexp.exec(e);if(n==null)return null;let o=n.groups.title1,a=n.groups.time;if(a==null)return null;let c=n.groups.title2;t&&(a=a.replace("[[",""),a=a.replace("]]",""));let u=null,f=a.indexOf(Kr.recurrenceSymbol);if(f>=0){let p=a.substring(0,f).trim(),b=a.substring(f+Kr.recurrenceSymbol.length).trim();b!==""&&(a=p,u=b)}return new Kr(t,o,a,c,u)}getTitle(){return`${this.title1.trim()} ${this.title2.trim()}`.trim()}getTime(){return Jr.parse(this.time)}setTime(e){this.time=Jr.toString(e)}setRawTime(e){return this.time=e,!0}getEndOfTimeTextIndex(){return this.toMarkdown().length-this.title2.length}computeSpan(){let e=this.title1.length,t=this.computeGroupText();return{start:e,end:e+t.length}}toMarkdown(){return`${this.title1}${this.computeGroupText()}${this.title2}`}computeGroupText(){let e=this.recurrence!==null?`${this.time} ${Kr.recurrenceSymbol}${this.recurrence}`:this.time;return`(@${this.renderTimeText(e)})`}renderTimeText(e){if(!this.linkDatesToDailyNotes)return e;let t=Jr.parse(this.time);if(!t)return e;let n=Jr.toString(t.clone(!1));return e.replace(n,`[[${n}]]`)}clone(){return Kr.parse(this.toMarkdown(),this.linkDatesToDailyNotes)}};h(Kr,"regexp",/^(?<title1>.*?)\(@(?<time>.+?)\)(?<title2>.*)$/),h(Kr,"recurrenceSymbol","\u{1F501}");var el=Kr,tl=class tl extends ai{parseReminder(e){return el.parse(e.body,this.linkDatesToDailyNotes())}modifyReminder(e,t,n,o){if(!super.modifyReminder(e,t,n,o))return!1;if(o.checked===!0){let a=n.recurrence;if(a!==null){let c=n.getTime();if(c!==null){let u=po(a,c.moment(),this.config.getParameter(Qe.now));if(u!==void 0){let f=n.clone();f.setTime(new P((0,qm.default)(u),c.hasTimePart));let p=t.clone();p.body=f.toMarkdown(),p.setChecked(!1),e.insertTodo(t.lineIndex,p)}}}}return!0}newReminder(e,t,n){let o,a;return n!=null?(o=e.substring(0,n),a=e.substring(n)):(o=e,a=""),new el(this.linkDatesToDailyNotes(),o,t.toString(),a)}linkDatesToDailyNotes(){return this.config.getParameter(Qe.linkDatesToDailyNotes)}};h(tl,"instance",new tl);var go=tl;var hc=Nr(wr(),1);function rl(r){return r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var bI=new class{get dateTrigger(){return this.get("date-trigger","@")}get dateFormat(){return this.get("date-format","YYYY-MM-DD")}get timeTrigger(){return this.get("time-trigger","@@")}get timeFormat(){return this.get("time-format","HH:mm")}get linkDateToDailyNote(){return this.get("link-date-to-daily-note",!1)}get(e,t){var u,f;if(!window)return t;let n=(f=(u=window==null?void 0:window.app)==null?void 0:u.plugins)==null?void 0:f.plugins;if(!n)return t;let o=n["obsidian-kanban"];if(!o||!o.settings)return t;let c=o.settings[e];return c==null?t:c}},ol=class ol{constructor(e){h(this,"setting",e)}get dateRegExp(){return this.setting.linkDateToDailyNote?new RegExp(`${rl(this.setting.dateTrigger)}\\[\\[(?<date>.+?)\\]\\]`):new RegExp(`${rl(this.setting.dateTrigger)}\\{(?<date>.+?)\\}`)}get timeRegExp(){return new RegExp(`${rl(this.setting.timeTrigger)}\\{(?<time>.+?)\\}`)}format(e){let t;return this.setting.linkDateToDailyNote?t=`${this.setting.dateTrigger}[[${e.format(this.setting.dateFormat)}]]`:t=`${this.setting.dateTrigger}{${e.format(this.setting.dateFormat)}}`,e.hasTimePart?`${t} ${this.setting.timeTrigger}{${e.format(this.setting.timeFormat)}}`:t}split(e,t){let n=e,o,a,c=this.dateRegExp,u=c.exec(e);if(u)o=u.groups.date,e=e.replace(c,"");else return{title:n};let f=u.index,p=f+u[0].length,b={start:f,end:p},I=this.timeRegExp,g=I.exec(e);if(g){a=g.groups.time,e=e.replace(I,"");let x=g.index>=f?g.index+u[0].length:g.index,k=x+g[0].length;b={start:Math.min(f,x),end:Math.max(p,k)}}let v=e.trim();if(a){let x=[this.setting.timeFormat,...["h:mm A","hh:mm A","HH:mm"].filter(k=>k!==this.setting.timeFormat)];for(let k of x){let E=(0,hc.default)(`${o} ${a}`,`${this.setting.dateFormat} ${k}`,!0);if(E.isValid())return{title:v,time:new P(E,!0),span:b}}return{title:n}}let y=t!=null?t:!0,w=new P((0,hc.default)(o,this.setting.dateFormat,y),!1);return w.isValid()?{title:v,time:w,span:b}:{title:n}}};h(ol,"instance",new ol(bI));var Es=ol,nl=class r{constructor(e,t,n){h(this,"title",e);h(this,"time",t);h(this,"span",n)}static parse(e,t){let n=Es.instance.split(e,t);return n.time==null?null:new r(n.title,n.time,n.span)}getTitle(){return this.title.trim()}getTime(){return this.time?this.time:null}setTime(e){this.time=e,this.span=void 0}setRawTime(){return!1}getEndOfTimeTextIndex(){return this.toMarkdown().length}computeSpan(){if(this.span)return this.span;let e=this.title.trim().length+1,t=e+Es.instance.format(this.time).length;return{start:e,end:t}}toMarkdown(){return`${this.title.trim()} ${Es.instance.format(this.time)}`}},sl=class sl extends ai{parseReminder(e){return nl.parse(e.body,this.isStrictDateFormat())}newReminder(e,t){let n=new nl(e,t);return n.setTime(t),n}};h(sl,"instance",new sl);var il=sl;var gc=Nr(wr(),1);var Wr=class r{constructor(e,t){h(this,"primary",e);h(this,"func",t)}static ofChar(e){return new r(e,t=>t===e)}static ofChars(e){if(e.length===0)throw"empty symbol";if(e[0]==null)throw"ch mustn't be null";return e.length===0?this.ofChar(e[0]):new r(e[0],t=>e.filter(n=>t===n).length>0)}isSymbol(e){return this.func(e)}},al=class{constructor(e){h(this,"tokens",e)}setTokenText(e,t,n=!1,o=!1,a=!1,c){let u=this.getToken(e);if(u===null){if(!o)return null;if(e instanceof Wr?u={symbol:e.primary,text:t}:u={symbol:e,text:t},a&&u.symbol!==""&&!u.text.startsWith(" ")&&(u.text=" "+u.text),this.tokens.length>0){let f=this.tokens[this.tokens.length-1];this.isTokenEndsWithSpace(f)||(f.text+=" ")}if(c==null)this.tokens.push(u);else{let f=0,p=-1,b=0;for(let I of this.tokens){let g=f+I.symbol.length+I.text.length;if(b>0&&g>c){p=b;break}f=g,b++}p==-1?this.tokens.push(u):(this.tokens.splice(p,0,u),p<this.tokens.length-1&&(u.text=u.text+" "))}return u}return this.replaceTokenText(u,t,n),u}length(){return this.tokens.length}replaceTokenText(e,t,n=!1){if(!n){e.text=t;return}e.text=e.text.replace(/^(\s*).*?(\s*)$/,`$1${t}$2`)}isTokenEndsWithSpace(e){return e.text.match(/^.*\s$/)}getToken(e){for(let t of this.tokens)if(e instanceof Wr){if(e.isSymbol(t.symbol))return t}else if(e===t.symbol)return t;return null}getTokenText(e,t=!1){let n=this.getToken(e);return n===null?null:t?n.text.replace(/^\s*(.*?)\s*$/,"$1"):n.text}removeToken(e){this.tokens=this.tokens.filter(t=>!e.isSymbol(t.symbol))}forEachTokens(e){this.tokens.forEach(e)}rangeOfSymbol(e){let t=0;for(let n of this.tokens){let o=t+n.symbol.length+n.text.length;if(e.isSymbol(n.symbol))return{start:t,end:o};t=o}}join(){return this.tokens.map(e=>e.symbol+e.text).join("")}};function ep(r,e){let t=[...r],n="",o=null,a=[],c=()=>{o===null?a.push({symbol:"",text:n}):o.text=n};return t.forEach(u=>{e.filter(p=>p.isSymbol(u)).length>0?(c(),o={symbol:u,text:""},a.push(o),n=""):o!==null&&u==="#"&&(n.length===0||/\s$/.test(n))?(c(),o=null,n=u):n+=u}),n.length>0&&c(),a}var oe=class oe{constructor(e,t,n,o,a){h(this,"useCustomEmoji",e);h(this,"removeTags",t);h(this,"strictDateFormat",n);h(this,"useDueDateFallback",o);h(this,"tokens",a)}static parse(e,t,n,o,a){return new oe(t!=null?t:!1,n!=null?n:!1,o!=null?o:!0,a!=null?a:!1,new al(ep(e,this.allSymbols)))}getTitle(){let e=this.tokens.getTokenText("",!0);return e!=null&&this.removeTags&&(e=Ja(e)),e}getTime(){return this.getDate(this.resolveReminderSymbol())}setTime(e,t){this.useCustomEmoji?this.setDate(this.writeReminderSymbol(),e,1):this.setDate(this.writeReminderSymbol(),e,t)}getDueDate(){return this.getDate(oe.symbolDueDate)}setDueDate(e){this.setDate(oe.symbolDueDate,e)}setRawTime(e){return this.setDate(this.writeReminderSymbol(),e),!0}resolveReminderSymbol(){if(!this.useCustomEmoji)return oe.symbolDueDate;if(!this.useDueDateFallback)return oe.symbolReminder;let e=[oe.symbolReminder,oe.symbolDueDate,oe.symbolScheduled,oe.symbolStart];for(let t of e)if(this.tokens.getToken(t)!=null)return t;return oe.symbolReminder}writeReminderSymbol(){return this.useCustomEmoji?oe.symbolReminder:oe.symbolDueDate}getEndOfTimeTextIndex(){let e=this.tokens.rangeOfSymbol(this.resolveReminderSymbol());return e!=null?e.end:this.toMarkdown().length}computeSpan(){let e=this.resolveReminderSymbol(),t=this.tokens.rangeOfSymbol(e),n=this.tokens.getToken(e);if(t==null||n==null)return{start:0,end:0};let o=n.text.replace(/\s+$/,"").length;return{start:t.start,end:t.start+n.symbol.length+o}}toMarkdown(){return this.tokens.join()}setTitle(e){this.tokens.setTokenText("",e,!0,!0)}getDoneDate(){return this.getDate(oe.symbolDoneDate)}setDoneDate(e){this.setDate(oe.symbolDoneDate,e)}getRecurrence(){return this.tokens.getTokenText(oe.symbolRecurrence,!0)}clone(){return oe.parse(this.toMarkdown(),this.useCustomEmoji,this.removeTags,this.strictDateFormat,this.useDueDateFallback)}getDate(e){let t=this.tokens.getTokenText(e,!0);if(t===null)return null;if(e===oe.symbolReminder)return Jr.parse(t);if(e===oe.symbolDueDate){let o=(0,gc.default)(t,oe.dueDateTimeFormat,!0);if(o.isValid())return new P(o,!0)}let n=(0,gc.default)(t,oe.dateFormat,this.strictDateFormat);return n.isValid()?new P(n,!1):null}setDate(e,t,n){if(t==null){this.tokens.removeToken(e);return}let o;t instanceof P?e===oe.symbolReminder?o=Jr.toString(t):e===oe.symbolDueDate&&t.hasTimePart?o=t.format(oe.dueDateTimeFormat):o=t.format(oe.dateFormat):o=t,this.tokens.setTokenText(e,o,!0,!0,this.shouldSplitBetweenSymbolAndText(),n)}shouldSplitBetweenSymbolAndText(){let e=0,t=0;return this.tokens.forEachTokens(n=>{n.symbol!==""&&(n.text.match(/^\s.*$/)?e+=1:t++)}),e>t?!0:!(e<t)}};h(oe,"dateFormat","YYYY-MM-DD"),h(oe,"dueDateTimeFormat","YYYY-MM-DD HH:mm"),h(oe,"symbolDueDate",Wr.ofChars([..."\u{1F4C5}\u{1F4C6}\u{1F5D3}"])),h(oe,"symbolDoneDate",Wr.ofChar("\u2705")),h(oe,"symbolRecurrence",Wr.ofChar("\u{1F501}")),h(oe,"symbolReminder",Wr.ofChar("\u23F0")),h(oe,"symbolScheduled",Wr.ofChar("\u23F3")),h(oe,"symbolStart",Wr.ofChar("\u{1F6EB}")),h(oe,"allSymbols",[oe.symbolDueDate,oe.symbolDoneDate,oe.symbolRecurrence,oe.symbolReminder,oe.symbolStart,oe.symbolScheduled]);var ll=oe,cl=class cl extends ho{parseReminder(e){let t=ll.parse(e.body,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat(),this.useDueDateFallback());if(this.useCustomEmoji()){if(this.useDueDateFallback()){if(t.getTime()==null)return null}else if(t.getDueDate()==null)return null}return t}removeTagsEnabled(){return this.config.getParameter(Qe.removeTagsForTasksPlugin)}useCustomEmoji(){return this.config.getParameter(Qe.useCustomEmojiForTasksPlugin)}useDueDateFallback(){return this.config.getParameter(Qe.useReminderTimeFallbackForTasksPlugin)}usesSeparateReminderDate(){return this.useCustomEmoji()}newReminder(e,t,n){let o=ll.parse(e,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat(),this.useDueDateFallback());return o.setTime(t,n),this.useCustomEmoji()&&o.getDueDate()==null&&o.setDueDate(t),o.setTitle(e),o}};h(cl,"instance",new cl);var ul=cl;var bo=new Xa;bo.resetFormat([go.instance]);var vo=class{constructor(e,t,n,o,a){h(this,"name",e);h(this,"description",t);h(this,"example",n);h(this,"format",o);h(this,"defaultEnabled",a)}};function yo(r){return bo.parse(r)}async function dl(r,e,t){return bo.modify(r,e,t)}function tp(r){r.length===0?bo.resetFormat([go.instance]):bo.resetFormat(r.map(e=>e.format))}function rp(r){bo.setConfig(r)}var bc=new vo("ReminderPluginReminderFormat","Reminder plugin format","(@2021-09-08)",go.instance,!0),vc=new vo("TasksPluginReminderFormat","Tasks plugin format","\u{1F4C5} 2021-09-08",ul.instance,!1),yc=new vo("KanbanPluginReminderFormat","Kanban plugin format","@{2021-09-08}",il.instance,!1),_c=new vo("DataviewReminderFormat","Dataview format","[due:: 2021-09-08]",Ka.instance,!1),_o=[bc,vc,yc,_c];var Bn=class{constructor(e,t){h(this,"doc");this.doc=new Sn(e,t)}getReminders(e=!0){let t=yo(this.doc).map(n=>n.reminder);return e?t.filter(n=>!n.done):t}getTodos(){return this.doc.getTodos()}async modifyReminderLines(e){for(let t of this.getReminders(!1)){let n=e(t);if(n===null)return;await this.modifyReminderLine(t,n)}}async updateReminder(e,t){await this.modifyReminderLine(e,t)}async modifyReminderLine(e,t){let n=await dl(this.doc,e,t);return n?console.debug("Reminder was updated: reminder=%o",e):console.warn("Cannot modify reminder because it's not a reminder todo: reminder=%o",e),n}getContent(){return this.doc.toMarkdown()}};var np=require("obsidian");var fl=class extends np.FuzzySuggestModal{constructor(t,n,o){super(t);h(this,"suggestions",n);h(this,"onChooseSuggestionFunc",o)}getItems(){return this.suggestions}getItemText(t){return t}onChooseItem(t){this.onChooseSuggestionFunc(t)}};function ip(r,e){new fl(r,["YYYY-MM-DD","YYYY/MM/DD","DD-MM-YYYY","DD/MM/YYYY"],t=>{new fl(r,["YYYY-MM-DD HH:mm","YYYY/MM/DD HH:mm","DD-MM-YYYY HH:mm","DD/MM/YYYY HH:mm","YYYY-MM-DDTHH:mm:ss:SSS"],n=>{e(t,n)}).open()}).open()}async function vI(r,e,t){let n=0,o=r.app.vault;for(let a of o.getMarkdownFiles()){let c=new Bn(a.path,await o.read(a)),u=0;await c.modifyReminderLines(f=>{let p;return f.time.hasTimePart?p=f.time.format(t):p=f.time.format(e),n++,u++,{rawTime:p}}),u>0&&await o.modify(a,c.getContent())}return r.settings.dateFormat.rawValue.value=e,r.settings.dateTimeFormat.rawValue.value=t,n>0&&await r.fileSystem.reloadRemindersInAllFiles(),n}function op(r,e){return r||om("Convert reminder time format","This command rewrite reminder dates in all markdown files. You should make a backup of your vault before you execute this. May I continue to convert?").then(t=>{t===0&&ip(e.app,(n,o)=>{vI(e,n,o).catch(()=>{})})}),!0}function sp(r,e,t){if(r)return!0;t.showAutoComplete(e)}async function yI(r,e,t){if(!r.fileSystem.isMarkdownFile(e))return;let n=r.app.vault,o=new Bn(e.path,await n.read(e)),a=o.getReminders(!1).find(c=>c.rowNumber===t);if(a)await o.updateReminder(a,{checked:!a.done});else{let c=o.getTodos().find(u=>u.lineIndex===t);if(!c)return;c.setChecked(!c.isChecked())}await n.modify(e,o.getContent())}function ap(r,e,t){if(r)return!0;e&&e.file&&yI(t,e.file,e.editor.getCursor().line)}var lp=require("obsidian");var ml=class extends lp.SuggestModal{constructor(t,n){super(t);h(this,"onSelect",n)}getSuggestions(t){return am.filter(n=>n.name.toLowerCase().includes(t.toLowerCase()))}renderSuggestion(t,n){let o=n.createDiv({cls:"reminder-preset-suggestion"}),a=o.createEl("div",{text:t.name,cls:"reminder-preset-title"}),c=P.now(),u=o.createDiv({cls:"reminder-preset-previews"});u.createEl("div",{cls:"reminder-preset-preview-line",text:"Year/Month: "+c.format(t.format.yearMonthFormat)}),u.createEl("div",{cls:"reminder-preset-preview-line",text:"Month/Day: "+c.format(t.format.monthDayFormat)}),u.createEl("div",{cls:"reminder-preset-preview-line",text:"Short: "+c.format(t.format.shortDateWithWeekdayFormat)}),u.createEl("div",{cls:"reminder-preset-preview-line",text:"Time: "+c.format(t.format.timeFormat)}),a.style.fontWeight="600",a.style.marginBottom="4px",u.style.opacity="0.8",u.style.fontSize="12px",u.style.display="grid",u.style.gridAutoRows="min-content",u.style.rowGap="2px"}onChooseSuggestion(t){this.onSelect(t)}};function up(r,e){return r||new ml(e.app,t=>{e.data.settings.monthDayDisplayFormat.rawValue.value=t.format.monthDayFormat,e.data.settings.yearMonthDisplayFormat.rawValue.value=t.format.yearMonthFormat,e.data.settings.shortDateWithWeekdayDisplayFormat.rawValue.value=t.format.shortDateWithWeekdayFormat,e.data.settings.timeDisplayFormat.rawValue.value=t.format.timeFormat,e.data.save(!0),e.ui.invalidate(),e.ui.reload(!0)}).open(),!0}function dp(r){r.addCommand({id:"scan-reminders",name:"Scan reminders",checkCallback:e=>em(e,r)}),r.addCommand({id:"show-reminders",name:"Show reminders",checkCallback:e=>tm(e,r.ui)}),r.addCommand({id:"convert-reminder-time-format",name:"Convert reminder time format",checkCallback:e=>op(e,r)}),r.addCommand({id:"show-date-chooser",name:"Show calendar popup",icon:"calendar-with-checkmark",hotkeys:[{modifiers:["Meta","Shift"],key:"2"}],editorCheckCallback:(e,t)=>sp(e,t,r.ui)}),r.addCommand({id:"toggle-checklist-status",name:"Toggle checklist status",hotkeys:[{modifiers:["Meta","Shift"],key:"Enter"}],editorCheckCallback:(e,t,n)=>n instanceof cp.MarkdownView?ap(e,n,r):!1}),r.addCommand({id:"set-date-display-format",name:"Set date display format",checkCallback:e=>up(e,r)}),r.addCommand({id:"pause-notifications",name:"Pause reminder notifications",checkCallback:e=>Jf(e,r)}),r.addCommand({id:"resume-notifications",name:"Resume reminder notifications",checkCallback:e=>qf(e,r)}),r.addCommand({id:"mute-all-reminders",name:"Mute all current reminders",checkCallback:e=>Pf(e,r)})}var fp=require("obsidian");function mp(r){if(!fp.Platform.isMobile)return;let e=`${r.manifest.dir}/logs.txt`,t=[],n=o=>(...a)=>{t.push(`
[${o}]`);for(let c of a)t.push(String(c));r.app.vault.adapter.write(e,t.join(" "))};console.debug=n("debug"),console.error=n("error"),console.info=n("info"),console.log=n("log"),console.warn=n("warn")}var qr="reminder-list";var _I=10*1e3,pl=class{constructor(e){h(this,"plugin",e);h(this,"el")}onload(){this.el=this.plugin.addStatusBarItem(),this.el.addClass("reminder-dnd-status-bar"),this.el.style.display="none",this.el.style.cursor="pointer",this.el.setAttribute("aria-label","Click to resume reminder notifications"),this.plugin.registerDomEvent(this.el,"click",()=>{Da(this.plugin)}),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),_I)),this.refresh()}refresh(){if(!this.el)return;let e=this.plugin.data.dndUntil.value;if(!ro(e,P.now())){this.el.style.display="none";return}this.el.setText(`\u{1F515} Until ${this.formatUntil(e)}`),this.el.style.display=""}formatUntil(e){let t=this.plugin.settings.timeDisplayFormat.value,n=e.format(t);if(e.toYYYYMMDD()===P.now().toYYYYMMDD())return n;let o=this.plugin.settings.monthDayDisplayFormat.value;return`${e.format(o)} ${n}`}};var hl=class{constructor(e){h(this,"plugin",e);h(this,"el")}onload(){this.el=this.plugin.addStatusBarItem(),this.el.addClass("reminder-overdue-status-bar"),this.el.style.display="none",this.el.style.cursor="pointer",this.el.setAttribute("aria-label","Overdue reminders \u2014 click to open the reminder list"),this.plugin.registerDomEvent(this.el,"click",()=>{this.plugin.ui.showReminderList()}),this.plugin.settings.showOverdueCountInStatusBar.rawValue.onChanged(()=>this.refresh()),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),1e4)),this.refresh()}refresh(){if(!this.el)return;if(!this.plugin.settings.showOverdueCountInStatusBar.value){this.el.style.display="none";return}let e=this.plugin.reminders.getExpiredReminders(this.plugin.settings.reminderTime.value).length;if(e===0){this.el.style.display="none";return}this.el.setText(`\u23F0 ${e}`),this.el.style.display=""}};var iu=require("obsidian");var ct=Symbol("$state"),Bs=Symbol("legacy props"),hp=Symbol(""),gl=Symbol("proxy path"),bl=Symbol("attributes"),Ds=Symbol("class"),Ic=Symbol("style"),Ns=Symbol("text"),ci=Symbol("form reset"),wc=Symbol("hmr anchor"),di=new class extends Error{constructor(){super(...arguments);h(this,"name","StaleReactionError");h(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},pp,Cc=!!((pp=globalThis.document)!=null&&pp.contentType)&&globalThis.document.contentType.includes("xml");var Io=3,Ar=8;var bp,vp,gp=(vp=(bp=globalThis.process)==null?void 0:bp.env)==null?void 0:vp.NODE_ENV,S=gp&&!gp.toLowerCase().startsWith("prod");var kr=Array.isArray,yp=Array.prototype.indexOf,fi=Array.prototype.includes,wo=Array.from,xc=Object.keys,Rt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,vl=Object.getOwnPropertyDescriptors,Ac=Object.prototype,_p=Array.prototype,Ei=Object.getPrototypeOf,kc=Object.isExtensible;var en=()=>{};function Ip(r){return r()}function Co(r){for(var e=0;e<r.length;e++)r[e]()}function yl(){var r,e,t=new Promise((n,o)=>{r=n,e=o});return{promise:t,resolve:r,reject:e}}function _l(r){return r===this.v}function Rc(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function Il(r){return!Rc(r,this.v)}function wp(r){if(S){let e=new Error(`invariant_violation
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${r}"
https://svelte.dev/e/invariant_violation`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invariant_violation")}function xo(r){if(S){let e=new Error(`lifecycle_outside_component
\`${r}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xp(){if(S){let r=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Sc(){if(S){let r=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function Ap(){if(S){let r=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/derived_references_self")}function Fc(r,e,t){if(S){let n=new Error(`each_key_duplicate
${t?`Keyed each block has duplicate key \`${t}\` at indexes ${r} and ${e}`:`Keyed each block has duplicate key at indexes ${r} and ${e}`}
https://svelte.dev/e/each_key_duplicate`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function kp(r,e,t){if(S){let n=new Error(`each_key_volatile
Keyed each block has key that is not idempotent \u2014 the key for item at index ${r} was \`${e}\` but is now \`${t}\`. Keys must be the same each time for a given item
https://svelte.dev/e/each_key_volatile`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function Rp(r){if(S){let e=new Error(`effect_in_teardown
\`${r}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Sp(){if(S){let r=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Fp(r){if(S){let e=new Error(`effect_orphan
\`${r}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function Tp(){if(S){let r=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Gp(){if(S){let r=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/hydration_failed")}function Ep(r){if(S){let e=new Error(`lifecycle_legacy_only
\`${r}(...)\` cannot be used in runes mode
https://svelte.dev/e/lifecycle_legacy_only`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function Bp(r){if(S){let e=new Error(`props_invalid_value
Cannot do \`bind:${r}={undefined}\` when \`${r}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function Dp(r){if(S){let e=new Error(`rune_outside_svelte
The \`${r}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function Np(){if(S){let r=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Wp(){if(S){let r=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Zp(){if(S){let r=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Yp(){if(S){let r=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var nt=!1,tn=!1,Zr=!1;function Mp(){tn=!0}var Dn={};var Ge=Symbol("uninitialized"),Rr=Symbol("filename");var wl="http://www.w3.org/1999/xhtml";var Ws=null;function Mt(r,e){return r.label=e,xl(r.v,e),r}function xl(r,e){var t;return(t=r==null?void 0:r[gl])==null||t.call(r,e),r}function Yr(r){let e=new Error,t=wI();return t.length===0?null:(t.unshift(`
`),Rt(e,"stack",{value:t.join(`
`)}),Rt(e,"name",{value:r}),e)}function wI(){let r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=r,!e)return[];let t=e.split(`
`),n=[];for(let o=0;o<t.length;o++){let a=t[o],c=a.replaceAll("\\","/");if(a.trim()!=="Error"){if(a.includes("validate_each_keys"))return[];c.includes("svelte/src/internal")||c.includes("node_modules/.vite")||n.push(a)}}return n}function Up(r,e){if(!S)throw new Error("invariant(...) was not guarded by if (DEV)");r||wp(e)}var K=null;function Nn(r){K=r}var rn=null;function Ao(r){rn=r}var Mr=null;function Al(r){Mr=r}function Ke(r,e=!1,t){K={p:K,i:!1,c:null,e:null,s:r,x:null,r:Y,l:tn&&!e?{s:null,u:null,$:[]}:null},S&&(K.function=t,Mr=t)}function qe(r){var o;var e=K,t=e.e;if(t!==null){e.e=null;for(var n of t)Tc(n)}return r!==void 0&&(e.x=r),e.i=!0,K=e.p,S&&(Mr=(o=K==null?void 0:K.function)!=null?o:null),r!=null?r:{}}function nn(){return!tn||K!==null&&K.l===null}var Bi=[];function Qp(){var r=Bi;Bi=[],Co(r)}function it(r){if(Bi.length===0&&!Di){var e=Bi;queueMicrotask(()=>{e===Bi&&Qp()})}Bi.push(r)}function Vp(){for(;Bi.length>0;)Qp()}var on="font-weight: bold",sn="font-weight: normal";function Lp(r){S?console.warn(`%c[svelte] await_reactivity_loss
%cDetected reactivity loss when reading \`${r}\`. This happens when state is read in an async function after an earlier \`await\`
https://svelte.dev/e/await_reactivity_loss`,on,sn):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Op(r,e){S?console.warn(`%c[svelte] await_waterfall
%cAn async derived, \`${r}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
https://svelte.dev/e/await_waterfall`,on,sn):console.warn("https://svelte.dev/e/await_waterfall")}function $p(){S?console.warn(`%c[svelte] derived_inert
%cReading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert`,on,sn):console.warn("https://svelte.dev/e/derived_inert")}function Pp(r,e,t){S?console.warn(`%c[svelte] hydration_attribute_changed
%cThe \`${r}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${t}\`, will be ignored in favour of the server value
https://svelte.dev/e/hydration_attribute_changed`,on,sn):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ni(r){S?console.warn(`%c[svelte] hydration_mismatch
%c${r?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${r}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,on,sn):console.warn("https://svelte.dev/e/hydration_mismatch")}function Hp(){S?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,on,sn):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Jp(){S?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",on,sn):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function kl(r){S?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${r}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,on,sn):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function jp(){S?console.warn(`%c[svelte] state_proxy_unmount
%cTried to unmount a state proxy, rather than a component
https://svelte.dev/e/state_proxy_unmount`,on,sn):console.warn("https://svelte.dev/e/state_proxy_unmount")}function zp(){S?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",on,sn):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var L=!1;function dt(r){L=r}var ne;function Se(r){if(r===null)throw Ni(),Dn;return ne=r}function Gt(){return Se(Et(ne))}function X(r){if(L){if(Et(ne)!==null)throw Ni(),Dn;ne=r}}function So(r=1){if(L){for(var e=r,t=ne;e--;)t=Et(t);ne=t}}function an(r=!0){for(var e=0,t=ne;;){if(t.nodeType===Ar){var n=t.data;if(n==="]"){if(e===0)return t;e-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var o=Et(t);r&&t.remove(),t=o}}function Ys(r){if(!r||r.nodeType!==Ar)throw Ni(),Dn;return r.data}var CI=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Wn(r){if(typeof r!="object"||r===null||ct in r)return r;let e=Ei(r);if(e!==Ac&&e!==_p)return r;var t=new Map,n=kr(r),o=ln(0),a=S&&Zr?Yr("created at"):null,c=pi,u=I=>{if(pi===c)return I();var g=$,v=pi;ft(null),Gc(c);var y=I();return ft(g),Gc(v),y};n&&(t.set("length",ln(r.length,a)),S&&(r=AI(r)));var f="";let p=!1;function b(I){if(!p){p=!0,f=I,Mt(o,`${f} version`);for(let[g,v]of t)Mt(v,Wi(f,g));p=!1}}return new Proxy(r,{defineProperty(I,g,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&Np();var y=t.get(g);return y===void 0?u(()=>{var w=ln(v.value,a);return t.set(g,w),S&&typeof g=="string"&&Mt(w,Wi(f,g)),w}):z(y,v.value,!0),!0},deleteProperty(I,g){var v=t.get(g);if(v===void 0){if(g in I){let y=u(()=>ln(Ge,a));t.set(g,y),Zi(o),S&&Mt(y,Wi(f,g))}}else z(v,Ge),Zi(o);return!0},get(I,g,v){var k;if(g===ct)return r;if(S&&g===gl)return b;var y=t.get(g),w=g in I;if(y===void 0&&(!w||(k=$t(I,g))!=null&&k.writable)&&(y=u(()=>{var E=Wn(w?I[g]:Ge),Z=ln(E,a);return S&&Mt(Z,Wi(f,g)),Z}),t.set(g,y)),y!==void 0){var x=A(y);return x===Ge?void 0:x}return Reflect.get(I,g,v)},getOwnPropertyDescriptor(I,g){var v=Reflect.getOwnPropertyDescriptor(I,g);if(v&&"value"in v){var y=t.get(g);y&&(v.value=A(y))}else if(v===void 0){var w=t.get(g),x=w==null?void 0:w.v;if(w!==void 0&&x!==Ge)return{enumerable:!0,configurable:!0,value:x,writable:!0}}return v},has(I,g){var x;if(g===ct)return!0;var v=t.get(g),y=v!==void 0&&v.v!==Ge||Reflect.has(I,g);if(v!==void 0||Y!==null&&(!y||(x=$t(I,g))!=null&&x.writable)){v===void 0&&(v=u(()=>{var k=y?Wn(I[g]):Ge,E=ln(k,a);return S&&Mt(E,Wi(f,g)),E}),t.set(g,v));var w=A(v);if(w===Ge)return!1}return y},set(I,g,v,y){var pe;var w=t.get(g),x=g in I;if(n&&g==="length")for(var k=v;k<w.v;k+=1){var E=t.get(k+"");E!==void 0?z(E,Ge):k in I&&(E=u(()=>ln(Ge,a)),t.set(k+"",E),S&&Mt(E,Wi(f,k)))}if(w===void 0)(!x||(pe=$t(I,g))!=null&&pe.writable)&&(w=u(()=>ln(void 0,a)),S&&Mt(w,Wi(f,g)),z(w,Wn(v)),t.set(g,w));else{x=w.v!==Ge;var Z=u(()=>Wn(v));z(w,Z)}var te=Reflect.getOwnPropertyDescriptor(I,g);if(te!=null&&te.set&&te.set.call(y,v),!x){if(n&&typeof g=="string"){var ae=t.get("length"),M=Number(g);Number.isInteger(M)&&M>=ae.v&&z(ae,M+1)}Zi(o)}return!0},ownKeys(I){A(o);var g=Reflect.ownKeys(I).filter(w=>{var x=t.get(w);return x===void 0||x.v!==Ge});for(var[v,y]of t)y.v!==Ge&&!(v in I)&&g.push(v);return g},setPrototypeOf(){Wp()}})}function Wi(r,e){var t;return typeof e=="symbol"?`${r}[Symbol(${(t=e.description)!=null?t:""})]`:CI.test(e)?`${r}.${e}`:/^\d+$/.test(e)?`${r}[${e}]`:`${r}['${e}']`}function Fo(r){try{if(r!==null&&typeof r=="object"&&ct in r)return r[ct]}catch(e){}return r}function Ec(r,e){return Object.is(Fo(r),Fo(e))}var xI=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function AI(r){return new Proxy(r,{get(e,t,n){var o=Reflect.get(e,t,n);return xI.has(t)?function(...a){Kp();var c=o.apply(this,a);return Rl(),c}:o}})}function qp(){let r=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:t,lastIndexOf:n,includes:o}=r;r.indexOf=function(a,c){let u=t.call(this,a,c);if(u===-1){for(let f=c!=null?c:0;f<this.length;f+=1)if(Fo(this[f])===a){kl("array.indexOf(...)");break}}return u},r.lastIndexOf=function(a,c){let u=n.call(this,a,c!=null?c:this.length-1);if(u===-1){for(let f=0;f<=(c!=null?c:this.length-1);f+=1)if(Fo(this[f])===a){kl("array.lastIndexOf(...)");break}}return u},r.includes=function(a,c){let u=o.call(this,a,c);if(!u){for(let f=0;f<this.length;f+=1)if(Fo(this[f])===a){kl("array.includes(...)");break}}return u},Array.__svelte_cleanup=()=>{r.indexOf=t,r.lastIndexOf=n,r.includes=o}}var Ms,eh,Xs,th,rh;function Sl(){if(Ms===void 0){Ms=window,eh=document,Xs=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;th=$t(e,"firstChild").get,rh=$t(e,"nextSibling").get,kc(r)&&(r[Ds]=void 0,r[bl]=null,r[Ic]=void 0,r.__e=void 0),kc(t)&&(t[Ns]=void 0),S&&(r.__svelte_meta=null,qp())}}function It(r=""){return document.createTextNode(r)}function Xt(r){return th.call(r)}function Et(r){return rh.call(r)}function H(r,e){if(!L)return Xt(r);var t=Xt(ne);if(t===null)t=ne.appendChild(It());else if(e&&t.nodeType!==Io){var n=It();return t==null||t.before(n),Se(n),n}return e&&Tl(t),Se(t),t}function To(r,e=!1){var o,a;if(!L){var t=Xt(r);return t instanceof Comment&&t.data===""?Et(t):t}if(e){if(((o=ne)==null?void 0:o.nodeType)!==Io){var n=It();return(a=ne)==null||a.before(n),Se(n),n}Tl(ne)}return ne}function Ie(r,e=1,t=!1){let n=L?ne:r;for(var o;e--;)o=n,n=Et(n);if(!L)return n;if(t){if((n==null?void 0:n.nodeType)!==Io){var a=It();return n===null?o==null||o.after(a):n.before(a),Se(a),a}Tl(n)}return Se(n),n}function Us(r){r.textContent=""}function Fl(){if(!nt||tr!==null)return!1;var r=Y.f;return(r&32768)!==0}function Zn(r,e,t){return e==null||e===wl?t?document.createElement(r,{is:t}):document.createElement(r):t?document.createElementNS(e,r,{is:t}):document.createElementNS(e,r)}function Tl(r){if(r.nodeValue.length<65536)return;let e=r.nextSibling;for(;e!==null&&e.nodeType===Io;)e.remove(),r.nodeValue+=e.nodeValue,e=r.nextSibling}var Bc=new WeakMap;function Gl(r){var e=Y;if(e===null)return $.f|=8388608,r;if(S&&r instanceof Error&&!Bc.has(r)&&Bc.set(r,kI(r,e)),(e.f&32768)===0&&(e.f&4)===0)throw S&&!e.parent&&r instanceof Error&&nh(r),r;Ur(r,e)}function Ur(r,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0){if((e.f&32768)===0)throw r;try{e.b.error(r);return}catch(t){r=t}}e=e.parent}throw S&&r instanceof Error&&nh(r),r}}function kI(r,e){var c,u,f;let t=$t(r,"message");if(!(t&&!t.configurable)){for(var n=Xs?" ":" ",o=`
${n}in ${((c=e.fn)==null?void 0:c.name)||"<unknown>"}`,a=e.ctx;a!==null;)o+=`
${n}in ${(u=a.function)==null?void 0:u[Rr].split("/").pop()}`,a=a.p;return{message:r.message+`
${o}
`,stack:(f=r.stack)==null?void 0:f.split(`
`).filter(p=>!p.includes("svelte/src/internal")).join(`
`)}}}function nh(r){let e=Bc.get(r);e&&(Rt(r,"message",{value:e.message}),Rt(r,"stack",{value:e.stack}))}var RI=-7169;function ke(r,e){r.f=r.f&RI|e}function Go(r){(r.f&512)!==0||r.deps===null?ke(r,1024):ke(r,4096)}function ih(r){if(r!==null)for(let e of r)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,ih(e.deps))}function El(r,e,t){(r.f&2048)!==0?e.add(r):(r.f&4096)!==0&&t.add(r),ih(r.deps),ke(r,1024)}var oh=!1,Bl=!1;function Dc(r){var e=Bl;try{return Bl=!1,[r(),Bl]}finally{Bl=e}}function sh(r){let e=0,t=Vt(0),n;return S&&Mt(t,"createSubscriber version"),()=>{mi()&&(A(t),gt(()=>(e===0&&(n=V(()=>r(()=>Zi(t)))),e+=1,()=>{it(()=>{e-=1,e===0&&(n==null||n(),n=void 0,Zi(t))})})))}}var FI=589824;function Mc(r,e,t,n){new Nc(r,e,t,n)}var ur,Vs,Tr,Yi,rr,Gr,Pt,cr,Mn,Mi,gi,Bo,Ls,Os,un,Wl,Xe,lh,uh,ch,Wc,Dl,Nl,Zc,Yc,Nc=class{constructor(e,t,n,o){q(this,Xe);h(this,"parent");h(this,"is_pending",!1);h(this,"transform_error");q(this,ur);q(this,Vs,L?ne:null);q(this,Tr);q(this,Yi);q(this,rr);q(this,Gr,null);q(this,Pt,null);q(this,cr,null);q(this,Mn,null);q(this,Mi,0);q(this,gi,0);q(this,Bo,!1);q(this,Ls,new Set);q(this,Os,new Set);q(this,un,null);q(this,Wl,sh(()=>(j(this,un,Vt(C(this,Mi))),S&&Mt(C(this,un),"$effect.pending()"),()=>{j(this,un,null)})));var a,c;j(this,ur,e),j(this,Tr,t),j(this,Yi,u=>{var f=Y;f.b=this,f.f|=128,n(u)}),this.parent=Y.b,this.transform_error=(c=o!=null?o:(a=this.parent)==null?void 0:a.transform_error)!=null?c:(u=>u),j(this,rr,mr(()=>{if(L){let u=C(this,Vs);Gt();let f=u.data==="[!";if(u.data.startsWith("[?")){let b=JSON.parse(u.data.slice("[?".length));le(this,Xe,uh).call(this,b)}else f?le(this,Xe,ch).call(this):le(this,Xe,lh).call(this)}else le(this,Xe,Wc).call(this)},FI)),L&&j(this,ur,ne)}defer_effect(e){El(e,C(this,Ls),C(this,Os))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!C(this,Tr).pending}update_pending_count(e,t){le(this,Xe,Zc).call(this,e,t),j(this,Mi,C(this,Mi)+e),!(!C(this,un)||C(this,Bo))&&(j(this,Bo,!0),it(()=>{j(this,Bo,!1),C(this,un)&&Qr(C(this,un),C(this,Mi))}))}get_effect_pending(){return C(this,Wl).call(this),A(C(this,un))}error(e){var t;if(!C(this,Tr).onerror&&!C(this,Tr).failed)throw e;(t=O)!=null&&t.is_fork?(C(this,Gr)&&O.skip_effect(C(this,Gr)),C(this,Pt)&&O.skip_effect(C(this,Pt)),C(this,cr)&&O.skip_effect(C(this,cr)),O.oncommit(()=>{le(this,Xe,Yc).call(this,e)})):le(this,Xe,Yc).call(this,e)}};ur=new WeakMap,Vs=new WeakMap,Tr=new WeakMap,Yi=new WeakMap,rr=new WeakMap,Gr=new WeakMap,Pt=new WeakMap,cr=new WeakMap,Mn=new WeakMap,Mi=new WeakMap,gi=new WeakMap,Bo=new WeakMap,Ls=new WeakMap,Os=new WeakMap,un=new WeakMap,Wl=new WeakMap,Xe=new WeakSet,lh=function(){try{j(this,Gr,bt(()=>C(this,Yi).call(this,C(this,ur))))}catch(e){this.error(e)}},uh=function(e){let t=C(this,Tr).failed;t&&j(this,cr,bt(()=>{t(C(this,ur),()=>e,()=>()=>{})}))},ch=function(){let e=C(this,Tr).pending;e&&(this.is_pending=!0,j(this,Pt,bt(()=>e(C(this,ur)))),it(()=>{var t=j(this,Mn,document.createDocumentFragment()),n=It();t.append(n),j(this,Gr,le(this,Xe,Nl).call(this,()=>bt(()=>C(this,Yi).call(this,n)))),C(this,gi)===0&&(C(this,ur).before(t),j(this,Mn,null),cn(C(this,Pt),()=>{j(this,Pt,null)}),le(this,Xe,Dl).call(this,O))}))},Wc=function(){try{if(this.is_pending=this.has_pending_snippet(),j(this,gi,0),j(this,Mi,0),j(this,Gr,bt(()=>{C(this,Yi).call(this,C(this,ur))})),C(this,gi)>0){var e=j(this,Mn,document.createDocumentFragment());Do(C(this,Gr),e);let t=C(this,Tr).pending;j(this,Pt,bt(()=>t(C(this,ur))))}else le(this,Xe,Dl).call(this,O)}catch(t){this.error(t)}},Dl=function(e){this.is_pending=!1,e.transfer_effects(C(this,Ls),C(this,Os))},Nl=function(e){var t=Y,n=$,o=K;et(C(this,rr)),ft(C(this,rr)),Nn(C(this,rr).ctx);try{return fr.ensure(),e()}catch(a){return Gl(a),null}finally{et(t),ft(n),Nn(o)}},Zc=function(e,t){var n;if(!this.has_pending_snippet()){this.parent&&le(n=this.parent,Xe,Zc).call(n,e,t);return}j(this,gi,C(this,gi)+e),C(this,gi)===0&&(le(this,Xe,Dl).call(this,t),C(this,Pt)&&cn(C(this,Pt),()=>{j(this,Pt,null)}),C(this,Mn)&&(C(this,ur).before(C(this,Mn)),j(this,Mn,null)))},Yc=function(e){C(this,Gr)&&(Oe(C(this,Gr)),j(this,Gr,null)),C(this,Pt)&&(Oe(C(this,Pt)),j(this,Pt,null)),C(this,cr)&&(Oe(C(this,cr)),j(this,cr,null)),L&&(Se(C(this,Vs)),So(),Se(an()));var t=C(this,Tr).onerror;let n=C(this,Tr).failed;var o=!1,a=!1;let c=()=>{if(o){zp();return}o=!0,a&&Yp(),C(this,cr)!==null&&cn(C(this,cr),()=>{j(this,cr,null)}),le(this,Xe,Nl).call(this,()=>{le(this,Xe,Wc).call(this)})},u=f=>{try{a=!0,t==null||t(f,c),a=!1}catch(p){Ur(p,C(this,rr)&&C(this,rr).parent)}n&&j(this,cr,le(this,Xe,Nl).call(this,()=>{try{return bt(()=>{var p=Y;p.b=this,p.f|=128,n(C(this,ur),()=>f,()=>c)})}catch(p){return Ur(p,C(this,rr).parent),null}}))};it(()=>{var f;try{f=this.transform_error(e)}catch(p){Ur(p,C(this,rr)&&C(this,rr).parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(u,p=>Ur(p,C(this,rr)&&C(this,rr).parent)):u(f)})};function Zl(r,e,t,n){let o=nn()?bi:Un;var a=r.filter(v=>!v.settled),c=e.map(o);if(S&&c.forEach((v,y)=>{v.label=e[y].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(w,x)=>x)}),t.length===0&&a.length===0){n(c);return}var u=Y,f=dh(),p=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(v=>v.promise)):null;function b(v){if((u.f&16384)===0){f();try{n([...c,...v])}catch(y){Ur(y,u)}No()}}var I=Xc();if(t.length===0){p.then(()=>b([])).finally(I);return}function g(){Promise.all(t.map(v=>Qc(v))).then(b).catch(v=>Ur(v,u)).finally(I)}p?p.then(()=>{f(),g(),No()}):g()}function dh(){var r=Y,e=$,t=K,n=O;if(S)var o=rn;return function(c=!0){et(r),ft(e),Nn(t),c&&(r.f&16384)===0&&(n==null||n.activate(),n==null||n.apply()),S&&(Uc(null),Ao(o))}}function No(r=!0){var e;et(null),ft(null),Nn(null),r&&((e=O)==null||e.deactivate()),S&&(Uc(null),Ao(null))}function Xc(){var r=Y,e=r.b,t=O,n=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(n,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(n,r)}}var nr=null;function Uc(r){nr=r}var $s=new Set;function bi(r){var e=2050;Y!==null&&(Y.f|=524288);let t={ctx:K,deps:null,effects:null,equals:_l,f:e,fn:r,reactions:null,rv:0,v:Ge,wv:0,parent:Y,ac:null};return S&&Zr&&(t.created=Yr("created at")),t}var Wo=Symbol("obsolete");function Qc(r,e,t){let n=Y;n===null&&xp();var o=void 0,a=Vt(Ge);S&&(a.label=e!=null?e:r.toString());var c=!$,u=new Set;return ph(()=>{var v,y;var f=Y;S&&(nr={effect:f,effect_deps:new Set,warned:!1});var p=yl();o=p.promise;try{Promise.resolve(r()).then(p.resolve,w=>{w!==di&&p.reject(w)}).finally(No)}catch(w){p.reject(w),No()}if(S){if(nr){if(f.deps!==null)for(let w=0;w<Ht;w+=1)nr.effect_deps.add(f.deps[w]);if(wt!==null)for(let w=0;w<wt.length;w+=1)nr.effect_deps.add(wt[w])}nr=null}var b=O;if(c){if((f.f&32768)!==0)var I=Xc();if((v=n.b)!=null&&v.is_rendered())(y=b.async_deriveds.get(f))==null||y.reject(Wo);else for(let w of u.values())w.reject(Wo);u.add(p),b.async_deriveds.set(f,p)}let g=(w,x=void 0)=>{S&&(nr=null),I==null||I(),u.delete(p),x!==Wo&&(b.activate(),x?(a.f|=8388608,Qr(a,x)):((a.f&8388608)!==0&&(a.f^=8388608),S&&t!==void 0&&!a.equals(w)&&($s.add(a),setTimeout(()=>{$s.has(a)&&(f.f&16384)===0&&(Op(a.label,t),$s.delete(a))})),Qr(a,w)),b.deactivate())};p.promise.then(g,w=>g(null,w||"unknown"))}),pt(()=>{for(let f of u)f.reject(Wo)}),S&&(a.f|=4194304),new Promise(f=>{function p(b){function I(){b===o?f(a):p(o)}b.then(I,I)}p(o)})}function Un(r){let e=bi(r);return e.equals=Il,e}function fh(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Oe(e[t])}}var Vc=[];function Ps(r){var e,t=Y,n=r.parent;if(!pr&&n!==null&&r.v!==Ge&&(n.f&24576)!==0)return $p(),r.v;if(et(n),S){let o=Xi;Yl(new Set);try{fi.call(Vc,r)&&Ap(),Vc.push(r),r.f&=-65537,fh(r),e=Ml(r)}finally{et(t),Yl(o),Vc.pop()}}else try{r.f&=-65537,fh(r),e=Ml(r)}finally{et(t)}return e}function Lc(r){var t,n,o;var e=Ps(r);if(!r.equals(e)&&(r.wv=Zo(),(!((t=O)!=null&&t.is_fork)||r.deps===null)&&(O!==null?(O.capture(r,e,!0),(n=dn)==null||n.capture(r,e,!0)):r.v=e,r.deps===null))){ke(r,1024);return}pr||(ot!==null?(mi()||(o=O)!=null&&o.is_fork)&&ot.set(r,e):Go(r))}function mh(r){var e,t;if(r.effects!==null)for(let n of r.effects)(n.teardown||n.ac)&&((e=n.teardown)==null||e.call(n),(t=n.ac)==null||t.abort(di),n.fn!==null&&(n.teardown=en),n.ac=null,Ui(n,0),Hs(n))}function Oc(r){if(r.effects!==null)for(let e of r.effects)e.teardown&&e.fn!==null&&Vr(e)}var Xl=null,Yo=null,O=null,dn=null,ot=null,Jc=null,Di=!1,Pc=!1,Qi=null,zs=null,hh=0,Hc=new Set,EI=1,Xo,Qn,Vn,Uo,Qo,Vo,Ln,Lo,Jt,Ks,On,Lr,fn,Oo,vi,xe,jc,Js,zc,bh,vh,Mo,yh,js,Ul=class Ul{constructor(){q(this,xe);h(this,"id",EI++);q(this,Xo,!1);h(this,"linked",!0);q(this,Qn,null);q(this,Vn,null);h(this,"async_deriveds",new Map);h(this,"current",new Map);h(this,"previous",new Map);q(this,Uo,new Set);q(this,Qo,new Set);q(this,Vo,0);q(this,Ln,new Map);q(this,Lo,null);q(this,Jt,[]);q(this,Ks,[]);q(this,On,new Set);q(this,Lr,new Set);q(this,fn,new Map);q(this,Oo,new Set);h(this,"is_fork",!1);q(this,vi,!1);Yo===null?Xl=Yo=this:(j(Yo,Vn,this),j(this,Qn,Yo)),Yo=this}skip_effect(e){C(this,fn).has(e)||C(this,fn).set(e,{d:[],m:[]}),C(this,Oo).delete(e)}unskip_effect(e,t=n=>this.schedule(n)){var n=C(this,fn).get(e);if(n){C(this,fn).delete(e);for(var o of n.d)ke(o,2048),t(o);for(o of n.m)ke(o,4096),t(o)}C(this,Oo).add(e)}capture(e,t,n=!1){e.v!==Ge&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&8388608)===0&&(this.current.set(e,[t,n]),ot==null||ot.set(e,t)),this.is_fork||(e.v=t)}activate(){O=this}deactivate(){O=null,ot=null}flush(){try{S&&Hc.clear(),Pc=!0,O=this,le(this,xe,Js).call(this)}finally{if(hh=0,Jc=null,Qi=null,zs=null,Pc=!1,O=null,ot=null,$n.clear(),S)for(let e of Hc)e.updated=null}}discard(){var e;for(let t of C(this,Qo))t(this);C(this,Qo).clear();for(let t of this.async_deriveds.values())t.reject(Wo);le(this,xe,js).call(this),(e=C(this,Lo))==null||e.resolve()}register_created_effect(e){C(this,Ks).push(e)}increment(e,t){var n;if(j(this,Vo,C(this,Vo)+1),e){let o=(n=C(this,Ln).get(t))!=null?n:0;C(this,Ln).set(t,o+1)}}decrement(e,t){var n;if(j(this,Vo,C(this,Vo)-1),e){let o=(n=C(this,Ln).get(t))!=null?n:0;o===1?C(this,Ln).delete(t):C(this,Ln).set(t,o-1)}C(this,vi)||(j(this,vi,!0),it(()=>{j(this,vi,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(let n of e)C(this,On).add(n);for(let n of t)C(this,Lr).add(n);e.clear(),t.clear()}oncommit(e){C(this,Uo).add(e)}ondiscard(e){C(this,Qo).add(e)}settled(){var e;return((e=C(this,Lo))!=null?e:j(this,Lo,yl())).promise}static ensure(){if(O===null){let e=O=new Ul;!Pc&&!Di&&it(()=>{C(e,Xo)||e.flush()})}return O}apply(){if(!nt||!this.is_fork&&C(this,Qn)===null&&C(this,Vn)===null){ot=null;return}ot=new Map;for(let[t,[n]]of this.current)ot.set(t,n);for(let t=Xl;t!==null;t=C(t,Vn))if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,o]]of t.current)if(!o&&this.current.has(n)){e=!0;break}}if(!e)for(let[n,o]of t.previous)ot.has(n)||ot.set(n,o)}}schedule(e){var o;if(Jc=e,(o=e.b)!=null&&o.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Qi!==null&&t===Y&&(nt||($===null||($.f&2)===0)&&!oh))return;if((n&96)!==0){if((n&1024)===0)return;t.f^=1024}}C(this,Jt).push(t)}};Xo=new WeakMap,Qn=new WeakMap,Vn=new WeakMap,Uo=new WeakMap,Qo=new WeakMap,Vo=new WeakMap,Ln=new WeakMap,Lo=new WeakMap,Jt=new WeakMap,Ks=new WeakMap,On=new WeakMap,Lr=new WeakMap,fn=new WeakMap,Oo=new WeakMap,vi=new WeakMap,xe=new WeakSet,jc=function(){if(this.is_fork)return!0;for(let n of C(this,Ln).keys()){for(var e=n,t=!1;e.parent!==null;){if(C(this,fn).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},Js=function(){var f,p,b,I;if(j(this,Xo,!0),hh++>1e3&&(le(this,xe,js).call(this),BI()),S)for(let g of this.current.keys())Hc.add(g);for(let g of C(this,On))C(this,Lr).delete(g),ke(g,2048),this.schedule(g);for(let g of C(this,Lr))ke(g,4096),this.schedule(g);let e=C(this,Jt);j(this,Jt,[]),this.apply();var t=Qi=[],n=[],o=zs=[];for(let g of e)try{le(this,xe,zc).call(this,g,t,n)}catch(v){throw wh(g),le(this,xe,jc).call(this)||this.discard(),v}if(O=null,o.length>0){var a=Ul.ensure();for(let g of o)a.schedule(g)}if(Qi=null,zs=null,le(this,xe,jc).call(this)){le(this,xe,Mo).call(this,n),le(this,xe,Mo).call(this,t);for(let[g,v]of C(this,fn))Ih(g,v);o.length>0&&le(f=O,xe,Js).call(f);return}let c=le(this,xe,bh).call(this);if(c){le(this,xe,Mo).call(this,n),le(this,xe,Mo).call(this,t),le(p=c,xe,vh).call(p,this);return}C(this,On).clear(),C(this,Lr).clear();for(let g of C(this,Uo))g(this);C(this,Uo).clear(),dn=this,gh(n),gh(t),dn=null,(b=C(this,Lo))==null||b.resolve();var u=O;if(C(this,Vo)===0&&(C(this,Jt).length===0||u!==null)&&(le(this,xe,js).call(this),nt&&(le(this,xe,yh).call(this),O=u)),C(this,Jt).length>0)if(u!==null){let g=u;C(g,Jt).push(...C(this,Jt).filter(v=>!C(g,Jt).includes(v)))}else u=this;u!==null&&le(I=u,xe,Js).call(I)},zc=function(e,t,n){e.f^=1024;for(var o=e.first;o!==null;){var a=o.f,c=(a&96)!==0,u=c&&(a&1024)!==0,f=u||(a&8192)!==0||C(this,fn).has(o);if(!f&&o.fn!==null){c?o.f^=1024:(a&4)!==0?t.push(o):nt&&(a&16777224)!==0?n.push(o):Pn(o)&&((a&16)!==0&&C(this,Lr).add(o),Vr(o));var p=o.first;if(p!==null){o=p;continue}}for(;o!==null;){var b=o.next;if(b!==null){o=b;break}o=o.parent}}},bh=function(){for(var e=C(this,Qn);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=C(e,Qn)}return null},vh=function(e){var n;for(let[o,a]of e.current)!this.previous.has(o)&&e.previous.has(o)&&this.previous.set(o,e.previous.get(o)),this.current.set(o,a);for(let[o,a]of e.async_deriveds){let c=this.async_deriveds.get(o);c&&a.promise.then(c.resolve).catch(c.reject)}e.async_deriveds.clear(),this.transfer_effects(C(e,On),C(e,Lr));let t=o=>{var a=o.reactions;if(a!==null)for(let f of a){var c=f.f;if((c&2)!==0)t(f);else{var u=f;c&4194320&&!this.async_deriveds.has(u)&&(C(this,Lr).delete(u),ke(u,2048),this.schedule(u))}}};for(let o of this.current.keys())t(o);this.oncommit(()=>e.discard()),le(n=e,xe,js).call(n),O=this,le(this,xe,Js).call(this)},Mo=function(e){for(var t=0;t<e.length;t+=1)El(e[t],C(this,On),C(this,Lr))},yh=function(){var I;for(let g=Xl;g!==null;g=C(g,Vn)){var e=g.id<this.id,t=[];for(let[v,[y,w]]of this.current){if(g.current.has(v)){var n=g.current.get(v)[0];if(e&&y!==n)g.current.set(v,[y,w]);else continue}t.push(v)}if(e)for(let[v,y]of this.async_deriveds){let w=g.async_deriveds.get(v);w&&y.promise.then(w.resolve).catch(w.reject)}var o=[...g.current.keys()].filter(v=>!g.current.get(v)[1]);if(!(!C(g,Xo)||o.length===0)){var a=o.filter(v=>!this.current.has(v));if(a.length===0)e&&g.discard();else if(t.length>0){if(S&&!C(g,vi)&&Up(C(g,Jt).length===0,"Batch has scheduled roots"),e)for(let v of C(this,Oo))g.unskip_effect(v,y=>{var w;(y.f&4194320)!==0?g.schedule(y):le(w=g,xe,Mo).call(w,[y])});g.activate();var c=new Set,u=new Map;for(var f of t)_h(f,a,c,u);u=new Map;var p=[...g.current].filter(([v,y])=>{let w=this.current.get(v);return w?w[0]!==y[0]||w[1]!==y[1]:!0}).map(([v])=>v);if(p.length>0)for(let v of C(this,Ks))(v.f&155648)===0&&Kc(v,p,u)&&((v.f&4194320)!==0?(ke(v,2048),g.schedule(v)):C(g,On).add(v));if(C(g,Jt).length>0&&!C(g,vi)){g.apply();for(var b of C(g,Jt))le(I=g,xe,zc).call(I,b,[],[]);j(g,Jt,[])}g.deactivate()}}}},js=function(){if(this.linked){var e=C(this,Qn),t=C(this,Vn);e===null?Xl=t:j(e,Vn,t),t===null?Yo=e:j(t,Qn,e),this.linked=!1}};var fr=Ul;function J(r){var e=Di;Di=!0;try{var t;for(r&&(O!==null&&!O.is_fork&&O.flush(),t=r());;){if(Vp(),O===null)return t;O.flush()}}finally{Di=e}}function BI(){var t;if(S){var r=new Map;for(let n of O.current.keys())for(let[o,a]of(t=n.updated)!=null?t:[]){var e=r.get(o);e||(e={error:a.error,count:0},r.set(o,e)),e.count+=a.count}for(let n of r.values())n.error&&console.error(n.error)}try{Tp()}catch(n){S&&Rt(n,"stack",{value:""}),Ur(n,Jc)}}var tr=null;function gh(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var n=r[t++];if((n.f&24576)===0&&Pn(n)&&(tr=new Set,Vr(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&qc(n),(tr==null?void 0:tr.size)>0)){$n.clear();for(let o of tr){if((o.f&24576)!==0)continue;let a=[o],c=o.parent;for(;c!==null;)tr.has(c)&&(tr.delete(c),a.push(c)),c=c.parent;for(let u=a.length-1;u>=0;u--){let f=a[u];(f.f&24576)===0&&Vr(f)}}tr.clear()}}tr=null}}function _h(r,e,t,n){if(!t.has(r)&&(t.add(r),r.reactions!==null))for(let o of r.reactions){let a=o.f;(a&2)!==0?_h(o,e,t,n):(a&4194320)!==0&&(a&2048)===0&&Kc(o,e,n)&&(ke(o,2048),ea(o))}}function Kc(r,e,t){let n=t.get(r);if(n!==void 0)return n;if(r.deps!==null)for(let o of r.deps){if(fi.call(e,o))return!0;if((o.f&2)!==0&&Kc(o,e,t))return t.set(o,!0),!0}return t.set(r,!1),!1}function ea(r){O.schedule(r)}function Ih(r,e){if(!((r.f&32)!==0&&(r.f&1024)!==0)){(r.f&2048)!==0?e.d.push(r):(r.f&4096)!==0&&e.m.push(r),ke(r,1024);for(var t=r.first;t!==null;)Ih(t,e),t=t.next}}function wh(r){ke(r,1024);for(var e=r.first;e!==null;)wh(e),e=e.next}var Xi=new Set,$n=new Map;function Yl(r){Xi=r}var ed=!1;function Kp(){ed=!0}function Vt(r,e){var t={f:0,v:r,reactions:null,equals:_l,rv:0,wv:0};return S&&Zr&&(t.created=e!=null?e:Yr("created at"),t.updated=null,t.set_during_effect=!1,t.trace=null),t}function ln(r,e){let t=Vt(r,e);return $c(t),t}function Ce(r,e=!1,t=!0){var o,a;let n=Vt(r);return e||(n.equals=Il),tn&&t&&K!==null&&K.l!==null&&((a=(o=K.l).s)!=null?a:o.s=[]).push(n),n}function td(r,e){return z(r,V(()=>A(r))),e}function z(r,e,t=!1){$!==null&&(!jt||($.f&131072)!==0)&&nn()&&($.f&4325394)!==0&&(hr===null||!hr.has(r))&&Zp();let n=t?Wn(e):e;return S&&xl(n,r.label),Qr(r,n,zs)}function Qr(r,e,t=null){var o,a,c;if(!r.equals(e)){$n.set(r,pr?e:r.v);var n=fr.ensure();if(n.capture(r,e),S){if(Zr||Y!==null){(o=r.updated)!=null||(r.updated=new Map);let u=((c=(a=r.updated.get(""))==null?void 0:a.count)!=null?c:0)+1;if(r.updated.set("",{error:null,count:u}),Zr||u>5){let f=Yr("updated at");if(f!==null){let p=r.updated.get(f.stack);p||(p={error:f,count:0},r.updated.set(f.stack,p)),p.count++}}}Y!==null&&(r.set_during_effect=!0)}if((r.f&2)!==0){let u=r;(r.f&2048)!==0&&Ps(u),ot===null&&Go(u)}r.wv=Zo(),xh(r,2048,t),nn()&&Y!==null&&(Y.f&1024)!==0&&(Y.f&96)===0&&(gr===null?Ah([r]):gr.push(r)),!n.is_fork&&Xi.size>0&&!ed&&Rl()}return e}function Rl(){ed=!1;for(let r of Xi){(r.f&1024)!==0&&ke(r,4096);let e;try{e=Pn(r)}catch(t){e=!0}e&&Vr(r)}Xi.clear()}function Zi(r){z(r,r.v+1)}function xh(r,e,t){var g;var n=r.reactions;if(n!==null)for(var o=nn(),a=n.length,c=0;c<a;c++){var u=n[c],f=u.f;if(!(!o&&u===Y)){var p=(f&2048)===0;if(p&&ke(u,e),(f&131072)!==0)Xi.add(u);else if((f&2)!==0){var b=u;(g=ot)==null||g.delete(b),(f&65536)===0&&(f&512&&(Y===null||(Y.f&2097152)===0)&&(u.f|=65536),xh(b,4096,t))}else if(p){var I=u;(f&16)!==0&&tr!==null&&tr.add(I),t!==null?t.push(I):ea(I)}}}}var kh=null;var Rh=!1;function Ql(){Rh||(Rh=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(let t of r.target.elements)(e=t[ci])==null||e.call(t)})},{capture:!0}))}function Hn(r){var e=$,t=Y;ft(null),et(null);try{return r()}finally{ft(e),et(t)}}function Vl(r,e,t,n=t){r.addEventListener(e,()=>Hn(t));let o=r[ci];o?r[ci]=()=>{o(),n(!0)}:r[ci]=()=>n(!0),Ql()}var Ll=!1,pr=!1;function rd(r){pr=r}var $=null,jt=!1;function ft(r){$=r}var Y=null;function et(r){Y=r}var hr=null;function $c(r){$!==null&&(!nt||($.f&2)!==0)&&(hr!=null?hr:hr=new Set).add(r)}var wt=null,Ht=0,gr=null;function Ah(r){gr=r}var Sh=1,Li=0,pi=Li;function Gc(r){pi=r}function Zo(){return++Sh}function Pn(r){var e=r.f;if((e&2048)!==0)return!0;if(e&2&&(r.f&=-65537),(e&4096)!==0){for(var t=r.deps,n=t.length,o=0;o<n;o++){var a=t[o];if(Pn(a)&&Lc(a),a.wv>r.wv)return!0}(e&512)!==0&&ot===null&&ke(r,1024)}return!1}function Fh(r,e,t=!0){var n=r.reactions;if(n!==null&&!(!nt&&hr!==null&&hr.has(r)))for(var o=0;o<n.length;o++){var a=n[o];(a.f&2)!==0?Fh(a,e,!1):e===a&&(t?ke(a,2048):(a.f&1024)!==0&&ke(a,4096),ea(a))}}function Ml(r){var w,x,k;var e=wt,t=Ht,n=gr,o=$,a=hr,c=K,u=jt,f=pi,p=r.f;wt=null,Ht=0,gr=null,$=(p&96)===0?r:null,hr=null,Nn(r.ctx),jt=!1,pi=++Li,r.ac!==null&&(Hn(()=>{r.ac.abort(di)}),r.ac=null);try{r.f|=2097152;var b=r.fn,I=b();r.f|=32768;var g=r.deps,v=(w=O)==null?void 0:w.is_fork;if(wt!==null){var y;if(v||Ui(r,Ht),g!==null&&Ht>0)for(g.length=Ht+wt.length,y=0;y<wt.length;y++)g[Ht+y]=wt[y];else r.deps=g=wt;if(mi()&&(r.f&512)!==0)for(y=Ht;y<g.length;y++)((k=(x=g[y]).reactions)!=null?k:x.reactions=[]).push(r)}else!v&&g!==null&&Ht<g.length&&(Ui(r,Ht),g.length=Ht);if(nn()&&gr!==null&&!jt&&g!==null&&(r.f&6146)===0)for(y=0;y<gr.length;y++)Fh(gr[y],r);if(o!==null&&o!==r){if(Li++,o.deps!==null)for(let E=0;E<t;E+=1)o.deps[E].rv=Li;if(e!==null)for(let E of e)E.rv=Li;gr!==null&&(n===null?n=gr:n.push(...gr))}return(r.f&8388608)!==0&&(r.f^=8388608),I}catch(E){return Gl(E)}finally{r.f^=2097152,wt=e,Ht=t,gr=n,$=o,hr=a,Nn(c),jt=u,pi=f}}function NI(r,e){let t=e.reactions;if(t!==null){var n=yp.call(t,r);if(n!==-1){var o=t.length-1;o===0?t=e.reactions=null:(t[n]=t[o],t.pop())}}if(t===null&&(e.f&2)!==0&&(wt===null||!fi.call(wt,e))){var a=e;(a.f&512)!==0&&(a.f^=512,a.f&=-65537),a.v!==Ge&&Go(a),mh(a),Ui(a,0)}}function Ui(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)NI(r,t[n])}function Vr(r){var f;var e=r.f;if((e&16384)===0){ke(r,1024);var t=Y,n=Ll;if(Y=r,Ll=!0,S){var o=Mr;Al(r.component_function);var a=rn;Ao((f=r.dev_stack)!=null?f:rn)}try{(e&16777232)!==0?Eh(r):Hs(r),nd(r);var c=Ml(r);if(r.teardown=typeof c=="function"?c:null,r.wv=Sh,S&&Zr&&(r.f&2048)!==0&&r.deps!==null)for(var u of r.deps)u.set_during_effect&&(u.wv=Zo(),u.set_during_effect=!1)}finally{Ll=n,Y=t,S&&(Al(o),Ao(a))}}}async function Jn(){if(nt)return new Promise(r=>{requestAnimationFrame(()=>r()),setTimeout(()=>r())});await Promise.resolve(),J()}function A(r){var v,y,w;var e=r.f,t=(e&2)!==0;if((v=kh)==null||v.add(r),$!==null&&!jt){var n=Y!==null&&(Y.f&16384)!==0;if(!n&&(hr===null||!hr.has(r))){var o=$.deps;if(($.f&2097152)!==0)r.rv<Li&&(r.rv=Li,wt===null&&o!==null&&o[Ht]===r?Ht++:wt===null?wt=[r]:wt.push(r));else{(y=$.deps)!=null||($.deps=[]),fi.call($.deps,r)||$.deps.push(r);var a=r.reactions;a===null?r.reactions=[$]:fi.call(a,$)||a.push($)}}}if(S){if(!jt&&nr&&O===null&&dn===null&&!nr.warned&&(nr.effect.f&2097152)===0&&!nr.effect_deps.has(r)){nr.warned=!0,Lp(r.label);var c=Yr("traced at");c&&console.warn(c)}if($s.delete(r),Zr&&!jt&&Ws!==null&&$!==null&&Ws.reaction===$){if(r.trace)r.trace();else if(c=Yr("traced at"),c){var u=Ws.entries.get(r);u===void 0&&(u={traces:[]},Ws.entries.set(r,u));var f=u.traces[u.traces.length-1];c.stack!==(f==null?void 0:f.stack)&&u.traces.push(c)}}}if(pr&&$n.has(r))return $n.get(r);if(t){var p=r;if(pr){var b=p.v;return((p.f&1024)===0&&p.reactions!==null||Gh(p))&&(b=Ps(p)),$n.set(p,b),b}var I=(p.f&512)===0&&!jt&&$!==null&&(Ll||($.f&512)!==0),g=(p.f&32768)===0;Pn(p)&&(I&&(p.f|=512),Lc(p)),I&&!g&&(Oc(p),Th(p))}if((w=ot)!=null&&w.has(r))return ot.get(r);if((r.f&8388608)!==0)throw r.v;return r.v}function Th(r){var e;if(r.f|=512,r.deps!==null)for(let t of r.deps)((e=t.reactions)!=null?e:t.reactions=[]).push(r),(t.f&2)!==0&&(t.f&512)===0&&(Oc(t),Th(t))}function Gh(r){if(r.v===Ge)return!0;if(r.deps===null)return!1;for(let e of r.deps)if($n.has(e)||(e.f&2)!==0&&Gh(e))return!0;return!1}function V(r){var e=jt;try{return jt=!0,r()}finally{jt=e}}function st(r){if(!(typeof r!="object"||!r||r instanceof EventTarget)){if(ct in r)Ol(r);else if(!Array.isArray(r))for(let e in r){let t=r[e];typeof t=="object"&&t&&ct in t&&Ol(t)}}}function Ol(r,e=new Set){if(typeof r=="object"&&r!==null&&!(r instanceof EventTarget)&&!e.has(r)){e.add(r),r instanceof Date&&r.getTime();for(let n in r)try{Ol(r[n],e)}catch(o){}let t=Ei(r);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){let n=vl(t);for(let o in n){let a=n[o].get;if(a)try{a.call(r)}catch(c){}}}}}function id(r){Y===null&&($===null&&Fp(r),Sp()),pr&&Rp(r)}function WI(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Or(r,e){var c,u;var t=Y;if(S)for(;t!==null&&(t.f&131072)!==0;)t=t.parent;t!==null&&(t.f&8192)!==0&&(r|=8192);var n={ctx:K,deps:null,nodes:null,f:r|2048|512,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};S&&(n.component_function=Mr),(c=O)==null||c.register_created_effect(n);var o=n;if((r&4)!==0)Qi!==null?Qi.push(n):fr.ensure().schedule(n);else if(e!==null){try{Vr(n)}catch(f){throw Oe(n),f}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&524288)===0&&(o=o.first,(r&16)!==0&&(r&65536)!==0&&o!==null&&(o.f|=65536))}if(o!==null&&(o.parent=t,t!==null&&WI(o,t),$!==null&&($.f&2)!==0&&(r&64)===0)){var a=$;((u=a.effects)!=null?u:a.effects=[]).push(o)}return n}function mi(){return $!==null&&!jt}function pt(r){let e=Or(8,null);return ke(e,1024),e.teardown=r,e}function Po(r){var o;id("$effect"),S&&Rt(r,"name",{value:"$effect"});var e=Y.f,t=!$&&(e&32)!==0&&K!==null&&!K.i;if(t){var n=K;((o=n.e)!=null?o:n.e=[]).push(r)}else return Tc(r)}function Tc(r){return Or(1048580,r)}function ta(r){return id("$effect.pre"),S&&Rt(r,"name",{value:"$effect.pre"}),Or(1048584,r)}function od(r){fr.ensure();let e=Or(524352,r);return()=>{Oe(e)}}function Nh(r){fr.ensure();let e=Or(524352,r);return(t={})=>new Promise(n=>{t.outro?cn(e,()=>{Oe(e),n(void 0)}):(Oe(e),n(void 0))})}function br(r){return Or(4,r)}function yi(r,e){var t=K,n={effect:null,ran:!1,deps:r};t.l.$.push(n),n.effect=gt(()=>{if(r(),!n.ran){n.ran=!0;var o=Y;try{et(o.parent),V(e)}finally{et(o)}}})}function ra(){var r=K;gt(()=>{for(var e of r.l.$){e.deps();var t=e.effect;(t.f&1024)!==0&&t.deps!==null&&ke(t,4096),Pn(t)&&Vr(t),e.ran=!1}})}function ph(r){return Or(4718592,r)}function gt(r,e=0){return Or(8|e,r)}function $e(r,e=[],t=[],n=[]){Zl(n,e,t,o=>{Or(8,()=>{r(...o.map(A))})})}function mr(r,e=0){var t=Or(16|e,r);return S&&(t.dev_stack=rn),t}function bt(r){return Or(524320,r)}function nd(r){var e=r.teardown;if(e!==null){let t=pr,n=$;rd(!0),ft(null);try{e.call(null)}finally{rd(t),ft(n)}}}function Hs(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){let o=t.ac;o!==null&&Hn(()=>{o.abort(di)});var n=t.next;(t.f&64)!==0?t.parent=null:Oe(t,e),t=n}}function Eh(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&32)===0&&Oe(e),e=t}}function Oe(r,e=!0){var t=!1;(e||(r.f&262144)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(Wh(r.nodes.start,r.nodes.end),t=!0),r.f|=33554432,Hs(r,e&&!t),Ui(r,0);var n=r.nodes&&r.nodes.t;if(n!==null)for(let a of n)a.stop();nd(r),r.f^=33554432,r.f|=16384;var o=r.parent;o!==null&&o.first!==null&&qc(r),S&&(r.component_function=null),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function Wh(r,e){for(;r!==null;){var t=r===e?null:Et(r);r.remove(),r=t}}function qc(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function cn(r,e,t=!0){var n=[];Zh(r,n,!0);var o=()=>{t&&Oe(r),e&&e()},a=n.length;if(a>0){var c=()=>--a||o();for(var u of n)u.out(c)}else o()}function Zh(r,e,t){if((r.f&8192)===0){r.f^=8192;var n=r.nodes&&r.nodes.t;if(n!==null)for(let u of n)(u.is_global||t)&&e.push(u);for(var o=r.first;o!==null;){var a=o.next;if((o.f&64)===0){var c=(o.f&65536)!==0||(o.f&32)!==0&&(r.f&16)!==0;Zh(o,e,c?t:!1)}o=a}}}function Ho(r){Yh(r,!0)}function Yh(r,e){if((r.f&8192)!==0){r.f^=8192,(r.f&1024)===0&&(ke(r,2048),fr.ensure().schedule(r));for(var t=r.first;t!==null;){var n=t.next,o=(t.f&65536)!==0||(t.f&32)!==0;Yh(t,o?e:!1),t=n}var a=r.nodes&&r.nodes.t;if(a!==null)for(let c of a)(c.is_global||e)&&c.in()}}function Do(r,e){if(r.nodes)for(var t=r.nodes.start,n=r.nodes.end;t!==null;){var o=t===n?null:Et(t);e.append(t),t=o}}var $l=Symbol("events"),Xh=new Set,sd=new Set;function Uh(r,e,t,n={}){function o(a){if(n.capture||Pl.call(e,a),!a.cancelBubble)return Hn(()=>t==null?void 0:t.call(this,a))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?it(()=>{e.addEventListener(r,o,n)}):e.addEventListener(r,o,n),o}function ce(r,e,t,n,o){var a={capture:n,passive:o},c=Uh(r,e,t,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&pt(()=>{e.removeEventListener(r,c,a)})}var Mh=null;function Pl(r){var w,x;var e=this,t=e.ownerDocument,n=r.type,o=((w=r.composedPath)==null?void 0:w.call(r))||[],a=o[0]||r.target;Mh=r;var c=0,u=Mh===r&&r[$l];if(u){var f=o.indexOf(u);if(f!==-1&&(e===document||e===window)){r[$l]=e;return}var p=o.indexOf(e);if(p===-1)return;f<=p&&(c=f)}if(a=o[c]||r.target,a!==e){Rt(r,"currentTarget",{configurable:!0,get(){return a||t}});var b=$,I=Y;ft(null),et(null);try{for(var g,v=[];a!==null&&a!==e;){try{var y=(x=a[$l])==null?void 0:x[n];y!=null&&(!a.disabled||r.target===a)&&y.call(a,r)}catch(k){g?v.push(k):g=k}if(r.cancelBubble)break;c++,a=c<o.length?o[c]:null}if(g){for(let k of v)queueMicrotask(()=>{throw k});throw g}}finally{r[$l]=e,delete r.currentTarget,ft(b),et(I)}}}var Qh,ad=((Qh=globalThis==null?void 0:globalThis.window)==null?void 0:Qh.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function Vh(r){var e;return(e=ad==null?void 0:ad.createHTML(r))!=null?e:r}function ld(r){var e=Zn("template");return e.innerHTML=Vh(r.replaceAll("<!>","<!---->")),e.content}function jn(r,e){var t=Y;t.nodes===null&&(t.nodes={start:r,end:e,a:null,t:null})}function ve(r,e){var t=(e&1)!==0,n=(e&2)!==0,o,a=!r.startsWith("<!>");return()=>{if(L)return jn(ne,null),ne;o===void 0&&(o=ld(a?r:"<!>"+r),t||(o=Xt(o)));var c=n||Xs?document.importNode(o,!0):o.cloneNode(!0);if(t){var u=Xt(c),f=c.lastChild;jn(u,f)}else jn(c,c);return c}}function de(r,e){if(L){var t=Y;((t.f&32768)===0||t.nodes.end===null)&&(t.nodes.end=ne),Gt();return}r!==null&&r.before(e)}var QI=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var S1=[...QI,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var VI=["touchstart","touchmove"];function Lh(r){return VI.includes(r)}var LI=["$state","$state.raw","$derived","$derived.by"],F1=[...LI,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var cd=!0;function Pe(r,e){var n,o;var t=e==null?"":typeof e=="object"?`${e}`:e;t!==((o=r[n=Ns])!=null?o:r[n]=r.nodeValue)&&(r[Ns]=t,r.nodeValue=`${t}`)}function Jl(r,e){return Oh(r,e)}function fd(r,e){var c;Sl(),e.intro=(c=e.intro)!=null?c:!1;let t=e.target,n=L,o=ne;try{for(var a=Xt(t);a&&(a.nodeType!==Ar||a.data!=="[");)a=Et(a);if(!a)throw Dn;dt(!0),Se(a);let u=Oh(r,{...e,anchor:a});return dt(!1),u}catch(u){if(u instanceof Error&&u.message.split(`
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw u;return u!==Dn&&console.warn("Failed to hydrate: ",u),e.recover===!1&&Gp(),Sl(),Us(t),dt(!1),Jl(r,e)}finally{dt(n),Se(o)}}var Hl=new Map;function Oh(r,{target:e,anchor:t,props:n={},events:o,context:a,intro:c=!0,transformError:u}){Sl();var f=void 0,p=Nh(()=>{var b=t!=null?t:e.appendChild(It());Mc(b,{pending:()=>{}},v=>{Ke({});var y=K;if(a&&(y.c=a),o&&(n.$$events=o),L&&jn(v,null),cd=c,f=r(v,n)||{},cd=!0,L&&(Y.nodes.end=ne,ne===null||ne.nodeType!==Ar||ne.data!=="]"))throw Ni(),Dn;qe()},u);var I=new Set,g=v=>{for(var y=0;y<v.length;y++){var w=v[y];if(!I.has(w)){I.add(w);var x=Lh(w);for(let Z of[e,document]){var k=Hl.get(Z);k===void 0&&(k=new Map,Hl.set(Z,k));var E=k.get(w);E===void 0?(Z.addEventListener(w,Pl,{passive:x}),k.set(w,1)):k.set(w,E+1)}}}};return g(wo(Xh)),sd.add(g),()=>{var x;for(var v of I)for(let k of[e,document]){var y=Hl.get(k),w=y.get(v);--w==0?(k.removeEventListener(v,Pl),y.delete(v),y.size===0&&Hl.delete(k)):y.set(v,w)}sd.delete(g),b!==t&&((x=b.parentNode)==null||x.removeChild(b))}});return dd.set(f,p),f}var dd=new WeakMap;function md(r,e){let t=dd.get(r);return t?(dd.delete(r),t(e)):(S&&(ct in r?jp():Hp()),Promise.resolve())}function jl(r){return function(...e){var t=e[0];return t.stopPropagation(),r==null?void 0:r.apply(this,e)}}function zl(r){return function(...e){var t=e[0];return t.preventDefault(),r==null?void 0:r.apply(this,e)}}function at(r){return new pd(r)}var zn,Er,pd=class{constructor(e){q(this,zn);q(this,Er);var a,c;var t=new Map,n=(u,f)=>{var p=Ce(f,!1,!1);return t.set(u,p),p};let o=new Proxy({...e.props||{},$$events:{}},{get(u,f){var p;return A((p=t.get(f))!=null?p:n(f,Reflect.get(u,f)))},has(u,f){var p;return f===Bs?!0:(A((p=t.get(f))!=null?p:n(f,Reflect.get(u,f))),Reflect.has(u,f))},set(u,f,p){var b;return z((b=t.get(f))!=null?b:n(f,p),p),Reflect.set(u,f,p)}});j(this,Er,(e.hydrate?fd:Jl)(e.component,{target:e.target,anchor:e.anchor,props:o,context:e.context,intro:(a=e.intro)!=null?a:!1,recover:e.recover,transformError:e.transformError})),!nt&&(!((c=e==null?void 0:e.props)!=null&&c.$$host)||e.sync===!1)&&J(),j(this,zn,o.$$events);for(let u of Object.keys(C(this,Er)))u==="$set"||u==="$destroy"||u==="$on"||Rt(this,u,{get(){return C(this,Er)[u]},set(f){C(this,Er)[u]=f},enumerable:!0});C(this,Er).$set=u=>{Object.assign(o,u)},C(this,Er).$destroy=()=>{md(C(this,Er))}}$set(e){C(this,Er).$set(e)}$on(e,t){C(this,zn)[e]=C(this,zn)[e]||[];let n=(...o)=>t.call(this,...o);return C(this,zn)[e].push(n),()=>{C(this,zn)[e]=C(this,zn)[e].filter(o=>o!==n)}}$destroy(){C(this,Er).$destroy()}};zn=new WeakMap,Er=new WeakMap;var $h,Ph,Hh;typeof window!="undefined"&&((Hh=(Ph=($h=window.__svelte)!=null?$h:window.__svelte={}).v)!=null?Hh:Ph.v=new Set).add("5");Mp();var $r,mn,vr,Oi,na,ia,Kl,Kn=class{constructor(e,t=!0){h(this,"anchor");q(this,$r,new Map);q(this,mn,new Map);q(this,vr,new Map);q(this,Oi,new Set);q(this,na,!0);q(this,ia,e=>{if(C(this,$r).has(e)){var t=C(this,$r).get(e),n=C(this,mn).get(t);if(n)Ho(n),C(this,Oi).delete(t);else{var o=C(this,vr).get(t);o&&(Ho(o.effect),C(this,mn).set(t,o.effect),C(this,vr).delete(t),S&&(o.fragment.lastChild[wc]=this.anchor),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(let[a,c]of C(this,$r)){if(C(this,$r).delete(a),a===e)break;let u=C(this,vr).get(c);u&&(Oe(u.effect),C(this,vr).delete(c))}for(let[a,c]of C(this,mn)){if(a===t||C(this,Oi).has(a))continue;let u=()=>{if(Array.from(C(this,$r).values()).includes(a)){var p=document.createDocumentFragment();Do(c,p),p.append(It()),C(this,vr).set(a,{effect:c,fragment:p})}else Oe(c);C(this,Oi).delete(a),C(this,mn).delete(a)};C(this,na)||!n?(C(this,Oi).add(a),cn(c,u,!1)):u()}}});q(this,Kl,e=>{C(this,$r).delete(e);let t=Array.from(C(this,$r).values());for(let[n,o]of C(this,vr))t.includes(n)||(Oe(o.effect),C(this,vr).delete(n))});this.anchor=e,j(this,na,t)}ensure(e,t){var n=O,o=Fl();if(t&&!C(this,mn).has(e)&&!C(this,vr).has(e))if(o){var a=document.createDocumentFragment(),c=It();a.append(c),C(this,vr).set(e,{effect:bt(()=>t(c)),fragment:a})}else C(this,mn).set(e,bt(()=>t(this.anchor)));if(C(this,$r).set(n,e),o){for(let[u,f]of C(this,mn))u===e?n.unskip_effect(f):n.skip_effect(f);for(let[u,f]of C(this,vr))u===e?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(C(this,ia)),n.ondiscard(C(this,Kl))}else L&&(this.anchor=ne),C(this,ia).call(this,n)}};$r=new WeakMap,mn=new WeakMap,vr=new WeakMap,Oi=new WeakMap,na=new WeakMap,ia=new WeakMap,Kl=new WeakMap;if(S){let r=function(e){if(!(e in globalThis)){let t;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(t!==void 0)return t;Dp(e)},set:n=>{t=n}})}};r("$state"),r("$effect"),r("$derived"),r("$inspect"),r("$props"),r("$bindable")}function Jo(r){K===null&&xo("onMount"),tn&&K.l!==null?zh(K).m.push(r):Po(()=>{let e=V(r);if(typeof e=="function")return e})}function KI(r,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(r,{detail:e,bubbles:t,cancelable:n})}function jo(){let r=K;return r===null&&xo("createEventDispatcher"),(e,t,n)=>{var a;let o=(a=r.s.$$events)==null?void 0:a[e];if(o){let c=kr(o)?o.slice():[o],u=KI(e,t,n);for(let f of c)f.call(r.x,u);return!u.defaultPrevented}return!0}}function jh(r){K===null&&xo("afterUpdate"),K.l===null&&Ep("afterUpdate"),zh(K).a.push(r)}function zh(r){var t;var e=r.l;return(t=e.u)!=null?t:e.u={a:[],b:[],m:[]}}function pn(r,e,t=!1){var n;L&&(n=ne,Gt());var o=new Kn(r),a=t?65536:0;function c(u,f){if(L){var p=Ys(n);if(u!==parseInt(p.substring(1))){var b=an();Se(b),o.anchor=b,dt(!1),o.ensure(u,f),dt(!0);return}}o.ensure(u,f)}mr(()=>{var u=!1;e((f,p=0)=>{u=!0,c(p,f)}),u||c(-1,null)},a)}function gd(r,e){return e}function sw(r,e,t){var I;for(var n=[],o=e.length,a,c=e.length,u=0;u<o;u++){let g=e[u];cn(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var v=r.outrogroups;hd(r,wo(a.done)),v.delete(a),v.size===0&&(r.outrogroups=null)}}else c-=1},!1)}if(c===0){var f=n.length===0&&t!==null;if(f){var p=t,b=p.parentNode;Us(b),b.append(p),r.items.clear()}hd(r,e,!f)}else a={pending:new Set(e),done:new Set},((I=r.outrogroups)!=null?I:r.outrogroups=new Set).add(a)}function hd(r,e,t=!0){var n;if(r.pending.size>0){n=new Set;for(let c of r.pending.values())for(let u of c)n.add(r.items.get(u).e)}for(var o=0;o<e.length;o++){var a=e[o];if(n!=null&&n.has(a)){a.f|=33554432;let c=document.createDocumentFragment();Do(a,c)}else Oe(e[o],t)}}var zo;function zt(r,e,t,n,o,a=null){var c=r,u=new Map,f=(e&4)!==0;if(f){var p=r;c=L?Se(Xt(p)):p.appendChild(It())}L&&Gt();var b=null,I=Un(()=>{var Z=t();return kr(Z)?Z:Z==null?[]:wo(Z)});S&&Mt(I,"{#each ...}");var g,v=new Map,y=!0;function w(Z){(E.effect.f&16384)===0&&(E.pending.delete(Z),E.fallback=b,aw(E,g,c,e,n),b!==null&&(g.length===0?(b.f&33554432)===0?Ho(b):(b.f^=33554432,sa(b,null,c)):cn(b,()=>{b=null})))}function x(Z){E.pending.delete(Z)}var k=mr(()=>{g=A(I);var Z=g.length;let te=!1;if(L){var ae=Ys(c)==="[!";ae!==(Z===0)&&(c=an(),Se(c),dt(!1),te=!0)}for(var M=new Set,pe=O,ye=Fl(),Te=0;Te<Z;Te+=1){L&&ne.nodeType===Ar&&ne.data==="]"&&(c=ne,te=!0,dt(!1));var He=g[Te],he=n(He,Te);if(S){var Lt=n(He,Te);he!==Lt&&kp(String(Te),String(he),String(Lt))}var Ne=y?null:u.get(he);Ne?(Ne.v&&Qr(Ne.v,He),Ne.i&&Qr(Ne.i,Te),ye&&pe.unskip_effect(Ne.e)):(Ne=lw(u,y?c:zo!=null?zo:zo=It(),He,he,Te,o,e,t),y||(Ne.e.f|=33554432),u.set(he,Ne)),M.add(he)}if(Z===0&&a&&!b&&(y?b=bt(()=>a(c)):(b=bt(()=>a(zo!=null?zo:zo=It())),b.f|=33554432)),Z>M.size&&(S?uw(g,n):Fc("","","")),L&&Z>0&&Se(an()),!y)if(v.set(pe,M),ye){for(let[tt,xt]of u)M.has(tt)||pe.skip_effect(xt.e);pe.oncommit(w),pe.ondiscard(x)}else w(pe);te&&dt(!0),A(I)}),E={effect:k,flags:e,items:u,pending:v,outrogroups:null,fallback:b};y=!1,L&&(c=ne)}function oa(r){for(;r!==null&&(r.f&32)===0;)r=r.next;return r}function aw(r,e,t,n,o){var He,he,Lt,Ne,tt,xt,Kt,Q,ie;var a=(n&8)!==0,c=e.length,u=r.items,f=oa(r.effect.first),p,b=null,I,g=[],v=[],y,w,x,k;if(a)for(k=0;k<c;k+=1)y=e[k],w=o(y,k),x=u.get(w).e,(x.f&33554432)===0&&((he=(He=x.nodes)==null?void 0:He.a)==null||he.measure(),(I!=null?I:I=new Set).add(x));for(k=0;k<c;k+=1){if(y=e[k],w=o(y,k),x=u.get(w).e,r.outrogroups!==null)for(let D of r.outrogroups)D.pending.delete(x),D.done.delete(x);if((x.f&8192)!==0&&(Ho(x),a&&((Ne=(Lt=x.nodes)==null?void 0:Lt.a)==null||Ne.unfix(),(I!=null?I:I=new Set).delete(x))),(x.f&33554432)!==0)if(x.f^=33554432,x===f)sa(x,null,t);else{var E=b?b.next:f;x===r.effect.last&&(r.effect.last=x.prev),x.prev&&(x.prev.next=x.next),x.next&&(x.next.prev=x.prev),_i(r,b,x),_i(r,x,E),sa(x,E,t),b=x,g=[],v=[],f=oa(b.next);continue}if(x!==f){if(p!==void 0&&p.has(x)){if(g.length<v.length){var Z=v[0],te;b=Z.prev;var ae=g[0],M=g[g.length-1];for(te=0;te<g.length;te+=1)sa(g[te],Z,t);for(te=0;te<v.length;te+=1)p.delete(v[te]);_i(r,ae.prev,M.next),_i(r,b,ae),_i(r,M,Z),f=Z,b=M,k-=1,g=[],v=[]}else p.delete(x),sa(x,f,t),_i(r,x.prev,x.next),_i(r,x,b===null?r.effect.first:b.next),_i(r,b,x),b=x;continue}for(g=[],v=[];f!==null&&f!==x;)(p!=null?p:p=new Set).add(f),v.push(f),f=oa(f.next);if(f===null)continue}(x.f&33554432)===0&&g.push(x),b=x,f=oa(x.next)}if(r.outrogroups!==null){for(let D of r.outrogroups)D.pending.size===0&&(hd(r,wo(D.done)),(tt=r.outrogroups)==null||tt.delete(D));r.outrogroups.size===0&&(r.outrogroups=null)}if(f!==null||p!==void 0){var pe=[];if(p!==void 0)for(x of p)(x.f&8192)===0&&pe.push(x);for(;f!==null;)(f.f&8192)===0&&f!==r.fallback&&pe.push(f),f=oa(f.next);var ye=pe.length;if(ye>0){var Te=(n&4)!==0&&c===0?t:null;if(a){for(k=0;k<ye;k+=1)(Kt=(xt=pe[k].nodes)==null?void 0:xt.a)==null||Kt.measure();for(k=0;k<ye;k+=1)(ie=(Q=pe[k].nodes)==null?void 0:Q.a)==null||ie.fix()}sw(r,pe,Te)}}a&&it(()=>{var D,se;if(I!==void 0)for(x of I)(se=(D=x.nodes)==null?void 0:D.a)==null||se.apply()})}function lw(r,e,t,n,o,a,c,u){var f=(c&1)!==0?(c&16)===0?Ce(t,!1,!1):Vt(t):null,p=(c&2)!==0?Vt(o):null;return S&&f&&(f.trace=()=>{var b;u()[(b=p==null?void 0:p.v)!=null?b:o]}),{v:f,i:p,e:bt(()=>(a(e,f!=null?f:t,p!=null?p:o,u),()=>{r.delete(n)}))}}function sa(r,e,t){if(r.nodes)for(var n=r.nodes.start,o=r.nodes.end,a=e&&(e.f&33554432)===0?e.nodes.start:t;n!==null;){var c=Et(n);if(a.before(n),n===o)return;n=c}}function _i(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function uw(r,e){let t=new Map,n=r.length;for(let o=0;o<n;o++){let a=e(r[o],o);if(t.has(a)){let c=String(t.get(a)),u=String(o),f=String(a);f.startsWith("[object ")&&(f=null),Fc(c,u,f)}t.set(a,o)}}function bd(r,e,t,n,o){var u;L&&Gt();var a=(u=e.$$slots)==null?void 0:u[t],c=!1;a===!0&&(a=e[t==="default"?"children":t],c=!0),a===void 0?o!==null&&o(r):a(r,c?()=>n:n)}var eg=[...`
\r\f\xA0\v\uFEFF`];function tg(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var o of Object.keys(t))if(t[o])n=n?n+" "+o:o;else if(n.length)for(var a=o.length,c=0;(c=n.indexOf(o,c))>=0;){var u=c+a;(c===0||eg.includes(n[c-1]))&&(u===n.length||eg.includes(n[u]))?n=(c===0?"":n.substring(0,c))+n.substring(u+1):c=u}}return n===""?null:n}function gn(r,e,t,n,o,a){var c=r[Ds];if(L||c!==t||c===void 0){var u=tg(t,n,a);(!L||u!==r.getAttribute("class"))&&(u==null?r.removeAttribute("class"):e?r.className=u:r.setAttribute("class",u)),r[Ds]=t}else if(a&&o!==a)for(var f in a){var p=!!a[f];(o==null||p!==!!o[f])&&r.classList.toggle(f,p)}return a}function ql(r,e,t=!1){if(r.multiple){if(e==null)return;if(!kr(e))return Jp();for(var n of r.options)n.selected=e.includes(aa(n));return}for(n of r.options){var o=aa(n);if(Ec(o,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function vd(r){var e=new MutationObserver(()=>{ql(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),pt(()=>{e.disconnect()})}function la(r,e,t=e){var n=new WeakSet,o=!0;Vl(r,"change",a=>{var p;var c=a?"[selected]":":checked",u;if(r.multiple)u=[].map.call(r.querySelectorAll(c),aa);else{var f=(p=r.querySelector(c))!=null?p:r.querySelector("option:not([disabled])");u=f&&aa(f)}t(u),r.__value=u,O!==null&&n.add(O)}),br(()=>{var a=e();if(r===document.activeElement){var c=nt?dn:O;if(n.has(c))return}if(ql(r,a,o),o&&a===void 0){var u=r.querySelector(":checked");u!==null&&(a=aa(u),t(a))}r.__value=a,o=!1}),vd(r)}function aa(r){return"__value"in r?r.__value:r.value}var vw=Symbol("is custom element"),yw=Symbol("is html"),_w=Cc?"link":"LINK";function _d(r){if(L){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;Pr(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var o=r.checked;Pr(r,"checked",null),r.checked=o}}};r[ci]=t,it(t),Ql()}}function Id(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Pr(r,e,t,n){var o=Iw(r);if(L&&(o[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===_w)){n||Cw(r,e,t!=null?t:"");return}o[e]!==(o[e]=t)&&(e==="loading"&&(r[hp]=t),t==null?r.removeAttribute(e):typeof t!="string"&&ww(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function Iw(r){var e,t;return(t=r[e=bl])!=null?t:r[e]={[vw]:r.nodeName.includes("-"),[yw]:r.namespaceURI===wl}}var rg=new Map;function ww(r){var e=r.getAttribute("is")||r.nodeName,t=rg.get(e);if(t)return t;rg.set(e,t=[]);for(var n,o=r,a=Element.prototype;a!==o;){n=vl(o);for(var c in n)n[c].set&&c!=="innerHTML"&&c!=="textContent"&&c!=="innerText"&&t.push(c);o=Ei(o)}return t}function Cw(r,e,t){var n;S&&(e==="srcset"&&xw(r,t)||yd((n=r.getAttribute(e))!=null?n:"",t)||Pp(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function yd(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function ng(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function xw(r,e){var t=ng(r.srcset),n=ng(e);return n.length===t.length&&n.every(([o,a],c)=>a===t[c][1]&&(yd(t[c][0],o)||yd(o,t[c][0])))}function xd(r,e,t=e){var n=new WeakSet;Vl(r,"input",async o=>{S&&r.type==="checkbox"&&Sc();var a=o?r.defaultValue:r.value;if(a=wd(r)?Cd(a):a,t(a),O!==null&&n.add(O),await Jn(),a!==(a=e())){var c=r.selectionStart,u=r.selectionEnd,f=r.value.length;if(r.value=a!=null?a:"",u!==null){var p=r.value.length;c===u&&u===f&&p>f?(r.selectionStart=p,r.selectionEnd=p):(r.selectionStart=c,r.selectionEnd=Math.min(u,p))}}}),(L&&r.defaultValue!==r.value||V(e)==null&&r.value)&&(t(wd(r)?Cd(r.value):r.value),O!==null&&n.add(O)),gt(()=>{S&&r.type==="checkbox"&&Sc();var o=e();if(r===document.activeElement){var a=nt?dn:O;if(n.has(a))return}wd(r)&&o===Cd(r.value)||r.type==="date"&&!o&&!r.value||o!==r.value&&(r.value=o!=null?o:"")})}function wd(r){var e=r.type;return e==="number"||e==="range"}function Cd(r){return r===""?null:+r}function Ad(r,e,t){var n=$t(r,e);n&&n.set&&(r[e]=t,pt(()=>{r[e]=null}))}function kd(r,e){return r===e||(r==null?void 0:r[ct])===e}function Ct(r={},e,t,n){var o=K.r,a=Y;return br(()=>{var c,u;return gt(()=>{c=u,u=(n==null?void 0:n())||[],V(()=>{kd(t(...u),r)||(e(r,...u),c&&kd(t(...c),r)&&e(null,...c))})}),()=>{let f=a;for(;f!==o&&f.parent!==null&&f.parent.f&33554432;)f=f.parent;let p=()=>{u&&kd(t(...u),r)&&e(null,...u)},b=f.teardown;f.teardown=()=>{p(),b==null||b()}}}),r}function Bt(r=!1){let e=K,t=e.l.u;if(!t)return;let n=()=>st(e.s);if(r){let o=0,a={},c=bi(()=>{let u=!1,f=e.s;for(let p in f)f[p]!==a[p]&&(a[p]=f[p],u=!0);return u&&o++,o});n=()=>A(c)}t.b.length&&ta(()=>{og(e,n),Co(t.b)}),Po(()=>{let o=V(()=>t.m.map(Ip));return()=>{for(let a of o)typeof a=="function"&&a()}}),t.a.length&&Po(()=>{og(e,n),Co(t.a)})}function og(r,e){if(r.l.s)for(let t of r.l.s)A(t);e()}function Rd(r,e){var a;var t=(a=r.$$events)==null?void 0:a[e.type],n=kr(t)?t.slice():t==null?[]:[t];for(var o of n)o.call(this,e)}function vt(r,e,t){var n;r.$$events||(r.$$events={}),(n=r.$$events)[e]||(n[e]=[]),r.$$events[e].push(t)}function yt(r){for(var e in r)e in this&&(this[e]=r[e])}function re(r,e,t,n){var te,ae;var o=!tn||(t&2)!==0,a=(t&8)!==0,c=(t&16)!==0,u=n,f=!0,p=void 0,b=()=>c&&o?(p!=null||(p=bi(n)),A(p)):(f&&(f=!1,u=c?V(n):n),u);let I;if(a){var g=ct in r||Bs in r;I=(ae=(te=$t(r,e))==null?void 0:te.set)!=null?ae:g&&e in r?M=>r[e]=M:void 0}var v,y=!1;a?[v,y]=Dc(()=>r[e]):v=r[e],v===void 0&&n!==void 0&&(v=b(),I&&(o&&Bp(e),I(v)));var w;if(o?w=()=>{var M=r[e];return M===void 0?b():(f=!0,M)}:w=()=>{var M=r[e];return M!==void 0&&(u=void 0),M===void 0?u:M},o&&(t&4)===0)return w;if(I){var x=r.$$legacy;return(function(M,pe){return arguments.length>0?((!o||!pe||x||y)&&I(pe?w():M),M):w()})}var k=!1,E=((t&1)!==0?bi:Un)(()=>(k=!1,w()));S&&(E.label=e),a&&A(E);var Z=Y;return(function(M,pe){if(arguments.length>0){let ye=pe?A(E):o&&a?Wn(M):M;return z(E,ye),k=!0,u!==void 0&&(u=ye),M}return pr&&k||(Z.f&16384)!==0?E.v:A(E)})}var Gw;typeof HTMLElement=="function"&&(Gw=class extends HTMLElement{constructor(e,t,n){super();h(this,"$$ctor");h(this,"$$s");h(this,"$$c");h(this,"$$cn",!1);h(this,"$$d",{});h(this,"$$r",!1);h(this,"$$p_d",{});h(this,"$$l",{});h(this,"$$l_u",new Map);h(this,"$$me");h(this,"$$shadowRoot",null);this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return a=>{let c=Zn("slot");o!=="default"&&(c.name=o),de(a,c)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=Ew(this);for(let o of this.$$s)o in n&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),t.default=!0):t[o]=e(o));for(let o of this.attributes){let a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Sd(a,o.value,this.$$p_d,"toProp"))}for(let o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=at({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=od(()=>{gt(()=>{var o;this.$$r=!0;for(let a of xc(this.$$c)){if(!((o=this.$$p_d[a])!=null&&o.reflect))continue;this.$$d[a]=this.$$c[a];let c=Sd(a,this.$$d[a],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,c)}this.$$r=!1})});for(let o in this.$$l)for(let a of this.$$l[o]){let c=this.$$c.$on(o,a);this.$$l_u.set(a,c)}this.$$l={}}}attributeChangedCallback(e,t,n){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Sd(e,n,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return xc(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Sd(r,e,t,n){var a;let o=(a=t[r])==null?void 0:a.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[r])return e;if(n==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Ew(r){let e={};return r.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}var sg=require("obsidian");var Bw=ve('<span><span class="reminder-markdown"></span></span>');function Ko(r,e){if(new.target)return at({component:Ko,...r});Ke(e,!1);let t=re(e,"sourcePath",12),n=re(e,"markdown",12),o=Ce();jh(()=>{A(o).empty(),sg.MarkdownRenderer.renderMarkdown(n(),A(o),t(),window.app.plugins.plugins["obsidian-reminder-plugin"]),A(o).childNodes.forEach(f=>{f instanceof HTMLElement&&(f.style.display="inline")})});var a={get sourcePath(){return t()},set sourcePath(f){t(f),J()},get markdown(){return n()},set markdown(f){n(f),J()},$set:yt,$on:(f,p)=>vt(e,f,p)};Bt();var c=Bw(),u=H(c);return Ct(u,f=>z(o,f),()=>A(o)),X(c),de(r,c),qe(a)}var Dw=ve('<div class="reminder-list-item no-reminders svelte-18c89ir">No reminders</div>'),Nw=ve('<button class="reminder-list-item hover-highlight svelte-18c89ir" draggable="true"><span class="reminder-time svelte-18c89ir"> </span> <div class="reminder-title-container svelte-18c89ir"><span class="reminder-title svelte-18c89ir"><!></span> <span class="reminder-file svelte-18c89ir"> </span></div></button>'),Ww=ve("<div></div>"),Zw=ve('<div class="reminder-group svelte-18c89ir"><!></div>');function qo(r,e){if(new.target)return at({component:qo,...r});Ke(e,!1);let t=re(e,"reminders",12),n=re(e,"onOpenReminder",12,()=>{}),o=re(e,"timeToString",12,g=>g.format("HH:mm")),a=re(e,"generateLink",12,()=>"");function c(g){return`[${g.time.toString()}] ${g.title} - ${g.getFileName()}`}var u={get reminders(){return t()},set reminders(g){t(g),J()},get onOpenReminder(){return n()},set onOpenReminder(g){n(g),J()},get timeToString(){return o()},set timeToString(g){o(g),J()},get generateLink(){return a()},set generateLink(g){a(g),J()},$set:yt,$on:(g,v)=>vt(e,g,v)};Bt();var f=Zw(),p=H(f);{var b=g=>{var v=Dw();de(g,v)},I=g=>{var v=Ww();zt(v,5,t,y=>y.key(),(y,w)=>{var x=Nw(),k=H(x),E=H(k,!0);X(k);var Z=Ie(k,2),te=H(Z),ae=H(te);Ko(ae,{get markdown(){return A(w),V(()=>A(w).title)},get sourcePath(){return A(w),V(()=>A(w).file)}}),X(te);var M=Ie(te,2),pe=H(M,!0);X(M),X(Z),X(x),$e((ye,Te,He,he)=>{Pr(x,"aria-label",ye),Pr(x,"title",Te),Pe(E,He),Pe(pe,he)},[()=>(A(w),V(()=>c(A(w)))),()=>(A(w),V(()=>c(A(w)))),()=>(st(o()),A(w),V(()=>o()(A(w).time))),()=>(A(w),V(()=>A(w).getFileName()))]),ce("dragstart",x,ye=>{var Te;(Te=ye.dataTransfer)==null||Te.setData("text/plain",a()(A(w)))}),ce("click",x,()=>{n()(A(w))}),de(y,x)}),X(v),de(g,v)};pn(p,g=>{st(t()),V(()=>t().length===0)?g(b):g(I,-1)})}return X(f),de(r,f),qe(u)}var Yw=ve('<span class="group-count svelte-6tg2e0"> </span>'),Mw=ve("<div> <!></div> <!>",1),Xw=ve("<main><div></div></main>");function tu(r,e){if(new.target)return at({component:tu,...r});Ke(e,!1);let t=re(e,"groups",12),n=re(e,"onOpenReminder",12),o=re(e,"generateLink",12);var a={get groups(){return t()},set groups(f){t(f),J()},get onOpenReminder(){return n()},set onOpenReminder(f){n(f),J()},get generateLink(){return o()},set generateLink(f){o(f),J()},$set:yt,$on:(f,p)=>vt(e,f,p)},c=Xw(),u=H(c);return zt(u,5,t,f=>f.name,(f,p)=>{var b=Mw(),I=To(b);let g;var v=H(I),y=Ie(v);{var w=k=>{var E=Yw(),Z=H(E,!0);X(E),$e(()=>Pe(Z,(A(p),V(()=>A(p).reminders.length)))),de(k,E)};pn(y,k=>{A(p),V(()=>A(p).reminders.length>0)&&k(w)})}X(I);var x=Ie(I,2);qo(x,{get reminders(){return A(p),V(()=>A(p).reminders)},get onOpenReminder(){return n()},timeToString:k=>A(p).timeToString(k),get generateLink(){return o()}}),$e(()=>{var k;g=gn(I,1,"group-name svelte-6tg2e0",null,g,{"group-name-overdue":A(p).isOverdue}),Pe(v,`${(k=(A(p),V(()=>A(p).name)))!=null?k:""} `)}),de(f,b)}),X(u),X(c),de(r,c),qe(a)}var ru=class extends iu.ItemView{constructor(t,n,o){super(n);h(this,"plugin",t);h(this,"onOpenReminder",o);h(this,"view")}getViewType(){return qr}getDisplayText(){return"Reminders"}getIcon(){return"clock"}async onOpen(){this.view=new tu({target:this.contentEl,props:{groups:this.remindersForView(),onOpenReminder:this.onOpenReminder,generateLink:t=>{let n=this.app.vault.getAbstractFileByPath(t.file),o=this.app.workspace.getActiveFile(),a;return!(n instanceof iu.TFile)||o==null?a=`[[${t.getFileName()}]]`:a=this.app.fileManager.generateMarkdownLink(n,o.path),`${t.title} - ${a}`}}})}reload(){this.view!=null&&this.view.$set({groups:this.remindersForView(),onOpenReminder:this.onOpenReminder})}remindersForView(){return lm(this.plugin.reminders.reminders,this.plugin.settings.reminderTime.value,{yearMonthFormat:this.plugin.settings.yearMonthDisplayFormat.value,monthDayFormat:this.plugin.settings.monthDayDisplayFormat.value,shortDateWithWeekdayFormat:this.plugin.settings.shortDateWithWeekdayDisplayFormat.value,timeFormat:this.plugin.settings.timeDisplayFormat.value})}onClose(){return this.view&&this.view.$destroy(),Promise.resolve()}},nu=class{constructor(e,t){h(this,"plugin",e);h(this,"onOpenReminder",t);h(this,"valid",!1);[this.plugin.settings.yearMonthDisplayFormat,this.plugin.settings.monthDayDisplayFormat,this.plugin.settings.shortDateWithWeekdayDisplayFormat,this.plugin.settings.timeDisplayFormat].forEach(o=>{o.rawValue.onChanged(()=>{this.invalidate(),this.reload(!0)})})}createView(e){return new ru(this.plugin,e,this.onOpenReminder)}openView(){var e;this.plugin.app.workspace.getLeavesOfType(qr).length||(e=this.plugin.app.workspace.getRightLeaf(!1))==null||e.setViewState({type:qr})}reload(e=!1){if(e||!this.valid){let t=this.getViews();t.length>0?(t.forEach(n=>n==null?void 0:n.reload()),this.valid=!0):(this.valid=!1,console.debug("view is null. Skipping reminder list view reload"))}}getViews(){return this.plugin.app.workspace.getLeavesOfType(qr).map(e=>e&&e.view instanceof ru?e.view:null).filter(e=>e!=null)}invalidate(){this.valid=!1}};var cg=require("obsidian");var ug=Nr(wr(),1);var ag=Nr(wr()),Ed=require("obsidian");var ts=Nr(wr());var Fd=Nr(wr(),1);var Td=class{constructor(e){h(this,"date",e)}isToday(e){return this.date===void 0?!1:this.date.date()===e.date()&&this.date.month()===e.month()&&this.date.year()===e.year()}isHoliday(){return[0,6].includes(this.date.day())}},Gd=class{constructor(e){h(this,"weekStart",e);h(this,"days",[]);let t=e.clone();for(let n=0;n<7;n++)this.days.push(new Td(t.clone())),t.add(1,"day")}get key(){return this.weekStart.valueOf()}},ou=class{constructor(e,t){h(this,"monthStart",e);h(this,"weeks",[]);h(this,"weekStart");this.weekStart=t||0;let n=e.clone().add(-(e.day()-this.weekStart+7)%7,"day");for(let o=0;o<6&&!(o>0&&!this.isThisMonth(n));o++)this.weeks.push(new Gd(n.clone())),n.add(1,"week")}isThisMonth(e){return this.monthStart.month()===e.month()&&this.monthStart.year()===e.year()}},ua=class r{constructor(e,t,n){h(this,"_current");h(this,"today");h(this,"weekStart");this.weekStart=n||0,e?this.today=e:this.today=(0,Fd.default)(),t?this._current=new ou(t.clone().set("date",1),this.weekStart):this._current=new ou(this.today.clone().set("date",1),this.weekStart)}nextMonth(){return new r(this.today,this._current.monthStart.clone().add(1,"month"),this.weekStart)}previousMonth(){return new r(this.today,this._current.monthStart.clone().add(-1,"month"),this.weekStart)}calendarString(){let e=Array.from({length:7},(n,o)=>(0,Fd.default)().day((this.weekStart+o)%7).format("ddd")).join(" "),t=`${this._current.monthStart.format("YYYY, MMM")}
${e}
`;return this._current.weeks.forEach(n=>{let o=" ";n.days.forEach(a=>{let c;a.date&&this._current.isThisMonth(a.date)?c=a.date.format("DD"):c=" ",o=o+c+" "}),t=t+o+`
`}),t}get current(){return this._current}};var es=class{constructor(){h(this,"digits",[]);h(this,"lastInput",0)}handle(e){let t=new Date().getTime();return t-this.lastInput>1e3&&this.clear(),this.lastInput=t,this.digits.push(e),this.digits.join("")}clear(){this.digits=[]}};var Uw=ve('<th class="svelte-1lru178"> </th>'),Qw=ve('<td><button tabindex="-1"> </button></td>'),Vw=ve("<tr></tr>"),Lw=ve('<div class="reminder-calendar svelte-1lru178" tabindex="0" role="grid"><div class="year-month svelte-1lru178"><button tabindex="-1" class="month-nav svelte-1lru178">&lt;</button> <span class="month svelte-1lru178"> </span> <span class="year svelte-1lru178"> </span> <button tabindex="-1" class="month-nav svelte-1lru178">&gt;</button></div> <table><thead><tr></tr></thead><tbody></tbody></table> <div class="footer"><!></div></div>');function su(r,e){if(new.target)return at({component:su,...r});Ke(e,!1);let t=Ce(),n=Ce(),o=re(e,"value",28,ts.default),a=re(e,"weekStart",12,0),c=jo(),u=Ce(),f=Ce(),p=Ce();function b(){A(p).focus()}function I(Q){o(Q)}function g(Q){o(Q),w()}function v(){o(o().add(-1,"month"))}function y(){o(o().add(1,"month"))}function w(){c("select",o())}let x=new es;function k(Q){if(Q.key>="0"&&Q.key<="9"){Q.preventDefault();let ie=x.handle(Q.key);switch(ie.length){case 1:{let D=parseInt(ie);D>0&&o(o().set("date",D));break}case 2:ie.startsWith("0")&&(ie=ie.slice(1)),o(o().set("date",parseInt(ie)));break;case 4:{let D=ie.slice(0,2),se=ie.slice(2,4);D.startsWith("0")&&(D=D.slice(1)),se.startsWith("0")&&(se=se.slice(1)),o(o().set("month",parseInt(D)-1)),o(o().set("date",parseInt(se)))}break}return}x.clear(),Q.key==="ArrowLeft"||Q.ctrlKey&&Q.key==="B"?(o(o().add(-1,"day")),Q.preventDefault()):Q.key==="ArrowRight"||Q.ctrlKey&&Q.key==="F"?(o(o().add(1,"day")),Q.preventDefault()):Q.key==="ArrowUp"||Q.ctrlKey&&Q.key==="P"?o(o().add(-7,"day")):Q.key==="ArrowDown"||Q.ctrlKey&&Q.key==="N"?(o(o().add(7,"day")),Q.preventDefault()):Q.key==="Enter"&&(w(),Q.preventDefault())}Jo(()=>{td(f,A(f).style.width=A(u).clientWidth+"px")}),yi(()=>(ua,ts.default,st(o()),st(a())),()=>{z(t,new ua((0,ts.default)().startOf("day"),o().startOf("day"),a()))}),yi(()=>(ts.default,A(t)),()=>{z(n,Array.from({length:7},(Q,ie)=>(0,ts.default)().day((A(t).weekStart+ie)%7).format("ddd")))}),ra();var E={focus:b,get value(){return o()},set value(Q){o(Q),J()},get weekStart(){return a()},set weekStart(Q){a(Q),J()},$set:yt,$on:(Q,ie)=>vt(e,Q,ie)};Bt();var Z=Lw(),te=H(Z),ae=H(te),M=Ie(ae,2),pe=H(M,!0);X(M);var ye=Ie(M,2),Te=H(ye,!0);X(ye);var He=Ie(ye,2);X(te);var he=Ie(te,2),Lt=H(he),Ne=H(Lt);zt(Ne,5,()=>A(n),Q=>Q,(Q,ie)=>{var D=Uw(),se=H(D,!0);X(D),$e(()=>Pe(se,A(ie))),de(Q,D)}),X(Ne),X(Lt);var tt=Ie(Lt);zt(tt,5,()=>(A(t),V(()=>A(t).current.weeks)),Q=>Q.key,(Q,ie)=>{var D=Vw();zt(D,5,()=>(A(ie),V(()=>A(ie).days)),se=>se.date.valueOf(),(se,Be)=>{var T=Qw(),G=H(T);let _t;var Je=H(G,!0);X(G),X(T),$e((lt,Ve)=>{_t=gn(G,1,"calendar-date svelte-1lru178",null,_t,lt),Pe(Je,Ve)},[()=>({"is-selected":A(Be).isToday(o()),"other-month":!A(t).current.isThisMonth(A(Be).date),"is-holiday":A(Be).isHoliday(),"is-past":A(Be).date.isBefore(A(t).today)}),()=>(A(Be),V(()=>A(Be).date.format("D")))]),ce("click",G,()=>I(A(Be).date)),ce("dblclick",G,()=>g(A(Be).date)),de(se,T)}),X(D),de(Q,D)}),X(tt),X(he),Ct(he,Q=>z(u,Q),()=>A(u));var xt=Ie(he,2),Kt=H(xt);return bd(Kt,e,"footer",{},null),X(xt),Ct(xt,Q=>z(f,Q),()=>A(f)),X(Z),Ct(Z,Q=>z(p,Q),()=>A(p)),$e((Q,ie)=>{Pe(pe,Q),Pe(Te,ie)},[()=>(A(t),V(()=>A(t).current.monthStart.format("MMM"))),()=>(A(t),V(()=>A(t).current.monthStart.format("YYYY")))]),ce("click",ae,()=>v()),ce("click",He,()=>y()),ce("focus",Z,()=>{c("focus")}),ce("blur",Z,()=>{c("blur")}),ce("keydown",Z,k),de(r,Z),Ad(e,"focus",b),qe(E)}var Ow=ve("<option> </option>"),$w=ve('<select class="time-picker svelte-16e079f"></select>');function au(r,e){if(new.target)return at({component:au,...r});Ke(e,!1);let t=re(e,"value",12,"00:00"),n=re(e,"step",12,15),o=jo();function a(){o("select",t())}function c(){o("focus")}function u(){o("blur")}function f(){let y=[];for(let w=0;w<1440;w+=n()){let x=Math.floor(w/60),k=w%60;y.push(`${x.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`)}return y}let p=f(),b=new es;function I(y){if(y.key>="0"&&y.key<="9"){y.preventDefault();let w=b.handle(y.key);switch(w.length){case 1:{let x=w.padStart(2,"0"),k=p.filter(E=>E.startsWith(x));k.length>1&&t(k[0])}break;case 2:{let x=w+":",k=p.filter(E=>E.startsWith(x));k.length>1&&t(k[0]);break}case 4:{let x=w.slice(0,2)+":"+w.slice(2,4);p.includes(x)&&t(x)}break}return}if(b.clear(),y.key==="Enter"){a(),y.preventDefault();return}}var g={get value(){return t()},set value(y){t(y),J()},get step(){return n()},set step(y){n(y),J()},$set:yt,$on:(y,w)=>vt(e,y,w)};Bt();var v=$w();return zt(v,5,()=>p,y=>y,(y,w)=>{var x=Ow(),k=H(x,!0);X(x);var E={};$e(()=>{var Z;Pe(k,A(w)),E!==(E=A(w))&&(x.value=(Z=x.__value=A(w))!=null?Z:"")}),de(y,x)}),X(v),la(v,t),ce("dblclick",v,a),ce("focus",v,c),ce("blur",v,u),ce("keydown",v,I),de(r,v),qe(g)}var Pw=ve('<div slot="footer"><hr class="dtchooser-divider svelte-1twe6ts"/> <!></div>'),Hw=ve('<div class="dtchooser-calendar-area svelte-1twe6ts"><button type="button" class="dtchooser-mode-toggle dtchooser-mode-toggle-overlay svelte-1twe6ts" aria-label="Show quick date picks" title="Show quick date picks"><span class="dtchooser-mode-toggle-icon svelte-1twe6ts"></span></button> <!></div> <div class="dtchooser-wrapper svelte-1twe6ts"><div class="dtchooser-time-picker svelte-1twe6ts"><span class="svelte-1twe6ts">Time:</span> <!></div> <button class="mod-cta">OK</button></div>',1),Jw=ve('<button type="button"> </button>'),jw=ve('<div class="dtchooser-header svelte-1twe6ts"><input type="text" class="dtchooser-quick-pick-filter svelte-1twe6ts" placeholder="Filter..."/> <button type="button" class="dtchooser-mode-toggle svelte-1twe6ts" aria-label="Show calendar" title="Show calendar"><span class="dtchooser-mode-toggle-icon svelte-1twe6ts"></span></button></div> <div class="dtchooser-calendar-area svelte-1twe6ts"><div class="dtchooser-quick-picks svelte-1twe6ts"></div></div>',1),zw=ve('<div class="dtchooser svelte-1twe6ts"><!></div>');function rs(r,e){var tt,xt,Kt,Q,ie;if(new.target)return at({component:rs,...r});Ke(e,!1);let t=Ce(),n=re(e,"reminders",12),o=re(e,"onSelect",12),a=re(e,"timeStep",12,15),c=re(e,"weekStart",12,0),u=re(e,"initialTime",12,void 0),f=re(e,"date",28,()=>{var D,se;return(se=(D=u())==null?void 0:D.moment().clone())!=null?se:(0,ag.default)()}),p=Ce((tt=u())!=null&&tt.hasTimePart?u().format("HH:mm"):(Kt=(xt=n().reminderTime)==null?void 0:xt.value.toString())!=null?Kt:"10:00"),b=Ce((ie=(Q=u())==null?void 0:Q.hasTimePart)!=null?ie:!1),I=Ce("calendar"),g=Ce(""),v=Ce(0),y=Ce(),w=Ce(),x=Ce();function k(){let[D,se]=A(p).split(":"),Be=f().clone();A(b)?(Be.set({hour:parseInt(D),minute:parseInt(se)}),o()(new P(Be,!0))):o()(new P(Be,!1))}function E(D){o()(D.later())}async function Z(){var D;z(I,"quickpick"),z(g,""),z(v,0),await Jn(),(D=A(y))==null||D.focus()}async function te(){var D;z(I,"calendar"),z(g,""),await Jn(),(D=A(x))==null||D.focus()}function ae(){A(I)==="calendar"?Z():te()}let M=["INPUT","SELECT","TEXTAREA"];function pe(D){if(A(I)!=="calendar"||D.key!=="+")return;let se=D.target;se&&M.includes(se.tagName)||(Z(),D.preventDefault())}function ye(D){switch(D.key){case"ArrowDown":D.preventDefault(),A(t).length>0&&z(v,(A(v)+1)%A(t).length);break;case"ArrowUp":D.preventDefault(),A(t).length>0&&z(v,(A(v)-1+A(t).length)%A(t).length);break;case"Enter":{D.preventDefault();let se=A(t)[A(v)];se&&E(se);break}case"Escape":D.preventDefault(),D.stopPropagation(),te();break}}yi(()=>(A(w),Ed.setIcon,A(I)),()=>{A(w)&&(0,Ed.setIcon)(A(w),A(I)==="calendar"?"clock":"calendar")}),yi(()=>(ec,A(g)),()=>{z(t,ec.filter(D=>D.label.toLowerCase().includes(A(g).toLowerCase())))}),yi(()=>A(g),()=>{A(g)!==void 0&&z(v,0)}),ra();var Te={get reminders(){return n()},set reminders(D){n(D),J()},get onSelect(){return o()},set onSelect(D){o(D),J()},get timeStep(){return a()},set timeStep(D){a(D),J()},get weekStart(){return c()},set weekStart(D){c(D),J()},get initialTime(){return u()},set initialTime(D){u(D),J()},get date(){return f()},set date(D){f(D),J()},$set:yt,$on:(D,se)=>vt(e,D,se)};Bt();var He=zw(),he=H(He);{var Lt=D=>{var se=Hw(),Be=To(se),T=H(Be),G=H(T);Ct(G,qt=>z(w,qt),()=>A(w)),X(T);var _t=Ie(T,2);Ct(su(_t,{get weekStart(){return c()},get value(){return f()},set value(qt){f(qt)},$$events:{select:()=>k()},$$slots:{footer:(qt,vn)=>{var ei=Pw(),us=Ie(H(ei),2);{let xu=Un(()=>(st(n()),st(P),st(f()),V(()=>n().byDate(new P(f(),!1)))));qo(us,{get reminders(){return A(xu)}})}X(ei),de(qt,ei)}},$$legacy:!0}),qt=>z(x,qt),()=>A(x)),X(Be);var Je=Ie(Be,2),lt=H(Je),Ve=Ie(H(lt),2);au(Ve,{get step(){return a()},get value(){return A(p)},set value(qt){z(p,qt)},$$events:{select:()=>{k()},focus:()=>{z(b,!0)}},$$legacy:!0}),X(lt);var wi=Ie(lt,2);X(Je),ce("click",T,ae),ce("click",wi,k),de(D,se)},Ne=D=>{var se=jw(),Be=To(se),T=H(Be);_d(T),Ct(T,Ve=>z(y,Ve),()=>A(y));var G=Ie(T,2),_t=H(G);Ct(_t,Ve=>z(w,Ve),()=>A(w)),X(G),X(Be);var Je=Ie(Be,2),lt=H(Je);zt(lt,7,()=>A(t),Ve=>Ve.label,(Ve,wi,qt)=>{var vn=Jw();let ei;var us=H(vn,!0);X(vn),$e(()=>{ei=gn(vn,1,"dtchooser-quick-pick svelte-1twe6ts",null,ei,{"is-selected":A(qt)===A(v)}),Pe(us,(A(wi),V(()=>A(wi).label)))}),ce("click",vn,()=>E(A(wi))),ce("mouseenter",vn,()=>z(v,A(qt))),de(Ve,vn)}),X(lt),X(Je),xd(T,()=>A(g),Ve=>z(g,Ve)),ce("keydown",T,ye),ce("click",G,ae),de(D,se)};pn(he,D=>{A(I)==="calendar"?D(Lt):D(Ne,-1)})}return X(He),ce("keydown",He,pe),de(r,He),qe(Te)}var $i=8;function lg(r,e,t){return Math.min(Math.max(r,e),t)}var ns=class{constructor(e,t,n,o){h(this,"editorView",e);h(this,"reminders",t);h(this,"timeStep",n);h(this,"weekStart",o);h(this,"view");h(this,"dateTimeChooser");h(this,"resultResolve");h(this,"resultReject");h(this,"anchorPos",0);h(this,"onDocumentMouseDown",e=>{this.view.contains(e.target)||this.cancel()});h(this,"onKeyDown",e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.cancel())});h(this,"onReposition",()=>{this.position(this.anchorPos)});this.view=document.createElement("div"),this.view.addClass("date-time-chooser-popup"),this.view.style.position="fixed"}show(e){var t;return this.anchorPos=e,this.view.style.visibility="hidden",document.body.appendChild(this.view),this.dateTimeChooser=new rs({target:this.view,props:{onSelect:n=>{this.setResult(n),this.hide()},reminders:this.reminders,timeStep:this.timeStep,weekStart:this.weekStart,date:(0,ug.default)()}}),this.position(e),this.view.style.visibility="visible",document.addEventListener("mousedown",this.onDocumentMouseDown,!0),this.view.addEventListener("keydown",this.onKeyDown),this.editorView.scrollDOM.addEventListener("scroll",this.onReposition,{passive:!0}),window.addEventListener("resize",this.onReposition,{passive:!0}),(t=this.view.querySelector(".reminder-calendar"))==null||t.focus(),new Promise((n,o)=>{this.resultResolve=n,this.resultReject=o})}position(e){var I,g,v;let t=this.editorView.coordsAtPos(e),n=this.editorView.dom.getBoundingClientRect(),o=(I=t==null?void 0:t.top)!=null?I:n.top,a=(g=t==null?void 0:t.bottom)!=null?g:n.top,c=(v=t==null?void 0:t.left)!=null?v:n.left,{width:u,height:f}=this.view.getBoundingClientRect(),p=a;p+f>window.innerHeight-$i&&(p=o-f),p=lg(p,$i,Math.max(window.innerHeight-f-$i,$i));let b=lg(c,$i,Math.max(window.innerWidth-u-$i,$i));this.view.style.top=`${p}px`,this.view.style.left=`${b}px`}cancel(){this.setResult(null),this.hide()}setResult(e){this.resultReject==null||this.resultResolve==null||(e===null?this.resultReject():this.resultResolve(e),this.resultReject=void 0,this.resultResolve=void 0)}hide(){var e;document.removeEventListener("mousedown",this.onDocumentMouseDown,!0),this.view.removeEventListener("keydown",this.onKeyDown),this.editorView.scrollDOM.removeEventListener("scroll",this.onReposition),window.removeEventListener("resize",this.onReposition),(e=this.dateTimeChooser)==null||e.$destroy(),this.dateTimeChooser=void 0,this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.editorView.focus()}};var lu=require("obsidian");var Bd=class extends lu.Modal{constructor(t,n,o,a,c,u,f){super(t);h(this,"reminders",n);h(this,"onSelect",o);h(this,"onCancel",a);h(this,"timeStep",c);h(this,"weekStart",u);h(this,"initialTime",f);h(this,"selected")}onOpen(){let t;lu.Platform.isDesktop?(this.modalEl.style.minWidth="0px",this.modalEl.style.minHeight="0px",this.modalEl.style.width="auto",t=this.contentEl):t=this.containerEl,new rs({target:t,props:{onSelect:n=>{this.select(n)},reminders:this.reminders,timeStep:this.timeStep,weekStart:this.weekStart,initialTime:this.initialTime}})}select(t){this.selected=t,this.close()}onClose(){this.selected!=null?this.onSelect(this.selected):this.onCancel()}};function Pi(r,e,t=15,n=0,o){return new Promise((a,c)=>{new Bd(r,e,a,c,t,n,o).open()})}var uu=class{constructor(e,t,n,o,a){h(this,"trigger",e);h(this,"timeStep",t);h(this,"primaryFormat",n);h(this,"convertNonTaskLines",o);h(this,"weekStart",a)}isTrigger(e,t){let n=this.trigger.value;if(n.length===0)return!1;if(t.text.contains(n.charAt(n.length-1))){let o=e.getLine(t.from.line).substring(0,t.to.ch)+t.text;if(!o.match(/^\s*- \[.\]\s.*/))return!1;if(o.endsWith(n))return!0}return!1}show(e,t,n){let o;if(cg.Platform.isDesktopApp){let a=t.cm;if(a==null)console.error("Cannot get CodeMirror 6 editor view."),o=Pi(e,n,this.timeStep.value,Number(this.weekStart.value));else{let c=a.state.selection.main.head;o=new ns(a,n,this.timeStep.value,Number(this.weekStart.value)).show(c)}}else o=Pi(e,n,this.timeStep.value,Number(this.weekStart.value));o.then(a=>{this.insert(t,a,!0)}).catch(()=>{})}insert(e,t,n=!1){var f;let o=e.getCursor(),a=e.getLine(o.line),c={line:o.line,ch:a.length};n||(a=a.substring(0,o.ch-this.trigger.value.length));let u=this.primaryFormat.value.format;try{let p=(f=Ya(u,a,t,void 0,this.convertNonTaskLines.value))==null?void 0:f.insertedLine;if(p==null){Za(),console.error("Cannot append reminder time to the line: line=%s, date=%s",a,t);return}e.replaceRange(p,{line:o.line,ch:0},c)}catch(p){console.error(p)}}};var dg=require("@codemirror/state"),fg=require("@codemirror/view"),mg=require("obsidian");function pg(r,e,t){return fg.ViewPlugin.fromClass(class{constructor(){h(this,"activePopup");h(this,"destroyed",!1)}update(n){n.docChanged&&n.changes.iterChanges((o,a,c,u,f)=>{let p=n.state.doc,b=p.sliceString(u-2,u);if(f.length===0)return;let I=t.autoCompleteTrigger.value,g=t.reminderTimeStep.value,v=Number(t.weekStart.value);if(I===b){let y;mg.Platform.isDesktopApp?y=new Promise((w,x)=>{setTimeout(()=>{var E;if(this.destroyed){x();return}(E=this.activePopup)==null||E.cancel();let k=new ns(n.view,e,g,v);this.activePopup=k,k.show(u).finally(()=>{this.activePopup===k&&(this.activePopup=void 0)}).then(w,x)},0)}):y=Pi(r,e,g,v),y.then(w=>{let x=t.primaryFormat.value.format;try{let k=p.lineAt(u),E=k.text.lastIndexOf(I),Z=E+I.length;I.startsWith("(")&&k.text.charAt(Z)===")"&&Z++;let te=k.text.substring(0,E)+k.text.substring(Z),ae=Ya(x,te,w,E,t.convertNonTaskLines.value);if(ae==null){Za(),console.error("Cannot append reminder time to the line: line=%s, date=%s",k.text,w);return}let M=n.view.state.update({changes:{from:k.from,to:k.to,insert:ae.insertedLine},selection:dg.EditorSelection.cursor(k.from+ae.caretPosition)});n.view.update([M])}catch(k){console.error(k)}}).catch(()=>{})}})}destroy(){var n;this.destroyed=!0,(n=this.activePopup)==null||n.cancel()}})}var is=require("@codemirror/state"),os=require("@codemirror/view"),fu=require("obsidian");function hg(r,e,t){return Math.min(Math.max(r,e),t)}function gg(r,e){let t=[];for(let{reminder:a,columnStart:c,columnEnd:u}of e){let f=a.rowNumber+1;if(f<1||f>r.lines)continue;let p=r.line(f),b=hg(p.from+c,p.from,p.to),I=hg(p.from+u,b,p.to);b>=I||t.push({from:b,to:I,reminder:a,text:r.sliceString(b,I)})}t.sort((a,c)=>a.from-c.from);let n=[],o=-1;for(let a of t)a.from<o||(n.push(a),o=a.to);return n}var bg=require("@codemirror/state"),ca=bg.StateEffect.define();var yg=require("@codemirror/view"),_g=require("obsidian");var Kw=ve('<span class="reminder-pill svelte-1r4kx8j" role="button" tabindex="0"> </span>');function cu(r,e){if(new.target)return at({component:cu,...r});Ke(e,!1);let t=re(e,"label",12),n=re(e,"title",12),o=jo();function a(b){b.preventDefault(),b.stopPropagation(),o("activate")}function c(b){(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),o("activate"))}var u={get label(){return t()},set label(b){t(b),J()},get title(){return n()},set title(b){n(b),J()},$set:yt,$on:(b,I)=>vt(e,b,I)};Bt();var f=Kw(),p=H(f,!0);return X(f),$e(()=>{Pr(f,"title",n()),Pe(p,t())}),ce("click",f,a),ce("keydown",f,c),ce("mousedown",f,zl(jl(function(b){Rd.call(this,e,b)}))),de(r,f),qe(u)}var du=class extends yg.WidgetType{constructor(t,n){super();h(this,"span",t);h(this,"plugin",n);h(this,"component")}eq(t){return this.span.text===t.span.text&&this.span.reminder.title===t.span.reminder.title}toDOM(t){let n=document.createElement("span");return this.component=new cu({target:n,props:{label:`\u23F0 ${this.span.reminder.time.toString()}`,title:`Reminder: ${this.span.reminder.title}`}}),this.component.$on("activate",()=>{this.activate(t,n)}),n}destroy(){var t;(t=this.component)==null||t.$destroy(),this.component=void 0}ignoreEvent(){return!1}async activate(t,n){try{await qw(t,this.plugin,n)}catch(o){}}};function vg(r,e){var p,b,I;if(!r.dom.contains(e))return null;let t=r.posAtDOM(e),n=r.state.doc.lineAt(t),o=(I=(b=(p=r.state.field(_g.editorInfoField,!1))==null?void 0:p.file)==null?void 0:b.path)!=null?I:"",a=new Sn(o,r.state.doc.toString()),c=yo(a).filter(g=>g.reminder.rowNumber===n.number-1),u=null,f=Number.POSITIVE_INFINITY;for(let g of c){let v=n.from+g.columnStart,y=n.from+g.columnEnd,w=t>=v&&t<=y?0:Math.min(Math.abs(t-v),Math.abs(t-y));w<f&&(f=w,u=g)}return u==null?null:{md:a,span:u}}async function qw(r,e,t){var b;let n=vg(r,t);if(n==null)return;let o=await Pi(e.app,e.reminders,e.settings.reminderTimeStep.value,Number(e.settings.weekStart.value),n.span.reminder.time),a=vg(r,t);if(a==null||!await dl(a.md,a.span.reminder,{time:o}))return;let u=a.span.reminder.rowNumber,f=(b=a.md.toMarkdown().split(`
`)[u])!=null?b:"",p=r.state.doc.line(u+1);r.dispatch({changes:{from:p.from,to:p.to,insert:f},effects:[ca.of()]})}var eC=300,Ig=is.Annotation.define();function Nd(r,e){var t,n,o,a;try{if(!r.settings.editorReminderDisplay.value)return[];if(!((t=e.field(fu.editorLivePreviewField,!1))!=null&&t))return[];let c=(a=(o=(n=e.field(fu.editorInfoField,!1))==null?void 0:n.file)==null?void 0:o.path)!=null?a:"",u=new Sn(c,e.doc.toString());return gg(e.doc,yo(u))}catch(c){return console.error("Failed to parse reminders for editor pills.",c),[]}}function Dd(r,e,t){let n=r.selection.main.head,o=new is.RangeSetBuilder;for(let a of e)n>=a.from&&n<=a.to||o.add(a.from,a.to,os.Decoration.replace({widget:new du(a,t)}));return o.finish()}function tC(r,e){let t=[];for(let n of r){let o=e.mapPos(n.from),a=e.mapPos(n.to,1);o<a&&t.push({...n,from:o,to:a})}return t}function rC(r){return is.StateField.define({create(e){let t=Nd(r,e);return{decos:Dd(e,t,r),cache:t}},update(e,t){let n=e.decos.map(t.changes),o=t.docChanged?tC(e.cache,t.changes):e.cache,a=t.annotation(Ig);a!==void 0&&(o=a);let c=t.docChanged&&o.some(b=>t.changes.touchesRange(b.from,b.to)),u=t.effects.some(b=>b.is(ca));if(c||t.reconfigured||u&&a===void 0)return o=Nd(r,t.state),n=Dd(t.state,o,r),{decos:n,cache:o};let p=!t.startState.selection.eq(t.state.selection);return(a!==void 0||p)&&(n=Dd(t.state,o,r)),{decos:n,cache:o}},provide:e=>os.EditorView.decorations.from(e,t=>t.decos)})}function nC(r){return os.ViewPlugin.fromClass(class{constructor(e){h(this,"view",e);h(this,"debounceTimer")}update(e){e.docChanged&&(this.debounceTimer!==void 0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void 0;let t=Nd(r,this.view.state);this.view.dispatch({annotations:Ig.of(t),effects:[ca.of()]})},eC))}destroy(){this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}})}function Wd(r){return[rC(r),nC(r)]}var mu=require("@codemirror/state"),Ii=require("@codemirror/view"),Zd=mu.StateEffect.define();function iC(r){return r.from>=r.to?Ii.Decoration.none:Ii.Decoration.set([Ii.Decoration.mark({attributes:{style:"background-color: var(--text-highlight-bg);"}}).range(r.from,r.to)])}var oC=mu.StateField.define({create(){return Ii.Decoration.none},update(r,e){let t=e.effects.find(n=>n.is(Zd));return t!==void 0?iC(t.value):e.docChanged||!e.startState.selection.eq(e.state.selection)?Ii.Decoration.none:r.map(e.changes)},provide:r=>Ii.EditorView.decorations.from(r)});function wg(){return oC}var Ag=require("obsidian");var Cg=require("obsidian");var sC=ve('<div class="icon-text svelte-1qeb5yo"><span class="icon svelte-1qeb5yo"></span> <span class="text svelte-1qeb5yo"> </span></div>');function ss(r,e){if(new.target)return at({component:ss,...r});Ke(e,!1);let t=re(e,"icon",12,""),n=re(e,"text",12,""),o=Ce();Jo(()=>{(0,Cg.setIcon)(A(o),t())});var a={get icon(){return t()},set icon(b){t(b),J()},get text(){return n()},set text(b){n(b),J()},$set:yt,$on:(b,I)=>vt(e,b,I)};Bt();var c=sC(),u=H(c);Ct(u,b=>z(o,b),()=>A(o));var f=Ie(u,2),p=H(f,!0);return X(f),X(c),$e(()=>Pe(p,n())),de(r,c),qe(a)}var aC=ve('<button class="reminder-toast-close svelte-1u4loek" aria-label="Close">\xD7</button>'),lC=ve("<option> </option>"),uC=ve('<div class="reminder-secondary-actions svelte-1u4loek"><button class="reminder-footer-action svelte-1u4loek" title="Pause all notifications for a chosen duration. Reminders are not muted: anything still overdue notifies you again after the pause ends.">Pause all notifications\u2026</button> <button class="reminder-footer-action svelte-1u4loek" title="Mute every currently overdue reminder. Muted reminders stay silent (even across restarts) until you snooze them or change their date.">Mute all reminders\u2026</button></div>'),cC=ve('<main tabindex="-1"><!> <h3 class="reminder-title svelte-1u4loek"><!></h3> <button class="reminder-file svelte-1u4loek" title="Alt+O / Ctrl+O" aria-keyshortcuts="Alt+O Control+O"><!></button> <div class="reminder-actions svelte-1u4loek"><button class="mod-cta svelte-1u4loek" title="Alt+D / Ctrl+D" aria-keyshortcuts="Alt+D Control+D"><!><span><span class="mnemonic svelte-1u4loek">D</span>one</span></button> <button title="Alt+M / Ctrl+M" aria-keyshortcuts="Alt+M Control+M" class="svelte-1u4loek"><!><span><span class="mnemonic svelte-1u4loek">M</span>ute</span></button> <select class="dropdown later-select svelte-1u4loek" title="Alt+S / Ctrl+S" aria-keyshortcuts="Alt+S Control+S"><option selected="" disabled="" hidden="">Snooze</option><!></select></div> <!></main>');function as(r,e){if(new.target)return at({component:as,...r});Ke(e,!1);let t=re(e,"reminder",12),n=re(e,"onRemindMeLater",12),o=re(e,"onDone",12),a=re(e,"onOpenFile",12),c=re(e,"onMute",12),u=re(e,"onPauseAllNotifications",12),f=re(e,"onMuteAll",12),p=re(e,"variant",12,"modal"),b=re(e,"onClose",12,void 0),I=re(e,"focusDone",12,!1),g=re(e,"shortcutsEnabled",12,!0),v=Ce(),y=re(e,"laters",28,()=>[]),w=Ce(),x=Ce(),k=Ce();function E(){let T=y()[A(v)];T!=null&&n()(T.later())}function Z(T){if(!g())return;let G=T.altKey&&!T.ctrlKey,_t=T.ctrlKey&&!T.altKey;if(!(!G&&!_t||T.metaKey||T.shiftKey))switch(T.code){case"KeyD":T.preventDefault(),T.stopPropagation(),o()();break;case"KeyM":T.preventDefault(),T.stopPropagation(),c()();break;case"KeyO":T.preventDefault(),T.stopPropagation(),a()();break;case"KeyS":T.preventDefault(),T.stopPropagation(),A(x).focus();break}}Jo(async()=>{p()!=="toast"&&(await Jn(),I()?A(w).focus():A(k).focus())});var te={get reminder(){return t()},set reminder(T){t(T),J()},get onRemindMeLater(){return n()},set onRemindMeLater(T){n(T),J()},get onDone(){return o()},set onDone(T){o(T),J()},get onOpenFile(){return a()},set onOpenFile(T){a(T),J()},get onMute(){return c()},set onMute(T){c(T),J()},get onPauseAllNotifications(){return u()},set onPauseAllNotifications(T){u(T),J()},get onMuteAll(){return f()},set onMuteAll(T){f(T),J()},get variant(){return p()},set variant(T){p(T),J()},get onClose(){return b()},set onClose(T){b(T),J()},get focusDone(){return I()},set focusDone(T){I(T),J()},get shortcutsEnabled(){return g()},set shortcutsEnabled(T){g(T),J()},get laters(){return y()},set laters(T){y(T),J()},$set:yt,$on:(T,G)=>vt(e,T,G)};Bt();var ae=cC();ce("keydown",Ms,Z,!0);let M;var pe=H(ae);{var ye=T=>{var G=aC();ce("click",G,function(..._t){var Je;(Je=b())==null||Je.apply(this,_t)}),de(T,G)};pn(pe,T=>{p()==="toast"&&T(ye)})}var Te=Ie(pe,2),He=H(Te);Ko(He,{get markdown(){return st(t()),V(()=>t().title)},get sourcePath(){return st(t()),V(()=>t().file)}}),X(Te);var he=Ie(Te,2),Lt=H(he);ss(Lt,{icon:"link",get text(){return st(t()),V(()=>t().file)}}),X(he);var Ne=Ie(he,2),tt=H(Ne),xt=H(tt);ss(xt,{icon:"check-small"}),So(),X(tt),Ct(tt,T=>z(w,T),()=>A(w));var Kt=Ie(tt,2),Q=H(Kt);ss(Q,{icon:"minus-with-circle"}),So(),X(Kt);var ie=Ie(Kt,2),D=Ie(H(ie));zt(D,1,y,gd,(T,G,_t)=>{var Je=lC(),lt=H(Je,!0);X(Je),Je.value=Je.__value=_t,$e(()=>{Id(Je,A(v)===_t),Pe(lt,(A(G),V(()=>A(G).label)))}),de(T,Je)}),X(ie),Ct(ie,T=>z(x,T),()=>A(x)),X(Ne);var se=Ie(Ne,2);{var Be=T=>{var G=uC(),_t=H(G),Je=Ie(_t,2);X(G),ce("click",_t,function(...lt){var Ve;(Ve=u())==null||Ve.apply(this,lt)}),ce("click",Je,function(...lt){var Ve;(Ve=f())==null||Ve.apply(this,lt)}),de(T,G)};pn(se,T=>{p()==="modal"&&T(Be)})}return X(ae),Ct(ae,T=>z(k,T),()=>A(k)),$e(()=>{M=gn(ae,1,"svelte-1u4loek",null,M,{toast:p()==="toast"}),Pr(Te,"aria-label",(st(t()),V(()=>t().title))),Pr(he,"aria-label",(st(t()),V(()=>t().file)))}),ce("click",he,function(...T){var G;(G=a())==null||G.apply(this,T)}),ce("click",tt,function(...T){var G;(G=o())==null||G.apply(this,T)}),ce("click",Kt,function(...T){var G;(G=c())==null||G.apply(this,T)}),la(ie,()=>A(v),T=>z(v,T)),ce("change",ie,E),de(r,ae),qe(te)}var pu=class{constructor(){h(this,"containerEl");h(this,"toasts",new Map)}show(e,t,n,o,a,c,u,f){let p=e.key();this.remove(p);let b=this.getContainer().createDiv("reminder-toast-card"),I=new as({target:b,props:{reminder:e,laters:t,variant:"toast",shortcutsEnabled:!0,onRemindMeLater:g=>{n(g),this.remove(p)},onDone:()=>{o(),this.remove(p)},onOpenFile:()=>{c(),a(),this.remove(p)},onMute:()=>{a(),this.remove(p)},onClose:()=>{a(),this.remove(p)},onPauseAllNotifications:()=>{u(),this.remove(p)},onMuteAll:()=>{f(),this.remove(p)}}});this.toasts.set(p,{el:b,component:I}),this.updateShortcutTarget()}destroy(){var e;this.toasts.forEach(({component:t})=>t.$destroy()),this.toasts.clear(),(e=this.containerEl)==null||e.remove(),this.containerEl=void 0}sync(e){for(let t of Array.from(this.toasts.keys()))e.has(t)||this.remove(t)}remove(e){let t=this.toasts.get(e);t&&(t.component.$destroy(),t.el.remove(),this.toasts.delete(e),this.updateShortcutTarget())}updateShortcutTarget(){let e=Array.from(this.toasts.keys()),t=e[e.length-1];this.toasts.forEach(({component:n},o)=>{n.$set({shortcutsEnabled:o===t})})}getContainer(){if(!this.containerEl){let e=document.body.createDiv("reminder-toast-container");e.style.cssText="position: fixed; right: 16px; bottom: 40px; z-index: var(--layer-notice); display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; width: 360px; max-width: calc(100vw - 32px);",this.containerEl=e}return this.containerEl}};var xg=window.require?window.require("electron"):void 0,hu=class{constructor(e,t,n,o,a,c,u){h(this,"app",e);h(this,"useSystemNotification",t);h(this,"laters",n);h(this,"openNoteOnReminderClick",o);h(this,"showPopupWithSystemNotification",a);h(this,"focusDoneButtonOnPopup",c);h(this,"notificationPopupStyle",u);h(this,"toastManager",new pu)}destroy(){this.toastManager.destroy()}syncToasts(e){this.toastManager.sync(e)}show(e,t,n,o,a,c,u){if(!this.isSystemNotification()){this.showBuiltinReminder(e,t,n,o,a,c,u);return}let f=this.showPopupWithSystemNotification.value;f&&this.showBuiltinReminder(e,t,n,o,a,c,u),this.showSystemNotification(e,t,n,o,a,c,u,f)}showSystemNotification(e,t,n,o,a,c,u,f){let p=xg.remote.Notification,b=new p({title:"Obsidian Reminder",body:e.title});if(b.on("click",()=>{if(b.close(),this.openNoteOnReminderClick.value){a();return}f||this.showBuiltinReminder(e,t,n,o,a,c,u)}),!f){b.on("close",()=>{o()});{let I=this.laters.value;b.on("action",(v,y)=>{if(y===0){n();return}let w=I[y-1];t(w.later())});let g=[{type:"button",text:"Mark as Done"}];I.forEach(v=>{g.push({type:"button",text:v.label})}),b.actions=g}}b.show()}showBuiltinReminder(e,t,n,o,a,c,u){if(this.notificationPopupStyle.value==="toast"){this.toastManager.show(e,this.laters.value,t,n,o,a,c,u);return}new Yd(this.app,this.laters.value,e,t,n,o,a,c,u,this.focusDoneButtonOnPopup.value).open()}isSystemNotification(){return this.isMobile()?!1:this.useSystemNotification.value}isMobile(){return xg===void 0}},Yd=class extends Ag.Modal{constructor(t,n,o,a,c,u,f,p,b,I){super(t);h(this,"laters",n);h(this,"reminder",o);h(this,"onRemindMeLater",a);h(this,"onDone",c);h(this,"onCancel",u);h(this,"onOpenFile",f);h(this,"onPauseAllNotifications",p);h(this,"onMuteAll",b);h(this,"focusDoneButtonOnPopup",I);h(this,"canceled",!0);h(this,"pausingAll",!1);h(this,"mutingAll",!1)}onOpen(){this.reminder.beingDisplayed=!0;let{contentEl:t}=this;new as({target:t,props:{reminder:this.reminder,laters:this.laters,focusDone:this.focusDoneButtonOnPopup,onRemindMeLater:n=>{this.onRemindMeLater(n),this.canceled=!1,this.close()},onDone:()=>{this.canceled=!1,this.onDone(),this.close()},onOpenFile:()=>{this.canceled=!0,this.onOpenFile(),this.close()},onMute:()=>{this.canceled=!0,this.close()},onPauseAllNotifications:()=>{this.pausingAll=!0,this.onPauseAllNotifications(),this.close()},onMuteAll:()=>{this.mutingAll=!0,this.onMuteAll(),this.close()}}})}onClose(){this.reminder.beingDisplayed=!1;let{contentEl:t}=this;t.empty(),this.pausingAll||this.mutingAll||this.canceled&&this.onCancel()}};var da=class{constructor(e){h(this,"plugin",e);h(this,"autoComplete");h(this,"editDetector");h(this,"reminderModal");h(this,"viewProxy");h(this,"dndStatusBar");h(this,"overdueStatusBar");this.viewProxy=new nu(this.plugin,t=>{if(!this.plugin.settings.openNoteOnReminderClick.value&&t.muteNotification){this.showReminder(t);return}this.openReminderFile(t)}),this.autoComplete=new uu(e.settings.autoCompleteTrigger,e.settings.reminderTimeStep,e.settings.primaryFormat,e.settings.convertNonTaskLines,e.settings.weekStart),this.editDetector=new Md(e.settings.editDetectionSec),this.reminderModal=new hu(e.app,e.settings.useSystemNotification,e.settings.laters,e.settings.openNoteOnReminderClick,e.settings.showPopupWithSystemNotification,e.settings.focusDoneButtonOnPopup,e.settings.notificationPopupStyle),this.dndStatusBar=new pl(e),this.overdueStatusBar=new hl(e)}onload(){this.dndStatusBar.onload(),this.overdueStatusBar.onload(),this.plugin.registerView(qr,e=>this.viewProxy.createView(e)),this.plugin.addSettingTab(new Xd(this.plugin.app,this.plugin)),this.plugin.registerDomEvent(document,"keydown",()=>{this.editDetector.fileChanged()}),bn.Platform.isDesktopApp&&(this.plugin.registerEditorExtension(pg(this.plugin.app,this.plugin.reminders,this.plugin.settings)),this.plugin.registerEditorExtension(Wd(this.plugin)),this.plugin.registerEditorExtension(wg()),this.plugin.settings.editorReminderDisplay.rawValue.onChanged(()=>{this.plugin.app.workspace.updateOptions()})),dp(this.plugin)}onLayoutReady(){this.plugin.data.debug.value&&mp(this.plugin),this.viewProxy.openView()}onunload(){this.detachReminderList(),this.reminderModal.destroy()}isEditing(){return this.editDetector.isEditing()}invalidate(){this.viewProxy.invalidate(),this.overdueStatusBar.refresh(),this.reminderModal.syncToasts(new Set(this.plugin.reminders.reminders.map(e=>e.key())))}reload(e=!1){this.viewProxy.reload(e),this.overdueStatusBar.refresh()}showAutoComplete(e){this.autoComplete.show(this.plugin.app,e,this.plugin.reminders)}refreshDndStatusBar(){this.dndStatusBar.refresh()}showReminderModal(e,t,n,o,a,c,u){this.reminderModal.show(e,t,n,o,a,c,u)}async showReminderList(){let e=this.plugin.app.workspace,t=e.getLeavesOfType(qr)[0];if(t==null){let n=e.getRightLeaf(!1);if(n==null)return;await n.setViewState({type:qr}),t=n}await e.revealLeaf(t)}detachReminderList(){this.plugin.app.workspace.getLeavesOfType(qr).forEach(e=>e.detach())}async openReminderFile(e){let t=this.plugin.app.workspace.getLeaf(!1);console.debug("Open reminder: ",e);let n=this.plugin.app.vault.getAbstractFileByPath(e.file);if(!(n instanceof bn.TFile)){console.error("Cannot open file because it isn't a TFile: %o",n);return}if(await t.openFile(n),!(t.view instanceof bn.MarkdownView))return;let o=t.view.editor,a=o.getLine(e.rowNumber);o.setCursor({line:e.rowNumber,ch:0}),o.scrollIntoView({from:{line:e.rowNumber,ch:0},to:{line:e.rowNumber,ch:a.length}},!0);let c=o.cm;if(c){let u=c.state.doc.line(e.rowNumber+1);c.dispatch({effects:Zd.of({from:u.from,to:u.to})})}}showReminder(e){e.muteNotification=!0,this.showReminderModal(e,t=>{console.debug("Remind me later: time=%o",t),e.time=t,e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!1),this.plugin.data.save(!0)},()=>{console.debug("done"),e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!0),this.plugin.reminders.removeReminder(e),this.plugin.data.save(!0)},()=>{console.debug("Mute"),e.muteNotification=!0,this.reload(!0),this.plugin.data.save(!0)},()=>{console.debug("Open"),this.openReminderFile(e)},()=>{console.debug("Pause all notifications"),e.muteNotification=!1,Na(this.plugin)},()=>{console.debug("Mute all reminders");let t=this.plugin.reminders.muteExpiredReminders(this.plugin.settings.reminderTime.value)+1;e.muteNotification=!0,this.reload(!0),this.plugin.data.save(!0),new bn.Notice(`Muted ${t} reminder${t===1?"":"s"}`)})}},Md=class{constructor(e){h(this,"editDetectionSec",e);h(this,"lastModified")}fileChanged(){this.lastModified=new Date}isEditing(){return this.editDetectionSec.value<=0||this.lastModified==null?!1:(new Date().getTime()-this.lastModified.getTime())/1e3<this.editDetectionSec.value}},Xd=class extends bn.PluginSettingTab{constructor(t,n){super(t,n);h(this,"plugin",n)}display(){let{containerEl:t}=this;this.plugin.settings.settings.displayOn(t)}};function kg(r){return r.trim().replace(/^\/+/,"").replace(/\/+$/,"")}function Rg(r,e){let t=kg(r);return e.some(n=>{let o=kg(n);return o.length===0?!1:t===o||t.startsWith(`${o}/`)})}var Ud=require("obsidian");var fa=class{constructor(e,t,n,o){h(this,"vault",e);h(this,"reminders",t);h(this,"onRemindersChanged",n);h(this,"excludedPaths",o)}onload(e){[this.vault.on("modify",async t=>{await this.reloadRemindersInFile(t)&&this.onRemindersChanged()}),this.vault.on("delete",async t=>{await this.removeRemindersByFile(t.path)&&this.onRemindersChanged()}),this.vault.on("rename",async(t,n)=>{await this.removeRemindersByFile(n)&&(await this.reloadRemindersInFile(t),this.onRemindersChanged())})].forEach(t=>{e.registerEvent(t)})}async removeRemindersByFile(e){return console.debug("Remove file: path=%s",e),this.reminders.removeByFile(e)}async reloadRemindersInFile(e){if(console.debug("Reload file and collect reminders: file=%s",e.path),!(e instanceof Ud.TFile))return console.debug("Cannot read file other than TFile: file=%o",e),!1;if(!this.isMarkdownFile(e))return console.debug("Not a markdown file: file=%o",e),!1;if(Rg(e.path,this.excludedPaths()))return console.debug("Excluded file: file=%o",e),this.reminders.removeByFile(e.path);let n=new Bn(e.path,await this.vault.cachedRead(e)).getReminders();if(n.length>0){if(!this.reminders.replaceFile(e.path,n))return!1}else if(!this.reminders.removeByFile(e.path))return!1;return!0}async reloadRemindersInAllFiles(){console.debug("Reload all files and collect reminders"),this.reminders.clear();for(let e of this.vault.getMarkdownFiles())await this.reloadRemindersInFile(e);this.onRemindersChanged()}isMarkdownFile(e){return e.extension.toLowerCase()==="md"}async updateReminder(e,t){let n=this.vault.getAbstractFileByPath(e.file);if(!(n instanceof Ud.TFile)){console.error("file is not instance of TFile: %o",n);return}let o=new Bn(n.path,await this.vault.read(n));await o.updateReminder(e,{checked:t,time:e.time}),await this.vault.modify(n,o.getContent())}};var Sg=Nr(wr(),1);var zd=require("obsidian");var Qd=class{constructor(){h(this,"settingContexts",[])}register(e){this.settingContexts.push(e)}findByKey(e){return this.settingContexts.find(t=>t.key===e)}forEach(e){this.settingContexts.forEach(e)}},Vd=class{constructor(e){h(this,"_settingRegistry",e);h(this,"validationEl");h(this,"infoEl");h(this,"_setting");h(this,"key");h(this,"name");h(this,"desc");h(this,"tags",[]);h(this,"settingModel");h(this,"anyValueChanged")}init(e,t){this.settingModel=e,this._setting=t,this.validationEl=t.descEl.createDiv("validation",n=>{n.style.color="var(--text-error)",n.style.marginTop="0.25rem",n.style.display="none"}),this.infoEl=t.descEl.createDiv("info",n=>{n.style.color="var(--text-faint)",n.style.marginTop="0.25rem",n.style.display="none"})}setValidationError(e){this.setText(this.validationEl,e)}setInfo(e){this.setText(this.infoEl,e)}setText(e,t){if(!e){console.error("element not created");return}t===null?e.style.display="none":(e.style.display="block",e.textContent=t)}get setting(){return this._setting}get registry(){return this._settingRegistry}hasTag(e){return this.tags.filter(t=>t===e).length>0}update(){this.isInitialized()&&this.anyValueChanged&&this.anyValueChanged(this)}setEnabled(e){this.setting.setDisabled(!e),this.setting.settingEl.toggleClass("reminder-setting-disabled",!e)}findContextByKey(e){return this._settingRegistry.findByKey(e)}booleanValue(){return this.settingModel.value}isInitialized(){return this.settingModel&&this.validationEl&&this.setting}},Ld=class{constructor(e){h(this,"registry",e);h(this,"context");this.context=new Vd(this.registry),this.registry.register(this.context)}key(e){return this.context.key=e,this}name(e){return this.context.name=e,this}desc(e){return this.context.desc=e,this}tag(e){return this.context.tags.push(e),this}enableWhen(e){return this.context.anyValueChanged=e,this}text(e){return new gu(this.context,!1,e)}textArea(e){return new gu(this.context,!0,e)}number(e){return new Od(this.context,e)}toggle(e){return new $d(this.context,e)}dropdown(e){return new Hd(this.context,e)}},ls=class{constructor(e,t){h(this,"context",e);h(this,"initValue",t)}onAnyValueChanged(e){return this.context.anyValueChanged=e,this}onValueChange(){this.context.registry.forEach(e=>{e.update()})}buildSettingModel(e,t){return new ma(this.context,e,this.initValue,t)}wireTextComponent(e,t,n,o){e.setPlaceholder(t).setValue(n).onChange(async a=>{o(a)})}},gu=class extends ls{constructor(t,n,o){super(t,o);h(this,"longText",n);h(this,"_placeHolder")}placeHolder(t){return this._placeHolder=t,this}build(t){return this.buildSettingModel(t,({setting:n,rawValue:o,context:a})=>{let c=u=>{var f;this.wireTextComponent(u,(f=this._placeHolder)!=null?f:"",o.value,p=>{try{t.unmarshal(p),o.value=p,a.setValidationError(null),this.onValueChange()}catch(b){b instanceof Error?a.setValidationError(b.message):typeof b=="string"&&a.setValidationError(b)}})};this.longText?n.addTextArea(u=>{c(u)}):n.addText(u=>{c(u)})})}},Od=class extends ls{constructor(t,n){super(t,n);h(this,"_placeHolder")}placeHolder(t){return this._placeHolder=t,this}build(t){return this.buildSettingModel(t,({setting:n,rawValue:o,context:a})=>{n.addText(c=>{var u;this.wireTextComponent(c,(u=this._placeHolder)!=null?u:"",o.value.toString(),f=>{let p=parseInt(f,10);if(Number.isNaN(p)){a.setValidationError("Please enter a valid number.");return}a.setValidationError(null),o.value=p,this.onValueChange()})})})}},$d=class extends ls{build(e){return new ma(this.context,e,this.initValue,({setting:t,rawValue:n})=>{t.addToggle(o=>o.setValue(n.value).onChange(async a=>{n.value=a,this.onValueChange()}))})}},Pd=class{constructor(e,t){h(this,"label",e);h(this,"value",t)}},Hd=class extends ls{constructor(){super(...arguments);h(this,"options",[])}addOption(t,n){return this.options.push(new Pd(t,n)),this}build(t){return new ma(this.context,t,this.initValue,({setting:n,rawValue:o})=>{n.addDropdown(a=>{this.options.forEach(c=>{a.addOption(c.value,c.label)}),a.setValue(o.value),a.onChange(async c=>{o.value=c,this.onValueChange()})})})}},ma=class{constructor(e,t,n,o){h(this,"context",e);h(this,"serde",t);h(this,"settingInitializer",o);h(this,"rawValue");if(this.rawValue=new ii(n),e.key==null)throw new Error("key is required.")}createSetting(e){var n,o;let t=new zd.Setting(e).setName((n=this.context.name)!=null?n:"").setDesc((o=this.context.desc)!=null?o:"");return this.context.init(this,t),this.settingInitializer({setting:t,rawValue:this.rawValue,context:this.context}),t}get value(){return this.serde.unmarshal(this.rawValue.value)}get key(){return this.context.key}load(e){if(e===void 0)return;let t=e[this.key];t!==void 0&&(this.rawValue.value=t)}store(e){e[this.key]=this.rawValue.value}hasTag(e){return this.context.hasTag(e)}},Jd=class{constructor(e){h(this,"name",e);h(this,"settings",[])}addSettings(...e){this.settings.push(...e)}},jd=class{constructor(e){h(this,"name",e);h(this,"groups",[])}newGroup(e){let t=new Jd(e);return this.groups.push(t),t}},bu=class{constructor(){h(this,"pages",[]);h(this,"registry",new Qd);h(this,"activeTabIndex",0)}newSettingBuilder(){return new Ld(this.registry)}newPage(e){let t=new jd(e);return this.pages.push(t),t}displayOn(e){e.empty();let t=e.createDiv("reminder-settings-tab-bar");t.setAttribute("role","tablist");let n=this.pages.map((a,c)=>{let u=t.createEl("button",{cls:"reminder-settings-tab",text:a.name});return u.setAttribute("role","tab"),u.setAttribute("type","button"),u.addEventListener("click",()=>{this.activeTabIndex=c,this.updateTabButtons(n),this.renderActivePage(o)}),u});this.updateTabButtons(n);let o=e.createDiv("reminder-settings-tab-content");this.renderActivePage(o)}updateTabButtons(e){e.forEach((t,n)=>{let o=n===this.activeTabIndex;t.toggleClass("is-active",o),t.setAttribute("aria-selected",o?"true":"false")})}renderActivePage(e){e.empty();let t=this.pages[this.activeTabIndex];t!==void 0&&(t.groups.forEach(n=>{n.name!==void 0&&new zd.Setting(e).setName(n.name).setHeading(),n.settings.forEach(o=>{o.createSetting(e)})}),this.registry.forEach(n=>n.update()))}forEach(e){this.pages.forEach(t=>{t.groups.forEach(n=>{n.settings.forEach(o=>{e(o)})})})}},vu=class{unmarshal(e){return Wa.parse(e)}marshal(e){return e.toString()}},Ae=class{unmarshal(e){return e}marshal(e){return e}},yu=class{unmarshal(e){return Kf(e)}marshal(e){return e.map(t=>t.label).join(`
`)}},_u=class{unmarshal(e){return e.split(`
`).map(t=>t.trim()).filter(t=>t.length>0)}marshal(e){return e.join(`
`)}},Iu=class{unmarshal(e){let t=_o.find(n=>n.name===e);return t!==void 0?t:(console.warn(`Unknown reminder format: ${e}. Falling back to the default format.`),_o[0])}marshal(e){return e.name}};var yr="re-scan",wu=class{constructor(){h(this,"settings",new bu);h(this,"reminderTime");h(this,"reminderTimeStep");h(this,"enableNotification");h(this,"notificationPopupStyle");h(this,"openNoteOnReminderClick");h(this,"useSystemNotification");h(this,"showPopupWithSystemNotification");h(this,"focusDoneButtonOnPopup");h(this,"laters");h(this,"weekStart");h(this,"dateFormat");h(this,"dateTimeFormat");h(this,"strictDateFormat");h(this,"autoCompleteTrigger");h(this,"convertNonTaskLines");h(this,"editorReminderDisplay");h(this,"primaryFormat");h(this,"excludedPaths");h(this,"useCustomEmojiForTasksPlugin");h(this,"useReminderTimeFallbackForTasksPlugin");h(this,"removeTagsForTasksPlugin");h(this,"dataviewReminderFieldName");h(this,"linkDatesToDailyNotes");h(this,"yearMonthDisplayFormat");h(this,"monthDayDisplayFormat");h(this,"timeDisplayFormat");h(this,"shortDateWithWeekdayDisplayFormat");h(this,"editDetectionSec");h(this,"reminderCheckIntervalSec");h(this,"showOverdueCountInStatusBar");let e=new Kd(this.settings);this.reminderTime=this.settings.newSettingBuilder().key("reminderTime").name("Reminder time").desc("Time when a reminder with no time part will show").tag(yr).text("09:00").placeHolder("Time (hh:mm)").build(new vu),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new Ae),this.enableNotification=this.settings.newSettingBuilder().key("enableNotification").name("Enable reminder notifications").desc("If disabled, reminder popups and system notifications are not shown. The reminder list view keeps working.").toggle(!0).build(new Ae),this.notificationPopupStyle=this.settings.newSettingBuilder().key("notificationPopupStyle").name("Reminder popup style").desc("Toast: a card in the corner of the window that does not interrupt your work. Modal: a dialog in the center of the window that takes focus.").dropdown("toast").addOption("Toast (corner card)","toast").addOption("Modal (center dialog)","modal").build(new Ae),this.openNoteOnReminderClick=this.settings.newSettingBuilder().key("openNoteOnReminderClick").name("Open note on reminder click").desc("When clicking a reminder in the reminder list or a system notification, open the note directly instead of showing the reminder popup.").toggle(!1).build(new Ae),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new Ae),this.showPopupWithSystemNotification=this.settings.newSettingBuilder().key("showPopupWithSystemNotification").name("Show popup together with system notification").desc("When using system notification, also show the built-in reminder popup at the same time. The popup handles the reminder actions; the system notification acts as an alert only.").toggle(!1).build(new Ae),this.focusDoneButtonOnPopup=this.settings.newSettingBuilder().key("focusDoneButtonOnPopup").name("Focus Done button on popup").desc("Automatically focus the Done button when a reminder popup opens, so pressing Enter completes the task. Off by default to prevent accidentally completing a reminder you haven't read.").toggle(!1).build(new Ae),this.laters=this.settings.newSettingBuilder().key("laters").name("Remind me later").desc("Line-separated list of remind me later items").textArea(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).placeHolder(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).build(new yu);let t=this.settings.newSettingBuilder().key("weekStart").name("Week start").desc("Select the first day of the week").dropdown("0");Array.from({length:7},(a,c)=>{let u=(0,Sg.default)().day(c).format("dddd");t.addOption(u,c.toString())}),this.weekStart=t.build(new Ae),this.dateFormat=this.settings.newSettingBuilder().key("dateFormat").name("Date format").desc("moment style date format: https://momentjs.com/docs/#/displaying/format/").tag(yr).text("YYYY-MM-DD").placeHolder("YYYY-MM-DD").onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ae),this.strictDateFormat=this.settings.newSettingBuilder().key("strictDateFormat").name("Strict date format").desc("Strictly parse the date and time").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ae),this.dateTimeFormat=this.settings.newSettingBuilder().key("dateTimeFormat").name("Date and time format").desc("moment() style date time format: https://momentjs.com/docs/#/displaying/format/").tag(yr).text("YYYY-MM-DD HH:mm").placeHolder("YYYY-MM-DD HH:mm").onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ae),this.linkDatesToDailyNotes=this.settings.newSettingBuilder().key("linkDatesToDailyNotes").name("Link dates to daily notes").desc("When toggled, Dates link to daily notes.").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ae),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(a=>{let c=this.autoCompleteTrigger.value;a.setInfo(`Popup is ${c.length===0?"disabled":"enabled"}`)}).build(new Ae),this.convertNonTaskLines=this.settings.newSettingBuilder().key("convertNonTaskLines").name("Convert non-task lines when inserting a reminder").desc('When inserting a reminder from the calendar popup on a line that is not a task, convert the line into a task list item ("- [ ] ") automatically. When disabled, a notice is shown instead.').toggle(!0).build(new Ae),this.editorReminderDisplay=this.settings.newSettingBuilder().key("editorReminderDisplay").name("Show reminder pills in editor").desc("Render each reminder's time as a clickable pill (\u23F0) in Live Preview. Clicking a pill opens the date/time chooser to change it. Disable to show the raw reminder text instead.").toggle(!0).build(new Ae);let n=this.settings.newSettingBuilder().key("primaryReminderFormat").name("Primary reminder format").desc("Reminder format for generated reminder by calendar popup").dropdown(_o[0].name);_o.forEach(a=>n.addOption(`${a.description} - ${a.example}`,a.name)),this.primaryFormat=n.build(new Iu),this.excludedPaths=this.settings.newSettingBuilder().key("excludedPaths").name("Excluded files/folders").desc("Reminders in these files/folders are ignored. One vault-relative path per line (e.g. Templates or Archive/2020).").tag(yr).textArea("").placeHolder(`Templates
Archive/2020`).build(new _u),this.useCustomEmojiForTasksPlugin=this.settings.newSettingBuilder().key("useCustomEmojiForTasksPlugin").name("Distinguish between reminder date and due date").desc("Use custom emoji \u23F0 instead of \u{1F4C5} and distinguish between reminder date/time and Tasks Plugin's due date.").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ae),this.useReminderTimeFallbackForTasksPlugin=this.settings.newSettingBuilder().key("useReminderTimeFallbackForTasksPlugin").name("Fall back to due, scheduled, or start date").desc("When the reminder date (\u23F0) is missing, use the due date (\u{1F4C5}), then the scheduled date (\u23F3), then the start date (\u{1F6EB}), in that order.").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableTasksPluginReminderFormat.value&&this.useCustomEmojiForTasksPlugin.value)}).build(new Ae),this.removeTagsForTasksPlugin=this.settings.newSettingBuilder().key("removeTagsForTasksPlugin").name("Remove tags from reminder title").desc("If checked, tags(#xxx) are removed from the reminder list view and notification.").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ae),this.dataviewReminderFieldName=this.settings.newSettingBuilder().key("dataviewReminderFieldName").name("Reminder field name").desc("The inline field (e.g. [reminder:: 2021-09-08]) read as the reminder date. On a line that also has a due field, this field takes precedence.").tag(yr).text("reminder").placeHolder("reminder").onAnyValueChanged(a=>{a.setEnabled(e.enableDataviewReminderFormat.value)}).build(new Ae),this.yearMonthDisplayFormat=this.settings.newSettingBuilder().key("yearMonthDisplayFormat").name("Year & month format").desc(`Moment style year and month format:
https://momentjs.com/docs/#/displaying/format/`).text("YYYY, MMMM").placeHolder("YYYY, MMMM").build(new Ae),this.monthDayDisplayFormat=this.settings.newSettingBuilder().key("monthDayDisplayFormat").name("Month & day format").desc(`Moment style month and day format:
https://momentjs.com/docs/#/displaying/format/`).text("MM/DD").placeHolder("MM/DD").build(new Ae),this.shortDateWithWeekdayDisplayFormat=this.settings.newSettingBuilder().key("shortDateWithWeekdayDisplayFormat").name("Short date with weekday format").desc(`Moment style short date with weekday format:
https://momentjs.com/docs/#/displaying/format/`).text("M/DD (ddd)").placeHolder("M/DD (ddd)").build(new Ae),this.timeDisplayFormat=this.settings.newSettingBuilder().key("timeDisplayFormat").name("Time format").desc(`Moment style time format:
https://momentjs.com/docs/#/displaying/format/`).text("HH:mm").placeHolder("HH:mm").build(new Ae),this.editDetectionSec=this.settings.newSettingBuilder().key("editDetectionSec").name("Edit detection time").desc("The minimum amount of time (in seconds) after a key is typed that it will be identified as notifiable. Only applies to the Modal popup style; Toast reminders are shown immediately even while typing.").number(10).build(new Ae),this.reminderCheckIntervalSec=this.settings.newSettingBuilder().key("reminderCheckIntervalSec").name("Reminder check interval").desc("Interval(in seconds) to periodically check whether or not you should be notified of reminders. You will need to restart Obsidian for this setting to take effect.").number(5).build(new Ae),this.showOverdueCountInStatusBar=this.settings.newSettingBuilder().key("showOverdueCountInStatusBar").name("Show overdue count in status bar").desc("Show the number of overdue reminders in the status bar. Click it to open the reminder list.").toggle(!0).build(new Ae),this.settings.newPage("Notifications").newGroup().addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.enableNotification,this.notificationPopupStyle,this.openNoteOnReminderClick,this.useSystemNotification,this.showPopupWithSystemNotification,this.focusDoneButtonOnPopup,this.showOverdueCountInStatusBar),this.settings.newPage("Editor").newGroup().addSettings(this.autoCompleteTrigger,this.convertNonTaskLines,this.primaryFormat,this.editorReminderDisplay);let o=this.settings.newPage("Reminder formats");o.newGroup("Reminder plugin format").addSettings(e.enableReminderPluginReminderFormat,this.dateFormat,this.dateTimeFormat,this.strictDateFormat,this.linkDatesToDailyNotes),o.newGroup("Tasks plugin format").addSettings(e.enableTasksPluginReminderFormat,this.useCustomEmojiForTasksPlugin,this.useReminderTimeFallbackForTasksPlugin,this.removeTagsForTasksPlugin),o.newGroup("Dataview format").addSettings(e.enableDataviewReminderFormat,this.dataviewReminderFieldName),o.newGroup("Kanban plugin format").addSettings(e.enableKanbanPluginReminderFormat),this.settings.newPage("Display").newGroup().addSettings(this.yearMonthDisplayFormat,this.monthDayDisplayFormat,this.shortDateWithWeekdayDisplayFormat,this.timeDisplayFormat,this.weekStart),this.settings.newPage("Advanced").newGroup().addSettings(this.excludedPaths,this.editDetectionSec,this.reminderCheckIntervalSec)}wireReminderFormatConfig(){let e=new ws;e.setParameterFunc(Qe.now,()=>P.now()),e.setParameter(Qe.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),e.setParameter(Qe.linkDatesToDailyNotes,this.linkDatesToDailyNotes),e.setParameter(Qe.removeTagsForTasksPlugin,this.removeTagsForTasksPlugin),e.setParameter(Qe.useReminderTimeFallbackForTasksPlugin,this.useReminderTimeFallbackForTasksPlugin),e.setParameter(Qe.dataviewReminderFieldName,this.dataviewReminderFieldName),rp(e)}forEach(e){this.settings.forEach(e)}},Kd=class{constructor(e){h(this,"settings",e);h(this,"settingKeyToFormatName",new Map);h(this,"reminderFormatSettings",[]);h(this,"enableReminderPluginReminderFormat");h(this,"enableTasksPluginReminderFormat");h(this,"enableKanbanPluginReminderFormat");h(this,"enableDataviewReminderFormat");this.enableReminderPluginReminderFormat=this.createUseReminderFormatSetting(bc),this.enableTasksPluginReminderFormat=this.createUseReminderFormatSetting(vc),this.enableKanbanPluginReminderFormat=this.createUseReminderFormatSetting(yc),this.enableDataviewReminderFormat=this.createUseReminderFormatSetting(_c)}createUseReminderFormatSetting(e){let t=`enable${e.name}`,n=this.settings.newSettingBuilder().key(t).name(`Enable ${e.description}`).desc("Recognize reminders written in this format.").tag(yr).toggle(e.defaultEnabled).onAnyValueChanged(o=>{var a;o.setInfo(`Example: ${(a=e.format.appendReminder("- [ ] Task 1",P.now()))==null?void 0:a.insertedLine}`)}).build(new Ae);return this.settingKeyToFormatName.set(t,e),this.reminderFormatSettings.push(n),n.rawValue.onChanged(()=>{this.updateReminderFormat()}),n}updateReminderFormat(){let e=this.reminderFormatSettings.filter(t=>t.value).map(t=>this.settingKeyToFormatName.get(t.key)).filter(t=>t!==void 0);tp(e)}};var pa=class{constructor(e,t){h(this,"store",e);h(this,"reminders",t);h(this,"restoring",!0);h(this,"changed",!1);h(this,"scanned",new ii(!1));h(this,"debug",new ii(!1));h(this,"dndUntil",new ii(null));h(this,"_settings",new wu);this._settings.wireReminderFormatConfig(),this.settings.forEach(n=>{n.rawValue.onChanged(()=>{this.restoring||(n.hasTag(yr)&&(this.scanned.value=!1),this.changed=!0)})})}async load(){console.debug("Load reminder plugin data");let e=await this.store.loadData();if(!e){this.scanned.value=!1;return}this.scanned.value=e.scanned,e.debug!=null&&(this.debug.value=e.debug),this.dndUntil.value=e.dndUntil!=null?P.ofEpochMillis(e.dndUntil):null,this.settings.forEach(n=>{n.load(e.settings)});let t=e.reminders;t&&Object.keys(t).forEach(n=>{let o=t[n];o&&this.reminders.replaceFile(n,o.map(a=>{var u;let c=new ao(n,a.title,P.parse(a.time),a.rowNumber,!1);return c.muteNotification=(u=a.muted)!=null?u:!1,c}))}),this.changed=!1,this.restoring&&(this.restoring=!1)}async save(e=!1){var o,a;if(!e&&!this.changed)return;console.debug("Save reminder plugin data: force=%s, changed=%s",e,this.changed);let t={};this.reminders.fileToReminders.forEach((c,u)=>{t[u]=c.map(f=>({title:f.title,time:f.time.toString(),rowNumber:f.rowNumber,muted:f.muteNotification}))});let n={};this.settings.forEach(c=>{c.store(n)}),await this.store.saveData({scanned:this.scanned.value,reminders:t,debug:this.debug.value,dndUntil:(a=(o=this.dndUntil.value)==null?void 0:o.getTimeInMillis())!=null?a:null,settings:n}),this.changed=!1}get settings(){return this._settings}};var Fg=require("obsidian");var Cu=class extends Fg.Plugin{constructor(t,n){super(t,n);h(this,"_data");h(this,"settings");h(this,"_ui");h(this,"_reminders");h(this,"_fileSystem");h(this,"_notificationWorker");this._reminders=new Ma(()=>{this.ui&&this.ui.invalidate(),this.data.changed=!0}),this._data=new pa(this,this.reminders),this.settings=this.data.settings,this.reminders.reminderTime=this.settings.reminderTime,Jr.setTimeFormat(this.settings.dateFormat,this.settings.dateTimeFormat,this.settings.strictDateFormat),this._ui=new da(this),this._fileSystem=new fa(t.vault,this.reminders,()=>{this.ui.reload(!0)},()=>this.settings.excludedPaths.value),this._notificationWorker=new _s({registerInterval:o=>this.registerInterval(o),isLayoutReady:()=>this.app.workspace.layoutReady,reloadUI:o=>this.ui.reload(o),isEditing:()=>this.ui.isEditing(),isPopupIntrusive:()=>this.settings.notificationPopupStyle.value!=="toast",showReminder:o=>this.ui.showReminder(o),isScanned:()=>this.data.scanned.value,markScanned:()=>{this.data.scanned.value=!0},saveData:o=>{this.data.save(o)},reloadRemindersInAllFiles:()=>this.fileSystem.reloadRemindersInAllFiles(),getExpiredReminders:()=>this.reminders.getExpiredReminders(this.settings.reminderTime.value),checkIntervalSec:()=>this.settings.reminderCheckIntervalSec.value,isNotificationEnabled:()=>this.settings.enableNotification.value,isNotificationPaused:()=>ro(this.data.dndUntil.value,P.now())})}async onload(){this.ui.onload(),this.app.workspace.onLayoutReady(async()=>{await this.data.load(),this.ui.onLayoutReady(),this.fileSystem.onload(this),this._notificationWorker.startPeriodicTask()})}onunload(){this.ui.onunload()}get reminders(){return this._reminders}get ui(){return this._ui}get fileSystem(){return this._fileSystem}get data(){return this._data}};
/*! Bundled license information:
moment/moment.js:
(*! moment.js *)
(*! version : 2.30.1 *)
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
(*! license : MIT *)
(*! momentjs.com *)
*/
/* nosourcemap */