Files
StudyDiary/.obsidian/plugins/obsidian-reminder-plugin/main.js
T

103 lines
290 KiB
JavaScript
Raw Normal View History

2026-07-23 20:36:13 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
2026-08-24 09:42:59 +08:00
"use strict";var B_=Object.create;var ys=Object.defineProperty;var D_=Object.getOwnPropertyDescriptor;var N_=Object.getOwnPropertyNames;var W_=Object.getPrototypeOf,Z_=Object.prototype.hasOwnProperty;var rm=r=>{throw TypeError(r)};var M_=(r,e,t)=>e in r?ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Y_=(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})},nm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N_(e))!Z_.call(r,o)&&o!==t&&ys(r,o,{get:()=>e[o],enumerable:!(n=D_(e,o))||n.enumerable});return r};var Wr=(r,e,t)=>(t=r!=null?B_(W_(r)):{},nm(e||!r||!r.__esModule?ys(t,"default",{value:r,enumerable:!0}):t,r)),U_=r=>nm(ys({},"__esModule",{value:!0}),r);var m=(r,e,t)=>M_(r,typeof e!="symbol"?e+"":e,t),ec=(r,e,t)=>e.has(r)||rm("Cannot "+t);var C=(r,e,t)=>(ec(r,e,"read from private field"),t?t.call(r):e.get(r)),ee=(r,e,t)=>e.has(r)?rm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),z=(r,e,t,n)=>(ec(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ae=(r,e,t)=>(ec(r,e,"access private method"),t);var wr=Y_((ac,no)=>{(function(r,e){typeof ac=="object"&&typeof no!="undefined"?no.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(ac,(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 u(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 c(i){return i===void 0}function f(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function h(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function b(i,s){var l=[],d,p=i.length;for(d=0;d<p;++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 Bf(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(p){return p!=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 B=e.momentProperties=[],F=!1;function P(i,s){var l,d,p,_=B.length;if(c(s._isAMomentObject)||(i._isAMomentObject=s._isAMomentObject),c(s._i)||(i._i=s._i),c(s._f)||(i._f=s._f),c(s._l)||(i._l=s._l),c(s._strict)||(i._strict=s._strict),c(s._tzm)||(i._tzm=s._tzm),c(s._isUTC)||(i._isUTC=s._isUTC),c(s._offset)||(i._offset=s._offset),c(s._pf)||(i._pf=y(s)),c(s._locale)||(i._locale=s._locale),_>0)for(l=0;l<_;l++)d=B[l],p=s[d],c(p)||(i[d]=p);return i}function ie(i){P(this,i),this._d=new Date(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),F===!1&&(F=!0,e.updateOffset(this),F=!1)}function Y(i){return i instanceof ie||i!=null&&i._isAMomentObject!=null}function pe(i){e.suppressDeprecationWarnings===!1&&typeof console
[`+_+"] ";for(S in arguments[0])a(arguments[0],S)&&(p+=S+": "+arguments[0][S]+", ");p=p.slice(0,-2)}else p=arguments[_];d.push(p)}pe(i+`
2026-07-23 20:36:13 +08:00
Arguments: `+Array.prototype.slice.call(d).join("")+`
2026-08-24 09:42:59 +08:00
`+new Error().stack),l=!1}return s.apply(this,arguments)},s)}var Ge={};function He(i,s){e.deprecationHandler!=null&&e.deprecationHandler(i,s),Ge[i]||(pe(s),Ge[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 Ze(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 rt(i){i!=null&&this.set(i)}var At;Object.keys?At=Object.keys:At=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 oe(i,s,l){var d=""+Math.abs(i),p=s-d.length,_=i>=0;return(_?l?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+d}var N=/(\[[^\[]*\])|(\\)?([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,le=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,De={},E={};function G(i,s,l,d){var p=d;typeof d=="string"&&(p=function(){return this[d]()}),i&&(E[i]=p),s&&(E[s[0]]=function(){return oe(p.apply(this,arguments),s[1],s[2])}),l&&(E[l]=function(){return this.localeData().ordinal(p.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(N),l,d;for(l=0,d=s.length;l<d;l++)E[s[l]]?s[l]=E[s[l]]:s[l]=_t(s[l]);return function(p){var _="",S;for(S=0;S<d;S++)_+=he(s[S])?s[S].call(p,i):s[S];return _}}function ut(i,s){return i.isValid()?(s=Ve(s,i.localeData()),De[s]=De[s]||Je(s),De[s](i)):i.localeData().invalidDate()}function Ve(i,s){var l=5;function d(p){return s.longDateFormat(p)||p}for(le.lastIndex=0;l>=0&&le.test(i);)i=i.replace(le,d),le.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(N).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[i])}var yn="Invalid date";function ti(){return this._invalidDate}var us="%d",Tu=/\d{1,2}/;function $g(i){return this._ordinal.replace("%d",i)}var Pg={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 Hg(i,s,l,d){var p=this._relativeTime[l];return he(p)?p(i,s,l,d):p.replace(/%d/i,i)}function Jg(i,s){var l=this._relativeTime[i>0?"future":"past"];return he(l)?l(s):l.replace(/%s/i,s)}var ff={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 typeo
`;function om(r,e){return`${r}${O_}${e}`}function sm(r,e,t){let n=om(r,e),o=im(n,V_).toString(36),a=im(n,L_).toString(36),u=`${nc}${o}${a}`;return t===0?u:`${u}-${t}`}function ic(r){var o;let e=[...r].sort((a,u)=>a.file!==u.file?a.file<u.file?-1:1:a.rowNumber-u.rowNumber),t=new Map,n=new Map;for(let a of e){let u=om(a.file,a.title),c=(o=t.get(u))!=null?o:0;t.set(u,c+1),n.set(a,sm(a.file,a.title,c))}return n}var $_=10,P_=1440*60;function oc(r){let{reminders:e,serverPending:t,serverDelivered:n=[],now:o,defaultTime:a,minLeadSeconds:u=$_,horizonSeconds:c=P_}=r,f=o.getTimeInMillis(a),h=f+u*1e3,b=f+c*1e3,I=ic(e),g=new Map;for(let F of e){let P=F.time.getTimeInMillis(a),ie=I.get(F);g.set(ie,Math.floor(P/1e3))}let v=new Map;for(let F of e){let P=F.time.getTimeInMillis(a);if(P<=h||P>b)continue;let ie=I.get(F);v.set(ie,{sequenceId:ie,atSeconds:Math.floor(P/1e3),reminder:F})}let y=new Map;for(let F of t)y.set(F.sequenceId,F);let w=[];for(let F of v.values()){let P=y.get(F.sequenceId);(P===void 0||P.atSeconds!==F.atSeconds)&&w.push(F)}let x=[],k=new Set;function B(F){k.has(F)||(k.add(F),x.push({sequenceId:F}))}for(let F of t)Is(F.sequenceId)&&(v.has(F.sequenceId)||am(F,g)&&B(F.sequenceId));for(let F of n)am(F,g)&&B(F.sequenceId);return{publish:w,delete:x}}function am(r,e){if(!Is(r.sequenceId))return!1;let t=e.get(r.sequenceId);return t===void 0||t!==r.atSeconds}function sc(r){return r.map(e=>e.sequenceId).filter(Is)}var ro=class{constructor(e){m(this,"_value",e)}get value(){return this._value}},oi=class{constructor(e){m(this,"_value",e);m(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 sr=Wr(wr(),1);var $=class r{constructor(e,t){m(this,"time",e);m(this,"_hasTimePart",t)}static now(){return new r((0,sr.default)(),!0)}static parse(e){return e.length>10?new r((0,sr.default)(e,"YYYY-MM-DD HH:mm"),!0):new r((0,sr.default)(e,"YYYY-MM-DD"),!1)}static ofEpochMillis(e){return new r((0,sr.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)}},Na=class r{constructor(e,t){m(this,"hour",e);m(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 io(r,e){return()=>new $((0,sr.default)(),!0).add(r,e)}function lm(r){return io(r,"minutes")}function lc(r){return io(r,"hours")}function H_(r){return io(r,"days")}function J_(r){return io(r,"weeks")}function j_(r){return io(r,"months")}function z_(r){return io(r,"years")}function ki(r){return()=>{let e=(0,sr.default)();return e.isoWeekday()<=r?new $(e.isoWeekday(r),!1):new $(e.add(1,"weeks").isoWeekday(r),!1)}}function uc(){return()=>new $((0,sr.default)().add(1,"days"),!1)}function um(){return()=>new $((0,sr.default)().add(1,"weeks"),!1)}function K_(){return()=>new $((0,sr.default)().add(1,"months"),!1)}function q_(){return()=>new $((0,sr.defau
`).map(e=>eI(e.trim()))}function eI(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 Xe(`In ${t} ${n}`,lm(t))}case"hour":case"hours":{let n=t==1?"hour":"hours";return new Xe(`In ${t} ${n}`,lc(t))}case"day":case"days":{let n=t==1?"day":"days";return new Xe(`In ${t} ${n}`,H_(t))}case"week":case"weeks":{let n=t==1?"week":"weeks";return new Xe(`In ${t} ${n}`,J_(t))}case"month":case"months":{let n=t==1?"month":"months";return new Xe(`In ${t} ${n}`,j_(t))}case"year":case"years":{let n=t==1?"year":"years";return new Xe(`In ${t} ${n}`,z_(t))}}}else if(r.startsWith("next")){let e=r.substring(5);switch(e){case"sunday":return new Xe("Next Sunday",ki(0));case"monday":return new Xe("Next Monday",ki(1));case"tuesday":return new Xe("Next Tuesday",ki(2));case"wednesday":return new Xe("Next Wednesday",ki(3));case"thursday":return new Xe("Next Thursday",ki(4));case"friday":return new Xe("Next Friday",ki(5));case"saturday":return new Xe("Next Saturday",ki(6));case"day":return new Xe("Tomorrow",uc());case"week":return new Xe("Next week",um());case"month":return new Xe("Next month",K_());case"year":return new Xe("Next year",q_());default:throw`Unsupported weekday: ${e}`}}else if(r==="tomorrow")return new Xe("Tomorrow",uc());throw`Unsupported format: ${r}`}var dc=[new Xe("In 30 minutes",lm(30)),new Xe("In 1 hours",lc(1)),new Xe("In 3 hours",lc(3)),new Xe("Tomorrow",uc()),new Xe("Next week",um())],cc=class{constructor(){m(this,"dateFormat",new ro("YYYY-MM-DD"));m(this,"dateTimeFormat",new ro("YYYY-MM-DD HH:mm"));m(this,"strict",new ro(!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,sr.default)(e,this.dateTimeFormat.value,t);if(n.isValid())return new $(n,!0);let o=(0,sr.default)(e,this.dateFormat.value,t);return o.isValid()?new $(o,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},jr=new cc;var Wa=require("obsidian");var tI=1800*1e3,rI=10*1e3,ws=class{constructor(e){m(this,"deps",e);m(this,"debounceTimer");m(this,"syncing",!1);m(this,"syncQueued",!1);m(this,"stopped",!1);m(this,"previousEnabled")}start(){this.previousEnabled=this.deps.isEnabled(),this.sync(),this.deps.registerInterval(window.setInterval(()=>{this.sync()},tI))}stop(){this.stopped=!0,this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}notifyRemindersChanged(){this.stopped||(this.debounceTimer!==void 0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void 0,this.sync()},rI))}notifySettingsChanged(){this.stopped||(this.checkEnabledTransition(),this.notifyRemindersChanged())}checkEnabledTransition(){let e=this.deps.isEnabled(),t=this.previousEnabled;this.previousEnabled=e,t===!0&&!e&&this.cleanupAfterDisable()}async cleanupAfterDisable(){let e=this.resolveServerAndTopic();if(e===void 0)return;let{serverUrl:t,topic:n}=e;try{let{pending:o}=await this.fetchServerState(t,n),a=sc(o);for(let u of a)await this.deleteScheduled(t,n,u)}catch(o){console.error("[ntfy] Failed to clean up scheduled notifications after disabling: %o",o)}}async sync(){if(this.syncing){this.syncQueued=!0;return}this.syncing=!0;try{await this.doSync()}finally{this.syncing=!1,this.syncQueued&&(this.syncQueued=!1,this.sync())}}async doSync(){if(!this.deps.isEnabled())return;let e=this.resolveServerAndTopic();if(e===void 0)return;let{serverUrl:t,topic:n}=e;try{let{pending:o,delivered:a}=await this.fetchServerState(t,n),u=oc({reminders:this.deps.reminders(),serverPending:o,serverDelivered:a,now:$.now(),defaultTime:this.deps.defaultTime()});for(let c of u.delete)await this.deleteScheduled(t,n,c.sequenceId);for(let c of u.publish)await this.publish(t,n,c)}catch(o){console.error("[ntfy] Failed to sync sche
`)){let c=u.trim();if(c.length===0)continue;let f;try{f=JSON.parse(c)}catch(h){console.error("[ntfy] Failed to parse a poll response line: %o",h);continue}f.event!=="message"&&f.event!=="message_delete"||f.sequence_id===void 0||f.time===void 0||o.push({event:f.event,sequenceId:f.sequence_id,atSeconds:f.time})}let a=Math.floor(Date.now()/1e3);return rc(o,a)}async publish(e,t,n){let o=await(0,Wa.requestUrl)({url:`${e}/`,method:"POST",headers:{"Content-Type":"application/json","X-Sequence-ID":n.sequenceId},body:JSON.stringify({topic:t,title:n.reminder.title,message:tc(n.reminder.file),click:this.buildClickUrl(n.reminder),delay:String(n.atSeconds)}),throw:!1});o.status>=400&&console.error("[ntfy] Failed to publish a scheduled notification: status=%d",o.status)}async deleteScheduled(e,t,n){let o=await(0,Wa.requestUrl)({url:`${e}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,method:"DELETE",throw:!1});o.status>=400&&console.error("[ntfy] Failed to delete a scheduled notification: status=%d",o.status)}buildClickUrl(e){let t=e.file.replace(/\.md$/i,""),n=encodeURIComponent(this.deps.vaultName()),o=encodeURIComponent(t);return`obsidian://open?vault=${n}&file=${o}`}};var vn=require("obsidian");var kp=require("obsidian");var dm=require("obsidian");function fm(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 dm.Notice(`Muted ${n} reminder${n===1?"":"s"}`),!0}var fc=require("obsidian");var mm=require("obsidian");var Za=class extends mm.SuggestModal{constructor(t,n,o,a){super(t);m(this,"laters",n);m(this,"onSelect",o);m(this,"onCloseCallback",a);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)}onClose(){var t;(t=this.onCloseCallback)==null||t.call(this)}};function nI(r,e){let t=e.later();r.data.dndUntil.value=t,r.data.save(!0),r.ui.refreshDndStatusBar(),new fc.Notice(`Reminder notifications paused until ${t.format("YYYY-MM-DD HH:mm")}`)}function Ma(r){r.data.dndUntil.value=null,r.data.save(!0),r.ui.refreshDndStatusBar(),new fc.Notice("Reminder notifications resumed")}function Ya(r,e){new Za(r.app,r.settings.laters.value,t=>{nI(r,t)},e).open()}function pm(r,e){return r||Ya(e),!0}function oo(r,e){return r==null?!1:e.getTimeInMillis()<r.getTimeInMillis()}function hm(r,e){return oo(e.data.dndUntil.value,$.now())?(r||Ma(e),!0):!1}function gm(r,e){return r||e.fileSystem.reloadRemindersInAllFiles(),!0}function bm(r,e){return r||e.showReminderList(),!0}var si=class si{constructor(e,t,n,o,a){m(this,"lineIndex",e);m(this,"prefix",t);m(this,"check",n);m(this,"suffix",o);m(this,"body",a)}static parse(e,t){let n=si.regexp.exec(t);return n?new si(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 si.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 si.parse(this.lineIndex,this.toMarkdown())}};m(si,"regexp",/^(?<prefix>((> ?)*)?\s*[-*+][ ]+\[)(?<check>.)(?<suffix>\]\s+)(?<body>.*)$/),m(si,"checkedStatuses",["x","-"]);var so=si;function vm(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,u=o.groups.content;return`${t}${a} [ ] ${u}`}return`${t}- [ ] ${n}`}var Xa=class Xa{constructor(e,t){m(this,"file",e);m(this,"lines",[]);m(this,"todos",[]);this.parse(t)}parse(e){this.lines=e.split(`
`),this.todos=[];let t=null,n=0;this.lines.forEach((o,a)=>{let u=Xa.fenceRegexp.exec(o),c=u==null?void 0:u.groups.fence,f=u==null?void 0:u.groups.info;if(t===null){if(c!==void 0&&(c[0]!=="`"||!f.includes("`"))){t=c[0],n=c.length;return}}else{c!==void 0&&c[0]===t&&c.length>=n&&f.trim()===""&&(t=null);return}let h=so.parse(a,o);h&&this.todos.push(h)})}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(`
`)}};m(Xa,"fenceRegexp",/^\s*(?:> ?)*\s*(?<fence>`{3,}|~{3,})(?<info>.*)$/);var Fn=Xa;var _m=require("obsidian"),ym=window.require?window.require("electron"):void 0;function Ua(){new _m.Notice('Cannot insert a reminder here. Reminders can only be added to task lines such as "- [ ] Task".')}function Qa(r,e,t,n,o){let a=r.appendReminder(e,t,n);if(a!=null)return a;if(!o)return null;let u=vm(e);if(u==null)return null;let c=n==null?void 0:n+(u.length-e.length);return r.appendReminder(u,t,c)}async function Im(r,e){return ym&&(await ym.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){m(this,"file",e);m(this,"title",t);m(this,"time",n);m(this,"rowNumber",o);m(this,"done",a);m(this,"muteNotification",!1);m(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")}},Va=class{constructor(e){m(this,"onChange",e);m(this,"fileToReminders",new Map);m(this,"reminders",[]);m(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 u=o.get(a.key());o.set(a.key(),a.muteNotification),u!==void 0&&(a.muteNotification=u)}}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,u)=>a.equals(o[u]))}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,u;let o=t.time.getTimeInMillis((a=this.reminderTime)==null?void 0:a.value)-n.time.getTimeInMillis((u=this.reminderTime)==null?void 0:u.value);return o>0?1:o<0?-1:0})}},Cm=[{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 wm(r,e,t,n){let o=$.duration(e,r,"days",t);if(o>30)return new ai(r.format(n.yearMonthFormat,t),a=>a.format(n.monthDayFormat,t));if(o>=7)return new ai("Over 1 week",a=>a.format(n.monthDayFormat,t));if(r.toYYYYMMDD(t)===e.toYYYYMMDD(t)){let a=new ai("Today",u=>u.format(n.timeFormat,t));return a.isToday=!
`).map(gI).filter(function(t){return t!==null});return St(St({},e[0]),e[1])}function Es(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=Ss(o),e}function gI(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Vm(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Vm(r);case"DTSTART":return Es(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Vm(r){var e=r.replace(/^RRULE:/i,""),t=Es(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(o){var a=o.split("="),u=a[0],c=a[1];switch(u.toUpperCase()){case"FREQ":t.freq=ue[c.toUpperCase()];break;case"WKST":t.wkst=xr[c.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var f=bI(c),h=u.toLowerCase();t[h]=f;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=vI(c);break;case"DTSTART":case"TZID":var b=Es(r);t.tzid=b.tzid,t.dtstart=b.dtstart;break;case"UNTIL":t.until=Ss(c);break;case"BYEASTER":t.byeaster=Number(c);break;default:throw new Error("Unknown RRULE property '"+u+"'")}}),t}function bI(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Lm)}return Lm(r)}function Lm(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function vI(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],u=xr[a].weekday;return new nt(u,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:Dm(this.date,this.tzid)},r})();function Bs(r){for(var e=[],t="",n=Object.keys(r),o=Object.keys(Ts),a=0;a<n.length;a++)if(n[a]!=="tzid"&&be(o,n[a])){var u=n[a].toUpperCase(),c=r[n[a]],f="";if(!(!Ne(c)||kt(c)&&!c.length)){switch(u){case"FREQ":f=U.FREQUENCIES[r.freq];break;case"WKST":ar(c)?f=new nt(c).toString():f=c.toString();break;case"BYWEEKDAY":u="BYDAY",f=Fm(c).map(function(v){return v instanceof nt?v:kt(v)?new nt(v[0],v[1]):new nt(v)}).toString();break;case"DTSTART":t=yI(c,r.tzid);break;case"UNTIL":f=uo(c,!r.tzid);break;default:if(kt(c)){for(var h=[],b=0;b<c.length;b++)h[b]=String(c[b]);f=h.toString()}else f=String(c)}f&&e.push([u,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 yI(r,e){return r?"DTSTART"+new Ti(new Date(r),e).toString():""}function _I(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 Om=(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?Ja(t):bc(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(!_I(t[g],b[g]))return!0}return!1},u=this[e];if(e==="all")n=this.all;else if(kt(u))for(var c=0;c<u.length;c++){var f=u[c];if(!(o.length&&a(f))){n=f._value;break}}if(!n&&this.all){for(var h=new Gn(e,t),c=0;c<this.all.length&&h.accept(this.all[c]);c++);n=h.getValue(),this._cacheAdd(e,n,t)}return kt(n)?bc(n):n instanceof Date?Ja(n):n},r})();var $m=D(D(D(D(D(D(D(D(D(D(D(D(D([],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),Pm=D(D(D(D(D(D(D(D(D(D(D(D(D([],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),II=Cr(1,29),wI=Cr(1,30),ui=Cr(1,31),Zt=Cr(1,32),Hm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Zt,!0),wI,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt.slice(0,7),!0),Jm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Zt,!0),II,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt.slice(0,7),!0),CI=Cr(-28,0),xI=Cr(-29,0),ci=Cr(-30,0),Mt=Cr(-31,0),jm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Mt,!0),xI,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt.slice(0,7),!0),zm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Mt,!0),CI,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt.slice(0,7),!0),Km=[0,31,60,91,121,152,182,213,244,274,305,335,366],qm=[0,31,59,90,120,151,181,212,243,273,304,334,365],Ic=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(Cr(7));return r})();function ep(r,e){var t=zr(r,1,1),n=lo(r)?366:365,o=lo(r+1)?366:365,a=ks(t),u=Tn(t),c=St(St({yearlen:n,nextyearlen:o,yearordinal:a,yearweekday:u},AI(r)),{wnomask:null});if(lr(e.byweekno))return c;c.wnomask=me(0,n+7);var f,h,b=f=Wt(7-u+e.wkst,7);b>=4?(b=0,h=c.yearlen+Wt(u-e.wkst,7)):h=n-b;for(var I=Math.floor(h/7),g=Wt(h,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&&(c.wnomask[x]=1,x++,c.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&&(c.wnomask[x]=1,x+=1,c.wdaymask[x]!==e.wkst);y++);}if(b){var B=void 0;if(be(e.byweekno,-1))B=-1;else{var F=Tn(zr(r-1,1,1)),P=Wt(7-F.valueOf()+e.wkst,7),ie=lo(r-1)?366:365,Y=void 0;P>=4?(P=0,Y=ie+Wt(F-e.wkst,7)):Y=n-b,B=Math.floor(52+Wt(Y,7)/4)}if(be(e.byweekno,B))for(var x=0;x<b;x++)c.wnomask[x]=1}return c}function AI(r){var e=lo(r)?366:365,t=zr(r,1,1),n=Tn(t);return e===365?{mmask:$m,mdaymask:Jm,nmdaymask:zm,wdaymask:Ic.slice(n),mrange:qm}:{mmask:Pm,mdaymask:Hm,nmdaymask:jm,wdaymask:Ic.slice(n),mrange:Km}}function tp(r,e,t,n,o,a){var u={lastyear:r,lastmonth:e,nwdaymask:[]},c=[];if(a.freq===U.YEARLY)if(lr(a.bymonth))c=[[0,t]];else for(var f=0;f<a.bymonth.length;f++)e=a.bymonth[f],c.push(n.slice(e-1,e+1));else a.freq===U.MONTHLY&&(c=[n.slice(e-1,e+1)]);if(lr(c))return u;u.nwdaymask=me(0,t);for(var f=0;f<c.length;f++)for(var h=c[f],b=h[0],I=h[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&&(u.nwdaymask[v]=1)}return u}function rp(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),o=r%100,a=Math.floor(n/4),u=n%4,c=Math.floor((n+8)/25),f=Math.floor((n-c+1)/3),h=Math.floor(19*t+n-a-f+15)%30,b=Math.floor(o/4),I=o%4,g=Math.floor(32+2*u+2*b-h-I)%7,v=Math.floor((t+11
`),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 WI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function lp(r,e){return WI(e),r.split(",").map(function(t){return Ss(t)})}function up(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 Cc=(function(r){co(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=up.apply(n,["dtstart"]),n.tzid=up.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return sp(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){cp(t,this._rrule)},e.prototype.exrule=function(t){cp(t,this._exrule)},e.prototype.rdate=function(t){dp(t,this._rdate)},e.prototype.exdate=function(t){dp(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return za(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return za(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(Bs({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
2026-07-23 20:36:13 +08:00
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
2026-08-24 09:42:59 +08:00
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&t.push(fp("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(fp("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 cp(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 dp(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");be(e.map(Number),Number(r))||(e.push(r),En(e))}function fp(r,e,t){var n=!t||t.toUpperCase()==="UTC",o=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(u){return uo(u.valueOf(),n)}).join(",");return"".concat(o).concat(a)}function po(r,e,t){let n;try{n=U.parseText(r)}catch(h){console.warn("Failed to parse recurrence text: recurrence=%s, error=%o",r,h);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 c=new U(n).after(e.toDate(),!1);if(c==null)return;let f=c.getTime()-n.dtstart.getTime();return a.add(f,"millisecond"),a.toDate()}function qa(r){return r.replace(/#[\p{L}\p{N}\p{M}_/-]+/gu,"").trim()}var ho=class extends li{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 u=t.clone(),c=n.clone(),f=n.getDueDate(),h=this.config.getParameter(Qe.now);if(this.usesSeparateReminderDate(n)){let b=n.getTime();if(b==null)return!1;let I=po(a,b.moment(),h);if(I==null)return!1;if(c.setTime(new $((0,Ka.default)(I),b.hasTimePart)),f!=null){let g=po(a,f.moment(),h);if(g==null)return!1;c.setDueDate(new $((0,Ka.default)(g),f.hasTimePart))}}else{if(f==null)return!1;let b=po(a,f.moment(),h);if(b==null)return!1;let I=new $((0,Ka.default)(b),f.hasTimePart);c.setTime(I)}u.body=c.toMarkdown(),u.setChecked(!1),e.insertTodo(t.lineIndex,u)}n.setDoneDate(this.config.getParameter(Qe.now))}else n.setDoneDate(void 0);return!0}};var ZI=["YYYY-MM-DDTHH:mm","YYYY-MM-DD HH:mm"],kc="YYYY-MM-DD";function xc(r){for(let t of ZI){let n=(0,Ac.default)(r,t,!0);if(n.isValid())return new $(n,!0)}let e=(0,Ac.default)(r,kc,!0);return e.isValid()?new $(e,!1):null}function mp(r){return r.hasTimePart?r.format("YYYY-MM-DDTHH:mm"):r.format(kc)}var Ei="due",el="completion",pp="repeat",MI="scheduled",YI="start",XI=[Ei,el,pp,MI,YI],tl=class r{constructor(e,t,n){m(this,"text",e);m(this,"reminderFieldName",t);m(this,"removeTags",n)}static parse(e,t,n){return new r(e,t.toLowerCase(),n!=null?n:!1)}fields(){return km(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(Ei)!=null}reminderSourceField(){var e;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Ei)}getTitle(){let e=new Set([...XI,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=mc(n,o);return n=n.trim(),this.removeTags&&(n=qa(n)),n}getTime(){let e=this.reminderSourceField();return e==null?null:xc(e.value)}setTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Ei;this.setFieldValue(n,mp(e))}setRawTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Ei;return this.setFieldValue(n,e),!0}getDueDate(){let e=this.firstField(Ei);return e==null?null:xc(e.value)}setDueDate(e){this.setFieldValue(Ei,mp(e))}getRecurrence(){var t;let e=this.firstField(pp);return(t=e==null?void 0:e.value)!=null?t:null}getDoneDate(){let e=this.firstField(el);return e==null?null:xc(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(el);return}let t=e instanceof $?e.f
[${o}]`);for(let u of a)t.push(String(u));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 en="reminder-list";var LI=10*1e3,vl=class{constructor(e){m(this,"plugin",e);m(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",()=>{Ma(this.plugin)}),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),LI)),this.refresh()}refresh(){if(!this.el)return;let e=this.plugin.data.dndUntil.value;if(!oo(e,$.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()===$.now().toYYYYMMDD())return n;let o=this.plugin.settings.monthDayDisplayFormat.value;return`${e.format(o)} ${n}`}};var yl=class{constructor(e){m(this,"plugin",e);m(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 lu=require("obsidian");var dt=Symbol("$state"),Ns=Symbol("legacy props"),Ep=Symbol(""),_l=Symbol("proxy path"),Il=Symbol("attributes"),Ws=Symbol("class"),Bc=Symbol("style"),Zs=Symbol("text"),di=Symbol("form reset"),Dc=Symbol("hmr anchor"),Nn=new class extends Error{constructor(){super(...arguments);m(this,"name","StaleReactionError");m(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Tp,Nc=!!((Tp=globalThis.document)!=null&&Tp.contentType)&&globalThis.document.contentType.includes("xml");var Io=3,Ar=8;var Bp,Dp,Gp=(Dp=(Bp=globalThis.process)==null?void 0:Bp.env)==null?void 0:Dp.NODE_ENV,R=Gp&&!Gp.toLowerCase().startsWith("prod");var kr=Array.isArray,Np=Array.prototype.indexOf,fi=Array.prototype.includes,wo=Array.from,Wc=Object.keys,Rt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,wl=Object.getOwnPropertyDescriptors,Zc=Object.prototype,Wp=Array.prototype,Gi=Object.getPrototypeOf,Mc=Object.isExtensible;var tn=()=>{};function Zp(r){return r()}function Co(r){for(var e=0;e<r.length;e++)r[e]()}function Cl(){var r,e,t=new Promise((n,o)=>{r=n,e=o});return{promise:t,resolve:r,reject:e}}function xl(r){return r===this.v}function Yc(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function Al(r){return!Yc(r,this.v)}function Mp(r){if(R){let e=new Error(`invariant_violation
2026-07-23 20:36:13 +08:00
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}"
2026-08-02 09:03:32 +08:00
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(R){let e=new Error(`lifecycle_outside_component
2026-07-23 20:36:13 +08:00
\`${r}(...)\` can only be used during component initialisation
2026-08-24 09:42:59 +08:00
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(R){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 Xc(){if(R){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 Up(){if(R){let r=new Error(`derived_references_self
2026-07-23 20:36:13 +08:00
A derived value cannot reference itself recursively
2026-08-24 09:42:59 +08:00
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 Uc(r,e,t){if(R){let n=new Error(`each_key_duplicate
2026-07-23 20:36:13 +08:00
${t?`Keyed each block has duplicate key \`${t}\` at indexes ${r} and ${e}`:`Keyed each block has duplicate key at indexes ${r} and ${e}`}
2026-08-24 09:42:59 +08:00
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 Qp(r,e,t){if(R){let n=new Error(`each_key_volatile
2026-07-23 20:36:13 +08:00
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
2026-08-24 09:42:59 +08:00
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 Vp(r){if(R){let e=new Error(`effect_in_teardown
2026-07-23 20:36:13 +08:00
\`${r}\` cannot be used inside an effect cleanup function
2026-08-24 09:42:59 +08:00
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 Lp(){if(R){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 Op(r){if(R){let e=new Error(`effect_orphan
2026-07-23 20:36:13 +08:00
\`${r}\` can only be used inside an effect (e.g. during component initialisation)
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function $p(){if(R){let r=new Error(`effect_update_depth_exceeded
2026-07-23 20:36:13 +08:00
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
2026-08-24 09:42:59 +08:00
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 Pp(){if(R){let r=new Error(`hydration_failed
2026-07-23 20:36:13 +08:00
Failed to hydrate the application
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/hydration_failed`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/hydration_failed")}function Hp(r){if(R){let e=new Error(`lifecycle_legacy_only
2026-07-23 20:36:13 +08:00
\`${r}(...)\` cannot be used in runes mode
2026-08-24 09:42:59 +08:00
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 Jp(r){if(R){let e=new Error(`props_invalid_value
2026-07-23 20:36:13 +08:00
Cannot do \`bind:${r}={undefined}\` when \`${r}\` has a fallback value
2026-08-24 09:42:59 +08:00
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 jp(r){if(R){let e=new Error(`rune_outside_svelte
2026-07-23 20:36:13 +08:00
The \`${r}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
2026-08-24 09:42:59 +08:00
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 zp(){if(R){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 Kp(){if(R){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 qp(){if(R){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 eh(){if(R){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 it=!1,rn=!1,Mr=!1;function th(){rn=!0}var Wn={};var Be=Symbol("uninitialized"),Sr=Symbol("filename");var kl="http://www.w3.org/1999/xhtml";var Ms=null;function Yt(r,e){return r.label=e,Rl(r.v,e),r}function Rl(r,e){var t;return(t=r==null?void 0:r[_l])==null||t.call(r,e),r}function Yr(r){let e=new Error,t=$I();return t.length===0?null:(t.unshift(`
2026-07-23 20:36:13 +08:00
`),Rt(e,"stack",{value:t.join(`
2026-08-24 09:42:59 +08:00
`)}),Rt(e,"name",{value:r}),e)}function $I(){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],u=a.replaceAll("\\","/");if(a.trim()!=="Error"){if(a.includes("validate_each_keys"))return[];u.includes("svelte/src/internal")||u.includes("node_modules/.vite")||n.push(a)}}return n}function nh(r,e){if(!R)throw new Error("invariant(...) was not guarded by if (DEV)");r||Mp(e)}var q=null;function Zn(r){q=r}var nn=null;function Ao(r){nn=r}var Xr=null;function Fl(r){Xr=r}function Ke(r,e=!1,t){q={p:q,i:!1,c:null,e:null,s:r,x:null,r:M,l:rn&&!e?{s:null,u:null,$:[]}:null},R&&(q.function=t,Xr=t)}function qe(r){var o;var e=q,t=e.e;if(t!==null){e.e=null;for(var n of t)Qc(n)}return r!==void 0&&(e.x=r),e.i=!0,q=e.p,R&&(Xr=(o=q==null?void 0:q.function)!=null?o:null),r!=null?r:{}}function on(){return!rn||q!==null&&q.l===null}var Bi=[];function ih(){var r=Bi;Bi=[],Co(r)}function et(r){if(Bi.length===0&&!Di){var e=Bi;queueMicrotask(()=>{e===Bi&&ih()})}Bi.push(r)}function oh(){for(;Bi.length>0;)ih()}var sn="font-weight: bold",an="font-weight: normal";function sh(r){R?console.warn(`%c[svelte] await_reactivity_loss
2026-07-23 20:36:13 +08:00
%cDetected reactivity loss when reading \`${r}\`. This happens when state is read in an async function after an earlier \`await\`
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/await_reactivity_loss`,sn,an):console.warn("https://svelte.dev/e/await_reactivity_loss")}function ah(r,e){R?console.warn(`%c[svelte] await_waterfall
2026-07-23 20:36:13 +08:00
%cAn async derived, \`${r}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/await_waterfall`,sn,an):console.warn("https://svelte.dev/e/await_waterfall")}function lh(){R?console.warn(`%c[svelte] derived_inert
2026-07-23 20:36:13 +08:00
%cReading a derived belonging to a now-destroyed effect may result in stale values
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/derived_inert`,sn,an):console.warn("https://svelte.dev/e/derived_inert")}function uh(r,e,t){R?console.warn(`%c[svelte] hydration_attribute_changed
2026-07-23 20:36:13 +08:00
%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
2026-08-02 09:03:32 +08:00
https://svelte.dev/e/hydration_attribute_changed`,sn,an):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ni(r){R?console.warn(`%c[svelte] hydration_mismatch
2026-07-23 20:36:13 +08:00
%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"}
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/hydration_mismatch`,sn,an):console.warn("https://svelte.dev/e/hydration_mismatch")}function ch(){R?console.warn(`%c[svelte] lifecycle_double_unmount
2026-07-23 20:36:13 +08:00
%cTried to unmount a component that was not mounted
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/lifecycle_double_unmount`,sn,an):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function dh(){R?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",sn,an):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Tl(r){R?console.warn(`%c[svelte] state_proxy_equality_mismatch
2026-07-23 20:36:13 +08:00
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${r}\` will produce unexpected results
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/state_proxy_equality_mismatch`,sn,an):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function fh(){R?console.warn(`%c[svelte] state_proxy_unmount
2026-07-23 20:36:13 +08:00
%cTried to unmount a state proxy, rather than a component
2026-08-24 09:42:59 +08:00
https://svelte.dev/e/state_proxy_unmount`,sn,an):console.warn("https://svelte.dev/e/state_proxy_unmount")}function mh(){R?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",sn,an):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var L=!1;function ft(r){L=r}var ne;function Fe(r){if(r===null)throw Ni(),Wn;return ne=r}function Et(){return Fe(Gt(ne))}function X(r){if(L){if(Gt(ne)!==null)throw Ni(),Wn;ne=r}}function Ro(r=1){if(L){for(var e=r,t=ne;e--;)t=Gt(t);ne=t}}function ln(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=Gt(t);r&&t.remove(),t=o}}function Xs(r){if(!r||r.nodeType!==Ar)throw Ni(),Wn;return r.data}var PI=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Mn(r){if(typeof r!="object"||r===null||dt in r)return r;let e=Gi(r);if(e!==Zc&&e!==Wp)return r;var t=new Map,n=kr(r),o=un(0),a=R&&Mr?Yr("created at"):null,u=pi,c=I=>{if(pi===u)return I();var g=H,v=pi;mt(null),Vc(u);var y=I();return mt(g),Vc(v),y};n&&(t.set("length",un(r.length,a)),R&&(r=JI(r)));var f="";let h=!1;function b(I){if(!h){h=!0,f=I,Yt(o,`${f} version`);for(let[g,v]of t)Yt(v,Wi(f,g));h=!1}}return new Proxy(r,{defineProperty(I,g,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&zp();var y=t.get(g);return y===void 0?c(()=>{var w=un(v.value,a);return t.set(g,w),R&&typeof g=="string"&&Yt(w,Wi(f,g)),w}):K(y,v.value,!0),!0},deleteProperty(I,g){var v=t.get(g);if(v===void 0){if(g in I){let y=c(()=>un(Be,a));t.set(g,y),Zi(o),R&&Yt(y,Wi(f,g))}}else K(v,Be),Zi(o);return!0},get(I,g,v){var k;if(g===dt)return r;if(R&&g===_l)return b;var y=t.get(g),w=g in I;if(y===void 0&&(!w||(k=$t(I,g))!=null&&k.writable)&&(y=c(()=>{var B=Mn(w?I[g]:Be),F=un(B,a);return R&&Yt(F,Wi(f,g)),F}),t.set(g,y)),y!==void 0){var x=A(y);return x===Be?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!==Be)return{enumerable:!0,configurable:!0,value:x,writable:!0}}return v},has(I,g){var x;if(g===dt)return!0;var v=t.get(g),y=v!==void 0&&v.v!==Be||Reflect.has(I,g);if(v!==void 0||M!==null&&(!y||(x=$t(I,g))!=null&&x.writable)){v===void 0&&(v=c(()=>{var k=y?Mn(I[g]):Be,B=un(k,a);return R&&Yt(B,Wi(f,g)),B}),t.set(g,v));var w=A(v);if(w===Be)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 B=t.get(k+"");B!==void 0?K(B,Be):k in I&&(B=c(()=>un(Be,a)),t.set(k+"",B),R&&Yt(B,Wi(f,k)))}if(w===void 0)(!x||(pe=$t(I,g))!=null&&pe.writable)&&(w=c(()=>un(void 0,a)),R&&Yt(w,Wi(f,g)),K(w,Mn(v)),t.set(g,w));else{x=w.v!==Be;var F=c(()=>Mn(v));K(w,F)}var P=Reflect.getOwnPropertyDescriptor(I,g);if(P!=null&&P.set&&P.set.call(y,v),!x){if(n&&typeof g=="string"){var ie=t.get("length"),Y=Number(g);Number.isInteger(Y)&&Y>=ie.v&&K(ie,Y+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!==Be});for(var[v,y]of t)y.v!==Be&&!(v in I)&&g.push(v);return g},setPrototypeOf(){Kp()}})}function Wi(r,e){var t;return typeof e=="symbol"?`${r}[Symbol(${(t=e.description)!=null?t:""})]`:PI.test(e)?`${r}.${e}`:/^\d+$/.test(e)?`${r}[${e}]`:`${r}['${e}']`}function Fo(r){try{if(r!==null&&typeof r=="object"&&dt in r)return r[dt]}catch(e){}return r}function Lc(r,e){return Object.is(Fo(r),Fo(e))}var HI=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function JI(r){return new Proxy(r,{get(e,t,n){var o=Reflect.get(e,t,n);return HI.has(t)?function(...a){ph();var u=o.apply(this,a);return El(),u}:o}})}function hh(){let r=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:t,lastIndexOf:n,includes:o}=r;r.indexOf=function(a,u){let c=t.call(this,a,u);if(c===-1){for(let f=u!=null?u:0;f<this.length;f+=1)if(Fo(this[f])===a
${n}in ${((u=e.fn)==null?void 0:u.name)||"<unknown>"}`,a=e.ctx;a!==null;)o+=`
${n}in ${(c=a.function)==null?void 0:c[Sr].split("/").pop()}`,a=a.p;return{message:r.message+`
2026-07-23 20:36:13 +08:00
${o}
`,stack:(f=r.stack)==null?void 0:f.split(`
2026-08-02 09:03:32 +08:00
`).filter(h=>!h.includes("svelte/src/internal")).join(`
2026-08-24 09:42:59 +08:00
`)}}}function yh(r){let e=Oc.get(r);e&&(Rt(r,"message",{value:e.message}),Rt(r,"stack",{value:e.stack}))}var zI=-7169;function Ae(r,e){r.f=r.f&zI|e}function Eo(r){(r.f&512)!==0||r.deps===null?Ae(r,1024):Ae(r,4096)}function _h(r){if(r!==null)for(let e of r)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,_h(e.deps))}function Wl(r,e,t){(r.f&2048)!==0?e.add(r):(r.f&4096)!==0&&t.add(r),_h(r.deps),Ae(r,1024)}var Ih=!1,Zl=!1;function $c(r){var e=Zl;try{return Zl=!1,[r(),Zl]}finally{Zl=e}}var wh=!1;function Ml(){wh||(wh=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(let t of r.target.elements)(e=t[di])==null||e.call(t)})},{capture:!0}))}function Tr(r){var e=H,t=M;mt(null),tt(null);try{return r()}finally{mt(e),tt(t)}}function Yl(r,e,t,n=t){r.addEventListener(e,()=>Tr(t));let o=r[di];o?r[di]=()=>{o(),n(!0)}:r[di]=()=>n(!0),Ml()}function Ch(r){let e=0,t=Vt(0),n;return R&&Yt(t,"createSubscriber version"),()=>{mi()&&(A(t),gt(()=>(e===0&&(n=V(()=>r(()=>Zi(t)))),e+=1,()=>{et(()=>{e-=1,e===0&&(n==null||n(),n=void 0,Zi(t))})})))}}var qI=589824;function Kc(r,e,t,n){new Pc(r,e,t,n)}var ur,Os,Er,Mi,nr,Gr,Pt,cr,Un,Yi,gi,Bo,$s,Ps,cn,Ql,Ee,Ah,kh,Hc,Sh,Jc,Xl,Ul,jc,zc,Pc=class{constructor(e,t,n,o){ee(this,Ee);m(this,"parent");m(this,"is_pending",!1);m(this,"transform_error");ee(this,ur);ee(this,Os,L?ne:null);ee(this,Er);ee(this,Mi);ee(this,nr);ee(this,Gr,null);ee(this,Pt,null);ee(this,cr,null);ee(this,Un,null);ee(this,Yi,0);ee(this,gi,0);ee(this,Bo,!1);ee(this,$s,new Set);ee(this,Ps,new Set);ee(this,cn,null);ee(this,Ql,Ch(()=>(z(this,cn,Vt(C(this,Yi))),R&&Yt(C(this,cn),"$effect.pending()"),()=>{z(this,cn,null)})));var a,u;z(this,ur,e),z(this,Er,t),z(this,Mi,c=>{var f=M;f.b=this,f.f|=128,n(c)}),this.parent=M.b,this.transform_error=(u=o!=null?o:(a=this.parent)==null?void 0:a.transform_error)!=null?u:(c=>c),z(this,nr,mr(()=>{if(L){let c=C(this,Os);Et();let f=c.data==="[!";if(c.data.startsWith("[?")){let b=JSON.parse(c.data.slice("[?".length));ae(this,Ee,kh).call(this,b)}else f?ae(this,Ee,Sh).call(this):ae(this,Ee,Ah).call(this)}else ae(this,Ee,Jc).call(this)},qI)),L&&z(this,ur,ne)}defer_effect(e){Wl(e,C(this,$s),C(this,Ps))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!C(this,Er).pending}update_pending_count(e,t){ae(this,Ee,jc).call(this,e,t),z(this,Yi,C(this,Yi)+e),!(!C(this,cn)||C(this,Bo))&&(z(this,Bo,!0),et(()=>{z(this,Bo,!1),C(this,cn)&&Vr(C(this,cn),C(this,Yi))}))}get_effect_pending(){return C(this,Ql).call(this),A(C(this,cn))}error(e){var t;if(!C(this,Er).onerror&&!C(this,Er).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(()=>{ae(this,Ee,zc).call(this,e)})):ae(this,Ee,zc).call(this,e)}};ur=new WeakMap,Os=new WeakMap,Er=new WeakMap,Mi=new WeakMap,nr=new WeakMap,Gr=new WeakMap,Pt=new WeakMap,cr=new WeakMap,Un=new WeakMap,Yi=new WeakMap,gi=new WeakMap,Bo=new WeakMap,$s=new WeakMap,Ps=new WeakMap,cn=new WeakMap,Ql=new WeakMap,Ee=new WeakSet,Ah=function(){try{z(this,Gr,bt(()=>C(this,Mi).call(this,C(this,ur))))}catch(e){this.error(e)}},kh=function(e){let t=C(this,Er).failed,{reset:n,invoke_onerror:o}=ae(this,Ee,Hc).call(this,e);et(o),t&&z(this,cr,bt(()=>{t(C(this,ur),()=>e,()=>n)}))},Hc=function(e){var t=!1,n=!1;let o=()=>{if(t){mh();return}t=!0,n&&eh(),C(this,cr)!==null&&dn(C(this,cr),()=>{z(this,cr,null)}),ae(this,Ee,Ul).call(this,()=>{ae(this,Ee,Jc).call(this)})};return{reset:o,invoke_onerror:()=>{var u,c;try{n=!0,(c=(u=C(this,Er)).onerror)==null||c.call(u,e,o),n=!1}catch(f){Qr(f,C(this,nr)&&C(this,nr).parent)}}}},Sh=function(){let e=C(this,Er).pending;e&&(this.is_pending=!0,z(this,Pt,bt(()=>e(C(this,ur)))),et(()=>{var t=z(this,Un,document.createDocumentFragment()),n=wt();t.append(n),z(this,Gr,ae(this,Ee,Ul).call(this,()=>bt(()=>C(this,Mi).call(this,n)))),C(this,gi)===0&&(C(this,ur).before(t),z(this,Un,null),dn(C(this,Pt),()=>{z(this,Pt,null)}),ae(this,Ee,Xl).call(this,O))}))},Jc=function(){try{if(this.is_pending=this
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw c;return c!==Wn&&console.warn("Failed to hydrate: ",c),e.recover===!1&&Pp(),Gl(),Vs(t),ft(!1),ql(r,e)}finally{ft(n),Fe(o)}}var Kl=new Map;function ag(r,{target:e,anchor:t,props:n={},events:o,context:a,intro:u=!0,transformError:c}){Gl();var f=void 0,h=zh(()=>{var b=t!=null?t:e.appendChild(wt());Kc(b,{pending:()=>{}},v=>{Ke({});var y=q;if(a&&(y.c=a),o&&(n.$$events=o),L&&zn(v,null),Cd=u,f=r(v,n)||{},Cd=!0,L&&(M.nodes.end=ne,ne===null||ne.nodeType!==Ar||ne.data!=="]"))throw Ni(),Wn;qe()},c);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=sg(w);for(let F of[e,document]){var k=Kl.get(F);k===void 0&&(k=new Map,Kl.set(F,k));var B=k.get(w);B===void 0?(F.addEventListener(w,zl,{passive:x}),k.set(w,1)):k.set(w,B+1)}}}};return g(wo(rg)),yd.add(g),()=>{var x;for(var v of I)for(let k of[e,document]){var y=Kl.get(k),w=y.get(v);--w==0?(k.removeEventListener(v,zl),y.delete(v),y.size===0&&Kl.delete(k)):y.set(v,w)}yd.delete(g),b!==t&&((x=b.parentNode)==null||x.removeChild(b))}});return xd.set(f,h),f}var xd=new WeakMap;function kd(r,e){let t=xd.get(r);return t?(xd.delete(r),t(e)):(R&&(dt in r?fh():ch()),Promise.resolve())}function eu(r){return function(...e){var t=e[0];return t.stopPropagation(),r==null?void 0:r.apply(this,e)}}function tu(r){return function(...e){var t=e[0];return t.preventDefault(),r==null?void 0:r.apply(this,e)}}function lt(r){return new Sd(r)}var Kn,Br,Sd=class{constructor(e){ee(this,Kn);ee(this,Br);var a,u;var t=new Map,n=(c,f)=>{var h=xe(f,!1,!1);return t.set(c,h),h};let o=new Proxy({...e.props||{},$$events:{}},{get(c,f){var h;return A((h=t.get(f))!=null?h:n(f,Reflect.get(c,f)))},has(c,f){var h;return f===Ns?!0:(A((h=t.get(f))!=null?h:n(f,Reflect.get(c,f))),Reflect.has(c,f))},set(c,f,h){var b;return K((b=t.get(f))!=null?b:n(f,h),h),Reflect.set(c,f,h)}});z(this,Br,(e.hydrate?Ad:ql)(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})),!it&&(!((u=e==null?void 0:e.props)!=null&&u.$$host)||e.sync===!1)&&j(),z(this,Kn,o.$$events);for(let c of Object.keys(C(this,Br)))c==="$set"||c==="$destroy"||c==="$on"||Rt(this,c,{get(){return C(this,Br)[c]},set(f){C(this,Br)[c]=f},enumerable:!0});C(this,Br).$set=c=>{Object.assign(o,c)},C(this,Br).$destroy=()=>{kd(C(this,Br))}}$set(e){C(this,Br).$set(e)}$on(e,t){C(this,Kn)[e]=C(this,Kn)[e]||[];let n=(...o)=>t.call(this,...o);return C(this,Kn)[e].push(n),()=>{C(this,Kn)[e]=C(this,Kn)[e].filter(o=>o!==n)}}$destroy(){C(this,Br).$destroy()}};Kn=new WeakMap,Br=new WeakMap;var lg,ug,cg;typeof window!="undefined"&&((cg=(ug=(lg=window.__svelte)!=null?lg:window.__svelte={}).v)!=null?cg:ug.v=new Set).add("5");th();var Pr,pn,vr,Oi,oa,sa,ru,qn=class{constructor(e,t=!0){m(this,"anchor");ee(this,Pr,new Map);ee(this,pn,new Map);ee(this,vr,new Map);ee(this,Oi,new Set);ee(this,oa,!0);ee(this,sa,e=>{if(C(this,Pr).has(e)){var t=C(this,Pr).get(e),n=C(this,pn).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,pn).set(t,o.effect),C(this,vr).delete(t),R&&(o.fragment.lastChild[Dc]=this.anchor),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(let[a,u]of C(this,Pr)){if(C(this,Pr).delete(a),a===e)break;let c=C(this,vr).get(u);c&&(Oe(c.effect),C(this,vr).delete(u))}for(let[a,u]of C(this,pn)){if(a===t||C(this,Oi).has(a))continue;let c=()=>{if(Array.from(C(this,Pr).values()).includes(a)){var h=document.createDocumentFragment();Do(u,h),h.append(wt()),C(this,vr).set(a,{effect:u,fragment:h})}else Oe(u);C(this,Oi).delete(a),C(this,pn).delete(a)};C(this,oa)||!n?(C(this,Oi).add(a),dn(u,c,!1)):c()}}});ee(this,ru,e=>{C(this,Pr).delete(e);let t=Array.from(C(this,Pr).values());for(let[n,o]of C(this,vr))t.includes(n)||(Oe(o.effect),C(this,vr).delete(n))});this.anchor=e,z(this,oa,t)}ensure(e,t){var n=O,o=Bl();if(t&&!C(this,pn).has(e)&&!C(this,vr).has(e))if(o){var a=document.createDocumentFragment(),u=wt();a.append(u),C(this,vr).set(e,{effect:bt(()=>t(u)),fragment:a})}els
\r\f\xA0\v\uFEFF`];function bg(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,u=0;(u=n.indexOf(o,u))>=0;){var c=u+a;(u===0||gg.includes(n[u-1]))&&(c===n.length||gg.includes(n[c]))?n=(u===0?"":n.substring(0,u))+n.substring(c+1):u=c}}return n===""?null:n}function bn(r,e,t,n,o,a){var u=r[Ws];if(L||u!==t||u===void 0){var c=bg(t,n,a);(!L||c!==r.getAttribute("class"))&&(c==null?r.removeAttribute("class"):e?r.className=c:r.setAttribute("class",c)),r[Ws]=t}else if(a&&o!==a)for(var f in a){var h=!!a[f];(o==null||h!==!!o[f])&&r.classList.toggle(f,h)}return a}function nu(r,e,t=!1){if(r.multiple){if(e==null)return;if(!kr(e))return dh();for(var n of r.options)n.selected=e.includes(ua(n));return}for(n of r.options){var o=ua(n);if(Lc(o,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Ed(r){var e=new MutationObserver(()=>{"__value"in r&&nu(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),pt(()=>{e.disconnect()})}function ca(r,e,t=e){var n=new WeakSet,o=!0;Yl(r,"change",a=>{var h;var u=a?"[selected]":":checked",c;if(r.multiple)c=[].map.call(r.querySelectorAll(u),ua);else{var f=(h=r.querySelector(u))!=null?h:r.querySelector("option:not([disabled])");c=f&&ua(f)}t(c),r.__value=c,O!==null&&n.add(O)}),br(()=>{var a=e();if(r===document.activeElement){var u=it?fn:O;if(n.has(u))return}if(nu(r,a,o),o&&a===void 0){var c=r.querySelector(":checked");c!==null&&(a=ua(c),t(a))}r.__value=a,o=!1}),Ed(r)}function ua(r){return"__value"in r?r.__value:r.value}var Qw=Symbol("is custom element"),Vw=Symbol("is html"),Lw=Nc?"link":"LINK";function Bd(r){if(L){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;Hr(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var o=r.checked;Hr(r,"checked",null),r.checked=o}}};r[di]=t,et(t),Ml()}}function Dd(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Hr(r,e,t,n){var o=Ow(r);if(L&&(o[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Lw)){n||Pw(r,e,t!=null?t:"");return}o[e]!==(o[e]=t)&&(e==="loading"&&(r[Ep]=t),t==null?r.removeAttribute(e):typeof t!="string"&&$w(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function Ow(r){var e,t;return(t=r[e=Il])!=null?t:r[e]={[Qw]:r.nodeName.includes("-"),[Vw]:r.namespaceURI===kl}}var vg=new Map;function $w(r){var e=r.getAttribute("is")||r.nodeName,t=vg.get(e);if(t)return t;vg.set(e,t=[]);for(var n,o=r,a=Element.prototype;a!==o;){n=wl(o);for(var u in n)n[u].set&&u!=="innerHTML"&&u!=="textContent"&&u!=="innerText"&&t.push(u);o=Gi(o)}return t}function Pw(r,e,t){var n;R&&(e==="srcset"&&Hw(r,t)||Gd((n=r.getAttribute(e))!=null?n:"",t)||uh(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function Gd(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function yg(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Hw(r,e){var t=yg(r.srcset),n=yg(e);return n.length===t.length&&n.every(([o,a],u)=>a===t[u][1]&&(Gd(t[u][0],o)||Gd(o,t[u][0])))}function Zd(r,e,t=e){var n=new WeakSet;Yl(r,"input",async o=>{R&&r.type==="checkbox"&&Xc();var a=o?r.defaultValue:r.value;if(a=Nd(r)?Wd(a):a,t(a),O!==null&&n.add(O),await jn(),a!==(a=e())){var u=r.selectionStart,c=r.selectionEnd,f=r.value.length;if(r.value=a!=null?a:"",c!==null){var h=r.value.length;u===c&&c===f&&h>f?(r.selectionStart=h,r.selectionEnd=h):(r.selectionStart=u,r.selectionEnd=Math.min(c,h))}}}),(L&&r.defaultValue!==r.value||V(e)==null&&r.value)&&(t(Nd(r)?Wd(r.value):r.value),O!==null&&n.add(O)),gt(()=>{R&&r.type==="checkbox"&&Xc();var o=e();if(r===document.activeElement){var a=it?fn:O;if(n.has(a))return}Nd(r)&&o===Wd(r.value)||r.type==="date"&&!o&&!r.value||o!==r.value&&(r.value=o!=null?o:"")})}function Nd(r){var e=r.type;return e==="number"||e==="range"}function Wd(r){return r===""?null:+r}function Md(r,e,t){var n=$t(r,e);n&&n.set&&(r[e]=t,pt(()=>{r[e]=null}))}function Yd(r,e){return r===e||(r==null?void 0:r[dt])=
2026-07-23 20:36:13 +08:00
${e}
2026-08-24 09:42:59 +08:00
`;return this._current.weeks.forEach(n=>{let o=" ";n.days.forEach(a=>{let u;a.date&&this._current.isThisMonth(a.date)?u=a.date.format("DD"):u=" ",o=o+u+" "}),t=t+o+`
`}),t}get current(){return this._current}};var es=class{constructor(){m(this,"digits",[]);m(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 dC=ve('<th class="svelte-1lru178"> </th>'),fC=ve('<td><button tabindex="-1"> </button></td>'),mC=ve("<tr></tr>"),pC=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 cu(r,e){if(new.target)return lt({component:cu,...r});Ke(e,!1);let t=xe(),n=xe(),o=re(e,"value",28,ts.default),a=re(e,"weekStart",12,0),u=jo(),c=xe(),f=xe(),h=xe();function b(){A(h).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(){u("select",o())}let x=new es;function k(Q){if(Q.key>="0"&&Q.key<="9"){Q.preventDefault();let oe=x.handle(Q.key);switch(oe.length){case 1:{let N=parseInt(oe);N>0&&o(o().set("date",N));break}case 2:oe.startsWith("0")&&(oe=oe.slice(1)),o(o().set("date",parseInt(oe)));break;case 4:{let N=oe.slice(0,2),le=oe.slice(2,4);N.startsWith("0")&&(N=N.slice(1)),le.startsWith("0")&&(le=le.slice(1)),o(o().set("month",parseInt(N)-1)),o(o().set("date",parseInt(le)))}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(()=>{pd(f,A(f).style.width=A(c).clientWidth+"px")}),yi(()=>(da,ts.default,at(o()),at(a())),()=>{K(t,new da((0,ts.default)().startOf("day"),o().startOf("day"),a()))}),yi(()=>(ts.default,A(t)),()=>{K(n,Array.from({length:7},(Q,oe)=>(0,ts.default)().day((A(t).weekStart+oe)%7).format("ddd")))}),ia();var B={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,oe)=>vt(e,Q,oe)};Bt();var F=pC(),P=J(F),ie=J(P),Y=we(ie,2),pe=J(Y,!0);X(Y);var _e=we(Y,2),Ge=J(_e,!0);X(_e);var He=we(_e,2);X(P);var he=we(P,2),Lt=J(he),Ze=J(Lt);zt(Ze,5,()=>A(n),Q=>Q,(Q,oe)=>{var N=dC(),le=J(N,!0);X(N),$e(()=>Pe(le,A(oe))),de(Q,N)}),X(Ze),X(Lt);var rt=we(Lt);zt(rt,5,()=>(A(t),V(()=>A(t).current.weeks)),Q=>Q.key,(Q,oe)=>{var N=mC();zt(N,5,()=>(A(oe),V(()=>A(oe).days)),le=>le.date.valueOf(),(le,De)=>{var E=fC(),G=J(E);let _t;var Je=J(G,!0);X(G),X(E),$e((ut,Ve)=>{_t=bn(G,1,"calendar-date svelte-1lru178",null,_t,ut),Pe(Je,Ve)},[()=>({"is-selected":A(De).isToday(o()),"other-month":!A(t).current.isThisMonth(A(De).date),"is-holiday":A(De).isHoliday(),"is-past":A(De).date.isBefore(A(t).today)}),()=>(A(De),V(()=>A(De).date.format("D")))]),ce("click",G,()=>I(A(De).date)),ce("dblclick",G,()=>g(A(De).date)),de(le,E)}),X(N),de(Q,N)}),X(rt),X(he),xt(he,Q=>K(c,Q),()=>A(c));var At=we(he,2),Kt=J(At);return Td(Kt,e,"footer",{},null),X(At),xt(At,Q=>K(f,Q),()=>A(f)),X(F),xt(F,Q=>K(h,Q),()=>A(h)),$e((Q,oe)=>{Pe(pe,Q),Pe(Ge,oe)},[()=>(A(t),V(()=>A(t).current.monthStart.format("MMM"))),()=>(A(t),V(()=>A(t).current.monthStart.format("YYYY")))]),ce("click",ie,()=>v()),ce("click",He,()=>y()),ce("focus",F,()=>{u("focus")}),ce("blur",F,()=>{u("blur")}),ce("keydown",F,k),de(r,F),Md(e,"focus",b),qe(B)}var hC=ve("<option> </option>"),gC=ve('<select class="time-picker svelte-16e079f"></select>');function du(r,e){if(new.target)return lt({component:du,...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 u(){o("focus")}function c(){o("blur")}function f(){let y=[];for(let w=0;w<1440;w+=n()){let x=Mat
`)[c])!=null?b:"",h=r.state.doc.line(c+1);r.dispatch({changes:{from:h.from,to:h.to,insert:f},effects:[fa.of()]})}var xC=300,Zg=is.Annotation.define();function Hd(r,e){var t,n,o,a;try{if(!r.settings.editorReminderDisplay.value)return[];if(!((t=e.field(gu.editorLivePreviewField,!1))!=null&&t))return[];let u=(a=(o=(n=e.field(gu.editorInfoField,!1))==null?void 0:n.file)==null?void 0:o.path)!=null?a:"",c=new Fn(u,e.doc.toString());return Gg(e.doc,yo(c))}catch(u){return console.error("Failed to parse reminders for editor pills.",u),[]}}function Pd(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 hu(a,t)}));return o.finish()}function AC(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 kC(r){return is.StateField.define({create(e){let t=Hd(r,e);return{decos:Pd(e,t,r),cache:t}},update(e,t){let n=e.decos.map(t.changes),o=t.docChanged?AC(e.cache,t.changes):e.cache,a=t.annotation(Zg);a!==void 0&&(o=a);let u=t.docChanged&&o.some(b=>t.changes.touchesRange(b.from,b.to)),c=t.effects.some(b=>b.is(fa));if(u||t.reconfigured||c&&a===void 0)return o=Hd(r,t.state),n=Pd(t.state,o,r),{decos:n,cache:o};let h=!t.startState.selection.eq(t.state.selection);return(a!==void 0||h)&&(n=Pd(t.state,o,r)),{decos:n,cache:o}},provide:e=>os.EditorView.decorations.from(e,t=>t.decos)})}function SC(r){return os.ViewPlugin.fromClass(class{constructor(e){m(this,"view",e);m(this,"debounceTimer")}update(e){e.docChanged&&(this.debounceTimer!==void 0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void 0;let t=Hd(r,this.view.state);this.view.dispatch({annotations:Zg.of(t),effects:[fa.of()]})},xC))}destroy(){this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}})}function Jd(r){return[kC(r),SC(r)]}var bu=require("@codemirror/state"),Ii=require("@codemirror/view"),jd=bu.StateEffect.define();function RC(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 FC=bu.StateField.define({create(){return Ii.Decoration.none},update(r,e){let t=e.effects.find(n=>n.is(jd));return t!==void 0?RC(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 Mg(){return FC}var Xg=require("obsidian");var Yg=require("obsidian");var TC=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 lt({component:ss,...r});Ke(e,!1);let t=re(e,"icon",12,""),n=re(e,"text",12,""),o=xe();Jo(()=>{(0,Yg.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 u=TC(),c=J(u);xt(c,b=>K(o,b),()=>A(o));var f=we(c,2),h=J(f,!0);return X(f),X(u),$e(()=>Pe(h,n())),de(r,u),qe(a)}var EC=ve('<button class="reminder-toast-close svelte-1u4loek" aria-label="Close">\xD7</button>'),GC=ve("<option> </option>"),BC=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>'),DC=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 /
`)}},ku=class{unmarshal(e){return e.split(`
2026-07-23 20:36:13 +08:00
`).map(t=>t.trim()).filter(t=>t.length>0)}marshal(e){return e.join(`
2026-08-24 09:42:59 +08:00
`)}},Su=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",Ru=class{constructor(){m(this,"settings",new Cu);m(this,"reminderTime");m(this,"reminderTimeStep");m(this,"enableNotification");m(this,"reNotifyMutedOnStartup");m(this,"notificationPopupStyle");m(this,"openNoteOnReminderClick");m(this,"useSystemNotification");m(this,"showPopupWithSystemNotification");m(this,"keepSystemNotificationOnScreen");m(this,"focusDoneButtonOnPopup");m(this,"laters");m(this,"weekStart");m(this,"dateFormat");m(this,"dateTimeFormat");m(this,"strictDateFormat");m(this,"autoCompleteTrigger");m(this,"convertNonTaskLines");m(this,"editorReminderDisplay");m(this,"primaryFormat");m(this,"excludedPaths");m(this,"useCustomEmojiForTasksPlugin");m(this,"useReminderTimeFallbackForTasksPlugin");m(this,"removeTagsForTasksPlugin");m(this,"dataviewReminderFieldName");m(this,"linkDatesToDailyNotes");m(this,"yearMonthDisplayFormat");m(this,"monthDayDisplayFormat");m(this,"timeDisplayFormat");m(this,"shortDateWithWeekdayDisplayFormat");m(this,"editDetectionSec");m(this,"reminderCheckIntervalSec");m(this,"showOverdueCountInStatusBar");m(this,"ntfyEnabled");m(this,"ntfyServerUrl");m(this,"ntfyTopic");let e=new df(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 xu),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new ye),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 ye),this.reNotifyMutedOnStartup=this.settings.newSettingBuilder().key("reNotifyMutedOnStartup").name("Re-notify muted reminders on startup").desc('When enabled, reminders you previously muted are notified again the next time Obsidian starts. Useful if you rely on startup notifications to review overdue reminders. If many reminders are overdue, they are shown one after another \u2014 use the "Mute all current reminders" command to silence them again.').toggle(!1).build(new ye),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 ye),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 ye),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new ye),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).onAnyValueChanged(a=>{a.setEnabled(this.useSystemNotification.value)}).build(new ye),this.keepSystemNotificationOnScreen=this.settings.newSettingBuilder().key("keepSystemNotificationOnScreen").name("Keep system notification on screen").desc("Keep the system notification on screen until you interact with it, instead of it disappearing after a few
2026-07-23 20:36:13 +08:00
In 1 hour
In 3 hours
Tomorrow
Next week`).placeHolder(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
2026-08-24 09:42:59 +08:00
Next week`).build(new Au);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,u)=>{let c=(0,Lg.default)().day(u).format("dddd");t.addOption(c,u.toString())}),this.weekStart=t.build(new ye),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 ye),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 ye),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 ye),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 ye),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(a=>{let u=this.autoCompleteTrigger.value;a.setInfo(`Popup is ${u.length===0?"disabled":"enabled"}`)}).build(new ye),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 ye),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 ye);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 Su),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 ku),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),this.ntfyEnabled=this.settings.newSettingBuilder().key("ntfyEnabled").name("Enable ntfy scheduled notifications (experimental)").desc("Publish upcoming reminders to the ntfy server below as scheduled push notifications, so you're notified even when Obsidian isn't running (useful on mobile, where plugins can't run in the background). This sends reminder titles to that server, so only enable this if you trust it. Requires an ntfy server running v2.16.0 or later (needed for sequence-ID based scheduled message replacement/deletion). Only reminders due within the next 24 hours are registered \u2014 ntfy itself allows scheduling at most 3 days ahead, and this plugin periodically re-registers reminders to roll that 24-hour window forward.").toggle(!1).build(new ye),this.ntfyServerUrl=this.settings.newSettingBuilder().key("ntfyServerUrl").name("ntfy server URL").desc("The ntfy server to publish scheduled notifications to.").text("https://ntfy.sh").placeHolder("https://ntfy.sh").build(new ye),this.ntfyTopic=this.settings.newSettingBuilder().key("ntfyTopic").name("ntfy topic").desc("Topic to publish reminders to. Anyone who knows this topic name can subscribe to it and read your reminder titles, so use a long, hard-to-guess name rather than something predictable.").text("").placeHolder("a-long-random-topic-name").build(new ye),this.settings.newPage("Notifications").newGroup().addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.enableNotification,this.reNotifyMutedOnStartup,this.notificationPopupStyle,this.openNoteOnReminderClick,this.useSystemNotification,this.showPopupWithSystemNotification,this.keepSystemNotificationOnScreen,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),this.settings.newPage("ntfy").newGroup().addSettings(this.ntfyEnabled,this.ntfyServerUrl,this.ntfyTopic)}wireReminderFormatConfig(){let e=new xs;e.setParameterFunc(Qe.now,()=>$.now()),e.setParameter(Qe.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),e.setParam
2026-07-23 20:36:13 +08:00
/*! 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 */