/ *
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository
* /
/ *
License obsidian - tasks :
MIT License
Copyright ( c ) 2021 Martin Schenck and Clare Macrae
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the "Software" ) , to deal
in the Software without restriction , including without limitation the rights
to use , copy , modify , merge , publish , distribute , sublicense , and / or sell
copies of the Software , and to permit persons to whom the Software is
furnished to do so , subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED "AS IS" , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER
LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM ,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE .
* /
/ *
License rrule ( included library ) :
rrule . js : Library for working with recurrence rules for calendar dates .
=== === === === === === === === === === === === === === === === === === === === === === === ==
Copyright 2010 , Jakub Roztocil < jakub @ roztocil . name > and Lars Schöning
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are met :
1. Redistributions of source code must retain the above copyright notice ,
this list of conditions and the following disclaimer .
2. Redistributions in binary form must reproduce the above copyright
notice , this list of conditions and the following disclaimer in the
documentation and / or other materials provided with the distribution .
3. Neither the name of The author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission .
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED . IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR
ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
. / rrule . js and . / test / tests . js is based on python - dateutil . LICENCE :
python - dateutil - Extensions to the standard Python datetime module .
=== === === === === === === === === === === === === === === === === === === === === === ==
Copyright ( c ) 2003 - 2011 - Gustavo Niemeyer < gustavo @ niemeyer . net >
Copyright ( c ) 2012 - Tomi Pieviläinen < tomi . pievilainen @ iki . fi >
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are met :
* Redistributions of source code must retain the above copyright notice ,
this list of conditions and the following disclaimer .
* Redistributions in binary form must reproduce the above copyright notice ,
this list of conditions and the following disclaimer in the documentation
and / or other materials provided with the distribution .
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission .
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL ,
EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO ,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR
PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
* /
/ *
License chrono - node ( included library ) :
The MIT License
Copyright ( c ) 2014 , Wanasit Tanakitrungruang
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the "Software" ) , to deal
in the Software without restriction , including without limitation the rights
to use , copy , modify , merge , publish , distribute , sublicense , and / or sell
copies of the Software , and to permit persons to whom the Software is
furnished to do so , subject to the following conditions :
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED "AS IS" , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER
LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM ,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE .
* /
"use strict" ; var mE = Object . create ; var Li = Object . defineProperty , yE = Object . defineProperties , gE = Object . getOwnPropertyDescriptor , _E = Object . getOwnPropertyDescriptors , TE = Object . getOwnPropertyNames , Gp = Object . getOwnPropertySymbols , bE = Object . getPrototypeOf , zp = Object . prototype . hasOwnProperty , vE = Object . prototype . propertyIsEnumerable ; var Hp = ( r , e , t ) => e in r ? Li ( r , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : t } ) : r [ e ] = t , Qe = ( r , e ) => { for ( var t in e || ( e = { } ) ) zp . call ( e , t ) && Hp ( r , t , e [ t ] ) ; if ( Gp ) for ( var t of Gp ( e ) ) vE . call ( e , t ) && Hp ( r , t , e [ t ] ) ; return r } , tr = ( r , e ) => yE ( r , _E ( e ) ) ; var O = ( r , e ) => ( ) => ( e || r ( ( e = { exports : { } } ) . exports , e ) , e . exports ) , wE = ( r , e ) => { for ( var t in e ) Li ( r , t , { get : e [ t ] , enumerable : ! 0 } ) } , Vp = ( r , e , t , n ) => { if ( e && typeof e == "object" || typeof e == "function" ) for ( let s of TE ( e ) ) ! zp . call ( r , s ) && s !== t && Li ( r , s , { get : ( ) => e [ s ] , enumerable : ! ( n = gE ( e , s ) ) || n . enumerable } ) ; return r } ; var ns = ( r , e , t ) => ( t = r != null ? mE ( bE ( r ) ) : { } , Vp ( e || ! r || ! r . _ _esModule ? Li ( t , "default" , { value : r , enumerable : ! 0 } ) : t , r ) ) , EE = r => Vp ( Li ( { } , "__esModule" , { value : ! 0 } ) , r ) ; var J = ( r , e , t ) => new Promise ( ( n , s ) => { var a = c => { try { l ( t . next ( c ) ) } catch ( h ) { s ( h ) } } , o = c => { try { l ( t . throw ( c ) ) } catch ( h ) { s ( h ) } } , l = c => c . done ? n ( c . value ) : Promise . resolve ( c . value ) . then ( a , o ) ; l ( ( t = t . apply ( r , e ) ) . next ( ) ) } ) ; var Tm = O ( ( DF , So ) => { var Qp , Jp , em , tm , rm , nm , sm , im , am , ko , Ml , om , um , lm , js , cm , dm , fm , hm , pm , mm , ym , gm , _m , Do ; ( function ( r ) { var e = typeof global == "object" ? global : typeof self == "object" ? self : typeof this == "object" ? this : { } ; typeof define == "function" && define . amd ? define ( "tslib" , [ "exports" ] , function ( n ) { r ( t ( e , t ( n ) ) ) } ) : typeof So == "object" && typeof So . exports == "object" ? r ( t ( e , t ( So . exports ) ) ) : r ( t ( e ) ) ; function t ( n , s ) { return n !== e && ( typeof Object . create == "function" ? Object . defineProperty ( n , "__esModule" , { value : ! 0 } ) : n . _ _esModule = ! 0 ) , function ( a , o ) { return n [ a ] = s ? s ( a , o ) : o } } } ) ( function ( r ) { var e = Object . setPrototypeOf || { _ _proto _ _ : [ ] } instanceof Array && function ( n , s ) { n . _ _proto _ _ = s } || function ( n , s ) { for ( var a in s ) Object . prototype . hasOwnProperty . call ( s , a ) && ( n [ a ] = s [ a ] ) } ; Qp = function ( n , s ) { if ( typeof s != "function" && s !== null ) throw new TypeError ( "Class extends value " + String ( s ) + " is not a constructor or null" ) ; e ( n , s ) ; function a ( ) { this . constructor = n } n . prototype = s === null ? Object . create ( s ) : ( a . prototype = s . prototype , new a ) } , Jp = Object . assign || function ( n ) { for ( var s , a = 1 , o = arguments . length ; a < o ; a ++ ) { s = arguments [ a ] ; for ( var l in s ) Object . prototype . hasOwnProperty . call ( s , l ) && ( n [ l ] = s [ l ] ) } return n } , em = function ( n , s ) { var a = { } ; for ( var o in n ) Object . prototype . hasOwnProperty . call ( n , o ) && s . indexOf ( o ) < 0 && ( a [ o ] = n [ o ] ) ; if ( n != null && typeof Object . getOwnPropertySymbols == "function" ) for ( var l = 0 , o = Object . getOwnPropertySymbols ( n ) ; l < o . length ; l ++ ) s . indexOf ( o [ l ] ) < 0 && Object . prototype . propertyIsEnumerable . call ( n , o [ l ] ) && ( a [ o [ l ] ] = n [ o [ l ] ] ) ; return a } , tm = function ( n , s , a , o ) { var l = arguments . length , c = l < 3 ? s : o === null ? o = Object . getOwnPropertyDescriptor ( s , a ) : o , h ; if ( typeof Reflect == "object" && typeof Reflect . decorate == "function" ) c = Reflect . decorate ( n , s , a , o ) ; else for ( var m = n . length - 1 ; m >= 0 ; m -- ) ( h = n [ m ] ) && ( c = ( l < 3 ? h ( c ) : l > 3 ? h ( s , a , c ) : h ( s , a ) ) || c ) ; return l > 3 && c && Object . defineProperty ( s , a , c ) , c } , rm = function ( n , s ) { return function ( a , o ) { s ( a , o , n ) } } , nm = function ( n , s ) { if ( typeof Reflect == "object" && typeof Reflect . metadata == "function" ) return Reflect . metadata ( n , s ) } , sm = function ( n , s , a , o ) { function l ( c ) { return c instanceof a ? c : new a ( function ( h ) { h ( c ) } ) } return new ( a || ( a = Promise ) ) ( function ( c , h ) { function m ( D ) { try { T ( o . next ( D ) ) } catch ( v ) { h ( v ) } } function _ ( D ) { try { T ( o . throw ( D ) ) } catch ( v ) { h ( v ) } } function T ( D ) { D . done ? c ( D . value ) : l ( D . value ) . then ( m , _ ) } T ( ( o = o . apply ( n , s || [ ] ) ) . next ( ) ) } ) } , im = function ( n , s ) { var a = { label : 0 , sent : function ( ) { if ( c [ 0 ] & 1 ) throw c [ 1 ] ; return c [ 1 ] } , trys : [ ] , ops : [ ] } , o , l , c , h ; return h = { next : m ( 0 ) , throw : m ( 1 ) , return : m ( 2 ) } , typeof Symbol == "function" && ( h [ Symbol . iterator ] = function ( ) { return this } ) , h ; function m ( T ) { return function ( D ) { return _ ( [ T , D ] ) } } function _ ( T ) { if ( o ) throw new TypeError ( "Generator is already executing." ) ; for ( ; a ; ) try { if ( o = 1 , l && ( c = T [ 0 ] & 2 ? l . return : T [ 0 ] ? l . throw || ( ( c = l . return ) && c . call ( l ) , 0 ) : l . next ) && ! ( c = c . call ( l , T [ 1 ] ) ) . done ) return c ; switch ( l = 0 , c && ( T = [ T [ 0 ] & 2 , c . value ] ) , T [ 0 ] ) { case 0 : case 1 : c = T ; break ; case 4 : return a . label ++ , { value : T [ 1 ] , done : ! 1 } ; case 5 : a . label ++ , l = T [ 1 ] ,
[ ` +b+"] ";for(x in arguments[0])a(arguments[0],x)&&(p+=x+": "+arguments[0][x]+", ");p=p.slice(0,-2)}else p=arguments[b];f.push(p)}ee(i+ `
Arguments : ` +Array.prototype.slice.call(f).join("")+ `
` +new Error().stack),d=!1}return u.apply(this,arguments)},u)}var It={};function yt(i,u){e.deprecationHandler!=null&&e.deprecationHandler(i,u),It[i]||(ee(u),It[i]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function V(i){return typeof Function!="undefined"&&i instanceof Function||Object.prototype.toString.call(i)==="[object Function]"}function W(i){var u,d;for(d in i)a(i,d)&&(u=i[d],V(u)?this[d]=u:this["_"+d]=u);this._config=i,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/ \d {1,2}/.source)}function P(i,u){var d=_({},i),f;for(f in u)a(u,f)&&(s(i[f])&&s(u[f])?(d[f]={},_(d[f],i[f]),_(d[f],u[f])):u[f]!=null?d[f]=u[f]:delete d[f]);for(f in i)a(i,f)&&!a(u,f)&&s(i[f])&&(d[f]=_({},d[f]));return d}function Q(i){i!=null&&this.set(i)}var Y;Object.keys?Y=Object.keys:Y=function(i){var u,d=[];for(u in i)a(i,u)&&d.push(u);return d};var ue={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function y(i,u,d){var f=this._calendar[i]||this._calendar.sameElse;return V(f)?f.call(u,d):f}function g(i,u,d){var f=""+Math.abs(i),p=u-f.length,b=i>=0;return(b?d?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+f}var w=/( \[ [^ \[ ]* \] )|( \\ )?([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,E=/( \[ [^ \[ ]* \] )|( \\ )?(LTS|LT|LL?L?L?|l{1,4})/g,S={},M={};function k(i,u,d,f){var p=f;typeof f=="string"&&(p=function(){return this[f]()}),i&&(M[i]=p),u&&(M[u[0]]=function(){return g(p.apply(this,arguments),u[1],u[2])}),d&&(M[d]=function(){return this.localeData().ordinal(p.apply(this,arguments),i)})}function C(i){return i.match(/ \[ [ \s \S ]/)?i.replace(/^ \[ | \] $ /g,""):i.replace(/ \\ /g,"")}function A(i){var u=i.match(w),d,f;for(d=0,f=u.length;d<f;d++)M[u[d]]?u[d]=M[u[d]]:u[d]=C(u[d]);return function(p){var b="",x;for(x=0;x<f;x++)b+=V(u[x])?u[x].call(p,i):u[x];return b}}function N(i,u){return i.isValid()?(u=j(u,i.localeData()),S[u]=S[u]||A(u),S[u](i)):i.localeData().invalidDate()}function j(i,u){var d=5;function f(p){return u.longDateFormat(p)||p}for(E.lastIndex=0;d>=0&&E.test(i);)i=i.replace(E,f),E.lastIndex=0,d-=1;return i}var ke={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 ye(i){var u=this._longDateFormat[i],d=this._longDateFormat[i.toUpperCase()];return u||!d?u:(this._longDateFormat[i]=d.match(w).map(function(f){return f==="MMMM"||f==="MM"||f==="DD"||f==="dddd"?f.slice(1):f}).join(""),this._longDateFormat[i])}var ce="Invalid date";function Ie(){return this._invalidDate}var K="%d",We=/ \d {1,2}/;function Je(i){return this._ordinal.replace("%d",i)}var Ke={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 Dr(i,u,d,f){var p=this._relativeTime[d];return V(p)?p(i,u,d,f):p.replace(/%d/i,i)}function Mt(i,u){var d=this._relativeTime[i>0?"future":"past"];return V(d)?d(u):d.replace(/%s/i,u)}var Ae={};function st(i,u){var d=i.toLowerCase();Ae[d]=Ae[d+"s"]=Ae[u]=i}function gt(i){return typeof i=="string"?Ae[i]||Ae[i.toLowerCase()]:void 0}function kn(i){var u={},d,f;for(f in i)a(i,f)&&(d=gt(f),d&&(u[d]=i[f]));return u}var Ri={};function qe(i,u){Ri[i]=u}function Ns(i){var u=[],d;for(d in i)a(i,d)&&u.push({unit:d,priority:Ri[d]});return u.sort(function(f,p){return f.priority-p.priority}),u}function Kn(i){return i%4===0&&i%100!==0||i%400===0}function ft(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function de(i){var u=+i,d=0;return u!==0&&isFinite(u)&&(d=ft(u)),d}function Vr(i,u){return function(d){return d!=null?(Zn(this,i,d),e.updateOffset(this,u),this):Rt(this,i)}}function Rt(i,u){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+u]():NaN}function Zn(i,u,d){i.isValid()&&!isNaN(d)&&(u==="FullYear"&&Kn(i.ye
` ).map(NE).filter(function(t){return t!==null});return Bt(Bt({},e[0]),e[1])}function ji(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^; \s ]+)/i.exec(r);if(!t)return e;var n=t[1],s=t[2];return n&&(e.tzid=n),e.dtstart=ie.untilStringToDate(s),e}function NE(r){if(r=r.replace(/^ \s +| \s + $ /,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Rm(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Rm(r);case"DTSTART":return ji(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Rm(r){var e=r.replace(/^RRULE:/i,""),t=ji(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(s){var a=s.split("="),o=a[0],l=a[1];switch(o.toUpperCase()){case"FREQ":t.freq=be[l.toUpperCase()];break;case"WKST":t.wkst=yr[l.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var c=CE(l),h=o.toLowerCase();t[h]=c;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=IE(l);break;case"DTSTART":case"TZID":var m=ji(r);t.tzid=m.tzid,t.dtstart=m.dtstart;break;case"UNTIL":t.until=ie.untilStringToDate(l);break;case"BYEASTER":t.byeaster=Number(l);break;default:throw new Error("Unknown RRULE property '"+o+"'")}}),t}function CE(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(xm)}return xm(r)}function xm(r){return/^[+-]? \d + $ /.test(r)?Number(r):r}function IE(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return yr[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 s=Number(n[1]),a=n[2],o=yr[a].weekday;return new ut(o,s)})}var as=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=ie.timeToUntilString(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(){var e;if(this.isUTC)return this.date;var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(this.date.toLocaleString(void 0,{timeZone:t})),s=new Date(this.date.toLocaleString(void 0,{timeZone:(e=this.tzid)!==null&&e!==void 0?e:"UTC"})),a=s.getTime()-n.getTime();return new Date(this.date.getTime()-a)},r}();function Bi(r){for(var e=[],t="",n=Object.keys(r),s=Object.keys(qi),a=0;a<n.length;a++)if(n[a]!=="tzid"&&!!De(s,n[a])){var o=n[a].toUpperCase(),l=r[n[a]],c="";if(!(!Ge(l)||xt(l)&&!l.length)){switch(o){case"FREQ":c=X.FREQUENCIES[r.freq];break;case"WKST":rr(l)?c=new ut(l).toString():c=l.toString();break;case"BYWEEKDAY":o="BYDAY",c=Zp(l).map(function(D){return D instanceof ut?D:xt(D)?new ut(D[0],D[1]):new ut(D)}).toString();break;case"DTSTART":t=FE(l,r.tzid);break;case"UNTIL":c=ie.timeToUntilString(l,!r.tzid);break;default:if(xt(l)){for(var h=[],m=0;m<l.length;m++)h[m]=String(l[m]);c=h.toString()}else c=String(l)}c&&e.push([o,c])}}var _=e.map(function(D){var v=D[0],R=D[1];return"".concat(v,"=").concat(R.toString())}).join(";"),T="";return _!==""&&(T="RRULE:".concat(_)),[t,T].filter(function(D){return!!D}).join( `
` )}function FE(r,e){return r?"DTSTART"+new as(new Date(r),e).toString():""}function LE(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 Pm=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?ie.clone(t):ie.cloneDates(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,s=t?Object.keys(t):[],a=function(m){for(var _=0;_<s.length;_++){var T=s[_];if(!LE(t[T],m[T]))return!0}return!1},o=this[e];if(e==="all")n=this.all;else if(xt(o))for(var l=0;l<o.length;l++){var c=o[l];if(!(s.length&&a(c))){n=c._value;break}}if(!n&&this.all){for(var h=new nn(e,t),l=0;l<this.all.length&&h.accept(this.all[l]);l++);n=h.getValue(),this._cacheAdd(e,n,t)}return xt(n)?ie.cloneDates(n):n instanceof Date?ie.clone(n):n},r}();var Am=U(U(U(U(U(U(U(U(U(U(U(U(U([],Ee(1,31),!0),Ee(2,28),!0),Ee(3,31),!0),Ee(4,30),!0),Ee(5,31),!0),Ee(6,30),!0),Ee(7,31),!0),Ee(8,31),!0),Ee(9,30),!0),Ee(10,31),!0),Ee(11,30),!0),Ee(12,31),!0),Ee(1,7),!0),Nm=U(U(U(U(U(U(U(U(U(U(U(U(U([],Ee(1,31),!0),Ee(2,29),!0),Ee(3,31),!0),Ee(4,30),!0),Ee(5,31),!0),Ee(6,30),!0),Ee(7,31),!0),Ee(8,31),!0),Ee(9,30),!0),Ee(10,31),!0),Ee(11,30),!0),Ee(12,31),!0),Ee(1,7),!0),YE=mr(1,29),UE=mr(1,30),Nn=mr(1,31),Yt=mr(1,32),Cm=U(U(U(U(U(U(U(U(U(U(U(U(U([],Yt,!0),UE,!0),Yt,!0),Nn,!0),Yt,!0),Nn,!0),Yt,!0),Yt,!0),Nn,!0),Yt,!0),Nn,!0),Yt,!0),Yt.slice(0,7),!0),Im=U(U(U(U(U(U(U(U(U(U(U(U(U([],Yt,!0),YE,!0),Yt,!0),Nn,!0),Yt,!0),Nn,!0),Yt,!0),Yt,!0),Nn,!0),Yt,!0),Nn,!0),Yt,!0),Yt.slice(0,7),!0),WE=mr(-28,0),qE=mr(-29,0),Cn=mr(-30,0),Ut=mr(-31,0),Fm=U(U(U(U(U(U(U(U(U(U(U(U(U([],Ut,!0),qE,!0),Ut,!0),Cn,!0),Ut,!0),Cn,!0),Ut,!0),Ut,!0),Cn,!0),Ut,!0),Cn,!0),Ut,!0),Ut.slice(0,7),!0),Lm=U(U(U(U(U(U(U(U(U(U(U(U(U([],Ut,!0),WE,!0),Ut,!0),Cn,!0),Ut,!0),Cn,!0),Ut,!0),Ut,!0),Cn,!0),Ut,!0),Cn,!0),Ut,!0),Ut.slice(0,7),!0),Ym=[0,31,60,91,121,152,182,213,244,274,305,335,366],Um=[0,31,59,90,120,151,181,212,243,273,304,334,365],Pl=function(){for(var r=[],e=0;e<55;e++)r=r.concat(mr(7));return r}();function Wm(r,e){var t=new Date(Date.UTC(r,0,1)),n=ie.isLeapYear(r)?366:365,s=ie.isLeapYear(r+1)?366:365,a=ie.toOrdinal(t),o=ie.getWeekday(t),l=Bt(Bt({yearlen:n,nextyearlen:s,yearordinal:a,yearweekday:o},jE(r)),{wnomask:null});if(nr(e.byweekno))return l;l.wnomask=Ee(0,n+7);var c,h,m=c=Lt(7-o+e.wkst,7);m>=4?(m=0,h=l.yearlen+Lt(o-e.wkst,7)):h=n-m;for(var _=Math.floor(h/7),T=Lt(h,7),D=Math.floor(_+T/4),v=0;v<e.byweekno.length;v++){var R=e.byweekno[v];if(R<0&&(R+=D+1),R>0&&R<=D){var I=void 0;R>1?(I=m+(R-1)*7,m!==c&&(I-=7-c)):I=m;for(var q=0;q<7&&(l.wnomask[I]=1,I++,l.wdaymask[I]!==e.wkst);q++);}}if(De(e.byweekno,1)){var I=m+D*7;if(m!==c&&(I-=7-c),I<n)for(var v=0;v<7&&(l.wnomask[I]=1,I+=1,l.wdaymask[I]!==e.wkst);v++);}if(m){var $ =void 0;if(De(e.byweekno,-1)) $ =-1;else{var B=ie.getWeekday(new Date(Date.UTC(r-1,0,1))),me=Lt(7-B.valueOf()+e.wkst,7),fe=ie.isLeapYear(r-1)?366:365,ve=void 0;me>=4?(me=0,ve=fe+Lt(B-e.wkst,7)):ve=n-m, $ =Math.floor(52+Lt(ve,7)/4)}if(De(e.byweekno, $ ))for(var I=0;I<m;I++)l.wnomask[I]=1}return l}function jE(r){var e=ie.isLeapYear(r)?366:365,t=new Date(Date.UTC(r,0,1)),n=ie.getWeekday(t);return e===365?{mmask:Am,mdaymask:Im,nmdaymask:Lm,wdaymask:Pl.slice(n),mrange:Um}:{mmask:Nm,mdaymask:Cm,nmdaymask:Fm,wdaymask:Pl.slice(n),mrange:Ym}}function qm(r,e,t,n,s,a){var o={lastyear:r,lastmonth:e,nwdaymask:[]},l=[];if(a.freq===X.YEARLY)if(nr(a.bymonth))l=[[0,t]];else for(var c=0;c<a.bymonth.length;c++)e=a.bymonth[c],l.push(n.slice(e-1,e+1));else a.freq===X.MONTHLY&&(l=[n.slice(e-1,e+1)]);if(nr(l))return o;o.nwdaymask=Ee(0,t);for(var c=0;c<l.length;c++)for(var h=l[c],m=h[0],_=h[1]-1,T=0;T<a.bynweekday.length;T++){var D=void 0,v=a.bynweekday[T],R=v[0],I=v[1];I<0?(D=_+(I+1)*7,D-=Lt(s[D]-R,7)):(D=m+(I-1)*7,D+=Lt(7-s[D]+R,7)),m<=D&&D<=_&&(o.nwdaymask[D]=1)}return o}function jm(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),s=r%100,a=M
` ),n=0;n<t.length;){var s=t[n]=t[n].replace(/ \s + $ /g,"");s?n>0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function JE(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Vm(r,e){return JE(e),r.split(",").map(function(t){return ie.untilStringToDate(t)})}function Km(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 s=e._rrule[n].origOptions[r];if(s)return s}}}var Nl=function(r){ $ s(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=Km.apply(n,["dtstart"]),n.tzid=Km.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return Hm(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){Zm(t,this._rrule)},e.prototype.exrule=function(t){Zm(t,this._exrule)},e.prototype.rdate=function(t){Xm(t,this._rdate)},e.prototype.exdate=function(t){Xm(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return Mo(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return Mo(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(Bi({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split( `
` ))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split( `
` ).map(function(s){return s.replace(/^RRULE:/,"EXRULE:")}).filter(function(s){return!/^DTSTART/.test(s)}))}),this._rdate.length&&t.push(Qm("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Qm("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}(X);function Zm(r,e){if(!(r instanceof X))throw new TypeError(String(r)+" is not RRule instance");De(e.map(String),String(r))||e.push(r)}function Xm(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");De(e.map(Number),Number(r))||(e.push(r),ie.sort(e))}function Qm(r,e,t){var n=!t||t.toUpperCase()==="UTC",s=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(o){return ie.timeToUntilString(o.valueOf(),n)}).join(",");return"".concat(s).concat(a)}function Ur(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?-1:!r.isValid()&&e.isValid()||r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var Tt=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:s,scheduledDate:a,dueDate:o}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=s,this.scheduledDate=a,this.dueDate=o}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:s}){try{let a=e.match(/^([a-zA-Z0-9, !]+?)( when done)? $ /i);if(a==null)return null;let o=a[1].trim(),l=a[2]!==void 0,c=X.parseText(o);if(c!==null){let h=null;s?h=window.moment(s):n?h=window.moment(n):t&&(h=window.moment(t)),!l&&h!==null?c.dtstart=window.moment(h).startOf("day").utc(!0).toDate():c.dtstart=window.moment().startOf("day").utc(!0).toDate();let m=new X(c);return new Tt({rrule:m,baseOnToday:l,referenceDate:h,startDate:t,scheduledDate:n,dueDate:s})}}catch(a){}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){var t;let e;if(this.baseOnToday){let n=window.moment(),s=new X(tr(Qe({},this.rrule.origOptions),{dtstart:n.startOf("day").utc(!0).toDate()}));e=this.nextAfter(n.endOf("day"),s)}else{let n=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");e=this.nextAfter(n,this.rrule)}if(e!==null){let n=null,s=null,a=null;if(this.referenceDate){if(this.startDate){let o=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(o.asDays()),"days")}if(this.scheduledDate){let o=window.moment.duration(this.scheduledDate.diff(this.referenceDate));s=window.moment(e),s.add(Math.round(o.asDays()),"days")}if(this.dueDate){let o=window.moment.duration(this.dueDate.diff(this.referenceDate));a=window.moment(e),a.add(Math.round(o.asDays()),"days")}}return{startDate:n,scheduledDate:s,dueDate:a}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||Ur(this.startDate,e.startDate)!==0||Ur(this.scheduledDate,e.scheduledDate)!==0||Ur(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),s=this.toText(),a=s.match(/every( \d +)? month(s)?(.*)?/);a!==null&&(s.includes(" on ")||(n=Tt.nextAfterMonths(e,n,t,a[1])));let o=s.match(/every( \d +)? year(s)?(.*)?/);return o!==null&&(n=Tt.nextAfterYears(e,n,t,o[1])),Tt.addTimezone(n).toDate()}static nextAfterMonths(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));Tt.isSkippingTooManyMonths(e,t,a);)t=Tt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let s=t.month()-e.month();return s+=(t.year()-e.year())*12,s>n}static nextAfterYears(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));Tt.isSkippingTooManyYears(e,t,a);)t=Tt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new X(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};var Jm={prioritySymbols:{High:" \u 23EB",Medium:" \u {1F53C}",Low:" \u {1F53D}",None:""},startDateSymbol:" \u {1F6EB}",createdDateSymbol:" \u 27
The task line not updated is :
$ { r . originalMarkdown }
In this markdown file :
"${r.taskLocation.path}"
Note : further clicks on this checkbox will usually now be ignored until the file is opened ( or certain , specific edits are made - it ' s complicated ) .
Recommendations :
1. Close all panes that have the above file open , and then re - open the file .
2. Check for exactly identical copies of the task line , in this file , and see if you can make them different .
` ; $ l(I);return}let R=Math.min(Math.pow(10,a),100);Hi.debug( ` timeout = $ { R } ` ),setTimeout(()=>{uy({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a+1})},R)},c=t.getAbstractFileByPath(r.path);if(!(c instanceof zi.TFile))return Ul( ` Tasks : No file found for task $ { r . description } . Retrying ... ` ),l();if(!nk.includes(c.extension)){ $ l( ` Tasks : Does not support files with the $ { c . extension } file extension . ` );return}let h=n.getFileCache(c);if(h==null||h===null)return Ul( ` Tasks : No file cache found for file $ { c . path } . Retrying ... ` ),l();let m=h.listItems;if(m===void 0||m.length===0)return Ul( ` Tasks : No list items found in file cache of $ { c . path } . Retrying ... ` ),l();let T=(yield t.read(c)).split( `
` ),D=ik(r,T,m,sk);if(D===void 0)return l();let v=[...T.slice(0,D),...e.map(R=>R.toFileLineString()),...T.slice(D+1)];yield t.modify(c,v.join( `
` ))});function ly(r,e){return r<e.length}function ik(r,e,t,n){let s=ak(r,e);return s!==void 0||(s=ok(r,e),s!==void 0)?s:uk(r,e,t,n)}function ak(r,e){let t=r.taskLocation.lineNumber;if(ly(t,e)&&e[t]===r.originalMarkdown)return Hi.debug( ` Found original markdown at original line number $ { t } ` ),t}function ok(r,e){let t=[];for(let n=0;n<e.length;n++)e[n]===r.originalMarkdown&&t.push(n);if(t.length===1)return t[0]}function uk(r,e,t,n){let{globalFilter:s}=se(),a,o=0;for(let l of t){let c=l.position.start.line;if(!ly(c,e))return;if(c<r.taskLocation.sectionStart||l.task===void 0)continue;let h=e[c];if(h.includes(s)){if(o===r.taskLocation.sectionIndex){if(h===r.originalMarkdown)a=c;else{n( ` Tasks : Unable to find task in file $ { r . taskLocation . path } .
Expected task :
$ { r . originalMarkdown }
Found task :
$ { h } ` );return}break}o++}}return a}function lk(r,e,t){return J(this,null,function*(){yield cy.MarkdownRenderer.renderMarkdown(r,e,t,null)})}function dy(r,e,t=null){return J(this,null,function*(){var o;t||(t=lk);let n=document.createElement("li");e.parentUlElement.appendChild(n),n.classList.add("task-list-item","plugin-tasks-list-item");let s=document.createElement("span");n.appendChild(s),s.classList.add("tasks-list-text"),yield ck(r,e,s,t);let a=document.createElement("input");return n.appendChild(a),a.classList.add("task-list-item-checkbox"),a.type="checkbox",r.status.symbol!==" "&&(a.checked=!0,n.classList.add("is-checked")),a.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),a.disabled=!0;let c=r.toggle();Ao({originalTask:r,newTasks:c})}),n.prepend(a),n.setAttribute("data-task",r.status.symbol.trim()),n.setAttribute("data-line",e.listIndex.toString()),a.setAttribute("data-line",e.listIndex.toString()),(o=e.layoutOptions)!=null&&o.shortMode&&fk({task:r,element:s,isFilenameUnique:e.isFilenameUnique}),n})}function ck(r,e,t,n){return J(this,null,function*(){let s="",a=new qs(e.layoutOptions),o=Fn.tasksPluginEmoji.taskSerializer;for(let c of a.layoutComponents){let h=o.componentToString(r,a,c);h&&(c==="description"&&(h=hk(h)),s+=h)}let{debugSettings:l}=se();l.showTaskHiddenData&&(s+= ` < br > \ u { 1 F41B } < b > $ { r . lineNumber } < / b > . $ { r . s e c t i o n S t a r t } . $ { r . s e c t i o n I n d e x } . ' < c o d e > $ { r . o r i g i n a l M a r k d o w n } < / c o d e > ' < b r > ' < c o d e > $ { r . p a t h } < / c o d e > ' > ' < c o d e > $ { r . p r e c e d i n g H e a d e r } < / c o d e > ' < b r > ` ) , y i e l d d k ( t , s , " d e s c r i p t i o n " , r , n ) } ) } f u n c t i o n d k ( r , e , t , n , s ) { r e t u r n J ( t h i s , n u l l , f u n c t i o n * ( ) { i f ( t = = = " d e s c r i p t i o n " ) { y i e l d s ( e , r , n . p a t h ) ; l e t a = r . q u e r y S e l e c t o r ( " b l o c k q u o t e " ) , o = a ! = n u l l ? a : r , l = o . q u e r y S e l e c t o r ( " p " ) ; i f ( l ! = = n u l l ) { f o r ( ; l . f i r s t C h i l d ; ) o . i n s e r t B e f o r e ( l . f i r s t C h i l d , l ) ; l . r e m o v e ( ) } r . q u e r y S e l e c t o r A l l ( " p " ) . f o r E a c h ( c = > { c . h a s C h i l d N o d e s ( ) | | c . r e m o v e ( ) } ) , r . q u e r y S e l e c t o r A l l ( " . f o o t n o t e s " ) . f o r E a c h ( c = > { c . r e m o v e ( ) } ) } e l s e r . i n n e r H T M L = e } ) } f u n c t i o n f k ( { t a s k : r , e l e m e n t : e , i s F i l e n a m e U n i q u e : t } ) { l e t { r e c u r r e n c e S y m b o l : n , s t a r t D a t e S y m b o l : s , c r e a t e d D a t e S y m b o l : a , s c h e d u l e d D a t e S y m b o l : o , d u e D a t e S y m b o l : l , d o n e D a t e S y m b o l : c } = F n . t a s k s P l u g i n E m o j i . t a s k S e r i a l i z e r . s y m b o l s ; e . a d d E v e n t L i s t e n e r ( " m o u s e e n t e r " , ( ) = > { l e t h = e . c r e a t e D i v ( ) ; h . a d d C l a s s e s ( [ " t o o l t i p " , " p o p - u p " ] ) , r . r e c u r r e n c e & & h . c r e a t e D i v ( ) . s e t T e x t ( ` $ { n } $ { r . r e c u r r e n c e . t o T e x t ( ) } ` ) , r . c r e a t e d D a t e & & h . c r e a t e D i v ( ) . s e t T e x t ( V i ( { s i g n i f i e r : a , d a t e : r . c r e a t e d D a t e } ) ) , r . s t a r t D a t e & & h . c r e a t e D i v ( ) . s e t T e x t ( V i ( { s i g n i f i e r : s , d a t e : r . s t a r t D a t e } ) ) , r . s c h e d u l e d D a t e & & h . c r e a t e D i v ( ) . s e t T e x t ( V i ( { s i g n i f i e r : o , d a t e : r . s c h e d u l e d D a t e } ) ) , r . d u e D a t e & & h . c r e a t e D i v ( ) . s e t T e x t ( V i ( { s i g n i f i e r : l , d a t e : r . d u e D a t e } ) ) , r . d o n e D a t e & & h . c r e a t e D i v ( ) . s e t T e x t ( V i ( { s i g n i f i e r : c , d a t e : r . d o n e D a t e } ) ) ; l e t m = r . g e t L i n k T e x t ( { i s F i l e n a m e U n i q u e : t } ) ; m & & h . c r e a t e D i v ( ) . s e t T e x t ( ` \ u { 1 F 5 1 7 } $ { m } ` ) , e . a d d E v e n t L i s t e n e r ( " m o u s e l e a v e " , ( ) = > { h . r e m o v e ( ) } ) } ) } f u n c t i o n V i ( { s i g n i f i e r : r , d a t e : e } ) { r e t u r n ` $ { r } $ { e . f o r m a t ( a e . d a t e F o r m a t ) } ( $ { e . f r o m ( w i n d o w . m o m e n t ( ) . s t a r t O f ( " d a y " ) ) } ) ` } f u n c t i o n h k ( r ) { l e t { g l o b a l F i l t e r : e , r e m o v e G l o b a l F i l t e r : t } = s e ( ) ; r e t u r n t ? r . r e p l a c e ( e , " " ) . t r i m ( ) : r } v a r K t = c l a s s { s t a t i c f r o m P a t h ( e ) { l e t { u s e F i l e n a m e A s S c h e d u l e d D a t e : t , f i l e n a m e A s D a t e F o l d e r s : n } = s e ( ) ; r e t u r n ! t | | ! t h i s . m a t c h e s A n y F o l d e r ( n , e ) ? n u l l : t h i s . e x t r a c t D a t e F r o m P a t h ( e ) } s t a t i c m a t c h e s A n y F o l d e r ( e , t ) { r e t u r n e . l e n g t h = = = 0 ? ! 0 : e . s o m e ( n = > t . s t a r t s W i t h ( n + " / " ) ) } s t a t i c e x t r a c t D a t e F r o m P a t h ( e ) { l e t t = M a t h . m a x ( 0 , e . l a s t I n d e x O f ( " / " ) + 1 ) , n = e . l a s t I n d e x O f ( " . " ) , s = e . s u b s t r i n g ( t , n ) , a = / ( \ d { 4 } ) - ( \ d { 2 } ) - ( \ d { 2 } ) / . e x e c ( s ) ; i f ( a | | ( a = / ( \ d { 4 } ) ( \ d { 2 } ) ( \ d { 2 } ) / . e x e c ( s ) ) , a ) { l e t o = w i n d o w . m o m e n t ( [ p a r s e I n t ( a [ 1 ] ) , p a r s e I n t ( a [ 2 ] ) - 1 , p a r s e I n t ( a [ 3 ] ) ] ) ; i f ( o . i s V a l i d ( ) ) r e t u r n o } r e t u r n n u l l } s t a t i c c a n A p p l y F a l l b a c k ( { s t a r t D a t e : e , s c h e d u l e d D a t e : t , d u e D a t e : n } ) { r e t u r n e = = = n u l l & & n = = = n u l l & & t = = = n u l l } s t a t i c u p d a t e T a s k P a t h ( e , t , n ) { l e t s = e . s c h e d u l e d D a t e , a = e . s c h e d u l e d D a t e I s I n f e r r e d ; r e t u r n n = = = n u l l ? a & & ( a = ! 1 , s = n u l l ) : a ? s = n : t h i s . c a n A p p l y F a l l b a c k ( e ) & & ( s = n , a = ! 0 ) , n e w j e ( t r ( Q e ( { } , e ) , { t a s k L o c a t i o n : e . t a s k L o c a t i o n . f r o m R e n a m e d F i l e ( t ) , s c h e d u l e d D a t e : s , s c h e d u l e d D a t e I s I n f e r r e d : a } ) ) } s t a t i c r e m o v e I n f e r r e d S t a t u s I f N e e d e d ( e , t ) { l e t n = e . s c h e d u l e d D a t e I s I n f e r r e d ? e . s c h e d u l e d D a t e : n u l l ; r e t u r n t . m a p ( s = > ( n ! = = n u l l & & ! n . i s S a m e ( s . s c h e d u l e d D a t e , " d a y " ) & & ( s = n e w j e ( t
` ),l=o.length,c=new Ki(()=>Kt.fromPath(s.path)),h=null,m=0;for(let _ of t)if(_.task!==void 0){let T=_.position.start.line;if(T>=l)return console.log( ` $ { s . path } Obsidian gave us a line number $ { T } past the end of the file . $ { l } . ` ),a;if((h===null||h.position.end.line<T)&&(h=us.getSection(T,n.sections),m=0),h===null)continue;let D=o[T];if(D===void 0){console.log( ` $ { s . path } : line $ { T } - ignoring 'undefined' line . ` );continue}let v;try{v=je.fromLine({line:D,taskLocation:new Pt(s.path,T,h.position.start.line,m,us.getPrecedingHeader(T,n.headings)),fallbackDate:c.value})}catch(R){this.reportTaskParsingErrorToUser(R,s,_,D);continue}v!==null&&(m++,a.push(v))}return a}reportTaskParsingErrorToUser(e,t,n,s){let a= ` There was an error reading one of the tasks in this vault .
The following task has been ignored , to prevent Tasks queries getting stuck with 'Loading Tasks ...'
Error : $ { e }
File : $ { t . path }
Line number : $ { n . position . start . line }
Task line : $ { s }
Please create a bug report for this message at
https : //github.com/obsidian-tasks-group/obsidian-tasks/issues/new/choose
to help us find and fix the underlying issue .
Include :
- either a screenshot of the error popup , or copy the text from the console , if on a desktop machine .
- the output from running the Obsidian command 'Show debug info'
The error popup will only be shown when Tasks is starting up , but if the error persists ,
it will be shown in the console every time this file is edited during the Obsidian
session .
` ;console.error(a),e instanceof Error&&console.error(e.stack),this.state==="Initializing"&&new zs.Notice(a,1e4)}static getSection(e,t){if(t===void 0)return null;for(let n of t)if(n.position.start.line<=e&&n.position.end.line>=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var Bh=require("obsidian");var iv=require("obsidian");function cs(){}function Hl(r){return r()}function py(){return Object.create(null)}function ds(r){r.forEach(Hl)}function yy(r){return typeof r=="function"}function gy(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function _y(r){return Object.keys(r).length===0}var Ty=!1;function pk(){Ty=!0}function mk(){Ty=!1}function L(r,e){r.appendChild(e)}function Vs(r,e,t){r.insertBefore(e,t||null)}function fs(r){r.parentNode.removeChild(r)}function zl(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function oe(r){return document.createElement(r)}function yk(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Zt(r){return document.createTextNode(r)}function Se(){return Zt(" ")}function Ht(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function by(r){return function(e){return e.preventDefault(),r.call(this,e)}}function z(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function gk(r){return Array.from(r.childNodes)}function Vl(r,e){e=""+e,r.wholeText!==e&&(r.data=e)}function Or(r,e){r.value=e==null?"":e}function Kl(r,e){for(let t=0;t<r.options.length;t+=1){let n=r.options[t];if(n.__value===e){n.selected=!0;return}}r.selectedIndex=-1}function vy(r){let e=r.querySelector(":checked")||r.options[0];return e&&e.__value}function Mr(r,e,t){r.classList[t?"add":"remove"](e)}var ls=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=yk(t.nodeName):this.e=oe(t.nodeName),this.t=t,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Vs(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(fs)}};var Qi;function Xi(r){Qi=r}function _k(){if(!Qi)throw new Error("Function called outside component initialization");return Qi}function Zl(r){_k(). $ $ .on_mount.push(r)}var Zi=[];var Fo=[],Io=[],my=[],Tk=Promise.resolve(),Gl=!1;function bk(){Gl||(Gl=!0,Tk.then(wy))}function Ji(r){Io.push(r)}var Bl=new Set,Co=0;function wy(){let r=Qi;do{for(;Co<Zi.length;){let e=Zi[Co];Co++,Xi(e),vk(e. $ $ )}for(Xi(null),Zi.length=0,Co=0;Fo.length;)Fo.pop()();for(let e=0;e<Io.length;e+=1){let t=Io[e];Bl.has(t)||(Bl.add(t),t())}Io.length=0}while(Zi.length);for(;my.length;)my.pop()();Gl=!1,Bl.clear(),Xi(r)}function vk(r){if(r.fragment!==null){r.update(),ds(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Ji)}}var wk=new Set;function Ek(r,e){r&&r.i&&(wk.delete(r),r.i(e))}var bU=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function kk(r,e,t,n){let{fragment:s,on_mount:a,on_destroy:o,after_update:l}=r. $ $ ;s&&s.m(e,t),n||Ji(()=>{let c=a.map(Hl).filter(yy);o?o.push(...c):ds(c),r. $ $ .on_mount=[]}),l.forEach(Ji)}function Ey(r,e){let t=r. $ $ ;t.fragment!==null&&(ds(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Dk(r,e){r. $ $ .dirty[0]===-1&&(Zi.push(r),bk(),r. $ $ .dirty.fill(0)),r. $ $ .dirty[e/31|0]|=1<<e%31}function ky(r,e,t,n,s,a,o,l=[-1]){let c=Qi;Xi(r);let h=r. $ $ ={fragment:null,ctx:null,props:a,update:cs,not_equal:s,bound:py(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c. $ $ .context:[])),callbacks:py(),dirty:l,skip_bound:!1,root:e.target||c. $ $ .root};o&&o(h.root);let m=!1;if(h.ctx=t?t(r,e.props||{},(_,T,...D)=>{let v=D.length?D[0]:T;return h.ctx&&s(h.ctx[_],h.ctx[_]=v)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](v),m&&Dk(r,_)),T}):[],h.update(),m=!0,ds(h.before_update),h.fragment=n?n(h.ctx):!1,e.targe
< span class = "accesskey-first" > future < / s p a n > d a t e s : ` , R i = S e ( ) , q e = o e ( " i n p u t " ) , K n = S e ( ) , f t = o e ( " d i v " ) , d e = o e ( " l a b e l " ) , d e . i n n e r H T M L = ' S t a t < s p a n c l a s s = " a c c e s s k e y " > u < / s p a n > s ' , V r = S e ( ) , R t = o e ( " s e l e c t " ) ; f o r ( l e t G = 0 ; G < Z e . l e n g t h ; G + = 1 ) Z e [ G ] . c ( ) ; s o = S e ( ) , L r = o e ( " d i v " ) , D n = o e ( " d i v " ) , _ t = o e ( " l a b e l " ) , _ t . t e x t C o n t e n t = " C o m p l e t e d : " , x i = S e ( ) , c r = o e ( " i n p u t " ) , L e = S e ( ) , S n = o e ( " d i v " ) , C s = o e ( " s p a n " ) , C s . t e x t C o n t e n t = " C r e a t e d o n : " , X n = S e ( ) , O n = o e ( " c o d e " ) , Q n = S e ( ) , d r = o e ( " d i v " ) , M n = o e ( " s p a n " ) , M n . t e x t C o n t e n t = " D o n e o n : " , i o = S e ( ) , Z r = o e ( " c o d e " ) , a o = S e ( ) , f r = o e ( " d i v " ) , h r = o e ( " b u t t o n " ) , H = Z t ( " A p p l y " ) , o o = S e ( ) , h t = o e ( " b u t t o n " ) , h t . t e x t C o n t e n t = " C a n c e l " , z ( s , " f o r " , " d e s c r i p t i o n " ) , z ( o , " i d " , " d e s c r i p t i o n " ) , z ( o , " t y p e " , " t e x t " ) , z ( o , " c l a s s " , " t a s k s - m o d a l - d e s c r i p t i o n " ) , z ( o , " p l a c e h o l d e r " , " T a k e o u t t h e t r a s h " ) , z ( o , " a c c e s s k e y " , l = r [ 1 5 ] ( " t " ) ) , z ( n , " c l a s s " , " t a s k s - m o d a l - s e c t i o n " ) , z ( m , " f o r " , T = " p r i o r i t y - " + r [ 1 ] . p r i o r i t y ) , z ( h , " c l a s s " , " t a s k s - m o d a l - s e c t i o n t a s k s - m o d a l - p r i o r i t i e s " ) , z ( I , " f o r " , " r e c u r r e n c e " ) , z ( I , " c l a s s " , " a c c e s s k e y - f i r s t " ) , z ( $ , " i d " , " r e c u r r e n c e " ) , z ( $ , " t y p e " , " t e x t " ) , z ( $ , " p l a c e h o l d e r " , " T r y ' e v e r y 2 w e e k s o n T h u r s d a y ' . " ) , z ( $ , " a c c e s s k e y " , B = r [ 1 5 ] ( " r " ) ) , M r ( $ , " t a s k s - m o d a l - e r r o r " , ! r [ 8 ] ) , t e . a = n u l l , z ( y t , " f o r " , " d u e " ) , z ( y t , " c l a s s " , " a c c e s s k e y - f i r s t " ) , z ( W , " i d " , " d u e " ) , z ( W , " t y p e " , " t e x t " ) , z ( W , " p l a c e h o l d e r " , q h ) , z ( W , " a c c e s s k e y " , P = r [ 1 5 ] ( " d " ) ) , M r ( W , " t a s k s - m o d a l - e r r o r " , ! r [ 7 ] ) , g . a = n u l l , z ( E , " f o r " , " s c h e d u l e d " ) , z ( E , " c l a s s " , " a c c e s s k e y - f i r s t " ) , z ( M , " i d " , " s c h e d u l e d " ) , z ( M , " t y p e " , " t e x t " ) , z ( M , " p l a c e h o l d e r " , q h ) , z ( M , " a c c e s s k e y " , k = r [ 1 5 ] ( " s " ) ) , M r ( M , " t a s k s - m o d a l - e r r o r " , ! r [ 5 ] ) , k e . a = n u l l , z ( c e , " f o r " , " s t a r t " ) , z ( K , " i d " , " s t a r t " ) , z ( K , " t y p e " , " t e x t " ) , z ( K , " p l a c e h o l d e r " , q h ) , z ( K , " a c c e s s k e y " , W e = r [ 1 5 ] ( " a " ) ) , M r ( K , " t a s k s - m o d a l - e r r o r " , ! r [ 3 ] ) , A e . a = n u l l , z ( k n , " f o r " , " f o r w a r d O n l y " ) , z ( q e , " i d " , " f o r w a r d O n l y " ) , z ( q e , " t y p e " , " c h e c k b o x " ) , z ( q e , " c l a s s " , " t a s k - l i s t - i t e m - c h e c k b o x t a s k s - m o d a l - c h e c k b o x " ) , z ( q e , " a c c e s s k e y " , N s = r [ 1 5 ] ( " f " ) ) , z ( R , " c l a s s " , " t a s k s - m o d a l - s e c t i o n t a s k s - m o d a l - d a t e s " ) , z ( d e , " f o r " , " s t a t u s " ) , z ( R t , " i d " , " s t a t u s - t y p e " ) , z ( R t , " c l a s s " , " d r o p d o w n " ) , z ( R t , " a c c e s s k e y " , Z n = r [ 1 5 ] ( " u " ) ) , r [ 1 ] . s t a t u s = = = v o i d 0 & & J i ( ( ) = > r [ 3 9 ] . c a l l ( R t ) ) , z ( f t , " c l a s s " , " t a s k s - m o d a l - s e c t i o n " ) , z ( _ t , " f o r " , " s t a t u s " ) , z ( c r , " i d " , " s t a t u s " ) , z ( c r , " t y p e " , " c h e c k b o x " ) , z ( c r , " c l a s s " , " t a s k - l i s t - i t e m - c h e c k b o x t a s k s - m o d a l - c h e c k b o x " ) , c r . c h e c k e d = K r = r [ 1 ] . s t a t u s . i s C o m p l e t e d ( ) , c r . d i s a b l e d = ! 0 , z ( L r , " c l a s s " , " t a s k s - m o d a l - s e c t i o n t a s k s - m o d a l - s t a t u s " ) , h r . d i s a b l e d = I s = ! r [ 1 4 ] , z ( h r , " t y p e " , " s u b m i t " ) , z ( h r , " c l a s s " , " m o d - c t a " ) , z ( h t , " t y p e " , " b u t t o n " ) , z ( f r , " c l a s s " , " t a s k s - m o d a l - s e c t i o n t a s k s - m o d a l - b u t t o n s " ) , M r ( t , " w i t h - a c c e s s k e y s " , r [ 9 ] ) , z ( e , " c l a s s " , " t a s k s - m o d a l " ) } , m ( G , n e ) { V s ( G , e , n e ) , L ( e , t ) , L ( t , n ) , L ( n , s ) , L ( n , a ) , L ( n , o ) , O r ( o , r [ 1 ] . d e s c r i p t i o n ) , r [ 3 1 ] ( o ) , L ( t , c ) , L ( t , h ) , L ( h , m ) , L ( m , _ ) , L ( h , D ) ; f o r ( l e t l e = 0 ; l e < F t . l e n g t h ; l e + = 1 ) F t [ l e ] . m ( h , n u l l ) ; L ( t , v ) , L ( t , R ) , L ( R , I ) , L ( R , q ) , L ( R , $ ) , O r ( $ , r [ 1 ] . r e c u r r e n c e R u l e ) , L ( R , m e ) , L ( R , f e ) , L ( f e , v e ) , L ( f e , e e ) , t e . m ( r [ 1 2 ] , f e ) , L ( R , I t ) , L ( R , y t ) , L ( R , V ) , L ( R , W ) , O r ( W , r [ 1 ] . d u e D a t e ) , L ( R , Q ) , L ( R , Y ) , L ( Y , u e ) , L ( Y , y ) , g . m ( r [ 6 ] , Y ) , L ( R , w ) , L ( R , E ) , L ( R , S ) , L ( R , M ) , O r ( M , r [ 1 ] . s c h e d u l e d D a t e ) , L ( R , C ) , L ( R , A ) , L ( A , N ) , L ( A , j ) , k e . m ( r [ 4 ] , A ) , L ( R , y e ) , L ( R , c e ) , L ( R , I e ) , L ( R , K ) , O r ( K , r [ 1 ] . s t a r t D a t e ) , L ( R , J e ) , L ( R , K e ) , L ( K e , D r ) , L ( K e , M t ) , A e . m ( r [ 2 ] , K e ) , L ( R , s t ) , L ( R , g t ) , L ( g t , k n ) , L ( g t , R i ) , L ( g t , q e ) , q e . c h e c k e d = r [ 1 ] . f o r w a r d O n l y , L ( t , K n ) , L ( t , f t ) , L ( f t , d e ) , L ( f t , V r ) , L ( f t , R t ) ; f o r ( l e t l e = 0 ; l e < Z e . l e n g t h ; l e + = 1 ) Z e [ l e ] . m ( R t , n u l l ) ; K l ( R t , r [ 1 ] . s t a t u s ) , L ( t , s o ) , L ( t , L r ) , L ( L r , D n ) , L ( D n , _ t ) , L ( D n , x i ) , L ( D n , c r ) , L ( L r , L e ) , L ( L r , S n ) , L ( S n , C s ) , L ( S n , X n ) , L ( S n , O n ) , O n . i n n e r H T M L = r [ 1 1 ] , L ( L r , Q n ) , L ( L r , d r ) , L ( d r , M n ) , L ( d r , i o ) , L ( d r , Z r ) , Z r . i n n e r H T M L = r [ 1 3 ] , L ( t , a o ) , L ( t , f r ) , L ( f r , h r ) , L ( h r , H ) , L ( f r , o o ) , L ( f r , h t ) , J n | | ( N e = [ H t ( o , " i n p u t " , r [ 3 0 ] ) , H t ( o , " k e y d o w n " , r [ 2 3 ] ) , H t ( o , " p a s t e " , r [ 2 4 ] ) , H t ( o , " d r o p " , r [ 2 4 ] ) , H t ( h , " k e y u p " , r [ 2 1 ] ) , H t ( $ , " i n p u t " , r [ 3 4 ] ) , H t ( W , " i n p u t " , r [ 3 5 ] ) , H t ( M , " i n p u t " , r [ 3 6 ] ) , H t ( K , " i n p u t " , r [ 3 7 ] ) , H t ( q e , " c h a n g e " , r [ 3 8 ] ) , H t ( R t , " c h a n g e " , r [ 3 9 ] ) , H t ( h t , " c l i c k " , r [ 2 2 ] ) , H t ( t , " s u b m i t " , b y ( r [ 2 5 ] ) ) ] , J n = ! 0 ) } , p ( G , n e ) { i f ( n e [ 0 ] & 3 2 7 6 8 & & l ! = = ( l = G [ 1 5 ] ( " t " ) ) & & z ( o , " a c c e s s k e y " , l ) , n e [ 0 ] & 3 & & O r ( o , G [ 1 ] . d e s c r i p t i o n ) , n e [ 0 ] & 3 & & T ! = = ( T = " p r i o r i t y - " + G [ 1 ] . p r i o r i t y ) & & z ( m , " f o r " , T ) , n e [ 0 ] & 1 0 8 1 3 4 6 ) { p r = G [ 2 0 ] ; l e t l e ; f o r ( l e = 0 ; l e < p r . l e n g t h ; l e + = 1 ) { l e t j t = t v ( G , p r , l e ) ; F t [ l e ] ? F t [ l e ] . p ( j t , n e ) : ( F t [ l e ] = r v ( j t ) , F t [ l e ] . c ( ) , F t [ l e ] . m ( h , n u l l ) ) } f o r ( ; l e < F t . l e n g t h ; l e
` );e.setLine(o,D)};new Bn({app:n,task:c,onSubmit:h}).open()};var Gh=require("obsidian");var ov=(r,e,t)=>{var c;if(r)return t instanceof Gh.MarkdownView;if(!(t instanceof Gh.MarkdownView))return;let n=(c=t.file)==null?void 0:c.path;if(n===void 0)return;let s=e.getCursor(),a=s.line,o=e.getLine(a),l=VI(o,n);e.setLine(a,l.text),e.setCursor(KI(s,l))},VI=(r,e)=>{let t=je.fromLine({line:r,taskLocation:Pt.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggle().map(s=>s.toFileLineString());return{text:n.join( `
` ),moveTo:{line:n.length-1}}}else{let n=r.match(ae.taskRegex);if(n!==null){let s=n[3],o= $ e.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(ae.taskRegex, ` $1 - [ $ { o } ] $4 ` )}}else if(ae.listItemRegex.test(r)){let s=r.replace(ae.listItemRegex," $ 1 $ 2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(ae.indentationRegex," $ 1- ");return{text:s,moveTo:{ch:s.length}}}}},KI=(r,e)=>{var a;let t={line:0,ch:r.ch},n=Qe(Qe({},t),(a=e.moveTo)!=null?a:{}),s=e.text.split( `
` )[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var xu=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,s)=>av(t,n,s,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:ov})}};var Pu=class{constructor({obsidianEvents:e}){this.obsidianEvents=e}onCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.obsidianEvents.offref(e)}};var Au=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return J(this,null,function*(){var m;let{globalFilter:n}=se(),s=e.findAll(".task-list-item").filter(_=>{var v;let T=(v=_.textContent)==null?void 0:v.split( `
` );if(T===void 0)return!1;let D=null;for(let R=0;R<T.length;R=R+1)if(T[R]!==""){D=T[R];break}return D===null?!1:D.includes(n)});if(s.length===0)return;let a=t.sourcePath,o=t.getSectionInfo(e);if(o===null)return;let l=o.text.split( `
` ),c=0,h=[];for(let _=o.lineStart;_<=o.lineEnd;_++){let T=l[_];if(T===void 0)continue;let D=null,v=je.fromLine({line:T,taskLocation:new Pt(a,_,o.lineStart,c,D),fallbackDate:null});v!==null&&(h.push(v),c++)}for(let _=0;_<s.length;_++){let T=h[_],D=s[_];if(T===void 0||D===void 0)continue;let v=(m=D.getAttr("data-line"))!=null?m:"0",R=Number.parseInt(v,10),I=yield T.toLi({parentUlElement:e,listIndex:R}),q=D.childNodes;for(let me=0;me<q.length;me=me+1){let fe=q[me];fe.nodeName.toLowerCase()==="div"?I.prepend(fe):fe.nodeName.toLowerCase()==="ul"&&I.append(fe)}let $ =D.querySelectorAll("[data-footnote-id]"),B=I.querySelectorAll("[data-footnote-id]");if( $ .length===B.length)for(let me=0;me< $ .length;me++)B[me].replaceWith( $ [me]);D.replaceWith(I)}})}};var uv=require("@codemirror/view"),lv=require("obsidian");var cv=()=>uv.ViewPlugin.fromClass(Hh),Hh=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let T= ` obsidian - tasks - plugin warning : Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview .
If you wanted Tasks to do these things , please undo your change , then either click the line of the task and use the "Toggle Task Done" command , or switch to Reading View to click the checkbox . ` ;console.warn(T),new lv.Notice(T,45e3)}return!1}let{state:s}=this.view,a=this.view.posAtDOM(t),o=s.doc.lineAt(a),l=je.fromLine({line:o.text,taskLocation:Pt.fromUnknownPosition(""),fallbackDate:null});if(console.debug( ` Live Preview Extension : toggle called . Position : $ { a } Line : $ { o . text } ` ),l===null)return!1;e.preventDefault();let h=l.toggle().map(T=>T.toFileLineString()).join(s.lineBreak),m=s.update({changes:{from:o.from,to:o.to,insert:h}});this.view.dispatch(m);let _=t.checked;return setTimeout(()=>{t.checked=_},1),!0}};var al=require("obsidian");var gn=class{constructor(e,t,n){this.property=e,this.comparator=gn.maybeReverse(n,t)}static maybeReverse(e,t){return e?gn.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var fi=class{constructor(e,t){this.property=e,this.grouper=t}};var ze=class{canCreateFilterForLine(e){return ze.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return No(this.fieldNameSingular())}supportsSorting(){return!1}parseSortLine(e){return!this.supportsSorting()||!this.canCreateSorterForLine(e)?null:this.createSorterFromLine(e)}canCreateSorterForLine(e){return this.supportsSorting()?ze.lineMatchesFilter(this.sorterRegExp(),e):!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ze.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error( ` sorterRegExp ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` );return new RegExp( ` ^ sort by $ { this . fieldNameSingularEscaped ( ) } ( reverse ) ? ` )}comparator(){throw Error( ` comparator ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` )}createSorter(e){return new gn(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}grouper(){throw Error( ` grouper ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` )}createGrouper(){return new fi(this.fieldNameSingular(),this.grouper())}};var ot=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new ot("None of",e,"NOT")}static booleanXor(e){return new ot("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e+ ` $ { this . symbol } ` ;this.children.length>1&&(t+= ` ( $ { this . description } ) ` ),t+=":";let n=e+" ";for(let s=0;s<this.children.length;s++)t+= `
$ { this . children [ s ] . asString ( n ) } ` ;return t}static combineOrCreateExplanation(e,t,n){if(t.length===2){let s=t[0],a=t[1];if(s.symbol===n&&a.symbol==="")return s.children.push(a),s}return new ot(e,t,n)}};var er=class{constructor(e,t,n){this.instruction=e,this.explanation=n,this.filterFunction=t}explainFilterIndented(e){let t=this.explanation;return t.asString()===this.instruction? ` $ { e } $ { this . instruction }
` : ` $ { e } $ { this . instruction } =>
$ { t . asString ( " " ) }
` }},Ve=class{constructor(e){this.instruction=e}get filter(){return this._filter}set filter(e){this._filter=e}get filterFunction(){if(this._filter)return this._filter.filterFunction}static fromFilter(e){let t=new Ve(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new Ve(e);return n.error=t,n}};var Nu=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new Ve(e);return e===this._instruction?(t.filter=new er(e,this._filter,new ot(e)),t):(t.error= ` do not understand filter : $ { e } ` ,t)}};var Hr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Nu(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let n of this._filters){let s=n.createFilterOrErrorMessage(e);if(s.error===void 0)return s}let t=new Ve(e);return t.error= ` do not understand filter : $ { e } ` ,t}};var Gn=class extends ze{constructor(){super(...arguments);this._filters=new Hr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var _n=class extends Gn{constructor(){super(),this._filters.add("done",e=>e.status.type==="DONE"||e.status.type==="CANCELLED"||e.status.type==="NON_TASK"),this._filters.add("not done",e=>e.status.type==="TODO"||e.status.type==="IN_PROGRESS")}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=_n.oldStatusName(e),s=_n.oldStatusName(t);return n<s?1:n>s?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}};var Cu=ns(mt()),hi=ns(Fl()),ks=class{static parseDate(e,t=!1){return window.moment(Cu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e){let t=Cu.parse(e,void 0,{forwardDate:!0});if(t.length===0)return[hi.default.invalid(),hi.default.invalid()];let n=t[0].start,s=t[1]&&t[1].start?t[1].start:n,a=window.moment(n.date()),o=window.moment(s.date()),l=[a,o];o.isBefore(a)&&(l=[o,a]);let c=/(last|this|next) (week|month|quarter|year)/,h=e.match(c);if(h&&h.length===3){let m=h[1],_=hi.default.duration(),T=h[2];switch(T){case"month":case"quarter":case"year":case"week":_.add(1,T)}switch(l=[(0,hi.default)(),(0,hi.default)()],m){case"last":l.forEach(D=>D.subtract(_));break;case"next":l.forEach(D=>D.add(_));break}switch(T){case"month":case"quarter":case"year":l=[l[0].startOf(T),l[1].endOf(T)];break;case"week":l=[l[0].startOf("isoWeek"),l[1].endOf("isoWeek")];break}}return l.forEach(m=>m.startOf("day")),l}};var Wt=class extends ze{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Hr,this.filterInstructions.add( ` has $ { this . fieldName ( ) } date ` ,n=>this.date(n)!==null),this.filterInstructions.add( ` no $ { this . fieldName ( ) } date ` ,n=>this.date(n)===null),this.filterInstructions.add( ` $ { this . fieldName ( ) } date is invalid ` ,n=>{let s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);if(n.filter!==void 0)return n;let s=new Ve(t),a=ze.getMatch(this.filterRegExp(),t);if(a!==null){let o=a[1],l=a[2],c=ks.parseDateRange(l);if(!c[0].isValid()||!c[1].isValid())s.error="do not understand "+this.fieldName()+" date";else{let h=this.buildFilterFunction(o,c),m=Wt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),c);s.filter=new er(t,h,new ot(m))}}else s.error="do not understand query filter ("+this.fieldName()+" date)";return s}buildFilterFunction(t,n){let s;return t==="before"?s=a=>a?a.isBefore(n[0]):this.filterResultIfFieldMissing():t==="after"?s=a=>a?a.isAfter(n[1]):this.filterResultIfFieldMissing():s=a=>a?a.isSameOrAfter(n[0])&&a.isSameOrBefore(n[1]):this.filterResultIfFieldMissing(),this.getFilter(s)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp( ` ^ $ { this . fieldNameFo
Allowed options : 'is' and 'is not' ( without quotes ) .
Allowed values : $ { t }
Note : values are case - insensitive ,
so 'in_progress' works too , for example .
Example : $ { this . fieldNameSingular ( ) } is not NON _TASK ` ;return Ve.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Vn.groupName(e),s=Vn.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[Vn.groupName(e)]}static groupName(e){let t;switch(e.status.type){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return t+" "+e.status.type}};var Zu=class extends qt{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}};var ip=[()=>new Ku,()=>new Vn,()=>new _n,()=>new qu,()=>new Ds,()=>new Hn,()=>new Iu,()=>new Wu,()=>new Uu,()=>new pi,()=>new Fu,()=>new _i,()=>new Ss,()=>new Os,()=>new Yu,()=>new Lu,()=>new Hu,()=>new Vu,()=>new Ti,()=>new Zu];function zu(r){for(let e of ip){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function kv(r){let e=/^sort by /;if(r.match(e)===null)return null;for(let t of ip){let s=t().parseSortLine(r);if(s)return s}return null}function Dv(r){let e=/^group by /;if(r.match(e)===null)return null;for(let t of ip){let n=t(),s=n.fieldNameSingular();if(r=== ` group by $ { s } ` &&n.supportsGrouping())return n.createGrouper()}return null}var Xu=class{constructor(e,t){this.nestingLevel=e,this.name=t}};var Qu=class{constructor(e){this.lastHeadingAtLevel=new Array;let n=e.keys().next().value.length;for(let s=0;s<n;s++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(e){let t=new Array;for(let n=0;n<e.length;n++){let s=e[n];if(s!=this.lastHeadingAtLevel[n]){t.push(new Xu(n,s));for(let a=n;a<e.length;a++)this.lastHeadingAtLevel[a]="";this.lastHeadingAtLevel[n]=s}}return t}};var Ju=class{constructor(e){this.children=new Map;this.values=[];this.values=e}generateAllPaths(e=[]){let t=new Map;if(this.children.size==0)return t.set([...e],this.values),t;for(let[n,s]of this.children)e.push(n),s.generateAllPaths(e).forEach((o,l)=>t.set(l,o)),e.pop();return t}};var el=class extends Map{},tl=class extends Ju{},rl=class{constructor(e,t){this.groups=new el;let n=this.buildGroupingTree(e,t);this.groups=n.generateAllPaths(),this.groups=this.getSortedGroups()}buildGroupingTree(e,t){let n=new tl(t),s=[n];for(let a of e){let o=[];for(let l of s)for(let c of l.values){let h=En.getGroupNamesForTask(a,c);for(let m of h){let _=l.children.get(m);_===void 0&&(_=new tl([]),l.children.set(m,_),o.push(_)),_.values.push(c)}}s=o}return n}getSortedGroups(){return new el([...this.groups.entries()].sort())}};var nl=class{constructor(e,t,n){this.groups=e,this.groupHeadings=t,this.tasks=n}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+ `
` ;return e}toString(){let e= `
` ;e+= ` Group names : [ $ { this . groups } ]
` ;for(let t of this.groupHeadings)e+= ` $ { "#" . repeat ( 4 + t . nestingLevel ) } $ { t . name }
` ;return e+=this.tasksAsStringOfLines(),e}};var sl=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length;let n=new rl(e,t);this.addTasks(n)}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";for(let n of this.groups)e+=n.toString(),e+= `
-- -
` ;return e+= `
$ { this . totalTasksCount ( ) } tasks
` ,e}addTasks(e){let t=new Qu(e.groups);for(let[n,s]of e.groups){let a=t.getHeadingsForTaskGroup(n),o=new nl(n,a,s);this.add(o)}}add(e){this._groups.push(e)}};var Me=class{static fromGroupingProperty(e){return new fi(e,Me.grouperForProperty(e))}static by(e,t){return new sl(e,t)}static getGroupNamesForTask(e,t){return e.grouper(t)}static grouperForProperty(e){return Me.groupers[e]}static escapeMarkdownCharacters(e){return e.replace(/ \\ /g," \\ \\ ").replace(/_/g," \\ _")}static groupByPriority(e){let t="ERROR";switch(e.priority){case"1":t="High";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break}return[ ` Priority $ { e . priority } : $ { t } ` ]}static groupByRecurrence(e){return e.recurrence!==null?[e.recurrence.toText()]:["None"]}static groupByRecurring(e){return e.recurrence!==null?["Recurring"]:["Not Recurring"]}static groupByCreatedDate(e){return[Me.stringFromDate(e.createdDate,"created")]}static groupByStartDate(e){return[Me.stringFromDate(e.startDate,"start")]}static groupByScheduledDate(e){return[Me.stringFromDate(e.scheduledDate,"scheduled")]}static groupByDueDate(e){return[Me.stringFromDate(e.dueDate,"due")]}static groupByDoneDate(e){return[Me.stringFromDate(e.doneDate,"done")]}static groupByHappensDate(e){let t=new Hn().earliestDate(e);return[Me.stringFromDate(t,"happens")]}static stringFromDate(e,t){return e===null?"No "+t+" date":e.format(Me.groupDateFormat)}static groupByPath(e){return[Me.escapeMarkdownCharacters(e.path.replace(".md",""))]}static groupByFolder(e){let t=e.path,n=e.filename+".md",s=t.substring(0,t.lastIndexOf(n));return s===""?["/"]:[Me.escapeMarkdownCharacters(s)]}static groupByFileName(e){let t=e.filename;return t===null?["Unknown Location"]:["[["+Me.escapeMarkdownCharacters(t)+"]]"]}static groupByRoot(e){let t=e.path.replace(/ \\ /g,"/"),n=t.indexOf("/");return n==-1?["/"]:[Me.escapeMarkdownCharacters(t.substring(0,n+1))]}static groupByBacklink(e){if(e.getLinkText({isFilenameUnique:!0})===null)return["Unknown Location"];let n="Unknown Location";if(e.filename!==null&&(n=Me.escapeMarkdownCharacters(e.filename)),e.precedingHeader===null||e.precedingHeader.length===0)return[n];let s=Me.groupByHeading(e)[0];return n===s?[n]:[ ` $ { n } > $ { s } ` ]}static groupByStatus(e){return e.status.symbol===" "?["Todo"]:["Done"]}static groupByHeading(e){return e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}static groupByTags(e){return e.tags.length==0?["(No tags)"]:e.tags}},En=Me;En.groupDateFormat="YYYY-MM-DD dddd",En.groupers={backlink:Me.groupByBacklink,created:Me.groupByCreatedDate,done:Me.groupByDoneDate,due:Me.groupByDueDate,filename:Me.groupByFileName,folder:Me.groupByFolder,happens:Me.groupByHappensDate,heading:Me.groupByHeading,path:Me.groupByPath,priority:Me.groupByPriority,recurrence:Me.groupByRecurrence,recurring:Me.groupByRecurring,root:Me.groupByRoot,scheduled:Me.groupByScheduledDate,start:Me.groupByStartDate,status:Me.groupByStatus,tags:Me.groupByTags};var Si=class{constructor({source:e}){this._limit=void 0;this._layoutOptions=new Yi;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.groupByRegexp=/^group by (backlink|created|done|due|filename|folder|happens|heading|path|priority|recurrence|recurring|root|scheduled|start|status|tags)/;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (to )?( \d +)( tasks?)?/;this.commentRegexp=/^#.*/;this.source=e,e.split( `
` ).map(t=>t.trim()).forEach(t=>{switch(!0){case t==="":break;case this.shortModeRegexp.test(t):this._layoutOptions.shortMode=!0;break;case this.explainQueryRegexp.test(t):this._layoutOptions.explainQuery=!0;break;case this.limitRegexp.test(t):this.parseLimit({line:t});break;case this.parseSortBy({line:t}):break;case this.parseGroupBy2({line:t}):break;case this.groupByRegexp.test(t):this.parseGroupBy({line:t});break;case this.hideOptionsRegexp.test(t):this.parseHideOptions({line:t});break;case this.commentRegexp.test(t):break;case this.parseFilter(t):break;default:this._error= ` do not understand query : $ { t } ` }})}explainQuery(){return ` Explanation of this Tasks code block query :
` +this.explainQueryWithoutIntroduction()}explainQueryWithoutIntroduction(){let e="",{globalFilter:t}=se();t.length!==0&&(e+= ` Only tasks containing the global filter '${t}' .
` );let n=this.filters.length;if(n===0)e+="No filters supplied. All tasks will match the query.";else for(let a=0;a<n;a++)a>0&&(e+= `
` ),e+=this.filters[a].explainFilterIndented("");this._limit!==void 0&&(e+= `
At most $ { this . _limit } task ` ,this._limit!==1&&(e+="s"),e+= ` .
` );let{debugSettings:s}=se();return s.ignoreSortInstructions&&(e+= `
NOTE : All sort instructions , including default sort order , are disabled , due to 'ignoreSortInstructions' setting . ` ),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}applyQueryToTasks(e){this.filters.forEach(a=>{e=e.filter(a.filterFunction)});let{debugSettings:t}=se(),s=(t.ignoreSortInstructions?e:bi.by(this.sorting,e)).slice(0,this.limit);return En.by(this.grouping,s)}parseHideOptions({line:e}){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1]==="hide";switch(t[2]){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;default:this._error="do not understand hide/show option"}}}parseFilter(e){let t=zu(e);return t!=null?(t.filter?this._filters.push(t.filter):this._error=t.error,!0):!1}parseLimit({line:e}){let t=e.match(this.limitRegexp);t!==null?this._limit=Number.parseInt(t[2],10):this._error="do not understand query limit"}parseSortBy({line:e}){let t=kv(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=e.match(this.groupByRegexp);t!==null?this._grouping.push(En.fromGroupingProperty(t[1])):this._error="do not understand query grouping"}parseGroupBy2({line:e}){let t=Dv(e);return t?(this._grouping.push(t),!0):!1}};var il=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return J(this,null,function*(){n.addChild(new ap({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},ap=class extends al.MarkdownRenderChild{constructor({app:t,events:n,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.events=n,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=new Si({source:a}),this.queryType="tasks";break;default:this.query=new Si({source:a}),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=new Si({source:this.source}),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return J(this,arguments,function*({tasks:t,state:n}){var o;let a=this.containerEl.createEl("div");if(n==="Warm"&&this.query.error===void 0){console.debug( ` Render $ { this . queryType } called for a block in active file "${this.filePath}" , to select from $ { t . length } tasks : plugin state : $ { n } ` ),this.query.layoutOptions.explainQuery&&this.createExplanation(a);let l=this.query.applyQueryToTasks(t);for(let h of l.groups){this.addGroupHeadings(a,h.groupHeadings);let{taskList:m}=yield this.createTasksList({tasks:h.tasks,content:a});a.appendChild(m)}let c=l.totalTasksCount();console.debug( ` $ { c } of $ { t . length } tasks displayed in a block in "${this.filePath}" ` ),this.addTaskCount(a,c)}else this.query.error!==void 0?a.createDiv().innerHTML= ` < pre > Tasks query : $ { this . query . error . replace ( /\n/g , "<br>" ) } < / p r e > ` : a . s e t T e x t ( " L o a d i
` )+ `
Fix errors before saving . ` ;new Fr.Notice(_);return}this.saved=!0,this.close()})),h)),c.addExtraButton(h=>(h.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),h))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?lr.removeValidationError(t):lr.setValidationError(t)}};var Oi=class extends Be.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return J(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Global filter Settings"}),new Be.Setting(t).setName("Global task filter").setDesc(Oi.createFragmentWithHTML('<p><b>Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.</b></p><p>Use a global filter if you want Tasks to only act on a subset of your "<code>- [ ]</code>" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.<p><p>For example, if you set the global filter to <code>#task</code>, the Tasks plugin will only handle checklist items tagged with <code>#task</code>.</br>Other checklist items will remain normal checklist items and not appear in queries or get a done date set.</p><p>See the <a href="https://obsidian-tasks-group.github.io/obsidian-tasks/getting-started/global-filter/">documentation</a>.</p>')).addText(s=>{let a=se();s.setPlaceholder("e.g. #task or TODO").setValue(a.globalFilter).onChange(o=>J(this,null,function*(){Gt({globalFilter:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(s=>{let a=se();s.setValue(a.removeGlobalFilter).onChange(o=>J(this,null,function*(){Gt({removeGlobalFilter:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=se();Av.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new Be.Setting(t).setName("Set created date on every added task").setDesc("Enabling this will add a timestamp \u 2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.").addToggle(s=>{let a=se();s.setValue(a.setCreatedDate).onChange(o=>J(this,null,function*(){Gt({setCreatedDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Set done date on every completed task").setDesc("Enabling this will add a timestamp \u 2705 YYYY-MM-DD at the end when a task is toggled to done.").addToggle(s=>{let a=se();s.setValue(a.setDoneDate).onChange(o=>J(this,null,function*(){Gt({setDoneDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Oi.createFragmentWithHTML('Save time entering Scheduled ( \u 23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due ( \u {1F4C5} ), Scheduled ( \u 23F3) and Start ( \u {1F6EB}) dates.</br><p>See the <a href="https://obsidian-tasks-group.github.io/obsidian-tasks/getting-started/use-filename-as-default-date/">documentation</a>.</p>')).addToggle(s=>{let a=se();s.setValue(a.useFilenameAsScheduledDate).onChange(o=>J(this,null,function*(){Gt({useFilename
` }),n=n.slice(0,t.autoSuggestMaxItems),n}function lF(r){if(Object.values(tt.prioritySymbols).some(e=>e.length>0&&r.includes(e)))return!0}function cF(r,e){let t=[];return r.includes(tt.dueDateSymbol)||t.push({displayText: ` $ { tt . dueDateSymbol } due date ` ,appendText: ` $ { tt . dueDateSymbol } ` }),r.includes(tt.startDateSymbol)||t.push({displayText: ` $ { tt . startDateSymbol } start date ` ,appendText: ` $ { tt . startDateSymbol } ` }),r.includes(tt.scheduledDateSymbol)||t.push({displayText: ` $ { tt . scheduledDateSymbol } scheduled date ` ,appendText: ` $ { tt . scheduledDateSymbol } ` }),lF(r)||(t.push({displayText: ` $ { tt . prioritySymbols . High } high priority ` ,appendText: ` $ { tt . prioritySymbols . High } ` }),t.push({displayText: ` $ { tt . prioritySymbols . Medium } medium priority ` ,appendText: ` $ { tt . prioritySymbols . Medium } ` }),t.push({displayText: ` $ { tt . prioritySymbols . Low } low priority ` ,appendText: ` $ { tt . prioritySymbols . Low } ` })),r.includes(tt.recurrenceSymbol)||t.push({displayText: ` $ { tt . recurrenceSymbol } recurring ( repeat ) ` ,appendText: ` $ { tt . recurrenceSymbol } ` }),t}function dF(r,e,t){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],s=[],a=new RegExp( ` ( [ $ { uF } ] ) \ \ s * ( [ 0 - 9 a - zA - Z ] * ) ` ,"ug"),o=op(r,a,e);if(o&&o.length>=2){let l=o[1],c=o[2];if(c.length<t.autoSuggestMinMatch)return[];let h=c&&c.length>1?ks.parseDate(di(c),!0):null;h&&h.isValid()&&s.push({displayText: ` $ { h . format ( ae . dateFormat ) } ` ,appendText: ` $ { l } $ { h . format ( ae . dateFormat ) } ` ,insertAt:o.index,insertSkip:o[0].length});let m=1,_=5,T=n.filter(D=>c&&c.length>=m&&D.toLowerCase().includes(c.toLowerCase())).slice(0,_);T.length===0&&(T=n.slice(0,_));for(let D of T){let R= ` $ { ks . parseDate ( D , ! 0 ) . format ( ae . dateFormat ) } ` ;s.push({suggestionType:"match",displayText: ` $ { D } ( $ { R } ) ` ,appendText: ` $ { l } $ { R } ` ,insertAt:o.index,insertSkip:o[0].length})}}return s}function fF(r,e,t){var l;let n=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],s=[],a=new RegExp( ` ( $ { tt . recurrenceSymbol } ) \ \ s * ( [ 0 - 9 a - zA - Z ] * ) ` ,"ug"),o=op(r,a,e);if(o&&o.length>=2){let c=o[1],h=o[2];if(h.length<t.autoSuggestMinMatch)return[];if(h.length>0){let D=(l=Tt.fromText({recurrenceRuleText:h,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:l.toText();if(D){let v= ` $ { c } $ { D } ` ;if(s.push({suggestionType:"match",displayText: ` \u2705 $ { D } ` ,appendText:v,insertAt:o.index,insertSkip:o[0].length}),o[0]==v)return[]}}let m=1,_=t.autoSuggestMaxItems/2,T=n.filter(D=>h&&h.length>=m&&D.toLowerCase().includes(h.toLowerCase())).slice(0,_);T.length===0&&h.trim().length===0&&(T=n.slice(0,_));for(let D of T)s.push({suggestionType:"match",displayText: ` $ { D } ` ,appendText: ` $ { c } $ { D } ` ,insertAt:o.index,insertSkip:o[0].length})}return s}function op(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s;return[]}var ol=class extends Iv.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let a=n.getLine(t.line);return a.contains(this.settings.globalFilter)&&a.match(ae.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:a.length},query:a}:null}getSuggestions(t){let n=t.query,s=t.editor.getCursor(),a=Cv(n,s.ch,this.settings),o=[];for(let l of a)o.push(tr(Qe({},l),{context:t}));return o}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var c,h,m;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let _=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(h=(c=s==null?void 0:s.cm)==null?void 0:c.contentDOM)==null||h.dispatchEvent(_);return}let a=t.context.editor.getCursor(),o={line:a.line,ch:(m=t.insertAt)!=null?m:a.ch},l=t.insertSkip?{line:a.line,ch:o.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,o,l),t.context.editor.setCursor({line:a.line,ch:o.ch+t.appendText.length})}};var Fv=(r,e)=>{let t,n=new Promise((o,l)=>{t=o});return
` );t(l)}).open(),n};var Lv=(r,e)=>{let t=Ru({line:"",path:""});return new Bn({app:r,task:t,onSubmit:e})};var Yv=r=>({createTaskLineModal:()=>Fv(r,Lv)});var ul=class extends Uv.Plugin{get apiV1(){return Yv(app)}onload(){return J(this,null,function*(){Po.registerConsoleLogger(),console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new no({plugin:this})),oy({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let t=new Pu({obsidianEvents:this.app.workspace});this.cache=new us({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlineRenderer=new Au({plugin:this}),this.queryRenderer=new il({plugin:this,events:t}),this.registerEditorExtension(cv()),this.registerEditorSuggest(new ol(this.app,se())),new xu({plugin:this})})}loadTaskStatuses(){return J(this,null,function*(){let{statusSettings:t}=se();pt.applyToStatusRegistry(t, $ e.getInstance())})}onunload(){var t;console.log('unloading plugin "tasks"'),(t=this.cache)==null||t.unload()}loadSettings(){return J(this,null,function*(){let t=yield this.loadData();Gt(t),yield this.loadTaskStatuses()})}saveSettings(){return J(this,null,function*(){yield this.saveData(se())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}};
/ * !
* EventEmitter2
* https : //github.com/hij1nx/EventEmitter2
*
* Copyright ( c ) 2013 hij1nx
* Licensed under the MIT license .
* /
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! moment.js
//! momentjs.com
//! version : 2.29.4