"use strict";varT_=Object.create;varys=Object.defineProperty;varE_=Object.getOwnPropertyDescriptor;varG_=Object.getOwnPropertyNames;varB_=Object.getPrototypeOf,D_=Object.prototype.hasOwnProperty;varem=r=>{throwTypeError(r)};varN_=(r,e,t)=>einr?ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;varW_=(r,e)=>()=>{try{returne||r((e={exports:{}}).exports,e),e.exports}catch(t){throwe=0,t}},Z_=(r,e)=>{for(vartine)ys(r,t,{get:e[t],enumerable:!0})},tm=(r,e,t,n)=>{if(e&&typeofe=="object"||typeofe=="function")for(letoofG_(e))!D_.call(r,o)&&o!==t&&ys(r,o,{get:()=>e[o],enumerable:!(n=E_(e,o))||n.enumerable});returnr};varWr=(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);varm=(r,e,t)=>N_(r,typeofe!="symbol"?e+"":e,t),Ku=(r,e,t)=>e.has(r)||em("Cannot "+t);varx=(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"):einstanceofWeakSet?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);varwr=W_((ic,no)=>{(function(r,e){typeofic=="object"&&typeofno!="undefined"?no.exports=e():typeofdefine=="function"&&define.amd?define(e):r.moment=e()})(ic,(function(){"use strict";varr;functione(){returnr.apply(null,arguments)}functiont(i){r=i}functionn(i){returniinstanceofArray||Object.prototype.toString.call(i)==="[object Array]"}functiono(i){returni!=null&&Object.prototype.toString.call(i)==="[object Object]"}functiona(i,s){returnObject.prototype.hasOwnProperty.call(i,s)}functionc(i){if(Object.getOwnPropertyNames)returnObject.getOwnPropertyNames(i).length===0;vars;for(sini)if(a(i,s))return!1;return!0}functionu(i){returni===void0}functionf(i){returntypeofi=="number"||Object.prototype.toString.call(i)==="[object Number]"}functionh(i){returniinstanceofDate||Object.prototype.toString.call(i)==="[object Date]"}functionb(i,s){varl=[],d,p=i.length;for(d=0;d<p;++d)l.push(s(i[d],d));returnl}function_(i,s){for(varlins)a(s,l)&&(i[l]=s[l]);returna(s,"toString")&&(i.toString=s.toString),a(s,"valueOf")&&(i.valueOf=s.valueOf),i}functiong(i,s,l,d){returnEf(i,s,l,d,!0).utc()}functionv(){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}}functiony(i){returni._pf==null&&(i._pf=v()),i._pf}varw;Array.prototype.some?w=Array.prototype.some:w=function(i){vars=Object(this),l=s.length>>>0,d;for(d=0;d<l;d++)if(dins&&i.call(this,s[d],d,s))return!0;return!1};functionC(i){vars=null,l=!1,d=i._d&&!isNaN(i._d.getTime());if(d&&(s=y(i),l=w.call(s.parsedDateParts,function(p){returnp!=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===void0)),Object.isFrozen==null||!Object.isFrozen(i))i._isValid=d;elsereturnd;returni._isValid}functionA(i){vars=g(NaN);returni!=null?_(y(s),i):y(s).userInvalidated=!0,s}varG=e.momentProperties=[],Z=!1;functionte(i,s){varl,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);returni}functionle(i){te(this,i),this._d=newDate(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=newDate(NaN)),Z===!1&&(Z=!0,e.updateOffset(this),Z=!1)}functionM(i){returniinstanceofle||i!=null&&i._isAMomentObject!=null}functionpe(i){e.suppressDeprecationWarnings===!1&&typeofconsol
[`+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+`
`;functionnm(r,e){return`${r}${Q_}${e}`}functionim(r,e,t){letn=nm(r,e),o=rm(n,X_).toString(36),a=rm(n,U_).toString(36),c=`${ec}${o}${a}`;returnt===0?c:`${c}-${t}`}functiontc(r){varo;lete=[...r].sort((a,c)=>a.file!==c.file?a.file<c.file?-1:1:a.rowNumber-c.rowNumber),t=newMap,n=newMap;for(letaofe){letc=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))}returnn}varV_=10,L_=1440*60;functionrc(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),_=newMap;for(letCofe){letA=C.time.getTimeInMillis(o),G=b.get(C);_.set(G,Math.floor(A/1e3))}letg=newMap;for(letCofe){letA=C.time.getTimeInMillis(o);if(A<=f||A>h)continue;letG=b.get(C);g.set(G,{sequenceId:G,atSeconds:Math.floor(A/1e3),reminder:C})}letv=newMap;for(letCoft)v.set(C.sequenceId,C);lety=[];for(letCofg.values()){letA=v.get(C.sequenceId);(A===void0||A.atSeconds!==C.atSeconds)&&y.push(C)}letw=[];for(letCoft){if(!Da(C.sequenceId)||g.has(C.sequenceId))continue;letA=_.get(C.sequenceId);(A===void0||A!==C.atSeconds)&&w.push({sequenceId:C.sequenceId})}return{publish:y,delete:w}}functionnc(r){returnr.map(e=>e.sequenceId).filter(Da)}varro=class{constructor(e){m(this,"_value",e)}getvalue(){returnthis._value}},oi=class{constructor(e){m(this,"_value",e);m(this,"onChangeFunctions",[])}onChanged(e){this.onChangeFunctions.push(e)}getvalue(){returnthis._value}setvalue(e){lett=this._value;this._value=e,this.onChangeFunctions.forEach(n=>{n(t,e)})}};varsr=Wr(wr(),1);var$=classr{constructor(e,t){m(this,"time",e);m(this,"_hasTimePart",t)}staticnow(){returnnewr((0,sr.default)(),!0)}staticparse(e){returne.length>10?newr((0,sr.default)(e,"YYYY-MM-DD HH:mm"),!0):newr((0,sr.default)(e,"YYYY-MM-DD"),!1)}staticofEpochMillis(e){returnnewr((0,sr.default)(e),!0)}staticduration(e,t,n,o){returnt.fixedTime(o).diff(e.fixedTime(o),n)}getTimeInMillis(e){returnthis.fixedTime(e).valueOf()}format(e,t){returnthis.fixedTime(t).format(e)}toYYYYMMMM(e){returnthis.fixedTime(e).format("YYYY, MMMM")}toYYYYMMDD(e){returnthis.fixedTime(e).format("YYYY-MM-DD")}add(e,t,n){returnnewr(this.fixedTime(n).clone().add(e,t),this._hasTimePart)}fixedTime(e){returnthis._hasTimePart?this.time:e===void0?this.time:this.time.clone().add(e.minutes,"minutes")}gethasTimePart(){returnthis._hasTimePart}moment(){returnthis.time}isValid(){returnthis.time.isValid()}clone(e){lett=e==null?this._hasTimePart:e,n=this.time.clone();returnnewr(n,t)}toString(){returnthis._hasTimePart?this.format("YYYY-MM-DD HH:mm"):this.format("YYYY-MM-DD")}equals(e){returnthis._hasTimePart===e._hasTimePart&&this.time.isSame(e.time)}},Na=classr{constructor(e,t){m(this,"hour",e);m(this,"minute",t)}staticparse(e){if(!e.match(/^\d{1,2}:\d{1,2}$/))throw`Unexpected format time(${e}). Time must be HH:mm.`;lett=e.split(":");if(t.length!==2)throw`Unexpected format time(${e}). time must be HH:mm.`;letn=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";returnnewr(n,o)}getminutes(){returnthis.hour*60+this.minute}toString(){lete=t=>t<10?"0"+t:""+t;return`${e(this.hour)}:${e(this.minute)}`}};functionio(r,e){return()=>new$((0,sr.default)(),!0).add(r,e)}functionom(r){returnio(r,"minutes")}functionoc(r){returnio(r,"hours")}functionO_(r){returnio(r,"days")}function$_(r){returnio(r,"weeks")}functionP_(r){returnio(r,"months")}functionH_(r){returnio(r,"years")}functionki(r){return()=>{lete=(0,sr.default)();returne.isoWeekday()<=r?new$(e.isoWeekday(r),!1):new$(e.add(1,"weeks").isoWeekday(r),!1)}}functionsc(){return()=>new$((0,sr.default)().add(1,"days"),!1)}functionsm(){return()=>new$((0,sr.default)().add(1,"weeks"),!1)}functionJ_(){return()=>new$((0,sr.default)().add(1,"months"),!1)}functionj_(){return()=>new$((0,sr.default)().add(1,"years"),!1)}varXe=class{constructor(e,t){m(this,"label",e);m(this,"later",t)}};functionam(r){returnr.split(`
`).map(e=>z_(e.trim()))}functionz_(r){if(r=r.toLowerCase(),r.startsWith("in")){lete=r.split(" ");if(e.length!==3)throw"Unsupported format. Should be 'In N (minutes|hours)'";lett=e[1]==="a"||e[1]==="an"?1:parseInt(e[1]);switch(e[2]){case"minute":case"minutes":{letn=t==1?"minute":"minutes";returnnewXe(`In ${t}${n}`,om(t))}case"hour":case"hours":{letn=t==1?"hour":"hours";returnnewXe(`In ${t}${n}`,oc(t))}case"day":case"days":{letn=t==1?"day":"days";returnnewXe(`In ${t}${n}`,O_(t))}case"week":case"weeks":{letn=t==1?"week":"weeks";returnnewXe(`In ${t}${n}`,$_(t))}case"month":case"months":{letn=t==1?"month":"months";returnnewXe(`In ${t}${n}`,P_(t))}case"year":case"years":{letn=t==1?"year":"years";returnnewXe(`In ${t}${n}`,H_(t))}}}elseif(r.startsWith("next")){lete=r.substring(5);switch(e){case"sunday":returnnewXe("Next Sunday",ki(0));case"monday":returnnewXe("Next Monday",ki(1));case"tuesday":returnnewXe("Next Tuesday",ki(2));case"wednesday":returnnewXe("Next Wednesday",ki(3));case"thursday":returnnewXe("Next Thursday",ki(4));case"friday":returnnewXe("Next Friday",ki(5));case"saturday":returnnewXe("Next Saturday",ki(6));case"day":returnnewXe("Tomorrow",sc());case"week":returnnewXe("Next week",sm());case"month":returnnewXe("Next month",J_());case"year":returnnewXe("Next year",j_());default:throw`Unsupported weekday: ${e}`}}elseif(r==="tomorrow")returnnewXe("Tomorrow",sc());throw`Unsupported format: ${r}`}varlc=[newXe("In 30 minutes",om(30)),newXe("In 1 hours",oc(1)),newXe("In 3 hours",oc(3)),newXe("Tomorrow",sc()),newXe("Next week",sm())],ac=class{constructor(){m(this,"dateFormat",newro("YYYY-MM-DD"));m(this,"dateTimeFormat",newro("YYYY-MM-DD HH:mm"));m(this,"strict",newro(!1))}setTimeFormat(e,t,n){this.dateFormat=e,this.dateTimeFormat=t,this.strict=n}parse(e){lett=this.doParse(e,!0);returnt!=null?t:this.strict.value?null:this.doParse(e,!1)}doParse(e,t){letn=(0,sr.default)(e,this.dateTimeFormat.value,t);if(n.isValid())returnnew$(n,!0);leto=(0,sr.default)(e,this.dateFormat.value,t);returno.isValid()?new$(o,!1):null}toString(e){returne.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},jr=newac;varWa=require("obsidian");varK_=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!==void0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void0)}notifyRemindersChanged(){this.stopped||(this.debounceTimer!==void0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void0,this.sync()},q_))}notifySettingsChanged(){this.stopped||(this.checkEnabledTransition(),this.notifyRemindersChanged())}checkEnabledTransition(){lete=this.deps.isEnabled(),t=this.previousEnabled;this.previousEnabled=e,t===!0&&!e&&this.cleanupAfterDisable()}asynccleanupAfterDisable(){lete=this.resolveServerAndTopic();if(e===void0)return;let{serverUrl:t,topic:n}=e;try{leto=awaitthis.fetchPending(t,n),a=nc(o);for(letcofa)awaitthis.deleteScheduled(t,n,c)}catch(o){console.error("[ntfy] Failed to clean up scheduled notifications after disabling: %o",o)}}asyncsync(){if(this.syncing){this.syncQueued=!0;return}this.syncing=!0;try{awaitthis.doSync()}finally{this.syncing=!1,this.syncQueued&&(this.syncQueued=!1,this.sync())}}asyncdoSync(){if(!this.deps.isEnabled())return;lete=this.resolveServerAndTopic();if(e===void0)return;let{serverUrl:t,topic:n}=e;try{leto=awaitthis.fetchPending(t,n),a=rc({reminders:this.deps.reminders(),serverPending:o,now:$.now(),defaultTime:this.deps.defaultTime()});for(letcofa.delete)awaitthis.deleteScheduled(t,n,c.sequenceId);for(letcofa.publish)awaitthis.publish(t,n,c)}catch(o){console.error("[ntfy] Failed to sync scheduled notifications: %o",o)}}resolveServerAndTopic(){let
`)},e.prototype.clone=function(){vart=newe(!!this._cache);returnthis._rrule.forEach(function(n){returnt.rrule(n.clone())}),this._exrule.forEach(function(n){returnt.exrule(n.clone())}),this._rdate.forEach(function(n){returnt.rdate(newDate(n.getTime()))}),this._exdate.forEach(function(n){returnt.exdate(newDate(n.getTime()))}),t},e})(U);functionap(r,e){if(!(rinstanceofU))thrownewTypeError(String(r)+" is not RRule instance");be(e.map(String),String(r))||e.push(r)}functionlp(r,e){if(!(rinstanceofDate))thrownewTypeError(String(r)+" is not Date instance");be(e.map(Number),Number(r))||(e.push(r),En(e))}functionup(r,e,t){varn=!t||t.toUpperCase()==="UTC",o=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(c){returnuo(c.valueOf(),n)}).join(",");return"".concat(o).concat(a)}functionpo(r,e,t){letn;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();leto=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);leta=e.clone();n.dtstart=e.utc(!0).toDate();letu=newU(n).after(e.toDate(),!1);if(u==null)return;letf=u.getTime()-n.dtstart.getTime();returna.add(f,"millisecond"),a.toDate()}functionqa(r){returnr.replace(/#[\p{L}\p{N}\p{M}_/-]+/gu,"").trim()}varho=classextendsli{modifyReminder(e,t,n,o){if(!super.modifyReminder(e,t,n,o))return!1;if(o.checked!==void0)if(o.checked){leta=n.getRecurrence();if(a!==null){letc=t.clone(),u=n.clone(),f=n.getDueDate(),h=this.config.getParameter(Qe.now);if(this.usesSeparateReminderDate(n)){letb=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){letg=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;letb=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))}elsen.setDoneDate(void0);return!0}};varDI=["YYYY-MM-DDTHH:mm","YYYY-MM-DD HH:mm"],Cc="YYYY-MM-DD";functionIc(r){for(lettofDI){letn=(0,wc.default)(r,t,!0);if(n.isValid())returnnew$(n,!0)}lete=(0,wc.default)(r,Cc,!0);returne.isValid()?new$(e,!1):null}functioncp(r){returnr.hasTimePart?r.format("YYYY-MM-DDTHH:mm"):r.format(Cc)}varEi="due",el="completion",dp="repeat",NI="scheduled",WI="start",ZI=[Ei,el,dp,NI,WI],tl=classr{constructor(e,t,n){m(this,"text",e);m(this,"reminderFieldName",t);m(this,"removeTags",n)}staticparse(e,t,n){returnnewr(e,t.toLowerCase(),n!=null?n:!1)}fields(){returnCm(this.text)}fieldsByKey(e){returnthis.fields().filter(t=>t.key.toLowerCase()===e)}firstField(e){vart;return(t=this.fieldsByKey(e)[0])!=null?t:null}hasReminderField(){returnthis.firstField(this.reminderFieldName)!=null}hasAnySourceField(){returnthis.hasReminderField()||this.firstField(Ei)!=null}reminderSourceField(){vare;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Ei)}getTitle(){lete=newSet([...ZI,this.reminderFieldName]),t=this.fields().filter(o=>e.has(o.key.toLowerCase())).sort((o,a)=>a.start-o.start),n=this.text;for(letooft)n=cc(n,o);returnn=n.trim(),this.removeTags&&(n=qa(n)),n}getTime(){lete=this.reminderSourceField();returne==null?null:Ic(e.value)}setTime(e){varo;lett=this.reminderSourceField(),n=(o=t==null?void0:t.key)!=null?o:Ei;this.setFieldValue(n,cp(e))}setRawTime(e){varo;lett=this.reminderSourceField(),n=(o=t==null?void0:t.key)!=null?o:Ei;returnthis.setFieldValue(n,e),!0}getDueDate(){lete=this.firstField(Ei);returne==null?null:Ic(e.value)}setDueDate(e){this.setFieldValue(Ei,cp(e))}getRecurrence(){vart;lete=this.firstField(dp);return(t=e==null?void0:e.value)!=null?t:null}getDoneDate(){lete=this.firstField(el);returne==null?null:Ic(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(el);return}lett=einstanceof$?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
Aninvariantviolationoccurred,meaningSvelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${r}"
https://svelte.dev/e/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
Keyed each block has key that is not idempotent \u2014 the key for item at index ${r} was \`${e}\` but is now \`${t}\`. Keys must be the same each time for a given item
https://svelte.dev/e/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
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(`
%cAn async derived, \`${r}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
%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
%c${r?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${r}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/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
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${r}\` will produce unexpected results
`)}},Au=class{unmarshal(e){lett=_o.find(n=>n.name===e);returnt!==void0?t:(console.warn(`Unknown reminder format: ${e}. Falling back to the default format.`),_o[0])}marshal(e){returne.name}};varyr="re-scan",ku=class{constructor(){m(this,"settings",newIu);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");lete=newuf(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(newwu),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(newIe),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(newIe),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(newIe),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(newIe),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(newIe),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(newIe),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(newIe),this.focusDoneButtonOnPopup=this.settings.newSettingBuilder().key("focusDoneButtonOnPopup").name("Focus Done button on popup").desc("Automatically focus th
Next week`).build(new Cu);let t=this.settings.newSettingBuilder().key("weekStart").name("Weekstart").desc("Selectthefirstdayoftheweek").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("Dateformat").desc("momentstyledateformat: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(`Momentstyleyearandmonthformat:
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