You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

348 lines
447 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository
*/
/*
License obsidian-tasks:
MIT License
Copyright (c) 2021 Martin Schenck and Clare Macrae
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
License rrule (included library):
rrule.js: Library for working with recurrence rules for calendar dates.
=======================================================================
Copyright 2010, Jakub Roztocil <jakub@roztocil.name> and Lars Schöning
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of The author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
./rrule.js and ./test/tests.js is based on python-dateutil. LICENCE:
python-dateutil - Extensions to the standard Python datetime module.
====================================================================
Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
License chrono-node (included library):
The MIT License
Copyright (c) 2014, Wanasit Tanakitrungruang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
"use strict";var Nk=Object.create;var oa=Object.defineProperty,Ik=Object.defineProperties,Fk=Object.getOwnPropertyDescriptor,Lk=Object.getOwnPropertyDescriptors,Uk=Object.getOwnPropertyNames,Jo=Object.getOwnPropertySymbols,Wk=Object.getPrototypeOf,vc=Object.prototype.hasOwnProperty,Qh=Object.prototype.propertyIsEnumerable;var Kh=(r,e,t)=>e in r?oa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,X=(r,e)=>{for(var t in e||(e={}))vc.call(e,t)&&Kh(r,t,e[t]);if(Jo)for(var t of Jo(e))Qh.call(e,t)&&Kh(r,t,e[t]);return r},be=(r,e)=>Ik(r,Lk(e));var eu=(r,e)=>{var t={};for(var n in r)vc.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Jo)for(var n of Jo(r))e.indexOf(n)<0&&Qh.call(r,n)&&(t[n]=r[n]);return t};var k=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),qk=(r,e)=>{for(var t in e)oa(r,t,{get:e[t],enumerable:!0})},Xh=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Uk(e))!vc.call(r,s)&&s!==t&&oa(r,s,{get:()=>e[s],enumerable:!(n=Fk(e,s))||n.enumerable});return r};var ua=(r,e,t)=>(t=r!=null?Nk(Wk(r)):{},Xh(e||!r||!r.__esModule?oa(t,"default",{value:r,enumerable:!0}):t,r)),jk=r=>Xh(oa({},"__esModule",{value:!0}),r);var L=(r,e,t)=>new Promise((n,s)=>{var i=u=>{try{o(t.next(u))}catch(l){s(l)}},a=u=>{try{o(t.throw(u))}catch(l){s(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,a);o((t=t.apply(r,e)).next())});var xe=k(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.matchAnyPattern=Wn.extractTerms=Wn.repeatedTimeunitPattern=void 0;function $k(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Wn.repeatedTimeunitPattern=$k;function Zh(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Wn.extractTerms=Zh;function Hk(r){return`(?:${Zh(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Wn.matchAnyPattern=Hk});var ve=k((kc,Ec)=>{(function(r,e){typeof kc=="object"&&typeof Ec!="undefined"?Ec.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(kc,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",s="second",i="minute",a="hour",o="day",u="week",l="month",c="quarter",f="year",p="date",m="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,E={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("_")},C=function(W,I,O){var $=String(W);return!$||$.length>=I?W:""+Array(I+1-$.length).join(O)+W},R={s:C,z:function(W){var I=-W.utcOffset(),O=Math.abs(I),$=Math.floor(O/60),P=O%60;return(I<=0?"+":"-")+C($,2,"0")+":"+C(P,2,"0")},m:function W(I,O){if(I.date()<O.date())return-W(O,I);var $=12*(O.year()-I.year())+(O.month()-I.month()),P=I.clone().add($,l),Q=O-P<0,d=I.clone().add($+(Q?-1:1),l);return+(-($+(O-P)/(Q?P-d:d-P))||0)},a:function(W){return W<0?Math.ceil(W)||0:Math.floor(W)},p:function(W){return{M:l,y:f,w:u,d:o,D:p,h:a,m:i,s,ms:n,Q:c}[W]||String(W||"").toLowerCase().replace(/s$/,"")},u:function(W){return W===void 0}},b="en",z={};z[b]=E;var U=function(W){return W instanceof te},ne=function(W,I,O){var $;if(!W)return b;if(typeof W=="string")z[W]&&($=W),I&&(z[W]=I,$=W);else{var P=W.name;z[P]=W,$=P}return!O&&$&&(b=$),$||!O&&b},G=function(W,I){if(U(W))return W.clone();var O=typeof I=="object"?I:{};return O.date=W,O.args=arguments,new te(O)},Y=R;Y.l=ne,Y.i=U,Y.w=function(W,I){return G(W,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var te=function(){function W(O){this.$L=ne(O.locale,null,!0),this.parse(O)}var I=W.prototype;return I.parse=function(O){this.$d=function($){var P=$.date,Q=$.utc;if(P===null)return new Date(NaN);if(Y.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var d=P.match(_);if(d){var h=d[2]-1||0,y=(d[7]||"0").substring(0,3);return Q?new Date(Date.UTC(d[1],h,d[3]||1,d[4]||0,d[5]||0,d[6]||0,y)):new Date(d[1],h,d[3]||1,d[4]||0,d[5]||0,d[6]||0,y)}}return new Date(P)}(O),this.$x=O.x||{},this.init()},I.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},I.$utils=function(){return Y},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(O,$){var P=G(O);return this.startOf($)<=P&&P<=this.endOf($)},I.isAfter=function(O,$){return G(O)<this.startOf($)},I.isBefore=function(O,$){return this.endOf($)<G(O)},I.$g=function(O,$,P){return Y.u(O)?this[$]:this.set(P,O)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(O,$){var P=this,Q=!!Y.u($)||$,d=Y.p(O),h=function(x,F){var ce=Y.w(P.$u?Date.UTC(P.$y,F,x):new Date(P.$y,F,x),P);return Q?ce:ce.endOf(o)},y=function(x,F){return Y.w(P.toDate()[x].apply(P.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(F)),P)},T=this.$W,w=this.$M,S=this.$D,M="set"+(this.$u?"UTC":"");switch(d){case f:return Q?h(1,0):h(31,11);case l:return Q?h(1,w):h(0,w+1);case u:var N=this.$locale().weekStart||0,v=(T<N?T+7:T)-N;return h(Q?S-v:S+(6-v),w);case o:case p:return y(M+"Hours",0);case a:return y(M+"Minutes",1);case i:return y(M+"Seconds",2);case s:return y(M+"Milliseconds",3);default:return this.clone()}},I.endOf=function(O){return this.startOf(O,!1)},I.$set=function(O,$){var P,Q=Y.p(O),d="set"+(this.$u?"UTC":""),h=(P={},P[o]=d+"Date",P[p]=d+"Date",P[l]=d+"Month",P[f]=d+"FullYear",P[a]=d+"Hours",P[i]=d+"Minutes",P[s]=d+"Seconds",P[n]=d+"Milliseconds",P)[Q],y=Q===o?this.$D+($-this.$W):$;if(Q===l||Q===f){var T=this.clone().set(p,1);T.$d[h](y),T.init(),this.$d=T.set(p,Math.min(this.$D,T.daysInMonth())).$d}else h&&this.$d[h](y);return this.init(),this},I.set=function(O,$){return this.clone().$set(O,$)},I.get=function(O){return this[Y.p(O)]()},I.add=function(O,$){var P,Q=this;O=Number(O);var d=Y.p($),h=function(w){var S=G(Q);return Y.w(S.date(S.date()+Math.round(w*O)),Q)};if(d===l)return this.set(l,this.$M+O);if(d===f)return this.set(f,this.$y+O);if(d===o)return h(1);if(d===u)return h(7);var y=(P={},P[i]=e,P[a]=t,P[s]=r,P)[d]||1,T=this.$d.getTime()+O*y;return Y.w(T,this)},I.subtract=function(O,$){return this.add(-1*O,$)},I.format=function(O){var $=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var Q=O||"YYYY-MM-DDTHH:mm:ssZ",d=Y.z(this),h=this.$H,y=this.$m,T=this.$M,w=P.weekdays,S=P.months,M=function(F,ce,ue,de){return F&&(F[ce]||F($,Q))||ue[ce].substr(0,de)},N=function(F){return Y.s(h%12||12,F,"0")},v=P.meridiem||function(F,ce,ue){var de=F<12?"AM":"PM";return ue?de.toLowerCase():de},x={YY:String(this.$y).slice(-2),YYYY:this.$y,M:T+1,MM:Y.s(T+1,2,"0"),MMM:M(P.monthsShort,T,S,3),MMMM:M(S,T),D:this.$D,DD:Y.s(this.$D,2,"0"),d:String(this.$W),dd:M(P.weekdaysMin,this.$W,w,2),ddd:M(P.weekdaysShort,this.$W,w,3),dddd:w[this.$W],H:String(h),HH:Y.s(h,2,"0"),h:N(1),hh:N(2),a:v(h,y,!0),A:v(h,y,!1),m:String(y),mm:Y.s(y,2,"0"),s:String(this.$s),ss:Y.s(this.$s,2,"0"),SSS:Y.s(this.$ms,3,"0"),Z:d};return Q.replace(g,function(F,ce){return ce||x[F]||d.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(O,$,P){var Q,d=Y.p($),h=G(O),y=(h.utcOffset()-this.utcOffset())*e,T=this-h,w=Y.m(this,h);return w=(Q={},Q[f]=w/12,Q[l]=w,Q[c]=w/3,Q[u]=(T-y)/6048e5,Q[o]=(T-y)/864e5,Q[a]=T/t,Q[i]=T/e,Q[s]=T/r,Q)[d]||T,P?w:Y.a(w)},I.daysInMonth=function(){return this.endOf(l).$D},I.$locale=function(){return z[this.$L]},I.locale=function(O,$){if(!O)return this.$L;var P=this.clone(),Q=ne(O,$,!0);return Q&&(P.$L=Q),P},I.clone=function(){return Y.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},W}(),_e=te.prototype;return G.prototype=_e,[["$ms",n],["$s",s],["$m",i],["$H",a],["$W",o],["$M",l],["$y",f],["$D",p]].forEach(function(W){_e[W[1]]=function(I){return this.$g(I,W[0],W[1])}}),G.extend=function(W,I){return W.$i||(W(I,te,G),W.$i=!0),G},G.locale=ne,G.isDayjs=U,G.unix=function(W){return G(1e3*W)},G.en=z[b],G.Ls=z,G.p={},G})});var gt=k(qn=>{"use strict";var zk=qn&&qn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qn,"__esModule",{value:!0});qn.findYearClosestToRef=qn.findMostLikelyADYear=void 0;var Vk=zk(ve());function Kk(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}qn.findMostLikelyADYear=Kk;function Qk(r,e,t){let n=Vk.default(r),s=n;s=s.month(t-1),s=s.date(e),s=s.year(n.year());let i=s.add(1,"y"),a=s.add(-1,"y");return Math.abs(i.diff(n))<Math.abs(s.diff(n))?s=i:Math.abs(a.diff(n))<Math.abs(s.diff(n))&&(s=a),s.year()}qn.findYearClosestToRef=Qk});var yt=k(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.parseTimeUnits=le.TIME_UNITS_PATTERN=le.parseYear=le.YEAR_PATTERN=le.parseOrdinalNumberPattern=le.ORDINAL_NUMBER_PATTERN=le.parseNumberPattern=le.NUMBER_PATTERN=le.TIME_UNIT_DICTIONARY=le.ORDINAL_WORD_DICTIONARY=le.INTEGER_WORD_DICTIONARY=le.MONTH_DICTIONARY=le.FULL_MONTH_NAME_DICTIONARY=le.WEEKDAY_DICTIONARY=void 0;var ru=xe(),Xk=gt();le.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};le.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};le.MONTH_DICTIONARY=Object.assign(Object.assign({},le.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});le.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};le.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};le.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};le.NUMBER_PATTERN=`(?:${ru.matchAnyPattern(le.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function eg(r){let e=r.toLowerCase();return le.INTEGER_WORD_DICTIONARY[e]!==void 0?le.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}le.parseNumberPattern=eg;le.ORDINAL_NUMBER_PATTERN=`(?:${ru.matchAnyPattern(le.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Zk(r){let e=r.toLowerCase();return le.ORDINAL_WORD_DICTIONARY[e]!==void 0?le.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}le.parseOrdinalNumberPattern=Zk;le.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function Jk(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return Xk.findMostLikelyADYear(e)}le.parseYear=Jk;var tg=`(${le.NUMBER_PATTERN})\\s{0,3}(${ru.matchAnyPattern(le.TIME_UNIT_DICTIONARY)})`,Jh=new RegExp(tg,"i");le.TIME_UNITS_PATTERN=ru.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",tg);function eE(r){let e={},t=r,n=Jh.exec(t);for(;n;)tE(e,n),t=t.substring(n[0].length).trim(),n=Jh.exec(t);return e}le.parseTimeUnits=eE;function tE(r,e){let t=eg(e[1]),n=le.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var rg=k((Sc,Oc)=>{(function(r,e){typeof Sc=="object"&&typeof Oc!="undefined"?Oc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Sc,function(){"use strict";var r="month",e="quarter";return function(t,n){var s=n.prototype;s.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var i=s.add;s.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):i.bind(this)(o,u)};var a=s.startOf;s.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var f=this.quarter()-1;return c?this.month(3*f).startOf(r).startOf("day"):this.month(3*f+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var dr=k(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.implySimilarTime=jr.assignSimilarTime=jr.assignSimilarDate=jr.assignTheNextDay=void 0;var ng=rt();function rE(r,e){e=e.add(1,"day"),sg(r,e),ig(r,e)}jr.assignTheNextDay=rE;function sg(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}jr.assignSimilarDate=sg;function nE(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",ng.Meridiem.AM):r.assign("meridiem",ng.Meridiem.PM)}jr.assignSimilarTime=nE;function ig(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}jr.implySimilarTime=ig});var ag=k(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.toTimezoneOffset=ls.TIMEZONE_ABBR_MAP=void 0;ls.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function sE(r){var e;return r==null?null:typeof r=="number"?r:(e=ls.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}ls.toTimezoneOffset=sE});var Be=k(Gr=>{"use strict";var og=Gr&&Gr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.ParsingResult=Gr.ParsingComponents=Gr.ReferenceWithTimezone=void 0;var iE=og(rg()),nu=og(ve()),Dc=dr(),aE=ag();nu.default.extend(iE.default);var xc=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=aE.toTimezoneOffset(e.timezone))}};Gr.ReferenceWithTimezone=xc;var cs=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let s in t)this.knownValues[s]=t[s];let n=nu.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new cs(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return nu.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let s=-e.getTimezoneOffset(),i=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:s;return s-i}static createRelativeFromReference(e,t){let n=nu.default(e.instant);for(let i in t)n=n.add(t[i],i);let s=new cs(e);return t.hour||t.minute||t.second?(Dc.assignSimilarTime(s,n),Dc.assignSimilarDate(s,n),e.timezoneOffset!==null&&s.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Dc.implySimilarTime(s,n),e.timezoneOffset!==null&&s.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(s.assign("day",n.date()),s.assign("month",n.month()+1),s.assign("year",n.year())):(t.week&&s.imply("weekday",n.day()),s.imply("day",n.date()),t.month?(s.assign("month",n.month()+1),s.assign("year",n.year())):(s.imply("month",n.month()+1),t.year?s.assign("year",n.year()):s.imply("year",n.year())))),s}};Gr.ParsingComponents=cs;var la=class{constructor(e,t,n,s,i){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=s||new cs(e),this.end=i}clone(){let e=new la(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};Gr.ParsingResult=la});var H=k(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.AbstractParserWithWordBoundaryChecking=void 0;var Rc=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let s=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+s.length,t[0]=t[0].substring(s.length);for(let i=2;i<t.length;i++)t[i-1]=t[i];return this.innerExtract(e,t)}};su.AbstractParserWithWordBoundaryChecking=Rc});var ug=k(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});var Cc=yt(),oE=Be(),uE=H(),lE=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Cc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),cE=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Cc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Mc=class extends uE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?cE:lE}innerExtract(e,t){let n=Cc.parseTimeUnits(t[1]);return oE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ac.default=Mc});var mg=k(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var dE=gt(),fg=yt(),pg=yt(),iu=yt(),fE=xe(),pE=H(),mE=new RegExp(`(?:on\\s{0,3})?(${iu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${iu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${fE.matchAnyPattern(fg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${pg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),lg=1,cg=2,hE=3,dg=4,Pc=class extends pE.AbstractParserWithWordBoundaryChecking{innerPattern(){return mE}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=fg.MONTH_DICTIONARY[t[hE].toLowerCase()],i=iu.parseOrdinalNumberPattern(t[lg]);if(i>31)return t.index=t.index+t[lg].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[dg]){let a=pg.parseYear(t[dg]);n.start.assign("year",a)}else{let a=dE.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[cg]){let a=iu.parseOrdinalNumberPattern(t[cg]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Nc.default=Pc});var Tg=k(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var gE=gt(),yg=yt(),au=yt(),bg=yt(),yE=xe(),bE=H(),TE=new RegExp(`(${yE.matchAnyPattern(yg.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${au.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${au.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${bg.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),_E=1,vE=2,hg=3,gg=4,Ic=class extends bE.AbstractParserWithWordBoundaryChecking{innerPattern(){return TE}innerExtract(e,t){let n=yg.MONTH_DICTIONARY[t[_E].toLowerCase()],s=au.parseOrdinalNumberPattern(t[vE]);if(s>31)return null;let i=e.createParsingComponents({day:s,month:n});if(t[gg]){let u=bg.parseYear(t[gg]);i.assign("year",u)}else{let u=gE.findYearClosestToRef(e.refDate,s,n);i.imply("year",u)}if(!t[hg])return i;let a=au.parseOrdinalNumberPattern(t[hg]),o=e.createParsingResult(t.index,t[0]);return o.start=i,o.end=i.clone(),o.end.assign("day",a),o}};Fc.default=Ic});var wg=k(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var Lc=yt(),wE=gt(),kE=xe(),vg=yt(),EE=H(),SE=new RegExp(`((?:in)\\s*)?(${kE.matchAnyPattern(Lc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${vg.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),OE=1,DE=2,_g=3,Uc=class extends EE.AbstractParserWithWordBoundaryChecking{innerPattern(){return SE}innerExtract(e,t){let n=t[DE].toLowerCase();if(t[0].length<=3&&!Lc.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index+(t[OE]||"").length,t.index+t[0].length);s.start.imply("day",1);let i=Lc.MONTH_DICTIONARY[n];if(s.start.assign("month",i),t[_g]){let a=vg.parseYear(t[_g]);s.start.assign("year",a)}else{let a=wE.findYearClosestToRef(e.refDate,1,i);s.start.imply("year",a)}return s}};Wc.default=Uc});var Sg=k(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});var Eg=yt(),xE=xe(),RE=H(),ME=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${xE.matchAnyPattern(Eg.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),CE=1,AE=2,kg=3,PE=4,qc=class extends RE.AbstractParserWithWordBoundaryChecking{innerPattern(){return ME}innerExtract(e,t){let n=t[kg]?parseInt(t[kg]):Eg.MONTH_DICTIONARY[t[AE].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[CE]);return{day:parseInt(t[PE]),month:n,year:s}}};jc.default=qc});var Og=k(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var NE=H(),IE=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),FE=1,LE=2,Gc=class extends NE.AbstractParserWithWordBoundaryChecking{innerPattern(){return IE}innerExtract(e,t){let n=parseInt(t[LE]),s=parseInt(t[FE]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};Yc.default=Gc});var ds=k(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.AbstractTimeExpressionParser=void 0;var Pt=rt();function UE(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function WE(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Dg=2,Js=3,ou=4,uu=5,ca=6,Bc=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let s=t.index+t[1].length,i=t[0].substring(t[1].length),a=e.createParsingResult(s,i,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return i.match(/^\d{3,4}/)&&l&&l[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,l,a),a.end&&(a.text+=l[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let s=e.createParsingComponents(),i=0,a=null,o=parseInt(t[Dg]);if(o>100){if(this.strictMode||t[Js]!=null)return null;i=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[Js]!=null){if(t[Js].length==1&&!t[ca])return null;i=parseInt(t[Js])}if(i>=60)return null;if(o>12&&(a=Pt.Meridiem.PM),t[ca]!=null){if(o>12)return null;let u=t[ca][0].toLowerCase();u=="a"&&(a=Pt.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=Pt.Meridiem.PM,o!=12&&(o+=12))}if(s.assign("hour",o),s.assign("minute",i),a!==null?s.assign("meridiem",a):o<12?s.imply("meridiem",Pt.Meridiem.AM):s.imply("meridiem",Pt.Meridiem.PM),t[uu]!=null){let u=parseInt(t[uu].substring(0,3));if(u>=1e3)return null;s.assign("millisecond",u)}if(t[ou]!=null){let u=parseInt(t[ou]);if(u>=60)return null;s.assign("second",u)}return s}extractFollowingTimeComponents(e,t,n){let s=e.createParsingComponents();if(t[uu]!=null){let u=parseInt(t[uu].substring(0,3));if(u>=1e3)return null;s.assign("millisecond",u)}if(t[ou]!=null){let u=parseInt(t[ou]);if(u>=60)return null;s.assign("second",u)}let i=parseInt(t[Dg]),a=0,o=-1;if(t[Js]!=null?a=parseInt(t[Js]):i>100&&(a=i%100,i=Math.floor(i/100)),a>=60||i>24)return null;if(i>=12&&(o=Pt.Meridiem.PM),t[ca]!=null){if(i>12)return null;let u=t[ca][0].toLowerCase();u=="a"&&(o=Pt.Meridiem.AM,i==12&&(i=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),u=="p"&&(o=Pt.Meridiem.PM,i!=12&&(i+=12)),n.start.isCertain("meridiem")||(o==Pt.Meridiem.AM?(n.start.imply("meridiem",Pt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Pt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return s.assign("hour",i),s.assign("minute",a),o>=0?s.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>i?s.imply("meridiem",Pt.Meridiem.AM):i<=12&&(s.assign("hour",i+12),s.assign("meridiem",Pt.Meridiem.PM)):i>12?s.imply("meridiem",Pt.Meridiem.PM):i<=12&&s.imply("meridiem",Pt.Meridiem.AM),s.date().getTime()<n.start.date().getTime()&&s.imply("day",s.get("day")+1),s}checkAndReturnWithoutFollowingPattern(e){if(e.text.match(/^\d$/)||e.text.match(/^\d\d\d+$/)||e.text.match(/\d[apAP]$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)$/);if(t){let n=t[1];if(this.strictMode||n.includes(".")&&!n.match(/\d(\.\d{2})+$/)||parseInt(n)>24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;let i=parseInt(s),a=parseInt(n);if(i>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=UE(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=WE(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};lu.AbstractTimeExpressionParser=Bc});var xg=k(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var cu=rt(),qE=ds(),$c=class extends qE.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",cu.Meridiem.PM)):s<6&&n.assign("meridiem",cu.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",cu.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",cu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Hc.default=$c});var fr=k(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.addImpliedTimeUnits=ei.reverseTimeUnits=void 0;function jE(r){let e={};for(let t in r)e[t]=-r[t];return e}ei.reverseTimeUnits=jE;function GE(r,e){let t=r.clone(),n=r.dayjs();for(let s in e)n=n.add(e[s],s);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}ei.addImpliedTimeUnits=GE});var Rg=k(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});var Vc=yt(),YE=Be(),BE=H(),$E=fr(),HE=new RegExp(`(${Vc.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),zE=new RegExp(`(${Vc.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),zc=class extends BE.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?zE:HE}innerExtract(e,t){let n=Vc.parseTimeUnits(t[1]),s=$E.reverseTimeUnits(n);return YE.ParsingComponents.createRelativeFromReference(e.reference,s)}};Kc.default=zc});var Mg=k(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});var Xc=yt(),VE=Be(),KE=H(),QE=new RegExp(`(${Xc.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),XE=new RegExp("("+Xc.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),ZE=1,Qc=class extends KE.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?XE:QE}innerExtract(e,t){let n=Xc.parseTimeUnits(t[ZE]);return VE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Zc.default=Qc});var ri=k(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.MergingRefiner=ti.Filter=void 0;var Jc=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};ti.Filter=Jc;var ed=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0],i=null;for(let a=1;a<t.length;a++){i=t[a];let o=e.text.substring(s.index+s.text.length,i.index);if(!this.shouldMergeResults(o,s,i,e))n.push(s),s=i;else{let u=s,l=i,c=this.mergeResults(o,u,l,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),s=c}}return s!=null&&n.push(s),n}};ti.MergingRefiner=ed});var Yr=k(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});var JE=ri(),td=class extends JE.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(i=>{t.start.isCertain(i)||t.start.assign(i,n.start.get(i))}),t.start.getCertainComponents().forEach(i=>{n.start.isCertain(i)||n.start.assign(i,t.start.get(i))})),t.start.date().getTime()>n.start.date().getTime()){let i=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&i.add(-7,"days").isBefore(a)?(i=i.add(-7,"days"),t.start.imply("day",i.date()),t.start.imply("month",i.month()+1),t.start.imply("year",i.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(i)?(a=a.add(7,"days"),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())):[n,t]=[t,n]}let s=t.clone();return s.start=t.start,s.end=n.start,s.index=Math.min(t.index,n.index),t.index<n.index?s.text=t.text+e+n.text:s.text=n.text+e+t.text,s}};rd.default=td});var Cg=k(da=>{"use strict";var eS=da&&da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(da,"__esModule",{value:!0});var tS=eS(Yr()),nd=class extends tS.default{patternBetween(){return/^\s*(to|-)\s*$/i}};da.default=nd});var Ag=k(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.mergeDateTimeComponent=ni.mergeDateTimeResult=void 0;var rS=rt();function nS(r,e){let t=r.clone(),n=r.start,s=e.start;if(t.start=sd(n,s),r.end!=null||e.end!=null){let i=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=sd(i,a);r.end==null&&o.date().getTime()<t.start.date().getTime()&&(o.isCertain("day")?o.assign("day",o.get("day")+1):o.imply("day",o.get("day")+1)),t.end=o}return t}ni.mergeDateTimeResult=nS;function sd(r,e){let t=r.clone();return e.isCertain("hour")?(t.assign("hour",e.get("hour")),t.assign("minute",e.get("minute")),e.isCertain("second")?(t.assign("second",e.get("second")),e.isCertain("millisecond")?t.assign("millisecond",e.get("millisecond")):t.imply("millisecond",e.get("millisecond"))):(t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond")))):(t.imply("hour",e.get("hour")),t.imply("minute",e.get("minute")),t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond"))),e.isCertain("timezoneOffset")&&t.assign("timezoneOffset",e.get("timezoneOffset")),e.isCertain("meridiem")?t.assign("meridiem",e.get("meridiem")):e.get("meridiem")!=null&&t.get("meridiem")==null&&t.imply("meridiem",e.get("meridiem")),t.get("meridiem")==rS.Meridiem.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t}ni.mergeDateTimeComponent=sd});var ln=k(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var sS=ri(),Pg=Ag(),id=class extends sS.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let s=t.start.isOnlyDate()?Pg.mergeDateTimeResult(t,n):Pg.mergeDateTimeResult(n,t);return s.index=t.index,s.text=t.text+e+n.text,s}};ad.default=id});var Ng=k(fa=>{"use strict";var iS=fa&&fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fa,"__esModule",{value:!0});var aS=iS(ln()),od=class extends aS.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};fa.default=od});var Ig=k(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var oS=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),uS={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},ud=class{constructor(e){this.timezone=Object.assign(Object.assign({},uS),e)}refine(e,t){var n;let s=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(i=>{var a,o;let u=e.text.substring(i.index+i.text.length),l=oS.exec(u);if(!l)return;let c=l[1].toUpperCase(),f=(o=(a=s[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(f===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${f} for: ${i.start}`)});let p=i.start.get("timezoneOffset");p!==null&&f!=p&&(i.start.isCertain("timezoneOffset")||c!=l[1])||i.start.isOnlyDate()&&c!=l[1]||(i.text+=l[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",f),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",f))}),t}};ld.default=ud});var du=k(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var lS=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),cS=1,dS=2,fS=3,cd=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let s=e.text.substring(n.index+n.text.length),i=lS.exec(s);if(!i)return;e.debug(()=>{console.log(`Extracting timezone: '${i[0]}' into : ${n}`)});let a=parseInt(i[dS]),o=parseInt(i[fS]||"0"),u=a*60+o;u>14*60||(i[cS]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=i[0])}),t}};dd.default=cd});var Fg=k(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var fd=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0];for(let i=1;i<t.length;i++){let a=t[i];a.index<s.index+s.text.length?a.text.length>s.text.length&&(s=a):(n.push(s),s=a)}return s!=null&&n.push(s),n}};pd.default=fd});var Lg=k(pa=>{"use strict";var pS=pa&&pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pa,"__esModule",{value:!0});var mS=pS(ve()),md=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let s=mS.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&s.isAfter(n.start.dayjs()))for(let i=0;i<3&&s.isAfter(n.start.dayjs());i++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&s.isAfter(n.start.dayjs())&&(s.day()>=n.start.get("weekday")?s=s.day(n.start.get("weekday")+7):s=s.day(n.start.get("weekday")),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(s.day()>n.end.get("weekday")?s=s.day(n.end.get("weekday")+7):s=s.day(n.end.get("weekday")),n.end.imply("day",s.date()),n.end.imply("month",s.month()+1),n.end.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};pa.default=md});var Ug=k(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var hS=ri(),hd=class extends hS.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};gd.default=hd});var Td=k(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var gS=H(),yS=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),bS=1,TS=2,_S=3,Wg=4,vS=5,qg=6,jg=7,Gg=8,Yg=9,yd=class extends gS.AbstractParserWithWordBoundaryChecking{innerPattern(){return yS}innerExtract(e,t){let n={};if(n.year=parseInt(t[bS]),n.month=parseInt(t[TS]),n.day=parseInt(t[_S]),t[Wg]!=null)if(n.hour=parseInt(t[Wg]),n.minute=parseInt(t[vS]),t[qg]!=null&&(n.second=parseInt(t[qg])),t[jg]!=null&&(n.millisecond=parseInt(t[jg])),t[Gg]==null)n.timezoneOffset=0;else{let s=parseInt(t[Gg]),i=0;t[Yg]!=null&&(i=parseInt(t[Yg]));let a=s*60;a<0?a-=i:a+=i,n.timezoneOffset=a}return n}};bd.default=yd});var Bg=k(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var wS=ri(),_d=class extends wS.MergingRefiner{mergeResults(e,t,n){let s=n.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};vd.default=_d});var cn=k(si=>{"use strict";var fs=si&&si.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(si,"__esModule",{value:!0});si.includeCommonConfiguration=void 0;var kS=fs(Ig()),ES=fs(du()),$g=fs(Fg()),SS=fs(Lg()),OS=fs(Ug()),DS=fs(Td()),xS=fs(Bg());function RS(r,e=!1){return r.parsers.unshift(new DS.default),r.refiners.unshift(new xS.default),r.refiners.unshift(new kS.default),r.refiners.unshift(new ES.default),r.refiners.unshift(new $g.default),r.refiners.push(new $g.default),r.refiners.push(new SS.default),r.refiners.push(new OS.default(e)),r}si.includeCommonConfiguration=RS});var fn=k(Se=>{"use strict";var MS=Se&&Se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Se,"__esModule",{value:!0});Se.noon=Se.morning=Se.midnight=Se.yesterdayEvening=Se.evening=Se.lastNight=Se.tonight=Se.theDayAfter=Se.tomorrow=Se.theDayBefore=Se.yesterday=Se.today=Se.now=void 0;var Br=Be(),ii=MS(ve()),dn=dr(),ma=rt();function CS(r){let e=ii.default(r.instant),t=new Br.ParsingComponents(r,{});return dn.assignSimilarDate(t,e),dn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Se.now=CS;function AS(r){let e=ii.default(r.instant),t=new Br.ParsingComponents(r,{});return dn.assignSimilarDate(t,e),dn.implySimilarTime(t,e),t}Se.today=AS;function PS(r){return Hg(r,1)}Se.yesterday=PS;function Hg(r,e){return wd(r,-e)}Se.theDayBefore=Hg;function NS(r){return wd(r,1)}Se.tomorrow=NS;function wd(r,e){let t=ii.default(r.instant),n=new Br.ParsingComponents(r,{});return t=t.add(e,"day"),dn.assignSimilarDate(n,t),dn.implySimilarTime(n,t),n}Se.theDayAfter=wd;function IS(r,e=22){let t=ii.default(r.instant),n=new Br.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",ma.Meridiem.PM),dn.assignSimilarDate(n,t),n}Se.tonight=IS;function FS(r,e=0){let t=ii.default(r.instant),n=new Br.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),dn.assignSimilarDate(n,t),n.imply("hour",e),n}Se.lastNight=FS;function LS(r,e=20){let t=new Br.ParsingComponents(r,{});return t.imply("meridiem",ma.Meridiem.PM),t.imply("hour",e),t}Se.evening=LS;function US(r,e=20){let t=ii.default(r.instant),n=new Br.ParsingComponents(r,{});return t=t.add(-1,"day"),dn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",ma.Meridiem.PM),n}Se.yesterdayEvening=US;function WS(r){let e=new Br.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Se.midnight=WS;function qS(r,e=6){let t=new Br.ParsingComponents(r,{});return t.imply("meridiem",ma.Meridiem.AM),t.imply("hour",e),t}Se.morning=qS;function jS(r){let e=new Br.ParsingComponents(r,{});return e.imply("meridiem",ma.Meridiem.AM),e.imply("hour",12),e}Se.noon=jS});var zg=k(Sr=>{"use strict";var GS=Sr&&Sr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),YS=Sr&&Sr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),BS=Sr&&Sr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&GS(e,r,t);return YS(e,r),e},$S=Sr&&Sr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sr,"__esModule",{value:!0});var HS=$S(ve()),zS=H(),VS=dr(),ha=BS(fn()),KS=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,kd=class extends zS.AbstractParserWithWordBoundaryChecking{innerPattern(e){return KS}innerExtract(e,t){let n=HS.default(e.refDate),s=t[0].toLowerCase(),i=e.createParsingComponents();switch(s){case"now":return ha.now(e.reference);case"today":return ha.today(e.reference);case"yesterday":return ha.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return ha.tomorrow(e.reference);case"tonight":return ha.tonight(e.reference);default:s.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),VS.assignSimilarDate(i,n),i.imply("hour",0));break}return i}};Sr.default=kd});var Vg=k(ga=>{"use strict";var QS=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var fu=rt(),XS=H(),ZS=QS(ve()),JS=dr(),e1=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Ed=class extends XS.AbstractParserWithWordBoundaryChecking{innerPattern(){return e1}innerExtract(e,t){let n=ZS.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":s.imply("meridiem",fu.Meridiem.PM),s.imply("hour",15);break;case"evening":case"night":s.imply("meridiem",fu.Meridiem.PM),s.imply("hour",20);break;case"midnight":JS.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"morning":s.imply("meridiem",fu.Meridiem.AM),s.imply("hour",6);break;case"noon":s.imply("meridiem",fu.Meridiem.AM),s.imply("hour",12);break}return s}};ga.default=Ed});var ps=k(jn=>{"use strict";var t1=jn&&jn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jn,"__esModule",{value:!0});jn.toDayJSClosestWeekday=jn.toDayJSWeekday=void 0;var Kg=t1(ve());function r1(r,e,t){if(!t)return Qg(r,e);let n=Kg.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}jn.toDayJSWeekday=r1;function Qg(r,e){let t=Kg.default(r),n=t.day();return Math.abs(e-7-n)<Math.abs(e-n)?t=t.day(e-7):Math.abs(e+7-n)<Math.abs(e-n)?t=t.day(e+7):t=t.day(e),t}jn.toDayJSClosestWeekday=Qg});var Zg=k(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var Xg=yt(),n1=xe(),s1=H(),i1=ps(),a1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${n1.matchAnyPattern(Xg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),o1=1,u1=2,l1=3,Sd=class extends s1.AbstractParserWithWordBoundaryChecking{innerPattern(){return a1}innerExtract(e,t){let n=t[u1].toLowerCase(),s=Xg.WEEKDAY_DICTIONARY[n],i=t[o1],a=t[l1],o=i||a;o=o||"",o=o.toLowerCase();let u=null;o=="last"||o=="past"?u="last":o=="next"?u="next":o=="this"&&(u="this");let l=i1.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Od.default=Sd});var ty=k(ya=>{"use strict";var c1=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var ey=yt(),Jg=Be(),d1=c1(ve()),f1=H(),p1=xe(),m1=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${p1.matchAnyPattern(ey.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),h1=1,g1=2,Dd=class extends f1.AbstractParserWithWordBoundaryChecking{innerPattern(){return m1}innerExtract(e,t){let n=t[h1].toLowerCase(),s=t[g1].toLowerCase(),i=ey.TIME_UNIT_DICTIONARY[s];if(n=="next"||n.startsWith("after")){let u={};return u[i]=1,Jg.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[i]=-1,Jg.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=d1.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};ya.default=Dd});var Or=k(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.ParsingContext=ui.Chrono=void 0;var ai=Be(),y1=xd(),oi=class{constructor(e){e=e||y1.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new oi({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let s=this.parse(e,t,n);return s.length>0?s[0].start.date():null}parse(e,t,n){let s=new pu(e,t,n),i=[];return this.parsers.forEach(a=>{let o=oi.executeParser(s,a);i=i.concat(o)}),i.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){i=a.refine(s,i)}),i}static executeParser(e,t){let n=[],s=t.pattern(e),i=e.text,a=e.text,o=s.exec(a);for(;o;){let u=o.index+i.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=i.substring(o.index+1),o=s.exec(a);continue}let c=null;l instanceof ai.ParsingResult?c=l:l instanceof ai.ParsingComponents?(c=e.createParsingResult(o.index,o[0]),c.start=l):c=e.createParsingResult(o.index,o[0],l),e.debug(()=>console.log(`${t.constructor.name} extracted result ${c}`)),n.push(c),a=i.substring(u+c.text.length),o=s.exec(a)}return n}};ui.Chrono=oi;var pu=class{constructor(e,t,n){this.text=e,this.reference=new ai.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof ai.ParsingComponents?e:new ai.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,s){let i=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=s?this.createParsingComponents(s):null;return new ai.ParsingResult(this.reference,e,i,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};ui.ParsingContext=pu});var ms=k(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var ry=gt(),b1=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),mu=1,ny=5,sy=2,iy=3,Rd=4,Md=class{constructor(e){this.groupNumberMonth=e?iy:sy,this.groupNumberDay=e?sy:iy}pattern(){return b1}extract(e,t){if(t[mu]=="/"||t[ny]=="/"){t.index+=t[0].length;return}let n=t.index+t[mu].length,s=t[0].substr(t[mu].length,t[0].length-t[mu].length-t[ny].length);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Rd]&&t[0].indexOf("/")<0)return;let i=e.createParsingResult(n,s),a=parseInt(t[this.groupNumberMonth]),o=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(o>=1&&o<=12&&a<=31)[o,a]=[a,o];else return null;if(o<1||o>31)return null;if(i.start.assign("day",o),i.start.assign("month",a),t[Rd]){let u=parseInt(t[Rd]),l=ry.findMostLikelyADYear(u);i.start.assign("year",l)}else{let u=ry.findYearClosestToRef(e.refDate,o,a);i.start.imply("year",u)}return i}};Cd.default=Md});var oy=k(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var ay=yt(),T1=Be(),_1=H(),v1=fr(),w1=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${ay.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Ad=class extends _1.AbstractParserWithWordBoundaryChecking{innerPattern(){return w1}innerExtract(e,t){let n=t[1].toLowerCase(),s=ay.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":s=v1.reverseTimeUnits(s);break}return T1.ParsingComponents.createRelativeFromReference(e.reference,s)}};Pd.default=Ad});var ly=k(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var k1=ri(),Nd=Be(),E1=yt(),S1=fr();function uy(r){return r.text.match(/\s+(before|from)$/i)!=null}function O1(r){return r.text.match(/\s+(after|since)$/i)!=null}var Id=class extends k1.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!uy(t)&&!O1(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let s=E1.parseTimeUnits(t.text);uy(t)&&(s=S1.reverseTimeUnits(s));let i=Nd.ParsingComponents.createRelativeFromReference(new Nd.ReferenceWithTimezone(n.start.date()),s);return new Nd.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,i)}};Fd.default=Id});var xd=k(Qe=>{"use strict";var ot=Qe&&Qe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.createConfiguration=Qe.createCasualConfiguration=Qe.parseDate=Qe.parse=Qe.GB=Qe.strict=Qe.casual=void 0;var D1=ot(ug()),x1=ot(mg()),R1=ot(Tg()),M1=ot(wg()),C1=ot(Sg()),A1=ot(Og()),P1=ot(xg()),N1=ot(Rg()),I1=ot(Mg()),F1=ot(Cg()),L1=ot(Ng()),U1=cn(),W1=ot(zg()),q1=ot(Vg()),j1=ot(Zg()),G1=ot(ty()),Ld=Or(),Y1=ot(ms()),B1=ot(oy()),$1=ot(ly());Qe.casual=new Ld.Chrono(cy(!1));Qe.strict=new Ld.Chrono(hu(!0,!1));Qe.GB=new Ld.Chrono(hu(!1,!0));function H1(r,e,t){return Qe.casual.parse(r,e,t)}Qe.parse=H1;function z1(r,e,t){return Qe.casual.parseDate(r,e,t)}Qe.parseDate=z1;function cy(r=!1){let e=hu(!1,r);return e.parsers.unshift(new W1.default),e.parsers.unshift(new q1.default),e.parsers.unshift(new M1.default),e.parsers.unshift(new G1.default),e.parsers.unshift(new B1.default),e}Qe.createCasualConfiguration=cy;function hu(r=!0,e=!1){return U1.includeCommonConfiguration({parsers:[new Y1.default(e),new D1.default,new x1.default,new R1.default,new j1.default,new C1.default,new A1.default,new P1.default(r),new N1.default(r),new I1.default(r)],refiners:[new $1.default,new L1.default,new F1.default]},r)}Qe.createConfiguration=hu});var dy=k(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var V1=ds(),Ud=class extends V1.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Wd.default=Ud});var ba=k(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.parseTimeUnits=Ae.TIME_UNITS_PATTERN=Ae.parseYear=Ae.YEAR_PATTERN=Ae.parseNumberPattern=Ae.NUMBER_PATTERN=Ae.TIME_UNIT_DICTIONARY=Ae.INTEGER_WORD_DICTIONARY=Ae.MONTH_DICTIONARY=Ae.WEEKDAY_DICTIONARY=void 0;var qd=xe(),K1=gt();Ae.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Ae.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Ae.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Ae.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Ae.NUMBER_PATTERN=`(?:${qd.matchAnyPattern(Ae.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function py(r){let e=r.toLowerCase();return Ae.INTEGER_WORD_DICTIONARY[e]!==void 0?Ae.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Ae.parseNumberPattern=py;Ae.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function Q1(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return K1.findMostLikelyADYear(e)}Ae.parseYear=Q1;var my=`(${Ae.NUMBER_PATTERN})\\s{0,5}(${qd.matchAnyPattern(Ae.TIME_UNIT_DICTIONARY)})\\s{0,5}`,fy=new RegExp(my,"i");Ae.TIME_UNITS_PATTERN=qd.repeatedTimeunitPattern("",my);function X1(r){let e={},t=r,n=fy.exec(t);for(;n;)Z1(e,n),t=t.substring(n[0].length),n=fy.exec(t);return e}Ae.parseTimeUnits=X1;function Z1(r,e){let t=py(e[1]),n=Ae.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var gy=k(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var hy=ba(),J1=xe(),e0=H(),t0=ps(),r0=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${J1.matchAnyPattern(hy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),n0=1,s0=3,i0=2,jd=class extends e0.AbstractParserWithWordBoundaryChecking{innerPattern(){return r0}innerExtract(e,t){let n=t[i0].toLowerCase(),s=hy.WEEKDAY_DICTIONARY[n],i=t[n0],a=t[s0],o=i||a;o=o||"",o=o.toLowerCase();let u=null;o.match(/letzte/)?u="last":o.match(/chste/)?u="next":o.match(/diese/)&&(u="this");let l=t0.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Gd.default=jd});var _y=k(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Gn=rt(),a0=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),o0=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),u0=2,yy=3,by=4,Ty=5,li=class{pattern(e){return a0}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=li.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),i=o0.exec(s);return i&&(n.end=li.extractTimeComponent(n.start.clone(),i),n.end&&(n.text+=i[0])),n}static extractTimeComponent(e,t){let n=0,s=0,i=null;if(n=parseInt(t[u0]),t[yy]!=null&&(s=parseInt(t[yy])),s>=60||n>24)return null;if(n>=12&&(i=Gn.Meridiem.PM),t[Ty]!=null){if(n>12)return null;let a=t[Ty].toLowerCase();a.match(/morgen|vormittag/)&&(i=Gn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(i=Gn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(i=Gn.Meridiem.AM,n=0):n<6?i=Gn.Meridiem.AM:(i=Gn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",s),i!==null?e.assign("meridiem",i):n<12?e.imply("meridiem",Gn.Meridiem.AM):e.imply("meridiem",Gn.Meridiem.PM),t[by]!=null){let a=parseInt(t[by]);if(a>=60)return null;e.assign("second",a)}return e}};Yd.default=li});var vy=k(Ta=>{"use strict";var l0=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var c0=l0(Yr()),Bd=class extends c0.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Ta.default=Bd});var wy=k(_a=>{"use strict";var d0=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0});var f0=d0(ln()),$d=class extends f0.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};_a.default=$d});var Hd=k(wa=>{"use strict";var p0=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var m0=p0(ve()),hs=rt(),h0=H(),g0=dr(),y0=fr(),va=class extends h0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=m0.default(e.refDate),s=t[2].toLowerCase(),i=e.createParsingComponents();return g0.implySimilarTime(i,n),va.extractTimeComponents(i,s)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=y0.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",hs.Meridiem.AM);break}return e}};wa.default=va});var Sy=k(Dr=>{"use strict";var b0=Dr&&Dr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),T0=Dr&&Dr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),_0=Dr&&Dr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&b0(e,r,t);return T0(e,r),e},Ey=Dr&&Dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dr,"__esModule",{value:!0});var v0=Ey(ve()),w0=H(),gs=dr(),k0=Ey(Hd()),ky=_0(fn()),E0=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),S0=1,O0=2,zd=class extends w0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return E0}innerExtract(e,t){let n=v0.default(e.refDate),s=(t[S0]||"").toLowerCase(),i=(t[O0]||"").toLowerCase(),a=e.createParsingComponents();switch(s){case"jetzt":a=ky.now(e.reference);break;case"heute":a=ky.today(e.reference);break;case"morgen":gs.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),gs.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),gs.assignSimilarDate(a,n),gs.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),gs.assignSimilarDate(a,n),gs.implySimilarTime(a,n);break;default:s.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),gs.assignSimilarDate(a,n),a.imply("hour",0));break}return i&&(a=k0.default.extractTimeComponents(a,i)),a}};Dr.default=zd});var Cy=k(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});var D0=gt(),Ry=ba(),My=ba(),x0=xe(),R0=H(),M0=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${x0.matchAnyPattern(Ry.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${My.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Oy=1,Dy=2,C0=3,xy=4,Vd=class extends R0.AbstractParserWithWordBoundaryChecking{innerPattern(){return M0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Ry.MONTH_DICTIONARY[t[C0].toLowerCase()],i=parseInt(t[Oy]);if(i>31)return t.index=t.index+t[Oy].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[xy]){let a=My.parseYear(t[xy]);n.start.assign("year",a)}else{let a=D0.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[Dy]){let a=parseInt(t[Dy]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Kd.default=Vd});var Ay=k(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var gu=ba(),A0=Be(),P0=H(),N0=fr(),I0=xe(),Qd=class extends P0.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${gu.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${I0.matchAnyPattern(gu.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?gu.parseNumberPattern(t[2]):1,s=gu.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],i={};i[s]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(i=N0.reverseTimeUnits(i)),A0.ParsingComponents.createRelativeFromReference(e.reference,i)}};Xd.default=Qd});var Iy=k(ut=>{"use strict";var xr=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});ut.createConfiguration=ut.createCasualConfiguration=ut.parseDate=ut.parse=ut.strict=ut.casual=void 0;var F0=cn(),Py=Or(),L0=xr(ms()),U0=xr(Td()),W0=xr(dy()),q0=xr(gy()),j0=xr(_y()),G0=xr(vy()),Y0=xr(wy()),B0=xr(Sy()),$0=xr(Hd()),H0=xr(Cy()),z0=xr(Ay());ut.casual=new Py.Chrono(Ny());ut.strict=new Py.Chrono(Zd(!0));function V0(r,e,t){return ut.casual.parse(r,e,t)}ut.parse=V0;function K0(r,e,t){return ut.casual.parseDate(r,e,t)}ut.parseDate=K0;function Ny(r=!0){let e=Zd(!1,r);return e.parsers.unshift(new $0.default),e.parsers.unshift(new B0.default),e.parsers.unshift(new z0.default),e}ut.createCasualConfiguration=Ny;function Zd(r=!0,e=!0){return F0.includeCommonConfiguration({parsers:[new U0.default,new L0.default(e),new W0.default,new j0.default,new H0.default,new q0.default],refiners:[new G0.default,new Y0.default]},r)}ut.createConfiguration=Zd});var Ly=k(Rr=>{"use strict";var Q0=Rr&&Rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),X0=Rr&&Rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Z0=Rr&&Rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Q0(e,r,t);return X0(e,r),e},J0=Rr&&Rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rr,"__esModule",{value:!0});var eO=J0(ve()),tO=rt(),rO=H(),Fy=dr(),yu=Z0(fn()),Jd=class extends rO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=eO.default(e.refDate),s=t[0].toLowerCase(),i=e.createParsingComponents();switch(s){case"maintenant":return yu.now(e.reference);case"aujourd'hui":return yu.today(e.reference);case"hier":return yu.yesterday(e.reference);case"demain":return yu.tomorrow(e.reference);default:s.match(/cette\s*nuit/)?(Fy.assignSimilarDate(i,n),i.imply("hour",22),i.imply("meridiem",tO.Meridiem.PM)):s.match(/la\s*veille/)&&(n=n.add(-1,"day"),Fy.assignSimilarDate(i,n),i.imply("hour",0))}return i}};Rr.default=Jd});var Uy=k(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});var ka=rt(),nO=H(),ef=class extends nO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),s=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":s.imply("hour",14),s.imply("minute",0),s.imply("meridiem",ka.Meridiem.PM);break;case"soir":s.imply("hour",18),s.imply("minute",0),s.imply("meridiem",ka.Meridiem.PM);break;case"matin":s.imply("hour",8),s.imply("minute",0),s.imply("meridiem",ka.Meridiem.AM);break;case"a midi":s.imply("hour",12),s.imply("minute",0),s.imply("meridiem",ka.Meridiem.AM);break;case"\xE0 minuit":s.imply("hour",0),s.imply("meridiem",ka.Meridiem.AM);break}return s}};tf.default=ef});var Wy=k(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var sO=ds(),rf=class extends sO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};nf.default=rf});var qy=k(Ea=>{"use strict";var iO=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var aO=iO(ln()),sf=class extends aO.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Ea.default=sf});var jy=k(Sa=>{"use strict";var oO=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var uO=oO(Yr()),af=class extends uO.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Sa.default=af});var Yn=k(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.parseTimeUnits=we.TIME_UNITS_PATTERN=we.parseYear=we.YEAR_PATTERN=we.parseOrdinalNumberPattern=we.ORDINAL_NUMBER_PATTERN=we.parseNumberPattern=we.NUMBER_PATTERN=we.TIME_UNIT_DICTIONARY=we.INTEGER_WORD_DICTIONARY=we.MONTH_DICTIONARY=we.WEEKDAY_DICTIONARY=void 0;var of=xe();we.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};we.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};we.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};we.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};we.NUMBER_PATTERN=`(?:${of.matchAnyPattern(we.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Yy(r){let e=r.toLowerCase();return we.INTEGER_WORD_DICTIONARY[e]!==void 0?we.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}we.parseNumberPattern=Yy;we.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function lO(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}we.parseOrdinalNumberPattern=lO;we.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function cO(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}we.parseYear=cO;var By=`(${we.NUMBER_PATTERN})\\s{0,5}(${of.matchAnyPattern(we.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Gy=new RegExp(By,"i");we.TIME_UNITS_PATTERN=of.repeatedTimeunitPattern("",By);function dO(r){let e={},t=r,n=Gy.exec(t);for(;n;)fO(e,n),t=t.substring(n[0].length),n=Gy.exec(t);return e}we.parseTimeUnits=dO;function fO(r,e){let t=Yy(e[1]),n=we.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Hy=k(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var $y=Yn(),pO=xe(),mO=H(),hO=ps(),gO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${pO.matchAnyPattern($y.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),yO=1,bO=2,uf=class extends mO.AbstractParserWithWordBoundaryChecking{innerPattern(){return gO}innerExtract(e,t){let n=t[yO].toLowerCase(),s=$y.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let i=t[bO];i=i||"",i=i.toLowerCase();let a=null;i=="dernier"?a="last":i=="prochain"&&(a="next");let o=hO.toDayJSWeekday(e.refDate,s,a);return e.createParsingComponents().assign("weekday",s).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};lf.default=uf});var Qy=k(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var Oa=rt(),TO=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),_O=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),vO=2,zy=3,Vy=4,Ky=5,ci=class{pattern(e){return TO}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ci.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),i=_O.exec(s);return i&&(n.end=ci.extractTimeComponent(n.start.clone(),i),n.end&&(n.text+=i[0])),n}static extractTimeComponent(e,t){let n=0,s=0,i=null;if(n=parseInt(t[vO]),t[zy]!=null&&(s=parseInt(t[zy])),s>=60||n>24)return null;if(n>=12&&(i=Oa.Meridiem.PM),t[Ky]!=null){if(n>12)return null;let a=t[Ky][0].toLowerCase();a=="a"&&(i=Oa.Meridiem.AM,n==12&&(n=0)),a=="p"&&(i=Oa.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",s),i!==null?e.assign("meridiem",i):n<12?e.imply("meridiem",Oa.Meridiem.AM):e.imply("meridiem",Oa.Meridiem.PM),t[Vy]!=null){let a=parseInt(t[Vy]);if(a>=60)return null;e.assign("second",a)}return e}};cf.default=ci});var rb=k(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var wO=gt(),eb=Yn(),tb=Yn(),bu=Yn(),kO=xe(),EO=H(),SO=new RegExp(`(?:on\\s*?)?(${bu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${bu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${kO.matchAnyPattern(eb.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${tb.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Xy=1,Zy=2,OO=3,Jy=4,df=class extends EO.AbstractParserWithWordBoundaryChecking{innerPattern(){return SO}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=eb.MONTH_DICTIONARY[t[OO].toLowerCase()],i=bu.parseOrdinalNumberPattern(t[Xy]);if(i>31)return t.index=t.index+t[Xy].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[Jy]){let a=tb.parseYear(t[Jy]);n.start.assign("year",a)}else{let a=wO.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[Zy]){let a=bu.parseOrdinalNumberPattern(t[Zy]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};ff.default=df});var sb=k(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});var nb=Yn(),DO=Be(),xO=H(),RO=fr(),pf=class extends xO.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${nb.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=nb.parseTimeUnits(t[1]),s=RO.reverseTimeUnits(n);return DO.ParsingComponents.createRelativeFromReference(e.reference,s)}};mf.default=pf});var ab=k(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var ib=Yn(),MO=Be(),CO=H(),hf=class extends CO.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${ib.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=ib.parseTimeUnits(t[1]);return MO.ParsingComponents.createRelativeFromReference(e.reference,n)}};gf.default=hf});var ob=k(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var Tu=Yn(),AO=Be(),PO=H(),NO=fr(),IO=xe(),yf=class extends PO.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${Tu.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${IO.matchAnyPattern(Tu.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?Tu.parseNumberPattern(t[1]):1,s=Tu.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],i={};i[s]=n;let a=t[2]||t[4]||"";if(a=a.toLowerCase(),!!a)return(/derni[eè]re?s?/.test(a)||/pass[ée]e?s?/.test(a)||/pr[ée]c[ée]dents?/.test(a))&&(i=NO.reverseTimeUnits(i)),AO.ParsingComponents.createRelativeFromReference(e.reference,i)}};bf.default=yf});var cb=k(lt=>{"use strict";var pr=lt&&lt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lt,"__esModule",{value:!0});lt.createConfiguration=lt.createCasualConfiguration=lt.parseDate=lt.parse=lt.strict=lt.casual=void 0;var FO=cn(),ub=Or(),LO=pr(Ly()),UO=pr(Uy()),WO=pr(ms()),qO=pr(Wy()),jO=pr(qy()),GO=pr(jy()),YO=pr(Hy()),BO=pr(Qy()),$O=pr(rb()),HO=pr(sb()),zO=pr(ab()),VO=pr(ob());lt.casual=new ub.Chrono(lb());lt.strict=new ub.Chrono(Tf(!0));function KO(r,e,t){return lt.casual.parse(r,e,t)}lt.parse=KO;function QO(r,e,t){return lt.casual.parseDate(r,e,t)}lt.parseDate=QO;function lb(r=!0){let e=Tf(!1,r);return e.parsers.unshift(new LO.default),e.parsers.unshift(new UO.default),e.parsers.unshift(new VO.default),e}lt.createCasualConfiguration=lb;function Tf(r=!0,e=!0){return FO.includeCommonConfiguration({parsers:[new WO.default(e),new $O.default,new qO.default,new BO.default,new HO.default,new zO.default,new YO.default],refiners:[new jO.default,new GO.default]},r)}lt.createConfiguration=Tf});var db=k(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.toHankaku=void 0;function XO(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,ZO)}_u.toHankaku=XO;function ZO(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var pb=k(Da=>{"use strict";var JO=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var _f=db(),eD=gt(),tD=JO(ve()),rD=/(?:(?:([同今本])|((昭和|平成|令和)?([0-9-]{1,4}|元)))年\s*)?([0-9-]{1,2})月\s*([0-9-]{1,2})日/i,fb=1,nD=2,vf=3,sD=4,iD=5,aD=6,wf=class{pattern(){return rD}extract(e,t){let n=parseInt(_f.toHankaku(t[iD])),s=parseInt(_f.toHankaku(t[aD])),i=e.createParsingComponents({day:s,month:n});if(t[fb]&&t[fb].match("\u540C|\u4ECA|\u672C")){let a=tD.default(e.refDate);i.assign("year",a.year())}if(t[nD]){let a=t[sD],o=a=="\u5143"?1:parseInt(_f.toHankaku(a));t[vf]=="\u4EE4\u548C"?o+=2018:t[vf]=="\u5E73\u6210"?o+=1988:t[vf]=="\u662D\u548C"&&(o+=1925),i.assign("year",o)}else{let a=eD.findYearClosestToRef(e.refDate,s,n);i.imply("year",a)}return i}};Da.default=wf});var mb=k(xa=>{"use strict";var oD=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var uD=oD(Yr()),kf=class extends uD.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};xa.default=kf});var gb=k(Mr=>{"use strict";var lD=Mr&&Mr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cD=Mr&&Mr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),dD=Mr&&Mr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lD(e,r,t);return cD(e,r),e},fD=Mr&&Mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mr,"__esModule",{value:!0});var pD=fD(ve()),hb=rt(),Ef=dD(fn()),mD=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Sf=class{pattern(){return mD}extract(e,t){let n=t[0],s=pD.default(e.refDate),i=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Ef.yesterday(e.reference);case"\u660E\u65E5":return Ef.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Ef.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(i.imply("hour",22),i.assign("meridiem",hb.Meridiem.PM)):n.match("\u4ECA\u671D")&&(i.imply("hour",6),i.assign("meridiem",hb.Meridiem.AM)),i.assign("day",s.date()),i.assign("month",s.month()+1),i.assign("year",s.year()),i}};Mr.default=Sf});var Tb=k(ct=>{"use strict";var Of=ct&&ct.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ct,"__esModule",{value:!0});ct.createConfiguration=ct.createCasualConfiguration=ct.parseDate=ct.parse=ct.strict=ct.casual=void 0;var hD=Of(pb()),gD=Of(mb()),yD=Of(gb()),yb=Or();ct.casual=new yb.Chrono(bb());ct.strict=new yb.Chrono(Df());function bD(r,e,t){return ct.casual.parse(r,e,t)}ct.parse=bD;function TD(r,e,t){return ct.casual.parseDate(r,e,t)}ct.parseDate=TD;function bb(){let r=Df();return r.parsers.unshift(new yD.default),r}ct.createCasualConfiguration=bb;function Df(){return{parsers:[new hD.default],refiners:[new gD.default]}}ct.createConfiguration=Df});var vu=k($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.parseYear=$r.YEAR_PATTERN=$r.MONTH_DICTIONARY=$r.WEEKDAY_DICTIONARY=void 0;$r.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};$r.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};$r.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function _D(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}$r.parseYear=_D});var vb=k(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});var _b=vu(),vD=xe(),wD=H(),kD=ps(),ED=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${vD.matchAnyPattern(_b.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),SD=1,OD=2,DD=3,xf=class extends wD.AbstractParserWithWordBoundaryChecking{innerPattern(){return ED}innerExtract(e,t){let n=t[OD].toLowerCase(),s=_b.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let i=t[SD],a=t[DD],o=i||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=kD.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Rf.default=xf});var wb=k(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var xD=ds(),Mf=class extends xD.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Cf.default=Mf});var kb=k(Ra=>{"use strict";var RD=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var MD=RD(ln()),Af=class extends MD.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Ra.default=Af});var Eb=k(Ma=>{"use strict";var CD=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var AD=CD(Yr()),Pf=class extends AD.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Ma.default=Pf});var Mb=k(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});var PD=gt(),xb=vu(),Rb=vu(),ND=xe(),ID=H(),FD=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${ND.matchAnyPattern(xb.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Rb.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Sb=1,Ob=2,LD=3,Db=4,Nf=class extends ID.AbstractParserWithWordBoundaryChecking{innerPattern(){return FD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=xb.MONTH_DICTIONARY[t[LD].toLowerCase()],i=parseInt(t[Sb]);if(i>31)return t.index=t.index+t[Sb].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[Db]){let a=Rb.parseYear(t[Db]);n.start.assign("year",a)}else{let a=PD.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[Ob]){let a=parseInt(t[Ob]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};If.default=Nf});var Cb=k(pn=>{"use strict";var UD=pn&&pn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),WD=pn&&pn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),qD=pn&&pn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&UD(e,r,t);return WD(e,r),e};Object.defineProperty(pn,"__esModule",{value:!0});var jD=H(),wu=qD(fn()),Ff=class extends jD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"agora":return wu.now(e.reference);case"hoje":return wu.today(e.reference);case"amanha":case"amanh\xE3":return wu.tomorrow(e.reference);case"ontem":return wu.yesterday(e.reference)}return s}};pn.default=Ff});var Ab=k(Ca=>{"use strict";var GD=Ca&&Ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ca,"__esModule",{value:!0});var ku=rt(),YD=H(),BD=dr(),$D=GD(ve()),Lf=class extends YD.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=$D.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":s.imply("meridiem",ku.Meridiem.PM),s.imply("hour",15);break;case"noite":s.imply("meridiem",ku.Meridiem.PM),s.imply("hour",22);break;case"manha":case"manh\xE3":s.imply("meridiem",ku.Meridiem.AM),s.imply("hour",6);break;case"meia-noite":BD.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"meio-dia":s.imply("meridiem",ku.Meridiem.AM),s.imply("hour",12);break}return s}};Ca.default=Lf});var Ib=k(dt=>{"use strict";var Bn=dt&&dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dt,"__esModule",{value:!0});dt.createConfiguration=dt.createCasualConfiguration=dt.parseDate=dt.parse=dt.strict=dt.casual=void 0;var HD=cn(),Pb=Or(),zD=Bn(ms()),VD=Bn(vb()),KD=Bn(wb()),QD=Bn(kb()),XD=Bn(Eb()),ZD=Bn(Mb()),JD=Bn(Cb()),ex=Bn(Ab());dt.casual=new Pb.Chrono(Nb());dt.strict=new Pb.Chrono(Uf(!0));function tx(r,e,t){return dt.casual.parse(r,e,t)}dt.parse=tx;function rx(r,e,t){return dt.casual.parseDate(r,e,t)}dt.parseDate=rx;function Nb(r=!0){let e=Uf(!1,r);return e.parsers.push(new JD.default),e.parsers.push(new ex.default),e}dt.createCasualConfiguration=Nb;function Uf(r=!0,e=!0){return HD.includeCommonConfiguration({parsers:[new zD.default(e),new VD.default,new KD.default,new ZD.default],refiners:[new QD.default,new XD.default]},r)}dt.createConfiguration=Uf});var Fb=k(Aa=>{"use strict";var nx=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var sx=nx(Yr()),Wf=class extends sx.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};Aa.default=Wf});var Lb=k(Pa=>{"use strict";var ix=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var ax=ix(ln()),qf=class extends ax.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Pa.default=qf});var Ub=k(mn=>{"use strict";var ox=mn&&mn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ux=mn&&mn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),lx=mn&&mn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ox(e,r,t);return ux(e,r),e};Object.defineProperty(mn,"__esModule",{value:!0});var cx=H(),Eu=lx(fn()),jf=class extends cx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"nu":return Eu.now(e.reference);case"vandaag":return Eu.today(e.reference);case"morgen":case"morgend":return Eu.tomorrow(e.reference);case"gisteren":return Eu.yesterday(e.reference)}return s}};mn.default=jf});var Wb=k(Na=>{"use strict";var dx=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var Su=rt(),fx=H(),px=dx(ve()),mx=dr(),hx=1,gx=2,Gf=class extends fx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=px.default(e.refDate),s=e.createParsingComponents();switch(t[hx]==="deze"&&(s.assign("day",e.refDate.getDate()),s.assign("month",e.refDate.getMonth()+1),s.assign("year",e.refDate.getFullYear())),t[gx].toLowerCase()){case"namiddag":case"'s namiddags":s.imply("meridiem",Su.Meridiem.PM),s.imply("hour",15);break;case"avond":case"'s avonds'":s.imply("meridiem",Su.Meridiem.PM),s.imply("hour",20);break;case"middernacht":mx.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"ochtend":case"'s ochtends":s.imply("meridiem",Su.Meridiem.AM),s.imply("hour",6);break;case"middag":case"'s middags":s.imply("meridiem",Su.Meridiem.AM),s.imply("hour",12);break}return s}};Na.default=Gf});var zt=k(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.parseTimeUnits=me.TIME_UNITS_PATTERN=me.parseYear=me.YEAR_PATTERN=me.parseOrdinalNumberPattern=me.ORDINAL_NUMBER_PATTERN=me.parseNumberPattern=me.NUMBER_PATTERN=me.TIME_UNIT_DICTIONARY=me.ORDINAL_WORD_DICTIONARY=me.INTEGER_WORD_DICTIONARY=me.MONTH_DICTIONARY=me.WEEKDAY_DICTIONARY=void 0;var Ou=xe(),yx=gt();me.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};me.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};me.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};me.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};me.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};me.NUMBER_PATTERN=`(?:${Ou.matchAnyPattern(me.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function jb(r){let e=r.toLowerCase();return me.INTEGER_WORD_DICTIONARY[e]!==void 0?me.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}me.parseNumberPattern=jb;me.ORDINAL_NUMBER_PATTERN=`(?:${Ou.matchAnyPattern(me.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function bx(r){let e=r.toLowerCase();return me.ORDINAL_WORD_DICTIONARY[e]!==void 0?me.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}me.parseOrdinalNumberPattern=bx;me.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function Tx(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return yx.findMostLikelyADYear(e)}me.parseYear=Tx;var Gb=`(${me.NUMBER_PATTERN})\\s{0,5}(${Ou.matchAnyPattern(me.TIME_UNIT_DICTIONARY)})\\s{0,5}`,qb=new RegExp(Gb,"i");me.TIME_UNITS_PATTERN=Ou.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Gb);function _x(r){let e={},t=r,n=qb.exec(t);for(;n;)vx(e,n),t=t.substring(n[0].length),n=qb.exec(t);return e}me.parseTimeUnits=_x;function vx(r,e){let t=jb(e[1]),n=me.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Bb=k(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});var Yb=zt(),wx=Be(),kx=H(),Yf=class extends kx.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Yb.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Yb.parseTimeUnits(t[1]);return wx.ParsingComponents.createRelativeFromReference(e.reference,n)}};Bf.default=Yf});var Hb=k(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var $b=zt(),Ex=xe(),Sx=H(),Ox=ps(),Dx=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${Ex.matchAnyPattern($b.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),xx=1,Rx=2,Mx=3,$f=class extends Sx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Dx}innerExtract(e,t){let n=t[Rx].toLowerCase(),s=$b.WEEKDAY_DICTIONARY[n],i=t[xx],a=t[Mx],o=i||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=Ox.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Hf.default=$f});var Zb=k(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});var Cx=gt(),Qb=zt(),Du=zt(),Xb=zt(),Ax=xe(),Px=H(),Nx=new RegExp(`(?:on\\s*?)?(${Du.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Du.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+Ax.matchAnyPattern(Qb.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${Xb.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ix=3,zb=1,Vb=2,Kb=4,zf=class extends Px.AbstractParserWithWordBoundaryChecking{innerPattern(){return Nx}innerExtract(e,t){let n=Qb.MONTH_DICTIONARY[t[Ix].toLowerCase()],s=Du.parseOrdinalNumberPattern(t[zb]);if(s>31)return t.index=t.index+t[zb].length,null;let i=e.createParsingComponents({day:s,month:n});if(t[Kb]){let u=Xb.parseYear(t[Kb]);i.assign("year",u)}else{let u=Cx.findYearClosestToRef(e.refDate,s,n);i.imply("year",u)}if(!t[Vb])return i;let a=Du.parseOrdinalNumberPattern(t[Vb]),o=e.createParsingResult(t.index,t[0]);return o.start=i,o.end=i.clone(),o.end.assign("day",a),o}};Vf.default=zf});var rT=k(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var eT=zt(),Fx=gt(),Lx=xe(),tT=zt(),Ux=H(),Wx=new RegExp(`(${Lx.matchAnyPattern(eT.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${tT.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),qx=1,Jb=2,Kf=class extends Ux.AbstractParserWithWordBoundaryChecking{innerPattern(){return Wx}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let s=t[qx],i=eT.MONTH_DICTIONARY[s.toLowerCase()];if(n.assign("month",i),t[Jb]){let a=tT.parseYear(t[Jb]);n.assign("year",a)}else{let a=Fx.findYearClosestToRef(e.refDate,1,i);n.imply("year",a)}return n}};Qf.default=Kf});var nT=k(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var jx=H(),Gx=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Yx=1,Bx=2,Xf=class extends jx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Gx}innerExtract(e,t){let n=parseInt(t[Bx]),s=parseInt(t[Yx]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};Zf.default=Xf});var sT=k(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});var $x=ds(),Jf=class extends $x.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};ep.default=Jf});var oT=k(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var aT=zt(),Hx=xe(),zx=H(),Vx=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Hx.matchAnyPattern(aT.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Kx=1,Qx=2,iT=3,Xx=4,tp=class extends zx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Vx}innerExtract(e,t){let n=t[iT]?parseInt(t[iT]):aT.MONTH_DICTIONARY[t[Qx].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[Kx]);return{day:parseInt(t[Xx]),month:n,year:s}}};rp.default=tp});var uT=k(Ia=>{"use strict";var Zx=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var Jx=H(),xu=rt(),np=dr(),eR=Zx(ve()),tR=1,rR=2,sp=class extends Jx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[tR].toLowerCase(),s=t[rR].toLowerCase(),i=e.createParsingComponents(),a=eR.default(e.refDate);switch(n){case"gisteren":np.assignSimilarDate(i,a.add(-1,"day"));break;case"van":np.assignSimilarDate(i,a);break;case"morgen":np.assignTheNextDay(i,a);break}switch(s){case"ochtend":i.imply("meridiem",xu.Meridiem.AM),i.imply("hour",6);break;case"middag":i.imply("meridiem",xu.Meridiem.AM),i.imply("hour",12);break;case"namiddag":i.imply("meridiem",xu.Meridiem.PM),i.imply("hour",15);break;case"avond":i.imply("meridiem",xu.Meridiem.PM),i.imply("hour",20);break}return i}};Ia.default=sp});var cT=k(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var lT=zt(),nR=Be(),sR=H(),iR=fr(),aR=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${lT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),ip=class extends sR.AbstractParserWithWordBoundaryChecking{innerPattern(){return aR}innerExtract(e,t){let n=t[1].toLowerCase(),s=lT.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":s=iR.reverseTimeUnits(s);break}return nR.ParsingComponents.createRelativeFromReference(e.reference,s)}};ap.default=ip});var pT=k(Fa=>{"use strict";var oR=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var fT=zt(),dT=Be(),uR=oR(ve()),lR=H(),cR=xe(),dR=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${cR.matchAnyPattern(fT.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),fR=1,pR=2,op=class extends lR.AbstractParserWithWordBoundaryChecking{innerPattern(){return dR}innerExtract(e,t){let n=t[fR].toLowerCase(),s=t[pR].toLowerCase(),i=fT.TIME_UNIT_DICTIONARY[s];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[i]=1,dT.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[i]=-1,dT.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=uR.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/maand/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};Fa.default=op});var mT=k(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});var lp=zt(),mR=Be(),hR=H(),gR=fr(),yR=new RegExp("("+lp.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),bR=new RegExp("("+lp.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),up=class extends hR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?bR:yR}innerExtract(e,t){let n=lp.parseTimeUnits(t[1]),s=gR.reverseTimeUnits(n);return mR.ParsingComponents.createRelativeFromReference(e.reference,s)}};cp.default=up});var hT=k(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var fp=zt(),TR=Be(),_R=H(),vR=new RegExp("("+fp.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),wR=new RegExp("("+fp.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),kR=1,dp=class extends _R.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?wR:vR}innerExtract(e,t){let n=fp.parseTimeUnits(t[kR]);return TR.ParsingComponents.createRelativeFromReference(e.reference,n)}};pp.default=dp});var TT=k(ft=>{"use strict";var bt=ft&&ft.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ft,"__esModule",{value:!0});ft.createConfiguration=ft.createCasualConfiguration=ft.parseDate=ft.parse=ft.strict=ft.casual=void 0;var ER=cn(),gT=Or(),SR=bt(Fb()),OR=bt(Lb()),DR=bt(Ub()),xR=bt(Wb()),RR=bt(ms()),MR=bt(Bb()),CR=bt(Hb()),AR=bt(Zb()),yT=bt(rT()),PR=bt(nT()),NR=bt(sT()),IR=bt(oT()),FR=bt(uT()),LR=bt(cT()),UR=bt(pT()),WR=bt(mT()),qR=bt(hT());ft.casual=new gT.Chrono(bT());ft.strict=new gT.Chrono(mp(!0));function jR(r,e,t){return ft.casual.parse(r,e,t)}ft.parse=jR;function GR(r,e,t){return ft.casual.parseDate(r,e,t)}ft.parseDate=GR;function bT(r=!0){let e=mp(!1,r);return e.parsers.unshift(new DR.default),e.parsers.unshift(new xR.default),e.parsers.unshift(new FR.default),e.parsers.unshift(new yT.default),e.parsers.unshift(new UR.default),e.parsers.unshift(new LR.default),e}ft.createCasualConfiguration=bT;function mp(r=!0,e=!0){return ER.includeCommonConfiguration({parsers:[new RR.default(e),new MR.default,new AR.default,new yT.default,new CR.default,new IR.default,new PR.default,new NR.default(r),new WR.default(r),new qR.default(r)],refiners:[new OR.default,new SR.default]},r)}ft.createConfiguration=mp});var kT=k(La=>{"use strict";var YR=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var BR=YR(ve()),$R=H(),HR=1,_T=2,zR=3,vT=4,wT=5,VR=6,hp=class extends $R.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),i=BR.default(e.refDate),a=i;if(t[HR])s.start.imply("hour",i.hour()),s.start.imply("minute",i.minute()),s.start.imply("second",i.second()),s.start.imply("millisecond",i.millisecond());else if(t[_T]){let o=t[_T],u=t[zR];o=="\u660E"||o=="\u807D"?i.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day")),u=="\u65E9"||u=="\u671D"?s.start.imply("hour",6):u=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[vT]){let u=t[vT][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?s.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):u=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):u=="\u51CC"&&s.start.imply("hour",0)}else if(t[wT]){let o=t[wT];o=="\u660E"||o=="\u807D"?i.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day"));let u=t[VR];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?s.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):l=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):l=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year()),s}};La.default=hp});var di=k(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.zhStringToYear=Wt.zhStringToNumber=Wt.WEEKDAY_OFFSET=Wt.NUMBER=void 0;Wt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};Wt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function KR(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Wt.NUMBER[n]:e*Wt.NUMBER[n]:e+=Wt.NUMBER[n]}return e}Wt.zhStringToNumber=KR;function QR(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Wt.NUMBER[n]}return parseInt(e)}Wt.zhStringToYear=QR});var ST=k(Ua=>{"use strict";var XR=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var ZR=XR(ve()),JR=H(),ys=di(),gp=1,ET=2,yp=3,bp=class extends JR.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ys.NUMBER).join("")+"]{4}|["+Object.keys(ys.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ys.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ys.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=ZR.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=parseInt(t[ET]);if(isNaN(i)&&(i=ys.zhStringToNumber(t[ET])),s.start.assign("month",i),t[yp]){let a=parseInt(t[yp]);isNaN(a)&&(a=ys.zhStringToNumber(t[yp])),s.start.assign("day",a)}else s.start.imply("day",n.date());if(t[gp]){let a=parseInt(t[gp]);isNaN(a)&&(a=ys.zhStringToYear(t[gp])),s.start.assign("year",a)}else s.start.imply("year",n.year());return s}};Ua.default=bp});var DT=k(Wa=>{"use strict";var eM=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var tM=eM(ve()),rM=H(),OT=di(),nM=new RegExp("(\\d+|["+Object.keys(OT.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Tp=1,sM=2,_p=class extends rM.AbstractParserWithWordBoundaryChecking{innerPattern(){return nM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Tp]);if(isNaN(s)&&(s=OT.zhStringToNumber(t[Tp])),isNaN(s)){let u=t[Tp];if(u==="\u5E7E")s=3;else if(u==="\u534A")s=.5;else return null}let i=tM.default(e.refDate),o=t[sM][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?i=i.add(s,"d"):o=="\u661F"||o=="\u79AE"?i=i.add(s*7,"d"):o=="\u6708"?i=i.add(s,"month"):o=="\u5E74"&&(i=i.add(s,"year")),n.start.assign("year",i.year()),n.start.assign("month",i.month()+1),n.start.assign("day",i.date()),n):(o=="\u79D2"?i=i.add(s,"second"):o=="\u5206"?i=i.add(s,"minute"):(o=="\u5C0F"||o=="\u9418")&&(i=i.add(s,"hour")),n.start.imply("year",i.year()),n.start.imply("month",i.month()+1),n.start.imply("day",i.date()),n.start.assign("hour",i.hour()),n.start.assign("minute",i.minute()),n.start.assign("second",i.second()),n)}};Wa.default=_p});var RT=k(qa=>{"use strict";var iM=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var aM=iM(ve()),oM=H(),xT=di(),uM=new RegExp("(?<prefix>\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(xT.WEEKDAY_OFFSET).join("|")+")"),vp=class extends oM.AbstractParserWithWordBoundaryChecking{innerPattern(){return uM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=xT.WEEKDAY_OFFSET[s];if(i===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(a="this");let u=aM.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(i-7),l=!0):a=="next"?(u=u.day(i+7),l=!0):a=="this"?u=u.day(i):Math.abs(i-7-c)<Math.abs(i-c)?u=u.day(i-7):Math.abs(i+7-c)<Math.abs(i-c)?u=u.day(i+7):u=u.day(i),n.start.assign("weekday",i),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};qa.default=vp});var MT=k(ja=>{"use strict";var lM=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var cM=lM(ve()),dM=H(),hr=di(),fM=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),pM=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Ru=1,Mu=2,Cu=3,Au=4,Pu=5,Nu=6,mr=7,fi=8,Iu=9,wp=class extends dM.AbstractParserWithWordBoundaryChecking{innerPattern(){return fM}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=cM.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=n.clone();if(t[Ru]){var a=t[Ru];a=="\u660E"||a=="\u807D"?n.hour()>1&&i.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?i.add(-1,"day"):a=="\u524D"?i.add(-2,"day"):a=="\u5927\u524D"?i.add(-3,"day"):a=="\u5F8C"?i.add(2,"day"):a=="\u5927\u5F8C"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else if(t[Au]){var o=t[Au];o=="\u660E"||o=="\u807D"?i.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?i.add(-1,"day"):o=="\u524D"?i.add(-2,"day"):o=="\u5927\u524D"?i.add(-3,"day"):o=="\u5F8C"?i.add(2,"day"):o=="\u5927\u5F8C"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else s.start.imply("day",i.date()),s.start.imply("month",i.month()+1),s.start.imply("year",i.year());let u=0,l=0,c=-1;if(t[fi]){var f=parseInt(t[fi]);if(isNaN(f)&&(f=hr.zhStringToNumber(t[fi])),f>=60)return null;s.start.assign("second",f)}if(u=parseInt(t[Nu]),isNaN(u)&&(u=hr.zhStringToNumber(t[Nu])),t[mr]?t[mr]=="\u534A"?l=30:t[mr]=="\u6B63"||t[mr]=="\u6574"?l=0:(l=parseInt(t[mr]),isNaN(l)&&(l=hr.zhStringToNumber(t[mr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Iu]){if(u>12)return null;var p=t[Iu][0].toLowerCase();p=="a"&&(c=0,u==12&&(u=0)),p=="p"&&(c=1,u!=12&&(u+=12))}else if(t[Mu]){var m=t[Mu],_=m[0];_=="\u671D"||_=="\u65E9"?(c=0,u==12&&(u=0)):_=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var g=t[Cu],E=g[0];E=="\u4E0A"||E=="\u671D"||E=="\u65E9"||E=="\u51CC"?(c=0,u==12&&(u=0)):(E=="\u4E0B"||E=="\u664F"||E=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Pu]){var C=t[Pu],R=C[0];R=="\u4E0A"||R=="\u671D"||R=="\u65E9"||R=="\u51CC"?(c=0,u==12&&(u=0)):(R=="\u4E0B"||R=="\u664F"||R=="\u665A")&&(c=1,u!=12&&(u+=12))}if(s.start.assign("hour",u),s.start.assign("minute",l),c>=0?s.start.assign("meridiem",c):u<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=pM.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let b=i.clone();if(s.end=e.createParsingComponents(),t[Ru]){var a=t[Ru];a=="\u660E"||a=="\u807D"?n.hour()>1&&b.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?b.add(-1,"day"):a=="\u524D"?b.add(-2,"day"):a=="\u5927\u524D"?b.add(-3,"day"):a=="\u5F8C"?b.add(2,"day"):a=="\u5927\u5F8C"&&b.add(3,"day"),s.end.assign("day",b.date()),s.end.assign("month",b.month()+1),s.end.assign("year",b.year())}else if(t[Au]){var o=t[Au];o=="\u660E"||o=="\u807D"?b.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?b.add(-1,"day"):o=="\u524D"?b.add(-2,"day"):o=="\u5927\u524D"?b.add(-3,"day"):o=="\u5F8C"?b.add(2,"day"):o=="\u5927\u5F8C"&&b.add(3,"day"),s.end.assign("day",b.date()),s.end.assign("month",b.month()+1),s.end.assign("year",b.year())}else s.end.imply("day",b.date()),s.end.imply("month",b.month()+1),s.end.imply("year",b.year());if(u=0,l=0,c=-1,t[fi]){var f=parseInt(t[fi]);if(isNaN(f)&&(f=hr.zhStringToNumber(t[fi])),f>=60)return null;s.end.assign("second",f)}if(u=parseInt(t[Nu]),isNaN(u)&&(u=hr.zhStringToNumber(t[Nu])),t[mr]?t[mr]=="\u534A"?l=30:t[mr]=="\u6B63"||t[mr]=="\u6574"?l=0:(l=parseInt(t[mr]),isNaN(l)&&(l=hr.zhStringToNumber(t[mr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Iu]){if(u>12)return null;var p=t[Iu][0].toLowerCase();p=="a"&&(c=0,u==12&&(u=0)),p=="p"&&(c=1,u!=12&&(u+=12)),s.start.isCertain("meridiem")||(c==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[Mu]){var m=t[Mu],_=m[0];_=="\u671D"||_=="\u65E9"?(c=0,u==12&&(u=0)):_=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var g=t[Cu],E=g[0];E=="\u4E0A"||E=="\u671D"||E=="\u65E9"||E=="\u51CC"?(c=0,u==12&&(u=0)):(E=="\u4E0B"||E=="\u664F"||E=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Pu]){var C=t[Pu],R=C[0];R=="\u4E0A"||R=="\u671D"||R=="\u65E9"||R=="\u51CC"?(c=0,u==12&&(u=0)):(R=="\u4E0B"||R=="\u664F"||R=="\u665A")&&(c=1,u!=12&&(u+=12))}return s.text=s.text+t[0],s.end.assign("hour",u),s.end.assign("minute",l),c>=0?s.end.assign("meridiem",c):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>u?s.end.imply("meridiem",0):u>12&&s.end.imply("meridiem",1),s.end.date().getTime()<s.start.date().getTime()&&s.end.imply("day",s.end.get("day")+1),s}};ja.default=wp});var AT=k(Ga=>{"use strict";var mM=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var hM=mM(ve()),gM=H(),CT=di(),yM=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(CT.WEEKDAY_OFFSET).join("|")+")"),kp=class extends gM.AbstractParserWithWordBoundaryChecking{innerPattern(){return yM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=CT.WEEKDAY_OFFSET[s];if(i===void 0)return null;let a=hM.default(e.refDate),o=!1,u=a.day();return Math.abs(i-7-u)<Math.abs(i-u)?a=a.day(i-7):Math.abs(i+7-u)<Math.abs(i-u)?a=a.day(i+7):a=a.day(i),n.start.assign("weekday",i),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};Ga.default=kp});var PT=k(Ya=>{"use strict";var bM=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var TM=bM(Yr()),Ep=class extends TM.default{patternBetween(){return/^\s*(至|到|\-|\~|||ー)\s*$/i}};Ya.default=Ep});var NT=k(Ba=>{"use strict";var _M=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var vM=_M(ln()),Sp=class extends vM.default{patternBetween(){return/^\s*$/i}};Ba.default=Sp});var IT=k(Xe=>{"use strict";var hn=Xe&&Xe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.createConfiguration=Xe.createCasualConfiguration=Xe.parseDate=Xe.parse=Xe.strict=Xe.casual=Xe.hant=void 0;var Op=Or(),wM=hn(du()),kM=cn(),EM=hn(kT()),SM=hn(ST()),OM=hn(DT()),DM=hn(RT()),xM=hn(MT()),RM=hn(AT()),MM=hn(PT()),CM=hn(NT());Xe.hant=new Op.Chrono(Dp());Xe.casual=new Op.Chrono(Dp());Xe.strict=new Op.Chrono(xp());function AM(r,e,t){return Xe.casual.parse(r,e,t)}Xe.parse=AM;function PM(r,e,t){return Xe.casual.parseDate(r,e,t)}Xe.parseDate=PM;function Dp(){let r=xp();return r.parsers.unshift(new EM.default),r}Xe.createCasualConfiguration=Dp;function xp(){let r=kM.includeCommonConfiguration({parsers:[new SM.default,new DM.default,new RM.default,new xM.default,new OM.default],refiners:[new MM.default,new CM.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof wM.default)),r}Xe.createConfiguration=xp});var WT=k($a=>{"use strict";var NM=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var IM=NM(ve()),FM=H(),LM=1,FT=2,UM=3,LT=4,UT=5,WM=6,Rp=class extends FM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),i=IM.default(e.refDate),a=i;if(t[LM])s.start.imply("hour",i.hour()),s.start.imply("minute",i.minute()),s.start.imply("second",i.second()),s.start.imply("millisecond",i.millisecond());else if(t[FT]){let o=t[FT],u=t[UM];o=="\u660E"?i.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day")),u=="\u65E9"?s.start.imply("hour",6):u=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[LT]){let u=t[LT][0];u=="\u65E9"||u=="\u4E0A"?s.start.imply("hour",6):u=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):u=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):u=="\u51CC"&&s.start.imply("hour",0)}else if(t[UT]){let o=t[UT];o=="\u660E"?i.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day"));let u=t[WM];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?s.start.imply("hour",6):l=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):l=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):l=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year()),s}};$a.default=Rp});var pi=k(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.zhStringToYear=qt.zhStringToNumber=qt.WEEKDAY_OFFSET=qt.NUMBER=void 0;qt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};qt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function qM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?qt.NUMBER[n]:e*qt.NUMBER[n]:e+=qt.NUMBER[n]}return e}qt.zhStringToNumber=qM;function jM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+qt.NUMBER[n]}return parseInt(e)}qt.zhStringToYear=jM});var jT=k(Ha=>{"use strict";var GM=Ha&&Ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ha,"__esModule",{value:!0});var YM=GM(ve()),BM=H(),bs=pi(),Mp=1,qT=2,Cp=3,Ap=class extends BM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(bs.NUMBER).join("")+"]{4}|["+Object.keys(bs.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(bs.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(bs.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=YM.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=parseInt(t[qT]);if(isNaN(i)&&(i=bs.zhStringToNumber(t[qT])),s.start.assign("month",i),t[Cp]){let a=parseInt(t[Cp]);isNaN(a)&&(a=bs.zhStringToNumber(t[Cp])),s.start.assign("day",a)}else s.start.imply("day",n.date());if(t[Mp]){let a=parseInt(t[Mp]);isNaN(a)&&(a=bs.zhStringToYear(t[Mp])),s.start.assign("year",a)}else s.start.imply("year",n.year());return s}};Ha.default=Ap});var YT=k(za=>{"use strict";var $M=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var HM=$M(ve()),zM=H(),GT=pi(),VM=new RegExp("(\\d+|["+Object.keys(GT.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),Pp=1,KM=2,Np=class extends zM.AbstractParserWithWordBoundaryChecking{innerPattern(){return VM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Pp]);if(isNaN(s)&&(s=GT.zhStringToNumber(t[Pp])),isNaN(s)){let u=t[Pp];if(u==="\u51E0")s=3;else if(u==="\u534A")s=.5;else return null}let i=HM.default(e.refDate),o=t[KM][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?i=i.add(s,"d"):o=="\u661F"||o=="\u793C"?i=i.add(s*7,"d"):o=="\u6708"?i=i.add(s,"month"):o=="\u5E74"&&(i=i.add(s,"year")),n.start.assign("year",i.year()),n.start.assign("month",i.month()+1),n.start.assign("day",i.date()),n):(o=="\u79D2"?i=i.add(s,"second"):o=="\u5206"?i=i.add(s,"minute"):(o=="\u5C0F"||o=="\u949F")&&(i=i.add(s,"hour")),n.start.imply("year",i.year()),n.start.imply("month",i.month()+1),n.start.imply("day",i.date()),n.start.assign("hour",i.hour()),n.start.assign("minute",i.minute()),n.start.assign("second",i.second()),n)}};za.default=Np});var $T=k(Va=>{"use strict";var QM=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var XM=QM(ve()),ZM=H(),BT=pi(),JM=new RegExp("(?<prefix>\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(BT.WEEKDAY_OFFSET).join("|")+")"),Ip=class extends ZM.AbstractParserWithWordBoundaryChecking{innerPattern(){return JM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=BT.WEEKDAY_OFFSET[s];if(i===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":o=="\u8FD9"&&(a="this");let u=XM.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(i-7),l=!0):a=="next"?(u=u.day(i+7),l=!0):a=="this"?u=u.day(i):Math.abs(i-7-c)<Math.abs(i-c)?u=u.day(i-7):Math.abs(i+7-c)<Math.abs(i-c)?u=u.day(i+7):u=u.day(i),n.start.assign("weekday",i),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};Va.default=Ip});var HT=k(Ka=>{"use strict";var eC=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0});var tC=eC(ve()),rC=H(),yr=pi(),nC=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(yr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(yr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(yr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),sC=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(yr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(yr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(yr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Fu=1,Lu=2,Uu=3,Wu=4,qu=5,ju=6,gr=7,mi=8,Gu=9,Fp=class extends rC.AbstractParserWithWordBoundaryChecking{innerPattern(){return nC}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=tC.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=n.clone();if(t[Fu]){let c=t[Fu];c=="\u660E"?n.hour()>1&&i.add(1,"day"):c=="\u6628"?i.add(-1,"day"):c=="\u524D"?i.add(-2,"day"):c=="\u5927\u524D"?i.add(-3,"day"):c=="\u540E"?i.add(2,"day"):c=="\u5927\u540E"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else if(t[Wu]){let c=t[Wu];c=="\u660E"?i.add(1,"day"):c=="\u6628"?i.add(-1,"day"):c=="\u524D"?i.add(-2,"day"):c=="\u5927\u524D"?i.add(-3,"day"):c=="\u540E"?i.add(2,"day"):c=="\u5927\u540E"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else s.start.imply("day",i.date()),s.start.imply("month",i.month()+1),s.start.imply("year",i.year());let a=0,o=0,u=-1;if(t[mi]){let c=parseInt(t[mi]);if(isNaN(c)&&(c=yr.zhStringToNumber(t[mi])),c>=60)return null;s.start.assign("second",c)}if(a=parseInt(t[ju]),isNaN(a)&&(a=yr.zhStringToNumber(t[ju])),t[gr]?t[gr]=="\u534A"?o=30:t[gr]=="\u6B63"||t[gr]=="\u6574"?o=0:(o=parseInt(t[gr]),isNaN(o)&&(o=yr.zhStringToNumber(t[gr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Gu]){if(a>12)return null;let c=t[Gu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Lu]){let f=t[Lu][0];f=="\u65E9"?(u=0,a==12&&(a=0)):f=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Uu]){let f=t[Uu][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[qu]){let f=t[qu][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}if(s.start.assign("hour",a),s.start.assign("minute",o),u>=0?s.start.assign("meridiem",u):a<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=sC.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let l=i.clone();if(s.end=e.createParsingComponents(),t[Fu]){let c=t[Fu];c=="\u660E"?n.hour()>1&&l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),s.end.assign("day",l.date()),s.end.assign("month",l.month()+1),s.end.assign("year",l.year())}else if(t[Wu]){let c=t[Wu];c=="\u660E"?l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),s.end.assign("day",l.date()),s.end.assign("month",l.month()+1),s.end.assign("year",l.year())}else s.end.imply("day",l.date()),s.end.imply("month",l.month()+1),s.end.imply("year",l.year());if(a=0,o=0,u=-1,t[mi]){let c=parseInt(t[mi]);if(isNaN(c)&&(c=yr.zhStringToNumber(t[mi])),c>=60)return null;s.end.assign("second",c)}if(a=parseInt(t[ju]),isNaN(a)&&(a=yr.zhStringToNumber(t[ju])),t[gr]?t[gr]=="\u534A"?o=30:t[gr]=="\u6B63"||t[gr]=="\u6574"?o=0:(o=parseInt(t[gr]),isNaN(o)&&(o=yr.zhStringToNumber(t[gr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Gu]){if(a>12)return null;let c=t[Gu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),s.start.isCertain("meridiem")||(u==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[Lu]){let f=t[Lu][0];f=="\u65E9"?(u=0,a==12&&(a=0)):f=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Uu]){let f=t[Uu][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[qu]){let f=t[qu][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}return s.text=s.text+t[0],s.end.assign("hour",a),s.end.assign("minute",o),u>=0?s.end.assign("meridiem",u):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>a?s.end.imply("meridiem",0):a>12&&s.end.imply("meridiem",1),s.end.date().getTime()<s.start.date().getTime()&&s.end.imply("day",s.end.get("day")+1),s}};Ka.default=Fp});var VT=k(Qa=>{"use strict";var iC=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var aC=iC(ve()),oC=H(),zT=pi(),uC=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(zT.WEEKDAY_OFFSET).join("|")+")"),Lp=class extends oC.AbstractParserWithWordBoundaryChecking{innerPattern(){return uC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=zT.WEEKDAY_OFFSET[s];if(i===void 0)return null;let a=aC.default(e.refDate),o=!1,u=a.day();return Math.abs(i-7-u)<Math.abs(i-u)?a=a.day(i-7):Math.abs(i+7-u)<Math.abs(i-u)?a=a.day(i+7):a=a.day(i),n.start.assign("weekday",i),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};Qa.default=Lp});var KT=k(Xa=>{"use strict";var lC=Xa&&Xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xa,"__esModule",{value:!0});var cC=lC(Yr()),Up=class extends cC.default{patternBetween(){return/^\s*(至|到|-|~|||ー)\s*$/i}};Xa.default=Up});var QT=k(Za=>{"use strict";var dC=Za&&Za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Za,"__esModule",{value:!0});var fC=dC(ln()),Wp=class extends fC.default{patternBetween(){return/^\s*$/i}};Za.default=Wp});var XT=k(Ze=>{"use strict";var gn=Ze&&Ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createConfiguration=Ze.createCasualConfiguration=Ze.parseDate=Ze.parse=Ze.strict=Ze.casual=Ze.hans=void 0;var qp=Or(),pC=gn(du()),mC=cn(),hC=gn(WT()),gC=gn(jT()),yC=gn(YT()),bC=gn($T()),TC=gn(HT()),_C=gn(VT()),vC=gn(KT()),wC=gn(QT());Ze.hans=new qp.Chrono(jp());Ze.casual=new qp.Chrono(jp());Ze.strict=new qp.Chrono(Gp());function kC(r,e,t){return Ze.casual.parse(r,e,t)}Ze.parse=kC;function EC(r,e,t){return Ze.casual.parseDate(r,e,t)}Ze.parseDate=EC;function jp(){let r=Gp();return r.parsers.unshift(new hC.default),r}Ze.createCasualConfiguration=jp;function Gp(){let r=mC.includeCommonConfiguration({parsers:[new gC.default,new bC.default,new _C.default,new TC.default,new yC.default],refiners:[new vC.default,new wC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof pC.default)),r}Ze.createConfiguration=Gp});var JT=k(Vt=>{"use strict";var ZT=Vt&&Vt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),SC=Vt&&Vt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),OC=Vt&&Vt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ZT(e,r,t)},DC=Vt&&Vt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ZT(e,r,t);return SC(e,r),e};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.hans=void 0;OC(IT(),Vt);Vt.hans=DC(XT())});var jt=k(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.parseTimeUnits=ae.TIME_UNITS_PATTERN=ae.parseYear=ae.YEAR_PATTERN=ae.parseOrdinalNumberPattern=ae.ORDINAL_NUMBER_PATTERN=ae.parseNumberPattern=ae.NUMBER_PATTERN=ae.TIME_UNIT_DICTIONARY=ae.ORDINAL_WORD_DICTIONARY=ae.INTEGER_WORD_DICTIONARY=ae.MONTH_DICTIONARY=ae.FULL_MONTH_NAME_DICTIONARY=ae.WEEKDAY_DICTIONARY=ae.REGEX_PARTS=void 0;var Yu=xe(),xC=gt();ae.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};ae.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};ae.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};ae.MONTH_DICTIONARY=Object.assign(Object.assign({},ae.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});ae.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};ae.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};ae.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};ae.NUMBER_PATTERN=`(?:${Yu.matchAnyPattern(ae.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function t_(r){let e=r.toLowerCase();return ae.INTEGER_WORD_DICTIONARY[e]!==void 0?ae.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}ae.parseNumberPattern=t_;ae.ORDINAL_NUMBER_PATTERN=`(?:${Yu.matchAnyPattern(ae.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function RC(r){let e=r.toLowerCase();return ae.ORDINAL_WORD_DICTIONARY[e]!==void 0?ae.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ae.parseOrdinalNumberPattern=RC;var Yp="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";ae.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${Yp}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${Yp}|[5-9][0-9]${Yp})`;function MC(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return xC.findMostLikelyADYear(e)}ae.parseYear=MC;var r_=`(${ae.NUMBER_PATTERN})\\s{0,3}(${Yu.matchAnyPattern(ae.TIME_UNIT_DICTIONARY)})`,e_=new RegExp(r_,"i");ae.TIME_UNITS_PATTERN=Yu.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",r_);function CC(r){let e={},t=r,n=e_.exec(t);for(;n;)AC(e,n),t=t.substring(n[0].length).trim(),n=e_.exec(t);return e}ae.parseTimeUnits=CC;function AC(r,e){let t=t_(e[1]),n=ae.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var s_=k($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});var Ja=jt(),PC=Be(),NC=H(),n_=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Ja.TIME_UNITS_PATTERN})${Ja.REGEX_PARTS.rightBoundary}`,IC=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${n_}`,Ja.REGEX_PARTS.flags),FC=new RegExp(n_,"i"),Bp=class extends NC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ja.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?FC:IC}innerExtract(e,t){let n=Ja.parseTimeUnits(t[1]);return PC.ParsingComponents.createRelativeFromReference(e.reference,n)}};$p.default=Bp});var l_=k(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var LC=gt(),eo=jt(),u_=jt(),Bu=jt(),UC=xe(),WC=H(),qC=new RegExp(`(?:\u0441)?\\s*(${Bu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Bu.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${UC.matchAnyPattern(eo.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${u_.YEAR_PATTERN}(?![^\\s]\\d)))?${eo.REGEX_PARTS.rightBoundary}`,eo.REGEX_PARTS.flags),i_=1,a_=2,jC=3,o_=4,Hp=class extends WC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return eo.REGEX_PARTS.leftBoundary}innerPattern(){return qC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=eo.MONTH_DICTIONARY[t[jC].toLowerCase()],i=Bu.parseOrdinalNumberPattern(t[i_]);if(i>31)return t.index=t.index+t[i_].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[o_]){let a=u_.parseYear(t[o_]);n.start.assign("year",a)}else{let a=LC.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[a_]){let a=Bu.parseOrdinalNumberPattern(t[a_]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};zp.default=Hp});var f_=k(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});var to=jt(),GC=gt(),YC=xe(),d_=jt(),BC=H(),$C=new RegExp(`((?:\u0432)\\s*)?(${YC.matchAnyPattern(to.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${d_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,to.REGEX_PARTS.flags),HC=2,c_=3,Vp=class extends BC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return to.REGEX_PARTS.leftBoundary}innerPattern(){return $C}innerExtract(e,t){let n=t[HC].toLowerCase();if(t[0].length<=3&&!to.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index,t.index+t[0].length);s.start.imply("day",1);let i=to.MONTH_DICTIONARY[n];if(s.start.assign("month",i),t[c_]){let a=d_.parseYear(t[c_]);s.start.assign("year",a)}else{let a=GC.findYearClosestToRef(e.refDate,1,i);s.start.imply("year",a)}return s}};Kp.default=Vp});var m_=k(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var $u=rt(),zC=ds(),p_=jt(),Qp=class extends zC.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return p_.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${p_.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",$u.Meridiem.PM)):s<6&&n.assign("meridiem",$u.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",$u.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",$u.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Xp.default=Qp});var h_=k(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var Hu=jt(),VC=Be(),KC=H(),QC=fr(),XC=new RegExp(`(${Hu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Hu.REGEX_PARTS.flags),Zp=class extends KC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Hu.REGEX_PARTS.leftBoundary}innerPattern(){return XC}innerExtract(e,t){let n=Hu.parseTimeUnits(t[1]),s=QC.reverseTimeUnits(n);return VC.ParsingComponents.createRelativeFromReference(e.reference,s)}};Jp.default=Zp});var g_=k(ro=>{"use strict";var ZC=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0});var JC=ZC(Yr()),em=class extends JC.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};ro.default=em});var y_=k(no=>{"use strict";var eA=no&&no.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(no,"__esModule",{value:!0});var tA=eA(ln()),tm=class extends tA.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};no.default=tm});var b_=k(yn=>{"use strict";var rA=yn&&yn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nA=yn&&yn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),sA=yn&&yn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&rA(e,r,t);return nA(e,r),e};Object.defineProperty(yn,"__esModule",{value:!0});var iA=H(),so=sA(fn()),rm=jt(),aA=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${rm.REGEX_PARTS.rightBoundary}`,rm.REGEX_PARTS.flags),nm=class extends iA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return rm.REGEX_PARTS.leftBoundary}innerPattern(e){return aA}innerExtract(e,t){let n=t[1].toLowerCase(),s=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return so.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return so.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return so.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return so.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return so.theDayBefore(e.reference,2)}return s}};yn.default=nm});var T_=k(Cr=>{"use strict";var oA=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uA=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),lA=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&oA(e,r,t);return uA(e,r),e},cA=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var dA=H(),Ts=lA(fn()),fA=dr(),pA=cA(ve()),sm=jt(),mA=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${sm.REGEX_PARTS.rightBoundary}`,sm.REGEX_PARTS.flags),im=class extends dA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return sm.REGEX_PARTS.leftBoundary}innerPattern(){return mA}innerExtract(e,t){let n=pA.default(e.refDate),s=t[0].toLowerCase(),i=e.createParsingComponents();if(s==="\u0441\u0435\u0439\u0447\u0430\u0441")return Ts.now(e.reference);if(s==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||s==="\u0432\u0435\u0447\u0435\u0440\u0430")return Ts.evening(e.reference);if(s.endsWith("\u0443\u0442\u0440\u043E\u043C")||s.endsWith("\u0443\u0442\u0440\u0430"))return Ts.morning(e.reference);if(s.match(/в\s*полдень/))return Ts.noon(e.reference);if(s.match(/прошлой\s*ночью/))return Ts.lastNight(e.reference);if(s.match(/прошлым\s*вечером/))return Ts.yesterdayEvening(e.reference);if(s.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),fA.assignSimilarDate(i,n),i.imply("hour",0)}return s.match(/в\s*полночь/)||s.endsWith("\u043D\u043E\u0447\u044C\u044E")?Ts.midnight(e.reference):i}};Cr.default=im});var __=k(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var io=jt(),hA=xe(),gA=H(),yA=ps(),bA=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${hA.matchAnyPattern(io.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${io.REGEX_PARTS.rightBoundary}`,io.REGEX_PARTS.flags),TA=1,_A=2,vA=3,am=class extends gA.AbstractParserWithWordBoundaryChecking{innerPattern(){return bA}patternLeftBoundary(){return io.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[_A].toLowerCase(),s=io.WEEKDAY_DICTIONARY[n],i=t[TA],a=t[vA],o=i||a;o=o||"",o=o.toLowerCase();let u=null;o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?u="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?u="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(u="this");let l=yA.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};om.default=am});var w_=k(oo=>{"use strict";var wA=oo&&oo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oo,"__esModule",{value:!0});var ao=jt(),v_=Be(),kA=wA(ve()),EA=H(),SA=xe(),OA=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${SA.matchAnyPattern(ao.TIME_UNIT_DICTIONARY)})(?=\\s*)${ao.REGEX_PARTS.rightBoundary}`,ao.REGEX_PARTS.flags),DA=1,xA=2,um=class extends EA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ao.REGEX_PARTS.leftBoundary}innerPattern(){return OA}innerExtract(e,t){let n=t[DA].toLowerCase(),s=t[xA].toLowerCase(),i=ao.TIME_UNIT_DICTIONARY[s];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let u={};return u[i]=1,v_.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let u={};return u[i]=-1,v_.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=kA.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};oo.default=um});var k_=k(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var uo=jt(),RA=Be(),MA=H(),CA=fr(),AA=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${uo.TIME_UNITS_PATTERN})${uo.REGEX_PARTS.rightBoundary}`,uo.REGEX_PARTS.flags),lm=class extends MA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return uo.REGEX_PARTS.leftBoundary}innerPattern(){return AA}innerExtract(e,t){let n=t[1].toLowerCase(),s=uo.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":s=CA.reverseTimeUnits(s);break}return RA.ParsingComponents.createRelativeFromReference(e.reference,s)}};cm.default=lm});var O_=k(pt=>{"use strict";var Kt=pt&&pt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pt,"__esModule",{value:!0});pt.createConfiguration=pt.createCasualConfiguration=pt.parseDate=pt.parse=pt.strict=pt.casual=void 0;var PA=Kt(s_()),NA=Kt(l_()),IA=Kt(f_()),FA=Kt(m_()),LA=Kt(h_()),UA=Kt(g_()),WA=Kt(y_()),qA=cn(),jA=Kt(b_()),GA=Kt(T_()),YA=Kt(__()),BA=Kt(w_()),E_=Or(),$A=Kt(ms()),HA=Kt(k_());pt.casual=new E_.Chrono(S_());pt.strict=new E_.Chrono(dm(!0));function zA(r,e,t){return pt.casual.parse(r,e,t)}pt.parse=zA;function VA(r,e,t){return pt.casual.parseDate(r,e,t)}pt.parseDate=VA;function S_(){let r=dm(!1);return r.parsers.unshift(new jA.default),r.parsers.unshift(new GA.default),r.parsers.unshift(new IA.default),r.parsers.unshift(new BA.default),r.parsers.unshift(new HA.default),r}pt.createCasualConfiguration=S_;function dm(r=!0){return qA.includeCommonConfiguration({parsers:[new $A.default(!0),new PA.default,new NA.default,new YA.default,new FA.default(r),new LA.default],refiners:[new WA.default,new UA.default]},r)}pt.createConfiguration=dm});var rt=k(fe=>{"use strict";var KA=fe&&fe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),QA=fe&&fe.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),$n=fe&&fe.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&KA(e,r,t);return QA(e,r),e};Object.defineProperty(fe,"__esModule",{value:!0});fe.parseDate=fe.parse=fe.casual=fe.strict=fe.ru=fe.zh=fe.nl=fe.pt=fe.ja=fe.fr=fe.de=fe.Meridiem=fe.Chrono=fe.en=void 0;var fm=$n(xd());fe.en=fm;var XA=Or();Object.defineProperty(fe,"Chrono",{enumerable:!0,get:function(){return XA.Chrono}});var ZA;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(ZA=fe.Meridiem||(fe.Meridiem={}));var JA=$n(Iy());fe.de=JA;var eP=$n(cb());fe.fr=eP;var tP=$n(Tb());fe.ja=tP;var rP=$n(Ib());fe.pt=rP;var nP=$n(TT());fe.nl=nP;var sP=$n(JT());fe.zh=sP;var iP=$n(O_());fe.ru=iP;fe.strict=fm.strict;fe.casual=fm.casual;function aP(r,e,t){return fe.casual.parse(r,e,t)}fe.parse=aP;function oP(r,e,t){return fe.casual.parseDate(r,e,t)}fe.parseDate=oP});var kv=k((vv,wv)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(h){return Object.prototype.toString.call(h)==="[object Array]"},n=10,s=typeof process=="object"&&typeof process.nextTick=="function",i=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=i?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(d){var h=Object.getOwnPropertyNames(d);return h.push.apply(h,Object.getOwnPropertySymbols(d)),h}:Object.keys;function c(){this._events={},this._conf&&f.call(this,this._conf)}function f(d){d&&(this._conf=d,d.delimiter&&(this.delimiter=d.delimiter),d.maxListeners!==r&&(this._maxListeners=d.maxListeners),d.wildcard&&(this.wildcard=d.wildcard),d.newListener&&(this._newListener=d.newListener),d.removeListener&&(this._removeListener=d.removeListener),d.verboseMemoryLeak&&(this.verboseMemoryLeak=d.verboseMemoryLeak),d.ignoreErrors&&(this.ignoreErrors=d.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(d,h){var y="(node) warning: possible EventEmitter memory leak detected. "+d+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(y+=" Event name: "+h+"."),typeof process!="undefined"&&process.emitWarning){var T=new Error(y);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=d,process.emitWarning(T)}else console.error(y),console.trace&&console.trace()}var m=function(d,h,y){var T=arguments.length;switch(T){case 0:return[];case 1:return[d];case 2:return[d,h];case 3:return[d,h,y];default:for(var w=new Array(T);T--;)w[T]=arguments[T];return w}};function _(d,h){for(var y={},T,w=d.length,S=h?h.length:0,M=0;M<w;M++)T=d[M],y[T]=M<S?h[M]:r;return y}function g(d,h,y){this._emitter=d,this._target=h,this._listeners={},this._listenersCount=0;var T,w;if((y.on||y.off)&&(T=y.on,w=y.off),h.addEventListener?(T=h.addEventListener,w=h.removeEventListener):h.addListener?(T=h.addListener,w=h.removeListener):h.on&&(T=h.on,w=h.off),!T&&!w)throw Error("target does not implement any known event API");if(typeof T!="function")throw TypeError("on method must be a function");if(typeof w!="function")throw TypeError("off method must be a function");this._on=T,this._off=w;var S=d._observers;S?S.push(this):d._observers=[this]}Object.assign(g.prototype,{subscribe:function(d,h,y){var T=this,w=this._target,S=this._emitter,M=this._listeners,N=function(){var v=m.apply(null,arguments),x={data:v,name:h,original:d};if(y){var F=y.call(w,x);F!==!1&&S.emit.apply(S,[x.name].concat(v));return}S.emit.apply(S,[h].concat(v))};if(M[d])throw Error("Event '"+d+"' is already listening");this._listenersCount++,S._newListener&&S._removeListener&&!T._onNewListener?(this._onNewListener=function(v){v===h&&M[d]===null&&(M[d]=N,T._on.call(w,d,N))},S.on("newListener",this._onNewListener),this._onRemoveListener=function(v){v===h&&!S.hasListeners(v)&&M[d]&&(M[d]=null,T._off.call(w,d,N))},M[d]=null,S.on("removeListener",this._onRemoveListener)):(M[d]=N,T._on.call(w,d,N))},unsubscribe:function(d){var h=this,y=this._listeners,T=this._emitter,w,S,M=this._off,N=this._target,v;if(d&&typeof d!="string")throw TypeError("event must be a string");function x(){h._onNewListener&&(T.off("newListener",h._onNewListener),T.off("removeListener",h._onRemoveListener),h._onNewListener=null,h._onRemoveListener=null);var F=ne.call(T,h);T._observers.splice(F,1)}if(d){if(w=y[d],!w)return;M.call(N,d,w),delete y[d],--this._listenersCount||x()}else{for(S=l(y),v=S.length;v-- >0;)d=S[v],M.call(N,d,y[d]);this._listeners={},this._listenersCount=0,x()}}});function E(d,h,y,T){var w=Object.assign({},h);if(!d)return w;if(typeof d!="object")throw TypeError("options must be an object");var S=Object.keys(d),M=S.length,N,v,x;function F(ue){throw Error('Invalid "'+N+'" option value'+(ue?". Reason: "+ue:""))}for(var ce=0;ce<M;ce++){if(N=S[ce],!T&&!e.call(h,N))throw Error('Unknown "'+N+'" option');v=d[N],v!==r&&(x=y[N],w[N]=x?x(v,F):v)}return w}function C(d,h){return(typeof d!="function"||!d.hasOwnProperty("prototype"))&&h("value must be a constructor"),d}function R(d){var h="value must be type of "+d.join("|"),y=d.length,T=d[0],w=d[1];return y===1?function(S,M){if(typeof S===T)return S;M(h)}:y===2?function(S,M){var N=typeof S;if(N===T||N===w)return S;M(h)}:function(S,M){for(var N=typeof S,v=y;v-- >0;)if(N===d[v])return S;M(h)}}var b=R(["function"]),z=R(["object","function"]);function U(d,h,y){var T,w,S=0,M,N=new d(function(v,x,F){y=E(y,{timeout:0,overload:!1},{timeout:function(De,Ke){return De*=1,(typeof De!="number"||De<0||!Number.isFinite(De))&&Ke("timeout must be a positive number"),De}}),T=!y.overload&&typeof d.prototype.cancel=="function"&&typeof F=="function";function ce(){w&&(w=null),S&&(clearTimeout(S),S=0)}var ue=function(De){ce(),v(De)},de=function(De){ce(),x(De)};T?h(ue,de,F):(w=[function(De){de(De||Error("canceled"))}],h(ue,de,function(De){if(M)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof De!="function")throw TypeError("onCancel callback must be a function");w.push(De)}),M=!0),y.timeout>0&&(S=setTimeout(function(){var De=Error("timeout");De.code="ETIMEDOUT",S=0,N.cancel(De),x(De)},y.timeout))});return T||(N.cancel=function(v){if(!!w){for(var x=w.length,F=1;F<x;F++)w[F](v);w[0](v),w=null}}),N}function ne(d){var h=this._observers;if(!h)return-1;for(var y=h.length,T=0;T<y;T++)if(h[T]._target===d)return T;return-1}function G(d,h,y,T,w){if(!y)return null;if(T===0){var S=typeof h;if(S==="string"){var M,N,v=0,x=0,F=this.delimiter,ce=F.length;if((N=h.indexOf(F))!==-1){M=new Array(5);do M[v++]=h.slice(x,N),x=N+ce;while((N=h.indexOf(F,x))!==-1);M[v++]=h.slice(x),h=M,w=v}else h=[h],w=1}else S==="object"?w=h.length:(h=[h],w=1)}var ue=null,de,De,Ke,Ur,on,je=h[T],Wr=h[T+1],Ut,We;if(T===w)y._listeners&&(typeof y._listeners=="function"?(d&&d.push(y._listeners),ue=[y]):(d&&d.push.apply(d,y._listeners),ue=[y]));else if(je==="*"){for(Ut=l(y),N=Ut.length;N-- >0;)de=Ut[N],de!=="_listeners"&&(We=G(d,h,y[de],T+1,w),We&&(ue?ue.push.apply(ue,We):ue=We));return ue}else if(je==="**"){for(on=T+1===w||T+2===w&&Wr==="*",on&&y._listeners&&(ue=G(d,h,y,w,w)),Ut=l(y),N=Ut.length;N-- >0;)de=Ut[N],de!=="_listeners"&&(de==="*"||de==="**"?(y[de]._listeners&&!on&&(We=G(d,h,y[de],w,w),We&&(ue?ue.push.apply(ue,We):ue=We)),We=G(d,h,y[de],T,w)):de===Wr?We=G(d,h,y[de],T+2,w):We=G(d,h,y[de],T,w),We&&(ue?ue.push.apply(ue,We):ue=We));return ue}else y[je]&&(ue=G(d,h,y[je],T+1,w));if(De=y["*"],De&&G(d,h,De,T+1,w),Ke=y["**"],Ke)if(T<w)for(Ke._listeners&&G(d,h,Ke,w,w),Ut=l(Ke),N=Ut.length;N-- >0;)de=Ut[N],de!=="_listeners"&&(de===Wr?G(d,h,Ke[de],T+2,w):de===je?G(d,h,Ke[de],T+1,w):(Ur={},Ur[de]=Ke[de],G(d,h,{"**":Ur},T+1,w)));else Ke._listeners?G(d,h,Ke,w,w):Ke["*"]&&Ke["*"]._listeners&&G(d,h,Ke["*"],w,w);return ue}function Y(d,h,y){var T=0,w=0,S,M=this.delimiter,N=M.length,v;if(typeof d=="string")if((S=d.indexOf(M))!==-1){v=new Array(5);do v[T++]=d.slice(w,S),w=S+N;while((S=d.indexOf(M,w))!==-1);v[T++]=d.slice(w)}else v=[d],T=1;else v=d,T=d.length;if(T>1){for(S=0;S+1<T;S++)if(v[S]==="**"&&v[S+1]==="**")return}var x=this.listenerTree,F;for(S=0;S<T;S++)if(F=v[S],x=x[F]||(x[F]={}),S===T-1)return x._listeners?(typeof x._listeners=="function"&&(x._listeners=[x._listeners]),y?x._listeners.unshift(h):x._listeners.push(h),!x._listeners.warned&&this._maxListeners>0&&x._listeners.length>this._maxListeners&&(x._listeners.warned=!0,p.call(this,x._listeners.length,F))):x._listeners=h,!0;return!0}function te(d,h,y,T){for(var w=l(d),S=w.length,M,N,v,x=d._listeners,F;S-- >0;)N=w[S],M=d[N],N==="_listeners"?v=y:v=y?y.concat(N):[N],F=T||typeof N=="symbol",x&&h.push(F?v:v.join(this.delimiter)),typeof M=="object"&&te.call(this,M,h,v,F);return h}function _e(d){for(var h=l(d),y=h.length,T,w,S;y-- >0;)w=h[y],T=d[w],T&&(S=!0,w!=="_listeners"&&!_e(T)&&delete d[w]);return S}function W(d,h,y){this.emitter=d,this.event=h,this.listener=y}W.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function I(d,h,y){if(y===!0)w=!0;else if(y===!1)T=!0;else{if(!y||typeof y!="object")throw TypeError("options should be an object or true");var T=y.async,w=y.promisify,S=y.nextTick,M=y.objectify}if(T||S||w){var N=h,v=h._origin||h;if(S&&!s)throw Error("process.nextTick is not supported");w===r&&(w=h.constructor.name==="AsyncFunction"),h=function(){var x=arguments,F=this,ce=this.event;return w?S?Promise.resolve():new Promise(function(ue){u(ue)}).then(function(){return F.event=ce,N.apply(F,x)}):(S?process.nextTick:u)(function(){F.event=ce,N.apply(F,x)})},h._async=!0,h._origin=v}return[h,M?new W(this,d,h):this]}function O(d){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,d)}O.EventEmitter2=O,O.prototype.listenTo=function(d,h,y){if(typeof d!="object")throw TypeError("target musts be an object");var T=this;y=E(y,{on:r,off:r,reducers:r},{on:b,off:b,reducers:z});function w(S){if(typeof S!="object")throw TypeError("events must be an object");var M=y.reducers,N=ne.call(T,d),v;N===-1?v=new g(T,d,y):v=T._observers[N];for(var x=l(S),F=x.length,ce,ue=typeof M=="function",de=0;de<F;de++)ce=x[de],v.subscribe(ce,S[ce]||ce,ue?M:M&&M[ce])}return t(h)?w(_(h)):w(typeof h=="string"?_(h.split(/\s+/)):h),this},O.prototype.stopListeningTo=function(d,h){var y=this._observers;if(!y)return!1;var T=y.length,w,S=!1;if(d&&typeof d!="object")throw TypeError("target should be an object");for(;T-- >0;)w=y[T],(!d||w._target===d)&&(w.unsubscribe(h),S=!0);return S},O.prototype.delimiter=".",O.prototype.setMaxListeners=function(d){d!==r&&(this._maxListeners=d,this._conf||(this._conf={}),this._conf.maxListeners=d)},O.prototype.getMaxListeners=function(){return this._maxListeners},O.prototype.event="",O.prototype.once=function(d,h,y){return this._once(d,h,!1,y)},O.prototype.prependOnceListener=function(d,h,y){return this._once(d,h,!0,y)},O.prototype._once=function(d,h,y,T){return this._many(d,1,h,y,T)},O.prototype.many=function(d,h,y,T){return this._many(d,h,y,!1,T)},O.prototype.prependMany=function(d,h,y,T){return this._many(d,h,y,!0,T)},O.prototype._many=function(d,h,y,T,w){var S=this;if(typeof y!="function")throw new Error("many only accepts instances of Function");function M(){return--h===0&&S.off(d,M),y.apply(this,arguments)}return M._origin=y,this._on(d,M,T,w)},O.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var d=arguments[0],h,y=this.wildcard,T,w,S,M,N;if(d==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(y&&(h=d,d!=="newListener"&&d!=="removeListener"&&typeof d=="object")){if(w=d.length,i){for(S=0;S<w;S++)if(typeof d[S]=="symbol"){N=!0;break}}N||(d=d.join(this.delimiter))}var v=arguments.length,x;if(this._all&&this._all.length)for(x=this._all.slice(),S=0,w=x.length;S<w;S++)switch(this.event=d,v){case 1:x[S].call(this,d);break;case 2:x[S].call(this,d,arguments[1]);break;case 3:x[S].call(this,d,arguments[1],arguments[2]);break;default:x[S].apply(this,arguments)}if(y)x=[],G.call(this,x,h,this.listenerTree,0,w);else if(x=this._events[d],typeof x=="function"){switch(this.event=d,v){case 1:x.call(this);break;case 2:x.call(this,arguments[1]);break;case 3:x.call(this,arguments[1],arguments[2]);break;default:for(T=new Array(v-1),M=1;M<v;M++)T[M-1]=arguments[M];x.apply(this,T)}return!0}else x&&(x=x.slice());if(x&&x.length){if(v>3)for(T=new Array(v-1),M=1;M<v;M++)T[M-1]=arguments[M];for(S=0,w=x.length;S<w;S++)switch(this.event=d,v){case 1:x[S].call(this);break;case 2:x[S].call(this,arguments[1]);break;case 3:x[S].call(this,arguments[1],arguments[2]);break;default:x[S].apply(this,T)}return!0}else if(!this.ignoreErrors&&!this._all&&d==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},O.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var d=arguments[0],h=this.wildcard,y,T,w,S,M,N;if(d==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(h&&(y=d,d!=="newListener"&&d!=="removeListener"&&typeof d=="object")){if(S=d.length,i){for(M=0;M<S;M++)if(typeof d[M]=="symbol"){T=!0;break}}T||(d=d.join(this.delimiter))}var v=[],x=arguments.length,F;if(this._all)for(M=0,S=this._all.length;M<S;M++)switch(this.event=d,x){case 1:v.push(this._all[M].call(this,d));break;case 2:v.push(this._all[M].call(this,d,arguments[1]));break;case 3:v.push(this._all[M].call(this,d,arguments[1],arguments[2]));break;default:v.push(this._all[M].apply(this,arguments))}if(h?(F=[],G.call(this,F,y,this.listenerTree,0)):F=this._events[d],typeof F=="function")switch(this.event=d,x){case 1:v.push(F.call(this));break;case 2:v.push(F.call(this,arguments[1]));break;case 3:v.push(F.call(this,arguments[1],arguments[2]));break;default:for(w=new Array(x-1),N=1;N<x;N++)w[N-1]=arguments[N];v.push(F.apply(this,w))}else if(F&&F.length){if(F=F.slice(),x>3)for(w=new Array(x-1),N=1;N<x;N++)w[N-1]=arguments[N];for(M=0,S=F.length;M<S;M++)switch(this.event=d,x){case 1:v.push(F[M].call(this));break;case 2:v.push(F[M].call(this,arguments[1]));break;case 3:v.push(F[M].call(this,arguments[1],arguments[2]));break;default:v.push(F[M].apply(this,w))}}else if(!this.ignoreErrors&&!this._all&&d==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(v)},O.prototype.on=function(d,h,y){return this._on(d,h,!1,y)},O.prototype.prependListener=function(d,h,y){return this._on(d,h,!0,y)},O.prototype.onAny=function(d){return this._onAny(d,!1)},O.prototype.prependAny=function(d){return this._onAny(d,!0)},O.prototype.addListener=O.prototype.on,O.prototype._onAny=function(d,h){if(typeof d!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),h?this._all.unshift(d):this._all.push(d),this},O.prototype._on=function(d,h,y,T){if(typeof d=="function")return this._onAny(d,h),this;if(typeof h!="function")throw new Error("on only accepts instances of Function");this._events||c.call(this);var w=this,S;return T!==r&&(S=I.call(this,d,h,T),h=S[0],w=S[1]),this._newListener&&this.emit("newListener",d,h),this.wildcard?(Y.call(this,d,h,y),w):(this._events[d]?(typeof this._events[d]=="function"&&(this._events[d]=[this._events[d]]),y?this._events[d].unshift(h):this._events[d].push(h),!this._events[d].warned&&this._maxListeners>0&&this._events[d].length>this._maxListeners&&(this._events[d].warned=!0,p.call(this,this._events[d].length,d))):this._events[d]=h,w)},O.prototype.off=function(d,h){if(typeof h!="function")throw new Error("removeListener only takes instances of Function");var y,T=[];if(this.wildcard){var w=typeof d=="string"?d.split(this.delimiter):d.slice();if(T=G.call(this,null,w,this.listenerTree,0),!T)return this}else{if(!this._events[d])return this;y=this._events[d],T.push({_listeners:y})}for(var S=0;S<T.length;S++){var M=T[S];if(y=M._listeners,t(y)){for(var N=-1,v=0,x=y.length;v<x;v++)if(y[v]===h||y[v].listener&&y[v].listener===h||y[v]._origin&&y[v]._origin===h){N=v;break}if(N<0)continue;return this.wildcard?M._listeners.splice(N,1):this._events[d].splice(N,1),y.length===0&&(this.wildcard?delete M._listeners:delete this._events[d]),this._removeListener&&this.emit("removeListener",d,h),this}else(y===h||y.listener&&y.listener===h||y._origin&&y._origin===h)&&(this.wildcard?delete M._listeners:delete this._events[d],this._removeListener&&this.emit("removeListener",d,h))}return this.listenerTree&&_e(this.listenerTree),this},O.prototype.offAny=function(d){var h=0,y=0,T;if(d&&this._all&&this._all.length>0){for(T=this._all,h=0,y=T.length;h<y;h++)if(d===T[h])return T.splice(h,1),this._removeListener&&this.emit("removeListenerAny",d),this}else{if(T=this._all,this._removeListener)for(h=0,y=T.length;h<y;h++)this.emit("removeListenerAny",T[h]);this._all=[]}return this},O.prototype.removeListener=O.prototype.off,O.prototype.removeAllListeners=function(d){if(d===r)return!this._events||c.call(this),this;if(this.wildcard){var h=G.call(this,null,d,this.listenerTree,0),y,T;if(!h)return this;for(T=0;T<h.length;T++)y=h[T],y._listeners=null;this.listenerTree&&_e(this.listenerTree)}else this._events&&(this._events[d]=null);return this},O.prototype.listeners=function(d){var h=this._events,y,T,w,S,M;if(d===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!h)return[];for(y=l(h),S=y.length,w=[];S-- >0;)T=h[y[S]],typeof T=="function"?w.push(T):w.push.apply(w,T);return w}else{if(this.wildcard){if(M=this.listenerTree,!M)return[];var N=[],v=typeof d=="string"?d.split(this.delimiter):d.slice();return G.call(this,N,v,M,0),N}return h?(T=h[d],T?typeof T=="function"?[T]:T:[]):[]}},O.prototype.eventNames=function(d){var h=this._events;return this.wildcard?te.call(this,this.listenerTree,[],null,d):h?l(h):[]},O.prototype.listenerCount=function(d){return this.listeners(d).length},O.prototype.hasListeners=function(d){if(this.wildcard){var h=[],y=typeof d=="string"?d.split(this.delimiter):d.slice();return G.call(this,h,y,this.listenerTree,0),h.length>0}var T=this._events,w=this._all;return!!(w&&w.length||T&&(d===r?l(T).length:T[d]))},O.prototype.listenersAny=function(){return this._all?this._all:[]},O.prototype.waitFor=function(d,h){var y=this,T=typeof h;return T==="number"?h={timeout:h}:T==="function"&&(h={filter:h}),h=E(h,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:b,Promise:C}),U(h.Promise,function(w,S,M){function N(){var v=h.filter;if(!(v&&!v.apply(y,arguments)))if(y.off(d,N),h.handleError){var x=arguments[0];x?S(x):w(m.apply(null,arguments).slice(1))}else w(m.apply(null,arguments))}M(function(){y.off(d,N)}),y._on(d,N,!1)},{timeout:h.timeout,overload:h.overload})};function $(d,h,y){y=E(y,{Promise,timeout:0,overload:!1},{Promise:C});var T=y.Promise;return U(T,function(w,S,M){var N;if(typeof d.addEventListener=="function"){N=function(){w(m.apply(null,arguments))},M(function(){d.removeEventListener(h,N)}),d.addEventListener(h,N,{once:!0});return}var v=function(){x&&d.removeListener("error",x),w(m.apply(null,arguments))},x;h!=="error"&&(x=function(F){d.removeListener(h,v),S(F)},d.once("error",x)),M(function(){x&&d.removeListener("error",x),d.removeListener(h,v)}),d.once(h,v)},{timeout:y.timeout,overload:y.overload})}var P=O.prototype;if(Object.defineProperties(O,{defaultMaxListeners:{get:function(){return P._maxListeners},set:function(d){if(typeof d!="number"||d<0||Number.isNaN(d))throw TypeError("n must be a non-negative number");P._maxListeners=d},enumerable:!0},once:{value:$,writable:!0,configurable:!0}}),Object.defineProperties(P,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return O});else if(typeof vv=="object")wv.exports=O;else{var Q=new Function("","return this")();Q.EventEmitter2=O}})()});var Cw=k(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var Rw=Symbol("MustacheDataPath");function xw({target:r,propertyName:e}){return[...r[Rw]||[],e]}function Mw(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let s=t[n];if(s===void 0&&!(n in t)){let i=xw({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(i),s;throw Error(`Missing Mustache data property: ${i.join(" > ")}`)}return s&&typeof s=="object"?(s[Rw]=xw({target:t,propertyName:n}),Mw(s,e)):s}})}ah.default=Mw});var rn=k(Ir=>{"use strict";Ir.__esModule=!0;Ir.Tokens=Ir.StructuralCharacters=Ir.Operators=void 0;var pI;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(pI=Ir.Operators||(Ir.Operators={}));var mI;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(mI=Ir.StructuralCharacters||(Ir.StructuralCharacters={}));var hI;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(hI=Ir.Tokens||(Ir.Tokens={}))});var ph=k(Yi=>{"use strict";Yi.__esModule=!0;Yi.VALID_TOKENS=Yi.OPERATOR_PRECEDENCE=void 0;var $e=rn();Yi.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Yi.VALID_TOKENS={identifierOnly:[{name:$e.Tokens.IDENTIFIER},{name:$e.Tokens.STRUCTURAL_CHARACTER,value:$e.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:$e.Tokens.IDENTIFIER},{name:$e.Tokens.STRUCTURAL_CHARACTER,value:$e.StructuralCharacters.OPEN_PARENTHESIS},{name:$e.Tokens.OPERATOR,value:$e.Operators.NOT}],binaryOperator:[{name:$e.Tokens.OPERATOR,value:$e.Operators.AND},{name:$e.Tokens.OPERATOR,value:$e.Operators.OR},{name:$e.Tokens.OPERATOR,value:$e.Operators.XOR}],binaryOperatorOrClose:[{name:$e.Tokens.OPERATOR,value:$e.Operators.AND},{name:$e.Tokens.OPERATOR,value:$e.Operators.OR},{name:$e.Tokens.OPERATOR,value:$e.Operators.XOR},{name:$e.Tokens.STRUCTURAL_CHARACTER,value:$e.StructuralCharacters.CLOSE_PARENTHESIS}]}});var mh=k(Rt=>{"use strict";Rt.__esModule=!0;Rt.ESCAPE_CHARACTER=Rt.EOL=Rt.COMMENT_DELIMITER=Rt.QUOTED_IDENTIFIER_DELIMITER=Rt.SEPARATORS=Rt.OPERATORS=Rt.STRUCTURAL_CHARACTERS=void 0;var Bi=rn();Rt.STRUCTURAL_CHARACTERS={"(":Bi.StructuralCharacters.OPEN_PARENTHESIS,")":Bi.StructuralCharacters.CLOSE_PARENTHESIS};Rt.OPERATORS={AND:Bi.Operators.AND,OR:Bi.Operators.OR,XOR:Bi.Operators.XOR,NOT:Bi.Operators.NOT};Rt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));Rt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);Rt.COMMENT_DELIMITER=String.fromCodePoint(35);Rt.EOL=String.fromCodePoint(10);Rt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var Lw=k(kr=>{"use strict";var hh=kr&&kr.__assign||function(){return hh=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},hh.apply(this,arguments)};kr.__esModule=!0;kr.getQuotedIdentifier=kr.getComment=kr.createResult=void 0;var Fw=rn(),Ws=mh(),gI=function(r,e,t){return{token:hh({name:r},e!==null?{value:e}:{}),remainingString:t}};kr.createResult=gI;var yI=function(r){for(var e=r.length,t=0;t<r.length;t+=1){var n=r[t];if(n===Ws.EOL){e=t;break}}return(0,kr.createResult)(Fw.Tokens.COMMENT,r.slice(0,e),r.slice(e+1))};kr.getComment=yI;var bI=function(r){for(var e=!1,t="",n=null,s=0;s<r.length;s+=1){var i=r[s];if(n===null)i===Ws.QUOTED_IDENTIFIER_DELIMITER?e?t=t.slice(-1)+Ws.QUOTED_IDENTIFIER_DELIMITER:n=s:(i===Ws.ESCAPE_CHARACTER?e=!0:e=!1,t=t+=i);else{if(!Ws.SEPARATORS.has(i)&&!Ws.STRUCTURAL_CHARACTERS[i])throw new Error("Unexpected character: ".concat(i," Expected ) character or separator"));break}}if(n===null)throw new Error("Unexpected end of expression: expected ".concat(Ws.QUOTED_IDENTIFIER_DELIMITER," character"));return(0,kr.createResult)(Fw.Tokens.IDENTIFIER,t,r.slice(n+1))};kr.getQuotedIdentifier=bI});var Uw=k(ql=>{"use strict";ql.__esModule=!0;ql.lex=void 0;var $i=rn(),nr=mh(),Hi=Lw(),TI=function(r){for(var e=null,t=null,n=null,s=0;s<r.length;s+=1){var i=r[s];if(e===null){if(!nr.SEPARATORS.has(i)){var a=nr.STRUCTURAL_CHARACTERS[i];if(a){var o=r[s+1];if(a===$i.StructuralCharacters.CLOSE_PARENTHESIS&&o&&!nr.SEPARATORS.has(o)&&o!==$i.StructuralCharacters.CLOSE_PARENTHESIS)throw new Error("Unexpected character: ".concat(o,". A closing parenthesis should be followed by another closing parenthesis or whitespace"));return(0,Hi.createResult)($i.Tokens.STRUCTURAL_CHARACTER,nr.STRUCTURAL_CHARACTERS[i],r.slice(s+1))}if(i===nr.QUOTED_IDENTIFIER_DELIMITER)return(0,Hi.getQuotedIdentifier)(r.slice(s+1));if(i===nr.COMMENT_DELIMITER)return(0,Hi.getComment)(r.slice(s+1));e=s}}else if(nr.SEPARATORS.has(i)||nr.STRUCTURAL_CHARACTERS[i]){t=s,n=i;break}else if(i===nr.QUOTED_IDENTIFIER_DELIMITER||i===nr.COMMENT_DELIMITER)throw new Error("Unexpected character: ".concat(i))}if(e!==null){t=t!=null?t:r.length;var u=r.slice(e,t),l=r.slice(t);if(nr.OPERATORS[u]){if(n&&!nr.SEPARATORS.has(n))throw new Error("Unexpected character: ".concat(n,". Operators should be separated using whitespace"));return(0,Hi.createResult)($i.Tokens.OPERATOR,nr.OPERATORS[u],l)}else return(0,Hi.createResult)($i.Tokens.IDENTIFIER,u,l)}return(0,Hi.createResult)($i.Tokens.EOF,null,"")};ql.lex=TI});var qw=k(sr=>{"use strict";var Ww=sr&&sr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))};sr.__esModule=!0;sr.validateToken=sr.previousOperatorTakesPrecedent=sr.getValue=sr.newTokenGenerator=void 0;var _I=Uw(),zi=rn(),jl=ph(),vI=function(r){var e=r;return function(t,n){for(n===void 0&&(n=!1);;){var s=(0,_I.lex)(e),i=s.token,a=s.remainingString;if(e=a,i.name!==zi.Tokens.COMMENT)return(0,sr.validateToken)(i,t,n),i}}};sr.newTokenGenerator=vI;var wI=function(r,e){var t=r(jl.VALID_TOKENS.identifierOrNot),n=t.value===zi.Operators.NOT;n&&(t=r(jl.VALID_TOKENS.identifierOnly));var s=t.name===zi.Tokens.STRUCTURAL_CHARACTER?e(r,!0):[t];return n?Ww(Ww([],s,!0),[{name:zi.Tokens.OPERATOR,value:zi.Operators.NOT}],!1):s};sr.getValue=wI;var kI=function(r,e){return jl.OPERATOR_PRECEDENCE[r]<=jl.OPERATOR_PRECEDENCE[e]};sr.previousOperatorTakesPrecedent=kI;var EI=function(r,e,t){if(t===void 0&&(t=!1),r.name===zi.Tokens.EOF){if(t)return;throw new Error("Unexpected end of expression")}for(var n=0,s=e;n<s.length;n++){var i=s[n];if(i.name===r.name&&(!i.value||i.value===r.value))return}throw new TypeError("Invalid token")};sr.validateToken=EI});var yh=k(Vi=>{"use strict";var nn=Vi&&Vi.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))};Vi.__esModule=!0;Vi.parse=void 0;var jw=rn(),Gw=ph(),Gl=qw(),SI=function(r){if(typeof r!="string")throw new Error("Expected string but received ".concat(typeof r));var e=(0,Gl.newTokenGenerator)(r);return gh(e)};Vi.parse=SI;var gh=function(r,e){e===void 0&&(e=!1);for(var t=nn([],(0,Gl.getValue)(r,gh),!0),n=[];;){var s=e?Gw.VALID_TOKENS.binaryOperatorOrClose:Gw.VALID_TOKENS.binaryOperator,i=r(s,!e);if(i.name===jw.Tokens.EOF||i.name===jw.Tokens.STRUCTURAL_CHARACTER)return nn(nn([],t,!0),nn([],n,!0).reverse(),!0);for(;n.length;){var a=n[n.length-1]||null;if(a&&(0,Gl.previousOperatorTakesPrecedent)(a.value,i.value))t=nn(nn([],t,!0),[a],!1),n=n.slice(0,-1);else break}n=nn(nn([],n,!0),[i],!1),t=nn(nn([],t,!0),(0,Gl.getValue)(r,gh),!0)}}});var bh=k(Mt=>{"use strict";Mt.__esModule=!0;Mt.throwInvalidExpression=Mt.isOperator=Mt.isIdentifier=Mt.notUtil=Mt.xorUtil=Mt.orUtil=Mt.andUtil=void 0;var Yw=rn(),OI=function(r,e){return r&&e};Mt.andUtil=OI;var DI=function(r,e){return r||e};Mt.orUtil=DI;var xI=function(r,e){return r!==e};Mt.xorUtil=xI;var RI=function(r){return!r};Mt.notUtil=RI;var MI=function(r){var e=r.name,t=r.value;return e===Yw.Tokens.IDENTIFIER&&typeof t=="string"};Mt.isIdentifier=MI;var CI=function(r){var e=r.name,t=r.value;return e===Yw.Tokens.OPERATOR&&typeof t=="string"};Mt.isOperator=CI;var AI=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};Mt.throwInvalidExpression=AI});var Bw=k(Yl=>{"use strict";var Lo;Yl.__esModule=!0;Yl.OPERATOR_MAP=void 0;var Th=rn(),_h=bh();Yl.OPERATOR_MAP=(Lo={},Lo[Th.Operators.AND]=_h.andUtil,Lo[Th.Operators.OR]=_h.orUtil,Lo[Th.Operators.XOR]=_h.xorUtil,Lo)});var Hw=k(An=>{"use strict";var Ki=An&&An.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))};An.__esModule=!0;An.evaluate=An.getEvaluator=void 0;var PI=yh(),$w=rn(),NI=Bw(),qs=bh(),II=function(r){var e=(0,PI.parse)(r);return function(t){return(0,An.evaluate)(e,t)}};An.getEvaluator=II;var FI=function(r,e){if(!Array.isArray(r))throw new Error("".concat(r," should be an array. evaluate takes in a parsed expression. Use in combination with parse or use getEvaluator"));var t=r.reduce(function(n,s,i){if(!(s&&((0,qs.isIdentifier)(s)||(0,qs.isOperator)(s))))throw new Error("Invalid token: ".concat(s,". Found in parsed expression at index ").concat(i));if(s.name===$w.Tokens.IDENTIFIER)return Ki(Ki([],n,!0),[Boolean(e[s.value])],!1);var a=n[n.length-2],o=n[n.length-1];if(s.value===$w.Operators.NOT)return o===void 0&&(0,qs.throwInvalidExpression)("missing identifier"),Ki(Ki([],n.slice(0,-1),!0),[(0,qs.notUtil)(o)],!1);(o===void 0||a===void 0)&&(0,qs.throwInvalidExpression)("missing identifier");var u=NI.OPERATOR_MAP[s.value];return u||(0,qs.throwInvalidExpression)("unknown operator"),Ki(Ki([],n.slice(0,-2),!0),[u(a,o)],!1)},[]);return t.length!==1&&(0,qs.throwInvalidExpression)("too many identifiers after evaluation"),t[0]};An.evaluate=FI});var Vw=k(sn=>{"use strict";var vh=sn&&sn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});sn.__esModule=!0;sn.parse=sn.evaluate=sn.getEvaluator=void 0;var zw=Hw();vh(sn,zw,"getEvaluator");vh(sn,zw,"evaluate");var LI=yh();vh(sn,LI,"parse")});var eF={};qk(eF,{default:()=>Tc});module.exports=jk(eF);var Pk=require("obsidian");var ki=require("obsidian");var rF=new Error("timeout while waiting for mutex to become available"),nF=new Error("mutex already locked"),Gk=new Error("request for lock canceled"),Yk=function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?i(c.value):s(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},wc=class{constructor(e,t=Gk){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return Yk(this,void 0,void 0,function*(){let[n,s]=yield this.acquire(t);try{return yield e(n)}finally{s()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let s=this._value,i=t;this._value-=t,t=this._value+1,n.resolve([s,this._newReleaser(i)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},Bk=function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?i(c.value):s(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},tu=class{constructor(e){this._semaphore=new wc(1,e)}acquire(){return Bk(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var zu=ua(rt());var Nt=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new Nt(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new Nt(window.moment.invalid(),window.moment.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=window.moment.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=window.moment.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var Qt=class{static parseDate(e,t=!1){return window.moment(zu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Qt.parseRelativeDateRange,Qt.parseNumberedDateRange,Qt.parseAbsoluteDateRange];for(let s of n){let i=s(e,t);if(i.isValid())return i}return Nt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=zu.parse(e,void 0,{forwardDate:t});if(n.length===0)return Nt.buildInvalid();let s=n[0].start,i=n[1]&&n[1].start?n[1].start:s,a=window.moment(s.date()),o=window.moment(i.date());return new Nt(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,s=e.match(n);if(s&&s.length===3){let i=s[1],a=s[2],o=Nt.buildRelative(a);switch(i){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return Nt.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[s,i,a]of n){let o=e.match(s);if(o){let u=o[0].trim();return new Nt(window.moment(u,i).startOf(a),window.moment(u,i).endOf(a))}}return Nt.buildInvalid()}};var uP={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function bn(r){for(let[e,t]of Object.entries(uP))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Vu=["MO","TU","WE","TH","FR","SA","SU"],Je=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Vu.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Vu[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var Ne=function(r){return r!=null},Xt=function(r){return typeof r=="number"},pm=function(r){return typeof r=="string"&&Vu.includes(r)},Tt=Array.isArray,br=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n<e;n++)t.push(n);return t};var he=function(r,e){var t=0,n=[];if(Tt(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},D_=function(r){return Tt(r)?r:[r]};function _s(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=he(t,e/t.length)),t.slice(0,e)+String(n))}var x_=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Et=function(r,e){var t=r%e;return t*e<0?t+e:t},Ku=function(r,e){return{div:Math.floor(r/e),mod:Et(r,e)}},Zt=function(r){return!Ne(r)||r.length===0},He=function(r){return!Zt(r)},ge=function(r,e){return He(r)&&r.indexOf(e)!==-1};var Hr=function(r,e,t,n,s,i){return n===void 0&&(n=0),s===void 0&&(s=0),i===void 0&&(i=0),new Date(Date.UTC(r,e-1,t,n,s,i))},lP=[31,28,31,30,31,30,31,31,30,31,30,31],C_=1e3*60*60*24,Qu=9999,A_=Hr(1970,1,1),cP=[6,0,1,2,3,4,5];var hi=function(r){return r%4===0&&r%100!==0||r%400===0},mm=function(r){return r instanceof Date},vs=function(r){return mm(r)&&!isNaN(r.getTime())},R_=function(r){return r.getTimezoneOffset()*60*1e3},dP=function(r,e){var t=r.getTime()-R_(r),n=e.getTime()-R_(e),s=t-n;return Math.round(s/C_)},lo=function(r){return dP(r,A_)},Xu=function(r){return new Date(A_.getTime()+r*C_)},fP=function(r){var e=r.getUTCMonth();return e===1&&hi(r.getUTCFullYear())?29:lP[e]},Tn=function(r){return cP[r.getUTCDay()]},hm=function(r,e){var t=Hr(r,e+1,1);return[Tn(t),fP(t)]},Zu=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Ju=function(r){var e=new Date(r.getTime());return e},gm=function(r){for(var e=[],t=0;t<r.length;t++)e.push(Ju(r[t]));return e},_n=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},gi=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[_s(t.getUTCFullYear().toString(),4,"0"),_s(t.getUTCMonth()+1,2,"0"),_s(t.getUTCDate(),2,"0"),"T",_s(t.getUTCHours(),2,"0"),_s(t.getUTCMinutes(),2,"0"),_s(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},co=function(r){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,t=e.exec(r);if(!t)throw new Error("Invalid UNTIL value: ".concat(r));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},M_=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},P_=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(M_(r,t)),s=new Date(M_(r,e!=null?e:"UTC")),i=s.getTime()-n.getTime();return new Date(r.getTime()-i)};var pP=function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),vn=pP;var ym=function(r,e){return ym=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},ym(r,e)};function yi(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ym(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var _t=function(){return _t=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},_t.apply(this,arguments)};function q(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}var mP=function(r){yi(e,r);function e(t,n,s){var i=r.call(this,t,n)||this;return i.iterator=s,i}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(vn),bm=mP;var hP={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},ws=hP;var N_=function(r,e){return r.indexOf(e)!==-1},gP=function(r){return r.toString()},yP=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},bP=function(){function r(e,t,n,s){if(t===void 0&&(t=gP),n===void 0&&(n=ws),s===void 0&&(s=yP),this.text=[],this.language=n||ws,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);i.sort(function(c,f){return c-f}),a.sort(function(c,f){return f-c}),this.bymonthday=i.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Ne(this.origOptions.byweekday)){var o=Tt(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],u=String(o);this.byweekday={allWeeks:o.filter(function(c){return!c.n}),someWeeks:o.filter(function(c){return Boolean(c.n)}),isWeekdays:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")===-1&&u.indexOf("SU")===-1,isEveryDay:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")!==-1&&u.indexOf("SU")!==-1};var l=function(c,f){return c.weekday-f.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(N_(["dtstart","wkst","freq"],n))return!0;if(!N_(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[V.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=Xt(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,s){var i=this;s===void 0&&(s=","),Tt(e)||(e=[e]);var a=function(u,l,c){for(var f="",p=0;p<u.length;p++)p!==0&&(p===u.length-1?f+=" "+c+" ":f+=l+" "),f+=u[p];return f};t=t||function(u){return u.toString()};var o=function(u){return t&&t.call(i,u)};return n?a(e.map(o),s,n):e.map(o).join(s+" ")},r}(),zr=bP;var TP=function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var s in this.rules){n=this.rules[s];var i=n.exec(this.text);i&&(e===null||i[0].length>e[0].length)&&(e=i,t=s)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function fo(r,e){e===void 0&&(e=ws);var t={},n=new TP(e.tokens);if(!n.start(r))return null;return s(),t;function s(){n.expect("every");var p=n.acceptNumber();if(p&&(t.interval=parseInt(p[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=V.DAILY,n.nextSymbol()&&(a(),f());break;case"weekday(s)":t.freq=V.WEEKLY,t.byweekday=[V.MO,V.TU,V.WE,V.TH,V.FR],n.nextSymbol(),f();break;case"week(s)":t.freq=V.WEEKLY,n.nextSymbol()&&(i(),f());break;case"hour(s)":t.freq=V.HOURLY,n.nextSymbol()&&(i(),f());break;case"minute(s)":t.freq=V.MINUTELY,n.nextSymbol()&&(i(),f());break;case"month(s)":t.freq=V.MONTHLY,n.nextSymbol()&&(i(),f());break;case"year(s)":t.freq=V.YEARLY,n.nextSymbol()&&(i(),f());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=V.WEEKLY;var m=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[V[m]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var _=u();if(!_)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(V[_]),n.nextSymbol()}c(),f();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=V.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var g=o();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(g),n.nextSymbol()}i(),f();break;default:throw new Error("Unknown symbol")}}function i(){var p=n.accept("on"),m=n.accept("the");if(!!(p||m))do{var _=l(),g=u(),E=o();if(_)g?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(V[g].nth(_))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(_),n.accept("day(s)"));else if(g)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(V[g]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[V.MO,V.TU,V.WE,V.TH,V.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var C=n.acceptNumber();if(!C)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(C[0],10)];n.accept("comma");){if(C=n.acceptNumber(),!C)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(C[0],10))}}else if(E)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(E);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var p=n.accept("at");if(!!p)do{var m=n.acceptNumber();if(!m)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(m[0],10)];n.accept("comma");){if(m=n.acceptNumber(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(m[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var p=parseInt(n.value[1],10);if(p<-366||p>366)throw new Error("Nth out of range: "+p);return n.nextSymbol(),n.accept("last")?-p:p;default:return!1}}function c(){n.accept("on"),n.accept("the");var p=l();if(!!p)for(t.bymonthday=[p],n.nextSymbol();n.accept("comma");){if(p=l(),!p)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(p),n.nextSymbol()}}function f(){if(n.symbol==="until"){var p=Date.parse(n.text);if(!p)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(p)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var pe;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(pe||(pe={}));function po(r){return r<pe.HOURLY}var I_=function(r,e){return e===void 0&&(e=ws),new V(fo(r,e)||void 0)},bi=["count","until","interval","byweekday","bymonthday","bymonth"];zr.IMPLEMENTED=[];zr.IMPLEMENTED[pe.HOURLY]=bi;zr.IMPLEMENTED[pe.MINUTELY]=bi;zr.IMPLEMENTED[pe.DAILY]=["byhour"].concat(bi);zr.IMPLEMENTED[pe.WEEKLY]=bi;zr.IMPLEMENTED[pe.MONTHLY]=bi;zr.IMPLEMENTED[pe.YEARLY]=["byweekno","byyearday"].concat(bi);var F_=function(r,e,t,n){return new zr(r,e,t,n).toString()},L_=zr.isFullyConvertible;var Ti=function(){function r(e,t,n,s){this.hour=e,this.minute=t,this.second=n,this.millisecond=s||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r}();var U_=function(r){yi(e,r);function e(t,n,s,i,a,o,u){var l=r.call(this,i,a,o,u)||this;return l.year=t,l.month=n,l.day=s,l}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return Tn(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),s=Et(this.month,12);this.month=s,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var i=Ku(this.hour,24),a=i.div,o=i.mod;if(a&&(this.hour=o,this.addDaily(a)),Zt(s)||ge(s,this.hour))break}},e.prototype.addMinutes=function(t,n,s,i){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=Ku(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,s)),(Zt(s)||ge(s,this.hour))&&(Zt(i)||ge(i,this.minute)))break}},e.prototype.addSeconds=function(t,n,s,i,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=Ku(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,s,i)),(Zt(s)||ge(s,this.hour))&&(Zt(i)||ge(i,this.minute))&&(Zt(a)||ge(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=hm(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Qu))return;t=hm(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var s=t.freq,i=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(s){case pe.YEARLY:return this.addYears(i);case pe.MONTHLY:return this.addMonths(i);case pe.WEEKLY:return this.addWeekly(i,a);case pe.DAILY:return this.addDaily(i);case pe.HOURLY:return this.addHours(i,n,o);case pe.MINUTELY:return this.addMinutes(i,n,o,u);case pe.SECONDLY:return this.addSeconds(i,n,o,u,l)}},e}(Ti);function Tm(r){for(var e=[],t=Object.keys(r),n=0,s=t;n<s.length;n++){var i=s[n];ge(j_,i)||e.push(i),mm(r[i])&&!vs(r[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return _t({},r)}function W_(r){var e=_t(_t({},mo),Tm(r));if(Ne(e.byeaster)&&(e.freq=V.YEARLY),!(Ne(e.freq)&&V.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(r.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),Ne(e.wkst)?Xt(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=V.MO.weekday,Ne(e.bysetpos)){Xt(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var t=0;t<e.bysetpos.length;t++){var n=e.bysetpos[t];if(n===0||!(n>=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||He(e.byweekno)||He(e.byyearday)||Boolean(e.bymonthday)||He(e.bymonthday)||Ne(e.byweekday)||Ne(e.byeaster)))switch(e.freq){case V.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case V.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case V.WEEKLY:e.byweekday=[Tn(e.dtstart)];break}if(Ne(e.bymonth)&&!Tt(e.bymonth)&&(e.bymonth=[e.bymonth]),Ne(e.byyearday)&&!Tt(e.byyearday)&&Xt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Ne(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(Tt(e.bymonthday)){for(var s=[],i=[],t=0;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?s.push(n):n<0&&i.push(n)}e.bymonthday=s,e.bynmonthday=i}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Ne(e.byweekno)&&!Tt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Ne(e.byweekday))e.bynweekday=null;else if(Xt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(pm(e.byweekday))e.byweekday=[Je.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Je)!e.byweekday.n||e.freq>V.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],o=[],t=0;t<e.byweekday.length;t++){var u=e.byweekday[t];if(Xt(u)){a.push(u);continue}else if(pm(u)){a.push(Je.fromStr(u).weekday);continue}!u.n||e.freq>V.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=He(a)?a:null,e.bynweekday=He(o)?o:null}return Ne(e.byhour)?Xt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<V.HOURLY?[e.dtstart.getUTCHours()]:null,Ne(e.byminute)?Xt(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<V.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Ne(e.bysecond)?Xt(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<V.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function q_(r){var e=r.dtstart.getTime()%1e3;if(!po(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(s){r.bysecond.forEach(function(i){t.push(new Ti(n,s,i,e))})})}),t}function go(r){var e=r.split(`
`).map(_P).filter(function(t){return t!==null});return _t(_t({},e[0]),e[1])}function ho(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],s=t[2];return n&&(e.tzid=n),e.dtstart=co(s),e}function _P(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return G_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return G_(r);case"DTSTART":return ho(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function G_(r){var e=r.replace(/^RRULE:/i,""),t=ho(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(s){var i=s.split("="),a=i[0],o=i[1];switch(a.toUpperCase()){case"FREQ":t.freq=pe[o.toUpperCase()];break;case"WKST":t.wkst=Tr[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=vP(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=wP(o);break;case"DTSTART":case"TZID":var c=ho(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=co(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function vP(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Y_)}return Y_(r)}function Y_(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function wP(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Tr[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var s=Number(n[1]),i=n[2],a=Tr[i].weekday;return new Je(a,s)})}var ks=function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=gi(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:P_(this.date,this.tzid)},r}();function yo(r){for(var e=[],t="",n=Object.keys(r),s=Object.keys(mo),i=0;i<n.length;i++)if(n[i]!=="tzid"&&!!ge(s,n[i])){var a=n[i].toUpperCase(),o=r[n[i]],u="";if(!(!Ne(o)||Tt(o)&&!o.length)){switch(a){case"FREQ":u=V.FREQUENCIES[r.freq];break;case"WKST":Xt(o)?u=new Je(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=D_(o).map(function(m){return m instanceof Je?m:Tt(m)?new Je(m[0],m[1]):new Je(m)}).toString();break;case"DTSTART":t=kP(o,r.tzid);break;case"UNTIL":u=gi(o,!r.tzid);break;default:if(Tt(o)){for(var l=[],c=0;c<o.length;c++)l[c]=String(o[c]);u=l.toString()}else u=String(o)}u&&e.push([a,u])}}var f=e.map(function(m){var _=m[0],g=m[1];return"".concat(_,"=").concat(g.toString())}).join(";"),p="";return f!==""&&(p="RRULE:".concat(f)),[t,p].filter(function(m){return!!m}).join(`
`)}function kP(r,e){return r?"DTSTART"+new ks(new Date(r),e).toString():""}function EP(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var B_=function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?Ju(t):gm(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,s=t?Object.keys(t):[],i=function(c){for(var f=0;f<s.length;f++){var p=s[f];if(!EP(t[p],c[p]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(Tt(a))for(var o=0;o<a.length;o++){var u=a[o];if(!(s.length&&i(u))){n=u._value;break}}if(!n&&this.all){for(var l=new vn(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return Tt(n)?gm(n):n instanceof Date?Ju(n):n},r}();var $_=q(q(q(q(q(q(q(q(q(q(q(q(q([],he(1,31),!0),he(2,28),!0),he(3,31),!0),he(4,30),!0),he(5,31),!0),he(6,30),!0),he(7,31),!0),he(8,31),!0),he(9,30),!0),he(10,31),!0),he(11,30),!0),he(12,31),!0),he(1,7),!0),H_=q(q(q(q(q(q(q(q(q(q(q(q(q([],he(1,31),!0),he(2,29),!0),he(3,31),!0),he(4,30),!0),he(5,31),!0),he(6,30),!0),he(7,31),!0),he(8,31),!0),he(9,30),!0),he(10,31),!0),he(11,30),!0),he(12,31),!0),he(1,7),!0),SP=br(1,29),OP=br(1,30),Hn=br(1,31),St=br(1,32),z_=q(q(q(q(q(q(q(q(q(q(q(q(q([],St,!0),OP,!0),St,!0),Hn,!0),St,!0),Hn,!0),St,!0),St,!0),Hn,!0),St,!0),Hn,!0),St,!0),St.slice(0,7),!0),V_=q(q(q(q(q(q(q(q(q(q(q(q(q([],St,!0),SP,!0),St,!0),Hn,!0),St,!0),Hn,!0),St,!0),St,!0),Hn,!0),St,!0),Hn,!0),St,!0),St.slice(0,7),!0),DP=br(-28,0),xP=br(-29,0),zn=br(-30,0),Ot=br(-31,0),K_=q(q(q(q(q(q(q(q(q(q(q(q(q([],Ot,!0),xP,!0),Ot,!0),zn,!0),Ot,!0),zn,!0),Ot,!0),Ot,!0),zn,!0),Ot,!0),zn,!0),Ot,!0),Ot.slice(0,7),!0),Q_=q(q(q(q(q(q(q(q(q(q(q(q(q([],Ot,!0),DP,!0),Ot,!0),zn,!0),Ot,!0),zn,!0),Ot,!0),Ot,!0),zn,!0),Ot,!0),zn,!0),Ot,!0),Ot.slice(0,7),!0),X_=[0,31,60,91,121,152,182,213,244,274,305,335,366],Z_=[0,31,59,90,120,151,181,212,243,273,304,334,365],_m=function(){for(var r=[],e=0;e<55;e++)r=r.concat(br(7));return r}();function J_(r,e){var t=Hr(r,1,1),n=hi(r)?366:365,s=hi(r+1)?366:365,i=lo(t),a=Tn(t),o=_t(_t({yearlen:n,nextyearlen:s,yearordinal:i,yearweekday:a},RP(r)),{wnomask:null});if(Zt(e.byweekno))return o;o.wnomask=he(0,n+7);var u,l,c=u=Et(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+Et(a-e.wkst,7)):l=n-c;for(var f=Math.floor(l/7),p=Et(l,7),m=Math.floor(f+p/4),_=0;_<e.byweekno.length;_++){var g=e.byweekno[_];if(g<0&&(g+=m+1),g>0&&g<=m){var E=void 0;g>1?(E=c+(g-1)*7,c!==u&&(E-=7-u)):E=c;for(var C=0;C<7&&(o.wnomask[E]=1,E++,o.wdaymask[E]!==e.wkst);C++);}}if(ge(e.byweekno,1)){var E=c+m*7;if(c!==u&&(E-=7-u),E<n)for(var _=0;_<7&&(o.wnomask[E]=1,E+=1,o.wdaymask[E]!==e.wkst);_++);}if(c){var R=void 0;if(ge(e.byweekno,-1))R=-1;else{var b=Tn(Hr(r-1,1,1)),z=Et(7-b.valueOf()+e.wkst,7),U=hi(r-1)?366:365,ne=void 0;z>=4?(z=0,ne=U+Et(b-e.wkst,7)):ne=n-c,R=Math.floor(52+Et(ne,7)/4)}if(ge(e.byweekno,R))for(var E=0;E<c;E++)o.wnomask[E]=1}return o}function RP(r){var e=hi(r)?366:365,t=Hr(r,1,1),n=Tn(t);return e===365?{mmask:$_,mdaymask:V_,nmdaymask:Q_,wdaymask:_m.slice(n),mrange:Z_}:{mmask:H_,mdaymask:z_,nmdaymask:K_,wdaymask:_m.slice(n),mrange:X_}}function ev(r,e,t,n,s,i){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(i.freq===V.YEARLY)if(Zt(i.bymonth))o=[[0,t]];else for(var u=0;u<i.bymonth.length;u++)e=i.bymonth[u],o.push(n.slice(e-1,e+1));else i.freq===V.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(Zt(o))return a;a.nwdaymask=he(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],f=l[1]-1,p=0;p<i.bynweekday.length;p++){var m=void 0,_=i.bynweekday[p],g=_[0],E=_[1];E<0?(m=f+(E+1)*7,m-=Et(s[m]-g,7)):(m=c+(E-1)*7,m+=Et(7-s[m]+g,7)),c<=m&&m<=f&&(a.nwdaymask[m]=1)}return a}function tv(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),s=r%100,i=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),u=Math.floor((n-o+1)/3),l=Math.floor(19*t+n-i-u+15)%30,c=Math.floor(s/4),f=s%4,p=Math.floor(32+2*a+2*c-l-f)%7,m=Math.floor((t+11*l+22*p)/451),_=Math.floor((l+p-7*m+114)/31),g=(l+p-7*m+114)%31+1,E=Date.UTC(r,_-1,g+e),C=Date.UTC(r,0,1);return[Math.ceil((E-C)/(1e3*60*60*24))]}var MP=function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=J_(e,n)),He(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var s=this.yearinfo,i=s.yearlen,a=s.mrange,o=s.wdaymask;this.monthinfo=ev(e,t,i,a,o,n)}Ne(n.byeaster)&&(this.eastermask=tv(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[br(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],s=this.mrange[t],i=he(null,this.yearlen),a=n;a<s;a++)i[a]=a;return[i,n,s]},r.prototype.wdayset=function(e,t,n){for(var s=he(null,this.yearlen+7),i=lo(Hr(e,t,n))-this.yearordinal,a=i,o=0;o<7&&(s[i]=i,++i,this.wdaymask[i]!==this.options.wkst);o++);return[s,a,i]},r.prototype.ddayset=function(e,t,n){var s=he(null,this.yearlen),i=lo(Hr(e,t,n))-this.yearordinal;return s[i]=i,[s,i,i+1]},r.prototype.htimeset=function(e,t,n,s){var i=this,a=[];return this.options.byminute.forEach(function(o){a=a.concat(i.mtimeset(e,o,n,s))}),_n(a),a},r.prototype.mtimeset=function(e,t,n,s){var i=this.options.bysecond.map(function(a){return new Ti(e,t,a,s)});return _n(i),i},r.prototype.stimeset=function(e,t,n,s){return[new Ti(e,t,n,s)]},r.prototype.getdayset=function(e){switch(e){case pe.YEARLY:return this.ydayset.bind(this);case pe.MONTHLY:return this.mdayset.bind(this);case pe.WEEKLY:return this.wdayset.bind(this);case pe.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case pe.HOURLY:return this.htimeset.bind(this);case pe.MINUTELY:return this.mtimeset.bind(this);case pe.SECONDLY:return this.stimeset.bind(this)}},r}(),rv=MP;function nv(r,e,t,n,s,i){for(var a=[],o=0;o<r.length;o++){var u=void 0,l=void 0,c=r[o];c<0?(u=Math.floor(c/e.length),l=Et(c,e.length)):(u=Math.floor((c-1)/e.length),l=Et(c-1,e.length));for(var f=[],p=t;p<n;p++){var m=i[p];!Ne(m)||f.push(m)}var _=void 0;u<0?_=f.slice(u)[0]:_=f[u];var g=e[l],E=Xu(s.yearordinal+_),C=Zu(E,g);ge(a,C)||a.push(C)}return _n(a),a}function el(r,e){var t=e.dtstart,n=e.freq,s=e.interval,i=e.until,a=e.bysetpos,o=e.count;if(o===0||s===0)return wn(r);var u=U_.fromDate(t),l=new rv(e);l.rebuild(u.year,u.month);for(var c=PP(l,u,e);;){var f=l.getdayset(n)(u.year,u.month,u.day),p=f[0],m=f[1],_=f[2],g=AP(p,m,_,l,e);if(He(a))for(var E=nv(a,c,m,_,l,p),C=0;C<E.length;C++){var R=E[C];if(i&&R>i)return wn(r);if(R>=t){var b=sv(R,e);if(!r.accept(b)||o&&(--o,!o))return wn(r)}}else for(var C=m;C<_;C++){var z=p[C];if(!!Ne(z))for(var U=Xu(l.yearordinal+z),ne=0;ne<c.length;ne++){var G=c[ne],R=Zu(U,G);if(i&&R>i)return wn(r);if(R>=t){var b=sv(R,e);if(!r.accept(b)||o&&(--o,!o))return wn(r)}}}if(e.interval===0||(u.add(e,g),u.year>Qu))return wn(r);po(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function CP(r,e,t){var n=t.bymonth,s=t.byweekno,i=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return He(n)&&!ge(n,r.mmask[e])||He(s)&&!r.wnomask[e]||He(i)&&!ge(i,r.wdaymask[e])||He(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!ge(r.eastermask,e)||(He(o)||He(u))&&!ge(o,r.mdaymask[e])&&!ge(u,r.nmdaymask[e])||He(l)&&(e<r.yearlen&&!ge(l,e+1)&&!ge(l,-r.yearlen+e)||e>=r.yearlen&&!ge(l,e+1-r.yearlen)&&!ge(l,-r.nextyearlen+e-r.yearlen))}function sv(r,e){return new ks(r,e.tzid).rezonedDate()}function wn(r){return r.getValue()}function AP(r,e,t,n,s){for(var i=!1,a=e;a<t;a++){var o=r[a];i=CP(n,o,s),i&&(r[o]=null)}return i}function PP(r,e,t){var n=t.freq,s=t.byhour,i=t.byminute,a=t.bysecond;return po(n)?q_(t):n>=V.HOURLY&&He(s)&&!ge(s,e.hour)||n>=V.MINUTELY&&He(i)&&!ge(i,e.minute)||n>=V.SECONDLY&&He(a)&&!ge(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var Tr={MO:new Je(0),TU:new Je(1),WE:new Je(2),TH:new Je(3),FR:new Je(4),SA:new Je(5),SU:new Je(6)},mo={freq:pe.YEARLY,dtstart:null,interval:1,wkst:Tr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},j_=Object.keys(mo),V=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new B_,this.origOptions=Tm(e);var n=W_(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return fo(e,t)},r.fromText=function(e,t){return I_(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return el(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new bm("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new vn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,s){if(n===void 0&&(n=!1),!vs(e)||!vs(t))throw new Error("Invalid date passed in to RRule.between");var i={before:t,after:e,inc:n};if(s)return this._iter(new bm("between",i,s));var a=this._cacheGet("between",i);return a===!1&&(a=this._iter(new vn("between",i)),this._cacheAdd("between",a,i)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!vs(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new vn("before",n)),this._cacheAdd("before",s,n)),s},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!vs(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new vn("after",n)),this._cacheAdd("after",s,n)),s},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return yo(this.origOptions)},r.prototype.toText=function(e,t,n){return F_(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return L_(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=pe.YEARLY,r.MONTHLY=pe.MONTHLY,r.WEEKLY=pe.WEEKLY,r.DAILY=pe.DAILY,r.HOURLY=pe.HOURLY,r.MINUTELY=pe.MINUTELY,r.SECONDLY=pe.SECONDLY,r.MO=Tr.MO,r.TU=Tr.TU,r.WE=Tr.WE,r.TH=Tr.TH,r.FR=Tr.FR,r.SA=Tr.SA,r.SU=Tr.SU,r.parseString=go,r.optionsToString=yo,r}();function iv(r,e,t,n,s,i){var a={},o=r.accept;function u(p,m){t.forEach(function(_){_.between(p,m,!0).forEach(function(g){a[Number(g)]=!0})})}s.forEach(function(p){var m=new ks(p,i).rezonedDate();a[Number(m)]=!0}),r.accept=function(p){var m=Number(p);return isNaN(m)?o.call(this,p):!a[m]&&(u(new Date(m-1),new Date(m+1)),!a[m])?(a[m]=!0,o.call(this,p)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(p){var m=Number(p);return a[m]?!0:(a[m]=!0,o.call(this,p))});for(var l=0;l<n.length;l++){var c=new ks(n[l],i).rezonedDate();if(!r.accept(new Date(c.getTime())))break}e.forEach(function(p){el(r,p.options)});var f=r._result;switch(_n(f),r.method){case"all":case"between":return f;case"before":return f.length&&f[f.length-1]||null;case"after":default:return f.length&&f[0]||null}}var av={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function NP(r,e){var t=[],n=[],s=[],i=[],a=ho(r),o=a.dtstart,u=a.tzid,l=WP(r,e.unfold);return l.forEach(function(c){var f;if(!!c){var p=UP(c),m=p.name,_=p.parms,g=p.value;switch(m.toUpperCase()){case"RRULE":if(_.length)throw new Error("unsupported RRULE parm: ".concat(_.join(",")));t.push(go(c));break;case"RDATE":var E=(f=/RDATE(?:;TZID=([^:=]+))?/i.exec(c))!==null&&f!==void 0?f:[],C=E[1];C&&!u&&(u=C),n=n.concat(ov(g,_));break;case"EXRULE":if(_.length)throw new Error("unsupported EXRULE parm: ".concat(_.join(",")));s.push(go(g));break;case"EXDATE":i=i.concat(ov(g,_));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:o,tzid:u,rrulevals:t,rdatevals:n,exrulevals:s,exdatevals:i}}function IP(r,e){var t=NP(r,e),n=t.rrulevals,s=t.rdatevals,i=t.exrulevals,a=t.exdatevals,o=t.dtstart,u=t.tzid,l=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||s.length||i.length||a.length){var c=new wm(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(p){c.rrule(new V(vm(p,o,u),l))}),s.forEach(function(p){c.rdate(p)}),i.forEach(function(p){c.exrule(new V(vm(p,o,u),l))}),a.forEach(function(p){c.exdate(p)}),e.compatible&&e.dtstart&&c.rdate(o),c}var f=n[0]||{};return new V(vm(f,f.dtstart||e.dtstart||o,f.tzid||e.tzid||u),l)}function tl(r,e){return e===void 0&&(e={}),IP(r,FP(e))}function vm(r,e,t){return _t(_t({},r),{dtstart:e,tzid:t})}function FP(r){var e=[],t=Object.keys(r),n=Object.keys(av);if(t.forEach(function(s){ge(n,s)||e.push(s)}),e.length)throw new Error("Invalid options: "+e.join(", "));return _t(_t({},av),r)}function LP(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=x_(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function UP(r){var e=LP(r),t=e.name,n=e.value,s=t.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:n}}function WP(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(`
`),n=0;n<t.length;){var s=t[n]=t[n].replace(/\s+$/g,"");s?n>0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function qP(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function ov(r,e){return qP(e),r.split(",").map(function(t){return co(t)})}function uv(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n<e._rrule.length;n++){var s=e._rrule[n].origOptions[r];if(s)return s}}}var wm=function(r){yi(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=uv.apply(n,["dtstart"]),n.tzid=uv.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return iv(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){lv(t,this._rrule)},e.prototype.exrule=function(t){lv(t,this._exrule)},e.prototype.rdate=function(t){cv(t,this._rdate)},e.prototype.exdate=function(t){cv(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return tl(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return tl(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(yo({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
`).map(function(s){return s.replace(/^RRULE:/,"EXRULE:")}).filter(function(s){return!/^DTSTART/.test(s)}))}),this._rdate.length&&t.push(dv("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(dv("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}(V);function lv(r,e){if(!(r instanceof V))throw new TypeError(String(r)+" is not RRule instance");ge(e.map(String),String(r))||e.push(r)}function cv(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");ge(e.map(Number),Number(r))||(e.push(r),_n(e))}function dv(r,e,t){var n=!t||t.toUpperCase()==="UTC",s=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),i=e.map(function(a){return gi(a.valueOf(),n)}).join(",");return"".concat(s).concat(i)}function _r(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?1:!r.isValid()&&e.isValid()?-1:r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var mt=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:s,scheduledDate:i,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=s,this.scheduledDate=i,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:s}){try{let i=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(i==null)return null;let a=i[1].trim(),o=i[2]!==void 0,u=V.parseText(a);if(u!==null){let l=null;s?l=window.moment(s):n?l=window.moment(n):t&&(l=window.moment(t)),!o&&l!==null?u.dtstart=window.moment(l).startOf("day").utc(!0).toDate():u.dtstart=window.moment().startOf("day").utc(!0).toDate();let c=new V(u);return new mt({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:s})}}catch(i){i instanceof Error&&console.log(i.message)}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(e=window.moment()){let t=this.nextReferenceDate(e);if(t!==null){let n=null,s=null,i=null;if(this.referenceDate){if(this.startDate){let a=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(t),n.add(Math.round(a.asDays()),"days")}if(this.scheduledDate){let a=window.moment.duration(this.scheduledDate.diff(this.referenceDate));s=window.moment(t),s.add(Math.round(a.asDays()),"days")}if(this.dueDate){let a=window.moment.duration(this.dueDate.diff(this.referenceDate));i=window.moment(t),i.add(Math.round(a.asDays()),"days")}}return{startDate:n,scheduledDate:s,dueDate:i}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||_r(this.startDate,e.startDate)!==0||_r(this.scheduledDate,e.scheduledDate)!==0||_r(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(e){return this.baseOnToday?this.nextReferenceDateFromToday(e).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new V(be(X({},this.rrule.origOptions),{dtstart:e.startOf("day").utc(!0).toDate()}));return this.nextAfter(e.endOf("day"),t)}nextReferenceDateFromOriginalReferenceDate(){var t;let e=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");return this.nextAfter(e,this.rrule)}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),s=this.toText(),i=s.match(/every( \d+)? month(s)?(.*)?/);i!==null&&(s.includes(" on ")||(n=mt.nextAfterMonths(e,n,t,i[1])));let a=s.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=mt.nextAfterYears(e,n,t,a[1])),mt.addTimezone(n)}static nextAfterMonths(e,t,n,s){let i=1;for(s!==void 0&&(i=Number.parseInt(s.trim(),10));mt.isSkippingTooManyMonths(e,t,i);)t=mt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let s=t.month()-e.month();return s+=(t.year()-e.year())*12,s>n}static nextAfterYears(e,t,n,s){let i=1;for(s!==void 0&&(i=Number.parseInt(s.trim(),10));mt.isSkippingTooManyYears(e,t,i);)t=mt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new V(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function rl(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var Vn=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return Vn.instance||(Vn.instance=new Vn),Vn.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(Vn.empty)}isEmpty(){return this.get()===Vn.empty}equals(e){return this.get()===e}includedIn(e){let t=this.get();return e.includes(t)}prependTo(e){return this.get()+" "+e}removeAsWordFromDependingOnSettings(e){return this.getRemoveGlobalFilter()?this.removeAsWordFrom(e):e}getRemoveGlobalFilter(){return this._removeGlobalFilter}setRemoveGlobalFilter(e){this._removeGlobalFilter=e}removeAsWordFrom(e){if(this.isEmpty())return e;let t=RegExp("(^|\\s)"+rl(this.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}removeAsSubstringFrom(e){let t=this.get();return e.replace(t,"").trim()}},ye=Vn;ye.empty="";var Jt=class{},Z=Jt;Z.dateFormat="YYYY-MM-DD",Z.dateTimeFormat="YYYY-MM-DD HH:mm",Z.indentationRegex=/^([\s\t>]*)/,Z.listMarkerRegex=/([-*+]|[0-9]+\.)/,Z.checkboxRegex=/\[(.)\]/u,Z.afterCheckboxRegex=/ *(.*)/u,Z.taskRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source+" +"+Jt.checkboxRegex.source+Jt.afterCheckboxRegex.source,"u"),Z.nonTaskRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source+"? *("+Jt.checkboxRegex.source+")?"+Jt.afterCheckboxRegex.source,"u"),Z.listItemRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source),Z.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,Z.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,Z.hashTagsFromEnd=new RegExp(Jt.hashTags.source+"$");var km=5;function Em(r,e,t){let n=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(s,i,a)=>{let o=[];return o=o.concat(GP(s,i,a,n,e,t)),o=o.concat(YP(s,i,a,r.recurrenceSymbol,t)),o=o.concat(jP(s,i,a,r,t)),o.length>0&&!o.some(u=>u.suggestionType==="match")&&(t||o.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:`
`})),o=o.slice(0,a.autoSuggestMaxItems),o}}function Sm(r,e,t){let n=$P(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",s=r?n+" ":" ",i=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:s,insertSkip:i}}function jP(r,e,t,n,s){let i=f=>Object.values(n.prioritySymbols).some(p=>p.length>0&&f.includes(p)),a=[],{postfix:o,insertSkip:u}=Sm(s,r,e);if(r.includes(n.dueDateSymbol)||a.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||a.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||a.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),!i(r)){let f=n.prioritySymbols,p=["High","Medium","Low","Highest","Lowest"];for(let m=0;m<p.length;m++){let _=p[m],g=f[_];a.push({displayText:s?`${g} priority`:`${g} ${_.toLowerCase()} priority`,appendText:`${g}${o}`,insertSkip:s?u:void 0})}}if(r.includes(n.recurrenceSymbol)||a.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let p=Qt.parseDate("today",!0).format(Z.dateFormat);a.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${p})`,appendText:`${n.createdDateSymbol} ${p}`+o,insertSkip:s?u:void 0})}let l=Om(r,/([a-zA-Z'_-]*)/g,e),c=[];if(l&&l.length>0){let f=l[0];if(f.length>=Math.max(1,t.autoSuggestMinMatch)){let p=a.filter(m=>(m.textToMatch||m.displayText).toLowerCase().includes(f.toLowerCase()));for(let m of p){let _=s&&(m.displayText.includes("priority")||m.displayText.includes("created"))?f.length+u:f.length;c.push({suggestionType:"match",displayText:m.displayText,appendText:m.appendText,insertAt:l.index,insertSkip:_})}}}return c.length===0&&t.autoSuggestMinMatch===0?a:c}function GP(r,e,t,n,s,i){let a=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],{postfix:o,insertSkip:u}=Sm(i,r,e),l=[],c=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),f=Om(r,c,e);if(f&&f.length>=2){let p=f[1],m=f[2];if(m.length<t.autoSuggestMinMatch)return[];let _=m&&m.length>1?Qt.parseDate(bn(m),!0):null;_&&_.isValid()&&l.push({displayText:`${_.format(Z.dateFormat)}`,appendText:`${p} ${_.format(Z.dateFormat)} `,insertAt:f.index,insertSkip:f[0].length});let g=1,E=a.filter(C=>m&&m.length>=g&&C.toLowerCase().includes(m.toLowerCase())).slice(0,s);E.length===0&&(E=a.slice(0,s));for(let C of E){let b=`${Qt.parseDate(C,!0).format(Z.dateFormat)}`,z=i?f[0].length+u:f[0].length;l.push({suggestionType:"match",displayText:`${C} (${b})`,appendText:`${p} ${b}`+o,insertAt:f.index,insertSkip:z})}}return l}function YP(r,e,t,n,s){var f;let i=["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"],{postfix:a,insertSkip:o}=Sm(s,r,e),u=[],l=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),c=Om(r,l,e);if(c&&c.length>=2){let p=c[1],m=c[2];if(m.length<t.autoSuggestMinMatch)return[];if(m.length>0){let C=(f=mt.fromText({recurrenceRuleText:m,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:f.toText();if(C){let R=`${p} ${C}`+a,b=s?c[0].length+o:c[0].length;if(u.push({suggestionType:"match",displayText:`\u2705 ${C}`,appendText:R,insertAt:c.index,insertSkip:b}),c[0]==R)return[]}}let _=1,g=t.autoSuggestMaxItems/2,E=i.filter(C=>m&&m.length>=_&&C.toLowerCase().includes(m.toLowerCase())).slice(0,g);E.length===0&&m.trim().length===0&&(E=i.slice(0,g));for(let C of E)u.push({suggestionType:"match",displayText:`${C}`,appendText:`${p} ${C} `,insertAt:c.index,insertSkip:c[0].length})}return u}function Om(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s}function BP(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([s,i])=>[s,0])),n=Object.fromEntries(e.map(([s,i])=>[i,s]));for(let s of r)s in t?t[s]++:s in n&&(t[n[s]]=Math.max(0,t[n[s]]-1));return Object.values(t).some(s=>s>0)}function $P(r,e){if(e.length===0)return null;let t=Object.fromEntries(e.map(([i,a])=>[i,0])),n=Object.fromEntries(e.map(([i,a])=>[a,i])),s=[];for(let i=0;i<r.length;i++){let a=r[i];if(a in t)t[a]++,s.push({bracket:a,idx:i});else if(a in n){if(t[n[a]]>=1){for(let o=s.length-1;o>=0;o--)if(s[o].bracket==n[a]){s.splice(o,1);break}}t[n[a]]=Math.max(0,t[n[a]]-1)}}return s.length>0?s[s.length-1].bracket:null}function pv(r,e){return(t,n,s)=>BP(t.slice(0,n),e)?r(t,n,s):[]}function mv(r,e){return ye.getInstance().includedIn(r)&&HP(r,e)}function HP(r,e){if(r.length===0)return!1;let t=oe.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}var _i=(p=>(p.Description="description",p.Id="id",p.DependsOn="dependsOn",p.Priority="priority",p.RecurrenceRule="recurrenceRule",p.CreatedDate="createdDate",p.StartDate="startDate",p.ScheduledDate="scheduledDate",p.DueDate="dueDate",p.CancelledDate="cancelledDate",p.DoneDate="doneDate",p.BlockLink="blockLink",p))(_i||{}),nl=Object.values(_i),Vr=class{constructor(){this.visible={};this.tagsVisible=!0;nl.forEach(e=>{this.visible[e]=!0})}isShown(e){return this.visible[e]}areTagsShown(){return this.tagsVisible}hide(e){this.visible[e]=!1}setVisibility(e,t){this.visible[e]=t}setTagsVisibility(e){this.tagsVisible=e}get shownComponents(){return nl.filter(e=>this.visible[e])}get hiddenComponents(){return nl.filter(e=>!this.visible[e])}get toggleableComponents(){return nl.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var Es=/[a-zA-Z0-9-_]+/,xm={prioritySymbols:{Highest:"\u{1F53A}",High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",Lowest:"\u23EC",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",cancelledDateSymbol:"\u274C",recurrenceSymbol:"\u{1F501}",dependsOnSymbol:"\u26D4",idSymbol:"\u{1F194}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])\uFE0F?$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,cancelledDateRegex:/❌ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu,dependsOnRegex:new RegExp("\u26D4\uFE0F? *("+Es.source+"( *, *"+Es.source+" *)*)$","iu"),idRegex:new RegExp("\u{1F194} *("+Es.source+")$","iu")}};function Dm(r,e,t){return t?r?" "+e:` ${e} ${t}`:""}function vi(r,e,t){return t?r?" "+e:` ${e} ${t.format(Z.dateFormat)}`:""}var Ss=class{constructor(e){this.symbols=e}serialize(e){let t=new Vr,n="",s=!1;for(let i of t.shownComponents)n+=this.componentToString(e,s,i);return n}componentToString(e,t,n){var _;let{prioritySymbols:s,startDateSymbol:i,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,cancelledDateSymbol:l,recurrenceSymbol:c,dueDateSymbol:f,dependsOnSymbol:p,idSymbol:m}=this.symbols;switch(n){case"description":return e.description;case"priority":{let g="";return e.priority==="0"?g=" "+s.Highest:e.priority==="1"?g=" "+s.High:e.priority==="2"?g=" "+s.Medium:e.priority==="4"?g=" "+s.Low:e.priority==="5"&&(g=" "+s.Lowest),g}case"startDate":return vi(t,i,e.startDate);case"createdDate":return vi(t,a,e.createdDate);case"scheduledDate":return e.scheduledDateIsInferred?"":vi(t,o,e.scheduledDate);case"doneDate":return vi(t,u,e.doneDate);case"cancelledDate":return vi(t,l,e.cancelledDate);case"dueDate":return vi(t,f,e.dueDate);case"recurrenceRule":return e.recurrence?Dm(t,c,e.recurrence.toText()):"";case"dependsOn":return e.dependsOn.length===0?"":Dm(t,p,e.dependsOn.join(","));case"id":return Dm(t,m,e.id);case"blockLink":return(_=e.blockLink)!=null?_:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Lowest:return"5";case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";case t.Highest:return"0";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,s="3",i=null,a=null,o=null,u=null,l=null,c=null,f="",p=null,m="",_=[],g="",E=20,C=0;do{n=!1;let R=e.match(t.priorityRegex);R!==null&&(s=this.parsePriority(R[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let b=e.match(t.doneDateRegex);b!==null&&(u=window.moment(b[1],Z.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let z=e.match(t.cancelledDateRegex);z!==null&&(l=window.moment(z[1],Z.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let U=e.match(t.dueDateRegex);U!==null&&(o=window.moment(U[1],Z.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let ne=e.match(t.scheduledDateRegex);ne!==null&&(a=window.moment(ne[1],Z.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let G=e.match(t.startDateRegex);G!==null&&(i=window.moment(G[1],Z.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let Y=e.match(t.createdDateRegex);Y!==null&&(c=window.moment(Y[1],Z.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let te=e.match(t.recurrenceRegex);te!==null&&(f=te[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let _e=e.match(Z.hashTagsFromEnd);if(_e!=null){e=e.replace(Z.hashTagsFromEnd,"").trim(),n=!0;let O=_e[0].trim();g=g.length>0?[O,g].join(" "):O}let W=e.match(t.idRegex);W!=null&&(e=e.replace(t.idRegex,"").trim(),m=W[1].trim(),n=!0);let I=e.match(t.dependsOnRegex);I!=null&&(e=e.replace(t.dependsOnRegex,"").trim(),_=I[1].replace(/ /g,"").split(",").filter(O=>O!==""),n=!0),C++}while(n&&C<=E);return f.length>0&&(p=mt.fromText({recurrenceRuleText:f,startDate:i,scheduledDate:a,dueDate:o})),g.length>0&&(e+=" "+g),{description:e,priority:s,startDate:i,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:p,id:m,dependsOn:_,tags:oe.extractHashtags(e)}}};function Kr(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Rm={prioritySymbols:{Highest:"priority:: highest",High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",Lowest:"priority:: lowest",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",cancelledDateSymbol:"cancelled::",recurrenceSymbol:"repeat::",idSymbol:"id::",dependsOnSymbol:"dependsOn::",TaskFormatRegularExpressions:{priorityRegex:Kr(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:Kr(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:Kr(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:Kr(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:Kr(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:Kr(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:Kr(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:Kr(/repeat:: *([a-zA-Z0-9, !]+)/),dependsOnRegex:Kr(new RegExp("dependsOn:: *("+Es.source+"( *, *"+Es.source+" *)*)")),idRegex:Kr(new RegExp("id:: *("+Es.source+")"))}},sl=class extends Ss{constructor(){super(Rm)}parsePriority(e){switch(e){case"highest":return"0";case"high":return"1";case"medium":return"2";case"low":return"4";case"lowest":return"5";default:return"3"}}componentToString(e,t,n){let s=super.componentToString(e,t,n),i=["blockLink","description"];return s!==""&&!i.includes(n)?` [${s.trim()}]`:s}};var er=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(er||{}),nt=class{constructor(e,t,n,s,i="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=s,this.type=i}};var It=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get nextSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}get typeGroupText(){let e=this.type,t;switch(e){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return`%%${t}%%${e}`}constructor(e){this.configuration=e}static makeDone(){return new It(new nt("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new It(new nt("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new It(new nt(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new It(new nt("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new It(new nt("/","In Progress","x",!0,"IN_PROGRESS"))}static makeNonTask(){return new It(new nt("Q","Non-Task","A",!0,"NON_TASK"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return er[e]||"TODO"}static createUnknownStatus(e){return new It(new nt(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=It.getTypeFromStatusTypeString(e[3]);return new It(new nt(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}isCancelled(){return this.type==="CANCELLED"}identicalTo(e){let t=["symbol","name","nextStatusSymbol","availableAsCommand","type"];for(let n of t)if(this[n]!==e[n])return!1;return!0}previewText(){let e="";return It.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},ie=It;ie.DONE=It.makeDone(),ie.EMPTY=It.makeEmpty(),ie.TODO=It.makeTodo();var il=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var Ue=class{constructor(){this.coreStatuses=[ie.makeTodo().configuration,ie.makeDone().configuration],this.customStatuses=[ie.makeInProgress().configuration,ie.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let s=this.findStatusIndex(t,e);return s<=-1?!1:(e.splice(s,1,n),!0)}static findStatusIndex(e,t){let n=new ie(e);return t.findIndex(s=>new ie(s).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){Ue.deleteAllCustomStatuses(e),new Ue().customStatuses.forEach(n=>{Ue.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(s=>{e.customStatuses.find(a=>a.symbol==s[0]&&a.name==s[1]&&a.nextStatusSymbol==s[2])?n.push(`The status ${s[1]} (${s[0]}) is already added.`):Ue.addStatus(e.customStatuses,ie.createFromImportedValue(s))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Ue.allStatuses(e).forEach(n=>{t.add(n)})}};var hv=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var kn=class{constructor(e,t,n,s,i,a){this.internalName=e;this.index=t;this.description=n;this.displayName=s;this.enabledByDefault=i;this.stable=a}static get values(){let e=[];return hv.forEach(t=>{e=[...e,new kn(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return kn.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of kn.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var En={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Ss(xm),buildSuggestions:Em(xm,km,!1)},dataview:{displayName:"Dataview",taskSerializer:new sl,buildSuggestions:pv(Em(Rm,km,!0),[["(",")"],["[","]"]])}},yv={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Ue,features:kn.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new il,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},Kn=X({},yv);function gv(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var ee=()=>(gv(kn.settingsFlags,Kn.features),gv(yv.loggingOptions.minLevels,Kn.loggingOptions.minLevels),Kn.statusSettings.customStatuses.forEach((r,e,t)=>{var s,i;let n=ie.getTypeFromStatusTypeString(r.type);t[e]=new nt((s=r.symbol)!=null?s:" ",r.name,(i=r.nextStatusSymbol)!=null?i:"x",r.availableAsCommand,n)}),X({},Kn)),st=r=>(Kn=X(X({},Kn),r),ee());var Os=(r,e)=>(Kn.generalSettings[r]=e,ee()),bv=r=>{var e;return(e=Kn.features[r])!=null?e:!1};function To(){return En[ee().taskFormat]}function al(r){let t={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"}[r];return t!==void 0?t:r}function Tv(r){let e=[...r],t="";return e.forEach(n=>{t+=al(n)}),t}var Oe=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(e){this.clearStatuses(),e.forEach(t=>{this.add(t)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==ie.EMPTY.symbol)}static getInstance(){return Oe.instance||(Oe.instance=new Oe),Oe.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof ie?this._registeredStatuses.push(e):this._registeredStatuses.push(new ie(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):ie.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):ie.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:ie.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return ie.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:ie.createUnknownStatus(e.nextStatusSymbol)}getNextRecurrenceStatusOrCreate(e){let t=this.getNextStatusOrCreate(e),n=this.getNextRecurrenceStatusOfType(t,"TODO");if(n)return n;let s=this.getNextRecurrenceStatusOfType(t,"IN_PROGRESS");return s||this.bySymbolOrCreate(" ")}getNextRecurrenceStatusOfType(e,t){if(e.type===t)return e;let n=e;for(let s=0;s<this.registeredStatuses.length-1;s++)if(n=this.getNextStatusOrCreate(n),n.type===t)return n}findUnknownStatuses(e){let t=e.filter(i=>!this.hasSymbol(i.symbol)),n=new Oe,s=[];return t.forEach(i=>{if(n.hasSymbol(i.symbol))return;let a=Oe.copyStatusWithNewName(i,`Unknown (${i.symbol})`);s.push(a),n.add(a)}),s.sort((i,a)=>i.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new nt(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new ie(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[ie.makeTodo(),ie.makeInProgress(),ie.makeDone(),ie.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",s=[],i=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);s.push(`${o+1}${u}`);let l=this.getNextStatus(a);if(this.addEdgeIfNotToInternal(t,l,i,o,!1),a.type==="DONE"){let c=this.getNextRecurrenceStatusOrCreate(a);c.symbol!==l.symbol&&this.addEdgeIfNotToInternal(t,c,i,o,!0)}}),`
\`\`\`${n}
flowchart LR
classDef TODO stroke:#f33,stroke-width:3px;
classDef DONE stroke:#0c0,stroke-width:3px;
classDef IN_PROGRESS stroke:#fa0,stroke-width:3px;
classDef CANCELLED stroke:#ddd,stroke-width:3px;
classDef NON_TASK stroke:#99e,stroke-width:3px;
${s.join(`
`)}
${i.join(`
`)}
linkStyle default stroke:gray
\`\`\`
`}addEdgeIfNotToInternal(e,t,n,s,i){let a=e.findIndex(l=>l.symbol===t.symbol),o=a!==-1,u=t.type!=="EMPTY";if(o&&u){let l;i?l='-. "\u{1F501}" .-> ':l=" --> ";let c=`${s+1}${l}${a+1}`;n.push(c)}}getMermaidNodeLabel(e,t){let n=Tv(e.name),s=e.type;if(t){let i=al(e.symbol),a=al(e.nextStatusSymbol),o=`[${i}] -> [${a}]`,u=`'${n}'`,l=`(${s})`;return`["${u}<br>${o}<br>${l}"]:::${s}`}else return`["${n}"]:::${s}`}};var _v=require("obsidian");var Qr=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var ze=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(Z.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(Z.dateTimeFormat,e)}format(e,t=""){return this._date?this._date.format(e):t}toISOString(e){return this._date?this._date.toISOString(e):""}get category(){let e=window.moment(),t=this.moment;return t?t.isBefore(e,"day")?new Qr("Overdue",1):t.isSame(e,"day")?new Qr("Today",2):t.isValid()?new Qr("Future",3):new Qr("Invalid date",0):new Qr("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new Qr("",0);let t=this.fromNowOrder(e);return new Qr(e.fromNow(),t)}fromNowOrder(e){if(!e.isValid())return 0;let t=window.moment(),n=e.isSameOrBefore(t,"day"),s=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+s.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let s=e.fromNow(!0).split(" "),i,a=Number(s[0]);isNaN(a)?i=1:i=a;let o=s[1];return t?n.subtract(i,o):n.add(i,o)}postpone(e="days",t=1){if(!this._date)throw new _v.Notice("Cannot postpone a null date");let n=window.moment().startOf("day");return this._date.isSameOrAfter(n,"day")?this._date.clone().add(t,e):n.add(t,e)}};var wi=class{constructor(e){this._path=e}get path(){return this._path}get pathWithoutExtension(){return this.withoutExtension(this.path)}withoutExtension(e){return e.replace(/\.md$/,"")}get root(){let e=this.path.replace(/\\/g,"/");e.charAt(0)==="/"&&(e=e.substring(1));let t=e.indexOf("/");return t==-1?"/":e.substring(0,t+1)}get folder(){let e=this.path,t=this.filename,n=e.substring(0,e.lastIndexOf(t));return n===""?"/":n}get filename(){let e=this.path.match(/([^/]+)$/);return e!==null?e[1]:""}get filenameWithoutExtension(){return this.withoutExtension(this.filename)}};var Sn=class{static priorityNameUsingNone(e){let t="ERROR";switch(e){case"1":t="High";break;case"0":t="Highest";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break;case"5":t="Lowest";break}return t}static priorityNameUsingNormal(e){return Sn.priorityNameUsingNone(e).replace("None","Normal")}};var VP=require("obsidian"),Ev=ua(kv());var Mm=class extends Ev.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,s)=>n+s,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",s="";for(let i in this.options.minLevels)t.startsWith(i)&&i.length>=s.length&&(n=this.options.minLevels[i],s=i);return new Cm(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${window.moment().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Ft=new Mm,Cm=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e)<this.minLevel)return;let i={level:e,module:this.module,message:t,objects:n,traceId:void 0};this.logManager.emit("log",i)}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}logWithId(e,t,n,s){if(this.levelToInt(e)<this.minLevel)return;let a={level:e,module:this.module,message:n,objects:s,traceId:t};this.logManager.emit("log",a)}traceWithId(e,t,n){this.logWithId("trace",e,t,n)}debugWithId(e,t,n){this.logWithId("debug",e,t,n)}infoWithId(e,t,n){this.logWithId("info",e,t,n)}warnWithId(e,t,n){this.logWithId("warn",e,t,n)}errorWithId(e,t,n){this.logWithId("error",e,t,n)}};function Am(r,e){let t=Ft.getLogger("tasks");switch(r){case"trace":t.trace(e);break;case"debug":t.debug(e);break;case"info":t.info(e);break;case"warn":t.warn(e);break;case"error":t.error(e);break;default:break}}function ol(r,e,t){r.debug(`${e}: task line number: ${t.taskLocation.lineNumber}. file path: "${t.path}"`),r.debug(`${e} original: ${t.originalMarkdown}`)}function ul(r,e,t){t.map((n,s)=>{r.debug(`${e} ==> ${s+1} : ${n.toFileLineString()}`)})}var Dt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=ee();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),s=e.substring(t,n),i=/(\d{4})-(\d{2})-(\d{2})/.exec(s);if(i||(i=/(\d{4})(\d{2})(\d{2})/.exec(s)),i){let a=window.moment([parseInt(i[1]),parseInt(i[2])-1,parseInt(i[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let s=e.scheduledDate,i=e.scheduledDateIsInferred;return n===null?i&&(i=!1,s=null):i?s=n:this.canApplyFallback(e)&&(s=n,i=!0),new oe(be(X({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:s,scheduledDateIsInferred:i}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(s=>(n!==null&&!n.isSame(s.scheduledDate,"day")&&(s=new oe(be(X({},s),{scheduledDateIsInferred:!1}))),s))}};var Ar=class{static calculate(e){var n,s,i;let t=0;if((n=e.dueDate)!=null&&n.isValid()){let a=window.moment().startOf("day"),o=Math.round(a.diff(e.dueDate)/Ar.milliSecondsPerDay),u;o>=7?u=1:o>=-14?u=(o+14)*.8/21+.2:u=.2,t+=u*Ar.dueCoefficient}switch((s=e.scheduledDate)!=null&&s.isValid()&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*Ar.scheduledCoefficient),(i=e.startDate)!=null&&i.isValid()&&window.moment().isBefore(e.startDate)&&(t+=1*Ar.startedCoefficient),e.priority){case"0":t+=1.5*Ar.priorityCoefficient;break;case"1":t+=1*Ar.priorityCoefficient;break;case"2":t+=.65*Ar.priorityCoefficient;break;case"3":t+=.325*Ar.priorityCoefficient;break;case"5":t-=.3*Ar.priorityCoefficient;break}return t}},On=Ar;On.dueCoefficient=12,On.scheduledCoefficient=5,On.startedCoefficient=-3,On.priorityCoefficient=6,On.milliSecondsPerDay=1e3*60*60*24;var oe=class{constructor({status:e,description:t,taskLocation:n,indentation:s,listMarker:i,priority:a,createdDate:o,startDate:u,scheduledDate:l,dueDate:c,doneDate:f,cancelledDate:p,recurrence:m,dependsOn:_,id:g,blockLink:E,tags:C,originalMarkdown:R,scheduledDateIsInferred:b}){this._urgency=null;this.status=e,this.description=t,this.indentation=s,this.listMarker=i,this.taskLocation=n,this.tags=C,this.priority=a,this.createdDate=o,this.startDate=u,this.scheduledDate=l,this.dueDate=c,this.doneDate=f,this.cancelledDate=p,this.recurrence=m,this.dependsOn=_,this.id=g,this.blockLink=E,this.originalMarkdown=R,this.scheduledDateIsInferred=b}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let s=oe.extractTaskComponents(e);return s===null||!ye.getInstance().includedIn(s.body)?null:oe.parseTaskSignifiers(e,t,n)}static parseTaskSignifiers(e,t,n){let s=oe.extractTaskComponents(e);if(s===null)return null;let{taskSerializer:i}=To(),a=i.deserialize(s.body),o=!1;return Dt.canApplyFallback(a)&&n!==null&&(a.scheduledDate=n,o=!0),a.tags=a.tags.map(u=>u.trim()),a.tags=a.tags.filter(u=>!ye.getInstance().equals(u)),new oe(be(X(X({},s),a),{taskLocation:t,originalMarkdown:e,scheduledDateIsInferred:o}))}static extractTaskComponents(e){let t=e.match(Z.taskRegex);if(t===null)return null;let n=t[1],s=t[2],i=t[3],a=Oe.getInstance().bySymbolOrCreate(i),o=t[4].trim(),u=o.match(Z.blockLinkRegex),l=u!==null?u[0]:"";return l!==""&&(o=o.replace(Z.blockLinkRegex,"").trim()),{indentation:n,listMarker:s,status:a,body:o,blockLink:l}}toString(){return To().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Ft.getLogger("tasks.Task"),t="toggle()";ol(e,t,this);let n=Oe.getInstance().getNextStatusOrCreate(this.status),s=this.handleNewStatus(n);return ul(e,t,s),s}handleNewStatus(e,t=window.moment()){if(e.identicalTo(this.status))return[this];let{setDoneDate:n}=ee(),s=this.newDate(e,"DONE",this.doneDate,n,t),{setCancelledDate:i}=ee(),a=this.newDate(e,"CANCELLED",this.cancelledDate,i,t),o=null;e.isCompleted()&&!this.status.isCompleted()&&this.recurrence!==null&&(o=this.recurrence.next(t));let u=new oe(be(X({},this),{status:e,doneDate:s,cancelledDate:a})),l=[];if(o!==null){let c=this.createNextOccurrence(e,o);l.push(c)}return l.push(u),l}newDate(e,t,n,s,i){let a=null;return e.type===t&&(this.status.type!==t?s&&(a=i):a=n),a}createNextOccurrence(e,t){let{setCreatedDate:n}=ee(),s=null;n&&(s=window.moment());let i=null,a=null,u=Oe.getInstance().getNextRecurrenceStatusOrCreate(e);return new oe(be(X(X({},this),t),{status:u,blockLink:"",id:"",dependsOn:[],createdDate:s,cancelledDate:i,doneDate:a}))}toggleWithRecurrenceInUsersOrder(){let e=this.toggle();return this.putRecurrenceInUsersOrder(e)}handleNewStatusWithRecurrenceInUsersOrder(e,t=window.moment()){Ft.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to '${e.symbol}'`);let s=this.handleNewStatus(e,t);return this.putRecurrenceInUsersOrder(s)}putRecurrenceInUsersOrder(e){let{recurrenceOnNextLine:t}=ee();return t?e.reverse():e}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}isBlocked(e){if(this.dependsOn.length===0||this.isDone)return!1;for(let t of this.dependsOn)if(!!e.find(s=>s.id===t&&!s.isDone))return!0;return!1}isBlocking(e){return this.id===""||this.isDone?!1:e.some(t=>t.isDone?!1:t.dependsOn.includes(this.id))}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let e=Sn.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${e} priority`}get descriptionWithoutTags(){return this.description.replace(Z.hashTags,"").trim()}get priorityName(){return Sn.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=On.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get cancelled(){return new ze(this.cancelledDate)}get created(){return new ze(this.createdDate)}get done(){return new ze(this.doneDate)}get due(){return new ze(this.dueDate)}get scheduled(){return new ze(this.scheduledDate)}get start(){return new ze(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let e=this.happensDates,t=Array.from(e).sort(_r);for(let n of t)if(n!=null&&n.isValid())return new ze(n);return new ze(null)}get isRecurring(){return this.recurrence!==null}get recurrenceRule(){return this.recurrence?this.recurrence.toText():""}get heading(){return this.precedingHeader}get hasHeading(){return this.precedingHeader!==null}get file(){return new wi(this.path)}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,s)=>n.identicalTo(t[s]))}identicalTo(e){var i,a;let t=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred","id","dependsOn"];for(let o of t)if(((i=this[o])==null?void 0:i.toString())!==((a=e[o])==null?void 0:a.toString()))return!1;if(!this.status.identicalTo(e.status)||this.tags.length!==e.tags.length||!this.tags.every(function(o,u){return o===e.tags[u]}))return!1;t=oe.allDateFields();for(let o of t){let u=this[o],l=e[o];if(_r(u,l)!==0)return!1}let n=this.recurrence,s=e.recurrence;return n===null&&s!==null||n!==null&&s===null?!1:!(n&&s&&!n.identicalTo(s))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate","cancelledDate"]}static extractHashtags(e){var t,n;return(n=(t=e.match(Z.hashTags))==null?void 0:t.map(s=>s.trim()))!=null?n:[]}};var _o=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var vt=class{constructor(e,t,n,s,i){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=s,this._precedingHeader=i}static fromUnknownPosition(e){return new vt(e,0,0,0,null)}fromRenamedFile(e){return new vt(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}get hasKnownPath(){return this.path!==""}};var Ds=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=Ft.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new tu,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){this.logger.info("Unloading Cache");for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}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 e=this.metadataCache.on("resolved",()=>L(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:e}=ee(),t=this.vault.on("create",i=>{i instanceof ki.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${i.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(i)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",i=>{i instanceof ki.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${i.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==i.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let s=this.vault.on("rename",(i,a)=>{i instanceof ki.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${i.path}`),this.tasksMutex.runExclusive(()=>{let o=new _o(()=>Dt.fromPath(i.path));this.tasks=this.tasks.map(u=>u.path===a?e?Dt.updateTaskPath(u,i.path,o.value):new oe(be(X({},u),{taskLocation:u.taskLocation.fromRenamedFile(i.path)})):u),this.notifySubscribers()}))});this.vaultEventReferences.push(s)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>L(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(e){return L(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;if(!e.path.endsWith(".md")){this.logger.debug("indexFile: skipping non-markdown file: "+e.path);return}this.logger.debug("Cache.indexFile: "+e.path);let n=this.tasks.filter(a=>a.path===e.path),s=t.listItems,i=[];if(s!==void 0){let a=yield this.vault.cachedRead(e);i=this.getTasksFromFileContent(a,s,t,e)}oe.tasksListsIdentical(n,i)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...i),this.logger.debug("Cache.indexFile: "+e.path+`: read ${i.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,s){let i=[],a=e.split(`
`),o=a.length,u=new _o(()=>Dt.fromPath(s.path)),l=null,c=0;for(let f of t)if(f.task!==void 0){let p=f.position.start.line;if(p>=o)return this.logger.debug(`${s.path} Obsidian gave us a line number ${p} past the end of the file. ${o}.`),i;if((l===null||l.position.end.line<p)&&(l=Ds.getSection(p,n.sections),c=0),l===null)continue;let m=a[p];if(m===void 0){this.logger.debug(`${s.path}: line ${p} - ignoring 'undefined' line.`);continue}let _;try{_=oe.fromLine({line:m,taskLocation:new vt(s.path,p,l.position.start.line,c,Ds.getPrecedingHeader(p,n.headings)),fallbackDate:u.value})}catch(g){this.reportTaskParsingErrorToUser(g,s,f,m);continue}_!==null&&(c++,i.push(_))}return i}reportTaskParsingErrorToUser(e,t,n,s){let i=`There was an error reading one of the tasks in this vault.
The following task has been ignored, to prevent Tasks queries getting stuck with 'Loading Tasks ...'
Error: ${e}
File: ${t.path}
Line number: ${n.position.start.line}
Task line: ${s}
Please create a bug report for this message at
https://github.com/obsidian-tasks-group/obsidian-tasks/issues/new/choose
to help us find and fix the underlying issue.
Include:
- either a screenshot of the error popup, or copy the text from the console, if on a desktop machine.
- the output from running the Obsidian command 'Show debug info'
The error popup will only be shown when Tasks is starting up, but if the error persists,
it will be shown in the console every time this file is edited during the Obsidian
session.
`;this.logger.error(i),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new ki.Notice(i,1e4)}static getSection(e,t){if(t===void 0)return null;for(let n of t)if(n.position.start.line<=e&&n.position.end.line>=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var th=require("obsidian");var kw=require("obsidian");function tr(){}function Im(r){return r()}function Sv(){return Object.create(null)}function vr(r){r.forEach(Im)}function dl(r){return typeof r=="function"}function fl(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Dv(r){return Object.keys(r).length===0}var xv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,wo=class{constructor(e){this.options=e,this._listeners="WeakMap"in xv?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var n;for(let s of t)wo.entries.set(s.target,s),(n=this._listeners.get(s.target))===null||n===void 0||n(s)})}};wo.entries="WeakMap"in xv?new WeakMap:void 0;var Rv=!1;function KP(){Rv=!0}function QP(){Rv=!1}function D(r,e){r.appendChild(e)}function Ve(r,e,t){r.insertBefore(e,t||null)}function qe(r){r.parentNode&&r.parentNode.removeChild(r)}function xi(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function B(r){return document.createElement(r)}function XP(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Re(r){return document.createTextNode(r)}function K(){return Re(" ")}function Te(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Mv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function A(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Cv(r){let e;return{p(...t){e=t,e.forEach(n=>r.push(n))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function ZP(r){return Array.from(r.childNodes)}function Dn(r,e){e=""+e,r.data!==e&&(r.data=e)}function et(r,e){r.value=e==null?"":e}function Fm(r,e,t){for(let n=0;n<r.options.length;n+=1){let s=r.options[n];if(s.__value===e){s.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Av(r){let e=r.querySelector(":checked");return e&&e.__value}var ll;function JP(){if(ll===void 0){ll=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){ll=!0}}return ll}function Pv(r,e){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=B("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 s=JP(),i;return s?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",i=Te(window,"message",a=>{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{i=Te(n.contentWindow,"resize",e),e()}),D(r,n),()=>{(s||i&&n.contentWindow)&&i(),qe(n)}}function tt(r,e,t){r.classList[t?"add":"remove"](e)}var Xr=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=XP(t.nodeName):this.e=B(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Ve(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(qe)}};var ko;function vo(r){ko=r}function eN(){if(!ko)throw new Error("Function called outside component initialization");return ko}function Lm(r){eN().$$.on_mount.push(r)}var Si=[];var Rs=[],Oi=[],Ov=[],tN=Promise.resolve(),Nm=!1;function rN(){Nm||(Nm=!0,tN.then(Nv))}function Ms(r){Oi.push(r)}var Pm=new Set,Ei=0;function Nv(){if(Ei!==0)return;let r=ko;do{try{for(;Ei<Si.length;){let e=Si[Ei];Ei++,vo(e),nN(e.$$)}}catch(e){throw Si.length=0,Ei=0,e}for(vo(null),Si.length=0,Ei=0;Rs.length;)Rs.pop()();for(let e=0;e<Oi.length;e+=1){let t=Oi[e];Pm.has(t)||(Pm.add(t),t())}Oi.length=0}while(Si.length);for(;Ov.length;)Ov.pop()();Nm=!1,Pm.clear(),vo(r)}function nN(r){if(r.fragment!==null){r.update(),vr(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Ms)}}function sN(r){let e=[],t=[];Oi.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Oi=e}var cl=new Set,xs;function Iv(){xs={r:0,c:[],p:xs}}function Fv(){xs.r||vr(xs.c),xs=xs.p}function Ri(r,e){r&&r.i&&(cl.delete(r),r.i(e))}function Eo(r,e,t,n){if(r&&r.o){if(cl.has(r))return;cl.add(r),xs.c.push(()=>{cl.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var iN=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],q3=new Set([...iN]);function Um(r){r&&r.c()}function pl(r,e,t,n){let{fragment:s,after_update:i}=r.$$;s&&s.m(e,t),n||Ms(()=>{let a=r.$$.on_mount.map(Im).filter(dl);r.$$.on_destroy?r.$$.on_destroy.push(...a):vr(a),r.$$.on_mount=[]}),i.forEach(Ms)}function So(r,e){let t=r.$$;t.fragment!==null&&(sN(t.after_update),vr(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function aN(r,e){r.$$.dirty[0]===-1&&(Si.push(r),rN(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function ml(r,e,t,n,s,i,a,o=[-1]){let u=ko;vo(r);let l=r.$$={fragment:null,ctx:[],props:i,update:tr,not_equal:s,bound:Sv(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Sv(),dirty:o,skip_bound:!1,root:e.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=t?t(r,e.props||{},(f,p,...m)=>{let _=m.length?m[0]:p;return l.ctx&&s(l.ctx[f],l.ctx[f]=_)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](_),c&&aN(r,f)),p}):[],l.update(),c=!0,vr(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){KP();let f=ZP(e.target);l.fragment&&l.fragment.l(f),f.forEach(qe)}else l.fragment&&l.fragment.c();e.intro&&Ri(r.$$.fragment),pl(r,e.target,e.anchor,e.customElement),QP(),Nv()}vo(u)}var oN;typeof HTMLElement=="function"&&(oN=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Im).filter(dl);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){vr(this.$$.on_disconnect)}$destroy(){So(this,1),this.$destroy=tr}$on(r,e){if(!dl(e))return tr;let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!Dv(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Di=class{$destroy(){So(this,1),this.$destroy=tr}$on(e,t){if(!dl(t))return tr;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!Dv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function Wm(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?i(c.value):s(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})}var Jm=ua(rt());function qm(r){let e="",t=!0;for(;t;)e=Math.random().toString(36).substring(2,6+2),r.includes(e)||(t=!1);return e}function Lv(r,e){return r.id!==""?r:new oe(be(X({},r),{id:qm(e)}))}function Uv(r,e){let t=r;if(!r.dependsOn.includes(e.id)){let n=[...r.dependsOn,e.id];t=new oe(be(X({},r),{dependsOn:n}))}return t}function Wv(r,e){let t=r;if(r.dependsOn.includes(e.id)){let n=r.dependsOn.filter(s=>s!==e.id);t=new oe(be(X({},r),{dependsOn:n}))}return t}var Do=require("obsidian");var Oo,jm,Gm,uN=["md"];function yl(){return Ft.getLogger("tasks.File")}var qv=({metadataCache:r,vault:e,workspace:t})=>{Oo=r,jm=e,Gm=t},Zr=t=>L(void 0,[t],function*({originalTask:r,newTasks:e}){if(jm===void 0||Oo===void 0||Gm===void 0){hl("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=yl(),s="replaceTaskWithTasks()";ol(n,s,r),ul(n,s,e),yield Gv({originalTask:r,newTasks:e,vault:jm,metadataCache:Oo,workspace:Gm,previousTries:0})});function hl(r){console.error(r),new Do.Notice(r,15e3)}function jv(r){console.warn(r),new Do.Notice(r,1e4)}function lN(r){yl().debug(r)}var Qn=class extends Error{},gl=class extends Error{},Gv=a=>L(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:i}){let o=yl();o.debug(`tryRepetitive after ${i} previous tries`);let u=()=>L(void 0,null,function*(){if(i>10){let c=`Tasks: Could not find the correct task line to update.
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.
`;hl(c);return}let l=Math.min(Math.pow(10,i),100);o.debug(`timeout = ${l}`),setTimeout(()=>L(void 0,null,function*(){yield Gv({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:i+1})}),l)});try{let[l,c,f]=yield Yv(r,t),p=[...f.slice(0,l),...e.map(m=>m.toFileLineString()),...f.slice(l+1)];yield t.modify(c,p.join(`
`))}catch(l){if(l instanceof Qn){l.message&&jv(l.message),yield u();return}else if(l instanceof gl){yield u();return}else l instanceof Error&&hl(l.message)}});function Yv(r,e){return L(this,null,function*(){if(Oo===void 0)throw new Qn;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Do.TFile))throw new Qn(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!uN.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Oo.getFileCache(t);if(n==null||n===null)throw new Qn(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let s=n.listItems;if(s===void 0||s.length===0)throw new Qn(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(`
`),o=cN(r,a,s,lN);if(o===void 0)throw new gl;return[o,t,a]})}function Ym(r,e){return L(this,null,function*(){try{let[t,n,s]=yield Yv(r,e);return[t,n]}catch(t){t instanceof Qn?t.message&&jv(t.message):t instanceof Error&&hl(t.message)}})}function Bv(r,e){return r<e.length}function cN(r,e,t,n){let s=dN(r,e);return s!==void 0||(s=fN(r,e),s!==void 0)?s:pN(r,e,t,n)}function dN(r,e){let t=r.taskLocation.lineNumber;if(Bv(t,e)&&e[t]===r.originalMarkdown)return yl().debug(`Found original markdown at original line number ${t}`),t}function fN(r,e){let t=[];for(let n=0;n<e.length;n++)e[n]===r.originalMarkdown&&t.push(n);if(t.length===1)return t[0]}function pN(r,e,t,n){let s,i=0;for(let a of t){let o=a.position.start.line;if(!Bv(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(ye.getInstance().includedIn(u)){if(i===r.taskLocation.sectionIndex){if(u===r.originalMarkdown)s=o;else{n(`Tasks: Unable to find task in file ${r.taskLocation.path}.
Expected task:
${r.originalMarkdown}
Found task:
${u}`);return}break}i++}}return s}var Cs=Math.min,Gt=Math.max,Ro=Math.round;var xn=r=>({x:r,y:r}),mN={left:"right",right:"left",bottom:"top",top:"bottom"},hN={start:"end",end:"start"};function Bm(r,e,t){return Gt(r,Cs(e,t))}function Mi(r,e){return typeof r=="function"?r(e):r}function Rn(r){return r.split("-")[0]}function Ci(r){return r.split("-")[1]}function $m(r){return r==="x"?"y":"x"}function Hm(r){return r==="y"?"height":"width"}function Ai(r){return["top","bottom"].includes(Rn(r))?"y":"x"}function zm(r){return $m(Ai(r))}function $v(r,e,t){t===void 0&&(t=!1);let n=Ci(r),s=zm(r),i=Hm(s),a=s==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=xo(a)),[a,xo(a)]}function Hv(r){let e=xo(r);return[bl(r),e,bl(e)]}function bl(r){return r.replace(/start|end/g,e=>hN[e])}function gN(r,e,t){let n=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(r){case"top":case"bottom":return t?e?s:n:e?n:s;case"left":case"right":return e?i:a;default:return[]}}function zv(r,e,t,n){let s=Ci(r),i=gN(Rn(r),t==="start",n);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(bl)))),i}function xo(r){return r.replace(/left|right|bottom|top/g,e=>mN[e])}function yN(r){return X({top:0,right:0,bottom:0,left:0},r)}function Vv(r){return typeof r!="number"?yN(r):{top:r,right:r,bottom:r,left:r}}function As(r){return be(X({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function Kv(r,e,t){let{reference:n,floating:s}=r,i=Ai(e),a=zm(e),o=Hm(a),u=Rn(e),l=i==="y",c=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[o]/2-s[o]/2,m;switch(u){case"top":m={x:c,y:n.y-s.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(Ci(e)){case"start":m[a]-=p*(t&&l?-1:1);break;case"end":m[a]+=p*(t&&l?-1:1);break}return m}var Qv=(r,e,t)=>L(void 0,null,function*(){let{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:a}=t,o=i.filter(Boolean),u=yield a.isRTL==null?void 0:a.isRTL(e),l=yield a.getElementRects({reference:r,floating:e,strategy:s}),{x:c,y:f}=Kv(l,n,u),p=n,m={},_=0;for(let g=0;g<o.length;g++){let{name:E,fn:C}=o[g],{x:R,y:b,data:z,reset:U}=yield C({x:c,y:f,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:l,platform:a,elements:{reference:r,floating:e}});if(c=R!=null?R:c,f=b!=null?b:f,m=be(X({},m),{[E]:X(X({},m[E]),z)}),U&&_<=50){_++,typeof U=="object"&&(U.placement&&(p=U.placement),U.rects&&(l=U.rects===!0?yield a.getElementRects({reference:r,floating:e,strategy:s}):U.rects),{x:c,y:f}=Kv(l,p,u)),g=-1;continue}}return{x:c,y:f,placement:p,strategy:s,middlewareData:m}});function Tl(r,e){return L(this,null,function*(){var t;e===void 0&&(e={});let{x:n,y:s,platform:i,rects:a,elements:o,strategy:u}=r,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=Mi(e,r),_=Vv(m),E=o[p?f==="floating"?"reference":"floating":f],C=As(yield i.getClippingRect({element:(t=yield i.isElement==null?void 0:i.isElement(E))==null||t?E:E.contextElement||(yield i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:c,strategy:u})),R=f==="floating"?be(X({},a.floating),{x:n,y:s}):a.reference,b=yield i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating),z=(yield i.isElement==null?void 0:i.isElement(b))?(yield i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},U=As(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:R,offsetParent:b,strategy:u}):R);return{top:(C.top-U.top+_.top)/z.y,bottom:(U.bottom-C.bottom+_.bottom)/z.y,left:(C.left-U.left+_.left)/z.x,right:(U.right-C.right+_.right)/z.x}})}var Vm=function(r){return r===void 0&&(r={}),{name:"flip",options:r,fn(t){return L(this,null,function*(){var n,s;let{placement:i,middlewareData:a,rects:o,initialPlacement:u,platform:l,elements:c}=t,O=Mi(r,t),{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:E=!0}=O,C=eu(O,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let R=Rn(i),b=Rn(u)===u,z=yield l.isRTL==null?void 0:l.isRTL(c.floating),U=m||(b||!E?[xo(u)]:Hv(u));!m&&g!=="none"&&U.push(...zv(u,E,g,z));let ne=[u,...U],G=yield Tl(t,C),Y=[],te=((s=a.flip)==null?void 0:s.overflows)||[];if(f&&Y.push(G[R]),p){let $=$v(i,o,z);Y.push(G[$[0]],G[$[1]])}if(te=[...te,{placement:i,overflows:Y}],!Y.every($=>$<=0)){var _e,W;let $=(((_e=a.flip)==null?void 0:_e.index)||0)+1,P=ne[$];if(P)return{data:{index:$,overflows:te},reset:{placement:P}};let Q=(W=te.filter(d=>d.overflows[0]<=0).sort((d,h)=>d.overflows[1]-h.overflows[1])[0])==null?void 0:W.placement;if(!Q)switch(_){case"bestFit":{var I;let d=(I=te.map(h=>[h.placement,h.overflows.filter(y=>y>0).reduce((y,T)=>y+T,0)]).sort((h,y)=>h[1]-y[1])[0])==null?void 0:I[0];d&&(Q=d);break}case"initialPlacement":Q=u;break}if(i!==Q)return{reset:{placement:Q}}}return{}})}}};function bN(r,e){return L(this,null,function*(){let{placement:t,platform:n,elements:s}=r,i=yield n.isRTL==null?void 0:n.isRTL(s.floating),a=Rn(t),o=Ci(t),u=Ai(t)==="y",l=["left","top"].includes(a)?-1:1,c=i&&u?-1:1,f=Mi(e,r),{mainAxis:p,crossAxis:m,alignmentAxis:_}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:X({mainAxis:0,crossAxis:0,alignmentAxis:null},f);return o&&typeof _=="number"&&(m=o==="end"?_*-1:_),u?{x:m*c,y:p*l}:{x:p*l,y:m*c}})}var _l=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(t){return L(this,null,function*(){var n,s;let{x:i,y:a,placement:o,middlewareData:u}=t,l=yield bN(t,r);return o===((n=u.offset)==null?void 0:n.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:be(X({},l),{placement:o})}})}}},vl=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(t){return L(this,null,function*(){let{x:n,y:s,placement:i}=t,C=Mi(r,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:u={fn:R=>{let{x:b,y:z}=R;return{x:b,y:z}}}}=C,l=eu(C,["mainAxis","crossAxis","limiter"]),c={x:n,y:s},f=yield Tl(t,l),p=Ai(Rn(i)),m=$m(p),_=c[m],g=c[p];if(a){let R=m==="y"?"top":"left",b=m==="y"?"bottom":"right",z=_+f[R],U=_-f[b];_=Bm(z,_,U)}if(o){let R=p==="y"?"top":"left",b=p==="y"?"bottom":"right",z=g+f[R],U=g-f[b];g=Bm(z,g,U)}let E=u.fn(be(X({},t),{[m]:_,[p]:g}));return be(X({},E),{data:{x:E.x-n,y:E.y-s}})})}}};var Km=function(r){return r===void 0&&(r={}),{name:"size",options:r,fn(t){return L(this,null,function*(){let{placement:n,rects:s,platform:i,elements:a}=t,G=Mi(r,t),{apply:o=()=>{}}=G,u=eu(G,["apply"]),l=yield Tl(t,u),c=Rn(n),f=Ci(n),p=Ai(n)==="y",{width:m,height:_}=s.floating,g,E;c==="top"||c==="bottom"?(g=c,E=f===((yield i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(E=c,g=f==="end"?"top":"bottom");let C=_-l[g],R=m-l[E],b=!t.middlewareData.shift,z=C,U=R;if(p){let Y=m-l.left-l.right;U=f||b?Cs(R,Y):Y}else{let Y=_-l.top-l.bottom;z=f||b?Cs(C,Y):Y}if(b&&!f){let Y=Gt(l.left,0),te=Gt(l.right,0),_e=Gt(l.top,0),W=Gt(l.bottom,0);p?U=m-2*(Y!==0||te!==0?Y+te:Gt(l.left,l.right)):z=_-2*(_e!==0||W!==0?_e+W:Gt(l.top,l.bottom))}yield o(be(X({},t),{availableWidth:U,availableHeight:z}));let ne=yield i.getDimensions(a.floating);return m!==ne.width||_!==ne.height?{reset:{rects:!0}}:{}})}}};function Mn(r){return Zv(r)?(r.nodeName||"").toLowerCase():"#document"}function Yt(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Cn(r){var e;return(e=(Zv(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Zv(r){return r instanceof Node||r instanceof Yt(r).Node}function Jr(r){return r instanceof Element||r instanceof Yt(r).Element}function Pr(r){return r instanceof HTMLElement||r instanceof Yt(r).HTMLElement}function Xv(r){return typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof Yt(r).ShadowRoot}function Pi(r){let{overflow:e,overflowX:t,overflowY:n,display:s}=rr(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(s)}function Jv(r){return["table","td","th"].includes(Mn(r))}function kl(r){let e=El(),t=rr(r);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function ew(r){let e=Ps(r);for(;Pr(e)&&!Mo(e);){if(kl(e))return e;e=Ps(e)}return null}function El(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Mo(r){return["html","body","#document"].includes(Mn(r))}function rr(r){return Yt(r).getComputedStyle(r)}function Co(r){return Jr(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function Ps(r){if(Mn(r)==="html")return r;let e=r.assignedSlot||r.parentNode||Xv(r)&&r.host||Cn(r);return Xv(e)?e.host:e}function tw(r){let e=Ps(r);return Mo(e)?r.ownerDocument?r.ownerDocument.body:r.body:Pr(e)&&Pi(e)?e:tw(e)}function wl(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);let s=tw(r),i=s===((n=r.ownerDocument)==null?void 0:n.body),a=Yt(s);return i?e.concat(a,a.visualViewport||[],Pi(s)?s:[],a.frameElement&&t?wl(a.frameElement):[]):e.concat(s,wl(s,[],t))}function sw(r){let e=rr(r),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,s=Pr(r),i=s?r.offsetWidth:t,a=s?r.offsetHeight:n,o=Ro(t)!==i||Ro(n)!==a;return o&&(t=i,n=a),{width:t,height:n,$:o}}function iw(r){return Jr(r)?r:r.contextElement}function Ni(r){let e=iw(r);if(!Pr(e))return xn(1);let t=e.getBoundingClientRect(),{width:n,height:s,$:i}=sw(e),a=(i?Ro(t.width):t.width)/n,o=(i?Ro(t.height):t.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var TN=xn(0);function aw(r){let e=Yt(r);return!El()||!e.visualViewport?TN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _N(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==Yt(r)?!1:e}function Ao(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);let s=r.getBoundingClientRect(),i=iw(r),a=xn(1);e&&(n?Jr(n)&&(a=Ni(n)):a=Ni(r));let o=_N(i,t,n)?aw(i):xn(0),u=(s.left+o.x)/a.x,l=(s.top+o.y)/a.y,c=s.width/a.x,f=s.height/a.y;if(i){let p=Yt(i),m=n&&Jr(n)?Yt(n):n,_=p.frameElement;for(;_&&n&&m!==p;){let g=Ni(_),E=_.getBoundingClientRect(),C=rr(_),R=E.left+(_.clientLeft+parseFloat(C.paddingLeft))*g.x,b=E.top+(_.clientTop+parseFloat(C.paddingTop))*g.y;u*=g.x,l*=g.y,c*=g.x,f*=g.y,u+=R,l+=b,_=Yt(_).frameElement}}return As({width:c,height:f,x:u,y:l})}function vN(r){let{rect:e,offsetParent:t,strategy:n}=r,s=Pr(t),i=Cn(t);if(t===i)return e;let a={scrollLeft:0,scrollTop:0},o=xn(1),u=xn(0);if((s||!s&&n!=="fixed")&&((Mn(t)!=="body"||Pi(i))&&(a=Co(t)),Pr(t))){let l=Ao(t);o=Ni(t),u.x=l.x+t.clientLeft,u.y=l.y+t.clientTop}return{width:e.width*o.x,height:e.height*o.y,x:e.x*o.x-a.scrollLeft*o.x+u.x,y:e.y*o.y-a.scrollTop*o.y+u.y}}function wN(r){return Array.from(r.getClientRects())}function ow(r){return Ao(Cn(r)).left+Co(r).scrollLeft}function kN(r){let e=Cn(r),t=Co(r),n=r.ownerDocument.body,s=Gt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Gt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ow(r),o=-t.scrollTop;return rr(n).direction==="rtl"&&(a+=Gt(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:a,y:o}}function EN(r,e){let t=Yt(r),n=Cn(r),s=t.visualViewport,i=n.clientWidth,a=n.clientHeight,o=0,u=0;if(s){i=s.width,a=s.height;let l=El();(!l||l&&e==="fixed")&&(o=s.offsetLeft,u=s.offsetTop)}return{width:i,height:a,x:o,y:u}}function SN(r,e){let t=Ao(r,!0,e==="fixed"),n=t.top+r.clientTop,s=t.left+r.clientLeft,i=Pr(r)?Ni(r):xn(1),a=r.clientWidth*i.x,o=r.clientHeight*i.y,u=s*i.x,l=n*i.y;return{width:a,height:o,x:u,y:l}}function rw(r,e,t){let n;if(e==="viewport")n=EN(r,t);else if(e==="document")n=kN(Cn(r));else if(Jr(e))n=SN(e,t);else{let s=aw(r);n=be(X({},e),{x:e.x-s.x,y:e.y-s.y})}return As(n)}function uw(r,e){let t=Ps(r);return t===e||!Jr(t)||Mo(t)?!1:rr(t).position==="fixed"||uw(t,e)}function ON(r,e){let t=e.get(r);if(t)return t;let n=wl(r,[],!1).filter(o=>Jr(o)&&Mn(o)!=="body"),s=null,i=rr(r).position==="fixed",a=i?Ps(r):r;for(;Jr(a)&&!Mo(a);){let o=rr(a),u=kl(a);!u&&o.position==="fixed"&&(s=null),(i?!u&&!s:!u&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Pi(a)&&!u&&uw(r,a))?n=n.filter(c=>c!==a):s=o,a=Ps(a)}return e.set(r,n),n}function DN(r){let{element:e,boundary:t,rootBoundary:n,strategy:s}=r,a=[...t==="clippingAncestors"?ON(e,this._c):[].concat(t),n],o=a[0],u=a.reduce((l,c)=>{let f=rw(e,c,s);return l.top=Gt(f.top,l.top),l.right=Cs(f.right,l.right),l.bottom=Cs(f.bottom,l.bottom),l.left=Gt(f.left,l.left),l},rw(e,o,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function xN(r){return sw(r)}function RN(r,e,t){let n=Pr(e),s=Cn(e),i=t==="fixed",a=Ao(r,!0,i,e),o={scrollLeft:0,scrollTop:0},u=xn(0);if(n||!n&&!i)if((Mn(e)!=="body"||Pi(s))&&(o=Co(e)),n){let l=Ao(e,!0,i,e);u.x=l.x+e.clientLeft,u.y=l.y+e.clientTop}else s&&(u.x=ow(s));return{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function nw(r,e){return!Pr(r)||rr(r).position==="fixed"?null:e?e(r):r.offsetParent}function lw(r,e){let t=Yt(r);if(!Pr(r))return t;let n=nw(r,e);for(;n&&Jv(n)&&rr(n).position==="static";)n=nw(n,e);return n&&(Mn(n)==="html"||Mn(n)==="body"&&rr(n).position==="static"&&!kl(n))?t:n||ew(r)||t}var MN=function(r){return L(this,null,function*(){let{reference:e,floating:t,strategy:n}=r,s=this.getOffsetParent||lw,i=this.getDimensions;return{reference:RN(e,yield s(t),n),floating:X({x:0,y:0},yield i(t))}})};function CN(r){return rr(r).direction==="rtl"}var AN={convertOffsetParentRelativeRectToViewportRelativeRect:vN,getDocumentElement:Cn,getClippingRect:DN,getOffsetParent:lw,getElementRects:MN,getClientRects:wN,getDimensions:xN,getScale:Ni,isElement:Jr,isRTL:CN};var Qm=(r,e,t)=>{let n=new Map,s=X({platform:AN},t),i=be(X({},s.platform),{_c:n});return Qv(r,e,be(X({},s),{platform:i}))};var cw=require("obsidian");var PN=20;function Ns(r){return ye.getInstance().removeAsWordFrom(r.description)}function NN(r,e){if(r==="")return e;let t=(0,cw.prepareSimpleSearch)(r),n=-4;return e.map(a=>{let o=t(Ns(a));return o&&o.score>n?{item:a,match:o}:null}).filter(Boolean).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item)}function dw(r,e,t,n,s){let i=NN(r,e);return i=i.filter(a=>{if(a.isDone||a.description.includes("<%")&&a.description.includes("%>"))return!1;let o=a.description===t.description&&a.taskLocation.path===t.taskLocation.path&&a.originalMarkdown===t.originalMarkdown;return![...n,...s].includes(a)&&!o}),i.sort((a,o)=>{let u=a.taskLocation.path===t.taskLocation.path,l=o.taskLocation.path===t.taskLocation.path;return u&&l?Math.abs(a.taskLocation.lineNumber-t.taskLocation.lineNumber)-Math.abs(o.taskLocation.lineNumber-t.taskLocation.lineNumber):u?-1:l?1:0}),i.slice(0,PN)}function fw(r,e,t){let n=r.slice();return n[5]=e[t],n}function pw(r,e,t){let n=r.slice();n[40]=e[t],n[43]=t;let s=n[17](n[40].taskLocation.path);return n[41]=s,n}function mw(r){let e,t,n,s=r[10],i=[];for(let a=0;a<s.length;a+=1)i[a]=gw(pw(r,s,a));return{c(){e=B("ul");for(let a=0;a<i.length;a+=1)i[a].c();A(e,"class","task-dependency-dropdown")},m(a,o){Ve(a,e,o);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);r[31](e),t||(n=Te(e,"mouseleave",r[32]),t=!0)},p(a,o){if(o[0]&928832){s=a[10];let u;for(u=0;u<s.length;u+=1){let l=pw(a,s,u);i[u]?i[u].p(l,o):(i[u]=gw(l),i[u].c(),i[u].m(e,null))}for(;u<i.length;u+=1)i[u].d(1);i.length=s.length}},d(a){a&&qe(e),xi(i,a),r[31](null),t=!1,n()}}}function hw(r){let e,t=r[41]+"",n,s,i;function a(...o){return r[28](r[41],...o)}return{c(){e=B("div"),n=Re(t),A(e,"class","dependency-path")},m(o,u){Ve(o,e,u),D(e,n),s||(i=Te(e,"mouseenter",a),s=!0)},p(o,u){r=o,u[0]&1024&&t!==(t=r[41]+"")&&Dn(n,t)},d(o){o&&qe(e),s=!1,i()}}}function gw(r){let e,t,n,s=r[40].status.symbol+"",i,a,o=Ns(r[40])+"",u,l,c,f,p,m;function _(...R){return r[27](r[40],...R)}let g=r[41]&&hw(r);function E(){return r[29](r[40])}function C(){return r[30](r[43])}return{c(){e=B("li"),t=B("div"),n=Re("["),i=Re(s),a=Re("] "),u=Re(o),c=K(),g&&g.c(),f=K(),A(t,"class",l=r[41]?"dependency-name-shared":"dependency-name"),tt(e,"selected",r[6]!==null&&r[43]===r[11])},m(R,b){Ve(R,e,b),D(e,t),D(t,n),D(t,i),D(t,a),D(t,u),D(e,c),g&&g.m(e,null),D(e,f),p||(m=[Te(t,"mouseenter",_),Te(e,"mousedown",E),Te(e,"mouseenter",C)],p=!0)},p(R,b){r=R,b[0]&1024&&s!==(s=r[40].status.symbol+"")&&Dn(i,s),b[0]&1024&&o!==(o=Ns(r[40])+"")&&Dn(u,o),b[0]&1024&&l!==(l=r[41]?"dependency-name-shared":"dependency-name")&&A(t,"class",l),r[41]?g?g.p(r,b):(g=hw(r),g.c(),g.m(e,f)):g&&(g.d(1),g=null),b[0]&2112&&tt(e,"selected",r[6]!==null&&r[43]===r[11])},d(R){R&&qe(e),g&&g.d(),p=!1,vr(m)}}}function yw(r){let e,t,n,s=r[5].status.symbol+"",i,a,o=Ns(r[5])+"",u,l,c,f,p,m;function _(){return r[33](r[5])}function g(...E){return r[34](r[5],...E)}return{c(){e=B("div"),t=B("span"),n=Re("["),i=Re(s),a=Re("] "),u=Re(o),l=K(),c=B("button"),c.innerHTML='<svg style="display: block; margin: auto;" xmlns="http://www.w3.org/2000/svg" width="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>',f=K(),A(t,"class","task-dependency-name"),A(c,"type","button"),A(c,"class","task-dependency-delete"),A(e,"class","task-dependency")},m(E,C){Ve(E,e,C),D(e,t),D(t,n),D(t,i),D(t,a),D(t,u),D(e,l),D(e,c),D(e,f),p||(m=[Te(c,"click",_),Te(e,"mouseenter",g)],p=!0)},p(E,C){r=E,C[0]&3&&s!==(s=r[5].status.symbol+"")&&Dn(i,s),C[0]&3&&o!==(o=Ns(r[5])+"")&&Dn(u,o)},d(E){E&&qe(e),p=!1,vr(m)}}}function IN(r){let e,t,n,s,i,a,o,u,l,c=r[10]&&r[10].length!==0&&mw(r),f=r[0][r[1]],p=[];for(let m=0;m<f.length;m+=1)p[m]=yw(fw(r,f,m));return{c(){e=B("span"),t=B("input"),i=K(),c&&c.c(),a=K(),o=B("div");for(let m=0;m<p.length;m+=1)p[m].c();A(t,"accesskey",n=r[2](r[3])),A(t,"id",r[1]),A(t,"class","input"),A(t,"type","text"),A(t,"placeholder",r[4]),A(e,"class","input"),Ms(()=>r[26].call(e)),A(o,"class","task-dependencies-container results")},m(m,_){Ve(m,e,_),D(e,t),r[22](t),et(t,r[6]),s=Pv(e,r[26].bind(e)),Ve(m,i,_),c&&c.m(m,_),Ve(m,a,_),Ve(m,o,_);for(let g=0;g<p.length;g+=1)p[g]&&p[g].m(o,null);u||(l=[Te(t,"input",r[23]),Te(t,"keydown",r[24]),Te(t,"focus",r[16]),Te(t,"blur",r[25])],u=!0)},p(m,_){if(_[0]&12&&n!==(n=m[2](m[3]))&&A(t,"accesskey",n),_[0]&2&&A(t,"id",m[1]),_[0]&16&&A(t,"placeholder",m[4]),_[0]&64&&t.value!==m[6]&&et(t,m[6]),m[10]&&m[10].length!==0?c?c.p(m,_):(c=mw(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null),_[0]&802819){f=m[0][m[1]];let g;for(g=0;g<f.length;g+=1){let E=fw(m,f,g);p[g]?p[g].p(E,_):(p[g]=yw(E),p[g].c(),p[g].m(o,null))}for(;g<p.length;g+=1)p[g].d(1);p.length=f.length}},i:tr,o:tr,d(m){m&&qe(e),r[22](null),s(),m&&qe(i),c&&c.d(m),m&&qe(a),m&&qe(o),xi(p,m),u=!1,vr(l)}}}function FN(r,e,t){let{task:n}=e,{editableTask:s}=e,{allTasks:i}=e,{_onDescriptionKeyDown:a}=e,{type:o}=e,{accesskey:u}=e,{accesskeyLetter:l=""}=e,{placeholder:c="Type to search..."}=e,f="",p=null,m=0,_,g=!1,E=!1,C,R;function b(v){t(0,s[o]=[...s[o],v],s),t(6,f=""),t(7,g=!1)}function z(v){t(0,s[o]=s[o].filter(x=>x!==v),s)}function U(v){var x;if(p!==null){switch(v.key){case"ArrowUp":v.preventDefault(),!!m&&m>0?t(11,m-=1):t(11,m=p.length-1);break;case"ArrowDown":v.preventDefault(),!!m&&m<p.length-1?t(11,m+=1):t(11,m=0);break;case"Enter":m!==null?(v.preventDefault(),b(p[m]),t(11,m=null),t(7,g=!1)):a(v);break;default:t(11,m=0);break}m&&((x=R==null?void 0:R.getElementsByTagName("li")[m])===null||x===void 0||x.scrollIntoView({block:"nearest"}))}}function ne(v){return!v&&!E?[]:(E=!1,dw(v,i,n,s.blockedBy,s.blocking))}function G(){t(7,g=!0),E=!0}function Y(v,x){!v||!x||Qm(v,x,{middleware:[_l(6),vl(),Vm(),Km({apply(){x&&Object.assign(x.style,{width:`${_}px`})}})]}).then(({x:F,y:ce})=>{x.style.left=`${F}px`,x.style.top=`${ce}px`})}function te(v){return v===n.taskLocation.path?"":v}function _e(v){return Ns(v)}function W(v,x){let F=v.createDiv();F.addClasses(["tooltip","pop-up"]),F.innerText=x,Qm(v,F,{placement:"top",middleware:[_l(-18),vl()]}).then(({x:ce,y:ue})=>{F.style.left=`${ce}px`,F.style.top=`${ue}px`}),v.addEventListener("mouseleave",()=>F.remove())}function I(v){Rs[v?"unshift":"push"](()=>{C=v,t(8,C)})}function O(){f=this.value,t(6,f)}let $=v=>U(v),P=()=>t(7,g=!1);function Q(){_=this.clientWidth,t(12,_)}let d=(v,x)=>W(x.currentTarget,_e(v)),h=(v,x)=>W(x.currentTarget,v),y=v=>b(v),T=v=>t(11,m=v);function w(v){Rs[v?"unshift":"push"](()=>{R=v,t(9,R)})}let S=()=>t(11,m=null),M=v=>z(v),N=(v,x)=>W(x.currentTarget,_e(v));return r.$$set=v=>{"task"in v&&t(5,n=v.task),"editableTask"in v&&t(0,s=v.editableTask),"allTasks"in v&&t(20,i=v.allTasks),"_onDescriptionKeyDown"in v&&t(21,a=v._onDescriptionKeyDown),"type"in v&&t(1,o=v.type),"accesskey"in v&&t(2,u=v.accesskey),"accesskeyLetter"in v&&t(3,l=v.accesskeyLetter),"placeholder"in v&&t(4,c=v.placeholder)},r.$$.update=()=>{if(r.$$.dirty[0]&768){e:Y(C,R)}if(r.$$.dirty[0]&192){e:t(10,p=g?ne(f):null)}},[s,o,u,l,c,n,f,g,C,R,p,m,_,b,z,U,G,te,_e,W,i,a,I,O,$,P,Q,d,h,y,T,w,S,M,N]}var Xm=class extends Di{constructor(e){super(),ml(this,e,FN,IN,fl,{task:5,editableTask:0,allTasks:20,_onDescriptionKeyDown:21,type:1,accesskey:2,accesskeyLetter:3,placeholder:4},null,[-1,-1])}},Zm=Xm;function bw(r,e,t){let n=r.slice();return n[61]=e[t],n}function Tw(r,e,t){let n=r.slice();return n[64]=e[t].value,n[65]=e[t].label,n[66]=e[t].symbol,n[67]=e[t].accessKey,n[68]=e[t].accessKeyIndex,n}function LN(r){let e,t=r[66]+"",n;return{c(){e=B("span"),n=Re(t)},m(s,i){Ve(s,e,i),D(e,n)},p:tr,d(s){s&&qe(e)}}}function _w(r){let e,t,n,s,i,a,o,u,l=r[65].substring(0,r[68])+"",c,f,p=r[65].substring(r[68],r[68]+1)+"",m,_,g=r[65].substring(r[68]+1)+"",E,C,R=r[66]&&r[66].charCodeAt(0)>=256,b,z,U,ne,G,Y=R&&LN(r);return U=Cv(r[44][0]),{c(){e=B("span"),t=B("input"),a=K(),o=B("label"),u=B("span"),c=Re(l),f=B("span"),m=Re(p),_=B("span"),E=Re(g),C=K(),Y&&Y.c(),z=K(),A(t,"type","radio"),A(t,"id",n="priority-"+r[64]),t.__value=s=r[64],t.value=t.__value,A(t,"accesskey",i=r[23](r[67])),A(f,"class","accesskey"),A(o,"for",b="priority-"+r[64]),U.p(t)},m(te,_e){Ve(te,e,_e),D(e,t),t.checked=t.__value===r[3].priority,D(e,a),D(e,o),D(o,u),D(u,c),D(o,f),D(f,m),D(o,_),D(_,E),D(o,C),Y&&Y.m(o,null),D(e,z),ne||(G=Te(t,"change",r[43]),ne=!0)},p(te,_e){_e[0]&8388608&&i!==(i=te[23](te[67]))&&A(t,"accesskey",i),_e[0]&8&&(t.checked=t.__value===te[3].priority),R&&Y.p(te,_e)},d(te){te&&qe(e),Y&&Y.d(),U.r(),ne=!1,G()}}}function UN(r){let e;return{c(){e=B("div"),e.innerHTML="<i>Blocking and blocked by fields are disabled when vault tasks is empty</i>"},m(t,n){Ve(t,e,n)},p:tr,i:tr,o:tr,d(t){t&&qe(e)}}}function WN(r){let e,t,n,s,i,a,o,u;return n=new Zm({props:{type:"blockedBy",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[35],accesskey:r[23],accesskeyLetter:"b",placeholder:"Search for tasks that the task being edited depends on..."}}),o=new Zm({props:{type:"blocking",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[35],accesskey:r[23],accesskeyLetter:"e",placeholder:"Search for tasks that depend on this task being done..."}}),{c(){e=B("label"),e.textContent="Before this",t=K(),Um(n.$$.fragment),s=K(),i=B("label"),i.innerHTML='Aft<span class="accesskey">e</span>r this',a=K(),Um(o.$$.fragment),A(e,"for","blockedBy"),A(e,"class","accesskey-first"),A(i,"for","blocking")},m(l,c){Ve(l,e,c),Ve(l,t,c),pl(n,l,c),Ve(l,s,c),Ve(l,i,c),Ve(l,a,c),pl(o,l,c),u=!0},p(l,c){let f={};c[0]&1&&(f.task=l[0]),c[0]&8&&(f.editableTask=l[3]),c[0]&4&&(f.allTasks=l[2]),c[0]&8388608&&(f.accesskey=l[23]),n.$set(f);let p={};c[0]&1&&(p.task=l[0]),c[0]&8&&(p.editableTask=l[3]),c[0]&4&&(p.allTasks=l[2]),c[0]&8388608&&(p.accesskey=l[23]),o.$set(p)},i(l){u||(Ri(n.$$.fragment,l),Ri(o.$$.fragment,l),u=!0)},o(l){Eo(n.$$.fragment,l),Eo(o.$$.fragment,l),u=!1},d(l){l&&qe(e),l&&qe(t),So(n,l),l&&qe(s),l&&qe(i),l&&qe(a),So(o,l)}}}function vw(r){let e,t=r[61].name+"",n,s,i=r[61].symbol+"",a,o,u;return{c(){e=B("option"),n=Re(t),s=Re(" ["),a=Re(i),o=Re("]"),e.__value=u=r[61].symbol,e.value=e.__value},m(l,c){Ve(l,e,c),D(e,n),D(e,s),D(e,a),D(e,o)},p(l,c){c[0]&2&&t!==(t=l[61].name+"")&&Dn(n,t),c[0]&2&&i!==(i=l[61].symbol+"")&&Dn(a,i),c[0]&2&&u!==(u=l[61].symbol)&&(e.__value=u,e.value=e.__value)},d(l){l&&qe(e)}}}function qN(r){let e,t,n,s,i,a,o,u,l,c,f,p,m,_,g,E,C,R,b,z,U,ne,G,Y,te,_e,W,I,O,$,P,Q,d,h,y,T,w,S,M,N,v,x,F,ce,ue,de,De,Ke,Ur,on,je,Wr,Ut,We,Go,Yo,Bs,Bo,as,$s,$o,or,Hs,J,Ie,Fe,it,at,wt,In,na,qr,un,os,sa,kt,Fn,Ho,Ge,Ye,Ln,ur,Mh,zs,Ch,Ah,zo,Ph,Vo,Nh,lr,Ih,Vs,Fh,Lh,Ko,Uh,Qo,Wh,cr,qh,Ks,jh,Gh,Xo,Yh,Qs,us,Bh,Zo,$h,ia,Ce,_c,Hh,Xs=r[31],Ct=[];for(let j=0;j<Xs.length;j+=1)Ct[j]=_w(Tw(r,Xs,j));let zh=[WN,UN],Un=[];function Vh(j,se){return j[2].length>0&&j[22]?0:1}at=Vh(r,[-1,-1,-1]),wt=Un[at]=zh[at](r);let Zs=r[1],At=[];for(let j=0;j<Zs.length;j+=1)At[j]=vw(bw(r,Zs,j));return{c(){e=B("div"),t=B("form"),n=B("div"),s=B("label"),s.innerHTML='Descrip<span class="accesskey">t</span>ion',i=K(),a=B("textarea"),u=K(),l=B("div"),c=B("label"),f=Re("Priority"),m=K();for(let j=0;j<Ct.length;j+=1)Ct[j].c();_=K(),g=B("div"),E=B("label"),E.textContent="Recurs",C=K(),R=B("input"),z=K(),U=B("code"),ne=Re(r[24]),G=K(),Y=new Xr(!1),te=K(),_e=B("hr"),W=K(),I=B("div"),O=B("label"),O.textContent="Due",$=K(),P=B("input"),d=K(),h=B("code"),y=Re(r[27]),T=K(),w=new Xr(!1),S=K(),M=B("label"),M.textContent="Scheduled",N=K(),v=B("input"),F=K(),ce=B("code"),ue=Re(r[26]),de=K(),De=new Xr(!1),Ke=K(),Ur=B("label"),Ur.innerHTML='St<span class="accesskey">a</span>rt',on=K(),je=B("input"),Ut=K(),We=B("code"),Go=Re(r[25]),Yo=K(),Bs=new Xr(!1),Bo=K(),as=B("div"),$s=B("label"),$s.innerHTML=`Only
<span class="accesskey-first">future</span> dates:`,$o=K(),or=B("input"),J=K(),Ie=B("hr"),Fe=K(),it=B("div"),wt.c(),In=K(),na=B("hr"),qr=K(),un=B("div"),os=B("label"),os.innerHTML='Stat<span class="accesskey">u</span>s',sa=K(),kt=B("select");for(let j=0;j<At.length;j+=1)At[j].c();Ho=K(),Ge=B("div"),Ye=B("label"),Ye.textContent="Created",Ln=K(),ur=B("input"),Mh=K(),zs=B("code"),Ch=Re(r[29]),Ah=K(),zo=new Xr(!1),Ph=K(),Vo=B("label"),Vo.textContent="Done",Nh=K(),lr=B("input"),Ih=K(),Vs=B("code"),Fh=Re(r[30]),Lh=K(),Ko=new Xr(!1),Uh=K(),Qo=B("label"),Qo.textContent="Cancelled",Wh=K(),cr=B("input"),qh=K(),Ks=B("code"),jh=Re(r[28]),Gh=K(),Xo=new Xr(!1),Yh=K(),Qs=B("div"),us=B("button"),Bh=Re("Apply"),$h=K(),ia=B("button"),ia.textContent="Cancel",A(s,"for","description"),A(a,"id","description"),A(a,"class","tasks-modal-description"),A(a,"placeholder","Take out the trash"),A(a,"accesskey",o=r[23]("t")),A(n,"class","tasks-modal-section"),A(c,"for",p="priority-"+r[3].priority),A(l,"class","tasks-modal-section tasks-modal-priorities"),A(E,"for","recurrence"),A(E,"class","accesskey-first"),A(R,"id","recurrence"),A(R,"type","text"),A(R,"class","input"),A(R,"placeholder","Try 'every 2 weeks on Thursday'."),A(R,"accesskey",b=r[23]("r")),tt(R,"tasks-modal-error",!r[12]),Y.a=null,A(U,"class","results"),A(g,"class","tasks-modal-section tasks-modal-dates"),A(O,"for","due"),A(O,"class","accesskey-first"),A(P,"id","due"),A(P,"type","text"),A(P,"class","input"),A(P,"placeholder",Ii),A(P,"accesskey",Q=r[23]("d")),tt(P,"tasks-modal-error",!r[11]),w.a=null,A(h,"class","results"),A(M,"for","scheduled"),A(M,"class","accesskey-first"),A(v,"id","scheduled"),A(v,"type","text"),A(v,"class","input"),A(v,"placeholder",Ii),A(v,"accesskey",x=r[23]("s")),tt(v,"tasks-modal-error",!r[9]),De.a=null,A(ce,"class","results"),A(Ur,"for","start"),A(je,"id","start"),A(je,"type","text"),A(je,"class","input"),A(je,"placeholder",Ii),A(je,"accesskey",Wr=r[23]("a")),tt(je,"tasks-modal-error",!r[7]),Bs.a=null,A(We,"class","results"),A($s,"for","forwardOnly"),A(or,"id","forwardOnly"),A(or,"type","checkbox"),A(or,"class","input task-list-item-checkbox tasks-modal-checkbox"),A(or,"accesskey",Hs=r[23]("f")),A(I,"class","tasks-modal-section tasks-modal-dates"),A(it,"class","tasks-modal-section tasks-modal-dates"),A(os,"for","status"),A(kt,"id","status-type"),A(kt,"class","dropdown"),A(kt,"accesskey",Fn=r[23]("u")),r[18]===void 0&&Ms(()=>r[50].call(kt)),A(un,"class","tasks-modal-section"),A(Ye,"for","created"),A(ur,"id","created"),A(ur,"type","text"),A(ur,"class","input"),A(ur,"placeholder",Ii),tt(ur,"tasks-modal-error",!r[5]),zo.a=null,A(zs,"class","results"),A(Vo,"for","done"),A(lr,"id","done"),A(lr,"type","text"),A(lr,"class","input"),A(lr,"placeholder",Ii),tt(lr,"tasks-modal-error",!r[14]),Ko.a=null,A(Vs,"class","results"),A(Qo,"for","cancelled"),A(cr,"id","cancelled"),A(cr,"type","text"),A(cr,"class","input"),A(cr,"placeholder",Ii),tt(cr,"tasks-modal-error",!r[16]),Xo.a=null,A(Ks,"class","results"),A(Ge,"class","tasks-modal-section tasks-modal-dates"),us.disabled=Zo=!r[21],A(us,"type","submit"),A(us,"class","mod-cta"),A(ia,"type","button"),A(Qs,"class","tasks-modal-section tasks-modal-buttons"),tt(t,"with-accesskeys",r[17]),A(e,"class","tasks-modal")},m(j,se){Ve(j,e,se),D(e,t),D(t,n),D(n,s),D(n,i),D(n,a),et(a,r[3].description),r[42](a),D(t,u),D(t,l),D(l,c),D(c,f),D(l,m);for(let Ht=0;Ht<Ct.length;Ht+=1)Ct[Ht]&&Ct[Ht].m(l,null);D(t,_),D(t,g),D(g,E),D(g,C),D(g,R),et(R,r[3].recurrenceRule),D(g,z),D(g,U),D(U,ne),D(U,G),Y.m(r[20],U),D(t,te),D(t,_e),D(t,W),D(t,I),D(I,O),D(I,$),D(I,P),et(P,r[3].dueDate),D(I,d),D(I,h),D(h,y),D(h,T),w.m(r[10],h),D(I,S),D(I,M),D(I,N),D(I,v),et(v,r[3].scheduledDate),D(I,F),D(I,ce),D(ce,ue),D(ce,de),De.m(r[8],ce),D(I,Ke),D(I,Ur),D(I,on),D(I,je),et(je,r[3].startDate),D(I,Ut),D(I,We),D(We,Go),D(We,Yo),Bs.m(r[6],We),D(I,Bo),D(I,as),D(as,$s),D(as,$o),D(as,or),or.checked=r[3].forwardOnly,D(t,J),D(t,Ie),D(t,Fe),D(t,it),Un[at].m(it,null),D(t,In),D(t,na),D(t,qr),D(t,un),D(un,os),D(un,sa),D(un,kt);for(let Ht=0;Ht<At.length;Ht+=1)At[Ht]&&At[Ht].m(kt,null);Fm(kt,r[18],!0),D(t,Ho),D(t,Ge),D(Ge,Ye),D(Ge,Ln),D(Ge,ur),et(ur,r[3].createdDate),D(Ge,Mh),D(Ge,zs),D(zs,Ch),D(zs,Ah),zo.m(r[4],zs),D(Ge,Ph),D(Ge,Vo),D(Ge,Nh),D(Ge,lr),et(lr,r[3].doneDate),D(Ge,Ih),D(Ge,Vs),D(Vs,Fh),D(Vs,Lh),Ko.m(r[13],Vs),D(Ge,Uh),D(Ge,Qo),D(Ge,Wh),D(Ge,cr),et(cr,r[3].cancelledDate),D(Ge,qh),D(Ge,Ks),D(Ks,jh),D(Ks,Gh),Xo.m(r[15],Ks),D(t,Yh),D(t,Qs),D(Qs,us),D(us,Bh),D(Qs,$h),D(Qs,ia),Ce=!0,_c||(Hh=[Te(a,"input",r[41]),Te(a,"keydown",r[35]),Te(a,"paste",r[36]),Te(a,"drop",r[36]),Te(l,"keyup",r[33]),Te(R,"input",r[45]),Te(P,"input",r[46]),Te(v,"input",r[47]),Te(je,"input",r[48]),Te(or,"change",r[49]),Te(kt,"change",r[50]),Te(kt,"change",r[32]),Te(ur,"input",r[51]),Te(lr,"input",r[52]),Te(cr,"input",r[53]),Te(ia,"click",r[34]),Te(t,"submit",Mv(r[37]))],_c=!0)},p(j,se){if((!Ce||se[0]&8388608&&o!==(o=j[23]("t")))&&A(a,"accesskey",o),se[0]&8&&et(a,j[3].description),(!Ce||se[0]&8&&p!==(p="priority-"+j[3].priority))&&A(c,"for",p),se[0]&8388616|se[1]&1){Xs=j[31];let Le;for(Le=0;Le<Xs.length;Le+=1){let aa=Tw(j,Xs,Le);Ct[Le]?Ct[Le].p(aa,se):(Ct[Le]=_w(aa),Ct[Le].c(),Ct[Le].m(l,null))}for(;Le<Ct.length;Le+=1)Ct[Le].d(1);Ct.length=Xs.length}(!Ce||se[0]&8388608&&b!==(b=j[23]("r")))&&A(R,"accesskey",b),se[0]&8&&R.value!==j[3].recurrenceRule&&et(R,j[3].recurrenceRule),(!Ce||se[0]&4096)&&tt(R,"tasks-modal-error",!j[12]),(!Ce||se[0]&1048576)&&Y.p(j[20]),(!Ce||se[0]&8388608&&Q!==(Q=j[23]("d")))&&A(P,"accesskey",Q),se[0]&8&&P.value!==j[3].dueDate&&et(P,j[3].dueDate),(!Ce||se[0]&2048)&&tt(P,"tasks-modal-error",!j[11]),(!Ce||se[0]&1024)&&w.p(j[10]),(!Ce||se[0]&8388608&&x!==(x=j[23]("s")))&&A(v,"accesskey",x),se[0]&8&&v.value!==j[3].scheduledDate&&et(v,j[3].scheduledDate),(!Ce||se[0]&512)&&tt(v,"tasks-modal-error",!j[9]),(!Ce||se[0]&256)&&De.p(j[8]),(!Ce||se[0]&8388608&&Wr!==(Wr=j[23]("a")))&&A(je,"accesskey",Wr),se[0]&8&&je.value!==j[3].startDate&&et(je,j[3].startDate),(!Ce||se[0]&128)&&tt(je,"tasks-modal-error",!j[7]),(!Ce||se[0]&64)&&Bs.p(j[6]),(!Ce||se[0]&8388608&&Hs!==(Hs=j[23]("f")))&&A(or,"accesskey",Hs),se[0]&8&&(or.checked=j[3].forwardOnly);let Ht=at;if(at=Vh(j,se),at===Ht?Un[at].p(j,se):(Iv(),Eo(Un[Ht],1,1,()=>{Un[Ht]=null}),Fv(),wt=Un[at],wt?wt.p(j,se):(wt=Un[at]=zh[at](j),wt.c()),Ri(wt,1),wt.m(it,null)),se[0]&2){Zs=j[1];let Le;for(Le=0;Le<Zs.length;Le+=1){let aa=bw(j,Zs,Le);At[Le]?At[Le].p(aa,se):(At[Le]=vw(aa),At[Le].c(),At[Le].m(kt,null))}for(;Le<At.length;Le+=1)At[Le].d(1);At.length=Zs.length}(!Ce||se[0]&8388608&&Fn!==(Fn=j[23]("u")))&&A(kt,"accesskey",Fn),se[0]&262146&&Fm(kt,j[18]),se[0]&8&&ur.value!==j[3].createdDate&&et(ur,j[3].createdDate),(!Ce||se[0]&32)&&tt(ur,"tasks-modal-error",!j[5]),(!Ce||se[0]&16)&&zo.p(j[4]),se[0]&8&&lr.value!==j[3].doneDate&&et(lr,j[3].doneDate),(!Ce||se[0]&16384)&&tt(lr,"tasks-modal-error",!j[14]),(!Ce||se[0]&8192)&&Ko.p(j[13]),se[0]&8&&cr.value!==j[3].cancelledDate&&et(cr,j[3].cancelledDate),(!Ce||se[0]&65536)&&tt(cr,"tasks-modal-error",!j[16]),(!Ce||se[0]&32768)&&Xo.p(j[15]),(!Ce||se[0]&2097152&&Zo!==(Zo=!j[21]))&&(us.disabled=Zo),(!Ce||se[0]&131072)&&tt(t,"with-accesskeys",j[17])},i(j){Ce||(Ri(wt),Ce=!0)},o(j){Eo(wt),Ce=!1},d(j){j&&qe(e),r[42](null),xi(Ct,j),Un[at].d(),xi(At,j),_c=!1,vr(Hh)}}}var Ii="Try 'Monday' or 'tomorrow', or [td|tm|yd|tw|nw|we] then space.";function jN(r,e,t){let n;var s;let{task:i}=e,{onSubmit:a}=e,{statusOptions:o}=e,{allTasks:u}=e,l=i.status.symbol,{prioritySymbols:c,recurrenceSymbol:f,startDateSymbol:p,scheduledDateSymbol:m,dueDateSymbol:_,cancelledDateSymbol:g,createdDateSymbol:E,doneDateSymbol:C}=En.tasksPluginEmoji.taskSerializer.symbols,R,b={description:"",status:ie.TODO,priority:"none",recurrenceRule:"",createdDate:"",startDate:"",scheduledDate:"",dueDate:"",doneDate:"",cancelledDate:"",forwardOnly:!0,blockedBy:[],blocking:[]},z=!0,U="",ne=!0,G="",Y=!0,te="",_e=!0,W="",I=!0,O="",$=!0,P="",Q=!0,d="",h=!0,y=!1,T=!0,w=!0,S=[],M=!1,N=[{value:"lowest",label:"Lowest",symbol:c.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:c.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:c.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:c.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:c.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:c.Highest,accessKey:"i",accessKeyIndex:1}];function v(J,Ie,Fe=void 0){if(!Ie)return`<i>no ${J} date</i>`;let it=Jm.parseDate(Ie,Fe,{forwardDate:Fe!=null});return it!==null?window.moment(it).format("YYYY-MM-DD"):`<i>invalid ${J} date</i>`}function x(J,Ie){return v(J,Ie,b.forwardOnly?new Date:void 0)}function F(J){let Ie=null,Fe=Jm.parseDate(J,new Date,{forwardDate:b.forwardOnly});return Fe!==null&&(Ie=window.moment(Fe)),Ie}function ce(J){return Wm(this,void 0,void 0,function*(){if(J.id!=="")return J;let Ie=u.filter(it=>it.id!==""),Fe=Lv(J,Ie.map(it=>it.id));return yield Zr({originalTask:J,newTasks:Fe}),Fe})}let ue=()=>{let J=o.find(Fe=>Fe.symbol===l);if(J)t(3,b.status=J,b);else{console.log(`Error in EditTask: cannot find status with symbol ${l}`);return}let Ie=i.handleNewStatus(J).pop();Ie&&(t(3,b.doneDate=Ie.done.formatAsDate(),b),t(3,b.cancelledDate=Ie.cancelled.formatAsDate(),b))};Lm(()=>{let{provideAccessKeys:J}=ee();t(17,T=J);let Ie=ye.getInstance().removeAsWordFrom(i.description);(Ie!=i.description||!ye.getInstance().includedIn(i.description))&&(y=!0);let Fe="none";i.priority==="5"?Fe="lowest":i.priority==="4"?Fe="low":i.priority==="2"?Fe="medium":i.priority==="1"?Fe="high":i.priority==="0"&&(Fe="highest");let it=[];for(let at of i.dependsOn){let wt=u.find(In=>In.id===at);!wt||it.push(wt)}S=u.filter(at=>at.dependsOn.includes(i.id)),t(3,b={description:Ie,status:i.status,priority:Fe,recurrenceRule:i.recurrence?i.recurrence.toText():"",createdDate:new ze(i.createdDate).formatAsDate(),startDate:new ze(i.startDate).formatAsDate(),scheduledDate:new ze(i.scheduledDate).formatAsDate(),dueDate:new ze(i.dueDate).formatAsDate(),doneDate:new ze(i.doneDate).formatAsDate(),cancelledDate:new ze(i.cancelledDate).formatAsDate(),forwardOnly:!0,blockedBy:it,blocking:S}),t(22,M=!0),setTimeout(()=>{R.focus()},10)});let de=J=>{if(J.key&&!J.altKey&&!J.ctrlKey){let Ie=N.find(Fe=>Fe.label.charAt(0).toLowerCase()==J.key);Ie&&t(3,b.priority=Ie.value,b)}},De=()=>{a([])},Ke=J=>{J.key==="Enter"&&(J.preventDefault(),w&&on())},Ur=()=>{setTimeout(()=>{t(3,b.description=b.description.replace(/[\r\n]+/g," "),b)},0)},on=()=>Wm(void 0,void 0,void 0,function*(){let J=b.description.trim();y&&(J=ye.getInstance().prependTo(J));let Ie=F(b.startDate),Fe=F(b.scheduledDate),it=F(b.dueDate),at=F(b.cancelledDate),wt=F(b.createdDate),In=F(b.doneDate),na=null;b.recurrenceRule&&(na=mt.fromText({recurrenceRuleText:b.recurrenceRule,startDate:Ie,scheduledDate:Fe,dueDate:it}));let qr;switch(b.priority){case"lowest":qr="5";break;case"low":qr="4";break;case"medium":qr="2";break;case"high":qr="1";break;case"highest":qr="0";break;default:qr="3"}let un=[];for(let Ye of b.blockedBy){let Ln=yield ce(Ye);un.push(Ln)}let os=i.id,sa=[],kt=[];(b.blocking.toString()!==S.toString()||b.blocking.length!==0)&&(i.id===""&&(os=qm(u.filter(Ye=>Ye.id!=="").map(Ye=>Ye.id))),sa=S.filter(Ye=>!b.blocking.includes(Ye)),kt=b.blocking.filter(Ye=>!S.includes(Ye)));let Fn=new oe(Object.assign(Object.assign({},i),{description:J,status:i.status,priority:qr,recurrence:na,startDate:Ie,scheduledDate:Fe,dueDate:it,doneDate:In,createdDate:wt,cancelledDate:at,dependsOn:un.map(Ye=>Ye.id),id:os}));for(let Ye of sa){let Ln=Wv(Ye,Fn);yield Zr({originalTask:Ye,newTasks:Ln})}for(let Ye of kt){let Ln=Uv(Ye,Fn);yield Zr({originalTask:Ye,newTasks:Ln})}let Ho=In||window.moment(),Ge=Fn.handleNewStatusWithRecurrenceInUsersOrder(b.status,Ho);a(Ge)}),je=[[]];function Wr(){b.description=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function Ut(J){Rs[J?"unshift":"push"](()=>{R=J,t(19,R)})}function We(){b.priority=this.__value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function Go(){b.recurrenceRule=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function Yo(){b.dueDate=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function Bs(){b.scheduledDate=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function Bo(){b.startDate=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function as(){b.forwardOnly=this.checked,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function $s(){l=Av(this),t(18,l),t(1,o)}function $o(){b.createdDate=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function or(){b.doneDate=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}function Hs(){b.cancelledDate=this.value,t(3,b),t(10,W),t(6,G),t(8,te),t(13,P),t(4,U),t(15,d)}return r.$$set=J=>{"task"in J&&t(0,i=J.task),"onSubmit"in J&&t(38,a=J.onSubmit),"statusOptions"in J&&t(1,o=J.statusOptions),"allTasks"in J&&t(2,u=J.allTasks)},r.$$.update=()=>{if(r.$$.dirty[0]&131072){e:t(23,n=J=>T?J:null)}if(r.$$.dirty[0]&1032){e:t(3,b.dueDate=bn(b.dueDate),b),t(10,W=x("due",b.dueDate)),t(11,I=!W.includes("invalid"))}if(r.$$.dirty[0]&72){e:t(3,b.startDate=bn(b.startDate),b),t(6,G=x("start",b.startDate)),t(7,Y=!G.includes("invalid"))}if(r.$$.dirty[0]&264){e:t(3,b.scheduledDate=bn(b.scheduledDate),b),t(8,te=x("scheduled",b.scheduledDate)),t(9,_e=!te.includes("invalid"))}if(r.$$.dirty[0]&8200){e:t(3,b.doneDate=bn(b.doneDate),b),t(13,P=x("done",b.doneDate)),t(14,Q=!P.includes("invalid"))}if(r.$$.dirty[0]&24){e:t(3,b.createdDate=bn(b.createdDate),b),t(4,U=x("created",b.createdDate)),t(5,ne=!U.includes("invalid"))}if(r.$$.dirty[0]&32776){e:t(3,b.cancelledDate=bn(b.cancelledDate),b),t(15,d=x("cancelled",b.cancelledDate)),t(16,h=!d.includes("invalid"))}if(r.$$.dirty[0]&8|r.$$.dirty[1]&256){e:if(t(12,$=!0),!b.recurrenceRule)t(20,O="<i>not recurring</>");else{let J=t(39,s=mt.fromText({recurrenceRuleText:b.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||s===void 0?void 0:s.toText();J?!b.startDate&&!b.scheduledDate&&!b.dueDate?(t(20,O="<i>due, scheduled or start date required</i>"),t(12,$=!1)):t(20,O=J):(t(20,O="<i>invalid recurrence rule</i>"),t(12,$=!1))}}if(r.$$.dirty[0]&8){e:t(40,z=b.description.trim()!=="")}if(r.$$.dirty[0]&88736|r.$$.dirty[1]&512){e:t(21,w=I&&$&&_e&&Y&&z&&h&&ne&&Q)}},[i,o,u,b,U,ne,G,Y,te,_e,W,I,$,P,Q,d,h,T,l,R,O,w,M,n,f,p,m,_,g,E,C,N,ue,de,De,Ke,Ur,on,a,s,z,Wr,Ut,We,je,Go,Yo,Bs,Bo,as,$s,$o,or,Hs]}var eh=class extends Di{constructor(e){super(),ml(this,e,jN,qN,fl,{task:0,onSubmit:38,statusOptions:1,allTasks:2},null,[-1,-1,-1])}},ww=eh;var Xn=class extends kw.Modal{constructor({app:t,task:n,onSubmit:s,allTasks:i}){super(t);this.task=n,this.allTasks=i,this.onSubmit=a=>{a.length&&s(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task"),this.modalEl.style.paddingBottom="0";let{contentEl:t}=this;this.contentEl.style.paddingBottom="0";let n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new ww({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit,allTasks:this.allTasks}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Oe.getInstance().registeredStatuses;return Oe.getInstance().bySymbol(this.task.status.symbol)===ie.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function GN(){let{setCreatedDate:r}=ee();return r?window.moment():null}function YN(r){let{setCreatedDate:e}=ee();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!ye.getInstance().isEmpty(),s=!ye.getInstance().includedIn(r.description);return t||n&&s}var Sl=({line:r,path:e})=>{var p,m;let t=oe.parseTaskSignifiers(r,vt.fromUnknownPosition(e),Dt.fromPath(e)),n=GN();if(t!==null)return YN(t)?new oe(be(X({},t),{createdDate:n})):t;let s=r.match(Z.nonTaskRegex);if(s===null)return console.error("Tasks: Cannot create task on line:",r),new oe({status:ie.TODO,description:"",taskLocation:vt.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,dependsOn:[],id:"",blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let i=s[1],a=(p=s[2])!=null?p:"-",o=(m=s[4])!=null?m:" ",u=Oe.getInstance().bySymbolOrCreate(o),l=s[5],c=r.match(Z.blockLinkRegex),f=c!==null?c[0]:"";return f!==""&&(l=l.replace(Z.blockLinkRegex,"")),new oe({status:u,description:l,taskLocation:vt.fromUnknownPosition(e),indentation:i,listMarker:a,blockLink:f,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1,id:"",dependsOn:[]})};var Ew=(r,e,t,n,s)=>{var p;if(r)return t instanceof th.MarkdownView;if(!(t instanceof th.MarkdownView))return;let i=(p=t.file)==null?void 0:p.path;if(i===void 0)return;let o=e.getCursor().line,u=e.getLine(o),l=Sl({line:u,path:i}),c=m=>{let _=Dt.removeInferredStatusIfNeeded(l,m).map(g=>g.toFileLineString()).join(`
`);e.setLine(o,_)};new Xn({app:n,task:l,onSubmit:c,allTasks:s}).open()};var rh=require("obsidian");var Sw=(r,e,t)=>{var u;if(r)return t instanceof rh.MarkdownView;if(!(t instanceof rh.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let s=e.getCursor(),i=s.line,a=e.getLine(i),o=BN(a,n);e.setLine(i,o.text),e.setCursor($N(s,o))},BN=(r,e)=>{let t=oe.fromLine({line:r,taskLocation:vt.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(s=>s.toFileLineString());return{text:n.join(`
`),moveTo:{line:n.length-1}}}else{let n=r.match(Z.taskRegex);if(n!==null){let s=n[3],a=Oe.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(Z.taskRegex,`$1- [${a}] $4`)}}else if(Z.listItemRegex.test(r)){let s=r.replace(Z.listItemRegex,"$1$2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(Z.indentationRegex,"$1- ");return{text:s,moveTo:{ch:s.length}}}}},$N=(r,e)=>{var i;let t={line:0,ch:r.ch},n=X(X({},t),(i=e.moveTo)!=null?i:{}),s=e.text.split(`
`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var Ol=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,s)=>Ew(t,n,s,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:Sw})}};var Zn=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};function Is(r,e){let t=`Error: ${r}.
The error message was:
`,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var HN=Object.prototype.toString,Li=Array.isArray||function(e){return HN.call(e)==="[object Array]"};function sh(r){return typeof r=="function"}function zN(r){return Li(r)?"array":typeof r}function nh(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ow(r,e){return r!=null&&typeof r=="object"&&e in r}function VN(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var KN=RegExp.prototype.test;function QN(r,e){return KN.call(r,e)}var XN=/\S/;function ZN(r){return!QN(XN,r)}var JN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function eI(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return JN[t]})}var tI=/\s*/,rI=/\s+/,Dw=/\s*=/,nI=/\s*\}/,sI=/#|\^|\/|>|\{|&|=|!/;function iI(r,e){if(!r)return[];var t=!1,n=[],s=[],i=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;i.length;)delete s[i.pop()];else i=[];a=!1,o=!1}var f,p,m;function _(Y){if(typeof Y=="string"&&(Y=Y.split(rI,2)),!Li(Y)||Y.length!==2)throw new Error("Invalid tags: "+Y);f=new RegExp(nh(Y[0])+"\\s*"),p=new RegExp("\\s*"+nh(Y[1])),m=new RegExp("\\s*"+nh("}"+Y[1]))}_(e||wr.tags);for(var g=new No(r),E,C,R,b,z,U;!g.eos();){if(E=g.pos,R=g.scanUntil(f),R)for(var ne=0,G=R.length;ne<G;++ne)b=R.charAt(ne),ZN(b)?(i.push(s.length),u+=b):(o=!0,t=!0,u+=" "),s.push(["text",b,E,E+1]),E+=1,b===`
`&&(c(),u="",l=0,t=!1);if(!g.scan(f))break;if(a=!0,C=g.scan(sI)||"name",g.scan(tI),C==="="?(R=g.scanUntil(Dw),g.scan(Dw),g.scanUntil(p)):C==="{"?(R=g.scanUntil(m),g.scan(nI),g.scanUntil(p),C="&"):R=g.scanUntil(p),!g.scan(p))throw new Error("Unclosed tag at "+g.pos);if(C==">"?z=[C,R,E,g.pos,u,l,t]:z=[C,R,E,g.pos],l++,s.push(z),C==="#"||C==="^")n.push(z);else if(C==="/"){if(U=n.pop(),!U)throw new Error('Unopened section "'+R+'" at '+E);if(U[1]!==R)throw new Error('Unclosed section "'+U[1]+'" at '+E)}else C==="name"||C==="{"||C==="&"?o=!0:C==="="&&_(R)}if(c(),U=n.pop(),U)throw new Error('Unclosed section "'+U[1]+'" at '+g.pos);return oI(aI(s))}function aI(r){for(var e=[],t,n,s=0,i=r.length;s<i;++s)t=r[s],t&&(t[0]==="text"&&n&&n[0]==="text"?(n[1]+=t[1],n[3]=t[3]):(e.push(t),n=t));return e}function oI(r){for(var e=[],t=e,n=[],s,i,a=0,o=r.length;a<o;++a)switch(s=r[a],s[0]){case"#":case"^":t.push(s),n.push(s),t=s[4]=[];break;case"/":i=n.pop(),i[5]=s[2],t=n.length>0?n[n.length-1][4]:e;break;default:t.push(s)}return e}function No(r){this.string=r,this.tail=r,this.pos=0}No.prototype.eos=function(){return this.tail===""};No.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};No.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function Fi(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Fi.prototype.push=function(e){return new Fi(e,this)};Fi.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var s=this,i,a,o,u=!1;s;){if(e.indexOf(".")>0)for(i=s.view,a=e.split("."),o=0;i!=null&&o<a.length;)o===a.length-1&&(u=Ow(i,a[o])||VN(i,a[o])),i=i[a[o++]];else i=s.view[e],u=Ow(s.view,e);if(u){n=i;break}s=s.parent}t[e]=n}return sh(n)&&(n=n.call(this.view)),n};function Lt(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Lt.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};Lt.prototype.parse=function(e,t){var n=this.templateCache,s=e+":"+(t||wr.tags).join(":"),i=typeof n!="undefined",a=i?n.get(s):void 0;return a==null&&(a=iI(e,t),i&&n.set(s,a)),a};Lt.prototype.render=function(e,t,n,s){var i=this.getConfigTags(s),a=this.parse(e,i),o=t instanceof Fi?t:new Fi(t,void 0);return this.renderTokens(a,o,n,e,s)};Lt.prototype.renderTokens=function(e,t,n,s,i){for(var a="",o,u,l,c=0,f=e.length;c<f;++c)l=void 0,o=e[c],u=o[0],u==="#"?l=this.renderSection(o,t,n,s,i):u==="^"?l=this.renderInverted(o,t,n,s,i):u===">"?l=this.renderPartial(o,t,n,i):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,i):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Lt.prototype.renderSection=function(e,t,n,s,i){var a=this,o="",u=t.lookup(e[1]);function l(p){return a.render(p,t,n,i)}if(!!u){if(Li(u))for(var c=0,f=u.length;c<f;++c)o+=this.renderTokens(e[4],t.push(u[c]),n,s,i);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],t.push(u),n,s,i);else if(sh(u)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(t.view,s.slice(e[3],e[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],t,n,s,i);return o}};Lt.prototype.renderInverted=function(e,t,n,s,i){var a=t.lookup(e[1]);if(!a||Li(a)&&a.length===0)return this.renderTokens(e[4],t,n,s,i)};Lt.prototype.indentPartial=function(e,t,n){for(var s=t.replace(/[^ \t]/g,""),i=e.split(`
`),a=0;a<i.length;a++)i[a].length&&(a>0||!n)&&(i[a]=s+i[a]);return i.join(`
`)};Lt.prototype.renderPartial=function(e,t,n,s){if(!!n){var i=this.getConfigTags(s),a=sh(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var f=this.parse(c,i);return this.renderTokens(f,t,n,c,s)}}};Lt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Lt.prototype.escapedValue=function(e,t,n){var s=this.getConfigEscape(n)||wr.escape,i=t.lookup(e[1]);if(i!=null)return typeof i=="number"&&s===wr.escape?String(i):s(i)};Lt.prototype.rawValue=function(e){return e[1]};Lt.prototype.getConfigTags=function(e){return Li(e)?e:e&&typeof e=="object"?e.tags:void 0};Lt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Li(e))return e.escape};var wr={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){Po.templateCache=r},get templateCache(){return Po.templateCache}},Po=new Lt;wr.clearCache=function(){return Po.clearCache()};wr.parse=function(e,t){return Po.parse(e,t)};wr.render=function(e,t,n,s){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+zN(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Po.render(e,t,n,s)};wr.escape=eI;wr.Scanner=No;wr.Context=Fi;wr.Writer=Lt;var ih=wr;var Aw=ua(Cw());function Pw(r,e){ih.escape=function(t){return t};try{return ih.render(r,(0,Aw.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders.
The error message was:
${t.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:n="Unknown error expanding placeholders.",n+=`
The problem is in:
${r}`,Error(n)}}function Nw(r){return oh(r,[])}function oh(r,e){return{query:{file:new wi(r),allTasks:e}}}var Ui=class{constructor(e=""){this.indentation=e}explainQuery(e){if(e.error!==void 0)return this.explainError(e);let t=[];return t.push(this.explainFilters(e)),t.push(this.explainGroups(e)),t.push(this.explainSorters(e)),t.push(this.explainQueryLimits(e)),t.push(this.explainDebugSettings()),t.filter(n=>n!=="").join(`
`)}explainError(e){let t="";return t+=`Query has an error:
`,t+=e.error+`
`,t}explainFilters(e){return e.filters.length===0?this.indent(`No filters supplied. All tasks will match the query.
`):e.filters.map(n=>n.explainFilterIndented(this.indentation)).join(`
`)}explainGroups(e){let t=e.grouping.length;if(t===0)return this.indent(`No grouping instructions supplied.
`);let n="";for(let s=0;s<t;s++)n+=this.indentation+e.grouping[s].instruction+`
`;return n}explainSorters(e){let t=e.sorting.length;if(t===0)return this.indent(`No sorting instructions supplied.
`);let n="";for(let s=0;s<t;s++)n+=this.indentation+e.sorting[s].instruction+`
`;return n}explainQueryLimits(e){function t(s){let i=`At most ${s} task`;return s!==1&&(i+="s"),i}let n=[];if(e.limit!==void 0){let s=t(e.limit)+`.
`;n.push(this.indent(s))}if(e.taskGroupLimit!==void 0){let s=t(e.taskGroupLimit)+` per group (if any "group by" options are supplied).
`;n.push(this.indent(s))}return n.join(`
`)}explainDebugSettings(){let e="",{debugSettings:t}=ee();return t.ignoreSortInstructions&&(e+=this.indent(`NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.
`)),e}indent(e){return this.indentation+e}};var Me=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Me("None of",e,"NOT")}static booleanXor(e){return new Me("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let s=0;s<this.children.length;s++)t+=`
${this.children[s].asString(n)}`;return t}static combineOrCreateExplanation(e,t,n){if(t.length===2){let s=t[0],i=t[1];if(s.symbol===n&&i.symbol==="")return s.children.push(i),s}return new Me(e,t,n)}};var Wi=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var qi=class extends Wi{constructor(t){super();this.stringToFind=t}matches(t){return qi.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Me(t)}};var Jn=class extends Wi{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,s=t.match(n);if(s!==null){let i=new RegExp(s[1],s[2]);return new Jn(i)}else return null}matches(t){return t.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:
/pattern/flags
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(t){let s=uI(t,"using regex: ",this.regexAsString());return new Me(s)}regexAsString(){let t=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:t+="no flags";break;case 1:t+=`flag '${this.regex.flags}'`;break;default:t+=`flags '${this.regex.flags}'`;break}return t}};function uI(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let s=2,i=((o=n.index)!=null?o:s)-s;return`${e.padEnd(i)}${t}`}var Nr=class{constructor(e,t,n,s){this.instruction=e,this.property=t,this.comparator=Nr.maybeReverse(s,n)}static maybeReverse(e,t){return e?Nr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n,s)=>e(t,n,s)*-1}};var es=class{constructor(e,t,n,s){this.instruction=e,this.property=t,this.grouper=n,this.reverse=s}};var ke=class{canCreateFilterForLine(e){return ke.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return rl(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}sorterInstruction(e){let t=`sort by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Nr(this.sorterInstruction(e),this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(e){if(!this.supportsGrouping())return null;let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[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(e){let t=`group by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new es(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var xt=class{constructor(e,t,n){this.instruction=e,this.explanation=n,this.filterFunction=t}explainFilterIndented(e){let t=this.explanation;return t.asString()===this.instruction?`${e}${this.instruction}
`:`${e}${this.instruction} =>
${t.asString(e+" ")}
`}};var en=class{constructor(e){this.instruction=e}get queryComponent(){return this._queryComponent}set queryComponent(e){this._queryComponent=e}get error(){return this._error}set error(e){this._error=e}isValid(){return this._queryComponent!==void 0}static fromObject(e,t){let n=new en(e);return n._queryComponent=t,n}static fromError(e,t){let n=new en(e);return n._error=t,n}};var re=class{constructor(e){this.object=e}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(e){return new re(en.fromObject(e.instruction,e))}static fromError(e,t){return new re(en.fromError(e,t))}};var Pe=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return re.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),s=t[2],i=null;if(n.includes("include"))i=new qi(s);else if(n.includes("regex")){try{i=Jn.validateAndConstruct(s)}catch(u){let l=Is("Parsing regular expression",u)+`
${Jn.helpMessage()}`;return re.fromError(e,l)}if(i===null)return re.fromError(e,`Invalid instruction: '${e}'
${Jn.helpMessage()}`)}if(i===null)return re.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new xt(e,this.getFilter(i,a),i.explanation(e));return re.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(e,t){return n=>{let s=e.matches(this.value(n));return t?!s:s}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var Fs=class extends Pe{fieldName(){return"description"}value(e){return ye.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Fs.cleanDescription(e.description),s=Fs.cleanDescription(t.description);return n.localeCompare(s,void 0,{numeric:!0})}}static cleanDescription(e){e=ye.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let s=n[1];e=s.substring(s.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var Dl=class{findUnexpandedDateText(e){let t=["<%","YYYY-MM-DD"];for(let n of t)if(e.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(e){return`Instruction contains unexpanded template text: "${e}" - 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 xl=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?re.fromFilter(new xt(e,this._filter,new Me(e))):re.fromError(e,`do not understand filter: ${e}`)}};var Bt=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new xl(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.error===void 0)return n}return re.fromError(e,`do not understand filter: ${e}`)}};var ht=class extends ke{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Bt,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var p;let n=this.checkForUnexpandedTemplateText(t);if(n)return re.fromError(t,n);let s=this.filterInstructions.createFilterOrErrorMessage(t);if(s.isValid())return s;let i=ke.getMatch(this.filterRegExp(),t);if(i===null)return re.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=i[1],o=(p=i[2])==null?void 0:p.toLowerCase(),u=i[3],l=Qt.parseDateRange(u);if(!l.isValid()){let m=Qt.parseDate(a);m.isValid()&&(l=new Nt(m,m))}if(!l.isValid())return re.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),f=ht.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return re.fromFilter(new xt(t,c,f))}buildFilterFunction(t,n){let s;switch(t){case"before":s=i=>i?i.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":s=i=>i?i.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":s=i=>i?i.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":s=i=>i?i.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:s=i=>i?i.isSameOrAfter(n.start)&&i.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(s)}getFilter(t){return n=>t(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(t,n,s,i){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=i.start.format(o);break;case"after":case"on or before":u=i.end.format(o);break;case"in or before":a="on or before",u=i.end.format(o);break;case"in or after":a="on or after",u=i.start.format(o);break;default:if(!i.start.isSame(i.end)){let c=`${t} date is between:`,f=[new Me(`${i.start.format(o)} and`),new Me(`${i.end.format(o)} inclusive`)];return s&&f.push(new Me(`OR no ${t} date`)),new Me(c,f)}a="on",u=i.start.format(o);break}let l=`${t} date is ${a} ${u}`;return s&&(l+=` OR no ${t} date`),new Me(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>_r(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:n.isValid()?[n.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(t){return new Dl().findUnexpandedDateText(t)}};var Rl=class extends ht{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Ml=class extends ht{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var ji=class extends ht{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var tn=class extends ke{constructor(){super(...arguments);this._filters=new Bt}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Cl=class extends tn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var Io=class extends en{};function uh(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,s=e&&new Function(...t,n);return s instanceof Function?Io.fromObject(e,s):Io.fromError(e,"Error parsing group function")}catch(n){return Io.fromError(e,Is(`Failed parsing expression "${e}"`,n))}}function lh(r,e){let t=e.map(([n,s])=>s);return r(...t)}function ch(r,e,t){try{return lh(r,e)}catch(n){return Is(`Failed calculating expression "${t}"`,n)}}function Al(r,e){return[["task",r],["query",e?e.query:null]]}function Iw(r,e,t){let n=Al(r,t||null),s=uh(n,e);return s.error?s.error:ch(s.queryComponent,n,e)}var Fo=class{constructor(e){this.line=e,this.functionOrError=uh(Al(null,null),e)}isValid(){return this.functionOrError.isValid()}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return lh(this.functionOrError.queryComponent,Al(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?ch(this.functionOrError.queryComponent,Al(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function dh(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Pl=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return re.fromError(e,"Unable to parse line");let n=t[1],s=new Fo(n);return s.isValid()?re.fromFilter(new xt(e,lI(s),new Me(e))):re.fromError(e,s.parseError)}fieldName(){return"function"}filterRegExp(){return new RegExp(`^filter by ${this.fieldNameSingularEscaped()} (.*)`,"i")}supportsSorting(){return!0}sorterRegExp(){return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}createSorterFromLine(e){let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1],s=t[2],i=new Fo(s);if(!i.isValid())throw new Error(i.parseError);let a=(o,u,l)=>{try{let c=l.queryContext(),f=this.validateTaskSortKey(i.evaluate(o,c)),p=this.validateTaskSortKey(i.evaluate(u,c));return this.compareTaskSortKeys(f,p)}catch(c){throw c instanceof Error&&(c.message+=`: while evaluating instruction '${e}'`),c}};return new Nr(e,this.fieldNameSingular(),a,n)}validateTaskSortKey(e){function t(n){throw new Error(`"${n}" is not a valid sort key`)}return e===void 0&&t("undefined"),Number.isNaN(e)&&t("NaN (Not a Number)"),Array.isArray(e)&&t("array"),e}compareTaskSortKeys(e,t){let n=dh(e),s=dh(t),i=this.compareTaskSortKeysIfOptionalMoment(e,t,n,s);if(i!==void 0)return i;let a=this.compareTaskSortKeysIfEitherIsNull(e,t);if(a!==void 0)return a;if(n!==s)throw new Error(`Unable to compare two different sort key types '${n}' and '${s}' order`);if(n==="string")return e.localeCompare(t,void 0,{numeric:!0});if(n==="TasksDate")return _r(e.moment,t.moment);if(n==="boolean")return Number(t)-Number(e);let o=Number(e)-Number(t);if(isNaN(o))throw new Error(`Unable to determine sort order for sort key types '${n}' and '${s}'`);return o}compareTaskSortKeysIfOptionalMoment(e,t,n,s){let i=n==="Moment",a=s==="Moment";if(i&&a||i&&t===null||a&&e===null)return _r(e,t)}compareTaskSortKeysIfEitherIsNull(e,t){if(e===null&&t===null)return 0;if(e===null&&t!==null)return-1;if(e!==null&&t===null)return 1}supportsGrouping(){return!0}createGrouperFromLine(e){let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],s=t[2];return new es(e,"function",dI(s),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function lI(r){return(e,t)=>{let n=t.queryContext();return cI(r,e,n)}}function cI(r,e,t){let n=r.evaluate(e,t);if(typeof n=="boolean")return n;throw Error(`filtering function must return true or false. This returned "${n}".`)}function dI(r){return(e,t)=>{let n=t.queryContext();return fI(e,r,n)}}function fI(r,e,t){try{let n=Iw(r,e,t);return Array.isArray(n)?n.map(i=>i.toString()):n===null?[]:[n.toString()]}catch(n){let s=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[s+n.message]:[s+"Unknown error"]}}var Nl=class extends Pe{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var Gi=class extends Pe{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Pe.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var fh=class extends ke{createFilterOrErrorMessage(e){var n;let t=ke.getMatch(this.filterRegExp(),e);if(t!==null){let s=t[5],i=null;switch(s.toLowerCase()){case"lowest":i="5";break;case"low":i="4";break;case"none":i="3";break;case"medium":i="2";break;case"high":i="1";break;case"highest":i="0";break}if(i===null)return re.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(i)<0;break;case"below":o=u=>u.priority.localeCompare(i)>0;break;case"not":o=u=>u.priority!==i;break;default:o=u=>u.priority===i,a=`${this.fieldName()} is ${s}`}return re.fromFilter(new xt(e,o,new Me(a)))}else return re.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return fh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},Ls=fh;Ls.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Il=class extends ht{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Fl=class extends ht{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Ll=class extends ht{constructor(){let e=new Bt;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return e.happensDates}earliestDate(e){return e.happens.moment}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var Ul=class extends tn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsSorting(){return!0}comparator(){return(e,t)=>e.recurrence!==null&&t.recurrence===null?-1:e.recurrence===null&&t.recurrence!==null?1:0}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var ts=class extends tn{constructor(){super(),this._filters.add("done",e=>e.isDone),this._filters.add("not done",e=>!e.isDone)}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=ts.oldStatusName(e),s=ts.oldStatusName(t);return n<s?1:n>s?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[ts.oldStatusName(e)]}};var Wl=class extends Pe{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let s=e.matchesAnyOf(this.values(n));return t?!s:s}}createGrouper(e){return new es(this.grouperInstruction(e),this.fieldNamePlural(),this.grouper(),e)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNamePlural()}( reverse)?$`,"i")}grouperInstruction(e){let t=`group by ${this.fieldNamePlural()}`;return e&&(t+=" reverse"),t}};var Us=class extends Wl{constructor(){super();this.filterInstructions=new Bt,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let s=!!n[1],i=isNaN(+n[2])?1:+n[2],a=Us.makeCompareByTagComparator(i);return new Nr(t,this.fieldNameSingular(),a,s)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Us.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,s)=>{if(n.tags.length===0&&s.tags.length===0)return 0;if(n.tags.length===0)return 1;if(s.tags.length===0)return-1;let i=t-1;if(n.tags.length<t&&s.tags.length>=t)return 1;if(s.tags.length<t&&n.tags.length>=t)return-1;if(n.tags.length<t&&s.tags.length<t)return 0;let a=n.tags[i],o=s.tags[i];return a.localeCompare(o,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>t.tags.length==0?["(No tags)"]:t.tags}};var Kw=ua(Vw());var Bl=class extends ke{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return re.fromError(t,"empty line");let n=this.preprocessExpression(t);try{let s=(0,Kw.parse)(n);for(let o of s)if(o.name==="IDENTIFIER"&&o.value){let u=o.value.trim();if(!(u in this.subFields)){let l=$l(u);if(l===null)return re.fromError(t,`couldn't parse sub-expression '${u}'`);if(l.error)return re.fromError(t,`couldn't parse sub-expression '${u}': ${l.error}`);l.filter&&(this.subFields[u]=l.filter)}}else if(o.name==="OPERATOR"){if(o.value==null)return re.fromError(t,"empty operator in boolean query");if(!this.supportedOperators.includes(o.value))return re.fromError(t,`unknown boolean operator '${o.value}'`)}let i=(o,u)=>this.filterTaskWithParsedQuery(o,s,u),a=this.constructExplanation(s);return re.fromFilter(new xt(t,i,a))}catch(s){let i=s instanceof Error?s.message:"unknown error type";return re.fromError(t,`malformed boolean query -- ${i} (check the documentation for guidelines)`)}}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n,s){let i=u=>u==="true",a=u=>u?"true":"false",o=[];for(let u of n)if(u.name==="IDENTIFIER"){if(u.value==null)throw Error("null token value");let c=this.subFields[u.value.trim()].filterFunction(t,s);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=i(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=i(o.pop()),c=i(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=i(o.pop()),c=i(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=i(o.pop()),c=i(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return i(o[0])}constructExplanation(t){let n=[];for(let s of t)if(s.name==="IDENTIFIER"){if(s.value==null)throw Error("null token value");let i=this.subFields[s.value.trim()];n.push(i.explanation)}else if(s.name==="OPERATOR")if(s.value==="NOT"){let i=n.pop();n.push(Me.booleanNot([i]))}else if(s.value==="OR"){let i=n.pop(),a=n.pop();n.push(Me.booleanOr([a,i]))}else if(s.value==="AND"){let i=n.pop(),a=n.pop();n.push(Me.booleanAnd([a,i]))}else if(s.value==="XOR"){let i=n.pop(),a=n.pop();n.push(Me.booleanXor([a,i]))}else throw Error("Unsupported operator: "+s.value);else throw Error("Unsupported token type: "+s.name);return n[0]}};var Hl=class extends Pe{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var Qi=class extends ke{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return re.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}grouperInstruction(e){return super.grouperInstruction(!e)}};var zl=class extends Pe{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var an=class extends ke{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return ke.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),s=t[2],i=er[s.toUpperCase()];if(!i)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===i;break;case"is not":a=o=>o.status.type!==i;break;default:return this.helpMessage(e)}return re.fromFilter(new xt(e,a,new Me(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(er).filter(s=>s!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'.
Allowed options: 'is' and 'is not' (without quotes).
Allowed values: ${t}
Note: values are case-insensitive,
so 'in_progress' works too, for example.
Example: ${this.fieldNameSingular()} is not NON_TASK`;return re.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=an.groupName(e),s=an.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[an.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Vl=class extends Pe{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var Kl=class extends Pe{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Pe.escapeMarkdownCharacters(this.value(e))]}};var Ql=class extends Pe{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Pe.escapeMarkdownCharacters(this.value(e))]}};var Xl=class extends Pe{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return re.fromError(e,"backlink field does not support filtering")}canCreateFilterForLine(e){return!1}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;if(t===null)return["Unknown Location"];let n=e.precedingHeader;return n===null?["[["+t+"]]"]:[`[[${t}#${n}|${t} > ${n}]]`]}}};var Zl=class extends ht{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Jl=class extends tn{constructor(){super(),this._filters.add("is blocking",(e,t)=>e.isBlocking(t.allTasks)),this._filters.add("is not blocking",(e,t)=>!e.isBlocking(t.allTasks)),this._filters.add("is blocked",(e,t)=>e.isBlocked(t.allTasks)),this._filters.add("is not blocked",(e,t)=>!e.isBlocked(t.allTasks))}fieldName(){return"blocking"}};var ec=class extends Pe{constructor(){super();this.filterInstructions=new Bt;this.filterInstructions.add("has id",t=>t.id.length>0),this.filterInstructions.add("no id",t=>t.id.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}fieldName(){return"id"}value(t){return t.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var tc=class extends ke{constructor(){super();this.filterInstructions=new Bt;this.filterInstructions.add("has depends on",t=>t.dependsOn.length>0),this.filterInstructions.add("no depends on",t=>t.dependsOn.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:re.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var wh=[()=>new zl,()=>new an,()=>new ts,()=>new Ul,()=>new Ls,()=>new Ll,()=>new Zl,()=>new Rl,()=>new Fl,()=>new Il,()=>new ji,()=>new Ml,()=>new Gi,()=>new Kl,()=>new Ql,()=>new Xl,()=>new Fs,()=>new Us,()=>new Nl,()=>new Cl,()=>new Hl,()=>new Qi,()=>new Vl,()=>new Pl,()=>new ec,()=>new tc,()=>new Jl,()=>new Bl];function $l(r){for(let e of wh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Qw(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of wh){let s=t().createSorterFromLine(r);if(s)return s}return null}function Xw(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of wh){let s=t().createGrouperFromLine(r);if(s)return s}return null}var rc=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var nc=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let s=e.keys().next().value.length;for(let i=0;i<s;i++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(e){let t=new Array;for(let n=0;n<e.length;n++){let s=e[n];if(s!=this.lastHeadingAtLevel[n]){t.push(new rc(n,s,this.groupers[n].property));for(let i=n;i<e.length;i++)this.lastHeadingAtLevel[i]="";this.lastHeadingAtLevel[n]=s}}return t}};var sc=class{constructor(e){this.children=new Map;this.values=[];this.values=e}generateAllPaths(e=[]){let t=new Map;if(this.children.size==0)return t.set([...e],this.values),t;for(let[n,s]of this.children)e.push(n),s.generateAllPaths(e).forEach((a,o)=>t.set(o,a)),e.pop();return t}};var ic=class extends sc{},ac=class{constructor(e,t,n){this.root=new ic(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let s of e){let i=[];for(let a of n)for(let o of a.values){let u=s.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new ic([]),a.children.set(l,c),i.push(c)),c.values.push(o)}}n=i}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var oc=class{constructor(e,t){this.groups=e,this.groupHeadings=[],this.tasks=t}setGroupHeadings(e){for(let t of e)this.groupHeadings.push(t)}applyTaskLimit(e){this.tasks=this.tasks.slice(0,e)}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+`
`;return e}toString(){let e=`
`;e+=`Group names: [${this.groups}]
`;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} [${t.property}] ${t.displayName}
`;return e+=this.tasksAsStringOfLines(),e}};var Xi=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let i=new ac(e,t,n).generateTaskTreeStorage();this.addTaskGroups(i),this.sortTaskGroups(),this.setGroupsHeadings(i)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any):
`;for(let n of this._groupers){let s=n.reverse?" reverse":"";e+=`- ${n.property}${s}
`}for(let n of this.groups)e+=n.toString(),e+=`
---
`;return e+=`
${this.totalTasksCount()} tasks
`,e}addTaskGroups(e){for(let[t,n]of e){let s=new oc(t,n);this.addTaskGroup(s)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let s=t.groups,i=n.groups;for(let a=0;a<s.length;a++){let o=this._groupers[a],u=s[a].localeCompare(i[a],void 0,{numeric:!0});if(u!==0)return o.reverse?-u:u}return 0};this._groups.sort(e)}setGroupsHeadings(e){let t=new nc(e,this._groupers);for(let n of this._groups)n.setGroupHeadings(t.getHeadingsForTaskGroup(n.groups))}applyTaskLimit(e){this._groupers.length!==0&&(this._groups.forEach(t=>{t.applyTaskLimit(e)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let e=[];this._groups.forEach(n=>{e=[...e,...n.tasks]});let t=[...new Set(e)];this._totalTaskCount=t.length}};var rs=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new rs(void 0,e)}queryContext(){return this.queryPath?oh(this.queryPath,this.allTasks):void 0}};function Zw(r){return`task${r!==1?"s":""}`}var js=class{constructor(e,t){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=e,this.totalTasksCountBeforeLimit=t}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(e){this._searchErrorMessage=e}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let e=this.totalTasksCount,t=this.totalTasksCountBeforeLimit;return e===t?`${e} ${Zw(e)}`:`${e} of ${t} ${Zw(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new js(new Xi([],[],rs.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function Jw(r){return r.endsWith("\\")}function ek(r){return r.endsWith("\\\\")}function WI(r){return r.replace(/^[ \t]*/,"")}function qI(r){return r.replace(/[ \t]*\\$/,"")}function jI(r,e){let t=r;return e&&(t=WI(r)),ek(t)?t=t.slice(0,-1):Jw(r)&&(t=qI(t)),t}function GI(r,e,t){e?r[r.length-1]+=" "+t:r.push(t)}function YI(r){let e=[],t=!1;for(let n of r.split(`
`)){let s=jI(n,t);GI(e,t,s),ek(n)?t=!1:t=Jw(n)}return e.join(`
`)}function tk(r){return YI(r).split(`
`).map(e=>e.trim()).filter(e=>e!=="")}var Zi=class{static by(e,t,n){let s=this.defaultSorters().map(a=>a.comparator),i=[];for(let a of e)i.push(a.comparator);return t.sort(Zi.makeCompositeComparator([...i,...s],n))}static defaultSorters(){return[new an().createNormalSorter(),new Qi().createNormalSorter(),new ji().createNormalSorter(),new Ls().createNormalSorter(),new Gi().createNormalSorter()]}static makeCompositeComparator(e,t){return(n,s)=>{for(let i of e){let a=i(n,s,t);if(a!==0)return a}return 0}}};var Pn=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Vr;this._queryLayoutOptions=new Zn;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)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Ft.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.filePath=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),tk(e).forEach(n=>{let s=this.expandPlaceholders(n,t);if(this.error===void 0)try{this.parseLine(s)}catch(i){let a;i instanceof Error?a=i.message:a="Unknown error",this.setError(a,s);return}})}parseLine(e){switch(!0){case this.shortModeRegexp.test(e):this._queryLayoutOptions.shortMode=!0;break;case this.fullModeRegexp.test(e):this._queryLayoutOptions.shortMode=!1;break;case this.explainQueryRegexp.test(e):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(e):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(e):this.parseLimit(e);break;case this.parseSortBy(e):break;case this.parseGroupBy(e):break;case this.hideOptionsRegexp.test(e):this.parseHideOptions(e);break;case this.commentRegexp.test(e):break;case this.parseFilter(e):break;default:this.setError("do not understand query",e)}}formatQueryForLogging(){return`[${this.source.split(`
`).join(" ; ")}]`}expandPlaceholders(e,t){if(e.includes("{{")&&e.includes("}}")&&this.filePath===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:
${e}`,e;let n=e;if(t){let s=Nw(t);try{n=Pw(e,s)}catch(i){return i instanceof Error?this._error=i.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",e}}return n}append(e){return this.source===""?e:e.source===""?this:new Pn(`${this.source}
${e.source}`,this.filePath)}explainQuery(){return new Ui().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(e){this._filters.push(e)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(e,t){this._error=`${e}
Problem line: "${t}"`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new rs(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=ee(),s=n.ignoreSortInstructions?e:Zi.by(this.sorting,e,t),i=s.slice(0,this.limit),a=new Xi(this.grouping,i,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new js(a,s.length)}catch(n){let s="Search failed";return js.fromError(Is(s,n))}}parseHideOptions(e){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1].toLowerCase()==="hide";switch(t[2].toLowerCase()){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;default:this.setError("do not understand hide/show option",e)}}}parseFilter(e){var n;let t=$l(e);return t!=null?(t.filter?this._filters.push(t.filter):this.setError((n=t.error)!=null?n:"Unknown error",e),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",e);return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=Qw(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=Xw(e);return t?(this._grouping.push(t),!0):!1}generateQueryId(e){let t="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:e},()=>t[Math.floor(Math.random()*t.length)]).join("")}debug(e,t){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${e}`,t)}};var ns=class{constructor(e=ns.empty){this._source=e}static getInstance(){return ns.instance||(ns.instance=new ns),ns.instance}set(e){this._source=e}query(e=void 0){return new Pn(this._source,e)}hasInstructions(){return this._source.trim()!==ns.empty}},Er=ns;Er.empty="";var uc=class{constructor({obsidianEvents:e}){this.logger=Ft.getLogger("tasks.Events");this.obsidianEvents=e}onCacheUpdate(e){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(e)}};var ik=require("obsidian");var sk=require("obsidian");var kh=class{constructor(e){this.newStatus=e}apply(e){return this.isCheckedForTask(e)?[e]:e.handleNewStatusWithRecurrenceInUsersOrder(this.newStatus)}instructionDisplayName(){return`Change status to: [${this.newStatus.symbol}] ${this.newStatus.name}`}isCheckedForTask(e){return this.newStatus.symbol===e.status.symbol}};function rk(r){let e=[],t=new Ue().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let s of r.registeredStatuses)t.includes(s.symbol)===n&&e.push(new kh(s));return e}var nk=require("obsidian");function Uo(r,e){return L(this,null,function*(){yield Zr({originalTask:r,newTasks:e})})}var Ji=class extends nk.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let s of t)this.addItemForInstruction(n,s)}addItemForInstruction(t,n){this.addItem(s=>this.getMenuItemCallback(t,s,n))}getMenuItemCallback(t,n,s){n.setTitle(s.instructionDisplayName()).setChecked(s.isCheckedForTask(t)).onClick(()=>L(this,null,function*(){let i=s.apply(t);(i.length!==1||!Object.is(i[0],t))&&(yield this.taskSaver(t,i))}))}};var lc=class extends Ji{constructor(e,t,n=Uo){super(n);let s=rk(e);this.addItemsForInstructions(s,t)}};var cc=class{constructor(){this.data=BI}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},Eh=class{constructor(e,t,n){if(e==="")throw Error("Developer note: CSS class cannot be an empty string, please specify one.");this.className=e,this.attributeName=t,this.attributeValueCalculator=n}addDataAttribute(e,t,n){if(this.attributeName===Eh.noAttributeName)return;let s=this.attributeValueCalculator(n,t);s!==""&&(e.dataset[this.attributeName]=s)}},Fr=Eh;Fr.noAttributeName="",Fr.noAttributeValueCalculator=()=>"",Fr.dateAttributeCalculator=(e,t)=>{let s="far";function i(o){let u=window.moment().startOf("day"),l="",c=u.diff(o,"days");return isNaN(c)?null:c===0?"today":(c>0?l+="past-":c<0&&(l+="future-"),Math.abs(c)<=7?l+=Math.abs(c).toString()+"d":l+=s,l)}let a=t[e];if(!Array.isArray(a)&&a instanceof window.moment){let o=i(a);if(o)return o}return""};function Wo(r){return new Fr(r,Fr.noAttributeName,Fr.noAttributeValueCalculator)}function ea(r,e){return new Fr(r,e,Fr.dateAttributeCalculator)}var BI={createdDate:ea("task-created","taskCreated"),dueDate:ea("task-due","taskDue"),startDate:ea("task-start","taskStart"),scheduledDate:ea("task-scheduled","taskScheduled"),doneDate:ea("task-done","taskDone"),cancelledDate:ea("task-cancelled","taskCancelled"),priority:new Fr("task-priority","taskPriority",(r,e)=>Sn.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),description:Wo("task-description"),recurrenceRule:Wo("task-recurring"),dependsOn:Wo("task-dependsOn"),id:Wo("task-id"),blockLink:Wo("task-block-link")};function ir(r,e){let t=document.createElement(r);return e.appendChild(t),t}var ss=class{static obsidianMarkdownRenderer(e,t,n,s){return L(this,null,function*(){if(!s)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield sk.MarkdownRenderer.renderMarkdown(e,t,n,s)})}constructor({textRenderer:e=ss.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,taskLayoutOptions:s,queryLayoutOptions:i}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.taskLayoutOptions=s,this.queryLayoutOptions=i}renderTaskLine(e,t,n){return L(this,null,function*(){let s=ir("li",this.parentUlElement);s.classList.add("task-list-item","plugin-tasks-list-item");let i=ir("span",s);i.classList.add("tasks-list-text"),yield this.taskToHtml(e,i,s);let a=ir("input",s);return a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,s.classList.add("is-checked")),e.taskLocation.hasKnownPath&&(a.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),a.disabled=!0;let l=e.toggleWithRecurrenceInUsersOrder();Zr({originalTask:e,newTasks:l})}),a.addEventListener("contextmenu",u=>{new lc(Oe.getInstance(),e).showAtPosition({x:u.clientX,y:u.clientY})}),a.setAttribute("title","Right-click for options")),s.prepend(a),s.setAttribute("data-task",e.status.symbol.trim()),s.setAttribute("data-line",t.toString()),s.setAttribute("data-task-status-name",e.status.name),s.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.queryLayoutOptions.shortMode&&this.addTooltip(e,i,n),s})}taskToHtml(e,t,n){return L(this,null,function*(){let s=new cc,i=En.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=i.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=ir("span",t),l=ir("span",u);yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l),s.addClassName(u,a),s.addDataAttribute(u,e,a),s.addDataAttribute(n,e,a)}}for(let a of this.taskLayoutOptions.hiddenComponents)s.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&s.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,s){return L(this,null,function*(){if(n==="description"){t=ye.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:i}=ee();i.showTaskHiddenData&&(t+=`<br>\u{1F41B} <b>${s.lineNumber}</b> . ${s.sectionStart} . ${s.sectionIndex} . '<code>${s.originalMarkdown}</code>'<br>'<code>${s.path}</code>' > '<code>${s.precedingHeader}</code>'<br>`),yield this.textRenderer(t,e,s.path,this.obsidianComponent);let a=e.querySelector("blockquote"),o=a!=null?a:e,u=o.querySelector("p");if(u!==null){for(;u.firstChild;)o.insertBefore(u.firstChild,u);u.remove()}e.querySelectorAll("p").forEach(l=>{l.hasChildNodes()||l.remove()}),e.querySelectorAll(".footnotes").forEach(l=>{l.remove()})}else e.innerHTML=t})}addInternalClasses(e,t){function n(s){let i=/["&\x00\r\n]/g,a=s.replace(i,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let s=t.getElementsByClassName("tag");for(let i=0;i<s.length;i++){let a=s[i].textContent;if(a){let o=n(a),u=s[i];o&&(u.dataset.tagName=o)}}}}addTooltip(e,t,n){let{recurrenceSymbol:s,startDateSymbol:i,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:u,cancelledDateSymbol:l,doneDateSymbol:c}=En.tasksPluginEmoji.taskSerializer.symbols;t.addEventListener("mouseenter",()=>{function f(g,E,C){E&&g.createDiv().setText(p({signifier:C,date:E}))}function p({signifier:g,date:E}){return`${g} ${E.format(Z.dateFormat)} (${E.from(window.moment().startOf("day"))})`}let m=t.createDiv();m.addClasses(["tooltip","pop-up"]),e.recurrence&&m.createDiv().setText(`${s} ${e.recurrence.toText()}`),f(m,e.createdDate,a),f(m,e.startDate,i),f(m,e.scheduledDate,o),f(m,e.dueDate,u),f(m,e.cancelledDate,l),f(m,e.doneDate,c);let _=e.getLinkText({isFilenameUnique:n});_&&m.createDiv().setText(`\u{1F517} ${_}`),t.addEventListener("mouseleave",()=>{m.remove()})})}};var dc=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return L(this,null,function*(){var f;let n=new ik.MarkdownRenderChild(e);t.addChild(n);let s=e.findAll(".task-list-item").filter(p=>{var g;let m=(g=p.textContent)==null?void 0:g.split(`
`);if(m===void 0)return!1;let _=null;for(let E=0;E<m.length;E=E+1)if(m[E]!==""){_=m[E];break}return _===null?!1:ye.getInstance().includedIn(_)});if(s.length===0)return;let i=t.sourcePath,a=t.getSectionInfo(e);if(a===null)return;let o=a.text.split(`
`),u=0,l=[];for(let p=a.lineStart;p<=a.lineEnd;p++){let m=o[p];if(m===void 0)continue;let _=null,g=oe.fromLine({line:m,taskLocation:new vt(i,p,a.lineStart,u,_),fallbackDate:null});g!==null&&(l.push(g),u++)}let c=new ss({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new Vr,queryLayoutOptions:new Zn});for(let p=0;p<s.length;p++){let m=l[p],_=s[p];if(m===void 0||_===void 0)continue;let g=(f=_.getAttr("data-line"))!=null?f:"0",E=Number.parseInt(g,10),C=yield c.renderTaskLine(m,E),R=_.childNodes;for(let U=0;U<R.length;U=U+1){let ne=R[U];ne.nodeName.toLowerCase()==="div"?C.prepend(ne):ne.nodeName.toLowerCase()==="ul"&&C.append(ne)}let b=_.querySelectorAll("[data-footnote-id]"),z=C.querySelectorAll("[data-footnote-id]");if(b.length===z.length)for(let U=0;U<b.length;U++)z[U].replaceWith(b[U]);_.replaceWith(C)}})}};var ak=require("@codemirror/view"),ok=require("obsidian");var uk=()=>ak.ViewPlugin.fromClass(Sh),Sh=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let p=`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(p),new ok.Notice(p,45e3)}return!1}let{state:s}=this.view,i=this.view.posAtDOM(t),a=s.doc.lineAt(i),o=oe.fromLine({line:a.text,taskLocation:vt.fromUnknownPosition(""),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(p=>p.toFileLineString()).join(s.lineBreak),c=s.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let f=t.checked;return setTimeout(()=>{t.checked=f},1),!0}};var ta=require("obsidian");function qo(r,e,t){e&&r.push($I(t))}function $I(r){return`tasks-layout-hide-${r}`}var fc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new Zn}getHiddenClasses(){let e=[],t=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,s]of t)qo(e,n,s);return this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode"),e}};function lk(r,e,t,n=void 0){let s="";e.isEmpty()||(s+=`Only tasks containing the global filter '${e.get()}'.
`);let i=new Ui(" "),a=new Pn(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);s+=`Explanation of the global query:
${i.explainQuery(o)}
`}return s+=`Explanation of this Tasks code block query:
${i.explainQuery(a)}`,s}function pc(r,e,t){let n=new Pn(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function ck(r){for(let t of oe.allDateFields()){let n=r[t];if(n&&!n.isValid())return!1}let e=r.happensDates.some(t=>!!(t!=null&&t.isValid()));return!r.isDone&&e}function mc(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function Oh(r,e,t,n){let s=r[e];return fk(s,r,e,t,n)}function dk(r,e,t,n){let s=window.moment();return fk(s,r,e,t,n)}function fk(r,e,t,n,s){let i=new ze(r).postpone(n,s),a=Dt.removeInferredStatusIfNeeded(e,[new oe(be(X({},e),{[t]:i}))])[0];return{postponedDate:i,postponedTask:a}}function pk(r,e){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}function mk(r,e,t){return`\u2139\uFE0F ${Dh(r,e,t)} (right-click for more options)`}function HI(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Dh(r,e,t){let n=mc(r),s=r[n];return gk(n,s,e,t)}function hk(r,e,t){let n=mc(r),s=window.moment().startOf("day");return gk(n,s,e,t)}function gk(r,e,t,n){let i=new ze(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";return e.isSameOrBefore(window.moment(),"day")?`${HI(r.replace("Date",""))} in ${a} ${n}, on ${i}`.replace(" in 0 days"," today").replace("in a day","tomorrow"):`Postpone ${r.replace("Date"," date")} by ${a} ${n}, to ${i}`}var hc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new Vr}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{qo(e,!this.taskLayoutOptions.isShown(t),t)}),qo(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var xh=require("obsidian");var is=class extends Ji{constructor(e,t,n=Uo){super(n);let s=(l,c,f,p,m,_)=>{let g=m(t,p,f);c.setTitle(g).onClick(()=>is.postponeOnClickCallback(l,t,p,f,_,n))},i=hk,a=dk;this.addItem(l=>s(e,l,"days",0,i,a)),this.addItem(l=>s(e,l,"day",1,i,a)),this.addSeparator();let o=Dh,u=Oh;this.addItem(l=>s(e,l,"days",2,o,u)),this.addItem(l=>s(e,l,"days",3,o,u)),this.addItem(l=>s(e,l,"days",4,o,u)),this.addItem(l=>s(e,l,"days",5,o,u)),this.addItem(l=>s(e,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>s(e,l,"week",1,o,u)),this.addItem(l=>s(e,l,"weeks",2,o,u)),this.addItem(l=>s(e,l,"weeks",3,o,u)),this.addItem(l=>s(e,l,"month",1,o,u))}static postponeOnClickCallback(o,u,l,c){return L(this,arguments,function*(e,t,n,s,i=Oh,a=Uo){let f=mc(t);if(f===null){let _="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new xh.Notice(_,1e4)}let{postponedDate:p,postponedTask:m}=i(t,f,s,n);yield a(t,m),is.postponeSuccessCallback(e,f,p)})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let s=pk(n,t);new xh.Notice(s,2e3)}};var gc=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.plugin=e,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return L(this,null,function*(){n.addChild(new Rh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Rh=class extends ta.MarkdownRenderChild{constructor({app:t,plugin:n,events:s,container:i,source:a,filePath:o}){super(i);switch(this.app=t,this.plugin=n,this.events=s,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=pc(this.source,Er.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=pc(this.source,Er.getInstance(),this.filePath),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=pc(this.source,Er.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return L(this,arguments,function*({tasks:t,state:n}){var a;let i=ir("div",this.containerEl);n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,i):this.query.error!==void 0?this.renderErrorMessage(i,this.query.error):this.renderLoadingMessage(i),(a=this.containerEl.firstChild)==null||a.replaceWith(i)})}renderQuerySearchResults(t,n,s){return L(this,null,function*(){this.query.debug(`[render] Render called: plugin state: ${n}; searching ${t.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(s);let i=this.query.applyQueryToTasks(t);if(i.searchErrorMessage!==void 0){this.renderErrorMessage(s,i.searchErrorMessage);return}yield this.addAllTaskGroups(i.taskGroups,s);let a=i.totalTasksCount;this.addTaskCount(s,i),this.query.debug(`[render] ${a} tasks displayed`)})}renderErrorMessage(t,n){t.createDiv().innerHTML=`<pre>Tasks query: ${n.replace(/\n/g,"<br>")}</pre>`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let n=lk(this.source,ye.getInstance(),Er.getInstance(),this.filePath),s=ir("pre",t);s.addClasses(["plugin-tasks-query-explanation"]),s.setText(n),t.appendChild(s)}createTaskList(t,n){return L(this,null,function*(){let s=ir("ul",n);s.addClasses(["contains-task-list","plugin-tasks-query-result"]);let i=new hc(this.query.taskLayoutOptions);s.addClasses(i.generateHiddenClasses());let a=new fc(this.query.queryLayoutOptions);s.addClasses(a.getHiddenClasses());let o=this.getGroupingAttribute();o&&o.length>0&&(s.dataset.taskGroupBy=o);let u=new ss({obsidianComponent:this,parentUlElement:s,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[l,c]of t.entries()){let f=this.isFilenameUnique({task:c}),p=yield u.renderTaskLine(c,l,f);p.querySelectorAll("[data-footnote-id]").forEach(E=>E.remove());let _=p.createSpan("task-extras");this.query.queryLayoutOptions.hideUrgency||this.addUrgency(_,c);let g=this.query.queryLayoutOptions.shortMode;this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(_,c,g,f),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(_,c,this.plugin.getTasks()),!this.query.queryLayoutOptions.hidePostponeButton&&ck(c)&&this.addPostponeButton(_,c,g),s.appendChild(p)}n.appendChild(s)})}addEditButton(t,n,s){let i=ir("a",t);i.addClass("tasks-edit"),i.title="Edit task",i.href="#",i.onClickEvent(a=>{a.preventDefault();let o=l=>L(this,null,function*(){yield Zr({originalTask:n,newTasks:Dt.removeInferredStatusIfNeeded(n,l)})});new Xn({app:this.app,task:n,onSubmit:o,allTasks:s}).open()})}addUrgency(t,n){let s=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:s,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return L(this,null,function*(){for(let s of t.groups)yield this.addGroupHeadings(n,s.groupHeadings),yield this.createTaskList(s.tasks,n)})}addGroupHeadings(t,n){return L(this,null,function*(){for(let s of n)yield this.addGroupHeading(t,s)})}addGroupHeading(t,n){return L(this,null,function*(){let s="h6";n.nestingLevel===0?s="h4":n.nestingLevel===1&&(s="h5");let i=ir(s,t);i.addClass("tasks-group-heading"),yield ta.MarkdownRenderer.renderMarkdown(n.displayName,i,this.filePath,this)})}addBacklinks(t,n,s,i){var c;let a=t.createSpan({cls:"tasks-backlink"});s||a.append(" (");let o=ir("a",a);o.rel="noopener",o.target="_blank",o.addClass("internal-link"),s&&o.addClass("internal-link-short-mode");let u;s?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:i}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",f=>L(this,null,function*(){let p=yield Ym(n,l);if(p){let[m,_]=p,g=this.app.workspace.getLeaf(ta.Keymap.isModEvent(f));f.preventDefault(),yield g.openFile(_,{eState:{line:m}})}})),o.addEventListener("mousedown",f=>L(this,null,function*(){if(f.button===1){let p=yield Ym(n,l);if(p){let[m,_]=p,g=this.app.workspace.getLeaf("tab");f.preventDefault(),yield g.openFile(_,{eState:{line:m}})}}})),s||a.append(")")}addPostponeButton(t,n,s){let a="day",o=mk(n,1,a),u=ir("a",t);u.addClass("tasks-postpone"),s&&u.addClass("tasks-postpone-short-mode"),u.title=o,u.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),is.postponeOnClickCallback(u,n,1,a)}),u.addEventListener("contextmenu",l=>L(this,null,function*(){l.preventDefault(),l.stopPropagation(),new is(u,n).showAtPosition({x:l.clientX,y:l.clientY})}))}addTaskCount(t,n){this.query.queryLayoutOptions.hideTaskCount||t.createDiv({text:n.totalTasksCountDisplayText(),cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let s=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===s)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var Ee=require("obsidian");var yc=class{constructor(e){this._markdown="";this.columnNames=e,this.addTitleRow()}get markdown(){return this._markdown}addTitleRow(){let e="|",t="|";this.columnNames.forEach(n=>{e+=` ${n} |`,t+=" ----- |"}),this._markdown+=`${e}
`,this._markdown+=`${t}
`}addRow(e){let t=this.makeRowText(e);this._markdown+=`${t}
`}addRowIfNew(e){let t=this.makeRowText(e);this._markdown.includes(t)||(this._markdown+=`${t}
`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function yk(r,e){return r.findIndex(t=>t.symbol===e)}function Nn(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function zI(r,e){let t=ie.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Nn(r.symbol)} is ${Nn(t)}: you may wish to review this type.`))}function VI(r,e,t){let n=yk(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Nn(e.nextStatusSymbol)} is unknown: create a status with symbol ${Nn(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let s=r[n];if(s){if(s.type!=="TODO"&&s.type!=="IN_PROGRESS"){let i="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",a=[`This \`DONE\` status is followed by ${Nn(s.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](${i}).`].join("<br>");t.push(a)}}else t.push("Unexpected failure to find the next status.")}function KI(r,e,t){let n=[];return e.symbol===ie.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):yk(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Nn(e.symbol)}': this status will be ignored.`),n):(zI(e,n),VI(r,e,n),n)}function bk(r){let e=new yc(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Ue.allStatuses(r);return t.forEach((n,s)=>{e.addRow([Nn(n.symbol),Nn(n.nextStatusSymbol),n.name,Nn(n.type),KI(t,n,s).join("<br>")])}),e.markdown}function Tk(r,e,t,n){let i=bk(r),a=e.mermaidDiagram(!0);return`# ${t}
## 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.
${i}
## Loaded Settings
<!-- Switch to Live Preview or Reading Mode to see the diagram. -->
These are the settings actually used by Tasks.
${a}`}function _k(){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 vk(){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 wk(){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 kk(){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 Ek(){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 Sk(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Ok(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Dk=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"<p>These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.</p><p>You can add edit and add your own custom statuses in the section below.</p>"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`<p>You should first <b>select and install a CSS Snippet or Theme</b> to style custom checkboxes.</p><p>Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.</p><p><b>Note</b> Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.</p><p></p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Statuses">documentation</a> to get started!</p>`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Lr=require("obsidian");var Gs=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,s,i]=e,a=[];if(a.push(...this.validateType(i)),t===s&&i!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=ie.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return Gs.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Gs.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=er[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,s=new Oe,i=n==="X"?"x":n,a=s.bySymbol(i);return a.type!=="EMPTY"&&(e.nextStatusSymbol!==a.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${a.nextStatusSymbol}'`),e.type!==a.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${a.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var Ys=new Gs,ar=class extends Lr.Modal{constructor(t,n,s){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=s}statusConfiguration(){return new nt(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return L(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),s;new Lr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(l=>{s=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,ar.setValid(l,Ys.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{ar.setValid(s,Ys.validateSymbol(this.statusConfiguration()))});let i;new Lr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{i=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,ar.setValid(l,Ys.validateName(this.statusConfiguration()))})}).then(l=>{ar.setValid(i,Ys.validateName(this.statusConfiguration()))});let a;new Lr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(l=>{a=l,l.setValue(this.statusNextSymbol).onChange(c=>{this.statusNextSymbol=c,ar.setValid(l,Ys.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{ar.setValid(a,Ys.validateNextSymbol(this.statusConfiguration()))}),new Lr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(f=>{l.addOption(f,f)}),l.setValue(this.type).onChange(f=>{this.type=ie.getTypeFromStatusTypeString(f)})}),ie.tasksPluginCanCreateCommandsForStatuses()&&new Lr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(l=>{l.setValue(this.statusAvailableAsCommand).onChange(c=>L(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new Lr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>L(this,null,function*(){let c=Ys.validate(this.statusConfiguration());if(c.length>0){let f=c.join(`
`)+`
Fix errors before saving.`;new Lr.Notice(f);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(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?ar.removeValidationError(t):ar.setValidationError(t)}};var $t=class extends Ee.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return L(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new Ee.Setting(t).setName("Task Format").setDesc($t.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(s=>{for(let i of Object.keys(En))s.addOption(i,En[i].displayName);s.setValue(ee().taskFormat).onChange(i=>L(this,null,function*(){st({taskFormat:i}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new Ee.Setting(t).setName("Global task filter").setDesc($t.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(s=>{s.setPlaceholder("e.g. #task or TODO").setValue(ye.getInstance().get()).onChange(i=>L(this,null,function*(){st({globalFilter:i}),ye.getInstance().set(i),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(s=>{let i=ee();s.setValue(i.removeGlobalFilter).onChange(a=>L(this,null,function*(){st({removeGlobalFilter:a}),ye.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),JI(new Ee.Setting(t).setDesc($t.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(s=>{let i=ee();s.inputEl.rows=4,s.setPlaceholder(`# For example...
path does not include _templates/
limit 300
show urgency`).setValue(i.globalQuery).onChange(a=>L(this,null,function*(){st({globalQuery:a}),Er.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=ee();Dk.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new Ee.Setting(t).setName("Set created date on every added task").setDesc($t.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(s=>{let i=ee();s.setValue(i.setCreatedDate).onChange(a=>L(this,null,function*(){st({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Set done date on every completed task").setDesc($t.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(s=>{let i=ee();s.setValue(i.setDoneDate).onChange(a=>L(this,null,function*(){st({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Set cancelled date on every cancelled task").setDesc($t.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(s=>{let i=ee();s.setValue(i.setCancelledDate).onChange(a=>L(this,null,function*(){st({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc($t.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>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\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(s=>{let i=ee();s.setValue(i.useFilenameAsScheduledDate).onChange(a=>L(this,null,function*(){st({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).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(s=>L(this,null,function*(){let i=ee();yield this.plugin.saveSettings(),s.setValue($t.renderFolderArray(i.filenameAsDateFolders)).onChange(a=>L(this,null,function*(){let o=$t.parseCommaSeparatedFolders(a);st({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new Ee.Setting(t).setName("Next recurrence appears on the line below").setDesc($t.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Recurring+Tasks">documentation</a>.</p>')).addToggle(s=>{let{recurrenceOnNextLine:i}=ee();s.setValue(i).onChange(a=>L(this,null,function*(){st({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new Ee.Setting(t).setName("Auto-suggest task content").setDesc($t.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Auto-Suggest">documentation</a>.</p>')).addToggle(s=>{let i=ee();s.setValue(i.autoSuggestInEditor).onChange(a=>L(this,null,function*(){st({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(s=>{let i=ee();s.setLimits(0,3,1).setValue(i.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>L(this,null,function*(){st({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(s=>{let i=ee();s.setLimits(3,12,1).setValue(i.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>L(this,null,function*(){st({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new Ee.Setting(t).setName("Provide access keys in dialogs").setDesc($t.createFragmentWithHTML('If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Create+or+edit+Task#Keyboard+shortcuts">documentation</a>.</p>')).addToggle(s=>{let i=ee();s.setValue(i.provideAccessKeys).onChange(a=>L(this,null,function*(){st({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,s){let i=t.createEl("details",{cls:"tasks-nested-settings",attr:X({},n.open||s[n.text]?{open:!0}:{})});i.empty(),i.ontoggle=()=>{s[n.text]=i.open,st({headingOpened:s}),this.plugin.saveSettings()};let a=i.createEl("summary");if(new Ee.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=i.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!bv(o.featureFlag))&&(o.type==="checkbox"?new Ee.Setting(i).setName(o.name).setDesc(o.description).addToggle(u=>{let l=ee();l.generalSettings[o.settingName]||Os(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>L(this,null,function*(){Os(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new Ee.Setting(i).setName(o.name).setDesc(o.description).addText(u=>{let l=ee();l.generalSettings[o.settingName]||Os(o.settingName,o.initialValue);let c=f=>L(this,null,function*(){Os(o.settingName,f),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,Ee.debounce)(c,500,!0))}):o.type==="textarea"?new Ee.Setting(i).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=ee();l.generalSettings[o.settingName]||Os(o.settingName,o.initialValue);let c=f=>L(this,null,function*(){Os(o.settingName,f),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,Ee.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](i,this),o.notice!==null)){let u=i.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:s}=ee();s.coreStatuses.forEach(a=>{xk(t,a,s.coreStatuses,s,n,n.plugin,!0)}),new Ee.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>L(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,f=this.plugin.manifest.version,p=Oe.getInstance(),m=Tk(s,p,o,f),_=yield app.vault.create(c,m);yield this.app.workspace.getLeaf(!0).openFile(_)})),a.setTooltip("Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings.")}).infoEl.remove()}insertCustomTaskStatusSettings(t,n){let{statusSettings:s}=ee();s.customStatuses.forEach(l=>{xk(t,l,s.customStatuses,s,n,n.plugin,!1)}),t.createEl("div"),new Ee.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>L(this,null,function*(){Ue.addStatus(s.customStatuses,new nt("","","",!1,"TODO")),yield ra(s,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",_k()],["Aura Theme",vk()],["Ebullientworks Theme",wk()],["ITS Theme & SlRvb Checkboxes",kk()],["Minimal Theme",Sk()],["Things Theme",Ok()],["LYT Mode Theme (Dark mode only)",Ek()]];for(let[l,c]of a)new Ee.Setting(t).addButton(p=>{let m=`${l}: Add ${c.length} supported Statuses`;p.setButtonText(m).onClick(()=>L(this,null,function*(){yield ZI(c,s,n)}))}).infoEl.remove();new Ee.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>L(this,null,function*(){let f=this.plugin.getTasks().map(m=>m.status),p=Oe.getInstance().findUnknownStatuses(f);p.length!==0&&(p.forEach(m=>{Ue.addStatus(s.customStatuses,m)}),yield ra(s,n))}))}).infoEl.remove(),new Ee.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>L(this,null,function*(){Ue.resetAllCustomStatuses(s),yield ra(s,n)}))}).infoEl.remove()}},jo=$t;jo.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function xk(r,e,t,n,s,i,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new ie(e).previewText();let u=new Ee.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>L(this,null,function*(){Ue.deleteStatus(t,e)&&(yield ra(n,s))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>L(this,null,function*(){let c=new ar(i,e,a);c.onClose=()=>L(this,null,function*(){c.saved&&Ue.replaceStatus(t,e,c.statusConfiguration())&&(yield ra(n,s))}),c.open()}))}),u.infoEl.remove()}function ZI(r,e,t){return L(this,null,function*(){Ue.bulkAddStatusCollection(e,r).forEach(s=>{new Ee.Notice(s)}),yield ra(e,t)})}function ra(r,e){return L(this,null,function*(){st({statusSettings:r}),Ue.applyToStatusRegistry(r,Oe.getInstance()),yield e.saveSettings(!0)})}function JI(r){let{settingEl:e,infoEl:t,controlEl:n}=r,s=n.querySelector("textarea");s!==null&&(e.style.display="block",t.style.marginRight="0px",s.style.minWidth="-webkit-fill-available")}var Rk=require("obsidian");var bc=class extends Rk.EditorSuggest{constructor(t,n){super(t);this.settings=n,t.scope.register([],"Tab",()=>{var i;let s=(i=this.context)==null?void 0:i.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let i=n.getLine(t.line);return mv(i,t.ch)?{start:{line:t.line,ch:0},end:{line:t.line,ch:i.length},query:i}:null}getSuggestions(t){var a,o,u;let n=t.query,s=t.editor.getCursor();return((u=(o=(a=To()).buildSuggestions)==null?void 0:o.call(a,n,s.ch,this.settings))!=null?u:[]).map(l=>be(X({},l),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=s==null?void 0:s.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(f);return}let i=t.context.editor.getCursor(),a={line:i.line,ch:(c=t.insertAt)!=null?c:i.ch},o=t.insertSkip?{line:i.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:i.line,ch:a.ch+t.appendText.length})}};var Mk=(r,e)=>{let t,n=new Promise((a,o)=>{t=a});return e(r,a=>{let o=a.map(u=>u.toFileLineString()).join(`
`);t(o)}).open(),n};var Ck=(r,e)=>{let t=Sl({line:"",path:""});return new Xn({app:r,task:t,onSubmit:e,allTasks:[]})};var Ak=r=>({createTaskLineModal:()=>Mk(r,Ck)});var Tc=class extends Pk.Plugin{get apiV1(){return Ak(app)}onload(){return L(this,null,function*(){Ft.registerConsoleLogger(),Am("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=ee();Ft.configure(t),this.addSettingTab(new jo({plugin:this})),qv({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new uc({obsidianEvents:this.app.workspace});this.cache=new Ds({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new dc({plugin:this}),this.queryRenderer=new gc({plugin:this,events:n}),this.registerEditorExtension(uk()),this.registerEditorSuggest(new bc(this.app,ee())),new Ol({plugin:this})})}loadTaskStatuses(){return L(this,null,function*(){let{statusSettings:t}=ee();Ue.applyToStatusRegistry(t,Oe.getInstance())})}onunload(){var t;Am("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return L(this,null,function*(){let t=yield this.loadData();st(t),t=ee(),ye.getInstance().set(t.globalFilter),ye.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),Er.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return L(this,null,function*(){yield this.saveData(ee())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}};
/*!
* EventEmitter2
* https://github.com/hij1nx/EventEmitter2
*
* Copyright (c) 2013 hij1nx
* Licensed under the MIT license.
*/
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/