/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source visit the plugins github repository */ /* License obsidian-tasks: MIT License Copyright (c) 2021 Clare Macrae, Ilyas Landikov and Martin Schenck Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* License rrule (included library): rrule.js: Library for working with recurrence rules for calendar dates. ======================================================================= Copyright 2010, Jakub Roztocil 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 Copyright (c) 2012 - Tomi Pieviläinen All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* License chrono-node (included library): The MIT License Copyright (c) 2014, Wanasit Tanakitrungruang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* License flatpickr (included library): The MIT License (MIT) Copyright (c) 2017 Gregory Petrosyan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict";var _E=Object.create;var pa=Object.defineProperty,vE=Object.defineProperties,wE=Object.getOwnPropertyDescriptor,kE=Object.getOwnPropertyDescriptors,EE=Object.getOwnPropertyNames,Qo=Object.getOwnPropertySymbols,SE=Object.getPrototypeOf,Ic=Object.prototype.hasOwnProperty,ug=Object.prototype.propertyIsEnumerable;var og=(r,e,t)=>e in r?pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,K=(r,e)=>{for(var t in e||(e={}))Ic.call(e,t)&&og(r,t,e[t]);if(Qo)for(var t of Qo(e))ug.call(e,t)&&og(r,t,e[t]);return r},fe=(r,e)=>vE(r,kE(e));var Xo=(r,e)=>{var t={};for(var n in r)Ic.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Qo)for(var n of Qo(r))e.indexOf(n)<0&&ug.call(r,n)&&(t[n]=r[n]);return t};var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),OE=(r,e)=>{for(var t in e)pa(r,t,{get:e[t],enumerable:!0})},lg=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of EE(e))!Ic.call(r,i)&&i!==t&&pa(r,i,{get:()=>e[i],enumerable:!(n=wE(e,i))||n.enumerable});return r};var ma=(r,e,t)=>(t=r!=null?_E(SE(r)):{},lg(e||!r||!r.__esModule?pa(t,"default",{value:r,enumerable:!0}):t,r)),DE=r=>lg(pa({},"__esModule",{value:!0}),r);var A=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{o(t.next(u))}catch(l){i(l)}},a=u=>{try{o(t.throw(u))}catch(l){i(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((t=t.apply(r,e)).next())});var Me=E(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.matchAnyPattern=Gn.extractTerms=Gn.repeatedTimeunitPattern=void 0;function CE(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Gn.repeatedTimeunitPattern=CE;function cg(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Gn.extractTerms=cg;function AE(r){return`(?:${cg(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Gn.matchAnyPattern=AE});var we=E((Lc,Uc)=>{(function(r,e){typeof Lc=="object"&&typeof Uc!="undefined"?Uc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Lc,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",u="week",l="month",c="quarter",d="year",f="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,k={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("_")},_=function($,j,D){var Y=String($);return!Y||Y.length>=j?$:""+Array(j+1-Y.length).join(D)+$},S={s:_,z:function($){var j=-$.utcOffset(),D=Math.abs(j),Y=Math.floor(D/60),F=D%60;return(j<=0?"+":"-")+_(Y,2,"0")+":"+_(F,2,"0")},m:function $(j,D){if(j.date(){"use strict";var PE=Yn&&Yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.findYearClosestToRef=Yn.findMostLikelyADYear=void 0;var NE=PE(we());function IE(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Yn.findMostLikelyADYear=IE;function FE(r,e,t){let n=NE.default(r),i=n;i=i.month(t-1),i=i.date(e),i=i.year(n.year());let s=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(s.diff(n)){"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseTimeUnits=pe.TIME_UNITS_PATTERN=pe.parseYear=pe.YEAR_PATTERN=pe.parseOrdinalNumberPattern=pe.ORDINAL_NUMBER_PATTERN=pe.parseNumberPattern=pe.NUMBER_PATTERN=pe.TIME_UNIT_DICTIONARY=pe.ORDINAL_WORD_DICTIONARY=pe.INTEGER_WORD_DICTIONARY=pe.MONTH_DICTIONARY=pe.FULL_MONTH_NAME_DICTIONARY=pe.WEEKDAY_DICTIONARY=void 0;var eu=Me(),LE=lt();pe.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};pe.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};pe.MONTH_DICTIONARY=Object.assign(Object.assign({},pe.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});pe.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};pe.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};pe.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"};pe.NUMBER_PATTERN=`(?:${eu.matchAnyPattern(pe.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 fg(r){let e=r.toLowerCase();return pe.INTEGER_WORD_DICTIONARY[e]!==void 0?pe.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)}pe.parseNumberPattern=fg;pe.ORDINAL_NUMBER_PATTERN=`(?:${eu.matchAnyPattern(pe.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function UE(r){let e=r.toLowerCase();return pe.ORDINAL_WORD_DICTIONARY[e]!==void 0?pe.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}pe.parseOrdinalNumberPattern=UE;pe.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 WE(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 LE.findMostLikelyADYear(e)}pe.parseYear=WE;var pg=`(${pe.NUMBER_PATTERN})\\s{0,3}(${eu.matchAnyPattern(pe.TIME_UNIT_DICTIONARY)})`,dg=new RegExp(pg,"i");pe.TIME_UNITS_PATTERN=eu.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",pg);function qE(r){let e={},t=r,n=dg.exec(t);for(;n;)jE(e,n),t=t.substring(n[0].length).trim(),n=dg.exec(t);return e}pe.parseTimeUnits=qE;function jE(r,e){let t=fg(e[1]),n=pe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var mg=E((Wc,qc)=>{(function(r,e){typeof Wc=="object"&&typeof qc!="undefined"?qc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Wc,function(){"use strict";var r="month",e="quarter";return function(t,n){var i=n.prototype;i.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var s=i.add;i.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):s.bind(this)(o,u)};var a=i.startOf;i.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var d=this.quarter()-1;return c?this.month(3*d).startOf(r).startOf("day"):this.month(3*d+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var ar=E(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.implySimilarTime=zr.assignSimilarTime=zr.assignSimilarDate=zr.assignTheNextDay=void 0;var hg=Ke();function $E(r,e){e=e.add(1,"day"),gg(r,e),yg(r,e)}zr.assignTheNextDay=$E;function gg(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}zr.assignSimilarDate=gg;function GE(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",hg.Meridiem.AM):r.assign("meridiem",hg.Meridiem.PM)}zr.assignSimilarTime=GE;function yg(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}zr.implySimilarTime=yg});var Tg=E(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.toTimezoneOffset=mi.TIMEZONE_ABBR_MAP=void 0;mi.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 YE(r){var e;return r==null?null:typeof r=="number"?r:(e=mi.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}mi.toTimezoneOffset=YE});var We=E(Kr=>{"use strict";var bg=Kr&&Kr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ParsingResult=Kr.ParsingComponents=Kr.ReferenceWithTimezone=void 0;var BE=bg(mg()),tu=bg(we()),jc=ar(),HE=Tg();tu.default.extend(BE.default);var $c=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=HE.toTimezoneOffset(e.timezone))}};Kr.ReferenceWithTimezone=$c;var hi=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=tu.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 hi(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 tu.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 i=-e.getTimezoneOffset(),s=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:i;return i-s}static createRelativeFromReference(e,t){let n=tu.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new hi(e);return t.hour||t.minute||t.second?(jc.assignSimilarTime(i,n),jc.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(jc.implySimilarTime(i,n),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(i.assign("day",n.date()),i.assign("month",n.month()+1),i.assign("year",n.year())):(t.week&&i.imply("weekday",n.day()),i.imply("day",n.date()),t.month?(i.assign("month",n.month()+1),i.assign("year",n.year())):(i.imply("month",n.month()+1),t.year?i.assign("year",n.year()):i.imply("year",n.year())))),i}};Kr.ParsingComponents=hi;var ha=class{constructor(e,t,n,i,s){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new hi(e),this.end=s}clone(){let e=new ha(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}', ...}]`}};Kr.ParsingResult=ha});var H=E(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.AbstractParserWithWordBoundaryChecking=void 0;var Gc=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 i=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+i.length,t[0]=t[0].substring(i.length);for(let s=2;s{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var Bc=ct(),VE=We(),zE=H(),KE=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Bc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),QE=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Bc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Yc=class extends zE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?QE:KE}innerExtract(e,t){let n=Bc.parseTimeUnits(t[1]);return VE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Hc.default=Yc});var Og=E(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});var XE=lt(),Eg=ct(),Sg=ct(),nu=ct(),ZE=Me(),JE=H(),eS=new RegExp(`(?:on\\s{0,3})?(${nu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${nu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${ZE.matchAnyPattern(Eg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${Sg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),vg=1,wg=2,tS=3,kg=4,Vc=class extends JE.AbstractParserWithWordBoundaryChecking{innerPattern(){return eS}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Eg.MONTH_DICTIONARY[t[tS].toLowerCase()],s=nu.parseOrdinalNumberPattern(t[vg]);if(s>31)return t.index=t.index+t[vg].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[kg]){let a=Sg.parseYear(t[kg]);n.start.assign("year",a)}else{let a=XE.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[wg]){let a=nu.parseOrdinalNumberPattern(t[wg]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};zc.default=Vc});var Cg=E(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var rS=lt(),Rg=ct(),iu=ct(),Mg=ct(),nS=Me(),iS=H(),sS=new RegExp(`(${nS.matchAnyPattern(Rg.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${iu.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${iu.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${Mg.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),aS=1,oS=2,Dg=3,xg=4,Kc=class extends iS.AbstractParserWithWordBoundaryChecking{innerPattern(){return sS}innerExtract(e,t){let n=Rg.MONTH_DICTIONARY[t[aS].toLowerCase()],i=iu.parseOrdinalNumberPattern(t[oS]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[xg]){let u=Mg.parseYear(t[xg]);s.assign("year",u)}else{let u=rS.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[Dg])return s;let a=iu.parseOrdinalNumberPattern(t[Dg]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};Qc.default=Kc});var Ng=E(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var Xc=ct(),uS=lt(),lS=Me(),Pg=ct(),cS=H(),dS=new RegExp(`((?:in)\\s*)?(${lS.matchAnyPattern(Xc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Pg.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),fS=1,pS=2,Ag=3,Zc=class extends cS.AbstractParserWithWordBoundaryChecking{innerPattern(){return dS}innerExtract(e,t){let n=t[pS].toLowerCase();if(t[0].length<=3&&!Xc.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[fS]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=Xc.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[Ag]){let a=Pg.parseYear(t[Ag]);i.start.assign("year",a)}else{let a=uS.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};Jc.default=Zc});var Lg=E(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});var Fg=ct(),mS=Me(),hS=H(),gS=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${mS.matchAnyPattern(Fg.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),yS=1,TS=2,Ig=3,bS=4,ed=class extends hS.AbstractParserWithWordBoundaryChecking{innerPattern(){return gS}innerExtract(e,t){let n=t[Ig]?parseInt(t[Ig]):Fg.MONTH_DICTIONARY[t[TS].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[yS]);return{day:parseInt(t[bS]),month:n,year:i}}};td.default=ed});var Ug=E(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});var _S=H(),vS=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),wS=1,kS=2,rd=class extends _S.AbstractParserWithWordBoundaryChecking{innerPattern(){return vS}innerExtract(e,t){let n=parseInt(t[kS]),i=parseInt(t[wS]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};nd.default=rd});var gi=E(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.AbstractTimeExpressionParser=void 0;var Dt=Ke();function ES(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 SS(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 Wg=2,Ji=3,su=4,au=5,ga=6,id=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 i=t.index+t[1].length,s=t[0].substring(t[1].length),a=e.createParsingResult(i,s,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return s.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 i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[Wg]);if(o>100){if(this.strictMode||t[Ji]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[Ji]!=null){if(t[Ji].length==1&&!t[ga])return null;s=parseInt(t[Ji])}if(s>=60)return null;if(o>12&&(a=Dt.Meridiem.PM),t[ga]!=null){if(o>12)return null;let u=t[ga][0].toLowerCase();u=="a"&&(a=Dt.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=Dt.Meridiem.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",Dt.Meridiem.AM):i.imply("meridiem",Dt.Meridiem.PM),t[au]!=null){let u=parseInt(t[au].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[su]!=null){let u=parseInt(t[su]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[au]!=null){let u=parseInt(t[au].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[su]!=null){let u=parseInt(t[su]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[Wg]),a=0,o=-1;if(t[Ji]!=null?a=parseInt(t[Ji]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=Dt.Meridiem.PM),t[ga]!=null){if(s>12)return null;let u=t[ga][0].toLowerCase();u=="a"&&(o=Dt.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=Dt.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==Dt.Meridiem.AM?(n.start.imply("meridiem",Dt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Dt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>s?i.imply("meridiem",Dt.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",Dt.Meridiem.PM)):s>12?i.imply("meridiem",Dt.Meridiem.PM):s<=12&&i.imply("meridiem",Dt.Meridiem.AM),i.date().getTime()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],i=t[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let s=parseInt(i),a=parseInt(n);if(s>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=ES(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=SS(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};ou.AbstractTimeExpressionParser=id});var qg=E(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var uu=Ke(),OS=gi(),sd=class extends OS.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 i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",uu.Meridiem.PM)):i<6&&n.assign("meridiem",uu.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",uu.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",uu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};ad.default=sd});var or=E(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.addImpliedTimeUnits=es.reverseTimeUnits=void 0;function DS(r){let e={};for(let t in r)e[t]=-r[t];return e}es.reverseTimeUnits=DS;function xS(r,e){let t=r.clone(),n=r.dayjs();for(let i in e)n=n.add(e[i],i);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}es.addImpliedTimeUnits=xS});var jg=E(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var ud=ct(),RS=We(),MS=H(),CS=or(),AS=new RegExp(`(${ud.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),PS=new RegExp(`(${ud.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),od=class extends MS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?PS:AS}innerExtract(e,t){let n=ud.parseTimeUnits(t[1]),i=CS.reverseTimeUnits(n);return RS.ParsingComponents.createRelativeFromReference(e.reference,i)}};ld.default=od});var $g=E(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var dd=ct(),NS=We(),IS=H(),FS=new RegExp(`(${dd.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),LS=new RegExp("("+dd.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),US=1,cd=class extends IS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?LS:FS}innerExtract(e,t){let n=dd.parseTimeUnits(t[US]);return NS.ParsingComponents.createRelativeFromReference(e.reference,n)}};fd.default=cd});var rs=E(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.MergingRefiner=ts.Filter=void 0;var pd=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};ts.Filter=pd;var md=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0],s=null;for(let a=1;a{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&n.push(i),n}};ts.MergingRefiner=md});var Qr=E(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var WS=rs(),hd=class extends WS.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(s=>{t.start.isCertain(s)||t.start.assign(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.assign(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&s.add(-7,"days").isBefore(a)?(s=s.add(-7,"days"),t.start.imply("day",s.date()),t.start.imply("month",s.month()+1),t.start.imply("year",s.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(s)?(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 i=t.clone();return i.start=t.start,i.end=n.start,i.index=Math.min(t.index,n.index),t.index{"use strict";var qS=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var jS=qS(Qr()),yd=class extends jS.default{patternBetween(){return/^\s*(to|-)\s*$/i}};ya.default=yd});var Yg=E(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.mergeDateTimeComponent=ns.mergeDateTimeResult=void 0;var $S=Ke();function GS(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=Td(n,i),r.end!=null||e.end!=null){let s=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=Td(s,a);r.end==null&&o.date().getTime(){"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var YS=rs(),Bg=Yg(),bd=class extends YS.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 i=t.start.isOnlyDate()?Bg.mergeDateTimeResult(t,n):Bg.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};_d.default=bd});var Hg=E(Ta=>{"use strict";var BS=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var HS=BS(gn()),vd=class extends HS.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};Ta.default=vd});var Vg=E(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var VS=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),zS={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},wd=class{constructor(e){this.timezone=Object.assign(Object.assign({},zS),e)}refine(e,t){var n;let i=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(s=>{var a,o;let u=e.text.substring(s.index+s.text.length),l=VS.exec(u);if(!l)return;let c=l[1].toUpperCase(),d=(o=(a=i[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(d===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${d} for: ${s.start}`)});let f=s.start.get("timezoneOffset");f!==null&&d!=f&&(s.start.isCertain("timezoneOffset")||c!=l[1])||s.start.isOnlyDate()&&c!=l[1]||(s.text+=l[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",d),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",d))}),t}};kd.default=wd});var lu=E(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});var KS=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),QS=1,XS=2,ZS=3,Ed=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let i=e.text.substring(n.index+n.text.length),s=KS.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[XS]),o=parseInt(s[ZS]||"0"),u=a*60+o;u>14*60||(s[QS]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};Sd.default=Ed});var zg=E(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var Od=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;si.text.length&&(i=a):(n.push(i),i=a)}return i!=null&&n.push(i),n}};Dd.default=Od});var Kg=E(ba=>{"use strict";var JS=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var eO=JS(we()),xd=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=eO.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&i.isAfter(n.start.dayjs()))for(let s=0;s<3&&i.isAfter(n.start.dayjs());s++)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()&&i.isAfter(n.start.dayjs())&&(i.day()>=n.start.get("weekday")?i=i.day(n.start.get("weekday")+7):i=i.day(n.start.get("weekday")),n.start.imply("day",i.date()),n.start.imply("month",i.month()+1),n.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(i.day()>n.end.get("weekday")?i=i.day(n.end.get("weekday")+7):i=i.day(n.end.get("weekday")),n.end.imply("day",i.date()),n.end.imply("month",i.month()+1),n.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};ba.default=xd});var Qg=E(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var tO=rs(),Rd=class extends tO.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}};Md.default=Rd});var Pd=E(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var rO=H(),nO=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"),iO=1,sO=2,aO=3,Xg=4,oO=5,Zg=6,Jg=7,ey=8,ty=9,Cd=class extends rO.AbstractParserWithWordBoundaryChecking{innerPattern(){return nO}innerExtract(e,t){let n={};if(n.year=parseInt(t[iO]),n.month=parseInt(t[sO]),n.day=parseInt(t[aO]),t[Xg]!=null)if(n.hour=parseInt(t[Xg]),n.minute=parseInt(t[oO]),t[Zg]!=null&&(n.second=parseInt(t[Zg])),t[Jg]!=null&&(n.millisecond=parseInt(t[Jg])),t[ey]==null)n.timezoneOffset=0;else{let i=parseInt(t[ey]),s=0;t[ty]!=null&&(s=parseInt(t[ty]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};Ad.default=Cd});var ry=E(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var uO=rs(),Nd=class extends uO.MergingRefiner{mergeResults(e,t,n){let i=n.clone();return i.index=t.index,i.text=t.text+e+i.text,i.start.assign("weekday",t.start.get("weekday")),i.end&&i.end.assign("weekday",t.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Id.default=Nd});var yn=E(is=>{"use strict";var yi=is&&is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(is,"__esModule",{value:!0});is.includeCommonConfiguration=void 0;var lO=yi(Vg()),cO=yi(lu()),ny=yi(zg()),dO=yi(Kg()),fO=yi(Qg()),pO=yi(Pd()),mO=yi(ry());function hO(r,e=!1){return r.parsers.unshift(new pO.default),r.refiners.unshift(new mO.default),r.refiners.unshift(new lO.default),r.refiners.unshift(new cO.default),r.refiners.unshift(new ny.default),r.refiners.push(new ny.default),r.refiners.push(new dO.default),r.refiners.push(new fO.default(e)),r}is.includeCommonConfiguration=hO});var bn=E(De=>{"use strict";var gO=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0});De.noon=De.morning=De.midnight=De.yesterdayEvening=De.evening=De.lastNight=De.tonight=De.theDayAfter=De.tomorrow=De.theDayBefore=De.yesterday=De.today=De.now=void 0;var Xr=We(),ss=gO(we()),Tn=ar(),_a=Ke();function yO(r){let e=ss.default(r.instant),t=new Xr.ParsingComponents(r,{});return Tn.assignSimilarDate(t,e),Tn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}De.now=yO;function TO(r){let e=ss.default(r.instant),t=new Xr.ParsingComponents(r,{});return Tn.assignSimilarDate(t,e),Tn.implySimilarTime(t,e),t}De.today=TO;function bO(r){return iy(r,1)}De.yesterday=bO;function iy(r,e){return Fd(r,-e)}De.theDayBefore=iy;function _O(r){return Fd(r,1)}De.tomorrow=_O;function Fd(r,e){let t=ss.default(r.instant),n=new Xr.ParsingComponents(r,{});return t=t.add(e,"day"),Tn.assignSimilarDate(n,t),Tn.implySimilarTime(n,t),n}De.theDayAfter=Fd;function vO(r,e=22){let t=ss.default(r.instant),n=new Xr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",_a.Meridiem.PM),Tn.assignSimilarDate(n,t),n}De.tonight=vO;function wO(r,e=0){let t=ss.default(r.instant),n=new Xr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),Tn.assignSimilarDate(n,t),n.imply("hour",e),n}De.lastNight=wO;function kO(r,e=20){let t=new Xr.ParsingComponents(r,{});return t.imply("meridiem",_a.Meridiem.PM),t.imply("hour",e),t}De.evening=kO;function EO(r,e=20){let t=ss.default(r.instant),n=new Xr.ParsingComponents(r,{});return t=t.add(-1,"day"),Tn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",_a.Meridiem.PM),n}De.yesterdayEvening=EO;function SO(r){let e=new Xr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}De.midnight=SO;function OO(r,e=6){let t=new Xr.ParsingComponents(r,{});return t.imply("meridiem",_a.Meridiem.AM),t.imply("hour",e),t}De.morning=OO;function DO(r){let e=new Xr.ParsingComponents(r,{});return e.imply("meridiem",_a.Meridiem.AM),e.imply("hour",12),e}De.noon=DO});var sy=E(xr=>{"use strict";var xO=xr&&xr.__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]}),RO=xr&&xr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),MO=xr&&xr.__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)&&xO(e,r,t);return RO(e,r),e},CO=xr&&xr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xr,"__esModule",{value:!0});var AO=CO(we()),PO=H(),NO=ar(),va=MO(bn()),IO=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Ld=class extends PO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return IO}innerExtract(e,t){let n=AO.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":return va.now(e.reference);case"today":return va.today(e.reference);case"yesterday":return va.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return va.tomorrow(e.reference);case"tonight":return va.tonight(e.reference);default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),NO.assignSimilarDate(s,n),s.imply("hour",0));break}return s}};xr.default=Ld});var ay=E(wa=>{"use strict";var FO=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var cu=Ke(),LO=H(),UO=FO(we()),WO=ar(),qO=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Ud=class extends LO.AbstractParserWithWordBoundaryChecking{innerPattern(){return qO}innerExtract(e,t){let n=UO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",cu.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",cu.Meridiem.PM),i.imply("hour",20);break;case"midnight":WO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",cu.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",cu.Meridiem.AM),i.imply("hour",12);break}return i}};wa.default=Ud});var Ti=E(Bn=>{"use strict";var jO=Bn&&Bn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.toDayJSClosestWeekday=Bn.toDayJSWeekday=void 0;var oy=jO(we());function $O(r,e,t){if(!t)return uy(r,e);let n=oy.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}Bn.toDayJSWeekday=$O;function uy(r,e){let t=oy.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var ly=ct(),GO=Me(),YO=H(),BO=Ti(),HO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${GO.matchAnyPattern(ly.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),VO=1,zO=2,KO=3,Wd=class extends YO.AbstractParserWithWordBoundaryChecking{innerPattern(){return HO}innerExtract(e,t){let n=t[zO].toLowerCase(),i=ly.WEEKDAY_DICTIONARY[n],s=t[VO],a=t[KO],o=s||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=BO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};qd.default=Wd});var py=E(ka=>{"use strict";var QO=ka&&ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ka,"__esModule",{value:!0});var fy=ct(),dy=We(),XO=QO(we()),ZO=H(),JO=Me(),eD=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${JO.matchAnyPattern(fy.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),tD=1,rD=2,jd=class extends ZO.AbstractParserWithWordBoundaryChecking{innerPattern(){return eD}innerExtract(e,t){let n=t[tD].toLowerCase(),i=t[rD].toLowerCase(),s=fy.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,dy.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,dy.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=XO.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}};ka.default=jd});var Rr=E(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.ParsingContext=us.Chrono=void 0;var as=We(),nD=$d(),os=class{constructor(e){e=e||nD.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new os({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let i=this.parse(e,t,n);return i.length>0?i[0].start.date():null}parse(e,t,n){let i=new du(e,t,n),s=[];return this.parsers.forEach(a=>{let o=os.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(e,t){let n=[],i=t.pattern(e),s=e.text,a=e.text,o=i.exec(a);for(;o;){let u=o.index+s.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;l instanceof as.ParsingResult?c=l:l instanceof as.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=s.substring(u+c.text.length),o=i.exec(a)}return n}};us.Chrono=os;var du=class{constructor(e,t,n){this.text=e,this.reference=new as.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof as.ParsingComponents?e:new as.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,i){let s=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=i?this.createParsingComponents(i):null;return new as.ParsingResult(this.reference,e,s,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};us.ParsingContext=du});var bi=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var my=lt(),iD=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"),fu=1,hy=5,gy=2,yy=3,Gd=4,Yd=class{constructor(e){this.groupNumberMonth=e?yy:gy,this.groupNumberDay=e?gy:yy}pattern(){return iD}extract(e,t){if(t[fu]=="/"||t[hy]=="/"){t.index+=t[0].length;return}let n=t.index+t[fu].length,i=t[0].substr(t[fu].length,t[0].length-t[fu].length-t[hy].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Gd]&&t[0].indexOf("/")<0)return;let s=e.createParsingResult(n,i),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(s.start.assign("day",o),s.start.assign("month",a),t[Gd]){let u=parseInt(t[Gd]),l=my.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=my.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};Bd.default=Yd});var by=E(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var Ty=ct(),sD=We(),aD=H(),oD=or(),uD=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Ty.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Hd=class extends aD.AbstractParserWithWordBoundaryChecking{innerPattern(){return uD}innerExtract(e,t){let n=t[1].toLowerCase(),i=Ty.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=oD.reverseTimeUnits(i);break}return sD.ParsingComponents.createRelativeFromReference(e.reference,i)}};Vd.default=Hd});var vy=E(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var lD=rs(),zd=We(),cD=ct(),dD=or();function _y(r){return r.text.match(/\s+(before|from)$/i)!=null}function fD(r){return r.text.match(/\s+(after|since)$/i)!=null}var Kd=class extends lD.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!_y(t)&&!fD(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=cD.parseTimeUnits(t.text);_y(t)&&(i=dD.reverseTimeUnits(i));let s=zd.ParsingComponents.createRelativeFromReference(new zd.ReferenceWithTimezone(n.start.date()),i);return new zd.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};Qd.default=Kd});var $d=E(Ye=>{"use strict";var Ze=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConfiguration=Ye.createCasualConfiguration=Ye.parseDate=Ye.parse=Ye.GB=Ye.strict=Ye.casual=void 0;var pD=Ze(_g()),mD=Ze(Og()),hD=Ze(Cg()),gD=Ze(Ng()),yD=Ze(Lg()),TD=Ze(Ug()),bD=Ze(qg()),_D=Ze(jg()),vD=Ze($g()),wD=Ze(Gg()),kD=Ze(Hg()),ED=yn(),SD=Ze(sy()),OD=Ze(ay()),DD=Ze(cy()),xD=Ze(py()),Xd=Rr(),RD=Ze(bi()),MD=Ze(by()),CD=Ze(vy());Ye.casual=new Xd.Chrono(wy(!1));Ye.strict=new Xd.Chrono(pu(!0,!1));Ye.GB=new Xd.Chrono(pu(!1,!0));function AD(r,e,t){return Ye.casual.parse(r,e,t)}Ye.parse=AD;function PD(r,e,t){return Ye.casual.parseDate(r,e,t)}Ye.parseDate=PD;function wy(r=!1){let e=pu(!1,r);return e.parsers.unshift(new SD.default),e.parsers.unshift(new OD.default),e.parsers.unshift(new gD.default),e.parsers.unshift(new xD.default),e.parsers.unshift(new MD.default),e}Ye.createCasualConfiguration=wy;function pu(r=!0,e=!1){return ED.includeCommonConfiguration({parsers:[new RD.default(e),new pD.default,new mD.default,new hD.default,new DD.default,new yD.default,new TD.default,new bD.default(r),new _D.default(r),new vD.default(r)],refiners:[new CD.default,new kD.default,new wD.default]},r)}Ye.createConfiguration=pu});var ky=E(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var ND=gi(),Zd=class extends ND.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)}};Jd.default=Zd});var Ea=E(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 ef=Me(),ID=lt();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=`(?:${ef.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 Sy(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=Sy;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 FD(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 ID.findMostLikelyADYear(e)}Ae.parseYear=FD;var Oy=`(${Ae.NUMBER_PATTERN})\\s{0,5}(${ef.matchAnyPattern(Ae.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ey=new RegExp(Oy,"i");Ae.TIME_UNITS_PATTERN=ef.repeatedTimeunitPattern("",Oy);function LD(r){let e={},t=r,n=Ey.exec(t);for(;n;)UD(e,n),t=t.substring(n[0].length),n=Ey.exec(t);return e}Ae.parseTimeUnits=LD;function UD(r,e){let t=Sy(e[1]),n=Ae.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var xy=E(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});var Dy=Ea(),WD=Me(),qD=H(),jD=Ti(),$D=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${WD.matchAnyPattern(Dy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),GD=1,YD=3,BD=2,tf=class extends qD.AbstractParserWithWordBoundaryChecking{innerPattern(){return $D}innerExtract(e,t){let n=t[BD].toLowerCase(),i=Dy.WEEKDAY_DICTIONARY[n],s=t[GD],a=t[YD],o=s||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=jD.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};rf.default=tf});var Ay=E(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var Hn=Ke(),HD=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"),VD=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"),zD=2,Ry=3,My=4,Cy=5,ls=class{pattern(e){return HD}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=ls.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=VD.exec(i);return s&&(n.end=ls.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[zD]),t[Ry]!=null&&(i=parseInt(t[Ry])),i>=60||n>24)return null;if(n>=12&&(s=Hn.Meridiem.PM),t[Cy]!=null){if(n>12)return null;let a=t[Cy].toLowerCase();a.match(/morgen|vormittag/)&&(s=Hn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=Hn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=Hn.Meridiem.AM,n=0):n<6?s=Hn.Meridiem.AM:(s=Hn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Hn.Meridiem.AM):e.imply("meridiem",Hn.Meridiem.PM),t[My]!=null){let a=parseInt(t[My]);if(a>=60)return null;e.assign("second",a)}return e}};nf.default=ls});var Py=E(Sa=>{"use strict";var KD=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var QD=KD(Qr()),sf=class extends QD.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Sa.default=sf});var Ny=E(Oa=>{"use strict";var XD=Oa&&Oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oa,"__esModule",{value:!0});var ZD=XD(gn()),af=class extends ZD.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Oa.default=af});var of=E(xa=>{"use strict";var JD=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var e0=JD(we()),_i=Ke(),t0=H(),r0=ar(),n0=or(),Da=class extends t0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=e0.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return r0.implySimilarTime(s,n),Da.extractTimeComponents(s,i)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=n0.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break}return e}};xa.default=Da});var Ly=E(Mr=>{"use strict";var i0=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]}),s0=Mr&&Mr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),a0=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)&&i0(e,r,t);return s0(e,r),e},Fy=Mr&&Mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mr,"__esModule",{value:!0});var o0=Fy(we()),u0=H(),vi=ar(),l0=Fy(of()),Iy=a0(bn()),c0=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),d0=1,f0=2,uf=class extends u0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return c0}innerExtract(e,t){let n=o0.default(e.refDate),i=(t[d0]||"").toLowerCase(),s=(t[f0]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=Iy.now(e.reference);break;case"heute":a=Iy.today(e.reference);break;case"morgen":vi.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),vi.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),vi.assignSimilarDate(a,n),vi.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),vi.assignSimilarDate(a,n),vi.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),vi.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=l0.default.extractTimeComponents(a,s)),a}};Mr.default=uf});var Gy=E(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var p0=lt(),jy=Ea(),$y=Ea(),m0=Me(),h0=H(),g0=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${m0.matchAnyPattern(jy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${$y.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Uy=1,Wy=2,y0=3,qy=4,lf=class extends h0.AbstractParserWithWordBoundaryChecking{innerPattern(){return g0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=jy.MONTH_DICTIONARY[t[y0].toLowerCase()],s=parseInt(t[Uy]);if(s>31)return t.index=t.index+t[Uy].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[qy]){let a=$y.parseYear(t[qy]);n.start.assign("year",a)}else{let a=p0.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Wy]){let a=parseInt(t[Wy]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};cf.default=lf});var Yy=E(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var mu=Ea(),T0=We(),b0=H(),_0=or(),v0=Me(),df=class extends b0.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*)?(${mu.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${v0.matchAnyPattern(mu.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?mu.parseNumberPattern(t[2]):1,i=mu.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],s={};s[i]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(s=_0.reverseTimeUnits(s)),T0.ParsingComponents.createRelativeFromReference(e.reference,s)}};ff.default=df});var Vy=E(Je=>{"use strict";var Cr=Je&&Je.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Je,"__esModule",{value:!0});Je.createConfiguration=Je.createCasualConfiguration=Je.parseDate=Je.parse=Je.strict=Je.casual=void 0;var w0=yn(),By=Rr(),k0=Cr(bi()),E0=Cr(Pd()),S0=Cr(ky()),O0=Cr(xy()),D0=Cr(Ay()),x0=Cr(Py()),R0=Cr(Ny()),M0=Cr(Ly()),C0=Cr(of()),A0=Cr(Gy()),P0=Cr(Yy());Je.casual=new By.Chrono(Hy());Je.strict=new By.Chrono(pf(!0));function N0(r,e,t){return Je.casual.parse(r,e,t)}Je.parse=N0;function I0(r,e,t){return Je.casual.parseDate(r,e,t)}Je.parseDate=I0;function Hy(r=!0){let e=pf(!1,r);return e.parsers.unshift(new C0.default),e.parsers.unshift(new M0.default),e.parsers.unshift(new P0.default),e}Je.createCasualConfiguration=Hy;function pf(r=!0,e=!0){return w0.includeCommonConfiguration({parsers:[new E0.default,new k0.default(e),new S0.default,new D0.default,new A0.default,new O0.default],refiners:[new x0.default,new R0.default]},r)}Je.createConfiguration=pf});var Ky=E(Ar=>{"use strict";var F0=Ar&&Ar.__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]}),L0=Ar&&Ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),U0=Ar&&Ar.__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)&&F0(e,r,t);return L0(e,r),e},W0=Ar&&Ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ar,"__esModule",{value:!0});var q0=W0(we()),j0=Ke(),$0=H(),zy=ar(),hu=U0(bn()),mf=class extends $0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=q0.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return hu.now(e.reference);case"aujourd'hui":return hu.today(e.reference);case"hier":return hu.yesterday(e.reference);case"demain":return hu.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(zy.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",j0.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),zy.assignSimilarDate(s,n),s.imply("hour",0))}return s}};Ar.default=mf});var Qy=E(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var Ra=Ke(),G0=H(),hf=class extends G0.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(),i=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":i.imply("hour",14),i.imply("minute",0),i.imply("meridiem",Ra.Meridiem.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",Ra.Meridiem.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",Ra.Meridiem.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",Ra.Meridiem.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",Ra.Meridiem.AM);break}return i}};gf.default=hf});var Xy=E(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var Y0=gi(),yf=class extends Y0.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)}};Tf.default=yf});var Zy=E(Ma=>{"use strict";var B0=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var H0=B0(gn()),bf=class extends H0.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Ma.default=bf});var Jy=E(Ca=>{"use strict";var V0=Ca&&Ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ca,"__esModule",{value:!0});var z0=V0(Qr()),_f=class extends z0.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Ca.default=_f});var Vn=E(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.parseTimeUnits=ke.TIME_UNITS_PATTERN=ke.parseYear=ke.YEAR_PATTERN=ke.parseOrdinalNumberPattern=ke.ORDINAL_NUMBER_PATTERN=ke.parseNumberPattern=ke.NUMBER_PATTERN=ke.TIME_UNIT_DICTIONARY=ke.INTEGER_WORD_DICTIONARY=ke.MONTH_DICTIONARY=ke.WEEKDAY_DICTIONARY=void 0;var vf=Me();ke.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};ke.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};ke.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};ke.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"};ke.NUMBER_PATTERN=`(?:${vf.matchAnyPattern(ke.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function tT(r){let e=r.toLowerCase();return ke.INTEGER_WORD_DICTIONARY[e]!==void 0?ke.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}ke.parseNumberPattern=tT;ke.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function K0(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}ke.parseOrdinalNumberPattern=K0;ke.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 Q0(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}ke.parseYear=Q0;var rT=`(${ke.NUMBER_PATTERN})\\s{0,5}(${vf.matchAnyPattern(ke.TIME_UNIT_DICTIONARY)})\\s{0,5}`,eT=new RegExp(rT,"i");ke.TIME_UNITS_PATTERN=vf.repeatedTimeunitPattern("",rT);function X0(r){let e={},t=r,n=eT.exec(t);for(;n;)Z0(e,n),t=t.substring(n[0].length),n=eT.exec(t);return e}ke.parseTimeUnits=X0;function Z0(r,e){let t=tT(e[1]),n=ke.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var iT=E(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var nT=Vn(),J0=Me(),e1=H(),t1=Ti(),r1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${J0.matchAnyPattern(nT.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),n1=1,i1=2,wf=class extends e1.AbstractParserWithWordBoundaryChecking{innerPattern(){return r1}innerExtract(e,t){let n=t[n1].toLowerCase(),i=nT.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[i1];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=t1.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};kf.default=wf});var uT=E(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var Aa=Ke(),s1=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"),a1=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"),o1=2,sT=3,aT=4,oT=5,cs=class{pattern(e){return s1}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=cs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=a1.exec(i);return s&&(n.end=cs.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[o1]),t[sT]!=null&&(i=parseInt(t[sT])),i>=60||n>24)return null;if(n>=12&&(s=Aa.Meridiem.PM),t[oT]!=null){if(n>12)return null;let a=t[oT][0].toLowerCase();a=="a"&&(s=Aa.Meridiem.AM,n==12&&(n=0)),a=="p"&&(s=Aa.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Aa.Meridiem.AM):e.imply("meridiem",Aa.Meridiem.PM),t[aT]!=null){let a=parseInt(t[aT]);if(a>=60)return null;e.assign("second",a)}return e}};Ef.default=cs});var mT=E(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});var u1=lt(),fT=Vn(),pT=Vn(),gu=Vn(),l1=Me(),c1=H(),d1=new RegExp(`(?:on\\s*?)?(${gu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${gu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${l1.matchAnyPattern(fT.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${pT.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),lT=1,cT=2,f1=3,dT=4,Sf=class extends c1.AbstractParserWithWordBoundaryChecking{innerPattern(){return d1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=fT.MONTH_DICTIONARY[t[f1].toLowerCase()],s=gu.parseOrdinalNumberPattern(t[lT]);if(s>31)return t.index=t.index+t[lT].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[dT]){let a=pT.parseYear(t[dT]);n.start.assign("year",a)}else{let a=u1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[cT]){let a=gu.parseOrdinalNumberPattern(t[cT]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Of.default=Sf});var gT=E(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});var hT=Vn(),p1=We(),m1=H(),h1=or(),Df=class extends m1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${hT.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=hT.parseTimeUnits(t[1]),i=h1.reverseTimeUnits(n);return p1.ParsingComponents.createRelativeFromReference(e.reference,i)}};xf.default=Df});var TT=E(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var yT=Vn(),g1=We(),y1=H(),Rf=class extends y1.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${yT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=yT.parseTimeUnits(t[1]);return g1.ParsingComponents.createRelativeFromReference(e.reference,n)}};Mf.default=Rf});var bT=E(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});var yu=Vn(),T1=We(),b1=H(),_1=or(),v1=Me(),Cf=class extends b1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${yu.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${v1.matchAnyPattern(yu.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]?yu.parseNumberPattern(t[1]):1,i=yu.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],s={};s[i]=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))&&(s=_1.reverseTimeUnits(s)),T1.ParsingComponents.createRelativeFromReference(e.reference,s)}};Af.default=Cf});var wT=E(et=>{"use strict";var ur=et&&et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(et,"__esModule",{value:!0});et.createConfiguration=et.createCasualConfiguration=et.parseDate=et.parse=et.strict=et.casual=void 0;var w1=yn(),_T=Rr(),k1=ur(Ky()),E1=ur(Qy()),S1=ur(bi()),O1=ur(Xy()),D1=ur(Zy()),x1=ur(Jy()),R1=ur(iT()),M1=ur(uT()),C1=ur(mT()),A1=ur(gT()),P1=ur(TT()),N1=ur(bT());et.casual=new _T.Chrono(vT());et.strict=new _T.Chrono(Pf(!0));function I1(r,e,t){return et.casual.parse(r,e,t)}et.parse=I1;function F1(r,e,t){return et.casual.parseDate(r,e,t)}et.parseDate=F1;function vT(r=!0){let e=Pf(!1,r);return e.parsers.unshift(new k1.default),e.parsers.unshift(new E1.default),e.parsers.unshift(new N1.default),e}et.createCasualConfiguration=vT;function Pf(r=!0,e=!0){return w1.includeCommonConfiguration({parsers:[new S1.default(e),new C1.default,new O1.default,new M1.default,new A1.default,new P1.default,new R1.default],refiners:[new D1.default,new x1.default]},r)}et.createConfiguration=Pf});var kT=E(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.toHankaku=void 0;function L1(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,U1)}Tu.toHankaku=L1;function U1(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var ST=E(Pa=>{"use strict";var W1=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var Nf=kT(),q1=lt(),j1=W1(we()),$1=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,ET=1,G1=2,If=3,Y1=4,B1=5,H1=6,Ff=class{pattern(){return $1}extract(e,t){let n=parseInt(Nf.toHankaku(t[B1])),i=parseInt(Nf.toHankaku(t[H1])),s=e.createParsingComponents({day:i,month:n});if(t[ET]&&t[ET].match("\u540C|\u4ECA|\u672C")){let a=j1.default(e.refDate);s.assign("year",a.year())}if(t[G1]){let a=t[Y1],o=a=="\u5143"?1:parseInt(Nf.toHankaku(a));t[If]=="\u4EE4\u548C"?o+=2018:t[If]=="\u5E73\u6210"?o+=1988:t[If]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=q1.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};Pa.default=Ff});var OT=E(Na=>{"use strict";var V1=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var z1=V1(Qr()),Lf=class extends z1.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Na.default=Lf});var xT=E(Pr=>{"use strict";var K1=Pr&&Pr.__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]}),Q1=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),X1=Pr&&Pr.__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)&&K1(e,r,t);return Q1(e,r),e},Z1=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0});var J1=Z1(we()),DT=Ke(),Uf=X1(bn()),ex=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Wf=class{pattern(){return ex}extract(e,t){let n=t[0],i=J1.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Uf.yesterday(e.reference);case"\u660E\u65E5":return Uf.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Uf.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",DT.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",DT.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};Pr.default=Wf});var CT=E(tt=>{"use strict";var qf=tt&&tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tt,"__esModule",{value:!0});tt.createConfiguration=tt.createCasualConfiguration=tt.parseDate=tt.parse=tt.strict=tt.casual=void 0;var tx=qf(ST()),rx=qf(OT()),nx=qf(xT()),RT=Rr();tt.casual=new RT.Chrono(MT());tt.strict=new RT.Chrono(jf());function ix(r,e,t){return tt.casual.parse(r,e,t)}tt.parse=ix;function sx(r,e,t){return tt.casual.parseDate(r,e,t)}tt.parseDate=sx;function MT(){let r=jf();return r.parsers.unshift(new nx.default),r}tt.createCasualConfiguration=MT;function jf(){return{parsers:[new tx.default],refiners:[new rx.default]}}tt.createConfiguration=jf});var bu=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.parseYear=Zr.YEAR_PATTERN=Zr.MONTH_DICTIONARY=Zr.WEEKDAY_DICTIONARY=void 0;Zr.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};Zr.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};Zr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function ax(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)}Zr.parseYear=ax});var PT=E(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});var AT=bu(),ox=Me(),ux=H(),lx=Ti(),cx=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${ox.matchAnyPattern(AT.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),dx=1,fx=2,px=3,$f=class extends ux.AbstractParserWithWordBoundaryChecking{innerPattern(){return cx}innerExtract(e,t){let n=t[fx].toLowerCase(),i=AT.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[dx],a=t[px],o=s||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=lx.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Gf.default=$f});var NT=E(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});var mx=gi(),Yf=class extends mx.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Bf.default=Yf});var IT=E(Ia=>{"use strict";var hx=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var gx=hx(gn()),Hf=class extends gx.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Ia.default=Hf});var FT=E(Fa=>{"use strict";var yx=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var Tx=yx(Qr()),Vf=class extends Tx.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Fa.default=Vf});var $T=E(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});var bx=lt(),qT=bu(),jT=bu(),_x=Me(),vx=H(),wx=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*)(${_x.matchAnyPattern(qT.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${jT.YEAR_PATTERN}))?(?=\\W|$)`,"i"),LT=1,UT=2,kx=3,WT=4,zf=class extends vx.AbstractParserWithWordBoundaryChecking{innerPattern(){return wx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=qT.MONTH_DICTIONARY[t[kx].toLowerCase()],s=parseInt(t[LT]);if(s>31)return t.index=t.index+t[LT].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[WT]){let a=jT.parseYear(t[WT]);n.start.assign("year",a)}else{let a=bx.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[UT]){let a=parseInt(t[UT]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Kf.default=zf});var GT=E(_n=>{"use strict";var Ex=_n&&_n.__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]}),Sx=_n&&_n.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ox=_n&&_n.__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)&&Ex(e,r,t);return Sx(e,r),e};Object.defineProperty(_n,"__esModule",{value:!0});var Dx=H(),_u=Ox(bn()),Qf=class extends Dx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"agora":return _u.now(e.reference);case"hoje":return _u.today(e.reference);case"amanha":case"amanh\xE3":return _u.tomorrow(e.reference);case"ontem":return _u.yesterday(e.reference)}return i}};_n.default=Qf});var YT=E(La=>{"use strict";var xx=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var vu=Ke(),Rx=H(),Mx=ar(),Cx=xx(we()),Xf=class extends Rx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=Cx.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",vu.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",vu.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",vu.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":Mx.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",vu.Meridiem.AM),i.imply("hour",12);break}return i}};La.default=Xf});var VT=E(rt=>{"use strict";var zn=rt&&rt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rt,"__esModule",{value:!0});rt.createConfiguration=rt.createCasualConfiguration=rt.parseDate=rt.parse=rt.strict=rt.casual=void 0;var Ax=yn(),BT=Rr(),Px=zn(bi()),Nx=zn(PT()),Ix=zn(NT()),Fx=zn(IT()),Lx=zn(FT()),Ux=zn($T()),Wx=zn(GT()),qx=zn(YT());rt.casual=new BT.Chrono(HT());rt.strict=new BT.Chrono(Zf(!0));function jx(r,e,t){return rt.casual.parse(r,e,t)}rt.parse=jx;function $x(r,e,t){return rt.casual.parseDate(r,e,t)}rt.parseDate=$x;function HT(r=!0){let e=Zf(!1,r);return e.parsers.push(new Wx.default),e.parsers.push(new qx.default),e}rt.createCasualConfiguration=HT;function Zf(r=!0,e=!0){return Ax.includeCommonConfiguration({parsers:[new Px.default(e),new Nx.default,new Ix.default,new Ux.default],refiners:[new Fx.default,new Lx.default]},r)}rt.createConfiguration=Zf});var zT=E(Ua=>{"use strict";var Gx=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var Yx=Gx(Qr()),Jf=class extends Yx.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};Ua.default=Jf});var KT=E(Wa=>{"use strict";var Bx=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var Hx=Bx(gn()),ep=class extends Hx.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Wa.default=ep});var QT=E(vn=>{"use strict";var Vx=vn&&vn.__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]}),zx=vn&&vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Kx=vn&&vn.__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)&&Vx(e,r,t);return zx(e,r),e};Object.defineProperty(vn,"__esModule",{value:!0});var Qx=H(),wu=Kx(bn()),tp=class extends Qx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"nu":return wu.now(e.reference);case"vandaag":return wu.today(e.reference);case"morgen":case"morgend":return wu.tomorrow(e.reference);case"gisteren":return wu.yesterday(e.reference)}return i}};vn.default=tp});var XT=E(qa=>{"use strict";var Xx=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var ku=Ke(),Zx=H(),Jx=Xx(we()),eR=ar(),tR=1,rR=2,rp=class extends Zx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=Jx.default(e.refDate),i=e.createParsingComponents();switch(t[tR]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[rR].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",ku.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",ku.Meridiem.PM),i.imply("hour",20);break;case"middernacht":eR.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",ku.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",ku.Meridiem.AM),i.imply("hour",12);break}return i}};qa.default=rp});var Bt=E(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.parseTimeUnits=Te.TIME_UNITS_PATTERN=Te.parseYear=Te.YEAR_PATTERN=Te.parseOrdinalNumberPattern=Te.ORDINAL_NUMBER_PATTERN=Te.parseNumberPattern=Te.NUMBER_PATTERN=Te.TIME_UNIT_DICTIONARY=Te.ORDINAL_WORD_DICTIONARY=Te.INTEGER_WORD_DICTIONARY=Te.MONTH_DICTIONARY=Te.WEEKDAY_DICTIONARY=void 0;var Eu=Me(),nR=lt();Te.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};Te.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};Te.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};Te.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};Te.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"};Te.NUMBER_PATTERN=`(?:${Eu.matchAnyPattern(Te.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function JT(r){let e=r.toLowerCase();return Te.INTEGER_WORD_DICTIONARY[e]!==void 0?Te.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}Te.parseNumberPattern=JT;Te.ORDINAL_NUMBER_PATTERN=`(?:${Eu.matchAnyPattern(Te.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function iR(r){let e=r.toLowerCase();return Te.ORDINAL_WORD_DICTIONARY[e]!==void 0?Te.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}Te.parseOrdinalNumberPattern=iR;Te.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function sR(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 nR.findMostLikelyADYear(e)}Te.parseYear=sR;var eb=`(${Te.NUMBER_PATTERN})\\s{0,5}(${Eu.matchAnyPattern(Te.TIME_UNIT_DICTIONARY)})\\s{0,5}`,ZT=new RegExp(eb,"i");Te.TIME_UNITS_PATTERN=Eu.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",eb);function aR(r){let e={},t=r,n=ZT.exec(t);for(;n;)oR(e,n),t=t.substring(n[0].length),n=ZT.exec(t);return e}Te.parseTimeUnits=aR;function oR(r,e){let t=JT(e[1]),n=Te.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var rb=E(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var tb=Bt(),uR=We(),lR=H(),np=class extends lR.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+tb.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=tb.parseTimeUnits(t[1]);return uR.ParsingComponents.createRelativeFromReference(e.reference,n)}};ip.default=np});var ib=E(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var nb=Bt(),cR=Me(),dR=H(),fR=Ti(),pR=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${cR.matchAnyPattern(nb.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),mR=1,hR=2,gR=3,sp=class extends dR.AbstractParserWithWordBoundaryChecking{innerPattern(){return pR}innerExtract(e,t){let n=t[hR].toLowerCase(),i=nb.WEEKDAY_DICTIONARY[n],s=t[mR],a=t[gR],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=fR.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};ap.default=sp});var cb=E(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var yR=lt(),ub=Bt(),Su=Bt(),lb=Bt(),TR=Me(),bR=H(),_R=new RegExp(`(?:on\\s*?)?(${Su.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Su.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+TR.matchAnyPattern(ub.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${lb.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),vR=3,sb=1,ab=2,ob=4,op=class extends bR.AbstractParserWithWordBoundaryChecking{innerPattern(){return _R}innerExtract(e,t){let n=ub.MONTH_DICTIONARY[t[vR].toLowerCase()],i=Su.parseOrdinalNumberPattern(t[sb]);if(i>31)return t.index=t.index+t[sb].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[ob]){let u=lb.parseYear(t[ob]);s.assign("year",u)}else{let u=yR.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[ab])return s;let a=Su.parseOrdinalNumberPattern(t[ab]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};up.default=op});var mb=E(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});var fb=Bt(),wR=lt(),kR=Me(),pb=Bt(),ER=H(),SR=new RegExp(`(${kR.matchAnyPattern(fb.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${pb.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),OR=1,db=2,lp=class extends ER.AbstractParserWithWordBoundaryChecking{innerPattern(){return SR}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[OR],s=fb.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[db]){let a=pb.parseYear(t[db]);n.assign("year",a)}else{let a=wR.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};cp.default=lp});var hb=E(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var DR=H(),xR=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),RR=1,MR=2,dp=class extends DR.AbstractParserWithWordBoundaryChecking{innerPattern(){return xR}innerExtract(e,t){let n=parseInt(t[MR]),i=parseInt(t[RR]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};fp.default=dp});var gb=E(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var CR=gi(),pp=class extends CR.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)}};mp.default=pp});var bb=E(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var Tb=Bt(),AR=Me(),PR=H(),NR=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${AR.matchAnyPattern(Tb.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),IR=1,FR=2,yb=3,LR=4,hp=class extends PR.AbstractParserWithWordBoundaryChecking{innerPattern(){return NR}innerExtract(e,t){let n=t[yb]?parseInt(t[yb]):Tb.MONTH_DICTIONARY[t[FR].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[IR]);return{day:parseInt(t[LR]),month:n,year:i}}};gp.default=hp});var _b=E(ja=>{"use strict";var UR=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var WR=H(),Ou=Ke(),yp=ar(),qR=UR(we()),jR=1,$R=2,Tp=class extends WR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[jR].toLowerCase(),i=t[$R].toLowerCase(),s=e.createParsingComponents(),a=qR.default(e.refDate);switch(n){case"gisteren":yp.assignSimilarDate(s,a.add(-1,"day"));break;case"van":yp.assignSimilarDate(s,a);break;case"morgen":yp.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",Ou.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",Ou.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",Ou.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",Ou.Meridiem.PM),s.imply("hour",20);break}return s}};ja.default=Tp});var wb=E(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var vb=Bt(),GR=We(),YR=H(),BR=or(),HR=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${vb.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),bp=class extends YR.AbstractParserWithWordBoundaryChecking{innerPattern(){return HR}innerExtract(e,t){let n=t[1].toLowerCase(),i=vb.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=BR.reverseTimeUnits(i);break}return GR.ParsingComponents.createRelativeFromReference(e.reference,i)}};_p.default=bp});var Sb=E($a=>{"use strict";var VR=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var Eb=Bt(),kb=We(),zR=VR(we()),KR=H(),QR=Me(),XR=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${QR.matchAnyPattern(Eb.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),ZR=1,JR=2,vp=class extends KR.AbstractParserWithWordBoundaryChecking{innerPattern(){return XR}innerExtract(e,t){let n=t[ZR].toLowerCase(),i=t[JR].toLowerCase(),s=Eb.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,kb.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,kb.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=zR.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(/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)):i.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}};$a.default=vp});var Ob=E(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});var kp=Bt(),eM=We(),tM=H(),rM=or(),nM=new RegExp("("+kp.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),iM=new RegExp("("+kp.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),wp=class extends tM.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?iM:nM}innerExtract(e,t){let n=kp.parseTimeUnits(t[1]),i=rM.reverseTimeUnits(n);return eM.ParsingComponents.createRelativeFromReference(e.reference,i)}};Ep.default=wp});var Db=E(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});var Op=Bt(),sM=We(),aM=H(),oM=new RegExp("("+Op.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),uM=new RegExp("("+Op.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),lM=1,Sp=class extends aM.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?uM:oM}innerExtract(e,t){let n=Op.parseTimeUnits(t[lM]);return sM.ParsingComponents.createRelativeFromReference(e.reference,n)}};Dp.default=Sp});var Cb=E(nt=>{"use strict";var dt=nt&&nt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nt,"__esModule",{value:!0});nt.createConfiguration=nt.createCasualConfiguration=nt.parseDate=nt.parse=nt.strict=nt.casual=void 0;var cM=yn(),xb=Rr(),dM=dt(zT()),fM=dt(KT()),pM=dt(QT()),mM=dt(XT()),hM=dt(bi()),gM=dt(rb()),yM=dt(ib()),TM=dt(cb()),Rb=dt(mb()),bM=dt(hb()),_M=dt(gb()),vM=dt(bb()),wM=dt(_b()),kM=dt(wb()),EM=dt(Sb()),SM=dt(Ob()),OM=dt(Db());nt.casual=new xb.Chrono(Mb());nt.strict=new xb.Chrono(xp(!0));function DM(r,e,t){return nt.casual.parse(r,e,t)}nt.parse=DM;function xM(r,e,t){return nt.casual.parseDate(r,e,t)}nt.parseDate=xM;function Mb(r=!0){let e=xp(!1,r);return e.parsers.unshift(new pM.default),e.parsers.unshift(new mM.default),e.parsers.unshift(new wM.default),e.parsers.unshift(new Rb.default),e.parsers.unshift(new EM.default),e.parsers.unshift(new kM.default),e}nt.createCasualConfiguration=Mb;function xp(r=!0,e=!0){return cM.includeCommonConfiguration({parsers:[new hM.default(e),new gM.default,new TM.default,new Rb.default,new yM.default,new vM.default,new bM.default,new _M.default(r),new SM.default(r),new OM.default(r)],refiners:[new fM.default,new dM.default]},r)}nt.createConfiguration=xp});var Ib=E(Ga=>{"use strict";var RM=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var MM=RM(we()),CM=H(),AM=1,Ab=2,PM=3,Pb=4,Nb=5,NM=6,Rp=class extends CM.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,i=e.createParsingResult(n,t[0]),s=MM.default(e.refDate),a=s;if(t[AM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[Ab]){let o=t[Ab],u=t[PM];o=="\u660E"||o=="\u807D"?s.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"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[Pb]){let u=t[Pb][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[Nb]){let o=t[Nb];o=="\u660E"||o=="\u807D"?s.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[NM];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Ga.default=Rp});var ds=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.zhStringToYear=Ft.zhStringToNumber=Ft.WEEKDAY_OFFSET=Ft.NUMBER=void 0;Ft.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};Ft.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function IM(r){let e=0;for(let t=0;t{"use strict";var LM=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var UM=LM(we()),WM=H(),wi=ds(),Mp=1,Fb=2,Cp=3,Ap=class extends WM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(wi.NUMBER).join("")+"]{4}|["+Object.keys(wi.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(wi.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(wi.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=UM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[Fb]);if(isNaN(s)&&(s=wi.zhStringToNumber(t[Fb])),i.start.assign("month",s),t[Cp]){let a=parseInt(t[Cp]);isNaN(a)&&(a=wi.zhStringToNumber(t[Cp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Mp]){let a=parseInt(t[Mp]);isNaN(a)&&(a=wi.zhStringToYear(t[Mp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Ya.default=Ap});var Wb=E(Ba=>{"use strict";var qM=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var jM=qM(we()),$M=H(),Ub=ds(),GM=new RegExp("(\\d+|["+Object.keys(Ub.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"),Pp=1,YM=2,Np=class extends $M.AbstractParserWithWordBoundaryChecking{innerPattern(){return GM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Pp]);if(isNaN(i)&&(i=Ub.zhStringToNumber(t[Pp])),isNaN(i)){let u=t[Pp];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=jM.default(e.refDate),o=t[YM][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u79AE"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u9418")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Ba.default=Np});var jb=E(Ha=>{"use strict";var BM=Ha&&Ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ha,"__esModule",{value:!0});var HM=BM(we()),VM=H(),qb=ds(),zM=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(qb.WEEKDAY_OFFSET).join("|")+")"),Ip=class extends VM.AbstractParserWithWordBoundaryChecking{innerPattern(){return zM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=qb.WEEKDAY_OFFSET[i];if(s===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=HM.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c){"use strict";var KM=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var QM=KM(we()),XM=H(),cr=ds(),ZM=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(cr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),JM=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(cr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Du=1,xu=2,Ru=3,Mu=4,Cu=5,Au=6,lr=7,fs=8,Pu=9,Fp=class extends XM.AbstractParserWithWordBoundaryChecking{innerPattern(){return ZM}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=QM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Du]){var a=t[Du];a=="\u660E"||a=="\u807D"?n.hour()>1&&s.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s.add(-1,"day"):a=="\u524D"?s.add(-2,"day"):a=="\u5927\u524D"?s.add(-3,"day"):a=="\u5F8C"?s.add(2,"day"):a=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Mu]){var o=t[Mu];o=="\u660E"||o=="\u807D"?s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s.add(-1,"day"):o=="\u524D"?s.add(-2,"day"):o=="\u5927\u524D"?s.add(-3,"day"):o=="\u5F8C"?s.add(2,"day"):o=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let u=0,l=0,c=-1;if(t[fs]){var d=parseInt(t[fs]);if(isNaN(d)&&(d=cr.zhStringToNumber(t[fs])),d>=60)return null;i.start.assign("second",d)}if(u=parseInt(t[Au]),isNaN(u)&&(u=cr.zhStringToNumber(t[Au])),t[lr]?t[lr]=="\u534A"?l=30:t[lr]=="\u6B63"||t[lr]=="\u6574"?l=0:(l=parseInt(t[lr]),isNaN(l)&&(l=cr.zhStringToNumber(t[lr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Pu]){if(u>12)return null;var f=t[Pu][0].toLowerCase();f=="a"&&(c=0,u==12&&(u=0)),f=="p"&&(c=1,u!=12&&(u+=12))}else if(t[xu]){var m=t[xu],g=m[0];g=="\u671D"||g=="\u65E9"?(c=0,u==12&&(u=0)):g=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Ru]){var b=t[Ru],k=b[0];k=="\u4E0A"||k=="\u671D"||k=="\u65E9"||k=="\u51CC"?(c=0,u==12&&(u=0)):(k=="\u4E0B"||k=="\u664F"||k=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var _=t[Cu],S=_[0];S=="\u4E0A"||S=="\u671D"||S=="\u65E9"||S=="\u51CC"?(c=0,u==12&&(u=0)):(S=="\u4E0B"||S=="\u664F"||S=="\u665A")&&(c=1,u!=12&&(u+=12))}if(i.start.assign("hour",u),i.start.assign("minute",l),c>=0?i.start.assign("meridiem",c):u<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=JM.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let x=s.clone();if(i.end=e.createParsingComponents(),t[Du]){var a=t[Du];a=="\u660E"||a=="\u807D"?n.hour()>1&&x.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?x.add(-1,"day"):a=="\u524D"?x.add(-2,"day"):a=="\u5927\u524D"?x.add(-3,"day"):a=="\u5F8C"?x.add(2,"day"):a=="\u5927\u5F8C"&&x.add(3,"day"),i.end.assign("day",x.date()),i.end.assign("month",x.month()+1),i.end.assign("year",x.year())}else if(t[Mu]){var o=t[Mu];o=="\u660E"||o=="\u807D"?x.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?x.add(-1,"day"):o=="\u524D"?x.add(-2,"day"):o=="\u5927\u524D"?x.add(-3,"day"):o=="\u5F8C"?x.add(2,"day"):o=="\u5927\u5F8C"&&x.add(3,"day"),i.end.assign("day",x.date()),i.end.assign("month",x.month()+1),i.end.assign("year",x.year())}else i.end.imply("day",x.date()),i.end.imply("month",x.month()+1),i.end.imply("year",x.year());if(u=0,l=0,c=-1,t[fs]){var d=parseInt(t[fs]);if(isNaN(d)&&(d=cr.zhStringToNumber(t[fs])),d>=60)return null;i.end.assign("second",d)}if(u=parseInt(t[Au]),isNaN(u)&&(u=cr.zhStringToNumber(t[Au])),t[lr]?t[lr]=="\u534A"?l=30:t[lr]=="\u6B63"||t[lr]=="\u6574"?l=0:(l=parseInt(t[lr]),isNaN(l)&&(l=cr.zhStringToNumber(t[lr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Pu]){if(u>12)return null;var f=t[Pu][0].toLowerCase();f=="a"&&(c=0,u==12&&(u=0)),f=="p"&&(c=1,u!=12&&(u+=12)),i.start.isCertain("meridiem")||(c==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[xu]){var m=t[xu],g=m[0];g=="\u671D"||g=="\u65E9"?(c=0,u==12&&(u=0)):g=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Ru]){var b=t[Ru],k=b[0];k=="\u4E0A"||k=="\u671D"||k=="\u65E9"||k=="\u51CC"?(c=0,u==12&&(u=0)):(k=="\u4E0B"||k=="\u664F"||k=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var _=t[Cu],S=_[0];S=="\u4E0A"||S=="\u671D"||S=="\u65E9"||S=="\u51CC"?(c=0,u==12&&(u=0)):(S=="\u4E0B"||S=="\u664F"||S=="\u665A")&&(c=1,u!=12&&(u+=12))}return i.text=i.text+t[0],i.end.assign("hour",u),i.end.assign("minute",l),c>=0?i.end.assign("meridiem",c):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>u?i.end.imply("meridiem",0):u>12&&i.end.imply("meridiem",1),i.end.date().getTime(){"use strict";var eC=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var tC=eC(we()),rC=H(),Gb=ds(),nC=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Gb.WEEKDAY_OFFSET).join("|")+")"),Lp=class extends rC.AbstractParserWithWordBoundaryChecking{innerPattern(){return nC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Gb.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=tC.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u){"use strict";var iC=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0});var sC=iC(Qr()),Up=class extends sC.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};Ka.default=Up});var Hb=E(Qa=>{"use strict";var aC=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var oC=aC(gn()),Wp=class extends oC.default{patternBetween(){return/^\s*$/i}};Qa.default=Wp});var Vb=E(Be=>{"use strict";var wn=Be&&Be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Be,"__esModule",{value:!0});Be.createConfiguration=Be.createCasualConfiguration=Be.parseDate=Be.parse=Be.strict=Be.casual=Be.hant=void 0;var qp=Rr(),uC=wn(lu()),lC=yn(),cC=wn(Ib()),dC=wn(Lb()),fC=wn(Wb()),pC=wn(jb()),mC=wn($b()),hC=wn(Yb()),gC=wn(Bb()),yC=wn(Hb());Be.hant=new qp.Chrono(jp());Be.casual=new qp.Chrono(jp());Be.strict=new qp.Chrono($p());function TC(r,e,t){return Be.casual.parse(r,e,t)}Be.parse=TC;function bC(r,e,t){return Be.casual.parseDate(r,e,t)}Be.parseDate=bC;function jp(){let r=$p();return r.parsers.unshift(new cC.default),r}Be.createCasualConfiguration=jp;function $p(){let r=lC.includeCommonConfiguration({parsers:[new dC.default,new pC.default,new hC.default,new mC.default,new fC.default],refiners:[new gC.default,new yC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof uC.default)),r}Be.createConfiguration=$p});var Xb=E(Xa=>{"use strict";var _C=Xa&&Xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xa,"__esModule",{value:!0});var vC=_C(we()),wC=H(),kC=1,zb=2,EC=3,Kb=4,Qb=5,SC=6,Gp=class extends wC.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,i=e.createParsingResult(n,t[0]),s=vC.default(e.refDate),a=s;if(t[kC])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[zb]){let o=t[zb],u=t[EC];o=="\u660E"?s.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"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[Kb]){let u=t[Kb][0];u=="\u65E9"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[Qb]){let o=t[Qb];o=="\u660E"?s.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[SC];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Xa.default=Gp});var ps=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.zhStringToYear=Lt.zhStringToNumber=Lt.WEEKDAY_OFFSET=Lt.NUMBER=void 0;Lt.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};Lt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function OC(r){let e=0;for(let t=0;t{"use strict";var xC=Za&&Za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Za,"__esModule",{value:!0});var RC=xC(we()),MC=H(),ki=ps(),Yp=1,Zb=2,Bp=3,Hp=class extends MC.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ki.NUMBER).join("")+"]{4}|["+Object.keys(ki.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ki.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ki.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=RC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[Zb]);if(isNaN(s)&&(s=ki.zhStringToNumber(t[Zb])),i.start.assign("month",s),t[Bp]){let a=parseInt(t[Bp]);isNaN(a)&&(a=ki.zhStringToNumber(t[Bp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Yp]){let a=parseInt(t[Yp]);isNaN(a)&&(a=ki.zhStringToYear(t[Yp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Za.default=Hp});var t_=E(Ja=>{"use strict";var CC=Ja&&Ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ja,"__esModule",{value:!0});var AC=CC(we()),PC=H(),e_=ps(),NC=new RegExp("(\\d+|["+Object.keys(e_.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"),Vp=1,IC=2,zp=class extends PC.AbstractParserWithWordBoundaryChecking{innerPattern(){return NC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Vp]);if(isNaN(i)&&(i=e_.zhStringToNumber(t[Vp])),isNaN(i)){let u=t[Vp];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=AC.default(e.refDate),o=t[IC][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u793C"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u949F")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Ja.default=zp});var n_=E(eo=>{"use strict";var FC=eo&&eo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(eo,"__esModule",{value:!0});var LC=FC(we()),UC=H(),r_=ps(),WC=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(r_.WEEKDAY_OFFSET).join("|")+")"),Kp=class extends UC.AbstractParserWithWordBoundaryChecking{innerPattern(){return WC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=r_.WEEKDAY_OFFSET[i];if(s===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=LC.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c){"use strict";var qC=to&&to.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(to,"__esModule",{value:!0});var jC=qC(we()),$C=H(),fr=ps(),GC=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(fr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(fr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(fr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),YC=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(fr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(fr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(fr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Nu=1,Iu=2,Fu=3,Lu=4,Uu=5,Wu=6,dr=7,ms=8,qu=9,Qp=class extends $C.AbstractParserWithWordBoundaryChecking{innerPattern(){return GC}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=jC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Nu]){let c=t[Nu];c=="\u660E"?n.hour()>1&&s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Lu]){let c=t[Lu];c=="\u660E"?s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let a=0,o=0,u=-1;if(t[ms]){let c=parseInt(t[ms]);if(isNaN(c)&&(c=fr.zhStringToNumber(t[ms])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[Wu]),isNaN(a)&&(a=fr.zhStringToNumber(t[Wu])),t[dr]?t[dr]=="\u534A"?o=30:t[dr]=="\u6B63"||t[dr]=="\u6574"?o=0:(o=parseInt(t[dr]),isNaN(o)&&(o=fr.zhStringToNumber(t[dr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[qu]){if(a>12)return null;let c=t[qu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Iu]){let d=t[Iu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Fu]){let d=t[Fu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Uu]){let d=t[Uu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),u>=0?i.start.assign("meridiem",u):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=YC.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let l=s.clone();if(i.end=e.createParsingComponents(),t[Nu]){let c=t[Nu];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"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else if(t[Lu]){let c=t[Lu];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"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else i.end.imply("day",l.date()),i.end.imply("month",l.month()+1),i.end.imply("year",l.year());if(a=0,o=0,u=-1,t[ms]){let c=parseInt(t[ms]);if(isNaN(c)&&(c=fr.zhStringToNumber(t[ms])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[Wu]),isNaN(a)&&(a=fr.zhStringToNumber(t[Wu])),t[dr]?t[dr]=="\u534A"?o=30:t[dr]=="\u6B63"||t[dr]=="\u6574"?o=0:(o=parseInt(t[dr]),isNaN(o)&&(o=fr.zhStringToNumber(t[dr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[qu]){if(a>12)return null;let c=t[qu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(u==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Iu]){let d=t[Iu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Fu]){let d=t[Fu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Uu]){let d=t[Uu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),u>=0?i.end.assign("meridiem",u):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>a?i.end.imply("meridiem",0):a>12&&i.end.imply("meridiem",1),i.end.date().getTime(){"use strict";var BC=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0});var HC=BC(we()),VC=H(),s_=ps(),zC=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(s_.WEEKDAY_OFFSET).join("|")+")"),Xp=class extends VC.AbstractParserWithWordBoundaryChecking{innerPattern(){return zC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=s_.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=HC.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u){"use strict";var KC=no&&no.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(no,"__esModule",{value:!0});var QC=KC(Qr()),Zp=class extends QC.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};no.default=Zp});var u_=E(io=>{"use strict";var XC=io&&io.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(io,"__esModule",{value:!0});var ZC=XC(gn()),Jp=class extends ZC.default{patternBetween(){return/^\s*$/i}};io.default=Jp});var l_=E(He=>{"use strict";var kn=He&&He.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(He,"__esModule",{value:!0});He.createConfiguration=He.createCasualConfiguration=He.parseDate=He.parse=He.strict=He.casual=He.hans=void 0;var em=Rr(),JC=kn(lu()),eA=yn(),tA=kn(Xb()),rA=kn(Jb()),nA=kn(t_()),iA=kn(n_()),sA=kn(i_()),aA=kn(a_()),oA=kn(o_()),uA=kn(u_());He.hans=new em.Chrono(tm());He.casual=new em.Chrono(tm());He.strict=new em.Chrono(rm());function lA(r,e,t){return He.casual.parse(r,e,t)}He.parse=lA;function cA(r,e,t){return He.casual.parseDate(r,e,t)}He.parseDate=cA;function tm(){let r=rm();return r.parsers.unshift(new tA.default),r}He.createCasualConfiguration=tm;function rm(){let r=eA.includeCommonConfiguration({parsers:[new rA.default,new iA.default,new aA.default,new sA.default,new nA.default],refiners:[new oA.default,new uA.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof JC.default)),r}He.createConfiguration=rm});var d_=E(Ht=>{"use strict";var c_=Ht&&Ht.__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]}),dA=Ht&&Ht.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),fA=Ht&&Ht.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&c_(e,r,t)},pA=Ht&&Ht.__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)&&c_(e,r,t);return dA(e,r),e};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.hans=void 0;fA(Vb(),Ht);Ht.hans=pA(l_())});var Ut=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.parseTimeUnits=oe.TIME_UNITS_PATTERN=oe.parseYear=oe.YEAR_PATTERN=oe.parseOrdinalNumberPattern=oe.ORDINAL_NUMBER_PATTERN=oe.parseNumberPattern=oe.NUMBER_PATTERN=oe.TIME_UNIT_DICTIONARY=oe.ORDINAL_WORD_DICTIONARY=oe.INTEGER_WORD_DICTIONARY=oe.MONTH_DICTIONARY=oe.FULL_MONTH_NAME_DICTIONARY=oe.WEEKDAY_DICTIONARY=oe.REGEX_PARTS=void 0;var ju=Me(),mA=lt();oe.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};oe.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};oe.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};oe.MONTH_DICTIONARY=Object.assign(Object.assign({},oe.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});oe.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};oe.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};oe.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"};oe.NUMBER_PATTERN=`(?:${ju.matchAnyPattern(oe.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 p_(r){let e=r.toLowerCase();return oe.INTEGER_WORD_DICTIONARY[e]!==void 0?oe.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}oe.parseNumberPattern=p_;oe.ORDINAL_NUMBER_PATTERN=`(?:${ju.matchAnyPattern(oe.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function hA(r){let e=r.toLowerCase();return oe.ORDINAL_WORD_DICTIONARY[e]!==void 0?oe.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}oe.parseOrdinalNumberPattern=hA;var nm="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";oe.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${nm}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${nm}|[5-9][0-9]${nm})`;function gA(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 mA.findMostLikelyADYear(e)}oe.parseYear=gA;var m_=`(${oe.NUMBER_PATTERN})\\s{0,3}(${ju.matchAnyPattern(oe.TIME_UNIT_DICTIONARY)})`,f_=new RegExp(m_,"i");oe.TIME_UNITS_PATTERN=ju.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",m_);function yA(r){let e={},t=r,n=f_.exec(t);for(;n;)TA(e,n),t=t.substring(n[0].length).trim(),n=f_.exec(t);return e}oe.parseTimeUnits=yA;function TA(r,e){let t=p_(e[1]),n=oe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var g_=E(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var so=Ut(),bA=We(),_A=H(),h_=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${so.TIME_UNITS_PATTERN})${so.REGEX_PARTS.rightBoundary}`,vA=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${h_}`,so.REGEX_PARTS.flags),wA=new RegExp(h_,"i"),im=class extends _A.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return so.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?wA:vA}innerExtract(e,t){let n=so.parseTimeUnits(t[1]);return bA.ParsingComponents.createRelativeFromReference(e.reference,n)}};sm.default=im});var v_=E(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var kA=lt(),ao=Ut(),__=Ut(),$u=Ut(),EA=Me(),SA=H(),OA=new RegExp(`(?:\u0441)?\\s*(${$u.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${$u.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${EA.matchAnyPattern(ao.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${__.YEAR_PATTERN}(?![^\\s]\\d)))?${ao.REGEX_PARTS.rightBoundary}`,ao.REGEX_PARTS.flags),y_=1,T_=2,DA=3,b_=4,am=class extends SA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ao.REGEX_PARTS.leftBoundary}innerPattern(){return OA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=ao.MONTH_DICTIONARY[t[DA].toLowerCase()],s=$u.parseOrdinalNumberPattern(t[y_]);if(s>31)return t.index=t.index+t[y_].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[b_]){let a=__.parseYear(t[b_]);n.start.assign("year",a)}else{let a=kA.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[T_]){let a=$u.parseOrdinalNumberPattern(t[T_]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};om.default=am});var E_=E(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var oo=Ut(),xA=lt(),RA=Me(),k_=Ut(),MA=H(),CA=new RegExp(`((?:\u0432)\\s*)?(${RA.matchAnyPattern(oo.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${k_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,oo.REGEX_PARTS.flags),AA=2,w_=3,um=class extends MA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return oo.REGEX_PARTS.leftBoundary}innerPattern(){return CA}innerExtract(e,t){let n=t[AA].toLowerCase();if(t[0].length<=3&&!oo.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=oo.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[w_]){let a=k_.parseYear(t[w_]);i.start.assign("year",a)}else{let a=xA.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};lm.default=um});var O_=E(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var Gu=Ke(),PA=gi(),S_=Ut(),cm=class extends PA.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return S_.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))?(?!\\/)${S_.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 i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Gu.Meridiem.PM)):i<6&&n.assign("meridiem",Gu.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Gu.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Gu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};dm.default=cm});var D_=E(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var Yu=Ut(),NA=We(),IA=H(),FA=or(),LA=new RegExp(`(${Yu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Yu.REGEX_PARTS.flags),fm=class extends IA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Yu.REGEX_PARTS.leftBoundary}innerPattern(){return LA}innerExtract(e,t){let n=Yu.parseTimeUnits(t[1]),i=FA.reverseTimeUnits(n);return NA.ParsingComponents.createRelativeFromReference(e.reference,i)}};pm.default=fm});var x_=E(uo=>{"use strict";var UA=uo&&uo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(uo,"__esModule",{value:!0});var WA=UA(Qr()),mm=class extends WA.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};uo.default=mm});var R_=E(lo=>{"use strict";var qA=lo&&lo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lo,"__esModule",{value:!0});var jA=qA(gn()),hm=class extends jA.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};lo.default=hm});var M_=E(En=>{"use strict";var $A=En&&En.__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]}),GA=En&&En.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),YA=En&&En.__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)&&$A(e,r,t);return GA(e,r),e};Object.defineProperty(En,"__esModule",{value:!0});var BA=H(),co=YA(bn()),gm=Ut(),HA=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)${gm.REGEX_PARTS.rightBoundary}`,gm.REGEX_PARTS.flags),ym=class extends BA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return gm.REGEX_PARTS.leftBoundary}innerPattern(e){return HA}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return co.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return co.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return co.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return co.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return co.theDayBefore(e.reference,2)}return i}};En.default=ym});var C_=E(Nr=>{"use strict";var VA=Nr&&Nr.__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]}),zA=Nr&&Nr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),KA=Nr&&Nr.__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)&&VA(e,r,t);return zA(e,r),e},QA=Nr&&Nr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nr,"__esModule",{value:!0});var XA=H(),Ei=KA(bn()),ZA=ar(),JA=QA(we()),Tm=Ut(),eP=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)${Tm.REGEX_PARTS.rightBoundary}`,Tm.REGEX_PARTS.flags),bm=class extends XA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Tm.REGEX_PARTS.leftBoundary}innerPattern(){return eP}innerExtract(e,t){let n=JA.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return Ei.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return Ei.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return Ei.morning(e.reference);if(i.match(/в\s*полдень/))return Ei.noon(e.reference);if(i.match(/прошлой\s*ночью/))return Ei.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return Ei.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),ZA.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?Ei.midnight(e.reference):s}};Nr.default=bm});var A_=E(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});var fo=Ut(),tP=Me(),rP=H(),nP=Ti(),iP=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*)?(${tP.matchAnyPattern(fo.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)?${fo.REGEX_PARTS.rightBoundary}`,fo.REGEX_PARTS.flags),sP=1,aP=2,oP=3,_m=class extends rP.AbstractParserWithWordBoundaryChecking{innerPattern(){return iP}patternLeftBoundary(){return fo.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[aP].toLowerCase(),i=fo.WEEKDAY_DICTIONARY[n],s=t[sP],a=t[oP],o=s||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=nP.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};vm.default=_m});var N_=E(mo=>{"use strict";var uP=mo&&mo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(mo,"__esModule",{value:!0});var po=Ut(),P_=We(),lP=uP(we()),cP=H(),dP=Me(),fP=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*(${dP.matchAnyPattern(po.TIME_UNIT_DICTIONARY)})(?=\\s*)${po.REGEX_PARTS.rightBoundary}`,po.REGEX_PARTS.flags),pP=1,mP=2,wm=class extends cP.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return po.REGEX_PARTS.leftBoundary}innerPattern(){return fP}innerExtract(e,t){let n=t[pP].toLowerCase(),i=t[mP].toLowerCase(),s=po.TIME_UNIT_DICTIONARY[i];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[s]=1,P_.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[s]=-1,P_.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=lP.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}};mo.default=wm});var I_=E(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var ho=Ut(),hP=We(),gP=H(),yP=or(),TP=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*(${ho.TIME_UNITS_PATTERN})${ho.REGEX_PARTS.rightBoundary}`,ho.REGEX_PARTS.flags),km=class extends gP.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ho.REGEX_PARTS.leftBoundary}innerPattern(){return TP}innerExtract(e,t){let n=t[1].toLowerCase(),i=ho.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=yP.reverseTimeUnits(i);break}return hP.ParsingComponents.createRelativeFromReference(e.reference,i)}};Em.default=km});var U_=E(it=>{"use strict";var Vt=it&&it.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(it,"__esModule",{value:!0});it.createConfiguration=it.createCasualConfiguration=it.parseDate=it.parse=it.strict=it.casual=void 0;var bP=Vt(g_()),_P=Vt(v_()),vP=Vt(E_()),wP=Vt(O_()),kP=Vt(D_()),EP=Vt(x_()),SP=Vt(R_()),OP=yn(),DP=Vt(M_()),xP=Vt(C_()),RP=Vt(A_()),MP=Vt(N_()),F_=Rr(),CP=Vt(bi()),AP=Vt(I_());it.casual=new F_.Chrono(L_());it.strict=new F_.Chrono(Sm(!0));function PP(r,e,t){return it.casual.parse(r,e,t)}it.parse=PP;function NP(r,e,t){return it.casual.parseDate(r,e,t)}it.parseDate=NP;function L_(){let r=Sm(!1);return r.parsers.unshift(new DP.default),r.parsers.unshift(new xP.default),r.parsers.unshift(new vP.default),r.parsers.unshift(new MP.default),r.parsers.unshift(new AP.default),r}it.createCasualConfiguration=L_;function Sm(r=!0){return OP.includeCommonConfiguration({parsers:[new CP.default(!0),new bP.default,new _P.default,new RP.default,new wP.default(r),new kP.default],refiners:[new SP.default,new EP.default]},r)}it.createConfiguration=Sm});var Ke=E(he=>{"use strict";var IP=he&&he.__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]}),FP=he&&he.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Kn=he&&he.__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)&&IP(e,r,t);return FP(e,r),e};Object.defineProperty(he,"__esModule",{value:!0});he.parseDate=he.parse=he.casual=he.strict=he.ru=he.zh=he.nl=he.pt=he.ja=he.fr=he.de=he.Meridiem=he.Chrono=he.en=void 0;var Om=Kn($d());he.en=Om;var LP=Rr();Object.defineProperty(he,"Chrono",{enumerable:!0,get:function(){return LP.Chrono}});var UP;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(UP=he.Meridiem||(he.Meridiem={}));var WP=Kn(Vy());he.de=WP;var qP=Kn(wT());he.fr=qP;var jP=Kn(CT());he.ja=jP;var $P=Kn(VT());he.pt=$P;var GP=Kn(Cb());he.nl=GP;var YP=Kn(d_());he.zh=YP;var BP=Kn(U_());he.ru=BP;he.strict=Om.strict;he.casual=Om.casual;function HP(r,e,t){return he.casual.parse(r,e,t)}he.parse=HP;function VP(r,e,t){return he.casual.parseDate(r,e,t)}he.parseDate=VP});var $v=E((qv,jv)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(h){return Object.prototype.toString.call(h)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(p){var h=Object.getOwnPropertyNames(p);return h.push.apply(h,Object.getOwnPropertySymbols(p)),h}:Object.keys;function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(p){p&&(this._conf=p,p.delimiter&&(this.delimiter=p.delimiter),p.maxListeners!==r&&(this._maxListeners=p.maxListeners),p.wildcard&&(this.wildcard=p.wildcard),p.newListener&&(this._newListener=p.newListener),p.removeListener&&(this._removeListener=p.removeListener),p.verboseMemoryLeak&&(this.verboseMemoryLeak=p.verboseMemoryLeak),p.ignoreErrors&&(this.ignoreErrors=p.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function f(p,h){var y="(node) warning: possible EventEmitter memory leak detected. "+p+" 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=p,process.emitWarning(T)}else console.error(y),console.trace&&console.trace()}var m=function(p,h,y){var T=arguments.length;switch(T){case 0:return[];case 1:return[p];case 2:return[p,h];case 3:return[p,h,y];default:for(var w=new Array(T);T--;)w[T]=arguments[T];return w}};function g(p,h){for(var y={},T,w=p.length,O=h?h.length:0,M=0;M0;)p=O[v],M.call(P,p,y[p]);this._listeners={},this._listenersCount=0,R()}}});function k(p,h,y,T){var w=Object.assign({},h);if(!p)return w;if(typeof p!="object")throw TypeError("options must be an object");var O=Object.keys(p),M=O.length,P,v,R;function N(de){throw Error('Invalid "'+P+'" option value'+(de?". Reason: "+de:""))}for(var ie=0;ie0;)if(P===p[v])return O;M(h)}}var x=S(["function"]),q=S(["object","function"]);function W(p,h,y){var T,w,O=0,M,P=new p(function(v,R,N){y=k(y,{timeout:0,overload:!1},{timeout:function(Ne,Ce){return Ne*=1,(typeof Ne!="number"||Ne<0||!Number.isFinite(Ne))&&Ce("timeout must be a positive number"),Ne}}),T=!y.overload&&typeof p.prototype.cancel=="function"&&typeof N=="function";function ie(){w&&(w=null),O&&(clearTimeout(O),O=0)}var de=function(Ne){ie(),v(Ne)},me=function(Ne){ie(),R(Ne)};T?h(de,me,N):(w=[function(Ne){me(Ne||Error("canceled"))}],h(de,me,function(Ne){if(M)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Ne!="function")throw TypeError("onCancel callback must be a function");w.push(Ne)}),M=!0),y.timeout>0&&(O=setTimeout(function(){var Ne=Error("timeout");Ne.code="ETIMEDOUT",O=0,P.cancel(Ne),R(Ne)},y.timeout))});return T||(P.cancel=function(v){if(!!w){for(var R=w.length,N=1;N0;)me=St[P],me!=="_listeners"&&(Ge=G(p,h,y[me],T+1,w),Ge&&(de?de.push.apply(de,Ge):de=Ge));return de}else if(Hr==="**"){for(pn=T+1===w||T+2===w&&ot==="*",pn&&y._listeners&&(de=G(p,h,y,w,w)),St=l(y),P=St.length;P-- >0;)me=St[P],me!=="_listeners"&&(me==="*"||me==="**"?(y[me]._listeners&&!pn&&(Ge=G(p,h,y[me],w,w),Ge&&(de?de.push.apply(de,Ge):de=Ge)),Ge=G(p,h,y[me],T,w)):me===ot?Ge=G(p,h,y[me],T+2,w):Ge=G(p,h,y[me],T,w),Ge&&(de?de.push.apply(de,Ge):de=Ge));return de}else y[Hr]&&(de=G(p,h,y[Hr],T+1,w));if(Ne=y["*"],Ne&&G(p,h,Ne,T+1,w),Ce=y["**"],Ce)if(T0;)me=St[P],me!=="_listeners"&&(me===ot?G(p,h,Ce[me],T+2,w):me===Hr?G(p,h,Ce[me],T+1,w):(It={},It[me]=Ce[me],G(p,h,{"**":It},T+1,w)));else Ce._listeners?G(p,h,Ce,w,w):Ce["*"]&&Ce["*"]._listeners&&G(p,h,Ce["*"],w,w);return de}function B(p,h,y){var T=0,w=0,O,M=this.delimiter,P=M.length,v;if(typeof p=="string")if((O=p.indexOf(M))!==-1){v=new Array(5);do v[T++]=p.slice(w,O),w=O+P;while((O=p.indexOf(M,w))!==-1);v[T++]=p.slice(w)}else v=[p],T=1;else v=p,T=p.length;if(T>1){for(O=0;O+10&&R._listeners.length>this._maxListeners&&(R._listeners.warned=!0,f.call(this,R._listeners.length,N))):R._listeners=h,!0;return!0}function ge(p,h,y,T){for(var w=l(p),O=w.length,M,P,v,R=p._listeners,N;O-- >0;)P=w[O],M=p[P],P==="_listeners"?v=y:v=y?y.concat(P):[P],N=T||typeof P=="symbol",R&&h.push(N?v:v.join(this.delimiter)),typeof M=="object"&&ge.call(this,M,h,v,N);return h}function Pe(p){for(var h=l(p),y=h.length,T,w,O;y-- >0;)w=h[y],T=p[w],T&&(O=!0,w!=="_listeners"&&!Pe(T)&&delete p[w]);return O}function $(p,h,y){this.emitter=p,this.event=h,this.listener=y}$.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function j(p,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,O=y.nextTick,M=y.objectify}if(T||O||w){var P=h,v=h._origin||h;if(O&&!i)throw Error("process.nextTick is not supported");w===r&&(w=h.constructor.name==="AsyncFunction"),h=function(){var R=arguments,N=this,ie=this.event;return w?O?Promise.resolve():new Promise(function(de){u(de)}).then(function(){return N.event=ie,P.apply(N,R)}):(O?process.nextTick:u)(function(){N.event=ie,P.apply(N,R)})},h._async=!0,h._origin=v}return[h,M?new $(this,p,h):this]}function D(p){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,d.call(this,p)}D.EventEmitter2=D,D.prototype.listenTo=function(p,h,y){if(typeof p!="object")throw TypeError("target musts be an object");var T=this;y=k(y,{on:r,off:r,reducers:r},{on:x,off:x,reducers:q});function w(O){if(typeof O!="object")throw TypeError("events must be an object");var M=y.reducers,P=ne.call(T,p),v;P===-1?v=new b(T,p,y):v=T._observers[P];for(var R=l(O),N=R.length,ie,de=typeof M=="function",me=0;me0;)w=y[T],(!p||w._target===p)&&(w.unsubscribe(h),O=!0);return O},D.prototype.delimiter=".",D.prototype.setMaxListeners=function(p){p!==r&&(this._maxListeners=p,this._conf||(this._conf={}),this._conf.maxListeners=p)},D.prototype.getMaxListeners=function(){return this._maxListeners},D.prototype.event="",D.prototype.once=function(p,h,y){return this._once(p,h,!1,y)},D.prototype.prependOnceListener=function(p,h,y){return this._once(p,h,!0,y)},D.prototype._once=function(p,h,y,T){return this._many(p,1,h,y,T)},D.prototype.many=function(p,h,y,T){return this._many(p,h,y,!1,T)},D.prototype.prependMany=function(p,h,y,T){return this._many(p,h,y,!0,T)},D.prototype._many=function(p,h,y,T,w){var O=this;if(typeof y!="function")throw new Error("many only accepts instances of Function");function M(){return--h===0&&O.off(p,M),y.apply(this,arguments)}return M._origin=y,this._on(p,M,T,w)},D.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var p=arguments[0],h,y=this.wildcard,T,w,O,M,P;if(p==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(y&&(h=p,p!=="newListener"&&p!=="removeListener"&&typeof p=="object")){if(w=p.length,s){for(O=0;O3)for(T=new Array(v-1),M=1;M3)for(w=new Array(R-1),P=1;P0&&this._events[p].length>this._maxListeners&&(this._events[p].warned=!0,f.call(this,this._events[p].length,p))):this._events[p]=h,w)},D.prototype.off=function(p,h){if(typeof h!="function")throw new Error("removeListener only takes instances of Function");var y,T=[];if(this.wildcard){var w=typeof p=="string"?p.split(this.delimiter):p.slice();if(T=G.call(this,null,w,this.listenerTree,0),!T)return this}else{if(!this._events[p])return this;y=this._events[p],T.push({_listeners:y})}for(var O=0;O0){for(T=this._all,h=0,y=T.length;h0;)T=h[y[O]],typeof T=="function"?w.push(T):w.push.apply(w,T);return w}else{if(this.wildcard){if(M=this.listenerTree,!M)return[];var P=[],v=typeof p=="string"?p.split(this.delimiter):p.slice();return G.call(this,P,v,M,0),P}return h?(T=h[p],T?typeof T=="function"?[T]:T:[]):[]}},D.prototype.eventNames=function(p){var h=this._events;return this.wildcard?ge.call(this,this.listenerTree,[],null,p):h?l(h):[]},D.prototype.listenerCount=function(p){return this.listeners(p).length},D.prototype.hasListeners=function(p){if(this.wildcard){var h=[],y=typeof p=="string"?p.split(this.delimiter):p.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&&(p===r?l(T).length:T[p]))},D.prototype.listenersAny=function(){return this._all?this._all:[]},D.prototype.waitFor=function(p,h){var y=this,T=typeof h;return T==="number"?h={timeout:h}:T==="function"&&(h={filter:h}),h=k(h,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:x,Promise:_}),W(h.Promise,function(w,O,M){function P(){var v=h.filter;if(!(v&&!v.apply(y,arguments)))if(y.off(p,P),h.handleError){var R=arguments[0];R?O(R):w(m.apply(null,arguments).slice(1))}else w(m.apply(null,arguments))}M(function(){y.off(p,P)}),y._on(p,P,!1)},{timeout:h.timeout,overload:h.overload})};function Y(p,h,y){y=k(y,{Promise,timeout:0,overload:!1},{Promise:_});var T=y.Promise;return W(T,function(w,O,M){var P;if(typeof p.addEventListener=="function"){P=function(){w(m.apply(null,arguments))},M(function(){p.removeEventListener(h,P)}),p.addEventListener(h,P,{once:!0});return}var v=function(){R&&p.removeListener("error",R),w(m.apply(null,arguments))},R;h!=="error"&&(R=function(N){p.removeListener(h,v),O(N)},p.once("error",R)),M(function(){R&&p.removeListener("error",R),p.removeListener(h,v)}),p.once(h,v)},{timeout:y.timeout,overload:y.overload})}var F=D.prototype;if(Object.defineProperties(D,{defaultMaxListeners:{get:function(){return F._maxListeners},set:function(p){if(typeof p!="number"||p<0||Number.isNaN(p))throw TypeError("n must be a non-negative number");F._maxListeners=p},enumerable:!0},once:{value:Y,writable:!0,configurable:!0}}),Object.defineProperties(F,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return D});else if(typeof qv=="object")jv.exports=D;else{var J=new Function("","return this")();J.EventEmitter2=D}})()});var Kw=E(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});var Vw=Symbol("MustacheDataPath");function Hw({target:r,propertyName:e}){return[...r[Vw]||[],e]}function zw(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let i=t[n];if(i===void 0&&!(n in t)){let s=Hw({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(s),i;throw Error(`Missing Mustache data property: ${s.join(" > ")}`)}return i&&typeof i=="object"?(i[Vw]=Hw({target:t,propertyName:n}),zw(i,e)):i}})}kh.default=zw});var un=E(jr=>{"use strict";jr.__esModule=!0;jr.Tokens=jr.StructuralCharacters=jr.Operators=void 0;var SF;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(SF=jr.Operators||(jr.Operators={}));var OF;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(OF=jr.StructuralCharacters||(jr.StructuralCharacters={}));var DF;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(DF=jr.Tokens||(jr.Tokens={}))});var Mh=E(Gs=>{"use strict";Gs.__esModule=!0;Gs.VALID_TOKENS=Gs.OPERATOR_PRECEDENCE=void 0;var qe=un();Gs.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Gs.VALID_TOKENS={identifierOnly:[{name:qe.Tokens.IDENTIFIER},{name:qe.Tokens.STRUCTURAL_CHARACTER,value:qe.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:qe.Tokens.IDENTIFIER},{name:qe.Tokens.STRUCTURAL_CHARACTER,value:qe.StructuralCharacters.OPEN_PARENTHESIS},{name:qe.Tokens.OPERATOR,value:qe.Operators.NOT}],binaryOperator:[{name:qe.Tokens.OPERATOR,value:qe.Operators.AND},{name:qe.Tokens.OPERATOR,value:qe.Operators.OR},{name:qe.Tokens.OPERATOR,value:qe.Operators.XOR}],binaryOperatorOrClose:[{name:qe.Tokens.OPERATOR,value:qe.Operators.AND},{name:qe.Tokens.OPERATOR,value:qe.Operators.OR},{name:qe.Tokens.OPERATOR,value:qe.Operators.XOR},{name:qe.Tokens.STRUCTURAL_CHARACTER,value:qe.StructuralCharacters.CLOSE_PARENTHESIS}]}});var Ch=E(kt=>{"use strict";kt.__esModule=!0;kt.ESCAPE_CHARACTER=kt.EOL=kt.COMMENT_DELIMITER=kt.QUOTED_IDENTIFIER_DELIMITER=kt.SEPARATORS=kt.OPERATORS=kt.STRUCTURAL_CHARACTERS=void 0;var Ys=un();kt.STRUCTURAL_CHARACTERS={"(":Ys.StructuralCharacters.OPEN_PARENTHESIS,")":Ys.StructuralCharacters.CLOSE_PARENTHESIS};kt.OPERATORS={AND:Ys.Operators.AND,OR:Ys.Operators.OR,XOR:Ys.Operators.XOR,NOT:Ys.Operators.NOT};kt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));kt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);kt.COMMENT_DELIMITER=String.fromCodePoint(35);kt.EOL=String.fromCodePoint(10);kt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var tk=E(Er=>{"use strict";var Ah=Er&&Er.__assign||function(){return Ah=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";jl.__esModule=!0;jl.lex=void 0;var Bs=un(),tr=Ch(),Hs=tk(),CF=function(r){for(var e=null,t=null,n=null,i=0;i{"use strict";var nk=rr&&rr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";var ln=zs&&zs.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";Et.__esModule=!0;Et.throwInvalidExpression=Et.isOperator=Et.isIdentifier=Et.notUtil=Et.xorUtil=Et.orUtil=Et.andUtil=void 0;var ok=un(),UF=function(r,e){return r&&e};Et.andUtil=UF;var WF=function(r,e){return r||e};Et.orUtil=WF;var qF=function(r,e){return r!==e};Et.xorUtil=qF;var jF=function(r){return!r};Et.notUtil=jF;var $F=function(r){var e=r.name,t=r.value;return e===ok.Tokens.IDENTIFIER&&typeof t=="string"};Et.isIdentifier=$F;var GF=function(r){var e=r.name,t=r.value;return e===ok.Tokens.OPERATOR&&typeof t=="string"};Et.isOperator=GF;var YF=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};Et.throwInvalidExpression=YF});var uk=E(Yl=>{"use strict";var $o;Yl.__esModule=!0;Yl.OPERATOR_MAP=void 0;var Fh=un(),Lh=Ih();Yl.OPERATOR_MAP=($o={},$o[Fh.Operators.AND]=Lh.andUtil,$o[Fh.Operators.OR]=Lh.orUtil,$o[Fh.Operators.XOR]=Lh.xorUtil,$o)});var ck=E(Sr=>{"use strict";var Ks=Sr&&Sr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";var Uh=cn&&cn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});cn.__esModule=!0;cn.parse=cn.evaluate=cn.getEvaluator=void 0;var dk=ck();Uh(cn,dk,"getEvaluator");Uh(cn,dk,"evaluate");var QF=Nh();Uh(cn,QF,"parse")});var hL={};OE(hL,{default:()=>wc});module.exports=DE(hL);var sE=require("obsidian");var ks=require("obsidian");var yL=new Error("timeout while waiting for mutex to become available"),TL=new Error("mutex already locked"),xE=new Error("request for lock canceled"),RE=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Fc=class{constructor(e,t=xE){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 RE(this,void 0,void 0,function*(){let[n,i]=yield this.acquire(t);try{return yield e(n)}finally{i()}})}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 i=this._value,s=t;this._value-=t,t=this._value+1,n.resolve([i,this._newReleaser(s)])}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]=[])}},ME=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Zo=class{constructor(e){this._semaphore=new Fc(1,e)}acquire(){return ME(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 Jo=require("obsidian"),ut=class{constructor(e,t={}){this._frontmatter={tags:[]};this._tags=[];var i,s;this._path=e,this._cachedMetadata=t;let n=t.frontmatter;if(n!==void 0&&(this._frontmatter=JSON.parse(JSON.stringify(n)),this._frontmatter.tags=(i=(0,Jo.parseFrontMatterTags)(n))!=null?i:[]),Object.keys(t).length!==0){let a=(s=(0,Jo.getAllTags)(this.cachedMetadata))!=null?s:[];this._tags=[...new Set(a)]}}get path(){return this._path}get tags(){return this._tags}get cachedMetadata(){return this._cachedMetadata}get frontmatter(){return this._frontmatter}rawFrontmatterIdenticalTo(e){let t=this.cachedMetadata.frontmatter,n=e.cachedMetadata.frontmatter;return t===n?!0:!t||!n?!1:JSON.stringify(t)===JSON.stringify(n)}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)}hasProperty(e){let t=this.findKeyInFrontmatter(e);if(t===void 0)return!1;let n=this.frontmatter[t];return!(n===null||n===void 0)}property(e){let t=this.findKeyInFrontmatter(e);if(t===void 0)return null;let n=this.frontmatter[t];return n===void 0?null:Array.isArray(n)?n.filter(i=>i!==null):n}findKeyInFrontmatter(e){let t=e.toLowerCase();return Object.keys(this.frontmatter).find(n=>n.toLowerCase()===t)}};var Yt=class{},Z=Yt;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(Yt.indentationRegex.source+Yt.listMarkerRegex.source+" +"+Yt.checkboxRegex.source+Yt.afterCheckboxRegex.source,"u"),Z.nonTaskRegex=new RegExp(Yt.indentationRegex.source+Yt.listMarkerRegex.source+"? *("+Yt.checkboxRegex.source+")?"+Yt.afterCheckboxRegex.source,"u"),Z.listItemRegex=new RegExp(Yt.indentationRegex.source+Yt.listMarkerRegex.source),Z.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,Z.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,Z.hashTagsFromEnd=new RegExp(Yt.hashTags.source+"$");var hn=class{constructor(e,t){this.parent=null;this.children=[];this.description=e.replace(Z.listItemRegex,"").trim(),this.originalMarkdown=e,this.parent=t,t!==null&&t.children.push(this)}get root(){return this.parent===null?this:this.parent.root}get isRoot(){return this.parent===null}identicalTo(e){return this.constructor.name!==e.constructor.name||this.originalMarkdown!==e.originalMarkdown?!1:hn.listsAreIdentical(this.children,e.children)}static listsAreIdentical(e,t){return e.length!==t.length?!1:e.every((n,i)=>n.identicalTo(t[i]))}};var Bu=ma(Ke());var xt=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 xt(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new xt(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 zt=class{static parseDate(e,t=!1){return window.moment(Bu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[zt.parseRelativeDateRange,zt.parseNumberedDateRange,zt.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return xt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Bu.parse(e,void 0,{forwardDate:t});if(n.length===0)return xt.buildInvalid();let i=n[0].start,s=n[1]&&n[1].start?n[1].start:i,a=window.moment(i.date()),o=window.moment(s.date());return new xt(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,i=e.match(n);if(i&&i.length===3){let s=i[1],a=i[2],o=xt.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return xt.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[i,s,a]of n){let o=e.match(i);if(o){let u=o[0].trim();return new xt(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return xt.buildInvalid()}};var zP={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function Hu(r){for(let[e,t]of Object.entries(zP))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Dm=ma(Ke());function pr(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}function KP(r,e,t=void 0){if(!e)return`no ${r} date`;let n=Dm.parseDate(e,t,{forwardDate:t!=null});return n!==null?window.moment(n).format("YYYY-MM-DD"):`invalid ${r} date`}function W_(r,e,t){return KP(r,e,t?new Date:void 0)}function Si(r,e){let t=null,n=Dm.parseDate(r,new Date,{forwardDate:e});return n!==null&&(t=window.moment(n)),t}var mr=class{constructor({startDate:e=null,scheduledDate:t=null,dueDate:n=null}){this.startDate=e!=null?e:null,this.scheduledDate=t!=null?t:null,this.dueDate=n!=null?n:null,this.referenceDate=this.getReferenceDate()}getReferenceDate(){return this.dueDate?window.moment(this.dueDate):this.scheduledDate?window.moment(this.scheduledDate):this.startDate?window.moment(this.startDate):null}isIdenticalTo(e){return!(pr(this.startDate,e.startDate)!==0||pr(this.scheduledDate,e.scheduledDate)!==0||pr(this.dueDate,e.dueDate)!==0)}next(e){return this.referenceDate===null?new mr({startDate:null,scheduledDate:null,dueDate:null}):new mr({startDate:this.nextOccurrenceDate(this.startDate,e),scheduledDate:this.nextOccurrenceDate(this.scheduledDate,e),dueDate:this.nextOccurrenceDate(this.dueDate,e)})}nextOccurrenceDate(e,t){if(e===null)return null;let n=window.moment.duration(e.diff(this.referenceDate)),i=window.moment(t);return i.add(Math.round(n.asDays()),"days"),i}};var Vu=["MO","TU","WE","TH","FR","SA","SU"],Ve=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 Fe=function(r){return r!=null},Kt=function(r){return typeof r=="number"},xm=function(r){return typeof r=="string"&&Vu.includes(r)},ft=Array.isArray,hr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=be(t,e/t.length)),t.slice(0,e)+String(n))}var j_=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},yt=function(r,e){var t=r%e;return t*e<0?t+e:t},zu=function(r,e){return{div:Math.floor(r/e),mod:yt(r,e)}},Qt=function(r){return!Fe(r)||r.length===0},je=function(r){return!Qt(r)},_e=function(r,e){return je(r)&&r.indexOf(e)!==-1};var Jr=function(r,e,t,n,i,s){return n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=0),new Date(Date.UTC(r,e-1,t,n,i,s))},QP=[31,28,31,30,31,30,31,31,30,31,30,31],Y_=1e3*60*60*24,Ku=9999,B_=Jr(1970,1,1),XP=[6,0,1,2,3,4,5];var hs=function(r){return r%4===0&&r%100!==0||r%400===0},Rm=function(r){return r instanceof Date},Di=function(r){return Rm(r)&&!isNaN(r.getTime())},$_=function(r){return r.getTimezoneOffset()*60*1e3},ZP=function(r,e){var t=r.getTime()-$_(r),n=e.getTime()-$_(e),i=t-n;return Math.round(i/Y_)},go=function(r){return ZP(r,B_)},Qu=function(r){return new Date(B_.getTime()+r*Y_)},JP=function(r){var e=r.getUTCMonth();return e===1&&hs(r.getUTCFullYear())?29:QP[e]},Sn=function(r){return XP[r.getUTCDay()]},Mm=function(r,e){var t=Jr(r,e+1,1);return[Sn(t),JP(t)]},Xu=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()))},Zu=function(r){var e=new Date(r.getTime());return e},Cm=function(r){for(var e=[],t=0;tthis.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}(),Dn=eN;var Am=function(r,e){return Am=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Am(r,e)};function ys(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Am(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var pt=function(){return pt=Object.assign||function(e){for(var t,n=1,i=arguments.length;ne[0].length)&&(e=s,t=i)}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 To(r,e){e===void 0&&(e=xi);var t={},n=new aN(e.tokens);if(!n.start(r))return null;return i(),t;function i(){n.expect("every");var f=n.acceptNumber();if(f&&(t.interval=parseInt(f[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=V.DAILY,n.nextSymbol()&&(a(),d());break;case"weekday(s)":t.freq=V.WEEKLY,t.byweekday=[V.MO,V.TU,V.WE,V.TH,V.FR],n.nextSymbol(),d();break;case"week(s)":t.freq=V.WEEKLY,n.nextSymbol()&&(s(),d());break;case"hour(s)":t.freq=V.HOURLY,n.nextSymbol()&&(s(),d());break;case"minute(s)":t.freq=V.MINUTELY,n.nextSymbol()&&(s(),d());break;case"month(s)":t.freq=V.MONTHLY,n.nextSymbol()&&(s(),d());break;case"year(s)":t.freq=V.YEARLY,n.nextSymbol()&&(s(),d());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 g=u();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(V[g]),n.nextSymbol()}c(),d();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 b=o();if(!b)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(b),n.nextSymbol()}s(),d();break;default:throw new Error("Unknown symbol")}}function s(){var f=n.accept("on"),m=n.accept("the");if(!!(f||m))do{var g=l(),b=u(),k=o();if(g)b?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(V[b].nth(g))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(g),n.accept("day(s)"));else if(b)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(V[b]);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 _=n.acceptNumber();if(!_)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(_[0],10)];n.accept("comma");){if(_=n.acceptNumber(),!_)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(_[0],10))}}else if(k)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(k);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var f=n.accept("at");if(!!f)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 f=parseInt(n.value[1],10);if(f<-366||f>366)throw new Error("Nth out of range: "+f);return n.nextSymbol(),n.accept("last")?-f:f;default:return!1}}function c(){n.accept("on"),n.accept("the");var f=l();if(!!f)for(t.bymonthday=[f],n.nextSymbol();n.accept("comma");){if(f=l(),!f)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(f),n.nextSymbol()}}function d(){if(n.symbol==="until"){var f=Date.parse(n.text);if(!f)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(f)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var ye;(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"})(ye||(ye={}));function bo(r){return r12){var n=Math.floor(this.month/12),i=yt(this.month,12);this.month=i,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,i){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var s=zu(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),Qt(i)||_e(i,this.hour))break}},e.prototype.addMinutes=function(t,n,i,s){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=zu(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(Qt(i)||_e(i,this.hour))&&(Qt(s)||_e(s,this.minute)))break}},e.prototype.addSeconds=function(t,n,i,s,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=zu(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(Qt(i)||_e(i,this.hour))&&(Qt(s)||_e(s,this.minute))&&(Qt(a)||_e(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Mm(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>Ku))return;t=Mm(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var i=t.freq,s=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(i){case ye.YEARLY:return this.addYears(s);case ye.MONTHLY:return this.addMonths(s);case ye.WEEKLY:return this.addWeekly(s,a);case ye.DAILY:return this.addDaily(s);case ye.HOURLY:return this.addHours(s,n,o);case ye.MINUTELY:return this.addMinutes(s,n,o,u);case ye.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(bs);function Nm(r){for(var e=[],t=Object.keys(r),n=0,i=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||je(e.byweekno)||je(e.byyearday)||Boolean(e.bymonthday)||je(e.bymonthday)||Fe(e.byweekday)||Fe(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=[Sn(e.dtstart)];break}if(Fe(e.bymonth)&&!ft(e.bymonth)&&(e.bymonth=[e.bymonth]),Fe(e.byyearday)&&!ft(e.byyearday)&&Kt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Fe(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(ft(e.bymonthday)){for(var i=[],s=[],t=0;t0?i.push(n):n<0&&s.push(n)}e.bymonthday=i,e.bynmonthday=s}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Fe(e.byweekno)&&!ft(e.byweekno)&&(e.byweekno=[e.byweekno]),!Fe(e.byweekday))e.bynweekday=null;else if(Kt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(xm(e.byweekday))e.byweekday=[Ve.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Ve)!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;tV.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=je(a)?a:null,e.bynweekday=je(o)?o:null}return Fe(e.byhour)?Kt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(c=0,l=o.yearlen+yt(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),f=yt(l,7),m=Math.floor(d+f/4),g=0;g0&&b<=m){var k=void 0;b>1?(k=c+(b-1)*7,c!==u&&(k-=7-u)):k=c;for(var _=0;_<7&&(o.wnomask[k]=1,k++,o.wdaymask[k]!==e.wkst);_++);}}if(_e(e.byweekno,1)){var k=c+m*7;if(c!==u&&(k-=7-u),k=4?(q=0,ne=W+yt(x-e.wkst,7)):ne=n-c,S=Math.floor(52+yt(ne,7)/4)}if(_e(e.byweekno,S))for(var k=0;ks)return xn(r);if(S>=t){var x=yv(S,e);if(!r.accept(x)||o&&(--o,!o))return xn(r)}}else for(var _=m;_s)return xn(r);if(S>=t){var x=yv(S,e);if(!r.accept(x)||o&&(--o,!o))return xn(r)}}}if(e.interval===0||(u.add(e,b),u.year>Ku))return xn(r);bo(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function TN(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return je(n)&&!_e(n,r.mmask[e])||je(i)&&!r.wnomask[e]||je(s)&&!_e(s,r.wdaymask[e])||je(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!_e(r.eastermask,e)||(je(o)||je(u))&&!_e(o,r.mdaymask[e])&&!_e(u,r.nmdaymask[e])||je(l)&&(e=r.yearlen&&!_e(l,e+1-r.yearlen)&&!_e(l,-r.nextyearlen+e-r.yearlen))}function yv(r,e){return new Ri(r,e.tzid).rezonedDate()}function xn(r){return r.getValue()}function bN(r,e,t,n,i){for(var s=!1,a=e;a=V.HOURLY&&je(i)&&!_e(i,e.hour)||n>=V.MINUTELY&&je(s)&&!_e(s,e.minute)||n>=V.SECONDLY&&je(a)&&!_e(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var gr={MO:new Ve(0),TU:new Ve(1),WE:new Ve(2),TH:new Ve(3),FR:new Ve(4),SA:new Ve(5),SU:new Ve(6)},_o={freq:ye.YEARLY,dtstart:null,interval:1,wkst:gr.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},ev=Object.keys(_o),V=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new nv,this.origOptions=Nm(e);var n=Z_(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return To(e,t)},r.fromText=function(e,t){return z_(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Ju(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 Pm("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Dn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!Di(e)||!Di(t))throw new Error("Invalid date passed in to RRule.between");var s={before:t,after:e,inc:n};if(i)return this._iter(new Pm("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new Dn("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Di(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Dn("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Di(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Dn("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return ko(this.origOptions)},r.prototype.toText=function(e,t,n){return K_(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return Q_(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ye.YEARLY,r.MONTHLY=ye.MONTHLY,r.WEEKLY=ye.WEEKLY,r.DAILY=ye.DAILY,r.HOURLY=ye.HOURLY,r.MINUTELY=ye.MINUTELY,r.SECONDLY=ye.SECONDLY,r.MO=gr.MO,r.TU=gr.TU,r.WE=gr.WE,r.TH=gr.TH,r.FR=gr.FR,r.SA=gr.SA,r.SU=gr.SU,r.parseString=wo,r.optionsToString=ko,r}();function Tv(r,e,t,n,i,s){var a={},o=r.accept;function u(f,m){t.forEach(function(g){g.between(f,m,!0).forEach(function(b){a[Number(b)]=!0})})}i.forEach(function(f){var m=new Ri(f,s).rezonedDate();a[Number(m)]=!0}),r.accept=function(f){var m=Number(f);return isNaN(m)?o.call(this,f):!a[m]&&(u(new Date(m-1),new Date(m+1)),!a[m])?(a[m]=!0,o.call(this,f)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(f){var m=Number(f);return a[m]?!0:(a[m]=!0,o.call(this,f))});for(var l=0;l1||i.length||s.length||a.length){var c=new Lm(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(f){c.rrule(new V(Fm(f,o,u),l))}),i.forEach(function(f){c.rdate(f)}),s.forEach(function(f){c.exrule(new V(Fm(f,o,u),l))}),a.forEach(function(f){c.exdate(f)}),e.compatible&&e.dtstart&&c.rdate(o),c}var d=n[0]||{};return new V(Fm(d,d.dtstart||e.dtstart||o,d.tzid||e.tzid||u),l)}function el(r,e){return e===void 0&&(e={}),wN(r,kN(e))}function Fm(r,e,t){return pt(pt({},r),{dtstart:e,tzid:t})}function kN(r){var e=[],t=Object.keys(r),n=Object.keys(bv);if(t.forEach(function(i){_e(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return pt(pt({},bv),r)}function EN(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=j_(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function SN(r){var e=EN(r),t=e.name,n=e.value,i=t.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function ON(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;n0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function DN(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function _v(r,e){return DN(e),r.split(",").map(function(t){return yo(t)})}function vv(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;nn}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));st.isSkippingTooManyYears(e,t,s);)t=st.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.utc(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).set({hour:12,minute:0,second:0,millisecond:0}).local(!0).startOf("day")}};var _s=(m=>(m.Description="description",m.Id="id",m.DependsOn="dependsOn",m.Priority="priority",m.RecurrenceRule="recurrenceRule",m.OnCompletion="onCompletion",m.CreatedDate="createdDate",m.StartDate="startDate",m.ScheduledDate="scheduledDate",m.DueDate="dueDate",m.CancelledDate="cancelledDate",m.DoneDate="doneDate",m.BlockLink="blockLink",m))(_s||{}),tl=Object.values(_s),tn=class{constructor(){this.visible={};this.tagsVisible=!0;tl.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 tl.filter(e=>this.visible[e])}get hiddenComponents(){return tl.filter(e=>!this.visible[e])}get toggleableComponents(){return tl.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var Rt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(Rt||{}),Qe=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};function Sv(r){let e=r.trim().toLowerCase();return e==="delete"?"delete":e==="keep"?"keep":""}function xN(r,e){return r.filter(t=>t!==e)}function RN(r,e){let t=r.status,n=e.status,i=n.type===t.type;return n.type!=="DONE"||i}function Ov(r,e){let t=e.length;if(r.onCompletion===""||r.onCompletion==="keep"||t===0)return e;let n=e[t-1];if(RN(r,n))return e;let s=r.onCompletion;return s==="delete"?xN(e,n):(console.log(`OnCompletion action ${s} not yet implemented.`),e)}var Mi=/[a-zA-Z0-9-_]+/,Um=new RegExp(Mi.source+"( *, *"+Mi.source+" *)*"),Eo={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}",onCompletionSymbol:"\u{1F3C1}",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,onCompletionRegex:/🏁 ?([a-zA-Z]+)$/iu,dependsOnRegex:new RegExp("\u26D4\uFE0F? *("+Um.source+")$","iu"),idRegex:new RegExp("\u{1F194} *("+Mi.source+")$","iu")}};function rl(r,e,t){return t?r?" "+e:` ${e} ${t}`:""}function vs(r,e,t){return t?r?" "+e:` ${e} ${t.format(Z.dateFormat)}`:""}function Dv(){let r=[];return Object.values(Eo.prioritySymbols).forEach(e=>{e.length>0&&r.push(e)}),Object.values(Eo).forEach(e=>{typeof e=="string"&&r.push(e)}),r}var Ci=class{constructor(e){this.symbols=e}serialize(e){let t=new tn,n="",i=!1;for(let s of t.shownComponents)n+=this.componentToString(e,i,s);return n}componentToString(e,t,n){var b;let{prioritySymbols:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,cancelledDateSymbol:l,recurrenceSymbol:c,onCompletionSymbol:d,dueDateSymbol:f,dependsOnSymbol:m,idSymbol:g}=this.symbols;switch(n){case"description":return e.description;case"priority":{let k="";return e.priority==="0"?k=" "+i.Highest:e.priority==="1"?k=" "+i.High:e.priority==="2"?k=" "+i.Medium:e.priority==="4"?k=" "+i.Low:e.priority==="5"&&(k=" "+i.Lowest),k}case"startDate":return vs(t,s,e.startDate);case"createdDate":return vs(t,a,e.createdDate);case"scheduledDate":return e.scheduledDateIsInferred?"":vs(t,o,e.scheduledDate);case"doneDate":return vs(t,u,e.doneDate);case"cancelledDate":return vs(t,l,e.cancelledDate);case"dueDate":return vs(t,f,e.dueDate);case"recurrenceRule":return e.recurrence?rl(t,c,e.recurrence.toText()):"";case"onCompletion":return e.onCompletion===""?"":rl(t,d,e.onCompletion);case"dependsOn":return e.dependsOn.length===0?"":rl(t,m,e.dependsOn.join(","));case"id":return rl(t,g,e.id);case"blockLink":return(b=e.blockLink)!=null?b:"";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,i="3",s=null,a=null,o=null,u=null,l=null,c=null,d="",f=null,m="",g="",b=[],k="",_=20,S=0;do{n=!1;let x=e.match(t.priorityRegex);x!==null&&(i=this.parsePriority(x[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let q=e.match(t.doneDateRegex);q!==null&&(u=window.moment(q[1],Z.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let W=e.match(t.cancelledDateRegex);W!==null&&(l=window.moment(W[1],Z.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let ne=e.match(t.dueDateRegex);ne!==null&&(o=window.moment(ne[1],Z.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let G=e.match(t.scheduledDateRegex);G!==null&&(a=window.moment(G[1],Z.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let B=e.match(t.startDateRegex);B!==null&&(s=window.moment(B[1],Z.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let ge=e.match(t.createdDateRegex);ge!==null&&(c=window.moment(ge[1],Z.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let Pe=e.match(t.recurrenceRegex);Pe!==null&&(d=Pe[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let $=e.match(t.onCompletionRegex);if($!=null){e=e.replace(t.onCompletionRegex,"").trim();let F=$[1];m=Sv(F),n=!0}let j=e.match(Z.hashTagsFromEnd);if(j!=null){e=e.replace(Z.hashTagsFromEnd,"").trim(),n=!0;let F=j[0].trim();k=k.length>0?[F,k].join(" "):F}let D=e.match(t.idRegex);D!=null&&(e=e.replace(t.idRegex,"").trim(),g=D[1].trim(),n=!0);let Y=e.match(t.dependsOnRegex);Y!=null&&(e=e.replace(t.dependsOnRegex,"").trim(),b=Y[1].replace(/ /g,"").split(",").filter(F=>F!==""),n=!0),S++}while(n&&S<=_);return d.length>0&&(f=st.fromText({recurrenceRuleText:d,occurrence:new mr({startDate:s,scheduledDate:a,dueDate:o})})),k.length>0&&(e+=" "+k),{description:e,priority:i,startDate:s,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:f,onCompletion:m,id:g,dependsOn:b,tags:ee.extractHashtags(e)}}};function So(r){let e="",t=!0;for(;t;)e=Math.random().toString(36).substring(2,6+2),r.includes(e)||(t=!1);return e}function il(r,e){return r.id!==""?r:new ee(fe(K({},r),{id:So(e)}))}function xv(r,e){let t=r;if(!r.dependsOn.includes(e.id)){let n=[...r.dependsOn,e.id];t=new ee(fe(K({},r),{dependsOn:n}))}return t}function Rv(r,e){let t=r;if(r.dependsOn.includes(e.id)){let n=r.dependsOn.filter(i=>i!==e.id);t=new ee(fe(K({},r),{dependsOn:n}))}return t}function Zn(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var Jn=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return Jn.instance||(Jn.instance=new Jn),Jn.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(Jn.empty)}isEmpty(){return this.get()===Jn.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)"+Zn(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()}},ve=Jn;ve.empty="";var Cv=require("obsidian");var CN=20;function Ai(r){return ve.getInstance().removeAsWordFrom(r.description)}function AN(r,e){if(r==="")return e;let t=(0,Cv.prepareSimpleSearch)(r),n=-4;return e.map(a=>{let o=t(Ai(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 sl(r,e,t,n,i){let s=AN(r,e);return s=s.filter(a=>!(a.isDone||a.description.includes("<%")&&a.description.includes("%>")||a.description===(t==null?void 0:t.description)&&a.taskLocation.path===(t==null?void 0:t.taskLocation.path)&&a.originalMarkdown===(t==null?void 0:t.originalMarkdown)||(n==null?void 0:n.includes(a))||(i==null?void 0:i.includes(a)))),t&&s.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}),s.slice(0,CN)}var Wm=5,PN=!0;globalThis.SHOW_DEPENDENCY_SUGGESTIONS=PN;function Av(r){return globalThis.SHOW_DEPENDENCY_SUGGESTIONS&&r}function qm(r,e,t){let n=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(i,s,a,o,u,l)=>{let c=[],{postfix:d,insertSkip:f}=NN(t,i,s),m={line:i,cursorPos:s,settings:a,dataviewMode:t,postfix:d,insertSkip:f};return c=c.concat(qN(n,e,m)),c=c.concat(jN(r.recurrenceSymbol,m)),Av(u)&&(c=c.concat(GN(r.idSymbol,o,m)),c=c.concat(YN(r.dependsOnSymbol,o,m,l))),c=c.concat($N(r.onCompletionSymbol,e,m)),c=c.concat(IN(r,u,m)),c.length>0&&!c.some(g=>g.suggestionType==="match")&&(t||c.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` `})),c=c.slice(0,a.autoSuggestMaxItems),c}}function NN(r,e,t){let n=HN(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:i,insertSkip:s}}function IN(r,e,t){let n=[],i=t.line;Pi(n,i,r.dueDateSymbol,"due date"),Pi(n,i,r.startDateSymbol,"start date"),Pi(n,i,r.scheduledDateSymbol,"scheduled date"),FN(n,r,t),Pi(n,i,r.recurrenceSymbol,"recurring (repeat)"),LN(n,r,t),Av(e)&&(Pi(n,i,r.idSymbol,"id"),Pi(n,i,r.dependsOnSymbol,"depends on id")),Pi(n,i,r.onCompletionSymbol,"on completion");let s=UN(n,t);return s.length===0&&t.settings.autoSuggestMinMatch===0?n:s}function Pi(r,e,t,n){e.includes(t)||r.push({displayText:`${t} ${n}`,appendText:`${t} `})}function FN(r,e,t){if(!(i=>Object.values(e.prioritySymbols).some(s=>s.length>0&&i.includes(s)))(t.line)){let i=e.prioritySymbols,s=["High","Medium","Low","Highest","Lowest"];for(let a of s){let o=i[a];r.push({displayText:t.dataviewMode?`${o} priority`:`${o} ${a.toLowerCase()} priority`,appendText:`${o}${t.postfix}`,insertSkip:t.dataviewMode?t.insertSkip:void 0})}}}function LN(r,e,t){if(!t.line.includes(e.createdDateSymbol)){let i=zt.parseDate("today",!0).format(Z.dateFormat);r.push({textToMatch:`${e.createdDateSymbol} created`,displayText:`${e.createdDateSymbol} created today (${i})`,appendText:`${e.createdDateSymbol} ${i}`+t.postfix,insertSkip:t.dataviewMode?t.insertSkip:void 0})}}function UN(r,e){let t=ws(/([a-zA-Z'_-]*)/g,e),n=[];if(t&&t.length>0){let i=t[0];if(i.length>=Math.max(1,e.settings.autoSuggestMinMatch)){let s=r.filter(a=>{var u;return((u=a.textToMatch)!=null?u:a.displayText).toLowerCase().includes(i.toLowerCase())});for(let a of s){let o=e.dataviewMode&&(a.displayText.includes("priority")||a.displayText.includes("created"))?i.length+e.insertSkip:i.length;n.push({suggestionType:"match",displayText:a.displayText,appendText:a.appendText,insertAt:t.index,insertSkip:o})}}}return n}function Pv(r,e){let t=`${e}`,n=`${r} ${e}`;return{displayText:t,appendText:n}}function WN(r,e){let n=`${zt.parseDate(e,!0).format(Z.dateFormat)}`,i=`${e} (${n})`,s=`${r} ${n}`;return{displayText:i,appendText:s}}function qN(r,e,t){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),a=ws(s,t);if(a&&a.length>=2){let o=a[2];if(o.length1?zt.parseDate(Hu(o),!0):null;if(u!=null&&u.isValid()){let c=u.format(Z.dateFormat);al(t,a,[c],Pv,i)}let l=jm(n,o,e,!0);al(t,a,l,WN,i)}return i}function jN(r,e){var a;let t=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],n=[],i=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),s=ws(i,e);if(s&&s.length>=2){let o=s[1],u=s[2];if(u.length0){let f=(a=st.fromText({recurrenceRuleText:u,occurrence:new mr({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:a.toText();if(f){let m=`${o} ${f}`+e.postfix;if(n.push({suggestionType:"match",displayText:`\u2705 ${f}`,appendText:m,insertAt:s.index,insertSkip:$m(s[0],e)}),s[0]==m)return[]}}let l=e.settings.autoSuggestMaxItems/2,c=jm(t,u,l,!1);c.length===0&&u.trim().length===0&&(c=t.slice(0,l)),al(e,s,c,(f,m)=>{let g=`${m}`,b=`${f} ${m}`;return{displayText:g,appendText:b}},n)}return n}function $N(r,e,t){let n=["delete","keep"],i=[],s=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),a=ws(s,t);if(a&&a.length>=2){let o=a[2];if(o.lengtho.id));n.push({suggestionType:"match",displayText:"generate unique id",appendText:`${r} ${a}`+t.postfix,insertAt:s.index,insertSkip:$m(s[0],t)})}return n}function YN(r,e,t,n){let i=[],s=t.dataviewMode?Zn("()[]"):Dv(),a=new RegExp(`(${r})([0-9a-zA-Z-_ ^,]*,)*([^,${s}]*)`,"ug"),o=ws(a,t);if(o&&o.length>=1){let u=o[2]||"",l=o[3],c=[];if(u){let d=u.split(",").map(f=>f.trim());c=e.filter(f=>f.id&&d.includes(f.id))}if(l.length>=t.settings.autoSuggestMinMatch){let d=sl(l.trim(),e,n,[],c);for(let f of d)i.push({suggestionType:"match",displayText:`${f.descriptionWithoutTags} - From: ${f.filename}.md`,appendText:`${r}${u}`,insertAt:o.index,insertSkip:r.length+u.length+l.length,taskItDependsOn:f})}}return i}function jm(r,e,t,n){let s=r.filter(a=>e&&e.length>=1&&a.toLowerCase().includes(e.toLowerCase())).slice(0,t);return n&&s.length===0&&(s=r.slice(0,t)),s}function al(r,e,t,n,i){let s=e[1];for(let a of t){let{displayText:o,appendText:u}=n(s,a);i.push({suggestionType:"match",displayText:o,appendText:u+r.postfix,insertAt:e.index,insertSkip:$m(e[0],r)})}}function ws(r,e){let t=e.line.matchAll(r),n=e.cursorPos;for(let i of t)if((i==null?void 0:i.index)&&i.index[i,0])),n=Object.fromEntries(e.map(([i,s])=>[s,i]));for(let i of r)i in t?t[i]++:i in n&&(t[n[i]]=Math.max(0,t[n[i]]-1));return Object.values(t).some(i=>i>0)}function HN(r,e){if(e.length===0)return null;let t=Object.fromEntries(e.map(([s,a])=>[s,0])),n=Object.fromEntries(e.map(([s,a])=>[a,s])),i=[];for(let s=0;s=1){for(let o=i.length-1;o>=0;o--)if(i[o].bracket==n[a]){i.splice(o,1);break}}t[n[a]]=Math.max(0,t[n[a]]-1)}}return i.length>0?i[i.length-1].bracket:null}function Nv(r,e){return(t,n,i,s,a)=>BN(t.slice(0,n),e)?r(t,n,i,s,a):[]}function Iv(r,e,t){let n=ve.getInstance().includedIn(r),i=VN(t,e,n);return typeof i=="boolean"?i:n&&zN(r,e.ch)}function VN(r,e,t){var n,i;return(i=(n=r==null?void 0:r.editorComponent)==null?void 0:n.showTasksPluginAutoSuggest)==null?void 0:i.call(n,e,r,t)}function zN(r,e){if(r.length===0)return!1;let t=ee.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}function $m(r,e){return e.dataviewMode?r.length+e.insertSkip:r.length}var Xt=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 Xt.priorityNameUsingNone(e).replace("None","Normal")}static priorityValue(e){switch(e.toLowerCase()){case"lowest":return"5";case"low":return"4";case"medium":return"2";case"high":return"1";case"highest":return"0";default:return"3"}}};function Ir(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Gm={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::",onCompletionSymbol:"onCompletion::",idSymbol:"id::",dependsOnSymbol:"dependsOn::",TaskFormatRegularExpressions:{priorityRegex:Ir(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:Ir(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:Ir(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:Ir(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:Ir(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:Ir(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:Ir(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:Ir(/repeat:: *([a-zA-Z0-9, !]+)/),onCompletionRegex:Ir(/onCompletion:: *([a-zA-Z]+)/),dependsOnRegex:Ir(new RegExp("dependsOn:: *("+Um.source+")")),idRegex:Ir(new RegExp("id:: *("+Mi.source+")"))}},ol=class extends Ci{constructor(){super(Gm)}parsePriority(e){return Xt.priorityValue(e)}componentToString(e,t,n){let i=super.componentToString(e,t,n),s=["blockLink","description"];return i!==""&&!s.includes(n)?` [${i.trim()}]`:i}};var yr=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 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 Rt[e]||"TODO"}static createUnknownStatus(e){return new yr(new Qe(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=yr.getTypeFromStatusTypeString(e[3]);return new yr(new Qe(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 yr.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},re=yr;re.DONE=new yr(new Qe("x","Done"," ",!0,"DONE")),re.EMPTY=new yr(new Qe("","EMPTY","",!0,"EMPTY")),re.TODO=new yr(new Qe(" ","Todo","x",!0,"TODO")),re.CANCELLED=new yr(new Qe("-","Cancelled"," ",!0,"CANCELLED")),re.IN_PROGRESS=new yr(new Qe("/","In Progress","x",!0,"IN_PROGRESS")),re.NON_TASK=new yr(new Qe("Q","Non-Task","A",!0,"NON_TASK"));var ul=class{constructor(e=!1,t=!1,n=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t,this.recordTimings=n}};var Le=class{constructor(){this.coreStatuses=[re.TODO.configuration,re.DONE.configuration],this.customStatuses=[re.IN_PROGRESS.configuration,re.CANCELLED.configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let i=this.findStatusIndex(t,e);return i<=-1?!1:(e.splice(i,1,n),!0)}static findStatusIndex(e,t){let n=new re(e);return t.findIndex(i=>new re(i).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){Le.deleteAllCustomStatuses(e),new Le().customStatuses.forEach(n=>{Le.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(i=>{e.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):Le.addStatus(e.customStatuses,re.createFromImportedValue(i))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Le.allStatuses(e).forEach(n=>{t.add(n)})}};var Fv=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var Rn=class{constructor(e,t,n,i,s,a){this.internalName=e;this.index=t;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let e=[];return Fv.forEach(t=>{e=[...e,new Rn(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return Rn.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of Rn.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 Fr={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Ci(Eo),buildSuggestions:qm(Eo,Wm,!1)},dataview:{displayName:"Dataview",taskSerializer:new ol,buildSuggestions:Nv(qm(Gm,Wm,!0),[["(",")"],["[","]"]])}},Bm={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:20,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsScheduledDateFormat:"",filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Le,features:Rn.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new ul,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},Mn=K({},Bm);function Ym(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var Q=()=>(Ym(Rn.settingsFlags,Mn.features),Ym(Bm.loggingOptions.minLevels,Mn.loggingOptions.minLevels),Ym(Bm.debugSettings,Mn.debugSettings),Mn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=re.getTypeFromStatusTypeString(r.type);t[e]=new Qe((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),K({},Mn)),ze=r=>(Mn=K(K({},Mn),r),Q());var Ni=(r,e)=>(Mn.generalSettings[r]=e,Q()),Lv=r=>{var e;return(e=Mn.features[r])!=null?e:!1};function Oo(){return Fr[Q().taskFormat]}function ll(r){let t={"<":"<",">":">","&":"&",'"':"""}[r];return t!==void 0?t:r}function Uv(r){let e=[...r],t="";return e.forEach(n=>{t+=ll(n)}),t}var xe=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!==re.EMPTY.symbol)}static getInstance(){return xe.instance||(xe.instance=new xe),xe.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof re?this._registeredStatuses.push(e):this._registeredStatuses.push(new re(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):re.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):re.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:re.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 re.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:re.createUnknownStatus(e.nextStatusSymbol)}getNextRecurrenceStatusOrCreate(e){let t=this.getNextStatusOrCreate(e),n=this.getNextRecurrenceStatusOfType(t,"TODO");if(n)return n;let i=this.getNextRecurrenceStatusOfType(t,"IN_PROGRESS");return i||this.bySymbolOrCreate(" ")}getNextRecurrenceStatusOfType(e,t){if(e.type===t)return e;let n=e;for(let i=0;i!this.hasSymbol(s.symbol)),n=new xe,i=[];return t.forEach(s=>{if(n.hasSymbol(s.symbol))return;let a=xe.copyStatusWithNewName(s,`Unknown (${s.symbol})`);i.push(a),n.add(a)}),i.sort((s,a)=>s.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new Qe(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new re(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(){[re.TODO,re.IN_PROGRESS,re.DONE,re.CANCELLED].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",i=[],s=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);i.push(`${o+1}${u}`);let l=this.getNextStatus(a);if(this.addEdgeIfNotToInternal(t,l,s,o,!1),a.type==="DONE"){let c=this.getNextRecurrenceStatusOrCreate(a);c.symbol!==l.symbol&&this.addEdgeIfNotToInternal(t,c,s,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; ${i.join(` `)} ${s.join(` `)} linkStyle default stroke:gray \`\`\` `}addEdgeIfNotToInternal(e,t,n,i,s){let a=e.findIndex(l=>l.symbol===t.symbol),o=a!==-1,u=t.type!=="EMPTY";if(o&&u){let l;s?l='-. "\u{1F501}" .-> ':l=" --> ";let c=`${i+1}${l}${a+1}`;n.push(c)}}getMermaidNodeLabel(e,t){let n=Uv(e.name),i=e.type;if(t){let s=ll(e.symbol),a=ll(e.nextStatusSymbol),o=`[${s}] -> [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}
${o}
${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var Wv=require("obsidian");var rn=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var mt=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 rn("Overdue",1):t.isSame(e,"day")?new rn("Today",2):t.isValid()?new rn("Future",3):new rn("Invalid date",0):new rn("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new rn("",0);let t=this.fromNowOrder(e);return new rn(e.fromNow(),t)}fromNowOrder(e){if(!e.isValid())return 0;let t=window.moment(),n=e.isSameOrBefore(t,"day"),i=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let i=e.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return t?n.subtract(s,o):n.add(s,o)}postpone(e="days",t=1){if(!this._date)throw new Wv.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 QN=require("obsidian"),Gv=ma($v());var Hm=class extends Gv.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,i)=>n+i,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",i="";for(let s in this.options.minLevels)t.startsWith(s)&&s.length>=i.length&&(n=this.options.minLevels[s],i=s);return new Vm(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)}},Mt=new Hm,Vm=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){r.debug(`${e} ==> ${i+1} : ${n.toFileLineString()}`)})}var _t=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=Q();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("."),i=e.substring(t,n),{filenameAsScheduledDateFormat:s}=Q();if(s!==""){let o=window.moment(i,s,!0);if(o.isValid())return o}let a=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(a||(a=/(\d{4})(\d{2})(\d{2})/.exec(i)),a){let o=window.moment([parseInt(a[1]),parseInt(a[2])-1,parseInt(a[3])]);if(o.isValid())return o}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new ee(fe(K({},e),{taskLocation:t,scheduledDate:i,scheduledDateIsInferred:s}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(i=>(n!==null&&!n.isSame(i.scheduledDate,"day")&&(i=new ee(fe(K({},i),{scheduledDateIsInferred:!1}))),i))}};var Lr=class{static calculate(e){var n,i,s;let t=0;if((n=e.dueDate)!=null&&n.isValid()){let a=window.moment().startOf("day"),o=Math.round(a.diff(e.dueDate)/Lr.milliSecondsPerDay),u;o>=7?u=1:o>=-14?u=(o+14)*.8/21+.2:u=.2,t+=u*Lr.dueCoefficient}switch((i=e.scheduledDate)!=null&&i.isValid()&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*Lr.scheduledCoefficient),(s=e.startDate)!=null&&s.isValid()&&window.moment().isBefore(e.startDate)&&(t+=1*Lr.startedCoefficient),e.priority){case"0":t+=1.5*Lr.priorityCoefficient;break;case"1":t+=1*Lr.priorityCoefficient;break;case"2":t+=.65*Lr.priorityCoefficient;break;case"3":t+=.325*Lr.priorityCoefficient;break;case"5":t-=.3*Lr.priorityCoefficient;break}return t}},Cn=Lr;Cn.dueCoefficient=12,Cn.scheduledCoefficient=5,Cn.startedCoefficient=-3,Cn.priorityCoefficient=6,Cn.milliSecondsPerDay=1e3*60*60*24;var ee=class extends hn{constructor({status:t,description:n,taskLocation:i,indentation:s,listMarker:a,priority:o,createdDate:u,startDate:l,scheduledDate:c,dueDate:d,doneDate:f,cancelledDate:m,recurrence:g,onCompletion:b,dependsOn:k,id:_,blockLink:S,tags:x,originalMarkdown:q,scheduledDateIsInferred:W,parent:ne=null}){super(q,ne);this._urgency=null;this.status=t,this.description=n,this.indentation=s,this.listMarker=a,this.taskLocation=i,this.tags=x,this.priority=o,this.createdDate=u,this.startDate=l,this.scheduledDate=c,this.dueDate=d,this.doneDate=f,this.cancelledDate=m,this.recurrence=g,this.onCompletion=b,this.dependsOn=k,this.id=_,this.blockLink=S,this.scheduledDateIsInferred=W}static fromLine({line:t,taskLocation:n,fallbackDate:i}){let s=ee.extractTaskComponents(t);return s===null||!ve.getInstance().includedIn(s.body)?null:ee.parseTaskSignifiers(t,n,i)}static parseTaskSignifiers(t,n,i){let s=ee.extractTaskComponents(t);if(s===null)return null;let{taskSerializer:a}=Oo(),o=a.deserialize(s.body),u=!1;return _t.canApplyFallback(o)&&i!==null&&(o.scheduledDate=i,u=!0),o.tags=o.tags.map(l=>l.trim()),o.tags=o.tags.filter(l=>!ve.getInstance().equals(l)),new ee(fe(K(K({},s),o),{taskLocation:n,originalMarkdown:t,scheduledDateIsInferred:u}))}static extractTaskComponents(t){let n=t.match(Z.taskRegex);if(n===null)return null;let i=n[1],s=n[2],a=n[3],o=xe.getInstance().bySymbolOrCreate(a),u=n[4].trim(),l=u.match(Z.blockLinkRegex),c=l!==null?l[0]:"";return c!==""&&(u=u.replace(Z.blockLinkRegex,"").trim()),{indentation:i,listMarker:s,status:o,body:u,blockLink:c}}toString(){return Oo().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let t=Mt.getLogger("tasks.Task"),n="toggle()";cl(t,n,this);let i=xe.getInstance().getNextStatusOrCreate(this.status),s=this.handleNewStatus(i);return dl(t,n,s),s}handleNewStatus(t,n=window.moment()){if(t.identicalTo(this.status))return[this];let{setDoneDate:i}=Q(),s=this.newDate(t,"DONE",this.doneDate,i,n),{setCancelledDate:a}=Q(),o=this.newDate(t,"CANCELLED",this.cancelledDate,a,n),u=new ee(fe(K({},this),{status:t,doneDate:s,cancelledDate:o})),l=!t.isCompleted(),c=this.status.isCompleted(),d=this.recurrence===null;if(l||c||d)return[u];let m=this.recurrence.next(n);return m===null?[u]:[this.createNextOccurrence(t,m),u]}newDate(t,n,i,s,a){let o=null;return t.type===n&&(this.status.type!==n?s&&(o=a):o=i),o}createNextOccurrence(t,n){let{setCreatedDate:i}=Q(),s=null;i&&(s=window.moment());let a=null,o=null,l=xe.getInstance().getNextRecurrenceStatusOrCreate(t);return new ee(fe(K(K({},this),n),{status:l,blockLink:"",id:"",dependsOn:[],createdDate:s,cancelledDate:a,doneDate:o}))}toggleWithRecurrenceInUsersOrder(){let t=this.toggle();return this.putRecurrenceInUsersOrder(t)}handleNewStatusWithRecurrenceInUsersOrder(t,n=window.moment()){Mt.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to '${t.symbol}'`);let s=this.handleNewStatus(t,n);return this.putRecurrenceInUsersOrder(s)}putRecurrenceInUsersOrder(t){let n=Ov(this,t),{recurrenceOnNextLine:i}=Q();return i?n.reverse():n}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}isBlocked(t){if(this.dependsOn.length===0||this.isDone)return!1;for(let n of this.dependsOn)if(!!t.find(s=>s.id===n&&!s.isDone))return!0;return!1}isBlocking(t){return this.id===""||this.isDone?!1:t.some(n=>n.isDone?!1:n.dependsOn.includes(this.id))}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let t=Xt.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${t} priority`}get descriptionWithoutTags(){return this.description.replace(Z.hashTags,"").trim()}get priorityName(){return Xt.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=Cn.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get cancelled(){return new mt(this.cancelledDate)}get created(){return new mt(this.createdDate)}get done(){return new mt(this.doneDate)}get due(){return new mt(this.dueDate)}get scheduled(){return new mt(this.scheduledDate)}get start(){return new mt(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let t=this.happensDates,n=Array.from(t).sort(pr);for(let i of n)if(i!=null&&i.isValid())return new mt(i);return new mt(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 this.taskLocation.tasksFile}get filename(){let t=this.path.match(/([^/]+)\.md$/);return t!==null?t[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:t}){let n;return t?n=this.filename:n="/"+this.path,n===null?null:(this.precedingHeader!==null&&this.precedingHeader!==n&&(n=n+" > "+this.precedingHeader),n)}identicalTo(t){var i,s;if(!super.identicalTo(t))return!1;let n=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred","id","dependsOn","onCompletion"];for(let a of n)if(((i=this[a])==null?void 0:i.toString())!==((s=t[a])==null?void 0:s.toString()))return!1;if(!this.status.identicalTo(t.status)||this.tags.length!==t.tags.length||!this.tags.every(function(a,o){return a===t.tags[o]}))return!1;n=ee.allDateFields();for(let a of n){let o=this[a],u=t[a];if(pr(o,u)!==0)return!1}return this.recurrenceIdenticalTo(t)?this.file.rawFrontmatterIdenticalTo(t.file):!1}recurrenceIdenticalTo(t){let n=this.recurrence,i=t.recurrence;return!(n===null&&i!==null||n!==null&&i===null||n&&i&&!n.identicalTo(i))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate","cancelledDate"]}static extractHashtags(t){var n,i;return(i=(n=t.match(Z.hashTags))==null?void 0:n.map(s=>s.trim()))!=null?i:[]}};var Do=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var ht=class{constructor(e,t,n,i,s){this._tasksFile=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=i,this._precedingHeader=s}static fromUnknownPosition(e){return new ht(e,0,0,0,null)}fromRenamedFile(e){return new ht(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get tasksFile(){return this._tasksFile}get path(){return this._tasksFile.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!==""}};function XN(r,e,t,n,i,s){var g,b;let a=new ut(r,i),o=[],u=e.split(` `),l=u.length,c=new Do(()=>_t.fromPath(r)),d=null,f=0,m=new Map;for(let k of t){let _=k.position.start.line;if(_>=l)return n.debug(`${r} Obsidian gave us a line number ${_} past the end of the file. ${l}.`),o;if((d===null||d.position.end.line<_)&&(d=Es.getSection(_,i.sections),f=0),d===null)continue;let S=u[_];if(S===void 0){n.debug(`${r}: line ${_} - ignoring 'undefined' line.`);continue}if(k.task!==void 0){let x;try{if(x=ee.fromLine({line:S,taskLocation:new ht(a,_,d.position.start.line,f,Es.getPrecedingHeader(_,i.headings)),fallbackDate:c.value}),x!==null){let q=(g=m.get(k.parent))!=null?g:null;q!==null&&(x=new ee(fe(K({},x),{parent:q}))),m.set(_,x)}}catch(q){s(q,r,k,S);continue}x!==null&&(f++,o.push(x))}else{let x=k.position.start.line,q=(b=m.get(k.parent))!=null?b:null;m.set(x,new hn(u[x],q))}}return o}var Es=class{constructor({metadataCache:e,vault:t,workspace:n,events:i}){this.logger=Mt.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.workspace=n,this.vaultEventReferences=[],this.events=i,this.eventsEventReferences=[],this.tasksMutex=new Zo,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.workspace.onLayoutReady(()=>{this.subscribeToVault(),this.loadVault()}),this.subscribeToEvents()}unload(){this.logger.info("Unloading Cache");for(let 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",()=>A(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}=Q(),t=this.vault.on("create",s=>{s instanceof ks.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",s=>{s instanceof ks.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof ks.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=this.metadataCache.getFileCache(s),u=new ut(s.path,o!=null?o:void 0),l=new Do(()=>_t.fromPath(s.path));this.tasks=this.tasks.map(c=>{if(c.path!==a)return c;let d=c.taskLocation.fromRenamedFile(u);return e?_t.updateTaskPath(c,d,l.value):new ee(fe(K({},c),{taskLocation:d}))}),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}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(()=>A(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 A(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),i=t.listItems,s=[];if(i!==void 0){let a=yield this.vault.cachedRead(e);s=this.getTasksFromFileContent(a,i,t,e.path,this.reportTaskParsingErrorToUser,this.logger)}hn.listsAreIdentical(n,s)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...s),this.logger.debug("Cache.indexFile: "+e.path+`: read ${s.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,i,s,a){return XN(i,e,t,a,n,s)}reportTaskParsingErrorToUser(e,t,n,i){let s=`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} Line number: ${n.position.start.line} Task line: ${i} Please create a bug report for this message at https://github.com/obsidian-tasks-group/obsidian-tasks/issues/new/choose to help us find and fix the underlying issue. Include: - either a screenshot of the error popup, or copy the text from the console, if on a desktop machine. - the output from running the Obsidian command 'Show debug info' The error popup will only be shown when Tasks is starting up, but if the error persists, it will be shown in the console every time this file is edited during the Obsidian session. `;this.logger.error(s),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new ks.Notice(s,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 i of t){if(i.position.start.line>e)return n;n=i.heading}return n}};var yh=require("obsidian");var jw=require("obsidian");function Ue(){}function Zm(r){return r()}function Yv(){return Object.create(null)}function vt(r){r.forEach(Zm)}function ml(r){return typeof r=="function"}function nn(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Bv(r){return Object.keys(r).length===0}var Hv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Ro=class{constructor(e){this.options=e,this._listeners="WeakMap"in Hv?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 i of t)Ro.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};Ro.entries="WeakMap"in Hv?new WeakMap:void 0;var Vv=!1;function ZN(){Vv=!0}function JN(){Vv=!1}function L(r,e){r.appendChild(e)}function ue(r,e,t){r.insertBefore(e,t||null)}function se(r){r.parentNode&&r.parentNode.removeChild(r)}function Li(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function zv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function I(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Kv(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 tI(r){return Array.from(r.childNodes)}function br(r,e){e=""+e,r.data!==e&&(r.data=e)}function Wt(r,e){r.value=e==null?"":e}function Jm(r,e,t){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=Ee(n.contentWindow,"resize",e),e()}),L(r,n),()=>{(i||s&&n.contentWindow)&&s(),se(n)}}function An(r,e,t){r.classList[t?"add":"remove"](e)}var xs=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=eI(t.nodeName):this.e=X(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;tr.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Ds=e}var pl=new Set,Ii;function Jv(){Ii={r:0,c:[],p:Ii}}function ew(){Ii.r||vt(Ii.c),Ii=Ii.p}function qt(r,e){r&&r.i&&(pl.delete(r),r.i(e))}function Zt(r,e,t,n){if(r&&r.o){if(pl.has(r))return;pl.add(r),Ii.c.push(()=>{pl.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var uI=["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"],wG=new Set([...uI]);function At(r,e,t){let n=r.$$.props[e];n!==void 0&&(r.$$.bound[n]=t,t(r.$$.ctx[n]))}function Ur(r){r&&r.c()}function _r(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||Fi(()=>{let a=r.$$.on_mount.map(Zm).filter(ml);r.$$.on_destroy?r.$$.on_destroy.push(...a):vt(a),r.$$.on_mount=[]}),s.forEach(Fi)}function Jt(r,e){let t=r.$$;t.fragment!==null&&(oI(t.after_update),vt(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function lI(r,e){r.$$.dirty[0]===-1&&(Os.push(r),sI(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let g=m.length?m[0]:f;return l.ctx&&i(l.ctx[d],l.ctx[d]=g)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](g),c&&lI(r,d)),f}):[],l.update(),c=!0,vt(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){ZN();let d=tI(e.target);l.fragment&&l.fragment.l(d),d.forEach(se)}else l.fragment&&l.fragment.c();e.intro&&qt(r.$$.fragment),_r(r,e.target,e.anchor,e.customElement),JN(),Zv()}xo(u)}var cI;typeof HTMLElement=="function"&&(cI=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Zm).filter(ml);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){vt(this.$$.on_disconnect)}$destroy(){Jt(this,1),this.$destroy=Ue}$on(r,e){if(!ml(e))return Ue;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&&!Bv(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Tr=class{$destroy(){Jt(this,1),this.$destroy=Ue}$on(e,t){if(!ml(t))return Ue;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Bv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function tw(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})}function Rs(r){return r.charAt(0).toUpperCase()+r.slice(1)}function gt(r,e){if(e===null)return Rs(r);let t=r.toLowerCase().indexOf(e.toLowerCase());if(t===-1)return`${Rs(r)} (${e.toLowerCase()})`;let n=r.substring(0,t);return n+='',t===0?n+=r.substring(t,t+1).toUpperCase():n+=r.substring(t,t+1),n+="",n+=r.substring(t+1),n=Rs(n),n}function dI(r){let e,t,n,i;return{c(){e=X("code"),t=Re(r[4]),n=le(),i=new xs(!1),i.a=null,I(e,"class","tasks-modal-parsed-date")},m(s,a){ue(s,e,a),L(e,t),L(e,n),i.m(r[2],e)},p(s,a){a&16&&br(t,s[4]),a&4&&i.p(s[2])},d(s){s&&se(e)}}}function fI(r){let e,t,n,i,s;return{c(){e=X("div"),t=Re(r[4]),n=X("input"),I(n,"class","tasks-modal-date-editor-picker"),I(n,"type","date"),I(n,"id","date-editor-picker"),I(n,"tabindex","-1"),I(e,"class","tasks-modal-parsed-date")},m(a,o){ue(a,e,o),L(e,t),L(e,n),Wt(n,r[6]),i||(s=[Ee(n,"input",r[10]),Ee(n,"input",r[7])],i=!0)},p(a,o){o&16&&br(t,a[4]),o&64&&Wt(n,a[6])},d(a){a&&se(e),i=!1,vt(s)}}}function pI(r){let e,t=gt(r[3],r[5])+"",n,i,s,a,o,u;function l(f,m){return f[1]?fI:dI}let c=l(r,-1),d=c(r);return{c(){e=X("label"),n=le(),i=X("input"),s=le(),d.c(),a=hl(),I(e,"for",r[3]),I(i,"id",r[3]),I(i,"type","text"),I(i,"class","tasks-modal-date-input"),I(i,"placeholder",mI),I(i,"accesskey",r[5]),An(i,"tasks-modal-error",!r[1])},m(f,m){ue(f,e,m),e.innerHTML=t,ue(f,n,m),ue(f,i,m),Wt(i,r[0]),ue(f,s,m),d.m(f,m),ue(f,a,m),o||(u=Ee(i,"input",r[9]),o=!0)},p(f,[m]){m&40&&t!==(t=gt(f[3],f[5])+"")&&(e.innerHTML=t),m&8&&I(e,"for",f[3]),m&8&&I(i,"id",f[3]),m&32&&I(i,"accesskey",f[5]),m&1&&i.value!==f[0]&&Wt(i,f[0]),m&2&&An(i,"tasks-modal-error",!f[1]),c===(c=l(f,m))&&d?d.p(f,m):(d.d(1),d=c(f),d&&(d.c(),d.m(a.parentNode,a)))},i:Ue,o:Ue,d(f){f&&se(e),f&&se(n),f&&se(i),f&&se(s),d.d(f),f&&se(a),o=!1,u()}}}var mI="Try 'Mon' or 'tm' then space";function hI(r,e,t){let{id:n}=e,{dateSymbol:i}=e,{date:s}=e,{isDateValid:a}=e,{forwardOnly:o}=e,{accesskey:u}=e,{parsedDate:l=""}=e,c="";function d(g){g.target!==null&&t(0,s=c)}function f(){s=this.value,t(0,s),t(3,n),t(8,o),t(2,l),t(1,a)}function m(){c=this.value,t(6,c),t(0,s),t(3,n),t(8,o),t(2,l),t(1,a)}return r.$$set=g=>{"id"in g&&t(3,n=g.id),"dateSymbol"in g&&t(4,i=g.dateSymbol),"date"in g&&t(0,s=g.date),"isDateValid"in g&&t(1,a=g.isDateValid),"forwardOnly"in g&&t(8,o=g.forwardOnly),"accesskey"in g&&t(5,u=g.accesskey),"parsedDate"in g&&t(2,l=g.parsedDate)},r.$$.update=()=>{if(r.$$.dirty&271){e:t(0,s=Hu(s)),t(2,l=W_(n,s,o)),t(1,a=!l.includes("invalid")),a&&t(6,c=l)}},[s,a,l,n,i,u,c,d,o,f,m]}var th=class extends Tr{constructor(e){super(),sn(this,e,hI,pI,nn,{id:3,dateSymbol:4,date:0,isDateValid:1,forwardOnly:8,accesskey:5,parsedDate:2})}},Ui=th;var Wi=Math.min,jt=Math.max,Ao=Math.round;var Pn=r=>({x:r,y:r}),gI={left:"right",right:"left",bottom:"top",top:"bottom"},yI={start:"end",end:"start"};function rh(r,e,t){return jt(r,Wi(e,t))}function Ms(r,e){return typeof r=="function"?r(e):r}function Nn(r){return r.split("-")[0]}function Cs(r){return r.split("-")[1]}function nh(r){return r==="x"?"y":"x"}function ih(r){return r==="y"?"height":"width"}function As(r){return["top","bottom"].includes(Nn(r))?"y":"x"}function sh(r){return nh(As(r))}function rw(r,e,t){t===void 0&&(t=!1);let n=Cs(r),i=sh(r),s=ih(i),a=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Co(a)),[a,Co(a)]}function nw(r){let e=Co(r);return[gl(r),e,gl(e)]}function gl(r){return r.replace(/start|end/g,e=>yI[e])}function TI(r,e,t){let n=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(r){case"top":case"bottom":return t?e?i:n:e?n:i;case"left":case"right":return e?s:a;default:return[]}}function iw(r,e,t,n){let i=Cs(r),s=TI(Nn(r),t==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(gl)))),s}function Co(r){return r.replace(/left|right|bottom|top/g,e=>gI[e])}function bI(r){return K({top:0,right:0,bottom:0,left:0},r)}function sw(r){return typeof r!="number"?bI(r):{top:r,right:r,bottom:r,left:r}}function qi(r){return fe(K({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function aw(r,e,t){let{reference:n,floating:i}=r,s=As(e),a=sh(e),o=ih(a),u=Nn(e),l=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[o]/2-i[o]/2,m;switch(u){case"top":m={x:c,y:n.y-i.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-i.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Cs(e)){case"start":m[a]-=f*(t&&l?-1:1);break;case"end":m[a]+=f*(t&&l?-1:1);break}return m}var ow=(r,e,t)=>A(void 0,null,function*(){let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=t,o=s.filter(Boolean),u=yield a.isRTL==null?void 0:a.isRTL(e),l=yield a.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:d}=aw(l,n,u),f=n,m={},g=0;for(let b=0;bY<=0)){var Pe,$;let Y=(((Pe=a.flip)==null?void 0:Pe.index)||0)+1,F=ne[Y];if(F)return{data:{index:Y,overflows:ge},reset:{placement:F}};let J=($=ge.filter(p=>p.overflows[0]<=0).sort((p,h)=>p.overflows[1]-h.overflows[1])[0])==null?void 0:$.placement;if(!J)switch(g){case"bestFit":{var j;let p=(j=ge.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:j[0];p&&(J=p);break}case"initialPlacement":J=u;break}if(s!==J)return{reset:{placement:J}}}return{}})}}};function _I(r,e){return A(this,null,function*(){let{placement:t,platform:n,elements:i}=r,s=yield n.isRTL==null?void 0:n.isRTL(i.floating),a=Nn(t),o=Cs(t),u=As(t)==="y",l=["left","top"].includes(a)?-1:1,c=s&&u?-1:1,d=Ms(e,r),{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:K({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return o&&typeof g=="number"&&(m=o==="end"?g*-1:g),u?{x:m*c,y:f*l}:{x:f*l,y:m*c}})}var Tl=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(t){return A(this,null,function*(){var n,i;let{x:s,y:a,placement:o,middlewareData:u}=t,l=yield _I(t,r);return o===((n=u.offset)==null?void 0:n.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:a+l.y,data:fe(K({},l),{placement:o})}})}}},bl=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(t){return A(this,null,function*(){let{x:n,y:i,placement:s}=t,_=Ms(r,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:u={fn:S=>{let{x,y:q}=S;return{x,y:q}}}}=_,l=Xo(_,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},d=yield yl(t,l),f=As(Nn(s)),m=nh(f),g=c[m],b=c[f];if(a){let S=m==="y"?"top":"left",x=m==="y"?"bottom":"right",q=g+d[S],W=g-d[x];g=rh(q,g,W)}if(o){let S=f==="y"?"top":"left",x=f==="y"?"bottom":"right",q=b+d[S],W=b-d[x];b=rh(q,b,W)}let k=u.fn(fe(K({},t),{[m]:g,[f]:b}));return fe(K({},k),{data:{x:k.x-n,y:k.y-i}})})}}};var oh=function(r){return r===void 0&&(r={}),{name:"size",options:r,fn(t){return A(this,null,function*(){let{placement:n,rects:i,platform:s,elements:a}=t,G=Ms(r,t),{apply:o=()=>{}}=G,u=Xo(G,["apply"]),l=yield yl(t,u),c=Nn(n),d=Cs(n),f=As(n)==="y",{width:m,height:g}=i.floating,b,k;c==="top"||c==="bottom"?(b=c,k=d===((yield s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(k=c,b=d==="end"?"top":"bottom");let _=g-l[b],S=m-l[k],x=!t.middlewareData.shift,q=_,W=S;if(f){let B=m-l.left-l.right;W=d||x?Wi(S,B):B}else{let B=g-l.top-l.bottom;q=d||x?Wi(_,B):B}if(x&&!d){let B=jt(l.left,0),ge=jt(l.right,0),Pe=jt(l.top,0),$=jt(l.bottom,0);f?W=m-2*(B!==0||ge!==0?B+ge:jt(l.left,l.right)):q=g-2*(Pe!==0||$!==0?Pe+$:jt(l.top,l.bottom))}yield o(fe(K({},t),{availableWidth:W,availableHeight:q}));let ne=yield s.getDimensions(a.floating);return m!==ne.width||g!==ne.height?{reset:{rects:!0}}:{}})}}};function In(r){return lw(r)?(r.nodeName||"").toLowerCase():"#document"}function $t(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Fn(r){var e;return(e=(lw(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function lw(r){return r instanceof Node||r instanceof $t(r).Node}function an(r){return r instanceof Element||r instanceof $t(r).Element}function Wr(r){return r instanceof HTMLElement||r instanceof $t(r).HTMLElement}function uw(r){return typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof $t(r).ShadowRoot}function Ps(r){let{overflow:e,overflowX:t,overflowY:n,display:i}=er(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(i)}function cw(r){return["table","td","th"].includes(In(r))}function vl(r){let e=wl(),t=er(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 dw(r){let e=ji(r);for(;Wr(e)&&!Po(e);){if(vl(e))return e;e=ji(e)}return null}function wl(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Po(r){return["html","body","#document"].includes(In(r))}function er(r){return $t(r).getComputedStyle(r)}function No(r){return an(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function ji(r){if(In(r)==="html")return r;let e=r.assignedSlot||r.parentNode||uw(r)&&r.host||Fn(r);return uw(e)?e.host:e}function fw(r){let e=ji(r);return Po(e)?r.ownerDocument?r.ownerDocument.body:r.body:Wr(e)&&Ps(e)?e:fw(e)}function _l(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=fw(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),a=$t(i);return s?e.concat(a,a.visualViewport||[],Ps(i)?i:[],a.frameElement&&t?_l(a.frameElement):[]):e.concat(i,_l(i,[],t))}function hw(r){let e=er(r),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Wr(r),s=i?r.offsetWidth:t,a=i?r.offsetHeight:n,o=Ao(t)!==s||Ao(n)!==a;return o&&(t=s,n=a),{width:t,height:n,$:o}}function gw(r){return an(r)?r:r.contextElement}function Ns(r){let e=gw(r);if(!Wr(e))return Pn(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:s}=hw(e),a=(s?Ao(t.width):t.width)/n,o=(s?Ao(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var vI=Pn(0);function yw(r){let e=$t(r);return!wl()||!e.visualViewport?vI:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function wI(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==$t(r)?!1:e}function Io(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=r.getBoundingClientRect(),s=gw(r),a=Pn(1);e&&(n?an(n)&&(a=Ns(n)):a=Ns(r));let o=wI(s,t,n)?yw(s):Pn(0),u=(i.left+o.x)/a.x,l=(i.top+o.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(s){let f=$t(s),m=n&&an(n)?$t(n):n,g=f.frameElement;for(;g&&n&&m!==f;){let b=Ns(g),k=g.getBoundingClientRect(),_=er(g),S=k.left+(g.clientLeft+parseFloat(_.paddingLeft))*b.x,x=k.top+(g.clientTop+parseFloat(_.paddingTop))*b.y;u*=b.x,l*=b.y,c*=b.x,d*=b.y,u+=S,l+=x,g=$t(g).frameElement}}return qi({width:c,height:d,x:u,y:l})}function kI(r){let{rect:e,offsetParent:t,strategy:n}=r,i=Wr(t),s=Fn(t);if(t===s)return e;let a={scrollLeft:0,scrollTop:0},o=Pn(1),u=Pn(0);if((i||!i&&n!=="fixed")&&((In(t)!=="body"||Ps(s))&&(a=No(t)),Wr(t))){let l=Io(t);o=Ns(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 EI(r){return Array.from(r.getClientRects())}function Tw(r){return Io(Fn(r)).left+No(r).scrollLeft}function SI(r){let e=Fn(r),t=No(r),n=r.ownerDocument.body,i=jt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=jt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Tw(r),o=-t.scrollTop;return er(n).direction==="rtl"&&(a+=jt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function OI(r,e){let t=$t(r),n=Fn(r),i=t.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,u=0;if(i){s=i.width,a=i.height;let l=wl();(!l||l&&e==="fixed")&&(o=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:o,y:u}}function DI(r,e){let t=Io(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=Wr(r)?Ns(r):Pn(1),a=r.clientWidth*s.x,o=r.clientHeight*s.y,u=i*s.x,l=n*s.y;return{width:a,height:o,x:u,y:l}}function pw(r,e,t){let n;if(e==="viewport")n=OI(r,t);else if(e==="document")n=SI(Fn(r));else if(an(e))n=DI(e,t);else{let i=yw(r);n=fe(K({},e),{x:e.x-i.x,y:e.y-i.y})}return qi(n)}function bw(r,e){let t=ji(r);return t===e||!an(t)||Po(t)?!1:er(t).position==="fixed"||bw(t,e)}function xI(r,e){let t=e.get(r);if(t)return t;let n=_l(r,[],!1).filter(o=>an(o)&&In(o)!=="body"),i=null,s=er(r).position==="fixed",a=s?ji(r):r;for(;an(a)&&!Po(a);){let o=er(a),u=vl(a);!u&&o.position==="fixed"&&(i=null),(s?!u&&!i:!u&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ps(a)&&!u&&bw(r,a))?n=n.filter(c=>c!==a):i=o,a=ji(a)}return e.set(r,n),n}function RI(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r,a=[...t==="clippingAncestors"?xI(e,this._c):[].concat(t),n],o=a[0],u=a.reduce((l,c)=>{let d=pw(e,c,i);return l.top=jt(d.top,l.top),l.right=Wi(d.right,l.right),l.bottom=Wi(d.bottom,l.bottom),l.left=jt(d.left,l.left),l},pw(e,o,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function MI(r){return hw(r)}function CI(r,e,t){let n=Wr(e),i=Fn(e),s=t==="fixed",a=Io(r,!0,s,e),o={scrollLeft:0,scrollTop:0},u=Pn(0);if(n||!n&&!s)if((In(e)!=="body"||Ps(i))&&(o=No(e)),n){let l=Io(e,!0,s,e);u.x=l.x+e.clientLeft,u.y=l.y+e.clientTop}else i&&(u.x=Tw(i));return{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function mw(r,e){return!Wr(r)||er(r).position==="fixed"?null:e?e(r):r.offsetParent}function _w(r,e){let t=$t(r);if(!Wr(r))return t;let n=mw(r,e);for(;n&&cw(n)&&er(n).position==="static";)n=mw(n,e);return n&&(In(n)==="html"||In(n)==="body"&&er(n).position==="static"&&!vl(n))?t:n||dw(r)||t}var AI=function(r){return A(this,null,function*(){let{reference:e,floating:t,strategy:n}=r,i=this.getOffsetParent||_w,s=this.getDimensions;return{reference:CI(e,yield i(t),n),floating:K({x:0,y:0},yield s(t))}})};function PI(r){return er(r).direction==="rtl"}var NI={convertOffsetParentRelativeRectToViewportRelativeRect:kI,getDocumentElement:Fn,getClippingRect:RI,getOffsetParent:_w,getElementRects:AI,getClientRects:EI,getDimensions:MI,getScale:Ns,isElement:an,isRTL:PI};var uh=(r,e,t)=>{let n=new Map,i=K({platform:NI},t),s=fe(K({},i.platform),{_c:n});return ow(r,e,fe(K({},i),{platform:s}))};function vw(r,e,t){let n=r.slice();return n[5]=e[t],n}function ww(r,e,t){let n=r.slice();n[40]=e[t],n[43]=t;let i=n[17](n[40].taskLocation.path);return n[41]=i,n}function kw(r){let e,t,n,i=r[10],s=[];for(let a=0;a',d=le(),I(t,"class","task-dependency-name"),I(c,"type","button"),I(c,"class","task-dependency-delete"),I(e,"class","task-dependency")},m(k,_){ue(k,e,_),L(e,t),L(t,n),L(t,s),L(t,a),L(t,u),L(e,l),L(e,c),L(e,d),f||(m=[Ee(c,"click",g),Ee(e,"mouseenter",b)],f=!0)},p(k,_){r=k,_[0]&3&&i!==(i=r[5].status.symbol+"")&&br(s,i),_[0]&3&&o!==(o=Ai(r[5])+"")&&br(u,o)},d(k){k&&se(e),f=!1,vt(m)}}}function II(r){let e,t=gt(r[2],r[3])+"",n,i,s,a,o,u,l,c,d,f=r[10]&&r[10].length!==0&&kw(r),m=r[0][r[1]].length!==0&&Ow(r);return{c(){e=X("label"),n=le(),i=X("span"),s=X("input"),o=le(),f&&f.c(),u=le(),m&&m.c(),l=hl(),I(e,"for",r[1]),I(s,"accesskey",r[3]),I(s,"id",r[1]),I(s,"class","tasks-modal-dependency-input"),I(s,"type","text"),I(s,"placeholder",r[4]),Fi(()=>r[26].call(i))},m(g,b){ue(g,e,b),e.innerHTML=t,ue(g,n,b),ue(g,i,b),L(i,s),r[22](s),Wt(s,r[6]),a=Xv(i,r[26].bind(i)),ue(g,o,b),f&&f.m(g,b),ue(g,u,b),m&&m.m(g,b),ue(g,l,b),c||(d=[Ee(s,"input",r[23]),Ee(s,"keydown",r[24]),Ee(s,"focus",r[16]),Ee(s,"blur",r[25])],c=!0)},p(g,b){b[0]&12&&t!==(t=gt(g[2],g[3])+"")&&(e.innerHTML=t),b[0]&2&&I(e,"for",g[1]),b[0]&8&&I(s,"accesskey",g[3]),b[0]&2&&I(s,"id",g[1]),b[0]&16&&I(s,"placeholder",g[4]),b[0]&64&&s.value!==g[6]&&Wt(s,g[6]),g[10]&&g[10].length!==0?f?f.p(g,b):(f=kw(g),f.c(),f.m(u.parentNode,u)):f&&(f.d(1),f=null),g[0][g[1]].length!==0?m?m.p(g,b):(m=Ow(g),m.c(),m.m(l.parentNode,l)):m&&(m.d(1),m=null)},i:Ue,o:Ue,d(g){g&&se(e),g&&se(n),g&&se(i),r[22](null),a(),g&&se(o),f&&f.d(g),g&&se(u),m&&m.d(g),g&&se(l),c=!1,vt(d)}}}function FI(r,e,t){let{task:n}=e,{editableTask:i}=e,{allTasks:s}=e,{_onDescriptionKeyDown:a}=e,{type:o}=e,{labelText:u}=e,{accesskey:l}=e,{placeholder:c="Type to search..."}=e,d="",f=null,m=0,g,b=!1,k=!1,_,S;function x(v){t(0,i[o]=[...i[o],v],i),t(6,d=""),t(7,b=!1)}function q(v){t(0,i[o]=i[o].filter(R=>R!==v),i)}function W(v){var R;if(f!==null){switch(v.key){case"ArrowUp":v.preventDefault(),!!m&&m>0?t(11,m-=1):t(11,m=f.length-1);break;case"ArrowDown":v.preventDefault(),!!m&&m{R.style.left=`${N}px`,R.style.top=`${ie}px`})}function ge(v){return v===n.taskLocation.path?"":v}function Pe(v){return Ai(v)}function $(v,R){let N=v.createDiv();N.addClasses(["tooltip","pop-up"]),N.innerText=R,uh(v,N,{placement:"top",middleware:[Tl(-18),bl()]}).then(({x:ie,y:de})=>{N.style.left=`${ie}px`,N.style.top=`${de}px`}),v.addEventListener("mouseleave",()=>N.remove())}function j(v){$e[v?"unshift":"push"](()=>{_=v,t(8,_)})}function D(){d=this.value,t(6,d)}let Y=v=>W(v),F=()=>t(7,b=!1);function J(){g=this.clientWidth,t(12,g)}let p=(v,R)=>$(R.currentTarget,Pe(v)),h=(v,R)=>$(R.currentTarget,v),y=v=>x(v),T=v=>t(11,m=v);function w(v){$e[v?"unshift":"push"](()=>{S=v,t(9,S)})}let O=()=>t(11,m=null),M=v=>q(v),P=(v,R)=>$(R.currentTarget,Pe(v));return r.$$set=v=>{"task"in v&&t(5,n=v.task),"editableTask"in v&&t(0,i=v.editableTask),"allTasks"in v&&t(20,s=v.allTasks),"_onDescriptionKeyDown"in v&&t(21,a=v._onDescriptionKeyDown),"type"in v&&t(1,o=v.type),"labelText"in v&&t(2,u=v.labelText),"accesskey"in v&&t(3,l=v.accesskey),"placeholder"in v&&t(4,c=v.placeholder)},r.$$.update=()=>{if(r.$$.dirty[0]&768){e:B(_,S)}if(r.$$.dirty[0]&192){e:t(10,f=b?ne(d):null)}},[i,o,u,l,c,n,d,b,_,S,f,m,g,x,q,W,G,ge,Pe,$,s,a,j,D,Y,F,J,p,h,y,T,w,O,M,P]}var lh=class extends Tr{constructor(e){super(),sn(this,e,FI,II,nn,{task:5,editableTask:0,allTasks:20,_onDescriptionKeyDown:21,type:1,labelText:2,accesskey:3,placeholder:4},null,[-1,-1])}},ch=lh;var Lo=require("obsidian");var Fo,dh,fh,LI=["md"];function Sl(){return Mt.getLogger("tasks.File")}var xw=({metadataCache:r,vault:e,workspace:t})=>{Fo=r,dh=e,fh=t},vr=t=>A(void 0,[t],function*({originalTask:r,newTasks:e}){if(dh===void 0||Fo===void 0||fh===void 0){kl("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=Sl(),i="replaceTaskWithTasks()";cl(n,i,r),dl(n,i,e),yield Mw({originalTask:r,newTasks:e,vault:dh,metadataCache:Fo,workspace:fh,previousTries:0})});function kl(r){console.error(r),new Lo.Notice(r,15e3)}function Rw(r){console.warn(r),new Lo.Notice(r,1e4)}function UI(r){Sl().debug(r)}var ei=class extends Error{},El=class extends Error{},Mw=a=>A(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){let o=Sl();o.debug(`tryRepetitive after ${s} previous tries`);let u=()=>A(void 0,null,function*(){if(s>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. `;kl(c);return}let l=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${l}`),setTimeout(()=>A(void 0,null,function*(){yield Mw({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield Cw(r,t),f=[...d.slice(0,l),...e.map(m=>m.toFileLineString()),...d.slice(l+1)];yield t.modify(c,f.join(` `))}catch(l){if(l instanceof ei){l.message&&Rw(l.message),yield u();return}else if(l instanceof El){yield u();return}else l instanceof Error&&kl(l.message)}});function Cw(r,e){return A(this,null,function*(){if(Fo===void 0)throw new ei;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Lo.TFile))throw new ei(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!LI.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Fo.getFileCache(t);if(n==null||n===null)throw new ei(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new ei(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(` `),o=WI(r,a,i,UI);if(o===void 0)throw new El;return[o,t,a]})}function ph(r,e){return A(this,null,function*(){try{let[t,n,i]=yield Cw(r,e);return[t,n]}catch(t){t instanceof ei?t.message&&Rw(t.message):t instanceof Error&&kl(t.message)}})}function Aw(r,e){return rc.id===u);!l||a.push(l)}let o=t.filter(u=>u.dependsOn.includes(e.id));return new Is({addGlobalFilterOnSave:i,originalBlocking:o,description:n,status:e.status,priority:s,recurrenceRule:e.recurrence?e.recurrence.toText():"",onCompletion:e.onCompletion,createdDate:e.created.formatAsDate(),startDate:e.start.formatAsDate(),scheduledDate:e.scheduled.formatAsDate(),dueDate:e.due.formatAsDate(),doneDate:e.done.formatAsDate(),cancelledDate:e.cancelled.formatAsDate(),forwardOnly:!0,blockedBy:a,blocking:o})}applyEdits(e,t){return A(this,null,function*(){let n=this.description.trim();this.addGlobalFilterOnSave&&(n=ve.getInstance().prependTo(n));let i=Si(this.startDate,this.forwardOnly),s=Si(this.scheduledDate,this.forwardOnly),a=Si(this.dueDate,this.forwardOnly),o=Si(this.cancelledDate,this.forwardOnly),u=Si(this.createdDate,this.forwardOnly),l=Si(this.doneDate,this.forwardOnly),c=null;this.recurrenceRule&&(c=st.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new mr({startDate:i,scheduledDate:s,dueDate:a})}));let d=this.onCompletion,f=[];for(let S of this.blockedBy){let x=yield GI(S,t);f.push(x)}let m=e.id,g=[],b=[];(this.blocking.toString()!==this.originalBlocking.toString()||this.blocking.length!==0)&&(e.id===""&&(m=So(t.filter(S=>S.id!=="").map(S=>S.id))),g=this.originalBlocking.filter(S=>!this.blocking.includes(S)),b=this.blocking.filter(S=>!this.originalBlocking.includes(S)));let k=new ee(fe(K({},e),{description:n,status:e.status,priority:Xt.priorityValue(this.priority),onCompletion:d,recurrence:c,startDate:i,scheduledDate:s,dueDate:a,doneDate:l,createdDate:u,cancelledDate:o,dependsOn:f.map(S=>S.id),id:m}));for(let S of g){let x=Rv(S,k);yield vr({originalTask:S,newTasks:x})}for(let S of b){let x=xv(S,k);yield vr({originalTask:S,newTasks:x})}let _=this.inferTodaysDate(this.status.type,l,o);return k.handleNewStatusWithRecurrenceInUsersOrder(this.status,_)})}inferTodaysDate(e,t,n){return e==="DONE"&&t!==null?t:e==="CANCELLED"&&n!==null?n:window.moment()}parseAndValidateRecurrence(){var t;if(!this.recurrenceRule)return{parsedRecurrence:"not recurring",isRecurrenceValid:!0};let e=(t=st.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new mr({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:t.toText();return e?this.startDate||this.scheduledDate||this.dueDate?{parsedRecurrence:e,isRecurrenceValid:!0}:{parsedRecurrence:"due, scheduled or start date required",isRecurrenceValid:!1}:{parsedRecurrence:"invalid recurrence rule",isRecurrenceValid:!1}}};function GI(r,e){return A(this,null,function*(){if(r.id!=="")return r;let t=e.filter(i=>i.id!==""),n=il(r,t.map(i=>i.id));return yield vr({originalTask:r,newTasks:n}),n})}function YI(r){let e,t=gt("Recurs",r[2])+"",n,i,s,a,o,u,l,c,d;return{c(){e=X("label"),n=le(),i=X("input"),s=le(),a=X("code"),o=Re(r[4]),u=le(),l=new xs(!1),I(e,"for","recurrence"),I(i,"id","recurrence"),I(i,"type","text"),I(i,"class","tasks-modal-date-input"),I(i,"placeholder","Try 'every day when done'"),I(i,"accesskey",r[2]),An(i,"tasks-modal-error",!r[1]),l.a=null,I(a,"class","tasks-modal-parsed-date")},m(f,m){ue(f,e,m),e.innerHTML=t,ue(f,n,m),ue(f,i,m),Wt(i,r[0].recurrenceRule),ue(f,s,m),ue(f,a,m),L(a,o),L(a,u),l.m(r[3],a),c||(d=Ee(i,"input",r[5]),c=!0)},p(f,[m]){m&4&&t!==(t=gt("Recurs",f[2])+"")&&(e.innerHTML=t),m&4&&I(i,"accesskey",f[2]),m&1&&i.value!==f[0].recurrenceRule&&Wt(i,f[0].recurrenceRule),m&2&&An(i,"tasks-modal-error",!f[1]),m&8&&l.p(f[3])},i:Ue,o:Ue,d(f){f&&se(e),f&&se(n),f&&se(i),f&&se(s),f&&se(a),c=!1,d()}}}function BI(r,e,t){let{editableTask:n}=e,{isRecurrenceValid:i}=e,{accesskey:s}=e,a,{recurrenceSymbol:o}=Fr.tasksPluginEmoji.taskSerializer.symbols;function u(){n.recurrenceRule=this.value,t(0,n)}return r.$$set=l=>{"editableTask"in l&&t(0,n=l.editableTask),"isRecurrenceValid"in l&&t(1,i=l.isRecurrenceValid),"accesskey"in l&&t(2,s=l.accesskey)},r.$$.update=()=>{if(r.$$.dirty&1){e:t(3,{parsedRecurrence:a,isRecurrenceValid:i}=n.parseAndValidateRecurrence(),a,(t(1,i),t(0,n)))}},[n,i,s,a,o,u]}var mh=class extends Tr{constructor(e){super(),sn(this,e,BI,YI,nn,{editableTask:0,isRecurrenceValid:1,accesskey:2})}},Pw=mh;function Nw(r,e,t){let n=r.slice();return n[7]=e[t],n}function Iw(r){let e,t=r[7].name+"",n,i,s=r[7].symbol+"",a,o,u;return{c(){e=X("option"),n=Re(t),i=Re(" ["),a=Re(s),o=Re("]"),e.__value=u=r[7].symbol,e.value=e.__value},m(l,c){ue(l,e,c),L(e,n),L(e,i),L(e,a),L(e,o)},p(l,c){c&1&&t!==(t=l[7].name+"")&&br(n,t),c&1&&s!==(s=l[7].symbol+"")&&br(a,s),c&1&&u!==(u=l[7].symbol)&&(e.__value=u,e.value=e.__value)},d(l){l&&se(e)}}}function HI(r){let e,t=gt("Status",r[1])+"",n,i,s,a,o=r[0],u=[];for(let l=0;lr[6].call(i))},m(l,c){ue(l,e,c),e.innerHTML=t,ue(l,n,c),ue(l,i,c);for(let d=0;d{let c=s.find(f=>f.symbol===o);if(c)t(4,i.status=c,i);else{console.log(`Error in EditTask: cannot find status with symbol ${o}`);return}let d=n.handleNewStatus(c).pop();d&&(t(4,i.doneDate=Fw(i.doneDate,c.isCompleted(),d.done),i),t(4,i.cancelledDate=Fw(i.cancelledDate,c.isCancelled(),d.cancelled),i))};function l(){o=Qv(this),t(2,o),t(0,s)}return r.$$set=c=>{"task"in c&&t(5,n=c.task),"editableTask"in c&&t(4,i=c.editableTask),"statusOptions"in c&&t(0,s=c.statusOptions),"accesskey"in c&&t(1,a=c.accesskey)},[s,a,o,u,i,n,l]}var hh=class extends Tr{constructor(e){super(),sn(this,e,VI,HI,nn,{task:5,editableTask:4,statusOptions:0,accesskey:1})}},Lw=hh;function Uw(r,e,t){let n=r.slice();return n[52]=e[t].value,n[53]=e[t].label,n[54]=e[t].symbol,n[55]=e[t].accessKey,n[56]=e[t].accessKeyIndex,n}function zI(r){let e,t=r[53]+"",n;return{c(){e=X("span"),n=Re(t)},m(i,s){ue(i,e,s),L(e,n)},p:Ue,d(i){i&&se(e)}}}function KI(r){let e,t=r[53].substring(0,r[56])+"",n,i,s=r[53].substring(r[56],r[56]+1)+"",a,o,u=r[53].substring(r[56]+1)+"",l;return{c(){e=X("span"),n=Re(t),i=X("span"),a=Re(s),o=X("span"),l=Re(u),I(i,"class","accesskey")},m(c,d){ue(c,e,d),L(e,n),ue(c,i,d),L(i,a),ue(c,o,d),L(o,l)},p:Ue,d(c){c&&se(e),c&&se(i),c&&se(o)}}}function QI(r){let e,t=r[54]+"",n;return{c(){e=X("span"),n=Re(t)},m(i,s){ue(i,e,s),L(e,n)},p:Ue,d(i){i&&se(e)}}}function Ww(r){let e,t,n,i,s,a,o,u,l=r[54]&&r[54].charCodeAt(0)>=256,c,d,f,m,g;function b(x,q){return x[11]?KI:zI}let k=b(r,[-1,-1]),_=k(r),S=l&&QI(r);return f=Kv(r[35][0]),{c(){e=X("div"),t=X("input"),a=le(),o=X("label"),_.c(),u=le(),S&&S.c(),d=le(),I(t,"type","radio"),I(t,"id",n="priority-"+r[52]),t.__value=i=r[52],t.value=t.__value,I(t,"accesskey",s=r[15](r[55])),I(o,"for",c="priority-"+r[52]),I(e,"class","task-modal-priority-option-container"),f.p(t)},m(x,q){ue(x,e,q),L(e,t),t.checked=t.__value===r[3].priority,L(e,a),L(e,o),_.m(o,null),L(o,u),S&&S.m(o,null),L(e,d),m||(g=Ee(t,"change",r[34]),m=!0)},p(x,q){q[0]&32768&&s!==(s=x[15](x[55]))&&I(t,"accesskey",s),q[0]&8&&(t.checked=t.__value===x[3].priority),k===(k=b(x,q))&&_?_.p(x,q):(_.d(1),_=k(x),_&&(_.c(),_.m(o,u))),l&&S.p(x,q)},d(x){x&&se(e),_.d(),S&&S.d(),f.r(),m=!1,g()}}}function XI(r){let e;return{c(){e=X("div"),e.innerHTML="Blocking and blocked by fields are disabled when vault tasks is empty"},m(t,n){ue(t,e,n)},p:Ue,i:Ue,o:Ue,d(t){t&&se(e)}}}function ZI(r){let e,t,n,i;return e=new ch({props:{type:"blockedBy",labelText:"Before this",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[24],accesskey:r[15]("b"),placeholder:"Search for tasks that the task being edited depends on..."}}),n=new ch({props:{type:"blocking",labelText:"After this",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[24],accesskey:r[15]("e"),placeholder:"Search for tasks that depend on this task being done..."}}),{c(){Ur(e.$$.fragment),t=le(),Ur(n.$$.fragment)},m(s,a){_r(e,s,a),ue(s,t,a),_r(n,s,a),i=!0},p(s,a){let o={};a[0]&1&&(o.task=s[0]),a[0]&8&&(o.editableTask=s[3]),a[0]&4&&(o.allTasks=s[2]),a[0]&32768&&(o.accesskey=s[15]("b")),e.$set(o);let u={};a[0]&1&&(u.task=s[0]),a[0]&8&&(u.editableTask=s[3]),a[0]&4&&(u.allTasks=s[2]),a[0]&32768&&(u.accesskey=s[15]("e")),n.$set(u)},i(s){i||(qt(e.$$.fragment,s),qt(n.$$.fragment,s),i=!0)},o(s){Zt(e.$$.fragment,s),Zt(n.$$.fragment,s),i=!1},d(s){Jt(e,s),s&&se(t),Jt(n,s)}}}function JI(r){let e,t,n,i=gt("Description",r[15]("t"))+"",s,a,o,u,l,c,d,f,m,g,b,k,_,S,x,q,W,ne,G,B,ge,Pe,$,j,D,Y,F,J,p,h,y=gt("Only future dates:",r[15]("f"))+"",T,w,O,M,P,v,R,N,ie,de,me,Ne,Ce,It,pn,Hr,ot,St,Ge,z,Or,kc,Ec,Xh,Dr,Sc,Oc,Zh,Xi,pi,Jh,Ko,eg,sa,Vr,Dc,tg,Zi=r[22],Ot=[];for(let C=0;CAt(S,"isRecurrenceValid",aE));function oE(C){r[37](C)}function uE(C){r[38](C)}let xc={id:"due",dateSymbol:r[18],forwardOnly:r[3].forwardOnly,accesskey:r[15]("d")};r[3].dueDate!==void 0&&(xc.date=r[3].dueDate),r[7]!==void 0&&(xc.isDateValid=r[7]),W=new Ui({props:xc}),$e.push(()=>At(W,"date",oE)),$e.push(()=>At(W,"isDateValid",uE)),W.$on("open",r[27]),W.$on("close",r[28]);function lE(C){r[39](C)}function cE(C){r[40](C)}let Rc={id:"scheduled",dateSymbol:r[17],forwardOnly:r[3].forwardOnly,accesskey:r[15]("s")};r[3].scheduledDate!==void 0&&(Rc.date=r[3].scheduledDate),r[8]!==void 0&&(Rc.isDateValid=r[8]),ge=new Ui({props:Rc}),$e.push(()=>At(ge,"date",lE)),$e.push(()=>At(ge,"isDateValid",cE)),ge.$on("open",r[27]),ge.$on("close",r[28]);function dE(C){r[41](C)}function fE(C){r[42](C)}let Mc={id:"start",dateSymbol:r[16],forwardOnly:r[3].forwardOnly,accesskey:r[15]("a")};r[3].startDate!==void 0&&(Mc.date=r[3].startDate),r[9]!==void 0&&(Mc.isDateValid=r[9]),D=new Ui({props:Mc}),$e.push(()=>At(D,"date",dE)),$e.push(()=>At(D,"isDateValid",fE)),D.$on("open",r[27]),D.$on("close",r[28]);let ng=[ZI,XI],$n=[];function ig(C,te){return C[2].length>0&&C[14]?0:1}N=ig(r,[-1,-1]),ie=$n[N]=ng[N](r);function pE(C){r[44](C)}let sg={task:r[0],statusOptions:r[1],accesskey:r[15]("u")};r[3]!==void 0&&(sg.editableTask=r[3]),It=new Lw({props:sg}),$e.push(()=>At(It,"editableTask",pE));function mE(C){r[45](C)}function hE(C){r[46](C)}let Cc={id:"created",dateSymbol:r[20],forwardOnly:r[3].forwardOnly,accesskey:r[15]("c")};r[3].createdDate!==void 0&&(Cc.date=r[3].createdDate),r[5]!==void 0&&(Cc.isDateValid=r[5]),ot=new Ui({props:Cc}),$e.push(()=>At(ot,"date",mE)),$e.push(()=>At(ot,"isDateValid",hE)),ot.$on("open",r[27]),ot.$on("close",r[28]);function gE(C){r[47](C)}function yE(C){r[48](C)}let Ac={id:"done",dateSymbol:r[21],forwardOnly:r[3].forwardOnly,accesskey:r[15]("x")};r[3].doneDate!==void 0&&(Ac.date=r[3].doneDate),r[6]!==void 0&&(Ac.isDateValid=r[6]),Or=new Ui({props:Ac}),$e.push(()=>At(Or,"date",gE)),$e.push(()=>At(Or,"isDateValid",yE)),Or.$on("open",r[27]),Or.$on("close",r[28]);function TE(C){r[49](C)}function bE(C){r[50](C)}let Pc={id:"cancelled",dateSymbol:r[19],forwardOnly:r[3].forwardOnly,accesskey:r[15]("-")};return r[3].cancelledDate!==void 0&&(Pc.date=r[3].cancelledDate),r[4]!==void 0&&(Pc.isDateValid=r[4]),Dr=new Ui({props:Pc}),$e.push(()=>At(Dr,"date",TE)),$e.push(()=>At(Dr,"isDateValid",bE)),Dr.$on("open",r[27]),Dr.$on("close",r[28]),{c(){e=X("form"),t=X("section"),n=X("label"),s=le(),a=X("textarea"),u=le(),l=X("section"),c=X("label"),d=Re("Priority"),m=le();for(let C=0;Cx=!1)),S.$set(mn);let aa={};te[0]&8&&(aa.forwardOnly=C[3].forwardOnly),te[0]&32768&&(aa.accesskey=C[15]("d")),!ne&&te[0]&8&&(ne=!0,aa.date=C[3].dueDate,Ct(()=>ne=!1)),!G&&te[0]&128&&(G=!0,aa.isDateValid=C[7],Ct(()=>G=!1)),W.$set(aa);let oa={};te[0]&8&&(oa.forwardOnly=C[3].forwardOnly),te[0]&32768&&(oa.accesskey=C[15]("s")),!Pe&&te[0]&8&&(Pe=!0,oa.date=C[3].scheduledDate,Ct(()=>Pe=!1)),!$&&te[0]&256&&($=!0,oa.isDateValid=C[8],Ct(()=>$=!1)),ge.$set(oa);let ua={};te[0]&8&&(ua.forwardOnly=C[3].forwardOnly),te[0]&32768&&(ua.accesskey=C[15]("a")),!Y&&te[0]&8&&(Y=!0,ua.date=C[3].startDate,Ct(()=>Y=!1)),!F&&te[0]&512&&(F=!0,ua.isDateValid=C[9],Ct(()=>F=!1)),D.$set(ua),(!Vr||te[0]&32768)&&y!==(y=gt("Only future dates:",C[15]("f"))+"")&&(h.innerHTML=y),(!Vr||te[0]&32768&&O!==(O=C[15]("f")))&&I(w,"accesskey",O),te[0]&8&&(w.checked=C[3].forwardOnly);let Nc=N;N=ig(C,te),N===Nc?$n[N].p(C,te):(Jv(),Zt($n[Nc],1,1,()=>{$n[Nc]=null}),ew(),ie=$n[N],ie?ie.p(C,te):(ie=$n[N]=ng[N](C),ie.c()),qt(ie,1),ie.m(R,null));let la={};te[0]&1&&(la.task=C[0]),te[0]&2&&(la.statusOptions=C[1]),te[0]&32768&&(la.accesskey=C[15]("u")),!pn&&te[0]&8&&(pn=!0,la.editableTask=C[3],Ct(()=>pn=!1)),It.$set(la);let ca={};te[0]&8&&(ca.forwardOnly=C[3].forwardOnly),te[0]&32768&&(ca.accesskey=C[15]("c")),!St&&te[0]&8&&(St=!0,ca.date=C[3].createdDate,Ct(()=>St=!1)),!Ge&&te[0]&32&&(Ge=!0,ca.isDateValid=C[5],Ct(()=>Ge=!1)),ot.$set(ca);let da={};te[0]&8&&(da.forwardOnly=C[3].forwardOnly),te[0]&32768&&(da.accesskey=C[15]("x")),!kc&&te[0]&8&&(kc=!0,da.date=C[3].doneDate,Ct(()=>kc=!1)),!Ec&&te[0]&64&&(Ec=!0,da.isDateValid=C[6],Ct(()=>Ec=!1)),Or.$set(da);let fa={};te[0]&8&&(fa.forwardOnly=C[3].forwardOnly),te[0]&32768&&(fa.accesskey=C[15]("-")),!Sc&&te[0]&8&&(Sc=!0,fa.date=C[3].cancelledDate,Ct(()=>Sc=!1)),!Oc&&te[0]&16&&(Oc=!0,fa.isDateValid=C[4],Ct(()=>Oc=!1)),Dr.$set(fa),(!Vr||te[0]&8192&&Ko!==(Ko=!C[13]))&&(pi.disabled=Ko)},i(C){Vr||(qt(S.$$.fragment,C),qt(W.$$.fragment,C),qt(ge.$$.fragment,C),qt(D.$$.fragment,C),qt(ie),qt(It.$$.fragment,C),qt(ot.$$.fragment,C),qt(Or.$$.fragment,C),qt(Dr.$$.fragment,C),Vr=!0)},o(C){Zt(S.$$.fragment,C),Zt(W.$$.fragment,C),Zt(ge.$$.fragment,C),Zt(D.$$.fragment,C),Zt(ie),Zt(It.$$.fragment,C),Zt(ot.$$.fragment,C),Zt(Or.$$.fragment,C),Zt(Dr.$$.fragment,C),Vr=!1},d(C){C&&se(e),r[33](null),Li(Ot,C),Jt(S),Jt(W),Jt(ge),Jt(D),$n[N].d(),Jt(It),Jt(ot),Jt(Or),Jt(Dr),Dc=!1,vt(tg)}}}function eF(r,e,t){let n,{task:i}=e,{onSubmit:s}=e,{statusOptions:a}=e,{allTasks:o}=e,{modal:u=null}=e,{prioritySymbols:l,startDateSymbol:c,scheduledDateSymbol:d,dueDateSymbol:f,cancelledDateSymbol:m,createdDateSymbol:g,doneDateSymbol:b}=Fr.tasksPluginEmoji.taskSerializer.symbols,k,_=Is.fromTask(i,o),S=!0,x=!0,q=!0,W=!0,ne=!0,G=!0,B=!0,ge=!0,Pe=!0,$=!0,j=!1,D=[{value:"lowest",label:"Lowest",symbol:l.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:l.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:l.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:l.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:l.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:l.Highest,accessKey:"i",accessKeyIndex:1}];eh(()=>{let{provideAccessKeys:z}=Q();t(11,Pe=z),t(14,j=!0),setTimeout(()=>{k.focus()},10)});let Y=()=>{s([])},F=z=>{z.key==="Enter"&&(z.preventDefault(),$&&p())},J=()=>{setTimeout(()=>{t(3,_.description=_.description.replace(/[\r\n]+/g," "),_)},0)},p=()=>tw(void 0,void 0,void 0,function*(){let z=yield _.applyEdits(i,o);s(z)});function h(z){u&&u.setActiveFlatpickrInstance(z.detail.instance)}function y(){u&&u.clearActiveFlatpickrInstance()}let T=[[]];function w(){_.description=this.value,t(3,_)}function O(z){$e[z?"unshift":"push"](()=>{k=z,t(12,k)})}function M(){_.priority=this.__value,t(3,_)}function P(z){ge=z,t(10,ge)}function v(z){r.$$.not_equal(_.dueDate,z)&&(_.dueDate=z,t(3,_))}function R(z){ne=z,t(7,ne)}function N(z){r.$$.not_equal(_.scheduledDate,z)&&(_.scheduledDate=z,t(3,_))}function ie(z){G=z,t(8,G)}function de(z){r.$$.not_equal(_.startDate,z)&&(_.startDate=z,t(3,_))}function me(z){B=z,t(9,B)}function Ne(){_.forwardOnly=this.checked,t(3,_)}function Ce(z){_=z,t(3,_)}function It(z){r.$$.not_equal(_.createdDate,z)&&(_.createdDate=z,t(3,_))}function pn(z){q=z,t(5,q)}function Hr(z){r.$$.not_equal(_.doneDate,z)&&(_.doneDate=z,t(3,_))}function ot(z){W=z,t(6,W)}function St(z){r.$$.not_equal(_.cancelledDate,z)&&(_.cancelledDate=z,t(3,_))}function Ge(z){x=z,t(4,x)}return r.$$set=z=>{"task"in z&&t(0,i=z.task),"onSubmit"in z&&t(29,s=z.onSubmit),"statusOptions"in z&&t(1,a=z.statusOptions),"allTasks"in z&&t(2,o=z.allTasks),"modal"in z&&t(30,u=z.modal)},r.$$.update=()=>{if(r.$$.dirty[0]&2048){e:t(15,n=z=>Pe?z:null)}if(r.$$.dirty[0]&8){e:t(31,S=_.description.trim()!=="")}if(r.$$.dirty[0]&2032|r.$$.dirty[1]&1){e:t(13,$=ne&&ge&&G&&B&&S&&x&&q&&W)}},[i,a,o,_,x,q,W,ne,G,B,ge,Pe,k,$,j,n,c,d,f,m,g,b,D,Y,F,J,p,h,y,s,u,S,w,O,M,T,P,v,R,N,ie,de,me,Ne,Ce,It,pn,Hr,ot,St,Ge]}var gh=class extends Tr{constructor(e){super(),sn(this,e,eF,JI,nn,{task:0,onSubmit:29,statusOptions:1,allTasks:2,modal:30},null,[-1,-1])}},qw=gh;var ti=class extends jw.Modal{constructor({app:t,task:n,onSubmit:i,allTasks:s}){super(t);this.activeFlatpickrInstance=null;this.task=n,this.allTasks=s,this.onSubmit=a=>{this.activeFlatpickrInstance||(a.length&&i(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 qw({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit,allTasks:this.allTasks,modal:this}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=xe.getInstance().registeredStatuses;return xe.getInstance().bySymbol(this.task.status.symbol)===re.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}onEscapeKey(){var t;(t=this.activeFlatpickrInstance)!=null&&t.isOpen?(this.activeFlatpickrInstance.close(),this.activeFlatpickrInstance=null):this.close()}setActiveFlatpickrInstance(t){this.activeFlatpickrInstance=t}clearActiveFlatpickrInstance(){this.activeFlatpickrInstance=null}};function tF(){let{setCreatedDate:r}=Q();return r?window.moment():null}function rF(r){let{setCreatedDate:e}=Q();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!ve.getInstance().isEmpty(),i=!ve.getInstance().includedIn(r.description);return t||n&&i}var Ol=({line:r,path:e})=>{var f,m;let t=ee.parseTaskSignifiers(r,ht.fromUnknownPosition(new ut(e)),_t.fromPath(e)),n=tF();if(t!==null)return rF(t)?new ee(fe(K({},t),{createdDate:n})):t;let i=r.match(Z.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new ee({status:re.TODO,description:"",taskLocation:ht.fromUnknownPosition(new ut(e)),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,onCompletion:"",dependsOn:[],id:"",blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(f=i[2])!=null?f:"-",o=(m=i[4])!=null?m:" ",u=xe.getInstance().bySymbolOrCreate(o),l=i[5],c=r.match(Z.blockLinkRegex),d=c!==null?c[0]:"";return d!==""&&(l=l.replace(Z.blockLinkRegex,"")),new ee({status:u,description:l,taskLocation:ht.fromUnknownPosition(new ut(e)),indentation:s,listMarker:a,blockLink:d,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,onCompletion:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1,id:"",dependsOn:[]})};var $w=(r,e,t,n,i)=>{var f;if(r)return t instanceof yh.MarkdownView;if(!(t instanceof yh.MarkdownView))return;let s=(f=t.file)==null?void 0:f.path;if(s===void 0)return;let o=e.getCursor().line,u=e.getLine(o),l=Ol({line:u,path:s}),c=m=>{let g=_t.removeInferredStatusIfNeeded(l,m).map(b=>b.toFileLineString()).join(` `);e.setLine(o,g)};new ti({app:n,task:l,onSubmit:c,allTasks:i}).open()};var Th=require("obsidian");var Gw=(r,e,t)=>{var u;if(r)return t instanceof Th.MarkdownView;if(!(t instanceof Th.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let i=e.getCursor(),s=i.line,a=e.getLine(s),o=bh(a,n);e.setLine(s,o.text),e.setCursor(nF(i,o))},bh=(r,e)=>{let t=ee.fromLine({line:r,taskLocation:ht.fromUnknownPosition(new ut(e)),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join(` `),moveTo:{line:n.length-1}}}else{let n=r.match(Z.taskRegex);if(n!==null){let i=n[3],a=xe.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(Z.taskRegex,`$1- [${a}] $4`)}}else if(Z.listItemRegex.test(r)){let i=r.replace(Z.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(Z.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},nF=(r,e)=>{var s;let t={line:0,ch:r.ch},n=K(K({},t),(s=e.moveTo)!=null?s:{}),i=e.text.split(` `)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var Dl=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,i)=>$w(t,n,i,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:Gw})}};var ri=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.hideTree=!0;this.shortMode=!1;this.explainQuery=!1}};function $i(r,e){let t=`Error: ${r}. The error message was: `,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var iF=Object.prototype.toString,Ls=Array.isArray||function(e){return iF.call(e)==="[object Array]"};function vh(r){return typeof r=="function"}function sF(r){return Ls(r)?"array":typeof r}function _h(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Yw(r,e){return r!=null&&typeof r=="object"&&e in r}function aF(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var oF=RegExp.prototype.test;function uF(r,e){return oF.call(r,e)}var lF=/\S/;function cF(r){return!uF(lF,r)}var dF={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function fF(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return dF[t]})}var pF=/\s*/,mF=/\s+/,Bw=/\s*=/,hF=/\s*\}/,gF=/#|\^|\/|>|\{|&|=|!/;function yF(r,e){if(!r)return[];var t=!1,n=[],i=[],s=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,f,m;function g(B){if(typeof B=="string"&&(B=B.split(mF,2)),!Ls(B)||B.length!==2)throw new Error("Invalid tags: "+B);d=new RegExp(_h(B[0])+"\\s*"),f=new RegExp("\\s*"+_h(B[1])),m=new RegExp("\\s*"+_h("}"+B[1]))}g(e||wr.tags);for(var b=new Wo(r),k,_,S,x,q,W;!b.eos();){if(k=b.pos,S=b.scanUntil(d),S)for(var ne=0,G=S.length;ne"?q=[_,S,k,b.pos,u,l,t]:q=[_,S,k,b.pos],l++,i.push(q),_==="#"||_==="^")n.push(q);else if(_==="/"){if(W=n.pop(),!W)throw new Error('Unopened section "'+S+'" at '+k);if(W[1]!==S)throw new Error('Unclosed section "'+W[1]+'" at '+k)}else _==="name"||_==="{"||_==="&"?o=!0:_==="="&&g(S)}if(c(),W=n.pop(),W)throw new Error('Unclosed section "'+W[1]+'" at '+b.pos);return bF(TF(i))}function TF(r){for(var e=[],t,n,i=0,s=r.length;i0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function Wo(r){this.string=r,this.tail=r,this.pos=0}Wo.prototype.eos=function(){return this.tail===""};Wo.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};Wo.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 Fs(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Fs.prototype.push=function(e){return new Fs(e,this)};Fs.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,s,a,o,u=!1;i;){if(e.indexOf(".")>0)for(s=i.view,a=e.split("."),o=0;s!=null&&o"?l=this.renderPartial(o,t,n,s):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,s):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Pt.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(f){return a.render(f,t,n,s)}if(!!u){if(Ls(u))for(var c=0,d=u.length;c0||!n)&&(s[a]=i+s[a]);return s.join(` `)};Pt.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=vh(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 d=this.parse(c,s);return this.renderTokens(d,t,n,c,i)}}};Pt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Pt.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||wr.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===wr.escape?String(s):i(s)};Pt.prototype.rawValue=function(e){return e[1]};Pt.prototype.getConfigTags=function(e){return Ls(e)?e:e&&typeof e=="object"?e.tags:void 0};Pt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Ls(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){Uo.templateCache=r},get templateCache(){return Uo.templateCache}},Uo=new Pt;wr.clearCache=function(){return Uo.clearCache()};wr.parse=function(e,t){return Uo.parse(e,t)};wr.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+sF(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Uo.render(e,t,n,i)};wr.escape=fF;wr.Scanner=Wo;wr.Context=Fs;wr.Writer=Pt;var wh=wr;var Qw=ma(Kw());function Xw(r,e){wh.escape=function(t){return t};try{return wh.render(r,(0,Qw.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 Zw(r){return Eh(r,[])}function Eh(r,e){return{query:{file:r,allTasks:e}}}var Us=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(t=>t.explainFilterIndented(this.indentation)).join(` `)}explainGroups(e){return e.grouping.length===0?this.indent(`No grouping instructions supplied. `):e.grouping.map(t=>this.indentation+t.instruction).join(` `)+` `}explainSorters(e){return e.sorting.length===0?this.indent(`No sorting instructions supplied. `):e.sorting.map(t=>this.indentation+t.instruction).join(` `)+` `}explainQueryLimits(e){function t(i){let s=`At most ${i} task`;return i!==1&&(s+="s"),s}let n=[];if(e.limit!==void 0){let i=t(e.limit)+`. `;n.push(this.indent(i))}if(e.taskGroupLimit!==void 0){let i=t(e.taskGroupLimit)+` per group (if any "group by" options are supplied). `;n.push(this.indent(i))}return n.join(` `)}explainDebugSettings(){let e="",{debugSettings:t}=Q();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 Oe=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 Oe("None of",e,"NOT")}static booleanXor(e){return new Oe("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 i=0;ithis.matches(t))}};var qs=class extends Ws{constructor(t){super();this.stringToFind=t}matches(t){return qs.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Oe(t)}};var ni=class extends Ws{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,i=t.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new ni(s)}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 i=_F(t,"using regex: ",this.regexAsString());return new Oe(i)}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 _F(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return`${e.padEnd(s)}${t}`}var qr=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.comparator=qr.maybeReverse(i,n)}static maybeReverse(e,t){return e?qr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n,i)=>e(t,n,i)*-1}};var ii=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.grouper=n,this.reverse=i}};var Se=class{canCreateFilterForLine(e){return Se.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 Zn(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=Se.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 qr(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=Se.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 ii(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Ln=class{constructor(e,t){this._rawInstruction=e,this._anyContinuationLinesRemoved=t.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(e){this._anyPlaceholdersExpanded=e}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(e){function t(a,o){o!==a&&(s+=` => ${e}${o}`)}let n=this._rawInstruction.trim(),i=n.split(` `).join(` `+e),s=`${e}${i}`;return this._rawInstruction.includes(` `)&&(s+=` `+e),t(n,this._anyContinuationLinesRemoved),t(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var wt=class{constructor(e,t,n){this._statement=new Ln(e,e),this.explanation=n,this.filterFunction=t}get statement(){return this._statement}setStatement(e){this._statement=e}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(e){let t=this._statement.explainStatement(e);return this.onlyNeedsOneLineExplanation()?`${t} `:`${t} => ${this.explanation.asString(e+" ")} `}simulateExplainFilter(){return this.onlyNeedsOneLineExplanation()?this.explanation:new Oe(this.instruction+" =>",[this.explanation])}onlyNeedsOneLineExplanation(){return this.explanation.asString("")===this.instruction}};var on=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 on(e);return n._queryComponent=t,n}static fromError(e,t){let n=new on(e);return n._error=t,n}};var ae=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 ae(on.fromObject(e.instruction,e))}static fromError(e,t){return new ae(on.fromError(e,t))}};var Ie=class extends Se{createFilterOrErrorMessage(e){let t=Se.getMatch(this.filterRegExp(),e);if(t===null)return ae.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),i=t[2],s=null;if(n.includes("include"))s=new qs(i);else if(n.includes("regex")){try{s=ni.validateAndConstruct(i)}catch(u){let l=$i("Parsing regular expression",u)+` ${ni.helpMessage()}`;return ae.fromError(e,l)}if(s===null)return ae.fromError(e,`Invalid instruction: '${e}' ${ni.helpMessage()}`)}if(s===null)return ae.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new wt(e,this.getFilter(s,a),s.explanation(e));return ae.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 i=e.matches(this.value(n));return t?!i:i}}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 Gi=class extends Ie{fieldName(){return"description"}value(e){return ve.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Gi.cleanDescription(e.description),i=Gi.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=ve.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let i=n[1];e=i.substring(i.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 xl=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 Rl=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?ae.fromFilter(new wt(e,this._filter,new Oe(e))):ae.fromError(e,`do not understand filter: ${e}`)}};var Gt=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Rl(e,t))}canCreateFilterForLine(e){return this._filters.some(t=>t.canCreateFilterForLine(e))}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.isValid())return n}return ae.fromError(e,`do not understand filter: ${e}`)}};var at=class extends Se{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Gt,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var f;let n=this.checkForUnexpandedTemplateText(t);if(n)return ae.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.isValid())return i;let s=Se.getMatch(this.filterRegExp(),t);if(s===null)return ae.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(f=s[2])==null?void 0:f.toLowerCase(),u=s[3],l=zt.parseDateRange(u);if(!l.isValid()){let m=zt.parseDate(a);m.isValid()&&(l=new xt(m,m))}if(!l.isValid())return ae.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=at.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return ae.fromFilter(new wt(t,c,d))}buildFilterFunction(t,n){let i;switch(t){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(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,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=s.start.format(o);break;case"after":case"on or before":u=s.end.format(o);break;case"in or before":a="on or before",u=s.end.format(o);break;case"in or after":a="on or after",u=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${t} date is between:`,d=[new Oe(`${s.start.format(o)} and`),new Oe(`${s.end.format(o)} inclusive`)];return i&&d.push(new Oe(`OR no ${t} date`)),new Oe(c,d)}a="on",u=s.start.format(o);break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Oe(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>pr(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 xl().findUnexpandedDateText(t)}};var Ml=class extends at{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Cl=class extends at{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var js=class extends at{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var kr=class extends Se{constructor(){super(...arguments);this._filters=new Gt}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Al=class extends kr{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 qo=class extends on{};function Sh(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,i=e&&new Function(...t,n);return i instanceof Function?qo.fromObject(e,i):qo.fromError(e,"Error parsing group function")}catch(n){return qo.fromError(e,$i(`Failed parsing expression "${e}"`,n))}}function Oh(r,e){let t=e.map(([n,i])=>i);return r(...t)}function Dh(r,e,t){try{return Oh(r,e)}catch(n){return $i(`Failed calculating expression "${t}"`,n)}}function Pl(r,e){return[["task",r],["query",e?e.query:null]]}function Jw(r,e,t){let n=Pl(r,t||null),i=Sh(n,e);return i.error?i.error:Dh(i.queryComponent,n,e)}var jo=class{constructor(e){this.line=e,this.functionOrError=Sh(Pl(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 Oh(this.functionOrError.queryComponent,Pl(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?Dh(this.functionOrError.queryComponent,Pl(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function xh(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Nl=class extends Se{createFilterOrErrorMessage(e){let t=Se.getMatch(this.filterRegExp(),e);if(t===null)return ae.fromError(e,"Unable to parse line");let n=t[1],i=new jo(n);return i.isValid()?ae.fromFilter(new wt(e,vF(i),new Oe(e))):ae.fromError(e,i.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=Se.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2],s=new jo(i);if(!s.isValid())throw new Error(s.parseError);let a=(o,u,l)=>{try{let c=l.queryContext(),d=this.validateTaskSortKey(s.evaluate(o,c)),f=this.validateTaskSortKey(s.evaluate(u,c));return this.compareTaskSortKeys(d,f)}catch(c){throw c instanceof Error&&(c.message+=`: while evaluating instruction '${e}'`),c}};return new qr(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=xh(e),i=xh(t),s=this.compareTaskSortKeysIfOptionalMoment(e,t,n,i);if(s!==void 0)return s;let a=this.compareTaskSortKeysIfEitherIsNull(e,t);if(a!==void 0)return a;if(n!==i)throw new Error(`Unable to compare two different sort key types '${n}' and '${i}' order`);if(n==="string")return e.localeCompare(t,void 0,{numeric:!0});if(n==="TasksDate")return pr(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 '${i}'`);return o}compareTaskSortKeysIfOptionalMoment(e,t,n,i){let s=n==="Moment",a=i==="Moment";if(s&&a||s&&t===null||a&&e===null)return pr(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=Se.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new ii(e,"function",kF(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function vF(r){return(e,t)=>{let n=t.queryContext();return wF(r,e,n)}}function wF(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 kF(r){return(e,t)=>{let n=t.queryContext();return EF(e,r,n)}}function EF(r,e,t){try{let n=Jw(r,e,t);return Array.isArray(n)?n.map(s=>s.toString()):n===null?[]:[n.toString()]}catch(n){let i=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[i+n.message]:[i+"Unknown error"]}}var Il=class extends Ie{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 $s=class extends Ie{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var Rh=class extends Se{createFilterOrErrorMessage(e){var n;let t=Se.getMatch(this.filterRegExp(),e);if(t!==null){let i=t[5],s=null;switch(i.toLowerCase()){case"lowest":s="5";break;case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break;case"highest":s="0";break}if(s===null)return ae.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(s)<0;break;case"below":o=u=>u.priority.localeCompare(s)>0;break;case"not":o=u=>u.priority!==s;break;default:o=u=>u.priority===s,a=`${this.fieldName()} is ${i}`}return ae.fromFilter(new wt(e,o,new Oe(a)))}else return ae.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return Rh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},Yi=Rh;Yi.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Fl=class extends at{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Ll=class extends at{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Ul=class extends at{constructor(){let e=new Gt;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 Wl=class extends kr{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 si=class extends kr{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=si.oldStatusName(e),i=si.oldStatusName(t);return ni?-1:0}}static oldStatusName(e){return e.isDone?"Done":"Todo"}supportsGrouping(){return!0}grouper(){return e=>[si.oldStatusName(e)]}};var ql=class extends Ie{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 i=e.matchesAnyOf(this.values(n));return t?!i:i}}createGrouper(e){return new ii(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 Bi=class extends ql{constructor(){super();this.filterInstructions=new Gt,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 i=!!n[1],s=isNaN(+n[2])?1:+n[2],a=Bi.makeCompareByTagComparator(s);return new qr(t,this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Bi.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,i)=>{if(n.tags.length===0&&i.tags.length===0)return 0;if(n.tags.length===0)return 1;if(i.tags.length===0)return-1;let s=t-1;if(n.tags.length=t)return 1;if(i.tags.length=t)return-1;if(n.tags.lengtht.tags.length==0?["(No tags)"]:t.tags}};var pk=ma(fk());function ai(r){return new RegExp("["+Zn(r)+"]").source}var Wh=[["(",")"],["[","]"],["{","}"],['"','"']],Un=class{constructor(e,t,n){this.openFilterChars=e,this.closeFilterChars=t,this.openAndCloseFilterChars=n,this.openFilter=ai(this.openFilterChars),this.closeFilter=ai(this.closeFilterChars)}static allSupportedDelimiters(){let e="",t="",n="";for(let[i,s]of Wh)e+=i,t+=s,n+=Un.openAndClosing(i,s);return new Un(e,t,n)}static fromInstructionLine(e){let t=e.trim(),i=/^[A-Z ]*\s*(.*)/.exec(t);if(i){let a=i[1],o=a[0],u=a.slice(-1);for(let[l,c]of Wh)if(o===l&&u===c){let d=this.openAndClosing(l,c);return new Un(l,c,d)}}let s="All filters in a Boolean instruction must be inside one of these pairs of delimiter characters: "+Wh.map(([a,o])=>a+"..."+o).join(" or ")+". Combinations of those delimiters are no longer supported.";throw new Error(s)}static openAndClosing(e,t){let n=e;return t!=e&&(n+=t),n}};var oi=class{static preprocessExpression(e,t){let n=oi.splitLine(e,t);return oi.getFiltersAndSimplifiedLine(n,t)}static splitLine(e,t){let n=new RegExp("("+t.closeFilter+"\\s*(?:AND|OR|AND +NOT|OR +NOT|XOR)\\s*"+t.openFilter+")"),i=e.split(n),s=new RegExp("(NOT\\s*"+t.openFilter+")"),a=i.flatMap(l=>l.split(s)).filter(l=>l!==""),o=new RegExp("(^"+ai(t.openFilterChars+" ")+"*)"),u=new RegExp("("+ai(t.closeFilterChars+" ")+"*$)");return a.flatMap(l=>l.split(o)).flatMap(l=>l.split(u)).filter(l=>l!=="")}static getFiltersAndSimplifiedLine(e,t){let n="",i=1,s={};e.forEach(l=>{if(!oi.isAFilter(l,t))n+=`${l}`;else{let c=`f${i}`;s[c]=l,n+=c,i++}});let a=new RegExp(`(${t.closeFilter})([A-Z])`,"g");n=n.replace(a,"$1 $2");let o=new RegExp(`([A-Z])(${t.openFilter})`,"g");n=n.replace(o,"$1 $2");let u=t.openFilterChars;if(u!='"'&&u!="("){let l=new RegExp(ai(u),"g");n=n.replace(l,"(");let c=t.closeFilterChars,d=new RegExp(ai(c),"g");n=n.replace(d,")")}return{simplifiedLine:n,filters:s}}static isAFilter(e,t){let n=new RegExp("^"+ai(" "+t.openAndCloseFilterChars)+"+$"),i=new RegExp("^ *"+t.closeFilter+" *(AND|OR|XOR) *"+t.openFilter+" *$"),s=new RegExp("^(AND|OR|XOR|NOT) *"+t.openFilter+"$"),a=new RegExp("^"+t.closeFilter+" *(AND|OR|XOR)$");return![n,i,s,a,/^(AND|OR|XOR|NOT)$/].some(u=>RegExp(u).exec(e))}};var Bl=class extends Se{constructor(){super();this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={};let t=Un.allSupportedDelimiters();this.basicBooleanRegexp=new RegExp("(.*(AND|OR|XOR|NOT)\\s*"+t.openFilter+".*|"+t.openFilter+".+"+t.closeFilter+")","g")}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return ae.fromError(t,"empty line");let n;try{n=Un.fromInstructionLine(t)}catch(o){let u=o instanceof Error?o.message:"unknown error type";return ae.fromError(t,this.helpMessageFromSimpleError(t,u))}let i=oi.preprocessExpression(t,n),s=i.simplifiedLine,a=i.filters;try{let o=(0,pk.parse)(s);for(let c of o)if(c.name==="IDENTIFIER"&&c.value){let d=c.value.trim(),f=a[d];if(c.value=f,!(f in this.subFields)){let m=Go(f);if(m===null)return this.helpMessage(t,`couldn't parse sub-expression '${f}'`,i);if(m.error)return this.helpMessage(t,`couldn't parse sub-expression '${f}': ${m.error}`,i);m.filter&&(this.subFields[f]=m.filter)}}else if(c.name==="OPERATOR"){if(c.value==null)return this.helpMessage(t,"empty operator in boolean query",i);if(!this.supportedOperators.includes(c.value))return this.helpMessage(t,`unknown boolean operator '${c.value}'`,i)}let u=(c,d)=>this.filterTaskWithParsedQuery(c,o,d),l=this.constructExplanation(o);return ae.fromFilter(new wt(t,u,l))}catch(o){let u=o instanceof Error?o.message:"unknown error type";return this.helpMessage(t,`malformed boolean query -- ${u} (check the documentation for guidelines)`,i)}}filterTaskWithParsedQuery(t,n,i){let s=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,i);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=s(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return s(o[0])}constructExplanation(t){let n=[];for(let i of t)if(i.name==="IDENTIFIER")this.explainExpression(i,n);else if(i.name==="OPERATOR")this.explainOperator(i,n);else throw Error("Unsupported token type: "+i.name);return n[0]}explainExpression(t,n){if(t.value==null)throw Error("null token value");let i=this.subFields[t.value.trim()],s=this.simulateExplainFilter(i);n.push(s)}simulateExplainFilter(t){return t.simulateExplainFilter()}explainOperator(t,n){if(t.value==="NOT"){let i=n.pop();n.push(Oe.booleanNot([i]))}else if(t.value==="OR"){let i=n.pop(),s=n.pop();n.push(Oe.booleanOr([s,i]))}else if(t.value==="AND"){let i=n.pop(),s=n.pop();n.push(Oe.booleanAnd([s,i]))}else if(t.value==="XOR"){let i=n.pop(),s=n.pop();n.push(Oe.booleanXor([s,i]))}else throw Error("Unsupported operator: "+t.value)}helpMessage(t,n,i){let s=i.filters,a=this.stringifySubExpressionsForErrorMessage(s),u=`${this.helpMessageFromSimpleError(t,n)} The instruction was converted to the following simplified line: ${i.simplifiedLine} Where the sub-expressions in the simplified line are: ${a} For help, see: https://publish.obsidian.md/tasks/Queries/Combining+Filters `;return ae.fromError(t,u)}stringifySubExpressionsForErrorMessage(t){return Object.entries(t).map(([n,i])=>` '${n}': '${i}' => ${this.stringifySubExpressionStatus(i)}`).join(` `)}stringifySubExpressionStatus(t){let n=Go(t);return n?n.error?`ERROR: ${n.error.split(` `).map(s=>s.trim()).join(` `)}`:"OK":`ERROR: do not understand query`}helpMessageFromSimpleError(t,n){return`Could not interpret the following instruction as a Boolean combination: ${t} The error message is: ${n}`}};var Hl=class extends Ie{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 Qs=class extends Se{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return ae.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 Vl=class extends Ie{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var dn=class extends Se{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return Se.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=Se.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=Rt[i.toUpperCase()];if(!s)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(e)}return ae.fromFilter(new wt(e,a,new Oe(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(Rt).filter(i=>i!=="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 ae.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=dn.groupName(e),i=dn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[dn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var zl=class extends Ie{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 Ie{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(this.value(e))]}};var Ql=class extends Ie{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(this.value(e))]}};var Xl=class extends Ie{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return ae.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 at{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Jl=class extends kr{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 Ie{constructor(){super();this.filterInstructions=new Gt;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 Se{constructor(){super();this.filterInstructions=new Gt;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:ae.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var rc=class extends kr{fieldName(){return"random"}supportsSorting(){return!0}comparator(){return(e,t)=>this.sortKey(e)-this.sortKey(t)}sortKey(e){let t=i=>{let s=0,a=9;for(;s>>9},n=window.moment().format("Y-MM-DD");return t(n+" "+e.description)}};var qh=[()=>new Vl,()=>new dn,()=>new si,()=>new Wl,()=>new Yi,()=>new Ul,()=>new Zl,()=>new Ml,()=>new Ll,()=>new Fl,()=>new js,()=>new Cl,()=>new $s,()=>new Kl,()=>new Ql,()=>new Xl,()=>new Gi,()=>new Bi,()=>new Il,()=>new Al,()=>new Hl,()=>new Qs,()=>new zl,()=>new Nl,()=>new ec,()=>new tc,()=>new Jl,()=>new rc,()=>new Bl];function Go(r){for(let e of qh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function mk(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of qh){let i=t().createSorterFromLine(r);if(i)return i}return null}function hk(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of qh){let i=t().createGrouperFromLine(r);if(i)return i}return null}var nc=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var ic=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let i=e.keys().next().value.length;for(let s=0;st.set(o,a)),e.pop();return t}};var ac=class extends sc{},oc=class{constructor(e,t,n){this.root=new ac(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let i of e){let s=[];for(let a of n)for(let o of a.values){let u=i.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new ac([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var uc=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 Xs=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new oc(e,t,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any): `;for(let n of this._groupers){let i=n.reverse?" reverse":"";e+=`- ${n.property}${i} `}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 i=new uc(t,n);this.addTaskGroup(i)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let i=t.groups,s=n.groups;for(let a=0;a{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 ui=class{constructor(e,t){this.tasksFile=e,this.allTasks=[...t]}static fromAllTasks(e){return new ui(void 0,e)}get queryPath(){var e,t;return(t=(e=this.tasksFile)==null?void 0:e.path)!=null?t:void 0}queryContext(){return this.tasksFile?Eh(this.tasksFile,this.allTasks):void 0}};function gk(r){return`task${r!==1?"s":""}`}var zi=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} ${gk(e)}`:`${e} of ${t} ${gk(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new zi(new Xs([],[],ui.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function yk(r){return r.endsWith("\\")}function Tk(r){return r.endsWith("\\\\")}function ZF(r){return r.replace(/^[ \t]*/,"")}function JF(r){return r.replace(/[ \t]*\\$/,"")}function eL(r,e){let t=r;return e&&(t=ZF(r)),Tk(t)?t=t.slice(0,-1):yk(r)&&(t=JF(t)),t}function bk(r){let e=[],t=!1,n="",i="",s=r+` `;for(let a of s.split(` `)){let o=eL(a,t);t?(n+=` `+a,i+=" "+o):(n=a,i=o),Tk(a)?t=!1:t=yk(a),t||(i.trim()!==""&&e.push(new Ln(n,i)),n="",i="")}return e}var Zs=class{static by(e,t,n){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of e)s.push(a.comparator);return t.sort(Zs.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new dn().createNormalSorter(),new Qs().createNormalSorter(),new js().createNormalSorter(),new Yi().createNormalSorter(),new $s().createNormalSorter()]}static makeCompositeComparator(e,t){return(n,i)=>{for(let s of e){let a=s(n,i,t);if(a!==0)return a}return 0}}};var $r=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new tn;this._queryLayoutOptions=new ri;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|cancelled date|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|postpone button|urgency|tags|depends on|id|on completion|tree)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Mt.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.tasksFile=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),bk(e).forEach(n=>{let i=this.expandPlaceholders(n,t);if(this.error===void 0)try{this.parseLine(i,n)}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,n);return}})}get filePath(){var e,t;return(t=(e=this.tasksFile)==null?void 0:e.path)!=null?t:void 0}get queryId(){return this._queryId}parseLine(e,t){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,t):break;default:this.setError("do not understand query",t)}}formatQueryForLogging(){return`[${this.source.split(` `).join(" ; ")}]`}expandPlaceholders(e,t){let n=e.anyContinuationLinesRemoved;if(n.includes("{{")&&n.includes("}}")&&this.tasksFile===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}" but no file path has been supplied, so cannot expand placeholder values. The query is: ${n}`,n;let i=n;if(t){let s=Zw(t);try{i=Xw(n,s)}catch(a){return a instanceof Error?this._error=a.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",n}}return e.recordExpandedPlaceholders(i),i}append(e){return this.source===""?e:e.source===""?this:new $r(`${this.source} ${e.source}`,this.tasksFile)}explainQuery(){return new Us().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=$r.generateErrorMessage(t,e)}static generateErrorMessage(e,t){return e.allLinesIdentical()?`${t} Problem line: "${e.rawInstruction}"`:`${t} Problem statement: ${e.explainStatement(" ")} `}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new ui(this.tasksFile,e),n;try{this.filters.forEach(u=>{n=u.statement,e=e.filter(l=>u.filterFunction(l,t))}),n=void 0;let{debugSettings:i}=Q(),s=i.ignoreSortInstructions?e:Zs.by(this.sorting,e,t),a=s.slice(0,this.limit),o=new Xs(this.grouping,a,t);return this._taskGroupLimit!==void 0&&o.applyTaskLimit(this._taskGroupLimit),new zi(o,s.length)}catch(i){let a=$i("Search failed",i);return n&&(a=$r.generateErrorMessage(n,a)),zi.fromError(a)}}parseHideOptions(e){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1].toLowerCase()==="hide";switch(t[2].toLowerCase()){case"tree":this._queryLayoutOptions.hideTree=n;break;case"task count":this._queryLayoutOptions.hideTaskCount=n;break;case"backlink":this._queryLayoutOptions.hideBacklinks=n;break;case"postpone button":this._queryLayoutOptions.hidePostponeButton=n;break;case"priority":this._taskLayoutOptions.setVisibility("priority",!n);break;case"cancelled date":this._taskLayoutOptions.setVisibility("cancelledDate",!n);break;case"created date":this._taskLayoutOptions.setVisibility("createdDate",!n);break;case"start date":this._taskLayoutOptions.setVisibility("startDate",!n);break;case"scheduled date":this._taskLayoutOptions.setVisibility("scheduledDate",!n);break;case"due date":this._taskLayoutOptions.setVisibility("dueDate",!n);break;case"done date":this._taskLayoutOptions.setVisibility("doneDate",!n);break;case"recurrence rule":this._taskLayoutOptions.setVisibility("recurrenceRule",!n);break;case"edit button":this._queryLayoutOptions.hideEditButton=n;break;case"urgency":this._queryLayoutOptions.hideUrgency=n;break;case"tags":this._taskLayoutOptions.setTagsVisibility(!n);break;case"id":this._taskLayoutOptions.setVisibility("id",!n);break;case"depends on":this._taskLayoutOptions.setVisibility("dependsOn",!n);break;case"on completion":this._taskLayoutOptions.setVisibility("onCompletion",!n);break;default:this.setError("do not understand hide/show option",new Ln(e,e))}}}parseFilter(e,t){var i;let n=Go(e);return n!=null?(n.filter?(n.filter.setStatement(t),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"Unknown error",t),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",new Ln(e,e));return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=mk(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=hk(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 li=class{constructor(e=li.empty){this._source=e}static getInstance(){return li.instance||(li.instance=new li),li.instance}set(e){this._source=e}query(e=void 0){return new $r(this._source,e)}hasInstructions(){return this._source.trim()!==li.empty}},nr=li;nr.empty="";var lc=class{constructor({obsidianEvents:e}){this.logger=Mt.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 Fk=require("obsidian");var Ik=require("obsidian");var jh=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 _k(r){let e=[],t=new Le().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let i of r.registeredStatuses)t.includes(i.symbol)===n&&e.push(new jh(i));return e}var vk=require("obsidian");var $h="---",Js=class{apply(e){throw new Error("MenuDividerInstruction.apply(): Method not implemented.")}instructionDisplayName(){return $h}isCheckedForTask(e){return!1}};function Wn(r,e){return A(this,null,function*(){yield vr({originalTask:r,newTasks:e})})}var ci=class extends vk.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let i of t)this.addItemForInstruction(n,i)}addItemForInstruction(t,n){n.instructionDisplayName()===$h?this.addSeparator():this.addItem(i=>this.getMenuItemCallback(t,i,n))}getMenuItemCallback(t,n,i){n.setTitle(i.instructionDisplayName()).setChecked(i.isCheckedForTask(t)).onClick(()=>A(this,null,function*(){let s=i.apply(t);(s.length!==1||!Object.is(s[0],t))&&(yield this.taskSaver(t,s))}))}};var cc=class extends ci{constructor(e,t,n=Wn){super(n);let i=_k(e);this.addItemsForInstructions(i,t)}};function wk(r){for(let t of ee.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 ea(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function Gh(r,e,t,n){let i=r[e];return Sk(i,r,e,t,n)}function kk(r,e,t,n){let i=window.moment();return Sk(i,r,e,t,n)}function Ek(r,e,t,n){return Ok(r,e,null)}function Sk(r,e,t,n,i){let s=new mt(r).postpone(n,i);return Ok(e,t,s)}function Ok(r,e,t){let n=_t.removeInferredStatusIfNeeded(r,[new ee(fe(K({},r),{[e]:t}))])[0];return{postponedDate:t,postponedTask:n}}function Dk(r,e){if(r){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}else return`Task's ${e} removed`}function xk(r,e,t){return`\u2139\uFE0F ${Yh(r,e,t)} (right-click for more options)`}function Yh(r,e,t){let n=ea(r),i=r[n];return ta(n,i,e,t)}function Rk(r,e,t){let n=ea(r),i=window.moment().startOf("day");return ta(n,i,e,t)}function Mk(r,e,t){let n=ea(r);return Bh(n,r)}function Bh(r,e){return r==="scheduledDate"&&e.scheduledDateIsInferred?"Cannot remove inferred scheduled date":`Remove ${dc(r)}`}function tL(r){return Rs(r.replace("Date",""))}function dc(r){return r.replace("Date"," date")}function ta(r,e,t,n){let s=new mt(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";if(e.isSameOrBefore(window.moment(),"day")){let u=tL(r);return(t>=0?`${u} in ${a} ${n}, on ${s}`:`${u} ${-a} ${n} ago, on ${s}`).replace(" 1 day ago"," yesterday").replace(" in 0 days"," today").replace("in a day","tomorrow")}let o=dc(r);return t>=0?`Postpone ${o} by ${a} ${n}, to ${s}`:`Backdate ${o} by ${-a} ${n}, to ${s}`}function Ck(r){return["startDate","scheduledDate","dueDate"].includes(r)}var Yo=class{constructor(e,t,n){this.newDate=t,this.dateFieldToEdit=e,this.displayName=n!=null?n:`Set Date: ${this.newDate.toDateString()}`}apply(e){return this.isCheckedForTask(e)?[e]:[new ee(fe(K({},e),{[this.dateFieldToEdit]:window.moment(this.newDate)}))]}instructionDisplayName(){return this.displayName}isCheckedForTask(e){var t;return((t=e[this.dateFieldToEdit])==null?void 0:t.isSame(window.moment(this.newDate)))||!1}},Gr=class extends Yo{constructor(e,t,n,i){var u;let s=(u=t[e])!=null?u:window.moment(),a=ta(e,s,n,i),o=new mt(window.moment(s)).postpone(i,n).toDate();super(e,o,a)}},Hh=class{constructor(e,t){this.dateFieldToEdit=e,this.displayName=Bh(e,t)}apply(e){let t=this.dateFieldToEdit==="scheduledDate"&&e.scheduledDateIsInferred;return e[this.dateFieldToEdit]===null||t?[e]:[new ee(fe(K({},e),{[this.dateFieldToEdit]:null}))]}instructionDisplayName(){return this.displayName}isCheckedForTask(e){return!1}};function Ak(r,e){return Nk(e,r,1)}function Pk(r,e){return Nk(e,r,-1)}function Nk(r,e,t){let n=window.moment().startOf("day"),i=n.toDate(),s=new mt(n.clone());return[new Yo(e,i,ta(e,n,0,"days")),new Yo(e,s.postpone("day",t).toDate(),ta(e,n,t,"day")),new Js,new Gr(e,r,t*2,"days"),new Gr(e,r,t*3,"days"),new Gr(e,r,t*4,"days"),new Gr(e,r,t*5,"days"),new Gr(e,r,t*6,"days"),new Js,new Gr(e,r,t,"week"),new Gr(e,r,t*2,"weeks"),new Gr(e,r,t*3,"weeks"),new Gr(e,r,t,"month"),new Js,new Hh(e,r)]}var fc=class extends ci{constructor(e,t,n=Wn){super(n);let i=Ck(e)?Ak(e,t):Pk(e,t);this.addItemsForInstructions(i,t)}};var pc=class{constructor(){this.data=rL}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},Vh=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===Vh.noAttributeName)return;let i=this.attributeValueCalculator(n,t);i!==""&&(e.dataset[this.attributeName]=i)}},Yr=Vh;Yr.noAttributeName="",Yr.noAttributeValueCalculator=()=>"",Yr.dateAttributeCalculator=(e,t)=>{let i="far";function s(o){let l=window.moment().startOf("day").diff(o,"days");if(isNaN(l))return null;if(l===0)return"today";let c="";return l>0?c+="past-":l<0&&(c+="future-"),Math.abs(l)<=7?c+=Math.abs(l).toString()+"d":c+=i,c}let a=t[e];if(!Array.isArray(a)&&a instanceof window.moment){let o=s(a);if(o)return o}return""};function ra(r){return new Yr(r,Yr.noAttributeName,Yr.noAttributeValueCalculator)}function na(r,e){return new Yr(r,e,Yr.dateAttributeCalculator)}var rL={createdDate:na("task-created","taskCreated"),dueDate:na("task-due","taskDue"),startDate:na("task-start","taskStart"),scheduledDate:na("task-scheduled","taskScheduled"),doneDate:na("task-done","taskDone"),cancelledDate:na("task-cancelled","taskCancelled"),priority:new Yr("task-priority","taskPriority",(r,e)=>Xt.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),description:ra("task-description"),recurrenceRule:ra("task-recurring"),onCompletion:ra("task-onCompletion"),dependsOn:ra("task-dependsOn"),id:ra("task-id"),blockLink:ra("task-block-link")};function Xe(r,e){let t=document.createElement(r);return e.appendChild(t),t}var qn=class{static obsidianMarkdownRenderer(e,t,n,i){return A(this,null,function*(){!i||(yield Ik.MarkdownRenderer.renderMarkdown(e,t,n,i))})}constructor({textRenderer:e=qn.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,taskLayoutOptions:i,queryLayoutOptions:s}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.taskLayoutOptions=i,this.queryLayoutOptions=s}renderTaskLine(e,t,n){return A(this,null,function*(){let i=Xe("li",this.parentUlElement);i.classList.add("task-list-item","plugin-tasks-list-item");let s=Xe("span",i);s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=Xe("input",i);return a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,i.classList.add("is-checked")),e.taskLocation.hasKnownPath&&(a.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),a.disabled=!0;let l=e.toggleWithRecurrenceInUsersOrder();vr({originalTask:e,newTasks:l})}),a.addEventListener("contextmenu",u=>{new cc(xe.getInstance(),e).showAtPosition({x:u.clientX,y:u.clientY})}),a.setAttribute("title","Right-click for options")),i.prepend(a),i.setAttribute("data-task",e.status.symbol.trim()),i.setAttribute("data-line",t.toString()),i.setAttribute("data-task-status-name",e.status.name),i.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.queryLayoutOptions.shortMode&&this.addTooltip(e,s,n),i})}taskToHtml(e,t,n){return A(this,null,function*(){let i=new pc,s=Fr.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=s.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=Xe("span",t),l=Xe("span",u);if(yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l),i.addClassName(u,a),i.addDataAttribute(u,e,a),i.addDataAttribute(n,e,a),ee.allDateFields().includes(a)){let c=a;u.addEventListener("contextmenu",d=>{d.preventDefault(),d.stopPropagation(),new fc(c,e,Wn).showAtPosition({x:d.clientX,y:d.clientY})}),u.setAttribute("title",`Right-click to edit ${dc(c)}`)}}}for(let a of this.taskLayoutOptions.hiddenComponents)i.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&i.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,i){return A(this,null,function*(){if(n==="description"){t=ve.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:s}=Q();s.showTaskHiddenData&&(t+=`
\u{1F41B} ${i.lineNumber} . ${i.sectionStart} . ${i.sectionIndex} . '${i.originalMarkdown}'
'${i.path}' > '${i.precedingHeader}'
`),yield this.textRenderer(t,e,i.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(i){let s=/["&\x00\r\n]/g,a=i.replace(s,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let i=t.getElementsByClassName("tag");for(let s=0;s{function d(b,k,_){k&&b.createDiv().setText(f({signifier:_,date:k}))}function f({signifier:b,date:k}){return`${b} ${k.format(Z.dateFormat)} (${k.from(window.moment().startOf("day"))})`}let m=t.createDiv();m.addClasses(["tooltip","pop-up"]),e.recurrence&&m.createDiv().setText(`${i} ${e.recurrence.toText()}`),d(m,e.createdDate,a),d(m,e.startDate,s),d(m,e.scheduledDate,o),d(m,e.dueDate,u),d(m,e.cancelledDate,l),d(m,e.doneDate,c);let g=e.getLinkText({isFilenameUnique:n});g&&m.createDiv().setText(`\u{1F517} ${g}`),t.addEventListener("mouseleave",()=>{m.remove()})})}};var mc=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return A(this,null,function*(){var d;let n=new Fk.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(f=>{var b;let m=(b=f.textContent)==null?void 0:b.split(` `);if(m===void 0)return!1;let g=null;for(let k=0;kLk.ViewPlugin.fromClass(zh),zh=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 f=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(f),new Uk.Notice(f,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=ee.fromLine({line:a.text,taskLocation:ht.fromUnknownPosition(new ut("")),fallbackDate:null});if(o===null)return!1;e.preventDefault();let u=o.toggleWithRecurrenceInUsersOrder(),l=u.map(f=>f.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});if(this.view.dispatch(c),u.length===1){let f=u[0].status.symbol!==" ";setTimeout(()=>{t.checked=f},1)}return!0}};var bc=require("obsidian"),$k=require("obsidian");function qk(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'. `);let s=new Us(" "),a=new $r(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);i+=`Explanation of the global query: ${s.explainQuery(o)} `}return i+=`Explanation of this Tasks code block query: ${s.explainQuery(a)}`,i}function Bo(r,e,t){let n=new $r(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function Ho(r,e,t){e&&r.push(nL(t))}function nL(r){return`tasks-layout-hide-${r}`}var hc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new ri}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,i]of t)Ho(e,n,i);return this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode"),e}};var gc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new tn}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{Ho(e,!this.taskLayoutOptions.isShown(t),t)}),Ho(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var Vo=class{constructor(e){this.label=e,this.start()}start(){!this.recordTimings()||performance.mark(this.labelForStart())}finish(){!this.recordTimings()||(performance.mark(this.labelForEnd()),performance.measure(this.label,this.labelForStart(),this.labelForEnd()),this.printDuration())}printDuration(){let e=performance.getEntriesByName(this.label),t=e[e.length-1];t?console.log(this.label+":",t.duration.toFixed(2),"milliseconds"):console.log(`Measurement for ${this.label} not found`)}labelForStart(){return`${this.label} - start`}labelForEnd(){return`${this.label} - end`}recordTimings(){let{debugSettings:e}=Q();return e.recordTimings}};var Kh=require("obsidian");var di=class extends ci{constructor(e,t,n=Wn){super(n);let i=(l,c,d,f,m,g)=>{var S;let b=!1,k=ea(t);if(k){let{postponedDate:x}=g(t,k,d,f);(S=t[k])!=null&&S.isSame(x,"day")&&(b=!0)}let _=m(t,f,d);c.setChecked(b).setTitle(_).onClick(()=>di.postponeOnClickCallback(l,t,f,d,g,n))},s=Rk,a=kk;this.addItem(l=>i(e,l,"days",0,s,a)),this.addItem(l=>i(e,l,"day",1,s,a)),this.addSeparator();let o=Yh,u=Gh;this.addItem(l=>i(e,l,"days",2,o,u)),this.addItem(l=>i(e,l,"days",3,o,u)),this.addItem(l=>i(e,l,"days",4,o,u)),this.addItem(l=>i(e,l,"days",5,o,u)),this.addItem(l=>i(e,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>i(e,l,"week",1,o,u)),this.addItem(l=>i(e,l,"weeks",2,o,u)),this.addItem(l=>i(e,l,"weeks",3,o,u)),this.addItem(l=>i(e,l,"month",1,o,u)),this.addSeparator(),this.addItem(l=>i(e,l,"days",2,Mk,Ek))}static postponeOnClickCallback(o,u,l,c){return A(this,arguments,function*(e,t,n,i,s=Gh,a=Wn){var g;let d=ea(t);if(d===null){let b="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Kh.Notice(b,1e4)}let{postponedDate:f,postponedTask:m}=s(t,d,i,n);(g=t[d])!=null&&g.isSame(f,"day")||(yield a(t,m),di.postponeSuccessCallback(e,d,f))})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let i=Dk(n,t);new Kh.Notice(i,2e3)}};function jk(r){let e=r.parent;for(;e!==null&&!(e instanceof ee);)e=e.parent;return e}var yc=class{constructor(e,t,n,i,s,a=qn.obsidianMarkdownRenderer){switch(this.source=t,this.tasksFile=n,this.renderMarkdown=i,this.obsidianComponent=s,this.textRenderer=a,e){case"block-language-tasks":this.query=Bo(this.source,nr.getInstance(),this.tasksFile),this.queryType="tasks";break;default:this.query=Bo(this.source,nr.getInstance(),this.tasksFile),this.queryType="tasks";break}}get filePath(){var e,t;return(t=(e=this.tasksFile)==null?void 0:e.path)!=null?t:void 0}render(e,t,n,i){return A(this,null,function*(){e==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,e,n,i):this.query.error!==void 0?this.renderErrorMessage(n,this.query.error):this.renderLoadingMessage(n)})}renderQuerySearchResults(e,t,n,i){return A(this,null,function*(){let s=this.explainAndPerformSearch(t,e,n);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(n,s.searchErrorMessage);return}yield this.renderSearchResults(s,n,i)})}explainAndPerformSearch(e,t,n){let i=new Vo(`Search: ${this.query.queryId} - ${this.filePath}`);i.start(),this.query.debug(`[render] Render called: plugin state: ${e}; searching ${t.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(n);let s=this.query.applyQueryToTasks(t);return i.finish(),s}renderSearchResults(e,t,n){return A(this,null,function*(){let i=new Vo(`Render: ${this.query.queryId} - ${this.filePath}`);i.start(),yield this.addAllTaskGroups(e.taskGroups,t,n);let s=e.totalTasksCount;this.addTaskCount(t,e),this.query.debug(`[render] ${s} tasks displayed`),i.finish()})}renderErrorMessage(e,t){e.createDiv().innerHTML=`
Tasks query: ${t.replace(/\n/g,"
")}
`}renderLoadingMessage(e){e.setText("Loading Tasks ...")}createExplanation(e){let t=qk(this.source,ve.getInstance(),nr.getInstance(),this.tasksFile),n=Xe("pre",e);n.classList.add("plugin-tasks-query-explanation"),n.setText(t),e.appendChild(n)}addAllTaskGroups(e,t,n){return A(this,null,function*(){for(let i of e.groups){yield this.addGroupHeadings(t,i.groupHeadings);let s=new Set;yield this.createTaskList(i.tasks,t,n,s)}})}createTaskList(e,t,n,i){return A(this,null,function*(){let s=Xe("ul",t);s.classList.add("contains-task-list","plugin-tasks-query-result");let a=new gc(this.query.taskLayoutOptions);s.classList.add(...a.generateHiddenClasses());let o=new hc(this.query.queryLayoutOptions);s.classList.add(...o.getHiddenClasses());let u=this.getGroupingAttribute();u&&u.length>0&&(s.dataset.taskGroupBy=u);let l=new qn({textRenderer:this.textRenderer,obsidianComponent:this.obsidianComponent,parentUlElement:s,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[c,d]of e.entries())this.query.queryLayoutOptions.hideTree?d instanceof ee&&(yield this.addTask(s,l,d,c,n)):yield this.addTaskOrListItemAndChildren(s,l,d,c,n,e,i);t.appendChild(s)})}willBeRenderedLater(e,t,n){let i=jk(e);return i?!!(!t.has(i)&&n.includes(i)):!1}alreadyRendered(e,t){return t.has(e)}addTaskOrListItemAndChildren(e,t,n,i,s,a,o){return A(this,null,function*(){if(this.alreadyRendered(n,o)||this.willBeRenderedLater(n,o,a))return;let u=yield this.addTaskOrListItem(e,t,n,i,s);o.add(n),n.children.length>0&&(yield this.createTaskList(n.children,u,s,o),n.children.forEach(l=>{o.add(l)}))})}addTaskOrListItem(e,t,n,i,s){return A(this,null,function*(){return n instanceof ee?yield this.addTask(e,t,n,i,s):yield this.addListItem(e,n)})}addListItem(e,t){return A(this,null,function*(){var s,a;let n=Xe("li",e),i=Xe("span",n);return yield this.textRenderer(t.description,i,(a=(s=jk(t))==null?void 0:s.path)!=null?a:"",this.obsidianComponent),n})}addTask(e,t,n,i,s){return A(this,null,function*(){let a=this.isFilenameUnique({task:n},s.allMarkdownFiles),o=yield t.renderTaskLine(n,i,a);o.querySelectorAll("[data-footnote-id]").forEach(d=>d.remove());let l=Xe("span",o);l.classList.add("task-extras"),this.query.queryLayoutOptions.hideUrgency||this.addUrgency(l,n);let c=this.query.queryLayoutOptions.shortMode;return this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(l,n,c,a,s),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(l,n,s),!this.query.queryLayoutOptions.hidePostponeButton&&wk(n)&&this.addPostponeButton(l,n,c),e.appendChild(o),o})}addEditButton(e,t,n){let i=Xe("a",e);i.classList.add("tasks-edit"),i.title="Edit task",i.href="#",i.addEventListener("click",s=>n.editTaskPencilClickHandler(s,t,n.allTasks))}addUrgency(e,t){let n=new Intl.NumberFormat().format(t.urgency);e.createSpan({text:n,cls:"tasks-urgency"})}addGroupHeadings(e,t){return A(this,null,function*(){for(let n of t)yield this.addGroupHeading(e,n)})}addGroupHeading(e,t){return A(this,null,function*(){let n="h6";t.nestingLevel===0?n="h4":t.nestingLevel===1&&(n="h5");let i=Xe(n,e);i.classList.add("tasks-group-heading"),this.obsidianComponent!==null&&(yield this.renderMarkdown(t.displayName,i,this.tasksFile.path,this.obsidianComponent))})}addBacklinks(e,t,n,i,s){var l;let a=Xe("span",e);a.classList.add("tasks-backlink"),n||a.append(" (");let o=Xe("a",a);o.rel="noopener",o.target="_blank",o.classList.add("internal-link"),n&&o.classList.add("internal-link-short-mode");let u;n?u=" \u{1F517}":u=(l=t.getLinkText({isFilenameUnique:i}))!=null?l:"",o.text=u,o.addEventListener("click",c=>A(this,null,function*(){yield s.backlinksClickHandler(c,t)})),o.addEventListener("mousedown",c=>A(this,null,function*(){yield s.backlinksMousedownHandler(c,t)})),n||a.append(")")}addPostponeButton(e,t,n){let s="day",a=xk(t,1,s),o=Xe("a",e);o.classList.add("tasks-postpone"),n&&o.classList.add("tasks-postpone-short-mode"),o.title=a,o.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),di.postponeOnClickCallback(o,t,1,s)}),o.addEventListener("contextmenu",u=>A(this,null,function*(){u.preventDefault(),u.stopPropagation(),new di(o,t).showAtPosition({x:u.clientX,y:u.clientY})}))}addTaskCount(e,t){if(!this.query.queryLayoutOptions.hideTaskCount){let n=Xe("div",e);n.classList.add("task-count"),n.textContent=t.totalTasksCountDisplayText()}}isFilenameUnique({task:e},t){let n=e.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return t.filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let e=[];for(let t of this.query.grouping)e.push(t.property);return e.join(",")}};var Tc=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 A(this,null,function*(){let i=new Qh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,tasksFile:new ut(n.sourcePath)});n.addChild(i),i.load()})}},Qh=class extends bc.MarkdownRenderChild{constructor({app:t,plugin:n,events:i,container:s,source:a,tasksFile:o}){super(s);this.queryResultsRenderer=new yc(this.containerEl.className,a,o,bc.MarkdownRenderer.renderMarkdown,this),this.app=t,this.plugin=n,this.events=i}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,i=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.queryResultsRenderer.query=Bo(this.queryResultsRenderer.source,nr.getInstance(),this.queryResultsRenderer.tasksFile),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return A(this,arguments,function*({tasks:t,state:n}){var a;let s=Xe("div",this.containerEl);yield this.queryResultsRenderer.render(n,t,s,{allTasks:this.plugin.getTasks(),allMarkdownFiles:this.app.vault.getMarkdownFiles(),backlinksClickHandler:sL,backlinksMousedownHandler:aL,editTaskPencilClickHandler:iL}),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}};function iL(r,e,t){r.preventDefault();let n=s=>A(this,null,function*(){yield vr({originalTask:e,newTasks:_t.removeInferredStatusIfNeeded(e,s)})});new ti({app,task:e,onSubmit:n,allTasks:t}).open()}function sL(r,e){return A(this,null,function*(){let t=yield ph(e,app.vault);if(t){let[n,i]=t,s=app.workspace.getLeaf($k.Keymap.isModEvent(r));r.preventDefault(),yield s.openFile(i,{eState:{line:n}})}})}function aL(r,e){return A(this,null,function*(){if(r.button===1){let t=yield ph(e,app.vault);if(t){let[n,i]=t,s=app.workspace.getLeaf("tab");r.preventDefault(),yield s.openFile(i,{eState:{line:n}})}}})}var ce=require("obsidian");var _c=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 Gk(r,e){return r.findIndex(t=>t.symbol===e)}function jn(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function oL(r,e){let t=re.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${jn(r.symbol)} is ${jn(t)}: you may wish to review this type.`))}function uL(r,e,t){let n=Gk(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${jn(e.nextStatusSymbol)} is unknown: create a status with symbol ${jn(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let i=r[n];if(i){if(i.type!=="TODO"&&i.type!=="IN_PROGRESS"){let s="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",a=[`This \`DONE\` status is followed by ${jn(i.type)}, not \`TODO\` or \`IN_PROGRESS\`.`,"If used to complete a recurring task, it will instead be followed by `TODO` or `IN_PROGRESS`, to ensure the next task matches the `not done` filter.",`See [Recurring Tasks and Custom Statuses](${s}).`].join("
");t.push(a)}}else t.push("Unexpected failure to find the next status.")}function lL(r,e,t){let n=[];return e.symbol===re.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):Gk(r,e.symbol)!=t?(n.push(`Duplicate symbol '${jn(e.symbol)}': this status will be ignored.`),n):(oL(e,n),uL(r,e,n),n)}function Yk(r){let e=new _c(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Le.allStatuses(r);return t.forEach((n,i)=>{e.addRow([jn(n.symbol),jn(n.nextStatusSymbol),n.name,jn(n.type),lL(t,n,i).join("
")])}),e.markdown}function Bk(r,e,t,n){let s=Yk(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 These are the status values in the Core and Custom statuses sections. ${s} ## Loaded Settings These are the settings actually used by Tasks. ${a}`}function Hk(){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 zk(){return[[" ","To Do","x","TODO"],["/","In Progress","x","IN_PROGRESS"],["x","Done"," ","DONE"],["-","Cancelled"," ","CANCELLED"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["i","Infomation","x","TODO"],["S","Amount","x","TODO"],["*","Star","x","TODO"],["b","Bookmark","x","TODO"],["\u201C","Quote","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["I","Idea","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function Kk(){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 Qk(){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 Xk(){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 Zk(){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 Jk(){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 eE=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},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:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note 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.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Br=require("obsidian");var Ki=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,i,s]=e,a=[];if(a.push(...this.validateType(s)),t===i&&s!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=re.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return Ki.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Ki.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=Rt[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,i=new xe,s=n==="X"?"x":n,a=i.bySymbol(s);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 Qi=new Ki,ir=class extends Br.Modal{constructor(t,n,i){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=i}statusConfiguration(){return new Qe(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return A(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new Br.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=>{i=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,ir.setValid(l,Qi.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{ir.setValid(i,Qi.validateSymbol(this.statusConfiguration()))});let s;new Br.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{s=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,ir.setValid(l,Qi.validateName(this.statusConfiguration()))})}).then(l=>{ir.setValid(s,Qi.validateName(this.statusConfiguration()))});let a;new Br.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,ir.setValid(l,Qi.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{ir.setValid(a,Qi.validateNextSymbol(this.statusConfiguration()))}),new Br.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(d=>{l.addOption(d,d)}),l.setValue(this.type).onChange(d=>{this.type=re.getTypeFromStatusTypeString(d)})}),re.tasksPluginCanCreateCommandsForStatuses()&&new Br.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=>A(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new Br.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>A(this,null,function*(){let c=Qi.validate(this.statusConfiguration());if(c.length>0){let d=c.join(` `)+` Fix errors before saving.`;new Br.Notice(d);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(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?ir.removeValidationError(t):ir.setValidationError(t)}};var Nt=class extends ce.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 A(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),new ce.Setting(t).setName("Task Format").setDesc(Nt.createFragmentWithHTML('

The format that Tasks uses to read and write tasks.

Important: Tasks currently only supports one format at a time. Selecting Dataview will currently stop Tasks reading its own emoji signifiers.

See the documentation.

')).addDropdown(l=>{for(let c of Object.keys(Fr))l.addOption(c,Fr[c].displayName);l.setValue(Q().taskFormat).onChange(c=>A(this,null,function*(){ze({taskFormat:c}),yield this.plugin.saveSettings()}))}),new ce.Setting(t).setName("Global task filter").setHeading();let n=null;new ce.Setting(t).setName("Global filter").setDesc(Nt.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(l=>{l.setPlaceholder("e.g. #task or TODO").setValue(ve.getInstance().get()).onChange(c=>A(this,null,function*(){ze({globalFilter:c}),ve.getInstance().set(c),yield this.plugin.saveSettings(),fn(n,c.length>0)}))}),n=new ce.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(l=>{let c=Q();l.setValue(c.removeGlobalFilter).onChange(d=>A(this,null,function*(){ze({removeGlobalFilter:d}),ve.getInstance().setRemoveGlobalFilter(d),yield this.plugin.saveSettings()}))}),fn(n,Q().globalFilter.length>0),new ce.Setting(t).setName("Global Query").setHeading(),pL(new ce.Setting(t).setDesc(Nt.createFragmentWithHTML('

A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.

See the documentation.

')).addTextArea(l=>{let c=Q();l.inputEl.rows=4,l.setPlaceholder(`# For example... path does not include _templates/ limit 300 show urgency`).setValue(c.globalQuery).onChange(d=>A(this,null,function*(){ze({globalQuery:d}),nr.getInstance().set(d),yield this.plugin.saveSettings()}))})),new ce.Setting(t).setName("Task Statuses").setHeading();let{headingOpened:i}=Q();eE.forEach(l=>{var f;let c=(f=i[l.text])!=null?f:!0,d=this.addOneSettingsBlock(t,l,i);d.open=c}),new ce.Setting(t).setName("Dates").setHeading(),new ce.Setting(t).setName("Set created date on every added task").setDesc(Nt.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.

See the documentation.

`)).addToggle(l=>{let c=Q();l.setValue(c.setCreatedDate).onChange(d=>A(this,null,function*(){ze({setCreatedDate:d}),yield this.plugin.saveSettings()}))}),new ce.Setting(t).setName("Set done date on every completed task").setDesc(Nt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.

See the documentation.

')).addToggle(l=>{let c=Q();l.setValue(c.setDoneDate).onChange(d=>A(this,null,function*(){ze({setDoneDate:d}),yield this.plugin.saveSettings()}))}),new ce.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(Nt.createFragmentWithHTML('Enabling this will add a timestamp \u274C YYYY-MM-DD at the end when a task is toggled to cancelled.

See the documentation.

')).addToggle(l=>{let c=Q();l.setValue(c.setCancelledDate).onChange(d=>A(this,null,function*(){ze({setCancelledDate:d}),yield this.plugin.saveSettings()}))}),new ce.Setting(t).setName("Dates from file names").setHeading();let s=null,a=null;new ce.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Nt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
By default, Tasks plugin will match both YYYY-MM-DD and YYYYMMDD date formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(l=>{let c=Q();l.setValue(c.useFilenameAsScheduledDate).onChange(d=>A(this,null,function*(){ze({useFilenameAsScheduledDate:d}),fn(s,d),fn(a,d),yield this.plugin.saveSettings()}))}),s=new ce.Setting(t).setName("Additional filename date format as Scheduled date for undated tasks").setDesc(Nt.createFragmentWithHTML('An additional date format that Tasks plugin will recogize when using the file name as the Scheduled date for undated tasks.

Syntax Reference

')).addText(l=>{let c=Q();l.setPlaceholder("example: MMM DD YYYY").setValue(c.filenameAsScheduledDateFormat).onChange(d=>A(this,null,function*(){ze({filenameAsScheduledDateFormat:d}),yield this.plugin.saveSettings()}))}),a=new ce.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(l=>A(this,null,function*(){let c=Q();yield this.plugin.saveSettings(),l.setValue(Nt.renderFolderArray(c.filenameAsDateFolders)).onChange(d=>A(this,null,function*(){let f=Nt.parseCommaSeparatedFolders(d);ze({filenameAsDateFolders:f}),yield this.plugin.saveSettings()}))})),fn(s,Q().useFilenameAsScheduledDate),fn(a,Q().useFilenameAsScheduledDate),new ce.Setting(t).setName("Recurring tasks").setHeading(),new ce.Setting(t).setName("Next recurrence appears on the line below").setDesc(Nt.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.

See the documentation.

')).addToggle(l=>{let{recurrenceOnNextLine:c}=Q();l.setValue(c).onChange(d=>A(this,null,function*(){ze({recurrenceOnNextLine:d}),yield this.plugin.saveSettings()}))}),new ce.Setting(t).setName("Auto-suggest").setHeading();let o=null,u=null;new ce.Setting(t).setName("Auto-suggest task content").setDesc(Nt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.

See the documentation.

')).addToggle(l=>{let c=Q();l.setValue(c.autoSuggestInEditor).onChange(d=>A(this,null,function*(){ze({autoSuggestInEditor:d}),yield this.plugin.saveSettings(),fn(o,d),fn(u,d)}))}),o=new ce.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(l=>{let c=Q();l.setLimits(0,3,1).setValue(c.autoSuggestMinMatch).setDynamicTooltip().onChange(d=>A(this,null,function*(){ze({autoSuggestMinMatch:d}),yield this.plugin.saveSettings()}))}),u=new ce.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(l=>{let c=Q();l.setLimits(3,20,1).setValue(c.autoSuggestMaxItems).setDynamicTooltip().onChange(d=>A(this,null,function*(){ze({autoSuggestMaxItems:d}),yield this.plugin.saveSettings()}))}),fn(o,Q().autoSuggestInEditor),fn(u,Q().autoSuggestInEditor),new ce.Setting(t).setName("Dialogs").setHeading(),new ce.Setting(t).setName("Provide access keys in dialogs").setDesc(Nt.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.

See the documentation.

')).addToggle(l=>{let c=Q();l.setValue(c.provideAccessKeys).onChange(d=>A(this,null,function*(){ze({provideAccessKeys:d}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:K({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,ze({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new ce.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=s.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}return n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!Lv(o.featureFlag))&&(o.type==="checkbox"?new ce.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=Q();l.generalSettings[o.settingName]||Ni(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>A(this,null,function*(){Ni(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new ce.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=Q();l.generalSettings[o.settingName]||Ni(o.settingName,o.initialValue);let c=d=>A(this,null,function*(){Ni(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ce.debounce)(c,500,!0))}):o.type==="textarea"?new ce.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=Q();l.generalSettings[o.settingName]||Ni(o.settingName,o.initialValue);let c=d=>A(this,null,function*(){Ni(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ce.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](s,this),o.notice!==null)){let u=s.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}}),s}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:i}=Q();i.coreStatuses.forEach(a=>{tE(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new ce.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>A(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,d=this.plugin.manifest.version,f=xe.getInstance(),m=Bk(i,f,o,d),g=yield this.app.vault.create(c,m);yield this.app.workspace.getLeaf(!0).openFile(g)})),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:i}=Q();i.customStatuses.forEach(l=>{tE(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new ce.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>A(this,null,function*(){Le.addStatus(i.customStatuses,new Qe("","","",!1,"TODO")),yield ia(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",Hk()],["Aura Theme",Vk()],["Border Theme",zk()],["Ebullientworks Theme",Kk()],["ITS Theme & SlRvb Checkboxes",Qk()],["Minimal Theme",Zk()],["Things Theme",Jk()],["LYT Mode Theme (Dark mode only)",Xk()]];for(let[l,c]of a)new ce.Setting(t).addButton(f=>{let m=`${l}: Add ${c.length} supported Statuses`;f.setButtonText(m).onClick(()=>A(this,null,function*(){yield fL(c,i,n)}))}).infoEl.remove();new ce.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>A(this,null,function*(){let d=this.plugin.getTasks().map(m=>m.status),f=xe.getInstance().findUnknownStatuses(d);f.length!==0&&(f.forEach(m=>{Le.addStatus(i.customStatuses,m)}),yield ia(i,n))}))}).infoEl.remove(),new ce.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>A(this,null,function*(){Le.resetAllCustomStatuses(i),yield ia(i,n)}))}).infoEl.remove()}},zo=Nt;zo.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function tE(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new re(e).previewText();let u=new ce.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>A(this,null,function*(){Le.deleteStatus(t,e)&&(yield ia(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>A(this,null,function*(){let c=new ir(s,e,a);c.onClose=()=>A(this,null,function*(){c.saved&&Le.replaceStatus(t,e,c.statusConfiguration())&&(yield ia(n,i))}),c.open()}))}),u.infoEl.remove()}function fL(r,e,t){return A(this,null,function*(){Le.bulkAddStatusCollection(e,r).forEach(i=>{new ce.Notice(i)}),yield ia(e,t)})}function ia(r,e){return A(this,null,function*(){ze({statusSettings:r}),Le.applyToStatusRegistry(r,xe.getInstance()),yield e.saveSettings(!0)})}function pL(r){let{settingEl:e,infoEl:t,controlEl:n}=r,i=n.querySelector("textarea");i!==null&&(e.style.display="block",t.style.marginRight="0px",i.style.minWidth="-webkit-fill-available")}function fn(r,e){r?r.setVisibility(e):console.warn("Setting has not be initialised. Can update visibility of setting UI - in setSettingVisibility")}var fi=require("obsidian");function mL(r){console.error(r),new fi.Notice(r+` This message has been written to the console. `,1e4)}var vc=class extends fi.EditorSuggest{constructor(t,n,i){super(t);this.settings=n,this.plugin=i,t.scope.register([],"Tab",()=>{var a;let s=(a=this.context)==null?void 0:a.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return Iv(s,t,n)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var c,d,f;let n=t.query,i=t.editor.getCursor(),s=this.plugin.getTasks(),a=s.find(m=>m.taskLocation.path==t.file.path&&m.taskLocation.lineNumber==i.line),o=this.getMarkdownFileInfo(t),u=this.canSaveEdits(o);return((f=(d=(c=Oo()).buildSuggestions)==null?void 0:d.call(c,n,i.ch,this.settings,s,u,a))!=null?f:[]).map(m=>fe(K({},m),{context:t}))}getMarkdownFileInfo(t){return t.editor.cm.state.field(fi.editorInfoField)}canSaveEdits(t){return t instanceof fi.MarkdownView}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){return A(this,null,function*(){var l,c,d;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(c=(l=i==null?void 0:i.cm)==null?void 0:l.contentDOM)==null||c.dispatchEvent(f);return}if(t.taskItDependsOn!=null){let f=il(t.taskItDependsOn,this.plugin.getTasks().map(m=>m.id));if(t.appendText+=` ${f.id}`,t.taskItDependsOn!==f)if(t.context.file.path==f.path){let m=t.taskItDependsOn.originalMarkdown,g={line:t.taskItDependsOn.lineNumber,ch:0},b={line:t.taskItDependsOn.lineNumber,ch:m.length},k=t.context.editor.getRange(g,b);if(k!==m){let _=`Error adding new ID, due to mismatched data in Tasks memory and the editor: task line in memory: '${t.taskItDependsOn.originalMarkdown}' task line in editor: '${k}' file: '${f.path}' `;mL(_);return}t.context.editor.replaceRange(f.toFileLineString(),g,b)}else vr({originalTask:t.taskItDependsOn,newTasks:f})}let s=t.context.editor.getCursor(),a={line:s.line,ch:(d=t.insertAt)!=null?d:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length});let u=this.getMarkdownFileInfo(t.context);this.canSaveEdits(u)&&(yield u.save())})}};var rE=(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 nE=(r,e)=>{let t=Ol({line:"",path:""});return new ti({app:r,task:t,onSubmit:e,allTasks:[]})};var iE=r=>({createTaskLineModal:()=>rE(r,nE),executeToggleTaskDoneCommand:(e,t)=>bh(e,t).text});var wc=class extends sE.Plugin{get apiV1(){return iE(this.app)}onload(){return A(this,null,function*(){Mt.registerConsoleLogger(),zm("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=Q();Mt.configure(t),this.addSettingTab(new zo({plugin:this})),xw({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new lc({obsidianEvents:this.app.workspace});this.cache=new Es({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace,events:n}),this.inlineRenderer=new mc({plugin:this}),this.queryRenderer=new Tc({plugin:this,events:n}),this.registerEditorExtension(Wk()),this.registerEditorSuggest(new vc(this.app,Q(),this)),new Dl({plugin:this})})}loadTaskStatuses(){return A(this,null,function*(){let{statusSettings:t}=Q();Le.applyToStatusRegistry(t,xe.getInstance())})}onunload(){var t;zm("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return A(this,null,function*(){let t=yield this.loadData();ze(t),t=Q(),ve.getInstance().set(t.globalFilter),ve.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),nr.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return A(this,null,function*(){yield this.saveData(Q())})}getTasks(){return this.cache===void 0?[]:this.cache.getTasks()}}; /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 * * Copyright (c) 2013 hij1nx * Licensed under the MIT license. */ /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ /* nosourcemap */