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

103 lines
289 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-02 09:03:32 +08:00
"use strict";var T_=Object.create;var ys=Object.defineProperty;var E_=Object.getOwnPropertyDescriptor;var G_=Object.getOwnPropertyNames;var B_=Object.getPrototypeOf,D_=Object.prototype.hasOwnProperty;var em=r=>{throw TypeError(r)};var N_=(r,e,t)=>e in r?ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var W_=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Z_=(r,e)=>{for(var t in e)ys(r,t,{get:e[t],enumerable:!0})},tm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of G_(e))!D_.call(r,o)&&o!==t&&ys(r,o,{get:()=>e[o],enumerable:!(n=E_(e,o))||n.enumerable});return r};var Wr=(r,e,t)=>(t=r!=null?T_(B_(r)):{},tm(e||!r||!r.__esModule?ys(t,"default",{value:r,enumerable:!0}):t,r)),Y_=r=>tm(ys({},"__esModule",{value:!0}),r);var m=(r,e,t)=>N_(r,typeof e!="symbol"?e+"":e,t),Ku=(r,e,t)=>e.has(r)||em("Cannot "+t);var x=(r,e,t)=>(Ku(r,e,"read from private field"),t?t.call(r):e.get(r)),q=(r,e,t)=>e.has(r)?em("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),j=(r,e,t,n)=>(Ku(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),se=(r,e,t)=>(Ku(r,e,"access private method"),t);var wr=W_((ic,no)=>{(function(r,e){typeof ic=="object"&&typeof no!="undefined"?no.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(ic,(function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function o(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,s){return Object.prototype.hasOwnProperty.call(i,s)}function c(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var s;for(s in i)if(a(i,s))return!1;return!0}function u(i){return i===void 0}function f(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function 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,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 Ef(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 C(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 A(i){var s=g(NaN);return i!=null?_(y(s),i):y(s).userInvalidated=!0,s}var G=e.momentProperties=[],Z=!1;function te(i,s){var l,d,p,I=G.length;if(u(s._isAMomentObject)||(i._isAMomentObject=s._isAMomentObject),u(s._i)||(i._i=s._i),u(s._f)||(i._f=s._f),u(s._l)||(i._l=s._l),u(s._strict)||(i._strict=s._strict),u(s._tzm)||(i._tzm=s._tzm),u(s._isUTC)||(i._isUTC=s._isUTC),u(s._offset)||(i._offset=s._offset),u(s._pf)||(i._pf=y(s)),u(s._locale)||(i._locale=s._locale),I>0)for(l=0;l<I;l++)d=G[l],p=s[d],u(p)||(i[d]=p);return i}function le(i){te(this,i),this._d=new Date(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Z===!1&&(Z=!0,e.updateOffset(this),Z=!1)}function M(i){return i instanceof le||i!=null&&i._isAMomentObject!=null}function pe(i){e.suppressDeprecationWarnings===!1&&typeof consol
[`+I+"] ";for(S in arguments[0])a(arguments[0],S)&&(p+=S+": "+arguments[0][S]+", ");p=p.slice(0,-2)}else p=arguments[I];d.push(p)}pe(i+`
2026-07-23 20:36:13 +08:00
Arguments: `+Array.prototype.slice.call(d).join("")+`
2026-08-02 09:03:32 +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),d;for(d in s)a(s,d)&&(o(i[d])&&o(s[d])?(l[d]={},_(l[d],i[d]),_(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]=_({},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 ie(i,s,l){var d=""+Math.abs(i),p=s-d.length,I=i>=0;return(I?l?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+d}var D=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ae=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,De={},T={};function E(i,s,l,d){var p=d;typeof d=="string"&&(p=function(){return this[d]()}),i&&(T[i]=p),s&&(T[s[0]]=function(){return ie(p.apply(this,arguments),s[1],s[2])}),l&&(T[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(D),l,d;for(l=0,d=s.length;l<d;l++)T[s[l]]?s[l]=T[s[l]]:s[l]=_t(s[l]);return function(p){var I="",S;for(S=0;S<d;S++)I+=he(s[S])?s[S].call(p,i):s[S];return I}}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(ae.lastIndex=0;l>=0&&ae.test(i);)i=i.replace(ae,d),ae.lastIndex=0,l-=1;return i}var wi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function qt(i){var s=this._longDateFormat[i],l=this._longDateFormat[i.toUpperCase()];return s||!l?s:(this._longDateFormat[i]=l.match(D).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[i])}var yn="Invalid date";function ti(){return this._invalidDate}var us="%d",Ru=/\d{1,2}/;function Vg(i){return this._ordinal.replace("%d",i)}var Lg={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 Og(i,s,l,d){var p=this._relativeTime[l];return he(p)?p(i,s,l,d):p.replace(/%d/i,i)}function $g(i,s){var l=this._relativeTime[i>0?"future":"past"];return he(l)?l(s):l.replace(/%s/i,s)}var cf={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 nm(r,e){return`${r}${Q_}${e}`}function im(r,e,t){let n=nm(r,e),o=rm(n,X_).toString(36),a=rm(n,U_).toString(36),c=`${ec}${o}${a}`;return t===0?c:`${c}-${t}`}function tc(r){var o;let e=[...r].sort((a,c)=>a.file!==c.file?a.file<c.file?-1:1:a.rowNumber-c.rowNumber),t=new Map,n=new Map;for(let a of e){let c=nm(a.file,a.title),u=(o=t.get(c))!=null?o:0;t.set(c,u+1),n.set(a,im(a.file,a.title,u))}return n}var V_=10,L_=1440*60;function rc(r){let{reminders:e,serverPending:t,now:n,defaultTime:o,minLeadSeconds:a=V_,horizonSeconds:c=L_}=r,u=n.getTimeInMillis(o),f=u+a*1e3,h=u+c*1e3,b=tc(e),_=new Map;for(let C of e){let A=C.time.getTimeInMillis(o),G=b.get(C);_.set(G,Math.floor(A/1e3))}let g=new Map;for(let C of e){let A=C.time.getTimeInMillis(o);if(A<=f||A>h)continue;let G=b.get(C);g.set(G,{sequenceId:G,atSeconds:Math.floor(A/1e3),reminder:C})}let v=new Map;for(let C of t)v.set(C.sequenceId,C);let y=[];for(let C of g.values()){let A=v.get(C.sequenceId);(A===void 0||A.atSeconds!==C.atSeconds)&&y.push(C)}let w=[];for(let C of t){if(!Da(C.sequenceId)||g.has(C.sequenceId))continue;let A=_.get(C.sequenceId);(A===void 0||A!==C.atSeconds)&&w.push({sequenceId:C.sequenceId})}return{publish:y,delete:w}}function nc(r){return r.map(e=>e.sequenceId).filter(Da)}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 om(r){return io(r,"minutes")}function oc(r){return io(r,"hours")}function O_(r){return io(r,"days")}function $_(r){return io(r,"weeks")}function P_(r){return io(r,"months")}function H_(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 sc(){return()=>new $((0,sr.default)().add(1,"days"),!1)}function sm(){return()=>new $((0,sr.default)().add(1,"weeks"),!1)}function J_(){return()=>new $((0,sr.default)().add(1,"months"),!1)}function j_(){return()=>new $((0,sr.default)().add(1,"years"),!1)}var Xe=class{constructor(e,t){m(this,"label",e);m(this,"later",t)}};function am(r){return r.split(`
`).map(e=>z_(e.trim()))}function z_(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}`,om(t))}case"hour":case"hours":{let n=t==1?"hour":"hours";return new Xe(`In ${t} ${n}`,oc(t))}case"day":case"days":{let n=t==1?"day":"days";return new Xe(`In ${t} ${n}`,O_(t))}case"week":case"weeks":{let n=t==1?"week":"weeks";return new Xe(`In ${t} ${n}`,$_(t))}case"month":case"months":{let n=t==1?"month":"months";return new Xe(`In ${t} ${n}`,P_(t))}case"year":case"years":{let n=t==1?"year":"years";return new Xe(`In ${t} ${n}`,H_(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",sc());case"week":return new Xe("Next week",sm());case"month":return new Xe("Next month",J_());case"year":return new Xe("Next year",j_());default:throw`Unsupported weekday: ${e}`}}else if(r==="tomorrow")return new Xe("Tomorrow",sc());throw`Unsupported format: ${r}`}var lc=[new Xe("In 30 minutes",om(30)),new Xe("In 1 hours",oc(1)),new Xe("In 3 hours",oc(3)),new Xe("Tomorrow",sc()),new Xe("Next week",sm())],ac=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 ac;var Wa=require("obsidian");var K_=1800*1e3,q_=10*1e3,Is=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()},K_))}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()},q_))}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 o=await this.fetchPending(t,n),a=nc(o);for(let c of a)await this.deleteScheduled(t,n,c)}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 o=await this.fetchPending(t,n),a=rc({reminders:this.deps.reminders(),serverPending:o,now:$.now(),defaultTime:this.deps.defaultTime()});for(let c of a.delete)await this.deleteScheduled(t,n,c.sequenceId);for(let c of a.publish)await this.publish(t,n,c)}catch(o){console.error("[ntfy] Failed to sync scheduled notifications: %o",o)}}resolveServerAndTopic(){let
`)){let u=c.trim();if(u.length===0)continue;let f;try{f=JSON.parse(u)}catch(h){console.error("[ntfy] Failed to parse a poll response line: %o",h);continue}f.event!=="message"||f.sequence_id===void 0||f.time===void 0||f.time<=o||a.push({sequenceId:f.sequence_id,atSeconds:f.time})}return 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:qu(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 Cp=require("obsidian");var lm=require("obsidian");function um(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 lm.Notice(`Muted ${n} reminder${n===1?"":"s"}`),!0}var uc=require("obsidian");var cm=require("obsidian");var Za=class extends cm.SuggestModal{constructor(t,n,o){super(t);m(this,"laters",n);m(this,"onSelect",o);this.setPlaceholder("Pause reminder notifications for...")}getSuggestions(t){return this.laters.filter(n=>n.label.toLowerCase().includes(t.toLowerCase()))}renderSuggestion(t,n){n.createEl("div",{text:t.label})}onChooseSuggestion(t){this.onSelect(t)}};function eI(r,e){let t=e.later();r.data.dndUntil.value=t,r.data.save(!0),r.ui.refreshDndStatusBar(),new uc.Notice(`Reminder notifications paused until ${t.format("YYYY-MM-DD HH:mm")}`)}function Ya(r){r.data.dndUntil.value=null,r.data.save(!0),r.ui.refreshDndStatusBar(),new uc.Notice("Reminder notifications resumed")}function Ma(r){new Za(r.app,r.settings.laters.value,e=>{eI(r,e)}).open()}function dm(r,e){return r||Ma(e),!0}function oo(r,e){return r==null?!1:e.getTimeInMillis()<r.getTimeInMillis()}function fm(r,e){return oo(e.data.dndUntil.value,$.now())?(r||Ya(e),!0):!1}function mm(r,e){return r||e.fileSystem.reloadRemindersInAllFiles(),!0}function pm(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 hm(r){if(so.parse(0,r)!==null)return r;let e=/^(?<lead>(?:> ?)*\s*)(?<rest>.*)$/.exec(r),t=e.groups.lead,n=e.groups.rest;if(/^#{1,6}[ ]/.test(n)||/^\d+[.)][ ]/.test(n)||n.startsWith("|")||n.startsWith("```"))return null;let o=/^(?<marker>[-*+])[ ]+(?<content>.*)$/.exec(n);if(o){let a=o.groups.marker,c=o.groups.content;return`${t}${a} [ ] ${c}`}return`${t}- [ ] ${n}`}var 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 c=Xa.fenceRegexp.exec(o),u=c==null?void 0:c.groups.fence,f=c==null?void 0:c.groups.info;if(t===null){if(u!==void 0&&(u[0]!=="`"||!f.includes("`"))){t=u[0],n=u.length;return}}else{u!==void 0&&u[0]===t&&u.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 bm=require("obsidian"),gm=window.require?window.require("electron"):void 0;function Ua(){new bm.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 c=hm(e);if(c==null)return null;let u=n==null?void 0:n+(c.length-e.length);return r.appendReminder(c,t,u)}async function vm(r,e){return gm&&(await gm.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 c=o.get(a.key());o.set(a.key(),a.muteNotification),c!==void 0&&(a.muteNotification=c)}}return this.fileToReminders.set(e,t),this.sortReminders(),!0}equals(e,t){if(e.length!==t.length)return!1;let n=[...e],o=[...t];return this.sort(n),this.sort(o),n.every((a,c)=>a.equals(o[c]))}sortReminders(){let e=[];for(let t of this.fileToReminders.values())e.push(...t);this.sort(e),this.reminders=e,this.onChange()}sort(e){e.sort((t,n)=>{var a,c;let o=t.time.getTimeInMillis((a=this.reminderTime)==null?void 0:a.value)-n.time.getTimeInMillis((c=this.reminderTime)==null?void 0:c.value);return o>0?1:o<0?-1:0})}},_m=[{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 ym(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",c=>c.format(n.timeFormat,t));return a.isToday=!
`).map(mI).filter(function(t){return t!==null});return St(St({},e[0]),e[1])}function Ts(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=ks(o),e}function mI(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Xm(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Xm(r);case"DTSTART":return Ts(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Xm(r){var e=r.replace(/^RRULE:/i,""),t=Ts(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(o){var a=o.split("="),c=a[0],u=a[1];switch(c.toUpperCase()){case"FREQ":t.freq=ue[u.toUpperCase()];break;case"WKST":t.wkst=xr[u.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var f=pI(u),h=c.toLowerCase();t[h]=f;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=hI(u);break;case"DTSTART":case"TZID":var b=Ts(r);t.tzid=b.tzid,t.dtstart=b.dtstart;break;case"UNTIL":t.until=ks(u);break;case"BYEASTER":t.byeaster=Number(u);break;default:throw new Error("Unknown RRULE property '"+c+"'")}}),t}function pI(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Um)}return Um(r)}function Um(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function hI(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return xr[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var o=Number(n[1]),a=n[2],c=xr[a].weekday;return new nt(c,o)})}var Ti=(function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=uo(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:Em(this.date,this.tzid)},r})();function Gs(r){for(var e=[],t="",n=Object.keys(r),o=Object.keys(Fs),a=0;a<n.length;a++)if(n[a]!=="tzid"&&be(o,n[a])){var c=n[a].toUpperCase(),u=r[n[a]],f="";if(!(!Ne(u)||kt(u)&&!u.length)){switch(c){case"FREQ":f=U.FREQUENCIES[r.freq];break;case"WKST":ar(u)?f=new nt(u).toString():f=u.toString();break;case"BYWEEKDAY":c="BYDAY",f=km(u).map(function(v){return v instanceof nt?v:kt(v)?new nt(v[0],v[1]):new nt(v)}).toString();break;case"DTSTART":t=gI(u,r.tzid);break;case"UNTIL":f=uo(u,!r.tzid);break;default:if(kt(u)){for(var h=[],b=0;b<u.length;b++)h[b]=String(u[b]);f=h.toString()}else f=String(u)}f&&e.push([c,f])}}var _=e.map(function(v){var y=v[0],w=v[1];return"".concat(y,"=").concat(w.toString())}).join(";"),g="";return _!==""&&(g="RRULE:".concat(_)),[t,g].filter(function(v){return!!v}).join(`
`)}function gI(r,e){return r?"DTSTART"+new Ti(new Date(r),e).toString():""}function bI(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 Qm=(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):pc(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 _=0;_<o.length;_++){var g=o[_];if(!bI(t[g],b[g]))return!0}return!1},c=this[e];if(e==="all")n=this.all;else if(kt(c))for(var u=0;u<c.length;u++){var f=c[u];if(!(o.length&&a(f))){n=f._value;break}}if(!n&&this.all){for(var h=new Gn(e,t),u=0;u<this.all.length&&h.accept(this.all[u]);u++);n=h.getValue(),this._cacheAdd(e,n,t)}return kt(n)?pc(n):n instanceof Date?Ja(n):n},r})();var Vm=B(B(B(B(B(B(B(B(B(B(B(B(B([],me(1,31),!0),me(2,28),!0),me(3,31),!0),me(4,30),!0),me(5,31),!0),me(6,30),!0),me(7,31),!0),me(8,31),!0),me(9,30),!0),me(10,31),!0),me(11,30),!0),me(12,31),!0),me(1,7),!0),Lm=B(B(B(B(B(B(B(B(B(B(B(B(B([],me(1,31),!0),me(2,29),!0),me(3,31),!0),me(4,30),!0),me(5,31),!0),me(6,30),!0),me(7,31),!0),me(8,31),!0),me(9,30),!0),me(10,31),!0),me(11,30),!0),me(12,31),!0),me(1,7),!0),vI=Cr(1,29),yI=Cr(1,30),ui=Cr(1,31),Zt=Cr(1,32),Om=B(B(B(B(B(B(B(B(B(B(B(B(B([],Zt,!0),yI,!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),$m=B(B(B(B(B(B(B(B(B(B(B(B(B([],Zt,!0),vI,!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),_I=Cr(-28,0),II=Cr(-29,0),ci=Cr(-30,0),Yt=Cr(-31,0),Pm=B(B(B(B(B(B(B(B(B(B(B(B(B([],Yt,!0),II,!0),Yt,!0),ci,!0),Yt,!0),ci,!0),Yt,!0),Yt,!0),ci,!0),Yt,!0),ci,!0),Yt,!0),Yt.slice(0,7),!0),Hm=B(B(B(B(B(B(B(B(B(B(B(B(B([],Yt,!0),_I,!0),Yt,!0),ci,!0),Yt,!0),ci,!0),Yt,!0),Yt,!0),ci,!0),Yt,!0),ci,!0),Yt,!0),Yt.slice(0,7),!0),Jm=[0,31,60,91,121,152,182,213,244,274,305,335,366],jm=[0,31,59,90,120,151,181,212,243,273,304,334,365],vc=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(Cr(7));return r})();function zm(r,e){var t=zr(r,1,1),n=lo(r)?366:365,o=lo(r+1)?366:365,a=As(t),c=Tn(t),u=St(St({yearlen:n,nextyearlen:o,yearordinal:a,yearweekday:c},wI(r)),{wnomask:null});if(lr(e.byweekno))return u;u.wnomask=me(0,n+7);var f,h,b=f=Wt(7-c+e.wkst,7);b>=4?(b=0,h=u.yearlen+Wt(c-e.wkst,7)):h=n-b;for(var _=Math.floor(h/7),g=Wt(h,7),v=Math.floor(_+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 C=void 0;w>1?(C=b+(w-1)*7,b!==f&&(C-=7-f)):C=b;for(var A=0;A<7&&(u.wnomask[C]=1,C++,u.wdaymask[C]!==e.wkst);A++);}}if(be(e.byweekno,1)){var C=b+v*7;if(b!==f&&(C-=7-f),C<n)for(var y=0;y<7&&(u.wnomask[C]=1,C+=1,u.wdaymask[C]!==e.wkst);y++);}if(b){var G=void 0;if(be(e.byweekno,-1))G=-1;else{var Z=Tn(zr(r-1,1,1)),te=Wt(7-Z.valueOf()+e.wkst,7),le=lo(r-1)?366:365,M=void 0;te>=4?(te=0,M=le+Wt(Z-e.wkst,7)):M=n-b,G=Math.floor(52+Wt(M,7)/4)}if(be(e.byweekno,G))for(var C=0;C<b;C++)u.wnomask[C]=1}return u}function wI(r){var e=lo(r)?366:365,t=zr(r,1,1),n=Tn(t);return e===365?{mmask:Vm,mdaymask:$m,nmdaymask:Hm,wdaymask:vc.slice(n),mrange:jm}:{mmask:Lm,mdaymask:Om,nmdaymask:Pm,wdaymask:vc.slice(n),mrange:Jm}}function Km(r,e,t,n,o,a){var c={lastyear:r,lastmonth:e,nwdaymask:[]},u=[];if(a.freq===U.YEARLY)if(lr(a.bymonth))u=[[0,t]];else for(var f=0;f<a.bymonth.length;f++)e=a.bymonth[f],u.push(n.slice(e-1,e+1));else a.freq===U.MONTHLY&&(u=[n.slice(e-1,e+1)]);if(lr(u))return c;c.nwdaymask=me(0,t);for(var f=0;f<u.length;f++)for(var h=u[f],b=h[0],_=h[1]-1,g=0;g<a.bynweekday.length;g++){var v=void 0,y=a.bynweekday[g],w=y[0],C=y[1];C<0?(v=_+(C+1)*7,v-=Wt(o[v]-w,7)):(v=b+(C-1)*7,v+=Wt(7-o[v]+w,7)),b<=v&&v<=_&&(c.nwdaymask[v]=1)}return c}function qm(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),o=r%100,a=Math.floor(n/4),c=n%4,u=Math.floor((n+8)/25),f=Math.floor((n-u+1)/3),h=Math.floor(19*t+n-a-f+15)%30,b=Math.floor(o/4),_=o%4,g=Math.floor(32+2*c+2*b-h-_)%7,v=Math.floor((t
`),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 BI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function op(r,e){return BI(e),r.split(",").map(function(t){return ks(t)})}function sp(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 _c=(function(r){co(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=sp.apply(n,["dtstart"]),n.tzid=sp.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return np(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){ap(t,this._rrule)},e.prototype.exrule=function(t){ap(t,this._exrule)},e.prototype.rdate=function(t){lp(t,this._rdate)},e.prototype.exdate=function(t){lp(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(Gs({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-02 09:03:32 +08:00
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&t.push(up("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(up("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 ap(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 lp(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 up(r,e,t){var n=!t||t.toUpperCase()==="UTC",o=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(c){return uo(c.valueOf(),n)}).join(",");return"".concat(o).concat(a)}function po(r,e,t){let n;try{n=U.parseText(r)}catch(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 u=new U(n).after(e.toDate(),!1);if(u==null)return;let f=u.getTime()-n.dtstart.getTime();return a.add(f,"millisecond"),a.toDate()}function 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 c=t.clone(),u=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 _=po(a,b.moment(),h);if(_==null)return!1;if(u.setTime(new $((0,Ka.default)(_),b.hasTimePart)),f!=null){let g=po(a,f.moment(),h);if(g==null)return!1;u.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 _=new $((0,Ka.default)(b),f.hasTimePart);u.setTime(_)}c.body=u.toMarkdown(),c.setChecked(!1),e.insertTodo(t.lineIndex,c)}n.setDoneDate(this.config.getParameter(Qe.now))}else n.setDoneDate(void 0);return!0}};var DI=["YYYY-MM-DDTHH:mm","YYYY-MM-DD HH:mm"],Cc="YYYY-MM-DD";function Ic(r){for(let t of DI){let n=(0,wc.default)(r,t,!0);if(n.isValid())return new $(n,!0)}let e=(0,wc.default)(r,Cc,!0);return e.isValid()?new $(e,!1):null}function cp(r){return r.hasTimePart?r.format("YYYY-MM-DDTHH:mm"):r.format(Cc)}var Ei="due",el="completion",dp="repeat",NI="scheduled",WI="start",ZI=[Ei,el,dp,NI,WI],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 Cm(this.text)}fieldsByKey(e){return this.fields().filter(t=>t.key.toLowerCase()===e)}firstField(e){var t;return(t=this.fieldsByKey(e)[0])!=null?t:null}hasReminderField(){return this.firstField(this.reminderFieldName)!=null}hasAnySourceField(){return this.hasReminderField()||this.firstField(Ei)!=null}reminderSourceField(){var e;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Ei)}getTitle(){let e=new Set([...ZI,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=cc(n,o);return n=n.trim(),this.removeTags&&(n=qa(n)),n}getTime(){let e=this.reminderSourceField();return e==null?null:Ic(e.value)}setTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Ei;this.setFieldValue(n,cp(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:Ic(e.value)}setDueDate(e){this.setFieldValue(Ei,cp(e))}getRecurrence(){var t;let e=this.firstField(dp);return(t=e==null?void 0:e.value)!=null?t:null}getDoneDate(){let e=this.firstField(el);return e==null?null:Ic(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(el);return}let t=e instanceof $?e.f
[${o}]`);for(let c of a)t.push(String(c));r.app.vault.adapter.write(e,t.join(" "))};console.debug=n("debug"),console.error=n("error"),console.info=n("info"),console.log=n("log"),console.warn=n("warn")}var en="reminder-list";var UI=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",()=>{Ya(this.plugin)}),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),UI)),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"),Ds=Symbol("legacy props"),Rp=Symbol(""),_l=Symbol("proxy path"),Il=Symbol("attributes"),Ns=Symbol("class"),Tc=Symbol("style"),Ws=Symbol("text"),di=Symbol("form reset"),Ec=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")}},Sp,Gc=!!((Sp=globalThis.document)!=null&&Sp.contentType)&&globalThis.document.contentType.includes("xml");var Io=3,Ar=8;var Tp,Ep,Fp=(Ep=(Tp=globalThis.process)==null?void 0:Tp.env)==null?void 0:Ep.NODE_ENV,R=Fp&&!Fp.toLowerCase().startsWith("prod");var kr=Array.isArray,Gp=Array.prototype.indexOf,fi=Array.prototype.includes,wo=Array.from,Bc=Object.keys,Rt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,wl=Object.getOwnPropertyDescriptors,Dc=Object.prototype,Bp=Array.prototype,Gi=Object.getPrototypeOf,Nc=Object.isExtensible;var tn=()=>{};function Dp(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 Wc(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function Al(r){return!Wc(r,this.v)}function Np(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-02 09:03:32 +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 Zp(){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 Zc(){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 Yp(){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-02 09:03:32 +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 Yc(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-02 09:03:32 +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 Mp(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-02 09:03:32 +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 Xp(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-02 09:03:32 +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 Up(){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 Qp(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-02 09:03:32 +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 Vp(){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-02 09:03:32 +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 Lp(){if(R){let r=new Error(`hydration_failed
2026-07-23 20:36:13 +08:00
Failed to hydrate the application
2026-08-02 09:03:32 +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 Op(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-02 09:03:32 +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 $p(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-02 09:03:32 +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 Pp(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-02 09:03:32 +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 Hp(){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 Jp(){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 jp(){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 zp(){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,Yr=!1;function Kp(){rn=!0}var Wn={};var Be=Symbol("uninitialized"),Sr=Symbol("filename");var kl="http://www.w3.org/1999/xhtml";var Zs=null;function Mt(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 Mr(r){let e=new Error,t=VI();return t.length===0?null:(t.unshift(`
2026-07-23 20:36:13 +08:00
`),Rt(e,"stack",{value:t.join(`
2026-08-02 09:03:32 +08:00
`)}),Rt(e,"name",{value:r}),e)}function VI(){let r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=r,!e)return[];let t=e.split(`
`),n=[];for(let o=0;o<t.length;o++){let a=t[o],c=a.replaceAll("\\","/");if(a.trim()!=="Error"){if(a.includes("validate_each_keys"))return[];c.includes("svelte/src/internal")||c.includes("node_modules/.vite")||n.push(a)}}return n}function eh(r,e){if(!R)throw new Error("invariant(...) was not guarded by if (DEV)");r||Np(e)}var K=null;function Zn(r){K=r}var nn=null;function Ao(r){nn=r}var Xr=null;function Fl(r){Xr=r}function Ke(r,e=!1,t){K={p:K,i:!1,c:null,e:null,s:r,x:null,r:Y,l:rn&&!e?{s:null,u:null,$:[]}:null},R&&(K.function=t,Xr=t)}function qe(r){var o;var e=K,t=e.e;if(t!==null){e.e=null;for(var n of t)Mc(n)}return r!==void 0&&(e.x=r),e.i=!0,K=e.p,R&&(Xr=(o=K==null?void 0:K.function)!=null?o:null),r!=null?r:{}}function on(){return!rn||K!==null&&K.l===null}var Bi=[];function th(){var r=Bi;Bi=[],Co(r)}function et(r){if(Bi.length===0&&!Di){var e=Bi;queueMicrotask(()=>{e===Bi&&th()})}Bi.push(r)}function rh(){for(;Bi.length>0;)th()}var sn="font-weight: bold",an="font-weight: normal";function nh(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-02 09:03:32 +08:00
https://svelte.dev/e/await_reactivity_loss`,sn,an):console.warn("https://svelte.dev/e/await_reactivity_loss")}function ih(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-02 09:03:32 +08:00
https://svelte.dev/e/await_waterfall`,sn,an):console.warn("https://svelte.dev/e/await_waterfall")}function oh(){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-02 09:03:32 +08:00
https://svelte.dev/e/derived_inert`,sn,an):console.warn("https://svelte.dev/e/derived_inert")}function sh(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-02 09:03:32 +08:00
https://svelte.dev/e/hydration_mismatch`,sn,an):console.warn("https://svelte.dev/e/hydration_mismatch")}function ah(){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-02 09:03:32 +08:00
https://svelte.dev/e/lifecycle_double_unmount`,sn,an):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function lh(){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-02 09:03:32 +08:00
https://svelte.dev/e/state_proxy_equality_mismatch`,sn,an):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function uh(){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-02 09:03:32 +08:00
https://svelte.dev/e/state_proxy_unmount`,sn,an):console.warn("https://svelte.dev/e/state_proxy_unmount")}function ch(){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 Ms(r){if(!r||r.nodeType!==Ar)throw Ni(),Wn;return r.data}var LI=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Yn(r){if(typeof r!="object"||r===null||dt in r)return r;let e=Gi(r);if(e!==Dc&&e!==Bp)return r;var t=new Map,n=kr(r),o=un(0),a=R&&Yr?Mr("created at"):null,c=pi,u=_=>{if(pi===c)return _();var g=P,v=pi;mt(null),Xc(c);var y=_();return mt(g),Xc(v),y};n&&(t.set("length",un(r.length,a)),R&&(r=$I(r)));var f="";let h=!1;function b(_){if(!h){h=!0,f=_,Mt(o,`${f} version`);for(let[g,v]of t)Mt(v,Wi(f,g));h=!1}}return new Proxy(r,{defineProperty(_,g,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&Hp();var y=t.get(g);return y===void 0?u(()=>{var w=un(v.value,a);return t.set(g,w),R&&typeof g=="string"&&Mt(w,Wi(f,g)),w}):z(y,v.value,!0),!0},deleteProperty(_,g){var v=t.get(g);if(v===void 0){if(g in _){let y=u(()=>un(Be,a));t.set(g,y),Zi(o),R&&Mt(y,Wi(f,g))}}else z(v,Be),Zi(o);return!0},get(_,g,v){var A;if(g===dt)return r;if(R&&g===_l)return b;var y=t.get(g),w=g in _;if(y===void 0&&(!w||(A=$t(_,g))!=null&&A.writable)&&(y=u(()=>{var G=Yn(w?_[g]:Be),Z=un(G,a);return R&&Mt(Z,Wi(f,g)),Z}),t.set(g,y)),y!==void 0){var C=k(y);return C===Be?void 0:C}return Reflect.get(_,g,v)},getOwnPropertyDescriptor(_,g){var v=Reflect.getOwnPropertyDescriptor(_,g);if(v&&"value"in v){var y=t.get(g);y&&(v.value=k(y))}else if(v===void 0){var w=t.get(g),C=w==null?void 0:w.v;if(w!==void 0&&C!==Be)return{enumerable:!0,configurable:!0,value:C,writable:!0}}return v},has(_,g){var C;if(g===dt)return!0;var v=t.get(g),y=v!==void 0&&v.v!==Be||Reflect.has(_,g);if(v!==void 0||Y!==null&&(!y||(C=$t(_,g))!=null&&C.writable)){v===void 0&&(v=u(()=>{var A=y?Yn(_[g]):Be,G=un(A,a);return R&&Mt(G,Wi(f,g)),G}),t.set(g,v));var w=k(v);if(w===Be)return!1}return y},set(_,g,v,y){var pe;var w=t.get(g),C=g in _;if(n&&g==="length")for(var A=v;A<w.v;A+=1){var G=t.get(A+"");G!==void 0?z(G,Be):A in _&&(G=u(()=>un(Be,a)),t.set(A+"",G),R&&Mt(G,Wi(f,A)))}if(w===void 0)(!C||(pe=$t(_,g))!=null&&pe.writable)&&(w=u(()=>un(void 0,a)),R&&Mt(w,Wi(f,g)),z(w,Yn(v)),t.set(g,w));else{C=w.v!==Be;var Z=u(()=>Yn(v));z(w,Z)}var te=Reflect.getOwnPropertyDescriptor(_,g);if(te!=null&&te.set&&te.set.call(y,v),!C){if(n&&typeof g=="string"){var le=t.get("length"),M=Number(g);Number.isInteger(M)&&M>=le.v&&z(le,M+1)}Zi(o)}return!0},ownKeys(_){k(o);var g=Reflect.ownKeys(_).filter(w=>{var C=t.get(w);return C===void 0||C.v!==Be});for(var[v,y]of t)y.v!==Be&&!(v in _)&&g.push(v);return g},setPrototypeOf(){Jp()}})}function Wi(r,e){var t;return typeof e=="symbol"?`${r}[Symbol(${(t=e.description)!=null?t:""})]`:LI.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 Uc(r,e){return Object.is(Fo(r),Fo(e))}var OI=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function $I(r){return new Proxy(r,{get(e,t,n){var o=Reflect.get(e,t,n);return OI.has(t)?function(...a){dh();var c=o.apply(this,a);return El(),c}:o}})}function fh(){let r=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:t,lastIndexOf:n,includes:o}=r;r.indexOf=function(a,c){let u=t.call(this,a,c);if(u===-1){for(let f=c!=null?c:0;f<this.length;f+=1)if(Fo(this[f])
2026-07-23 20:36:13 +08:00
${n}in ${((c=e.fn)==null?void 0:c.name)||"<unknown>"}`,a=e.ctx;a!==null;)o+=`
2026-08-02 09:03:32 +08:00
${n}in ${(u=a.function)==null?void 0:u[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(`
`)}}}function gh(r){let e=Qc.get(r);e&&(Rt(r,"message",{value:e.message}),Rt(r,"stack",{value:e.stack}))}var HI=-7169;function Ae(r,e){r.f=r.f&HI|e}function Eo(r){(r.f&512)!==0||r.deps===null?Ae(r,1024):Ae(r,4096)}function bh(r){if(r!==null)for(let e of r)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,bh(e.deps))}function Wl(r,e,t){(r.f&2048)!==0?e.add(r):(r.f&4096)!==0&&t.add(r),bh(r.deps),Ae(r,1024)}var vh=!1,Zl=!1;function Vc(r){var e=Zl;try{return Zl=!1,[r(),Zl]}finally{Zl=e}}var yh=!1;function Yl(){yh||(yh=!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=P,t=Y;mt(null),tt(null);try{return r()}finally{mt(e),tt(t)}}function Ml(r,e,t,n=t){r.addEventListener(e,()=>Tr(t));let o=r[di];o?r[di]=()=>{o(),n(!0)}:r[di]=()=>n(!0),Yl()}function _h(r){let e=0,t=Vt(0),n;return R&&Mt(t,"createSubscriber version"),()=>{mi()&&(k(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 jI=589824;function Jc(r,e,t,n){new Lc(r,e,t,n)}var ur,Ls,Er,Yi,nr,Gr,Pt,cr,Un,Mi,gi,Bo,Os,$s,cn,Ql,Ee,wh,Ch,Oc,xh,$c,Xl,Ul,Pc,Hc,Lc=class{constructor(e,t,n,o){q(this,Ee);m(this,"parent");m(this,"is_pending",!1);m(this,"transform_error");q(this,ur);q(this,Ls,L?ne:null);q(this,Er);q(this,Yi);q(this,nr);q(this,Gr,null);q(this,Pt,null);q(this,cr,null);q(this,Un,null);q(this,Mi,0);q(this,gi,0);q(this,Bo,!1);q(this,Os,new Set);q(this,$s,new Set);q(this,cn,null);q(this,Ql,_h(()=>(j(this,cn,Vt(x(this,Mi))),R&&Mt(x(this,cn),"$effect.pending()"),()=>{j(this,cn,null)})));var a,c;j(this,ur,e),j(this,Er,t),j(this,Yi,u=>{var f=Y;f.b=this,f.f|=128,n(u)}),this.parent=Y.b,this.transform_error=(c=o!=null?o:(a=this.parent)==null?void 0:a.transform_error)!=null?c:(u=>u),j(this,nr,mr(()=>{if(L){let u=x(this,Ls);Et();let f=u.data==="[!";if(u.data.startsWith("[?")){let b=JSON.parse(u.data.slice("[?".length));se(this,Ee,Ch).call(this,b)}else f?se(this,Ee,xh).call(this):se(this,Ee,wh).call(this)}else se(this,Ee,$c).call(this)},jI)),L&&j(this,ur,ne)}defer_effect(e){Wl(e,x(this,Os),x(this,$s))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!x(this,Er).pending}update_pending_count(e,t){se(this,Ee,Pc).call(this,e,t),j(this,Mi,x(this,Mi)+e),!(!x(this,cn)||x(this,Bo))&&(j(this,Bo,!0),et(()=>{j(this,Bo,!1),x(this,cn)&&Vr(x(this,cn),x(this,Mi))}))}get_effect_pending(){return x(this,Ql).call(this),k(x(this,cn))}error(e){var t;if(!x(this,Er).onerror&&!x(this,Er).failed)throw e;(t=O)!=null&&t.is_fork?(x(this,Gr)&&O.skip_effect(x(this,Gr)),x(this,Pt)&&O.skip_effect(x(this,Pt)),x(this,cr)&&O.skip_effect(x(this,cr)),O.oncommit(()=>{se(this,Ee,Hc).call(this,e)})):se(this,Ee,Hc).call(this,e)}};ur=new WeakMap,Ls=new WeakMap,Er=new WeakMap,Yi=new WeakMap,nr=new WeakMap,Gr=new WeakMap,Pt=new WeakMap,cr=new WeakMap,Un=new WeakMap,Mi=new WeakMap,gi=new WeakMap,Bo=new WeakMap,Os=new WeakMap,$s=new WeakMap,cn=new WeakMap,Ql=new WeakMap,Ee=new WeakSet,wh=function(){try{j(this,Gr,bt(()=>x(this,Yi).call(this,x(this,ur))))}catch(e){this.error(e)}},Ch=function(e){let t=x(this,Er).failed,{reset:n,invoke_onerror:o}=se(this,Ee,Oc).call(this,e);et(o),t&&j(this,cr,bt(()=>{t(x(this,ur),()=>e,()=>n)}))},Oc=function(e){var t=!1,n=!1;let o=()=>{if(t){ch();return}t=!0,n&&zp(),x(this,cr)!==null&&dn(x(this,cr),()=>{j(this,cr,null)}),se(this,Ee,Ul).call(this,()=>{se(this,Ee,$c).call(this)})};return{reset:o,invoke_onerror:()=>{var c,u;try{n=!0,(u=(c=x(this,Er)).onerror)==null||u.call(c,e,o),n=!1}catch(f){Qr(f,x(this,nr)&&x(this,nr).parent)}}}},xh=function(){let e=x(this,Er).pending;e&&(this.is_pending=!0,j(this,Pt,bt(()=>e(x(this,ur)))),et(()=>{var t=j(this,Un,document.createDocumentFragment()),n=wt();t.append(n),j(this,Gr,se(this,Ee,Ul).call(this,()=>bt(()=>x(this,Yi).call(this,n)))),x(this,gi)===0&&(x(this,ur).before(t),j(this,Un,null),dn(x(this,Pt),()=>{j(this,Pt,null)}),se(this,Ee,Xl).call(this,O))}))},$c=function(){try{if(this.is_pending=this.has_pending_snip
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw u;return u!==Wn&&console.warn("Failed to hydrate: ",u),e.recover===!1&&Lp(),Gl(),Qs(t),ft(!1),ql(r,e)}finally{ft(n),Fe(o)}}var Kl=new Map;function ig(r,{target:e,anchor:t,props:n={},events:o,context:a,intro:c=!0,transformError:u}){Gl();var f=void 0,h=Hh(()=>{var b=t!=null?t:e.appendChild(wt());Jc(b,{pending:()=>{}},v=>{Ke({});var y=K;if(a&&(y.c=a),o&&(n.$$events=o),L&&zn(v,null),_d=c,f=r(v,n)||{},_d=!0,L&&(Y.nodes.end=ne,ne===null||ne.nodeType!==Ar||ne.data!=="]"))throw Ni(),Wn;qe()},u);var _=new Set,g=v=>{for(var y=0;y<v.length;y++){var w=v[y];if(!_.has(w)){_.add(w);var C=ng(w);for(let Z of[e,document]){var A=Kl.get(Z);A===void 0&&(A=new Map,Kl.set(Z,A));var G=A.get(w);G===void 0?(Z.addEventListener(w,zl,{passive:C}),A.set(w,1)):A.set(w,G+1)}}}};return g(wo(qh)),gd.add(g),()=>{var C;for(var v of _)for(let A of[e,document]){var y=Kl.get(A),w=y.get(v);--w==0?(A.removeEventListener(v,zl),y.delete(v),y.size===0&&Kl.delete(A)):y.set(v,w)}gd.delete(g),b!==t&&((C=b.parentNode)==null||C.removeChild(b))}});return Id.set(f,h),f}var Id=new WeakMap;function Cd(r,e){let t=Id.get(r);return t?(Id.delete(r),t(e)):(R&&(dt in r?uh():ah()),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 xd(r)}var Kn,Br,xd=class{constructor(e){q(this,Kn);q(this,Br);var a,c;var t=new Map,n=(u,f)=>{var h=xe(f,!1,!1);return t.set(u,h),h};let o=new Proxy({...e.props||{},$$events:{}},{get(u,f){var h;return k((h=t.get(f))!=null?h:n(f,Reflect.get(u,f)))},has(u,f){var h;return f===Ds?!0:(k((h=t.get(f))!=null?h:n(f,Reflect.get(u,f))),Reflect.has(u,f))},set(u,f,h){var b;return z((b=t.get(f))!=null?b:n(f,h),h),Reflect.set(u,f,h)}});j(this,Br,(e.hydrate?wd: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&&(!((c=e==null?void 0:e.props)!=null&&c.$$host)||e.sync===!1)&&J(),j(this,Kn,o.$$events);for(let u of Object.keys(x(this,Br)))u==="$set"||u==="$destroy"||u==="$on"||Rt(this,u,{get(){return x(this,Br)[u]},set(f){x(this,Br)[u]=f},enumerable:!0});x(this,Br).$set=u=>{Object.assign(o,u)},x(this,Br).$destroy=()=>{Cd(x(this,Br))}}$set(e){x(this,Br).$set(e)}$on(e,t){x(this,Kn)[e]=x(this,Kn)[e]||[];let n=(...o)=>t.call(this,...o);return x(this,Kn)[e].push(n),()=>{x(this,Kn)[e]=x(this,Kn)[e].filter(o=>o!==n)}}$destroy(){x(this,Br).$destroy()}};Kn=new WeakMap,Br=new WeakMap;var og,sg,ag;typeof window!="undefined"&&((ag=(sg=(og=window.__svelte)!=null?og:window.__svelte={}).v)!=null?ag:sg.v=new Set).add("5");Kp();var Pr,pn,vr,Oi,ia,oa,ru,qn=class{constructor(e,t=!0){m(this,"anchor");q(this,Pr,new Map);q(this,pn,new Map);q(this,vr,new Map);q(this,Oi,new Set);q(this,ia,!0);q(this,oa,e=>{if(x(this,Pr).has(e)){var t=x(this,Pr).get(e),n=x(this,pn).get(t);if(n)Ho(n),x(this,Oi).delete(t);else{var o=x(this,vr).get(t);o&&(Ho(o.effect),x(this,pn).set(t,o.effect),x(this,vr).delete(t),R&&(o.fragment.lastChild[Ec]=this.anchor),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(let[a,c]of x(this,Pr)){if(x(this,Pr).delete(a),a===e)break;let u=x(this,vr).get(c);u&&(Oe(u.effect),x(this,vr).delete(c))}for(let[a,c]of x(this,pn)){if(a===t||x(this,Oi).has(a))continue;let u=()=>{if(Array.from(x(this,Pr).values()).includes(a)){var h=document.createDocumentFragment();Do(c,h),h.append(wt()),x(this,vr).set(a,{effect:c,fragment:h})}else Oe(c);x(this,Oi).delete(a),x(this,pn).delete(a)};x(this,ia)||!n?(x(this,Oi).add(a),dn(c,u,!1)):u()}}});q(this,ru,e=>{x(this,Pr).delete(e);let t=Array.from(x(this,Pr).values());for(let[n,o]of x(this,vr))t.includes(n)||(Oe(o.effect),x(this,vr).delete(n))});this.anchor=e,j(this,ia,t)}ensure(e,t){var n=O,o=Bl();if(t&&!x(this,pn).has(e)&&!x(this,vr).has(e))if(o){var a=document.createDocumentFragment(),c=wt();a.append(c),x(this,vr).set(e,{effect:bt(()=>t(c)),fragment:a})}else x(this,
\r\f\xA0\v\uFEFF`];function pg(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var o of Object.keys(t))if(t[o])n=n?n+" "+o:o;else if(n.length)for(var a=o.length,c=0;(c=n.indexOf(o,c))>=0;){var u=c+a;(c===0||mg.includes(n[c-1]))&&(u===n.length||mg.includes(n[u]))?n=(c===0?"":n.substring(0,c))+n.substring(u+1):c=u}}return n===""?null:n}function bn(r,e,t,n,o,a){var c=r[Ns];if(L||c!==t||c===void 0){var u=pg(t,n,a);(!L||u!==r.getAttribute("class"))&&(u==null?r.removeAttribute("class"):e?r.className=u:r.setAttribute("class",u)),r[Ns]=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 lh();for(var n of r.options)n.selected=e.includes(la(n));return}for(n of r.options){var o=la(n);if(Uc(o,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Rd(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 ua(r,e,t=e){var n=new WeakSet,o=!0;Ml(r,"change",a=>{var h;var c=a?"[selected]":":checked",u;if(r.multiple)u=[].map.call(r.querySelectorAll(c),la);else{var f=(h=r.querySelector(c))!=null?h:r.querySelector("option:not([disabled])");u=f&&la(f)}t(u),r.__value=u,O!==null&&n.add(O)}),br(()=>{var a=e();if(r===document.activeElement){var c=it?fn:O;if(n.has(c))return}if(nu(r,a,o),o&&a===void 0){var u=r.querySelector(":checked");u!==null&&(a=la(u),t(a))}r.__value=a,o=!1}),Rd(r)}function la(r){return"__value"in r?r.__value:r.value}var Mw=Symbol("is custom element"),Xw=Symbol("is html"),Uw=Gc?"link":"LINK";function Td(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),Yl()}}function Ed(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Hr(r,e,t,n){var o=Qw(r);if(L&&(o[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Uw)){n||Lw(r,e,t!=null?t:"");return}o[e]!==(o[e]=t)&&(e==="loading"&&(r[Rp]=t),t==null?r.removeAttribute(e):typeof t!="string"&&Vw(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function Qw(r){var e,t;return(t=r[e=Il])!=null?t:r[e]={[Mw]:r.nodeName.includes("-"),[Xw]:r.namespaceURI===kl}}var hg=new Map;function Vw(r){var e=r.getAttribute("is")||r.nodeName,t=hg.get(e);if(t)return t;hg.set(e,t=[]);for(var n,o=r,a=Element.prototype;a!==o;){n=wl(o);for(var c in n)n[c].set&&c!=="innerHTML"&&c!=="textContent"&&c!=="innerText"&&t.push(c);o=Gi(o)}return t}function Lw(r,e,t){var n;R&&(e==="srcset"&&Ow(r,t)||Fd((n=r.getAttribute(e))!=null?n:"",t)||sh(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function Fd(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function gg(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Ow(r,e){var t=gg(r.srcset),n=gg(e);return n.length===t.length&&n.every(([o,a],c)=>a===t[c][1]&&(Fd(t[c][0],o)||Fd(o,t[c][0])))}function Dd(r,e,t=e){var n=new WeakSet;Ml(r,"input",async o=>{R&&r.type==="checkbox"&&Zc();var a=o?r.defaultValue:r.value;if(a=Gd(r)?Bd(a):a,t(a),O!==null&&n.add(O),await jn(),a!==(a=e())){var c=r.selectionStart,u=r.selectionEnd,f=r.value.length;if(r.value=a!=null?a:"",u!==null){var h=r.value.length;c===u&&u===f&&h>f?(r.selectionStart=h,r.selectionEnd=h):(r.selectionStart=c,r.selectionEnd=Math.min(u,h))}}}),(L&&r.defaultValue!==r.value||V(e)==null&&r.value)&&(t(Gd(r)?Bd(r.value):r.value),O!==null&&n.add(O)),gt(()=>{R&&r.type==="checkbox"&&Zc();var o=e();if(r===document.activeElement){var a=it?fn:O;if(n.has(a))return}Gd(r)&&o===Bd(r.value)||r.type==="date"&&!o&&!r.value||o!==r.value&&(r.value=o!=null?o:"")})}function Gd(r){var e=r.type;return e==="number"||e==="range"}function Bd(r){return r===""?null:+r}function Nd(r,e,t){var n=$t(r,e);n&&n.set&&(r[e]=t,pt(()=>{r[e]=null}))}function Wd(r,e){return r===e||(r==null?void 0:r[dt])=
2026-07-23 20:36:13 +08:00
${e}
`;return this._current.weeks.forEach(n=>{let o=" ";n.days.forEach(a=>{let c;a.date&&this._current.isThisMonth(a.date)?c=a.date.format("DD"):c=" ",o=o+c+" "}),t=t+o+`
2026-08-02 09:03:32 +08:00
`}),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 lC=ve('<th class="svelte-1lru178"> </th>'),uC=ve('<td><button tabindex="-1"> </button></td>'),cC=ve("<tr></tr>"),dC=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),c=jo(),u=xe(),f=xe(),h=xe();function b(){k(h).focus()}function _(Q){o(Q)}function g(Q){o(Q),w()}function v(){o(o().add(-1,"month"))}function y(){o(o().add(1,"month"))}function w(){c("select",o())}let C=new es;function A(Q){if(Q.key>="0"&&Q.key<="9"){Q.preventDefault();let ie=C.handle(Q.key);switch(ie.length){case 1:{let D=parseInt(ie);D>0&&o(o().set("date",D));break}case 2:ie.startsWith("0")&&(ie=ie.slice(1)),o(o().set("date",parseInt(ie)));break;case 4:{let D=ie.slice(0,2),ae=ie.slice(2,4);D.startsWith("0")&&(D=D.slice(1)),ae.startsWith("0")&&(ae=ae.slice(1)),o(o().set("month",parseInt(D)-1)),o(o().set("date",parseInt(ae)))}break}return}C.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(()=>{dd(f,k(f).style.width=k(u).clientWidth+"px")}),yi(()=>(ca,ts.default,at(o()),at(a())),()=>{z(t,new ca((0,ts.default)().startOf("day"),o().startOf("day"),a()))}),yi(()=>(ts.default,k(t)),()=>{z(n,Array.from({length:7},(Q,ie)=>(0,ts.default)().day((k(t).weekStart+ie)%7).format("ddd")))}),na();var G={focus:b,get value(){return o()},set value(Q){o(Q),J()},get weekStart(){return a()},set weekStart(Q){a(Q),J()},$set:yt,$on:(Q,ie)=>vt(e,Q,ie)};Bt();var Z=dC(),te=H(Z),le=H(te),M=we(le,2),pe=H(M,!0);X(M);var ye=we(M,2),Ge=H(ye,!0);X(ye);var He=we(ye,2);X(te);var he=we(te,2),Lt=H(he),Ze=H(Lt);zt(Ze,5,()=>k(n),Q=>Q,(Q,ie)=>{var D=lC(),ae=H(D,!0);X(D),$e(()=>Pe(ae,k(ie))),de(Q,D)}),X(Ze),X(Lt);var rt=we(Lt);zt(rt,5,()=>(k(t),V(()=>k(t).current.weeks)),Q=>Q.key,(Q,ie)=>{var D=cC();zt(D,5,()=>(k(ie),V(()=>k(ie).days)),ae=>ae.date.valueOf(),(ae,De)=>{var T=uC(),E=H(T);let _t;var Je=H(E,!0);X(E),X(T),$e((ut,Ve)=>{_t=bn(E,1,"calendar-date svelte-1lru178",null,_t,ut),Pe(Je,Ve)},[()=>({"is-selected":k(De).isToday(o()),"other-month":!k(t).current.isThisMonth(k(De).date),"is-holiday":k(De).isHoliday(),"is-past":k(De).date.isBefore(k(t).today)}),()=>(k(De),V(()=>k(De).date.format("D")))]),ce("click",E,()=>_(k(De).date)),ce("dblclick",E,()=>g(k(De).date)),de(ae,T)}),X(D),de(Q,D)}),X(rt),X(he),xt(he,Q=>z(u,Q),()=>k(u));var At=we(he,2),Kt=H(At);return Sd(Kt,e,"footer",{},null),X(At),xt(At,Q=>z(f,Q),()=>k(f)),X(Z),xt(Z,Q=>z(h,Q),()=>k(h)),$e((Q,ie)=>{Pe(pe,Q),Pe(Ge,ie)},[()=>(k(t),V(()=>k(t).current.monthStart.format("MMM"))),()=>(k(t),V(()=>k(t).current.monthStart.format("YYYY")))]),ce("click",le,()=>v()),ce("click",He,()=>y()),ce("focus",Z,()=>{c("focus")}),ce("blur",Z,()=>{c("blur")}),ce("keydown",Z,A),de(r,Z),Nd(e,"focus",b),qe(G)}var fC=ve("<option> </option>"),mC=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 c(){o("focus")}function u(){o("blur")}function f(){let y=[];for(let w=0;w<1440;w+=n()){let C
`)[u])!=null?b:"",h=r.state.doc.line(u+1);r.dispatch({changes:{from:h.from,to:h.to,insert:f},effects:[da.of()]})}var IC=300,Dg=is.Annotation.define();function Od(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 c=(a=(o=(n=e.field(gu.editorInfoField,!1))==null?void 0:n.file)==null?void 0:o.path)!=null?a:"",u=new Fn(c,e.doc.toString());return Fg(e.doc,yo(u))}catch(c){return console.error("Failed to parse reminders for editor pills.",c),[]}}function Ld(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 wC(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 CC(r){return is.StateField.define({create(e){let t=Od(r,e);return{decos:Ld(e,t,r),cache:t}},update(e,t){let n=e.decos.map(t.changes),o=t.docChanged?wC(e.cache,t.changes):e.cache,a=t.annotation(Dg);a!==void 0&&(o=a);let c=t.docChanged&&o.some(b=>t.changes.touchesRange(b.from,b.to)),u=t.effects.some(b=>b.is(da));if(c||t.reconfigured||u&&a===void 0)return o=Od(r,t.state),n=Ld(t.state,o,r),{decos:n,cache:o};let h=!t.startState.selection.eq(t.state.selection);return(a!==void 0||h)&&(n=Ld(t.state,o,r)),{decos:n,cache:o}},provide:e=>os.EditorView.decorations.from(e,t=>t.decos)})}function xC(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=Od(r,this.view.state);this.view.dispatch({annotations:Dg.of(t),effects:[da.of()]})},IC))}destroy(){this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}})}function $d(r){return[CC(r),xC(r)]}var bu=require("@codemirror/state"),Ii=require("@codemirror/view"),Pd=bu.StateEffect.define();function AC(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 kC=bu.StateField.define({create(){return Ii.Decoration.none},update(r,e){let t=e.effects.find(n=>n.is(Pd));return t!==void 0?AC(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 Ng(){return kC}var Yg=require("obsidian");var Wg=require("obsidian");var SC=ve('<div class="icon-text svelte-1qeb5yo"><span class="icon svelte-1qeb5yo"></span> <span class="text svelte-1qeb5yo"> </span></div>');function ss(r,e){if(new.target)return lt({component:ss,...r});Ke(e,!1);let t=re(e,"icon",12,""),n=re(e,"text",12,""),o=xe();Jo(()=>{(0,Wg.setIcon)(k(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,_)=>vt(e,b,_)};Bt();var c=SC(),u=H(c);xt(u,b=>z(o,b),()=>k(o));var f=we(u,2),h=H(f,!0);return X(f),X(c),$e(()=>Pe(h,n())),de(r,c),qe(a)}var RC=ve('<button class="reminder-toast-close svelte-1u4loek" aria-label="Close">\xD7</button>'),FC=ve("<option> </option>"),TC=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>'),EC=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 /
`)}},xu=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-02 09:03:32 +08:00
`)}},Au=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",ku=class{constructor(){m(this,"settings",new Iu);m(this,"reminderTime");m(this,"reminderTimeStep");m(this,"enableNotification");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 uf(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 wu),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new Ie),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 Ie),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 Ie),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 Ie),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new Ie),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 Ie),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 seconds. Only effective on Windows and Linux; ignored on macOS. Enable this if you use the same vault on multiple devices (e.g. via Obsidian Sync): it allows the plugin to dismiss the notification when you complete or snooze the reminder on another device.").toggle(!1).onAnyValueChanged(a=>{a.setEnabled(this.useSystemNotification.value)}).build(new Ie),this.focusDoneButtonOnPopup=this.settings.newSettingBuilder().key("focusDoneButtonOnPopup").name("Focus Done button on popup").desc("Automatically focus th
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-02 09:03:32 +08:00
Next week`).build(new Cu);let t=this.settings.newSettingBuilder().key("weekStart").name("Week start").desc("Select the first day of the week").dropdown("0");Array.from({length:7},(a,c)=>{let u=(0,Ug.default)().day(c).format("dddd");t.addOption(u,c.toString())}),this.weekStart=t.build(new Ie),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 Ie),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 Ie),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 Ie),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 Ie),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(a=>{let c=this.autoCompleteTrigger.value;a.setInfo(`Popup is ${c.length===0?"disabled":"enabled"}`)}).build(new Ie),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 Ie),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 Ie);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 Au),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 xu),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),this.settings.newPage("Notifications").newGroup().addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.enableNotification,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 Cs;e.setParameterFunc(Qe.now,()=>$.now()),e.setParameter(Qe.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),e.setParameter(Qe.linkDatesToDailyNote
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 */