"use strict";var_T=Object.create;varvi=Object.defineProperty,TT=Object.defineProperties,bT=Object.getOwnPropertyDescriptor,vT=Object.getOwnPropertyDescriptors,ET=Object.getOwnPropertyNames,Pf=Object.getOwnPropertySymbols,wT=Object.getPrototypeOf,Cf=Object.prototype.hasOwnProperty,OT=Object.prototype.propertyIsEnumerable;varxf=(r,e,t)=>einr?vi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Re=(r,e)=>{for(vartine||(e={}))Cf.call(e,t)&&xf(r,t,e[t]);if(Pf)for(vartofPf(e))OT.call(e,t)&&xf(r,t,e[t]);returnr},wt=(r,e)=>TT(r,vT(e));varp=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),DT=(r,e)=>{for(vartine)vi(r,t,{get:e[t],enumerable:!0})},Nf=(r,e,t,n)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofET(e))!Cf.call(r,i)&&i!==t&&vi(r,i,{get:()=>e[i],enumerable:!(n=bT(e,i))||n.enumerable});returnr};varXs=(r,e,t)=>(t=r!=null?_T(wT(r)):{},Nf(e||!r||!r.__esModule?vi(t,"default",{value:r,enumerable:!0}):t,r)),RT=r=>Nf(vi({},"__esModule",{value:!0}),r);varN=(r,e,t)=>newPromise((n,i)=>{vars=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())});varsp=p((EA,ra)=>{varLf,qf,Wf,Yf,jf,$f,Bf,Gf,Hf,ea,Uo,zf,Kf,Vf,kn,Xf,Zf,Qf,Jf,ep,tp,rp,np,ip,ta;(function(r){vare=typeofglobal=="object"?global:typeofself=="object"?self:typeofthis=="object"?this:{};typeofdefine=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeofra=="object"&&typeofra.exports=="object"?r(t(e,t(ra.exports))):r(t(e));functiont(n,i){returnn!==e&&(typeofObject.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){returnn[s]=i?i(s,a):a}}})(function(r){vare=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(n,i){n.__proto__=i}||function(n,i){for(varsini)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};Lf=function(n,i){if(typeofi!="function"&&i!==null)thrownewTypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);functions(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,news)},qf=Object.assign||function(n){for(vari,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(varoini)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}returnn},Wf=function(n,i){vars={};for(varainn)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeofObject.getOwnPropertySymbols=="function")for(varo=0,a=Object.getOwnPropertySymbols(n);o<a.length;o++)i.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(n,a[o])&&(s[a[o]]=n[a[o]]);returns},Yf=function(n,i,s,a){varo=arguments.length,u=o<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,l;if(typeofReflect=="object"&&typeofReflect.decorate=="function")u=Reflect.decorate(n,i,s,a);elsefor(varc=n.length-1;c>=0;c--)(l=n[c])&&(u=(o<3?l(u):o>3?l(i,s,u):l(i,s))||u);returno>3&&u&&Object.defineProperty(i,s,u),u},jf=function(n,i){returnfunction(s,a){i(s,a,n)}},$f=function(n,i){if(typeofReflect=="object"&&typeofReflect.metadata=="function")returnReflect.metadata(n,i)},Bf=function(n,i,s,a){functiono(u){returnuinstanceofs?u:news(function(l){l(u)})}returnnew(s||(s=Promise))(function(u,l){functionc(h){try{f(a.next(h))}catch(y){l(y)}}functiond(h){try{f(a.throw(h))}catch(y){l(y)}}functionf(h){h.done?u(h.value):o(h.value).then(c,d)}f((a=a.apply(n,i||[])).next())})},Gf=function(n,i){vars={label:0,sent:function(){if(u[0]&1)throwu[1];returnu[1]},trys:[],ops:[]},a,o,u,l;returnl={next:c(0),throw:c(1),return:c(2)},typeofSymbol=="function"&&(l[Symbol.iterator]=function(){returnthis}),l;functionc(f){returnfunction(h){returnd([f,h])}}functiond(f){if(a)thrownewTypeError("Generator is already executing.");for(;s;)try{if(a=1,o&&(u=f[0]&2?o.return:f[0]?o.throw||((u=o.return)&&u.call(o),0):o.next)&&!(u=u.call(o,f[1])).done)returnu;switch(o=0,u&&(f=[f[0]&2,u.value]),f[0]){case0:case1:u=f;break;case4:returns.label++,{value:f[1],done:!1};case5:s.label++,o=f[1],
`).map(FT).filter(function(t){return t!==null});return Je(Je({},e[0]),e[1])}function Ri(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],i=t[2];return n&&(e.tzid=n),e.dtstart=I.untilStringToDate(i),e}function FT(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return mp(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return mp(r);case"DTSTART":return Ri(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function mp(r){var e=r.replace(/^RRULE:/i,""),t=Ri(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":t.freq=G[o.toUpperCase()];break;case"WKST":t.wkst=Dt[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=UT(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=LT(o);break;case"DTSTART":case"TZID":var c=Ri(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=I.untilStringToDate(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function UT(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(yp)}return yp(r)}function yp(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function LT(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Dt[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var i=Number(n[1]),s=n[2],a=Dt[s].weekday;return new Se(a,i)})}var Vr=function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=I.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){var e;if(this.isUTC)return this.date;var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(this.date.toLocaleString(void 0,{timeZone:t})),i=new Date(this.date.toLocaleString(void 0,{timeZone:(e=this.tzid)!==null&&e!==void 0?e:"UTC"})),s=i.getTime()-n.getTime();return new Date(this.date.getTime()-s)},r}();function Mi(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(Di),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!X(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!pe(o)||Be(o)&&!o.length)){switch(a){case"FREQ":u=k.FREQUENCIES[r.freq];break;case"WKST":pt(o)?u=new Se(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=Ff(o).map(function(h){return h instanceof Se?h:Be(h)?new Se(h[0],h[1]):new Se(h)}).toString();break;case"DTSTART":t=qT(o,r.tzid);break;case"UNTIL":u=I.timeToUntilString(o,!r.tzid);break;default:if(Be(o)){for(var l=[],c=0;c<o.length;c++)l[c]=String(o[c]);u=l.toString()}else u=String(o)}u&&e.push([a,u])}}var d=e.map(function(h){var y=h[0],m=h[1];return"".concat(y,"=").concat(m.toString())}).join(";"),f="";return d!==""&&(f="RRULE:".concat(d)),[t,f].filter(function(h){return!!h}).join(`
`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}(k);function Fp(r,e){if(!(r instanceof k))throw new TypeError(String(r)+" is not RRule instance");X(e.map(String),String(r))||e.push(r)}function Up(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");X(e.map(Number),Number(r))||(e.push(r),I.sort(e))}function Lp(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return I.timeToUntilString(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}function It(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?-1:!r.isValid()&&e.isValid()||r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var Ie=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:i,scheduledDate:s,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=i,this.scheduledDate=s,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:i}){try{let s=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(s==null)return null;let a=s[1].trim(),o=s[2]!==void 0,u=k.parseText(a);if(u!==null){let l=null;i?l=window.moment(i):n?l=window.moment(n):t&&(l=window.moment(t)),!o&&l!==null?u.dtstart=window.moment(l).startOf("day").utc(!0).toDate():u.dtstart=window.moment().startOf("day").utc(!0).toDate();let c=new k(u);return new Ie({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:i})}}catch(s){}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){var t;let e;if(this.baseOnToday){let n=window.moment(),i=new k(wt(Re({},this.rrule.origOptions),{dtstart:n.startOf("day").utc(!0).toDate()}));e=this.nextAfter(n.endOf("day"),i)}else{let n=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");e=this.nextAfter(n,this.rrule)}if(e!==null){let n=null,i=null,s=null;if(this.referenceDate){if(this.startDate){let a=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(a.asDays()),"days")}if(this.scheduledDate){let a=window.moment.duration(this.scheduledDate.diff(this.referenceDate));i=window.moment(e),i.add(Math.round(a.asDays()),"days")}if(this.dueDate){let a=window.moment.duration(this.dueDate.diff(this.referenceDate));s=window.moment(e),s.add(Math.round(a.asDays()),"days")}}return{startDate:n,scheduledDate:i,dueDate:s}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||It(this.startDate,e.startDate)!==0||It(this.scheduledDate,e.scheduledDate)!==0||It(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=Ie.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=Ie.nextAfterYears(e,n,t,a[1])),Ie.addTimezone(n).toDate()}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Ie.isSkippingTooManyMonths(e,t,s);)t=Ie.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let i=t.month()-e.month();return i+=(t.year()-e.year())*12,i>n}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Ie.isSkippingTooManyYears(e,t,s);)t=Ie.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 k(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};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||
`),{globalFilter:f}=U(),h,y=0;for(let g of l){if(g.position.start.line<r.sectionStart||g.task===void 0)continue;if(d[g.position.start.line].includes(f)){if(y===r.sectionIndex){h=g;break}y++}}if(h===void 0){console.error("Tasks: could not find task to toggle in the file.");return}let m=[...d.slice(0,h.position.start.line),...e.map(g=>g.toFileLineString()),...d.slice(h.position.start.line+1)];yield t.modify(o,m.join(`
Fixerrorsbeforesaving.`;new Vt.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?bt.removeValidationError(t):bt.setValidationError(t)}};var pi=class extends he.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 N(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Global filter Settings"}),new he.Setting(t).setName("Global task filter").setDesc(pi.createFragmentWithHTML('<p><b>Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.</b></p><p>Use a global filter if you want Tasks to only act on a subset of your "<code>- [ ]</code>" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.<p><p>For example, if you set the global filter to <code>#task</code>, the Tasks plugin will only handle checklist items tagged with <code>#task</code>.</br>Other checklist items will remain normal checklist items and not appear in queries or get a done date set.</p><p>See the <a href="https://obsidian-tasks-group.github.io/obsidian-tasks/getting-started/global-filter/">documentation</a>.</p>')).addText(i=>{let s=U();i.setPlaceholder("e.g. #task or TODO").setValue(s.globalFilter).onChange(a=>N(this,null,function*(){it({globalFilter:a}),yield this.plugin.saveSettings()}))}),new he.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(i=>{let s=U();i.setValue(s.removeGlobalFilter).onChange(a=>N(this,null,function*(){it({removeGlobalFilter:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=U();pT.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new he.Setting(t).setName("Set done date on every completed task").setDesc("Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done").addToggle(i=>{let s=U();i.setValue(s.setDoneDate).onChange(a=>N(this,null,function*(){it({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new he.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(pi.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.</br><p>See the <a href="https://obsidian-tasks-group.github.io/obsidian-tasks/getting-started/use-filename-as-default-date/">documentation</a>.</p>')).addToggle(i=>{let s=U();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>N(this,null,function*(){it({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new he.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(i=>N(this,null,function*(){let s=U();yield this.plugin.saveSettings(),i.setValue(pi.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>N(thi
`}),n=n.slice(0,t.autoSuggestMaxItems),n}function aA(r){if(Object.values(Ce).some(e=>e.length>0&&r.includes(e)))return!0}function oA(r,e){let t=[];return r.includes(qt)||t.push({displayText:`${qt}duedate`,appendText:`${qt}`}),r.includes(Ut)||t.push({displayText:`${Ut}startdate`,appendText:`${Ut}`}),r.includes(Lt)||t.push({displayText:`${Lt}scheduleddate`,appendText:`${Lt}`}),aA(r)||(t.push({displayText:`${Ce.High}highpriority`,appendText:`${Ce.High}`}),t.push({displayText:`${Ce.Medium}mediumpriority`,appendText:`${Ce.Medium}`}),t.push({displayText:`${Ce.Low}lowpriority`,appendText:`${Ce.Low}`})),r.includes(Ft)||t.push({displayText:`${Ft}recurring(repeat)`,appendText:`${Ft}`}),t}function uA(r,e,t){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp(`([${sA}])\\s*([0-9a-zA-Z]*)`,"ug"),a=hf(r,s,e);if(a&&a.length>=2){let o=a[1],u=a[2];if(u.length<t.autoSuggestMinMatch)return[];let l=u&&u.length>1?Er.parseDate(Zn(u),!0):null;l&&l.isValid()&&i.push({displayText:`${l.format(S.dateFormat)}`,appendText:`${o}${l.format(S.dateFormat)}`,insertAt:a.index,insertSkip:a[0].length});let c=1,d=5,f=n.filter(h=>u&&u.length>=c&&h.toLowerCase().includes(u.toLowerCase())).slice(0,d);f.length===0&&(f=n.slice(0,d));for(let h of f){let m=`${Er.parseDate(h,!0).format(S.dateFormat)}`;i.push({suggestionType:"match",displayText:`${h}(${m})`,appendText:`${o}${m}`,insertAt:a.index,insertSkip:a[0].length})}}return i}function lA(r,e,t){var o;let n=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],i=[],s=new RegExp(`(${Ft})\\s*([0-9a-zA-Z]*)`,"ug"),a=hf(r,s,e);if(a&&a.length>=2){let u=a[1],l=a[2];if(l.length<t.autoSuggestMinMatch)return[];if(l.length>0){let h=(o=Ie.fromText({recurrenceRuleText:l,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:o.toText();if(h){let y=`${u}${h}`;if(i.push({suggestionType:"match",displayText:`\u2705${h}`,appendText:y,insertAt:a.index,insertSkip:a[0].length}),a[0]==y)return[]}}let c=1,d=t.autoSuggestMaxItems/2,f=n.filter(h=>l&&l.length>=c&&h.toLowerCase().includes(l.toLowerCase())).slice(0,d);f.length===0&&l.trim().length===0&&(f=n.slice(0,d));for(let h of f)i.push({suggestionType:"match",displayText:`${h}`,appendText:`${u}${h}`,insertAt:a.index,insertSkip:a[0].length})}return i}function hf(r,e,t){let n=r.matchAll(e);for(let i of n)if((i==null?void 0:i.index)&&i.index<=t&&t<=i.index+i[0].length)return i;return[]}var Po=class extends yT.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return s.contains(this.settings.globalFilter)&&s.match(S.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){let n=t.query,i=t.editor.getCursor(),s=mT(n,i.ch,this.settings),a=[];for(let o of s)a.push(wt(Re({},o),{context:t}));return a}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let d=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(d);return}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c: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})}};var xo=class extends gT.Plugin{onload(){return N(this,null,function*(){console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new Ws({plugin:this})),jp({metadataCache:this.app.metadataCache,vault:this.app.vault}),yield this.loadTaskStatuses();let t=new so({obsidianEvents:this.app.workspace});this.cache=new Zr({metadataCache:this.app.metadataCache,vault:this.a