/ *
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 Clare Macrae , Ilyas Landikov and Martin Schenck
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 .
* /
/ *
License flatpickr ( included library ) :
The MIT License ( MIT )
Copyright ( c ) 2017 Gregory Petrosyan
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 rD = Object . create ; var ao = Object . defineProperty , nD = Object . defineProperties , iD = Object . getOwnPropertyDescriptor , sD = Object . getOwnPropertyDescriptors , aD = Object . getOwnPropertyNames , Bu = Object . getOwnPropertySymbols , oD = Object . getPrototypeOf , Md = Object . prototype . hasOwnProperty , Qg = Object . prototype . propertyIsEnumerable ; var Kg = ( r , t , e ) => t in r ? ao ( r , t , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : e } ) : r [ t ] = e , ne = ( r , t ) => { for ( var e in t || ( t = { } ) ) Md . call ( t , e ) && Kg ( r , e , t [ e ] ) ; if ( Bu ) for ( var e of Bu ( t ) ) Qg . call ( t , e ) && Kg ( r , e , t [ e ] ) ; return r } , Ee = ( r , t ) => nD ( r , sD ( t ) ) ; var Vu = ( r , t ) => { var e = { } ; for ( var n in r ) Md . call ( r , n ) && t . indexOf ( n ) < 0 && ( e [ n ] = r [ n ] ) ; if ( r != null && Bu ) for ( var n of Bu ( r ) ) t . indexOf ( n ) < 0 && Qg . call ( r , n ) && ( e [ n ] = r [ n ] ) ; return e } ; var S = ( r , t ) => ( ) => ( t || r ( ( t = { exports : { } } ) . exports , t ) , t . exports ) , uD = ( r , t ) => { for ( var e in t ) ao ( r , e , { get : t [ e ] , enumerable : ! 0 } ) } , Xg = ( r , t , e , n ) => { if ( t && typeof t == "object" || typeof t == "function" ) for ( let i of aD ( t ) ) ! Md . call ( r , i ) && i !== e && ao ( r , i , { get : ( ) => t [ i ] , enumerable : ! ( n = iD ( t , i ) ) || n . enumerable } ) ; return r } ; var oo = ( r , t , e ) => ( e = r != null ? rD ( oD ( r ) ) : { } , Xg ( t || ! r || ! r . _ _esModule ? ao ( e , "default" , { value : r , enumerable : ! 0 } ) : e , r ) ) , lD = r => Xg ( ao ( { } , "__esModule" , { value : ! 0 } ) , r ) ; var F = ( r , t , e ) => new Promise ( ( n , i ) => { var s = u => { try { o ( e . next ( u ) ) } catch ( l ) { i ( l ) } } , a = u => { try { o ( e . throw ( u ) ) } catch ( l ) { i ( l ) } } , o = u => u . done ? n ( u . value ) : Promise . resolve ( u . value ) . then ( s , a ) ; o ( ( e = e . apply ( r , t ) ) . next ( ) ) } ) ; var Be = S ( yi => { "use strict" ; Object . defineProperty ( yi , "__esModule" , { value : ! 0 } ) ; yi . matchAnyPattern = yi . extractTerms = yi . repeatedTimeunitPattern = void 0 ; function pD ( r , t ) { let e = t . replace ( /\((?!\?)/g , "(?:" ) ; return ` ${ r } ${ e } \\ s{0,5}(?:,? \\ s{0,5} ${ e } ){0,10} ` } yi . repeatedTimeunitPattern = pD ; function Zg ( r ) { let t ; return r instanceof Array ? t = [ ... r ] : r instanceof Map ? t = Array . from ( r . keys ( ) ) : t = Object . keys ( r ) , t } yi . extractTerms = Zg ; function mD ( r ) { return ` (?: ${ Zg ( r ) . sort ( ( e , n ) => n . length - e . length ) . join ( "|" ) . replace ( /\./g , "\\." ) } ) ` } yi . matchAnyPattern = mD } ) ; var Ie = S ( ( Rd , Ad ) => { ( function ( r , t ) { typeof Rd == "object" && typeof Ad != "undefined" ? Ad . exports = t ( ) : typeof define == "function" && define . amd ? define ( t ) : ( r = typeof globalThis != "undefined" ? globalThis : r || self ) . dayjs = t ( ) } ) ( Rd , function ( ) { "use strict" ; var r = 1e3 , t = 6e4 , e = 36e5 , n = "millisecond" , i = "second" , s = "minute" , a = "hour" , o = "day" , u = "week" , l = "month" , c = "quarter" , d = "year" , f = "date" , m = "Invalid Date" , b = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/ , T = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g , _ = { name : "en" , weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday" . split ( "_" ) , months : "January_February_March_April_May_June_July_August_September_October_November_December" . split ( "_" ) } , x = function ( Q , B , C ) { var Z = String ( Q ) ; return ! Z || Z . length >= B ? Q : "" + Array ( B + 1 - Z . length ) . join ( C ) + Q } , O = { s : x , z : function ( Q ) { var B = - Q . utcOffset ( ) , C = Math . abs ( B ) , Z = Math . floor ( C / 60 ) , W = C % 60 ; return ( B <= 0 ? "+" : "-" ) + x ( Z , 2 , "0" ) + ":" + x ( W , 2 , "0" ) } , m : function Q ( B , C ) { if ( B . date ( ) < C . date ( ) ) return - Q ( C , B ) ; var Z = 12 * ( C . year ( ) - B . year ( ) ) + ( C . month ( ) - B . month ( ) ) , W = B . clone ( ) . add ( Z , l ) , ae = C - W < 0 , p = B . clone ( ) . add ( Z + ( ae ? - 1 : 1 ) , l ) ; return + ( - ( Z + ( C - W ) / ( ae ? W - p : p - W ) ) || 0 ) } , a : function ( Q ) { return Q < 0 ? Math . ceil ( Q ) || 0 : Math . floor ( Q ) } , p : function ( Q ) { return { M : l , y : d , w : u , d : o , D : f , h : a , m : s , s : i , ms : n , Q : c } [ Q ] || String ( Q || "" ) . toLowerCase ( ) . replace ( /s$/ , "" ) } , u : function ( Q ) { return Q === void 0 } } , M = "en" , Y = { } ; Y [ M ] = _ ; var G = function ( Q ) { return Q instanceof Se } , oe = function ( Q , B , C ) { var Z ; if ( ! Q ) return M ; if ( typeof Q == "string" ) Y [ Q ] && ( Z = Q ) , B && ( Y [ Q ] = B , Z = Q ) ; else { var W = Q . name ; Y [ W ] = Q , Z = W } return ! C && Z && ( M = Z ) , Z || ! C && M } , V = function ( Q , B ) { if ( G ( Q ) ) return Q . clone ( ) ; var C = typeof B == "object" ? B : { } ; return C . date = Q , C . args = arguments , new Se ( C ) } , K = O ; K . l = oe , K . i = G , K . w = function ( Q , B ) { return V ( Q , { locale : B . $L , utc : B . $u , x : B . $x , $offset : B . $offset } ) } ; var Se = function ( ) { function Q ( C ) { this . $L = oe ( C . locale , null , ! 0 ) , this . parse ( C ) } var B = Q . prototype ; return B . parse = function ( C ) { this . $d = function ( Z ) { var W = Z . date , ae = Z . utc ; if ( W === null ) return new Date ( NaN ) ; if ( K . u ( W ) ) return new Date ; if ( W instanceof Date ) return new Date ( W ) ; if ( typeof W == "string" && ! /Z$/i . test ( W ) ) { var p = W . match ( b ) ; if ( p ) { var y = p [ 2 ] - 1 || 0 , v = ( p [ 7 ] || "0" ) . substring ( 0 , 3 ) ; return
` ).map( $ N).filter(function(e){return e!==null});return Mt(Mt({},t[0]),t[1])}function mu(r){var t={},e=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^; \s ]+)/i.exec(r);if(!e)return t;var n=e[1],i=e[2];return n&&(t.tzid=n),t.dtstart=cu(i),t}function $ N(r){if(r=r.replace(/^ \s +| \s + $ /,""),!r.length)return null;var t=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!t)return $ v(r);var e=t[1];switch(e.toUpperCase()){case"RRULE":case"EXRULE":return $ v(r);case"DTSTART":return mu(r);default:throw new Error("Unsupported RFC prop ".concat(e," in ").concat(r))}}function $ v(r){var t=r.replace(/^RRULE:/i,""),e=mu(t),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":e.freq=xe[o.toUpperCase()];break;case"WKST":e.wkst=jr[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=GN(o),l=a.toLowerCase();e[l]=u;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=HN(o);break;case"DTSTART":case"TZID":var c=mu(r);e.tzid=c.tzid,e.dtstart=c.dtstart;break;case"UNTIL":e.until=cu(o);break;case"BYEASTER":e.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),e}function GN(r){if(r.indexOf(",")!==-1){var t=r.split(",");return t.map(Gv)}return Gv(r)}function Gv(r){return/^[+-]? \d + $ /.test(r)?Number(r):r}function HN(r){var t=r.split(",");return t.map(function(e){if(e.length===2)return jr[e];var n=e.match(/^([+-]? \d {1,2})([A-Z]{2}) $ /);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(e));var i=Number(n[1]),s=n[2],a=jr[s].weekday;return new ot(a,i)})}var cs=function(){function r(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var t=ta(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:Nv(this.date,this.tzid)},r}();function gu(r){for(var t=[],e="",n=Object.keys(r),i=Object.keys(pu),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!Re(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!Qe(o)||xt(o)&&!o.length)){switch(a){case"FREQ":u=re.FREQUENCIES[r.freq];break;case"WKST":yr(o)?u=new ot(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=xv(o).map(function(m){return m instanceof ot?m:xt(m)?new ot(m[0],m[1]):new ot(m)}).toString();break;case"DTSTART":e=BN(o,r.tzid);break;case"UNTIL":u=ta(o,!r.tzid);break;default:if(xt(o)){for(var l=[],c=0;c<o.length;c++)l[c]=String(o[c]);u=l.toString()}else u=String(o)}u&&t.push([a,u])}}var d=t.map(function(m){var b=m[0],T=m[1];return"".concat(b,"=").concat(T.toString())}).join(";"),f="";return d!==""&&(f="RRULE:".concat(d)),[e,f].filter(function(m){return!!m}).join( `
` )}function BN(r,t){return r?"DTSTART"+new cs(new Date(r),t).toString():""}function VN(r,t){return Array.isArray(r)?!Array.isArray(t)||r.length!==t.length?!1:r.every(function(e,n){return e.getTime()===t[n].getTime()}):r instanceof Date?t instanceof Date&&r.getTime()===t.getTime():r===t}var Hv=function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?zl(e):Dh(e)),t==="all"?this.all=e:(n._value=e,this[t].push(n))},r.prototype._cacheGet=function(t,e){var n=!1,i=e?Object.keys(e):[],s=function(c){for(var d=0;d<i.length;d++){var f=i[d];if(!VN(e[f],c[f]))return!0}return!1},a=this[t];if(t==="all")n=this.all;else if(xt(a))for(var o=0;o<a.length;o++){var u=a[o];if(!(i.length&&s(u))){n=u._value;break}}if(!n&&this.all){for(var l=new Jn(t,e),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(t,n,e)}return xt(n)?Dh(n):n instanceof Date?zl(n):n},r}();var Bv=H(H(H(H(H(H(H(H(H(H(H(H(H([],Ce(1,31),!0),Ce(2,28),!0),Ce(3,31),!0),Ce(4,30),!0),Ce(5,31),!0),Ce(6,30),!0),Ce(7,31),!0),Ce(8,31),!0),Ce(9,30),!0),Ce(10,31),!0),Ce(11,30),!0),Ce(12,31),!0),Ce(1,7),!0),Vv=H(H(H(H(H(H(H(H(H(H(H(H(H([],Ce(1,31),!0),Ce(2,29),!0),Ce(3,31),!0),Ce(4,30),!0),Ce(5,31),!0),Ce(6,30),!0),Ce(7,31),!0),Ce(8,31),!0),Ce(9,30),!0),Ce(10,31),!0),Ce(11,30),!0),Ce(12,31),!0),Ce(1,7),!0),zN=qr(1,29),KN=qr(1,30),Ei=qr(1,31),Ft=qr(1,32),zv=H(H(H(H(H(H(H(H(H(H(H(H(H([],Ft,!0),KN,!0),Ft,!0),Ei,!0),Ft,!0),Ei,!0),Ft,!0),Ft,!0),Ei,!0),Ft,!0),Ei,!0),Ft,!0),Ft.slice(0,7),!0),Kv=H(H(H(H(H(H(H(H(H(H(H(H(H([],Ft,!0),zN,!0),Ft,!0),Ei,!0),Ft,!0),Ei,!0),Ft,!0),Ft,!0),Ei,!0),Ft,!0),Ei,!0),Ft,!0),Ft.slice(0,7),!0),QN=qr(-28,0),XN=qr(-29,0),Di=qr(-30,0),Lt=qr(-31,0),Qv=H(H(H(H(H(H(H(H(H(H(H(H(H([],Lt,!0),XN,!0),Lt,!0),Di,!0),Lt,!0),Di,!0),Lt,!0),Lt,!0),Di,!0),Lt,!0),Di,!0),Lt,!0),Lt.slice(0,7),!0),Xv=H(H(H(H(H(H(H(H(H(H(H(H(H([],Lt,!0),QN,!0),Lt,!0),Di,!0),Lt,!0),Di,!0),Lt,!0),Lt,!0),Di,!0),Lt,!0),Di,!0),Lt,!0),Lt.slice(0,7),!0),Zv=[0,31,60,91,121,152,182,213,244,274,305,335,366],Jv=[0,31,59,90,120,151,181,212,243,273,304,334,365],Mh=function(){for(var r=[],t=0;t<55;t++)r=r.concat(qr(7));return r}();function ew(r,t){var e=On(r,1,1),n=ea(r)?366:365,i=ea(r+1)?366:365,s=lu(e),a=Xn(e),o=Mt(Mt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},ZN(r)),{wnomask:null});if(br(t.byweekno))return o;o.wnomask=Ce(0,n+7);var u,l,c=u=It(7-a+t.wkst,7);c>=4?(c=0,l=o.yearlen+It(a-t.wkst,7)):l=n-c;for(var d=Math.floor(l/7),f=It(l,7),m=Math.floor(d+f/4),b=0;b<t.byweekno.length;b++){var T=t.byweekno[b];if(T<0&&(T+=m+1),T>0&&T<=m){var _=void 0;T>1?(_=c+(T-1)*7,c!==u&&(_-=7-u)):_=c;for(var x=0;x<7&&(o.wnomask[_]=1,_++,o.wdaymask[_]!==t.wkst);x++);}}if(Re(t.byweekno,1)){var _=c+m*7;if(c!==u&&(_-=7-u),_<n)for(var b=0;b<7&&(o.wnomask[_]=1,_+=1,o.wdaymask[_]!==t.wkst);b++);}if(c){var O=void 0;if(Re(t.byweekno,-1))O=-1;else{var M=Xn(On(r-1,1,1)),Y=It(7-M.valueOf()+t.wkst,7),G=ea(r-1)?366:365,oe=void 0;Y>=4?(Y=0,oe=G+It(M-t.wkst,7)):oe=n-c,O=Math.floor(52+It(oe,7)/4)}if(Re(t.byweekno,O))for(var _=0;_<c;_++)o.wnomask[_]=1}return o}function ZN(r){var t=ea(r)?366:365,e=On(r,1,1),n=Xn(e);return t===365?{mmask:Bv,mdaymask:Kv,nmdaymask:Xv,wdaymask:Mh.slice(n),mrange:Jv}:{mmask:Vv,mdaymask:zv,nmdaymask:Qv,wdaymask:Mh.slice(n),mrange:Zv}}function tw(r,t,e,n,i,s){var a={lastyear:r,lastmonth:t,nwdaymask:[]},o=[];if(s.freq===re.YEARLY)if(br(s.bymonth))o=[[0,e]];else for(var u=0;u<s.bymonth.length;u++)t=s.bymonth[u],o.push(n.slice(t-1,t+1));else s.freq===re.MONTHLY&&(o=[n.slice(t-1,t+1)]);if(br(o))return a;a.nwdaymask=Ce(0,e);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],d=l[1]-1,f=0;f<s.bynweekday.length;f++){var m=void 0,b=s.bynweekday[f],T=b[0],_=b[1];_<0?(m=d+(_+1)*7,m-=It(i[m]-T,7)):(m=c+(_-1)*7,m+=It(7-i[m]+T,7)),c<=m&&m<=d&&(a.nwdaymask[m]=1)}return a}function rw(r,t){t===void 0&&(t=0);var e=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),u=Math.floor((n-o+1)/3),l=Math.floor(19*e+n-s-u+15)%30,c=Math.floor(i/4),d=i%4,f=Math.floor(32+2*a+2*c-l-d)%7,m=Math.floor((e+11
` ),n=0;n<e.length;){var i=e[n]=e[n].replace(/ \s + $ /g,"");i?n>0&&i[0]===" "?(e[n-1]+=i.slice(1),e.splice(n,1)):n+=1:e.splice(n,1)}return e}function lI(r){r.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function uw(r,t){return lI(t),r.split(",").map(function(e){return cu(e)})}function lw(r){var t=this;return function(e){if(e!==void 0&&(t["_".concat(r)]=e),t["_".concat(r)]!==void 0)return t["_".concat(r)];for(var n=0;n<t._rrule.length;n++){var i=t._rrule[n].origOptions[r];if(i)return i}}}var Rh=function(r){ra(t,r);function t(e){e===void 0&&(e=!1);var n=r.call(this,{},e)||this;return n.dtstart=lw.apply(n,["dtstart"]),n.tzid=lw.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return t.prototype._iter=function(e){return aw(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){cw(e,this._rrule)},t.prototype.exrule=function(e){cw(e,this._exrule)},t.prototype.rdate=function(e){dw(e,this._rdate)},t.prototype.exdate=function(e){dw(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(e){return Ql(e.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(e){return Ql(e.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(e){return new Date(e.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(e){return new Date(e.getTime())})},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(gu({dtstart:this._dtstart}))),this._rrule.forEach(function(n){e=e.concat(n.toString().split( `
` ))}),this._exrule.forEach(function(n){e=e.concat(n.toString().split( `
` ).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&e.push(fw("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(fw("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join( `
` )},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(n){return e.rrule(n.clone())}),this._exrule.forEach(function(n){return e.exrule(n.clone())}),this._rdate.forEach(function(n){return e.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return e.exdate(new Date(n.getTime()))}),e},t}(re);function cw(r,t){if(!(r instanceof re))throw new TypeError(String(r)+" is not RRule instance");Re(t.map(String),String(r))||t.push(r)}function dw(r,t){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");Re(t.map(Number),Number(r))||(t.push(r),Zn(t))}function fw(r,t,e){var n=!e||e.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(e,":"),s=t.map(function(a){return ta(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var _t=class{constructor({rrule:t,baseOnToday:e,occurrence:n}){this.rrule=t,this.baseOnToday=e,this.occurrence=n}static fromText({recurrenceRuleText:t,occurrence:e}){try{let n=t.match(/^([a-zA-Z0-9, !]+?)( when done)? $ /i);if(n==null)return null;let i=n[1].trim(),s=n[2]!==void 0,a=re.parseText(i);if(a!==null){let o=e.referenceDate;!s&&o!==null?a.dtstart=window.moment(o).startOf("day").utc(!0).toDate():a.dtstart=window.moment().startOf("day").utc(!0).toDate();let u=new re(a);return new _t({rrule:u,baseOnToday:s,occurrence:e})}}catch(n){n instanceof Error&&console.log(n.message)}return null}toText(){let t=this.rrule.toText();return this.baseOnToday&&(t+=" when done"),t}next(t=window.moment()){let e=this.nextReferenceDate(t);return e===null?null:this.occurrence.next(e)}identicalTo(t){return this.baseOnToday!==t.baseOnToday||!this.occurrence.isIdenticalTo(t.occurrence)?!1:this.toText()===t.toText()}nextReferenceDate(t){return this.baseOnToday?this.nextReferenceDateFromToday(t.clone()).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(t){let e=new re(Ee(ne({},this.rrule.origOptions),{dtstart:t.startOf("day").utc(!0).toDate()}));return this.nextAfter(t.endOf("day"),e)}nextReferenceDateFromOriginalReferenceDate(){var e;let t=window.moment((e=this.occurrence.referenceDate)!=null?e:void 0).endOf("day");return this.nextAfter(t,this.rrule)}nextAfter(t,e){t.utc(!0);let n=window.moment.utc(e.after(t.toDate())),i=this.toText(),s=i.match(/every( \d +)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=_t.nextAfterMonths(t,n,e,s[1])));let a=i.match(/every( \d +)? year(s)?(.*)?/);return a!==null&&(n=_t.nextAfterYears(t,n,e,a[1])),_t.addTimezone(n)}static nextAfterMonths(t,e,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));_t.isSkippingTooManyMonths(t,e,s);)e=_t.fromOneDayEarlier(t,n);return e}static isSkippingTooManyMonths(t,e,n){let i=e.month()-t.month();return i+=(e.year()-t.year())*12,i>n}static nextAfterYears(t,e,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));_t.isSkippingTooManyYears(t,e,s);)e=_t.fromOneDayEarlier(t,n);return e}static isSkippingTooManyYears(t,e,n){return e.year()-t.year()>n}static fromOneDayEarlier(t,e){t.subtract(1,"days").endOf("day");let n=e.origOptions;return n.dtstart=t.startOf("day").toDate(),e=new re(n),window.moment.utc(e.after(t.toDate()))}static addTimezone(t){return window.moment.utc(t).set({hour:12,minute:0,second:0,millisecond:0}).local(!0).startOf("day")}};var sa=(m=>(m.Description="description",m.Id="id",m.DependsOn="dependsOn",m.Priority="priority",m.RecurrenceRule="recurrenceRule",m.OnCompletion="onCompletion",m.CreatedDate="createdDate",m.StartDate="startDate",m.ScheduledDate="scheduledDate",m.DueDate="dueDate",m.CancelledDate="cancelledDate",m.DoneDate="doneDate",m.BlockLink="blockLink",m))(sa||{}),Xl=Object.values(sa),Mn=class{constructor(){this.visible={};this.tagsVisible=!0;Xl.forEach(t=>{this.visible[t]=!0})}isShown(t){return this.visible[t]}areTagsShown(){return this.tagsVisible}hide(t){this.visible[t]=!1}setVisibility(t,e){this.visible[t]=e}setTagsVisibility(t){this.tagsVisible=t}get shownComponents(){return Xl.filter(t=>this.visible[t])}get hiddenComponents(){return Xl.filter(t=>!this.visible[t])}get toggleableCompone
` })),c=c.slice(0,a.autoSuggestMaxItems),c}}function gI(r,t,e){let n=xI(t.substring(0,e),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&t.length>e&&t.charAt(e)===n?1:0;return{postfix:i,insertSkip:s}}function yI(r,t,e){let n=[],i=e.line;ms(n,i,r.dueDateSymbol,"due date"),ms(n,i,r.startDateSymbol,"start date"),ms(n,i,r.scheduledDateSymbol,"scheduled date"),bI(n,r,e),ms(n,i,r.recurrenceSymbol,"recurring (repeat)"),TI(n,r,e),_w(t)&&(ms(n,i,r.idSymbol,"id"),ms(n,i,r.dependsOnSymbol,"depends on id")),ms(n,i,r.onCompletionSymbol,"on completion");let s=_I(n,e);return s.length===0&&e.settings.autoSuggestMinMatch===0?n:s}function ms(r,t,e,n){t.includes(e)||r.push({displayText: ` $ { e } $ { n } ` ,appendText: ` $ { e } ` })}function bI(r,t,e){if(!(i=>Object.values(t.prioritySymbols).some(s=>s.length>0&&i.includes(s)))(e.line)){let i=t.prioritySymbols,s=["High","Medium","Low","Highest","Lowest"];for(let a of s){let o=i[a];r.push({displayText:e.dataviewMode? ` $ { o } priority ` : ` $ { o } $ { a . toLowerCase ( ) } priority ` ,appendText: ` $ { o } $ { e . postfix } ` ,insertSkip:e.dataviewMode?e.insertSkip:void 0})}}}function TI(r,t,e){if(!e.line.includes(t.createdDateSymbol)){let i=gr.parseDate("today",!0).format(le.dateFormat);r.push({textToMatch: ` $ { t . createdDateSymbol } created ` ,displayText: ` $ { t . createdDateSymbol } created today ( $ { i } ) ` ,appendText: ` $ { t . createdDateSymbol } $ { i } ` +e.postfix,insertSkip:e.dataviewMode?e.insertSkip:void 0})}}function _I(r,t){let e=la(/([a-zA-Z'_-]*)/g,t),n=[];if(e&&e.length>0){let i=e[0];if(i.length>=Math.max(1,t.settings.autoSuggestMinMatch)){let s=r.filter(a=>{var u;return((u=a.textToMatch)!=null?u:a.displayText).toLowerCase().includes(i.toLowerCase())});for(let a of s){let o=t.dataviewMode&&(a.displayText.includes("priority")||a.displayText.includes("created"))?i.length+t.insertSkip:i.length;n.push({suggestionType:"match",displayText:a.displayText,appendText:a.appendText,insertAt:e.index,insertSkip:o})}}}return n}function vw(r,t){let e= ` $ { t } ` ,n= ` $ { r } $ { t } ` ;return{displayText:e,appendText:n}}function vI(r,t){let n= ` $ { gr . parseDate ( t , ! 0 ) . format ( le . dateFormat ) } ` ,i= ` $ { t } ( $ { n } ) ` ,s= ` $ { r } $ { n } ` ;return{displayText:i,appendText:s}}function wI(r,t,e){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp( ` ( $ { r } ) \ \ s * ( [ 0 - 9 a - zA - Z ] * ) ` ,"ug"),a=la(s,e);if(a&&a.length>=2){let o=a[2];if(o.length<e.settings.autoSuggestMinMatch)return[];let u=o&&o.length>1?gr.parseDate(Yl(o),!0):null;if(u!=null&&u.isValid()){let c=u.format(le.dateFormat);rc(e,a,[c],vw,i)}let l=Ih(n,o,t,!0);rc(e,a,l,vI,i)}return i}function kI(r,t){var a;let e=["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"],n=[],i=new RegExp( ` ( $ { r } ) \ \ s * ( [ 0 - 9 a - zA - Z ] * ) ` ,"ug"),s=la(i,t);if(s&&s.length>=2){let o=s[1],u=s[2];if(u.length<t.settings.autoSuggestMinMatch)return[];if(u.length>0){let f=(a=_t.fromText({recurrenceRuleText:u,occurrence:new Wr({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:a.toText();if(f){let m= ` $ { o } $ { f } ` +t.postfix;if(n.push({suggestionType:"match",displayText: ` \u2705 $ { f } ` ,appendText:m,insertAt:s.index,insertSkip:Fh(s[0],t)}),s[0]==m)return[]}}let l=t.settings.autoSuggestMaxItems/2,c=Ih(e,u,l,!1);c.length===0&&u.trim().length===0&&(c=e.slice(0,l)),rc(t,s,c,(f,m)=>{let b= ` $ { m } ` ,T= ` $ { f } $ { m } ` ;return{displayText:b,appendText:T}},n)}return n}function EI(r,t,e){let n=["delete","keep"],i=[],s=new RegExp( ` ( $ { r } ) \ \ s * ( [ 0 - 9 a - zA - Z ] * ) ` ,"ug"),a=la(s,e);if(a&&a.length>=2){let o=a[2];if(o.length<e.settings.autoSuggestMinMatch)return[];let u=Ih(n,o,t,!0);rc(e,a,u,vw,i)}return i}function DI(r,t,e){let n=[],i=new RegExp( ` ( $ { r } ) \ \ s * ( $ { ds . source } ) ? ` ,"ug"),s=la(i,e);if(s&&s[0].trim().length<=r.length){let a=bu(t.map(o=>o.id));n.push({suggestionType:"match",displayText:"generate unique id",appendText: ` $ { r } $ { a } ` +e.postfix,insertAt:s.index,insertSkip:Fh(s[0],e)})}return n}function SI(r,t,e,n){let
\ ` \` \` ${ n }
flowchart LR
classDef TODO stroke : # f33 , stroke - width : 3 px ;
classDef DONE stroke : # 0 c0 , stroke - width : 3 px ;
classDef IN _PROGRESS stroke : # fa0 , stroke - width : 3 px ;
classDef CANCELLED stroke : # ddd , stroke - width : 3 px ;
classDef NON _TASK stroke : # 99 e , stroke - width : 3 px ;
$ { i . join ( `
` )}
$ { s . join ( `
` )}
linkStyle default stroke : gray
\ ` \` \`
` }addEdgeIfNotToInternal(t,e,n,i,s){let a=t.findIndex(l=>l.symbol===e.symbol),o=a!==-1,u=e.type!=="EMPTY";if(o&&u){let l;s?l='-. " \u {1F501}" .-> ':l=" --> ";let c= ` $ { i + 1 } $ { l } $ { a + 1 } ` ;n.push(c)}}getMermaidNodeLabel(t,e){let n=Sw(t.name),i=t.type;if(e){let s=sc(t.symbol),a=sc(t.nextStatusSymbol),o= ` [ $ { s } ] - > [ $ { a } ] ` ,u= ` '${n}' ` ,l= ` ( $ { i } ) ` ;return ` [ "${u}<br>${o}<br>${l}" ] : : : $ { i } ` }else return ` [ "${n}" ] : : : $ { i } ` }};var Ow=require("obsidian");var Cn=class{constructor(t,e){this.name=t,this.sortOrder=e}get groupText(){return this.name!==""? ` % % $ { this . sortOrder } % % $ { this . name } ` :""}};var Ct=class{constructor(t){this._date=null;this._date=t}get moment(){return this._date}formatAsDate(t=""){return this.format(le.dateFormat,t)}formatAsDateAndTime(t=""){return this.format(le.dateTimeFormat,t)}format(t,e=""){return this._date?this._date.format(t):e}toISOString(t){return this._date?this._date.toISOString(t):""}get category(){let t=window.moment(),e=this.moment;return e?e.isBefore(t,"day")?new Cn("Overdue",1):e.isSame(t,"day")?new Cn("Today",2):e.isValid()?new Cn("Future",3):new Cn("Invalid date",0):new Cn("Undated",4)}get fromNow(){let t=this.moment;if(!t)return new Cn("",0);let e=this.fromNowOrder(t);return new Cn(t.fromNow(),e)}fromNowOrder(t){if(!t.isValid())return 0;let e=window.moment(),n=t.isSameOrBefore(e,"day"),i=this.fromNowStartDateOfGroup(t,n,e);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(t,e,n){let i=t.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return e?n.subtract(s,o):n.add(s,o)}postpone(t="days",e=1){if(!this._date)throw new Ow.Notice("Cannot postpone a null date");let n=window.moment().startOf("day");return this._date.isSameOrAfter(n,"day")?this._date.clone().add(e,t):n.add(e,t)}};var AI=require("obsidian"),Rw=oo(Cw());var qh=class extends Rw.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=e=>e.reduce((n,i)=>n+i,0)/e.length}configure(e){return this.options=Object.assign({},this.options,e),this}getLogger(e){let n="none",i="";for(let s in this.options.minLevels)e.startsWith(s)&&s.length>=i.length&&(n=this.options.minLevels[s],i=s);return new jh(this,e,n)}onLogEntry(e){return this.on("log",e),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(e=>{let n= ` [ $ { window . moment ( ) . format ( "YYYY-MM-DD-HH:mm:ss.SSS" ) } ] [ $ { e . level } ] [ $ { e . module } ] ` ;switch(e.traceId&&(n+= ` [ $ { e . traceId } ] ` ),n+= ` $ { e . message } ` ,e.objects===void 0&&(e.objects=""),e.level){case"trace":console.trace(n,e.objects);break;case"debug":console.debug(n,e.objects);break;case"info":console.info(n,e.objects);break;case"warn":console.warn(n,e.objects);break;case"error":console.error(n,e.objects);break;default:console.log( ` { $ { e . level } } $ { n } ` ,e.objects)}}),this.consoleLoggerRegistered=!0,this)}},Kt=new qh,jh=class{constructor(t,e,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=t,this.module=e,this.minLevel=this.levelToInt(n)}levelToInt(t){return t.toLowerCase()in this.levels?this.levels[t.toLowerCase()]:99}log(t,e,n){if(this.levelToInt(t)<this.minLevel)return;let s={level:t,module:this.module,message:e,objects:n,traceId:void 0};this.logManager.emit("log",s)}trace(t,e){this.log("trace",t,e)}debug(t,e){this.log("debug",t,e)}info(t,e){this.log("info",t,e)}warn(t,e){this.log("warn",t,e)}error(t,e){this.log("error",t,e)}logWithId(t,e,n,i){if(this.levelToInt(t)<this.minLevel)return;let a={level:t,module:this.module,message:n,objects:i,traceId:e};this.logManager.emit("log",a)}traceWithId(t,e,n){this.logWithId("trace",t,e,n)}debugWithId(t,e,n){this.logWithId("debug",t,e,n)}infoWithId(t,e,n){this.logWithId("info",t,e,n)}warnWithId(t,e,n){this.logWithId("warn",t,e,n)}errorWithId(t,e,n){this.logWithId("error",t,e,n)}};function Yh(r,t){let e=Kt.getLogger("tasks");switch(r){case"trace":e.trace(t);break;case"debug":e.debug(t);break;case"info":e.info(t);break;case"warn":e.warn(t);break;case"error":e.error(t);break;default:break}}function ac(r,t,e){r.debug( ` $ { t } : task line number : $ { e . taskLocation . lin
` ),l=u.length,c=new _u(()=>Ut.fromPath(r)),d=null,f=0,m=new Map;for(let _ of e){let x=_.position.start.line;if(x>=l)return n.debug( ` $ { r } Obsidian gave us a line number $ { x } past the end of the file . $ { l } . ` ),a;if((d===null||d.position.end.line<x)&&(d=da.getSection(x,i.sections),f=0),d===null)continue;let O=u[x];if(O===void 0){n.debug( ` $ { r } : line $ { x } - ignoring 'undefined' line . ` );continue}if(_.task!==void 0){let M;try{if(M=de.fromLine({line:O,taskLocation:new Rt(o,x,d.position.start.line,f,da.getPrecedingHeader(x,i.headings)),fallbackDate:c.value}),M!==null){let Y=(b=m.get(_.parent))!=null?b:null;Y!==null&&(M=new de(Ee(ne({},M),{parent:Y}))),m.set(x,M)}}catch(Y){s(Y,r,_,O);continue}M!==null&&(f++,a.push(M))}else{let M=_.position.start.line,Y=(T=m.get(_.parent))!=null?T:null;m.set(M,new jn(u[M],Y))}}return a}var da=class{constructor({metadataCache:t,vault:e,workspace:n,events:i}){this.logger=Kt.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=t,this.metadataCacheEventReferences=[],this.vault=e,this.workspace=n,this.vaultEventReferences=[],this.events=i,this.eventsEventReferences=[],this.tasksMutex=new zu,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.workspace.onLayoutReady(()=>{this.subscribeToVault(),this.loadVault()}),this.subscribeToEvents()}unload(){this.logger.info("Unloading Cache");for(let t of this.metadataCacheEventReferences)this.metadataCache.offref(t);for(let t of this.vaultEventReferences)this.vault.offref(t);for(let t of this.eventsEventReferences)this.events.off(t)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let t=this.metadataCache.on("resolved",()=>F(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(t);let e=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(e)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:t}=ie(),e=this.vault.on("create",s=>{s instanceof ca.TFile&&(this.logger.debug( ` Cache . subscribeToVault . createdEventReference ( ) $ { s . path } ` ),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(e);let n=this.vault.on("delete",s=>{s instanceof ca.TFile&&(this.logger.debug( ` Cache . subscribeToVault . deletedEventReference ( ) $ { s . path } ` ),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof ca.TFile&&(this.logger.debug( ` Cache . subscribeToVault . renamedEventReference ( ) $ { s . path } ` ),this.tasksMutex.runExclusive(()=>{let o=this.metadataCache.getFileCache(s),u=new Et(s.path,o!=null?o:void 0),l=new _u(()=>Ut.fromPath(s.path));this.tasks=this.tasks.map(c=>{if(c.path!==a)return c;let d=c.taskLocation.fromRenamedFile(u);return t?Ut.updateTaskPath(c,d,l.value):new de(Ee(ne({},c),{taskLocation:d}))}),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let t=this.events.onRequestCacheUpdate(e=>{e({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(t)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>F(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(t=>this.indexFile(t))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(t){return F(this,null,function*(){let e=this.metadataCache.getFileCache(t);if(e==null)return;if(!t.path.endsWith(".md")){this.logger.debug("indexFile: skipping n
The following task has been ignored , to prevent Tasks queries getting stuck with 'Loading Tasks ...'
Error : $ { t }
File : $ { e }
Line number : $ { n . position . start . line }
Task line : $ { i }
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 .
` ;this.logger.error(s),t instanceof Error&&this.logger.error(t.stack?t.stack:"Cannot determine stack"),this.state==="Initializing"&&new ca.Notice(s,1e4)}static getSection(t,e){if(e===void 0)return null;for(let n of e)if(n.position.start.line<=t&&n.position.end.line>=t)return n;return null}static getPrecedingHeader(t,e){if(e===void 0)return null;let n=null;for(let i of e){if(i.position.start.line>t)return n;n=i.heading}return n}};var dg=require("obsidian");var Mk=require("obsidian");function Ze(){}function Bh(r){return r()}function Aw(){return Object.create(null)}function Wt(r){r.forEach(Bh)}function cc(r){return typeof r=="function"}function Rn(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function Pw(r){return Object.keys(r).length===0}var Nw=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,wu=class{constructor(t){this.options=t,this._listeners="WeakMap"in Nw?new WeakMap:void 0}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return(t=this._observer)!==null&&t!==void 0?t:this._observer=new ResizeObserver(e=>{var n;for(let i of e)wu.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};wu.entries="WeakMap"in Nw?new WeakMap:void 0;var Iw=!1;function NI(){Iw=!0}function II(){Iw=!1}function $ (r,t){r.appendChild(t)}function Te(r,t,e){r.insertBefore(t,e||null)}function ge(r){r.parentNode&&r.parentNode.removeChild(r)}function bs(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function se(r){return document.createElement(r)}function FI(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Ge(r){return document.createTextNode(r)}function _e(){return Ge(" ")}function dc(){return Ge("")}function Le(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function Fw(r){return function(t){return t.preventDefault(),r.call(this,t)}}function j(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Lw(r){let t;return{p(...e){t=e,t.forEach(n=>r.push(n))},r(){t.forEach(e=>r.splice(r.indexOf(e),1))}}}function LI(r){return Array.from(r.childNodes)}function Gr(r,t){t=""+t,r.data!==t&&(r.data=t)}function nr(r,t){r.value=t==null?"":t}function Vh(r,t,e){for(let n=0;n<r.options.length;n+=1){let i=r.options[n];if(i.__value===t){i.selected=!0;return}}(!e||t!==void 0)&&(r.selectedIndex=-1)}function Uw(r){let t=r.querySelector(":checked");return t&&t.__value}var uc;function UI(){if(uc===void 0){uc=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){uc=!0}}return uc}function Ww(r,t){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=se("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let i=UI(),s;return i?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}< \/ script>",s=Le(window,"message",a=>{a.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=Le(n.contentWindow,"resize",t),t()}), $ (r,n),()=>{(i||s&&n.contentWindow)&&s(),ge(n)}}function ii(r,t,e){r.classList[e?"add":"remove"](t)}var ha=class{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=FI(e.nodeName):this.e=se(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)Te(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(ge)}};var ku;function vu(r){ku=r}function WI(){if(!ku)throw new Error("Function called outside component initialization");return ku}function zh(r){WI(). $ $ .on_mount.push(r)}var pa=[];var nt=[],ma=[],Gh=[],qI=Promi
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 .
` ;Tc(c);return}let l=Math.min(Math.pow(10,s),100);o.debug( ` timeout = $ { l } ` ),setTimeout(()=>F(void 0,null,function*(){yield bk({originalTask:r,newTasks:t,vault:e,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield Tk(r,e),f=[...d.slice(0,l),...t.map(m=>m.toFileLineString()),...d.slice(l+1)];yield e.modify(c,f.join( `
` ))}catch(l){if(l instanceof xi){l.message&&yk(l.message),yield u();return}else if(l instanceof _c){yield u();return}else l instanceof Error&&Tc(l.message)}});function Tk(r,t){return F(this,null,function*(){if(Mu===void 0)throw new xi;let e=t.getAbstractFileByPath(r.path);if(!(e instanceof Cu.TFile))throw new xi( ` Tasks : No file found for task $ { r . description } . Retrying ... ` );if(!TF.includes(e.extension))throw new Error( ` Tasks : Does not support files with the $ { e . extension } file extension . ` );let n=Mu.getFileCache(e);if(n==null||n===null)throw new xi( ` Tasks : No file cache found for file $ { e . path } . Retrying ... ` );let i=n.listItems;if(i===void 0||i.length===0)throw new xi( ` Tasks : No list items found in file cache of $ { e . path } . Retrying ... ` );let a=(yield t.read(e)).split( `
` ),o=vF(r,a,i,_F);if(o===void 0)throw new _c;return[o,e,a]})}function og(r,t){return F(this,null,function*(){try{let[e,n,i]=yield Tk(r,t);return[e,n]}catch(e){e instanceof xi?e.message&&yk(e.message):e instanceof Error&&Tc(e.message)}})}function _k(r,t){return r<t.length}function vF(r,t,e,n){let i=wF(r,t);return i!==void 0||(i=kF(r,t),i!==void 0)?i:EF(r,t,e,n)}function wF(r,t){let e=r.taskLocation.lineNumber;if(_k(e,t)&&t[e]===r.originalMarkdown)return vc().debug( ` Found original markdown at original line number $ { e } ` ),e}function kF(r,t){let e=[];for(let n=0;n<t.length;n++)t[n]===r.originalMarkdown&&e.push(n);if(e.length===1)return e[0]}function EF(r,t,e,n){let i,s=0;for(let a of e){let o=a.position.start.line;if(!_k(o,t))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=t[o];if(Ae.getInstance().includedIn(u)){if(s===r.taskLocation.sectionIndex){if(u===r.originalMarkdown)i=o;else{n( ` Tasks : Unable to find task in file $ { r . taskLocation . path } .
Expected task :
$ { r . originalMarkdown }
Found task :
$ { u } ` );return}break}s++}}return i}var wa=class{constructor(t){this.addGlobalFilterOnSave=t.addGlobalFilterOnSave,this.originalBlocking=t.originalBlocking,this.description=t.description,this.status=t.status,this.priority=t.priority,this.onCompletion=t.onCompletion,this.recurrenceRule=t.recurrenceRule,this.createdDate=t.createdDate,this.startDate=t.startDate,this.scheduledDate=t.scheduledDate,this.dueDate=t.dueDate,this.doneDate=t.doneDate,this.cancelledDate=t.cancelledDate,this.forwardOnly=t.forwardOnly,this.blockedBy=t.blockedBy,this.blocking=t.blocking}static fromTask(t,e){let n=Ae.getInstance().removeAsWordFrom(t.description),i=n!=t.description||!Ae.getInstance().includedIn(t.description),s="none";t.priority==="5"?s="lowest":t.priority==="4"?s="low":t.priority==="2"?s="medium":t.priority==="1"?s="high":t.priority==="0"&&(s="highest");let a=[];for(let u of t.dependsOn){let l=e.find(c=>c.id===u);!l||a.push(l)}let o=e.filter(u=>u.dependsOn.includes(t.id));return new wa({addGlobalFilterOnSave:i,originalBlocking:o,description:n,status:t.status,priority:s,recurrenceRule:t.recurrence?t.recurrence.toText():"",onCompletion:t.onCompletion,createdDate:t.created.formatAsDate(),startDate:t.start.formatAsDate(),scheduledDate:t.scheduled.formatAsDate(),dueDate:t.due.formatAsDate(),doneDate:t.done.formatAsDate(),cancelledDate:t.cancelled.formatAsDate(),forwardOnly:!0,blockedBy:a,blocking:o})}applyEdits(t,e){return F(this,null,function*(){let n=this.description.trim();this.addGlobalFilterOnSave&&(n=Ae.getInstance().prependTo(n));let i=as(this.startDate,this.forwardOnly),s=as(this.scheduledDate,this.forwardOnly),a=as(this.dueDate,this.forwardOnly),o=as(this.cancelledDate,this.forwardOnly),u=as(this.createdDate,this.forwardOnly),l=as(this.doneDate,this.forwardOnly),c=null;this.recurrenceRule&&(c=_t.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new Wr({startDate:i,scheduledDate:s,dueDate:a})}));let d=this.onCompletion,f=[];for(let O of this.blockedBy){let M=yield DF(O,e);f.push(M)}let m=t.id,b=[],T=[];(this.blocking.toString()!==this.originalBlocking.toString()||this.blocking.length!==0)&&(t.id===""&&(m=bu(e.filter(O=>O.id!=="").map(O=>O.id))),b=this.originalBlocking.filter(O=>!this.blocking.includes(O)),T=this.blocking.filter(O=>!this.originalBlocking.includes(O)));let _=new de(Ee(ne({},t),{description:n,status:t.status,priority:Tr.priorityValue(this.priority),onCompletion:d,recurrence:c,startDate:i,scheduledDate:s,dueDate:a,doneDate:l,createdDate:u,cancelledDate:o,dependsOn:f.map(O=>O.id),id:m}));for(let O of b){let M=yw(O,_);yield Br({originalTask:O,newTasks:M})}for(let O of T){let M=gw(O,_);yield Br({originalTask:O,newTasks:M})}let x=this.inferTodaysDate(this.status.type,l,o);return _.handleNewStatusWithRecurrenceInUsersOrder(this.status,x)})}inferTodaysDate(t,e,n){return t==="DONE"&&e!==null?e:t==="CANCELLED"&&n!==null?n:window.moment()}parseAndValidateRecurrence(){var e;if(!this.recurrenceRule)return{parsedRecurrence:"<i>not recurring</>",isRecurrenceValid:!0};let t=(e=_t.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new Wr({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:e.toText();return t?this.startDate||this.scheduledDate||this.dueDate?{parsedRecurrence:t,isRecurrenceValid:!0}:{parsedRecurrence:"<i>due, scheduled or start date required</i>",isRecurrenceValid:!1}:{parsedRecurrence:"<i>invalid recurrence rule</i>",isRecurrenceValid:!1}}};function DF(r,t){return F(this,null,function*(){if(r.id!=="")return r;let e=t.filter(i=>i.id!==""),n=ec(r,e.map(i=>i.id));return yield Br({originalTask:r,newTasks:n}),n})}function SF(r){let t,e=At("Recurs",r[2])+"",n,i,s,a,o,u,l,c,d;return{c(){t=se("label"),n=_e(),i=se("input"),s=_e(),a=se("code"),o=Ge(r[4]),u=_e(),l=new ha(!1),j(t,"for","recurrence"),j(i,"id","recurrence"),j(i,"type","text"),j(i,"class","tasks-modal-date-input"),j(i,"placeholder","Try 'every day when done'"),j(i,"accesskey",r[2]),ii(i,"tasks-modal-error",!r[1]),l.a=null,j(a,"class","tasks-modal-parsed-date")},m(f,m){Te(f,t,m),t.innerHTML=e,Te(f,n,m),Te(f,i,m),nr(i,r[0].recurrenceRule)
` );t.setLine(o,b)};new Mi({app:n,task:l,onSubmit:c,allTasks:i}).open()};var fg=require("obsidian");var Rk=(r,t,e)=>{var u;if(r)return e instanceof fg.MarkdownView;if(!(e instanceof fg.MarkdownView))return;let n=(u=e.file)==null?void 0:u.path;if(n===void 0)return;let i=t.getCursor(),s=i.line,a=t.getLine(s),o=pg(a,n);t.setLine(s,o.text),t.setCursor(WF(i,o))},pg=(r,t)=>{let e=de.fromLine({line:r,taskLocation:Rt.fromUnknownPosition(new Et(t)),fallbackDate:null});if(e!==null){let n=e.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join( `
` ),moveTo:{line:n.length-1}}}else{let n=r.match(le.taskRegex);if(n!==null){let i=n[3],a= $ e.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(le.taskRegex, ` $1 - [ $ { a } ] $4 ` )}}else if(le.listItemRegex.test(r)){let i=r.replace(le.listItemRegex," $ 1 $ 2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(le.indentationRegex," $ 1- ");return{text:i,moveTo:{ch:i.length}}}}},WF=(r,t)=>{var s;let e={line:0,ch:r.ch},n=ne(ne({},e),(s=t.moveTo)!=null?s:{}),i=t.text.split( `
` )[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var kc=class{get app(){return this.plugin.app}constructor({plugin:t}){this.plugin=t,t.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(e,n,i)=>Ck(e,n,i,this.app,this.plugin.getTasks())}),t.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:Rk})}};var Ci=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.hideTree=!0;this.shortMode=!1;this.explainQuery=!1}};function ks(r,t){let e= ` Error : $ { r } .
The error message was :
` ,n="";return t instanceof Error?n+=t:n+="Unknown error", ` $ { e } "${n}" ` }var qF=Object.prototype.toString,Ea=Array.isArray||function(t){return qF.call(t)==="[object Array]"};function hg(r){return typeof r=="function"}function jF(r){return Ea(r)?"array":typeof r}function mg(r){return r.replace(/[ \- \[ \] {}()*+?., \\ \^ $ |# \s ]/g," \\ $ &")}function Ak(r,t){return r!=null&&typeof r=="object"&&t in r}function YF(r,t){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(t)}var $ F=RegExp.prototype.test;function GF(r,t){return $ F.call(r,t)}var HF=/ \S /;function BF(r){return!GF(HF,r)}var VF={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"," ` ":" & # x60 ; "," = ":" & # x3D ; "};function zF(r){return String(r).replace(/[&<>" ' ` = \/ ]/g,function(e){return VF[e]})}var KF=/ \s */,QF=/ \s +/,Pk=/ \s *=/,XF=/ \s * \} /,ZF=/#| \^ | \/ |>| \{ |&|=|!/;function JF(r,t){if(!r)return[];var e=!1,n=[],i=[],s=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,f,m;function b(K){if(typeof K=="string"&&(K=K.split(QF,2)),!Ea(K)||K.length!==2)throw new Error("Invalid tags: "+K);d=new RegExp(mg(K[0])+" \\ s*"),f=new RegExp(" \\ s*"+mg(K[1])),m=new RegExp(" \\ s*"+mg("}"+K[1]))}b(t||Vr.tags);for(var T=new Au(r),_,x,O,M,Y,G;!T.eos();){if(_=T.pos,O=T.scanUntil(d),O)for(var oe=0,V=O.length;oe<V;++oe)M=O.charAt(oe),BF(M)?(s.push(i.length),u+=M):(o=!0,e=!0,u+=" "),i.push(["text",M,_,_+1]),_+=1,M=== `
` &&(c(),u="",l=0,e=!1);if(!T.scan(d))break;if(a=!0,x=T.scan(ZF)||"name",T.scan(KF),x==="="?(O=T.scanUntil(Pk),T.scan(Pk),T.scanUntil(f)):x==="{"?(O=T.scanUntil(m),T.scan(XF),T.scanUntil(f),x="&"):O=T.scanUntil(f),!T.scan(f))throw new Error("Unclosed tag at "+T.pos);if(x==">"?Y=[x,O,_,T.pos,u,l,e]:Y=[x,O,_,T.pos],l++,i.push(Y),x==="#"||x==="^")n.push(Y);else if(x==="/"){if(G=n.pop(),!G)throw new Error('Unopened section "'+O+'" at '+_);if(G[1]!==O)throw new Error('Unclosed section "'+G[1]+'" at '+_)}else x==="name"||x==="{"||x==="&"?o=!0:x==="="&&b(O)}if(c(),G=n.pop(),G)throw new Error('Unclosed section "'+G[1]+'" at '+T.pos);return tL(eL(i))}function eL(r){for(var t=[],e,n,i=0,s=r.length;i<s;++i)e=r[i],e&&(e[0]==="text"&&n&&n[0]==="text"?(n[1]+=e[1],n[3]=e[3]):(t.push(e),n=e));return t}function tL(r){for(var t=[],e=t,n=[],i,s,a=0,o=r.length;a<o;++a)switch(i=r[a],i[0]){case"#":case"^":e.push(i),n.push(i),e=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],e=n.length>0?n[n.length-1][4]:t;break;default:e.push(i)}return t}function Au(r){this.string=r,this.tail=r,this.pos=0}Au.prototype.eos=function(){return this.tail===""};Au.prototype.scan=function(t){var e=this.tail.match(t);if(!e||e.index!==0)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};Au.prototype.scanUntil=function(t){var e=this.tail.search(t),n;switch(e){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=n.length,n};function ka(r,t){this.view=r,this.cache={".":this.view},this.parent=t}ka.prototype.push=function(t){return new ka(t,this)};ka.prototype.lookup=function(t){var e=this.cache,n;if(e.hasOwnProperty(t))n=e[t];else{for(var i=this,s,a,o,u=!1;i;){if(t.indexOf(".")>0)for(s=i.view,a=t.split("."),o=0;s!=null&&o<a.length;)o===a.length-1&&(u=Ak(s,a[o])||YF(s,a[o])),s=s[a[o++]];else s=i.view[t],u=Ak(i.view,t);if(u){n=s;break}i=i.parent}e[t]=n}return hg(n)&&(n=n.call(this.view)),n};function Zt(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}Zt.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};Zt.prototype.parse=function(t,e){var n=this.templateCache,i=t+":"+(e||Vr.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=JF(t,e),s&&n.set(i,a)),a};Zt.prototype.render=function(t,e,n,i){var s=this.getConfigTags(i),a=this.parse(t,s),o=e instanceof ka?e:new ka(e,void 0);return this.renderTokens(a,o,n,t,i)};Zt.prototype.renderTokens=function(t,e,n,i,s){for(var a="",o,u,l,c=0,d=t.length;c<d;++c)l=void 0,o=t[c],u=o[0],u==="#"?l=this.renderSection(o,e,n,i,s):u==="^"?l=this.renderInverted(o,e,n,i,s):u===">"?l=this.renderPartial(o,e,n,s):u==="&"?l=this.unescapedValue(o,e):u==="name"?l=this.escapedValue(o,e,s):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Zt.prototype.renderSection=function(t,e,n,i,s){var a=this,o="",u=e.lookup(t[1]);function l(f){return a.render(f,e,n,s)}if(!!u){if(Ea(u))for(var c=0,d=u.length;c<d;++c)o+=this.renderTokens(t[4],e.push(u[c]),n,i,s);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(t[4],e.push(u),n,i,s);else if(hg(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(e.view,i.slice(t[3],t[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(t[4],e,n,i,s);return o}};Zt.prototype.renderInverted=function(t,e,n,i,s){var a=e.lookup(t[1]);if(!a||Ea(a)&&a.length===0)return this.renderTokens(t[4],e,n,i,s)};Zt.prototype.indentPartial=function(t,e,n){for(var i=e.replace(/[^ \t ]/g,""),s=t.split( `
` ),a=0;a<s.length;a++)s[a].length&&(a>0||!n)&&(s[a]=i+s[a]);return s.join( `
` )};Zt.prototype.renderPartial=function(t,e,n,i){if(!!n){var s=this.getConfigTags(i),a=hg(n)?n(t[1]):n[t[1]];if(a!=null){var o=t[6],u=t[5],l=t[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var d=this.parse(c,s);return this.renderTokens(d,e,n,c,i)}}};Zt.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);if(n!=null)return n};Zt.prototype.escapedValue=function(t,e,n){var i=this.getConfigEscape(n)||Vr.escape,s=e.lookup(t[1]);if(s!=null)return typeof s=="number"&&i===Vr.escape?String(s):i(s)};Zt.prototype.rawValue=function(t){return t[1]};Zt.prototype.getConfigTags=function(t){return Ea(t)?t:t&&typeof t=="object"?t.tags:void 0};Zt.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!Ea(t))return t.escape};var Vr={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){Ru.templateCache=r},get templateCache(){return Ru.templateCache}},Ru=new Zt;Vr.clearCache=function(){return Ru.clearCache()};Vr.parse=function(t,e){return Ru.parse(t,e)};Vr.render=function(t,e,n,i){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+jF(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Ru.render(t,e,n,i)};Vr.escape=zF;Vr.Scanner=Au;Vr.Context=ka;Vr.Writer=Zt;var gg=Vr;var Uk=oo(Lk());function Wk(r,t){gg.escape=function(e){return e};try{return gg.render(r,(0,Uk.default)(t))}catch(e){let n="";throw e instanceof Error?n= ` There was an error expanding one or more placeholders .
The error message was :
$ { e . message . replace ( / > /g , "." ) . replace ( "Missing Mustache data property" , "Unknown property" ) } ` :n="Unknown error expanding placeholders.",n+= `
The problem is in :
$ { r } ` ,Error(n)}}function qk(r){return bg(r,[])}function bg(r,t){return{query:{file:r,allTasks:t}}}var Da=class{constructor(t=""){this.indentation=t}explainQuery(t){if(t.error!==void 0)return this.explainError(t);let e=[];return e.push(this.explainFilters(t)),e.push(this.explainGroups(t)),e.push(this.explainSorters(t)),e.push(this.explainQueryLimits(t)),e.push(this.explainDebugSettings()),e.filter(n=>n!=="").join( `
` )}explainError(t){let e="";return e+= ` Query has an error :
` ,e+=t.error+ `
` ,e}explainFilters(t){return t.filters.length===0?this.indent( ` No filters supplied . All tasks will match the query .
` ):t.filters.map(e=>e.explainFilterIndented(this.indentation)).join( `
` )}explainGroups(t){return t.grouping.length===0?this.indent( ` No grouping instructions supplied .
` ):t.grouping.map(e=>this.indentation+e.instruction).join( `
` )+ `
` }explainSorters(t){return t.sorting.length===0?this.indent( ` No sorting instructions supplied .
` ):t.sorting.map(e=>this.indentation+e.instruction).join( `
` )+ `
` }explainQueryLimits(t){function e(i){let s= ` At most $ { i } task ` ;return i!==1&&(s+="s"),s}let n=[];if(t.limit!==void 0){let i=e(t.limit)+ ` .
` ;n.push(this.indent(i))}if(t.taskGroupLimit!==void 0){let i=e(t.taskGroupLimit)+ ` per group ( if any "group by" options are supplied ) .
` ;n.push(this.indent(i))}return n.join( `
` )}explainDebugSettings(){let t="",{debugSettings:e}=ie();return e.ignoreSortInstructions&&(t+=this.indent( ` NOTE : All sort instructions , including default sort order , are disabled , due to 'ignoreSortInstructions' setting .
` )),t}indent(t){return this.indentation+t}};var qe=class{constructor(t,e=[],n=""){this.description=t,this.symbol=n,this.children=e}static booleanAnd(t){return this.combineOrCreateExplanation("All of",t,"AND")}static booleanOr(t){return this.combineOrCreateExplanation("At least one of",t,"OR")}static booleanNot(t){return new qe("None of",t,"NOT")}static booleanXor(t){return new qe("Exactly one of",t,"XOR")}asString(t=""){if(this.children.length==0)return t+this.description;let e=t;this.symbol===""?e+=this.description:(e+=this.symbol,this.children.length>1&&(e+= ` ( $ { this . description } ) ` ),e+=":");let n=t+" ";for(let i=0;i<this.children.length;i++)e+= `
$ { this . children [ i ] . asString ( n ) } ` ;return e}static combineOrCreateExplanation(t,e,n){if(e.length===2){let i=e[0],s=e[1];if(i.symbol===n&&s.symbol==="")return i.children.push(s),i}return new qe(t,e,n)}};var Sa=class{matchesAnyOf(t){return t.some(e=>this.matches(e))}};var Oa=class extends Sa{constructor(e){super();this.stringToFind=e}matches(e){return Oa.stringIncludesCaseInsensitive(e,this.stringToFind)}static stringIncludesCaseInsensitive(e,n){return e.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(e){return new qe(e)}};var Ri=class extends Sa{constructor(e){super();this.regex=e}static validateAndConstruct(e){let n=/^ \/ (.+) \/ ([^/]*) $ /,i=e.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new Ri(s)}else return null}matches(e){return e.match(this.regex)!==null}static helpMessage(){return String.raw ` See https : //publish.obsidian.md/tasks/Queries/Regular+Expressions
Regular expressions must look like this :
/pattern/
or this :
/ p a t t e r n / f l a g s
Where :
- pattern : The 'regular expression' pattern to search for .
- flags : Optional characters that modify the search .
i => make the search case - insensitive
u => add Unicode support
Examples : /^Log/
/^Log/i
/File Name\.md/
/waiting|waits|waited/i
/\d\d:\d\d/
The following characters have special meaning in the pattern :
to find them literally , you must add a \ before them :
[ \ ^ $ . | ? * + ( )
CAUTION ! Regular expression ( or 'regex' ) searching is a powerful
but advanced feature that requires thorough knowledge in order to
use successfully , and not miss intended search results .
` }explanation(e){let i=rL(e,"using regex: ",this.regexAsString());return new qe(i)}regexAsString(){let e= ` '${this.regex.source}' with ` ;switch(this.regex.flags.length){case 0:e+="no flags";break;case 1:e+= ` flag '${this.regex.flags}' ` ;break;default:e+= ` flags '${this.regex.flags}' ` ;break}return e}};function rL(r,t,e){var o;let n=r.match(/ \/ /);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return ` $ { t . padEnd ( s ) } $ { e } ` }var mn=class{constructor(t,e,n,i){this.instruction=t,this.property=e,this.comparator=mn.maybeReverse(i,n)}static maybeReverse(t,e){return t?mn.makeReversedComparator(e):e}static makeReversedComparator(t){return(e,n,i)=>t(e,n,i)*-1}};var Ai=class{constructor(t,e,n,i){this.instruction=t,this.property=e,this.grouper=n,this.reverse=i}};var Ue=class{canCreateFilterForLine(t){return Ue.lineMatchesFilter(this.filterRegExp(),t)}static lineMatchesFilter(t,e){return t?t.test(e):!1}static getMatch(t,e){return t?e.match(t):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Si(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(t){if(!this.supportsSorting())return null;let e=Ue.getMatch(this.sorterRegExp(),t);if(e===null)return null;let n=!!e[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error( ` sorterRegExp ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` );return new RegExp( ` ^ sort by $ { this . fieldNameSingularEscaped ( ) } ( reverse ) ? ` ,"i")}sorterInstruction(t){let e= ` sort by $ { this . fieldNameSingular ( ) } ` ;return t&&(e+=" reverse"),e}comparator(){throw Error( ` comparator ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` )}createSorter(t){return new mn(this.sorterInstruction(t),this.fieldNameSingular(),this.comparator(),t)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(t){if(!this.supportsGrouping())return null;let e=Ue.getMatch(this.grouperRegExp(),t);if(e===null)return null;let n=!!e[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error( ` grouperRegExp ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` );return new RegExp( ` ^ group by $ { this . fieldNameSingularEscaped ( ) } ( reverse ) ? $ ` ,"i")}grouperInstruction(t){let e= ` group by $ { this . fieldNameSingular ( ) } ` ;return t&&(e+=" reverse"),e}grouper(){throw Error( ` grouper ( ) unimplemented for $ { this . fieldNameSingular ( ) } ` )}createGrouper(t){return new Ai(this.grouperInstruction(t),this.fieldNameSingular(),this.grouper(),t)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var li=class{constructor(t,e){this._rawInstruction=t,this._anyContinuationLinesRemoved=e.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(t){this._anyPlaceholdersExpanded=t}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(t){function e(a,o){o!==a&&(s+= ` =>
$ { t } $ { o } ` )}let n=this._rawInstruction.trim(),i=n.split( `
` ).join( `
` +t),s= ` $ { t } $ { i } ` ;return this._rawInstruction.includes( `
` )&&(s+= `
` +t),e(n,this._anyContinuationLinesRemoved),e(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var qt=class{constructor(t,e,n){this._statement=new li(t,t),this.explanation=n,this.filterFunction=e}get statement(){return this._statement}setStatement(t){this._statement=t}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(t){let e=this._statement.explainStatement(t);return this.onlyNeedsOneLineExplanation()? ` $ { e }
` : ` $ { e } =>
$ { this . explanation . asString ( t + " " ) }
` }simulateExplainFilter(){return this.onlyNeedsOneLineExplanation()?this.explanation:new qe(this.instruction+" =>",[this.explanation])}onlyNeedsOneLineExplanation(){return this.explanation.asString("")===this.instruction}};var Nn=class{constructor(t){this.instruction=t}get queryComponent(){return this._queryComponent}set queryComponent(t){this._queryComponent=t}get error(){return this._error}set error(t){this._error=t}isValid(){return this._queryComponent!==void 0}static fromObject(t,e){let n=new Nn(t);return n._queryComponent=e,n}static fromError(t,e){let n=new Nn(t);return n._error=e,n}};var ye=class{constructor(t){this.object=t}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}isValid(){return this.object.isValid()}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(t){return new ye(Nn.fromObject(t.instruction,t))}static fromError(t,e){return new ye(Nn.fromError(t,e))}};var Ke=class extends Ue{createFilterOrErrorMessage(t){let e=Ue.getMatch(this.filterRegExp(),t);if(e===null)return ye.fromError(t, ` do not understand query filter ( $ { this . fieldName ( ) } ) ` );let n=e[1].toLowerCase(),i=e[2],s=null;if(n.includes("include"))s=new Oa(i);else if(n.includes("regex")){try{s=Ri.validateAndConstruct(i)}catch(u){let l=ks("Parsing regular expression",u)+ `
$ { Ri . helpMessage ( ) } ` ;return ye.fromError(t,l)}if(s===null)return ye.fromError(t, ` Invalid instruction : '${t}'
$ { Ri . helpMessage ( ) } ` )}if(s===null)return ye.fromError(t, ` do not understand query filter ( $ { this . fieldName ( ) } ) ` );let a=n.match(/not/)!==null,o=new qt(t,this.getFilter(s,a),s.explanation(t));return ye.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp( ` ^ ( ? : $ { this . fieldPattern ( ) } ) ( $ { this . filterOperatorPattern ( ) } ) ( . * ) ` ,"i")}getFilter(t,e){return n=>{let i=t.matches(this.value(n));return e?!i:i}}comparator(){return(t,e)=>this.value(t).localeCompare(this.value(e),void 0,{numeric:!0})}grouper(){return t=>[this.value(t)]}static escapeMarkdownCharacters(t){return t.replace(/ \\ /g," \\ \\ ").replace(/_/g," \\ _")}};var Es=class extends Ke{fieldName(){return"description"}value(t){return Ae.getInstance().removeAsSubstringFrom(t.description)}supportsSorting(){return!0}comparator(){return(t,e)=>{let n=Es.cleanDescription(t.description),i=Es.cleanDescription(e.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(t){t=Ae.getInstance().removeAsSubstringFrom(t);let e=/^ \[ \[ ?([^ \] ]*)]]?/,n=t.match(e);if(n!==null){let i=n[1];t=i.substring(i.indexOf("|")+1)+t.replace(e,"")}return t=this.replaceFormatting(t,/^ \* \* ([^*]+) \* \* /),t=this.replaceFormatting(t,/^ \* ([^*]+) \* /),t=this.replaceFormatting(t,/^==([^=]+)==/),t=this.replaceFormatting(t,/^__([^_]+)__/),t=this.replaceFormatting(t,/^_([^_]+)_/),t}static replaceFormatting(t,e){let n=t.match(e);return n!==null&&(t=n[1]+t.replace(e,"")),t}};var Ec=class{findUnexpandedDateText(t){let e=["<%","YYYY-MM-DD"];for(let n of e)if(t.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(t){return ` Instruction contains unexpanded template text : "${t}" - and cannot be interpreted .
Possible causes :
- The query is an a template file , and is not intended to be searched .
- A command such as "Replace templates in the active file" needs to be run .
- The core "Daily notes" plugin is in use , and the template contained
date calculations that it does not support .
- Some sample template text was accidentally pasted in to a tasks query ,
instead of in to a template file .
See : https : //publish.obsidian.md/tasks/Advanced/Instruction+contains+unexpanded+template+text
` }};var Dc=class{constructor(t,e){this._instruction=t,this._filter=e}canCreateFilterForLine(t){return t.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(t){return this.canCreateFilterForLine(t)?ye.fromFilter(new qt(t,this._filter,new qe(t))):ye.fromError(t, ` do not understand filter : $ { t } ` )}};var or=class{constructor(){this._filters=[]}add(t,e){this._filters.push(new Dc(t,e))}canCreateFilterForLine(t){return this._filters.some(e=>e.canCreateFilterForLine(t))}createFilterOrErrorMessage(t){for(let e of this._filters){let n=e.createFilterOrErrorMessage(t);if(n.isValid())return n}return ye.fromError(t, ` do not understand filter : $ { t } ` )}};var vt=class extends Ue{constructor(e=null){super();e!==null?this.filterInstructions=e:(this.filterInstructions=new or,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 i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){var f;let n=this.checkForUnexpandedTemplateText(e);if(n)return ye.fromError(e,n);let i=this.filterInstructions.createFilterOrErrorMessage(e);if(i.isValid())return i;let s=Ue.getMatch(this.filterRegExp(),e);if(s===null)return ye.fromError(e,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(f=s[2])==null?void 0:f.toLowerCase(),u=s[3],l=gr.parseDateRange(u);if(!l.isValid()){let m=gr.parseDate(a);m.isValid()&&(l=new Vt(m,m))}if(!l.isValid())return ye.fromError(e,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=vt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return ye.fromFilter(new qt(e,c,d))}buildFilterFunction(e,n){let i;switch(e){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(e){return n=>e(this.date(n))}filterRegExp(){return new RegExp( ` ^ $ { this . fieldNameForFilterInstruction ( ) } ( ( ( ? : on | in ) or before | before | ( ? : on | in ) or after | after | on | in ) ? ? ( . * ) ) ` ,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(e,n,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=s.start.format(o);break;case"after":case"on or before":u=s.end.format(o);break;case"in or before":a="on or before",u=s.end.format(o);break;case"in or after":a="on or after",u=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c= ` $ { e } date is between : ` ,d=[new qe( ` $ { s . start . format ( o ) } and ` ),new qe( ` $ { s . end . format ( o ) } inclusive ` )];return i&&d.push(new qe( ` OR no $ { e } date ` )),new qe(c,d)}a="on",u=s.start.format(o);break}let l= ` $ { e } date is $ { a } $ { u } ` ;return i&&(l+= ` OR no $ { e } date ` ),new qe(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(e,n)=>Ur(this.date(e),this.date(n))}supportsGrouping(){return!0}grouper(){return e=>{let n=this.date(e);return n===null?["No "+this.fieldName()+" date"]:n.isValid()?[n.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(e){return new Ec().findUnexpandedDateText(e)}};var Sc=class extends vt{fieldName(){return"created"}date(t){return t.createdDate}filterResultIfFieldMissing(){return!1}};var Oc=class extends vt{fieldName(){return"done"}date(t){return t.doneDate}filterResultIfFieldMissing(){return!1}};var xa=class extends vt{fieldName(){return"due"}date(t){return t.dueDate}filterResultIfFieldMissing(){
The instruction was converted to the following simplified line :
$ { i . simplifiedLine }
Where the sub - expressions in the simplified line are :
$ { a }
For help , see :
https : //publish.obsidian.md/tasks/Queries/Combining+Filters
` ;return ye.fromError(e,u)}stringifySubExpressionsForErrorMessage(e){return Object.entries(e).map(([n,i])=> ` '${n}' : '${i}'
=> $ { this . stringifySubExpressionStatus ( i ) } ` ).join( `
` )}stringifySubExpressionStatus(e){let n=Fu(e);return n?n.error? ` ERROR :
$ { n . error . split ( `
` ).map(s=>s.trim()).join( `
` )} ` : "OK" : ` ERROR:
do not understand query ` }helpMessageFromSimpleError(e,n){return ` Could not interpret the following instruction as a Boolean combination :
$ { e }
The error message is :
$ { n } ` }};var Yc=class extends Ke{fieldName(){return"filename"}value(t){let e=t.filename;return e===null?"":e+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return t=>{let e=t.filename;return e===null?["Unknown Location"]:["[["+e+"]]"]}}};var La=class extends Ue{canCreateFilterForLine(t){return!1}createFilterOrErrorMessage(t){return ye.fromError(t,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error( ` filterRegExp ( ) unimplemented for $ { this . fieldName ( ) } ` )}supportsSorting(){return!0}comparator(){return(t,e)=>e.urgency-t.urgency}supportsGrouping(){return!0}grouper(){return t=>[ ` $ { t . urgency . toFixed ( 2 ) } ` ]}createGrouper(t){return super.createGrouper(!t)}grouperInstruction(t){return super.grouperInstruction(!t)}};var $ c=class extends Ke{constructor(){super()}fieldName(){return"status.name"}value(t){return t.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var Un=class extends Ue{canCreateFilterForLine(t){let e=new RegExp( ` ^ ( ? : $ { this . fieldNameSingularEscaped ( ) } ) ` ,"i");return Ue.lineMatchesFilter(e,t)}createFilterOrErrorMessage(t){let e=Ue.getMatch(this.filterRegExp(),t);if(e===null)return this.helpMessage(t);let n=e[1].toLowerCase(),i=e[2],s=zt[i.toUpperCase()];if(!s)return this.helpMessage(t);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(t)}return ye.fromFilter(new qt(t,a,new qe(t)))}filterRegExp(){return new RegExp( ` ^ ( ? : $ { this . fieldNameSingularEscaped ( ) } ) ( is | is not ) ( [ ^ ] + ) $ ` ,"i")}helpMessage(t){let e=Object.values(zt).filter(i=>i!=="EMPTY").join(" "),n= ` Invalid $ { this . fieldNameSingular ( ) } instruction : '${t}' .
Allowed options : 'is' and 'is not' ( without quotes ) .
Allowed values : $ { e }
Note : values are case - insensitive ,
so 'in_progress' works too , for example .
Example : $ { this . fieldNameSingular ( ) } is not NON _TASK ` ;return ye.fromError(t,n)}fieldName(){return"status.type"}value(t){return t.status.type}supportsSorting(){return!0}comparator(){return(t,e)=>{let n=Un.groupName(t),i=Un.groupName(e);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>[Un.groupName(t)]}static groupName(t){return t.status.typeGroupText}};var Gc=class extends Ke{fieldName(){return"recurrence"}value(t){return t.recurrence!==null?t.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return t=>t.recurrence!==null?[t.recurrence.toText()]:["None"]}};var Hc=class extends Ke{fieldName(){return"folder"}value(t){return t.file.folder}supportsGrouping(){return!0}grouper(){return t=>[Ke.escapeMarkdownCharacters(this.value(t))]}};var Bc=class extends Ke{fieldName(){return"root"}value(t){return t.file.root}supportsGrouping(){return!0}grouper(){return t=>[Ke.escapeMarkdownCharacters(this.value(t))]}};var Vc=class extends Ke{fieldName(){return"backlink"}value(t){let e=t.getLinkText({isFilenameUnique:!0});return e===null?"Unknown Location":e}createFilterOrErrorMessage(t){return ye.fromError(t,"backlink field does not support filtering")}canCreateFilterForLine(t){return!1}supportsGrouping(){return!0}grouper(){return t=>{let e=t.filename;if(e===null)return["Unknown Location"];let n=t.precedingHeader;return n===null?["[["+e+"]]"]:[ ` [ [ $ { e } # $ { n } | $ { e } > $ { n } ] ] ` ]}}};var zc=class extends vt{fieldName(){return"cancelled"}date(t){return t.cancelledDate}filterResultIfFieldMissing(){return!1}};var Kc=class extends zr{constructor(){super(),this._filters.add("is blocking",(t,e)=>t.isBlocking(e.allTasks)),this._filters.add("is not blocking",(t,e)=>!t.isBlocking(e.allTasks)),this._filters.add("is blocked",(t,e)=>t.isBlocked(e.allTasks)),this._filters.add("is not blocked",(t,e)=>!t.isBlocked(e.allTasks))}fieldName(){return"blocking"}};var Qc=class extends Ke{constructor(){super();this.filterInstructions=new or;this.filterInstructions.add("has id",e=>e.id.length>0),this.filterInstructions.add("no id",e=>e.id.length===0)}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){let n=this.filterInstructions.createFilterOrErrorMessage(e);return n.isValid()?n:super.createFilterOrErrorMessage(e)}fieldName(){return"id"}value(e){return e.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var Xc=class extends Ue{constructor(){super();this.filterInstructions=new or;this.filterInstructions.add("has depends on",e=>e.dependsOn.length>0),this.filterInstructions.add("no depends on",e=>e.dependsOn.length===0)}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){let n=this.filterInstructions.createFilterOrErrorMessage(e);return n.isValid()?n:ye.fromError(e,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var Zc=class extends zr{fieldName(){return"random"}supportsSorting(){return!0}comparator(){return(t,e)=>this.sortKey(t)-this.sortKey(e)}sortKey(t){let e=i=>{let s=0,a=9;for(;s<i.length;)a=Math.imul(a^i.charCodeAt(s++),387420489);return a^a>>>9},n=window.moment().format("Y-MM-DD");return e(n+" "+t.description)}};var Ng=[()=>new $ c,()=>new Un,()=>new Pi,()=>new Ic,()=>new Ds,()=>new Nc,()=>new zc,()=>new Sc,()=>new Pc,()=>new Ac,()=>new xa,()=>new Oc,()=>new Ma,()=>new Hc,()=>new Bc,()=>new Vc,()=>new Es,()=>new Ss,()=>new Rc,()=>new xc,()=>new Yc,()=>new La,()=>new Gc,()=>new Cc,()=>new Qc,()=>new Xc,()=>new Kc,()=>new Zc,()=>new jc];function Fu(r){for(let t of Ng){let e=t();if(e.canCreateFilterForLine(r))return e.createFilterOrErrorMessage(r)}return null}function rE(r){let t=/^sort by /i;if(r.match(t)===null)return null;for(let e of Ng){let i=e().createSorterFromLine(r);if(i)return i}return null}function nE(r){let t=/^group by /i;if(r.match(t)===null)return null;for(let e of Ng){let i=e().createGrouperFromLine(r);if(i)return i}return null}var Jc=class{constructor(t,e
` ;return t}toString(){let t= `
` ;t+= ` Group names : [ $ { this . groups } ]
` ;for(let e of this.groupHeadings)t+= ` $ { "#" . repeat ( 4 + e . nestingLevel ) } [ $ { e . property } ] $ { e . displayName }
` ;return t+=this.tasksAsStringOfLines(),t}};var Ua=class{constructor(t,e,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=e.length,this._groupers=t;let s=new nd(t,e,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let t="";t+= ` Groupers ( if any ) :
` ;for(let n of this._groupers){let i=n.reverse?" reverse":"";t+= ` - $ { n . property } $ { i }
` }for(let n of this.groups)t+=n.toString(),t+= `
-- -
` ;return t+= `
$ { this . totalTasksCount ( ) } tasks
` ,t}addTaskGroups(t){for(let[e,n]of t){let i=new id(e,n);this.addTaskGroup(i)}}addTaskGroup(t){this._groups.push(t)}sortTaskGroups(){let t=(e,n)=>{let i=e.groups,s=n.groups;for(let a=0;a<i.length;a++){let o=this._groupers[a],u=i[a].localeCompare(s[a],void 0,{numeric:!0});if(u!==0)return o.reverse?-u:u}return 0};this._groups.sort(t)}setGroupsHeadings(t){let e=new ed(t,this._groupers);for(let n of this._groups)n.setGroupHeadings(e.getHeadingsForTaskGroup(n.groups))}applyTaskLimit(t){this._groupers.length!==0&&(this._groups.forEach(e=>{e.applyTaskLimit(t)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let t=[];this._groups.forEach(n=>{t=[...t,...n.tasks]});let e=[...new Set(t)];this._totalTaskCount=e.length}};var Fi=class{constructor(t,e){this.tasksFile=t,this.allTasks=[...e]}static fromAllTasks(t){return new Fi(void 0,t)}get queryPath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}queryContext(){return this.tasksFile?bg(this.tasksFile,this.allTasks):void 0}};function iE(r){return ` task$ { r !== 1 ? "s" : "" } ` }var Ms=class{constructor(t,e){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=t,this.totalTasksCountBeforeLimit=e}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(t){this._searchErrorMessage=t}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let t=this.totalTasksCount,e=this.totalTasksCountBeforeLimit;return t===e? ` $ { t } $ { iE ( t ) } ` : ` $ { t } of $ { e } $ { iE ( e ) } ` }get groups(){return this.taskGroups.groups}static fromError(t){let e=new Ms(new Ua([],[],Fi.fromAllTasks([])),0);return e._searchErrorMessage=t,e}};function sE(r){return r.endsWith(" \\ ")}function aE(r){return r.endsWith(" \\ \\ ")}function NL(r){return r.replace(/^[ \t ]*/,"")}function IL(r){return r.replace(/[ \t ]* \\ $ /,"")}function FL(r,t){let e=r;return t&&(e=NL(r)),aE(e)?e=e.slice(0,-1):sE(r)&&(e=IL(e)),e}function oE(r){let t=[],e=!1,n="",i="",s=r+ `
` ;for(let a of s.split( `
` )){let o=FL(a,e);e?(n+= `
` +a,i+=" "+o):(n=a,i=o),aE(a)?e=!1:e=sE(a),e||(i.trim()!==""&&t.push(new li(n,i)),n="",i="")}return t}var Wa=class{static by(t,e,n){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of t)s.push(a.comparator);return e.sort(Wa.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new Un().createNormalSorter(),new La().createNormalSorter(),new xa().createNormalSorter(),new Ds().createNormalSorter(),new Ma().createNormalSorter()]}static makeCompositeComparator(t,e){return(n,i)=>{for(let s of t){let a=s(n,i,e);if(a!==0)return a}return 0}}};var gn=class{constructor(t,e=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Mn;this._queryLayoutOptions=new Ci;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|cancelled date|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|postpone button|urgency|tags|depends on|id|on completion|tree)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Kt.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?( \d +)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=t,this.tasksFile=e,this.debug( ` Creating query : $ { this . formatQueryForLogging ( ) } ` ),oE(t).forEach(n=>{let i=this.expandPlaceholders(n,e);if(this.error===void 0)try{this.parseLine(i,n)}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,n);return}})}get filePath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}get queryId(){return this._queryId}parseLine(t,e){switch(!0){case this.shortModeRegexp.test(t):this._queryLayoutOptions.shortMode=!0;break;case this.fullModeRegexp.test(t):this._queryLayoutOptions.shortMode=!1;break;case this.explainQueryRegexp.test(t):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(t):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(t):this.parseLimit(t);break;case this.parseSortBy(t):break;case this.parseGroupBy(t):break;case this.hideOptionsRegexp.test(t):this.parseHideOptions(t);break;case this.commentRegexp.test(t):break;case this.parseFilter(t,e):break;default:this.setError("do not understand query",e)}}formatQueryForLogging(){return ` [ $ { this . source . split ( `
` ).join(" ; ")}] ` } expandPlaceholders ( t , e ) { let n = t . anyContinuationLinesRemoved ; if ( n . includes ( "{{" ) && n . includes ( "}}" ) && this . tasksFile === void 0 ) return this . _error = ` The query looks like it contains a placeholder, with "{{" and "}}"
but no file path has been supplied , so cannot expand placeholder values .
The query is :
$ { n } ` ,n;let i=n;if(e){let s=qk(e);try{i=Wk(n,s)}catch(a){return a instanceof Error?this._error=a.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",n}}return t.recordExpandedPlaceholders(i),i}append(t){return this.source===""?t:t.source===""?this:new gn( ` $ { this . source }
$ { t . source } ` ,this.tasksFile)}explainQuery(){return new Da().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}get filters(){return this._filters}addFilter(t){this._filters.push(t)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(t,e){this._error=gn.generateErrorMessage(e,t)}static generateErrorMessage(t,e){return t.allLinesIdentical()? ` $ { e }
Problem line : "${t.rawInstruction}" ` : ` $ { e }
Problem statement :
$ { t . explainStatement ( " " ) }
` }get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(t){this.debug( ` Executing query : $ { this . formatQueryForLogging ( ) } ` );let e=new Fi(this.tasksFile,t),n;try{this.filters.forEach(u=>{n=u.statement,t=t.filter(l=>u.filterFunction(l,e))}),n=void 0;let{debugSettings:i}=ie(),s=i.ignoreSortInstructions?t:Wa.by(this.sorting,t,e),a=s.slice(0,this.limit),o=new Ua(this.grouping,a,e);return this._taskGroupLimit!==void 0&&o.applyTaskLimit(this._taskGroupLimit),new Ms(o,s.length)}catch(i){let a=ks("Search failed",i);return n&&(a=gn.generateErrorMessage(n,a)),Ms.fromError(a)}}parseHideOptions(t){let e=t.match(this.hideOptionsRegexp);if(e!==null){let n=e[1].toLowerCase()==="hide";switch(e[2].toLowerCase()){case"tree":this._queryLayoutOptions.hideTree=n;break;case"task count":this._queryLayoutOptions.hideTaskCount=n;break;case"backlink":this._queryLayoutOptions.hideBacklinks=n;break;case"postpone button":this._queryLayoutOptions.hidePostponeButton=n;break;case"priority":this._taskLayoutOptions.setVisibility("priority",!n);break;case"cancelled date":this._taskLayoutOptions.setVisibility("cancelledDate",!n);break;case"created date":this._taskLayoutOptions.setVisibility("createdDate",!n);break;case"start date":this._taskLayoutOptions.setVisibility("startDate",!n);break;case"scheduled date":this._taskLayoutOptions.setVisibility("scheduledDate",!n);break;case"due date":this._taskLayoutOptions.setVisibility("dueDate",!n);break;case"done date":this._taskLayoutOptions.setVisibility("doneDate",!n);break;case"recurrence rule":this._taskLayoutOptions.setVisibility("recurrenceRule",!n);break;case"edit button":this._queryLayoutOptions.hideEditButton=n;break;case"urgency":this._queryLayoutOptions.hideUrgency=n;break;case"tags":this._taskLayoutOptions.setTagsVisibility(!n);break;case"id":this._taskLayoutOptions.setVisibility("id",!n);break;case"depends on":this._taskLayoutOptions.setVisibility("dependsOn",!n);break;case"on completion":this._taskLayoutOptions.setVisibility("onCompletion",!n);break;default:this.setError("do not understand hide/show option",new li(t,t))}}}parseFilter(t,e){var i;let n=Fu(t);return n!=null?(n.filter?(n.filter.setStatement(e),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"Unknown error",e),!0):!1}parseLimit(t){let e=t.match(this.limitRegexp);if(e===null){this.setError("do not understand query limit",new li(t,t));return}let n=Number.parseInt(e[3],10);e[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(t){let e=rE(t);return e?(this._sorting.push(e),!0):!1}parseGroupBy(t){let e=nE(t);return e?(this._grouping.push(e),!0):!1}generateQueryId(t){let e="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:t},()=>e[Math.floor(Math.random()*e.length)]).join("")}debug(t,e){this.logger.debugWithId(this._queryId, ` "${this.filePath}" : $ { t } ` ,e)}};var Li=class{constructor(t=Li.empty){this._source=t}static getInstance(){return Li.instance||(Li.instance=new Li),Li.instance}set(t){this._source=t}query(t=void 0){return new gn(this._source,t)}hasInstructions(){return this._source.trim()!==Li.empty}},Dr=Li;Dr.empty="";var sd=class{constructor({obsidianEvents:t}){this.logger=Kt.getLogger("tasks.Events");this.obsidianEvents=t}onCacheUpdate(t){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",t)}triggerCacheUpdate(t){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",t)}onRequestCacheUpdate(t){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",t)}triggerRequestCacheUpdate(t){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",t)}off(t){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(t)}};var AE=require("obsidian");var RE=require("obsidian");var Ig=class{constructor(t){this.newStatus=t}apply(t){return this.isCheckedForTask(t)?[t]:t.handleNewStatusWithRecurr
< span class = 'flatpickr-weekday' >
` +g.join("</span><span class='flatpickr-weekday'>")+ `
< / s p a n >
` }}function w(){e.calendarContainer.classList.add("hasWeeks");var h=We("div","flatpickr-weekwrapper");h.appendChild(We("span","flatpickr-weekday",e.l10n.weekAbbreviation));var g=We("div","flatpickr-weeks");return h.appendChild(g),{weekWrapper:h,weekNumbers:g}}function D(h,g){g===void 0&&(g=!0);var k=g?h:h-e.currentMonth;k<0&&e._hidePrevMonthArrow===!0||k>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=k,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,ze("onYearChange"),C()),B(),ze("onMonthChange"),Fs())}function R(h,g){if(h===void 0&&(h=!0),g===void 0&&(g=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,g===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var k=pd(e.config),A=k.hours,q=k.minutes,z=k.seconds;m(A,q,z)}e.redraw(),h&&ze("onChange")}function N(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),ze("onClose")}function L(){e.config!==void 0&&ze("onDestroy");for(var h=e._handlers.length;h--;)e._handlers[h].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var g=e.calendarContainer.parentNode;if(g.lastChild&&g.removeChild(g.lastChild),g.parentNode){for(;g.firstChild;)g.parentNode.insertBefore(g.firstChild,g);g.parentNode.removeChild(g)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(k){try{delete e[k]}catch(A){}})}function E(h){return e.calendarContainer.contains(h)}function P(h){if(e.isOpen&&!e.config.inline){var g=lr(h),k=E(g),A=g===e.input||g===e.altInput||e.element.contains(g)||h.path&&h.path.indexOf&&(~h.path.indexOf(e.input)||~h.path.indexOf(e.altInput)),q=!A&&!k&&!E(h.relatedTarget),z=!e.config.ignoredFocusElements.some(function(he){return he.contains(g)});q&&z&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function U(h){if(!(!h||e.config.minDate&&h<e.config.minDate.getFullYear()||e.config.maxDate&&h>e.config.maxDate.getFullYear())){var g=h,k=e.currentYear!==g;e.currentYear=g||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),k&&(e.redraw(),ze("onYearChange"),C())}}function ue(h,g){var k;g===void 0&&(g=!0);var A=e.parseDate(h,void 0,g);if(e.config.minDate&&A&&cr(A,e.config.minDate,g!==void 0?g:!e.minDateHasTime)<0||e.config.maxDate&&A&&cr(A,e.config.maxDate,g!==void 0?g:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(A===void 0)return!1;for(var q=
` );if(m===void 0)return!1;let b=null;for(let _=0;_<m.length;_=_+1)if(m[_]!==""){b=m[_];break}return b===null?!1:Ae.getInstance().includedIn(b)});if(i.length===0)return;let s=e.sourcePath,a=e.getSectionInfo(t);if(a===null)return;let o=a.text.split( `
` ),u=0,l=[];for(let f=a.lineStart;f<=a.lineEnd;f++){let m=o[f];if(m===void 0)continue;let b=null,T=de.fromLine({line:m,taskLocation:new Rt(new Et(s),f,a.lineStart,u,b),fallbackDate:null});T!==null&&(l.push(T),u++)}let c=new fi({obsidianComponent:n,parentUlElement:t,taskLayoutOptions:new Mn,queryLayoutOptions:new Ci});for(let f=0;f<i.length;f++){let m=l[f],b=i[f];if(m===void 0||b===void 0)continue;let T=(d=b.getAttr("data-line"))!=null?d:"0",_=Number.parseInt(T,10),x=yield c.renderTaskLine(m,_),O=b.childNodes;for(let G=0;G<O.length;G=G+1){let oe=O[G],V=oe.nodeName.toLowerCase();V==="div"?x.prepend(oe):(V==="ul"||V==="ol")&&x.append(oe)}let M=b.querySelectorAll("[data-footnote-id]"),Y=x.querySelectorAll("[data-footnote-id]");if(M.length===Y.length)for(let G=0;G<M.length;G++)Y[G].replaceWith(M[G]);b.replaceWith(x)}})}};var PE=require("@codemirror/view"),NE=require("obsidian");var IE=()=>PE.ViewPlugin.fromClass(Hg),Hg=class{constructor(t){this.view=t,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(t){let{target:e}=t;if(!e||!(e instanceof HTMLInputElement)||e.type!=="checkbox")return!1;let n=e.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let f= ` 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(f),new NE.Notice(f,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(e),a=i.doc.lineAt(s),o=de.fromLine({line:a.text,taskLocation:Rt.fromUnknownPosition(new Et("")),fallbackDate:null});if(o===null)return!1;t.preventDefault();let u=o.toggleWithRecurrenceInUsersOrder(),l=u.map(f=>f.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});if(this.view.dispatch(c),u.length===1){let f=u[0].status.symbol!==" ";setTimeout(()=>{e.checked=f},1)}return!0}};var wd=require("obsidian"),UE=require("obsidian");function FE(r,t,e,n=void 0){let i="";t.isEmpty()||(i+= ` Only tasks containing the global filter '${t.get()}' .
` );let s=new Da(" "),a=new gn(r,n);if(!a.ignoreGlobalQuery&&e.hasInstructions()){let o=e.query(n);i+= ` Explanation of the global query :
$ { s . explainQuery ( o ) }
` }return i+= ` Explanation of this Tasks code block query :
$ { s . explainQuery ( a ) } ` ,i}function ju(r,t,e){let n=new gn(r,e);return n.ignoreGlobalQuery?n:t.query(e).append(n)}function Yu(r,t,e){t&&r.push(jL(e))}function jL(r){return ` tasks - layout - hide - $ { r } ` }var bd=class{constructor(t){t?this.queryLayoutOptions=t:this.queryLayoutOptions=new Ci}getHiddenClasses(){let t=[],e=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,i]of e)Yu(t,n,i);return this.queryLayoutOptions.shortMode&&t.push("tasks-layout-short-mode"),t}};var Td=class{constructor(t){t?this.taskLayoutOptions=t:this.taskLayoutOptions=new Mn}generateHiddenClasses(){let t=[];return this.taskLayoutOptions.toggleableComponents.forEach(e=>{Yu(t,!this.taskLayoutOptions.isShown(e),e)}),Yu(t,!this.taskLayoutOptions.areTagsShown(),"tags"),t}};var $ u=class{constructor(t){this.label=t,this.start()}start(){!this.recordTimings()||performance.mark(this.labelForStart())}finish(){!this.recordTimings()||(performance.mark(this.labelForEnd()),performance.measure(this.label,this.labelForStart(),this.labelForEnd()),this.printDuration())}printDuration(){let t=performance.getEntriesByName(this.label),e=t[t.length-1];e?console.log(this.label+":",e.duration.toFixed(2),"milliseconds"):console.log( ` Measurement for $ { this . label } not found ` )}labelForStart(){return ` $ { this . label } - start ` }labelForEnd(){return ` $ { this . label } - end ` }recordTimings(){let{debugSettings:t}=ie();return t.recordTimings}};var Bg=require("obsidian");var ji=class extends Ui{constructor(t,e,n=Wn){super(n);let i=(l,c,d,f,m,b)=>{var O;let T=!1,_= $ a(e);if(_){let{postponedDate:M}=b(e,_,d,f);(O=e[_])!=null&&O.isSame(M,"day")&&(T=!0)}let x=m(e,f,d);c.setChecked(T).setTitle(x).onClick(()=>ji.postponeOnClickCallback(l,e,f,d,b,n))},s=kE,a=yE;this.addItem(l=>i(t,l,"days",0,s,a)),this.addItem(l=>i(t,l,"day",1,s,a)),this.addSeparator();let o=Yg,u=jg;this.addItem(l=>i(t,l,"days",2,o,u)),this.addItem(l=>i(t,l,"days",3,o,u)),this.addItem(l=>i(t,l,"days",4,o,u)),this.addItem(l=>i(t,l,"days",5,o,u)),this.addItem(l=>i(t,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>i(t,l,"week",1,o,u)),this.addItem(l=>i(t,l,"weeks",2,o,u)),this.addItem(l=>i(t,l,"weeks",3,o,u)),this.addItem(l=>i(t,l,"month",1,o,u)),this.addSeparator(),this.addItem(l=>i(t,l,"days",2,EE,bE))}static postponeOnClickCallback(o,u,l,c){return F(this,arguments,function*(t,e,n,i,s=jg,a=Wn){var b;let d= $ a(e);if(d===null){let T=" \u 26A0 \u FE0F Postponement requires a date: due, scheduled or start.";return new Bg.Notice(T,1e4)}let{postponedDate:f,postponedTask:m}=s(e,d,i,n);(b=e[d])!=null&&b.isSame(f,"day")||(yield a(e,m),ji.postponeSuccessCallback(t,d,f))})}static postponeSuccessCallback(t,e,n){t.style.pointerEvents="none";let i=vE(n,e);new Bg.Notice(i,2e3)}};function LE(r){let t=r.parent;for(;t!==null&&!(t instanceof de);)t=t.parent;return t}var _d=class{constructor(t,e,n,i,s,a=fi.obsidianMarkdownRenderer){switch(this.source=e,this.tasksFile=n,this.renderMarkdown=i,this.obsidianComponent=s,this.textRenderer=a,t){case"block-language-tasks":this.query=ju(this.source,Dr.getInstance(),this.tasksFile),this.queryType="tasks";break;default:this.query=ju(this.source,Dr.getInstance(),this.tasksFile),this.queryType="tasks";break}}get filePath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}render(t,e,n,i){return F(this,null,function*(){t==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(e,t,n,i):this.query.error!==void 0?this.renderErrorMessage(n,this.query.error):this.renderLoadingMessage(n)})}renderQuerySearchResults(t,e,n,i){return F(this,null,function*(){let s=this.explainAndPerformSearch(e,t,n);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(n,s.searchErrorMessage);return}yield this.renderSearchResults(s,n,i)})}explainAndPerformSearch(t,e,n){let i=new $ u( ` Search : $ { this . query . queryId } - $ { this . filePath } ` );i.start(),this.query.debug( ` [ render ] Render called : plugin state : $ { t } ; searching $ { e . length } tasks ` ),this.qu
` ,this._markdown+= ` $ { e }
` }addRow(t){let e=this.makeRowText(t);this._markdown+= ` $ { e }
` }addRowIfNew(t){let e=this.makeRowText(t);this._markdown.includes(e)||(this._markdown+= ` $ { e }
` )}makeRowText(t){let e="|";return t.forEach(n=>{e+= ` $ { n } | ` }),e}};function WE(r,t){return r.findIndex(e=>e.symbol===t)}function pi(r){return r===""?r:" ` "+(r!==" "?r:" space ")+" ` "}function HL(r,t){let e=pe.getTypeForUnknownSymbol(r.symbol);r.type!==e&&(e==="TODO"&&r.symbol!==" "||t.push( ` For information , the conventional type for status symbol $ { pi ( r . symbol ) } is $ { pi ( e ) } : you may wish to review this type . ` ))}function BL(r,t,e){let n=WE(r,t.nextStatusSymbol);if(n===-1){e.push( ` Next symbol $ { pi ( t . nextStatusSymbol ) } is unknown : create a status with symbol $ { pi ( t . nextStatusSymbol ) } . ` );return}if(t.type!=="DONE")return;let i=r[n];if(i){if(i.type!=="TODO"&&i.type!=="IN_PROGRESS"){let s="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",a=[ ` This \ ` DONE \` status is followed by ${ pi ( i . type ) } , not \` TODO \` or \` IN_PROGRESS \` . ` , "If used to complete a recurring task, it will instead be followed by `TODO` or `IN_PROGRESS`, to ensure the next task matches the `not done` filter." , ` See [Recurring Tasks and Custom Statuses]( ${ s } ). ` ] . join ( "<br>" ) ; e . push ( a ) } } else e . push ( "Unexpected failure to find the next status." ) } function VL ( r , t , e ) { let n = [ ] ; return t . symbol === pe . EMPTY . symbol ? ( n . push ( "Empty symbol: this status will be ignored." ) , n ) : WE ( r , t . symbol ) != e ? ( n . push ( ` Duplicate symbol ' ${ pi ( t . symbol ) } ': this status will be ignored. ` ) , n ) : ( HL ( t , n ) , BL ( r , t , n ) , n ) } function qE ( r ) { let t = new kd ( [ "Status Symbol" , "Next Status Symbol" , "Status Name" , "Status Type" , "Problems (if any)" ] ) , e = Xe . allStatuses ( r ) ; return e . forEach ( ( n , i ) => { t . addRow ( [ pi ( n . symbol ) , pi ( n . nextStatusSymbol ) , n . name , pi ( n . type ) , VL ( e , n , i ) . join ( "<br>" ) ] ) } ) , t . markdown } function jE ( r , t , e , n ) { let s = qE ( r ) , a = t . mermaidDiagram ( ! 0 ) ; return ` # ${ e }
# # About this file
This file was created by the Obsidian Tasks plugin ( version $ { n } ) to help visualise the task statuses in this vault .
If you change the Tasks status settings , you can get an updated report by :
- Going to \ ` Settings \` -> \` Tasks \` .
- Clicking on \ ` Review and check your Statuses \` .
You can delete this file any time .
# # Status Settings
<!--
Switch to Live Preview or Reading Mode to see the table .
If there are any Markdown formatting characters in status names , such as '*' or '_' ,
Obsidian may only render the table correctly in Reading Mode .
-- >
These are the status values in the Core and Custom statuses sections .
$ { s }
# # Loaded Settings
<!-- Switch to Live Preview or Reading Mode to see the diagram . -- >
These are the settings actually used by Tasks .
$ { a } ` }function YE(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function $ E(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function GE(){return[[" ","To Do","x","TODO"],["/","In Progress","x","IN_PROGRESS"],["x","Done"," ","DONE"],["-","Cancelled"," ","CANCELLED"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["i","Infomation","x","TODO"],["S","Amount","x","TODO"],["*","Star","x","TODO"],["b","Bookmark","x","TODO"],[" \u 201C","Quote","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["I","Idea","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function HE(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function BE(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function VE(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function zE(){return[[" ","to-do","x","TODO
` )+ `
Fix errors before saving . ` ;new Tn.Notice(d);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(e){e.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(e){e.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(e,n){n.length===0?Sr.removeValidationError(e):Sr.setValidationError(e)}};var Jt=class extends ke.PluginSettingTab{constructor({plugin:e}){super(e.app,e);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=e}saveSettings(e){return F(this,null,function*(){yield this.plugin.saveSettings(),e&&this.display()})}display(){let{containerEl:e}=this;e.empty(),this.containerEl.addClass("tasks-settings"),e.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),new ke.Setting(e).setName("Task Format").setDesc(Jt.createFragmentWithHTML('<p>The format that Tasks uses to read and write tasks.</p><p><b>Important:</b> Tasks currently only supports one format at a time. Selecting Dataview will currently <b>stop Tasks reading its own emoji signifiers</b>.</p><p>See the <a href="https://publish.obsidian.md/tasks/Reference/Task+Formats/About+Task+Formats">documentation</a>.</p>')).addDropdown(l=>{for(let c of Object.keys(cn))l.addOption(c,cn[c].displayName);l.setValue(ie().taskFormat).onChange(c=>F(this,null,function*(){ut({taskFormat:c}),yield this.plugin.saveSettings()}))}),new ke.Setting(e).setName("Global task filter").setHeading();let n=null;new ke.Setting(e).setName("Global filter").setDesc(Jt.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://publish.obsidian.md/tasks/Getting+Started/Global+Filter">documentation</a>.</p>')).addText(l=>{l.setPlaceholder("e.g. #task or TODO").setValue(Ae.getInstance().get()).onChange(c=>F(this,null,function*(){ut({globalFilter:c}),Ae.getInstance().set(c),yield this.plugin.saveSettings(),qn(n,c.length>0)}))}),n=new ke.Setting(e).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(l=>{let c=ie();l.setValue(c.removeGlobalFilter).onChange(d=>F(this,null,function*(){ut({removeGlobalFilter:d}),Ae.getInstance().setRemoveGlobalFilter(d),yield this.plugin.saveSettings()}))}),qn(n,ie().globalFilter.length>0),new ke.Setting(e).setName("Global Query").setHeading(),XL(new ke.Setting(e).setDesc(Jt.createFragmentWithHTML('<p>A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.</p><p>See the <a href="https://publish.obsidian.md/tasks/Queries/Global+Query">documentation</a>.</p>')).addTextArea(l=>{let c=ie();l.inputEl.rows=4,l.setPlaceholder( ` # For example ...
path does not include _templates /
limit 300
show urgency ` ).setValue(c.globalQuery).onChange(d=>F(this,null,function*(){ut({globalQuery:d}),Dr.getInstance().set(d),yield this.plugin.saveSettings()}))})),new ke.Setting(e).setName("Task Statuses").setHeading();let{headingOpened:i}=ie();QE.forEach(l=>{var f;let c=(f=i[l.text])!=null?f:!0,d=this.addOneSettingsBlock(e,l,i);d.open=c}),new ke.Setting(e).setName("Dates").setHeading(),new ke.Setting(e).setName("Set created date on every added task").setDesc(Jt.createFragmentWithHTML( ` Enabling this will add a timestamp \u2795 YYYY - MM - DD before other date values , when a task is created with 'Create or edit task' , or by completing a recurring task . < /br><p>See the <a href="https:/ / publish . obsidian . md / tasks / Getting + Started / Dates # Created + date ">documentation</a>.</p>`)).addToggle(l=>{let c=ie();l.setValue(c.setCreatedDate).onChange(d=>F(this,null,function*(){ut({setCreatedDate:d}),yield this.plugin.saveSettings()}))}),new ke.Setting(e).setName(" Set done date on every completed task ").setDesc(Jt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.</br><p>See the <a href=" https : //publish.obsidian.md/tasks/Getting+Started/Dates#Done+date">documentation</a>.</p>')).addToggle(l=>{let c=ie();l.setValue(c.setDoneDate).onChange(d=>F(this,null,function*(){ut({setDoneDate:d}),yield this.plugin.saveSettings()}))}),new ke.Setting(e).setName("Set cancelled date on every cancelled task").setDesc(Jt.createFragmentWithHTML('Enabling this will add a timestamp \u274C YYYY-MM-DD at the end when a task is toggled to cancelled.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Cancelled+date">documentation</a>.</p>')).addToggle(l=>{let c=ie();l.setValue(c.setCancelledDate).onChange(d=>F(this,null,function*(){ut({setCancelledDate:d}),yield this.plugin.saveSettings()}))}),new ke.Setting(e).setName("Dates from file names").setHeading();let s=null,a=null;new ke.Setting(e).setName("Use filename as Scheduled date for undated tasks").setDesc(Jt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>By default, Tasks plugin will match both <code>YYYY-MM-DD</code> and <code>YYYYMMDD</code> date formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Use+Filename+as+Default+Date">documentation</a>.</p>')).addToggle(l=>{let c=ie();l.setValue(c.useFilenameAsScheduledDate).onChange(d=>F(this,null,function*(){ut({useFilenameAsScheduledDate:d}),qn(s,d),qn(a,d),yield this.plugin.saveSettings()}))}),s=new ke.Setting(e).setName("Additional filename date format as Scheduled date for undated tasks").setDesc(Jt.createFragmentWithHTML('An additional date format that Tasks plugin will recogize when using the file name as the Scheduled date for undated tasks.</br><p><a href="https://momentjs.com/docs/#/displaying/format/">Syntax Reference</a></p>')).addText(l=>{let c=ie();l.setPlaceholder("example: MMM DD YYYY").setValue(c.filenameAsScheduledDateFormat).onChange(d=>F(this,null,function*(){ut({filenameAsScheduledDateFormat:d}),yield this.plugin.saveSettings()}))}),a=new ke.Setting(e).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(l=>F(this,null,function*(){let c=ie();yield this.plugin.saveSettings(),l.setValue(Jt.renderFolderArray(c.filenameAsDateFolders)).onChange(d=>F(this,null,function*(){let f=Jt.parseCommaSeparatedFolders(d);ut({filenameAsDateFolders:f}),yield this.plugin.saveSettings()}))})),qn(s,ie().useFilenameAsScheduledDate),qn(a,ie().useFilenameAsScheduledDate),new ke.Setting(e).setName("Recurring tasks").setHeading(),new ke.Setting(e).setName("Next recurrence appears on the line below").setDesc(Jt.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear o
This message has been written to the console .
` ,1e4)}var Ed=class extends Yi.EditorSuggest{constructor(e,n,i){super(e);this.settings=n,this.plugin=i,e.scope.register([],"Tab",()=>{var a;let s=(a=this.context)==null?void 0:a.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(e,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(e.line);return kw(s,e,n)?{start:{line:e.line,ch:0},end:{line:e.line,ch:s.length},query:s}:null}getSuggestions(e){var c,d,f;let n=e.query,i=e.editor.getCursor(),s=this.plugin.getTasks(),a=s.find(m=>m.taskLocation.path==e.file.path&&m.taskLocation.lineNumber==i.line),o=this.getMarkdownFileInfo(e),u=this.canSaveEdits(o);return((f=(d=(c=Tu()).buildSuggestions)==null?void 0:d.call(c,n,i.ch,this.settings,s,u,a))!=null?f:[]).map(m=>Ee(ne({},m),{context:e}))}getMarkdownFileInfo(e){return e.editor.cm.state.field(Yi.editorInfoField)}canSaveEdits(e){return e instanceof Yi.MarkdownView}renderSuggestion(e,n){n.setText(e.displayText)}selectSuggestion(e,n){return F(this,null,function*(){var l,c,d;let i=e.context.editor;if(e.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(c=(l=i==null?void 0:i.cm)==null?void 0:l.contentDOM)==null||c.dispatchEvent(f);return}if(e.taskItDependsOn!=null){let f=ec(e.taskItDependsOn,this.plugin.getTasks().map(m=>m.id));if(e.appendText+= ` $ { f . id } ` ,e.taskItDependsOn!==f)if(e.context.file.path==f.path){let m=e.taskItDependsOn.originalMarkdown,b={line:e.taskItDependsOn.lineNumber,ch:0},T={line:e.taskItDependsOn.lineNumber,ch:m.length},_=e.context.editor.getRange(b,T);if(_!==m){let x= ` Error adding new ID , due to mismatched data in Tasks memory and the editor :
task line in memory : '${e.taskItDependsOn.originalMarkdown}'
task line in editor : '${_}'
file : '${f.path}'
` ;ZL(x);return}e.context.editor.replaceRange(f.toFileLineString(),b,T)}else Br({originalTask:e.taskItDependsOn,newTasks:f})}let s=e.context.editor.getCursor(),a={line:s.line,ch:(d=e.insertAt)!=null?d:s.ch},o=e.insertSkip?{line:s.line,ch:a.ch+e.insertSkip}:void 0;e.context.editor.replaceRange(e.appendText,a,o),e.context.editor.setCursor({line:s.line,ch:a.ch+e.appendText.length});let u=this.getMarkdownFileInfo(e.context);this.canSaveEdits(u)&&(yield u.save())})}};var ZE=(r,t)=>{let e,n=new Promise((a,o)=>{e=a});return t(r,a=>{let o=a.map(u=>u.toFileLineString()).join( `
` );e(o)}).open(),n};var JE=(r,t)=>{let e=wc({line:"",path:""});return new Mi({app:r,task:e,onSubmit:t,allTasks:[]})};var eD=r=>({createTaskLineModal:()=>ZE(r,JE),executeToggleTaskDoneCommand:(t,e)=>pg(t,e).text});var Dd=class extends tD.Plugin{get apiV1(){return eD(this.app)}onload(){return F(this,null,function*(){Kt.registerConsoleLogger(),Yh("info", ` loading plugin "${this.manifest.name}" v$ { this . manifest . version } ` ),yield this.loadSettings();let{loggingOptions:e}=ie();Kt.configure(e),this.addSettingTab(new Gu({plugin:this})),gk({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new sd({obsidianEvents:this.app.workspace});this.cache=new da({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace,events:n}),this.inlineRenderer=new yd({plugin:this}),this.queryRenderer=new vd({plugin:this,events:n}),this.registerEditorExtension(IE()),this.registerEditorSuggest(new Ed(this.app,ie(),this)),new kc({plugin:this})})}loadTaskStatuses(){return F(this,null,function*(){let{statusSettings:e}=ie();Xe.applyToStatusRegistry(e, $ e.getInstance())})}onunload(){var e;Yh("info", ` unloading plugin "${this.manifest.name}" v$ { this . manifest . version } ` ),(e=this.cache)==null||e.unload()}loadSettings(){return F(this,null,function*(){let e=yield this.loadData();ut(e),e=ie(),Ae.getInstance().set(e.globalFilter),Ae.getInstance().setRemoveGlobalFilter(e.removeGlobalFilter),Dr.getInstance().set(e.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return F(this,null,function*(){yield this.saveData(ie())})}getTasks(){return this.cache===void 0?[]:this.cache.getTasks()}};
/ * !
* EventEmitter2
* https : //github.com/hij1nx/EventEmitter2
*
* Copyright ( c ) 2013 hij1nx
* Licensed under the MIT license .
* /
/ * !
* mustache . js - Logic - less { { mustache } } templates with JavaScript
* http : //github.com/janl/mustache.js
* /
/* nosourcemap */