/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var BLe=Object.create;var Qh=Object.defineProperty;var DZ=Object.getOwnPropertyDescriptor;var qLe=Object.getOwnPropertyNames;var HLe=Object.getPrototypeOf,ULe=Object.prototype.hasOwnProperty;var CZ=r=>{throw TypeError(r)};var VLe=(r,e,t)=>e in r?Qh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var v=(r,e)=>()=>(r&&(e=r(r=0)),e);var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),et=(r,e)=>{for(var t in e)Qh(r,t,{get:e[t],enumerable:!0})},PZ=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qLe(e))!ULe.call(r,i)&&i!==t&&Qh(r,i,{get:()=>e[i],enumerable:!(n=DZ(e,i))||n.enumerable});return r};var Ke=(r,e,t)=>(t=r!=null?BLe(HLe(r)):{},PZ(e||!r||!r.__esModule?Qh(t,"default",{value:r,enumerable:!0}):t,r)),eD=r=>PZ(Qh({},"__esModule",{value:!0}),r),Ze=(r,e,t,n)=>{for(var i=n>1?void 0:n?DZ(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Qh(e,t,i),i};var M=(r,e,t)=>VLe(r,typeof e!="symbol"?e+"":e,t),_Z=(r,e,t)=>e.has(r)||CZ("Cannot "+t);var La=(r,e,t)=>(_Z(r,e,"read from private field"),t?t.call(r):e.get(r)),gm=(r,e,t)=>e.has(r)?CZ("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Bc=(r,e,t,n)=>(_Z(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var WLe,Nwt,tD,MZ,BO,qO,YLe,AZ,Rwt,GLe,KLe,Owt,HO,Jh=v(()=>{WLe=Math.pow(10,8)*24*60*60*1e3,Nwt=-WLe,tD=6048e5,MZ=864e5,BO=6e4,qO=36e5,YLe=3600,AZ=YLe*24,Rwt=AZ*7,GLe=AZ*365.2425,KLe=GLe/12,Owt=KLe*3,HO=Symbol.for("constructDateFrom")});function bn(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&HO in r?r[HO](e):r instanceof Date?new r.constructor(e):new Date(e)}var Ro=v(()=>{Jh()});function it(r,e){return bn(e||r,r)}var ln=v(()=>{Ro()});function ym(r,e,t){let n=it(r,t==null?void 0:t.in);return isNaN(e)?bn((t==null?void 0:t.in)||r,NaN):(e&&n.setDate(n.getDate()+e),n)}var rD=v(()=>{Ro();ln()});function nD(r,e,t){let n=it(r,t==null?void 0:t.in);if(isNaN(e))return bn((t==null?void 0:t.in)||r,NaN);if(!e)return n;let i=n.getDate(),s=bn((t==null?void 0:t.in)||r,n.getTime());s.setMonth(n.getMonth()+e+1,0);let a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}var UO=v(()=>{Ro();ln()});var IZ=v(()=>{});var NZ=v(()=>{});var RZ=v(()=>{});var OZ=v(()=>{});var LZ=v(()=>{});var FZ=v(()=>{});var $Z=v(()=>{});function wl(){return ZLe}var ZLe,Xh=v(()=>{ZLe={}});function Xi(r,e){var o,l,c,d,u,p,m,f;let t=wl(),n=(f=(m=(d=(c=e==null?void 0:e.weekStartsOn)!=null?c:(l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)!=null?d:t.weekStartsOn)!=null?m:(p=(u=t.locale)==null?void 0:u.options)==null?void 0:p.weekStartsOn)!=null?f:0,i=it(r,e==null?void 0:e.in),s=i.getDay(),a=(s{Xh();ln()});function vm(r,e){return Xi(r,{...e,weekStartsOn:1})}var qb=v(()=>{eg()});function iD(r,e){let t=it(r,e==null?void 0:e.in),n=t.getFullYear(),i=bn(t,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);let s=vm(i),a=bn(t,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=vm(a);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}var sD=v(()=>{Ro();qb();ln()});function VO(r){let e=it(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}var jZ=v(()=>{ln()});function aD(r,...e){let t=bn.bind(null,r||e.find(n=>typeof n=="object"));return e.map(t)}var WO=v(()=>{Ro()});function Oo(r,e){let t=it(r,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}var oD=v(()=>{ln()});function zZ(r,e,t){let[n,i]=aD(t==null?void 0:t.in,r,e),s=Oo(n),a=Oo(i),o=+s-VO(s),l=+a-VO(a);return Math.round((o-l)/MZ)}var YO=v(()=>{jZ();WO();Jh();oD()});function BZ(r,e){let t=iD(r,e),n=bn((e==null?void 0:e.in)||r,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),vm(n)}var GO=v(()=>{Ro();sD();qb()});var qZ=v(()=>{});var HZ=v(()=>{});var UZ=v(()=>{});var VZ=v(()=>{});var WZ=v(()=>{});function YZ(r,e,t){return ym(r,e*7,t)}var GZ=v(()=>{rD()});function KZ(r,e,t){return nD(r,e*12,t)}var ZZ=v(()=>{UO()});var QZ=v(()=>{});var JZ=v(()=>{});var XZ=v(()=>{});var eQ=v(()=>{});var tQ=v(()=>{});var rQ=v(()=>{});var nQ=v(()=>{});var iQ=v(()=>{});var sQ=v(()=>{});var aQ=v(()=>{});function KO(r,e,t){let[n,i]=aD(t==null?void 0:t.in,r,e);return+Oo(n)==+Oo(i)}var oQ=v(()=>{WO();oD()});function lQ(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}var ZO=v(()=>{});function Kn(r){return!(!lQ(r)&&typeof r!="number"||isNaN(+it(r)))}var QO=v(()=>{ZO();ln()});var cQ=v(()=>{});var dQ=v(()=>{});var uQ=v(()=>{});var pQ=v(()=>{});var mQ=v(()=>{});var fQ=v(()=>{});var hQ=v(()=>{});var gQ=v(()=>{});var yQ=v(()=>{});var vQ=v(()=>{});var bQ=v(()=>{});var TQ=v(()=>{});var kQ=v(()=>{});var wQ=v(()=>{});function Hb(r,e){let t=it(r,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}var SQ=v(()=>{ln()});function lD(r,e){let t=it(r,e==null?void 0:e.in),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}var xQ=v(()=>{ln()});var EQ=v(()=>{});var DQ=v(()=>{});var CQ=v(()=>{});var PQ=v(()=>{});var _Q=v(()=>{});var MQ=v(()=>{});var AQ=v(()=>{});var IQ=v(()=>{});var NQ=v(()=>{});var RQ=v(()=>{});var OQ=v(()=>{});var LQ=v(()=>{});var FQ=v(()=>{});var $Q=v(()=>{});function cD(r,e){let t=it(r,e==null?void 0:e.in);return t.setDate(1),t.setHours(0,0,0,0),t}var jQ=v(()=>{ln()});var zQ=v(()=>{});function BQ(r,e){let t=it(r,e==null?void 0:e.in),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}var qQ=v(()=>{ln()});function dD(r,e){let t=it(r,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}var JO=v(()=>{ln()});var HQ=v(()=>{});var UQ=v(()=>{});var VQ=v(()=>{});var WQ=v(()=>{});function tg(r,e){var o,l,c,d,u,p,m,f;let t=wl(),n=(f=(m=(d=(c=e==null?void 0:e.weekStartsOn)!=null?c:(l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)!=null?d:t.weekStartsOn)!=null?m:(p=(u=t.locale)==null?void 0:u.options)==null?void 0:p.weekStartsOn)!=null?f:0,i=it(r,e==null?void 0:e.in),s=i.getDay(),a=(s{Xh();ln()});var GQ=v(()=>{});var KQ=v(()=>{});var ZQ=v(()=>{});var QQ=v(()=>{});var JQ=v(()=>{});var XQ=v(()=>{});var eJ=v(()=>{});var tJ=v(()=>{});var QLe,rJ,nJ=v(()=>{QLe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rJ=(r,e,t)=>{let n,i=QLe[r];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n}});function uD(r){return(e={})=>{let t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}var iJ=v(()=>{});var JLe,XLe,e1e,sJ,aJ=v(()=>{iJ();JLe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},XLe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},e1e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sJ={date:uD({formats:JLe,defaultWidth:"full"}),time:uD({formats:XLe,defaultWidth:"full"}),dateTime:uD({formats:e1e,defaultWidth:"full"})}});var t1e,oJ,lJ=v(()=>{t1e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oJ=(r,e,t,n)=>t1e[r]});function rg(r){return(e,t)=>{let n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&r.formattingValues){let a=r.defaultFormattingWidth||r.defaultWidth,o=t!=null&&t.width?String(t.width):a;i=r.formattingValues[o]||r.formattingValues[a]}else{let a=r.defaultWidth,o=t!=null&&t.width?String(t.width):r.defaultWidth;i=r.values[o]||r.values[a]}let s=r.argumentCallback?r.argumentCallback(e):e;return i[s]}}var cJ=v(()=>{});var r1e,n1e,i1e,s1e,a1e,o1e,l1e,dJ,uJ=v(()=>{cJ();r1e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},n1e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},i1e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},s1e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},a1e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},o1e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},l1e=(r,e)=>{let t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},dJ={ordinalNumber:l1e,era:rg({values:r1e,defaultWidth:"wide"}),quarter:rg({values:n1e,defaultWidth:"wide",argumentCallback:r=>r-1}),month:rg({values:i1e,defaultWidth:"wide"}),day:rg({values:s1e,defaultWidth:"wide"}),dayPeriod:rg({values:a1e,defaultWidth:"wide",formattingValues:o1e,defaultFormattingWidth:"wide"})}});function ng(r){return(e,t={})=>{let n=t.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(i);if(!s)return null;let a=s[0],o=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(o)?d1e(o,u=>u.test(a)):c1e(o,u=>u.test(a)),c;c=r.valueCallback?r.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;let d=e.slice(a.length);return{value:c,rest:d}}}function c1e(r,e){for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function d1e(r,e){for(let t=0;t{});function mJ(r){return(e,t={})=>{let n=e.match(r.matchPattern);if(!n)return null;let i=n[0],s=e.match(r.parsePattern);if(!s)return null;let a=r.valueCallback?r.valueCallback(s[0]):s[0];a=t.valueCallback?t.valueCallback(a):a;let o=e.slice(i.length);return{value:a,rest:o}}}var fJ=v(()=>{});var u1e,p1e,m1e,f1e,h1e,g1e,y1e,v1e,b1e,T1e,k1e,w1e,hJ,gJ=v(()=>{pJ();fJ();u1e=/^(\d+)(th|st|nd|rd)?/i,p1e=/\d+/i,m1e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},f1e={any:[/^b/i,/^(a|c)/i]},h1e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},g1e={any:[/1/i,/2/i,/3/i,/4/i]},y1e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},v1e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},b1e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},T1e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},k1e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},w1e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hJ={ordinalNumber:mJ({matchPattern:u1e,parsePattern:p1e,valueCallback:r=>parseInt(r,10)}),era:ng({matchPatterns:m1e,defaultMatchWidth:"wide",parsePatterns:f1e,defaultParseWidth:"any"}),quarter:ng({matchPatterns:h1e,defaultMatchWidth:"wide",parsePatterns:g1e,defaultParseWidth:"any",valueCallback:r=>r+1}),month:ng({matchPatterns:y1e,defaultMatchWidth:"wide",parsePatterns:v1e,defaultParseWidth:"any"}),day:ng({matchPatterns:b1e,defaultMatchWidth:"wide",parsePatterns:T1e,defaultParseWidth:"any"}),dayPeriod:ng({matchPatterns:k1e,defaultMatchWidth:"any",parsePatterns:w1e,defaultParseWidth:"any"})}});var XO,yJ=v(()=>{nJ();aJ();lJ();uJ();gJ();XO={code:"en-US",formatDistance:rJ,formatLong:sJ,formatRelative:oJ,localize:dJ,match:hJ,options:{weekStartsOn:0,firstWeekContainsDate:1}}});var vJ=v(()=>{yJ()});function bJ(r,e){let t=it(r,e==null?void 0:e.in);return zZ(t,dD(t))+1}var eL=v(()=>{YO();JO();ln()});function TJ(r,e){let t=it(r,e==null?void 0:e.in),n=+vm(t)-+BZ(t);return Math.round(n/tD)+1}var tL=v(()=>{Jh();qb();GO();ln()});function pD(r,e){var d,u,p,m,f,h,g,y;let t=it(r,e==null?void 0:e.in),n=t.getFullYear(),i=wl(),s=(y=(g=(m=(p=e==null?void 0:e.firstWeekContainsDate)!=null?p:(u=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)!=null?m:i.firstWeekContainsDate)!=null?g:(h=(f=i.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)!=null?y:1,a=bn((e==null?void 0:e.in)||r,0);a.setFullYear(n+1,0,s),a.setHours(0,0,0,0);let o=Xi(a,e),l=bn((e==null?void 0:e.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);let c=Xi(l,e);return+t>=+o?n+1:+t>=+c?n:n-1}var mD=v(()=>{Xh();Ro();eg();ln()});function kJ(r,e){var o,l,c,d,u,p,m,f;let t=wl(),n=(f=(m=(d=(c=e==null?void 0:e.firstWeekContainsDate)!=null?c:(l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)!=null?d:t.firstWeekContainsDate)!=null?m:(p=(u=t.locale)==null?void 0:u.options)==null?void 0:p.firstWeekContainsDate)!=null?f:1,i=pD(r,e),s=bn((e==null?void 0:e.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),Xi(s,e)}var rL=v(()=>{Xh();Ro();mD();eg()});function wJ(r,e){let t=it(r,e==null?void 0:e.in),n=+Xi(t,e)-+kJ(t,e);return Math.round(n/tD)+1}var nL=v(()=>{Jh();eg();rL();ln()});function lr(r,e){let t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}var iL=v(()=>{});var qc,SJ=v(()=>{iL();qc={y(r,e){let t=r.getFullYear(),n=t>0?t:1-t;return lr(e==="yy"?n%100:n,e.length)},M(r,e){let t=r.getMonth();return e==="M"?String(t+1):lr(t+1,2)},d(r,e){return lr(r.getDate(),e.length)},a(r,e){let t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return lr(r.getHours()%12||12,e.length)},H(r,e){return lr(r.getHours(),e.length)},m(r,e){return lr(r.getMinutes(),e.length)},s(r,e){return lr(r.getSeconds(),e.length)},S(r,e){let t=e.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,t-3));return lr(i,e.length)}}});function xJ(r,e=""){let t=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?t+String(i):t+String(i)+e+lr(s,2)}function EJ(r,e){return r%60===0?(r>0?"-":"+")+lr(Math.abs(r)/60,2):bm(r,e)}function bm(r,e=""){let t=r>0?"-":"+",n=Math.abs(r),i=lr(Math.trunc(n/60),2),s=lr(n%60,2);return t+i+e+s}var ig,sL,DJ=v(()=>{eL();tL();sD();nL();mD();iL();SJ();ig={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sL={G:function(r,e,t){let n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){let n=r.getFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return qc.y(r,e)},Y:function(r,e,t,n){let i=pD(r,n),s=i>0?i:1-i;if(e==="YY"){let a=s%100;return lr(a,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):lr(s,e.length)},R:function(r,e){let t=iD(r);return lr(t,e.length)},u:function(r,e){let t=r.getFullYear();return lr(t,e.length)},Q:function(r,e,t){let n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return lr(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){let n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return lr(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){let n=r.getMonth();switch(e){case"M":case"MM":return qc.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){let n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return lr(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){let i=wJ(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):lr(i,e.length)},I:function(r,e,t){let n=TJ(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):lr(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):qc.d(r,e)},D:function(r,e,t){let n=bJ(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):lr(n,e.length)},E:function(r,e,t){let n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){let i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return lr(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){let i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return lr(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(r,e,t){let n=r.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return lr(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){let i=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,e,t){let n=r.getHours(),i;switch(n===12?i=ig.noon:n===0?i=ig.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,e,t){let n=r.getHours(),i;switch(n>=17?i=ig.evening:n>=12?i=ig.afternoon:n>=4?i=ig.morning:i=ig.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return qc.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):qc.H(r,e)},K:function(r,e,t){let n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):lr(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):lr(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):qc.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):qc.s(r,e)},S:function(r,e){return qc.S(r,e)},X:function(r,e,t){let n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return EJ(n);case"XXXX":case"XX":return bm(n);case"XXXXX":case"XXX":default:return bm(n,":")}},x:function(r,e,t){let n=r.getTimezoneOffset();switch(e){case"x":return EJ(n);case"xxxx":case"xx":return bm(n);case"xxxxx":case"xxx":default:return bm(n,":")}},O:function(r,e,t){let n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+xJ(n,":");case"OOOO":default:return"GMT"+bm(n,":")}},z:function(r,e,t){let n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+xJ(n,":");case"zzzz":default:return"GMT"+bm(n,":")}},t:function(r,e,t){let n=Math.trunc(+r/1e3);return lr(n,e.length)},T:function(r,e,t){return lr(+r,e.length)}}});var CJ,PJ,S1e,_J,MJ=v(()=>{CJ=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},PJ=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},S1e=(r,e)=>{let t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return CJ(r,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",CJ(n,e)).replace("{{time}}",PJ(i,e))},_J={p:PJ,P:S1e}});function AJ(r){return x1e.test(r)}function IJ(r){return E1e.test(r)}function NJ(r,e,t){let n=C1e(r,e,t);if(console.warn(n),D1e.includes(r))throw new RangeError(n)}function C1e(r,e,t){let n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var x1e,E1e,D1e,RJ=v(()=>{x1e=/^D+$/,E1e=/^Y+$/,D1e=["D","DD","YY","YYYY"]});function P(r,e,t){var d,u,p,m,f,h,g,y,k,T,w,S,E,C,D,A,N,V;let n=wl(),i=(u=(d=t==null?void 0:t.locale)!=null?d:n.locale)!=null?u:XO,s=(T=(k=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(m=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)!=null?h:n.firstWeekContainsDate)!=null?k:(y=(g=n.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)!=null?T:1,a=(V=(N=(C=(E=t==null?void 0:t.weekStartsOn)!=null?E:(S=(w=t==null?void 0:t.locale)==null?void 0:w.options)==null?void 0:S.weekStartsOn)!=null?C:n.weekStartsOn)!=null?N:(A=(D=n.locale)==null?void 0:D.options)==null?void 0:A.weekStartsOn)!=null?V:0,o=it(r,t==null?void 0:t.in);if(!Kn(o))throw new RangeError("Invalid time value");let l=e.match(_1e).map(R=>{let I=R[0];if(I==="p"||I==="P"){let O=_J[I];return O(R,i.formatLong)}return R}).join("").match(P1e).map(R=>{if(R==="''")return{isToken:!1,value:"'"};let I=R[0];if(I==="'")return{isToken:!1,value:N1e(R)};if(sL[I])return{isToken:!0,value:R};if(I.match(I1e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return{isToken:!1,value:R}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));let c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(R=>{if(!R.isToken)return R.value;let I=R.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&IJ(I)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&AJ(I))&&NJ(I,e,String(r));let O=sL[I[0]];return O(o,I,i.localize,c)}).join("")}function N1e(r){let e=r.match(M1e);return e?e[1].replace(A1e,"'"):r}var P1e,_1e,M1e,A1e,I1e,OJ=v(()=>{vJ();Xh();DJ();MJ();RJ();QO();ln();P1e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_1e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M1e=/^'([^]*?)'?$/,A1e=/''/g,I1e=/[a-zA-Z]/});var LJ=v(()=>{});var FJ=v(()=>{});var $J=v(()=>{});var jJ=v(()=>{});var zJ=v(()=>{});var BJ=v(()=>{});var qJ=v(()=>{});var HJ=v(()=>{});var UJ=v(()=>{});var VJ=v(()=>{});var WJ=v(()=>{});var YJ=v(()=>{});var GJ=v(()=>{});var KJ=v(()=>{});var ZJ=v(()=>{});var QJ=v(()=>{});var JJ=v(()=>{});var XJ=v(()=>{});var eX=v(()=>{});var tX=v(()=>{});var rX=v(()=>{});var nX=v(()=>{});var iX=v(()=>{});var sX=v(()=>{});var aX=v(()=>{});var oX=v(()=>{});var lX=v(()=>{});var cX=v(()=>{});var dX=v(()=>{});var uX=v(()=>{});var pX=v(()=>{});var mX=v(()=>{});var fX=v(()=>{});var hX=v(()=>{});var gX=v(()=>{});var yX=v(()=>{});var vX=v(()=>{});var bX=v(()=>{});var TX=v(()=>{});var kX=v(()=>{});var wX=v(()=>{});function aL(r,e){return+it(r)<+it(e)}var SX=v(()=>{ln()});var xX=v(()=>{});var EX=v(()=>{});var DX=v(()=>{});var CX=v(()=>{});var PX=v(()=>{});var _X=v(()=>{});var MX=v(()=>{});var AX=v(()=>{});var IX=v(()=>{});var NX=v(()=>{});var RX=v(()=>{});var OX=v(()=>{});var LX=v(()=>{});var FX=v(()=>{});var $X=v(()=>{});var jX=v(()=>{});var zX=v(()=>{});var BX=v(()=>{});var qX=v(()=>{});var HX=v(()=>{});var UX=v(()=>{});var VX=v(()=>{});var WX=v(()=>{});var YX=v(()=>{});var GX=v(()=>{});var KX=v(()=>{});var ZX=v(()=>{});var QX=v(()=>{});var JX=v(()=>{});var XX=v(()=>{});var eee=v(()=>{});var tee=v(()=>{});var ree=v(()=>{});var nee=v(()=>{});var iee=v(()=>{});var see=v(()=>{});var aee=v(()=>{});var oee=v(()=>{});var lee=v(()=>{});var cee=v(()=>{});function sg(r,e,t){return ym(r,-e,t)}var dee=v(()=>{rD()});var uee=v(()=>{});var pee=v(()=>{});var mee=v(()=>{});var fee=v(()=>{});var hee=v(()=>{});var gee=v(()=>{});var yee=v(()=>{});var vee=v(()=>{});var bee=v(()=>{});var Tee=v(()=>{});var kee=v(()=>{});var wee=v(()=>{});var See=v(()=>{});var xee=v(()=>{});var Eee=v(()=>{});var Dee=v(()=>{});var Cee=v(()=>{});var Pee=v(()=>{});var _ee=v(()=>{});var Mee=v(()=>{});var Aee=v(()=>{});var Iee=v(()=>{});var Nee=v(()=>{});var Ree=v(()=>{});var Oee=v(()=>{});function ia(r,e){var c;let t=()=>bn(e==null?void 0:e.in,NaN),n=(c=e==null?void 0:e.additionalDigits)!=null?c:2,i=F1e(r),s;if(i.date){let d=$1e(i.date,n);s=j1e(d.restDateString,d.year)}if(!s||isNaN(+s))return t();let a=+s,o=0,l;if(i.time&&(o=z1e(i.time),isNaN(o)))return t();if(i.timezone){if(l=B1e(i.timezone),isNaN(l))return t()}else{let d=new Date(a+o),u=it(0,e==null?void 0:e.in);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return it(a+o+l,e==null?void 0:e.in)}function F1e(r){let e={},t=r.split(fD.dateTimeDelimiter),n;if(t.length>2)return e;if(/:/.test(t[0])?n=t[0]:(e.date=t[0],n=t[1],fD.timeZoneDelimiter.test(e.date)&&(e.date=r.split(fD.timeZoneDelimiter)[0],n=r.substr(e.date.length,r.length))),n){let i=fD.timezone.exec(n);i?(e.time=n.replace(i[1],""),e.timezone=i[1]):e.time=n}return e}function $1e(r,e){let t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=r.match(t);if(!n)return{year:NaN,restDateString:""};let i=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:s===null?i:s*100,restDateString:r.slice((n[1]||n[2]).length)}}function j1e(r,e){if(e===null)return new Date(NaN);let t=r.match(R1e);if(!t)return new Date(NaN);let n=!!t[4],i=Ub(t[1]),s=Ub(t[2])-1,a=Ub(t[3]),o=Ub(t[4]),l=Ub(t[5])-1;if(n)return W1e(e,o,l)?q1e(e,o,l):new Date(NaN);{let c=new Date(0);return!U1e(e,s,a)||!V1e(e,i)?new Date(NaN):(c.setUTCFullYear(e,s,Math.max(i,a)),c)}}function Ub(r){return r?parseInt(r):1}function z1e(r){let e=r.match(O1e);if(!e)return NaN;let t=oL(e[1]),n=oL(e[2]),i=oL(e[3]);return Y1e(t,n,i)?t*qO+n*BO+i*1e3:NaN}function oL(r){return r&&parseFloat(r.replace(",","."))||0}function B1e(r){if(r==="Z")return 0;let e=r.match(L1e);if(!e)return 0;let t=e[1]==="+"?-1:1,n=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return G1e(n,i)?t*(n*qO+i*BO):NaN}function q1e(r,e,t){let n=new Date(0);n.setUTCFullYear(r,0,4);let i=n.getUTCDay()||7,s=(e-1)*7+t+1-i;return n.setUTCDate(n.getUTCDate()+s),n}function Lee(r){return r%400===0||r%4===0&&r%100!==0}function U1e(r,e,t){return e>=0&&e<=11&&t>=1&&t<=(H1e[e]||(Lee(r)?29:28))}function V1e(r,e){return e>=1&&e<=(Lee(r)?366:365)}function W1e(r,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function Y1e(r,e,t){return r===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&r>=0&&r<25}function G1e(r,e){return e>=0&&e<=59}var fD,R1e,O1e,L1e,H1e,Fee=v(()=>{Jh();Ro();ln();fD={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},R1e=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,O1e=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,L1e=/^([+-])(\d{2})(?::?(\d{2}))?$/;H1e=[31,null,31,30,31,30,31,31,30,31,30,31]});var $ee=v(()=>{});var jee=v(()=>{});var zee=v(()=>{});var Bee=v(()=>{});var qee=v(()=>{});var Hee=v(()=>{});var Uee=v(()=>{});var Vee=v(()=>{});var Wee=v(()=>{});var Yee=v(()=>{});var Gee=v(()=>{});var Kee=v(()=>{});var Zee=v(()=>{});var Qee=v(()=>{});var Jee=v(()=>{});var Xee=v(()=>{});var ete=v(()=>{});var tte=v(()=>{});var rte=v(()=>{});var nte=v(()=>{});var ite=v(()=>{});var ste=v(()=>{});var ate=v(()=>{});var ote=v(()=>{});var lte=v(()=>{});var cte=v(()=>{});var dte=v(()=>{});var ute=v(()=>{});var pte=v(()=>{});var mte=v(()=>{});var fte=v(()=>{});var hte=v(()=>{});var gte=v(()=>{});var yte=v(()=>{});var vte=v(()=>{});var bte=v(()=>{});var Tte=v(()=>{});var kte=v(()=>{});var wte=v(()=>{});var Ste=v(()=>{});var xte=v(()=>{});var Ete=v(()=>{});var Dte=v(()=>{});var Cte=v(()=>{});var Pte=v(()=>{});var _te=v(()=>{});var Tn=v(()=>{IZ();LZ();rD();$Z();HZ();FZ();UZ();UO();VZ();WZ();GZ();ZZ();QZ();eQ();tQ();rQ();nQ();iQ();Ro();sQ();aQ();cQ();YO();dQ();uQ();pQ();fQ();hQ();gQ();yQ();vQ();TQ();kQ();wQ();DQ();CQ();PQ();_Q();MQ();AQ();IQ();NQ();RQ();LQ();FQ();$Q();zQ();HQ();UQ();SQ();VQ();WQ();GQ();KQ();ZQ();xQ();QQ();JQ();XQ();eJ();YQ();qQ();tJ();OJ();LJ();FJ();$J();jJ();zJ();BJ();qJ();HJ();UJ();VJ();WJ();YJ();GJ();KJ();eL();ZJ();JJ();XJ();eX();tX();rX();tL();sD();nX();iX();sX();aX();oX();mQ();lX();cX();dX();nL();uX();mD();mX();fX();hX();gX();yX();vX();bX();TX();kX();wX();SX();ZO();xX();EX();DX();CX();PX();EQ();QJ();OX();LX();FX();oQ();jX();BX();qX();UX();VX();WX();GX();zX();KX();NZ();RZ();ZX();QX();JX();XX();eee();tee();ree();nee();iee();see();aee();oee();QO();lee();OZ();cee();uee();pee();fee();hee();pX();gee();mee();yee();vee();JZ();bee();Tee();kee();wee();XZ();See();xee();Eee();Dee();Cee();Pee();_ee();Mee();Aee();Iee();Nee();Ree();Oee();RX();Fee();$ee();jee();zee();Bee();qee();Hee();Uee();Vee();Wee();Yee();Gee();Kee();Zee();Qee();Jee();Xee();tte();rte();IX();nte();ite();ste();NX();AX();qZ();ate();ote();ete();lte();cte();MX();dte();ute();oD();pte();$X();qb();GO();HX();jQ();OQ();YX();mte();fte();eg();rL();JO();hte();yte();vte();dee();bte();bQ();Tte();kte();gte();wte();Ste();xte();Ete();ln();_X();Dte();Cte();Pte();_te()});var Hc=x(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});var Xr=require("obsidian"),lL="YYYY-MM-DD",cL="gggg-[W]ww",Mte="YYYY-MM",Ate="YYYY-[Q]Q",Ite="YYYY";function Vb(r){var t,n;let e=window.app.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t[r])==null?void 0:n.enabled)}function Wb(){var r,e,t,n;try{let{internalPlugins:i,plugins:s}=window.app;if(Vb("daily")){let{format:c,folder:d,template:u}=((e=(r=s.getPlugin("periodic-notes"))==null?void 0:r.settings)==null?void 0:e.daily)||{};return{format:c||lL,folder:(d==null?void 0:d.trim())||"",template:(u==null?void 0:u.trim())||""}}let{folder:a,format:o,template:l}=((n=(t=i.getPluginById("daily-notes"))==null?void 0:t.instance)==null?void 0:n.options)||{};return{format:o||lL,folder:(a==null?void 0:a.trim())||"",template:(l==null?void 0:l.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function Yb(){var r,e,t,n,i,s,a;try{let o=window.app.plugins,l=(r=o.getPlugin("calendar"))==null?void 0:r.options,c=(t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.weekly;if(Vb("weekly"))return{format:c.format||cL,folder:((n=c.folder)==null?void 0:n.trim())||"",template:((i=c.template)==null?void 0:i.trim())||""};let d=l||{};return{format:d.weeklyNoteFormat||cL,folder:((s=d.weeklyNoteFolder)==null?void 0:s.trim())||"",template:((a=d.weeklyNoteTemplate)==null?void 0:a.trim())||""}}catch(o){console.info("No custom weekly note settings found!",o)}}function Gb(){var e,t,n,i;let r=window.app.plugins;try{let s=Vb("monthly")&&((t=(e=r.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.monthly)||{};return{format:s.format||Mte,folder:((n=s.folder)==null?void 0:n.trim())||"",template:((i=s.template)==null?void 0:i.trim())||""}}catch(s){console.info("No custom monthly note settings found!",s)}}function Kb(){var e,t,n,i;let r=window.app.plugins;try{let s=Vb("quarterly")&&((t=(e=r.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.quarterly)||{};return{format:s.format||Ate,folder:((n=s.folder)==null?void 0:n.trim())||"",template:((i=s.template)==null?void 0:i.trim())||""}}catch(s){console.info("No custom quarterly note settings found!",s)}}function Zb(){var e,t,n,i;let r=window.app.plugins;try{let s=Vb("yearly")&&((t=(e=r.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.yearly)||{};return{format:s.format||Ite,folder:((n=s.folder)==null?void 0:n.trim())||"",template:((i=s.template)==null?void 0:i.trim())||""}}catch(s){console.info("No custom yearly note settings found!",s)}}function Nte(...r){let e=[];for(let n=0,i=r.length;n{let k=n(),T=r.clone().set({hour:k.get("hour"),minute:k.get("minute"),second:k.get("second")});return f&&T.add(parseInt(h,10),g),y?T.format(y.substring(1).trim()):T.format(s)}).replace(/{{\s*yesterday\s*}}/gi,r.clone().subtract(1,"day").format(s)).replace(/{{\s*tomorrow\s*}}/gi,r.clone().add(1,"d").format(s)));return e.foldManager.save(u,l),u}catch(u){console.error(`Failed to create file: '${d}'`,u),new Xr.Notice("Unable to create new file.")}}function X1e(r,e){var t;return(t=e[Lo(r,"day")])!=null?t:null}function eFe(){let{vault:r}=window.app,{folder:e}=Wb(),t=r.getAbstractFileByPath(Xr.normalizePath(e));if(!t)throw new dL("Failed to find daily notes folder");let n={};return Xr.Vault.recurseChildren(t,i=>{if(i instanceof Xr.TFile){let s=og(i,"day");if(s){let a=Lo(s,"day");n[a]=i}}}),n}var uL=class extends Error{};function tFe(){let{moment:r}=window,e=r.localeData()._week.dow,t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;e;)t.push(t.shift()),e--;return t}function rFe(r){return tFe().indexOf(r.toLowerCase())}async function Fte(r){let{vault:e}=window.app,{template:t,format:n,folder:i}=Yb(),[s,a]=await ag(t),o=r.format(n),l=await Qb(i,o);try{let c=await e.create(l,s.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),y=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&y.add(parseInt(m,10),f),h?y.format(h.substring(1).trim()):y.format(n)}).replace(/{{\s*title\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(d,u,p)=>{let m=rFe(u);return r.weekday(m).format(p.trim())}));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Xr.Notice("Unable to create new file.")}}function nFe(r,e){var t;return(t=e[Lo(r,"week")])!=null?t:null}function iFe(){let r={};if(!jte())return r;let{vault:e}=window.app,{folder:t}=Yb(),n=e.getAbstractFileByPath(Xr.normalizePath(t));if(!n)throw new uL("Failed to find weekly notes folder");return Xr.Vault.recurseChildren(n,i=>{if(i instanceof Xr.TFile){let s=og(i,"week");if(s){let a=Lo(s,"week");r[a]=i}}}),r}var pL=class extends Error{};async function $te(r){let{vault:e}=window.app,{template:t,format:n,folder:i}=Gb(),[s,a]=await ag(t),o=r.format(n),l=await Qb(i,o);try{let c=await e.create(l,s.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),y=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&y.add(parseInt(m,10),f),h?y.format(h.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,o));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Xr.Notice("Unable to create new file.")}}function sFe(r,e){var t;return(t=e[Lo(r,"month")])!=null?t:null}function aFe(){let r={};if(!zte())return r;let{vault:e}=window.app,{folder:t}=Gb(),n=e.getAbstractFileByPath(Xr.normalizePath(t));if(!n)throw new pL("Failed to find monthly notes folder");return Xr.Vault.recurseChildren(n,i=>{if(i instanceof Xr.TFile){let s=og(i,"month");if(s){let a=Lo(s,"month");r[a]=i}}}),r}var mL=class extends Error{};async function oFe(r){let{vault:e}=window.app,{template:t,format:n,folder:i}=Kb(),[s,a]=await ag(t),o=r.format(n),l=await Qb(i,o);try{let c=await e.create(l,s.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),y=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&y.add(parseInt(m,10),f),h?y.format(h.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,o));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Xr.Notice("Unable to create new file.")}}function lFe(r,e){var t;return(t=e[Lo(r,"quarter")])!=null?t:null}function cFe(){let r={};if(!Bte())return r;let{vault:e}=window.app,{folder:t}=Kb(),n=e.getAbstractFileByPath(Xr.normalizePath(t));if(!n)throw new mL("Failed to find quarterly notes folder");return Xr.Vault.recurseChildren(n,i=>{if(i instanceof Xr.TFile){let s=og(i,"quarter");if(s){let a=Lo(s,"quarter");r[a]=i}}}),r}var fL=class extends Error{};async function dFe(r){let{vault:e}=window.app,{template:t,format:n,folder:i}=Zb(),[s,a]=await ag(t),o=r.format(n),l=await Qb(i,o);try{let c=await e.create(l,s.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),y=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&y.add(parseInt(m,10),f),h?y.format(h.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,o));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Xr.Notice("Unable to create new file.")}}function uFe(r,e){var t;return(t=e[Lo(r,"year")])!=null?t:null}function pFe(){let r={};if(!qte())return r;let{vault:e}=window.app,{folder:t}=Zb(),n=e.getAbstractFileByPath(Xr.normalizePath(t));if(!n)throw new fL("Failed to find yearly notes folder");return Xr.Vault.recurseChildren(n,i=>{if(i instanceof Xr.TFile){let s=og(i,"year");if(s){let a=Lo(s,"year");r[a]=i}}}),r}function mFe(){var n,i;let{app:r}=window,e=r.internalPlugins.plugins["daily-notes"];if(e&&e.enabled)return!0;let t=r.plugins.getPlugin("periodic-notes");return t&&((i=(n=t.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function jte(){var t,n;let{app:r}=window;if(r.plugins.getPlugin("calendar"))return!0;let e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.weekly)==null?void 0:n.enabled)}function zte(){var t,n;let{app:r}=window,e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.monthly)==null?void 0:n.enabled)}function Bte(){var t,n;let{app:r}=window,e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.quarterly)==null?void 0:n.enabled)}function qte(){var t,n;let{app:r}=window,e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.yearly)==null?void 0:n.enabled)}function fFe(r){let e={day:Wb,week:Yb,month:Gb,quarter:Kb,year:Zb}[r];return e()}function hFe(r,e){return{day:Lte,month:$te,week:Fte}[r](e)}bt.DEFAULT_DAILY_NOTE_FORMAT=lL;bt.DEFAULT_MONTHLY_NOTE_FORMAT=Mte;bt.DEFAULT_QUARTERLY_NOTE_FORMAT=Ate;bt.DEFAULT_WEEKLY_NOTE_FORMAT=cL;bt.DEFAULT_YEARLY_NOTE_FORMAT=Ite;bt.appHasDailyNotesPluginLoaded=mFe;bt.appHasMonthlyNotesPluginLoaded=zte;bt.appHasQuarterlyNotesPluginLoaded=Bte;bt.appHasWeeklyNotesPluginLoaded=jte;bt.appHasYearlyNotesPluginLoaded=qte;bt.createDailyNote=Lte;bt.createMonthlyNote=$te;bt.createPeriodicNote=hFe;bt.createQuarterlyNote=oFe;bt.createWeeklyNote=Fte;bt.createYearlyNote=dFe;bt.getAllDailyNotes=eFe;bt.getAllMonthlyNotes=aFe;bt.getAllQuarterlyNotes=cFe;bt.getAllWeeklyNotes=iFe;bt.getAllYearlyNotes=pFe;bt.getDailyNote=X1e;bt.getDailyNoteSettings=Wb;bt.getDateFromFile=og;bt.getDateFromPath=J1e;bt.getDateUID=Lo;bt.getMonthlyNote=sFe;bt.getMonthlyNoteSettings=Gb;bt.getPeriodicNoteSettings=fFe;bt.getQuarterlyNote=lFe;bt.getQuarterlyNoteSettings=Kb;bt.getTemplateInfo=ag;bt.getWeeklyNote=nFe;bt.getWeeklyNoteSettings=Yb;bt.getYearlyNote=uFe;bt.getYearlyNoteSettings=Zb});var Jb,hL,gFe,yFe,vFe,bFe,TFe,kFe,wFe,gL,Zn,lg=v(()=>{Jb=["status","priority","due","scheduled","projects","contexts"],hL={title:"title",status:"status",priority:"priority",due:"due",scheduled:"scheduled",contexts:"contexts",projects:"projects",timeEstimate:"timeEstimate",completedDate:"completedDate",dateCreated:"dateCreated",dateModified:"dateModified",recurrence:"recurrence",recurrenceAnchor:"recurrence_anchor",archiveTag:"archived",timeEntries:"timeEntries",completeInstances:"complete_instances",skippedInstances:"skipped_instances",blockedBy:"blockedBy",pomodoros:"pomodoros",icsEventId:"icsEventId",icsEventTag:"ics_event",googleCalendarEventId:"googleCalendarEventId",reminders:"reminders",sortOrder:"tasknotes_manual_order"},gFe=[{id:"none",value:"none",label:"None",color:"#cccccc",isCompleted:!1,order:0,autoArchive:!1,autoArchiveDelay:5},{id:"open",value:"open",label:"Open",color:"#808080",isCompleted:!1,order:1,autoArchive:!1,autoArchiveDelay:5},{id:"in-progress",value:"in-progress",label:"In progress",color:"#0066cc",isCompleted:!1,order:2,autoArchive:!1,autoArchiveDelay:5},{id:"done",value:"done",label:"Done",color:"#00aa00",isCompleted:!0,order:3,autoArchive:!1,autoArchiveDelay:5}],yFe=[{id:"none",value:"none",label:"None",color:"#cccccc",weight:0},{id:"low",value:"low",label:"Low",color:"#00aa00",weight:1},{id:"normal",value:"normal",label:"Normal",color:"#ffaa00",weight:2},{id:"high",value:"high",label:"High",color:"#ff0000",weight:3}],vFe={defaultContexts:"",defaultTags:"",defaultProjects:"",useParentNoteAsProject:!1,defaultTimeEstimate:0,defaultRecurrence:"none",defaultDueDate:"none",defaultScheduledDate:"today",bodyTemplate:"",useBodyTemplate:!1,defaultReminders:[]},bFe={defaultView:"dayGridMonth",customDayCount:3,slotDuration:"00:30:00",slotMinTime:"00:00:00",slotMaxTime:"24:00:00",scrollTime:"08:00:00",firstDay:1,timeFormat:"24",showWeekends:!0,locale:"",defaultShowScheduled:!0,defaultShowDue:!0,defaultShowDueWhenScheduled:!0,defaultShowScheduledToDueSpan:!1,defaultShowTimeEntries:!1,defaultShowRecurring:!0,defaultShowICSEvents:!0,enableTimeblocking:!1,defaultShowTimeblocks:!0,defaultTimeblockColor:"#6366f1",timeblockAttachmentSearchOrder:"name-asc",nowIndicator:!0,selectMirror:!0,weekNumbers:!1,showTodayHighlight:!0,eventMinHeight:15,slotEventOverlap:!0,eventMaxStack:null,dayMaxEvents:!0,dayMaxEventRows:!1},TFe={defaultNoteTemplate:"",defaultNoteFolder:"",icsNoteFilenameFormat:"title",customICSNoteFilenameTemplate:"{title}",enableAutoExport:!1,autoExportPath:"tasknotes-calendar.ics",autoExportInterval:60,useDurationForExport:!1,useICSEndAsDue:!1},kFe={enabled:!1,targetCalendarId:"",syncOnTaskCreate:!0,syncOnTaskUpdate:!0,syncOnTaskComplete:!0,syncOnTaskDelete:!0,eventTitleTemplate:"{{title}}",includeDescription:!0,eventColorId:null,syncTrigger:"scheduled",createAsAllDay:!0,defaultEventDuration:60,includeObsidianLink:!0,defaultReminderMinutes:null},wFe={enableFuzzy:!1,rows:["{title|n(Title)}","{aliases|n(Aliases)}","{file.path|n(Path)}"],showAdvanced:!1,requiredTags:[],includeFolders:[],propertyKey:"",propertyValue:""},gL={triggers:[{propertyId:"tags",trigger:"#",enabled:!0},{propertyId:"contexts",trigger:"@",enabled:!0},{propertyId:"projects",trigger:"+",enabled:!0},{propertyId:"status",trigger:"*",enabled:!0},{propertyId:"priority",trigger:"!",enabled:!1}]},Zn={tasksFolder:"TaskNotes/Tasks",moveArchivedTasks:!1,archiveFolder:"TaskNotes/Archive",taskTag:"task",taskIdentificationMethod:"tag",hideIdentifyingTagsInCards:!1,taskPropertyName:"",taskPropertyValue:"",excludedFolders:"",defaultTaskPriority:"normal",defaultTaskStatus:"open",taskOrgFiltersCollapsed:!1,taskFilenameFormat:"zettel",storeTitleInFilename:!0,customFilenameTemplate:"{title}",taskCreationDefaults:vFe,calendarViewSettings:bFe,pomodoroWorkDuration:25,pomodoroShortBreakDuration:5,pomodoroLongBreakDuration:15,pomodoroLongBreakInterval:4,pomodoroAutoStartBreaks:!0,pomodoroAutoStartWork:!1,pomodoroNotifications:!0,pomodoroSoundEnabled:!0,pomodoroSoundVolume:50,pomodoroStorageLocation:"plugin",pomodoroMobileSidebar:"tab",enableTaskLinkOverlay:!0,disableOverlayOnAlias:!1,enableInstantTaskConvert:!0,useDefaultsOnInstantConvert:!0,taskModalTabMovesFocus:!0,enableNaturalLanguageInput:!0,nlpDefaultToScheduled:!0,nlpLanguage:"en",uiLanguage:"system",statusSuggestionTrigger:"*",nlpTriggers:gL,singleClickAction:"edit",doubleClickAction:"openNote",projectAutosuggest:wFe,inlineTaskConvertFolder:"{{currentNotePath}}",disableNoteIndexing:!1,suggestionDebounceMs:0,fieldMapping:hL,customStatuses:gFe,customPriorities:yFe,recurrenceMigrated:!1,lastSeenVersion:void 0,showReleaseNotesOnUpdate:!0,showTrackedTasksInStatusBar:!1,autoStopTimeTrackingOnComplete:!0,autoStopTimeTrackingNotification:!1,showRelationships:!0,relationshipsPosition:"bottom",showTaskCardInNote:!0,showExpandableSubtasks:!0,subtaskChevronPosition:"right",viewsButtonAlignment:"right",hideCompletedFromOverdue:!0,icsIntegration:TFe,savedViews:[],enableNotifications:!0,notificationType:"system",enableAPI:!1,apiPort:8080,apiAuthToken:"",enableMCP:!1,webhooks:[],userFields:[],modalFieldsConfig:void 0,enableModalSplitLayout:!0,defaultVisibleProperties:["status","priority","due","scheduled","projects","contexts","tags","blocked","blocking"],inlineVisibleProperties:["status","priority","due","scheduled","recurrence"],enableBases:!0,enableMdbaseSpec:!1,autoCreateDefaultBasesFiles:!0,commandFileMapping:{"open-calendar-view":"TaskNotes/Views/mini-calendar-default.base","open-kanban-view":"TaskNotes/Views/kanban-default.base","open-tasks-view":"TaskNotes/Views/tasks-default.base","open-advanced-calendar-view":"TaskNotes/Views/calendar-default.base","open-agenda-view":"TaskNotes/Views/agenda-default.base",relationships:"TaskNotes/Views/relationships.base"},maintainDueDateOffsetInRecurring:!1,resetCheckboxesOnRecurrence:!1,useFrontmatterMarkdownLinks:!1,googleOAuthClientId:"",googleOAuthClientSecret:"",microsoftOAuthClientId:"",microsoftOAuthClientSecret:"",enableGoogleCalendar:!1,enableMicrosoftCalendar:!1,enabledGoogleCalendars:[],googleCalendarSyncTokens:{},enabledMicrosoftCalendars:[],microsoftCalendarSyncTokens:{},googleCalendarExport:kFe,enableDebugLogging:!1}});var Gte={};et(Gte,{DEFAULT_CORE_FIELDS:()=>Ute,DEFAULT_FIELD_GROUPS:()=>Hte,createDefaultFieldConfig:()=>Vte,getFieldsByGroup:()=>SFe,getFieldsForModal:()=>Wte,initializeFieldConfig:()=>Uc,migrateUserFieldsToFieldConfig:()=>Yte});function Vte(){return{version:1,fields:[...Ute],groups:[...Hte]}}function Wte(r,e){return r.fields.filter(t=>t.enabled).filter(t=>e?t.visibleInCreation:t.visibleInEdit).sort((t,n)=>{var o,l;let i=r.groups.find(c=>c.id===t.group),s=r.groups.find(c=>c.id===n.group),a=((o=i==null?void 0:i.order)!=null?o:0)-((l=s==null?void 0:s.order)!=null?l:0);return a!==0?a:t.order-n.order})}function SFe(r,e){let t=Wte(r,e),n=new Map;for(let i of t){let s=n.get(i.group)||[];s.push(i),n.set(i.group,s)}return n}function Yte(r){return!r||r.length===0?[]:r.map((e,t)=>({id:e.id||`user-${t}`,fieldType:"user",group:"custom",displayName:e.displayName||`Field ${t+1}`,visibleInCreation:!0,visibleInEdit:!0,order:t,enabled:!0}))}function Uc(r,e){if(r)return r;let t=Vte();if(e&&e.length>0){let n=Yte(e);t.fields.push(...n)}return t}var Hte,Ute,Xb=v(()=>{Hte=[{id:"basic",displayName:"Basic Information",order:0,collapsible:!1,defaultCollapsed:!1},{id:"metadata",displayName:"Metadata",order:1,collapsible:!0,defaultCollapsed:!1},{id:"organization",displayName:"Organization",order:2,collapsible:!0,defaultCollapsed:!1},{id:"dependencies",displayName:"Dependencies",order:3,collapsible:!0,defaultCollapsed:!1},{id:"custom",displayName:"Custom Fields",order:4,collapsible:!0,defaultCollapsed:!1}],Ute=[{id:"title",fieldType:"core",group:"basic",displayName:"Title",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0,required:!0},{id:"details",fieldType:"core",group:"basic",displayName:"Details",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0},{id:"contexts",fieldType:"core",group:"metadata",displayName:"Contexts",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0},{id:"tags",fieldType:"core",group:"metadata",displayName:"Tags",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0},{id:"time-estimate",fieldType:"core",group:"metadata",displayName:"Time Estimate",visibleInCreation:!0,visibleInEdit:!0,order:2,enabled:!0},{id:"projects",fieldType:"organization",group:"organization",displayName:"Projects",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0},{id:"subtasks",fieldType:"organization",group:"organization",displayName:"Subtasks",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0},{id:"blocked-by",fieldType:"dependency",group:"dependencies",displayName:"Blocked By",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0},{id:"blocking",fieldType:"dependency",group:"dependencies",displayName:"Blocking",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0}]});var Zte,Qte,Vc,cg,dg,Fa,Vt,ug,hD,gD,yD,Fo,Tm,On=v(()=>{Zte="tasknotes-mini-calendar-view",Qte="tasknotes-agenda-view",Vc="tasknotes-pomodoro-view",cg="tasknotes-pomodoro-stats-view",dg="tasknotes-stats-view",Fa="data-changed",Vt="task-updated",ug="task-deleted",hD="pomodoro-start",gD="pomodoro-complete",yD="pomodoro-interrupt",Fo="pomodoro-tick",Tm="date-changed"});function Jte(r,e,t){if(!(e!=null&&e.fields))return!0;let n=e.fields.find(s=>s.id===r);if(!n)return!0;let i=t?n.visibleInCreation:n.visibleInEdit;return!!n.enabled&&!!i}function Xte(r,e){let{getFieldsByGroup:t}=(Xb(),eD(Gte)),n=t(r,e);return[...r.groups||[]].sort((s,a)=>s.order-a.order).map(s=>({id:s.id,fields:n.get(s.id)||[]})).filter(s=>s.fields.length>0)}var ere=v(()=>{});function tre(r,e){let t=Object.keys(e).map(n=>AFe(r,n,e[n]));return t.length===1?t[0]:function(){t.forEach(n=>n())}}function AFe(r,e,t){let n=r[e],i=r.hasOwnProperty(e),s=i?n:function(){return Object.getPrototypeOf(r)[e].apply(this,arguments)},a=t(s);return n&&Object.setPrototypeOf(a,n),Object.setPrototypeOf(o,a),r[e]=o,l;function o(...c){return a===s&&r[e]===o&&l(),a.apply(this,c)}function l(){r[e]===o&&(i?r[e]=s:delete r[e]),a!==s&&(a=s,Object.setPrototypeOf(o,n||Function))}}var rre=v(()=>{});var vL={};et(vL,{EmbeddableMarkdownEditor:()=>yL});function IFe(r){let e=r.workspace.getActiveFile();if(!(e instanceof vD.TFile))throw new Error("Cannot resolve markdown editor prototype without an active markdown file.");let t=r.embedRegistry.embedByExtension.md({app:r,containerEl:activeDocument.createElement("div")},e,"");t.editable=!0,t.showEditor();let n=t.editMode;if(!n)throw t.unload(),new Error("Markdown editor edit mode was not initialized");let i=Object.getPrototypeOf(Object.getPrototypeOf(n));return t.unload(),i.constructor}function NFe(){return typeof app=="undefined"?class{constructor(e,t,n){this.containerEl=activeDocument.createElement("div");this.editor={cm:new Sl.EditorView};this.editorEl=activeDocument.createElement("div");this.owner={editMode:null,editor:null};this._loaded=!1;this.app=e,this.containerEl=t}set(e){}onUpdate(e,t){}buildLocalExtensions(){return[]}destroy(){}unload(){}}:IFe(app)}var vD,bD,Sl,nre,yL,bL=v(()=>{vD=require("obsidian"),bD=require("@codemirror/state"),Sl=require("@codemirror/view");rre();nre={cursorLocation:void 0,value:"",cls:"",placeholder:"",onEnter:()=>!1,onEscape:()=>{},onTab:()=>!1,onSubmit:()=>{},onBlur:()=>{},onPaste:()=>{},onChange:()=>{},extensions:[],enterVimInsertMode:!1},yL=class extends NFe(){constructor(t,n,i={}){super(t,n,{app:t,onMarkdownScroll:()=>{},getMode:()=>"source"});this.hasEnteredVimInsertMode=!1;this.options={...nre,...i},this.initial_value=this.options.value,this.scope=new vD.Scope(this.app.scope),this.scope.register(["Mod"],"Enter",(s,a)=>!0),this.owner.editMode=this,this.owner.editor=this.editor,this.set(i.value||""),this.uninstaller=tre(this.app.workspace,{setActiveLeaf:s=>function(...a){var o;(o=this.activeCM)!=null&&o.hasFocus||s.call(this,...a)}}),this.options.onBlur!==nre.onBlur&&this.editor.cm.contentDOM.addEventListener("blur",()=>{this.app.keymap.popScope(this.scope),this._loaded&&this.options.onBlur(this)}),this.editor.cm.contentDOM.addEventListener("focusin",()=>{this.app.keymap.pushScope(this.scope),this.app.workspace.activeEditor=this.owner,this.options.enterVimInsertMode&&!this.hasEnteredVimInsertMode&&(this.hasEnteredVimInsertMode=!0,this.enterVimInsertMode())}),i.cls&&this.editorEl.classList.add(i.cls),this.editorEl.classList.remove("markdown-source-view","mod-cm6"),i.cursorLocation&&this.editor.cm.dispatch({selection:bD.EditorSelection.range(i.cursorLocation.anchor,i.cursorLocation.head)})}get value(){return this.editor.cm.state.doc.toString()}setValue(t){this.set(t)}enterVimInsertMode(){window.setTimeout(()=>{var t,n;try{if(!this.app.vault.getConfig("vimMode"))return;let s=(t=window.CodeMirrorAdapter)==null?void 0:t.Vim;if(!s)return;let a=(n=this.editor.cm.cm)!=null?n:this.activeCM;if(!a)return;s.handleKey(a,"i","api")}catch(i){}},50)}onUpdate(t,n){super.onUpdate(t,n),n&&this.options.onChange(this.value,t)}buildLocalExtensions(){let t=super.buildLocalExtensions();return t.push(Sl.EditorView.theme({".cm-lineNumbers":{display:"none !important"},".cm-gutters":{display:"none !important"}})),t.push((0,Sl.tooltips)({parent:activeDocument.body})),this.options.placeholder&&t.push((0,Sl.placeholder)(this.options.placeholder)),t.push(Sl.EditorView.domEventHandlers({paste:n=>{this.options.onPaste(n,this)}})),t.push(bD.Prec.highest(Sl.keymap.of([{key:"Enter",run:n=>this.options.onEnter(this,!1,!1),shift:n=>this.options.onEnter(this,!1,!0)},{key:"Mod-Enter",run:n=>(this.options.onSubmit(this),!0)},{key:"Escape",run:n=>(this.options.onEscape(this),!0)},{key:"Tab",run:n=>this.options.onTab(this,!1)},{key:"Shift-Tab",run:n=>this.options.onTab(this,!0)}]))),this.options.extensions&&this.options.extensions.length>0&&t.push(...this.options.extensions),t}destroy(){this._loaded&&this.unload(),this.app.keymap.popScope(this.scope),this.app.workspace.activeEditor=null,this.uninstaller&&(this.uninstaller(),this.uninstaller=void 0),this.containerEl.empty(),super.destroy()}onunload(){this.destroy()}}});function RFe(){return(bL(),eD(vL)).EmbeddableMarkdownEditor}function TD(r,e,t){try{let n=RFe();return new n(r,e,{...t,onTab:(i,s)=>t.onTab(s)})}catch(n){console.error("Failed to create markdown editor:",n);let i=e.createEl("textarea",{cls:t.cls+"-fallback",placeholder:t.placeholder});return i.value=t.value,i.addEventListener("input",s=>{t.onChange(s.target.value)}),i.addEventListener("keydown",s=>{s.key==="Enter"&&(s.ctrlKey||s.metaKey)?(s.preventDefault(),t.onSubmit()):s.key==="Escape"?(s.preventDefault(),t.onEscape()):s.key==="Tab"&&t.onTab(s.shiftKey)&&s.preventDefault()}),null}}var TL=v(()=>{});var ire,Qn,Wc=v(()=>{ire=require("obsidian"),Qn=class extends ire.Menu{show(e){var t;if(e.instanceOf(MouseEvent))this.showAtMouseEvent(e);else if(e.instanceOf(KeyboardEvent)){let n=e.currentTarget;if(!n||!((t=n.instanceOf)!=null&&t.call(n,HTMLElement)))return;this.showAtPosition({x:n.getBoundingClientRect().left,y:n.getBoundingClientRect().bottom+4})}}}});var sre={};et(sre,{DateTimePickerModal:()=>tT});var pg,tT,kL=v(()=>{pg=require("obsidian"),tT=class extends pg.Modal{constructor(e,t){super(e),this.options=t}onOpen(){let{contentEl:e}=this;e.empty(),e.addClass("date-time-picker-modal"),this.options.title&&e.createEl("h3",{text:this.options.title}),new pg.Setting(e).setName("Date").addText(n=>{this.dateInput=n.inputEl,this.dateInput.type="date",this.options.currentDate&&(this.dateInput.value=this.options.currentDate)}),new pg.Setting(e).setName("Time (optional)").addText(n=>{this.timeInput=n.inputEl,this.timeInput.type="time",this.options.currentTime&&(this.timeInput.value=this.options.currentTime)}),new pg.Setting(e).addButton(n=>n.setButtonText("Cancel").onClick(()=>{this.close()})).addButton(n=>n.setButtonText("Select").setCta().onClick(()=>{let i=this.dateInput.value||null,s=this.timeInput.value||null;this.options.onSelect(i,s),this.close()})),window.setTimeout(()=>{this.dateInput.focus()},100);let t=n=>{if(n.key==="Enter"){n.preventDefault();let i=this.dateInput.value||null,s=this.timeInput.value||null;this.options.onSelect(i,s),this.close()}};this.dateInput.addEventListener("keydown",t),this.timeInput.addEventListener("keydown",t)}onClose(){let{contentEl:e}=this;e.empty()}}});var ML={};et(ML,{NATURAL_LANGUAGE_DATE_PATTERNS:()=>rT,addDaysToDateString:()=>km,addDaysToDateTime:()=>hg,addMonthsToDateString:()=>$Fe,addWeeksToDateString:()=>SL,addYearsToDateString:()=>jFe,combineDateAndTime:()=>ts,convertUTCToLocalCalendarDate:()=>hu,createSafeDate:()=>FFe,createSafeUTCDate:()=>xL,createTimeFormatHelper:()=>WFe,createUTCDateForRRule:()=>ja,createUTCDateFromLocalCalendarDate:()=>en,formatDateAsUTCString:()=>CL,formatDateForDisplay:()=>Gc,formatDateForStorage:()=>ue,formatDateStringTime:()=>lre,formatDateTime:()=>ore,formatDateTimeForDisplay:()=>xs,formatTime:()=>fg,formatTimestampForDisplay:()=>kD,generateUTCCalendarDates:()=>PL,getCurrentDateString:()=>mg,getCurrentDateTimeString:()=>GFe,getCurrentTimestamp:()=>Ve,getDatePart:()=>tt,getEndOfMonthString:()=>HFe,getEndOfWeekString:()=>BFe,getEndOfYearString:()=>VFe,getNaturalLanguageDateSuggestions:()=>QFe,getStartOfMonthString:()=>qFe,getStartOfWeekString:()=>zFe,getStartOfYearString:()=>UFe,getTimePart:()=>$a,getTodayLocal:()=>kr,getTodayString:()=>cn,getUTCEndOfMonth:()=>DD,getUTCEndOfWeek:()=>_L,getUTCStartOfMonth:()=>ED,getUTCStartOfWeek:()=>xD,hasTimeComponent:()=>$r,isBeforeDateSafe:()=>Yc,isBeforeDateTimeAware:()=>Kc,isNaturalLanguageDate:()=>CD,isOverdueTimeAware:()=>rs,isPastDate:()=>EL,isSameDateSafe:()=>Ln,isToday:()=>iT,isTodayTimeAware:()=>wD,isTodayUTC:()=>DL,isValidDateInput:()=>ZFe,normalizeCalendarBoundariesToUTC:()=>KFe,normalizeDateString:()=>LFe,parseDate:()=>OFe,parseDateAsLocal:()=>wm,parseDateToLocal:()=>Mr,parseDateToUTC:()=>st,parseTimestamp:()=>are,resolveNaturalLanguageDate:()=>Sm,startOfDayForDateString:()=>nT,validateCompleteInstances:()=>SD,validateDateInput:()=>wL,validateDateTimeInput:()=>YFe});function oi(r){if(!r){let t=new Error("Date string cannot be empty");throw console.error("Date parsing error:",{dateString:r,error:t.message}),t}let e=r.trim();try{let t=e.match(/^(\d{4}-\d{2}-\d{2})\s+(Mon|Tue|Wed|Thu|Fri|Sat|Sun|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)$/i);if(t){let n=t[1];return oi(n)}if(e.startsWith("T")&&/^T\d{2}:\d{2}(:\d{2})?/.test(e)){let n=new Error(`Invalid date format - time without date: ${r}`);throw console.warn("Date parsing error - incomplete time format:",{original:r,trimmed:e,error:n.message}),n}if(/^\d{4}-W\d{2}$/.test(e)){let[n,i]=e.split("-W"),s=parseInt(n,10),a=parseInt(i,10);if(isNaN(s)||isNaN(a)){let u=new Error(`Invalid numeric values in ISO week format: ${r}`);throw console.warn("Date parsing error - invalid ISO week numbers:",{original:r,year:n,week:i,yearNum:s,weekNum:a}),u}if(a<1||a>53){let u=new Error(`Invalid week number in ISO week format: ${r} (week must be 1-53)`);throw console.warn("Date parsing error - week number out of range:",{original:r,weekNum:a,error:u.message}),u}let o=new Date(s,0,4),l=o.getDay(),c=new Date(o);c.setDate(o.getDate()-(l===0?6:l-1));let d=new Date(c);if(d.setDate(c.getDate()+(a-1)*7),!Kn(d)){let u=new Error(`Failed to calculate date from ISO week format: ${r}`);throw console.error("Date parsing error - ISO week calculation failed:",{original:r,yearNum:s,weekNum:a,jan4:o.toISOString(),targetWeekMonday:d.toString()}),u}return d}if(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2})?/.test(e)){let n=e.replace(" ","T"),i=ia(n);if(!Kn(i)){let s=new Error(`Invalid space-separated datetime: ${r}`);throw console.warn("Date parsing error - space-separated datetime invalid:",{original:r,converted:n,error:s.message}),s}return i}if(e.includes("T")||e.includes("Z")||e.match(/[+-]\d{2}:\d{2}$/)){let n=ia(e);if(!Kn(n)){let i=new Error(`Invalid timezone-aware date: ${r}`);throw console.warn("Date parsing error - timezone-aware format invalid:",{original:r,trimmed:e,error:i.message}),i}return n}else{let n=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!n){let l=new Error(`Invalid date-only string: ${r} (expected format: yyyy-MM-dd)`);throw console.warn("Date parsing error - date-only format invalid:",{original:r,trimmed:e,expectedFormat:"yyyy-MM-dd",error:l.message}),l}let[,i,s,a]=n,o=new Date(parseInt(i,10),parseInt(s,10)-1,parseInt(a,10));if(!Kn(o)||o.getFullYear()!==parseInt(i,10)||o.getMonth()!==parseInt(s,10)-1||o.getDate()!==parseInt(a,10)){let l=new Error(`Invalid date values: ${r}`);throw console.warn("Date parsing error - invalid date values:",{original:r,year:i,month:s,day:a,error:l.message}),l}return o}}catch(t){if(t instanceof Error&&t.message.includes("Invalid date"))throw t;let n=new Error(`Unexpected error parsing date "${r}": ${t instanceof Error?t.message:String(t)}`);throw console.error("Unexpected date parsing error:",{original:r,trimmed:e,error:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0}),n}}function st(r){if(!r){let t=new Error("Date string cannot be empty");throw console.error("Date parsing error:",{dateString:r,error:t.message}),t}let e=r.trim();try{let t=e.match(/^(\d{4}-\d{2}-\d{2})\s+(Mon|Tue|Wed|Thu|Fri|Sat|Sun|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)$/i);if(t){let i=t[1];return st(i)}let n=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(n){let[,i,s,a]=n,o=parseInt(i,10),l=parseInt(s,10),c=parseInt(a,10);if(l<1||l>12)throw new Error(`Invalid month in date: ${r}`);if(c<1||c>31)throw new Error(`Invalid day in date: ${r}`);let d=new Date(Date.UTC(o,l-1,c));if(d.getUTCFullYear()!==o||d.getUTCMonth()!==l-1||d.getUTCDate()!==c)throw new Error(`Invalid date values: ${r}`);return d}return oi(e)}catch(t){let n=new Error(`Failed to parse date to UTC: ${e}`);throw console.error("Date parsing error:",{dateString:r,trimmed:e,error:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0}),n}}function Mr(r){return oi(r)}function OFe(r){return oi(r)}function Ln(r,e){try{let t=tt(r),n=tt(e),i=st(t),s=st(n);return i.getTime()===s.getTime()}catch(t){return console.error("Error comparing dates:",{date1:r,date2:e,error:t}),!1}}function Yc(r,e){try{let t=tt(r),n=tt(e),i=st(t),s=st(n);return i.getTime()=0?"+":"-",n=m=>String(Math.abs(m)).padStart(2,"0"),i=n(Math.floor(Math.abs(e)/60)),s=n(Math.abs(e)%60),a=r.getFullYear(),o=n(r.getMonth()+1),l=n(r.getDate()),c=n(r.getHours()),d=n(r.getMinutes()),u=n(r.getSeconds()),p=String(r.getMilliseconds()).padStart(3,"0");return`${a}-${o}-${l}T${c}:${d}:${u}.${p}${t}${i}:${s}`}function mg(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}function are(r){try{if(!r)throw new Error("Timestamp string cannot be empty");let e=ia(r);if(!Kn(e))throw new Error(`Invalid timestamp: ${r}`);return e}catch(e){throw console.error("Error parsing timestamp:",{timestampString:r,error:e}),e}}function kD(r,e,t="24"){if(!r)return r;try{let n=are(r);return Kn(n)?P(n,e||(t==="12"?"MMM d, yyyy h:mm a":"MMM d, yyyy HH:mm")):r}catch(n){return console.error("Error formatting timestamp for display:",{timestampString:r,error:n}),r}}function $r(r){return r?/T\d{2}:\d{2}/.test(r):!1}function tt(r){if(!r)return"";try{if(/^\d{4}-\d{2}-\d{2}$/.test(r))return r;let e=r.indexOf("T");if(e>-1)return r.substring(0,e);let t=st(r);return ue(t)}catch(e){return console.error("Error extracting date part:",{dateString:r,error:e}),r}}function $a(r){if(!r||!$r(r))return null;try{let e=oi(r);return P(e,"HH:mm")}catch(e){return console.error("Error extracting time part:",{dateString:r,error:e}),null}}function fg(r,e="24"){return Kn(r)?P(r,e==="12"?"h:mm a":"HH:mm"):(console.warn("Invalid date provided to formatTime:",r),"")}function ore(r,e="24"){return Kn(r)?P(r,e==="12"?"MMM d, yyyy h:mm a":"MMM d, yyyy HH:mm"):(console.warn("Invalid date provided to formatDateTime:",r),"")}function lre(r,e="24"){if(!r||!$r(r))return r;try{let t=Mr(r);return fg(t,e)}catch(t){return console.error("Error formatting date string time:",{dateString:r,error:t}),r}}function WFe(r){return{formatDateTimeForDisplay:(e,t={})=>xs(e,{...t,userTimeFormat:r}),formatTime:e=>fg(e,r),formatDateTime:e=>ore(e,r),formatDateStringTime:e=>lre(e,r)}}function ts(r,e){if(!r)return"";if(!e)return r;try{let t=r.match(/^(\d{4}-\d{2}-\d{2})$/);if(t)return/^\d{2}:\d{2}$/.test(e)?`${t[1]}T${e}`:(console.warn("Invalid time format, expected HH:mm:",e),r);let n=tt(r);return!n||!/^\d{4}-\d{2}-\d{2}$/.test(n)?(console.warn("Invalid date part from dateString:",{dateString:r,datePart:n}),r):/^\d{2}:\d{2}$/.test(e)?`${n}T${e}`:(console.warn("Invalid time format, expected HH:mm:",e),r)}catch(t){return console.error("Error combining date and time:",{dateString:r,timeString:e,error:t}),r}}function xs(r,e={}){if(!r)return"";let{dateFormat:t="MMM d, yyyy",timeFormat:n,showTime:i=!0,userTimeFormat:s="24"}=e,a=n||(s==="12"?"h:mm a":"HH:mm");try{let o=oi(r);return $r(r)&&i?!t||t.trim()===""?P(o,a):P(o,`${t} ${a}`):!t||t.trim()===""?"":P(o,t)}catch(o){return console.error("Error formatting datetime for display:",{dateString:r,error:o}),r}}function Kc(r,e){try{let t=st(r),n=st(e),i=t,s=n;if($r(r)){let a=$a(r);if(a){let[o,l]=a.split(":").map(Number);i=new Date(t),i.setUTCHours(o,l,0,0)}}if($r(e)){let a=$a(e);if(a){let[o,l]=a.split(":").map(Number);s=new Date(n),s.setUTCHours(o,l,0,0)}}return $r(r)&&!$r(e)?(s=new Date(n),s.setUTCHours(23,59,59,999)):!$r(r)&&$r(e)&&(i=new Date(t),i.setUTCHours(23,59,59,999)),i.getTime(){if(typeof e!="string"||!e.trim())return!1;let t=e.trim();if(t.startsWith("T")&&/^T\d{2}:\d{2}(:\d{2})?/.test(t)||!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;try{return oi(t),!0}catch(n){return console.warn("Invalid complete_instances entry (date parsing failed):",e,n),!1}}).map(e=>e.trim()):[]}function GFe(){return P(new Date,"yyyy-MM-dd'T'HH:mm")}function hg(r,e){try{let t=oi(r),n=ym(t,e);return $r(r)?P(n,"yyyy-MM-dd'T'HH:mm"):P(n,"yyyy-MM-dd")}catch(t){throw console.error("Error adding days to datetime:",{dateString:r,days:e,error:t}),t}}function ja(r){try{let e=r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!e)throw new Error(`Invalid date format for RRULE: ${r}`);let[,t,n,i]=e,s=parseInt(t,10),a=parseInt(n,10),o=parseInt(i,10);if(a<1||a>12)throw new Error(`Invalid month in date: ${r}`);if(o<1||o>31)throw new Error(`Invalid day in date: ${r}`);let l=new Date(Date.UTC(s,a-1,o));if(l.getUTCFullYear()!==s||l.getUTCMonth()!==a-1||l.getUTCDate()!==o)throw new Error(`Invalid date values: ${r}`);return l}catch(e){throw console.error("Error creating UTC date for RRULE:",{dateString:r,error:e}),e}}function en(r){let e=r.getFullYear(),t=r.getMonth(),n=r.getDate();return new Date(Date.UTC(e,t,n,0,0,0,0))}function DL(r){try{let e=kr(),t=en(e);return r.getUTCFullYear()===t.getUTCFullYear()&&r.getUTCMonth()===t.getUTCMonth()&&r.getUTCDate()===t.getUTCDate()}catch(e){return console.error("Error in isTodayUTC:",e),!1}}function KFe(r,e){try{let t=P(r,"yyyy-MM-dd"),n=P(e,"yyyy-MM-dd"),i=ja(t),s=ja(n);return{utcStart:i,utcEnd:s}}catch(t){throw console.error("Error normalizing calendar boundaries to UTC:",{startDate:r,endDate:e,error:t}),t}}function CL(r){try{let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}catch(e){return console.error("Error formatting date as UTC string:",{date:r,error:e}),r.toISOString().split("T")[0]}}function ue(r){try{if(!r||!(r instanceof Date)||isNaN(r.getTime()))return console.warn("formatDateForStorage received invalid date:",r),"";let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}catch(e){return console.error("Error formatting date for storage:",{date:r,error:e}),""}}function PL(r,e){let t=[],n=ue(r),i=ue(e),s=ja(n),a=ja(i);for(;s<=a;)t.push(new Date(s)),s.setUTCDate(s.getUTCDate()+1);return t}function xD(r,e=1){let t=ja(ue(r)),i=(t.getUTCDay()-e+7)%7,s=new Date(t);return s.setUTCDate(s.getUTCDate()-i),s}function _L(r,e=1){let t=xD(r,e),n=new Date(t);return n.setUTCDate(n.getUTCDate()+6),n}function ED(r){let e=ja(ue(r));return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1))}function DD(r){let e=ja(ue(r));return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+1,0))}function CD(r){if(!r||typeof r!="string")return!1;let e=r.toLowerCase().trim().replace(/\s+/g," ");return e in rT?!0:[/^in\s+(\d+)\s+(days?)$/,/^(\d+)\s+(days?)\s+ago$/,/^in\s+(\d+)\s+(weeks?)$/,/^(\d+)\s+(weeks?)\s+ago$/].some(n=>n.test(e))}function ZFe(r){if(typeof r!="string")return!1;let e=r.trim();if(e===""||CD(e))return!0;try{let t=oi(e);return Kn(t)}catch(t){return!1}}function Sm(r){if(!r||typeof r!="string")return r;let e=r.toLowerCase().trim().replace(/\s+/g," ");if(e in rT)try{return rT[e]()}catch(t){return console.error("Error resolving natural language date:",{value:r,error:t}),r}try{let t=e.match(/^in\s+(\d+)\s+(days?)$/);if(t){let n=parseInt(t[1],10);return km(cn(),n)}if(t=e.match(/^(\d+)\s+(days?)\s+ago$/),t){let n=parseInt(t[1],10);return km(cn(),-n)}if(t=e.match(/^in\s+(\d+)\s+(weeks?)$/),t){let n=parseInt(t[1],10);return SL(cn(),n)}if(t=e.match(/^(\d+)\s+(weeks?)\s+ago$/),t){let n=parseInt(t[1],10);return SL(cn(),-n)}}catch(t){console.error("Error parsing relative natural language date:",{value:r,error:t})}return r}function QFe(){let r=Object.keys(rT),e=["in 3 days","2 days ago","in 1 week","2 weeks ago"];return[...r,...e].sort()}var rT,Qe=v(()=>{Tn();rT={today:()=>cn(),tomorrow:()=>km(cn(),1),yesterday:()=>km(cn(),-1),"next week":()=>km(cn(),7),"last week":()=>km(cn(),-7)}});var dre={};et(dre,{DateContextMenu:()=>Es});function JFe(){return(0,cre.moment)()}function XFe(r){return r.setSubmenu()}var cre,Es,xm=v(()=>{cre=require("obsidian");Wc();kL();Qe();Es=class{constructor(e){this.menu=new Qn,this.options=e,this.buildMenu()}t(e,t,n){var i;return((i=this.options.plugin)==null?void 0:i.i18n.translate(e,n))||t||e}buildMenu(){this.options.title&&(this.menu.addItem(s=>{s.setTitle(this.options.title||""),s.setIcon("calendar"),s.setDisabled(!0)}),this.menu.addSeparator());let e=this.getDateOptions(),t=e.filter(s=>s.category==="increment");t.length>0&&(t.forEach(s=>{this.menu.addItem(a=>{s.icon&&a.setIcon(s.icon),a.setTitle(s.label),a.onClick(async()=>{this.options.onSelect(s.value,null)})})}),this.menu.addSeparator()),e.filter(s=>s.category==="basic").forEach(s=>{this.menu.addItem(a=>{s.icon&&a.setIcon(s.icon);let l=s.value&&s.value===this.options.currentValue?this.t("contextMenus.date.selected","\u2713 {label}",{label:s.label}):s.label;a.setTitle(l),a.onClick(async()=>{this.options.onSelect(s.value,null)})})});let i=e.filter(s=>s.category==="weekday");i.length>0&&(this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.date.weekdaysLabel","Weekdays")),s.setIcon("calendar");let a=XFe(s);i.forEach(o=>{a.addItem(l=>{let d=o.value&&o.value===this.options.currentValue?this.t("contextMenus.date.selected","\u2713 {label}",{label:o.label}):o.label;l.setTitle(d),l.setIcon("calendar"),l.onClick(async()=>{this.options.onSelect(o.value,null)})})})})),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.date.pickDateTime","Pick date & time\u2026")),s.setIcon("calendar"),s.onClick(async()=>{this.showDateTimePicker()})}),this.options.currentValue&&this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.date.clearDate","Clear date")),s.setIcon("x"),s.onClick(async()=>{this.options.onSelect(null,null)})})}getDateOptions(){let e=JFe(),t=[];this.options.currentValue&&(t.push({label:this.t("contextMenus.date.increment.plusOneDay","+1 day"),value:hg(this.options.currentValue,1),icon:"plus",category:"increment"}),t.push({label:this.t("contextMenus.date.increment.minusOneDay","-1 day"),value:hg(this.options.currentValue,-1),icon:"minus",category:"increment"}),t.push({label:this.t("contextMenus.date.increment.plusOneWeek","+1 week"),value:hg(this.options.currentValue,7),icon:"plus-circle",category:"increment"}),t.push({label:this.t("contextMenus.date.increment.minusOneWeek","-1 week"),value:hg(this.options.currentValue,-7),icon:"minus-circle",category:"increment"})),t.push({label:this.t("contextMenus.date.basic.today","Today"),value:e.format("YYYY-MM-DD"),icon:"calendar-check",isToday:!0,category:"basic"}),t.push({label:this.t("contextMenus.date.basic.tomorrow","Tomorrow"),value:e.clone().add(1,"day").format("YYYY-MM-DD"),icon:"calendar-plus",category:"basic"}),["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].forEach((o,l)=>{let c=e.clone().day(l);c.isSameOrBefore(e,"day")&&(c=c.add(1,"week"));let d=this.t(`common.weekdays.${o.toLowerCase()}`,o);t.push({label:d,value:c.format("YYYY-MM-DD"),icon:"calendar",category:"weekday"})});let i=e.clone().day(6);(i.isBefore(e)||i.isSame(e,"day"))&&i.add(1,"week"),t.push({label:this.t("contextMenus.date.basic.thisWeekend","This weekend"),value:i.format("YYYY-MM-DD"),icon:"calendar-days",category:"basic"});let s=e.clone().day(1).add(1,"week");t.push({label:this.t("contextMenus.date.basic.nextWeek","Next week"),value:s.format("YYYY-MM-DD"),icon:"calendar-plus",category:"basic"});let a=e.clone().add(1,"month").startOf("month");return t.push({label:this.t("contextMenus.date.basic.nextMonth","Next month"),value:a.format("YYYY-MM-DD"),icon:"calendar-range",category:"basic"}),t}show(e){this.menu.show(e)}showAtElement(e){this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4})}showDateTimePicker(){var n;let e=this.options.app||((n=this.options.plugin)==null?void 0:n.app);if(!e){console.error("DateContextMenu: No app instance available for modal");return}new tT(e,{currentDate:this.options.currentValue||null,currentTime:this.options.currentTime||null,title:this.t("contextMenus.date.modal.title","Set date & time"),onSelect:(i,s)=>{this.options.onSelect(i,s)}}).open()}}});var ure={};et(ure,{PriorityContextMenu:()=>$o});var $o,sT=v(()=>{Wc();$o=class{constructor(e){this.targetDoc=activeDocument;this.menu=new Qn,this.options=e,this.buildMenu()}buildMenu(){let e=this.options.plugin.settings.customPriorities;this.sortedPriorities=[...e].sort((t,n)=>n.weight-t.weight),this.sortedPriorities.forEach(t=>{this.menu.addItem(n=>{let i=t.label;n.setIcon("star"),t.value===this.options.currentValue&&(i=`\u2713 ${t.label}`),n.setTitle(i),n.onClick(async()=>{this.options.onSelect(t.value)})})})}show(e){var t,n;(n=(t=e.target)==null?void 0:t.instanceOf)!=null&&n.call(t,HTMLElement)&&(this.targetDoc=e.target.ownerDocument),this.menu.show(e),window.setTimeout(()=>{this.applyColorStyling()},10)}showAtElement(e){this.targetDoc=e.ownerDocument,this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4}),window.setTimeout(()=>{this.applyColorStyling()},10)}applyColorStyling(){let e=this.targetDoc.querySelector(".menu");if(!e)return;let t=e.querySelectorAll(".menu-item");this.sortedPriorities.forEach((n,i)=>{let s=t[i];if(s&&n.color){let a=s.querySelector(".menu-item-icon");a&&(a.style.color=n.color)}})}}});var PD,pre=v(()=>{Wc();PD=class{constructor(e){this.targetDoc=activeDocument;this.menu=new Qn,this.options=e,this.buildMenu()}buildMenu(){this.getStatusOptions().forEach((t,n)=>{this.menu.addItem(i=>{let s=t.label;i.setIcon(t.icon||"circle"),t.value===this.options.currentValue&&(s=`\u2713 ${t.label}`),i.setTitle(s),i.onClick(async()=>{this.options.onSelect(t.value)})})})}getStatusOptions(){let e=this.options.plugin.settings.customStatuses,t=[];return e&&e.length>0&&[...e].sort((i,s)=>i.order-s.order).forEach(i=>{t.push({label:i.label,value:i.value,color:i.color,icon:i.icon})}),t}capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}show(e){var t,n;(n=(t=e.target)==null?void 0:t.instanceOf)!=null&&n.call(t,HTMLElement)&&(this.targetDoc=e.target.ownerDocument),this.menu.show(e),window.setTimeout(()=>{this.applyColorStyling()},10)}showAtElement(e){this.targetDoc=e.ownerDocument,this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4}),window.setTimeout(()=>{this.applyColorStyling()},10)}applyColorStyling(){let e=this.getStatusOptions(),t=this.targetDoc.querySelector(".menu");if(!t)return;let n=t.querySelectorAll(".menu-item");e.forEach((i,s)=>{let a=n[s];if(a&&i.color){let o=a.querySelector(".menu-item-icon");o&&(o.style.color=i.color)}})}}});var mre={};et(mre,{RecurrenceContextMenu:()=>jo});var za,jo,AL,gg=v(()=>{za=require("obsidian");Wc();jo=class{constructor(e){this.menu=new Qn,this.options=e,this.translate=e.plugin.i18n.translate.bind(e.plugin.i18n),this.buildMenu()}buildMenu(){this.getRecurrenceOptions().forEach(t=>{if(t.label.startsWith("\u2500")){this.menu.addSeparator();return}this.menu.addItem(n=>{let i=t.label;t.icon&&n.setIcon(t.icon),t.value===this.options.currentValue&&(i=`\u2713 ${t.label}`),n.setTitle(i),n.onClick(async()=>{let s=t.anchor||"scheduled";this.options.onSelect(t.value,s)})})}),this.menu.addSeparator(),this.menu.addItem(t=>{t.setTitle(this.translate("components.recurrenceContextMenu.customRecurrence")),t.setIcon("settings"),t.onClick(async()=>{this.showCustomRecurrenceModal()})}),this.options.currentValue&&this.menu.addItem(t=>{t.setTitle(this.translate("components.recurrenceContextMenu.clearRecurrence")),t.setIcon("x"),t.onClick(async()=>{this.options.onSelect(null)})})}getRecurrenceOptions(){let e=[],t=new Date,n=["SU","MO","TU","WE","TH","FR","SA"],i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=n[t.getDay()],a=t.getDate(),o=t.getMonth()+1,l=i[t.getMonth()],c=t.toLocaleDateString("en-US",{weekday:"long"}),d=this.formatDateForDTSTART(t);if(this.options.currentValue){let u=this.options.currentValue.match(/DTSTART:(\d{8}(?:T\d{6}Z?)?)/);if(u&&u[1].includes("T")){let p=u[1].split("T")[1];d=`${d}T${p}`}}else if(this.options.scheduledDate&&this.options.scheduledDate.includes("T")){let u=this.options.scheduledDate.match(/T(\d{2}):(\d{2})/);if(u){let p=u[1],m=u[2];d=`${d}T${p}${m}00Z`}}return e.push({label:this.translate("components.recurrenceContextMenu.daily"),value:`DTSTART:${d};FREQ=DAILY;INTERVAL=1`,icon:"calendar-days"}),e.push({label:this.translate("components.recurrenceContextMenu.weeklyOn",{day:c}),value:`DTSTART:${d};FREQ=WEEKLY;INTERVAL=1;BYDAY=${s}`,icon:"calendar"}),e.push({label:this.translate("components.recurrenceContextMenu.everyTwoWeeksOn",{day:c}),value:`DTSTART:${d};FREQ=WEEKLY;INTERVAL=2;BYDAY=${s}`,icon:"calendar"}),e.push({label:this.translate("components.recurrenceContextMenu.monthlyOnThe",{ordinal:this.getOrdinal(a)}),value:`DTSTART:${d};FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=${a}`,icon:"calendar-range"}),e.push({label:this.translate("components.recurrenceContextMenu.everyThreeMonthsOnThe",{ordinal:this.getOrdinal(a)}),value:`DTSTART:${d};FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=${a}`,icon:"calendar-range"}),e.push({label:this.translate("components.recurrenceContextMenu.yearlyOn",{month:l,ordinal:this.getOrdinal(a)}),value:`DTSTART:${d};FREQ=YEARLY;INTERVAL=1;BYMONTH=${o};BYMONTHDAY=${a}`,icon:"calendar-clock"}),e.push({label:this.translate("components.recurrenceContextMenu.weekdaysOnly"),value:`DTSTART:${d};FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR`,icon:"briefcase"}),e.push({label:"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",value:"",icon:void 0}),e.push({label:this.translate("components.recurrenceContextMenu.dailyAfterCompletion"),value:`DTSTART:${d};FREQ=DAILY;INTERVAL=1`,icon:"calendar-days",anchor:"completion"}),e.push({label:this.translate("components.recurrenceContextMenu.every3DaysAfterCompletion"),value:`DTSTART:${d};FREQ=DAILY;INTERVAL=3`,icon:"calendar-days",anchor:"completion"}),e.push({label:this.translate("components.recurrenceContextMenu.weeklyAfterCompletion"),value:`DTSTART:${d};FREQ=WEEKLY;INTERVAL=1`,icon:"calendar",anchor:"completion"}),e.push({label:this.translate("components.recurrenceContextMenu.monthlyAfterCompletion"),value:`DTSTART:${d};FREQ=MONTHLY;INTERVAL=1`,icon:"calendar-range",anchor:"completion"}),e}formatDateForDTSTART(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}${n}${i}`}getOrdinal(e){let t=["th","st","nd","rd"],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}showCustomRecurrenceModal(){new AL(this.options.app,this.options.currentValue||"",this.options.currentAnchor||"scheduled",this.options.scheduledDate,(e,t)=>{e&&this.options.onSelect(e,t)}).open()}show(e){this.menu.show(e)}},AL=class extends za.Modal{constructor(t,n,i,s,a){super(t);this.frequency="DAILY";this.interval=1;this.byDay=[];this.byMonthDay=[];this.byMonth=[];this.until="";this.endType="never";this.dtstart="";this.dtstartTime="";this.recurrenceAnchor="scheduled";this.currentValue=n,this.recurrenceAnchor=i,this.scheduledDate=s,this.onSubmit=a,this.parseCurrentValue()}parseCurrentValue(){if(!this.currentValue){if(this.dtstart=this.formatTodayForInput(),this.scheduledDate&&this.scheduledDate.includes("T")){let n=this.scheduledDate.match(/T(\d{2}):(\d{2})/);n&&(this.dtstartTime=`${n[1]}:${n[2]}`)}return}let t=this.currentValue.split(";");for(let n of t){let i=n.includes(":")&&n.startsWith("DTSTART")?":":"=",[s,a]=n.split(i);switch(s){case"DTSTART":if(a.length>=8){if(this.dtstart=`${a.slice(0,4)}-${a.slice(4,6)}-${a.slice(6,8)}`,a.length>8&&a.includes("T")){let o=a.slice(9);o.length>=4&&(this.dtstartTime=`${o.slice(0,2)}:${o.slice(2,4)}`)}}else{let o=new Date(a);isNaN(o.getTime())?this.dtstart=this.formatTodayForInput():this.dtstart=a}break;case"FREQ":this.frequency=a;break;case"INTERVAL":this.interval=parseInt(a)||1;break;case"BYDAY":{let o=a.split(","),l=[];for(let c of o){let d=c.match(/^(-?\d+)([A-Z]{2})$/);d?(this.bySetPos=parseInt(d[1]),l.push(d[2])):l.push(c)}this.byDay=l;break}case"BYMONTHDAY":this.byMonthDay=a.split(",").map(o=>parseInt(o));break;case"BYMONTH":this.byMonth=a.split(",").map(o=>parseInt(o));break;case"BYSETPOS":this.bySetPos=parseInt(a);break;case"COUNT":this.count=parseInt(a),this.endType="count";break;case"UNTIL":a.length===8?this.until=`${a.slice(0,4)}-${a.slice(4,6)}-${a.slice(6,8)}`:this.until=a,this.endType="until";break}}}formatTodayForInput(){let t=new Date,n=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${i}-${s}`}onOpen(){let{contentEl:t}=this;t.empty(),t.createEl("h2",{text:"Custom recurrence"}),new za.Setting(t).setName("Start date").setDesc("The date when the recurrence pattern begins").addText(Z=>{Z.inputEl.type="date",Z.setValue(this.dtstart).onChange(X=>{this.dtstart=X})}),new za.Setting(t).setName("Start time").setDesc("The time when recurring instances should appear (optional)").addText(Z=>{Z.inputEl.type="time",Z.setValue(this.dtstartTime).onChange(X=>{this.dtstartTime=X})}),new za.Setting(t).setName("Recur from").setDesc("When should the next occurrence be calculated from?").addDropdown(Z=>{Z.addOption("scheduled","Scheduled date (fixed schedule)").addOption("completion","Completion date (flexible schedule)").setValue(this.recurrenceAnchor).onChange(X=>{this.recurrenceAnchor=X})}),new za.Setting(t).setName("Frequency").addDropdown(Z=>{Z.addOption("DAILY","Daily").addOption("WEEKLY","Weekly").addOption("MONTHLY","Monthly").addOption("YEARLY","Yearly").setValue(this.frequency).onChange(X=>{this.frequency=X,this.updateFrequencySpecificVisibility()})}),new za.Setting(t).setName("Interval").setDesc("Every X days/weeks/months/years").addText(Z=>{Z.setValue(this.interval.toString()).onChange(X=>{this.interval=parseInt(X)||1})});let n=new za.Setting(t).setName("Days of week").setDesc("Select specific days (for weekly recurrence)"),i=n.controlEl.createDiv("days-container");[{key:"MO",label:"Mon"},{key:"TU",label:"Tue"},{key:"WE",label:"Wed"},{key:"TH",label:"Thu"},{key:"FR",label:"Fri"},{key:"SA",label:"Sat"},{key:"SU",label:"Sun"}].forEach(Z=>{let X=i.createEl("label",{cls:"day-checkbox"});X.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),X.classList.add("tn-static-display-inline-block-60e32dcb"),X.classList.remove("tn-static-margin-right-4px-c6b76b85"),X.classList.add("tn-static-margin-right-8px-539fa9a0");let Me=X.createEl("input",{type:"checkbox"});Me.checked=this.byDay.includes(Z.key),Me.addEventListener("change",()=>{Me.checked?this.byDay.includes(Z.key)||this.byDay.push(Z.key):this.byDay=this.byDay.filter(me=>me!==Z.key)}),X.createSpan({text:` ${Z.label}`})});let a=new za.Setting(t).setName("Monthly recurrence").setDesc("Choose how to repeat monthly"),o=a.controlEl.createDiv("monthly-options"),l=o.createEl("label",{cls:"radio-option"});l.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),l.classList.add("tn-static-display-block-2a1b75c9"),l.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),l.classList.add("tn-static-margin-bottom-8px-fdf33f23");let c=l.createEl("input",{type:"radio",value:"bydate"});c.name="monthly-type",c.checked=this.byMonthDay.length>0||this.byDay.length===0&&this.bySetPos===void 0,l.createSpan({text:" On day "});let d=l.createEl("select");d.classList.add("tn-static-margin-left-4px-46cec891"),d.classList.remove("tn-static-margin-right-8px-539fa9a0"),d.classList.add("tn-static-margin-right-4px-c6b76b85");for(let Z=1;Z<=31;Z++){let X=d.createEl("option",{value:Z.toString(),text:Z.toString()});(this.byMonthDay.length>0&&this.byMonthDay[0]===Z||this.byMonthDay.length===0&&Z===new Date().getDate())&&(X.selected=!0)}l.createSpan({text:" of each month"});let u=o.createEl("label",{cls:"radio-option"});u.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),u.classList.add("tn-static-display-block-2a1b75c9"),u.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),u.classList.add("tn-static-margin-bottom-8px-fdf33f23");let p=u.createEl("input",{type:"radio",value:"byday"});p.name="monthly-type",p.checked=this.byDay.length>0&&this.bySetPos!==void 0,u.createSpan({text:" On the "});let m=u.createEl("select");m.classList.add("tn-static-margin-left-4px-46cec891"),m.classList.remove("tn-static-margin-right-8px-539fa9a0"),m.classList.add("tn-static-margin-right-4px-c6b76b85");let f=[{value:"1",text:"first"},{value:"2",text:"second"},{value:"3",text:"third"},{value:"4",text:"fourth"},{value:"-1",text:"last"}];f.forEach(Z=>{let X=m.createEl("option",{value:Z.value,text:Z.text});(this.bySetPos===parseInt(Z.value)||!this.bySetPos&&Z.value==="1")&&(X.selected=!0)});let h=u.createEl("select");h.classList.add("tn-static-margin-left-4px-46cec891"),h.classList.remove("tn-static-margin-right-8px-539fa9a0"),h.classList.add("tn-static-margin-right-4px-c6b76b85");let g=[{value:"MO",text:"Monday"},{value:"TU",text:"Tuesday"},{value:"WE",text:"Wednesday"},{value:"TH",text:"Thursday"},{value:"FR",text:"Friday"},{value:"SA",text:"Saturday"},{value:"SU",text:"Sunday"}],k=["SU","MO","TU","WE","TH","FR","SA"][new Date().getDay()];g.forEach(Z=>{let X=h.createEl("option",{value:Z.value,text:Z.text});(this.byDay.length>0&&this.byDay[0]===Z.value||this.byDay.length===0&&Z.value===k)&&(X.selected=!0)}),u.createSpan({text:" of each month"});let T=new za.Setting(t).setName("Yearly recurrence").setDesc("Choose how to repeat yearly"),w=T.controlEl.createDiv("yearly-options"),S=w.createEl("label",{cls:"radio-option"});S.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),S.classList.add("tn-static-display-block-2a1b75c9"),S.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),S.classList.add("tn-static-margin-bottom-8px-fdf33f23");let E=S.createEl("input",{type:"radio",value:"bydate"});E.name="yearly-type",E.checked=this.byMonthDay.length>0||this.byDay.length===0&&this.bySetPos===void 0,S.createSpan({text:" On "});let C=S.createEl("select");C.classList.add("tn-static-margin-left-4px-46cec891"),C.classList.remove("tn-static-margin-right-8px-539fa9a0"),C.classList.add("tn-static-margin-right-4px-c6b76b85");let D=["January","February","March","April","May","June","July","August","September","October","November","December"];D.forEach((Z,X)=>{let Me=C.createEl("option",{value:(X+1).toString(),text:Z});(this.byMonth.length>0&&this.byMonth[0]===X+1||this.byMonth.length===0&&X+1===new Date().getMonth()+1)&&(Me.selected=!0)});let A=S.createEl("select");A.classList.add("tn-static-margin-left-4px-46cec891"),A.classList.remove("tn-static-margin-right-8px-539fa9a0"),A.classList.add("tn-static-margin-right-4px-c6b76b85");for(let Z=1;Z<=31;Z++){let X=A.createEl("option",{value:Z.toString(),text:Z.toString()});(this.byMonthDay.length>0&&this.byMonthDay[0]===Z||this.byMonthDay.length===0&&Z===new Date().getDate())&&(X.selected=!0)}S.createSpan({text:" each year"});let N=w.createEl("label",{cls:"radio-option"});N.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),N.classList.add("tn-static-display-block-2a1b75c9"),N.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),N.classList.add("tn-static-margin-bottom-8px-fdf33f23");let V=N.createEl("input",{type:"radio",value:"byday"});V.name="yearly-type",V.checked=this.byDay.length>0&&this.bySetPos!==void 0,N.createSpan({text:" On the "});let R=N.createEl("select");R.classList.add("tn-static-margin-left-4px-46cec891"),R.classList.remove("tn-static-margin-right-8px-539fa9a0"),R.classList.add("tn-static-margin-right-4px-c6b76b85"),f.forEach(Z=>{let X=R.createEl("option",{value:Z.value,text:Z.text});(this.bySetPos===parseInt(Z.value)||!this.bySetPos&&Z.value==="1")&&(X.selected=!0)});let I=N.createEl("select");I.classList.add("tn-static-margin-left-4px-46cec891"),I.classList.remove("tn-static-margin-right-8px-539fa9a0"),I.classList.add("tn-static-margin-right-4px-c6b76b85"),g.forEach(Z=>{let X=I.createEl("option",{value:Z.value,text:Z.text});(this.byDay.length>0&&this.byDay[0]===Z.value||this.byDay.length===0&&Z.value===k)&&(X.selected=!0)});let O=N.createEl("select");O.classList.add("tn-static-margin-left-4px-46cec891"),O.classList.remove("tn-static-margin-right-8px-539fa9a0"),O.classList.add("tn-static-margin-right-4px-c6b76b85"),D.forEach((Z,X)=>{let Me=O.createEl("option",{value:(X+1).toString(),text:Z});(this.byMonth.length>0&&this.byMonth[0]===X+1||this.byMonth.length===0&&X+1===new Date().getMonth()+1)&&(Me.selected=!0)}),N.createSpan({text:" each year"}),new za.Setting(t).setName("End condition").setDesc("Choose when the recurrence should end");let z=t.createDiv("end-condition-container"),B=z.createEl("label",{cls:"radio-option"});B.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),B.classList.add("tn-static-display-block-2a1b75c9"),B.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),B.classList.add("tn-static-margin-bottom-8px-fdf33f23");let W=B.createEl("input",{type:"radio",value:"never"});W.name="end-type",W.checked=this.endType==="never",B.createSpan({text:" Never ends"});let Y=z.createEl("label",{cls:"radio-option"});Y.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),Y.classList.add("tn-static-display-block-2a1b75c9"),Y.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),Y.classList.add("tn-static-margin-bottom-8px-fdf33f23");let ee=Y.createEl("input",{type:"radio",value:"count"});ee.name="end-type",ee.checked=this.endType==="count",Y.createSpan({text:" End after "});let ae=Y.createEl("input",{type:"number",placeholder:"10"});ae.classList.remove("tn-static-width-100-0466783d","tn-static-width-12px-fbf353fb","tn-static-width-16px-7375d50b","tn-static-width-1px-aa77e27e","tn-static-width-200px-2acaf3b5","tn-static-width-80px-8573bae3"),ae.classList.add("tn-static-width-60px-bd09c419"),ae.classList.add("tn-static-margin-left-4px-46cec891"),ae.classList.remove("tn-static-margin-right-8px-539fa9a0"),ae.classList.add("tn-static-margin-right-4px-c6b76b85"),ae.value=this.count?this.count.toString():"",Y.createSpan({text:" occurrences"});let ce=z.createEl("label",{cls:"radio-option"});ce.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),ce.classList.add("tn-static-display-block-2a1b75c9"),ce.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),ce.classList.add("tn-static-margin-bottom-8px-fdf33f23");let J=ce.createEl("input",{type:"radio",value:"until"});J.name="end-type",J.checked=this.endType==="until",ce.createSpan({text:" End on "});let de=ce.createEl("input",{type:"date"});de.classList.add("tn-static-margin-left-4px-46cec891"),de.value=this.until?this.until.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"):"",W.addEventListener("change",()=>{W.checked&&(this.endType="never")}),ee.addEventListener("change",()=>{ee.checked&&(this.endType="count")}),J.addEventListener("change",()=>{J.checked&&(this.endType="until")}),ae.addEventListener("input",()=>{this.count=parseInt(ae.value)||void 0,ae.value&&(ee.checked=!0,this.endType="count")}),de.addEventListener("input",()=>{this.until=de.value?de.value.replace(/-/g,""):"",de.value&&(J.checked=!0,this.endType="until")}),this.updateFrequencySpecificVisibility=()=>{n.settingEl.style.display=this.frequency==="WEEKLY"?"flex":"none",a.settingEl.style.display=this.frequency==="MONTHLY"?"flex":"none",T.settingEl.style.display=this.frequency==="YEARLY"?"flex":"none"},this.updateFrequencySpecificVisibility();let vt=t.createDiv("button-container");vt.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),vt.classList.add("tn-static-display-flex-75816cae"),vt.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),vt.classList.add("tn-static-justify-content-flex-end-455f8cca"),vt.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-10px-f3d7ce77","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db"),vt.classList.add("tn-static-gap-8px-33fcd4c3"),vt.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-20px-a26bda7d","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),vt.classList.add("tn-static-margin-top-16px-1b0f4999"),vt.createEl("button",{text:"Cancel"}).addEventListener("click",()=>{this.close()}),vt.createEl("button",{text:"Save",cls:"mod-cta"}).addEventListener("click",()=>{let Z=c.checked?"bydate":"byday",X=E.checked?"bydate":"byday";this.frequency==="MONTHLY"?Z==="bydate"?(this.byMonthDay=[parseInt(d.value)],this.byDay=[],this.bySetPos=void 0):(this.byMonthDay=[],this.byDay=[h.value],this.bySetPos=parseInt(m.value)):this.frequency==="YEARLY"&&(X==="bydate"?(this.byMonth=[parseInt(C.value)],this.byMonthDay=[parseInt(A.value)],this.byDay=[],this.bySetPos=void 0):(this.byMonth=[parseInt(O.value)],this.byMonthDay=[],this.byDay=[I.value],this.bySetPos=parseInt(R.value)));let Me=this.buildRRule(Z,X);this.onSubmit(Me,this.recurrenceAnchor),this.close()})}updateFrequencySpecificVisibility(){}buildRRule(t,n){let i=[];if(this.dtstart){let s=this.dtstart.replace(/-/g,"");if(this.dtstartTime){let a=this.dtstartTime.replace(":","")+"00";s=`${s}T${a}`}i.push(`DTSTART:${s}`)}switch(i.push(`FREQ=${this.frequency}`),this.interval>1&&i.push(`INTERVAL=${this.interval}`),this.frequency){case"WEEKLY":this.byDay.length>0&&i.push(`BYDAY=${this.byDay.join(",")}`);break;case"MONTHLY":if(t==="bydate"){let s=this.byMonthDay.length>0?this.byMonthDay[0]:new Date().getDate();i.push(`BYMONTHDAY=${s}`)}else if(t==="byday"&&this.byDay.length>0){let s=this.bySetPos||1;i.push(`BYDAY=${s}${this.byDay[0]}`)}break;case"YEARLY":if(n==="bydate"){let s=this.byMonth.length>0?this.byMonth[0]:new Date().getMonth()+1,a=this.byMonthDay.length>0?this.byMonthDay[0]:new Date().getDate();i.push(`BYMONTH=${s}`),i.push(`BYMONTHDAY=${a}`)}else if(n==="byday"){let s=this.byMonth.length>0?this.byMonth[0]:new Date().getMonth()+1;if(i.push(`BYMONTH=${s}`),this.byDay.length>0){let a=this.bySetPos||1;i.push(`BYDAY=${a}${this.byDay[0]}`)}}break}switch(this.endType){case"count":this.count&&this.count>0&&i.push(`COUNT=${this.count}`);break;case"until":if(this.until){let s=this.until.replace(/-/g,"");i.push(`UNTIL=${s}`)}break}return i.join(";")}onClose(){let{contentEl:t}=this;t.empty()}}});var fre={};et(fre,{ReminderModal:()=>zo});var Wr,zo,yg=v(()=>{Wr=require("obsidian");Qe();zo=class extends Wr.Modal{constructor(t,n,i,s){super(t);this.selectedType="relative";this.relativeAnchor="due";this.relativeOffset=15;this.relativeUnit="minutes";this.relativeDirection="before";this.absoluteDate="";this.absoluteTime="";this.description="";this.plugin=n,this.task=i,this.reminders=i.reminders?[...i.reminders]:[],this.originalReminders=i.reminders?[...i.reminders]:[],this.onSave=s}onOpen(){let{contentEl:t}=this;t.empty(),t.addClass("tasknotes-plugin"),t.addClass("tasknotes-reminder-modal"),t.createDiv({cls:"reminder-modal__loading"}).createEl("div",{text:"Loading reminders..."}),this.initializeWithFreshData().catch(i=>{console.error("Failed to initialize reminder modal:",i),t.empty(),t.addClass("tasknotes-plugin"),t.addClass("tasknotes-reminder-modal"),t.createDiv({cls:"reminder-modal__error",text:"Failed to load task data. Please try again."})})}async initializeWithFreshData(){let{contentEl:t}=this;if(this.task.path&&this.task.path.trim()!==""){let a=await this.plugin.cacheManager.getTaskInfo(this.task.path);a?(this.task=a,this.reminders=a.reminders?[...a.reminders]:[],this.originalReminders=a.reminders?[...a.reminders]:[]):(this.reminders=this.task.reminders?[...this.task.reminders]:[],this.originalReminders=this.task.reminders?[...this.task.reminders]:[])}else this.reminders=this.task.reminders?[...this.task.reminders]:[],this.originalReminders=this.task.reminders?[...this.task.reminders]:[];t.empty(),t.addClass("tasknotes-plugin"),t.addClass("tasknotes-reminder-modal");let n=t.createDiv({cls:"reminder-modal__header"});n.createEl("h2",{text:"Task reminders"}),n.createDiv({cls:"reminder-modal__task-title",text:this.task.title});let i=this.getTaskContextInfo();if(i){let a=n.createDiv({cls:"reminder-modal__task-dates"});a.textContent=i}let s=t.createDiv({cls:"reminder-modal__content"});this.renderExistingReminders(s),this.renderAddReminderForm(s),this.renderActionButtons(t),this.setupKeyboardHandlers(),this.updateSaveButtonState()}renderActionButtons(t){let n=t.createDiv({cls:"reminder-modal__actions"});this.saveBtn=n.createEl("button",{text:"Save changes",cls:"mod-cta reminder-modal__save-btn"}),this.saveBtn.disabled=!0,this.saveBtn.onclick=async()=>{await this.save()};let i=n.createEl("button",{text:"Cancel",cls:"reminder-modal__cancel-btn"});i.onclick=()=>{this.cancel()}}getTaskContextInfo(){let t=[];return this.task.due&&t.push(`Due: ${Gc(this.task.due)}`),this.task.scheduled&&t.push(`Scheduled: ${Gc(this.task.scheduled)}`),t.length>0?t.join(" \u2022 "):null}setupKeyboardHandlers(){let t=n=>{n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&!this.saveBtn.disabled?(n.preventDefault(),this.save()):n.key==="Escape"&&(n.preventDefault(),this.cancel())};this.contentEl.addEventListener("keydown",t),this.onClose=()=>{this.contentEl.removeEventListener("keydown",t);let{contentEl:n}=this;n.empty()}}updateSaveButtonState(){if(!this.saveBtn)return;let t=this.remindersHaveChanged();this.saveBtn.disabled=!t,this.saveBtn.textContent=t?"Save Changes":"No Changes"}renderExistingReminders(t){let n=t.createDiv({cls:"reminder-modal__section"}),i=n.createDiv({cls:"reminder-modal__section-header"});if(i.createEl("h3",{text:"Current reminders"}),this.reminders.length>0&&i.createSpan({cls:"reminder-modal__reminder-count",text:`(${this.reminders.length})`}),this.reminders.length===0){let a=n.createDiv({cls:"reminder-modal__empty-state"});(0,Wr.setIcon)(a.createDiv({cls:"reminder-modal__empty-icon"}),"bell-off"),a.createEl("div",{cls:"reminder-modal__empty-text",text:"No reminders set"});return}let s=n.createDiv({cls:"reminder-modal__reminder-list"});this.reminders.forEach((a,o)=>{let l=s.createDiv({cls:"reminder-modal__reminder-card"}),c=l.createDiv({cls:"reminder-modal__reminder-icon"}),d=a.type==="absolute"?"calendar-clock":"timer";(0,Wr.setIcon)(c,d);let u=l.createDiv({cls:"reminder-modal__reminder-content"}),p=u.createDiv({cls:"reminder-modal__reminder-primary"});if(p.textContent=this.formatReminderDisplayText(a),a.description){let h=u.createDiv({cls:"reminder-modal__reminder-description"});h.textContent=`"${a.description}"`}let f=l.createDiv({cls:"reminder-modal__reminder-actions"}).createEl("button",{cls:"reminder-modal__action-btn reminder-modal__remove-btn"});(0,Wr.setIcon)(f,"trash-2"),(0,Wr.setTooltip)(f,"Delete this reminder"),f.onclick=async h=>{h.stopPropagation(),await this.removeReminder(o)}})}formatReminderDisplayText(t){if(t.type==="absolute"){if(t.absoluteTime)try{let n=new Date(t.absoluteTime);return`${n.toLocaleDateString()} at ${n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`}catch(n){return`At ${t.absoluteTime}`}return"Absolute reminder"}else{let n=t.relatedTo==="due"?"due date":"scheduled date";return`${this.formatOffset(t.offset||"")} ${n}`}}renderQuickActions(t){if(!(this.task.due||this.task.scheduled))return;let s=t.createDiv({cls:"reminder-modal__quick-actions"}).createDiv({cls:"reminder-modal__quick-buttons"});[{label:"5m",fullLabel:"5 minutes before",offset:"-PT5M",icon:"clock"},{label:"15m",fullLabel:"15 minutes before",offset:"-PT15M",icon:"clock"},{label:"1h",fullLabel:"1 hour before",offset:"-PT1H",icon:"clock"},{label:"1d",fullLabel:"1 day before",offset:"-P1D",icon:"calendar"}].forEach(({label:o,fullLabel:l,offset:c,icon:d})=>{let u=this.task.due?"due":"scheduled",p=s.createEl("button",{cls:"reminder-modal__quick-btn"}),m=p.createSpan({cls:"reminder-modal__quick-btn-icon"});(0,Wr.setIcon)(m,d),p.createSpan({cls:"reminder-modal__quick-btn-label",text:o}),(0,Wr.setTooltip)(p,`Add reminder ${l} ${u} date`),p.onclick=async()=>{await this.addQuickReminder(u,c,l)}})}async addQuickReminder(t,n,i){let s={id:`rem_${Date.now()}`,type:"relative",relatedTo:t,offset:n,description:i};await this.addReminder(s),new Wr.Notice(`Added reminder: ${i}`)}renderAddReminderForm(t){let n=t.createDiv({cls:"reminder-modal__section"});n.createDiv({cls:"reminder-modal__section-header"}).createEl("h3",{text:"Add new reminder"}),this.renderQuickActions(n);let s=n.createDiv({cls:"reminder-modal__form"}),a=s.createDiv({cls:"reminder-modal__type-selector"}),o=a.createEl("button",{cls:"reminder-modal__type-tab reminder-modal__type-tab--active",text:"Relative",attr:{"data-type":"relative"}}),l=a.createEl("button",{cls:"reminder-modal__type-tab",text:"Absolute",attr:{"data-type":"absolute"}});o.classList.toggle("reminder-modal__type-tab--active",this.selectedType==="relative"),l.classList.toggle("reminder-modal__type-tab--active",this.selectedType==="absolute");let c=f=>{this.selectedType=f,o.classList.toggle("reminder-modal__type-tab--active",f==="relative"),l.classList.toggle("reminder-modal__type-tab--active",f==="absolute"),this.updateFormVisibility(s,this.selectedType)};o.onclick=()=>c("relative"),l.onclick=()=>c("absolute");let d=s.createDiv({cls:"relative-fields"});new Wr.Setting(d).setName("Time").addText(f=>{f.setPlaceholder("15").setValue(String(this.relativeOffset)).onChange(h=>{this.relativeOffset=parseInt(h)||0})}).addDropdown(f=>{f.addOption("minutes","Minutes").addOption("hours","Hours").addOption("days","Days").setValue(this.relativeUnit).onChange(h=>{this.relativeUnit=h})}),new Wr.Setting(d).setName("Direction").addDropdown(f=>{f.addOption("before","Before").addOption("after","After").setValue(this.relativeDirection).onChange(h=>{this.relativeDirection=h})}),new Wr.Setting(d).setName("Relative to").addDropdown(f=>{let h={};this.task.due&&(h.due=`Due date (${Gc(this.task.due)})`),this.task.scheduled&&(h.scheduled=`Scheduled date (${Gc(this.task.scheduled)})`),Object.keys(h).length===0?(h.none="No dates available",f.setDisabled(!0)):(Object.entries(h).forEach(([g,y])=>{f.addOption(g,y)}),f.setValue(this.relativeAnchor)),f.onChange(g=>{this.relativeAnchor=g})});let u=s.createDiv({cls:"absolute-fields"});new Wr.Setting(u).setName("Date").addText(f=>{f.setPlaceholder("Yyyy-mm-dd").setValue(this.absoluteDate).onChange(h=>{this.absoluteDate=h}),f.inputEl.type="date"}),new Wr.Setting(u).setName("Time").addText(f=>{f.setPlaceholder("Hh:mm").setValue(this.absoluteTime).onChange(h=>{this.absoluteTime=h}),f.inputEl.type="time"}),new Wr.Setting(s).setName("Description (optional)").addText(f=>{f.setPlaceholder("Custom reminder message").setValue(this.description).onChange(h=>{this.description=h})});let p=s.createEl("button",{cls:"reminder-add-btn"}),m=p.createSpan({cls:"reminder-add-btn-icon"});(0,Wr.setIcon)(m,"plus"),p.createSpan({cls:"reminder-add-btn-text",text:"Add Reminder"}),p.onclick=async()=>{p.disabled=!0,p.classList.add("reminder-add-btn--loading");try{let f=this.createReminder(this.selectedType,this.relativeAnchor,this.relativeOffset,this.relativeUnit,this.relativeDirection,this.absoluteDate,this.absoluteTime,this.description);f&&(await this.addReminder(f),this.selectedType==="relative"?(this.relativeOffset=15,this.relativeUnit="minutes",this.description=""):(this.absoluteDate="",this.absoluteTime="",this.description=""),this.resetFormInputs(s))}catch(f){console.error("Error adding reminder:",f),new Wr.Notice("Failed to add reminder. Please check your inputs.")}finally{p.disabled=!1,p.classList.remove("reminder-add-btn--loading")}},this.updateFormVisibility(s,this.selectedType)}updateFormVisibility(t,n){let i=t.querySelector(".relative-fields"),s=t.querySelector(".absolute-fields");n==="relative"?(i.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),i.classList.add("tn-static-display-block-2a1b75c9"),s.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),s.classList.add("tn-static-display-none-6b99de8b")):(i.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),i.classList.add("tn-static-display-none-6b99de8b"),s.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),s.classList.add("tn-static-display-block-2a1b75c9"))}createReminder(t,n,i,s,a,o,l,c){let d=`rem_${Date.now()}`;if(t==="relative"){if(!(n==="due"?this.task.due:this.task.scheduled))return new Wr.Notice(`Cannot create reminder: Task has no ${n} date`),null;let p="PT";return s==="days"?p=`P${i}D`:s==="hours"?p=`PT${i}H`:p=`PT${i}M`,a==="before"&&(p="-"+p),{id:d,type:"relative",relatedTo:n,offset:p,description:c||void 0}}else{if(!o||!l)return new Wr.Notice("Please specify both date and time for absolute reminder"),null;let u=`${o}T${l}:00`;return{id:d,type:"absolute",absoluteTime:u,description:c||void 0}}}formatReminderTiming(t){if(t.type==="absolute")return"Absolute reminder";{let n=t.relatedTo==="due"?"due date":"scheduled date";return`${this.formatOffset(t.offset||"")} ${n}`}}formatReminderDetails(t){if(t.type==="absolute")return`At ${Gc(t.absoluteTime||"")}`;{let n=t.relatedTo==="due"?this.task.due:this.task.scheduled;return n?`When ${t.relatedTo} date is ${Gc(n)}`:`Relative to ${t.relatedTo} date (not set)`}}formatReminderDescription(t){if(t.description)return t.description;if(t.type==="absolute")return`At ${Gc(t.absoluteTime||"")}`;{let n=t.relatedTo==="due"?"due date":"scheduled date";return`${this.formatOffset(t.offset||"")} ${n}`}}formatOffset(t){let n=t.startsWith("-"),s=(n?t.substring(1):t).match(/P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?)?/);if(!s)return t;let[,a,o,l]=s,c=[];if(a&&c.push(`${a} day${a!=="1"?"s":""}`),o&&c.push(`${o} hour${o!=="1"?"s":""}`),l&&c.push(`${l} minute${l!=="1"?"s":""}`),c.length===0)return"At time of";let d=c.join(" ");return n?`${d} before`:`${d} after`}async addReminder(t){this.reminders.push(t),this.refreshRemindersListOnly(),this.task.path&&this.plugin.emitter.trigger("reminder-preview-changed",{taskPath:this.task.path,currentReminders:[...this.reminders],action:"added",reminder:t})}async removeReminder(t){let n=this.reminders[t];this.reminders.splice(t,1),this.refreshRemindersListOnly(),this.task.path&&n&&this.plugin.emitter.trigger("reminder-preview-changed",{taskPath:this.task.path,currentReminders:[...this.reminders],action:"removed",reminder:n})}async refresh(){await this.initializeWithFreshData()}refreshRemindersListOnly(){let t=this.contentEl.querySelector(".reminder-modal__content");if(t){let n=t.querySelector(".reminder-modal__section");n&&n.remove();let i=activeDocument.createElement("div");this.renderExistingReminders(i);let s=i.firstChild;s&&t.insertBefore(s,t.firstChild)}this.updateSaveButtonState()}resetFormInputs(t){let n=t.querySelector('input[placeholder="15"]');n&&(n.value=String(this.relativeOffset));let i=t.querySelector('input[placeholder="Custom reminder message"]');i&&(i.value=this.description);let s=t.querySelector('input[type="date"]');s&&(s.value=this.absoluteDate);let a=t.querySelector('input[type="time"]');a&&(a.value=this.absoluteTime);let o=t.querySelector('.setting-item:has(input[placeholder="15"]) select');o&&(o.value=this.relativeUnit);let l=t.querySelector(".setting-item:nth-child(2) select");l&&(l.value=this.relativeDirection);let c=t.querySelector(".setting-item:nth-child(3) select");c&&(c.value=this.relativeAnchor)}async save(){var t;this.saveBtn.disabled=!0,this.saveBtn.textContent="Saving...";try{this.task.path&&this.task.path.trim()!==""&&((t=this.plugin.notificationService)==null||t.clearProcessedRemindersForTask(this.task.path));let n=this.remindersHaveChanged();this.onSave(this.reminders),n&&this.task.path&&this.plugin.emitter.trigger("reminder-changed",{taskPath:this.task.path,oldReminders:this.originalReminders,newReminders:[...this.reminders]}),this.close()}catch(n){console.error("Failed to save reminders:",n),new Wr.Notice("Failed to save reminders. Please try again."),this.saveBtn.disabled=!1,this.saveBtn.textContent="Save changes"}}cancel(){this.remindersHaveChanged()&&this.task.path&&this.plugin.emitter.trigger("reminder-preview-changed",{taskPath:this.task.path,currentReminders:[...this.originalReminders],action:"cancelled"}),this.close()}remindersHaveChanged(){return this.reminders.length!==this.originalReminders.length?!0:!this.reminders.every((t,n)=>{let i=this.originalReminders[n];return i?t.id===i.id&&t.type===i.type&&t.relatedTo===i.relatedTo&&t.offset===i.offset&&t.absoluteTime===i.absoluteTime&&t.description===i.description:!1})}onClose(){let{contentEl:t}=this;t.empty()}}});var vg,IL=v(()=>{yg();Wc();vg=class{constructor(e,t,n,i){this.plugin=e,this.task=t,this.triggerElement=n,this.onUpdate=i}show(e){let t=new Qn;this.addQuickRemindersSection(t,"due",this.plugin.i18n.translate("components.reminderContextMenu.remindBeforeDue")),this.addQuickRemindersSection(t,"scheduled",this.plugin.i18n.translate("components.reminderContextMenu.remindBeforeScheduled")),t.addSeparator(),t.addItem(n=>{n.setTitle(this.plugin.i18n.translate("components.reminderContextMenu.manageAllReminders")).setIcon("settings").onClick(()=>{this.openReminderModal()})}),this.task.reminders&&this.task.reminders.length>0&&t.addItem(n=>{n.setTitle(this.plugin.i18n.translate("components.reminderContextMenu.clearAllReminders")).setIcon("trash").onClick(async()=>{await this.clearAllReminders()})}),t.show(e)}addQuickRemindersSection(e,t,n){if(!(t==="due"?this.task.due:this.task.scheduled)){e.addItem(s=>{s.setTitle(n).setIcon("bell").setDisabled(!0)});return}e.addItem(s=>{s.setTitle(n),s.setIcon("bell"),this.addQuickReminderSubmenu(s.setSubmenu(),t)})}addQuickReminderSubmenu(e,t){[{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.atTime"),offset:"PT0M"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.fiveMinutesBefore"),offset:"-PT5M"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.fifteenMinutesBefore"),offset:"-PT15M"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.oneHourBefore"),offset:"-PT1H"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.oneDayBefore"),offset:"-P1D"}].forEach(i=>{e.addItem(s=>{s.setTitle(i.label).onClick(async()=>{await this.addQuickReminder(t,i.offset,i.label)})})})}async addQuickReminder(e,t,n){let i={id:`rem_${Date.now()}`,type:"relative",relatedTo:e,offset:t,description:n},s=[...this.task.reminders||[],i];await this.saveReminders(s)}async clearAllReminders(){await this.saveReminders([])}async saveReminders(e){let t;if(this.task.path&&this.task.path.trim()!==""){let n=await this.plugin.cacheManager.getTaskInfo(this.task.path);n?(t={...n,reminders:e},await this.plugin.taskService.updateProperty(t,"reminders",e)):t={...this.task,reminders:e}}else t={...this.task,reminders:e};this.onUpdate(t)}openReminderModal(){new zo(this.plugin.app,this.plugin,this.task,t=>{this.saveReminders(t)}).open()}}});function ie(r){var t;if(r==null)return"";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="bigint")return r.toString();if(typeof r=="boolean")return r?"true":"false";if(typeof r=="symbol")return(t=r.description)!=null?t:"";if(r instanceof Date)return r.toISOString();if(Array.isArray(r))return r.map(n=>ie(n)).filter(n=>n.length>0).join(", ");let e=r.toString;if(typeof e=="function"){let n=e.call(r);if(typeof n=="string"&&n!=="[object Object]")return n}try{let n=JSON.stringify(r);return typeof n=="string"?n:""}catch(n){return""}}function _D(r){return Array.isArray(r)?r.map(e=>ie(e)):[ie(r)]}var jr=v(()=>{});function sa(r){if(r==null)return[];let e=[],t="",n=0,i=null;for(let a=0;a0){n--,t+="]]",a++;continue}if(!n&&(o==='"'||o==="'")){i===null?i=o:i===o&&(i=null),t+=o;continue}if(o===","&&n===0&&i===null){let c=t.trim();c&&e.push(c),t="";continue}t+=o}let s=t.trim();return s&&e.push(s),e}var gu=v(()=>{});function dn(r){if(!r)return r;let e=r.trim();if(e.startsWith("<")&&e.endsWith(">")){let n=e.slice(1,-1).trim(),i=/\.md$/i.test(n);try{n=decodeURIComponent(n)}catch(a){console.debug("Failed to decode URI component:",n,a)}let s=(0,aT.parseLinktext)(n);return i?n:s.path||n}if(e.startsWith("[[")&&e.endsWith("]]")){let n=e.slice(2,-2).trim(),i=n.indexOf("|"),s=i!==-1?n.substring(0,i):n;return(0,aT.parseLinktext)(s).path}let t=e.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(t){let n=t[2].trim();n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1).trim());let i=/\.md$/i.test(n);try{n=decodeURIComponent(n)}catch(a){console.debug("Failed to decode URI component:",n,a)}let s=(0,aT.parseLinktext)(n);return i?n:s.path}return e}function bg(r,e){if(!r)return"";let t=r.trim(),n=t.match(/^\[([^\]]+)\]\(([^)]+)\)$/);if(n){let i=n[1].trim(),s=n[2].trim();if(i)return i;let a=dn(s),o=e==null?void 0:e.metadataCache.getFirstLinkpathDest(a,"");if(o)return o.basename;let l=a.replace(/\.md$/i,""),c=l.split("/");return c[c.length-1]||l}if(t.startsWith("[[")&&t.endsWith("]]")){let i=t.slice(2,-2).trim(),s=i.indexOf("|");if(s!==-1){let u=i.slice(s+1).trim();if(u)return u}let o=(0,aT.parseLinktext)(i.split("|")[0]||i).path||dn(t),l=e==null?void 0:e.metadataCache.getFirstLinkpathDest(o,"");if(l)return l.basename;let c=o.replace(/\.md$/i,""),d=c.split("/");return d[d.length-1]||c}return t}function xl(r,e,t,n,i,s){if(s)return r.fileManager.generateMarkdownLink(e,t,n||"",i||"");let o=`[[${r.metadataCache.fileToLinktext(e,t,!0)}`;return n&&(o+=n),i&&(o+=`|${i}`),o+="]]",o}function NL(r,e,t,n,i){return xl(r,e,t,"",n,i)}var aT,Bo=v(()=>{aT=require("obsidian")});function t$e(r){return e$e.includes(r)}function RL(r){return typeof r=="string"?r:r.uid}function El(r){if(typeof r=="string"){let e=r.trim();return e?{uid:dn(e),reltype:Ds}:null}if(typeof r=="object"&&r!==null){let e=r,t=typeof e.uid=="string"?e.uid.trim():"";if(!t)return null;let n=dn(t),i=typeof e.reltype=="string"?e.reltype.trim().toUpperCase():"",s=t$e(i)?i:Ds,a=typeof e.gap=="string"&&e.gap.trim().length>0?e.gap.trim():void 0;return a?{uid:n,reltype:s,gap:a}:{uid:n,reltype:s}}return null}function yu(r){if(r==null)return;let e=Array.isArray(r)?r:[r],t=[];for(let n of e){let i=El(n);i&&t.push(i)}return t.length>0?t:void 0}function hre(r){return r.map(e=>{let n={uid:e.uid.startsWith("[[")?e.uid:`[[${e.uid}]]`,reltype:e.reltype};return e.gap&&e.gap.trim().length>0&&(n.gap=e.gap),n})}function Em(r,e,t){let n=RL(t);if(!n)return null;let i=dn(n);if(!i)return null;let s=new Set;s.add(i),i.endsWith(".md")&&s.add(i.replace(/\.md$/i,""));let a=(0,Tg.parseLinktext)(i);a.path&&a.path!==i&&s.add(a.path);for(let o of s){let l=r.metadataCache.getFirstLinkpathDest(o,e);if(l instanceof Tg.TFile)return{path:l.path,file:l};let c=r.vault.getAbstractFileByPath(o);if(c instanceof Tg.TFile)return{path:c.path,file:c}}return null}function Ba(r,e,t,n){let i=r.vault.getAbstractFileByPath(t);return i instanceof Tg.TFile?xl(r,i,e,"","",n):`[[${(t.split("/").pop()||t).replace(/\.md$/i,"")}]]`}var Tg,Ds,e$e,Zc=v(()=>{Tg=require("obsidian");gu();Bo();Ds="FINISHTOSTART",e$e=["FINISHTOSTART","FINISHTOFINISH","STARTTOSTART","STARTTOFINISH"]});function gre(r,e){return r[e]}function r$e(r){if(typeof r=="string")return r;if(Array.isArray(r))return r.map(e=>String(e)).join(", ");if(r!=null){if(typeof r=="object")return"";if(typeof r=="number"||typeof r=="boolean")return String(r)}}function vu(r){if(r!=null){if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r)}}function OL(r){return Array.isArray(r)?r.map(String):[String(r)]}function n$e(r){if(typeof r=="number")return r;if(typeof r=="string"&&r.trim()!==""){let e=Number(r);return Number.isNaN(e)?void 0:e}}function i$e(r){return Array.isArray(r)?r:[]}function s$e(r){if(Array.isArray(r)){let e=r.filter(t=>t!=null);return e.length>0?e:void 0}return r!=null?[r]:void 0}function yre(r,e,t,n,i=[]){var a;if(!e)return{};let s={path:t};if(e[r.title]!==void 0){let o=r$e(e[r.title]);o!==void 0&&(s.title=o)}else if(n){let o=(a=t.split("/").pop())==null?void 0:a.replace(".md","");o&&(s.title=o)}if(e[r.status]!==void 0){let o=e[r.status];s.status=typeof o=="boolean"?o?"true":"false":String(o)}if(e[r.priority]!==void 0&&(s.priority=vu(e[r.priority])),e[r.due]!==void 0&&(s.due=vu(e[r.due])),e[r.scheduled]!==void 0&&(s.scheduled=vu(e[r.scheduled])),e[r.contexts]!==void 0&&(s.contexts=OL(e[r.contexts])),e[r.projects]!==void 0&&(s.projects=OL(e[r.projects])),e[r.timeEstimate]!==void 0&&(s.timeEstimate=n$e(e[r.timeEstimate])),e[r.completedDate]!==void 0&&(s.completedDate=vu(e[r.completedDate])),e[r.recurrence]!==void 0&&(s.recurrence=vu(e[r.recurrence])),e[r.recurrenceAnchor]!==void 0){let o=e[r.recurrenceAnchor];o==="scheduled"||o==="completion"?s.recurrence_anchor=o:(console.warn(`Invalid recurrence_anchor value: ${ie(o)}, defaulting to 'scheduled'`),s.recurrence_anchor="scheduled")}if(e[r.dateCreated]!==void 0&&(s.dateCreated=vu(e[r.dateCreated])),e[r.dateModified]!==void 0&&(s.dateModified=vu(e[r.dateModified])),e[r.timeEntries]!==void 0&&(s.timeEntries=i$e(e[r.timeEntries])),e[r.completeInstances]!==void 0){let o=e[r.completeInstances];s.complete_instances=SD(Array.isArray(o)?o:[o])}if(e[r.skippedInstances]!==void 0){let o=e[r.skippedInstances];s.skipped_instances=SD(Array.isArray(o)?o:[o])}if(r.blockedBy&&e[r.blockedBy]!==void 0){let o=yu(e[r.blockedBy]);o&&(s.blockedBy=o)}if(e[r.icsEventId]!==void 0&&(s.icsEventId=OL(e[r.icsEventId])),e[r.googleCalendarEventId]!==void 0&&(s.googleCalendarEventId=vu(e[r.googleCalendarEventId])),e[r.reminders]!==void 0&&(s.reminders=s$e(e[r.reminders])),e[r.sortOrder]!==void 0){let o=e[r.sortOrder];s.sortOrder=typeof o=="string"?o:String(o)}if(e.tags&&Array.isArray(e.tags)&&(s.tags=e.tags.map(String),s.archived=e.tags.includes(r.archiveTag)),i.length>0){let o=s;for(let l of i)e[l.key]!==void 0&&(o[l.key]=e[l.key])}return s}function vre(r,e,t,n,i=[]){let s={};if(e.title!==void 0&&(s[r.title]=e.title),e.status!==void 0){let o=e.status.toLowerCase(),l=o==="true"||o==="false"?o==="true":e.status;s[r.status]=l}if(e.priority!==void 0&&(s[r.priority]=e.priority),e.due!==void 0&&(s[r.due]=e.due),e.scheduled!==void 0&&(s[r.scheduled]=e.scheduled),e.contexts!==void 0&&(!Array.isArray(e.contexts)||e.contexts.length>0)&&(s[r.contexts]=e.contexts),e.projects!==void 0&&(!Array.isArray(e.projects)||e.projects.length>0)&&(s[r.projects]=e.projects),e.timeEstimate!==void 0&&(s[r.timeEstimate]=e.timeEstimate),e.completedDate!==void 0&&(s[r.completedDate]=e.completedDate),e.recurrence!==void 0&&(s[r.recurrence]=e.recurrence),e.recurrence_anchor!==void 0&&(s[r.recurrenceAnchor]=e.recurrence_anchor),e.dateCreated!==void 0&&(s[r.dateCreated]=e.dateCreated),e.dateModified!==void 0&&(s[r.dateModified]=e.dateModified),e.sortOrder!==void 0&&(s[r.sortOrder]=e.sortOrder),e.timeEntries!==void 0&&(s[r.timeEntries]=e.timeEntries),e.complete_instances!==void 0&&(s[r.completeInstances]=e.complete_instances),e.skipped_instances!==void 0&&e.skipped_instances.length>0&&(s[r.skippedInstances]=e.skipped_instances),e.blockedBy!==void 0)if(Array.isArray(e.blockedBy)){let o=e.blockedBy.map(l=>El(l)).filter(l=>!!l);o.length>0&&(s[r.blockedBy]=hre(o))}else s[r.blockedBy]=e.blockedBy;e.icsEventId!==void 0&&e.icsEventId.length>0&&(s[r.icsEventId]=e.icsEventId),e.reminders!==void 0&&e.reminders.length>0&&(s[r.reminders]=e.reminders);let a=e.tags?[...e.tags]:[];if(t&&!a.includes(t)&&a.push(t),e.archived===!0&&!a.includes(r.archiveTag)?a.push(r.archiveTag):e.archived===!1&&(a=a.filter(o=>o!==r.archiveTag)),a.length>0&&(s.tags=a),i.length>0){let o=e;for(let l of i)Object.prototype.hasOwnProperty.call(o,l.key)&&o[l.key]!==void 0&&(s[l.key]=o[l.key])}return s}function LL(r,e){for(let[t,n]of Object.entries(r))if(n===e)return t;return null}function bre(r,e){return LL(r,e)!==null}function Tre(r,e,t){return r[t]===e}function kre(r,e){return e.map(t=>r[t])}function wre(r){let e=[],t=Object.keys(r);for(let s of t)(!r[s]||r[s].trim()==="")&&e.push(`Field "${s}" cannot be empty`);let n=Object.values(r),i=new Set(n);return n.length!==i.size&&e.push("Field mappings must have unique property names"),{valid:e.length===0,errors:e}}var Sre=v(()=>{Zc();Qe();jr()});var kg,FL=v(()=>{Sre();kg=class{constructor(e,t=[]){this.mapping=e;this.userFields=t}updateUserFields(e){this.userFields=e}getUserFields(){return[...this.userFields]}toUserField(e){return gre(this.mapping,e)}mapFromFrontmatter(e,t,n){let i=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0;return yre(this.mapping,i,t,n,this.userFields)}mapToFrontmatter(e,t,n){return vre(this.mapping,e,t,n,this.userFields)}updateMapping(e){this.mapping=e}getMapping(){return{...this.mapping}}lookupMappingKey(e){return LL(this.mapping,e)}isRecognizedProperty(e){return bre(this.mapping,e)}isPropertyForField(e,t){return Tre(this.mapping,e,t)}toUserFields(e){return kre(this.mapping,e)}fromUserField(e){return this.lookupMappingKey(e)}static validateMapping(e){return wre(e)}}});var oT,Dn,Dm=v(()=>{oT=["MO","TU","WE","TH","FR","SA","SU"],Dn=(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(oT.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=oT[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})()});function Cm(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=It(t,e/t.length)),t.slice(0,e)+String(n))}var Ar,aa,$L,li,qa,It,xre,Ere,Ci,MD,oa,kn,Ft,ns=v(()=>{Dm();Ar=function(r){return r!=null},aa=function(r){return typeof r=="number"},$L=function(r){return typeof r=="string"&&oT.includes(r)},li=Array.isArray,qa=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n{ns();Dl=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))},a$e=[31,28,31,30,31,30,31,31,30,31,30,31],Cre=1e3*60*60*24,AD=9999,Pre=Dl(1970,1,1),o$e=[6,0,1,2,3,4,5],wg=function(r){return r%4===0&&r%100!==0||r%400===0},jL=function(r){return r instanceof Date},Pm=function(r){return jL(r)&&!isNaN(r.getTime())},l$e=function(r,e){var t=r.getTime(),n=e.getTime(),i=t-n;return Math.round(i/Cre)},lT=function(r){return l$e(r,Pre)},ID=function(r){return new Date(Pre.getTime()+r*Cre)},c$e=function(r){var e=r.getUTCMonth();return e===1&&wg(r.getUTCFullYear())?29:a$e[e]},Qc=function(r){return o$e[r.getUTCDay()]},zL=function(r,e){var t=Dl(r,e+1,1);return[Qc(t),c$e(t)]},ND=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()))},RD=function(r){var e=new Date(r.getTime());return e},BL=function(r){for(var e=[],t=0;t{d$e=(function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&ethis.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})(),Xc=d$e});function xg(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");qL(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function le(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{qL=function(r,e){return qL=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])},qL(r,e)};ci=function(){return ci=Object.assign||function(e){for(var t,n=1,i=arguments.length;n{ed();OD();u$e=(function(r){xg(e,r);function e(t,n,i){var s=r.call(this,t,n)||this;return s.iterator=i,s}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e})(Xc),HL=u$e});var p$e,_m,LD=v(()=>{p$e={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},_m=p$e});var Are,m$e,f$e,h$e,Cl,Ire=v(()=>{LD();Ha();ns();Are=function(r,e){return r.indexOf(e)!==-1},m$e=function(r){return r.toString()},f$e=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},h$e=(function(){function r(e,t,n,i){if(t===void 0&&(t=m$e),n===void 0&&(n=_m),i===void 0&&(i=f$e),this.text=[],this.language=n||_m,this.gettext=t,this.dateFormatter=i,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var s=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);s.sort(function(d,u){return d-u}),a.sort(function(d,u){return u-d}),this.bymonthday=s.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Ar(this.origOptions.byweekday)){var o=li(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],l=String(o);this.byweekday={allWeeks:o.filter(function(d){return!d.n}),someWeeks:o.filter(function(d){return!!d.n}),isWeekdays:l.indexOf("MO")!==-1&&l.indexOf("TU")!==-1&&l.indexOf("WE")!==-1&&l.indexOf("TH")!==-1&&l.indexOf("FR")!==-1&&l.indexOf("SA")===-1&&l.indexOf("SU")===-1,isEveryDay:l.indexOf("MO")!==-1&&l.indexOf("TU")!==-1&&l.indexOf("WE")!==-1&&l.indexOf("TH")!==-1&&l.indexOf("FR")!==-1&&l.indexOf("SA")!==-1&&l.indexOf("SU")!==-1};var c=function(d,u){return d.weekday-u.weekday};this.byweekday.allWeeks.sort(c),this.byweekday.someWeeks.sort(c),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(Are(["dtstart","tzid","wkst","freq"],n))return!0;if(!Are(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Ee.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var i=Math.abs(e);switch(i){case 1:case 21:case 31:t=i+n("st");break;case 2:case 22:t=i+n("nd");break;case 3:case 23:t=i+n("rd");break;default:t=i+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=aa(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,i){var s=this;i===void 0&&(i=","),li(e)||(e=[e]);var a=function(l,c,d){for(var u="",p=0;p366)throw new Error("Nth out of range: "+p);return n.nextSymbol(),n.accept("last")?-p:p;default:return!1}}function d(){n.accept("on"),n.accept("the");var p=c();if(p)for(t.bymonthday=[p],n.nextSymbol();n.accept("comma");){if(p=c(),!p)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(p),n.nextSymbol()}}function u(){if(n.symbol==="until"){var p=Date.parse(n.text);if(!p)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(p)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var g$e,Nre=v(()=>{LD();Ha();g$e=(function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var i in this.rules){n=this.rules[i];var s=n.exec(this.text);s&&(e===null||s[0].length>e[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 uT(r){return r{(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"})(Tt||(Tt={}))});var Rre,Eg,Ore,Lre,Fre=v(()=>{Ire();Nre();Ha();td();LD();Rre=function(r,e){return e===void 0&&(e=_m),new Ee(dT(r,e)||void 0)},Eg=["count","until","interval","byweekday","bymonthday","bymonth"];Cl.IMPLEMENTED=[];Cl.IMPLEMENTED[Tt.HOURLY]=Eg;Cl.IMPLEMENTED[Tt.MINUTELY]=Eg;Cl.IMPLEMENTED[Tt.DAILY]=["byhour"].concat(Eg);Cl.IMPLEMENTED[Tt.WEEKLY]=Eg;Cl.IMPLEMENTED[Tt.MONTHLY]=Eg;Cl.IMPLEMENTED[Tt.YEARLY]=["byweekno","byyearday"].concat(Eg);Ore=function(r,e,t,n){return new Cl(r,e,t,n).toString()},Lre=Cl.isFullyConvertible});var Dg,$re,FD=v(()=>{ed();td();ns();Pi();Dg=(function(){function r(e,t,n,i){this.hour=e,this.minute=t,this.second=n,this.millisecond=i||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r})(),$re=(function(r){xg(e,r);function e(t,n,i,s,a,o,l){var c=r.call(this,s,a,o,l)||this;return c.year=t,c.month=n,c.day=i,c}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return Qc(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),i=Ci(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=MD(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),oa(i)||Ft(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=MD(this.minute,60),o=a.div,l=a.mod;if(o&&(this.minute=l,this.addHours(o,!1,i)),(oa(i)||Ft(i,this.hour))&&(oa(s)||Ft(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=MD(this.second,60),l=o.div,c=o.mod;if(l&&(this.second=c,this.addMinutes(l,!1,i,s)),(oa(i)||Ft(i,this.hour))&&(oa(s)||Ft(s,this.minute))&&(oa(a)||Ft(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=zL(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>AD))return;t=zL(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,l=t.byminute,c=t.bysecond;switch(i){case Tt.YEARLY:return this.addYears(s);case Tt.MONTHLY:return this.addMonths(s);case Tt.WEEKLY:return this.addWeekly(s,a);case Tt.DAILY:return this.addDaily(s);case Tt.HOURLY:return this.addHours(s,n,o);case Tt.MINUTELY:return this.addMinutes(s,n,o,l);case Tt.SECONDLY:return this.addSeconds(s,n,o,l,c)}},e})(Dg)});function UL(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(!(e.byweekno||kn(e.byweekno)||kn(e.byyearday)||e.bymonthday||kn(e.bymonthday)||Ar(e.byweekday)||Ar(e.byeaster)))switch(e.freq){case Ee.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Ee.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Ee.WEEKLY:e.byweekday=[Qc(e.dtstart)];break}if(Ar(e.bymonth)&&!li(e.bymonth)&&(e.bymonth=[e.bymonth]),Ar(e.byyearday)&&!li(e.byyearday)&&aa(e.byyearday)&&(e.byyearday=[e.byyearday]),!Ar(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(li(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(Ar(e.byweekno)&&!li(e.byweekno)&&(e.byweekno=[e.byweekno]),!Ar(e.byweekday))e.bynweekday=null;else if(aa(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if($L(e.byweekday))e.byweekday=[Dn.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Dn)!e.byweekday.n||e.freq>Ee.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;tEe.MONTHLY?a.push(l.weekday):o.push([l.weekday,l.n])}e.byweekday=kn(a)?a:null,e.bynweekday=kn(o)?o:null}return Ar(e.byhour)?aa(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq{ed();td();ns();Ha();Pi();Dm();FD()});function fT(r){var e=r.split(` `).map(y$e).filter(function(t){return t!==null});return ci(ci({},e[0]),e[1])}function mT(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=cT(i),e}function y$e(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return qre(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return qre(r);case"DTSTART":return mT(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function qre(r){var e=r.replace(/^RRULE:/i,""),t=mT(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=Tt[o.toUpperCase()];break;case"WKST":t.wkst=Ua[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var l=v$e(o),c=a.toLowerCase();t[c]=l;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=b$e(o);break;case"DTSTART":case"TZID":var d=mT(r);t.tzid=d.tzid,t.dtstart=d.dtstart;break;case"UNTIL":t.until=cT(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function v$e(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Hre)}return Hre(r)}function Hre(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function b$e(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Ua[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=Ua[s].weekday;return new Dn(a,i)})}var WL=v(()=>{ed();td();Dm();Pi();Ha()});var Mm,$D=v(()=>{Pi();Mm=(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=Sg(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:_re(this.date,this.tzid)},r})()});function hT(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(pT),s=0;s{Ha();ns();Dm();Pi();$D()});function k$e(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var Ure,Vre=v(()=>{OD();Pi();ns();Ure=(function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?RD(t):BL(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,i=t?Object.keys(t):[],s=function(d){for(var u=0;u{ed();ns();Wre=le(le(le(le(le(le(le(le(le(le(le(le(le([],It(1,31),!0),It(2,28),!0),It(3,31),!0),It(4,30),!0),It(5,31),!0),It(6,30),!0),It(7,31),!0),It(8,31),!0),It(9,30),!0),It(10,31),!0),It(11,30),!0),It(12,31),!0),It(1,7),!0),Yre=le(le(le(le(le(le(le(le(le(le(le(le(le([],It(1,31),!0),It(2,29),!0),It(3,31),!0),It(4,30),!0),It(5,31),!0),It(6,30),!0),It(7,31),!0),It(8,31),!0),It(9,30),!0),It(10,31),!0),It(11,30),!0),It(12,31),!0),It(1,7),!0),w$e=qa(1,29),S$e=qa(1,30),bu=qa(1,31),_i=qa(1,32),Gre=le(le(le(le(le(le(le(le(le(le(le(le(le([],_i,!0),S$e,!0),_i,!0),bu,!0),_i,!0),bu,!0),_i,!0),_i,!0),bu,!0),_i,!0),bu,!0),_i,!0),_i.slice(0,7),!0),Kre=le(le(le(le(le(le(le(le(le(le(le(le(le([],_i,!0),w$e,!0),_i,!0),bu,!0),_i,!0),bu,!0),_i,!0),_i,!0),bu,!0),_i,!0),bu,!0),_i,!0),_i.slice(0,7),!0),x$e=qa(-28,0),E$e=qa(-29,0),Tu=qa(-30,0),Mi=qa(-31,0),Zre=le(le(le(le(le(le(le(le(le(le(le(le(le([],Mi,!0),E$e,!0),Mi,!0),Tu,!0),Mi,!0),Tu,!0),Mi,!0),Mi,!0),Tu,!0),Mi,!0),Tu,!0),Mi,!0),Mi.slice(0,7),!0),Qre=le(le(le(le(le(le(le(le(le(le(le(le(le([],Mi,!0),x$e,!0),Mi,!0),Tu,!0),Mi,!0),Tu,!0),Mi,!0),Mi,!0),Tu,!0),Mi,!0),Tu,!0),Mi,!0),Mi.slice(0,7),!0),Jre=[0,31,60,91,121,152,182,213,244,274,305,335,366],Xre=[0,31,59,90,120,151,181,212,243,273,304,334,365],GL=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(qa(7));return r})()});function tne(r,e){var t=Dl(r,1,1),n=wg(r)?366:365,i=wg(r+1)?366:365,s=lT(t),a=Qc(t),o=ci(ci({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},D$e(r)),{wnomask:null});if(oa(e.byweekno))return o;o.wnomask=It(0,n+7);var l,c,d=l=Ci(7-a+e.wkst,7);d>=4?(d=0,c=o.yearlen+Ci(a-e.wkst,7)):c=n-d;for(var u=Math.floor(c/7),p=Ci(c,7),m=Math.floor(u+p/4),f=0;f0&&h<=m){var g=void 0;h>1?(g=d+(h-1)*7,d!==l&&(g-=7-l)):g=d;for(var y=0;y<7&&(o.wnomask[g]=1,g++,o.wdaymask[g]!==e.wkst);y++);}}if(Ft(e.byweekno,1)){var g=d+m*7;if(d!==l&&(g-=7-l),g=4?(w=0,E=S+Ci(T-e.wkst,7)):E=n-d,k=Math.floor(52+Ci(E,7)/4)}if(Ft(e.byweekno,k))for(var g=0;g{ed();Pi();ns();ene()});function nne(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===Ee.YEARLY)if(oa(s.bymonth))o=[[0,t]];else for(var l=0;l{Ha();ns()});function sne(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),l=Math.floor((n-o+1)/3),c=Math.floor(19*t+n-s-l+15)%30,d=Math.floor(i/4),u=i%4,p=Math.floor(32+2*a+2*d-c-u)%7,m=Math.floor((t+11*c+22*p)/451),f=Math.floor((c+p-7*m+114)/31),h=(c+p-7*m+114)%31+1,g=Date.UTC(r,f-1,h+e),y=Date.UTC(r,0,1);return[Math.ceil((g-y)/(1e3*60*60*24))]}var ane=v(()=>{});var C$e,one,lne=v(()=>{ns();td();rne();ine();ane();FD();Pi();C$e=(function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=tne(e,n)),kn(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var i=this.yearinfo,s=i.yearlen,a=i.mrange,o=i.wdaymask;this.monthinfo=nne(e,t,s,a,o,n)}Ar(n.byeaster)&&(this.eastermask=sne(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[qa(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],i=this.mrange[t],s=It(null,this.yearlen),a=n;a{Pi();ns()});function jD(r,e){var t=e.dtstart,n=e.freq,i=e.interval,s=e.until,a=e.bysetpos,o=e.count;if(o===0||i===0)return rd(r);var l=$re.fromDate(t),c=new one(e);c.rebuild(l.year,l.month);for(var d=M$e(c,l,e);;){var u=c.getdayset(n)(l.year,l.month,l.day),p=u[0],m=u[1],f=u[2],h=_$e(p,m,f,c,e);if(kn(a))for(var g=cne(a,d,m,f,c,p),y=0;ys)return rd(r);if(k>=t){var T=une(k,e);if(!r.accept(T)||o&&(--o,!o))return rd(r)}}else for(var y=m;ys)return rd(r);if(k>=t){var T=une(k,e);if(!r.accept(T)||o&&(--o,!o))return rd(r)}}}if(e.interval===0||(l.add(e,h),l.year>AD))return rd(r);uT(n)||(d=c.gettimeset(n)(l.hour,l.minute,l.second,0)),c.rebuild(l.year,l.month)}}function P$e(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,l=t.bynmonthday,c=t.byyearday;return kn(n)&&!Ft(n,r.mmask[e])||kn(i)&&!r.wnomask[e]||kn(s)&&!Ft(s,r.wdaymask[e])||kn(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!Ft(r.eastermask,e)||(kn(o)||kn(l))&&!Ft(o,r.mdaymask[e])&&!Ft(l,r.nmdaymask[e])||kn(c)&&(e=r.yearlen&&!Ft(c,e+1-r.yearlen)&&!Ft(c,-r.nextyearlen+e-r.yearlen))}function une(r,e){return new Mm(r,e.tzid).rezonedDate()}function rd(r){return r.getValue()}function _$e(r,e,t,n,i){for(var s=!1,a=e;a=Ee.HOURLY&&kn(i)&&!Ft(i,e.hour)||n>=Ee.MINUTELY&&kn(s)&&!Ft(s,e.minute)||n>=Ee.SECONDLY&&kn(a)&&!Ft(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var KL=v(()=>{td();Pi();lne();Ha();VL();ns();$D();dne();FD()});var Ua,pT,Bre,Ee,Ha=v(()=>{Pi();OD();Mre();Fre();td();VL();WL();YL();Vre();Dm();KL();Ua={MO:new Dn(0),TU:new Dn(1),WE:new Dn(2),TH:new Dn(3),FR:new Dn(4),SA:new Dn(5),SU:new Dn(6)},pT={freq:Tt.YEARLY,dtstart:null,interval:1,wkst:Ua.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},Bre=Object.keys(pT),Ee=(function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new Ure,this.origOptions=UL(e);var n=jre(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return dT(e,t)},r.fromText=function(e,t){return Rre(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return jD(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 HL("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Xc("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!Pm(e)||!Pm(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 HL("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new Xc("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Pm(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 Xc("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Pm(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 Xc("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return hT(this.origOptions)},r.prototype.toText=function(e,t,n){return Ore(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return Lre(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=Tt.YEARLY,r.MONTHLY=Tt.MONTHLY,r.WEEKLY=Tt.WEEKLY,r.DAILY=Tt.DAILY,r.HOURLY=Tt.HOURLY,r.MINUTELY=Tt.MINUTELY,r.SECONDLY=Tt.SECONDLY,r.MO=Ua.MO,r.TU=Ua.TU,r.WE=Ua.WE,r.TH=Ua.TH,r.FR=Ua.FR,r.SA=Ua.SA,r.SU=Ua.SU,r.parseString=fT,r.optionsToString=hT,r})()});function pne(r,e,t,n,i,s){var a={},o=r.accept;function l(p,m){t.forEach(function(f){f.between(p,m,!0).forEach(function(h){a[Number(h)]=!0})})}i.forEach(function(p){var m=new Mm(p,s).rezonedDate();a[Number(m)]=!0}),r.accept=function(p){var m=Number(p);return isNaN(m)?o.call(this,p):!a[m]&&(l(new Date(m-1),new Date(m+1)),!a[m])?(a[m]=!0,o.call(this,p)):!0},r.method==="between"&&(l(r.args.after,r.args.before),r.accept=function(p){var m=Number(p);return a[m]?!0:(a[m]=!0,o.call(this,p))});for(var c=0;c{$D();KL();Pi()});function A$e(r,e){var t=[],n=[],i=[],s=[],a=mT(r),o=a.dtstart,l=a.tzid,c=L$e(r,e.unfold);return c.forEach(function(d){var u;if(d){var p=O$e(d),m=p.name,f=p.parms,h=p.value;switch(m.toUpperCase()){case"RRULE":if(f.length)throw new Error("unsupported RRULE parm: ".concat(f.join(",")));t.push(fT(d));break;case"RDATE":var g=(u=/RDATE(?:;TZID=([^:=]+))?/i.exec(d))!==null&&u!==void 0?u:[],y=g[1];y&&!l&&(l=y),n=n.concat(hne(h,f));break;case"EXRULE":if(f.length)throw new Error("unsupported EXRULE parm: ".concat(f.join(",")));i.push(fT(h));break;case"EXDATE":s=s.concat(hne(h,f));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:o,tzid:l,rrulevals:t,rdatevals:n,exrulevals:i,exdatevals:s}}function I$e(r,e){var t=A$e(r,e),n=t.rrulevals,i=t.rdatevals,s=t.exrulevals,a=t.exdatevals,o=t.dtstart,l=t.tzid,c=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||i.length||s.length||a.length){var d=new JL(c);return d.dtstart(o),d.tzid(l||void 0),n.forEach(function(p){d.rrule(new Ee(ZL(p,o,l),c))}),i.forEach(function(p){d.rdate(p)}),s.forEach(function(p){d.exrule(new Ee(ZL(p,o,l),c))}),a.forEach(function(p){d.exdate(p)}),e.compatible&&e.dtstart&&d.rdate(o),d}var u=n[0]||{};return new Ee(ZL(u,u.dtstart||e.dtstart||o,u.tzid||e.tzid||l),c)}function zD(r,e){return e===void 0&&(e={}),I$e(r,N$e(e))}function ZL(r,e,t){return ci(ci({},r),{dtstart:e,tzid:t})}function N$e(r){var e=[],t=Object.keys(r),n=Object.keys(fne);if(t.forEach(function(i){Ft(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return ci(ci({},fne),r)}function R$e(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=Ere(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function O$e(r){var e=R$e(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 L$e(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 F$e(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function hne(r,e){return F$e(e),r.split(",").map(function(t){return cT(t)})}var fne,QL=v(()=>{ed();Ha();XL();Pi();ns();WL();fne={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null}});function gne(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n{ed();Ha();Pi();ns();mne();QL();YL();JL=(function(r){xg(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=gne.apply(n,["dtstart"]),n.tzid=gne.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return pne(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){yne(t,this._rrule)},e.prototype.exrule=function(t){yne(t,this._exrule)},e.prototype.rdate=function(t){vne(t,this._rdate)},e.prototype.exdate=function(t){vne(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return zD(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return zD(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(hT({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(` `))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(` `).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(bne("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(bne("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(` `)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e})(Ee)});var t1=v(()=>{Ha();XL();QL();td();Dm();Pi()});function n1(r){let e=r.match(/DTSTART:(\d{8}(?:T\d{6}Z?)?)/);if(!e)return null;let t=e[1];if(t.length===8){let c=parseInt(t.slice(0,4)),d=parseInt(t.slice(4,6))-1,u=parseInt(t.slice(6,8));return new Date(Date.UTC(c,d,u,0,0,0,0))}let n=parseInt(t.slice(0,4)),i=parseInt(t.slice(4,6))-1,s=parseInt(t.slice(6,8)),a=parseInt(t.slice(9,11))||0,o=parseInt(t.slice(11,13))||0,l=parseInt(t.slice(13,15))||0;return new Date(Date.UTC(n,i,s,a,o,l,0))}function $$e(r){if(!r.recurrence)return null;let e=n1(r.recurrence);return e||(r.scheduled?ja(r.scheduled):r.dateCreated?ja(r.dateCreated):null)}function Tne(r){if(!r.recurrence||typeof r.recurrence!="string")return null;let e=$$e(r);if(!e)return null;let t=r.recurrence.replace(/DTSTART:[^;]+;?/,""),n=r1.parseString(t);return n.dtstart=e,new r1(n)}function j$e(r){let e=r.match(/INTERVAL=(\d+)/);return e?parseInt(e[1],10):1}function kne(r){let e=j$e(r);return r.includes("FREQ=DAILY")?Math.max(30,e*2):r.includes("FREQ=WEEKLY")?Math.max(90,e*7*2):r.includes("FREQ=MONTHLY")?Math.max(400,e*31*2):r.includes("FREQ=YEARLY")?Math.max(800,e*366*2):365}function wne(r){if($r(r)){let s=Mr(r),a=s.getFullYear(),o=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),c=String(s.getHours()).padStart(2,"0"),d=String(s.getMinutes()).padStart(2,"0"),u=String(s.getSeconds()).padStart(2,"0");return`${a}${o}${l}T${c}${d}${u}Z`}let e=st(r),t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),i=String(e.getUTCDate()).padStart(2,"0");return`${t}${n}${i}`}function i1(r,e){if(!r.recurrence)return!0;if(typeof r.recurrence=="string")try{let t=Tne(r);if(!t)return!1;let n=ja(CL(e));return t.between(n,new Date(n.getTime()+1440*60*1e3-1),!0).length>0}catch(t){return console.error("Error evaluating rrule:",t,{task:r.title,recurrence:r.recurrence}),!0}return!0}function Sne(r,e,t){if(!r.recurrence)return r.status||"open";let n=ue(e);return(Array.isArray(r.complete_instances)?r.complete_instances:[]).includes(n)?t||"done":r.status||"open"}function BD(r,e,t){if(!r.recurrence)return[];if(typeof r.recurrence=="string")try{let s=Tne(r);if(!s)return[];let a=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0,0)),o=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),23,59,59,999));return s.between(a,o,!0)}catch(s){console.error("Error generating recurring instances:",s,{task:r.title,recurrence:r.recurrence})}let n=[],i=new Date(e);for(;i<=t;)i1(r,i)&&n.push(new Date(i)),i.setUTCDate(i.getUTCDate()+1);return n}function z$e(r){if(!r.recurrence)return null;try{let e=st(cn()),t=kne(r.recurrence),n=e,i=n1(r.recurrence);i&&i=e)return l}return null}catch(e){return console.error("Error calculating next scheduled-based occurrence:",e,{task:r.title}),null}}function B$e(r){if(!r.recurrence||typeof r.recurrence!="string")return null;try{let e=st(cn()),t=kne(r.recurrence),n=n1(r.recurrence),i=n||e,s=new Date(i.getTime()+t*24*60*60*1e3),a=BD(r,i,s),o=new Set(r.skipped_instances||[]),l=n?n.getTime():0;for(let c of a){let d=ue(c);if(c.getTime()>l&&c>=e&&!o.has(d))return c}return null}catch(e){return console.error("Error calculating completion-based recurrence:",e,{task:r.title}),null}}function xne(r){return r.recurrence?(r.recurrence_anchor||"scheduled")==="completion"?B$e(r):z$e(r):null}function Am(r,e=!0){let t=xne(r),n=null,i=null,s=null;if(t){if(e)try{let a=r.scheduled?st(r.scheduled):null,o=r.due?st(r.due):null;if(a&&o){let l=o.getTime()-a.getTime();s=new Date(t.getTime()+l)}}catch(a){console.error("Error calculating next due date with offset:",a)}if(r.scheduled&&r.scheduled.includes("T")){let a=r.scheduled.split("T")[1];n=`${ue(t)}T${a}`}else n=ue(t);if(s&&r.due&&r.due.includes("T")){let a=r.due.split("T")[1];i=`${ue(s)}T${a}`}else s&&(i=ue(s))}return{scheduled:n,due:i}}function Ene(r){if(!r)return"";try{if(r.includes("FREQ=")){let e=r.replace(/DTSTART:[^;]+;?/,"");return r1.fromString(e).toText()}return"rrule"}catch(e){return console.error("Error converting recurrence to display text:",e,{recurrence:r}),"rrule"}}function nd(r){if(!r.recurrence||typeof r.recurrence!="string")return null;if(r.recurrence.includes("DTSTART:"))return r.recurrence;let e=r.scheduled||r.dateCreated;if(!e)return null;try{return`DTSTART:${wne(e)};${r.recurrence}`}catch(t){return console.error("Error parsing date for DTSTART:",t,{sourceDateString:e}),null}}function qD(r,e){if(!r||typeof r!="string")return null;try{let t=wne(e);return r.includes("DTSTART:")?r.replace(/DTSTART:[^;]+;?/,`DTSTART:${t};`):`DTSTART:${t};${r}`}catch(t){return console.error("Error updating DTSTART in recurrence rule:",t,{dateStr:e}),null}}function Dne(r,e,t){if(!r.recurrence||typeof r.recurrence!="string")return null;if(r.recurrence.includes("DTSTART:"))return r.recurrence;let n=r.scheduled||r.dateCreated;if(!n)return null;try{let i;if(t){let s=st(n),a=s.getUTCFullYear(),o=String(s.getUTCMonth()+1).padStart(2,"0"),l=String(s.getUTCDate()).padStart(2,"0");i=`${a}${o}${l}`}else{let s=st(n),a=s.getUTCFullYear(),o=String(s.getUTCMonth()+1).padStart(2,"0"),l=String(s.getUTCDate()).padStart(2,"0"),c=String(e.getHours()).padStart(2,"0"),d=String(e.getMinutes()).padStart(2,"0");i=`${a}${o}${l}T${c}${d}00Z`}return`DTSTART:${i};${r.recurrence}`}catch(i){return console.error("Error parsing date for DTSTART with dragged time:",i,{sourceDateString:n,draggedStart:e,allDay:t}),null}}var r1,gT=v(()=>{t1();Qe();r1=Ee});function Cne(r){return window.moment(r)}function HD(r){if(!r.startsWith("---"))return{};let e=r.indexOf("---",3);if(e===-1)return{};let t=r.substring(3,e);try{return(0,Im.parseYaml)(t)||{}}catch(n){return console.error("Error parsing frontmatter:",n),{}}}async function Nm(r,e){try{let n=(0,Im.normalizePath)(e).split("/").filter(s=>s.length>0),i="";for(let s of n)if(i=i?`${i}/${s}`:s,!await r.adapter.exists(i))try{await r.createFolder(i)}catch(a){if(!await r.adapter.exists(i))throw new Error(`Failed to create folder "${i}"`)}}catch(t){let n=t instanceof Error?t.message:String(t),i=t instanceof Error?t.stack:void 0;console.error("Error creating folder structure:",{error:n,stack:i,folderPath:e,normalizedPath:(0,Im.normalizePath)(e)});let s=new Error(`Failed to create folder "${e}": ${n}`);throw i&&(s.stack=i),s}}function q$e(r,e){try{let t=new Date(r),n=new Date(e);if(isNaN(t.getTime())||isNaN(n.getTime()))return console.error("Invalid timestamps for duration calculation:",{startTime:r,endTime:e}),0;if(n<=t)return console.error("End time is not after start time:",{startTime:r,endTime:e}),0;let i=n.getTime()-t.getTime(),s=Math.round(i/(1e3*60));return Math.max(0,s)}catch(t){return console.error("Error calculating duration:",t,{startTime:r,endTime:e}),0}}function is(r){return!r||!Array.isArray(r)?0:r.reduce((e,t)=>{if(!t.startTime||!t.endTime)return e;let n=q$e(t.startTime,t.endTime);return e+n},0)}function UD(r){return!r||!Array.isArray(r)?null:r.find(e=>e.startTime&&!e.endTime)||null}function VD(r){if(!r||r===0||isNaN(r))return"0m";let e=Math.floor(r/60),t=r%60;return e===0?`${t}m`:t===0?`${e}h`:`${e}h ${t}m`}function qo(r){if(r==="none")return"";let e=new Date,t;switch(r){case"today":t=e;break;case"tomorrow":t=new Date(e),t.setDate(e.getDate()+1);break;case"next-week":t=new Date(e),t.setDate(e.getDate()+7);break;default:return""}return P(t,"yyyy-MM-dd")}function s1(r,e){return r.getUTCFullYear()===e.getUTCFullYear()&&r.getUTCMonth()===e.getUTCMonth()&&r.getUTCDate()===e.getUTCDate()}function Pne(r,e,t,n,i,s,a){var d;let o=r.metadataCache.getFileCache(n),l=o==null?void 0:o.frontmatter;if(l)if(i){let u=i.mapFromFrontmatter(l,t,s);return{title:u.title||"Untitled task",status:u.status||a||"open",priority:u.priority||"normal",due:u.due,scheduled:u.scheduled,path:t,archived:u.archived||!1,tags:u.tags||[],contexts:u.contexts||[],projects:u.projects||[],recurrence:u.recurrence,complete_instances:u.complete_instances,completedDate:u.completedDate,timeEstimate:u.timeEstimate,timeEntries:u.timeEntries,dateCreated:u.dateCreated,dateModified:u.dateModified,reminders:u.reminders}}else{let p=new kg(hL).mapFromFrontmatter(l,t,s);return{title:p.title||"Untitled task",status:p.status||a||"open",priority:p.priority||"normal",due:p.due,scheduled:p.scheduled,path:t,archived:p.archived||!1,tags:p.tags||[],contexts:p.contexts||[],projects:p.projects||[],recurrence:p.recurrence,complete_instances:p.complete_instances,completedDate:p.completedDate,timeEstimate:p.timeEstimate,timeEntries:p.timeEntries,dateCreated:p.dateCreated,dateModified:p.dateModified,reminders:p.reminders}}return{title:((d=t.split("/").pop())==null?void 0:d.replace(".md",""))||"Untitled",status:a||"open",priority:"normal",path:t,archived:!1,reminders:[]}}function Cg(r){if(r.startsWith("---")){let e=r.match(/^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?([\s\S]*)$/);if(e)return{frontmatter:e[1],body:e[2]||""}}return{frontmatter:null,body:r}}function _ne(r){let e=/^(\s*)([-*+]|\d+\.)(\s+\[)[xX](\].*)/gm,t=!1;return{content:r.replace(e,(i,s,a,o,l)=>(t=!0,`${s}${a}${o} ${l}`)),changed:t}}function WD(r,e){return i1(r,e)}function Pg(r,e,t){return Sne(r,e,t)}function YD(r,e,t){return BD(r,e,t)}function Mne(r,e=!0){return Am(r,e)}function Ane(r){return Ene(r)}function H$e(r){if(!r||typeof r!="object")return!1;let e=r;if(!e.id||typeof e.id!="string"||!e.title||typeof e.title!="string"||!e.startTime||typeof e.startTime!="string"||!e.endTime||typeof e.endTime!="string")return!1;let t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/;if(!t.test(e.startTime)||!t.test(e.endTime))return!1;let[n,i]=e.startTime.split(":").map(Number),[s,a]=e.endTime.split(":").map(Number),o=n*60+i;if(s*60+a<=o||e.attachments&&!Array.isArray(e.attachments))return!1;if(e.attachments){for(let c of e.attachments)if(typeof c!="string"||!c.trim())return!1}return!(e.color&&typeof e.color!="string"||e.description&&typeof e.description!="string")}function U$e(r,e){try{let t=HD(r);if(!t||!t.timeblocks||!Array.isArray(t.timeblocks))return[];let n=[];for(let i of t.timeblocks)H$e(i)?n.push(i):console.warn(`Invalid timeblock in ${e}:`,i);return n}catch(t){return console.error(`Error extracting timeblocks from ${e}:`,t),[]}}function Ine(){return`tb-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}async function a1(r,e,t,n,i,s){let{getDailyNote:a,getAllDailyNotes:o,appHasDailyNotesPluginLoaded:l}=await Promise.resolve().then(()=>Ke(Hc()));if(!l())throw new Error("Daily Notes plugin is not enabled");let c=o(),d=Cne(t),u=a(d,c);if(!u)throw new Error(`Daily note for ${t} not found`);let p=await r.vault.read(u),m=U$e(p,u.path),f=m.findIndex(y=>y.id===e);if(f===-1)throw new Error(`Timeblock ${e} not found`);let h=m[f];if(t===n){await V$e(r,u,e,i,s);return}await W$e(r,u,e);let g={...h,startTime:i,endTime:s};await Y$e(r,n,g)}async function V$e(r,e,t,n,i){let s=await r.vault.read(e),a=HD(s)||{};if(!a.timeblocks||!Array.isArray(a.timeblocks))throw new Error("No timeblocks found in frontmatter");let o=a.timeblocks.findIndex(l=>l.id===t);if(o===-1)throw new Error(`Timeblock ${t} not found`);a.timeblocks[o].startTime=n,a.timeblocks[o].endTime=i,await o1(r,e,a,s)}async function W$e(r,e,t){let n=await r.vault.read(e),i=HD(n)||{};!i.timeblocks||!Array.isArray(i.timeblocks)||(i.timeblocks=i.timeblocks.filter(s=>s.id!==t),await o1(r,e,i,n))}async function Y$e(r,e,t){let{createDailyNote:n,getDailyNote:i,getAllDailyNotes:s}=await Promise.resolve().then(()=>Ke(Hc())),a=Cne(e),o=s(),l=i(a,o);if(!l){try{l=await n(a)}catch(u){let p=u instanceof Error?u.message:String(u);throw new Error(`Failed to create daily note: ${p}. Please check your Daily Notes plugin configuration and ensure the daily notes folder exists.`)}if(!l)throw new Error("Failed to create daily note. Please check your Daily Notes plugin configuration and ensure the daily notes folder exists.")}let c=await r.vault.read(l),d=HD(c)||{};d.timeblocks||(d.timeblocks=[]),d.timeblocks.push(t),await o1(r,l,d,c)}async function o1(r,e,t,n){let i=n;if(n.startsWith("---")){let o=n.indexOf("---",3);o!==-1&&(i=n.substring(o+3))}let a=`--- ${(0,Im.stringifyYaml)(t)}---${i}`;await r.vault.modify(e,a)}function ku(r){return!r||!Array.isArray(r)?[]:r.filter(e=>{if(typeof e!="string")return!1;let t=e.trim();return!(t.length===0||t==='""'||t==="''")})}function Nne(r,e){return qD(r,e)}function Rne(r,e,t){return Dne(r,e,t)}function Ai(r){return!r||typeof r!="string"?"":r.split(",").map(e=>{let t=e.trim();return t.startsWith("#")?t.slice(1):t}).filter(e=>e.length>0).join(", ")}function l1(r){return!r||typeof r!="string"?"":r.replace(/[^a-zA-Z0-9-]/g,"-").toLowerCase()}var Im,Cr=v(()=>{Im=require("obsidian");Tn();FL();lg();gT();Qe()});var wu,GD=v(()=>{jr();wu=class{constructor(e){this.deps=e}buildMetadataRows(e,t,n){var a;let i=[],s=Math.min(e.length,3);for(let o=0;o0&&i.push(d.join(" "))}catch(c){}}return i}stringifyFmValue(e){if(e==null)return"";if(Array.isArray(e))return e.map(i=>this.stringifyFmValue(i)).filter(Boolean).join(", ");let t=typeof e;if(t==="string"){let i=e.trim(),s=i.match(/^\[\[([^\]]+)\]\]$/);if(s){let l=s[1].split("|");if(l.length>1&&l[1].trim())return l[1].trim();let c=l[0].split("#")[0].trim();return(c.split("/").pop()||c).replace(/\.md$/i,"")}let a=i.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return a?a[1].trim():i}if(t==="number"||t==="boolean")return ie(e);if(t==="object"){let n=e;if(typeof n.path=="string"){let i=n.path;return(i.split("/").pop()||i).replace(/\.md$/i,"")}return""}return""}resolve(e,t){if(!e)return"";if(e.startsWith("file."))switch(e){case"file.basename":return t.basename||"";case"file.name":return t.name||"";case"file.path":return t.path||"";case"file.parent":return t.parent||"";default:return""}if(e==="title")return t.title||"";if(e==="aliases"){let s=t.aliases||[];return s.length?s.join(", "):""}let n=e;e.startsWith("frontmatter:")&&(n=e.slice(12));let i=this.deps.getFrontmatter(t)||{};return this.stringifyFmValue(i[n])}}});function G$e(r){let e=[],t="",n=0;for(;ni.length>0)}function K$e(r){return r.replace(/\\\|/g,"|").replace(/\\\)/g,")")}function Pl(r){let e=[];if(!r)return e;let t=/\{([^}]*)\}/g,n,i=0;for(;(n=t.exec(r))!==null;){let a=r.slice(i,n.index);a.length>0&&e.push({property:`literal:${a}`,showName:!1}),i=t.lastIndex;let o=n[1].trim();if(!o)continue;let l=G$e(o);if(l.length===0)continue;let c=l[0];if(!c)throw new Error("Missing property name in token");let d={property:c,showName:!1};for(let u=1;u0&&e.push({property:`literal:${s}`,showName:!1}),e}var yT=v(()=>{});function One(r){return r!=null?r.trim():""}function Z$e(r){return r?r.trim():""}function KD(r){let e=Z$e(r==null?void 0:r.propertyKey),t=One(r==null?void 0:r.propertyValue);return{key:e,value:t,enabled:e.length>0}}function ZD(r,e){if(!e.enabled)return!0;if(!r||typeof r!="object"||!(e.key in r))return!1;let t=r[e.key],n=One(e.value);if(n.length===0)return t!=null;let i=n.toLowerCase(),s=a=>{if(a==null)return!1;if(Array.isArray(a))return a.some(o=>s(o));if(typeof a=="string")return a.trim().toLowerCase()===i;if(typeof a=="number"||typeof a=="boolean")return String(a).toLowerCase()===i;if(typeof a=="object")try{return JSON.stringify(a).toLowerCase()===i}catch(o){return!1}return ie(a).toLowerCase()===i};return s(t)}var c1=v(()=>{jr()});var di,id,Rm,vr,Om=v(()=>{Qe();di=class extends Error{constructor(t,n,i){super(t);this.field=n;this.nodeId=i;this.name="FilterValidationError"}},id=class extends Error{constructor(t,n){super(t);this.nodeId=n;this.name="FilterEvaluationError"}},Rm=class Rm{static generateId(){return`filter_${Date.now()}_${++this.idCounter}`}static deepCloneFilterQuery(e){return JSON.parse(JSON.stringify(e))}static validateFilterNode(e,t=!0){if(!e||typeof e!="object")throw new di("Filter node must be an object");if(!("id"in e)||!e.id||typeof e.id!="string")throw new di("Filter node must have a valid string ID",void 0,"id"in e?String(e.id):"unknown");if(e.type==="condition")this.validateCondition(e,t);else if(e.type==="group")this.validateGroup(e,t);else{let n=e;throw new di(`Unknown filter node type: ${String(n.type)}`,void 0,typeof n.id=="string"?n.id:void 0)}}static validateCondition(e,t=!0){if(typeof e.property!="string")throw new di("Condition must have a valid property","property",e.id);if(t&&e.property==="")throw new di("Property must be selected","property",e.id);if(e.property==="")return;if(!e.operator||typeof e.operator!="string")throw new di("Condition must have a valid operator","operator",e.id);if(!this.getValidOperatorsForProperty(e.property).includes(e.operator))throw new di(`Operator '${e.operator}' is not valid for property '${e.property}'`,"operator",e.id);if(t&&this.operatorRequiresValue(e.operator)&&(e.value===null||e.value===void 0||e.value===""))throw new di(`Operator '${e.operator}' requires a value`,"value",e.id)}static validateGroup(e,t=!0){if(!e.conjunction||!["and","or"].includes(e.conjunction))throw new di("Group must have a valid conjunction (and/or)","conjunction",e.id);if(!Array.isArray(e.children))throw new di("Group must have a children array","children",e.id);e.children.forEach((n,i)=>{try{this.validateFilterNode(n,t)}catch(s){throw s instanceof di?new di(`Child ${i}: ${s.message}`,s.field,e.id):s}})}static getValidOperatorsForProperty(e){return typeof e=="string"&&e.startsWith("user:")?["is","is-not","contains","does-not-contain","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty","is-checked","is-not-checked","is-greater-than","is-less-than","is-greater-than-or-equal","is-less-than-or-equal"]:{"":[],title:["is","is-not","contains","does-not-contain","is-empty","is-not-empty"],path:["contains","does-not-contain","is-empty","is-not-empty"],status:["is","is-not","is-empty","is-not-empty"],priority:["is","is-not","is-empty","is-not-empty"],tags:["contains","does-not-contain","is-empty","is-not-empty"],contexts:["contains","does-not-contain","is-empty","is-not-empty"],projects:["contains","does-not-contain","is-empty","is-not-empty"],blockedBy:["contains","does-not-contain","is-empty","is-not-empty"],blocking:["contains","does-not-contain","is-empty","is-not-empty"],due:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],scheduled:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],completedDate:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],dateCreated:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],dateModified:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],archived:["is-checked","is-not-checked"],"dependencies.isBlocked":["is-checked","is-not-checked"],"dependencies.isBlocking":["is-checked","is-not-checked"],timeEstimate:["is","is-not","is-greater-than","is-less-than","is-greater-than-or-equal","is-less-than-or-equal"],recurrence:["is-empty","is-not-empty"],"status.isCompleted":["is-checked","is-not-checked"]}[e]||[]}static isFilterNodeComplete(e){try{return this.validateFilterNode(e,!0),!0}catch(t){return!1}}static operatorRequiresValue(e){return!["is-empty","is-not-empty","is-checked","is-not-checked"].includes(e)}static getTaskPropertyValue(e,t){var n;switch(t){case"title":return e.title;case"path":return e.path;case"status":return e.status;case"priority":return e.priority;case"tags":return e.tags||[];case"contexts":return e.contexts||[];case"projects":return e.projects||[];case"blockedBy":return((n=e.blockedBy)==null?void 0:n.map(i=>i.uid))||[];case"blocking":return e.blocking||[];case"due":return e.due;case"scheduled":return e.scheduled;case"completedDate":return e.completedDate;case"dateCreated":return e.dateCreated;case"dateModified":return e.dateModified;case"archived":return e.archived;case"timeEstimate":return e.timeEstimate;case"recurrence":return e.recurrence;case"status.isCompleted":return;case"dependencies.isBlocked":return e.isBlocked===!0;case"dependencies.isBlocking":return e.isBlocking===!0;default:throw new id(`Unknown property: ${t}`)}}static applyOperator(e,t,n,i,s){try{switch(t){case"is":return this.isEqual(e,n,s);case"is-not":return!this.isEqual(e,n,s);case"contains":return this.contains(e,n,s);case"does-not-contain":return!this.contains(e,n,s);case"is-before":return this.isBefore(e,n);case"is-after":return this.isAfter(e,n);case"is-on-or-before":return this.isOnOrBefore(e,n);case"is-on-or-after":return this.isOnOrAfter(e,n);case"is-empty":return this.isEmpty(e);case"is-not-empty":return!this.isEmpty(e);case"is-checked":return e===!0;case"is-not-checked":return e!==!0;case"is-greater-than":return this.isGreaterThan(e,n);case"is-less-than":return this.isLessThan(e,n);case"is-greater-than-or-equal":return this.isGreaterThanOrEqual(e,n);case"is-less-than-or-equal":return this.isLessThanOrEqual(e,n);default:throw new id("Unknown operator",i)}}catch(a){throw a instanceof id?a:new id(`Error applying operator '${t}': ${a.message}`,i)}}static isEqual(e,t,n){return n&&this.isDateProperty(n)&&typeof e=="string"&&typeof t=="string"&&(e||CD(t))?this.isEqualDate(e,t):Array.isArray(e)?Array.isArray(t)?e.some(i=>t.includes(i)):e.includes(t):Array.isArray(t)?t.includes(e):e===t}static matchesHierarchicalTag(e,t){if(!e||!t)return!1;let n=e.toLowerCase(),i=t.toLowerCase();return!!(n===i||n.startsWith(i+"/")||n.includes(i))}static matchesHierarchicalTagExact(e,t){if(!e||!t)return!1;let n=e.toLowerCase(),i=t.toLowerCase();return!!(n===i||n.startsWith(i+"/"))}static matchesTagConditions(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(t.length===0)return!0;let n=[],i=[];for(let s of t)if(typeof s=="string"&&s.startsWith("-")){let a=s.slice(1);a&&i.push(a)}else typeof s=="string"&&n.push(s);for(let s of i)if(e.some(o=>this.matchesHierarchicalTag(o,s)))return!1;return n.length>0?n.some(s=>e.some(a=>this.matchesHierarchicalTag(a,s))):!0}static contains(e,t,n){if(Array.isArray(e))if(Array.isArray(t))if(n==="tags"){let i=e.filter(a=>typeof a=="string"),s=t.filter(a=>typeof a=="string");return Rm.matchesTagConditions(i,s)}else return t.some(i=>e.some(s=>typeof s=="string"&&typeof i=="string"&&s.toLowerCase().includes(i.toLowerCase())));else{let i=typeof t=="string"?t:String(t!=null?t:"");if(n==="tags"){let s=e.filter(a=>typeof a=="string");return Rm.matchesTagConditions(s,[i])}else{let s=i.toLowerCase();return e.some(a=>typeof a=="string"&&a.toLowerCase().includes(s))}}else if(typeof e=="string")if(Array.isArray(t))if(n==="tags"){let i=t.filter(s=>typeof s=="string");return Rm.matchesTagConditions([e],i)}else return t.some(i=>typeof i=="string"&&e.toLowerCase().includes(i.toLowerCase()));else return n==="tags"&&typeof t=="string"?Rm.matchesTagConditions([e],[t]):typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase());return!1}static isBefore(e,t){if(!e||!t)return!1;try{let n=Sm(t);return Kc(e,n)}catch(n){return!1}}static isAfter(e,t){if(!e||!t)return!1;try{let n=Sm(t);return Kc(n,e)}catch(n){return!1}}static isOnOrBefore(e,t){if(!e||!t)return!1;try{let n=Sm(t);return Kc(e,n)||Ln(tt(e),tt(n))}catch(n){return!1}}static isOnOrAfter(e,t){if(!e||!t)return!1;try{let n=Sm(t);return Kc(n,e)||Ln(tt(e),tt(n))}catch(n){return!1}}static isDateProperty(e){return["due","scheduled","completedDate","dateCreated","dateModified"].includes(e)}static isEqualDate(e,t){try{let n=Sm(t);return Ln(tt(e),tt(n))}catch(n){return!1}}static isEmpty(e){return e==null?!0:typeof e=="string"?e.trim()==="":Array.isArray(e)?e.length===0?!0:e.every(t=>{if(typeof t!="string")return!1;let n=t.trim();return n.length===0||n==='""'||n==="''"}):!1}static isGreaterThan(e,t){let n=typeof e=="number"?e:parseFloat(e),i=typeof t=="number"?t:parseFloat(t);return isNaN(n)||isNaN(i)?!1:n>i}static isLessThan(e,t){let n=typeof e=="number"?e:parseFloat(e),i=typeof t=="number"?t:parseFloat(t);return isNaN(n)||isNaN(i)?!1:n=i}static isLessThanOrEqual(e,t){let n=typeof e=="number"?e:parseFloat(e),i=typeof t=="number"?t:parseFloat(t);return isNaN(n)||isNaN(i)?!1:n<=i}};Rm.idCounter=0;vr=Rm});var _l,Su,QD=v(()=>{_l=require("obsidian");GD();yT();c1();Om();Su=class extends _l.FuzzySuggestModal{constructor(e,t,n){super(e),this.plugin=t,this.onChoose=n,this.setPlaceholder("Type to search for project notes..."),this.setInstructions([{command:"\u2191\u2193",purpose:"to navigate"},{command:"\u21B5",purpose:"to select"},{command:"esc",purpose:"to cancel"}])}getItems(){var s,a,o,l,c,d,u;let e=this.app.vault.getAllLoadedFiles().filter(p=>p instanceof _l.TFile&&p.extension==="md"&&!p.path.includes(".trash")),t=(o=(a=(s=this.plugin.settings)==null?void 0:s.projectAutosuggest)==null?void 0:a.requiredTags)!=null?o:[],n=(d=(c=(l=this.plugin.settings)==null?void 0:l.projectAutosuggest)==null?void 0:c.includeFolders)!=null?d:[],i=KD((u=this.plugin.settings)==null?void 0:u.projectAutosuggest);return t.length===0&&n.length===0&&!i.enabled?e:e.filter(p=>{var f,h;if(!(p instanceof _l.TFile))return!1;let m=this.app.metadataCache.getFileCache(p);if(t.length>0){let g=((f=m==null?void 0:m.tags)==null?void 0:f.map(T=>T.tag.replace("#","")))||[],y=((h=m==null?void 0:m.frontmatter)==null?void 0:h.tags)||[],k=[...g,...Array.isArray(y)?y:[y].filter(Boolean)];if(!vr.matchesTagConditions(k,t))return!1}if(n.length>0&&!n.some(y=>p.path.startsWith(y)||p.path.startsWith(y+"/")))return!1;if(i.enabled){let g=m==null?void 0:m.frontmatter;if(!ZD(g,i))return!1}return!0})}getItemText(e){var a,o,l,c;if(!(e instanceof _l.TFile))return e.name;let t=`${e.name} ${e.path}`,n=(l=(o=(a=this.plugin.settings)==null?void 0:a.projectAutosuggest)==null?void 0:o.rows)!=null?l:[],i=new Set;for(let d of n)try{let u=Pl(d);for(let p of u)p.searchable&&!p.property.startsWith("literal:")&&i.add(p.property)}catch(u){}let s=this.app.metadataCache.getFileCache(e);if(s!=null&&s.frontmatter){let d=this.plugin.fieldMapper.mapFromFrontmatter(s.frontmatter,e.path,this.plugin.settings.storeTitleInFilename),u=typeof d.title=="string"?d.title:"";u&&(t+=` ${u}`);let p=(0,_l.parseFrontMatterAliases)(s.frontmatter)||[];Array.isArray(p)&&p.length>0&&(t+=` ${p.join(" ")}`);for(let m of i){let f="";switch(m){case"file.path":f=e.path;break;case"file.parent":f=((c=e.parent)==null?void 0:c.name)||"";break;case"file.basename":f=e.basename;break;case"title":case"aliases":break;default:{let h=s.frontmatter[m];h!=null&&(f=Array.isArray(h)?h.join(" "):String(h));break}}f&&(t+=` ${f}`)}}return t}renderSuggestion(e,t){var a,o,l,c;let n=e.item;if(t.empty(),!(n instanceof _l.TFile)){t.textContent=n.name;return}let i=t.createDiv({cls:"project-suggestion"}),s=((l=(o=(a=this.plugin.settings)==null?void 0:a.projectAutosuggest)==null?void 0:o.rows)!=null?l:[]).slice(0,3);if(s.length===0){i.createSpan({cls:"project-name",text:n.basename});return}try{let d=this.app.metadataCache.getFileCache(n),u=(d==null?void 0:d.frontmatter)||{},p=this.plugin.fieldMapper.mapFromFrontmatter(u,n.path,this.plugin.settings.storeTitleInFilename),m=typeof p.title=="string"?p.title:"",f=(0,_l.parseFrontMatterAliases)(u)||[],h=Array.isArray(f)?f.filter(T=>typeof T=="string"):[],g={basename:n.basename,name:n.name,path:n.path,parent:((c=n.parent)==null?void 0:c.path)||"",title:m,aliases:h,frontmatter:u},y=new wu({getFrontmatter:()=>u});i.createDiv({cls:"project-name",text:n.basename});let k=y.buildMetadataRows(s,g,Pl);for(let T of k){let w=i.createDiv({cls:"project-meta"});w.textContent=T}}catch(d){console.error("Error rendering project suggestion:",d),i.createSpan({cls:"project-name",text:n.basename})}}onChooseItem(e,t){this.onChoose(e)}}});function Ml(r,e,t,n,i={}){var p;let{cssClass:s="internal-link",hoverSource:a="tasknotes-property-link",showErrorNotices:o=!1,onPrimaryNavigate:l}=i,c=(p=n.sourcePath)!=null?p:"",d=dn(e),u=r.createEl("a",{cls:s,text:t,attr:{"data-href":d,role:"link",tabindex:"0"}});u.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),(async()=>{try{if(m.ctrlKey||m.metaKey){n.workspace.openLinkText(d,c,!0);return}if(l&&await l(d,m)!==!1)return;let f=n.metadataCache.getFirstLinkpathDest(d,c)||n.metadataCache.getFirstLinkpathDest(d,"");f instanceof xu.TFile?await n.workspace.getLeaf(!1).openFile(f):o&&new xu.Notice(`Note "${t}" not found`)}catch(f){console.error("[TaskNotes] Error opening internal link:",{filePath:e,error:f}),o&&new xu.Notice(`Failed to open note "${t}"`)}})()}),u.addEventListener("auxclick",m=>{m.button===1&&(m.preventDefault(),m.stopPropagation(),(async()=>{try{(n.metadataCache.getFirstLinkpathDest(d,c)||n.metadataCache.getFirstLinkpathDest(d,""))instanceof xu.TFile&&n.workspace.openLinkText(d,c,!0)}catch(f){console.error("[TaskNotes] Error opening internal link:",{filePath:e,error:f})}})())}),u.addEventListener("keydown",m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),u.click())}),u.addEventListener("mouseover",m=>{let f=n.metadataCache.getFirstLinkpathDest(d,c)||n.metadataCache.getFirstLinkpathDest(d,"");if(f instanceof xu.TFile){let h={event:m,source:a,hoverParent:r,targetEl:u,linktext:d,sourcePath:c||f.path};n.workspace.trigger("hover-link",h)}})}function JD(r,e,t,n){let i=0,s;for(;(s=Q$e.exec(e))!==null;){let[o,l,c,d]=s,u=s.index;if(u>i&&r.appendChild(activeDocument.createTextNode(e.slice(i,u))),l){let p=l,m=p,f=p;if(p.includes("|")){let[h,g]=p.split("|");m=h,f=g}Ml(r,m,f,t)}else if(c&&d){let p=String(d).trim(),m=String(c).trim();/^[a-z]+:\/\//i.test(p)?r.createEl("a",{text:m,attr:{href:p,target:"_blank",rel:"noopener"}}).classList.add("external-link"):Ml(r,p,m,t)}i=u+o.length}let a=e.slice(i);if(a&&(n!=null&&n.onTagClick)){let o=/(^|\s)(#[\p{L}\p{N}\p{M}_/-]+)/gu,l=0,c;for(;(c=o.exec(a))!==null;){let[,d,u]=c,p=c.index;p>l&&r.appendChild(activeDocument.createTextNode(a.slice(l,p))),d&&r.appendChild(activeDocument.createTextNode(d));let m=r.createEl("a",{cls:"tag",text:u,attr:{href:u,role:"button",tabindex:"0","data-tn-click-exclude":"true"}});m.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation(),n.onTagClick(u,f)}),m.addEventListener("keydown",f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),f.stopPropagation(),n.onTagClick(u,f))}),l=p+d.length+u.length}l0}function X$e(r){return!r||typeof r!="string"?!1:/^\[([^\]]*)\]\(([^)]+)\)$/.test(r)}function eje(r){let e=r.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(!e)return null;let t=e[1].trim(),n=e[2].trim(),i=dn(n);return{displayText:t,filePath:i}}function Lne(r,e,t){var u,p;let n=(u=t.sourcePath)!=null?u:"",i=dn(r),s=t.metadataCache.getFirstLinkpathDest(i,n)||t.metadataCache.getFirstLinkpathDest(i,"");if(!(s instanceof xu.TFile))return e;let a=t.metadataCache.getCache(s.path),o=(p=a==null?void 0:a.frontmatter)==null?void 0:p.title;if(typeof o!="string"||o.trim().length===0)return e;let l=(e==null?void 0:e.trim())||"",c=s.name,d=s.basename;return l===""||l===c||l===d||l===s.path||l===i?o:e}function XD(r,e,t,n={}){r.innerHTML="",e.flat(2).filter(s=>s!=null&&typeof s=="string").forEach((s,a)=>{if(a>0&&r.appendChild(activeDocument.createTextNode(", ")),r.appendChild(activeDocument.createTextNode("+")),J$e(s)){let o=s.slice(2,-2),l=o,c=o;if(o.includes("|")){let u=o.split("|");l=u[0].trim(),c=u[1].trim()}let d=Lne(l,c,t);Ml(r,l,d,t,{cssClass:"task-card__project-link internal-link",hoverSource:"tasknotes-project-link",showErrorNotices:!0,onPrimaryNavigate:n.onPrimaryNavigate})}else if(X$e(s)){let o=eje(s);if(o){let l=Lne(o.filePath,o.displayText,t);Ml(r,o.filePath,l,t,{cssClass:"task-card__project-link internal-link",hoverSource:"tasknotes-project-link",showErrorNotices:!0,onPrimaryNavigate:n.onPrimaryNavigate})}else r.appendChild(activeDocument.createTextNode(s))}else r.appendChild(activeDocument.createTextNode(s))})}var xu,Q$e,vT=v(()=>{xu=require("obsidian");Bo();Q$e=/\[\[([^[\]]+)\]\]|\[([^\]]+)\]\(([^)]+)\)|<(https?:\/\/[^\s>]+)>|\[([^\]]+)\]\s*\[([^\]]*)\]/g});var Fne=v(()=>{});var $ne,d1=v(()=>{$ne={triggers:[{propertyId:"tags",trigger:"#",enabled:!0},{propertyId:"contexts",trigger:"@",enabled:!0},{propertyId:"projects",trigger:"+",enabled:!0},{propertyId:"status",trigger:"*",enabled:!0},{propertyId:"priority",trigger:"!",enabled:!1}]}});var jne,zne=v(()=>{jne={code:"en",name:"English",chronoLocale:"en",dateTriggers:{due:["due","deadline","must be done by","by"],scheduled:["scheduled for","start on","begin on","work on","on","scheduled","start"]},recurrence:{frequencies:{daily:["daily","every day"],weekly:["weekly","every week"],monthly:["monthly","every month"],yearly:["yearly","annually","every year"]},every:["every"],other:["other"],weekdays:{monday:["monday"],tuesday:["tuesday"],wednesday:["wednesday"],thursday:["thursday"],friday:["friday"],saturday:["saturday"],sunday:["sunday"]},pluralWeekdays:{monday:["mondays"],tuesday:["tuesdays"],wednesday:["wednesdays"],thursday:["thursdays"],friday:["fridays"],saturday:["saturdays"],sunday:["sundays"]},ordinals:{first:["first"],second:["second"],third:["third"],fourth:["fourth"],last:["last"]},periods:{day:["day","days"],week:["week","weeks"],month:["month","months"],year:["year","years"]}},timeEstimate:{hours:["h","hr","hrs","hour","hours"],minutes:["m","min","mins","minute","minutes"]},fallbackStatus:{open:["todo","to do","open"],inProgress:["in progress","in-progress","doing"],done:["done","completed","finished"],cancelled:["cancelled","canceled"],waiting:["waiting","blocked","on hold"]},fallbackPriority:{urgent:["urgent","critical","highest"],high:["high","important"],normal:["medium","normal"],low:["low","minor"]}}});var Bne,qne=v(()=>{Bne={code:"es",name:"Espa\xF1ol",chronoLocale:"es",dateTriggers:{due:["vence","fecha l\xEDmite","debe terminarse","para el","antes del"],scheduled:["programado para","programado el","comenzar el","empezar el","trabajar en","el"]},recurrence:{frequencies:{daily:["diario","diaria","diariamente","cada d\xEDa","todos los d\xEDas","a diario"],weekly:["semanal","semanalmente","cada semana","todas las semanas","por semana"],monthly:["mensual","mensualmente","cada mes","todos los meses","por mes"],yearly:["anual","anualmente","cada a\xF1o","todos los a\xF1os","por a\xF1o"]},every:["cada","todos los","todas las"],other:["otro","otra"],weekdays:{monday:["lunes"],tuesday:["martes"],wednesday:["mi\xE9rcoles"],thursday:["jueves"],friday:["viernes"],saturday:["s\xE1bado"],sunday:["domingo"]},pluralWeekdays:{monday:["lunes"],tuesday:["martes"],wednesday:["mi\xE9rcoles"],thursday:["jueves"],friday:["viernes"],saturday:["s\xE1bados"],sunday:["domingos"]},ordinals:{first:["primer","primera","primero"],second:["segundo","segunda"],third:["tercer","tercera","tercero"],fourth:["cuarto","cuarta"],last:["\xFAltimo","\xFAltima"]},periods:{day:["d\xEDa","d\xEDas"],week:["semana","semanas"],month:["mes","meses"],year:["a\xF1o","a\xF1os"]}},timeEstimate:{hours:["h","hr","hrs","hora","horas"],minutes:["m","min","mins","minuto","minutos"]},fallbackStatus:{open:["pendiente","por hacer","abierto","todo"],inProgress:["en progreso","en curso","haciendo","trabajando"],done:["hecho","terminado","completado","finalizado"],cancelled:["cancelado","anulado"],waiting:["esperando","bloqueado","en espera"]},fallbackPriority:{urgent:["urgente","cr\xEDtico","cr\xEDtica","m\xE1ximo","m\xE1xima","prioritario","prioritaria"],high:["alto","alta","importante","elevado","elevada"],normal:["medio","media","normal","regular","est\xE1ndar"],low:["bajo","baja","menor","m\xEDnimo","m\xEDnima"]}}});var Hne,Une=v(()=>{Hne={code:"fr",name:"Fran\xE7ais",chronoLocale:"fr",dateTriggers:{due:["\xE9ch\xE9ance","date limite","doit \xEAtre termin\xE9","pour le","avant le"],scheduled:["programm\xE9 pour","programm\xE9 le","commencer le","d\xE9buter le","travailler sur","le"]},recurrence:{frequencies:{daily:["quotidien","quotidienne","quotidiennement","chaque jour","tous les jours","journalier","journali\xE8re"],weekly:["hebdomadaire","chaque semaine","toutes les semaines","par semaine"],monthly:["mensuel","mensuelle","mensuellement","chaque mois","tous les mois","par mois"],yearly:["annuel","annuelle","annuellement","chaque ann\xE9e","tous les ans","par an","par ann\xE9e"]},every:["chaque","tous les","toutes les"],other:["autre"],weekdays:{monday:["lundi"],tuesday:["mardi"],wednesday:["mercredi"],thursday:["jeudi"],friday:["vendredi"],saturday:["samedi"],sunday:["dimanche"]},pluralWeekdays:{monday:["lundis"],tuesday:["mardis"],wednesday:["mercredis"],thursday:["jeudis"],friday:["vendredis"],saturday:["samedis"],sunday:["dimanches"]},ordinals:{first:["premier","premi\xE8re"],second:["deuxi\xE8me","second","seconde"],third:["troisi\xE8me"],fourth:["quatri\xE8me"],last:["dernier","derni\xE8re"]},periods:{day:["jour","jours"],week:["semaine","semaines"],month:["mois"],year:["an","ans","ann\xE9e","ann\xE9es"]}},timeEstimate:{hours:["h","hr","hrs","heure","heures"],minutes:["m","min","mins","minute","minutes"]},fallbackStatus:{open:["\xE0 faire","ouvert","en attente","todo"],inProgress:["en cours","en progression","en train de faire"],done:["termin\xE9","fini","accompli","fait"],cancelled:["annul\xE9","abandonn\xE9"],waiting:["en attente","bloqu\xE9","suspendu"]},fallbackPriority:{urgent:["urgent","urgente","critique","maximum","prioritaire"],high:["\xE9lev\xE9","\xE9lev\xE9e","haut","haute","important","importante","sup\xE9rieur","sup\xE9rieure"],normal:["moyen","moyenne","normal","normale","standard","r\xE9gulier","r\xE9guli\xE8re"],low:["faible","bas","basse","mineur","mineure","minimum"]}}});var Vne,Wne=v(()=>{Vne={code:"de",name:"Deutsch",chronoLocale:"de",dateTriggers:{due:["f\xE4llig","termin","abgabe","deadline","bis zum","bis"],scheduled:["geplant f\xFCr","geplant am","beginnen am","anfangen am","arbeiten an","am","geplant","starten"]},recurrence:{frequencies:{daily:["t\xE4glich","jeden Tag","alle Tage","tagaus tagein"],weekly:["w\xF6chentlich","jede Woche","alle Wochen"],monthly:["monatlich","jeden Monat","alle Monate"],yearly:["j\xE4hrlich","jedes Jahr","alle Jahre"]},every:["jede","jeden","jedes","alle"],other:["andere","anderen","anderes"],weekdays:{monday:["montag"],tuesday:["dienstag"],wednesday:["mittwoch"],thursday:["donnerstag"],friday:["freitag"],saturday:["samstag"],sunday:["sonntag"]},pluralWeekdays:{monday:["montags"],tuesday:["dienstags"],wednesday:["mittwochs"],thursday:["donnerstags"],friday:["freitags"],saturday:["samstags"],sunday:["sonntags"]},ordinals:{first:["erste","ersten","erster"],second:["zweite","zweiten","zweiter"],third:["dritte","dritten","dritter"],fourth:["vierte","vierten","vierter"],last:["letzte","letzten","letzter"]},periods:{day:["tag","tage"],week:["woche","wochen"],month:["monat","monate"],year:["jahr","jahre"]}},timeEstimate:{hours:["h","std","stunde","stunden"],minutes:["m","min","minute","minuten"]},fallbackStatus:{open:["offen","zu erledigen","ausstehend","todo"],inProgress:["in bearbeitung","wird bearbeitet","l\xE4uft","in arbeit"],done:["erledigt","fertig","abgeschlossen","gemacht"],cancelled:["abgebrochen","storniert","abgesagt"],waiting:["wartend","warten","blockiert","pausiert"]},fallbackPriority:{urgent:["dringend","eilig","kritisch","sofort","h\xF6chste"],high:["hoch","hohe","wichtig","priorit\xE4r"],normal:["normal","mittel","mittlere","standard"],low:["niedrig","niedrige","gering","geringe"]}}});var Yne,Gne=v(()=>{Yne={code:"ru",name:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",chronoLocale:"ru",dateTriggers:{due:["\u0441\u0440\u043E\u043A","\u0434\u0435\u0434\u043B\u0430\u0439\u043D","\u0434\u043E","\u043A","\u0441\u0434\u0430\u0442\u044C \u0434\u043E"],scheduled:["\u0437\u0430\u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u043D\u0430","\u043D\u0430\u0447\u0430\u0442\u044C","\u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u043D\u0430\u0434","\u043D\u0430"]},recurrence:{frequencies:{daily:["\u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E","\u043A\u0430\u0436\u0434\u044B\u0439 \u0434\u0435\u043D\u044C","\u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u044B\u0439","\u043A\u0430\u0436\u0434\u043E\u0434\u043D\u0435\u0432\u043D\u044B\u0439"],weekly:["\u0435\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u043E","\u043A\u0430\u0436\u0434\u0443\u044E \u043D\u0435\u0434\u0435\u043B\u044E","\u0435\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u044B\u0439"],monthly:["\u0435\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u043E","\u043A\u0430\u0436\u0434\u044B\u0439 \u043C\u0435\u0441\u044F\u0446","\u0435\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439"],yearly:["\u0435\u0436\u0435\u0433\u043E\u0434\u043D\u043E","\u043A\u0430\u0436\u0434\u044B\u0439 \u0433\u043E\u0434","\u0435\u0436\u0435\u0433\u043E\u0434\u043D\u044B\u0439"]},every:["\u043A\u0430\u0436\u0434\u044B\u0439","\u043A\u0430\u0436\u0434\u0443\u044E","\u043A\u0430\u0436\u0434\u043E\u0435","\u0432\u0441\u0435"],other:["\u0434\u0440\u0443\u0433\u043E\u0439","\u0434\u0440\u0443\u0433\u0443\u044E","\u0434\u0440\u0443\u0433\u043E\u0435"],weekdays:{monday:["\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A"],tuesday:["\u0432\u0442\u043E\u0440\u043D\u0438\u043A"],wednesday:["\u0441\u0440\u0435\u0434\u0430"],thursday:["\u0447\u0435\u0442\u0432\u0435\u0440\u0433"],friday:["\u043F\u044F\u0442\u043D\u0438\u0446\u0430"],saturday:["\u0441\u0443\u0431\u0431\u043E\u0442\u0430"],sunday:["\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435"]},pluralWeekdays:{monday:["\u043F\u043E \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430\u043C"],tuesday:["\u043F\u043E \u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430\u043C"],wednesday:["\u043F\u043E \u0441\u0440\u0435\u0434\u0430\u043C"],thursday:["\u043F\u043E \u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430\u043C"],friday:["\u043F\u043E \u043F\u044F\u0442\u043D\u0438\u0446\u0430\u043C"],saturday:["\u043F\u043E \u0441\u0443\u0431\u0431\u043E\u0442\u0430\u043C"],sunday:["\u043F\u043E \u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F\u043C"]},ordinals:{first:["\u043F\u0435\u0440\u0432\u044B\u0439","\u043F\u0435\u0440\u0432\u0430\u044F","\u043F\u0435\u0440\u0432\u043E\u0435"],second:["\u0432\u0442\u043E\u0440\u043E\u0439","\u0432\u0442\u043E\u0440\u0430\u044F","\u0432\u0442\u043E\u0440\u043E\u0435"],third:["\u0442\u0440\u0435\u0442\u0438\u0439","\u0442\u0440\u0435\u0442\u044C\u044F","\u0442\u0440\u0435\u0442\u044C\u0435"],fourth:["\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044B\u0439","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044F","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435"],last:["\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435"]},periods:{day:["\u0434\u0435\u043D\u044C","\u0434\u043D\u0438"],week:["\u043D\u0435\u0434\u0435\u043B\u044F","\u043D\u0435\u0434\u0435\u043B\u0438"],month:["\u043C\u0435\u0441\u044F\u0446","\u043C\u0435\u0441\u044F\u0446\u044B"],year:["\u0433\u043E\u0434","\u0433\u043E\u0434\u044B"]}},timeEstimate:{hours:["\u0447","\u0447\u0430\u0441","\u0447\u0430\u0441\u0430","\u0447\u0430\u0441\u043E\u0432"],minutes:["\u043C","\u043C\u0438\u043D","\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u044B","\u043C\u0438\u043D\u0443\u0442"]},fallbackStatus:{open:["\u043E\u0442\u043A\u0440\u044B\u0442\u043E","\u043A \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044E","\u043D\u043E\u0432\u043E\u0435","todo"],inProgress:["\u0432 \u0440\u0430\u0431\u043E\u0442\u0435","\u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","\u0432 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0435"],done:["\u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E","\u0433\u043E\u0442\u043E\u0432\u043E","\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","\u0441\u0434\u0435\u043B\u0430\u043D\u043E"],cancelled:["\u043E\u0442\u043C\u0435\u043D\u0435\u043D\u043E","\u043E\u0442\u043C\u0435\u043D\u0451\u043D","\u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430"],waiting:["\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","\u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D\u043E","\u043D\u0430 \u043F\u0430\u0443\u0437\u0435"]},fallbackPriority:{urgent:["\u0441\u0440\u043E\u0447\u043D\u043E","\u043A\u0440\u0438\u0442\u0438\u0447\u043D\u043E","\u044D\u043A\u0441\u0442\u0440\u0435\u043D\u043D\u043E","\u043D\u0435\u043C\u0435\u0434\u043B\u0435\u043D\u043D\u043E"],high:["\u0432\u044B\u0441\u043E\u043A\u0438\u0439","\u0432\u044B\u0441\u043E\u043A\u0430\u044F","\u0432\u0430\u0436\u043D\u043E","\u043F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u043E"],normal:["\u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u044B\u0439","\u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u0430\u044F","\u0441\u0440\u0435\u0434\u043D\u0438\u0439","\u0441\u0440\u0435\u0434\u043D\u044F\u044F"],low:["\u043D\u0438\u0437\u043A\u0438\u0439","\u043D\u0438\u0437\u043A\u0430\u044F","\u043D\u0435\u0432\u0430\u0436\u043D\u043E","\u043C\u043E\u0436\u043D\u043E \u043F\u043E\u0437\u0436\u0435"]}}});var Kne,Zne=v(()=>{Kne={code:"zh",name:"\u4E2D\u6587",chronoLocale:"zh",dateTriggers:{due:["\u622A\u6B62","\u5230\u671F","\u671F\u9650","\u5728","\u4E4B\u524D"],scheduled:["\u5B89\u6392\u5728","\u8BA1\u5212\u5728","\u5F00\u59CB\u5728","\u5728"]},recurrence:{frequencies:{daily:["\u6BCF\u5929","\u6BCF\u65E5","\u5929\u5929","\u65E5\u5E38"],weekly:["\u6BCF\u5468","\u6BCF\u661F\u671F","\u5468\u5468"],monthly:["\u6BCF\u6708","\u6BCF\u4E2A\u6708","\u6708\u6708"],yearly:["\u6BCF\u5E74","\u5E74\u5E74","\u6BCF\u4E00\u5E74"]},every:["\u6BCF","\u6BCF\u4E2A","\u6BCF\u4E00\u4E2A"],other:["\u5176\u4ED6","\u53E6\u4E00\u4E2A"],weekdays:{monday:["\u5468\u4E00","\u661F\u671F\u4E00","\u793C\u62DC\u4E00"],tuesday:["\u5468\u4E8C","\u661F\u671F\u4E8C","\u793C\u62DC\u4E8C"],wednesday:["\u5468\u4E09","\u661F\u671F\u4E09","\u793C\u62DC\u4E09"],thursday:["\u5468\u56DB","\u661F\u671F\u56DB","\u793C\u62DC\u56DB"],friday:["\u5468\u4E94","\u661F\u671F\u4E94","\u793C\u62DC\u4E94"],saturday:["\u5468\u516D","\u661F\u671F\u516D","\u793C\u62DC\u516D"],sunday:["\u5468\u65E5","\u661F\u671F\u65E5","\u793C\u62DC\u65E5"]},pluralWeekdays:{monday:["\u5468\u4E00","\u661F\u671F\u4E00","\u793C\u62DC\u4E00"],tuesday:["\u5468\u4E8C","\u661F\u671F\u4E8C","\u793C\u62DC\u4E8C"],wednesday:["\u5468\u4E09","\u661F\u671F\u4E09","\u793C\u62DC\u4E09"],thursday:["\u5468\u56DB","\u661F\u671F\u56DB","\u793C\u62DC\u56DB"],friday:["\u5468\u4E94","\u661F\u671F\u4E94","\u793C\u62DC\u4E94"],saturday:["\u5468\u516D","\u661F\u671F\u516D","\u793C\u62DC\u516D"],sunday:["\u5468\u65E5","\u661F\u671F\u65E5","\u793C\u62DC\u65E5"]},ordinals:{first:["\u7B2C\u4E00\u4E2A","\u7B2C\u4E00","\u9996\u4E2A"],second:["\u7B2C\u4E8C\u4E2A","\u7B2C\u4E8C"],third:["\u7B2C\u4E09\u4E2A","\u7B2C\u4E09"],fourth:["\u7B2C\u56DB\u4E2A","\u7B2C\u56DB"],last:["\u6700\u540E\u4E00\u4E2A","\u6700\u540E","\u672B\u5C3E"]},periods:{day:["\u5929","\u65E5"],week:["\u5468","\u661F\u671F"],month:["\u6708","\u4E2A\u6708"],year:["\u5E74"]}},timeEstimate:{hours:["\u5C0F\u65F6","\u65F6","\u4E2A\u5C0F\u65F6"],minutes:["\u5206\u949F","\u5206","\u4E2A\u5206\u949F"]},fallbackStatus:{open:["\u5F85\u529E","\u672A\u5B8C\u6210","\u5F00\u653E","\u65B0\u5EFA"],inProgress:["\u8FDB\u884C\u4E2D","\u6B63\u5728\u5904\u7406","\u5904\u7406\u4E2D","\u5DE5\u4F5C\u4E2D"],done:["\u5B8C\u6210","\u5DF2\u5B8C\u6210","\u7ED3\u675F","\u641E\u5B9A"],cancelled:["\u53D6\u6D88","\u5DF2\u53D6\u6D88","\u5E9F\u5F03"],waiting:["\u7B49\u5F85","\u6682\u505C","\u963B\u585E","\u5F85\u5B9A"]},fallbackPriority:{urgent:["\u7D27\u6025","\u6025\u8FEB","\u7ACB\u5373","\u9A6C\u4E0A"],high:["\u9AD8","\u91CD\u8981","\u9AD8\u4F18\u5148\u7EA7"],normal:["\u6B63\u5E38","\u666E\u901A","\u4E2D\u7B49","\u6807\u51C6"],low:["\u4F4E","\u4E0D\u91CD\u8981","\u4F4E\u4F18\u5148\u7EA7","\u6B21\u8981"]}}});var Qne,Jne=v(()=>{Qne={code:"ja",name:"\u65E5\u672C\u8A9E",chronoLocale:"ja",dateTriggers:{due:["\u671F\u9650","\u7DE0\u5207","\u3006\u5207","\u307E\u3067","\u307E\u3067\u306B","\u306B"],scheduled:["\u4E88\u5B9A","\u8A08\u753B","\u958B\u59CB","\u304B\u3089","\u306B\u958B\u59CB","\u3092\u958B\u59CB"]},recurrence:{frequencies:{daily:["\u6BCE\u65E5","\u65E5\u3005","\u6BCE\u65E5\u6BCE\u65E5","\u9023\u65E5"],weekly:["\u6BCE\u9031","\u9031\u6BCE","\u9031\u4E00","\u6BCE\u9031\u6BCE\u9031"],monthly:["\u6BCE\u6708","\u6708\u6BCE","\u6708\u4E00","\u6BCE\u6708\u6BCE\u6708"],yearly:["\u6BCE\u5E74","\u5E74\u6BCE","\u5E74\u4E00","\u6BCE\u5E74\u6BCE\u5E74","\u5E74\u6B21"]},every:["\u6BCE","\u5404","\u5168\u3066"],other:["\u4ED6\u306E","\u5225\u306E","\u7570\u306A\u308B"],weekdays:{monday:["\u6708\u66DC\u65E5","\u6708\u66DC","\u6708","\u3052\u3064\u3088\u3046\u3073"],tuesday:["\u706B\u66DC\u65E5","\u706B\u66DC","\u706B","\u304B\u3088\u3046\u3073"],wednesday:["\u6C34\u66DC\u65E5","\u6C34\u66DC","\u6C34","\u3059\u3044\u3088\u3046\u3073"],thursday:["\u6728\u66DC\u65E5","\u6728\u66DC","\u6728","\u3082\u304F\u3088\u3046\u3073"],friday:["\u91D1\u66DC\u65E5","\u91D1\u66DC","\u91D1","\u304D\u3093\u3088\u3046\u3073"],saturday:["\u571F\u66DC\u65E5","\u571F\u66DC","\u571F","\u3069\u3088\u3046\u3073"],sunday:["\u65E5\u66DC\u65E5","\u65E5\u66DC","\u65E5","\u306B\u3061\u3088\u3046\u3073"]},pluralWeekdays:{monday:["\u6708\u66DC\u65E5","\u6708\u66DC","\u6708","\u3052\u3064\u3088\u3046\u3073"],tuesday:["\u706B\u66DC\u65E5","\u706B\u66DC","\u706B","\u304B\u3088\u3046\u3073"],wednesday:["\u6C34\u66DC\u65E5","\u6C34\u66DC","\u6C34","\u3059\u3044\u3088\u3046\u3073"],thursday:["\u6728\u66DC\u65E5","\u6728\u66DC","\u6728","\u3082\u304F\u3088\u3046\u3073"],friday:["\u91D1\u66DC\u65E5","\u91D1\u66DC","\u91D1","\u304D\u3093\u3088\u3046\u3073"],saturday:["\u571F\u66DC\u65E5","\u571F\u66DC","\u571F","\u3069\u3088\u3046\u3073"],sunday:["\u65E5\u66DC\u65E5","\u65E5\u66DC","\u65E5","\u306B\u3061\u3088\u3046\u3073"]},ordinals:{first:["\u6700\u521D\u306E","\u7B2C\u4E00\u306E","\u4E00\u756A\u76EE\u306E","\u521D\u56DE"],second:["\u4E8C\u756A\u76EE\u306E","\u7B2C\u4E8C\u306E","\u6B21\u306E"],third:["\u4E09\u756A\u76EE\u306E","\u7B2C\u4E09\u306E"],fourth:["\u56DB\u756A\u76EE\u306E","\u7B2C\u56DB\u306E"],last:["\u6700\u5F8C\u306E","\u6700\u7D42\u306E","\u7D42\u308F\u308A\u306E"]},periods:{day:["\u65E5","\u65E5\u9593"],week:["\u9031","\u9031\u9593"],month:["\u6708","\u6708\u9593","\u30F6\u6708"],year:["\u5E74","\u5E74\u9593"]}},timeEstimate:{hours:["\u6642\u9593","\u6642","\u3058\u304B\u3093"],minutes:["\u5206","\u5206\u9593","\u3075\u3093","\u3077\u3093"]},fallbackStatus:{open:["\u672A\u7740\u624B","\u65B0\u898F","\u30AA\u30FC\u30D7\u30F3","\u958B\u59CB\u524D","\u5F85\u6A5F"],inProgress:["\u9032\u884C\u4E2D","\u4F5C\u696D\u4E2D","\u5B9F\u884C\u4E2D","\u51E6\u7406\u4E2D","\u9032\u884C"],done:["\u5B8C\u4E86","\u7D42\u4E86","\u6E08\u307F","\u7D42\u308F\u308A","\u9054\u6210"],cancelled:["\u30AD\u30E3\u30F3\u30BB\u30EB","\u4E2D\u6B62","\u53D6\u6D88","\u5EC3\u6B62","\u505C\u6B62"],waiting:["\u5F85\u6A5F","\u4FDD\u7559","\u30D6\u30ED\u30C3\u30AF","\u4E00\u6642\u505C\u6B62","\u5F85\u3061"]},fallbackPriority:{urgent:["\u7DCA\u6025","\u81F3\u6025","\u6025\u52D9","\u6700\u512A\u5148","\u3059\u3050\u306B"],high:["\u9AD8","\u91CD\u8981","\u9AD8\u512A\u5148\u5EA6","\u91CD\u70B9"],normal:["\u666E\u901A","\u901A\u5E38","\u6A19\u6E96","\u4E00\u822C","\u30CE\u30FC\u30DE\u30EB"],low:["\u4F4E","\u8EFD\u5FAE","\u5F8C\u56DE\u3057","\u4F4E\u512A\u5148\u5EA6","\u4F59\u88D5"]}}});var Xne,eie=v(()=>{Xne={code:"it",name:"Italiano",chronoLocale:"it",dateTriggers:{due:["scadenza","entro","entro il","deve essere fatto entro","per il","termine"],scheduled:["programmato per","programmato il","iniziare il","lavorare su","il","per"]},recurrence:{frequencies:{daily:["giornaliero","giornaliera","quotidiano","quotidiana","ogni giorno","tutti i giorni","giornalmente"],weekly:["settimanale","ogni settimana","tutte le settimane","settimanalmente","alla settimana"],monthly:["mensile","ogni mese","tutti i mesi","mensilmente","al mese"],yearly:["annuale","ogni anno","tutti gli anni","annualmente","all'anno"]},every:["ogni","tutti i","tutte le"],other:["altro","altra","altri","altre"],weekdays:{monday:["luned\xEC"],tuesday:["marted\xEC"],wednesday:["mercoled\xEC"],thursday:["gioved\xEC"],friday:["venerd\xEC"],saturday:["sabato"],sunday:["domenica"]},pluralWeekdays:{monday:["luned\xEC"],tuesday:["marted\xEC"],wednesday:["mercoled\xEC"],thursday:["gioved\xEC"],friday:["venerd\xEC"],saturday:["sabati"],sunday:["domeniche"]},ordinals:{first:["primo","prima"],second:["secondo","seconda"],third:["terzo","terza"],fourth:["quarto","quarta"],last:["ultimo","ultima"]},periods:{day:["giorno","giorni"],week:["settimana","settimane"],month:["mese","mesi"],year:["anno","anni"]}},timeEstimate:{hours:["h","hr","ore","ora","o"],minutes:["m","min","minuto","minuti"]},fallbackStatus:{open:["da fare","aperto","pendente","todo","in sospeso"],inProgress:["in corso","in progresso","facendo","lavorando"],done:["fatto","completato","finito","terminato","chiuso"],cancelled:["cancellato","annullato","rimosso"],waiting:["in attesa","aspettando","bloccato","fermo"]},fallbackPriority:{urgent:["urgente","critico","critica","massimo","massima","prioritario","prioritaria"],high:["alto","alta","importante","elevato","elevata"],normal:["medio","media","normale","regolare","standard"],low:["basso","bassa","minore","minimo","minima"]}}});var tie,rie=v(()=>{tie={code:"nl",name:"Nederlands",chronoLocale:"nl",dateTriggers:{due:["vervalt op","deadline","moet klaar zijn op","tegen","uiterlijk","voor"],scheduled:["gepland voor","gepland op","beginnen op","werken aan","op","voor"]},recurrence:{frequencies:{daily:["dagelijks","elke dag","alle dagen","per dag"],weekly:["wekelijks","elke week","alle weken","per week"],monthly:["maandelijks","elke maand","alle maanden","per maand"],yearly:["jaarlijks","elk jaar","alle jaren","per jaar"]},every:["elke","alle","iedere"],other:["andere","ander"],weekdays:{monday:["maandag"],tuesday:["dinsdag"],wednesday:["woensdag"],thursday:["donderdag"],friday:["vrijdag"],saturday:["zaterdag"],sunday:["zondag"]},pluralWeekdays:{monday:["maandagen"],tuesday:["dinsdagen"],wednesday:["woensdagen"],thursday:["donderdagen"],friday:["vrijdagen"],saturday:["zaterdagen"],sunday:["zondagen"]},ordinals:{first:["eerste"],second:["tweede"],third:["derde"],fourth:["vierde"],last:["laatste"]},periods:{day:["dag","dagen"],week:["week","weken"],month:["maand","maanden"],year:["jaar","jaren"]}},timeEstimate:{hours:["u","uur","uren","h"],minutes:["m","min","minuut","minuten"]},fallbackStatus:{open:["te doen","open","nog te doen","todo","openstaand"],inProgress:["bezig","in behandeling","aan het werk","lopend","in uitvoering"],done:["klaar","voltooid","gedaan","afgerond","gesloten"],cancelled:["geannuleerd","afgezegd","ingetrokken"],waiting:["wachtend","in de wacht","geblokkeerd","uitgesteld"]},fallbackPriority:{urgent:["urgent","kritiek","hoogste","spoed","direct"],high:["hoog","hoge","belangrijk","belangrijke"],normal:["normaal","normale","gemiddeld","standaard"],low:["laag","lage","klein","kleine","onbelangrijk"]}}});var nie,iie=v(()=>{nie={code:"pt",name:"Portugu\xEAs",chronoLocale:"pt",dateTriggers:{due:["vencimento","prazo","deve estar pronto at\xE9","at\xE9","para","limite"],scheduled:["programado para","agendado para","come\xE7ar em","trabalhar em","em","no"]},recurrence:{frequencies:{daily:["di\xE1rio","di\xE1ria","diariamente","todos os dias","cada dia","por dia"],weekly:["semanal","semanalmente","toda semana","todas as semanas","por semana"],monthly:["mensal","mensalmente","todo m\xEAs","todos os meses","por m\xEAs"],yearly:["anual","anualmente","todo ano","todos os anos","por ano"]},every:["todo","toda","todos","todas","cada"],other:["outro","outra","outros","outras"],weekdays:{monday:["segunda","segunda-feira"],tuesday:["ter\xE7a","ter\xE7a-feira"],wednesday:["quarta","quarta-feira"],thursday:["quinta","quinta-feira"],friday:["sexta","sexta-feira"],saturday:["s\xE1bado"],sunday:["domingo"]},pluralWeekdays:{monday:["segundas","segundas-feiras"],tuesday:["ter\xE7as","ter\xE7as-feiras"],wednesday:["quartas","quartas-feiras"],thursday:["quintas","quintas-feiras"],friday:["sextas","sextas-feiras"],saturday:["s\xE1bados"],sunday:["domingos"]},ordinals:{first:["primeiro","primeira"],second:["segundo","segunda"],third:["terceiro","terceira"],fourth:["quarto","quarta"],last:["\xFAltimo","\xFAltima"]},periods:{day:["dia","dias"],week:["semana","semanas"],month:["m\xEAs","meses"],year:["ano","anos"]}},timeEstimate:{hours:["h","hr","hora","horas"],minutes:["m","min","minuto","minutos"]},fallbackStatus:{open:["a fazer","pendente","aberto","todo","por fazer"],inProgress:["em andamento","em progresso","fazendo","trabalhando","executando"],done:["feito","conclu\xEDdo","terminado","finalizado","completo"],cancelled:["cancelado","anulado","suspenso"],waiting:["aguardando","esperando","bloqueado","em espera"]},fallbackPriority:{urgent:["urgente","cr\xEDtico","cr\xEDtica","m\xE1ximo","m\xE1xima","priorit\xE1rio","priorit\xE1ria"],high:["alto","alta","importante","elevado","elevada"],normal:["m\xE9dio","m\xE9dia","normal","regular","padr\xE3o"],low:["baixo","baixa","menor","m\xEDnimo","m\xEDnima"]}}});var sie,aie=v(()=>{sie={code:"sv",name:"Svenska",chronoLocale:"sv",dateTriggers:{due:["f\xF6rfaller","deadline","m\xE5ste vara klar","senast","till","innan"],scheduled:["schemalagd","planerad f\xF6r","b\xF6rja","arbeta med","den","p\xE5"]},recurrence:{frequencies:{daily:["dagligen","varje dag","alla dagar","per dag"],weekly:["veckovis","varje vecka","alla veckor","per vecka"],monthly:["m\xE5nadsvis","varje m\xE5nad","alla m\xE5nader","per m\xE5nad"],yearly:["\xE5rligen","varje \xE5r","alla \xE5r","per \xE5r"]},every:["varje","alla","var"],other:["annan","annat","andra"],weekdays:{monday:["m\xE5ndag"],tuesday:["tisdag"],wednesday:["onsdag"],thursday:["torsdag"],friday:["fredag"],saturday:["l\xF6rdag"],sunday:["s\xF6ndag"]},pluralWeekdays:{monday:["m\xE5ndagar"],tuesday:["tisdagar"],wednesday:["onsdagar"],thursday:["torsdagar"],friday:["fredagar"],saturday:["l\xF6rdagar"],sunday:["s\xF6ndagar"]},ordinals:{first:["f\xF6rsta"],second:["andra"],third:["tredje"],fourth:["fj\xE4rde"],last:["sista"]},periods:{day:["dag","dagar"],week:["vecka","veckor"],month:["m\xE5nad","m\xE5nader"],year:["\xE5r"]}},timeEstimate:{hours:["t","tim","timme","timmar","h"],minutes:["m","min","minut","minuter"]},fallbackStatus:{open:["att g\xF6ra","\xF6ppen","kvar","todo","v\xE4ntande"],inProgress:["p\xE5g\xE5ende","arbetar","g\xF6r","i process","under arbete"],done:["klar","f\xE4rdig","slutf\xF6rd","avslutad","gjord"],cancelled:["avbruten","inst\xE4lld","avbokad"],waiting:["v\xE4ntar","blockerad","pausad","vilande"]},fallbackPriority:{urgent:["br\xE5dskande","kritisk","h\xF6gsta","akut","omedelbar"],high:["h\xF6g","viktig","f\xF6rh\xF6jd","prioriterad"],normal:["normal","medel","standard","vanlig"],low:["l\xE5g","mindre","minimal","obetydlig"]}}});var oie,lie=v(()=>{oie={code:"uk",name:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",chronoLocale:"uk",dateTriggers:{due:["\u0442\u0435\u0440\u043C\u0456\u043D","\u0434\u0435\u0434\u043B\u0430\u0439\u043D","\u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0433\u043E\u0442\u043E\u0432\u043E \u0434\u043E","\u0434\u043E","\u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435","\u043A\u0440\u0430\u0439\u043D\u0456\u0439 \u0442\u0435\u0440\u043C\u0456\u043D"],scheduled:["\u0437\u0430\u043F\u043B\u0430\u043D\u043E\u0432\u0430\u043D\u043E \u043D\u0430","\u0437\u0430\u043F\u043B\u0430\u043D\u043E\u0432\u0430\u043D\u0438\u0439","\u043F\u043E\u0447\u0430\u0442\u0438","\u043F\u0440\u0430\u0446\u044E\u0432\u0430\u0442\u0438 \u043D\u0430\u0434","\u043D\u0430","\u0432"]},recurrence:{frequencies:{daily:["\u0449\u043E\u0434\u043D\u044F","\u0449\u043E\u0434\u0435\u043D\u043D\u043E","\u043A\u043E\u0436\u0435\u043D \u0434\u0435\u043D\u044C","\u0432\u0441\u0456 \u0434\u043D\u0456","\u043D\u0430 \u0434\u0435\u043D\u044C"],weekly:["\u0449\u043E\u0442\u0438\u0436\u043D\u044F","\u0449\u043E\u0442\u0438\u0436\u043D\u0435\u0432\u043E","\u043A\u043E\u0436\u0435\u043D \u0442\u0438\u0436\u0434\u0435\u043D\u044C","\u0432\u0441\u0456 \u0442\u0438\u0436\u043D\u0456","\u043D\u0430 \u0442\u0438\u0436\u0434\u0435\u043D\u044C"],monthly:["\u0449\u043E\u043C\u0456\u0441\u044F\u0446\u044F","\u0449\u043E\u043C\u0456\u0441\u044F\u0447\u043D\u043E","\u043A\u043E\u0436\u0435\u043D \u043C\u0456\u0441\u044F\u0446\u044C","\u0432\u0441\u0456 \u043C\u0456\u0441\u044F\u0446\u0456","\u043D\u0430 \u043C\u0456\u0441\u044F\u0446\u044C"],yearly:["\u0449\u043E\u0440\u043E\u043A\u0443","\u0449\u043E\u0440\u0456\u0447\u043D\u043E","\u043A\u043E\u0436\u0435\u043D \u0440\u0456\u043A","\u0432\u0441\u0456 \u0440\u043E\u043A\u0438","\u043D\u0430 \u0440\u0456\u043A"]},every:["\u043A\u043E\u0436\u0435\u043D","\u043A\u043E\u0436\u043D\u0430","\u043A\u043E\u0436\u043D\u0435","\u0432\u0441\u0456"],other:["\u0456\u043D\u0448\u0438\u0439","\u0456\u043D\u0448\u0430","\u0456\u043D\u0448\u0435","\u0456\u043D\u0448\u0456"],weekdays:{monday:["\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A"],tuesday:["\u0432\u0456\u0432\u0442\u043E\u0440\u043E\u043A"],wednesday:["\u0441\u0435\u0440\u0435\u0434\u0430"],thursday:["\u0447\u0435\u0442\u0432\u0435\u0440"],friday:["\u043F'\u044F\u0442\u043D\u0438\u0446\u044F"],saturday:["\u0441\u0443\u0431\u043E\u0442\u0430"],sunday:["\u043D\u0435\u0434\u0456\u043B\u044F"]},pluralWeekdays:{monday:["\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043A\u0438"],tuesday:["\u0432\u0456\u0432\u0442\u043E\u0440\u043A\u0438"],wednesday:["\u0441\u0435\u0440\u0435\u0434\u0438"],thursday:["\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0438"],friday:["\u043F'\u044F\u0442\u043D\u0438\u0446\u0456"],saturday:["\u0441\u0443\u0431\u043E\u0442\u0438"],sunday:["\u043D\u0435\u0434\u0456\u043B\u0456"]},ordinals:{first:["\u043F\u0435\u0440\u0448\u0438\u0439","\u043F\u0435\u0440\u0448\u0430","\u043F\u0435\u0440\u0448\u0435"],second:["\u0434\u0440\u0443\u0433\u0438\u0439","\u0434\u0440\u0443\u0433\u0430","\u0434\u0440\u0443\u0433\u0435"],third:["\u0442\u0440\u0435\u0442\u0456\u0439","\u0442\u0440\u0435\u0442\u044F","\u0442\u0440\u0435\u0442\u0454"],fourth:["\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0438\u0439","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0435"],last:["\u043E\u0441\u0442\u0430\u043D\u043D\u0456\u0439","\u043E\u0441\u0442\u0430\u043D\u043D\u044F","\u043E\u0441\u0442\u0430\u043D\u043D\u0454"]},periods:{day:["\u0434\u0435\u043D\u044C","\u0434\u043D\u0456","\u0434\u043D\u0456\u0432"],week:["\u0442\u0438\u0436\u0434\u0435\u043D\u044C","\u0442\u0438\u0436\u043D\u0456","\u0442\u0438\u0436\u043D\u0456\u0432"],month:["\u043C\u0456\u0441\u044F\u0446\u044C","\u043C\u0456\u0441\u044F\u0446\u0456","\u043C\u0456\u0441\u044F\u0446\u0456\u0432"],year:["\u0440\u0456\u043A","\u0440\u043E\u043A\u0438","\u0440\u043E\u043A\u0456\u0432"]}},timeEstimate:{hours:["\u0433","\u0433\u043E\u0434","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0438","\u0433\u043E\u0434\u0438\u043D"],minutes:["\u0445\u0432","\u043C\u0456\u043D","\u0445\u0432\u0438\u043B\u0438\u043D\u0430","\u0445\u0432\u0438\u043B\u0438\u043D\u0438","\u0445\u0432\u0438\u043B\u0438\u043D"]},fallbackStatus:{open:["\u0437\u0440\u043E\u0431\u0438\u0442\u0438","\u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u0439","\u043E\u0447\u0456\u043A\u0443\u0454","todo","\u0432 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u0456"],inProgress:["\u0432 \u0440\u043E\u0431\u043E\u0442\u0456","\u0432\u0438\u043A\u043E\u043D\u0443\u0454\u0442\u044C\u0441\u044F","\u0440\u043E\u0431\u043B\u044E","\u043F\u0440\u0430\u0446\u044E\u044E","\u0432 \u043F\u0440\u043E\u0446\u0435\u0441\u0456"],done:["\u0433\u043E\u0442\u043E\u0432\u043E","\u0432\u0438\u043A\u043E\u043D\u0430\u043D\u043E","\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","\u0437\u0430\u043A\u0456\u043D\u0447\u0435\u043D\u043E","\u0437\u0440\u043E\u0431\u043B\u0435\u043D\u043E"],cancelled:["\u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u043E","\u0432\u0456\u0434\u043C\u0456\u043D\u0435\u043D\u043E","\u043F\u0440\u0438\u043F\u0438\u043D\u0435\u043D\u043E"],waiting:["\u0447\u0435\u043A\u0430\u044E","\u043E\u0447\u0456\u043A\u0443\u044E","\u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E","\u043F\u0440\u0438\u0437\u0443\u043F\u0438\u043D\u0435\u043D\u043E"]},fallbackPriority:{urgent:["\u0442\u0435\u0440\u043C\u0456\u043D\u043E\u0432\u043E","\u043A\u0440\u0438\u0442\u0438\u0447\u043D\u043E","\u043D\u0430\u0439\u0432\u0438\u0449\u0438\u0439","\u043D\u0435\u0432\u0456\u0434\u043A\u043B\u0430\u0434\u043D\u043E","\u043F\u0440\u0456\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u043E"],high:["\u0432\u0438\u0441\u043E\u043A\u0438\u0439","\u0432\u0438\u0441\u043E\u043A\u0430","\u0432\u0430\u0436\u043B\u0438\u0432\u043E","\u043F\u0456\u0434\u0432\u0438\u0449\u0435\u043D\u0438\u0439"],normal:["\u0441\u0435\u0440\u0435\u0434\u043D\u0456\u0439","\u0441\u0435\u0440\u0435\u0434\u043D\u044F","\u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E","\u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E","\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E"],low:["\u043D\u0438\u0437\u044C\u043A\u0438\u0439","\u043D\u0438\u0437\u044C\u043A\u0430","\u043C\u0435\u043D\u0448\u0438\u0439","\u043C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439","\u043D\u0435\u0437\u043D\u0430\u0447\u043D\u0438\u0439"]}}});var cie=v(()=>{});function uie(r){return die[r]||die.en}var die,u1=v(()=>{zne();qne();Une();Wne();Gne();Zne();Jne();eie();rie();iie();aie();lie();cie();die={en:jne,es:Bne,fr:Hne,de:Vne,ru:Yne,zh:Kne,ja:Qne,it:Xne,nl:tie,pt:nie,sv:sie,uk:oie}});var eC,p1=v(()=>{eC=class{constructor(e,t=[]){this.config=e,this.userFields=t,this.triggerMap=new Map,this.propertyMap=new Map,this.buildMaps()}buildMaps(){this.triggerMap.clear(),this.propertyMap.clear();for(let e of this.config.triggers)e.enabled&&(this.triggerMap.set(e.trigger,e),this.propertyMap.set(e.propertyId,e))}getTriggerForProperty(e){return this.propertyMap.get(e)}getPropertyForTrigger(e){var t;return(t=this.triggerMap.get(e))==null?void 0:t.propertyId}getAllEnabledTriggers(){return this.config.triggers.filter(e=>e.enabled)}getTriggersOrderedByLength(){return this.getAllEnabledTriggers().sort((e,t)=>t.trigger.length-e.trigger.length)}usesNativeTagSuggester(){let e=this.getTriggerForProperty("tags");return(e==null?void 0:e.trigger)==="#"&&(e==null?void 0:e.enabled)}getTagTrigger(){let e=this.getTriggerForProperty("tags");return e!=null&&e.enabled?e.trigger:void 0}getContextTrigger(){let e=this.getTriggerForProperty("contexts");return e!=null&&e.enabled?e.trigger:void 0}getProjectTrigger(){let e=this.getTriggerForProperty("projects");return e!=null&&e.enabled?e.trigger:void 0}getStatusTrigger(){let e=this.getTriggerForProperty("status");return e!=null&&e.enabled?e.trigger:void 0}getPriorityTrigger(){let e=this.getTriggerForProperty("priority");return e!=null&&e.enabled?e.trigger:void 0}getUserField(e){return this.userFields.find(t=>t.id===e)}isUserField(e){return this.userFields.some(t=>t.id===e)}getSuggesterType(e){if(e==="tags")return this.usesNativeTagSuggester()?"native-tag":"list";if(e==="contexts")return"list";if(e==="projects")return"file";if(e==="status")return"status";if(e==="priority")return"priority";let t=this.getUserField(e);if(t)switch(t.type){case"text":return t.autosuggestFilter?"file":"list";case"list":return"list";case"boolean":return"boolean";default:return"none"}return"none"}updateConfig(e){this.config=e,this.buildMaps()}updateUserFields(e){this.userFields=e}}});var pie=x((m1,f1)=>{(function(r,e){typeof m1=="object"&&typeof f1!="undefined"?f1.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(m1,(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,l){return o=Number(o),this.$utils().p(l)===e?this.add(3*o,r):s.bind(this)(o,l)};var a=i.startOf;i.startOf=function(o,l){var c=this.$utils(),d=!!c.u(l)||l;if(c.p(o)===e){var u=this.quarter()-1;return d?this.month(3*u).startOf(r).startOf("day"):this.month(3*u+2).endOf(r).endOf("day")}return a.bind(this)(o,l)}}}))});var Wt=x((h1,g1)=>{(function(r,e){typeof h1=="object"&&typeof g1!="undefined"?g1.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(h1,(function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",l="week",c="month",d="quarter",u="year",p="date",m="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|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,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var I=["th","st","nd","rd"],O=R%100;return"["+R+(I[(O-20)%10]||I[O]||I[0])+"]"}},y=function(R,I,O){var z=String(R);return!z||z.length>=I?R:""+Array(I+1-z.length).join(O)+R},k={s:y,z:function(R){var I=-R.utcOffset(),O=Math.abs(I),z=Math.floor(O/60),B=O%60;return(I<=0?"+":"-")+y(z,2,"0")+":"+y(B,2,"0")},m:function R(I,O){if(I.date()1)return R(Y[0])}else{var ee=I.name;w[ee]=I,B=ee}return!z&&B&&(T=B),B||!z&&T},D=function(R,I){if(E(R))return R.clone();var O=typeof I=="object"?I:{};return O.date=R,O.args=arguments,new N(O)},A=k;A.l=C,A.i=E,A.w=function(R,I){return D(R,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var N=(function(){function R(O){this.$L=C(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[S]=!0}var I=R.prototype;return I.parse=function(O){this.$d=(function(z){var B=z.date,W=z.utc;if(B===null)return new Date(NaN);if(A.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var Y=B.match(f);if(Y){var ee=Y[2]-1||0,ae=(Y[7]||"0").substring(0,3);return W?new Date(Date.UTC(Y[1],ee,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ae)):new Date(Y[1],ee,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ae)}}return new Date(B)})(O),this.init()},I.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},I.$utils=function(){return A},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(O,z){var B=D(O);return this.startOf(z)<=B&&B<=this.endOf(z)},I.isAfter=function(O,z){return D(O){(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})($||($={}));(function(r){r[r.SUNDAY=0]="SUNDAY",r[r.MONDAY=1]="MONDAY",r[r.TUESDAY=2]="TUESDAY",r[r.WEDNESDAY=3]="WEDNESDAY",r[r.THURSDAY=4]="THURSDAY",r[r.FRIDAY=5]="FRIDAY",r[r.SATURDAY=6]="SATURDAY"})(ze||(ze={}));(function(r){r[r.JANUARY=1]="JANUARY",r[r.FEBRUARY=2]="FEBRUARY",r[r.MARCH=3]="MARCH",r[r.APRIL=4]="APRIL",r[r.MAY=5]="MAY",r[r.JUNE=6]="JUNE",r[r.JULY=7]="JULY",r[r.AUGUST=8]="AUGUST",r[r.SEPTEMBER=9]="SEPTEMBER",r[r.OCTOBER=10]="OCTOBER",r[r.NOVEMBER=11]="NOVEMBER",r[r.DECEMBER=12]="DECEMBER"})(la||(la={}))});function mie(r,e){r.assign("day",e.getDate()),r.assign("month",e.getMonth()+1),r.assign("year",e.getFullYear())}function fie(r,e){r.assign("hour",e.getHours()),r.assign("minute",e.getMinutes()),r.assign("second",e.getSeconds()),r.assign("millisecond",e.getMilliseconds()),r.assign("meridiem",e.getHours()<12?$.AM:$.PM)}function tC(r,e){r.imply("day",e.getDate()),r.imply("month",e.getMonth()+1),r.imply("year",e.getFullYear())}function hie(r,e){r.imply("hour",e.getHours()),r.imply("minute",e.getMinutes()),r.imply("second",e.getSeconds()),r.imply("millisecond",e.getMilliseconds()),r.imply("meridiem",e.getHours()<12?$.AM:$.PM)}var y1=v(()=>{Nt()});function Eu(r,e,t,n,i=0){let s=0,a=0;for(;a{v1=Ke(Wt(),1);Nt();rje={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:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:r=>gie(r,la.MARCH,ze.SUNDAY,2),dstEnd:r=>gie(r,la.OCTOBER,ze.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:r=>Eu(r,la.MARCH,ze.SUNDAY,2,2),dstEnd:r=>Eu(r,la.NOVEMBER,ze.SUNDAY,1,2)},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:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:r=>Eu(r,la.MARCH,ze.SUNDAY,2,2),dstEnd:r=>Eu(r,la.NOVEMBER,ze.SUNDAY,1,2)},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,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:r=>Eu(r,la.MARCH,ze.SUNDAY,2,2),dstEnd:r=>Eu(r,la.NOVEMBER,ze.SUNDAY,1,2)},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:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:r=>Eu(r,la.MARCH,ze.SUNDAY,2,2),dstEnd:r=>Eu(r,la.NOVEMBER,ze.SUNDAY,1,2)},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 yie(r,e){var n,i,s,a,o,l,c;let t=new Date(r);if(e.y&&(e.year=e.y,delete e.y),e.mo&&(e.month=e.mo,delete e.mo),e.M&&(e.month=e.M,delete e.M),e.w&&(e.week=e.w,delete e.w),e.d&&(e.day=e.d,delete e.d),e.h&&(e.hour=e.h,delete e.h),e.m&&(e.minute=e.m,delete e.m),e.s&&(e.second=e.s,delete e.s),e.ms&&(e.millisecond=e.ms,delete e.ms),"year"in e){let d=Math.floor(e.year);t.setFullYear(t.getFullYear()+d);let u=e.year-d;u>0&&(e.month=(n=e==null?void 0:e.month)!=null?n:0,e.month+=u*12)}if("quarter"in e){let d=Math.floor(e.quarter);t.setMonth(t.getMonth()+d*3)}if("month"in e){let d=Math.floor(e.month);t.setMonth(t.getMonth()+d);let u=e.month-d;u>0&&(e.week=(i=e==null?void 0:e.week)!=null?i:0,e.week+=u*4)}if("week"in e){let d=Math.floor(e.week);t.setDate(t.getDate()+d*7);let u=e.week-d;u>0&&(e.day=(s=e==null?void 0:e.day)!=null?s:0,e.day+=Math.round(u*7))}if("day"in e){let d=Math.floor(e.day);t.setDate(t.getDate()+d);let u=e.day-d;u>0&&(e.hour=(a=e==null?void 0:e.hour)!=null?a:0,e.hour+=Math.round(u*24))}if("hour"in e){let d=Math.floor(e.hour);t.setHours(t.getHours()+d);let u=e.hour-d;u>0&&(e.minute=(o=e==null?void 0:e.minute)!=null?o:0,e.minute+=Math.round(u*60))}if("minute"in e){let d=Math.floor(e.minute);t.setMinutes(t.getMinutes()+d);let u=e.minute-d;u>0&&(e.second=(l=e==null?void 0:e.second)!=null?l:0,e.second+=Math.round(u*60))}if("second"in e){let d=Math.floor(e.second);t.setSeconds(t.getSeconds()+d);let u=e.second-d;u>0&&(e.millisecond=(c=e==null?void 0:e.millisecond)!=null?c:0,e.millisecond+=Math.round(u*1e3))}if("millisecond"in e){let d=Math.floor(e.millisecond);t.setMilliseconds(t.getMilliseconds()+d)}return t}function _g(r){let e={};for(let t in r)e[t]=-r[t];return e}var bT=v(()=>{});var vie,T1,Yt,Q,$t,rt=v(()=>{vie=Ke(pie(),1),T1=Ke(Wt(),1);y1();b1();bT();T1.default.extend(vie.default);Yt=class r{constructor(e,t){M(this,"instant");M(this,"timezoneOffset");this.instant=e!=null?e:new Date,this.timezoneOffset=t!=null?t:null}static fromDate(e){return new r(e)}static fromInput(e,t){var s;if(e instanceof Date)return r.fromDate(e);let n=(s=e==null?void 0:e.instant)!=null?s:new Date,i=rC(e==null?void 0:e.timezone,n,t);return new r(n,i)}getDateWithAdjustedTimezone(){let e=new Date(this.instant);return this.timezoneOffset!==null&&e.setMinutes(e.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),e}getSystemTimezoneAdjustmentMinute(e,t){var s;(!e||e.getTime()<0)&&(e=new Date);let n=-e.getTimezoneOffset(),i=(s=t!=null?t:this.timezoneOffset)!=null?s:n;return n-i}getTimezoneOffset(){var e;return(e=this.timezoneOffset)!=null?e:-this.instant.getTimezoneOffset()}},Q=class r{constructor(e,t){M(this,"knownValues");M(this,"impliedValues");M(this,"reference");M(this,"_tags",new Set);if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=e.getDateWithAdjustedTimezone();this.imply("day",n.getDate()),this.imply("month",n.getMonth()+1),this.imply("year",n.getFullYear()),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 r(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")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return 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 { tags: ${JSON.stringify(Array.from(this._tags).sort())}, knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return(0,T1.default)(this.dateWithoutTimezoneAdjustment())}date(){let e=this.dateWithoutTimezoneAdjustment(),t=this.reference.getSystemTimezoneAdjustmentMinute(e,this.get("timezoneOffset"));return new Date(e.getTime()+t*6e4)}addTag(e){return this._tags.add(e),this}addTags(e){for(let t of e)this._tags.add(t);return this}tags(){return new Set(this._tags)}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}static createRelativeFromReference(e,t){let n=yie(e.getDateWithAdjustedTimezone(),t),i=new r(e);return i.addTag("result/relativeDate"),t.hour||t.minute||t.second?(i.addTag("result/relativeDateAndTime"),fie(i,n),mie(i,n),i.assign("timezoneOffset",e.getTimezoneOffset())):(hie(i,n),i.imply("timezoneOffset",e.getTimezoneOffset()),t.day?(i.assign("day",n.getDate()),i.assign("month",n.getMonth()+1),i.assign("year",n.getFullYear()),i.assign("weekday",n.getDay())):t.week?(i.assign("day",n.getDate()),i.assign("month",n.getMonth()+1),i.assign("year",n.getFullYear()),i.imply("weekday",n.getDay())):(i.imply("day",n.getDate()),t.month?(i.assign("month",n.getMonth()+1),i.assign("year",n.getFullYear())):(i.imply("month",n.getMonth()+1),t.year?i.assign("year",n.getFullYear()):i.imply("year",n.getFullYear())))),i}},$t=class r{constructor(e,t,n,i,s){M(this,"refDate");M(this,"index");M(this,"text");M(this,"reference");M(this,"start");M(this,"end");this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new Q(e),this.end=s}clone(){let e=new r(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()}addTag(e){return this.start.addTag(e),this.end&&this.end.addTag(e),this}addTags(e){return this.start.addTags(e),this.end&&this.end.addTags(e),this}tags(){let e=new Set(this.start.tags());if(this.end)for(let t of this.end.tags())e.add(t);return e}toString(){let e=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(e)} ...}]`}}});function ss(r,e,t="\\s{0,5},?\\s{0,5}"){let n=e.replace(/\((?!\?)/g,"(?:");return`${r}${n}(?:${t}${n}){0,10}`}function nje(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}function se(r){return`(?:${nje(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}var Dt=v(()=>{});function Cs(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}function ir(r,e,t){let n=(0,bie.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)){bie=Ke(Wt(),1)});function ije(r){let e=r.toLowerCase();return k1[e]!==void 0?k1[e]:e==="a"||e==="an"||e=="the"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}function Ag(r){let e=r.toLowerCase();return w1[e]!==void 0?w1[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}function Cu(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 Cs(e)}function Wa(r){let e={},t=r,n=Tie.exec(t);for(;n;)aje(e,n),t=t.substring(n[0].length).trim(),n=Tie.exec(t);return Object.keys(e).length==0?null:e}function aje(r,e){if(e[0].match(/^[a-zA-Z]+$/))return;let t=ije(e[1]),n=TT[e[2].toLowerCase()];r[n]=t}var nC,S1,Va,k1,w1,kie,TT,wie,Mg,Du,Sie,Tie,sje,xie,sd,Pu,Fn=v(()=>{Dt();un();nC={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},S1={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Va={...S1,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},k1={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},w1={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},kie={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},TT={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"d",day:"d",days:"d",w:"w",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...kie},wie=`(?:${se(k1)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;Mg=`(?:${se(w1)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;Du="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9]|2[0-5])";Sie=`(${wie})\\s{0,3}(${se(TT)})`,Tie=new RegExp(Sie,"i"),sje=`(${wie})\\s{0,3}(${se(kie)})`,xie="\\s{0,5},?(?:\\s*and)?\\s{0,5}",sd=ss("(?:(?:about|around)\\s{0,3})?",Sie,xie),Pu=ss("(?:(?:about|around)\\s{0,3})?",sje,xie)});var q,ve=v(()=>{q=class{constructor(){M(this,"cachedInnerPattern",null);M(this,"cachedPattern",null)}innerPatternHasChange(e,t){return this.innerPattern(e)!==t}patternLeftBoundary(){return"(\\W|^)"}pattern(e){return this.cachedInnerPattern&&!this.innerPatternHasChange(e,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(e),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(e,t){var i;let n=(i=t[1])!=null?i:"";t.index=t.index+n.length,t[0]=t[0].substring(n.length);for(let s=2;s{Fn();rt();ve();oje=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${sd})(?=\\W|$)`,"i"),lje=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${sd})(?=\\W|$)`,"i"),cje=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Pu})(?=\\W|$)`,"i"),kT=class extends q{constructor(t){super();M(this,"strictMode");this.strictMode=t}innerPattern(t){return this.strictMode?cje:t.option.forwardDate?oje:lje}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;let i=Wa(n[1]);return i?(t.debug(()=>{console.log(i),console.log(Q.createRelativeFromReference(t.reference,i))}),Q.createRelativeFromReference(t.reference,i)):null}}});var dje,Die,Cie,uje,Pie,wT,_ie=v(()=>{un();Fn();Fn();Fn();Dt();ve();dje=new RegExp(`(?:on\\s{0,3})?(${Mg})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${Mg}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${se(Va)})(?:(?:-|/|,?\\s{0,3})(${Du}(?!\\w)))?(?=\\W|$)`,"i"),Die=1,Cie=2,uje=3,Pie=4,wT=class extends q{innerPattern(){return dje}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Va[t[uje].toLowerCase()],s=Ag(t[Die]);if(s>31)return t.index=t.index+t[Die].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Pie]){let a=Cu(t[Pie]);n.start.assign("year",a)}else{let a=ir(e.refDate,s,i);n.start.imply("year",a)}if(t[Cie]){let a=Ag(t[Cie]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var pje,mje,Mie,x1,E1,ST,Aie=v(()=>{un();Fn();Fn();Fn();Dt();ve();pje=new RegExp(`(${se(Va)})(?:-|/|\\s*,?\\s*)(${Mg})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Mg})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${Du}))?(?=\\W|$)(?!\\:\\d)`,"i"),mje=1,Mie=2,x1=3,E1=4,ST=class extends q{constructor(t){super();M(this,"shouldSkipYearLikeDate");this.shouldSkipYearLikeDate=t}innerPattern(){return pje}innerExtract(t,n){let i=Va[n[mje].toLowerCase()],s=Ag(n[Mie]);if(s>31||this.shouldSkipYearLikeDate&&!n[x1]&&!n[E1]&&n[Mie].match(/^2[0-5]$/))return null;let a=t.createParsingComponents({day:s,month:i}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[E1]){let c=Cu(n[E1]);a.assign("year",c)}else{let c=ir(t.refDate,s,i);a.imply("year",c)}if(!n[x1])return a;let o=Ag(n[x1]),l=t.createParsingResult(n.index,n[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}}});var fje,hje,gje,Iie,xT,Nie=v(()=>{Fn();un();Dt();Fn();ve();fje=new RegExp(`((?:in)\\s*)?(${se(Va)})\\s*(?:(?:,|-|of)?\\s*(${Du})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),hje=1,gje=2,Iie=3,xT=class extends q{innerPattern(){return fje}innerExtract(e,t){let n=t[gje].toLowerCase();if(t[0].length<=3&&!S1[n])return null;let i=e.createParsingResult(t.index+(t[hje]||"").length,t.index+t[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");let s=Va[n];if(i.start.assign("month",s),t[Iie]){let a=Cu(t[Iie]);i.start.assign("year",a)}else{let a=ir(e.refDate,1,s);i.start.imply("year",a)}return i}}});var yje,vje,bje,Rie,Tje,ET,Oie=v(()=>{Fn();Dt();ve();yje=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${se(Va)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),vje=1,bje=2,Rie=3,Tje=4,ET=class extends q{constructor(t){super();M(this,"strictMonthDateOrder");this.strictMonthDateOrder=t}innerPattern(){return yje}innerExtract(t,n){let i=parseInt(n[vje]),s=parseInt(n[Tje]),a=n[Rie]?parseInt(n[Rie]):Va[n[bje].toLowerCase()];if(a<1||a>12){if(this.strictMonthDateOrder)return null;s>=1&&s<=12&&([a,s]=[s,a])}return s<1||s>31?null:{day:s,month:a,year:i}}}});var kje,wje,Sje,DT,Lie=v(()=>{ve();kje=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),wje=1,Sje=2,DT=class extends q{innerPattern(){return kje}innerExtract(e,t){let n=parseInt(t[Sje]),i=parseInt(t[wje]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}}});function xje(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 Eje(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 Fie,Ig,iC,sC,CT,Jn,ad=v(()=>{Nt();Fie=2,Ig=3,iC=4,sC=5,CT=6,Jn=class{constructor(e=!1){M(this,"strictMode");M(this,"cachedPrimaryPrefix",null);M(this,"cachedPrimarySuffix",null);M(this,"cachedPrimaryTimePattern",null);M(this,"cachedFollowingPhase",null);M(this,"cachedFollowingSuffix",null);M(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[0].match(/^\d{4}/)?(t.index+=4,null):(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),c=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&c&&(c[0].match(/^\s*([+-])\s*\d{2,4}$/)||c[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!c||c[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,c,a),a.end&&(a.text+=c[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[Fie]);if(o>100){if(this.strictMode||t[Ig]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[Ig]!=null){if(t[Ig].length==1&&!t[CT])return null;s=parseInt(t[Ig])}if(s>=60)return null;if(o>12&&(a=$.PM),t[CT]!=null){if(o>12)return null;let l=t[CT][0].toLowerCase();l=="a"&&(a=$.AM,o==12&&(o=0)),l=="p"&&(a=$.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",$.AM):i.imply("meridiem",$.PM),t[sC]!=null){let l=parseInt(t[sC].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(t[iC]!=null){let l=parseInt(t[iC]);if(l>=60)return null;i.assign("second",l)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[sC]!=null){let l=parseInt(t[sC].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(t[iC]!=null){let l=parseInt(t[iC]);if(l>=60)return null;i.assign("second",l)}let s=parseInt(t[Fie]),a=0,o=-1;if(t[Ig]!=null?a=parseInt(t[Ig]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=$.PM),t[CT]!=null){if(s>12)return null;let l=t[CT][0].toLowerCase();l=="a"&&(o=$.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),l=="p"&&(o=$.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==$.AM?(n.start.imply("meridiem",$.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("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",$.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",$.PM)):s>12?i.imply("meridiem",$.PM):s<=12&&i.imply("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=xje(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=Eje(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}}});var PT,$ie=v(()=>{Nt();ad();PT=class extends Jn{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\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)return 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",$.PM)):i<6&&n.assign("meridiem",$.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",$.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}return t[0].endsWith("morning")&&(n.assign("meridiem",$.AM),n.get("hour")<12&&n.assign("hour",n.get("hour"))),n.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(e,t,n){let i=super.extractFollowingTimeComponents(e,t,n);return i&&i.addTag("parser/ENTimeExpressionParser"),i}}});var Dje,Cje,_T,jie=v(()=>{Fn();rt();ve();bT();Dje=new RegExp(`(${sd})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Cje=new RegExp(`(${Pu})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),_T=class extends q{constructor(t){super();M(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Cje:Dje}innerExtract(t,n){let i=Wa(n[1]);return i?Q.createRelativeFromReference(t.reference,_g(i)):null}}});var Pje,_je,Mje,MT,zie=v(()=>{Fn();rt();ve();Pje=new RegExp(`(${sd})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),_je=new RegExp(`(${Pu})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),Mje=1,MT=class extends q{constructor(t){super();M(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?_je:Pje}innerExtract(t,n){let i=Wa(n[Mje]);return i?Q.createRelativeFromReference(t.reference,i):null}}});var Ng,Ps,od=v(()=>{Ng=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}},Ps=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 ${l} and ${c} into ${d}`)}),i=d}}return i!=null&&n.push(i),n}}});var zr,Ya=v(()=>{od();zr=class extends Ps{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.imply(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.imply(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();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())):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.isDateWithUnknownYear()&&a.add(1,"years").isAfter(s)?(a=a.add(1,"years"),n.start.imply("year",a.year())):t.start.isDateWithUnknownYear()&&s.add(-1,"years").isBefore(a)?(s=s.add(-1,"years"),t.start.imply("year",s.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{Ya();AT=class extends zr{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}}});function Ho(r,e){e=e.add(1,"day"),Ir(r,e),Al(r,e)}function qie(r,e){e=e.add(1,"day"),D1(r,e),Al(r,e)}function Ir(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}function Hie(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",$.AM):r.assign("meridiem",$.PM)}function D1(r,e){r.imply("day",e.date()),r.imply("month",e.month()+1),r.imply("year",e.year())}function Al(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}var ca=v(()=>{Nt()});function C1(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=Uie(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=Uie(s,a);if(r.end==null&&o.date().getTime(){Nt();ca()});var Br,Ga=v(()=>{od();Vie();Br=class extends Ps{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()?C1(t,n):C1(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}}});var Rg,Wie=v(()=>{Ga();Rg=class extends Br{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|\u2219|:)?\\s*$")}}});var Aje,IT,Yie=v(()=>{b1();Aje=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),IT=class{constructor(e){M(this,"timezoneOverrides");this.timezoneOverrides=e}refine(e,t){var i;let n=(i=e.option.timezones)!=null?i:{};return t.forEach(s=>{var m,f;let a=e.text.substring(s.index+s.text.length),o=Aje.exec(a);if(!o)return;let l=o[1].toUpperCase(),c=(f=(m=s.start.date())!=null?m:s.refDate)!=null?f:new Date,d={...this.timezoneOverrides,...n},u=rC(l,c,d);if(u==null)return;e.debug(()=>{console.log(`Extracting timezone: '${l}' into: ${u} for: ${s.start}`)});let p=s.start.get("timezoneOffset");p!==null&&u!=p&&(s.start.isCertain("timezoneOffset")||l!=o[1])||s.start.isOnlyDate()&&l!=o[1]||(s.text+=o[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",u),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",u))}),t}}});var Ije,Nje,Rje,Oje,Uo,NT=v(()=>{Ije=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),Nje=1,Rje=2,Oje=3,Uo=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=Ije.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[Rje]),o=parseInt(s[Oje]||"0"),l=a*60+o;l>840||(s[Nje]==="-"&&(l=-l),n.end!=null&&n.end.assign("timezoneOffset",l),n.start.assign("timezoneOffset",l),n.text+=s[0])}),t}}});var _u,P1=v(()=>{_u=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;s=i.index+i.text.length){n.push(i),i=a;continue}let o=null,l=null;a.text.length>i.text.length?(o=a,l=i):(o=i,l=a),e.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${o}`)}),i=o}return i!=null&&n.push(i),n}}});var Gie,RT,Kie=v(()=>{Gie=Ke(Wt(),1);y1();RT=class{refine(e,t){return e.option.forwardDate&&t.forEach(n=>{let i=(0,Gie.default)(e.reference.getDateWithAdjustedTimezone());if(n.start.isOnlyTime()&&e.reference.instant>n.start.date()){let s=e.reference.getDateWithAdjustedTimezone(),a=new Date(s);a.setDate(a.getDate()+1),tC(n.start,a),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} time from the ref date (${s}) to the following day (${a})`)}),n.end&&n.end.isOnlyTime()&&(tC(n.end,a),n.start.date()>n.end.date()&&(a.setDate(a.getDate()+1),tC(n.end,a)))}if(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(`${this.constructor.name} adjusted ${n} weekday (${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(`${this.constructor.name} adjusted ${n} weekday (${n.end})`)}))),n.start.isDateWithUnknownYear()&&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(`${this.constructor.name} adjusted ${n} year (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} month (${n.start})`)}))}),t}}});var OT,Zie=v(()=>{od();OT=class extends Ng{constructor(t){super();M(this,"strictMode");this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}}});var Lje,Fje,$je,jje,Qie,zje,Jie,Xie,Bje,ese,tse,ld,aC=v(()=>{ve();Lje=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"),Fje=1,$je=2,jje=3,Qie=4,zje=5,Jie=6,Xie=7,Bje=8,ese=9,tse=10,ld=class extends q{innerPattern(){return Lje}innerExtract(e,t){let n=e.createParsingComponents({year:parseInt(t[Fje]),month:parseInt(t[$je]),day:parseInt(t[jje])});if(t[Qie]!=null&&(n.assign("hour",parseInt(t[Qie])),n.assign("minute",parseInt(t[zje])),t[Jie]!=null&&n.assign("second",parseInt(t[Jie])),t[Xie]!=null&&n.assign("millisecond",parseInt(t[Xie])),t[Bje]!=null)){let i=0;if(t[ese]){let s=parseInt(t[ese]),a=0;t[tse]!=null&&(a=parseInt(t[tse])),i=s*60,i<0?i-=a:i+=a}n.assign("timezoneOffset",i)}return n.addTag("parser/ISOFormatParser")}}});var Lm,_1=v(()=>{od();Lm=class extends Ps{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}}});function Yr(r,e=!1){return r.parsers.unshift(new ld),r.refiners.unshift(new Lm),r.refiners.unshift(new Uo),r.refiners.unshift(new _u),r.refiners.push(new IT),r.refiners.push(new _u),r.refiners.push(new RT),r.refiners.push(new OT(e)),r}var da=v(()=>{Yie();NT();P1();Kie();Zie();aC();_1()});function Ii(r){let e=(0,Mu.default)(r.getDateWithAdjustedTimezone()),t=new Q(r,{});return Ir(t,e),Hie(t,e),t.assign("timezoneOffset",r.getTimezoneOffset()),t.addTag("casualReference/now"),t}function Xn(r){let e=(0,Mu.default)(r.getDateWithAdjustedTimezone()),t=new Q(r,{});return Ir(t,e),Al(t,e),t.addTag("casualReference/today"),t}function Ni(r){return Fm(r,1).addTag("casualReference/yesterday")}function Fm(r,e){return Il(r,-e)}function Ri(r){return Il(r,1).addTag("casualReference/tomorrow")}function Il(r,e){let t=(0,Mu.default)(r.getDateWithAdjustedTimezone()),n=new Q(r,{});return t=t.add(e,"day"),Ir(n,t),Al(n,t),n}function rse(r,e=22){let t=(0,Mu.default)(r.getDateWithAdjustedTimezone()),n=new Q(r,{});return Ir(n,t),n.imply("hour",e),n.imply("meridiem",$.PM),n.addTag("casualReference/tonight"),n}function oC(r,e=0){let t=(0,Mu.default)(r.getDateWithAdjustedTimezone()),n=new Q(r,{});return t.hour()<6&&(t=t.add(-1,"day")),Ir(n,t),n.imply("hour",e),n}function Og(r,e=20){let t=new Q(r,{});return t.imply("meridiem",$.PM),t.imply("hour",e),t.addTag("casualReference/evening"),t}function lC(r,e=20){let t=(0,Mu.default)(r.getDateWithAdjustedTimezone()),n=new Q(r,{});return t=t.add(-1,"day"),Ir(n,t),n.imply("hour",e),n.imply("meridiem",$.PM),n.addTag("casualReference/yesterday"),n.addTag("casualReference/evening"),n}function $m(r){let e=new Q(r,{}),t=(0,Mu.default)(r.getDateWithAdjustedTimezone());return t.hour()>2&&qie(e,t),e.assign("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e.addTag("casualReference/midnight"),e}function Lg(r,e=6){let t=new Q(r,{});return t.imply("meridiem",$.AM),t.imply("hour",e),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/morning"),t}function nse(r,e=15){let t=new Q(r,{});return t.imply("meridiem",$.PM),t.imply("hour",e),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/afternoon"),t}function Fg(r){let e=new Q(r,{});return e.imply("meridiem",$.AM),e.assign("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e.addTag("casualReference/noon"),e}var Mu,ua=v(()=>{rt();Mu=Ke(Wt(),1);ca();Nt()});var ise,qje,LT,sse=v(()=>{ise=Ke(Wt(),1);ve();ca();ua();qje=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,LT=class extends q{innerPattern(e){return qje}innerExtract(e,t){let n=(0,ise.default)(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":s=Ii(e.reference);break;case"today":s=Xn(e.reference);break;case"yesterday":s=Ni(e.reference);break;case"tomorrow":case"tmr":case"tmrw":s=Ri(e.reference);break;case"tonight":s=rse(e.reference);break;case"overmorrow":s=Il(e.reference,2);break;default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),Ir(s,n),s.imply("hour",0));break}return s.addTag("parser/ENCasualDateParser"),s}}});var Hje,FT,ase=v(()=>{ve();ua();Hje=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,FT=class extends q{innerPattern(){return Hje}innerExtract(e,t){let n=null;switch(t[1].toLowerCase()){case"afternoon":n=nse(e.reference);break;case"evening":case"night":n=Og(e.reference);break;case"midnight":n=$m(e.reference);break;case"morning":n=Lg(e.reference);break;case"noon":case"midday":n=Fg(e.reference);break}return n&&n.addTag("parser/ENCasualTimeParser"),n}}});function Cn(r){let e={};for(let t in r)e[t]=-r[t];return e}function cC(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}var pa=v(()=>{});function Pn(r,e,t){let n=r.getDateWithAdjustedTimezone(),i=Uje(n,e,t),s=new Q(r);return s=cC(s,{day:i}),s.assign("weekday",e),s}function Uje(r,e,t){let n=r.getDay();switch(t){case"this":return dC(r,e);case"last":return ose(r,e);case"next":return n==ze.SUNDAY?e==ze.SUNDAY?7:e:n==ze.SATURDAY?e==ze.SATURDAY?7:e==ze.SUNDAY?8:1+e:e=0&&(n-=7),n}var Vo=v(()=>{Nt();rt();pa()});var Wje,Yje,Gje,Kje,$T,lse=v(()=>{Fn();Dt();ve();Vo();Nt();Wje=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${se(nC)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),Yje=1,Gje=2,Kje=3,$T=class extends q{innerPattern(){return Wje}innerExtract(e,t){let n=t[Yje],i=t[Kje],s=n||i;s=s||"",s=s.toLowerCase();let a=null;s=="last"||s=="past"?a="last":s=="next"?a="next":s=="this"&&(a="this");let o=t[Gje].toLowerCase(),l;if(nC[o]!==void 0)l=nC[o];else if(o=="weekend")l=a=="last"?ze.SUNDAY:ze.SATURDAY;else if(o=="weekday"){let c=e.reference.getDateWithAdjustedTimezone().getDay();c==ze.SUNDAY||c==ze.SATURDAY?l=a=="last"?ze.FRIDAY:ze.MONDAY:(l=c-1,l=a=="last"?l-1:l+1,l=l%5+1)}else return null;return Pn(e.reference,l,a)}}});var cse,Zje,Qje,Jje,jT,dse=v(()=>{Fn();rt();cse=Ke(Wt(),1);ve();Dt();Zje=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${se(TT)})(?=\\s*)(?=\\W|$)`,"i"),Qje=1,Jje=2,jT=class extends q{innerPattern(){return Zje}innerExtract(e,t){let n=t[Qje].toLowerCase(),i=t[Jje].toLowerCase(),s=TT[i];if(n=="next"||n.startsWith("after")){let l={};return l[s]=1,Q.createRelativeFromReference(e.reference,l)}if(n=="last"||n=="past"){let l={};return l[s]=-1,Q.createRelativeFromReference(e.reference,l)}let a=e.createParsingComponents(),o=(0,cse.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}}});var Xje,eze,tze,use,pse,M1,$n,cd=v(()=>{un();Xje=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"),eze=1,tze=5,use=2,pse=3,M1=4,$n=class{constructor(e){M(this,"groupNumberMonth");M(this,"groupNumberDay");this.groupNumberMonth=e?pse:use,this.groupNumberDay=e?use:pse}pattern(){return Xje}extract(e,t){let n=t.index+t[eze].length,i=t.index+t[0].length-t[tze].length;if(n>0&&e.text.substring(0,n).match("\\d/?$")||i12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),t[M1]){let c=parseInt(t[M1]),d=Cs(c);a.start.assign("year",d)}else{let c=ir(e.refDate,l,o);a.start.imply("year",c)}return a.addTag("parser/SlashDateFormatParser")}}});var rze,nze,zT,mse=v(()=>{Fn();rt();ve();bT();rze=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${sd})(?=\\W|$)`,"i"),nze=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Pu})(?=\\W|$)`,"i"),zT=class extends q{constructor(t=!0){super();M(this,"allowAbbreviations");this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?rze:nze}innerExtract(t,n){let i=n[1].toLowerCase(),s=Wa(n[2]);if(!s)return null;switch(i){case"last":case"past":case"-":s=_g(s);break}return Q.createRelativeFromReference(t.reference,s)}}});function ize(r){return r.text.match(/^[+-]/i)!=null}function fse(r){return r.text.match(/^-/i)!=null}var BT,hse=v(()=>{od();rt();Fn();pa();BT=class extends Ps{shouldMergeResults(e,t,n){return e.match(/^\s*$/i)?ize(n)||fse(n):!1}mergeResults(e,t,n,i){let s=Wa(n.text);fse(n)&&(s=Cn(s));let a=Q.createRelativeFromReference(Yt.fromDate(t.start.date()),s);return new $t(t.reference,t.index,`${t.text}${e}${n.text}`,a)}}});function gse(r){return r.text.match(/\s+(before|from)$/i)!=null}function sze(r){return r.text.match(/\s+(after|since)$/i)!=null}var qT,yse=v(()=>{od();rt();Fn();bT();qT=class extends Ps{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!gse(t)&&!sze(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=Wa(t.text);gse(t)&&(i=_g(i));let s=Q.createRelativeFromReference(Yt.fromDate(n.start.date()),i);return new $t(n.reference,t.index,`${t.text}${e}${n.text}`,s)}}});var aze,oze,HT,vse=v(()=>{Fn();aze=new RegExp(`^\\s*(${Du})`,"i"),oze=1,HT=class{refine(e,t){return t.forEach(function(n){if(!n.start.isDateWithUnknownYear())return;let i=e.text.substring(n.index+n.text.length),s=aze.exec(i);if(!s||s[0].trim().length<=3)return;e.debug(()=>{console.log(`Extracting year: '${s[0]}' into : ${n}`)});let a=Cu(s[oze]);n.end!=null&&n.end.assign("year",a),n.start.assign("year",a),n.text+=s[0]}),t}}});var UT,bse=v(()=>{od();UT=class extends Ng{constructor(){super()}isValid(e,t){let n=t.text.trim();return n===e.text.trim()?!0:n.toLowerCase()==="may"&&!e.text.substring(0,t.index).trim().match(/\b(in)$/i)?(e.debug(()=>{console.log(`Removing unlikely result: ${t}`)}),!1):n.toLowerCase().endsWith("the second")?(e.text.substring(t.index+t.text.length).trim().length>0&&e.debug(()=>{console.log(`Removing unlikely result: ${t}`)}),!1):!0}}});var jm,A1=v(()=>{Eie();_ie();Aie();Nie();Oie();Lie();$ie();jie();zie();Bie();Wie();da();sse();ase();lse();dse();cd();mse();hse();yse();P1();vse();bse();jm=class{createCasualConfiguration(e=!1){let t=this.createConfiguration(!1,e);return t.parsers.push(new LT),t.parsers.push(new FT),t.parsers.push(new xT),t.parsers.push(new jT),t.parsers.push(new zT),t.refiners.push(new UT),t}createConfiguration(e=!0,t=!1){let n=Yr({parsers:[new $n(t),new kT(e),new wT,new ST(t),new $T,new DT,new PT(e),new _T(e),new MT(e)],refiners:[new Rg]},e);return n.parsers.unshift(new ET(e)),n.refiners.unshift(new qT),n.refiners.unshift(new BT),n.refiners.unshift(new _u),n.refiners.push(new Rg),n.refiners.push(new HT),n.refiners.push(new AT),n}}});var Oe,VT,_s=v(()=>{rt();A1();Oe=class r{constructor(e){M(this,"parsers");M(this,"refiners");M(this,"defaultConfig",new jm);e=e||this.defaultConfig.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new r({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 VT(e,t,n),s=[];return this.parsers.forEach(a=>{let o=r.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 l=o.index+s.length-a.length;o.index=l;let c=t.extract(e,o);if(!c){a=s.substring(o.index+1),o=i.exec(a);continue}let d=null;c instanceof $t?d=c:c instanceof Q?(d=e.createParsingResult(o.index,o[0]),d.start=c):d=e.createParsingResult(o.index,o[0],c);let u=d.index,p=d.text;e.debug(()=>console.log(`${t.constructor.name} extracted (at index=${u}) '${p}'`)),n.push(d),a=s.substring(u+p.length),o=i.exec(a)}return n}},VT=class{constructor(e,t,n){M(this,"text");M(this,"option");M(this,"reference");M(this,"refDate");this.text=e,this.option=n!=null?n:{},this.reference=Yt.fromInput(t,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof Q?e:new Q(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 $t(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))}}});var N1={};et(N1,{Chrono:()=>Oe,GB:()=>lze,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>WT,configuration:()=>uC,parse:()=>cze,parseDate:()=>dze,strict:()=>I1});function cze(r,e,t){return WT.parse(r,e,t)}function dze(r,e,t){return WT.parseDate(r,e,t)}var uC,WT,I1,lze,Tse=v(()=>{_s();rt();Nt();A1();uC=new jm,WT=new Oe(uC.createCasualConfiguration(!1)),I1=new Oe(uC.createConfiguration(!0,!1)),lze=new Oe(uC.createCasualConfiguration(!0))});var YT,kse=v(()=>{ad();YT=class extends Jn{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)}}});function $1(r){let e=r.toLowerCase();return R1[e]!==void 0?R1[e]:e==="ein"||e==="einer"||e==="einem"||e==="einen"||e==="eine"?1:e.match(/wenigen/)?2:e.match(/halb/)||e.match(/halben/)?.5:e.match(/einigen/)?3:e.match(/mehreren/)?7:parseFloat(e)}function xse(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 Cs(e)}function Cse(r){let e={},t=r,n=wse.exec(t);for(;n;)uze(e,n),t=t.substring(n[0].length),n=wse.exec(t);return e}function uze(r,e){let t=$1(e[1]),n=GT[e[2].toLowerCase()];r[n]=t}var O1,L1,R1,GT,F1,Sse,Ese,wse,Dse,$g=v(()=>{Dt();un();O1={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},L1={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},R1={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},GT={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"},F1=`(?:${se(R1)}|[0-9]+|[0-9]+\\.[0-9]+|halb?|halbe?|einigen?|wenigen?|mehreren?)`;Sse="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";Ese=`(${F1})\\s{0,5}(${se(GT)})\\s{0,5}`,wse=new RegExp(Ese,"i"),Dse=ss("",Ese)});var pze,mze,fze,hze,KT,Pse=v(()=>{$g();Dt();ve();Vo();pze=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${se(O1)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),mze=1,fze=3,hze=2,KT=class extends q{innerPattern(){return pze}innerExtract(e,t){let n=t[hze].toLowerCase(),i=O1[n],s=t[mze],a=t[fze],o=s||a;o=o||"",o=o.toLowerCase();let l=null;return o.match(/letzte/)?l="last":o.match(/chste/)?l="next":o.match(/diese/)&&(l="this"),Pn(e.reference,i,l)}}});var gze,yze,vze,_se,Mse,Ase,ZT,Ise=v(()=>{Nt();gze=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"),yze=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"),vze=2,_se=3,Mse=4,Ase=5,ZT=class r{pattern(e){return gze}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=r.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=yze.exec(i);return s&&(n.end=r.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[vze]),t[_se]!=null&&(i=parseInt(t[_se])),i>=60||n>24)return null;if(n>=12&&(s=$.PM),t[Ase]!=null){if(n>12)return null;let a=t[Ase].toLowerCase();a.match(/morgen|vormittag/)&&(s=$.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=$.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=$.AM,n=0):n<6?s=$.AM:(s=$.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",$.AM):e.imply("meridiem",$.PM),t[Mse]!=null){let a=parseInt(t[Mse]);if(a>=60)return null;e.assign("second",a)}return e}}});var QT,Nse=v(()=>{Ya();QT=class extends zr{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}}});var JT,Rse=v(()=>{Ga();JT=class extends Br{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}}});var Ose,zm,j1=v(()=>{Ose=Ke(Wt(),1);Nt();ve();ca();pa();zm=class r extends q{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=(0,Ose.default)(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return Al(s,n),r.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",$.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$.PM);break;case"mitternacht":e.get("hour")>1&&(e=cC(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$.AM);break}return e}}});var Lse,bze,Tze,kze,XT,Fse=v(()=>{Lse=Ke(Wt(),1);ve();ca();j1();ua();bze=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),Tze=1,kze=2,XT=class extends q{innerPattern(e){return bze}innerExtract(e,t){let n=(0,Lse.default)(e.refDate),i=(t[Tze]||"").toLowerCase(),s=(t[kze]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=Ii(e.reference);break;case"heute":a=Xn(e.reference);break;case"morgen":Ho(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),Ho(a,n);break;case"gestern":n=n.add(-1,"day"),Ir(a,n),Al(a,n);break;case"vorgestern":n=n.add(-2,"day"),Ir(a,n),Al(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),Ir(a,n),a.imply("hour",0));break}return s&&(a=zm.extractTimeComponents(a,s)),a}}});var wze,$se,jse,Sze,zse,ek,Bse=v(()=>{un();$g();$g();Dt();ve();wze=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${se(L1)})(?:(?:-|/|,?\\s*)(${Sse}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),$se=1,jse=2,Sze=3,zse=4,ek=class extends q{innerPattern(){return wze}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=L1[t[Sze].toLowerCase()],s=parseInt(t[$se]);if(s>31)return t.index=t.index+t[$se].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[zse]){let a=xse(t[zse]);n.start.assign("year",a)}else{let a=ir(e.refDate,s,i);n.start.imply("year",a)}if(t[jse]){let a=parseInt(t[jse]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var tk,qse=v(()=>{$g();rt();ve();pa();Dt();tk=class extends q{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*)?(${F1})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${se(GT)})`,"i")}innerExtract(e,t){let n=t[2]?$1(t[2]):1,i=GT[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=Cn(s)),Q.createRelativeFromReference(e.reference,s)}}});var rk,Hse=v(()=>{$g();rt();ve();rk=class extends q{innerPattern(){return new RegExp(`(?:in|f\xFCr|w\xE4hrend)\\s*(${Dse})(?=\\W|$)`,"i")}innerExtract(e,t){let n=Cse(t[1]);return Q.createRelativeFromReference(e.reference,n)}}});var q1={};et(q1,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>z1,createCasualConfiguration:()=>Use,createConfiguration:()=>B1,parse:()=>Eze,parseDate:()=>Dze,strict:()=>xze});function Eze(r,e,t){return z1.parse(r,e,t)}function Dze(r,e,t){return z1.parseDate(r,e,t)}function Use(r=!0){let e=B1(!1,r);return e.parsers.unshift(new zm),e.parsers.unshift(new XT),e.parsers.unshift(new tk),e}function B1(r=!0,e=!0){return Yr({parsers:[new ld,new $n(e),new YT,new ZT,new ek,new KT,new rk],refiners:[new QT,new JT]},r)}var z1,xze,Vse=v(()=>{da();_s();rt();Nt();cd();aC();kse();Pse();Ise();Nse();Rse();Fse();j1();Bse();qse();Hse();z1=new Oe(Use()),xze=new Oe(B1(!0))});var Wse,nk,Yse=v(()=>{Wse=Ke(Wt(),1);Nt();ve();ca();ua();nk=class extends q{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=(0,Wse.default)(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return Ii(e.reference);case"aujourd'hui":return Xn(e.reference);case"hier":return Ni(e.reference);case"demain":return Ri(e.reference);default:i.match(/cette\s*nuit/)?(Ir(s,n),s.imply("hour",22),s.imply("meridiem",$.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Ir(s,n),s.imply("hour",0))}return s}}});var ik,Gse=v(()=>{Nt();ve();ik=class extends q{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",$.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",$.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",$.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",$.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",$.AM);break}return i}}});var sk,Kse=v(()=>{ad();sk=class extends Jn{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)}}});var ak,Zse=v(()=>{Ga();ak=class extends Br{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|au|vers|de|,|-)?\\s*$")}}});var ok,Qse=v(()=>{Ya();ok=class extends zr{patternBetween(){return/^\s*(à|a|au|-)\s*$/i}}});function Y1(r){let e=r.toLowerCase();return H1[e]!==void 0?H1[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}function K1(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}function eae(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}function mC(r){let e={},t=r,n=Jse.exec(t);for(;n;)Cze(e,n),t=t.substring(n[0].length),n=Jse.exec(t);return e}function Cze(r,e){let t=Y1(e[1]),n=lk[e[2].toLowerCase()];r[n]=t}var U1,V1,H1,lk,W1,G1,Xse,tae,Jse,pC,Au=v(()=>{Dt();U1={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},V1={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},H1={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},lk={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"},W1=`(?:${se(H1)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;G1="(?:[0-9]{1,2}(?:er)?)";Xse="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";tae=`(${W1})\\s{0,5}(${se(lk)})\\s{0,5}`,Jse=new RegExp(tae,"i"),pC=ss("",tae)});var Pze,_ze,Mze,ck,rae=v(()=>{Au();Dt();ve();Vo();Pze=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${se(U1)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),_ze=1,Mze=2,ck=class extends q{innerPattern(){return Pze}innerExtract(e,t){let n=t[_ze].toLowerCase(),i=U1[n];if(i===void 0)return null;let s=t[Mze];s=s||"",s=s.toLowerCase();let a=null;return s=="dernier"?a="last":s=="prochain"&&(a="next"),Pn(e.reference,i,a)}}});var Aze,Ize,Nze,nae,iae,sae,dk,aae=v(()=>{Nt();Aze=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"),Ize=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"),Nze=2,nae=3,iae=4,sae=5,dk=class r{pattern(e){return Aze}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=r.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=Ize.exec(i);return s&&(n.end=r.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[Nze]),t[nae]!=null&&(i=parseInt(t[nae])),i>=60||n>24)return null;if(n>=12&&(s=$.PM),t[sae]!=null){if(n>12)return null;let a=t[sae][0].toLowerCase();a=="a"&&(s=$.AM,n==12&&(n=0)),a=="p"&&(s=$.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",$.AM):e.imply("meridiem",$.PM),t[iae]!=null){let a=parseInt(t[iae]);if(a>=60)return null;e.assign("second",a)}return e}}});var Rze,oae,lae,Oze,cae,uk,dae=v(()=>{un();Au();Au();Au();Dt();ve();Rze=new RegExp(`(?:on\\s*?)?(${G1})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${G1}))?(?:-|/|\\s*(?:de)?\\s*)(${se(V1)})(?:(?:-|/|,?\\s*)(${Xse}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),oae=1,lae=2,Oze=3,cae=4,uk=class extends q{innerPattern(){return Rze}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=V1[t[Oze].toLowerCase()],s=K1(t[oae]);if(s>31)return t.index=t.index+t[oae].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[cae]){let a=eae(t[cae]);n.start.assign("year",a)}else{let a=ir(e.refDate,s,i);n.start.imply("year",a)}if(t[lae]){let a=K1(t[lae]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var pk,uae=v(()=>{Au();rt();ve();pa();pk=class extends q{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${pC})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=mC(t[1]),i=Cn(n);return Q.createRelativeFromReference(e.reference,i)}}});var mk,pae=v(()=>{Au();rt();ve();mk=class extends q{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${pC})(?=\\W|$)`,"i")}innerExtract(e,t){let n=mC(t[1]);return Q.createRelativeFromReference(e.reference,n)}}});var fk,mae=v(()=>{Au();rt();ve();pa();Dt();fk=class extends q{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${W1})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${se(lk)})(?:\\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]?Y1(t[1]):1,i=lk[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=Cn(s)),Q.createRelativeFromReference(e.reference,s)}}});var J1={};et(J1,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>Z1,createCasualConfiguration:()=>fae,createConfiguration:()=>Q1,parse:()=>Fze,parseDate:()=>$ze,strict:()=>Lze});function Fze(r,e,t){return Z1.parse(r,e,t)}function $ze(r,e,t){return Z1.parseDate(r,e,t)}function fae(r=!0){let e=Q1(!1,r);return e.parsers.unshift(new nk),e.parsers.unshift(new ik),e.parsers.unshift(new fk),e}function Q1(r=!0,e=!0){return Yr({parsers:[new $n(e),new uk,new sk,new dk,new pk,new mk,new ck],refiners:[new ak,new ok]},r)}var Z1,Lze,hae=v(()=>{da();_s();rt();Nt();Yse();Gse();cd();Kse();Zse();Qse();rae();aae();dae();uae();pae();mae();Z1=new Oe(fae()),Lze=new Oe(Q1(!0))});function as(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,jze)}function jze(r){return String.fromCharCode(r.charCodeAt(0)-65248)}function Bm(r){let e=0;for(let t=0;t{Nl={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10},jg={\u65E5:0,\u6708:1,\u706B:2,\u6C34:3,\u6728:4,\u91D1:5,\u571F:6}});var yae,zze,gae,Bze,X1,qze,Hze,Uze,hk,vae=v(()=>{zg();un();yae=Ke(Wt(),1),zze=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,gae=1,Bze=2,X1=3,qze=4,Hze=5,Uze=6,hk=class{pattern(){return zze}extract(e,t){let n=parseInt(as(t[Hze])),i=parseInt(as(t[Uze])),s=e.createParsingComponents({day:i,month:n});if(t[gae]&&t[gae].match("\u540C|\u4ECA|\u672C")){let a=(0,yae.default)(e.refDate);s.assign("year",a.year())}if(t[Bze]){let a=t[qze],o=a=="\u5143"?1:parseInt(as(a));t[X1]=="\u4EE4\u548C"?o+=2018:t[X1]=="\u5E73\u6210"?o+=1988:t[X1]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=ir(e.refDate,i,n);s.imply("year",a)}return s}}});var gk,bae=v(()=>{Ya();gk=class extends zr{patternBetween(){return/^\s*(から|-|ー|-|~|~)\s*$/i}}});function Wze(r){switch(r){case"\u304D\u3087\u3046":return"\u4ECA\u65E5";case"\u307B\u3093\u3058\u3064":return"\u672C\u65E5";case"\u304D\u306E\u3046":return"\u6628\u65E5";case"\u3042\u3057\u305F":return"\u660E\u65E5";case"\u3053\u3093\u3084":return"\u4ECA\u591C";case"\u3053\u3093\u3086\u3046":return"\u4ECA\u5915";case"\u3053\u3093\u3070\u3093":return"\u4ECA\u6669";case"\u3051\u3055":return"\u4ECA\u671D";default:return r}}var Tae,Vze,yk,kae=v(()=>{Tae=Ke(Wt(),1);Nt();ua();Vze=/今日|きょう|本日|ほんじつ|昨日|きのう|明日|あした|今夜|こんや|今夕|こんゆう|今晩|こんばん|今朝|けさ/i;yk=class{pattern(){return Vze}extract(e,t){let n=Wze(t[0]),i=(0,Tae.default)(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Ni(e.reference);case"\u660E\u65E5":return Ri(e.reference);case"\u672C\u65E5":case"\u4ECA\u65E5":return Xn(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",$.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",$.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}}});var Yze,vk,wae=v(()=>{zg();Vo();Yze=new RegExp("((?\u524D\u306E|\u6B21\u306E|\u4ECA\u9031))?(?"+Object.keys(jg).join("|")+")(?:\u66DC\u65E5|\u66DC)","i"),vk=class{pattern(){return Yze}extract(e,t){let n=t.groups.weekday,i=jg[n];if(i===void 0)return null;let s=t.groups.prefix||"",a=null;return s.match(/前の/)?a="last":s.match(/次の/)?a="next":s.match(/今週/)&&(a="this"),Pn(e.reference,i,a)}}});var Gze,Sae,Kze,Zze,bk,xae=v(()=>{un();zg();Gze=new RegExp("([0-9\uFF10-\uFF19]{4}[\\/|\\\uFF0F])?([0-1\uFF10-\uFF11]{0,1}[0-9\uFF10-\uFF19]{1})(?:[\\/|\\\uFF0F]([0-3\uFF10-\uFF13]{0,1}[0-9\uFF10-\uFF19]{1}))","i"),Sae=1,Kze=2,Zze=3,bk=class{pattern(){return Gze}extract(e,t){let n=e.createParsingComponents(),i=parseInt(as(t[Kze])),s=parseInt(as(t[Zze]));if(i<1||i>12||s<1||s>31)return null;if(n.assign("day",s),n.assign("month",i),t[Sae]){let a=parseInt(as(t[Sae])),o=Cs(a);n.assign("year",o)}else{let a=ir(e.reference.instant,s,i);n.imply("year",a)}return n}}});var Qze,Jze,fC,hC,Iu,Bg,gC,Tk,Eae=v(()=>{ve();Nt();zg();Qze=new RegExp("(?:(\u5348\u524D|\u5348\u5F8C|A.M.|P.M.|AM|PM))?(?:[\\s,\uFF0C\u3001]*)(?:([0-9\uFF10-\uFF19]+|["+Object.keys(Nl).join("")+"]+)(?:\\s*)(?:\u6642|:|\uFF1A)(?:\\s*)([0-9\uFF10-\uFF19]+|\u534A|["+Object.keys(Nl).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)([0-9\uFF10-\uFF19]+|["+Object.keys(Nl).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Jze=new RegExp("(?:^\\s*(?:\u304B\u3089|\\-|\\\u2013|\\\uFF0D|\\~|\\\u301C)\\s*)(?:(\u5348\u524D|\u5348\u5F8C|A.M.|P.M.|AM|PM))?(?:[\\s,\uFF0C\u3001]*)(?:([0-9\uFF10-\uFF19]+|["+Object.keys(Nl).join("")+"]+)(?:\\s*)(?:\u6642|:|\uFF1A)(?:\\s*)([0-9\uFF10-\uFF19]+|\u534A|["+Object.keys(Nl).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)([0-9\uFF10-\uFF19]+|["+Object.keys(Nl).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),fC=1,hC=2,Iu=3,Bg=4,gC=5,Tk=class extends q{innerPattern(){return Qze}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=e.createParsingResult(t.index,t[0]),i=0,s=0,a=-1;if(t[Bg]){let o=parseInt(as(t[Bg]));if(isNaN(o)&&(o=Bm(t[Bg])),o>=60)return null;n.start.assign("second",o)}if(i=parseInt(as(t[hC])),isNaN(i)&&(i=Bm(t[hC])),t[Iu]?t[Iu]==="\u534A"?s=30:(s=parseInt(as(t[Iu])),isNaN(s)&&(s=Bm(t[Iu]))):i>100&&(s=i%100,i=Math.floor(i/100)),s>=60||i>24)return null;if(i>=12&&(a=$.PM),t[fC]){if(i>12)return null;let o=t[fC],l=o[0].toLowerCase();o==="\u5348\u524D"||l==="a"?(a=$.AM,i===12&&(i=0)):(o==="\u5348\u5F8C"||l==="p")&&(a=$.PM,i!=12&&(i+=12))}else if(t[gC]){if(i>12)return null;let o=t[gC][0].toLowerCase();o==="a"&&(a=$.AM,i===12&&(i=0)),o==="p"&&(a=$.PM,i!=12&&(i+=12))}if(n.start.assign("hour",i),n.start.assign("minute",s),a>=0?n.start.assign("meridiem",a):i<12?n.start.imply("meridiem",0):n.start.imply("meridiem",1),t=Jze.exec(e.text.substring(n.index+n.text.length)),!t)return n.text.match(/^\d+$/)?null:n;if(n.end=e.createParsingComponents(),i=0,s=0,a=-1,t[Bg]){let o=parseInt(as(t[Bg]));if(isNaN(o)&&(o=Bm(t[Bg])),o>=60)return null;n.end.assign("second",o)}if(i=parseInt(as(t[hC])),isNaN(i)&&(i=Bm(t[hC])),t[Iu]?t[Iu]==="\u534A"?s=30:(s=parseInt(as(t[Iu])),isNaN(s)&&(s=Bm(t[Iu]))):i>100&&(s=i%100,i=Math.floor(i/100)),s>=60||i>24)return null;if(i>=12&&(a=$.PM),t[fC]){if(i>12)return null;let o=t[fC],l=o[0].toLowerCase();o==="\u5348\u524D"||l==="a"?(a=$.AM,i===12&&(i=0)):(o==="\u5348\u5F8C"||l==="p")&&(a=$.PM,i!=12&&(i+=12)),n.start.isCertain("meridiem")||(a===$.AM?(n.start.imply("meridiem",$.AM),n.start.get("hour")===12&&n.start.assign("hour",0)):(n.start.imply("meridiem",1),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}else if(t[gC]){if(i>12)return null;let o=t[gC][0].toLowerCase();o==="a"&&(a=$.AM,i===12&&(i=0)),o==="p"&&(a=$.PM,i!=12&&(i+=12))}return n.text=n.text+t[0],n.end.assign("hour",i),n.end.assign("minute",s),a>=0?n.end.assign("meridiem",a):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>i?n.end.imply("meridiem",$.AM):i<=12&&(n.end.assign("hour",i+12),n.end.assign("meridiem",$.PM)):i>12?n.end.imply("meridiem",$.PM):i<=12&&n.end.imply("meridiem",$.AM),n.end.date().getTime(){Ga();kk=class extends Br{patternBetween(){return/^\s*(の)?\s*$/i}}});var wk,Cae=v(()=>{od();wk=class extends Ps{mergeResults(e,t,n){let i=t.clone();return i.text=t.text+e+n.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isCertain("day")&&n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&e.match(/^[,、の]?\s*$/)!==null}}});var Xze,Sk,Pae=v(()=>{zg();Vo();Xze=new RegExp("(?:\\(|\\\uFF08)(?"+Object.keys(jg).join("|")+")(?:\\)|\\\uFF09)","i"),Sk=class{pattern(){return Xze}extract(e,t){let n=t.groups.weekday,i=jg[n];return i===void 0?null:Pn(e.reference,i)}}});var rF={};et(rF,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>eF,createCasualConfiguration:()=>_ae,createConfiguration:()=>tF,parse:()=>t2e,parseDate:()=>r2e,strict:()=>e2e});function t2e(r,e,t){return eF.parse(r,e,t)}function r2e(r,e,t){return eF.parseDate(r,e,t)}function _ae(){let r=tF(!1);return r.parsers.unshift(new yk),r}function tF(r=!0){let e=Yr({parsers:[new hk,new vk,new Sk,new bk,new Tk],refiners:[new wk,new kk,new gk]},r);return e.refiners=e.refiners.filter(t=>!(t instanceof Lm)),e}var eF,e2e,Mae=v(()=>{vae();bae();kae();wae();xae();Eae();Dae();_s();rt();Nt();Cae();Pae();da();_1();eF=new Oe(_ae()),e2e=new Oe(tF(!0))});function Iae(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)}var nF,iF,Aae,yC=v(()=>{nF={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},iF={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},Aae="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?"});var n2e,i2e,s2e,a2e,xk,Nae=v(()=>{yC();Dt();ve();Vo();n2e=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${se(nF)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),i2e=1,s2e=2,a2e=3,xk=class extends q{innerPattern(){return n2e}innerExtract(e,t){let n=t[s2e].toLowerCase(),i=nF[n];if(i===void 0)return null;let s=t[i2e],a=t[a2e],o=s||a||"";o=o.toLowerCase();let l=null;return o=="passado"?l="this":o=="pr\xF3ximo"||o=="proximo"?l="next":o=="este"&&(l="this"),Pn(e.reference,i,l)}}});var Ek,Rae=v(()=>{ad();Ek=class extends Jn{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}}});var Dk,Oae=v(()=>{Ga();Dk=class extends Br{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}}});var Ck,Lae=v(()=>{Ya();Ck=class extends zr{patternBetween(){return/^\s*(?:-)\s*$/i}}});var o2e,Fae,$ae,l2e,jae,Pk,zae=v(()=>{un();yC();yC();Dt();ve();o2e=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*)(${se(iF)})(?:\\s*(?:de|,)?\\s*(${Aae}))?(?=\\W|$)`,"i"),Fae=1,$ae=2,l2e=3,jae=4,Pk=class extends q{innerPattern(){return o2e}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=iF[t[l2e].toLowerCase()],s=parseInt(t[Fae]);if(s>31)return t.index=t.index+t[Fae].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[jae]){let a=Iae(t[jae]);n.start.assign("year",a)}else{let a=ir(e.refDate,s,i);n.start.imply("year",a)}if(t[$ae]){let a=parseInt(t[$ae]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var _k,Bae=v(()=>{ve();ua();_k=class extends q{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 Ii(e.reference);case"hoje":return Xn(e.reference);case"amanha":case"amanh\xE3":return Ri(e.reference);case"ontem":return Ni(e.reference)}return i}}});var qae,Mk,Hae=v(()=>{Nt();ve();ca();qae=Ke(Wt(),1),Mk=class extends q{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=(0,qae.default)(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",$.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",$.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",$.AM),i.imply("hour",6);break;case"meia-noite":Ho(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",$.AM),i.imply("hour",12);break}return i}}});var oF={};et(oF,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>sF,createCasualConfiguration:()=>Uae,createConfiguration:()=>aF,parse:()=>d2e,parseDate:()=>u2e,strict:()=>c2e});function d2e(r,e,t){return sF.parse(r,e,t)}function u2e(r,e,t){return sF.parseDate(r,e,t)}function Uae(r=!0){let e=aF(!1,r);return e.parsers.push(new _k),e.parsers.push(new Mk),e}function aF(r=!0,e=!0){return Yr({parsers:[new $n(e),new xk,new Ek,new Pk],refiners:[new Dk,new Ck]},r)}var sF,c2e,Vae=v(()=>{da();_s();rt();Nt();cd();Nae();Rae();Oae();Lae();zae();Bae();Hae();sF=new Oe(Uae()),c2e=new Oe(aF(!0))});var Ak,Wae=v(()=>{Ya();Ak=class extends zr{patternBetween(){return/^\s*(tot|-)\s*$/i}}});var Ik,Yae=v(()=>{Ga();Ik=class extends Br{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}}});var Nk,Gae=v(()=>{ve();ua();Nk=class extends q{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 Ii(e.reference);case"vandaag":return Xn(e.reference);case"morgen":case"morgend":return Ri(e.reference);case"gisteren":return Ni(e.reference)}return i}}});var Kae,p2e,m2e,Rk,Zae=v(()=>{Nt();ve();Kae=Ke(Wt(),1);ca();p2e=1,m2e=2,Rk=class extends q{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=(0,Kae.default)(e.refDate),i=e.createParsingComponents();switch(t[p2e]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[m2e].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",$.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",$.PM),i.imply("hour",20);break;case"middernacht":Ho(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",$.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",$.AM),i.imply("hour",12);break}return i}}});function h2e(r){let e=r.toLowerCase();return lF[e]!==void 0?lF[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}function pF(r){let e=r.toLowerCase();return cF[e]!==void 0?cF[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}function bC(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 Cs(e)}function Nu(r){let e={},t=r,n=Qae.exec(t);for(;n;)g2e(e,n),t=t.substring(n[0].length),n=Qae.exec(t);return e}function g2e(r,e){let t=h2e(e[1]),n=Ok[e[2].toLowerCase()];r[n]=t}var dF,dd,lF,cF,Ok,f2e,uF,vC,Jae,Qae,Rl,ma=v(()=>{Dt();un();dF={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},dd={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,mrt:3,"mrt.":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},lF={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12},cF={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},Ok={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"},f2e=`(?:${se(lF)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;uF=`(?:${se(cF)}|[0-9]{1,2}(?:ste|de)?)`;vC="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";Jae=`(${f2e})\\s{0,5}(${se(Ok)})\\s{0,5}`,Qae=new RegExp(Jae,"i"),Rl=ss("(?:(?:binnen|in)\\s*)?",Jae)});var Lk,Xae=v(()=>{ma();rt();ve();Lk=class extends q{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Rl+")(?=\\W|$)","i")}innerExtract(e,t){let n=Nu(t[1]);return Q.createRelativeFromReference(e.reference,n)}}});var y2e,v2e,b2e,T2e,Fk,eoe=v(()=>{ma();Dt();ve();Vo();y2e=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${se(dF)})(?=\\W|$)`,"i"),v2e=1,b2e=2,T2e=3,Fk=class extends q{innerPattern(){return y2e}innerExtract(e,t){let n=t[b2e].toLowerCase(),i=dF[n],s=t[v2e],a=t[T2e],o=s||a;o=o||"",o=o.toLowerCase();let l=null;return o=="vorige"?l="last":o=="volgende"?l="next":o=="deze"&&(l="this"),Pn(e.reference,i,l)}}});var k2e,w2e,toe,roe,noe,$k,ioe=v(()=>{un();ma();ma();ma();Dt();ve();k2e=new RegExp(`(?:on\\s*?)?(${uF})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${uF}))?(?:-|/|\\s*(?:of)?\\s*)(`+se(dd)+`)(?:(?:-|/|,?\\s*)(${vC}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),w2e=3,toe=1,roe=2,noe=4,$k=class extends q{innerPattern(){return k2e}innerExtract(e,t){let n=dd[t[w2e].toLowerCase()],i=pF(t[toe]);if(i>31)return t.index=t.index+t[toe].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[noe]){let l=bC(t[noe]);s.assign("year",l)}else{let l=ir(e.refDate,i,n);s.imply("year",l)}if(!t[roe])return s;let a=pF(t[roe]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}}});var S2e,x2e,soe,qg,aoe=v(()=>{ma();un();Dt();ma();ve();S2e=new RegExp(`(${se(dd)})\\s*(?:[,-]?\\s*(${vC})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),x2e=1,soe=2,qg=class extends q{innerPattern(){return S2e}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[x2e],s=dd[i.toLowerCase()];if(n.assign("month",s),t[soe]){let a=bC(t[soe]);n.assign("year",a)}else{let a=ir(e.refDate,1,s);n.imply("year",a)}return n}}});var E2e,D2e,C2e,jk,ooe=v(()=>{ve();E2e=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),D2e=1,C2e=2,jk=class extends q{innerPattern(){return E2e}innerExtract(e,t){let n=parseInt(t[C2e]),i=parseInt(t[D2e]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}}});var zk,loe=v(()=>{ad();zk=class extends Jn{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)}}});var P2e,_2e,M2e,coe,A2e,Bk,doe=v(()=>{ma();Dt();ve();P2e=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${se(dd)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),_2e=1,M2e=2,coe=3,A2e=4,Bk=class extends q{innerPattern(){return P2e}innerExtract(e,t){let n=t[coe]?parseInt(t[coe]):dd[t[M2e].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[_2e]);return{day:parseInt(t[A2e]),month:n,year:i}}}});var uoe,I2e,N2e,qk,poe=v(()=>{ve();Nt();ca();uoe=Ke(Wt(),1),I2e=1,N2e=2,qk=class extends q{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[I2e].toLowerCase(),i=t[N2e].toLowerCase(),s=e.createParsingComponents(),a=(0,uoe.default)(e.refDate);switch(n){case"gisteren":Ir(s,a.add(-1,"day"));break;case"van":Ir(s,a);break;case"morgen":Ho(s,a);break}switch(i){case"ochtend":s.imply("meridiem",$.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",$.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",$.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",$.PM),s.imply("hour",20);break}return s}}});var R2e,O2e,L2e,Hk,moe=v(()=>{ma();rt();ve();pa();R2e=new RegExp(`(dit|deze|vorig|afgelopen|(?:aan)?komend|over|\\+|-)e?\\s*(${Rl})(?=\\W|$)`,"i"),O2e=1,L2e=2,Hk=class extends q{innerPattern(){return R2e}innerExtract(e,t){let n=t[O2e].toLowerCase(),i=Nu(t[L2e]);switch(n){case"vorig":case"afgelopen":case"-":i=Cn(i);break}return Q.createRelativeFromReference(e.reference,i)}}});var foe,F2e,$2e,j2e,Uk,hoe=v(()=>{ma();rt();foe=Ke(Wt(),1);ve();Dt();F2e=new RegExp(`(dit|deze|(?:aan)?komend|volgend|afgelopen|vorig)e?\\s*(${se(Ok)})(?=\\s*)(?=\\W|$)`,"i"),$2e=1,j2e=2,Uk=class extends q{innerPattern(){return F2e}innerExtract(e,t){let n=t[$2e].toLowerCase(),i=t[j2e].toLowerCase(),s=Ok[i];if(n=="volgend"||n=="komend"||n=="aankomend"){let l={};return l[s]=1,Q.createRelativeFromReference(e.reference,l)}if(n=="afgelopen"||n=="vorig"){let l={};return l[s]=-1,Q.createRelativeFromReference(e.reference,l)}let a=e.createParsingComponents(),o=(0,foe.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}}});var z2e,B2e,Vk,goe=v(()=>{ma();rt();ve();pa();z2e=new RegExp("("+Rl+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),B2e=new RegExp("("+Rl+")geleden(?=(?:\\W|$))","i"),Vk=class extends q{constructor(t){super();M(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?B2e:z2e}innerExtract(t,n){let i=Nu(n[1]),s=Cn(i);return Q.createRelativeFromReference(t.reference,s)}}});var q2e,H2e,U2e,Wk,yoe=v(()=>{ma();rt();ve();q2e=new RegExp("("+Rl+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),H2e=new RegExp("("+Rl+")(later|vanaf nu)(?=(?:\\W|$))","i"),U2e=1,Wk=class extends q{constructor(t){super();M(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?H2e:q2e}innerExtract(t,n){let i=Nu(n[U2e]);return Q.createRelativeFromReference(t.reference,i)}}});var hF={};et(hF,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>mF,createCasualConfiguration:()=>voe,createConfiguration:()=>fF,parse:()=>W2e,parseDate:()=>Y2e,strict:()=>V2e});function W2e(r,e,t){return mF.parse(r,e,t)}function Y2e(r,e,t){return mF.parseDate(r,e,t)}function voe(r=!0){let e=fF(!1,r);return e.parsers.unshift(new Nk),e.parsers.unshift(new Rk),e.parsers.unshift(new qk),e.parsers.unshift(new qg),e.parsers.unshift(new Uk),e.parsers.unshift(new Hk),e}function fF(r=!0,e=!0){return Yr({parsers:[new $n(e),new Lk,new $k,new qg,new Fk,new Bk,new jk,new zk(r),new Vk(r),new Wk(r)],refiners:[new Ik,new Ak]},r)}var mF,V2e,boe=v(()=>{da();_s();rt();Nt();Wae();Yae();Gae();Zae();cd();Xae();eoe();ioe();aoe();ooe();loe();doe();poe();moe();hoe();goe();yoe();mF=new Oe(voe()),V2e=new Oe(fF(!0))});function Za(r){let e=0;for(let t=0;t{ei={\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},Hg={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6}});var woe,gF,koe,yF,qm,vF=v(()=>{woe=Ke(Wt(),1);ve();Ug();gF=1,koe=2,yF=3,qm=class extends q{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ei).join("")+"]{4}|["+Object.keys(ei).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ei).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ei).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=(0,woe.default)(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[koe]);if(isNaN(s)&&(s=Za(t[koe])),i.start.assign("month",s),t[yF]){let a=parseInt(t[yF]);isNaN(a)&&(a=Za(t[yF])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[gF]){let a=parseInt(t[gF]);isNaN(a)&&(a=Toe(t[gF])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}}});var Soe,G2e,bF,K2e,Hm,TF=v(()=>{Soe=Ke(Wt(),1);ve();Ug();G2e=new RegExp("(\\d+|["+Object.keys(ei).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"),bF=1,K2e=2,Hm=class extends q{innerPattern(){return G2e}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[bF]);if(isNaN(i)&&(i=Za(t[bF])),isNaN(i)){let l=t[bF];if(l==="\u51E0")i=3;else if(l==="\u534A")i=.5;else return null}let s=(0,Soe.default)(e.refDate),o=t[K2e][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)}}});var xoe,Z2e,Um,kF=v(()=>{xoe=Ke(Wt(),1);ve();Ug();Z2e=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(Hg).join("|")+")"),Um=class extends q{innerPattern(){return Z2e}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Hg[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 l=(0,xoe.default)(e.refDate),c=!1,d=l.day();return a=="last"||a=="past"?(l=l.day(s-7),c=!0):a=="next"?(l=l.day(s+7),c=!0):a=="this"?l=l.day(s):Math.abs(s-7-d){Eoe=Ke(Wt(),1);ve();Ug();Q2e=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(ei).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(ei).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(ei).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),J2e=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(ei).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(ei).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(ei).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),TC=1,kC=2,wC=3,SC=4,xC=5,EC=6,Qa=7,Vg=8,DC=9,Vm=class extends q{innerPattern(){return Q2e}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=(0,Eoe.default)(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[TC]){let d=t[TC];d=="\u660E"?n.hour()>1&&(s=s.add(1,"day")):d=="\u6628"?s=s.add(-1,"day"):d=="\u524D"?s=s.add(-2,"day"):d=="\u5927\u524D"?s=s.add(-3,"day"):d=="\u540E"?s=s.add(2,"day"):d=="\u5927\u540E"&&(s=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[SC]){let d=t[SC];d=="\u660E"?s=s.add(1,"day"):d=="\u6628"?s=s.add(-1,"day"):d=="\u524D"?s=s.add(-2,"day"):d=="\u5927\u524D"?s=s.add(-3,"day"):d=="\u540E"?s=s.add(2,"day"):d=="\u5927\u540E"&&(s=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,l=-1;if(t[Vg]){let d=parseInt(t[Vg]);if(isNaN(d)&&(d=Za(t[Vg])),d>=60)return null;i.start.assign("second",d)}if(a=parseInt(t[EC]),isNaN(a)&&(a=Za(t[EC])),t[Qa]?t[Qa]=="\u534A"?o=30:t[Qa]=="\u6B63"||t[Qa]=="\u6574"?o=0:(o=parseInt(t[Qa]),isNaN(o)&&(o=Za(t[Qa]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(l=1),t[DC]){if(a>12)return null;let d=t[DC][0].toLowerCase();d=="a"&&(l=0,a==12&&(a=0)),d=="p"&&(l=1,a!=12&&(a+=12))}else if(t[kC]){let u=t[kC][0];u=="\u65E9"?(l=0,a==12&&(a=0)):u=="\u665A"&&(l=1,a!=12&&(a+=12))}else if(t[wC]){let u=t[wC][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,a==12&&(a=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,a!=12&&(a+=12))}else if(t[xC]){let u=t[xC][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,a==12&&(a=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),l>=0?i.start.assign("meridiem",l):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=J2e.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let c=s.clone();if(i.end=e.createParsingComponents(),t[TC]){let d=t[TC];d=="\u660E"?n.hour()>1&&(c=c.add(1,"day")):d=="\u6628"?c=c.add(-1,"day"):d=="\u524D"?c=c.add(-2,"day"):d=="\u5927\u524D"?c=c.add(-3,"day"):d=="\u540E"?c=c.add(2,"day"):d=="\u5927\u540E"&&(c=c.add(3,"day")),i.end.assign("day",c.date()),i.end.assign("month",c.month()+1),i.end.assign("year",c.year())}else if(t[SC]){let d=t[SC];d=="\u660E"?c=c.add(1,"day"):d=="\u6628"?c=c.add(-1,"day"):d=="\u524D"?c=c.add(-2,"day"):d=="\u5927\u524D"?c=c.add(-3,"day"):d=="\u540E"?c=c.add(2,"day"):d=="\u5927\u540E"&&(c=c.add(3,"day")),i.end.assign("day",c.date()),i.end.assign("month",c.month()+1),i.end.assign("year",c.year())}else i.end.imply("day",c.date()),i.end.imply("month",c.month()+1),i.end.imply("year",c.year());if(a=0,o=0,l=-1,t[Vg]){let d=parseInt(t[Vg]);if(isNaN(d)&&(d=Za(t[Vg])),d>=60)return null;i.end.assign("second",d)}if(a=parseInt(t[EC]),isNaN(a)&&(a=Za(t[EC])),t[Qa]?t[Qa]=="\u534A"?o=30:t[Qa]=="\u6B63"||t[Qa]=="\u6574"?o=0:(o=parseInt(t[Qa]),isNaN(o)&&(o=Za(t[Qa]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(l=1),t[DC]){if(a>12)return null;let d=t[DC][0].toLowerCase();d=="a"&&(l=0,a==12&&(a=0)),d=="p"&&(l=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(l==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[kC]){let u=t[kC][0];u=="\u65E9"?(l=0,a==12&&(a=0)):u=="\u665A"&&(l=1,a!=12&&(a+=12))}else if(t[wC]){let u=t[wC][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,a==12&&(a=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,a!=12&&(a+=12))}else if(t[xC]){let u=t[xC][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,a==12&&(a=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),l>=0?i.end.assign("meridiem",l):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(){Doe=Ke(Wt(),1);ve();Ug();X2e=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(Hg).join("|")+")"),Wm=class extends q{innerPattern(){return X2e}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Hg[i];if(s===void 0)return null;let a=(0,Doe.default)(e.refDate),o=!1,l=a.day();return Math.abs(s-7-l){Moe=Ke(Wt(),1);ve();eBe=1,Coe=2,tBe=3,Poe=4,_oe=5,rBe=6,Ym=class extends q{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=(0,Moe.default)(e.refDate),a=s;if(t[eBe])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[Coe]){let o=t[Coe],l=t[tBe];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")),l=="\u65E9"||l=="\u671D"?i.start.imply("hour",6):l=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[Poe]){let l=t[Poe][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)}else if(t[_oe]){let o=t[_oe];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 l=t[rBe];if(l){let c=l[0];c=="\u65E9"||c=="\u671D"||c=="\u4E0A"?i.start.imply("hour",6):c=="\u4E0B"||c=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):c=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):c=="\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}}});function Ja(r){let e=0;for(let t=0;t{ti={\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},Wg={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6}});var Noe,EF,Ioe,DF,Gm,CF=v(()=>{Noe=Ke(Wt(),1);ve();Yg();EF=1,Ioe=2,DF=3,Gm=class extends q{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ti).join("")+"]{4}|["+Object.keys(ti).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ti).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ti).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=(0,Noe.default)(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[Ioe]);if(isNaN(s)&&(s=Ja(t[Ioe])),i.start.assign("month",s),t[DF]){let a=parseInt(t[DF]);isNaN(a)&&(a=Ja(t[DF])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[EF]){let a=parseInt(t[EF]);isNaN(a)&&(a=Aoe(t[EF])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}}});var Roe,nBe,PF,iBe,Km,_F=v(()=>{Roe=Ke(Wt(),1);ve();Yg();nBe=new RegExp("(\\d+|["+Object.keys(ti).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"),PF=1,iBe=2,Km=class extends q{innerPattern(){return nBe}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[PF]);if(isNaN(i)&&(i=Ja(t[PF])),isNaN(i)){let l=t[PF];if(l==="\u5E7E")i=3;else if(l==="\u534A")i=.5;else return null}let s=(0,Roe.default)(e.refDate),o=t[iBe][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)}}});var Ooe,sBe,Zm,MF=v(()=>{Ooe=Ke(Wt(),1);ve();Yg();sBe=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Wg).join("|")+")"),Zm=class extends q{innerPattern(){return sBe}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Wg[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 l=(0,Ooe.default)(e.refDate),c=!1,d=l.day();return a=="last"||a=="past"?(l=l.day(s-7),c=!0):a=="next"?(l=l.day(s+7),c=!0):a=="this"?l=l.day(s):Math.abs(s-7-d){Loe=Ke(Wt(),1);ve();Yg();aBe=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(ti).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(ti).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(ti).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),oBe=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(ti).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(ti).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(ti).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),CC=1,PC=2,_C=3,MC=4,AC=5,IC=6,Xa=7,Gg=8,NC=9,Qm=class extends q{innerPattern(){return aBe}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=(0,Loe.default)(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[CC]){var a=t[CC];a=="\u660E"||a=="\u807D"?n.hour()>1&&(s=s.add(1,"day")):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s=s.add(-1,"day"):a=="\u524D"?s=s.add(-2,"day"):a=="\u5927\u524D"?s=s.add(-3,"day"):a=="\u5F8C"?s=s.add(2,"day"):a=="\u5927\u5F8C"&&(s=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[MC]){var o=t[MC];o=="\u660E"||o=="\u807D"?s=s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s=s.add(-1,"day"):o=="\u524D"?s=s.add(-2,"day"):o=="\u5927\u524D"?s=s.add(-3,"day"):o=="\u5F8C"?s=s.add(2,"day"):o=="\u5927\u5F8C"&&(s=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 l=0,c=0,d=-1;if(t[Gg]){var u=parseInt(t[Gg]);if(isNaN(u)&&(u=Ja(t[Gg])),u>=60)return null;i.start.assign("second",u)}if(l=parseInt(t[IC]),isNaN(l)&&(l=Ja(t[IC])),t[Xa]?t[Xa]=="\u534A"?c=30:t[Xa]=="\u6B63"||t[Xa]=="\u6574"?c=0:(c=parseInt(t[Xa]),isNaN(c)&&(c=Ja(t[Xa]))):l>100&&(c=l%100,l=Math.floor(l/100)),c>=60||l>24)return null;if(l>=12&&(d=1),t[NC]){if(l>12)return null;var p=t[NC][0].toLowerCase();p=="a"&&(d=0,l==12&&(l=0)),p=="p"&&(d=1,l!=12&&(l+=12))}else if(t[PC]){var m=t[PC],f=m[0];f=="\u671D"||f=="\u65E9"?(d=0,l==12&&(l=0)):f=="\u665A"&&(d=1,l!=12&&(l+=12))}else if(t[_C]){var h=t[_C],g=h[0];g=="\u4E0A"||g=="\u671D"||g=="\u65E9"||g=="\u51CC"?(d=0,l==12&&(l=0)):(g=="\u4E0B"||g=="\u664F"||g=="\u665A")&&(d=1,l!=12&&(l+=12))}else if(t[AC]){var y=t[AC],k=y[0];k=="\u4E0A"||k=="\u671D"||k=="\u65E9"||k=="\u51CC"?(d=0,l==12&&(l=0)):(k=="\u4E0B"||k=="\u664F"||k=="\u665A")&&(d=1,l!=12&&(l+=12))}if(i.start.assign("hour",l),i.start.assign("minute",c),d>=0?i.start.assign("meridiem",d):l<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=oBe.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let T=s.clone();if(i.end=e.createParsingComponents(),t[CC]){var a=t[CC];a=="\u660E"||a=="\u807D"?n.hour()>1&&(T=T.add(1,"day")):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?T=T.add(-1,"day"):a=="\u524D"?T=T.add(-2,"day"):a=="\u5927\u524D"?T=T.add(-3,"day"):a=="\u5F8C"?T=T.add(2,"day"):a=="\u5927\u5F8C"&&(T=T.add(3,"day")),i.end.assign("day",T.date()),i.end.assign("month",T.month()+1),i.end.assign("year",T.year())}else if(t[MC]){var o=t[MC];o=="\u660E"||o=="\u807D"?T=T.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?T=T.add(-1,"day"):o=="\u524D"?T=T.add(-2,"day"):o=="\u5927\u524D"?T=T.add(-3,"day"):o=="\u5F8C"?T=T.add(2,"day"):o=="\u5927\u5F8C"&&(T=T.add(3,"day")),i.end.assign("day",T.date()),i.end.assign("month",T.month()+1),i.end.assign("year",T.year())}else i.end.imply("day",T.date()),i.end.imply("month",T.month()+1),i.end.imply("year",T.year());if(l=0,c=0,d=-1,t[Gg]){var u=parseInt(t[Gg]);if(isNaN(u)&&(u=Ja(t[Gg])),u>=60)return null;i.end.assign("second",u)}if(l=parseInt(t[IC]),isNaN(l)&&(l=Ja(t[IC])),t[Xa]?t[Xa]=="\u534A"?c=30:t[Xa]=="\u6B63"||t[Xa]=="\u6574"?c=0:(c=parseInt(t[Xa]),isNaN(c)&&(c=Ja(t[Xa]))):l>100&&(c=l%100,l=Math.floor(l/100)),c>=60||l>24)return null;if(l>=12&&(d=1),t[NC]){if(l>12)return null;var p=t[NC][0].toLowerCase();p=="a"&&(d=0,l==12&&(l=0)),p=="p"&&(d=1,l!=12&&(l+=12)),i.start.isCertain("meridiem")||(d==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[PC]){var m=t[PC],f=m[0];f=="\u671D"||f=="\u65E9"?(d=0,l==12&&(l=0)):f=="\u665A"&&(d=1,l!=12&&(l+=12))}else if(t[_C]){var h=t[_C],g=h[0];g=="\u4E0A"||g=="\u671D"||g=="\u65E9"||g=="\u51CC"?(d=0,l==12&&(l=0)):(g=="\u4E0B"||g=="\u664F"||g=="\u665A")&&(d=1,l!=12&&(l+=12))}else if(t[AC]){var y=t[AC],k=y[0];k=="\u4E0A"||k=="\u671D"||k=="\u65E9"||k=="\u51CC"?(d=0,l==12&&(l=0)):(k=="\u4E0B"||k=="\u664F"||k=="\u665A")&&(d=1,l!=12&&(l+=12))}return i.text=i.text+t[0],i.end.assign("hour",l),i.end.assign("minute",c),d>=0?i.end.assign("meridiem",d):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>l?i.end.imply("meridiem",0):l>12&&i.end.imply("meridiem",1),i.end.date().getTime(){Foe=Ke(Wt(),1);ve();Yg();lBe=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Wg).join("|")+")"),Jm=class extends q{innerPattern(){return lBe}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Wg[i];if(s===void 0)return null;let a=(0,Foe.default)(e.refDate),o=!1,l=a.day();return Math.abs(s-7-l){Ya();Xm=class extends zr{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}}});var ef,RF=v(()=>{Ga();ef=class extends Br{patternBetween(){return/^\s*$/i}}});var RC={};et(RC,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>OF,createCasualConfiguration:()=>LF,createConfiguration:()=>FF,hant:()=>cBe,parse:()=>uBe,parseDate:()=>pBe,strict:()=>dBe});function uBe(r,e,t){return OF.parse(r,e,t)}function pBe(r,e,t){return OF.parseDate(r,e,t)}function LF(){let r=FF();return r.parsers.unshift(new Ym),r}function FF(){let r=Yr({parsers:[new Gm,new Zm,new Jm,new Qm,new Km],refiners:[new Xm,new ef]});return r.refiners=r.refiners.filter(e=>!(e instanceof Uo)),r}var cBe,OF,dBe,$oe=v(()=>{NT();da();_s();rt();Nt();xF();CF();_F();MF();AF();IF();NF();RF();cBe=new Oe(LF()),OF=new Oe(LF()),dBe=new Oe(FF())});var qoe,mBe,joe,fBe,zoe,Boe,hBe,Yk,Hoe=v(()=>{qoe=Ke(Wt(),1);ve();mBe=1,joe=2,fBe=3,zoe=4,Boe=5,hBe=6,Yk=class extends q{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=(0,qoe.default)(e.refDate),a=s;if(t[mBe])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[joe]){let o=t[joe],l=t[fBe];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")),l=="\u65E9"?i.start.imply("hour",6):l=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[zoe]){let l=t[zoe][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)}else if(t[Boe]){let o=t[Boe];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 l=t[hBe];if(l){let c=l[0];c=="\u65E9"||c=="\u4E0A"?i.start.imply("hour",6):c=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):c=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):c=="\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}}});var Gk,Uoe=v(()=>{Ya();Gk=class extends zr{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}}});var Kk,Voe=v(()=>{Ga();Kk=class extends Br{patternBetween(){return/^\s*$/i}}});var OC={};et(OC,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>$F,createCasualConfiguration:()=>jF,createConfiguration:()=>zF,hans:()=>gBe,parse:()=>vBe,parseDate:()=>bBe,strict:()=>yBe});function vBe(r,e,t){return $F.parse(r,e,t)}function bBe(r,e,t){return $F.parseDate(r,e,t)}function jF(){let r=zF();return r.parsers.unshift(new Yk),r}function zF(){let r=Yr({parsers:[new qm,new Um,new Wm,new Vm,new Hm],refiners:[new Gk,new Kk]});return r.refiners=r.refiners.filter(e=>!(e instanceof Uo)),r}var gBe,$F,yBe,Woe=v(()=>{NT();da();_s();rt();Nt();Hoe();vF();TF();kF();wF();SF();Uoe();Voe();gBe=new Oe(jF()),$F=new Oe(jF()),yBe=new Oe(zF())});var HF={};et(HF,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>BF,createCasualConfiguration:()=>Yoe,createConfiguration:()=>qF,hans:()=>OC,hant:()=>RC,parse:()=>kBe,parseDate:()=>wBe,strict:()=>TBe});function kBe(r,e,t){return BF.parse(r,e,t)}function wBe(r,e,t){return BF.parseDate(r,e,t)}function Yoe(){let r=qF();return r.parsers.unshift(new Ym),r}function qF(){let r=Yr({parsers:[new Gm,new qm,new Zm,new Um,new Jm,new Wm,new Qm,new Vm,new Km,new Hm],refiners:[new Xm,new ef]});return r.refiners=r.refiners.filter(e=>!(e instanceof Uo)),r}var BF,TBe,Goe=v(()=>{da();_s();rt();Nt();NT();vF();TF();kF();wF();SF();xF();CF();_F();MF();AF();IF();NF();RF();$oe();Woe();BF=new Oe(Yoe()),TBe=new Oe(qF())});function xBe(r){let e=r.toLowerCase();return VF[e]!==void 0?VF[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}function ZF(r){let e=r.toLowerCase();return WF[e]!==void 0?WF[e]:parseInt(e)}function FC(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 Cs(e)}function Qg(r){let e={},t=r,n=Koe.exec(t);for(;n;)EBe(e,n),t=t.substring(n[0].length).trim(),n=Koe.exec(t);return e}function EBe(r,e){let t=xBe(e[1]),n=Zk[e[2].toLowerCase()];r[n]=t}var fa,YF,GF,Kg,VF,WF,Zk,SBe,KF,UF,LC,Zoe,Koe,Zg,ha=v(()=>{Dt();un();fa={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"},YF={\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},GF={\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\u0430\u043B\u044C:2,\u0444\u0435\u0432\u0440\u0430\u043B\u044F:2,\u0444\u0435\u0432\u0440\u0430\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},Kg={...GF,\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},VF={\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\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},WF={\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},Zk={\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",\u043C\u0438\u043D\u0443\u0442\u043E\u0447\u0435\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u0447\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u0447\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"},SBe=`(?:${se(VF)}|[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})`;KF=`(?:${se(WF)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;UF="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?",LC=`(?:[1-9][0-9]{0,3}${UF}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${UF}|[5-9][0-9]${UF})`;Zoe=`(${SBe})\\s{0,3}(${se(Zk)})`,Koe=new RegExp(Zoe,"i"),Zg=ss("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",Zoe)});var Qoe,Qk,Joe=v(()=>{ha();rt();ve();Qoe=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Zg})${fa.rightBoundary}`,Qk=class extends q{patternLeftBoundary(){return fa.leftBoundary}innerPattern(e){return e.option.forwardDate?new RegExp(Qoe,fa.flags):new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${Qoe}`,fa.flags)}innerExtract(e,t){let n=Qg(t[1]);return Q.createRelativeFromReference(e.reference,n)}}});var tf,Ms,ud=v(()=>{ve();ha();tf=class extends q{patternLeftBoundary(){return fa.leftBoundary}innerPattern(e){return new RegExp(this.innerPatternString(e),fa.flags)}innerPatternHasChange(e,t){return!1}},Ms=class extends tf{innerPattern(e){return new RegExp(`${this.innerPatternString(e)}${fa.rightBoundary}`,fa.flags)}}});var Xoe,ele,DBe,tle,Jk,rle=v(()=>{un();ha();ha();ha();Dt();ud();Xoe=1,ele=2,DBe=3,tle=4,Jk=class extends Ms{innerPatternString(e){return`(?:\u0441)?\\s*(${KF})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${KF}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${se(Kg)})(?:(?:-|\\/|,?\\s{0,3})(${LC}(?![^\\s]\\d)))?`}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Kg[t[DBe].toLowerCase()],s=ZF(t[Xoe]);if(s>31)return t.index=t.index+t[Xoe].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[tle]){let a=FC(t[tle]);n.start.assign("year",a)}else{let a=ir(e.refDate,s,i);n.start.imply("year",a)}if(t[ele]){let a=ZF(t[ele]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var CBe,nle,Xk,ile=v(()=>{ha();un();Dt();ha();ud();CBe=2,nle=3,Xk=class extends tf{innerPatternString(e){return`((?:\u0432)\\s*)?(${se(Kg)})\\s*(?:[,-]?\\s*(${LC})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`}innerExtract(e,t){let n=t[CBe].toLowerCase();if(t[0].length<=3&&!GF[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=Kg[n];if(i.start.assign("month",s),t[nle]){let a=FC(t[nle]);i.start.assign("year",a)}else{let a=ir(e.refDate,1,s);i.start.imply("year",a)}return i}}});var ew,sle=v(()=>{Nt();ad();ha();ew=class extends Jn{constructor(e){super(e)}patternFlags(){return fa.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))?(?!\\/)${fa.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",$.PM)):i<6&&n.assign("meridiem",$.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("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",$.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}}});var tw,ale=v(()=>{ha();rt();pa();ud();tw=class extends tf{innerPatternString(e){return`(${Zg})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`}innerExtract(e,t){let n=Qg(t[1]),i=Cn(n);return Q.createRelativeFromReference(e.reference,i)}}});var rw,ole=v(()=>{Ya();rw=class extends zr{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}}});var nw,lle=v(()=>{Ga();nw=class extends Br{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}}});var iw,cle=v(()=>{ua();ud();iw=class extends Ms{innerPatternString(e){return"(?:\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\u0441\u043B\u0435\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)"}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return Xn(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return Ni(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return Ri(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Il(e.reference,2);case"\u043F\u043E\u0441\u043B\u0435\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Il(e.reference,3);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Fm(e.reference,2);case"\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Fm(e.reference,3)}return i}}});var dle,sw,ule=v(()=>{ua();ca();dle=Ke(Wt(),1);ud();sw=class extends Ms{innerPatternString(e){return"(\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)"}innerExtract(e,t){let n=(0,dle.default)(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return Ii(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return Og(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return Lg(e.reference);if(i.match(/в\s*полдень/))return Fg(e.reference);if(i.match(/прошлой\s*ночью/))return oC(e.reference);if(i.match(/прошлым\s*вечером/))return lC(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),Ir(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?$m(e.reference):s}}});var PBe,_Be,MBe,aw,ple=v(()=>{ha();Dt();Vo();ud();PBe=1,_Be=2,MBe=3,aw=class extends Ms{innerPatternString(e){return`(?:(?:,|\\(|\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*)?(${se(YF)})(?:\\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)?`}innerExtract(e,t){let n=t[_Be].toLowerCase(),i=YF[n],s=t[PBe],a=t[MBe],o=s||a;o=o||"",o=o.toLowerCase();let l=null;return o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?l="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"?l="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(l="this"),Pn(e.reference,i,l)}}});var mle,ABe,IBe,ow,fle=v(()=>{ha();rt();mle=Ke(Wt(),1);Dt();ud();ABe=1,IBe=2,ow=class extends Ms{innerPatternString(e){return`(\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*(${se(Zk)})`}innerExtract(e,t){let n=t[ABe].toLowerCase(),i=t[IBe].toLowerCase(),s=Zk[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 l={};return l[s]=1,Q.createRelativeFromReference(e.reference,l)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let l={};return l[s]=-1,Q.createRelativeFromReference(e.reference,l)}let a=e.createParsingComponents(),o=(0,mle.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}}});var lw,hle=v(()=>{ha();rt();pa();ud();lw=class extends Ms{innerPatternString(e){return`(\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|\u0441\u043F\u0443\u0441\u0442\u044F|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${Zg})`}innerExtract(e,t){let n=t[1].toLowerCase(),i=Qg(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=Cn(i);break}return Q.createRelativeFromReference(e.reference,i)}}});var XF={};et(XF,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>QF,createCasualConfiguration:()=>gle,createConfiguration:()=>JF,parse:()=>RBe,parseDate:()=>OBe,strict:()=>NBe});function RBe(r,e,t){return QF.parse(r,e,t)}function OBe(r,e,t){return QF.parseDate(r,e,t)}function gle(){let r=JF(!1);return r.parsers.unshift(new iw),r.parsers.unshift(new sw),r.parsers.unshift(new Xk),r.parsers.unshift(new ow),r.parsers.unshift(new lw),r}function JF(r=!0){return Yr({parsers:[new $n(!0),new Qk,new Jk,new aw,new ew(r),new tw],refiners:[new nw,new rw]},r)}var QF,NBe,yle=v(()=>{Joe();rle();ile();sle();ale();ole();lle();da();cle();ule();ple();fle();_s();rt();Nt();cd();hle();QF=new Oe(gle()),NBe=new Oe(JF(!0))});function FBe(r){let e=r.toLowerCase();return e$[e]!==void 0?e$[e]:e==="un"||e==="una"||e==="uno"?1:e.match(/algunos?/)||e.match(/unos?/)?3:e.match(/media?/)?.5:parseFloat(e)}function kle(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)}function xle(r){let e={},t=r,n=vle.exec(t);for(;n;)$Be(e,n),t=t.substring(n[0].length),n=vle.exec(t);return e}function $Be(r,e){let t=FBe(e[1]),n=ble[e[2].toLowerCase()];r[n]=t}var t$,r$,e$,ble,LBe,Tle,wle,vle,Sle,cw=v(()=>{Dt();t$={domingo:0,dom:0,lunes:1,lun:1,martes:2,mar:2,mi\u00E9rcoles:3,miercoles:3,mi\u00E9:3,mie:3,jueves:4,jue:4,viernes:5,vie:5,s\u00E1bado:6,sabado:6,s\u00E1b:6,sab:6},r$={enero:1,ene:1,"ene.":1,febrero:2,feb:2,"feb.":2,marzo:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,mayo:5,may:5,"may.":5,junio:6,jun:6,"jun.":6,julio:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,septiembre:9,setiembre:9,sep:9,"sep.":9,octubre:10,oct:10,"oct.":10,noviembre:11,nov:11,"nov.":11,diciembre:12,dic:12,"dic.":12},e$={uno:1,dos:2,tres:3,cuatro:4,cinco:5,seis:6,siete:7,ocho:8,nueve:9,diez:10,once:11,doce:12,trece:13},ble={sec:"second",segundo:"second",segundos:"second",min:"minute",mins:"minute",minuto:"minute",minutos:"minute",h:"hour",hr:"hour",hrs:"hour",hora:"hour",horas:"hour",d\u00EDa:"d",d\u00EDas:"d",semana:"week",semanas:"week",mes:"month",meses:"month",cuarto:"quarter",cuartos:"quarter",a\u00F1o:"year",a\u00F1os:"year"},LBe=`(?:${se(e$)}|[0-9]+|[0-9]+\\.[0-9]+|un?|uno?|una?|algunos?|unos?|demi-?)`;Tle="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";wle=`(${LBe})\\s{0,5}(${se(ble)})\\s{0,5}`,vle=new RegExp(wle,"i"),Sle=ss("",wle)});var jBe,zBe,BBe,qBe,dw,Ele=v(()=>{cw();Dt();ve();Vo();jBe=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|pasado|pr[o\xF3]ximo)\\s*)?(${se(t$)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|pasado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),zBe=1,BBe=2,qBe=3,dw=class extends q{innerPattern(){return jBe}innerExtract(e,t){let n=t[BBe].toLowerCase(),i=t$[n];if(i===void 0)return null;let s=t[zBe],a=t[qBe],o=s||a||"";o=o.toLowerCase();let l=null;return o=="pasado"?l="this":o=="pr\xF3ximo"||o=="proximo"?l="next":o=="este"&&(l="this"),Pn(e.reference,i,l)}}});var uw,Dle=v(()=>{ad();uw=class extends Jn{primaryPrefix(){return"(?:(?:aslas|deslas|las?|al?|de|del)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:l)?|\\?)\\s*"}}});var pw,Cle=v(()=>{Ga();pw=class extends Br{patternBetween(){return new RegExp("^\\s*(?:,|de|aslas|a)?\\s*$")}}});var mw,Ple=v(()=>{Ya();mw=class extends zr{patternBetween(){return/^\s*(?:-)\s*$/i}}});var HBe,_le,Mle,UBe,Ale,fw,Ile=v(()=>{un();cw();cw();Dt();ve();HBe=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*)(${se(r$)})(?:\\s*(?:de|,)?\\s*(${Tle}))?(?=\\W|$)`,"i"),_le=1,Mle=2,UBe=3,Ale=4,fw=class extends q{innerPattern(){return HBe}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=r$[t[UBe].toLowerCase()],s=parseInt(t[_le]);if(s>31)return t.index=t.index+t[_le].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Ale]){let a=kle(t[Ale]);n.start.assign("year",a)}else{let a=ir(e.refDate,s,i);n.start.imply("year",a)}if(t[Mle]){let a=parseInt(t[Mle]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var hw,Nle=v(()=>{ve();ua();hw=class extends q{innerPattern(e){return/(ahora|hoy|mañana|ayer)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"ahora":return Ii(e.reference);case"hoy":return Xn(e.reference);case"ma\xF1ana":return Ri(e.reference);case"ayer":return Ni(e.reference)}return i}}});var Rle,gw,Ole=v(()=>{Nt();ve();ca();Rle=Ke(Wt(),1),gw=class extends q{innerPattern(){return/(?:esta\s*)?(mañana|tarde|medianoche|mediodia|mediodía|noche)(?=\W|$)/i}innerExtract(e,t){let n=(0,Rle.default)(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",$.PM),i.imply("hour",15);break;case"noche":i.imply("meridiem",$.PM),i.imply("hour",22);break;case"ma\xF1ana":i.imply("meridiem",$.AM),i.imply("hour",6);break;case"medianoche":Ho(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"mediodia":case"mediod\xEDa":i.imply("meridiem",$.AM),i.imply("hour",12);break}return i}}});var yw,Lle=v(()=>{cw();rt();ve();yw=class extends q{innerPattern(){return new RegExp(`(?:en|por|durante|de|dentro de)\\s*(${Sle})(?=\\W|$)`,"i")}innerExtract(e,t){let n=xle(t[1]);return Q.createRelativeFromReference(e.reference,n)}}});var s$={};et(s$,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>n$,createCasualConfiguration:()=>Fle,createConfiguration:()=>i$,parse:()=>WBe,parseDate:()=>YBe,strict:()=>VBe});function WBe(r,e,t){return n$.parse(r,e,t)}function YBe(r,e,t){return n$.parseDate(r,e,t)}function Fle(r=!0){let e=i$(!1,r);return e.parsers.push(new hw),e.parsers.push(new gw),e}function i$(r=!0,e=!0){return Yr({parsers:[new $n(e),new dw,new uw,new fw,new yw],refiners:[new pw,new mw]},r)}var n$,VBe,$le=v(()=>{da();_s();rt();Nt();cd();Ele();Dle();Cle();Ple();Ile();Nle();Ole();Lle();n$=new Oe(Fle()),VBe=new Oe(i$(!0))});function KBe(r){let e=r.toLowerCase();return o$[e]!==void 0?o$[e]:e.match(/декілька/)?2:e.match(/пів/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}function p$(r){let e=r.toLowerCase();return l$[e]!==void 0?l$[e]:parseInt(e)}function jC(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 Cs(e)}function ey(r){let e={},t=r,n=jle.exec(t);for(;n;)ZBe(e,n),t=t.substring(n[0].length).trim(),n=jle.exec(t);return e}function ZBe(r,e){let t=KBe(e[1]),n=vw[e[2].toLowerCase()];r[n]=t}var eo,c$,d$,Jg,o$,l$,vw,GBe,u$,a$,$C,zle,jle,Xg,ga=v(()=>{Dt();un();eo={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"},c$={\u043D\u0435\u0434\u0456\u043B\u044F:0,\u043D\u0435\u0434\u0456\u043B\u0456:0,\u043D\u0435\u0434\u0456\u043B\u044E:0,\u043D\u0434:0,"\u043D\u0434.":0,\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0456\u0432\u0442\u043E\u0440\u043E\u043A:2,\u0432\u0456\u0432\u0442\u043E\u0440\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0435\u0440\u0435\u0434\u0430:3,\u0441\u0435\u0440\u0435\u0434\u0438:3,\u0441\u0435\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0443:4,\u0447\u0442:4,"\u0447\u0442.":4,"\u043F'\u044F\u0442\u043D\u0438\u0446\u044F":5,"\u043F'\u044F\u0442\u043D\u0438\u0446\u0456":5,"\u043F'\u044F\u0442\u043D\u0438\u0446\u044E":5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u043E\u0442\u0438:6,\u0441\u0443\u0431\u043E\u0442\u0443:6,\u0441\u0431:6,"\u0441\u0431.":6},d$={\u0441\u0456\u0447\u0435\u043D\u044C:1,\u0441\u0456\u0447\u043D\u044F:1,\u0441\u0456\u0447\u043D\u0456:1,\u043B\u044E\u0442\u0438\u0439:2,\u043B\u044E\u0442\u043E\u0433\u043E:2,\u043B\u044E\u0442\u043E\u043C\u0443:2,\u0431\u0435\u0440\u0435\u0437\u0435\u043D\u044C:3,\u0431\u0435\u0440\u0435\u0437\u043D\u044F:3,\u0431\u0435\u0440\u0435\u0437\u043D\u0456:3,\u043A\u0432\u0456\u0442\u0435\u043D\u044C:4,\u043A\u0432\u0456\u0442\u043D\u044F:4,\u043A\u0432\u0456\u0442\u043D\u0456:4,\u0442\u0440\u0430\u0432\u0435\u043D\u044C:5,\u0442\u0440\u0430\u0432\u043D\u044F:5,\u0442\u0440\u0430\u0432\u043D\u0456:5,\u0447\u0435\u0440\u0432\u0435\u043D\u044C:6,\u0447\u0435\u0440\u0432\u043D\u044F:6,\u0447\u0435\u0440\u0432\u043D\u0456:6,\u043B\u0438\u043F\u0435\u043D\u044C:7,\u043B\u0438\u043F\u043D\u044F:7,\u043B\u0438\u043F\u043D\u0456:7,\u0441\u0435\u0440\u043F\u0435\u043D\u044C:8,\u0441\u0435\u0440\u043F\u043D\u044F:8,\u0441\u0435\u0440\u043F\u043D\u0456:8,\u0432\u0435\u0440\u0435\u0441\u0435\u043D\u044C:9,\u0432\u0435\u0440\u0435\u0441\u043D\u044F:9,\u0432\u0435\u0440\u0435\u0441\u043D\u0456:9,\u0436\u043E\u0432\u0442\u0435\u043D\u044C:10,\u0436\u043E\u0432\u0442\u043D\u044F:10,\u0436\u043E\u0432\u0442\u043D\u0456:10,\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434:11,\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434\u0430:11,\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434\u0443:11,\u0433\u0440\u0443\u0434\u0435\u043D\u044C:12,\u0433\u0440\u0443\u0434\u043D\u044F:12,\u0433\u0440\u0443\u0434\u043D\u0456:12},Jg={...d$,\u0441\u0456\u0447:1,"\u0441\u0456\u0447.":1,\u043B\u044E\u0442:2,"\u043B\u044E\u0442.":2,\u0431\u0435\u0440:3,"\u0431\u0435\u0440.":3,\u043A\u0432\u0456\u0442:4,"\u043A\u0432\u0456\u0442.":4,\u0442\u0440\u0430\u0432:5,"\u0442\u0440\u0430\u0432.":5,\u0447\u0435\u0440\u0432:6,"\u0447\u0435\u0440\u0432.":6,\u043B\u0438\u043F:7,"\u043B\u0438\u043F.":7,\u0441\u0435\u0440\u043F:8,"\u0441\u0435\u0440\u043F.":8,\u0441\u0435\u0440:8,"c\u0435\u0440.":8,\u0432\u0435\u0440:9,"\u0432\u0435\u0440.":9,\u0432\u0435\u0440\u0435\u0441:9,"\u0432\u0435\u0440\u0435\u0441.":9,\u0436\u043E\u0432\u0442:10,"\u0436\u043E\u0432\u0442.":10,\u043B\u0438\u0441\u0442\u043E\u043F:11,"\u043B\u0438\u0441\u0442\u043E\u043F.":11,\u0433\u0440\u0443\u0434:12,"\u0433\u0440\u0443\u0434.":12},o$={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0457:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0456:2,\u0434\u0432\u0430:2,\u0434\u0432\u043E\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u044C\u043E\u0445:3,\u0447\u043E\u0442\u0438\u0440\u0438:4,\u0447\u043E\u0442\u0438\u0440\u044C\u043E\u0445:4,"\u043F'\u044F\u0442\u044C":5,"\u043F'\u044F\u0442\u0438":5,\u0448\u0456\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0456\u043C:7,\u0441\u0435\u043C\u0438:7,\u0432\u0456\u0441\u0456\u043C:8,\u0432\u043E\u0441\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\u0430\u0434\u0446\u044F\u0442\u044C:11,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u0438:11,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u044C:12,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u0438:12},l$={\u043F\u0435\u0440\u0448\u0435:1,\u043F\u0435\u0440\u0448\u043E\u0433\u043E:1,\u0434\u0440\u0443\u0433\u0435:2,\u0434\u0440\u0443\u0433\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u0454:3,\u0442\u0440\u0435\u0442\u044C\u043E\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,"\u043F'\u044F\u0442\u0435":5,"\u043F'\u044F\u0442\u043E\u0433\u043E":5,\u0448\u043E\u0441\u0442\u0435:6,\u0448\u043E\u0441\u0442\u043E\u0433\u043E:6,\u0441\u044C\u043E\u043C\u0435:7,\u0441\u044C\u043E\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,"\u0434\u0435\u0432'\u044F\u0442\u0435":9,"\u0434\u0435\u0432'\u044F\u0442\u043E\u0433\u043E":9,\u0434\u0435\u0441\u044F\u0442\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u0435:11,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u0435:12,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:13,\u0447\u043E\u0442\u0438\u0440\u043D\u0430\u0434\u0446\u044F\u0442\u0435:14,\u0447\u043E\u0442\u0438\u043D\u0440\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:14,"\u043F'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u0435":15,"\u043F'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E":15,\u0448\u0456\u0441\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u0435:16,\u0448\u0456\u0441\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:16,\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u0435:17,\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:17,\u0432\u0456\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u0435:18,\u0432\u0456\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:18,"\u0434\u0435\u0432'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u0435":19,"\u0434\u0435\u0432'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E":19,\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u0435:20,\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0440\u0443\u0433\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0440\u0443\u0433\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0442\u0440\u0435\u0442\u0454":23,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u043E\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F'\u044F\u0442\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F'\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0448\u043E\u0441\u0442\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0448\u043E\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0441\u044C\u043E\u043C\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0441\u044C\u043E\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0435\u0432'\u044F\u0442\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0435\u0432'\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u0435:30,\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0433\u043E":31},vw={\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\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043E\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u0445\u0432:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u0430:"minute",\u0445\u0432\u0438\u043B\u0438\u043D:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u0438:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u0443:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u043A:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043A\u0438:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043A\u0443:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u0447\u043E\u043A:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u0447\u043A\u0438:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u0447\u043A\u0443:"minute",\u0433\u043E\u0434:"hour",\u0433\u043E\u0434\u0438\u043D\u0430:"hour",\u0433\u043E\u0434\u0438\u043D:"hour",\u0433\u043E\u0434\u0438\u043D\u0438:"hour",\u0433\u043E\u0434\u0438\u043D\u0443:"hour",\u0433\u043E\u0434\u0438\u043D\u043A\u0430:"hour",\u0433\u043E\u0434\u0438\u043D\u043E\u043A:"hour",\u0433\u043E\u0434\u0438\u043D\u043A\u0438:"hour",\u0433\u043E\u0434\u0438\u043D\u043A\u0443:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0456\u0432:"d",\u0434\u043D\u0456:"d",\u0434\u043E\u0431\u0430:"d",\u0434\u043E\u0431\u0443:"d",\u0442\u0438\u0436\u0434\u0435\u043D\u044C:"week",\u0442\u0438\u0436\u043D\u044E:"week",\u0442\u0438\u0436\u043D\u044F:"week",\u0442\u0438\u0436\u043D\u0456:"week",\u0442\u0438\u0436\u043D\u0456\u0432:"week",\u043C\u0456\u0441\u044F\u0446\u044C:"month",\u043C\u0456\u0441\u044F\u0446\u0456\u0432:"month",\u043C\u0456\u0441\u044F\u0446\u0456:"month",\u043C\u0456\u0441\u044F\u0446\u044F:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0443:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0456\u0432:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0456:"quarter",\u0440\u0456\u043A:"year",\u0440\u043E\u043A\u0443:"year",\u0440\u043E\u0446\u0456:"year",\u0440\u043E\u043A\u0456\u0432:"year",\u0440\u043E\u043A\u0438:"year"},GBe=`(?:${se(o$)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u0456\u0432|\u0434\u0435\u043A\u0456\u043B\u044C\u043A\u0430|\u043F\u0430\u0440(?:\u0443)|\\s{0,3})`;u$=`(?:${se(l$)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435)?)`;a$="(?:\\s+(?:\u0440\u043E\u043A\u0443|\u0440\u0456\u043A|\u0440|\u0440.))?",$C=`(?:[1-9][0-9]{0,3}${a$}\\s*(?:\u043D.\u0435.|\u0434\u043E \u043D.\u0435.|\u043D. \u0435.|\u0434\u043E \u043D. \u0435.)|[1-2][0-9]{3}${a$}|[5-9][0-9]${a$})`;zle=`(${GBe})\\s{0,3}(${se(vw)})`,jle=new RegExp(zle,"i"),Xg=ss("(?:(?:\u0431\u043B\u0438\u0437\u044C\u043A\u043E|\u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E)\\s{0,3})?",zle)});var Ble,bw,qle=v(()=>{ga();rt();ve();Ble=`(?:(?:\u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E|\u043E\u0440\u0456\u0454\u043D\u0442\u043E\u0432\u043D\u043E)\\s*(?:~\\s*)?)?(${Xg})${eo.rightBoundary}`,bw=class extends q{patternLeftBoundary(){return eo.leftBoundary}innerPattern(e){return e.option.forwardDate?new RegExp(Ble,"i"):new RegExp(`(?:\u043F\u0440\u043E\u0442\u044F\u0433\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0442\u044F\u0437\u0456|\u043F\u0440\u043E\u0442\u044F\u0433\u043E\u043C|\u0443\u043F\u0440\u043E\u0434\u043E\u0432\u0436|\u0432\u043F\u0440\u043E\u0434\u043E\u0432\u0436)\\s*${Ble}`,eo.flags)}innerExtract(e,t){let n=ey(t[1]);return Q.createRelativeFromReference(e.reference,n)}}});var rf,As,pd=v(()=>{ve();ga();rf=class extends q{patternLeftBoundary(){return eo.leftBoundary}innerPattern(e){return new RegExp(this.innerPatternString(e),eo.flags)}innerPatternHasChange(e,t){return!1}},As=class extends rf{innerPattern(e){return new RegExp(`${this.innerPatternString(e)}${eo.rightBoundary}`,eo.flags)}}});var Hle,Ule,QBe,Vle,Tw,Wle=v(()=>{un();ga();ga();ga();Dt();pd();Hle=1,Ule=2,QBe=3,Vle=4,Tw=class extends As{innerPatternString(e){return`(?:\u0437|\u0456\u0437)?\\s*(${u$})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${u$}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${se(Jg)})(?:(?:-|\\/|,?\\s{0,3})(${$C}(?![^\\s]\\d)))?`}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Jg[t[QBe].toLowerCase()],s=p$(t[Hle]);if(s>31)return t.index=t.index+t[Hle].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Vle]){let a=jC(t[Vle]);n.start.assign("year",a)}else{let a=ir(e.reference.instant,s,i);n.start.imply("year",a)}if(t[Ule]){let a=p$(t[Ule]);n.end=n.start.clone(),n.end.assign("day",a)}return n}}});var JBe,Yle,kw,Gle=v(()=>{ga();un();Dt();ga();pd();JBe=2,Yle=3,kw=class extends rf{innerPatternString(e){return`((?:\u0432|\u0443)\\s*)?(${se(Jg)})\\s*(?:[,-]?\\s*(${$C})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`}innerExtract(e,t){let n=t[JBe].toLowerCase();if(t[0].length<=3&&!d$[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=Jg[n];if(i.start.assign("month",s),t[Yle]){let a=jC(t[Yle]);i.start.assign("year",a)}else{let a=ir(e.reference.instant,1,s);i.start.imply("year",a)}return i}}});var ww,Kle=v(()=>{Nt();ad();ga();ww=class extends Jn{constructor(e){super(e)}patternFlags(){return eo.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0456|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0443|\u043E|\u043E\u0431|\u0437|\u0456\u0437|\u0432\u0456\u0434)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0440\u0430\u043D\u043A\u0443|\u0432\u0435\u0447\u043E\u0440\u0430|\u043F\u043E \u043E\u0431\u0456\u0434\u0456|\u043F\u0456\u0441\u043B\u044F \u043E\u0431\u0456\u0434\u0443))?(?!\\/)${eo.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u043E\u0440\u0430")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",$.PM)):i<6&&n.assign("meridiem",$.AM)}if(t[0].endsWith("\u043F\u043E \u043E\u0431\u0456\u0434\u0456")||t[0].endsWith("\u043F\u0456\u0441\u043B\u044F \u043E\u0431\u0456\u0434\u0443")){n.assign("meridiem",$.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0440\u0430\u043D\u043A\u0443")&&(n.assign("meridiem",$.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}}});var Sw,Zle=v(()=>{ga();rt();pa();pd();Sw=class extends rf{innerPatternString(e){return`(${Xg})\\s{0,5}\u0442\u043E\u043C\u0443(?=(?:\\W|$))`}innerExtract(e,t){let n=ey(t[1]),i=Cn(n);return Q.createRelativeFromReference(e.reference,i)}}});var xw,Qle=v(()=>{Ya();xw=class extends zr{patternBetween(){return/^\s*(і до|і по|до|по|-)\s*$/i}}});var Ew,Jle=v(()=>{Ga();Ew=class extends Br{patternBetween(){return new RegExp("^\\s*(T|\u0432|\u0443|\u043E|,|-)?\\s*$")}}});var Dw,Xle=v(()=>{ua();pd();Dw=class extends As{innerPatternString(e){return"(?:\u0437|\u0456\u0437|\u0432\u0456\u0434)?\\s*(\u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456|\u0432\u0447\u043E\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u0456\u0441\u043B\u044F\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430)"}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456":return Xn(e.reference);case"\u0432\u0447\u043E\u0440\u0430":return Ni(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return Ri(e.reference);case"\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430":return Il(e.reference,2);case"\u043F\u0456\u0441\u043B\u044F\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430":return Il(e.reference,3);case"\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430":return Fm(e.reference,2);case"\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430":return Fm(e.reference,3)}return i}}});var ece,Cw,tce=v(()=>{ua();ca();ece=Ke(Wt(),1);pd();Cw=class extends As{innerPatternString(e){return"(\u0437\u0430\u0440\u0430\u0437|\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E\\s*\u0432\u0435\u0447\u043E\u0440\u0430|\u043C\u0438\u043D\u0443\u043B\u043E\u0457\\s*\u043D\u043E\u0447\u0456|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0457\\s*\u043D\u043E\u0447\u0456|\u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456\\s*\u0432\u043D\u043E\u0447\u0456|\u0446\u0456\u0454\u0457\\s*\u043D\u043E\u0447\u0456|\u0446\u044C\u043E\u0433\u043E \u0440\u0430\u043D\u043A\u0443|\u0432\u0440\u0430\u043D\u0446\u0456|\u0440\u0430\u043D\u043A\u0443|\u0437\u0440\u0430\u043D\u043A\u0443|\u043E\u043F\u0456\u0432\u0434\u043D\u0456|\u0432\u0432\u0435\u0447\u0435\u0440\u0456|\u0432\u0435\u0447\u043E\u0440\u0430|\u043E\u043F\u0456\u0432\u043D\u043E\u0447\u0456|\u0432\u043D\u043E\u0447\u0456)"}innerExtract(e,t){let n=(0,ece.default)(e.reference.instant),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0437\u0430\u0440\u0430\u0437")return Ii(e.reference);if(i==="\u0432\u0432\u0435\u0447\u0435\u0440\u0456"||i==="\u0432\u0435\u0447\u043E\u0440\u0430")return Og(e.reference);if(i.endsWith("\u0432\u0440\u0430\u043D\u0446\u0456")||i.endsWith("\u0440\u0430\u043D\u043A\u0443")||i.endsWith("\u0437\u0440\u0430\u043D\u043A\u0443"))return Lg(e.reference);if(i.endsWith("\u043E\u043F\u0456\u0432\u0434\u043D\u0456"))return Fg(e.reference);if(i.match(/минулої\s*ночі/))return oC(e.reference);if(i.match(/минулого\s*вечора/))return lC(e.reference);if(i.match(/наступної\s*ночі/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),Ir(s,n),s.imply("hour",1)}return i.match(/цієї\s*ночі/)?$m(e.reference):i.endsWith("\u043E\u043F\u0456\u0432\u043D\u043E\u0447\u0456")||i.endsWith("\u0432\u043D\u043E\u0447\u0456")?$m(e.reference):s}}});var XBe,eqe,tqe,Pw,rce=v(()=>{ga();Dt();Vo();pd();XBe=1,eqe=2,tqe=3,Pw=class extends As{innerPatternString(e){return`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:\u0443\\s*?)?(?:(\u0446\u0435\u0439|\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E|\u043C\u0438\u043D\u0443\u043B\u0438\u0439|\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439|\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044C\u043E\u0433\u043E|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443)\\s*)?(${se(c$)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*(\u043D\u0430|\u0443|\u0432)\\s*(\u0446\u044C\u043E\u043C\u0443|\u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443)\\s*\u0442\u0438\u0436\u043D\u0456)?`}innerExtract(e,t){let n=t[eqe].toLocaleLowerCase(),i=c$[n],s=t[XBe],a=t[tqe],o=s||a;o=o||"",o=o.toLocaleLowerCase();let l=null;return o=="\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E"||o=="\u043C\u0438\u043D\u0443\u043B\u0438\u0439"||o=="\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439"||o=="\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044C\u043E\u0433\u043E"?l="last":o=="\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E"||o=="\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439"?l="next":(o=="\u0446\u0435\u0439"||o=="\u0446\u044C\u043E\u0433\u043E"||o=="\u0446\u044C\u043E\u043C\u0443")&&(l="this"),Pn(e.reference,i,l)}}});var nce,rqe,nqe,_w,ice=v(()=>{ga();rt();nce=Ke(Wt(),1);Dt();pd();rqe=1,nqe=2,_w=class extends As{innerPatternString(e){return`(\u0432 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u0443 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u043D\u0430 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E|\u043D\u0430 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443|\u0432 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443|\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E|\u043D\u0430 \u0446\u044C\u043E\u043C\u0443|\u0432 \u0446\u044C\u043E\u043C\u0443|\u0443 \u0446\u044C\u043E\u043C\u0443|\u0446\u044C\u043E\u0433\u043E)\\s*(${se(vw)})(?=\\s*)`}innerExtract(e,t){let n=t[rqe].toLowerCase(),i=t[nqe].toLowerCase(),s=vw[i];if(n=="\u043D\u0430 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443"||n=="\u0432 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443"||n=="\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443"||n=="\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E"){let l={};return l[s]=1,Q.createRelativeFromReference(e.reference,l)}if(n=="\u043D\u0430 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443"||n=="\u0432 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443"||n=="\u0443 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443"||n=="\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E"){let l={};return l[s]=-1,Q.createRelativeFromReference(e.reference,l)}let a=e.createParsingComponents(),o=(0,nce.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}}});var Mw,sce=v(()=>{ga();rt();pa();pd();Mw=class extends As{innerPatternString(e){return`(\u0446\u0456|\u043E\u0441\u0442\u0430\u043D\u043D\u0456|\u043C\u0438\u043D\u0443\u043B\u0456|\u043C\u0430\u0439\u0431\u0443\u0442\u043D\u0456|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0456|\u043F\u0456\u0441\u043B\u044F|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${Xg})`}innerExtract(e,t){let n=t[1].toLowerCase(),i=ey(t[3]);switch(n){case"\u043E\u0441\u0442\u0430\u043D\u043D\u0456":case"\u043C\u0438\u043D\u0443\u043B\u0456":case"-":i=Cn(i);break}return Q.createRelativeFromReference(e.reference,i)}}});var h$={};et(h$,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>m$,createCasualConfiguration:()=>ace,createConfiguration:()=>f$,parse:()=>sqe,parseDate:()=>aqe,strict:()=>iqe});function ace(){let r=f$(!1);return r.parsers.unshift(new Dw),r.parsers.unshift(new Cw),r.parsers.unshift(new kw),r.parsers.unshift(new _w),r.parsers.unshift(new Mw),r}function f$(r){return Yr({parsers:[new ld,new $n(!0),new bw,new Tw,new Pw,new ww(r),new Sw],refiners:[new Ew,new xw]},r)}function sqe(r,e,t){return m$.parse(r,e,t)}function aqe(r,e,t){return m$.parseDate(r,e,t)}var m$,iqe,oce=v(()=>{qle();Wle();Gle();Kle();Zle();Qle();Jle();da();Xle();tce();rce();ice();_s();rt();Nt();cd();sce();aC();m$=new Oe(ace()),iqe=new Oe(f$(!0))});var zC={};et(zC,{Chrono:()=>Oe,Meridiem:()=>$,ParsingComponents:()=>Q,ParsingContext:()=>VT,ParsingResult:()=>$t,ReferenceWithTimezone:()=>Yt,Weekday:()=>ze,casual:()=>g$,de:()=>q1,en:()=>N1,es:()=>s$,fr:()=>J1,ja:()=>rF,nl:()=>hF,parse:()=>lqe,parseDate:()=>cqe,pt:()=>oF,ru:()=>XF,strict:()=>oqe,uk:()=>h$,zh:()=>HF});function lqe(r,e,t){return g$.parse(r,e,t)}function cqe(r,e,t){return g$.parseDate(r,e,t)}var oqe,g$,lce=v(()=>{Tse();_s();rt();Nt();Vse();hae();Mae();Vae();boe();Goe();yle();$le();oce();oqe=I1,g$=WT});var cce,dce,dqe,BC,uce=v(()=>{Tn();lce();t1();u1();p1();d1();dqe=(dce=Ee)!=null?dce:(cce=void 0)==null?void 0:cce.RRule,BC=class{constructor(e=[],t=[],n=!0,i="en",s,a){this.isValidDateString=l=>/^\d{4}-\d{2}-\d{2}$/.test(l),this.isValidTimeString=l=>/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/.test(l),this.escapeRegex=l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),this.cleanupWhitespace=l=>l.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").trim(),this.defaultToScheduled=n,this.languageConfig=uie(i),this.statusConfigs=e,this.priorityConfigs=t;let o=s||$ne;this.triggerConfig=new eC(o,a||[]),this.boundaries=this.createBoundaryConfig(),this.recurrencePatterns=this.buildRecurrencePatterns(),this.processingPipeline=this.buildProcessingPipeline()}createBoundaryConfig(){let e=["ru","zh","ja","uk","fr"].includes(this.languageConfig.code);return{boundary:e?"(?:^|\\s)":"\\b",endBoundary:e?"(?=\\s|$)":"\\b",isNonAscii:e}}getChronoParser(){let e=this.languageConfig.chronoLocale;return zC[e]||zC}buildProcessingPipeline(){return[{name:"extractTags",process:(e,t)=>this.extractTags(e,t)},{name:"extractContexts",process:(e,t)=>this.extractContexts(e,t)},{name:"extractProjects",process:(e,t)=>this.extractProjects(e,t)},{name:"extractPriority",process:(e,t)=>this.extractPriority(e,t)},{name:"extractStatus",process:(e,t)=>this.extractStatus(e,t)},{name:"extractRecurrence",process:(e,t)=>this.extractRecurrence(e,t)},{name:"extractTimeEstimate",process:(e,t)=>this.extractTimeEstimate(e,t)},{name:"extractUserFields",process:(e,t)=>this.extractUserFields(e,t)},{name:"parseUnifiedDatesAndTimes",process:(e,t)=>this.parseUnifiedDatesAndTimes(e,t)}]}parseInput(e){let t={title:"",tags:[],contexts:[],projects:[]},[n,i]=this.extractTitleAndDetails(e);i&&(t.details=i);let s=n;for(let a of this.processingPipeline)try{s=a.process(s,t)}catch(o){console.debug(`Error in processor ${a.name}:`,o)}return t.title=s.trim(),this.validateAndCleanupResult(t)}extractTitleAndDetails(e){let t=e.trim(),n=t.indexOf(` `);if(n!==-1){let i=t.substring(0,n).trim(),s=t.substring(n+1).trim();return[i,s]}return[t,void 0]}extractTags(e,t){let n=this.triggerConfig.getTagTrigger();if(!n)return e;let i=this.escapeRegex(n),s=new RegExp(`${i}[\\p{L}\\p{N}\\p{M}_/-]+`,"gu"),a=e.match(s);return a?(t.tags.push(...a.map(o=>o.substring(n.length))),this.cleanupWhitespace(e.replace(s,""))):e}extractContexts(e,t){let n=this.triggerConfig.getContextTrigger();if(!n)return e;let i=this.escapeRegex(n),s=new RegExp(`${i}[\\p{L}\\p{N}\\p{M}_/-]+`,"gu"),a=e.match(s);return a?(t.contexts.push(...a.map(o=>o.substring(n.length))),this.cleanupWhitespace(e.replace(s,""))):e}extractProjects(e,t){let n=this.triggerConfig.getProjectTrigger();if(!n)return e;let i=e,s=this.escapeRegex(n),a=new RegExp(`${s}\\[\\[.*?\\]\\]`,"g"),o=i.match(a);o&&(t.projects.push(...o.map(d=>d.slice(n.length))),i=this.cleanupWhitespace(i.replace(a,"")));let l=new RegExp(`${s}[\\p{L}\\p{N}\\p{M}_/-]+`,"gu"),c=i.match(l);return c&&(t.projects.push(...c.map(d=>d.substring(n.length))),i=this.cleanupWhitespace(i.replace(l,""))),i}extractUserFields(e,t){let n=e,i=this.triggerConfig.getAllEnabledTriggers().filter(s=>this.triggerConfig.isUserField(s.propertyId));for(let s of i){let a=this.triggerConfig.getUserField(s.propertyId);if(!a)continue;let o=this.escapeRegex(s.trigger);if(a.type==="list"){let l=new RegExp(`${o}(?:"([^"]+)"|([\\p{L}\\p{N}\\p{M}_/-]+))`,"gu"),c=[],d;for(;(d=l.exec(n))!==null;){let u=d[1]||d[2];c.push(u)}c.length>0&&(t.userFields||(t.userFields={}),t.userFields[a.id]=c,n=this.cleanupWhitespace(n.replace(l,"")))}else if(a.type==="text"||a.type==="boolean"||a.type==="number"){let l=new RegExp(`${o}(?:"([^"]+)"|([\\p{L}\\p{N}\\p{M}_/-]+))`,"u"),c=n.match(l);if(c){let d=c[1]||c[2];t.userFields||(t.userFields={}),a.type==="boolean"?t.userFields[a.id]=d.toLowerCase()==="true"?"true":"false":t.userFields[a.id]=d,n=this.cleanupWhitespace(n.replace(l,""))}}else if(a.type==="date"){let l=new RegExp(`${o}(?:"([^"]+)"|([\\p{L}\\p{N}\\p{M}_/-]+))`,"u"),c=n.match(l);if(c){let d=c[1]||c[2];t.userFields||(t.userFields={}),t.userFields[a.id]=d,n=this.cleanupWhitespace(n.replace(l,""))}}}return n}extractPriority(e,t){if(this.priorityConfigs.length>0){let s=[...this.priorityConfigs].sort((l,c)=>c.label.length-l.label.length),a=this.triggerConfig.getTriggerForProperty("priority"),o=a!=null&&a.enabled?a.trigger:"";for(let l of s){let c=[l.label,l.value];for(let d of c){if(!d||d.trim()==="")continue;if(o){let p=o+d,m=this.findTextMatch(e,p);if(m)return t.priority=l.value,this.cleanupWhitespace(e.replace(m.fullMatch,""))}let u=this.findTextMatch(e,d);if(u)return t.priority=l.value,this.cleanupWhitespace(e.replace(u.fullMatch,""))}}return e}let n=this.languageConfig.fallbackPriority,i=this.findPhraseValueMatch(e,[{value:"urgent",phrases:n.urgent},{value:"high",phrases:n.high},{value:"normal",phrases:n.normal},{value:"low",phrases:n.low}]);return i?(t.priority=i.value,this.removePhraseMatch(e,i.match)):e}extractStatus(e,t){if(this.statusConfigs.length>0){let s=[...this.statusConfigs].sort((l,c)=>c.label.length-l.label.length),a=this.triggerConfig.getTriggerForProperty("status"),o=a!=null&&a.enabled?a.trigger:"";for(let l of s){let c=[l.label,l.value];for(let d of c){if(!d||d.trim()==="")continue;if(o){let p=o+d,m=this.findTextMatch(e,p);if(m)return t.status=l.value,this.cleanupWhitespace(e.replace(m.fullMatch,""))}let u=this.findTextMatch(e,d);if(u)return t.status=l.value,this.cleanupWhitespace(e.replace(u.fullMatch,""))}}return e}let n=this.languageConfig.fallbackStatus,i=this.findPhraseValueMatch(e,[{value:"open",phrases:n.open},{value:"in-progress",phrases:n.inProgress},{value:"done",phrases:n.done},{value:"cancelled",phrases:n.cancelled},{value:"waiting",phrases:n.waiting}]);return i?(t.status=i.value,this.removePhraseMatch(e,i.match)):e}findTextMatch(e,t){let n=this.findPhraseMatch(e,[t]);if(!n)return null;let i=this.includeTrailingPhraseSeparator(e,n.endIndex);return{fullMatch:e.substring(n.startIndex,i),startIndex:n.startIndex}}findPhraseMatch(e,t){let n=t.filter(a=>a&&a.trim()!=="").sort((a,o)=>o.length-a.length);if(n.length===0)return null;let i=e.toLowerCase(),s=null;for(let a of n){let o=a.toLowerCase(),l=0;for(;l<=i.length;){let c=i.indexOf(o,l);if(c===-1)break;let d=c+a.length;if(this.hasPhraseBoundaries(e,c,d)){let u={fullMatch:e.substring(c,d),phrase:a,startIndex:c,endIndex:d};(!s||u.startIndexs.phrase.length)&&(s=u)}l=c+1}}return s}findPhraseValueMatch(e,t){let n=null;for(let i of t){let s=this.findPhraseMatch(e,i.phrases);s&&(!n||s.startIndexn.match.phrase.length)&&(n={value:i.value,match:s})}return n}removePhraseMatch(e,t){let n=this.includeTrailingPhraseSeparator(e,t.endIndex);return this.cleanupWhitespace(e.substring(0,t.startIndex)+e.substring(n))}hasPhraseBoundaries(e,t,n){if(["zh","ja"].includes(this.languageConfig.code))return!0;let i=this.getCodePointBefore(e,t),s=this.getCodePointAt(e,n);return!this.isWordCharacter(i)&&!this.isWordCharacter(s)}getCodePointBefore(e,t){return t<=0?"":Array.from(e.slice(0,t)).pop()||""}getCodePointAt(e,t){return t>=e.length?"":Array.from(e.slice(t))[0]||""}isWordCharacter(e){return e!==""&&/[\p{L}\p{N}\p{M}_]/u.test(e)}includeTrailingPhraseSeparator(e,t){return/[:,;]/.test(e[t]||"")?t+1:t}parseUnifiedDatesAndTimes(e,t){var i,s;let n=e;try{let a=this.getChronoParser(),o=this.languageConfig.dateTriggers,l=[{type:"due",phrases:o.due},{type:"scheduled",phrases:o.scheduled}],c=!1;for(let y of l){let k=this.findPhraseMatch(n,y.phrases);if(k){let T=n.substring(k.endIndex),w=this.parseChronoFromPosition(T);if(w.success){c=!0,y.type==="due"?(t.dueDate=w.date,w.time&&(t.dueTime=w.time)):(t.scheduledDate=w.date,w.time&&(t.scheduledTime=w.time));let S=this.getChronoMatchOffset(T,w),E=w.matchedText?k.endIndex+S+w.matchedText.length:k.endIndex;n=n.substring(0,k.startIndex)+n.substring(E),n=this.cleanupWhitespace(n)}}}if(c)return n;let d=a.parse(e,new Date,{forwardDate:!0});if(d.length===0)return e;let u=d[0],p=u.text,m=u.start.date(),f=(i=u.end)==null?void 0:i.date(),h=this.findPhraseMatch(u.text,o.due)!==null,g=this.findPhraseMatch(u.text,o.scheduled)!==null;if(f&&Kn(f)&&f.getTime()!==m.getTime())t.scheduledDate=P(m,"yyyy-MM-dd"),u.start.isCertain("hour")&&(t.scheduledTime=P(m,"HH:mm")),t.dueDate=P(f,"yyyy-MM-dd"),(s=u.end)!=null&&s.isCertain("hour")&&(t.dueTime=P(f,"HH:mm"));else if(Kn(m)){let y=P(m,"yyyy-MM-dd"),k=u.start.isCertain("hour")?P(m,"HH:mm"):void 0;h&&!g?(t.dueDate=y,t.dueTime=k):g&&!h||this.defaultToScheduled?(t.scheduledDate=y,t.scheduledTime=k):(t.dueDate=y,t.dueTime=k)}n=n.replace(p,"").trim(),n=this.cleanupWhitespace(n)}catch(a){console.debug("Error in unified date parsing:",a)}return n}parseChronoFromPosition(e){try{let n=this.getChronoParser().parse(e,new Date,{forwardDate:!0});if(n.length>0){let i=n[0];if(i.index<=3){let s=i.start.date();if(Kn(s)){let a={success:!0,date:P(s,"yyyy-MM-dd"),matchedText:i.text,startIndex:i.index};return i.start.isCertain("hour")&&(a.time=P(s,"HH:mm")),a}}}}catch(t){console.debug("Error parsing date with chrono:",t)}return{success:!1}}getChronoMatchOffset(e,t){var s;let n=(s=t.startIndex)!=null?s:0;if(!t.matchedText)return n;let i=e.indexOf(t.matchedText);return i!==-1?i:n}buildRecurrencePatterns(){let e=this.languageConfig.recurrence,t=[],{boundary:n,endBoundary:i}=this.boundaries,s=a=>a.map(o=>this.escapeRegex(o)).join("|");return t.push(...this.buildOrdinalWeekdayPatterns(e,n,i,s)),t.push(...this.buildIntervalPatterns(e,n,i,s)),t.push(...this.buildEveryOtherPatterns(e,n,i,s)),t.push(...this.buildWeekdayPatterns(e,n,i,s)),t.push(...this.buildFrequencyPatterns(e,n,i,s)),t}buildOrdinalWeekdayPatterns(e,t,n,i){let s=i(e.every),a=i([...e.ordinals.first,...e.ordinals.second,...e.ordinals.third,...e.ordinals.fourth,...e.ordinals.last]),o=i([...e.weekdays.monday,...e.weekdays.tuesday,...e.weekdays.wednesday,...e.weekdays.thursday,...e.weekdays.friday,...e.weekdays.saturday,...e.weekdays.sunday]);return[{regex:new RegExp(`${t}(${s})\\s+(${a})\\s+(${o})${n}`,"i"),handler:l=>{let c=l[2].toLowerCase(),d=l[3].toLowerCase(),u=1;return e.ordinals.second.some(m=>m.toLowerCase()===c)?u=2:e.ordinals.third.some(m=>m.toLowerCase()===c)?u=3:e.ordinals.fourth.some(m=>m.toLowerCase()===c)?u=4:e.ordinals.last.some(m=>m.toLowerCase()===c)&&(u=-1),`FREQ=MONTHLY;BYDAY=${this.getWeekdayRRuleCode(d,e)};BYSETPOS=${u}`}}]}buildIntervalPatterns(e,t,n,i){let s=i(e.every),a=i([...e.periods.day,...e.periods.week,...e.periods.month,...e.periods.year]);return[{regex:new RegExp(`${t}(${s})\\s+(\\d+)\\s+(${a})${n}`,"i"),handler:o=>{let l=parseInt(o[2]),c=o[3].toLowerCase();return`FREQ=${this.getPeriodFrequency(c,e)};INTERVAL=${l}`}}]}buildEveryOtherPatterns(e,t,n,i){let s=i(e.every),a=i(e.other),o=i([...e.periods.day,...e.periods.week,...e.periods.month,...e.periods.year]);return[{regex:new RegExp(`${t}(${s})\\s+(${a})\\s+(${o})${n}`,"i"),handler:l=>{let c=l[3].toLowerCase();return`FREQ=${this.getPeriodFrequency(c,e)};INTERVAL=2`}}]}buildWeekdayPatterns(e,t,n,i){let s=i(e.every),a=i([...e.weekdays.monday,...e.weekdays.tuesday,...e.weekdays.wednesday,...e.weekdays.thursday,...e.weekdays.friday,...e.weekdays.saturday,...e.weekdays.sunday]),o=i([...e.pluralWeekdays.monday,...e.pluralWeekdays.tuesday,...e.pluralWeekdays.wednesday,...e.pluralWeekdays.thursday,...e.pluralWeekdays.friday,...e.pluralWeekdays.saturday,...e.pluralWeekdays.sunday]);return[{regex:new RegExp(`${t}(${s})\\s+(${a})${n}`,"i"),handler:l=>{let c=l[2].toLowerCase();return`FREQ=WEEKLY;BYDAY=${this.getWeekdayRRuleCode(c,e)}`}},{regex:new RegExp(`${t}(${o})${n}`,"i"),handler:l=>{let c=l[1].toLowerCase();return`FREQ=WEEKLY;BYDAY=${this.getPluralWeekdayRRuleCode(c,e)}`}}]}buildFrequencyPatterns(e,t,n,i){return[{regex:new RegExp(`${t}(${i(e.frequencies.daily)})${n}`,"i"),handler:()=>"FREQ=DAILY"},{regex:new RegExp(`${t}(${i(e.frequencies.weekly)})${n}`,"i"),handler:()=>"FREQ=WEEKLY"},{regex:new RegExp(`${t}(${i(e.frequencies.monthly)})${n}`,"i"),handler:()=>"FREQ=MONTHLY"},{regex:new RegExp(`${t}(${i(e.frequencies.yearly)})${n}`,"i"),handler:()=>"FREQ=YEARLY"}]}getPeriodFrequency(e,t){return t.periods.week.some(n=>n.toLowerCase()===e)?"WEEKLY":t.periods.month.some(n=>n.toLowerCase()===e)?"MONTHLY":t.periods.year.some(n=>n.toLowerCase()===e)?"YEARLY":"DAILY"}getWeekdayRRuleCode(e,t){return t.weekdays.tuesday.some(n=>n.toLowerCase()===e)?"TU":t.weekdays.wednesday.some(n=>n.toLowerCase()===e)?"WE":t.weekdays.thursday.some(n=>n.toLowerCase()===e)?"TH":t.weekdays.friday.some(n=>n.toLowerCase()===e)?"FR":t.weekdays.saturday.some(n=>n.toLowerCase()===e)?"SA":t.weekdays.sunday.some(n=>n.toLowerCase()===e)?"SU":"MO"}getPluralWeekdayRRuleCode(e,t){return t.pluralWeekdays.tuesday.some(n=>n.toLowerCase()===e)?"TU":t.pluralWeekdays.wednesday.some(n=>n.toLowerCase()===e)?"WE":t.pluralWeekdays.thursday.some(n=>n.toLowerCase()===e)?"TH":t.pluralWeekdays.friday.some(n=>n.toLowerCase()===e)?"FR":t.pluralWeekdays.saturday.some(n=>n.toLowerCase()===e)?"SA":t.pluralWeekdays.sunday.some(n=>n.toLowerCase()===e)?"SU":"MO"}extractRecurrence(e,t){for(let n of this.recurrencePatterns){let i=e.match(n.regex);if(i){let s=n.handler(i);if(this.isValidRRuleString(s))return t.recurrence=s,this.cleanupWhitespace(e.replace(n.regex,""))}}return e}isValidRRuleString(e){if(e.includes("BYDAY=undefined")||e.includes("BYDAY=;")||e.includes("BYDAY=")){let t=e.match(/BYDAY=([^;]*)/);if(t&&(!t[1]||t[1]==="undefined"||t[1].trim()===""))return!1}return!!e.includes("FREQ=")}extractTimeEstimate(e,t){let n=this.languageConfig.timeEstimate,{boundary:i,endBoundary:s}=this.boundaries,a=[{regex:new RegExp(`${i}(\\d+)(${n.hours.map(c=>this.escapeRegex(c)).join("|")})\\s*(\\d+)(${n.minutes.map(c=>this.escapeRegex(c)).join("|")})${s}`,"i"),handler:c=>parseInt(c[1])*60+parseInt(c[3])},{regex:new RegExp(`${i}(\\d+)\\s*(${n.hours.map(c=>this.escapeRegex(c)).join("|")})${s}`,"i"),handler:c=>parseInt(c[1])*60},{regex:new RegExp(`${i}(\\d+)\\s*(${n.minutes.map(c=>this.escapeRegex(c)).join("|")})${s}`,"i"),handler:c=>parseInt(c[1])}],o=e,l=0;for(let c of a){let d=o.match(c.regex);d&&(l+=c.handler(d),o=this.cleanupWhitespace(o.replace(c.regex,"")))}return l>0&&(t.estimate=l),o}validateAndCleanupResult(e){return e.title.trim()||(e.title="Untitled Task"),e.tags=[...new Set(e.tags.filter(Boolean))],e.contexts=[...new Set(e.contexts.filter(Boolean))],e.projects=[...new Set(e.projects.filter(Boolean))],e.dueDate&&!this.isValidDateString(e.dueDate)&&delete e.dueDate,e.scheduledDate&&!this.isValidDateString(e.scheduledDate)&&delete e.scheduledDate,e.dueTime&&!this.isValidTimeString(e.dueTime)&&delete e.dueTime,e.scheduledTime&&!this.isValidTimeString(e.scheduledTime)&&delete e.scheduledTime,e}getPreviewData(e){let t=[];if(e.title&&t.push({icon:"edit-3",text:`"${e.title}"`}),e.details&&t.push({icon:"file-text",text:`Details: "${e.details.substring(0,50)}${e.details.length>50?"...":""}"`}),e.dueDate){let n=e.dueTime?`${e.dueDate} at ${e.dueTime}`:e.dueDate;t.push({icon:"calendar",text:`Due: ${n}`})}if(e.scheduledDate){let n=e.scheduledTime?`${e.scheduledDate} at ${e.scheduledTime}`:e.scheduledDate;t.push({icon:"calendar-clock",text:`Scheduled: ${n}`})}if(e.priority&&t.push({icon:"alert-triangle",text:`Priority: ${e.priority}`}),e.status&&t.push({icon:"activity",text:`Status: ${e.status}`}),e.contexts&&e.contexts.length>0&&t.push({icon:"map-pin",text:`Contexts: ${e.contexts.map(n=>"@"+n).join(", ")}`}),e.projects&&e.projects.length>0){let n=e.projects.map(i=>`+${i}`).join(", ");t.push({icon:"folder",text:`Projects: ${n}`})}if(e.tags&&e.tags.length>0&&t.push({icon:"tag",text:`Tags: ${e.tags.map(n=>"#"+n).join(", ")}`}),e.recurrence){let n="Invalid recurrence";try{e.recurrence.includes("FREQ=")&&this.isValidRRuleString(e.recurrence)&&(n=dqe.fromString(e.recurrence).toText())}catch(i){console.debug("Error parsing rrule for preview:",i)}t.push({icon:"repeat",text:`Recurrence: ${n}`})}if(e.estimate&&t.push({icon:"clock",text:`Estimate: ${e.estimate} min`}),e.userFields&&Object.keys(e.userFields).length>0)for(let[n,i]of Object.entries(e.userFields)){let s=this.triggerConfig.getUserField(n),a=(s==null?void 0:s.displayName)||n,o;Array.isArray(i)?o=i.join(", "):o=i,t.push({icon:"box",text:`${a}: ${o}`})}return t}getPreviewText(e){return this.getPreviewData(e).map(t=>t.text).join(" \u2022 ")}getStatusSuggestions(e,t=10){let n=e.toLowerCase();return this.statusConfigs.filter(i=>i&&typeof i.value=="string"&&typeof i.label=="string").filter(i=>i.value.trim()!==""&&i.label.trim()!=="").filter(i=>i.value.toLowerCase().includes(n)||i.label.toLowerCase().includes(n)).slice(0,t).map(i=>({value:i.value,label:i.label,display:i.label}))}}});var pce=v(()=>{Fne();d1();u1();p1();uce()});var Oi,Ru=v(()=>{pce();Oi=class r extends BC{static fromPlugin(e){let t=e.settings;return new r(t.customStatuses,t.customPriorities,t.nlpDefaultToScheduled,t.nlpLanguage,t.nlpTriggers,t.userFields)}constructor(e=[],t=[],n=!0,i="en",s,a){super(e,t,n,i,s,a),this.taskNotesNlpTriggers=s,this.taskNotesUserFields=a||[]}parseInput(e){let t=super.parseInput(e);return this.extractLinkedUserFields(e,t)}extractLinkedUserFields(e,t){var s;let n=((s=this.taskNotesNlpTriggers)==null?void 0:s.triggers)||[];if(n.length===0||this.taskNotesUserFields.length===0)return t;let i=t.title;for(let a of n){if(!a.enabled)continue;let o=this.taskNotesUserFields.find(p=>p.id===a.propertyId);if(!o)continue;let l=this.escapeRegexLiteral(a.trigger),c=new RegExp(`${l}(\\[\\[[^\\]]+\\]\\]|\\[[^\\]]+\\]\\([^\\)]+\\))`,"gu"),d=Array.from(e.matchAll(c));if(d.length===0)continue;let u=d.map(p=>p[1]).filter(p=>typeof p=="string"&&p.length>0);if(u.length!==0){if(t.userFields||(t.userFields={}),o.type==="list"){let p=t.userFields[o.id],m=Array.isArray(p)?p:typeof p=="string"?[p]:[];t.userFields[o.id]=[...m,...u]}else t.userFields[o.id]=u[u.length-1];i=i.replace(c,"").replace(/\s+/g," ").trim()}}return t.title=i,t}escapeRegexLiteral(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}});var mce={};et(mce,{CalendarExportService:()=>Ol});var nf,Ol,qC=v(()=>{Tn();nf=require("obsidian"),Ol=class{static generateCalendarURL(e){let{type:t,task:n,useScheduledAsDue:i=!0}=e;switch(t){case"google":return this.generateGoogleCalendarURL(n,i);case"outlook":return this.generateOutlookCalendarURL(n,i);case"yahoo":return this.generateYahooCalendarURL(n,i);case"ics":return this.generateICSDownloadURL(n);default:throw new Error("Unsupported calendar type")}}static openCalendarURL(e,t){try{let n=this.generateCalendarURL(e);window.open(n,"_blank")}catch(n){console.error("Failed to generate calendar URL:",n),new nf.Notice(t?t("services.calendarExport.notices.generateLinkFailed"):"Failed to generate calendar link")}}static generateGoogleCalendarURL(e,t){let n="https://calendar.google.com/calendar/render",i=new URLSearchParams;i.append("action","TEMPLATE"),i.append("text",e.title);let s=this.formatGoogleDates(e,t);s&&i.append("dates",s);let a=this.buildDescription(e);return a&&i.append("details",a),e.contexts&&e.contexts.length>0&&i.append("location",e.contexts.join(", ")),`${n}?${i.toString()}`}static generateOutlookCalendarURL(e,t){let n="https://outlook.live.com/calendar/0/deeplink/compose",i=new URLSearchParams;i.append("subject",e.title);let{startISO:s,endISO:a}=this.getTaskDateRange(e,t);s&&i.append("startdt",s),a&&i.append("enddt",a);let o=this.buildDescription(e);return o&&i.append("body",o),e.contexts&&e.contexts.length>0&&i.append("location",e.contexts.join(", ")),i.append("path","/calendar/action/compose"),i.append("rru","addevent"),`${n}?${i.toString()}`}static generateYahooCalendarURL(e,t){let n="https://calendar.yahoo.com/",i=new URLSearchParams;i.append("v","60"),i.append("title",e.title);let{startYahoo:s,endYahoo:a}=this.getYahooDateFormat(e,t);s&&i.append("st",s),a&&i.append("et",a);let o=this.buildDescription(e);return o&&i.append("desc",o),e.contexts&&e.contexts.length>0&&i.append("in_loc",e.contexts.join(", ")),`${n}?${i.toString()}`}static generateICSDownloadURL(e){let t=this.generateICSContent(e);return`data:text/calendar;charset=utf8,${encodeURIComponent(t)}`}static generateICSContent(e,t){let n=`${e.path.replace(/[^a-zA-Z0-9]/g,"-")}-${Date.now()}@tasknotes`,i=new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),s=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//TaskNotes//Task Export//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH","BEGIN:VEVENT",`UID:${n}`,`DTSTAMP:${i}`];s.push(`SUMMARY:${this.escapeICSText(e.title)}`);let{startLine:a,endLine:o}=this.getICSDateProperties(e,!0,t);a&&s.push(a),o&&s.push(o);let l=this.buildDescription(e);if(l&&s.push(`DESCRIPTION:${this.escapeICSText(l)}`),e.contexts&&e.contexts.length>0&&s.push(`LOCATION:${this.escapeICSText(e.contexts.join(", "))}`),e.tags&&e.tags.length>0&&s.push(`CATEGORIES:${e.tags.map(c=>this.escapeICSText(c)).join(",")}`),e.priority){let d={highest:"1",high:"3",medium:"5",low:"7",lowest:"9"}[e.priority]||"5";s.push(`PRIORITY:${d}`)}if(e.status){let d={done:"COMPLETED","in-progress":"IN-PROCESS",todo:"NEEDS-ACTION",cancelled:"CANCELLED"}[e.status]||"NEEDS-ACTION";s.push(`STATUS:${d}`)}return s.push("END:VEVENT"),s.push("END:VCALENDAR"),s.join(`\r `)}static buildDescription(e){let t=[],n=[];return e.priority&&n.push(`Priority: ${e.priority}`),e.status&&n.push(`Status: ${e.status}`),e.projects&&e.projects.length>0&&n.push(`Projects: ${e.projects.join(", ")}`),e.tags&&e.tags.length>0&&n.push(`Tags: ${e.tags.join(", ")}`),e.contexts&&e.contexts.length>0&&n.push(`Contexts: ${e.contexts.join(", ")}`),e.timeEstimate&&n.push(`Estimated time: ${e.timeEstimate} minutes`),n.length>0&&t.push(...n),t.length>0&&t.push(""),t.push(`Exported from TaskNotes: ${e.path}`),t.join(` `)}static formatGoogleDates(e,t){let{startICS:n,endICS:i}=this.getICSDateFormat(e,t);if(!n)return null;if(i)return`${n}/${i}`;let s=this.parseICSDate(n),a=new Date(s.getTime()+3600*1e3),o=this.formatDateToICS(a);return`${n}/${o}`}static getTaskDateRange(e,t,n){let i=null,s=null;if(e.scheduled)try{i=this.parseTaskDate(e.scheduled).toISOString()}catch(a){console.warn("Invalid scheduled date:",e.scheduled)}if(n!=null&&n.useDurationForExport&&i&&e.timeEstimate&&e.timeEstimate>0){let a=new Date(i);s=new Date(a.getTime()+e.timeEstimate*60*1e3).toISOString()}else if(e.due)try{s=this.parseTaskDate(e.due).toISOString()}catch(a){console.warn("Invalid due date:",e.due)}else if(t&&i){let a=new Date(i);s=new Date(a.getTime()+3600*1e3).toISOString()}return{startISO:i,endISO:s}}static getYahooDateFormat(e,t){let{startISO:n,endISO:i}=this.getTaskDateRange(e,t),s=a=>{let o=new Date(a);return P(o,"yyyyMMdd'T'HHmmss")};return{startYahoo:n?s(n):null,endYahoo:i?s(i):null}}static getICSDateFormat(e,t=!0,n){let{startISO:i,endISO:s}=this.getTaskDateRange(e,t,n),a=o=>{let l=new Date(o);return this.formatDateToICS(l)};return{startICS:i?a(i):null,endICS:s?a(s):null}}static getICSDateProperties(e,t=!0,n){if(e.scheduled&&!this.hasTimeComponent(e.scheduled)){let a=e.scheduled,o=this.getAllDayEndDate(e,t,n)||a;return{startLine:`DTSTART;VALUE=DATE:${this.formatDateOnlyToICS(a)}`,endLine:`DTEND;VALUE=DATE:${this.formatDateOnlyToICS(o)}`}}let{startICS:i,endICS:s}=this.getICSDateFormat(e,t,n);return{startLine:i?`DTSTART:${i}`:null,endLine:s?`DTEND:${s}`:null}}static formatDateToICS(e){return e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}static parseICSDate(e){let t=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8),s=e.slice(9,11),a=e.slice(11,13),o=e.slice(13,15);return new Date(`${t}-${n}-${i}T${s}:${a}:${o}Z`)}static parseTaskDate(e){let t=e.trim().replace(" ","T");return this.hasTimeComponent(t)?ia(t):ia(`${t}T00:00:00`)}static hasTimeComponent(e){return/\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}/.test(e)}static formatDateOnlyToICS(e){return e.split(/[T\s]/)[0].replace(/-/g,"")}static getAllDayEndDate(e,t,n){if(!e.scheduled)return null;let i=e.scheduled;if(n!=null&&n.useDurationForExport&&e.timeEstimate&&e.timeEstimate>0){let s=Math.max(1,Math.ceil(e.timeEstimate/1440));return this.addDaysToDateString(e.scheduled,s)}if(e.due)i=e.due;else if(!t)return null;return this.addDaysToDateString(i,1)}static addDaysToDateString(e,t){let n=ia(`${e.split(/[T\s]/)[0]}T00:00:00`);return n.setDate(n.getDate()+t),P(n,"yyyy-MM-dd")}static escapeICSText(e){return e.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\n/g,"\\n").replace(/\r/g,"")}static foldICSLines(e){let t=e.split(`\r `),n=[];return t.forEach(i=>{if(i.length<=75)n.push(i);else{let s=i;for(;s.length>75;)n.push(s.substring(0,75)),s=" "+s.substring(75);s.length>0&&n.push(s)}}),n.join(`\r `)}static generateMultipleTasksICSContent(e,t){let n=new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),i=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//TaskNotes//EN","CALSCALE:GREGORIAN"];return e.forEach((s,a)=>{let o=`${s.path.replace(/[^a-zA-Z0-9]/g,"-")}-${a}-${Date.now()}@tasknotes`;i.push("BEGIN:VEVENT"),i.push(`UID:${o}`),i.push(`DTSTAMP:${n}`),i.push(`SUMMARY:${this.escapeICSText(s.title)}`);let{startLine:l,endLine:c}=this.getICSDateProperties(s,!0,t);if(l){if(!c){let u=l.split(":",2)[1];if(l.includes("VALUE=DATE")){let p=ia(`${u.slice(0,4)}-${u.slice(4,6)}-${u.slice(6,8)}T00:00:00`);p.setDate(p.getDate()+1),c=`DTEND;VALUE=DATE:${P(p,"yyyyMMdd")}`}else{let p=this.parseICSDate(u),m=new Date(p.getTime()+3600*1e3);c=`DTEND:${this.formatDateToICS(m)}`}}}else{let u;if(s.dateCreated?u=new Date(s.dateCreated):u=new Date,l=`DTSTART:${this.formatDateToICS(u)}`,!c){let m=new Date(u.getTime()+36e5);c=`DTEND:${this.formatDateToICS(m)}`}}i.push(l),i.push(c);let d=this.buildDescription(s);if(d&&i.push(`DESCRIPTION:${this.escapeICSText(d)}`),s.contexts&&s.contexts.length>0&&i.push(`LOCATION:${this.escapeICSText(s.contexts.join(", "))}`),s.tags&&s.tags.length>0&&i.push(`CATEGORIES:${s.tags.map(u=>this.escapeICSText(u)).join(",")}`),s.priority){let p={highest:"1",high:"3",medium:"5",low:"7",lowest:"9"}[s.priority]||"5";i.push(`PRIORITY:${p}`)}if(s.status){let p={done:"COMPLETED","in-progress":"IN-PROCESS",todo:"NEEDS-ACTION",cancelled:"CANCELLED"}[s.status]||"NEEDS-ACTION";i.push(`STATUS:${p}`)}i.push("END:VEVENT")}),i.push("END:VCALENDAR"),this.foldICSLines(i.join(`\r `))}static downloadAllTasksICSFile(e,t,n){try{if(!e||e.length===0){new nf.Notice(t?t("services.calendarExport.notices.noTasksToExport"):"No tasks found to export");return}let i=this.generateMultipleTasksICSContent(e,n),s=new Blob([i],{type:"text/calendar"}),a=URL.createObjectURL(s),l=`tasknotes-all-tasks-${new Date().toISOString().split("T")[0]}.ics`,c=activeDocument.createElement("a");c.href=a,c.download=l,c.click(),URL.revokeObjectURL(a);let d=e.length===1?"":"s";new nf.Notice(t?t("services.calendarExport.notices.downloadSuccess",{filename:l,count:e.length,plural:d}):`Downloaded ${l} with ${e.length} task${d}`)}catch(i){console.error("Failed to download all tasks ICS file:",i),new nf.Notice(t?t("services.calendarExport.notices.downloadFailed"):"Failed to download calendar file")}}static downloadICSFile(e,t,n){try{let i=this.generateICSContent(e,n),s=new Blob([i],{type:"text/calendar"}),a=URL.createObjectURL(s),o=`${e.title.replace(/[^a-zA-Z0-9]/g,"-")}.ics`,l=activeDocument.createElement("a");l.href=a,l.download=o,l.click(),URL.revokeObjectURL(a),new nf.Notice(t?t("services.calendarExport.notices.singleDownloadSuccess",{filename:o}):`Downloaded ${o}`)}catch(i){console.error("Failed to download ICS file:",i),new nf.Notice(t?t("services.calendarExport.notices.downloadFailed"):"Failed to download calendar file")}}}});async function Li(r,e){return new Aw(r,e).show()}var HC,Aw,md=v(()=>{HC=require("obsidian"),Aw=class extends HC.Modal{constructor(e,t){super(e),this.options={confirmText:"Confirm",cancelText:"Cancel",isDestructive:!1,...t}}show(){return new Promise(e=>{this.resolve=e,this.open()})}onOpen(){let{contentEl:e}=this;e.empty(),new HC.Setting(e).setName(this.options.title).setHeading(),e.createEl("p",{text:this.options.message});let t=e.createEl("div",{cls:"modal-button-container"});t.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),t.classList.add("tn-static-display-flex-75816cae"),t.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),t.classList.add("tn-static-gap-10px-f3d7ce77"),t.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),t.classList.add("tn-static-justify-content-flex-end-455f8cca"),t.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-16px-1b0f4999","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),t.classList.add("tn-static-margin-top-20px-a26bda7d");let n=null;this.options.thirdButtonText&&(n=t.createEl("button",{text:this.options.thirdButtonText}),n.addEventListener("click",()=>{this.options.onThirdButton&&this.options.onThirdButton(),this.close()}));let i=t.createEl("button",{text:this.options.cancelText});i.addEventListener("click",()=>{this.resolve(!1),this.close()});let s=t.createEl("button",{text:this.options.confirmText,cls:this.options.isDestructive?"mod-warning":"mod-cta"});this.options.isDestructive&&(s.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-text-accent-a954c70f"),s.classList.add("tn-static-background-color-var-color-red-134bc721"),s.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),s.classList.add("tn-static-color-white-0a43e56a")),s.addEventListener("click",()=>{this.resolve(!0),this.close()}),window.setTimeout(()=>{this.options.defaultToConfirm?s.focus():i.focus()},0)}onClose(){let{contentEl:e}=this;e.empty(),this.resolve&&this.resolve(!1)}}});async function fce(r,e){return new y$(r,e).show()}var Iw,y$,hce=v(()=>{Iw=require("obsidian"),y$=class extends Iw.Modal{constructor(e,t){super(e),this.options={confirmText:"Confirm",cancelText:"Cancel",...t}}show(){return new Promise(e=>{this.resolve=e,this.open()})}onOpen(){let{contentEl:e}=this;e.empty(),new Iw.Setting(e).setName(this.options.title).setHeading(),new Iw.Setting(e).addText(s=>{this.inputEl=s.inputEl,s.setPlaceholder(this.options.placeholder||"").setValue(this.options.initialValue||"").onChange(()=>{}),window.setTimeout(()=>{this.inputEl.focus(),this.inputEl.select()},100)});let t=e.createEl("div",{cls:"modal-button-container"});t.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),t.classList.add("tn-static-display-flex-75816cae"),t.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),t.classList.add("tn-static-gap-10px-f3d7ce77"),t.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),t.classList.add("tn-static-justify-content-flex-end-455f8cca"),t.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-16px-1b0f4999","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),t.classList.add("tn-static-margin-top-20px-a26bda7d");let n=t.createEl("button",{text:this.options.cancelText});n.addEventListener("click",()=>{this.resolve(null),this.close()});let i=t.createEl("button",{text:this.options.confirmText,cls:"mod-cta"});i.addEventListener("click",()=>{let s=this.inputEl.value.trim();this.resolve(s||null),this.close()}),this.inputEl.addEventListener("keydown",s=>{s.key==="Enter"?(s.preventDefault(),i.click()):s.key==="Escape"&&(s.preventDefault(),n.click())})}onClose(){let{contentEl:e}=this;e.empty(),this.resolve&&this.resolve(null)}}});function gce(r){let e=String(r.getHours()).padStart(2,"0"),t=String(r.getMinutes()).padStart(2,"0");return`${e}:${t}`}function yce(r,e){let t=null;if(r.scheduled)try{t=Mr(r.scheduled)}catch(s){t=null}(!t||isNaN(t.getTime()))&&(t=new Date(e)),isNaN(t.getTime())&&(t=new Date),(!r.scheduled||!$r(r.scheduled))&&t.setHours(9,0,0,0);let n=r.timeEstimate&&r.timeEstimate>0?r.timeEstimate:60,i=new Date(t.getTime()+n*60*1e3);return{date:ue(t),startTime:gce(t),endTime:gce(i)}}var vce=v(()=>{Qe()});function Ou(r,e,t){new v$(r.app,r,{placeholder:t==null?void 0:t.placeholder,title:t==null?void 0:t.title,filter:t==null?void 0:t.filter,newFileFolder:t==null?void 0:t.newFileFolder,sortOrder:t==null?void 0:t.sortOrder,onResult:i=>{i.type==="selected"||i.type==="created"?e(i.file):e(null)}}).open()}var ri,v$,Nw=v(()=>{ri=require("obsidian"),v$=class extends ri.SuggestModal{constructor(t,n,i){super(t);this.currentQuery="";this.resultHandled=!1;this.createFooterEl=null;this.handleInputChange=()=>{this.currentQuery=this.inputEl.value.trim(),this.updateCreateFooter()};this.plugin=n,this.options=i,this.setPlaceholder(i.placeholder||"Search files or type to create new..."),this.setInstructions([{command:"\u2191\u2193",purpose:"to navigate"},{command:"\u21B5",purpose:"to select"},{command:"\u21E7\u21B5",purpose:"to create new"},{command:"esc",purpose:"to cancel"}]),i.title&&this.titleEl.setText(i.title),this.containerEl.addClass("file-selector-modal"),this.containerEl.addClass("tasknotes-plugin")}onOpen(){super.onOpen(),this.scope.register(["Shift"],"Enter",t=>(t.preventDefault(),t.stopPropagation(),this.createNewFile(),!1)),this.inputEl.addEventListener("input",this.handleInputChange),window.setTimeout(()=>this.createFooter(),0)}createFooter(){var n;let t=this.modalEl.querySelector(".prompt");t&&(this.createFooterEl=((n=t.parentElement)==null?void 0:n.createDiv({cls:"file-selector-create-footer"}))||null,this.createFooterEl&&(this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b")))}updateCreateFooter(){if(!this.createFooterEl)return;if(!this.currentQuery){this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b");return}this.createFooterEl.empty(),this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-flex-75816cae");let n=this.createFooterEl.createDiv({cls:"file-selector-create-footer__content"}).createDiv({cls:"file-selector-create-footer__title-line"});n.createSpan({cls:"file-selector-create-footer__shortcut",text:"\u21E7\u21B5"}),n.createSpan({cls:"file-selector-create-footer__hint-text",text:" to create: "}),n.createSpan({cls:"file-selector-create-footer__filename",text:this.getNewFileName()})}getNewFileName(){let t=this.currentQuery;return t.toLowerCase().endsWith(".md")&&(t=t.slice(0,-3)),t+".md"}async createNewFile(){if(!this.currentQuery){new ri.Notice("Please enter a file name");return}try{let t=this.currentQuery;t.toLowerCase().endsWith(".md")&&(t=t.slice(0,-3));let n=this.options.newFileFolder||"",i=n?`${n}/${t}.md`:`${t}.md`;if(this.app.vault.getAbstractFileByPath(i)){new ri.Notice(`File "${i}" already exists`);return}n&&!await this.app.vault.adapter.exists(n)&&await this.app.vault.createFolder(n);let a=await this.app.vault.create(i,"");this.resultHandled=!0,this.close(),this.options.onResult({type:"created",file:a})}catch(t){console.error("Error creating file:",t),new ri.Notice("Failed to create file")}}getSuggestions(t){this.currentQuery=t.trim(),this.updateCreateFooter();let n=this.app.vault.getAllLoadedFiles(),i=t.toLowerCase(),s,a=this.options.filter||"markdown";typeof a=="function"?s=n.filter(a):a==="markdown"?s=n.filter(c=>c instanceof ri.TFile&&c.extension==="md"&&!c.path.includes(".trash")):s=n.filter(c=>c instanceof ri.TFile&&!c.path.includes(".trash"));let o=this.options.sortOrder||"name-asc",l=[...s].sort((c,d)=>{let u=c instanceof ri.TFile?c.stat.ctime:0,p=d instanceof ri.TFile?d.stat.ctime:0,m=c instanceof ri.TFile?c.stat.mtime:0,f=d instanceof ri.TFile?d.stat.mtime:0;switch(o){case"name-desc":return d.name.localeCompare(c.name);case"path-asc":return c.path.localeCompare(d.path);case"path-desc":return d.path.localeCompare(c.path);case"created-recent":return p-u;case"created-oldest":return u-p;case"modified-recent":return f-m;case"modified-oldest":return m-f;case"name-asc":default:return c.name.localeCompare(d.name)}});return t?l.filter(c=>this.getSearchText(c).toLowerCase().includes(i)).slice(0,50):l.slice(0,50)}getSearchText(t){let n=`${t.name} ${t.path}`;if(t instanceof ri.TFile){let i=this.app.metadataCache.getFileCache(t);if(i!=null&&i.frontmatter){let s=this.plugin.fieldMapper.toUserField("title"),a=i.frontmatter[s];a&&(n+=` ${a}`);let o=(0,ri.parseFrontMatterAliases)(i.frontmatter);o&&o.length>0&&(n+=` ${o.join(" ")}`)}}return n}renderSuggestion(t,n){let i=n.createDiv({cls:"file-selector-suggestion"});if(i.createDiv({cls:"file-selector-suggestion__name",text:t.name}),t instanceof ri.TFile){let s=this.app.metadataCache.getFileCache(t);if(s!=null&&s.frontmatter){let a=this.plugin.fieldMapper.toUserField("title"),o=s.frontmatter[a];if(o)i.createDiv({cls:"file-selector-suggestion__title",text:o});else{let l=(0,ri.parseFrontMatterAliases)(s.frontmatter);l&&l.length>0&&i.createDiv({cls:"file-selector-suggestion__aliases",text:l.join(", ")})}}}t.parent&&t.parent.path!=="/"&&i.createDiv({cls:"file-selector-suggestion__path",text:t.parent.path})}onChooseSuggestion(t,n){this.resultHandled=!0,this.options.onResult({type:"selected",file:t})}onClose(){this.inputEl.removeEventListener("input",this.handleInputChange),this.createFooterEl&&(this.createFooterEl.remove(),this.createFooterEl=null),window.setTimeout(()=>{this.resultHandled||this.options.onResult({type:"cancelled"})},0),super.onClose()}}});function uqe(r){return(0,cr.moment)(r)}var cr,Lu,ty,b$=v(()=>{cr=require("obsidian");Cr();Nw();Wo();Qe();Lu=Ke(Hc());ty=class extends cr.Modal{constructor(t,n,i){super(t);this.selectedAttachments=[];this.keyboardHandler=null;this.plugin=n,this.options=i,this.translate=n.i18n.translate.bind(n.i18n)}onOpen(){let{contentEl:t}=this;t.empty(),t.addClass("timeblock-creation-modal"),this.keyboardHandler=c=>{c.key==="Enter"&&(c.ctrlKey||c.metaKey)&&(c.preventDefault(),this.handleSubmit())},this.containerEl.addEventListener("keydown",this.keyboardHandler),new cr.Setting(t).setName(this.translate("modals.timeblockCreation.heading")).setHeading();let n=t.createDiv({cls:"timeblock-date-display"});n.createEl("strong",{text:this.translate("modals.timeblockCreation.dateLabel")});let i=wm(this.options.date);n.createSpan({text:i.toLocaleDateString()}),new cr.Setting(t).setName(this.translate("modals.timeblockCreation.titleLabel")).setDesc(this.translate("modals.timeblockCreation.titleDesc")).addText(c=>{this.titleInput=c.inputEl,c.setPlaceholder(this.translate("modals.timeblockCreation.titlePlaceholder")).setValue(this.options.prefilledTitle||"").onChange(()=>this.validateForm()),window.setTimeout(()=>this.titleInput.focus(),100)});let s=t.createDiv({cls:"timeblock-time-container"});new cr.Setting(s).setName(this.translate("modals.timeblockCreation.startTimeLabel")).setDesc(this.translate("modals.timeblockCreation.startTimeDesc")).addText(c=>{this.startTimeInput=c.inputEl,c.setPlaceholder(this.translate("modals.timeblockCreation.startTimePlaceholder")).setValue(this.options.startTime||"").onChange(()=>this.validateForm()),this.startTimeInput.type="time"}),new cr.Setting(s).setName(this.translate("modals.timeblockCreation.endTimeLabel")).setDesc(this.translate("modals.timeblockCreation.endTimeDesc")).addText(c=>{this.endTimeInput=c.inputEl,c.setPlaceholder(this.translate("modals.timeblockCreation.endTimePlaceholder")).setValue(this.options.endTime||"").onChange(()=>{this.endTimeInput.value==="00:00"&&(this.endTimeInput.value="23:59"),this.validateForm()}),this.endTimeInput.type="time"}),new cr.Setting(t).setName(this.translate("modals.timeblockCreation.descriptionLabel")).setDesc(this.translate("modals.timeblockCreation.descriptionDesc")).addTextArea(c=>{this.descriptionInput=c.inputEl,c.setPlaceholder(this.translate("modals.timeblockCreation.descriptionPlaceholder")).setValue(""),this.descriptionInput.rows=3}),new cr.Setting(t).setName(this.translate("modals.timeblockCreation.colorLabel")).setDesc(this.translate("modals.timeblockCreation.colorDesc")).addText(c=>{this.colorInput=c.inputEl,c.setPlaceholder(this.translate("modals.timeblockCreation.colorPlaceholder")).setValue(this.plugin.settings.calendarViewSettings.defaultTimeblockColor),this.colorInput.type="color"}),new cr.Setting(t).setName(this.translate("modals.timeblockCreation.attachmentsLabel")).setDesc(this.translate("modals.timeblockCreation.attachmentsDesc")).addButton(c=>{c.setButtonText(this.translate("modals.timeblockCreation.addAttachmentButton")).setTooltip(this.translate("modals.timeblockCreation.addAttachmentTooltip")).onClick(()=>{Ou(this.plugin,d=>{d instanceof cr.TAbstractFile&&this.addAttachment(d)},{placeholder:"Search files or type to create new...",filter:"all",sortOrder:this.plugin.settings.calendarViewSettings.timeblockAttachmentSearchOrder})})}).addButton(c=>{c.setButtonText("Add task").setTooltip("Select task").onClick(()=>{this.openTaskSelectorForTitle()})}),this.attachmentsList=t.createDiv({cls:"timeblock-attachments-list"}),this.initializePrefilledAttachments(),this.renderAttachmentsList();let a=t.createDiv({cls:"timeblock-modal-buttons"});a.createEl("button",{text:this.translate("common.cancel")}).addEventListener("click",()=>this.close()),a.createEl("button",{text:this.translate("modals.timeblockCreation.createButton"),cls:"mod-cta timeblock-create-button"}).addEventListener("click",()=>{this.handleSubmit()}),this.validateForm()}validateForm(){var o,l,c;let t=this.contentEl.querySelector(".timeblock-create-button");if(!t)return;let n=(o=this.titleInput)==null?void 0:o.value.trim(),i=(l=this.startTimeInput)==null?void 0:l.value,s=(c=this.endTimeInput)==null?void 0:c.value,a=!!(n&&i&&s);if(a&&i&&s){let[d,u]=i.split(":").map(Number),[p,m]=s.split(":").map(Number),f=d*60+u,h=p*60+m;h===0&&(h=1439),h<=f&&(a=!1)}t.disabled=!a,t.style.opacity=a?"1":"0.5"}initializePrefilledAttachments(){let t=this.options.prefilledAttachmentPaths||[];if(t.length===0)return;let n=new Set(t.filter(i=>typeof i=="string"&&i.trim().length>0));for(let i of n){let s=this.app.vault.getAbstractFileByPath(i);s&&this.selectedAttachments.push(s)}}async handleSubmit(){try{let t=this.titleInput.value.trim(),n=this.startTimeInput.value,i=this.endTimeInput.value,s=this.descriptionInput.value.trim(),a=this.colorInput.value;if(!t||!n||!i){new cr.Notice(this.translate("notices.timeblockRequiredFieldsMissing"));return}i==="00:00"&&(i="23:59");let o=this.selectedAttachments.map(c=>`[[${c.path}]]`),l={id:Ine(),title:t,startTime:n,endTime:i};s&&(l.description=s),a&&(l.color=a),o.length>0&&(l.attachments=o),await this.saveTimeblockToDailyNote(l),this.plugin.emitter.trigger("data-changed"),new cr.Notice(`Timeblock "${t}" created successfully`),this.close()}catch(t){console.error("Error creating timeblock:",t),new cr.Notice("Failed to create timeblock. Check console for details.")}}async saveTimeblockToDailyNote(t){if(!(0,Lu.appHasDailyNotesPluginLoaded)())throw new Error("Daily Notes plugin is not enabled");let n=uqe(this.options.date),i=(0,Lu.getAllDailyNotes)(),s=(0,Lu.getDailyNote)(n,i);if(!s){try{s=await(0,Lu.createDailyNote)(n)}catch(u){let p=u instanceof Error?u.message:String(u);throw new Error(`Failed to create daily note: ${p}. Please check your Daily Notes plugin configuration and ensure the daily notes folder exists.`)}if(!s)throw new Error("Failed to create daily note. Please check your Daily Notes plugin configuration and ensure the daily notes folder exists.")}let a=await this.app.vault.read(s),o={},l=a;if(a.startsWith("---")){let u=a.indexOf("---",3);if(u!==-1){let p=a.substring(3,u);l=a.substring(u+3);try{o=(0,cr.parseYaml)(p)||{}}catch(m){console.error("Error parsing existing frontmatter:",m),o={}}}}o.timeblocks||(o.timeblocks=[]),o.timeblocks.push(t);let d=`--- ${(0,cr.stringifyYaml)(o)}---${l}`;await this.app.vault.modify(s,d)}addAttachment(t){if(this.selectedAttachments.some(n=>n.path===t.path)){new cr.Notice(this.translate("notices.timeblockAttachmentExists",{fileName:t.name}));return}if(this.titleInput&&!this.titleInput.value.trim()){let n=t instanceof cr.TFile?t.basename:t.name;this.titleInput.value=n,this.validateForm()}this.selectedAttachments.push(t),this.renderAttachmentsList(),new cr.Notice(this.translate("notices.timeblockAttachmentAdded",{fileName:t.name}))}async openTaskSelectorForTitle(){var t,n,i;try{let a=((i=await((n=(t=this.plugin.cacheManager).getAllTasks)==null?void 0:n.call(t)))!=null?i:[]).filter(o=>!o.archived);if(a.length===0){new cr.Notice("No tasks available to select");return}pn(this.plugin,a,o=>{if(!o)return;this.titleInput.value=o.title||"",this.validateForm();let l=this.app.vault.getAbstractFileByPath(o.path);l&&this.addAttachment(l)},{title:"Select task"})}catch(s){console.error("Failed to open task selector for timeblock creation:",s),new cr.Notice("Failed to open task selector")}}removeAttachment(t){this.selectedAttachments=this.selectedAttachments.filter(n=>n.path!==t.path),this.renderAttachmentsList(),new cr.Notice(this.translate("notices.timeblockAttachmentRemoved",{fileName:t.name}))}renderAttachmentsList(){if(this.attachmentsList.empty(),this.selectedAttachments.length===0){let t=this.attachmentsList.createDiv({cls:"timeblock-attachments-empty"});t.textContent="No attachments added yet";return}this.selectedAttachments.forEach(t=>{let n=this.attachmentsList.createDiv({cls:"timeblock-attachment-item"}),i=n.createDiv({cls:"timeblock-attachment-info"}),s=i.createSpan({cls:"timeblock-attachment-name"});if(s.textContent=t.name,t.path!==t.name){let o=i.createDiv({cls:"timeblock-attachment-path"});o.textContent=t.path}let a=n.createEl("button",{cls:"timeblock-attachment-remove",text:"\xD7"});(0,cr.setTooltip)(a,"Remove attachment",{placement:"top"}),a.addEventListener("click",()=>{this.removeAttachment(t)})})}onClose(){this.keyboardHandler&&(this.containerEl.removeEventListener("keydown",this.keyboardHandler),this.keyboardHandler=null);let{contentEl:t}=this;t.empty()}}});function Is(r){return r.setSubmenu()}function bce(r){var t,n;let e=r;return(n=(t=e.dom)!=null?t:e.domEl)!=null?n:null}var Be,ry,T$=v(()=>{Be=require("obsidian");Qe();yg();qC();md();xm();gg();hce();Wo();QD();Zc();Bo();Wc();vce();b$();ry=class{constructor(e){this.targetDoc=activeDocument;this.menu=new Qn,this.options=e,this.buildMenu()}t(e,t){return this.options.plugin.i18n.translate(e,t)}buildMenu(){var n,i;let{task:e,plugin:t}=this.options;if(this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.status")),s.setIcon("circle");let a=Is(s);this.addStatusOptions(a,e,t)}),e.recurrence){this.menu.addSeparator();let s=ue(this.options.targetDate),a=((n=e.complete_instances)==null?void 0:n.includes(s))||!1;this.menu.addItem(l=>{l.setTitle(a?this.t("contextMenus.task.markIncomplete"):this.t("contextMenus.task.markComplete")),l.setIcon(a?"x":"check"),l.onClick(async()=>{var c,d;try{await t.toggleRecurringTaskComplete(e,this.options.targetDate),(d=(c=this.options).onUpdate)==null||d.call(c)}catch(u){let p=u instanceof Error?u.message:String(u);console.error("Error toggling recurring task completion:",{error:p,taskPath:e.path}),new Be.Notice(this.t("contextMenus.task.notices.toggleCompletionFailure",{message:p}))}})});let o=((i=e.skipped_instances)==null?void 0:i.includes(s))||!1;this.menu.addItem(l=>{l.setTitle(o?this.t("contextMenus.task.unskipInstance"):this.t("contextMenus.task.skipInstance")),l.setIcon(o?"undo":"x-circle"),l.onClick(async()=>{var c,d;try{await t.taskService.toggleRecurringTaskSkipped(e,this.options.targetDate),(d=(c=this.options).onUpdate)==null||d.call(c)}catch(u){let p=u instanceof Error?u.message:String(u);console.error("Error toggling recurring task skip:",{error:p,taskPath:e.path}),new Be.Notice(this.t("contextMenus.task.notices.toggleSkipFailure",{message:p}))}})})}this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.priority")),s.setIcon("star");let a=Is(s);this.addPriorityOptions(a,e,t)}),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.dueDate")),s.setIcon("calendar");let a=Is(s);this.addDateOptions(a,e.due,async o=>{var l,c;try{await t.updateTaskProperty(e,"due",o||void 0),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){let u=d instanceof Error?d.message:String(d);console.error("Error updating task due date:",{error:u,taskPath:e.path}),new Be.Notice(this.t("contextMenus.task.notices.updateDueDateFailure",{message:u}))}},()=>{t.openDueDateModal(e)})}),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.scheduledDate")),s.setIcon("calendar-clock");let a=Is(s);this.addDateOptions(a,e.scheduled,async o=>{var l,c;try{await t.updateTaskProperty(e,"scheduled",o||void 0),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){let u=d instanceof Error?d.message:String(d);console.error("Error updating task scheduled date:",{error:u,taskPath:e.path}),new Be.Notice(this.t("contextMenus.task.notices.updateScheduledFailure",{message:u}))}},()=>{t.openScheduledDateModal(e)})}),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.reminders")),s.setIcon("bell");let a=Is(s);this.addQuickRemindersSection(a,e,t,"due",this.t("contextMenus.task.remindBeforeDue")),this.addQuickRemindersSection(a,e,t,"scheduled",this.t("contextMenus.task.remindBeforeScheduled")),a.addSeparator(),a.addItem(o=>{o.setTitle(this.t("contextMenus.task.manageReminders")),o.setIcon("settings"),o.onClick(()=>{new zo(t.app,t,e,c=>{(async()=>{var d,u;try{await t.updateTaskProperty(e,"reminders",c.length>0?c:void 0),(u=(d=this.options).onUpdate)==null||u.call(d)}catch(p){console.error("Error updating reminders:",p),new Be.Notice(this.t("contextMenus.task.notices.updateRemindersFailure"))}})()}).open()})}),e.reminders&&e.reminders.length>0&&a.addItem(o=>{o.setTitle(this.t("contextMenus.task.clearReminders")),o.setIcon("trash"),o.onClick(async()=>{var l,c;try{await t.updateTaskProperty(e,"reminders",void 0),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){console.error("Error clearing reminders:",d),new Be.Notice(this.t("contextMenus.task.notices.clearRemindersFailure"))}})})}),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.dependencies.title")),s.setIcon("git-branch");let a=Is(s);this.addDependencyMenuItems(a,e,t)}),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.organization.title")),s.setIcon("folder-tree");let a=Is(s);this.addOrganizationMenuItems(a,e,t)}),this.menu.addSeparator(),this.menu.addItem(s=>{let a=t.getActiveTimeSession(e);s.setTitle(a?this.t("contextMenus.task.stopTimeTracking"):this.t("contextMenus.task.startTimeTracking")),s.setIcon(a?"pause":"play"),s.onClick(async()=>{var l,c;t.getActiveTimeSession(e)?await t.stopTimeTracking(e):await t.startTimeTracking(e),(c=(l=this.options).onUpdate)==null||c.call(l)})}),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.editTimeEntries")),s.setIcon("clock"),s.onClick(()=>{t.openTimeEntryEditor(e)})}),t.settings.calendarViewSettings.enableTimeblocking&&this.menu.addItem(s=>{s.setTitle("Create timeblock"),s.setIcon("calendar-plus"),s.onClick(()=>{let a=yce(e,this.options.targetDate);new ty(t.app,t,{date:a.date,startTime:a.startTime,endTime:a.endTime,prefilledTitle:e.title,prefilledAttachmentPaths:[e.path]}).open()})}),this.menu.addItem(s=>{s.setTitle(e.archived?this.t("contextMenus.task.unarchive"):this.t("contextMenus.task.archive")),s.setIcon(e.archived?"archive-restore":"archive"),s.onClick(async()=>{var a,o;try{await t.toggleTaskArchive(e),(o=(a=this.options).onUpdate)==null||o.call(a)}catch(l){let c=l instanceof Error?l.message:String(l);console.error("Error toggling task archive:",{error:c,taskPath:e.path}),new Be.Notice(this.t("contextMenus.task.notices.archiveFailure",{message:c}))}})}),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.openNote")),s.setIcon("file-text"),s.onClick(()=>{let a=t.app.vault.getAbstractFileByPath(e.path);a instanceof Be.TFile&&t.app.workspace.getLeaf(!1).openFile(a)})}),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.copyTitle")),s.setIcon("copy"),s.onClick(async()=>{try{await navigator.clipboard.writeText(e.title),new Be.Notice(this.t("contextMenus.task.notices.copyTitleSuccess"))}catch(a){new Be.Notice(this.t("contextMenus.task.notices.copyFailure"))}})}),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.noteActions")),s.setIcon("file-text");let a=Is(s),o=t.app.vault.getAbstractFileByPath(e.path);if(o instanceof Be.TFile){try{t.app.workspace.trigger("file-menu",a,o,"file-explorer")}catch(l){console.debug("Native file menu not available, using fallback")}a.addItem(l=>{l.setTitle(this.t("contextMenus.task.rename")),l.setIcon("pencil"),l.onClick(async()=>{try{let c=o.basename,d=await fce(t.app,{title:this.t("contextMenus.task.renameTitle"),placeholder:this.t("contextMenus.task.renamePlaceholder"),initialValue:c});if(d&&d.trim()!==""&&d!==c){let u=o.extension,p=d.endsWith(`.${u}`)?d:`${d}.${u}`,m=o.parent?`${o.parent.path}/${p}`:p;await t.app.vault.rename(o,m),new Be.Notice(this.t("contextMenus.task.notices.renameSuccess",{name:p})),this.options.onUpdate&&this.options.onUpdate()}}catch(c){console.error("Error renaming file:",c),new Be.Notice(this.t("contextMenus.task.notices.renameFailure"))}})}),a.addItem(l=>{l.setTitle(this.t("contextMenus.task.delete")),l.setIcon("trash"),l.onClick(async()=>{var d;await Li(t.app,{title:this.t("contextMenus.task.deleteTitle"),message:this.t("contextMenus.task.deleteMessage",{name:o.name}),confirmText:this.t("contextMenus.task.deleteConfirm"),cancelText:this.t("common.cancel"),isDestructive:!0})&&((d=t.taskCalendarSyncService)!=null&&d.isEnabled()&&e.googleCalendarEventId&&t.taskCalendarSyncService.deleteTaskFromCalendarByPath(e.path,e.googleCalendarEventId).catch(u=>{console.warn("Failed to delete task from Google Calendar:",u)}),t.app.fileManager.trashFile(o))})}),a.addSeparator(),a.addItem(l=>{l.setTitle(this.t("contextMenus.task.copyPath")),l.setIcon("copy"),l.onClick(()=>{navigator.clipboard.writeText(o.path).then(()=>{new Be.Notice(this.t("contextMenus.task.notices.copyPathSuccess"))}).catch(()=>{new Be.Notice(this.t("contextMenus.task.notices.copyFailure"))})})}),a.addItem(l=>{l.setTitle(this.t("contextMenus.task.copyUrl")),l.setIcon("link"),l.onClick(()=>{let c=`obsidian://open?vault=${encodeURIComponent(t.app.vault.getName())}&file=${encodeURIComponent(o.path)}`;navigator.clipboard.writeText(c).then(()=>{new Be.Notice(this.t("contextMenus.task.notices.copyUrlSuccess"))}).catch(()=>{new Be.Notice(this.t("contextMenus.task.notices.copyFailure"))})})}),a.addSeparator(),a.addItem(l=>{l.setTitle(this.t("contextMenus.task.showInExplorer")),l.setIcon("folder-open"),l.onClick(()=>{t.app.workspace.getLeaf().setViewState({type:"file-explorer",state:{}}).then(()=>{let c=t.app.workspace.getLeavesOfType("file-explorer")[0];c!=null&&c.view&&"revealInFolder"in c.view&&c.view.revealInFolder(o)}).catch(c=>{console.warn("Failed to reveal task in file explorer:",c)})})})}}),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.addToCalendar")),s.setIcon("calendar-plus");let a=Is(s);a.addItem(o=>{o.setTitle(this.t("contextMenus.task.calendar.google")),o.setIcon("external-link"),o.onClick(()=>{Ol.openCalendarURL({type:"google",task:e,useScheduledAsDue:!0},this.t.bind(this))})}),a.addItem(o=>{o.setTitle(this.t("contextMenus.task.calendar.outlook")),o.setIcon("external-link"),o.onClick(()=>{Ol.openCalendarURL({type:"outlook",task:e,useScheduledAsDue:!0},this.t.bind(this))})}),a.addItem(o=>{o.setTitle(this.t("contextMenus.task.calendar.yahoo")),o.setIcon("external-link"),o.onClick(()=>{Ol.openCalendarURL({type:"yahoo",task:e,useScheduledAsDue:!0},this.t.bind(this))})}),a.addSeparator(),a.addItem(o=>{o.setTitle(this.t("contextMenus.task.calendar.downloadIcs")),o.setIcon("download"),o.onClick(()=>{Ol.downloadICSFile(e,this.t.bind(this))})}),a.addSeparator(),a.addItem(o=>{o.setTitle(this.t("contextMenus.task.calendar.syncToGoogle")),o.setIcon("refresh-cw"),o.onClick(async()=>{var l,c,d;if(!((l=t.taskCalendarSyncService)!=null&&l.isEnabled())){new Be.Notice(this.t("contextMenus.task.calendar.syncToGoogleNotConfigured"));return}try{await t.taskCalendarSyncService.syncTaskToCalendar(e),new Be.Notice(this.t("contextMenus.task.calendar.syncToGoogleSuccess")),(d=(c=this.options).onUpdate)==null||d.call(c)}catch(u){console.error("Failed to sync task to Google Calendar:",u),new Be.Notice(this.t("contextMenus.task.calendar.syncToGoogleFailed"))}})})}),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.recurrence")),s.setIcon("refresh-ccw");let a=Is(s),o=typeof e.recurrence=="string"?e.recurrence:void 0;this.addRecurrenceOptions(a,o,async l=>{var c,d;try{await t.updateTaskProperty(e,"recurrence",l||void 0),(d=(c=this.options).onUpdate)==null||d.call(c)}catch(u){let p=u instanceof Error?u.message:String(u);console.error("Error updating task recurrence:",{error:p,taskPath:e.path}),new Be.Notice(this.t("contextMenus.task.notices.updateRecurrenceFailure",{message:p}))}},t)}),this.menu.addSeparator(),this.menu.addItem(s=>{s.setTitle(this.t("contextMenus.task.createSubtask")),s.setIcon("plus"),s.onClick(()=>{let a=t.app.vault.getAbstractFileByPath(e.path);if(a instanceof Be.TFile){let o=xl(t.app,a,e.path,"","",t.settings.useFrontmatterMarkdownLinks);t.openTaskCreationModal({projects:[o]})}})}),window.setTimeout(()=>{this.updateMainMenuIconColors(e,t)},10)}addDependencyMenuItems(e,t,n){var a,o;e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.addBlockedBy")),l.setIcon("link-2"),l.onClick(()=>{this.menu.hide(),this.openBlockedBySelector(t,n)})});let i=(a=t.blockedBy)!=null?a:[];i.length>0&&e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.removeBlockedBy")),l.setIcon("unlink");let c=Is(l);i.forEach((d,u)=>{c.addItem(p=>{let m=RL(d)||this.t("contextMenus.task.dependencies.unknownDependency");p.setTitle(m),p.onClick(async()=>{var f,h;try{let g=i.filter((k,T)=>T!==u),y=await n.updateTaskProperty(t,"blockedBy",g.length>0?g:void 0);Object.assign(t,y),new Be.Notice(this.t("contextMenus.task.dependencies.notices.blockedByRemoved")),(h=(f=this.options).onUpdate)==null||h.call(f)}catch(g){console.error("Failed to remove blocked-by dependency:",g),new Be.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}})})})}),e.addSeparator(),e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.addBlocking")),l.setIcon("git-branch-plus"),l.onClick(()=>{this.menu.hide(),this.openBlockingSelector(t,n)})});let s=(o=t.blocking)!=null?o:[];s.length>0&&e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.removeBlocking")),l.setIcon("git-branch-minus");let c=Is(l);s.forEach(d=>{let u=n.app.vault.getAbstractFileByPath(d),p=u instanceof Be.TFile?n.app.metadataCache.fileToLinktext(u,t.path,!1):d.split("/").pop()||d;c.addItem(m=>{m.setTitle(p),m.onClick(async()=>{var f,h;try{await n.taskService.updateBlockingRelationships(t,[],[d],{});let g=await n.cacheManager.getTaskInfo(t.path);g&&Object.assign(t,g),new Be.Notice(this.t("contextMenus.task.dependencies.notices.blockingRemoved")),(h=(f=this.options).onUpdate)==null||h.call(f)}catch(g){console.error("Failed to remove blocking dependency:",g),new Be.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}})})})})}dedupeDependencyEntries(e){let t=new Map;for(let n of e){let i=El(n);if(!i)continue;let s=this.getDependencyKey(i);t.has(s)||t.set(s,i)}return Array.from(t.values())}async openBlockedBySelector(e,t){let n=new Set((Array.isArray(e.blockedBy)?e.blockedBy:[]).map(i=>i.uid));await this.openTaskDependencySelector(t,i=>{if(i.path===e.path)return!1;let s=Ba(t.app,e.path,i.path,t.settings.useFrontmatterMarkdownLinks);return!n.has(s)},async i=>{await this.handleBlockedBySelection(e,t,i)})}async openBlockingSelector(e,t){var i;let n=new Set((i=e.blocking)!=null?i:[]);await this.openTaskDependencySelector(t,s=>s.path===e.path?!1:!n.has(s.path),async s=>{await this.handleBlockingSelection(e,t,s)})}async openTaskDependencySelector(e,t,n){try{let s=(await e.cacheManager.getAllTasks()).filter(t);if(s.length===0){new Be.Notice(this.t("contextMenus.task.dependencies.notices.noEligibleTasks"));return}pn(e,s,a=>{a&&n(a)})}catch(i){console.error("Failed to open task selector for dependencies:",i),new Be.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}async handleBlockedBySelection(e,t,n){var i,s;if(n.path!==e.path)try{let a={uid:Ba(t.app,e.path,n.path,t.settings.useFrontmatterMarkdownLinks),reltype:Ds},o=Array.isArray(e.blockedBy)?e.blockedBy:[],l=this.dedupeDependencyEntries([...o,a]);if(l.length===o.length)return;let c=await t.updateTaskProperty(e,"blockedBy",l);Object.assign(e,c),new Be.Notice(this.t("contextMenus.task.dependencies.notices.blockedByAdded",{count:1})),(s=(i=this.options).onUpdate)==null||s.call(i)}catch(a){console.error("Failed to add blocked-by dependency via selector:",a),new Be.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}async handleBlockingSelection(e,t,n){var s,a,o;let i=n.path;if(i!==e.path&&!((s=e.blocking)!=null&&s.includes(i)))try{let l={uid:Ba(t.app,i,e.path,t.settings.useFrontmatterMarkdownLinks),reltype:Ds};await t.taskService.updateBlockingRelationships(e,[i],[],{[i]:l});let c=await t.cacheManager.getTaskInfo(e.path);c?Object.assign(e,c):Array.isArray(e.blocking)?e.blocking=Array.from(new Set([...e.blocking,i])):e.blocking=[i],new Be.Notice(this.t("contextMenus.task.dependencies.notices.blockingAdded",{count:1})),(o=(a=this.options).onUpdate)==null||o.call(a)}catch(l){console.error("Failed to add blocking dependency via selector:",l),new Be.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}getDependencyKey(e){var t;return`${e.uid}::${e.reltype}::${(t=e.gap)!=null?t:""}`}addOrganizationMenuItems(e,t,n){e.addItem(i=>{i.setTitle(this.t("contextMenus.task.organization.addToProject")),i.setIcon("folder-plus"),i.onClick(()=>{this.menu.hide(),this.openProjectSelector(t,n)})}),e.addItem(i=>{i.setTitle(this.t("contextMenus.task.organization.addSubtasks")),i.setIcon("indent"),i.onClick(()=>{this.menu.hide(),this.openSubtaskAssignmentSelector(t,n)})})}async openProjectSelector(e,t){try{new Su(t.app,t,i=>{i&&this.addTaskToProject(e,t,i)}).open()}catch(n){console.error("Failed to open project selector:",n),new Be.Notice(this.t("contextMenus.task.organization.notices.projectSelectFailed"))}}async openSubtaskAssignmentSelector(e,t){try{let i=(await t.cacheManager.getAllTasks()).filter(s=>s.path!==e.path);if(i.length===0){new Be.Notice(this.t("contextMenus.task.organization.notices.noEligibleSubtasks"));return}pn(t,i,s=>{s&&this.assignTaskAsSubtask(e,t,s)})}catch(n){console.error("Failed to open subtask assignment selector:",n),new Be.Notice(this.t("contextMenus.task.organization.notices.subtaskSelectFailed"))}}async addTaskToProject(e,t,n){var i,s;try{if(!(n instanceof Be.TFile)){new Be.Notice(this.t("contextMenus.task.organization.notices.projectSelectFailed"));return}let a=xl(t.app,n,e.path,"","",t.settings.useFrontmatterMarkdownLinks),o=`[[${n.basename}]]`,l=Array.isArray(e.projects)?e.projects:[];if(l.includes(a)||l.includes(o)){new Be.Notice(this.t("contextMenus.task.organization.notices.alreadyInProject"));return}let d=[...l.filter(p=>p!==o),a],u=await t.updateTaskProperty(e,"projects",d);Object.assign(e,u),new Be.Notice(this.t("contextMenus.task.organization.notices.addedToProject",{project:n.basename})),(s=(i=this.options).onUpdate)==null||s.call(i)}catch(a){console.error("Failed to add task to project:",a),new Be.Notice(this.t("contextMenus.task.organization.notices.addToProjectFailed"))}}async assignTaskAsSubtask(e,t,n){var i,s;try{let a=t.app.vault.getAbstractFileByPath(e.path);if(!(a instanceof Be.TFile)){new Be.Notice(this.t("contextMenus.task.organization.notices.currentTaskNotFound"));return}let o=xl(t.app,a,n.path,"","",t.settings.useFrontmatterMarkdownLinks),l=`[[${a.basename}]]`,c=Array.isArray(n.projects)?n.projects:[];if(c.includes(o)||c.includes(l)){new Be.Notice(this.t("contextMenus.task.organization.notices.alreadySubtask"));return}let u=[...c.filter(m=>m!==l),o],p=await t.updateTaskProperty(n,"projects",u);Object.assign(n,p),new Be.Notice(this.t("contextMenus.task.organization.notices.addedAsSubtask",{subtask:n.title,parent:a.basename})),(s=(i=this.options).onUpdate)==null||s.call(i)}catch(a){console.error("Failed to assign task as subtask:",a),new Be.Notice(this.t("contextMenus.task.organization.notices.addAsSubtaskFailed"))}}buildProjectReference(e,t,n){return xl(n.app,e,t,"","",n.settings.useFrontmatterMarkdownLinks)}updateMainMenuIconColors(e,t){let n=this.targetDoc.querySelector(".menu");if(!n)return;let i=n.querySelectorAll(".menu-item"),s=this.t("contextMenus.task.status"),a=this.t("contextMenus.task.priority");i.forEach(o=>{let l=o.querySelector(".menu-item-title"),c=o.querySelector(".menu-item-icon");if(l&&c){let d=l.textContent;if(d===s){let u=t.settings.customStatuses.find(p=>p.value===e.status);u&&u.color&&(c.style.color=u.color)}else if(d===a){let u=t.settings.customPriorities.find(p=>p.value===e.priority);u&&u.color&&(c.style.color=u.color)}}})}addStatusOptions(e,t,n){this.getStatusOptions(t,n).forEach((s,a)=>{e.addItem(o=>{let l=s.label;o.setIcon(s.icon||"circle"),s.value===t.status&&(l=this.t("contextMenus.task.statusSelected",{label:s.label})),o.setTitle(l),o.onClick(async()=>{var d,u;try{await n.updateTaskProperty(t,"status",s.value),(u=(d=this.options).onUpdate)==null||u.call(d)}catch(p){let m=p instanceof Error?p.message:String(p);console.error("Error updating task status:",{error:m,taskPath:t.path}),new Be.Notice(`Failed to update task status: ${m}`)}});let c=s.color;c&&window.setTimeout(()=>{let d=bce(o);if(d){let u=d.querySelector(".menu-item-icon");u&&(u.style.color=c)}},10)})})}addPriorityOptions(e,t,n){n.priorityManager.getPrioritiesByWeight().forEach(s=>{e.addItem(a=>{let o=s.label;a.setIcon("star"),s.value===t.priority&&(o=this.t("contextMenus.task.prioritySelected",{label:s.label})),a.setTitle(o),a.onClick(async()=>{var l,c;try{await n.updateTaskProperty(t,"priority",s.value),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){let u=d instanceof Error?d.message:String(d);console.error("Error updating task priority:",{error:u,taskPath:t.path}),new Be.Notice(`Failed to update task priority: ${u}`)}}),s.color&&window.setTimeout(()=>{let l=bce(a);if(l){let c=l.querySelector(".menu-item-icon");c&&(c.style.color=s.color)}},10)})})}addDateOptions(e,t,n,i){let a=new Es({currentValue:t,onSelect:d=>{n(d)},onCustomDate:i,plugin:this.options.plugin,app:this.options.plugin.app}).getDateOptions(),o=a.filter(d=>d.category==="increment");o.length>0&&(o.forEach(d=>{e.addItem(u=>{d.icon&&u.setIcon(d.icon),u.setTitle(d.label),u.onClick(()=>{n(d.value)})})}),e.addSeparator()),a.filter(d=>d.category==="basic").forEach(d=>{e.addItem(u=>{d.icon&&u.setIcon(d.icon);let m=d.value===t?this.t("contextMenus.date.selected",{label:d.label}):d.label;u.setTitle(m),u.onClick(()=>{n(d.value)})})});let c=a.filter(d=>d.category==="weekday");c.length>0&&(e.addSeparator(),e.addItem(d=>{d.setTitle(this.t("contextMenus.date.weekdaysLabel")),d.setIcon("calendar");let u=Is(d);c.forEach(p=>{u.addItem(m=>{let h=p.value===t?this.t("contextMenus.date.selected",{label:p.label}):p.label;m.setTitle(h),m.setIcon("calendar"),m.onClick(()=>{n(p.value)})})})})),e.addSeparator(),e.addItem(d=>{d.setTitle(this.t("contextMenus.date.pickDateTime")),d.setIcon("calendar"),d.onClick(i)}),t&&e.addItem(d=>{d.setTitle(this.t("contextMenus.date.clearDate")),d.setIcon("x"),d.onClick(()=>{n(null)})})}addRecurrenceOptions(e,t,n,i){let s=new Date,a=["SU","MO","TU","WE","TH","FR","SA"],o=[i.i18n.translate("common.months.january"),i.i18n.translate("common.months.february"),i.i18n.translate("common.months.march"),i.i18n.translate("common.months.april"),i.i18n.translate("common.months.may"),i.i18n.translate("common.months.june"),i.i18n.translate("common.months.july"),i.i18n.translate("common.months.august"),i.i18n.translate("common.months.september"),i.i18n.translate("common.months.october"),i.i18n.translate("common.months.november"),i.i18n.translate("common.months.december")],l=a[s.getDay()],c=s.getDate(),d=s.getMonth()+1,u=o[s.getMonth()],p=s.toLocaleDateString("en-US",{weekday:"long"}),m=y=>{let k=y.getFullYear(),T=String(y.getMonth()+1).padStart(2,"0"),w=String(y.getDate()).padStart(2,"0");return`${k}${T}${w}`},f=y=>{let k=["th","st","nd","rd"],T=y%100;return y+(k[(T-20)%10]||k[T]||k[0])},h=m(s);[{label:this.t("modals.task.recurrence.daily"),value:`DTSTART:${h};FREQ=DAILY;INTERVAL=1`,icon:"calendar-days"},{label:this.t("modals.task.recurrence.weeklyOn",{days:p}),value:`DTSTART:${h};FREQ=WEEKLY;INTERVAL=1;BYDAY=${l}`,icon:"calendar"},{label:this.t("modals.task.recurrence.everyTwoWeeks"),value:`DTSTART:${h};FREQ=WEEKLY;INTERVAL=2;BYDAY=${l}`,icon:"calendar"},{label:this.t("modals.task.recurrence.monthlyOnOrdinal",{ordinal:f(c)}),value:`DTSTART:${h};FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=${c}`,icon:"calendar-range"},{label:this.t("modals.task.recurrence.everyThreeMonths"),value:`DTSTART:${h};FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=${c}`,icon:"calendar-range"},{label:this.t("modals.task.recurrence.yearlyOn",{month:u,day:f(c)}),value:`DTSTART:${h};FREQ=YEARLY;INTERVAL=1;BYMONTH=${d};BYMONTHDAY=${c}`,icon:"calendar-clock"},{label:this.t("modals.task.recurrence.weekdays"),value:`DTSTART:${h};FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR`,icon:"briefcase"}].forEach(y=>{e.addItem(k=>{let T=y.value===t;k.setTitle(T?`\u2713 ${y.label}`:y.label),k.setIcon(y.icon),k.onClick(()=>{n(y.value)})})}),e.addSeparator(),e.addItem(y=>{y.setTitle(this.t("contextMenus.task.customRecurrence")),y.setIcon("settings"),y.onClick(()=>{new jo({currentValue:typeof t=="string"?t:void 0,currentAnchor:this.options.task.recurrence_anchor||"scheduled",scheduledDate:this.options.task.scheduled,onSelect:T=>{n(T)},app:i.app,plugin:i}).showCustomRecurrenceModal()})}),t&&e.addItem(y=>{y.setTitle(this.t("contextMenus.task.clearRecurrence")),y.setIcon("x"),y.onClick(()=>{n(null)})})}getStatusOptions(e,t){let n=t.settings.customStatuses,i=[];return n&&n.length>0&&[...n].sort((a,o)=>a.order-o.order).forEach(a=>{i.push({label:a.label,value:a.value,color:a.color,icon:a.icon})}),i}addQuickRemindersSection(e,t,n,i,s){if(!(i==="due"?t.due:t.scheduled)){e.addItem(o=>{o.setTitle(s),o.setIcon("bell"),o.setDisabled(!0)});return}e.addItem(o=>{o.setTitle(s),o.setIcon("bell");let l=Is(o);[{labelKey:"contextMenus.task.quickReminders.atTime",offset:"PT0M"},{labelKey:"contextMenus.task.quickReminders.fiveMinutes",offset:"-PT5M"},{labelKey:"contextMenus.task.quickReminders.fifteenMinutes",offset:"-PT15M"},{labelKey:"contextMenus.task.quickReminders.oneHour",offset:"-PT1H"},{labelKey:"contextMenus.task.quickReminders.oneDay",offset:"-P1D"}].forEach(d=>{l.addItem(u=>{let p=this.t(d.labelKey);u.setTitle(p),u.onClick(()=>{this.addQuickReminder(t,n,i,d.offset,p)})})})})}async addQuickReminder(e,t,n,i,s){var l,c;let a={id:`rem_${Date.now()}`,type:"relative",relatedTo:n,offset:i,description:s},o=[...e.reminders||[],a];try{await t.updateTaskProperty(e,"reminders",o),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){console.error("Error adding reminder:",d),new Be.Notice("Failed to add reminder")}}show(e){var t,n;(n=(t=e.target)==null?void 0:t.instanceOf)!=null&&n.call(t,HTMLElement)&&(this.targetDoc=e.target.ownerDocument),this.menu.showAtMouseEvent(e)}showAtElement(e){this.targetDoc=e.ownerDocument,this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4})}}});function UC(r){return r.setSubmenu()}function Tce(r){var t,n;let e=r;return(n=(t=e.dom)!=null?t:e.domEl)!=null?n:null}var ya,sf,k$=v(()=>{ya=require("obsidian");xm();Wc();md();sf=class{constructor(e){this.menu=new Qn,this.options=e,this.buildMenu()}t(e,t){return this.options.plugin.i18n.translate(e,t)}buildMenu(){let{selectedPaths:e}=this.options,t=e.length;this.menu.addItem(n=>{n.setTitle(`${t} tasks selected`),n.setIcon("check-square"),n.setDisabled(!0)}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.status")),n.setIcon("circle");let i=UC(n);this.addStatusOptions(i)}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.priority")),n.setIcon("star");let i=UC(n);this.addPriorityOptions(i)}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.dueDate")),n.setIcon("calendar");let i=UC(n);this.addDateOptions(i,"due")}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.scheduledDate")),n.setIcon("calendar-clock");let i=UC(n);this.addDateOptions(i,"scheduled")}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.archive")),n.setIcon("archive"),n.onClick(async()=>{await this.batchArchive(!0)})}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.unarchive")),n.setIcon("archive-restore"),n.onClick(async()=>{await this.batchArchive(!1)})}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle("Clear selection"),n.setIcon("x"),n.onClick(()=>{var i,s;(i=this.options.plugin.taskSelectionService)==null||i.clearSelection(),(s=this.options.plugin.taskSelectionService)==null||s.exitSelectionMode()})}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(`Delete ${t} tasks`),n.setIcon("trash"),n.onClick(async()=>{await this.batchDelete()})})}addStatusOptions(e){let n=[...this.options.plugin.settings.customStatuses].sort((i,s)=>i.order-s.order);for(let i of n)e.addItem(s=>{s.setTitle(i.label),s.setIcon(i.icon||"circle"),s.onClick(async()=>{await this.batchUpdateProperty("status",i.value)}),i.color&&window.setTimeout(()=>{let a=Tce(s);if(a){let o=a.querySelector(".menu-item-icon");o&&(o.style.color=i.color)}},10)})}addPriorityOptions(e){let t=this.options.plugin.priorityManager.getPrioritiesByWeight();for(let n of t)e.addItem(i=>{i.setTitle(n.label),i.setIcon("star"),i.onClick(async()=>{await this.batchUpdateProperty("priority",n.value)}),n.color&&window.setTimeout(()=>{let s=Tce(i);if(s){let a=s.querySelector(".menu-item-icon");a&&(a.style.color=n.color)}},10)});e.addSeparator(),e.addItem(n=>{n.setTitle(this.t("contextMenus.priority.clearPriority")),n.setIcon("x"),n.onClick(async()=>{await this.batchUpdateProperty("priority",void 0)})})}addDateOptions(e,t){let s=new Es({currentValue:void 0,onSelect:()=>{},plugin:this.options.plugin,app:this.options.plugin.app}).getDateOptions().filter(a=>a.category==="basic");for(let a of s)e.addItem(o=>{a.icon&&o.setIcon(a.icon),o.setTitle(a.label),o.onClick(async()=>{await this.batchUpdateProperty(t,a.value)})});e.addSeparator(),e.addItem(a=>{a.setTitle(this.t("contextMenus.date.clearDate")),a.setIcon("x"),a.onClick(async()=>{await this.batchUpdateProperty(t,void 0)})})}async batchUpdateProperty(e,t){var o,l;let{plugin:n,selectedPaths:i,onUpdate:s}=this.options,a=i.length;try{new ya.Notice(`Updating ${a} tasks...`);let c=0,d=0;for(let u of i)try{let p=await n.cacheManager.getTaskInfo(u);p?(await n.taskService.updateProperty(p,e,t),c++):d++}catch(p){console.error(`[BatchContextMenu] Failed to update task ${u}:`,p),d++}d===0?new ya.Notice(`Updated ${c} tasks`):new ya.Notice(`Updated ${c} tasks, ${d} failed`),(o=n.taskSelectionService)==null||o.clearSelection(),(l=n.taskSelectionService)==null||l.exitSelectionMode(),s==null||s()}catch(c){console.error("[BatchContextMenu] Batch update failed:",c),new ya.Notice("Failed to update tasks")}}async batchArchive(e){var a,o;let{plugin:t,selectedPaths:n,onUpdate:i}=this.options,s=n.length;try{new ya.Notice(`${e?"Archiving":"Unarchiving"} ${s} tasks...`);let l=0,c=0;for(let d of n)try{let u=await t.cacheManager.getTaskInfo(d);u&&u.archived!==e?(await t.toggleTaskArchive(u),l++):u?l++:c++}catch(u){console.error(`[BatchContextMenu] Failed to archive task ${d}:`,u),c++}c===0?new ya.Notice(`${e?"Archived":"Unarchived"} ${l} tasks`):new ya.Notice(`${e?"Archived":"Unarchived"} ${l} tasks, ${c} failed`),(a=t.taskSelectionService)==null||a.clearSelection(),(o=t.taskSelectionService)==null||o.exitSelectionMode(),i==null||i()}catch(l){console.error("[BatchContextMenu] Batch archive failed:",l),new ya.Notice("Failed to archive tasks")}}async batchDelete(){var a,o,l;let{plugin:e,selectedPaths:t,onUpdate:n}=this.options,i=t.length;if(await Li(e.app,{title:"Delete tasks",message:`Are you sure you want to delete ${i} tasks? This action cannot be undone.`,confirmText:"Delete",cancelText:this.t("common.cancel"),isDestructive:!0}))try{new ya.Notice(`Deleting ${i} tasks...`);let c=0,d=0;for(let u of t)try{let p=e.app.vault.getAbstractFileByPath(u);if(p){if((a=e.taskCalendarSyncService)!=null&&a.isEnabled()){let m=await e.cacheManager.getTaskInfo(u);if(m!=null&&m.googleCalendarEventId)try{await e.taskCalendarSyncService.deleteTaskFromCalendarByPath(u,m.googleCalendarEventId)}catch(f){console.warn("Failed to delete task from Google Calendar:",f)}}await e.app.fileManager.trashFile(p),c++}else d++}catch(p){console.error(`[BatchContextMenu] Failed to delete task ${u}:`,p),d++}d===0?new ya.Notice(`Deleted ${c} tasks`):new ya.Notice(`Deleted ${c} tasks, ${d} failed`),(o=e.taskSelectionService)==null||o.clearSelection(),(l=e.taskSelectionService)==null||l.exitSelectionMode(),n==null||n()}catch(c){console.error("[BatchContextMenu] Batch delete failed:",c),new ya.Notice("Failed to delete tasks")}}show(e){this.menu.showAtMouseEvent(e)}showAtPosition(e,t){this.menu.showAtPosition({x:e,y:t})}}});function wce(r){let{task:e,plugin:t,excludeSelector:n,onSingleClick:i,onDoubleClick:s,contextMenuHandler:a}=r,o=n?`${kce}, ${n}`:kce,l=null,c=(k=!1)=>{let T=t.app.vault.getAbstractFileByPath(e.path);T instanceof w$.TFile&&(k?t.app.workspace.openLinkText(e.path,"",!0):t.app.workspace.getLeaf(!1).openFile(T))},d=async()=>{await t.openTaskEditModal(e)},u=async k=>{if(i){await i(k);return}if(k.ctrlKey||k.metaKey){c(!0);return}let T=t.settings.singleClickAction;T==="edit"?await d():T==="openNote"&&c(!1)},p=async k=>{if(s){await s(k);return}let T=t.settings.doubleClickAction;T==="edit"?await d():T==="openNote"&&c()},m=async k=>{if(k.target.closest(o))return;let w=t.taskSelectionService;if(w){if(k.shiftKey){k.stopPropagation(),w.isSelectionModeActive()||w.enterSelectionMode(),w.toggleSelection(e.path);return}w.isSelectionModeActive()&&(w.clearSelection(),w.exitSelectionMode())}if(k.stopPropagation(),t.settings.doubleClickAction==="none"){await u(k);return}l?(window.clearTimeout(l),l=null,await p(k)):l=window.setTimeout(()=>{l=null,u(k)},250)},f=k=>{m(k)},h=k=>{},g=async k=>{k.preventDefault(),k.stopPropagation();let T=t.taskSelectionService;if(k.shiftKey&&T){T.isSelectionModeActive()||T.enterSelectionMode(),T.isSelected(e.path)||T.addToSelection(e.path),T.getSelectionCount()>0&&new sf({plugin:t,selectedPaths:T.getSelectedPaths(),onUpdate:()=>{}}).show(k);return}if(T&&T.getSelectionCount()>1){T.isSelected(e.path)||T.addToSelection(e.path),new sf({plugin:t,selectedPaths:T.getSelectedPaths(),onUpdate:()=>{}}).show(k);return}T!=null&&T.isSelectionModeActive()&&(T.clearSelection(),T.exitSelectionMode()),a&&await a(k)};return{clickHandler:f,dblclickHandler:h,contextmenuHandler:k=>{g(k)},cleanup:()=>{l&&(window.clearTimeout(l),l=null)}}}function Sce(r,e){return t=>{e.app.vault.getAbstractFileByPath(r.path)&&e.app.workspace.trigger("hover-link",{event:t,source:"tasknotes-task-card",hoverParent:t.currentTarget,targetEl:t.currentTarget,linktext:r.path,sourcePath:r.path})}}async function xce(r,e,t,n,i){let s=(d=!1)=>{let u=e.app.vault.getAbstractFileByPath(r.path);u instanceof w$.TFile&&(d?e.app.workspace.openLinkText(r.path,"",!0):e.app.workspace.getLeaf(!1).openFile(u))},a=async()=>{await e.openTaskEditModal(r,i?()=>i():void 0)},o=async d=>{if(d.ctrlKey||d.metaKey){s(!0);return}let u=e.settings.singleClickAction;u==="edit"?await a():u==="openNote"&&s(!1)},l=async d=>{let u=e.settings.doubleClickAction;u==="edit"?await a():u==="openNote"&&s()};if(e.settings.doubleClickAction==="none"){await o(t);return}let c=VC.get(n);if(c)window.clearTimeout(c),VC.delete(n),await l(t);else{let d=window.setTimeout(()=>{VC.delete(n),o(t)},250);VC.set(n,d)}}var w$,kce,VC,S$=v(()=>{w$=require("obsidian");k$();kce=["a","button","input","textarea","select",'[role="button"]','[data-tn-no-drag="true"]','[data-tn-click-exclude="true"]',".tag"].join(", ");VC=new Map});function mqe(r){return pqe.includes(r)}function Fi(r,e){return r.map(t=>mqe(t)?t:t in e.fieldMapper.getMapping()?e.fieldMapper.toUserField(t):t)}function fd(r,e,t){return t.fieldMapper.isPropertyForField(r,e)}var pqe,hd=v(()=>{pqe=["tags","blocked","blocking"]});function Ece(r){return fqe.has(r.trim().toLowerCase())}function WC(r){return typeof r=="object"&&r!==null&&typeof r.renderTo=="function"&&typeof r.toString=="function"}function x$(r){var t;return r==null||((t=r.constructor)==null?void 0:t.name)==="NullValue"?!0:WC(r)&&Ece(ie(r))}function Rw(r){return x$(r)?!0:Array.isArray(r)?r.every(Rw):typeof r=="string"?r.trim()===""||Ece(r):WC(r)?ie(r).trim()==="":!1}function YC(r,e,t){if(!WC(e)||x$(e))return!1;try{e.renderTo(r,t),!r.hasChildNodes()&&!r.textContent&&(r.textContent=ie(e))}catch(n){console.debug("[TaskNotes] Error rendering Bases value:",n),r.textContent=ie(e)}return!0}function gd(r){if(x$(r))return"";if(WC(r))return r;if(r&&typeof r=="object"&&"icon"in r){let e=r;if(e.icon==="lucide-link"&&"data"in e&&e.data!==null&&e.data!==void 0){let t=ie(e.data);if(!t.match(/^[a-z]+:\/\//i)){let i="display"in e&&e.display?ie(e.display):null;return i&&i!==t?`[[${t}|${i}]]`:`[[${t}]]`}let n="display"in e&&e.display?ie(e.display):null;return n?`[${n}](${t})`:t}return"display"in e&&e.display!==null&&e.display!==void 0?e.display:"date"in e&&e.date!==null&&e.date!==void 0?e.date:"data"in e&&e.data!==null&&e.data!==void 0?e.data:e.icon==="lucide-file-question"||e.icon==="lucide-help-circle"?"":e.icon?ie(e.icon).replace("lucide-",""):""}return r}function GC(r,e={},t){var i;let n=(i=e.propertyLabels)==null?void 0:i[r];return n&&n.trim()!==""?n:t&&t.trim()!==""?t:r.startsWith("formula.")?r.substring(8):r.charAt(0).toUpperCase()+r.slice(1)}var fqe,KC=v(()=>{jr();fqe=new Set(["null","undefined"])});function ZC(r){return r!==null&&typeof r=="object"&&typeof r.getValue=="function"?r:null}function va(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function Ll(r,e,t){let n=t==null?void 0:t[r];if(n&&n.trim()!=="")return n;let i=hqe(r,e,t),s={due:va(e,"labels.due"),scheduled:va(e,"labels.scheduled"),recurrence:va(e,"labels.recurrence"),completedDate:va(e,"labels.completed"),dateCreated:va(e,"labels.created"),dateModified:va(e,"labels.modified"),blocked:va(e,"labels.blocked"),blocking:va(e,"labels.blocking")};return GC(r,{propertyLabels:i?{[r]:i}:t},s[r])}function hqe(r,e,t){var n,i;if(t){for(let[s,a]of Object.entries(t))if(!(s===r||a.trim()==="")&&((i=(n=e.fieldMapper)==null?void 0:n.lookupMappingKey)==null?void 0:i.call(n,s))===r)return a}}function Ow(r,e,t){return va(r,"recurrenceTooltip",{label:Ll("recurrence",r,t),value:Ane(e)})}function E$(r,e){return e===1?va(r,"reminderTooltipOne"):va(r,"reminderTooltipMany",{count:e})}function JC(r,e){return e?va(r,"collapseSubtasks"):va(r,"expandSubtasks")}function Dce(r,e,t){var n;try{let i=t.fieldMapper.lookupMappingKey(e);if(i&&i in QC)return QC[i](r);if(e in QC)return QC[e](r);if(e.startsWith("user:"))return gqe(r,e,t);if(r.customProperties&&e in r.customProperties)return gd(r.customProperties[e]);if(r.customProperties){let a=`file.${e}`;if(a in r.customProperties)return gd(r.customProperties[a])}if(e.startsWith("file.")&&ZC(r.basesData))try{let a=(n=ZC(r.basesData))==null?void 0:n.getValue(e);if(a!=null)return gd(a)}catch(a){}if(e.startsWith("formula."))try{let a=ZC(r.basesData);if(!a)return"";let o=a.getValue(e);if(o==null)return"";let l=gd(o);return l!==""?l:""}catch(a){return console.debug(`[TaskNotes] Error computing formula ${e}:`,a),"[Formula Error]"}let s=ZC(r.basesData);if(s)try{let a=`note.${e}`,o=s.getValue(a);if(o!=null)return gd(o)}catch(a){}if(r.path){let a=Cce(r.path,e,t);if(a!==void 0)return a}return null}catch(i){return console.warn(`TaskCard: Error getting property ${e}:`,i),null}}function gqe(r,e,t){var a;let n=e.slice(5),i=(a=t.settings.userFields)==null?void 0:a.find(o=>o.id===n);if(!(i!=null&&i.key))return null;let s=r[i.key];return s===void 0&&(s=Cce(r.path,i.key,t)),s}function Cce(r,e,t){try{let n=t.app.metadataCache.getCache(r);return n!=null&&n.frontmatter?n.frontmatter[e]:void 0}catch(n){console.warn(`TaskCard: Error accessing frontmatter for ${r}:`,n);return}}var QC,D$=v(()=>{Cr();KC();QC={due:r=>r.due,scheduled:r=>r.scheduled,projects:r=>r.projects,contexts:r=>r.contexts,tags:r=>r.tags,blocked:r=>r.isBlocked,blocking:r=>r.isBlocking,blockedBy:r=>r.blockedBy,blockingTasks:r=>r.blocking,timeEstimate:r=>r.timeEstimate,timeEntries:r=>r.timeEntries,totalTrackedTime:r=>r.totalTrackedTime,recurrence:r=>r.recurrence,completedDate:r=>r.completedDate,reminders:r=>r.reminders,icsEventId:r=>r.icsEventId,completeInstances:r=>r.complete_instances,skippedInstances:r=>r.skipped_instances,dateCreated:r=>r.dateCreated,dateModified:r=>r.dateModified,googleCalendarSync:r=>r.path,checklistProgress:r=>r.path}});function Pce(r,e,t){if(!e||typeof e!="string")return;let n=yqe(e);if(!n)return;let i=r.createEl("a",{cls:"tag",text:n,attr:{href:n,role:"button",tabindex:"0","data-tn-click-exclude":"true"}});t!=null&&t.onTagClick&&(i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),t.onTagClick(n,s)}),i.addEventListener("keydown",s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),s.stopPropagation(),t.onTagClick(n,s))}))}function Ace(r,e,t){if(typeof e=="string"){Pce(r,e,t);return}if(Array.isArray(e)){e.flat(2).filter(i=>i!=null&&typeof i=="string").forEach((i,s)=>{s>0&&r.appendChild(activeDocument.createTextNode(" ")),Pce(r,String(i),t)});return}e!=null&&r.appendChild(activeDocument.createTextNode(ie(e)))}function Ice(r,e,t){if(typeof e=="string"){let n=Mce(e);if(n){let i=_ce(n),s=r.createEl("span",{cls:`context-tag ${i}`,text:n,attr:{role:"button",tabindex:"0","data-tn-click-exclude":"true"}});t!=null&&t.onTagClick&&(s.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),t.onTagClick(n,a)}),s.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),a.stopPropagation(),t.onTagClick(n,a))}))}return}if(Array.isArray(e)){e.flat(2).filter(i=>i!=null&&typeof i=="string").forEach((i,s)=>{s>0&&r.appendChild(activeDocument.createTextNode(", "));let a=Mce(i);if(a){let o=_ce(a),l=r.createEl("span",{cls:`context-tag ${o}`,text:a,attr:{role:"button",tabindex:"0","data-tn-click-exclude":"true"}});t!=null&&t.onTagClick&&(l.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),t.onTagClick(a,c)}),l.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),c.stopPropagation(),t.onTagClick(a,c))}))}else r.appendChild(activeDocument.createTextNode(String(i)))});return}e!=null&&r.appendChild(activeDocument.createTextNode(ie(e)))}function yqe(r){if(!r||typeof r!="string")return null;let e=r.trim();if(!e)return null;let t=e.startsWith("#"),n=e.replace(/[^\p{L}\p{N}_#/-]/gu,"");return t?n.length>1?n:null:n?`#${n}`:null}function vqe(r){let e=5381;for(let t=0;t>>0}function _ce(r){if(!r||typeof r!="string")return"context-tag--color-0";let e=r.replace(/^@/,"").toLowerCase();return e?`context-tag--color-${vqe(e)%20}`:"context-tag--color-0"}function Mce(r){if(!r||typeof r!="string")return null;let e=r.trim();if(!e)return null;let t=e.startsWith("@"),n=e.replace(/[^\p{L}\p{N}_@/-]/gu,"");return t?n.length>1?n:null:n?`@${n}`:null}var Nce=v(()=>{jr()});function Fu(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function bqe(r){if(r.dataset.tnNoDrag==="true"){r.setAttribute("draggable","false");return}r.dataset.tnNoDrag="true",r.setAttribute("draggable","false"),r.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()})}function Fce(r,e,t,n){bqe(r),r.addEventListener("click",i=>{i.stopPropagation();let s=n==="due"?e.due:e.scheduled;new Es({currentValue:tt(s||""),currentTime:$a(s||""),onSelect:(o,l)=>{(async()=>{try{let c;o?l?c=`${o}T${l}`:c=o:c=void 0,await t.updateTaskProperty(e,n,c)}catch(c){let d=c instanceof Error?c.message:String(c);console.error(`Error updating ${n} date:`,d);let u=n==="due"?"contextMenus.task.notices.updateDueDateFailure":"contextMenus.task.notices.updateScheduledFailure";new ny.Notice(t.i18n.translate(u,{message:d}))}})()},plugin:t,app:t.app}).show(i)})}function P$(r){let e=[...Jb,"tags","blocked","blocking","googleCalendarSync"];return Fi(e,r)}function Tqe(r,e){let t=e.app.vault.getAbstractFileByPath(r);if(!(t instanceof ny.TFile))return null;let n=e.app.metadataCache.getFileCache(t);return kqe(n)}function kqe(r){if(r==null)return null;let e=r.listItems;if(!Array.isArray(e)||e.length===0)return null;let t=0,n=0;for(let i of e)!i||typeof i.task!="string"||typeof i.parent=="number"&&i.parent>=0||(t+=1,i.task.toLowerCase()==="x"&&(n+=1));return t===0?null:{completed:n,total:t,percent:Math.round(n/t*100)}}function _$(r,e,t,n,i={}){let s=Dce(t,e,n);if(!XC(s))return null;let a=r.createEl("span",{cls:`task-card__metadata-property task-card__metadata-property--${e.replace(":","-")}`});try{let l=n.fieldMapper.lookupMappingKey(e)||e;return l in Rce?Rce[l](a,s,t,n,i):e.startsWith("user:")?wqe(a,e,s,n):Sqe(a,e,s,n,Ll(e,n,i.propertyLabels)),!a.textContent&&!a.hasChildNodes()?(a.remove(),null):a}catch(o){return console.warn(`TaskCard: Error rendering property ${e}:`,o),a.textContent=`${e}: (error)`,a}}function XC(r){return!Rw(r)}function wqe(r,e,t,n){var c;let i=e.slice(5),s=(c=n.settings.userFields)==null?void 0:c.find(d=>d.id===i);if(!s){r.textContent=`${i}: (not found)`;return}let a=s.displayName||i;r.createEl("span",{text:`${a}: `});let o=r.createEl("span",{cls:"task-card__metadata-value"}),l={metadataCache:n.app.metadataCache,workspace:n.app.workspace};if(typeof t=="string"&&t.trim()!==""){let d=t.trim();C$(d)?JD(o,d,l):o.textContent=Lce(t,s)}else if(s.type==="list"&&Array.isArray(t))t.map(u=>gd(u)).filter(XC).forEach((u,p)=>{if(p>0&&o.appendChild(activeDocument.createTextNode(", ")),typeof u=="string"&&u.trim()!==""){let m=u.trim();if(C$(m)){let f=o.createEl("span");JD(f,m,l)}else o.appendChild(activeDocument.createTextNode(String(u)))}else o.appendChild(activeDocument.createTextNode(String(u)))});else{let d=Lce(t,s);o.textContent=d.trim()!==""?d:"(empty)"}}function Sqe(r,e,t,n,i){let s=GC(e,{},i);r.createEl("span",{text:`${s}: `});let a=r.createEl("span",{cls:"task-card__metadata-value"});Array.isArray(t)?t.map(l=>gd(l)).filter(XC).forEach((l,c)=>{c>0&&a.appendChild(activeDocument.createTextNode(", ")),Oce(a,l,n)}):Oce(a,t,n)}function Oce(r,e,t){if(!XC(e)||t&&YC(r,e,t.app.renderContext))return;if(typeof e=="string"&&t){let i={metadataCache:t.app.metadataCache,workspace:t.app.workspace};if(C$(e)){JD(r,e,i,{onTagClick:async s=>{let a=s.startsWith("#")?s.slice(1):s;await t.openTagsPane(`#${a}`)}});return}r.appendChild(activeDocument.createTextNode(e));return}let n;if(typeof e=="object"&&e!==null)if(e instanceof Date)n=xs(e.toISOString(),{dateFormat:"MMM d, yyyy",timeFormat:"",showTime:!1});else{let i=Object.entries(e);n=i.length<=3?i.map(([s,a])=>`${s}: ${ie(a)}`).join(", "):ie(e)}else typeof e=="boolean"?n=e?"\u2713":"\u2717":typeof e=="number"?n=Number.isInteger(e)?String(e):e.toFixed(2):n=ie(e);n.length>100&&(n=n.substring(0,97)+"..."),r.appendChild(activeDocument.createTextNode(n))}function C$(r){return r.includes("[[")||r.includes("](")||r.includes("[")&&r.includes("](")||r.includes("#")&&/\s#\w+|#\w+/.test(r)}function Lce(r,e){if(r==null)return"";try{switch(e.type){case"text":case"number":return ie(r);case"date":return xs(ie(r),{dateFormat:"MMM d, yyyy",timeFormat:"",showTime:!1});case"boolean":return r?"\u2713":"\u2717";case"list":return Array.isArray(r)?r.flat(2).map(ie).join(", "):ie(r);default:return ie(r)}}catch(t){return console.warn("TaskCard: Error formatting user property value:",t),ie(r)}}function xqe(r,e,t,n,i){var p,m;let s=wD(e),a=n.statusManager.isCompletedStatus(t.status),o=(m=(p=n.settings)==null?void 0:p.hideCompletedFromOverdue)!=null?m:!0,l=rs(e,a,o),c=n.settings.calendarViewSettings.timeFormat,d=Ll("due",n,i),u="";if(s){let f=xs(e,{dateFormat:"",showTime:!0,userTimeFormat:c});u=f.trim()===""?Fu(n,"dueToday",{label:d}):Fu(n,"dueTodayAt",{label:d,time:f})}else if(l){let f=xs(e,{dateFormat:"MMM d",showTime:!0,userTimeFormat:c});u=Fu(n,"dueOverdue",{label:d,display:f})}else{let f=xs(e,{dateFormat:"MMM d",showTime:!0,userTimeFormat:c});u=Fu(n,"dueLabel",{label:d,display:f})}r.textContent=u,r.classList.add("task-card__metadata-date","task-card__metadata-date--due"),l&&r.classList.add("task-card__metadata-date--overdue"),r.dataset.tnAction="edit-date",r.dataset.tnDateType="due",Fce(r,t,n,"due")}function Eqe(r,e,t,n,i){var p,m;let s=wD(e),a=n.statusManager.isCompletedStatus(t.status),o=(m=(p=n.settings)==null?void 0:p.hideCompletedFromOverdue)!=null?m:!0,l=rs(e,a,o),c=n.settings.calendarViewSettings.timeFormat,d=Ll("scheduled",n,i),u="";if(s){let f=xs(e,{dateFormat:"",showTime:!0,userTimeFormat:c});u=f.trim()===""?Fu(n,"scheduledToday",{label:d}):Fu(n,"scheduledTodayAt",{label:d,time:f})}else if(l){let f=xs(e,{dateFormat:"MMM d",showTime:!0,userTimeFormat:c});u=Fu(n,"scheduledPast",{label:d,display:f})}else{let f=xs(e,{dateFormat:"MMM d",showTime:!0,userTimeFormat:c});u=Fu(n,"scheduledLabel",{label:d,display:f})}r.textContent=u,r.classList.add("task-card__metadata-date","task-card__metadata-date--scheduled"),l&&r.classList.add("task-card__metadata-date--past"),r.dataset.tnAction="edit-date",r.dataset.tnDateType="scheduled",Fce(r,t,n,"scheduled")}function M$(r,e){r.style.display=e.length>0?"":"none"}var ny,Rce,$ce=v(()=>{ny=require("obsidian");xm();lg();Om();Cr();Qe();jr();hd();KC();D$();vT();Nce();Rce={due:(r,e,t,n,i)=>{typeof e=="string"&&xqe(r,e,t,n,i==null?void 0:i.propertyLabels)},scheduled:(r,e,t,n,i)=>{typeof e=="string"&&Eqe(r,e,t,n,i==null?void 0:i.propertyLabels)},projects:(r,e,t,n)=>{if(Array.isArray(e)){let i={metadataCache:n.app.metadataCache,workspace:n.app.workspace,sourcePath:t.path};XD(r,e,i)}},contexts:(r,e,t,n)=>{Array.isArray(e)&&Ice(r,e,{onTagClick:async s=>{let a=s.startsWith("@")?s.slice(1):s;await n.openTagsPane(`#${a}`)}})},tags:(r,e,t,n)=>{if(Array.isArray(e)){let i=e;n.settings.taskIdentificationMethod==="tag"&&n.settings.hideIdentifyingTagsInCards&&(i=e.filter(s=>!vr.matchesHierarchicalTagExact(s,n.settings.taskTag))),i.length>0&&Ace(r,i,{onTagClick:async a=>{let o=a.startsWith("#")?a.slice(1):a;await n.openTagsPane(`#${o}`)}})}},timeEstimate:(r,e,t,n)=>{typeof e=="number"&&(r.textContent=`${n.formatTime(e)} estimated`)},totalTrackedTime:(r,e,t,n)=>{typeof e=="number"&&e>0&&(r.textContent=`${n.formatTime(e)} tracked`)},recurrence:(r,e,t,n,i)=>{typeof e=="string"&&(r.textContent=Ow(n,e,i==null?void 0:i.propertyLabels))},completeInstances:(r,e,t)=>{var n;if(Array.isArray(e)&&e.length>0){let i=e.length,s=((n=t.skipped_instances)==null?void 0:n.length)||0,a=i+s;if(a>0){let o=Math.round(i/a*100);r.textContent=`\u2713 ${i} completed (${o}%)`}else r.textContent=`\u2713 ${i} completed`;r.classList.add("task-card__metadata-pill--completed-instances")}},skippedInstances:(r,e)=>{Array.isArray(e)&&e.length>0&&(r.textContent=`\u2298 ${e.length} skipped`,r.classList.add("task-card__metadata-pill--skipped-instances"))},completedDate:(r,e,t,n,i)=>{if(typeof e=="string"){let s=Ll("completedDate",n,i==null?void 0:i.propertyLabels);r.textContent=`${s}: ${xs(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:n.settings.calendarViewSettings.timeFormat})}`}},dateCreated:(r,e,t,n,i)=>{if(typeof e=="string"){let s=Ll("dateCreated",n,i==null?void 0:i.propertyLabels);r.textContent=`${s}: ${xs(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:n.settings.calendarViewSettings.timeFormat})}`}},dateModified:(r,e,t,n,i)=>{if(typeof e=="string"){let s=Ll("dateModified",n,i==null?void 0:i.propertyLabels);r.textContent=`${s}: ${xs(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:n.settings.calendarViewSettings.timeFormat})}`}},blocked:(r,e,t,n,i)=>{var s,a;if(e===!0){let o=(a=(s=t.blockedBy)==null?void 0:s.length)!=null?a:0,l=Ll("blocked",n,i==null?void 0:i.propertyLabels);r.textContent=o>0?`${l} (${o})`:l,r.classList.add("task-card__metadata-pill--blocked")}},blocking:(r,e,t,n,i)=>{var s,a;if(e===!0){let o=(a=(s=t.blocking)==null?void 0:s.length)!=null?a:0,l=Ll("blocking",n,i==null?void 0:i.propertyLabels);r.textContent=o>0?`${l} (${o})`:l,r.classList.add("task-card__metadata-pill--blocking")}},blockedBy:(r,e,t,n)=>{if(Array.isArray(e)&&e.length>0){r.createEl("span",{text:"Blocked by: "});let i=r.createEl("span");e.forEach((s,a)=>{var l;a>0&&i.appendChild(activeDocument.createTextNode(", "));let o=typeof s=="string"?s:s.path;if(o){let c=i.createEl("a",{cls:"internal-link",attr:{href:o}});c.textContent=((l=o.split("/").pop())==null?void 0:l.replace(".md",""))||o,c.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),n.app.workspace.openLinkText(o,"",!1)})}})}},blockingTasks:(r,e,t,n)=>{if(Array.isArray(e)&&e.length>0){r.createEl("span",{text:"Blocking: "});let i=r.createEl("span");e.forEach((s,a)=>{var l;a>0&&i.appendChild(activeDocument.createTextNode(", "));let o=i.createEl("a",{cls:"internal-link",attr:{href:s}});o.textContent=((l=s.split("/").pop())==null?void 0:l.replace(".md",""))||s,o.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),n.app.workspace.openLinkText(s,"",!1)})})}},timeEntries:(r,e,t,n)=>{if(Array.isArray(e)&&e.length>0){let i=is(e);i>0&&(r.textContent=`${n.formatTime(i)} tracked (${e.length} ${e.length===1?"entry":"entries"})`)}},reminders:(r,e)=>{Array.isArray(e)&&e.length>0&&(r.textContent=`${e.length} ${e.length===1?"reminder":"reminders"}`)},icsEventId:(r,e)=>{Array.isArray(e)&&e.length>0&&(r.textContent=`Linked to ${e.length} calendar ${e.length===1?"event":"events"}`)},checklistProgress:(r,e,t,n)=>{let i=Tqe(t.path,n);if(!i)return;let s=r.createEl("span",{cls:"task-card__progress"}),o=s.createEl("span",{cls:"task-card__progress-bar"}).createEl("span",{cls:"task-card__progress-fill"});o.style.width=`${i.percent}%`,i.percent>0&&i.percent<5&&(o.classList.remove("tn-static-min-width-0-3922d326"),o.classList.add("tn-static-min-width-2px-709d7da0")),s.createEl("span",{cls:"task-card__progress-label",text:`${i.completed}/${i.total}`}),(0,ny.setTooltip)(s,`${i.percent}% complete (${i.completed}/${i.total})`,{placement:"top"})}}});async function jce(r,e){return new Promise((t,n)=>{new A$(e.app,r,async()=>{try{await e.taskService.deleteTask(r),t()}catch(s){n(s instanceof Error?s:new Error(String(s)))}}).open()})}var Lw,A$,zce=v(()=>{Lw=require("obsidian"),A$=class extends Lw.Modal{constructor(e,t,n){super(e),this.task=t,this.onConfirm=n}onOpen(){let{contentEl:e}=this;e.empty(),e.createEl("h2",{text:"Delete task"});let t=e.createEl("p");t.appendText('Are you sure you want to delete the task "'),t.createEl("strong",{text:this.task.title}),t.appendText('"?'),e.createEl("p",{cls:"mod-warning",text:"This action cannot be undone. The task file will be permanently deleted."});let n=e.createEl("div",{cls:"modal-button-container"});n.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),n.classList.add("tn-static-display-flex-75816cae"),n.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),n.classList.add("tn-static-gap-10px-f3d7ce77"),n.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),n.classList.add("tn-static-justify-content-flex-end-455f8cca"),n.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-16px-1b0f4999","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),n.classList.add("tn-static-margin-top-20px-a26bda7d");let i=n.createEl("button",{text:"Cancel"});i.addEventListener("click",()=>{this.close()});let s=n.createEl("button",{text:"Delete",cls:"mod-warning"});s.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-text-accent-a954c70f"),s.classList.add("tn-static-background-color-var-color-red-134bc721"),s.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),s.classList.add("tn-static-color-white-0a43e56a"),s.addEventListener("click",()=>{(async()=>{try{await this.onConfirm(),this.close(),new Lw.Notice("Task deleted successfully")}catch(a){let o=a instanceof Error?a.message:String(a);new Lw.Notice(`Failed to delete task: ${o}`),console.error("Error in delete confirmation:",a)}})()}),i.focus()}onClose(){let{contentEl:e}=this;e.empty()}}});var iy={};et(iy,{DEFAULT_TASK_CARD_OPTIONS:()=>N$,cleanupTaskCard:()=>Iqe,createTaskCard:()=>pr,refreshParentTaskSubtasks:()=>Nqe,showDeleteConfirmationModal:()=>jce,showTaskContextMenu:()=>ju,toggleBlockingTasks:()=>O$,toggleSubtasks:()=>$w,updateTaskCard:()=>Aqe});function Bce(r,e){let t=()=>e.classList.add("task-card--nested-interactive-hover"),n=()=>e.classList.remove("task-card--nested-interactive-hover");r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",n)}function R$(r){var e;return(e=r._taskCardOptions)!=null?e:{}}function Dqe(r){if(typeof r=="number")return r===1?"show-all":"inherit";let e=ie(r).trim().toLowerCase().replace(/^['"]|['"]$/g,"").replace(/[_\s]+/g,"-");return e==="show-all"||e==="1"?"show-all":"inherit"}function qce(r,e){var s,a;let t=R$(r);if(Dqe((a=(s=t.resolveExpandedRelationshipFilterMode)==null?void 0:s.call(t))!=null?a:t.expandedRelationshipFilterMode)!=="inherit")return e;let i=t.expandedRelationshipTaskPaths;return i?e.filter(o=>i.has(o.path)):e}function Fw(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function af(r){let{container:e,className:t,icon:n,tooltip:i,ariaLabel:s,onClick:a,visible:o=!0}=r;if(!o)return null;let l=e.createEl("div",{cls:t,attr:{"aria-label":s||i}});return(0,Ct.setIcon)(l,n),(0,Ct.setTooltip)(l,i,{placement:"top"}),a&&($u(l),l.addEventListener("click",c=>{c.stopPropagation(),a(c)})),l}function I$(r,e,t){let n=r.querySelector(e);if(!t.shouldExist)return n==null||n.remove(),null;if(n)return n.setAttribute("aria-label",t.ariaLabel||t.tooltip),(0,Ct.setTooltip)(n,t.tooltip,{placement:"top"}),t.onClick&&$u(n),n;let s=r.querySelector(".task-card__badges")||r.querySelector(".task-card__main-row");return s?af({container:s,...t}):null}function $u(r){if(r.dataset.tnNoDrag==="true"){r.setAttribute("draggable","false");return}r.dataset.tnNoDrag="true",r.setAttribute("draggable","false"),r.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()})}function Hce(r,e,t,n,i){return s=>{s.stopPropagation(),(async()=>{try{let a=(o,l,c)=>{let d=e.statusManager.getStatusConfig(l);d!=null&&d.color?n.style.borderColor=d.color:n.style.removeProperty("border-color"),d!=null&&d.icon?(n.addClass("task-card__status-dot--icon"),n.empty(),(0,Ct.setIcon)(n,d.icon)):(n.removeClass("task-card__status-dot--icon"),n.empty()),d!=null&&d.color?t.style.setProperty("--current-status-color",d.color):t.style.removeProperty("--current-status-color");let u=e.statusManager.getNextStatus(l),p=e.statusManager.getStatusConfig(u);p!=null&&p.color?t.style.setProperty("--next-status-color",p.color):t.style.removeProperty("--next-status-color");let m=t.querySelector(".task-card__checkbox");m&&(m.checked=c),Cqe(t,o,e,c,l)};if(r.recurrence){let o=await e.toggleRecurringTaskComplete(r,i),l=Pg(o,i,e.statusManager.getCompletedStatuses()[0]),c=e.statusManager.isCompletedStatus(l);a(o,l,c)}else{let o=await e.cacheManager.getTaskInfo(r.path);if(!o){new Ct.Notice("Task not found");return}let l=o.status||e.settings.defaultTaskStatus,c=s.shiftKey?e.statusManager.getPreviousStatus(l):e.statusManager.getNextStatus(l),d=await e.updateTaskProperty(o,"status",c),u=e.statusManager.isCompletedStatus(c);a(d,c,u)}}catch(a){let o=a instanceof Error?a.message:String(a);console.error("Error cycling task status:",{error:o,taskPath:r.path}),new Ct.Notice(`Failed to update task status: ${o}`)}})()}}function Cqe(r,e,t,n,i){var o;r.classList.toggle("task-card--completed",n),r.classList.toggle("task-card--archived",!!e.archived),r.classList.toggle("task-card--actively-tracked",t.getActiveTimeSession(e)!==null),r.classList.toggle("task-card--recurring",!!e.recurrence),r.classList.toggle("task-card--chevron-left",((o=t.settings)==null?void 0:o.subtaskChevronPosition)==="left");for(let l of Array.from(r.classList))l.startsWith("task-card--priority-")&&r.classList.remove(l);e.priority&&r.classList.add(`task-card--priority-${l1(e.priority)}`);for(let l of Array.from(r.classList))l.startsWith("task-card--status-")&&r.classList.remove(l);i&&r.classList.add(`task-card--status-${l1(i)}`),r.dataset.status=i;let s=r.querySelector(".task-card__title"),a=r.querySelector(".task-card__title-text");s&&s.classList.toggle("completed",n),a&&a.classList.toggle("completed",n)}function Pqe(r,e){return t=>{t.stopPropagation(),new $o({currentValue:r.priority,onSelect:i=>{(async()=>{try{await e.updateTaskProperty(r,"priority",i)}catch(s){console.error("Error updating priority:",s),new Ct.Notice("Failed to update priority")}})()},plugin:e}).show(t)}}function Uce(r,e){return t=>{t.stopPropagation(),new jo({currentValue:typeof r.recurrence=="string"?r.recurrence:void 0,currentAnchor:r.recurrence_anchor||"scheduled",scheduledDate:r.scheduled,onSelect:(i,s)=>{(async()=>{try{await e.updateTaskProperty(r,"recurrence",i||void 0),s!==void 0&&await e.updateTaskProperty(r,"recurrence_anchor",s)}catch(a){console.error("Error updating recurrence:",a),new Ct.Notice("Failed to update recurrence")}})()},app:e.app,plugin:e}).show(t)}}function Vce(r,e){return()=>{new zo(e.app,e,r,n=>{(async()=>{try{await e.updateTaskProperty(r,"reminders",n.length>0?n:void 0)}catch(i){console.error("Error updating reminders:",i),new Ct.Notice("Failed to update reminders")}})()}).open()}}function Wce(r,e){return()=>{(async()=>{try{await e.applyProjectSubtaskFilter(r)}catch(t){console.error("Error filtering project subtasks:",t),new Ct.Notice("Failed to filter project subtasks")}})()}}function Yce(r,e,t,n){return()=>{(async()=>{try{if(!e.expandedProjectsService){new Ct.Notice("Service not available. Please try reloading the plugin.");return}let i=e.expandedProjectsService.toggle(r.path);n.classList.toggle("task-card__chevron--expanded",i);let s=JC(e,i);n.setAttribute("aria-label",s),(0,Ct.setTooltip)(n,s,{placement:"top"}),await $w(t,r,e,i)}catch(i){console.error("Error toggling subtasks:",i),new Ct.Notice("Failed to toggle subtasks")}})()}}function _qe(r,e,t,n){return()=>{(async()=>{let i=n.classList.toggle("task-card__blocking-toggle--expanded");await O$(t,r,e,i)})()}}function pr(r,e,t,n={}){var ee,ae,ce,J,de,vt,ct,Ae,Z,X,Me;let i={...N$,...n},s=i.targetDate||(()=>{let me=new Date;return new Date(Date.UTC(me.getFullYear(),me.getMonth(),me.getDate()))})(),a=r.recurrence?Pg(r,s,e.statusManager.getCompletedStatuses()[0]):r.status,o=i.layout||"default",l=activeDocument.createElement(o==="inline"?"span":"div"),c=l;c._taskPath=r.path,c._taskCardOptions=i;let d=e.getActiveTimeSession(r)!==null,u=r.recurrence?((ee=r.complete_instances)==null?void 0:ee.includes(ue(s)))||!1:e.statusManager.isCompletedStatus(a),p=r.recurrence&&((ae=r.skipped_instances)==null?void 0:ae.includes(ue(s)))||!1,m=!!r.recurrence,f=["task-card"];o!=="default"&&f.push(`task-card--layout-${o}`),u&&f.push("task-card--completed"),p&&f.push("task-card--skipped"),r.archived&&f.push("task-card--archived"),d&&f.push("task-card--actively-tracked"),m&&f.push("task-card--recurring"),r.priority&&f.push(`task-card--priority-${r.priority}`),a&&f.push(`task-card--status-${a}`),((ce=e.settings)==null?void 0:ce.subtaskChevronPosition)==="left"&&f.push("task-card--chevron-left"),ku(r.projects||[]).length>0&&f.push("task-card--has-projects"),l.className=f.join(" "),l.dataset.taskPath=r.path,l.dataset.key=r.path,l.dataset.status=a;let g=l.createEl(o==="inline"?"span":"div",{cls:"task-card__main-row"}),y=e.priorityManager.getPriorityConfig(r.priority);y&&l.style.setProperty("--priority-color",y.color);let k=e.statusManager.getStatusConfig(a);k&&l.style.setProperty("--current-status-color",k.color);let T=e.statusManager.getNextStatus(a),w=e.statusManager.getStatusConfig(T);w&&l.style.setProperty("--next-status-color",w.color);let S=null;!i.hideStatusIndicator&&(!t||t.some(me=>fd(me,"status",e)))&&(S=g.createEl("span",{cls:"task-card__status-dot"}),k&&(S.style.borderColor=k.color,k.icon&&(S.addClass("task-card__status-dot--icon"),(0,Ct.setIcon)(S,k.icon)))),S&&($u(S),S.addEventListener("click",Hce(r,e,l,S,s)));let C=!t||t.some(me=>fd(me,"priority",e));if(r.priority&&y&&C){let me=g.createEl("span",{cls:"task-card__priority-dot",attr:{"aria-label":Fw(e,"priorityAriaLabel",{label:y.label})}});me.style.borderColor=y.color,$u(me),me.addEventListener("click",Pqe(r,e))}let D=g.createEl(o==="inline"?"span":"div",{cls:"task-card__content"}),A=o!=="inline"?g.createEl("div",{cls:"task-card__badges"}):null;if(A&&i.showSecondaryBadges){if(r.recurrence){let Lt=Ow(e,r.recurrence,i.propertyLabels);af({container:A,className:"task-card__recurring-indicator",icon:"rotate-ccw",tooltip:Lt,onClick:Uce(r,e)})}if(r.reminders&&r.reminders.length>0){let Lt=r.reminders.length,nr=E$(e,Lt);af({container:A,className:"task-card__reminder-indicator",icon:"bell",tooltip:nr,onClick:Vce(r,e)})}if(e.projectSubtasksService.isTaskUsedAsProjectSync(r.path)&&(af({container:A,className:"task-card__project-indicator",icon:"folder",tooltip:Fw(e,"projectTooltip"),onClick:Wce(r,e)}),(J=e.settings)!=null&&J.showExpandableSubtasks)){let Lt=((de=e.expandedProjectsService)==null?void 0:de.isExpanded(r.path))||!1;af({container:A,className:`task-card__chevron${Lt?" task-card__chevron--expanded":""}`,icon:"chevron-right",tooltip:JC(e,Lt),onClick:()=>{let nr=l.querySelector(".task-card__chevron");nr&&Yce(r,e,l,nr)()}}),Lt&&$w(l,r,e,!0).catch(nr=>{console.error("Error showing initial subtasks:",nr)})}if(r.blocking&&r.blocking.length>0){let Lt=(ct=(vt=r.blocking)==null?void 0:vt.length)!=null?ct:0,nr=e.i18n.translate("ui.taskCard.blockingToggle",{count:Lt});af({container:A,className:"task-card__blocking-toggle is-visible",icon:"git-branch",tooltip:nr,onClick:()=>{let Di=l.querySelector(".task-card__blocking-toggle");Di&&_qe(r,e,l,Di)()}})}}let N=g.createEl("div",{cls:"task-card__context-menu",attr:{"aria-label":Fw(e,"taskOptions")}});(0,Ct.setIcon)(N,"ellipsis-vertical"),(0,Ct.setTooltip)(N,Fw(e,"taskOptions"),{placement:"top"}),$u(N),N.addEventListener("click",me=>{me.stopPropagation(),me.preventDefault(),ju(me,r.path,e,s)});let V=D.createEl(o==="inline"?"span":"div",{cls:"task-card__title"}),R=V.createSpan({cls:"task-card__title-text",text:r.title});u&&(V.classList.add("completed"),R.classList.add("completed"));let I=D.createEl(o==="inline"?"span":"div",{cls:"task-card__metadata"}),O=[],z=t||(e.settings.defaultVisibleProperties?Fi(e.settings.defaultVisibleProperties,e):P$(e));for(let me of z){if(fd(me,"status",e)||fd(me,"priority",e))continue;if(me==="blocked"){if(r.isBlocked){let Lt=e.i18n.translate("ui.taskCard.blockedBadge"),nr=(Z=(Ae=r.blockedBy)==null?void 0:Ae.length)!=null?Z:0,Di=nr>0?`${Lt} (${nr})`:Lt,Oa=I.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--blocked",text:Di});(0,Ct.setTooltip)(Oa,e.i18n.translate("ui.taskCard.blockedBadgeTooltip"),{placement:"top"}),O.push(Oa)}continue}if(me==="blocking"){if(r.isBlocking){let Lt=e.i18n.translate("ui.taskCard.blockingBadge"),nr=(Me=(X=r.blocking)==null?void 0:X.length)!=null?Me:0,Di=nr>0?`${Lt} (${nr})`:Lt,Oa=I.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--blocking",text:Di});(0,Ct.setTooltip)(Oa,e.i18n.translate("ui.taskCard.blockingBadgeTooltip"),{placement:"top"}),O.push(Oa)}continue}if(me==="googleCalendarSync"){if(r.googleCalendarEventId){let Lt=I.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--google-calendar"});(0,Ct.setIcon)(Lt,"calendar"),(0,Ct.setTooltip)(Lt,e.i18n.translate("ui.taskCard.googleCalendarSyncTooltip"),{placement:"top"}),O.push(Lt)}continue}let gr=_$(I,me,r,e,i);gr&&O.push(gr)}M$(I,O);let{clickHandler:B,dblclickHandler:W,contextmenuHandler:Y}=wce({task:r,plugin:e,contextMenuHandler:me=>{let gr=l.dataset.taskPath;gr&&ju(me,gr,e,s)}});return l.addEventListener("click",B),l.addEventListener("dblclick",W),l.addEventListener("contextmenu",Y),i.enableHoverPreview&&l.addEventListener("mouseover",Sce(r,e)),l}async function ju(r,e,t,n){let i=t.app.vault.getAbstractFileByPath(e),s=()=>{i instanceof Ct.TFile&&Mqe(r,i,t)};try{let a=await t.cacheManager.getTaskInfo(e);if(!a){s();return}new ry({task:a,plugin:t,targetDate:n,onUpdate:()=>{t.app.workspace.trigger("tasknotes:refresh-views")}}).show(r)}catch(a){let o=a instanceof Error?a.message:String(a);console.error("Error creating context menu:",{error:o,taskPath:e}),new Ct.Notice(`Failed to create context menu: ${o}`),s()}}function Mqe(r,e,t){var s,a;let n=new Ct.Menu,i=!1;try{t.app.workspace.trigger("file-menu",n,e,"tasknotes-bases-view"),i=((a=(s=n.items)==null?void 0:s.length)!=null?a:0)>0}catch(o){i=!1}i||(n.addItem(o=>{o.setTitle("Open"),o.setIcon("file-text"),o.onClick(()=>{t.app.workspace.getLeaf(!1).openFile(e)})}),n.addItem(o=>{o.setTitle("Open in new tab"),o.setIcon("external-link"),o.onClick(()=>{t.app.workspace.openLinkText(e.path,"",!0)})})),n.showAtMouseEvent(r)}function Aqe(r,e,t,n,i={}){var Y,ee,ae,ce,J,de,vt,ct;let s={...N$,...i},a=s.targetDate||(()=>{let Ae=new Date;return new Date(Date.UTC(Ae.getFullYear(),Ae.getMonth(),Ae.getDate()))})(),o=e.recurrence?Pg(e,a,t.statusManager.getCompletedStatuses()[0]):e.status,l=t.getActiveTimeSession(e)!==null,c=e.recurrence?((Y=e.complete_instances)==null?void 0:Y.includes(ue(a)))||!1:t.statusManager.isCompletedStatus(o),d=e.recurrence&&((ee=e.skipped_instances)==null?void 0:ee.includes(ue(a)))||!1,u=!!e.recurrence,p=["task-card"];c&&p.push("task-card--completed"),d&&p.push("task-card--skipped"),e.archived&&p.push("task-card--archived"),l&&p.push("task-card--actively-tracked"),u&&p.push("task-card--recurring"),e.priority&&p.push(`task-card--priority-${e.priority}`),o&&p.push(`task-card--status-${o}`),((ae=t.settings)==null?void 0:ae.subtaskChevronPosition)==="left"&&p.push("task-card--chevron-left"),r.className=p.join(" "),r.dataset.status=o;let m=r.querySelector(".task-card__main-row"),f=t.priorityManager.getPriorityConfig(e.priority);f&&r.style.setProperty("--priority-color",f.color);let h=t.statusManager.getStatusConfig(o);h&&r.style.setProperty("--current-status-color",h.color);let g=t.statusManager.getNextStatus(o),y=t.statusManager.getStatusConfig(g);y&&r.style.setProperty("--next-status-color",y.color);let k=r.querySelector(".task-card__checkbox");k&&(k.checked=t.statusManager.isCompletedStatus(o));let T=!n||n.some(Ae=>fd(Ae,"status",t)),w=r.querySelector(".task-card__status-dot");if(T){if(w)h&&(w.style.borderColor=h.color);else if(m){let Ae=m.createEl("span",{cls:"task-card__status-dot"});h&&(Ae.style.borderColor=h.color),$u(Ae),Ae.addEventListener("click",Hce(e,t,r,Ae,a));let Z=r.querySelector(".task-card__checkbox");Z?Z.insertAdjacentElement("afterend",Ae):m.insertBefore(Ae,m.firstChild)}}else w&&w.remove();let S=!n||n.some(Ae=>fd(Ae,"priority",t)),E=r.querySelector(".task-card__priority-dot");if(S&&e.priority&&f){if(!E&&m){let Ae=m.createEl("span",{cls:"task-card__priority-dot",attr:{"aria-label":`Priority: ${f.label}`}});Ae.style.borderColor=f.color,$u(Ae),Ae.addEventListener("click",Me=>{Me.stopPropagation(),new $o({currentValue:e.priority,onSelect:gr=>{(async()=>{try{await t.updateTaskProperty(e,"priority",gr)}catch(Lt){console.error("Error updating priority:",Lt),new Ct.Notice("Failed to update priority")}})()},plugin:t}).show(Me)});let Z=r.querySelector(".task-card__status-dot"),X=r.querySelector(".task-card__checkbox");Z?Z.insertAdjacentElement("afterend",Ae):X?X.insertAdjacentElement("afterend",Ae):m.insertBefore(Ae,m.firstChild)}else if(E){E.style.borderColor=f.color,E.setAttribute("aria-label",`Priority: ${f.label}`);let Ae=E.cloneNode(!0);$u(Ae),Ae.addEventListener("click",Z=>{Z.stopPropagation(),new $o({currentValue:e.priority,onSelect:Me=>{(async()=>{try{await t.updateTaskProperty(e,"priority",Me)}catch(me){console.error("Error updating priority:",me),new Ct.Notice("Failed to update priority")}})()},plugin:t}).show(Z)}),E.replaceWith(Ae)}}else E&&E.remove();let C=r.querySelector(".task-card__badges"),D=e.recurrence?Ow(t,e.recurrence,s.propertyLabels):"";I$(r,".task-card__recurring-indicator",{shouldExist:!!e.recurrence,className:"task-card__recurring-indicator",icon:"rotate-ccw",tooltip:D,onClick:Uce(e,t)});let A=!!(e.reminders&&e.reminders.length>0),N=((ce=e.reminders)==null?void 0:ce.length)||0,V=E$(t,N);I$(r,".task-card__reminder-indicator",{shouldExist:A,className:"task-card__reminder-indicator",icon:"bell",tooltip:V,onClick:Vce(e,t)}),t.projectSubtasksService.isTaskUsedAsProject(e.path).then(Ae=>{var Me,me,gr,Lt;(Me=r.querySelector(".task-card__project-indicator-placeholder"))==null||Me.remove(),(me=r.querySelector(".task-card__chevron-placeholder"))==null||me.remove(),I$(r,".task-card__project-indicator",{shouldExist:Ae,className:"task-card__project-indicator",icon:"folder",tooltip:Fw(t,"projectTooltip"),onClick:Wce(e,t)});let Z=Ae&&((gr=t.settings)==null?void 0:gr.showExpandableSubtasks),X=r.querySelector(".task-card__chevron");if(Z&&!X){let nr=((Lt=t.expandedProjectsService)==null?void 0:Lt.isExpanded(e.path))||!1;af({container:C||m,className:`task-card__chevron${nr?" task-card__chevron--expanded":""}`,icon:"chevron-right",tooltip:JC(t,nr),onClick:()=>{let Di=r.querySelector(".task-card__chevron");Di&&Yce(e,t,r,Di)()}}),nr&&$w(r,e,t,!0).catch(Di=>{console.error("Error showing initial subtasks in update:",Di)})}else if(!Z&&X){X.remove();let nr=r.querySelector(".task-card__subtasks");if(nr){let Di=nr,Oa=Di._clickHandler;Oa&&(nr.removeEventListener("click",Oa),delete Di._clickHandler),nr.remove()}}}).catch(Ae=>{console.error("Error checking if task is used as project in update:",Ae)});let R=r.querySelector(".task-card__blocking-toggle");if(R)if(e.blocking&&e.blocking.length>0){R.classList.add("is-visible"),R.classList.remove("is-hidden");let Ae=t.i18n.translate("ui.taskCard.blockingToggle",{count:e.blocking.length});R.setAttribute("aria-label",Ae),(0,Ct.setTooltip)(R,Ae,{placement:"top"}),R.dataset.count=String(e.blocking.length),R.classList.contains("task-card__blocking-toggle--expanded")&&O$(r,e,t,!0).catch(Z=>{console.error("Error refreshing blocking tasks:",Z)})}else{R.classList.remove("is-visible","task-card__blocking-toggle--expanded"),R.classList.add("is-hidden");let Ae=r.querySelector(".task-card__blocking");Ae&&Ae.remove()}let I=r.querySelector(".task-card__title-text"),O=r.querySelector(".task-card__title"),z=c;I&&(I.textContent=e.title,I.classList.toggle("completed",z)),O&&O.classList.toggle("completed",z);let B=r.querySelector(".task-card__badge--blocked");B&&B.remove();let W=r.querySelector(".task-card__metadata");if(W){W.innerHTML="";let Ae=[],Z=n||(t.settings.defaultVisibleProperties?Fi(t.settings.defaultVisibleProperties,t):P$(t));for(let X of Z){if(fd(X,"status",t)||fd(X,"priority",t))continue;if(X==="blocked"){if(e.isBlocked){let me=t.i18n.translate("ui.taskCard.blockedBadge"),gr=(de=(J=e.blockedBy)==null?void 0:J.length)!=null?de:0,Lt=gr>0?`${me} (${gr})`:me,nr=W.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--blocked",text:Lt});(0,Ct.setTooltip)(nr,t.i18n.translate("ui.taskCard.blockedBadgeTooltip"),{placement:"top"}),Ae.push(nr)}continue}if(X==="blocking"){if(e.isBlocking){let me=t.i18n.translate("ui.taskCard.blockingBadge"),gr=(ct=(vt=e.blocking)==null?void 0:vt.length)!=null?ct:0,Lt=gr>0?`${me} (${gr})`:me,nr=W.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--blocking",text:Lt});(0,Ct.setTooltip)(nr,t.i18n.translate("ui.taskCard.blockingBadgeTooltip"),{placement:"top"}),Ae.push(nr)}continue}let Me=_$(W,X,e,t,s);Me&&Ae.push(Me)}M$(W,Ae)}}function Iqe(r){let e=r.querySelector(".task-card__subtasks");if(e){let t=e,n=t._clickHandler;n&&(e.removeEventListener("click",n),delete t._clickHandler)}}async function $w(r,e,t,n){try{let i=r.querySelector(".task-card__subtasks");if(n){if(!i){i=r.ownerDocument.createElement("div"),i.className="task-card__subtasks";let a=o=>{o.stopPropagation()};i.addEventListener("click",a),i._clickHandler=a,Bce(i,r),r.appendChild(i)}for(;i.firstChild;)i.removeChild(i.firstChild);let s=i.createEl("div",{cls:"task-card__subtasks-loading",text:t.i18n.translate("contextMenus.task.subtasks.loading")});try{let a=t.app.vault.getAbstractFileByPath(e.path);if(!(a instanceof Ct.TFile))throw new Error("Task file not found");if(!t.projectSubtasksService)throw new Error("projectSubtasksService not initialized");let o=qce(r,await t.projectSubtasksService.getTasksLinkedToProject(a));if(s.remove(),o.length===0){i.createEl("div",{cls:"task-card__subtasks-loading",text:t.i18n.translate("contextMenus.task.subtasks.noSubtasks")});return}let l=t.projectSubtasksService.sortTasks(o),d=(u=>{var f;let p=[],m=u.closest(".task-card");for(;m;){let h=m._taskPath;typeof h=="string"&&p.unshift(h),m=(f=m.parentElement)==null?void 0:f.closest(".task-card")}return p})(r);for(let u of l){if(d.includes(u.path)){console.warn("Circular reference detected in task chain:",{subtask:u.path,parentChain:d,cycle:[...d,u.path]});continue}let p=pr(u,t,void 0,R$(r));p.classList.add("task-card--subtask"),i.appendChild(p)}}catch(a){console.error("Error loading subtasks:",a),s.textContent=t.i18n.translate("contextMenus.task.subtasks.loadFailed")}}else if(i){let s=i,a=s._clickHandler;a&&(i.removeEventListener("click",a),delete s._clickHandler),i.remove()}}catch(i){throw console.error("Error in toggleSubtasks:",i),i}}async function O$(r,e,t,n){let i=r.querySelector(".task-card__blocking");if(!n){i&&(r.classList.remove("task-card--nested-interactive-hover"),i.remove());return}i||(i=r.createDiv({cls:"task-card__blocking"}),Bce(i,r),i.addEventListener("click",a=>a.stopPropagation()),i.addEventListener("dblclick",a=>a.stopPropagation()),i.addEventListener("contextmenu",a=>a.stopPropagation())),i.empty();let s=i.createDiv({cls:"task-card__blocking-loading",text:t.i18n.translate("ui.taskCard.loadingDependencies")});try{let a=e.blocking?await Promise.all(e.blocking.map(l=>t.cacheManager.getTaskInfo(l))):[],o=qce(r,a.filter(l=>!!l));if(s.remove(),o.length===0){i.createDiv({cls:"task-card__blocking-empty",text:t.i18n.translate("ui.taskCard.blockingEmpty")});return}o.forEach(l=>{let c=pr(l,t,void 0,R$(r));c.classList.add("task-card--dependency"),i&&i.appendChild(c)})}catch(a){console.error("Error loading blocking tasks:",a),s.textContent=t.i18n.translate("ui.taskCard.blockingLoadError")}}async function Nqe(r,e,t){if(!r||!r.projects||r.projects.length===0)return;let n=0,i=10;for(;nwindow.setTimeout(a,10)),n++}let s=t.querySelectorAll(".task-card__chevron--expanded");for(let a of s){let o=a.closest(".task-card");if(!o)continue;let l=o.dataset.taskPath;if(!l)continue;let c=e.app.vault.getAbstractFileByPath(l);if(!(c instanceof Ct.TFile))continue;let d=c.basename;if(r.projects.flat(2).some(p=>{if(p&&typeof p=="string"&&p.startsWith("[[")&&p.endsWith("]]")){let m=p.slice(2,-2).trim(),f=(0,Ct.parseLinktext)(m).path,h=e.app.metadataCache.getFirstLinkpathDest(f,"");return f===d||h&&h.path===l}return p===d||p===l})&&o.querySelector(".task-card__subtasks"))try{let m=await e.cacheManager.getTaskInfo(l);m&&await $w(o,m,e,!0)}catch(m){console.error("Error refreshing parent task subtasks:",m)}}}var Ct,N$,$i=v(()=>{Ct=require("obsidian");T$();Cr();Qe();jr();sT();gg();S$();yg();hd();D$();$ce();zce();N$={layout:"default",showSecondaryBadges:!0,enableHoverPreview:!0}});function sy(r,e,t={}){let n=Ve(),i={title:e.title.trim(),status:e.status||r.settings.defaultTaskStatus,priority:e.priority||r.settings.defaultTaskPriority,dateCreated:n,dateModified:n};if(t.creationContext&&(i.creationContext=t.creationContext),e.dueDate&&(i.due=e.dueTime?ts(e.dueDate,e.dueTime):e.dueDate),e.scheduledDate&&(i.scheduled=e.scheduledTime?ts(e.scheduledDate,e.scheduledTime):e.scheduledDate),e.contexts&&e.contexts.length>0&&(i.contexts=e.contexts),e.projects&&e.projects.length>0&&(i.projects=e.projects),e.tags&&e.tags.length>0&&(i.tags=e.tags.map(s=>Ai(s))),e.details&&(i.details=e.details),e.recurrence&&(i.recurrence=e.recurrence),e.estimate&&e.estimate>0&&(i.timeEstimate=e.estimate),e.userFields){let s=r.settings.userFields||[],a={};for(let[o,l]of Object.entries(e.userFields)){let c=s.find(d=>d.id===o);c&&(a[c.key]=Array.isArray(l)?l.join(", "):l)}Object.keys(a).length>0&&(i.customFrontmatter=a)}return i}var eP=v(()=>{Qe();Cr()});var Gce={};et(Gce,{TaskSelectorWithCreateModal:()=>jw,openTaskSelector:()=>pn,openTaskSelectorWithCreate:()=>Rqe});async function Rqe(r,e){let t=await r.cacheManager.getAllTasks();return new Promise(n=>{new jw(r.app,r,t,{onResult:n,...e}).open()})}function pn(r,e,t,n){new jw(r.app,r,e,{placeholder:n==null?void 0:n.placeholder,title:n==null?void 0:n.title,onResult:s=>{s.type==="selected"||s.type==="created"?t(s.task):t(null)}}).open()}var Fl,jw,Wo=v(()=>{Fl=require("obsidian");Cr();Ru();$i();eP();jw=class extends Fl.SuggestModal{constructor(t,n,i,s){super(t);this.createFooterEl=null;this.currentQuery="";this.resultHandled=!1;this.handleInputChange=()=>{let t=this.inputEl.value.trim();this.currentQuery=t,this.updateCreateFooter(t)};this.plugin=n,this.tasks=i,this.options=s,this.translate=n.i18n.translate.bind(n.i18n),this.nlParser=Oi.fromPlugin(n),this.setPlaceholder(s.placeholder||this.translate("modals.taskSelectorWithCreate.placeholder")),this.setInstructions([{command:"\u2191\u2193",purpose:this.translate("modals.taskSelector.instructions.navigate")},{command:"\u21B5",purpose:this.translate("modals.taskSelector.instructions.select")},{command:"\u21E7\u21B5",purpose:this.translate("modals.taskSelectorWithCreate.instructions.create")},{command:"esc",purpose:this.translate("modals.taskSelector.instructions.dismiss")}]),this.titleEl.setText(s.title||this.translate("modals.taskSelectorWithCreate.title")),this.titleEl.setAttribute("id","task-selector-with-create-title"),this.containerEl.setAttribute("aria-labelledby","task-selector-with-create-title"),this.containerEl.setAttribute("role","dialog"),this.containerEl.setAttribute("aria-modal","true"),this.containerEl.addClass("task-selector-with-create-modal"),this.containerEl.addClass("tasknotes-plugin")}onOpen(){super.onOpen(),this.scope.register(["Shift"],"Enter",t=>(t.preventDefault(),t.stopPropagation(),this.createNewTask(),!1)),this.inputEl.addEventListener("input",this.handleInputChange),window.setTimeout(()=>this.createFooter(),0)}createFooter(){var n;let t=((n=this.modalEl.querySelector(".prompt"))==null?void 0:n.parentElement)||this.modalEl;this.createFooterEl=createDiv({cls:"task-selector-create-footer"}),this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b"),t.appendChild(this.createFooterEl)}updateCreateFooter(t){if(!this.createFooterEl)return;if(!t){this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b"),this.createFooterEl.empty();return}let n=this.nlParser.parseInput(t);if(n.title&&n.title!=="Untitled Task"){this.createFooterEl.empty(),this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-flex-75816cae");let i=this.createFooterEl.createDiv({cls:"task-selector-create-footer__icon"});(0,Fl.setIcon)(i,"plus-circle");let s=this.createFooterEl.createDiv({cls:"task-selector-create-footer__content"});s.createDiv({cls:"task-selector-create-footer__title-line"}).createSpan({cls:"task-selector-create-footer__title",text:n.title});let o=this.buildMetadataParts(n);if(o.length>0){let c=s.createDiv({cls:"task-selector-create-footer__meta"});o.forEach(d=>{let u=c.createSpan({cls:`task-selector-create-footer__chip task-selector-create-footer__chip--${d.type}`}),p=u.createSpan({cls:"task-selector-create-footer__chip-icon"});(0,Fl.setIcon)(p,d.icon),u.createSpan({cls:"task-selector-create-footer__chip-text",text:d.text})})}let l=s.createDiv({cls:"task-selector-create-footer__hint"});l.createSpan({cls:"task-selector-create-footer__shortcut",text:"\u21E7\u21B5"}),l.createSpan({cls:"task-selector-create-footer__hint-text",text:this.translate("modals.taskSelectorWithCreate.footer.createLabel")})}else this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b"),this.createFooterEl.empty()}buildMetadataParts(t){let n=[];if(t.dueDate){let i=t.dueTime?`${t.dueDate} ${t.dueTime}`:t.dueDate;n.push({icon:"calendar",text:i,type:"due"})}if(t.scheduledDate){let i=t.scheduledTime?`${t.scheduledDate} ${t.scheduledTime}`:t.scheduledDate;n.push({icon:"calendar-clock",text:i,type:"scheduled"})}if(t.priority&&t.priority!=="normal"&&n.push({icon:"flag",text:t.priority,type:"priority"}),t.status){let i=this.plugin.statusManager.getStatusConfig(t.status);n.push({icon:"circle-dot",text:(i==null?void 0:i.label)||t.status,type:"status"})}if(t.contexts&&t.contexts.length>0&&t.contexts.forEach(i=>{n.push({icon:"at-sign",text:i,type:"context"})}),t.projects&&t.projects.length>0&&t.projects.forEach(i=>{n.push({icon:"folder",text:i.replace(/^\[\[|\]\]$/g,""),type:"project"})}),t.tags&&t.tags.length>0&&t.tags.forEach(i=>{n.push({icon:"hash",text:i,type:"tag"})}),t.recurrence&&n.push({icon:"repeat",text:t.recurrence,type:"recurrence"}),t.estimate&&t.estimate>0){let i=Math.floor(t.estimate/60),s=t.estimate%60,a=i>0?`${i}h ${s}m`:`${s}m`;n.push({icon:"timer",text:a,type:"estimate"})}if(t.details){let i=t.details.length>30?t.details.substring(0,30)+"...":t.details;n.push({icon:"file-text",text:i,type:"details"})}if(t.userFields){let i=this.plugin.settings.userFields||[];for(let[s,a]of Object.entries(t.userFields)){let o=i.find(d=>d.id===s),l=(o==null?void 0:o.displayName)||s,c=Array.isArray(a)?a.join(", "):a;n.push({icon:"sliders-horizontal",text:`${l}: ${c}`,type:"userfield"})}}return n}async createNewTask(){let t=this.inputEl.value.trim();if(!t){new Fl.Notice(this.translate("modals.taskSelectorWithCreate.notices.emptyQuery"));return}try{let n=this.nlParser.parseInput(t);if(!n.title||n.title==="Untitled Task"){new Fl.Notice(this.translate("modals.taskSelectorWithCreate.notices.invalidTitle"));return}let i=this.buildTaskDataFromParsed(n),s=await this.plugin.taskService.createTask(i);new Fl.Notice(this.translate("modals.taskCreation.notices.success",{title:s.taskInfo.title})),this.resultHandled=!0,this.close(),this.options.onResult({type:"created",task:s.taskInfo})}catch(n){console.error("Failed to create task:",n);let i=n instanceof Error?n.message:String(n);new Fl.Notice(this.translate("modals.taskCreation.notices.failure",{message:i}))}}buildTaskDataFromParsed(t){return sy(this.plugin,t)}getSuggestions(t){return this.currentQuery=t,this.getFilteredTasks(t)}getFilteredTasks(t){let n=t.toLowerCase();return this.tasks.filter(i=>!i.archived).filter(i=>{var a;return!!(!t||i.title&&i.title.toLowerCase().includes(n)||i.due&&i.due.toLowerCase().includes(n)||i.priority&&i.priority!=="normal"&&i.priority.toLowerCase().includes(n)||(a=i.contexts)!=null&&a.some(o=>o&&o.toLowerCase().includes(n))||ku(i.projects||[]).some(o=>o&&o.toLowerCase().includes(n)))}).sort((i,s)=>{var u,p;let a=this.plugin.statusManager.isCompletedStatus(i.status),o=this.plugin.statusManager.isCompletedStatus(s.status);if(a!==o)return a?1:-1;if(i.due&&!s.due)return-1;if(!i.due&&s.due)return 1;if(i.due&&s.due){let m=i.due.localeCompare(s.due);if(m!==0)return m}let l={high:0,normal:1,low:2},c=(u=l[i.priority])!=null?u:1,d=(p=l[s.priority])!=null?p:1;return c!==d?c-d:i.title.localeCompare(s.title)})}renderSuggestion(t,n){let i=pr(t,this.plugin,void 0,{layout:"default"});i.classList.add("task-selector-modal__suggestion");let s=i.cloneNode(!0);n.appendChild(s)}onChooseSuggestion(t,n){this.resultHandled=!0,this.options.onResult({type:"selected",task:t})}onClose(){this.inputEl.removeEventListener("input",this.handleInputChange),this.createFooterEl&&(this.createFooterEl.remove(),this.createFooterEl=null),window.setTimeout(()=>{this.resultHandled||this.options.onResult({type:"cancelled"})},0),super.onClose()}}});function zw(r,e){var t;return new Kce.Setting(r).setName(e.label).addButton(n=>{n.setButtonText(e.buttonText).setTooltip(e.buttonTooltip).onClick(e.onButtonClick),n.buttonEl.addClasses(["tn-btn","tn-btn--ghost"])}),(t=e.listElement)!=null?t:r.createDiv({cls:"task-projects-list"})}var Kce,Zce=v(()=>{Kce=require("obsidian")});function L$({plugin:r,sourcePath:e},t){return{dependency:{uid:Ba(r.app,e,t.path,r.settings.useFrontmatterMarkdownLinks),reltype:Ds},path:t.path,name:t.basename}}function Qce({plugin:r,sourcePath:e},t){var a;let n=El(t);if(!n){let o=typeof t=="object"&&t&&"uid"in t&&typeof t.uid=="string"?t.uid:ie(t);return{dependency:{uid:o,reltype:Ds},name:o,unresolved:!0}}let i=Em(r.app,e,n);if(i){let o=((a=i.file)==null?void 0:a.basename)||i.path.split("/").pop()||n.uid;return{dependency:n,path:i.path,name:o}}let s=n.uid.replace(/^\[\[/,"").replace(/\]\]$/,"");return{dependency:n,name:s||t.uid,unresolved:!0}}function Jce({plugin:r,sourcePath:e},t){let n=r.app.vault.getAbstractFileByPath(t);if(n instanceof Bw.TFile)return L$({plugin:r,sourcePath:e},n);let s=(t.split("/").pop()||t).replace(/\.md$/i,"");return{dependency:{uid:`[[${s}]]`,reltype:Ds},path:t,name:s,unresolved:!0}}function F$(r,e){return r.some(t=>t.dependency.uid===e.dependency.uid||!!e.path&&t.path===e.path)}async function Xce({plugin:r,listEl:e,items:t,linkServices:n,translate:i,onRemove:s}){if(e&&(e.empty(),t.length!==0))for(let[a,o]of t.entries()){let l=!!(o.path&&!o.unresolved),c=e.createDiv({cls:l?"task-project-item task-project-item--task-card":"task-project-item"});o.unresolved&&(c.addClass("task-project-item--unresolved"),(0,Bw.setTooltip)(c,i("contextMenus.task.dependencies.notices.unresolved",{entries:o.dependency.uid}),{placement:"top"}));let d=c.createDiv({cls:l?"task-project-card-host":"task-project-info"});o.path&&!o.unresolved?await Oqe(r,d,o,n):Lqe(d,o);let u=c.createEl("button",{cls:"task-project-remove",text:"\xD7"});(0,Bw.setTooltip)(u,i("modals.task.dependencies.removeTaskTooltip"),{placement:"top"}),u.addEventListener("click",p=>{p.preventDefault(),p.stopPropagation(),s(a)})}}async function Oqe(r,e,t,n){if(!t.path)return;let i=await r.cacheManager.getCachedTaskInfo(t.path);if(i){let a=pr(i,r,void 0,{layout:"default",showSecondaryBadges:!1,enableHoverPreview:!1});e.appendChild(a);return}let s=e.createSpan({cls:"task-project-name clickable-dependency"});Ml(s,t.path,t.name,n,{cssClass:"task-dependency-link internal-link",hoverSource:"tasknotes-dependency-link",showErrorNotices:!0}),t.path!==t.name&&e.createDiv({cls:"task-project-path",text:t.path})}function Lqe(r,e){var i;let t=r.createSpan({cls:"task-project-name"});t.textContent=e.name;let n=(i=e.path)!=null?i:e.dependency.uid;r.createDiv({cls:"task-project-path",text:n})}function $$(r,e,t){return Ba(r.app,e,t.path,r.settings.useFrontmatterMarkdownLinks)}var Bw,ede=v(()=>{Bw=require("obsidian");Zc();vT();$i();jr()});function qw(r,e){if(!r||!e)return 0;let t=r.toLowerCase().split(" ").filter(Boolean),n=e.toLowerCase(),i=0,s=0;for(let a=0;a0&&l===i&&(s+=5),i=l+o.length}return s}var tde=v(()=>{});var z$={};et(z$,{FileSuggestHelper:()=>j$});var rde,j$,tP=v(()=>{rde=require("obsidian");tde();yT();c1();Om();j$={async suggest(r,e,t=20,n){var a,o;let i=async()=>{var k,T,w,S,E,C,D,A,N,V;let l=(T=(k=r==null?void 0:r.app)==null?void 0:k.vault)!=null&&T.getMarkdownFiles?r.app.vault.getMarkdownFiles():[],c=[],d=((E=(S=(w=r.settings)==null?void 0:w.projectAutosuggest)==null?void 0:S.rows)!=null?E:[]).slice(0,3),u=new Set;for(let R of d)try{let I=Pl(R);for(let O of I)O.searchable&&!O.property.startsWith("literal:")&&u.add(O.property)}catch(I){}let p=(e||"").toLowerCase(),m=(C=n==null?void 0:n.requiredTags)!=null?C:[],f=(D=n==null?void 0:n.includeFolders)!=null?D:[],h=KD(n);for(let R of l){let I=r.app.metadataCache.getFileCache(R);if(m.length>0){let ae=((A=I==null?void 0:I.tags)==null?void 0:A.map(vt=>vt.tag.replace("#","")))||[],ce=((N=I==null?void 0:I.frontmatter)==null?void 0:N.tags)||[],J=[...ae,...Array.isArray(ce)?ce:[ce].filter(Boolean)];if(!vr.matchesTagConditions(J,m))continue}if(f.length>0&&!f.some(ce=>R.path.startsWith(ce)||R.path.startsWith(ce+"/")))continue;if(h.enabled){let ae=I==null?void 0:I.frontmatter;if(!ZD(ae,h))continue}let O=R.basename,z="";if(I!=null&&I.frontmatter){let ae=r.fieldMapper.mapFromFrontmatter(I.frontmatter,R.path,r.settings.storeTitleInFilename);z=typeof ae.title=="string"?ae.title:""}let B=I!=null&&I.frontmatter?(0,rde.parseFrontMatterAliases)(I.frontmatter)||[]:[],W=0,ee=p.length>0?qw(e,O):1;if(ee>0&&(W=Math.max(W,ee+15)),z){let ae=qw(e,z);ae>0&&(W=Math.max(W,ae+5))}if(Array.isArray(B)){for(let ae of B)if(typeof ae=="string"){let ce=qw(e,ae);ce>0&&(W=Math.max(W,ce))}}if(u.size>0){let ae=(I==null?void 0:I.frontmatter)||{};for(let ce of u){let J="";if(ce==="file.path")J=R.path;else if(ce==="file.parent")J=((V=R.parent)==null?void 0:V.path)||"";else if(ce==="file.basename")J=O;else if(ce==="title")J=z;else if(ce==="aliases")J=(Array.isArray(B)?B.filter(vt=>typeof vt=="string"):[]).join(" ");else{let de=ae[ce];de!=null&&(Array.isArray(de)?J=de.filter(vt=>typeof vt=="string").join(" "):typeof de=="object"?J=JSON.stringify(de):(typeof de=="string"||typeof de=="number"||typeof de=="boolean")&&(J=String(de)))}if(J){let de=qw(e,J),vt=de>0?de:J.toLowerCase().includes(p)?30:0;vt>0&&(W=Math.max(W,vt))}}}if(W>0){let ae=[];z&&z!==O&&ae.push(`title: ${z}`);let ce=Array.isArray(B)?B.filter(de=>typeof de=="string"):[];ce.length&&ae.push(`aliases: ${ce.join(", ")}`);let J=ae.length?`${O} [${ae.join(" | ")}]`:O;c.push({insertText:O,displayText:J,score:W})}}c.sort((R,I)=>I.score-R.score);let g=[],y=new Set;for(let R of c)if(!y.has(R.insertText)&&(g.push(R),y.add(R.insertText),g.length>=t))break;return g},s=(o=(a=r.settings)==null?void 0:a.suggestionDebounceMs)!=null?o:0;return s?new Promise(l=>{let c=r;c.__fileSuggestTimer&&window.clearTimeout(c.__fileSuggestTimer),c.__fileSuggestTimer=window.setTimeout(()=>{(async()=>{let d=await i();l(d)})()},s)}):i()}}});var iP,rP,nP,ay,nde=v(()=>{iP=require("obsidian"),rP=class extends iP.AbstractInputSuggest{constructor(e,t,n){super(e,t),this.plugin=n,this.input=t}async getSuggestions(e){let t=this.input.value.split(",").map(a=>a.trim()),n=t[t.length-1],i=this.plugin.cacheManager.getAllContexts(),s=t.slice(0,-1);return i.filter(a=>a&&typeof a=="string").filter(a=>!s.includes(a)&&(!n||a.toLowerCase().includes(n.toLowerCase()))).slice(0,10).map(a=>({value:a,display:a,type:"context",toString(){return this.value}}))}renderSuggestion(e,t){t.textContent=e.display}selectSuggestion(e){let t=this.input.value.split(",").map(n=>n.trim());t[t.length-1]=e.value,this.input.value=t.join(", ")+", ",this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.focus()}},nP=class extends iP.AbstractInputSuggest{constructor(e,t,n){super(e,t),this.plugin=n,this.input=t}async getSuggestions(e){let t=this.input.value.split(",").map(a=>a.trim()),n=t[t.length-1],i=this.plugin.cacheManager.getAllTags(),s=t.slice(0,-1);return i.filter(a=>a&&typeof a=="string").filter(a=>!s.includes(a)&&(!n||a.toLowerCase().includes(n.toLowerCase()))).slice(0,10).map(a=>({value:a,display:a,type:"tag",toString(){return this.value}}))}renderSuggestion(e,t){t.textContent=e.display}selectSuggestion(e){let t=this.input.value.split(",").map(n=>n.trim());t[t.length-1]=e.value,this.input.value=t.join(", ")+", ",this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.focus()}},ay=class extends iP.AbstractInputSuggest{constructor(e,t,n,i){super(e,t),this.plugin=n,this.input=t,this.fieldConfig=i}async getSuggestions(e){let t=this.fieldConfig.type==="list",n="",i=[];if(t?(i=this.input.value.split(",").map(o=>o.trim()),n=i[i.length-1]||""):n=this.input.value.trim(),!n)return[];let s=n.match(/\[\[([^\]]*)$/);if(s){let o=s[1]||"",{FileSuggestHelper:l}=await Promise.resolve().then(()=>(tP(),z$));return(await l.suggest(this.plugin,o,20,this.fieldConfig.autosuggestFilter)).map(d=>({value:d.insertText,display:d.displayText,type:"user-field",fieldKey:this.fieldConfig.key,toString(){return this.value}}))}return(await this.getExistingUserFieldValues(this.fieldConfig.key)).filter(o=>o&&typeof o=="string").filter(o=>o.toLowerCase().includes(n.toLowerCase())&&(!t||!i.slice(0,-1).includes(o))).slice(0,10).map(o=>({value:o,display:o,type:"user-field",fieldKey:this.fieldConfig.key,toString(){return this.value}}))}async getExistingUserFieldValues(e){var i,s;let t=async()=>{try{let a=this.plugin.app.vault.getMarkdownFiles(),o=new Set;for(let l of a)try{let c=this.plugin.app.metadataCache.getFileCache(l),d=c==null?void 0:c.frontmatter;if(d&&d[e]!==void 0){let u=d[e];Array.isArray(u)?u.forEach(p=>{typeof p=="string"&&p.trim()&&o.add(p.trim())}):typeof u=="string"&&u.trim()?o.add(u.trim()):(typeof u=="number"||typeof u=="boolean")&&o.add(u.toString())}if(o.size>=200)break}catch(c){continue}return Array.from(o).sort()}catch(a){return console.error("Error getting user field values:",a),[]}},n=(s=(i=this.plugin.settings)==null?void 0:i.suggestionDebounceMs)!=null?s:0;return n?new Promise(a=>{let o=this.plugin;o.__userFieldSuggestTimer&&window.clearTimeout(o.__userFieldSuggestTimer),o.__userFieldSuggestTimer=window.setTimeout(()=>{(async()=>a(await t()))()},n)}):t()}renderSuggestion(e,t){t.textContent=e.display}selectSuggestion(e){var n;if(this.fieldConfig.type==="list"){let i=this.input.value.split(","),s=(n=i.pop())!=null?n:"",a=i.join(","),o=s.trim(),l=/\[\[/.test(o)?o.replace(/\[\[[^\]]*$/,`[[${e.value}]]`):e.value,c=(a?a+", ":"")+l;this.input.value=c.endsWith(",")?c+" ":c+", "}else{let i=this.input.value,s=i.replace(/\[\[[^\]]*$/,`[[${e.value}]]`);this.input.value=s===i?e.value:s}this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.focus()}}});function Hw(r){return r==null?"":typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):Array.isArray(r)?r.map(Hw).join(", "):""}var at,oy,B$=v(()=>{at=require("obsidian");ere();TL();xm();sT();pre();gg();IL();Qe();jr();Cr();QD();Zc();vT();Wo();Bo();Zce();$i();ede();nde();oy=class extends at.Modal{constructor(t,n){super(t);this.keyboardHandler=null;this.guardedTitleInputs=new WeakSet;this.pendingTitleFocusScrollPositions=null;this.title="";this.details="";this.originalDetails="";this.dueDate="";this.scheduledDate="";this.priority="normal";this.status="open";this.contexts="";this.projects="";this.tags="";this.timeEstimate=0;this.recurrenceRule="";this.recurrenceAnchor="scheduled";this.reminders=[];this.userFields={};this.blockedByItems=[];this.blockingItems=[];this.selectedProjectItems=[];this.selectedSubtaskFiles=[];this.initialSubtaskFiles=[];this.detailsMarkdownEditor=null;this.isExpanded=!1;this.plugin=n}createDependencyItemFromFile(t,n={}){var i;return L$({plugin:this.plugin,sourcePath:(i=n.sourcePath)!=null?i:this.getDependencySourcePath()},t)}createDependencyItemFromDependency(t,n){return Qce({plugin:this.plugin,sourcePath:n!=null?n:this.getDependencySourcePath()},t)}createDependencyItemFromPath(t){return Jce({plugin:this.plugin,sourcePath:this.getDependencySourcePath()},t)}getDependencySourcePath(){var t;return this.getCurrentTaskPath()||((t=this.plugin.app.workspace.getActiveFile())==null?void 0:t.path)||""}getCurrentTaskPath(){}async openTaskNote(){}renderDependencyLists(){this.renderBlockedByList(),this.renderBlockingList()}getLinkServices(){var t;return{metadataCache:this.plugin.app.metadataCache,workspace:this.plugin.app.workspace,sourcePath:this.getCurrentTaskPath()||((t=this.plugin.app.workspace.getActiveFile())==null?void 0:t.path)||""}}renderBlockedByList(){this.renderDependencyList(this.blockedByList,this.blockedByItems,t=>{this.blockedByItems.splice(t,1),this.renderBlockedByList()})}renderBlockingList(){this.renderDependencyList(this.blockingList,this.blockingItems,t=>{this.blockingItems.splice(t,1),this.renderBlockingList()})}async renderDependencyList(t,n,i){t&&await Xce({plugin:this.plugin,listEl:t,items:n,linkServices:this.getLinkServices(),translate:(s,a)=>this.t(s,a),onRemove:i})}extractDetailsFromContent(t){let{body:n}=Cg(t);return n.replace(/\r\n/g,` `).trimEnd()}normalizeDetails(t){return t.replace(/\r\n/g,` `).trimEnd()}addBlockedByTask(t){let n={uid:Ba(this.plugin.app,this.getDependencySourcePath(),t.path,this.plugin.settings.useFrontmatterMarkdownLinks),reltype:Ds};this.addBlockedByDependency(n)}addBlockingTask(t){this.addBlockingTaskFromPath(t.path)}addBlockedByDependency(t){let n=this.getDependencySourcePath(),i=this.createDependencyItemFromDependency(t,n);F$(this.blockedByItems,i)||(this.blockedByItems.push(i),this.renderBlockedByList())}addBlockingTaskFromPath(t){let n=this.getCurrentTaskPath();if(n&&t===n)return;let i=this.createDependencyItemFromPath(t);F$(this.blockingItems,i)||(this.blockingItems.push(i),this.renderBlockingList())}async openBlockedBySelector(){let t=this.getDependencySourcePath(),n=this.getCurrentTaskPath(),i=new Set(this.blockedByItems.map(s=>s.dependency.uid));await this.openTaskDependencySelector(s=>{if(n&&s.path===n)return!1;let a=$$(this.plugin,t,s);return!i.has(a)},s=>{let a={uid:Ba(this.plugin.app,t,s.path),reltype:Ds};this.addBlockedByDependency(a)})}async openBlockingSelector(){let t=this.getDependencySourcePath(),n=this.getCurrentTaskPath(),i=new Set(this.blockingItems.map(a=>a.path).filter(a=>typeof a=="string")),s=new Set(this.blockingItems.map(a=>a.dependency.uid));await this.openTaskDependencySelector(a=>{if(n&&a.path===n||i.has(a.path))return!1;let o=$$(this.plugin,t,a);return!s.has(o)},a=>{this.addBlockingTaskFromPath(a.path)})}async openTaskDependencySelector(t,n){var i,s,a;try{let l=((a=await((s=(i=this.plugin.cacheManager).getAllTasks)==null?void 0:s.call(i)))!=null?a:[]).filter(t);if(l.length===0){new at.Notice(this.t("contextMenus.task.dependencies.notices.noEligibleTasks"));return}pn(this.plugin,l,c=>{c&&n(c)})}catch(o){console.error("Failed to open task selector for dependencies:",o),new at.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}getApp(){return this.app}getPlugin(){return this.plugin}t(t,n){return this.plugin.i18n.translate(t,n)}getFileByPath(t){return this.app.vault.getAbstractFileByPath(t)}getMarkdownFiles(){return this.app.vault.getMarkdownFiles()}getFileCache(t){return this.app.metadataCache.getFileCache(t)}resolveLink(t,n){return this.app.metadataCache.getFirstLinkpathDest(t,n)}isEditMode(){return!1}isCreationMode(){return!1}onOpen(){this.containerEl.addClass("tasknotes-plugin","minimalist-task-modal"),this.plugin.settings.enableModalSplitLayout&&this.containerEl.addClass("split-layout-enabled"),this.modalEl.addClass("mod-tasknotes"),this.titleEl.setText(this.getModalTitle()),this.keyboardHandler=t=>{if(t.key==="Enter"&&(t.ctrlKey||t.metaKey)){if(t.target.closest(".cm-editor"))return;t.preventDefault(),this.handleSave()}},this.containerEl.addEventListener("keydown",this.keyboardHandler),this.initializeFormData().then(()=>{this.createModalContent(),this.focusTitleInput()})}createModalContent(){let{contentEl:t}=this;t.empty();let n=t.createDiv("minimalist-modal-container");this.splitContentWrapper=n.createDiv("modal-split-content"),this.splitLeftColumn=this.splitContentWrapper.createDiv("modal-split-left"),this.createPrimaryInput(this.splitLeftColumn),this.createActionBar(this.splitLeftColumn),this.splitRightColumn=this.splitLeftColumn.createDiv("modal-split-right"),this.createDetailsSection(n),this.createAdditionalSections(this.splitLeftColumn),this.createActionButtons(n)}createPrimaryInput(t){this.createTitleInput(t)}createAdditionalSections(t){}createTitleInput(t){let n=t.createDiv("title-input-container");this.titleInput=n.createEl("input",{type:"text",cls:"title-input",placeholder:this.t("modals.task.titlePlaceholder")}),this.titleInput.value=this.title,this.titleInput.addEventListener("input",i=>{this.title=i.target.value}),this.attachTitleFocusScrollGuard(this.titleInput)}createActionBar(t){this.actionBar=t.createDiv("action-bar"),this.createActionIcon(this.actionBar,"calendar",this.t("modals.task.actions.due"),(n,i)=>{this.showDateContextMenu(i,"due")},"due-date"),this.createActionIcon(this.actionBar,"calendar-clock",this.t("modals.task.actions.scheduled"),(n,i)=>{this.showDateContextMenu(i,"scheduled")},"scheduled-date"),this.createActionIcon(this.actionBar,"dot-square",this.t("modals.task.actions.status"),(n,i)=>{this.showStatusContextMenu(i)},"status"),this.createActionIcon(this.actionBar,"star",this.t("modals.task.actions.priority"),(n,i)=>{this.showPriorityContextMenu(i)},"priority"),this.createActionIcon(this.actionBar,"refresh-ccw",this.t("modals.task.actions.recurrence"),(n,i)=>{this.showRecurrenceContextMenu(i)},"recurrence"),this.createActionIcon(this.actionBar,"bell",this.t("modals.task.actions.reminders"),(n,i)=>{this.showReminderContextMenu(i)},"reminders"),this.updateIconStates()}createActionIcon(t,n,i,s,a){let o=t.createDiv("action-icon");o.setAttribute("aria-label",i),o.setAttribute("data-initial-tooltip",i),o.setAttribute("tabindex","0"),o.setAttribute("role","button"),a&&o.setAttribute("data-type",a),(0,at.setTooltip)(o,i,{placement:"top"});let l=o.createSpan("icon");return(0,at.setIcon)(l,n),o.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),s(o,c)}),o.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),c.stopPropagation(),s(o,c))}),o}createDetailsSection(t){this.detailsContainer=this.splitLeftColumn?this.splitLeftColumn.createDiv("details-container"):t.createDiv("details-container"),this.isExpanded||(this.detailsContainer.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.detailsContainer.classList.add("tn-static-display-none-6b99de8b"),this.splitRightColumn&&(this.splitRightColumn.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.splitRightColumn.classList.add("tn-static-display-none-6b99de8b")));let n=this.plugin.settings.modalFieldsConfig,i=this.shouldShowField("title",n),s=this.shouldShowField("details",n);this.splitContentWrapper.classList.toggle("modal-split-content--right-empty",!s);let a=this.isEditMode(),o=this.isCreationMode()&&this.plugin.settings.enableNaturalLanguageInput;if(i&&(a||o)){let l=this.detailsContainer.createDiv("detail-label");l.textContent=this.t("modals.task.titleLabel");let c=this.detailsContainer.createEl("input",{type:"text",cls:"title-input-detailed",placeholder:this.t("modals.task.titleDetailedPlaceholder")});c.value=this.title,c.addEventListener("input",d=>{this.title=d.target.value}),this.attachTitleFocusScrollGuard(c),(a||o)&&!this.titleInput&&(this.titleInput=c)}if(s){let l=this.splitRightColumn||this.detailsContainer,c=l.createDiv("detail-label");c.textContent=this.t("modals.task.detailsLabel");let d=l.createDiv("details-markdown-editor");this.detailsMarkdownEditor=TD(this.app,d,{value:this.details,placeholder:this.t("modals.task.detailsPlaceholder"),cls:"details-editor",onChange:u=>{this.details=u},onSubmit:()=>{this.handleSave()},onEscape:()=>{this.close()},onTab:u=>this.plugin.settings.taskModalTabMovesFocus?u?this.focusPreviousField():this.focusNextField():!1})}this.createAdditionalFields(this.detailsContainer)}shouldShowField(t,n){return Jte(t,n,this.isCreationMode())}createAdditionalFields(t){let n=this.plugin.settings.modalFieldsConfig;if(!n){console.error("TaskModal: modalFieldsConfig is not initialized. This should never happen.");return}this.createFieldsFromConfig(t,n)}createFieldsFromConfig(t,n){let i=Xte(n,this.isCreationMode());for(let s of i){if(s.id==="basic")continue;let a=t.createDiv({cls:"task-modal__field-group"});for(let o of s.fields)this.createField(a,o)}}createField(t,n){switch(n.id){case"contexts":this.createContextsField(t);break;case"tags":this.createTagsField(t);break;case"time-estimate":this.createTimeEstimateField(t);break;case"projects":this.createProjectsField(t);break;case"subtasks":this.createSubtasksField(t);break;case"blocked-by":this.createBlockedByField(t);break;case"blocking":this.createBlockingField(t);break;default:n.fieldType==="user"&&this.createUserFieldByConfig(t,n);break}}createContextsField(t){new at.Setting(t).setName(this.t("modals.task.contextsLabel")).addText(n=>{n.setPlaceholder(this.t("modals.task.contextsPlaceholder")).setValue(this.contexts).onChange(i=>{this.contexts=i}),this.contextsInput=n.inputEl,new rP(this.app,n.inputEl,this.plugin)})}createTagsField(t){new at.Setting(t).setName(this.t("modals.task.tagsLabel")).addText(n=>{n.setPlaceholder(this.t("modals.task.tagsPlaceholder")).setValue(this.tags).onChange(i=>{this.tags=Ai(i)}),this.tagsInput=n.inputEl,new nP(this.app,n.inputEl,this.plugin)})}createTimeEstimateField(t){new at.Setting(t).setName(this.t("modals.task.timeEstimateLabel")).addText(n=>{n.setPlaceholder(this.t("modals.task.timeEstimatePlaceholder")).setValue(this.timeEstimate.toString()).onChange(i=>{this.timeEstimate=parseInt(i)||0}),this.timeEstimateInput=n.inputEl})}createProjectsField(t){this.projectsList=zw(t,{label:this.t("modals.task.organization.projects"),buttonText:this.t("modals.task.organization.addToProjectButton"),buttonTooltip:this.t("modals.task.projectsTooltip"),onButtonClick:()=>{new Su(this.app,this.plugin,i=>{this.addProject(i)}).open()},listElement:this.projectsList}),this.renderOrganizationLists()}createSubtasksField(t){this.subtasksList=zw(t,{label:this.t("modals.task.organization.subtasks"),buttonText:this.t("modals.task.organization.addSubtasksButton"),buttonTooltip:this.t("modals.task.organization.addSubtasksTooltip"),onButtonClick:()=>{this.openSubtaskSelector()},listElement:this.subtasksList}),this.renderOrganizationLists()}createBlockedByField(t){this.blockedByList=zw(t,{label:this.t("modals.task.dependencies.blockedBy"),buttonText:this.t("modals.task.dependencies.addTaskButton"),buttonTooltip:this.t("modals.task.dependencies.selectTaskTooltip"),onButtonClick:()=>{this.openBlockedBySelector()},listElement:this.blockedByList}),this.renderDependencyLists()}createBlockingField(t){this.blockingList=zw(t,{label:this.t("modals.task.dependencies.blocking"),buttonText:this.t("modals.task.dependencies.addTaskButton"),buttonTooltip:this.t("modals.task.dependencies.selectTaskTooltip"),onButtonClick:()=>{this.openBlockingSelector()},listElement:this.blockingList}),this.renderDependencyLists()}createUserFieldByConfig(t,n){var a;let i=(a=this.plugin.settings.userFields)==null?void 0:a.find(o=>o.id===n.id);if(!i)return;let s=new at.Setting(t).setName(i.displayName);switch(i.type){case"text":case"list":{s.addText(o=>{let l=this.userFields[i.key],c=Array.isArray(l)?l.map(Hw).join(", "):Hw(l);o.setValue(c).onChange(d=>{i.type==="list"?this.userFields[i.key]=d.split(",").map(u=>u.trim()).filter(u=>u.length>0):this.userFields[i.key]=d}),new ay(this.app,o.inputEl,this.plugin,i)});break}case"number":{s.addText(o=>{let l=this.userFields[i.key];o.setValue(Hw(l)).onChange(c=>{let d=parseFloat(c);this.userFields[i.key]=isNaN(d)?null:d}),o.inputEl.type="number"});break}case"date":{s.addText(o=>{let l=this.userFields[i.key];o.setValue(Hw(l)).onChange(c=>{this.userFields[i.key]=c}),o.inputEl.type="date"});break}case"boolean":{s.addToggle(o=>{let l=this.userFields[i.key];o.setValue(l===!0).onChange(c=>{this.userFields[i.key]=c})});break}}}createUserFields(t){var i;let n=((i=this.plugin.settings)==null?void 0:i.userFields)||[];n.length>0&&t.createDiv({cls:"user-fields-separator"}).createDiv({text:this.t("modals.task.customFieldsLabel"),cls:"detail-label-section"});for(let s of n){if(!s||!s.key||!s.displayName)continue;let a=this.userFields[s.key]||"";switch(s.type){case"boolean":new at.Setting(t).setName(s.displayName).addToggle(o=>{o.setValue(a===!0||a==="true").onChange(l=>{this.userFields[s.key]=l})});break;case"number":new at.Setting(t).setName(s.displayName).addText(o=>{o.setPlaceholder(this.t("modals.task.userFields.numberPlaceholder")).setValue(a?ie(a):"").onChange(l=>{let c=parseFloat(l);this.userFields[s.key]=isNaN(c)?null:c})});break;case"date":new at.Setting(t).setName(s.displayName).addText(o=>{o.setPlaceholder(this.t("modals.task.userFields.datePlaceholder")).setValue(a?ie(a):"").onChange(d=>{this.userFields[s.key]=d||null});let l=o.inputEl.parentElement;l&&l.addClass("tn-date-control");let c=l==null?void 0:l.createEl("button",{cls:"user-field-date-picker-btn"});c&&(c.setAttribute("aria-label",this.t("modals.task.userFields.pickDate",{field:s.displayName})),(0,at.setIcon)(c,"calendar"),c.addEventListener("click",d=>{d.preventDefault(),new Es({currentValue:o.getValue()||void 0,onSelect:p=>{o.setValue(p||""),this.userFields[s.key]=p||null},plugin:this.plugin,app:this.app}).showAtElement(c)}))});break;case"list":new at.Setting(t).setName(s.displayName).addText(o=>{var d;let l=Array.isArray(a)?a.join(", "):a?ie(a):"";o.setPlaceholder(this.t("modals.task.userFields.listPlaceholder")).setValue(l).onChange(u=>{u.trim()?this.userFields[s.key]=u.split(",").map(p=>p.trim()).filter(p=>p):this.userFields[s.key]=null}),new ay(this.app,o.inputEl,this.plugin,s);let c=t.querySelector(".user-field-link-preview");c&&((d=c.detach)==null||d.call(c))});break;case"text":default:new at.Setting(t).setName(s.displayName).addText(o=>{o.setPlaceholder(this.t("modals.task.userFields.textPlaceholder",{field:s.displayName})).setValue(a?ie(a):"").onChange(l=>{this.userFields[s.key]=l||null}),new ay(this.app,o.inputEl,this.plugin,s)});break}}}createActionButtons(t){let n=t.createDiv("modal-button-container");this.isEditMode()&&n.createEl("button",{cls:"open-note-button",text:this.t("modals.task.buttons.openNote")}).addEventListener("click",()=>{this.openTaskNote()});let i=n.createEl("button",{cls:"mod-cta",text:this.t("modals.task.buttons.save")});i.addEventListener("click",()=>{(async()=>{i.disabled=!0;try{await this.handleSave(),this.close()}finally{i.disabled=!1}})()}),n.createEl("button",{text:this.t("common.cancel")}).addEventListener("click",()=>{this.close()})}expandModal(){this.isExpanded||(this.isExpanded=!0,this.detailsContainer.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.detailsContainer.classList.add("tn-static-display-block-2a1b75c9"),this.containerEl.addClass("expanded"),this.splitRightColumn&&(this.splitRightColumn.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.splitRightColumn.style.removeProperty("display")),this.detailsContainer.classList.remove("tn-static-opacity-0-6-d95b59ac","tn-static-opacity-1-c6e7979d"),this.detailsContainer.classList.add("tn-static-opacity-0-8d919cb5"),this.detailsContainer.classList.remove("tn-static-transform-translatey-0-1b976432"),this.detailsContainer.classList.add("tn-static-transform-translatey-10px-5b91bf02"),window.setTimeout(()=>{this.detailsContainer.classList.remove("tn-static-opacity-0-6-d95b59ac","tn-static-opacity-0-8d919cb5"),this.detailsContainer.classList.add("tn-static-opacity-1-c6e7979d"),this.detailsContainer.classList.remove("tn-static-transform-translatey-10px-5b91bf02"),this.detailsContainer.classList.add("tn-static-transform-translatey-0-1b976432")},50))}showDateContextMenu(t,n){let i=n==="due"?this.dueDate:this.scheduledDate,s=n==="due"?this.t("modals.task.dateMenu.dueTitle"):this.t("modals.task.dateMenu.scheduledTitle");new Es({currentValue:i?tt(i):void 0,currentTime:i?$a(i):void 0,title:s,plugin:this.plugin,app:this.app,onSelect:(o,l)=>{if(o){let c=l?ts(o,l):o;n==="due"?this.dueDate=c:this.scheduledDate=c}else n==="due"?this.dueDate="":this.scheduledDate="";this.updateDateIconState()}}).show(t)}showStatusContextMenu(t){new PD({currentValue:this.status,onSelect:i=>{this.status=i,this.updateStatusIconState()},plugin:this.plugin}).show(t)}showPriorityContextMenu(t){new $o({currentValue:this.priority,onSelect:i=>{this.priority=i,this.updatePriorityIconState()},plugin:this.plugin}).show(t)}showRecurrenceContextMenu(t){new jo({currentValue:this.recurrenceRule,currentAnchor:this.recurrenceAnchor,scheduledDate:this.scheduledDate,onSelect:(i,s)=>{this.recurrenceRule=i||"",s!==void 0&&(this.recurrenceAnchor=s),this.updateRecurrenceIconState()},app:this.app,plugin:this.plugin}).show(t)}showReminderContextMenu(t){let n={title:this.title,status:this.status,priority:this.priority,due:this.dueDate,scheduled:this.scheduledDate,path:"",archived:!1,reminders:this.reminders};new vg(this.plugin,n,t.target,s=>{this.reminders=s.reminders||[],this.updateReminderIconState()}).show(t)}updateDateIconState(){this.updateIconStates()}updateStatusIconState(){this.updateIconStates()}updatePriorityIconState(){this.updateIconStates()}updateRecurrenceIconState(){this.updateIconStates()}updateReminderIconState(){this.updateIconStates()}getDefaultStatus(){let t=this.plugin.settings.customStatuses;return t&&t.length>0?[...t].sort((i,s)=>i.order-s.order)[0].value:"open"}getDefaultPriority(){let t=this.plugin.settings.customPriorities;return t&&t.length>0?[...t].sort((i,s)=>i.weight-s.weight)[0].value:"normal"}getRecurrenceDisplayText(){if(!this.recurrenceRule)return"";let t=this.recurrenceRule;if(t.includes("FREQ=DAILY"))return"Daily";if(t.includes("FREQ=WEEKLY")){if(t.includes("INTERVAL=2"))return"Every 2 weeks";if(t.includes("BYDAY=MO,TU,WE,TH,FR"))return"Weekdays";if(t.includes("BYDAY=")){let i=t.match(/BYDAY=([A-Z]{2})/);return i?`Weekly on ${{SU:"Sunday",MO:"Monday",TU:"Tuesday",WE:"Wednesday",TH:"Thursday",FR:"Friday",SA:"Saturday"}[i[1]]||i[1]}`:"Weekly"}else return"Weekly"}else if(t.includes("FREQ=MONTHLY")){if(t.includes("INTERVAL=3"))return"Every 3 months";if(t.includes("BYMONTHDAY=")){let i=t.match(/BYMONTHDAY=(\d+)/);return i?`Monthly on the ${this.getOrdinal(parseInt(i[1]))}`:"Monthly"}else return t.includes("BYDAY=")?"Monthly (by weekday)":"Monthly"}else if(t.includes("FREQ=YEARLY")){if(t.includes("BYMONTH=")&&t.includes("BYMONTHDAY=")){let i=t.match(/BYMONTH=(\d+)/),s=t.match(/BYMONTHDAY=(\d+)/);if(i&&s){let o=["","January","February","March","April","May","June","July","August","September","October","November","December"][parseInt(i[1])],l=this.getOrdinal(parseInt(s[1]));return`Yearly on ${o} ${l}`}}return"Yearly"}let n="";if(t.includes("COUNT=")){let i=t.match(/COUNT=(\d+)/);i&&(n=` (${i[1]} times)`)}else if(t.includes("UNTIL=")){let i=t.match(/UNTIL=(\d{8})/);if(i){let s=i[1];n=` (until ${`${s.slice(0,4)}-${s.slice(4,6)}-${s.slice(6,8)}`})`}}return"Custom"+n}getOrdinal(t){let n=["th","st","nd","rd"],i=t%100;return t+(n[(i-20)%10]||n[i]||n[0])}updateIconStates(){if(!this.actionBar)return;let t=this.actionBar.querySelector('[data-type="due-date"]');t&&(this.dueDate?(t.classList.add("has-value"),(0,at.setTooltip)(t,this.t("modals.task.tooltips.dueValue",{value:this.dueDate}),{placement:"top"})):(t.classList.remove("has-value"),(0,at.setTooltip)(t,this.t("modals.task.actions.due"),{placement:"top"})));let n=this.actionBar.querySelector('[data-type="scheduled-date"]');n&&(this.scheduledDate?(n.classList.add("has-value"),(0,at.setTooltip)(n,this.t("modals.task.tooltips.scheduledValue",{value:this.scheduledDate}),{placement:"top"})):(n.classList.remove("has-value"),(0,at.setTooltip)(n,this.t("modals.task.actions.scheduled"),{placement:"top"})));let i=this.actionBar.querySelector('[data-type="status"]');if(i){let l=this.plugin.settings.customStatuses.find(u=>u.value===this.status),c=l?l.label:this.status;this.status&&l&&l.value!==this.getDefaultStatus()?(i.classList.add("has-value"),(0,at.setTooltip)(i,this.t("modals.task.tooltips.statusValue",{value:c}),{placement:"top"})):(i.classList.remove("has-value"),(0,at.setTooltip)(i,this.t("modals.task.actions.status"),{placement:"top"}));let d=i.querySelector(".icon");d&&l&&l.color?d.style.color=l.color:d&&(d.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),d.style.removeProperty("color"))}let s=this.actionBar.querySelector('[data-type="priority"]');if(s){let l=this.plugin.settings.customPriorities.find(u=>u.value===this.priority),c=l?l.label:this.priority;this.priority&&l&&l.value!==this.getDefaultPriority()?(s.classList.add("has-value"),(0,at.setTooltip)(s,this.t("modals.task.tooltips.priorityValue",{value:c}),{placement:"top"})):(s.classList.remove("has-value"),(0,at.setTooltip)(s,this.t("modals.task.actions.priority"),{placement:"top"}));let d=s.querySelector(".icon");d&&l&&l.color?d.style.color=l.color:d&&(d.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),d.style.removeProperty("color"))}let a=this.actionBar.querySelector('[data-type="recurrence"]');a&&(this.recurrenceRule&&this.recurrenceRule.trim()?(a.classList.add("has-value"),(0,at.setTooltip)(a,this.t("modals.task.tooltips.recurrenceValue",{value:this.getRecurrenceDisplayText()}),{placement:"top"})):(a.classList.remove("has-value"),(0,at.setTooltip)(a,this.t("modals.task.actions.recurrence"),{placement:"top"})));let o=this.actionBar.querySelector('[data-type="reminders"]');if(o)if(this.reminders&&this.reminders.length>0){o.classList.add("has-value");let l=this.reminders.length,c=l===1?this.t("modals.task.tooltips.remindersSingle"):this.t("modals.task.tooltips.remindersPlural",{count:l});(0,at.setTooltip)(o,c,{placement:"top"})}else o.classList.remove("has-value"),(0,at.setTooltip)(o,this.t("modals.task.actions.reminders"),{placement:"top"})}focusTitleInput(){window.setTimeout(()=>{this.pendingTitleFocusScrollPositions=this.captureTitleFocusScrollPositions(this.titleInput),this.titleInput.focus({preventScroll:!0}),this.titleInput.select(),this.restoreTitleFocusScrollPositions(this.pendingTitleFocusScrollPositions)},100)}shouldPreserveTitleFocusScroll(){var i,s;let t=this.containerEl.ownerDocument,n=t.defaultView||window;return t.body.classList.contains("is-mobile")||((s=(i=n.matchMedia)==null?void 0:i.call(n,"(pointer: coarse)"))==null?void 0:s.matches)===!0}attachTitleFocusScrollGuard(t){if(this.guardedTitleInputs.has(t))return;this.guardedTitleInputs.add(t);let n=()=>{this.pendingTitleFocusScrollPositions=this.captureTitleFocusScrollPositions(t)};t.addEventListener("pointerdown",n,{capture:!0}),t.addEventListener("touchstart",n,{capture:!0}),t.addEventListener("focus",()=>{this.pendingTitleFocusScrollPositions&&this.scheduleTitleFocusScrollRestore(this.pendingTitleFocusScrollPositions)})}captureTitleFocusScrollPositions(t){if(!this.shouldPreserveTitleFocusScroll())return null;let n=new Set,i=a=>{var c;let o=a==null?void 0:a.ownerDocument.defaultView,l=(c=o==null?void 0:o.HTMLElement)!=null?c:HTMLElement;a instanceof l&&n.add(a)};i(this.containerEl),i(this.modalEl),i(this.contentEl),this.modalEl.querySelectorAll(".modal-content, .minimalist-modal-container, .modal-split-content, .modal-split-left, .modal-split-right, .details-container").forEach(i);let s=t.parentElement;for(;s&&s!==this.containerEl.parentElement;)i(s),s=s.parentElement;return Array.from(n).map(a=>({element:a,scrollTop:a.scrollTop,scrollLeft:a.scrollLeft}))}restoreTitleFocusScrollPositions(t){if(t)for(let{element:n,scrollTop:i,scrollLeft:s}of t)n.scrollTop=i,n.scrollLeft=s}scheduleTitleFocusScrollRestore(t){var s;this.restoreTitleFocusScrollPositions(t);let n=this.containerEl.ownerDocument.defaultView||window;((s=n.requestAnimationFrame)!=null?s:(a=>n.setTimeout(a,16)))(()=>this.restoreTitleFocusScrollPositions(t)),n.setTimeout(()=>this.restoreTitleFocusScrollPositions(t),50),n.setTimeout(()=>{this.restoreTitleFocusScrollPositions(t),this.pendingTitleFocusScrollPositions===t&&(this.pendingTitleFocusScrollPositions=null)},250)}addProject(t){if(t instanceof at.TFile){let n={file:t,name:t.basename,link:this.buildProjectReference(t,this.getCurrentTaskPath()||"")};if(this.hasProjectItem(n))return;this.selectedProjectItems.push(n)}this.updateProjectsFromFiles(),this.renderProjectsList()}removeProject(t){this.selectedProjectItems=this.selectedProjectItems.filter(n=>n!==t),this.updateProjectsFromFiles(),this.renderProjectsList()}updateProjectsFromFiles(){this.projects=this.selectedProjectItems.map(t=>t.link).join(", ")}buildProjectReference(t,n){return xl(this.app,t,n,"","",this.plugin.settings.useFrontmatterMarkdownLinks)}initializeProjectsFromStrings(t){this.selectedProjectItems=[],this.addProjectsFromStrings(t)}addProjectsFromStrings(t){let n=this.getCurrentTaskPath()||"";for(let i of t){let s=this.createProjectItemFromString(i,n);!s||this.hasProjectItem(s)||this.selectedProjectItems.push(s)}this.updateProjectsFromFiles()}createProjectItemFromString(t,n){if(!t||typeof t!="string"||t.trim()==="")return null;let i=t.match(/^\[\[([^\]]+)\]\]$/);if(i){let s=i[1],a=this.resolveLink(s,n);return a instanceof at.TFile?{file:a,name:a.basename,link:t}:{name:s.split("|")[0],link:t,unresolved:!0}}else{let s=t.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(s){let a=dn(t),o=this.resolveLink(a,n);return o instanceof at.TFile?{file:o,name:o.basename,link:t}:{name:s[1]||a,link:t,unresolved:!0}}else{let o=this.getMarkdownFiles().find(l=>l.basename===t||l.name===t+".md");return o?{file:o,name:o.basename,link:`[[${o.basename}]]`}:{name:t,link:t,unresolved:!0}}}}hasProjectItem(t){let n=this.getProjectDedupKeys(t);return this.selectedProjectItems.some(i=>{let s=this.getProjectDedupKeys(i);return n.some(a=>s.includes(a))})}getProjectDedupKeys(t){var s;let n=new Set;(s=t.file)!=null&&s.path&&n.add(`path:${this.normalizeProjectPath(t.file.path)}`);let i=dn(t.link);return i&&n.add(`path:${this.normalizeProjectPath(i)}`),t.link&&n.add(`link:${t.link.trim().toLowerCase()}`),Array.from(n)}normalizeProjectPath(t){return t.trim().replace(/\.md$/i,"").toLowerCase()}renderProjectsList(){this.projectsList&&(this.projectsList.empty(),this.selectedProjectItems.length!==0&&this.selectedProjectItems.forEach(t=>{let n=this.projectsList.createDiv({cls:"task-project-item"});t.unresolved&&n.addClass("task-project-item--unresolved");let i=n.createDiv({cls:"task-project-info"}),s=i.createDiv({cls:"task-project-name clickable-project"});if(t.file){let o=NL(this.app,t.file,this.getCurrentTaskPath()||"",t.file.name);if(this.renderProjectLinksWithoutPrefix(s,[o]),t.file.path!==t.file.name){let l=i.createDiv({cls:"task-project-path"});l.textContent=t.file.path}}else s.textContent=t.name,(0,at.setTooltip)(s,this.t("contextMenus.task.dependencies.notices.unresolved",{name:t.name}),{placement:"top"});let a=n.createEl("button",{cls:"task-project-remove",text:"\xD7"});(0,at.setTooltip)(a,this.t("modals.task.projectsRemoveTooltip"),{placement:"top"}),a.addEventListener("click",()=>{this.removeProject(t)})}))}async openSubtaskSelector(){try{let t=await this.plugin.cacheManager.getAllTasks(),n=this.getCurrentTaskPath(),i=t.filter(s=>n&&s.path===n?!1:!this.selectedSubtaskFiles.some(a=>a.path===s.path));if(i.length===0){new at.Notice(this.t("modals.task.organization.notices.noEligibleSubtasks"));return}pn(this.plugin,i,s=>{if(!s)return;let a=this.app.vault.getAbstractFileByPath(s.path);a&&this.addSubtask(a)})}catch(t){console.error("Failed to open subtask selector:",t),new at.Notice(this.t("modals.task.organization.notices.subtaskSelectFailed"))}}addSubtask(t){this.selectedSubtaskFiles.some(n=>n.path===t.path)||(this.selectedSubtaskFiles.push(t),this.renderSubtasksList())}removeSubtask(t){this.selectedSubtaskFiles=this.selectedSubtaskFiles.filter(n=>n.path!==t.path),this.renderSubtasksList()}async renderSubtasksList(){if(this.subtasksList&&(this.subtasksList.empty(),this.selectedSubtaskFiles.length!==0))for(let t of this.selectedSubtaskFiles){if(!(t instanceof at.TFile))return;let n=this.subtasksList.createDiv({cls:"task-project-item task-project-item--task-card"}),i=n.createDiv({cls:"task-project-card-host"}),s=await this.plugin.cacheManager.getCachedTaskInfo(t.path);if(s){let o=pr(s,this.plugin,void 0,{layout:"default",showSecondaryBadges:!1,enableHoverPreview:!1});i.appendChild(o)}else{let o=i.createDiv({cls:"task-project-info"}),l=o.createDiv({cls:"task-project-name clickable-project"}),c=NL(this.app,t,this.getCurrentTaskPath()||"",t.name);if(this.renderProjectLinksWithoutPrefix(l,[c]),t.path!==t.name){let d=o.createDiv({cls:"task-project-path"});d.textContent=t.path}}let a=n.createEl("button",{cls:"task-project-remove",text:"\xD7"});(0,at.setTooltip)(a,this.t("modals.task.organization.removeSubtaskTooltip"),{placement:"top"}),a.addEventListener("click",()=>{this.removeSubtask(t)})}}renderOrganizationLists(){this.renderProjectsList(),this.renderSubtasksList()}renderProjectLinksWithoutPrefix(t,n){let i={metadataCache:this.app.metadataCache,workspace:this.app.workspace};XD(t,n,i),Array.from(t.childNodes).forEach(s=>{var a;s.nodeType===Node.TEXT_NODE&&((a=s.textContent)==null?void 0:a.trim())==="+"&&s.remove()})}toggleProjectsList(){this.projectsList&&this.projectsList.toggleClass("collapsed",!this.projectsList.hasClass("collapsed"))}toggleSubtasksList(){this.subtasksList&&this.subtasksList.toggleClass("collapsed",!this.subtasksList.hasClass("collapsed"))}validateForm(){return this.title.trim().length>0}focusNextField(){let t=this.contextsInput||this.tagsInput||this.timeEstimateInput;return t?(window.setTimeout(()=>{t.focus()},50),!0):!1}focusPreviousField(){return this.titleInput?(window.setTimeout(()=>{var t;(t=this.titleInput)==null||t.focus()},50),!0):!1}onClose(){this.keyboardHandler&&(this.containerEl.removeEventListener("keydown",this.keyboardHandler),this.keyboardHandler=null),this.detailsMarkdownEditor&&(this.detailsMarkdownEditor.destroy(),this.detailsMarkdownEditor=null),super.onClose()}}});var sP,ide=v(()=>{sP=class{constructor(e,t=[]){this.config=e,this.userFields=t,this.triggerMap=new Map,this.propertyMap=new Map,this.buildMaps()}buildMaps(){this.triggerMap.clear(),this.propertyMap.clear();for(let e of this.config.triggers)e.enabled&&(this.triggerMap.set(e.trigger,e),this.propertyMap.set(e.propertyId,e))}getTriggerForProperty(e){return this.propertyMap.get(e)}getPropertyForTrigger(e){var t;return(t=this.triggerMap.get(e))==null?void 0:t.propertyId}getAllEnabledTriggers(){return this.config.triggers.filter(e=>e.enabled)}getTriggersOrderedByLength(){return this.getAllEnabledTriggers().sort((e,t)=>t.trigger.length-e.trigger.length)}usesNativeTagSuggester(){let e=this.getTriggerForProperty("tags");return(e==null?void 0:e.trigger)==="#"&&(e==null?void 0:e.enabled)}getTagTrigger(){let e=this.getTriggerForProperty("tags");return e!=null&&e.enabled?e.trigger:void 0}getContextTrigger(){let e=this.getTriggerForProperty("contexts");return e!=null&&e.enabled?e.trigger:void 0}getProjectTrigger(){let e=this.getTriggerForProperty("projects");return e!=null&&e.enabled?e.trigger:void 0}getStatusTrigger(){let e=this.getTriggerForProperty("status");return e!=null&&e.enabled?e.trigger:void 0}getPriorityTrigger(){let e=this.getTriggerForProperty("priority");return e!=null&&e.enabled?e.trigger:void 0}getUserField(e){return this.userFields.find(t=>t.id===e)}isUserField(e){return this.userFields.some(t=>t.id===e)}getSuggesterType(e){if(e==="tags")return this.usesNativeTagSuggester()?"native-tag":"list";if(e==="contexts")return"list";if(e==="projects")return"file";if(e==="status")return"status";if(e==="priority")return"priority";let t=this.getUserField(e);if(t)switch(t.type){case"text":return t.autosuggestFilter?"file":"list";case"list":return"list";case"boolean":return"boolean";default:return"none"}return"none"}updateConfig(e){this.config=e,this.buildMaps()}updateUserFields(e){this.userFields=e}}});function ade(r){let e=(0,$l.autocompletion)({override:[$qe(r)],activateOnTyping:!0,closeOnBlur:!0,maxRenderedOptions:10,addToOptions:[{render:(n,i,s)=>jqe(n),position:100}]}),t=q$.Prec.high(sde.keymap.of([{key:"ArrowDown",run:(0,$l.moveCompletionSelection)(!0)},{key:"ArrowUp",run:(0,$l.moveCompletionSelection)(!1)},{key:"Enter",run:$l.acceptCompletion},{key:"Tab",run:$l.acceptCompletion},{key:"Escape",run:$l.closeCompletion}]));return[q$.Prec.high(e),t]}function $qe(r){return async e=>{let t=new sP(r.settings.nlpTriggers,r.settings.userFields||[]),n=e.state.doc.lineAt(e.pos),i=n.text.slice(0,e.pos-n.from),s=(p,m)=>{if(p===-1)return!1;if(p===0)return!0;let f=m[p-1];return!/\w/.test(f)},a=t.getTriggersOrderedByLength(),o=[];for(let p of a){if(p.propertyId==="tags"&&p.trigger==="#")continue;let m=i.lastIndexOf(p.trigger);s(m,i)&&o.push({propertyId:p.propertyId,trigger:p.trigger,index:m,triggerLength:p.trigger.length})}if(o.length===0)return null;o.sort((p,m)=>m.index-p.index);let l=o[0],c=l.index+l.triggerLength,d=i.slice(c);if(l.propertyId==="projects"&&/^\[\[[^\]]*\]\]/.test(d)||l.propertyId!=="projects"&&(d.includes(" ")||d.includes(` `)))return null;let u=await zqe(l.propertyId,d,r,t);return!u||u.length===0?null:{from:n.from+l.index+l.triggerLength,to:e.pos,options:u,validFor:/^[\w\s-]*$/}}}function jqe(r){let e=r;if(!e.projectMetadata)return null;let t=activeDocument.createElement("div");t.className="cm-project-suggestion__metadata";for(let n of e.projectMetadata){let i=activeDocument.createElement("div");i.className="cm-project-suggestion__meta",n.forEach((s,a)=>{a>0&&i.appendChild(activeDocument.createTextNode(" "));let o=activeDocument.createElement("span");o.className=s.kind==="value"?"cm-project-suggestion__meta-value":s.kind==="label"?"cm-project-suggestion__meta-label":"cm-project-suggestion__meta-literal",s.searchable&&o.classList.add("cm-project-suggestion__meta-searchable"),s.searchable&&e.projectQuery?Uqe(o,s.text,e.projectQuery):o.textContent=s.text,i.appendChild(o)}),t.appendChild(i)}return t}async function zqe(r,e,t,n){switch(n.getSuggesterType(r)){case"list":return Bqe(r,e,t);case"file":return qqe(r,e,t,n);case"status":return Vqe(e,t);case"priority":return Wqe(e,t);case"boolean":return Yqe(e);case"native-tag":return null;default:return null}}function Bqe(r,e,t){let n=[],i=r;switch(r){case"tags":n=t.cacheManager.getAllTags(),i="Tag";break;case"contexts":n=t.cacheManager.getAllContexts(),i="Context";break;default:n=[],i=r;break}return n.filter(s=>s&&typeof s=="string").filter(s=>s.toLowerCase().includes(e.toLowerCase())).slice(0,10).map(s=>({label:s,apply:s+" ",type:"text",info:i}))}async function qqe(r,e,t,n){var i,s,a;try{let o;if(r==="projects")o=t.settings.projectAutosuggest;else{let u=n.getUserField(r);o=u==null?void 0:u.autosuggestFilter}let l=(t.settings.excludedFolders||"").split(",").map(u=>u.trim()).filter(Boolean),d=(await j$.suggest(t,e,20,o)).filter(u=>{let p=t.app.vault.getMarkdownFiles().find(m=>m.basename===u.insertText);return p?!l.some(m=>p.path.startsWith(m)):!0});if(r==="projects"){let u=new wu({getFrontmatter:m=>m.frontmatter}),p=((a=(s=(i=t.settings)==null?void 0:i.projectAutosuggest)==null?void 0:s.rows)!=null?a:[]).slice(0,3);return d.map(m=>{var k;let f=m.displayText||m.insertText,h=m.insertText,g=t.app.vault.getMarkdownFiles().find(T=>T.basename===m.insertText),y=[];if(g&&p.length>0){let T=t.app.metadataCache.getFileCache(g),w=(T==null?void 0:T.frontmatter)||{},S=t.fieldMapper.mapFromFrontmatter(w,g.path,t.settings.storeTitleInFilename),E=typeof S.title=="string"?S.title:"",C=Array.isArray(w.aliases)?w.aliases.filter(A=>typeof A=="string"):[],D={basename:g.basename,name:g.name,path:g.path,parent:((k=g.parent)==null?void 0:k.path)||"",title:E,aliases:C,frontmatter:w};y=Hqe(p,D,u)}return{label:f,apply:`[[${h}]] `,type:"text",info:"Project",projectMetadata:y.length>0?y:void 0,projectQuery:e}})}return d.map(u=>{let p=u.displayText||u.insertText,m=u.insertText;return{label:p,apply:`[[${m}]] `,type:"text",info:r==="projects"?"Project":r}})}catch(o){return console.error(`Error getting file suggestions for ${r}:`,o),[]}}function Hqe(r,e,t){var s;let n=[],i=Math.min(r.length,3);for(let a=0;ad.text.trim().length>0)&&n.push(c)}catch(l){}}return n}function Uqe(r,e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0){r.textContent=e;return}let i=e.toLowerCase(),s=[];for(let l of n){let c=i.indexOf(l);for(;c!==-1;)s.push({start:c,end:c+l.length}),c=i.indexOf(l,c+1)}s.sort((l,c)=>l.start-c.start);let a=[];for(let l of s){let c=a[a.length-1];(!c||l.start>=c.end)&&a.push(l)}if(a.length===0){r.textContent=e;return}let o=0;for(let l of a){l.start>o&&r.appendChild(activeDocument.createTextNode(e.slice(o,l.start)));let c=activeDocument.createElement("mark");c.textContent=e.slice(l.start,l.end),r.appendChild(c),o=l.end}o({label:i.display,apply:i.value+" ",type:"text",info:"Status"}))}function Wqe(r,e){return(e.settings.customPriorities||[]).filter(n=>n.label.toLowerCase().includes(r.toLowerCase())).slice(0,10).map(n=>({label:n.label,apply:n.value+" ",type:"text",info:"Priority"}))}function Yqe(r){return["true","false"].filter(t=>t.toLowerCase().includes(r.toLowerCase())).map(t=>({label:t,apply:t+" ",type:"text",info:"Boolean"}))}var $l,q$,sde,Fqe,ode=v(()=>{$l=require("@codemirror/autocomplete"),q$=require("@codemirror/state"),sde=require("@codemirror/view");Ru();ide();tP();GD();yT();Fqe=new Set(["title","aliases","file.basename"])});function lde(r){let e=Ve(),t=r.contexts.split(",").map(l=>l.trim()).filter(l=>l.length>0),n=sa(r.projects),i=Ai(r.tags).split(",").map(l=>l.trim()).filter(l=>l.length>0);r.taskIdentificationMethod==="tag"&&r.taskTag&&!i.includes(r.taskTag)&&i.push(r.taskTag);let s={title:r.title.trim(),due:r.dueDate||void 0,scheduled:r.scheduledDate||void 0,priority:r.priority,status:r.status,contexts:t.length>0?t:void 0,projects:n.length>0?n:void 0,tags:i.length>0?i:void 0,timeEstimate:r.timeEstimate>0?r.timeEstimate:void 0,recurrence:r.recurrenceRule||void 0,recurrence_anchor:r.recurrenceRule?r.recurrenceAnchor:void 0,reminders:r.reminders.length>0?r.reminders:void 0,creationContext:r.creationContext||"manual-creation",dateCreated:e,dateModified:e,customFrontmatter:Gqe(r.userFields)},a=r.blockedByItems.map(l=>({...l.dependency}));a.length>0&&(s.blockedBy=a);let o=r.normalizeDetails(r.details).trimEnd();return o.length>0&&(s.details=o),s}function cde(r){let e=[],t={},n=[];return r.forEach(i=>{i.path?e.includes(i.path)||(e.push(i.path),t[i.path]={...i.dependency}):n.push(i.dependency.uid)}),{added:e,raw:t,unresolved:n}}function Gqe(r){let e={};for(let[t,n]of Object.entries(r))n!=null&&n!==""&&(e[t]=n);return e}var dde=v(()=>{Qe();Cr();gu()});var ly,aP,ude=v(()=>{ly=require("obsidian");Ru();GD();yT();aP=class extends ly.AbstractInputSuggest{constructor(t,n,i){super(t,n);this.currentTrigger=null;this.projectMetadataResolver=null;this.plugin=i,this.textarea=n,this.obsidianApp=t}isBoundary(t,n){if(n===-1)return!1;if(n===0)return!0;let i=t[n-1];return!/\w/.test(i)}findActiveTrigger(t){let n=t.lastIndexOf("@"),i=t.lastIndexOf("#"),s=t.lastIndexOf("+"),a=(this.plugin.settings.statusSuggestionTrigger||"").trim(),o=a?t.lastIndexOf(a):-1,l=[{type:"@",index:n},{type:"#",index:i},{type:"+",index:s},{type:"status",index:o}].filter(m=>this.isBoundary(t,m.index));if(l.length===0)return{trigger:null,triggerIndex:-1,queryAfterTrigger:""};l.sort((m,f)=>f.index-m.index);let c=l[0].index,d=l[0].type,u=d==="status"?(a==null?void 0:a.length)||0:1,p=t.slice(c+u);return{trigger:d,triggerIndex:c,queryAfterTrigger:p}}shouldEndSuggestionContext(t,n){return!!(t==="+"&&/^\[\[[^\]]*\]\]/.test(n)||(t==="@"||t==="#"||t==="status")&&(n.includes(" ")||n.includes(` `)))}getContextSuggestions(t){return this.plugin.cacheManager.getAllContexts().filter(i=>i&&typeof i=="string").filter(i=>i.toLowerCase().includes(t.toLowerCase())).slice(0,10).map(i=>({value:i,display:i,type:"context",toString(){return this.value}}))}getStatusSuggestions(t){return Oi.fromPlugin(this.plugin).getStatusSuggestions(t,10).map(i=>({...i,type:"status",toString(){return this.value}}))}getTagSuggestions(t){return this.plugin.cacheManager.getAllTags().filter(i=>i&&typeof i=="string").filter(i=>i.toLowerCase().includes(t.toLowerCase())).slice(0,10).map(i=>({value:i,display:i,type:"tag",toString(){return this.value}}))}getProjectMetadataResolver(){var t;if(!this.projectMetadataResolver){let n=(t=this.obsidianApp)!=null?t:this.plugin.app;this.projectMetadataResolver=new wu({getFrontmatter:i=>{let s=n==null?void 0:n.vault.getAbstractFileByPath(i.path),a=s instanceof ly.TFile?n==null?void 0:n.metadataCache.getFileCache(s):void 0;return(a==null?void 0:a.frontmatter)||{}}})}return this.projectMetadataResolver}async getProjectSuggestions(t){var l,c,d,u;let{FileSuggestHelper:n}=await Promise.resolve().then(()=>(tP(),z$)),i=(this.plugin.settings.excludedFolders||"").split(",").map(p=>p.trim()).filter(Boolean),s=await n.suggest(this.plugin,t,20,this.plugin.settings.projectAutosuggest),a=(l=this.obsidianApp)!=null?l:this.plugin.app,o=s.filter(p=>{let m=a==null?void 0:a.vault.getMarkdownFiles().find(f=>f.basename===p.insertText);return m?!i.some(f=>m.path.startsWith(f)):!0});try{let p=this.getProjectMetadataResolver(),m=((u=(d=(c=this.plugin.settings)==null?void 0:c.projectAutosuggest)==null?void 0:d.rows)!=null?u:[]).slice(0,3);return o.map(f=>{var D;let h=a==null?void 0:a.vault.getMarkdownFiles().find(A=>A.basename===f.insertText);if(!h)return{basename:f.insertText,displayName:f.displayText,type:"project",toString(){return this.basename}};let g=a==null?void 0:a.metadataCache.getFileCache(h),y=(g==null?void 0:g.frontmatter)||{},k=this.plugin.fieldMapper.mapFromFrontmatter(y,h.path,this.plugin.settings.storeTitleInFilename),T=typeof k.title=="string"?k.title:"",w=(0,ly.parseFrontMatterAliases)(y)||[],S=Array.isArray(w)?w.filter(A=>typeof A=="string"):[],E={basename:h.basename,name:h.name,path:h.path,parent:((D=h.parent)==null?void 0:D.path)||"",title:T,aliases:S,frontmatter:y},C=this.generateProjectDisplayName(m,E,p,h.basename);return{basename:f.insertText,displayName:C,type:"project",entry:{basename:E.basename,name:E.name,path:E.path,parent:E.parent,title:E.title,aliases:E.aliases,frontmatter:E.frontmatter},toString(){return this.basename}}})}catch(p){return console.error("Enhanced project autosuggest failed, falling back to basic suggestions",p),o.map(m=>({basename:m.insertText,displayName:m.displayText,type:"project",toString(){return this.basename}}))}}generateProjectDisplayName(t,n,i,s){var o;let a=[];for(let l of t)try{let c=Pl(l),d=[];for(let p of c){if(p.property.startsWith("literal:")){d.push(p.property.slice(8));continue}let m=i.resolve(p.property,n)||"";if(m)if(p.showName){let f=(o=p.displayName)!=null?o:p.property;d.push(`${f}: ${m}`)}else d.push(m)}let u=d.join(" ");u.trim()&&a.push(u)}catch(c){}return a.join(" | ")||s}async getSuggestions(t){let n=this.textarea.selectionStart,i=this.textarea.value.slice(0,n),{trigger:s,triggerIndex:a,queryAfterTrigger:o}=this.findActiveTrigger(i);if(!s||a===-1)return this.currentTrigger=null,[];if(this.shouldEndSuggestionContext(s,o))return this.currentTrigger=null,[];switch(this.currentTrigger=s,s){case"@":return this.getContextSuggestions(o);case"status":return this.getStatusSuggestions(o);case"#":return this.getTagSuggestions(o);case"+":return await this.getProjectSuggestions(o);default:return[]}}renderSuggestion(t,n){var c,d,u,p,m;n.setAttribute("role","option");let i=t.type==="project"?t.displayName:t.display;n.setAttribute("aria-label",`${t.type}: ${i}`);let s=n.createSpan("nlp-suggest-icon");s.textContent=this.currentTrigger==="status"?this.plugin.settings.statusSuggestionTrigger||"":this.currentTrigger||"",s.setAttribute("aria-hidden","true");let a=n.createSpan("nlp-suggest-text"),o=(f,h)=>{if(!h)return;let g=h.toLowerCase().split(/\s+/).filter(Boolean);if(!g.length)return;let y=k=>{var T;if(k.nodeType===Node.TEXT_NODE){let w=k.nodeValue||"",S=w.toLowerCase(),E=[];for(let N of g){let V=S.indexOf(N);for(;V!==-1;)E.push({start:V,end:V+N.length}),V=S.indexOf(N,V+1)}E.sort((N,V)=>N.start-V.start);let C=[];for(let N of E)(!C.length||N.start>=C[C.length-1].end)&&C.push(N);if(!C.length)return;let D=activeDocument.createDocumentFragment(),A=0;for(let N of C){N.start>A&&D.appendChild(activeDocument.createTextNode(w.slice(A,N.start)));let V=activeDocument.createElement("mark");V.textContent=w.slice(N.start,N.end),D.appendChild(V),A=N.end}A0&&t.entry){let g=this.getProjectMetadataResolver();for(let y=0;yKqe,hasAnyUserFieldsEnabled:()=>pde,isUserFieldConfigComplete:()=>mde,isUserFieldEnabled:()=>Zqe});function Kqe(r,e){return r.map(t=>{let n={id:`rem_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,type:t.type,description:t.description};if(t.type==="relative"){if(t.relatedTo&&t.offset!==void 0&&t.unit&&t.direction){let i="PT";t.unit==="days"?i=`P${t.offset}D`:t.unit==="hours"?i=`PT${t.offset}H`:i=`PT${t.offset}M`,t.direction==="before"&&(i="-"+i),n.relatedTo=t.relatedTo,n.offset=i}}else t.type==="absolute"&&t.absoluteDate&&t.absoluteTime&&(n.absoluteTime=`${t.absoluteDate}T${t.absoluteTime}:00`);return n}).filter(t=>t.type==="relative"?t.relatedTo&&t.offset:!!t.absoluteTime)}function pde(r){let e=r.userFields;return!e||e.length===0?!1:e.some(t=>!!(t&&t.displayName&&t.key&&t.type))}function mde(r){return!r||!r.enabled?!1:!!(r.displayName&&r.key&&r.type)}function Zqe(r){return r.userFields&&r.userFields.length>0?pde(r):mde(r.userField)}var lP=v(()=>{});var fde={};et(fde,{TaskCreationModal:()=>zu});function Qqe(r,e,t){let n=(bL(),eD(vL));return new n.EmbeddableMarkdownEditor(r,e,t)}var to,zu,cP=v(()=>{to=require("obsidian");B$();Cr();Ru();Qe();gu();jr();ode();dde();ude();zu=class extends oy{constructor(t,n,i={}){super(t,n);this.nlMarkdownEditor=null;this.nlpSuggest=null;this.eventListeners=[];this.options=i,this.nlParser=Oi.fromPlugin(n)}getModalTitle(){return this.t("modals.taskCreation.title")}isCreationMode(){return!0}addTrackedEventListener(t,n,i){t.addEventListener(n,i),this.eventListeners.push({element:t,event:n,handler:i})}removeAllEventListeners(){for(let{element:t,event:n,handler:i}of this.eventListeners)t.removeEventListener(n,i);this.eventListeners=[]}createPrimaryInput(t){this.plugin.settings.enableNaturalLanguageInput?this.createNaturalLanguageInput(t):(this.createTitleInput(t),this.isExpanded=!0,this.containerEl.addClass("expanded"))}createAdditionalSections(t){(this.options.prePopulatedValues&&this.options.prePopulatedValues.projects||this.selectedProjectItems.length>0)&&this.renderProjectsList()}createNaturalLanguageInput(t){let n=t.createDiv("nl-input-container"),i=n.createDiv("nl-markdown-editor");i.setAttribute("role","textbox"),i.setAttribute("aria-label",this.t("modals.taskCreation.nlPlaceholder")),i.setAttribute("aria-multiline","true"),this.nlPreviewContainer=n.createDiv("nl-preview-container"),this.nlPreviewContainer.setAttribute("role","status"),this.nlPreviewContainer.setAttribute("aria-live","polite"),this.nlPreviewContainer.setAttribute("aria-label","Task preview");try{let s=ade(this.plugin);this.nlMarkdownEditor=Qqe(this.app,i,{value:"",placeholder:this.t("modals.taskCreation.nlPlaceholder"),cls:"nlp-editor",extensions:s,enterVimInsertMode:!0,onChange:a=>{a.trim()?this.updateNaturalLanguagePreview(a.trim()):this.clearNaturalLanguagePreview()},onSubmit:()=>{this.handleSave()},onEscape:()=>{this.close()},onTab:a=>a?!1:(this.isExpanded||this.expandModal(),window.setTimeout(()=>{let o=this.modalEl.querySelector(".title-input-detailed");o&&o.focus()},50),!0),onEnter:(a,o,l)=>l?!1:!!o}),window.setTimeout(()=>{var a;if(this.nlMarkdownEditor){let o=(a=this.nlMarkdownEditor.editor)==null?void 0:a.cm;o&&(o.focus(),o.scrollDOM.scrollTop=0)}},100)}catch(s){console.error("Failed to create NLP markdown editor:",s),this.nlInput=i.createEl("textarea",{cls:"nl-input",attr:{placeholder:this.t("modals.taskCreation.nlPlaceholder"),rows:"3"}});let a=()=>{let l=this.nlInput.value.trim();l?this.updateNaturalLanguagePreview(l):this.clearNaturalLanguagePreview()};this.addTrackedEventListener(this.nlInput,"input",a);let o=l=>{let c=this.nlInput.value.trim();if(!c)return;let d=l;d.key==="Enter"&&(d.ctrlKey||d.metaKey)?(d.preventDefault(),this.handleSave()):d.key==="Tab"&&d.shiftKey&&(d.preventDefault(),this.parseAndFillForm(c))};this.addTrackedEventListener(this.nlInput,"keydown",o),this.nlpSuggest=new aP(this.app,this.nlInput,this.plugin),window.setTimeout(()=>{this.nlInput.focus()},100)}}updateNaturalLanguagePreview(t){if(!this.nlPreviewContainer)return;let n=this.nlParser.parseInput(t),i=this.nlParser.getPreviewData(n);i.length>0&&n.title?(this.nlPreviewContainer.empty(),this.nlPreviewContainer.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.nlPreviewContainer.classList.add("tn-static-display-block-2a1b75c9"),i.forEach(s=>{let a=this.nlPreviewContainer.createDiv("nl-preview-item");a.textContent=s.text})):this.clearNaturalLanguagePreview()}clearNaturalLanguagePreview(){this.nlPreviewContainer&&(this.nlPreviewContainer.empty(),this.nlPreviewContainer.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.nlPreviewContainer.classList.add("tn-static-display-none-6b99de8b"))}getNLPInputValue(){return this.nlMarkdownEditor?this.nlMarkdownEditor.value:this.nlInput?this.nlInput.value:""}createActionBar(t){if(this.actionBar=t.createDiv("action-bar"),this.plugin.settings.enableNaturalLanguageInput){this.createActionIcon(this.actionBar,"wand",this.t("modals.taskCreation.actions.fillFromNaturalLanguage"),(i,s)=>{let a=this.getNLPInputValue().trim();a&&this.parseAndFillForm(a)}),this.createActionIcon(this.actionBar,this.isExpanded?"chevron-up":"chevron-down",this.isExpanded?this.t("modals.taskCreation.actions.hideDetailedOptions"):this.t("modals.taskCreation.actions.showDetailedOptions"),(i,s)=>{this.toggleDetailedForm();let a=i.querySelector(".icon");a&&(0,to.setIcon)(a,this.isExpanded?"chevron-up":"chevron-down"),(0,to.setTooltip)(i,this.isExpanded?this.t("modals.taskCreation.actions.hideDetailedOptions"):this.t("modals.taskCreation.actions.showDetailedOptions"),{placement:"top"})});let n=this.actionBar.createDiv("action-separator");n.classList.remove("tn-static-width-100-0466783d","tn-static-width-12px-fbf353fb","tn-static-width-16px-7375d50b","tn-static-width-200px-2acaf3b5","tn-static-width-60px-bd09c419","tn-static-width-80px-8573bae3"),n.classList.add("tn-static-width-1px-aa77e27e"),n.classList.remove("tn-static-display-flex-4d51fc62","tn-static-height-0-7a31cef0","tn-static-height-100-62264068","tn-static-height-12px-06c0747e","tn-static-height-16px-30de4aee","tn-static-min-height-800px-997b4c8c"),n.classList.add("tn-static-height-24px-29a11d37"),n.classList.remove("tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-color-red-134bc721","tn-static-background-color-var-text-accent-a954c70f"),n.classList.add("tn-static-background-color-var-background-mo-94b219f0"),n.classList.remove("tn-static-margin-0-11696618","tn-static-margin-0-auto-266e9b04","tn-static-margin-0-db0d5f36","tn-static-margin-2px-0-edce9b14","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),n.classList.add("tn-static-margin-0-var-size-4-2-77f7dc08")}this.createActionIcon(this.actionBar,"calendar",this.t("modals.task.actions.due"),(n,i)=>{this.showDateContextMenu(i,"due")},"due-date"),this.createActionIcon(this.actionBar,"calendar-clock",this.t("modals.task.actions.scheduled"),(n,i)=>{this.showDateContextMenu(i,"scheduled")},"scheduled-date"),this.createActionIcon(this.actionBar,"dot-square",this.t("modals.task.actions.status"),(n,i)=>{this.showStatusContextMenu(i)},"status"),this.createActionIcon(this.actionBar,"star",this.t("modals.task.actions.priority"),(n,i)=>{this.showPriorityContextMenu(i)},"priority"),this.createActionIcon(this.actionBar,"refresh-ccw",this.t("modals.task.actions.recurrence"),(n,i)=>{this.showRecurrenceContextMenu(i)},"recurrence"),this.createActionIcon(this.actionBar,"bell",this.t("modals.task.actions.reminders"),(n,i)=>{this.showReminderContextMenu(i)},"reminders"),this.updateIconStates()}parseAndFillForm(t){let n=this.nlParser.parseInput(t);this.applyParsedData(n),this.isExpanded||this.expandModal()}applyParsedData(t){var n;if(t.title&&(this.title=t.title),t.status&&(this.status=t.status),t.priority&&(this.priority=t.priority),t.dueDate&&(this.dueDate=t.dueTime?ts(t.dueDate,t.dueTime):t.dueDate),t.scheduledDate&&(this.scheduledDate=t.scheduledTime?ts(t.scheduledDate,t.scheduledTime):t.scheduledDate),t.contexts&&t.contexts.length>0&&(this.contexts=t.contexts.join(", ")),t.tags&&t.tags.length>0&&(this.tags=Ai(t.tags.join(", "))),t.details&&(this.details=t.details),t.recurrence&&(this.recurrenceRule=t.recurrence),t.estimate!==void 0&&(this.timeEstimate=t.estimate>0?t.estimate:0,this.timeEstimateInput&&(this.timeEstimateInput.value=this.timeEstimate>0?this.timeEstimate.toString():"")),this.titleInput&&(this.titleInput.value=this.title),this.detailsInput&&(this.detailsInput.value=this.details),this.detailsMarkdownEditor&&this.detailsMarkdownEditor.setValue(this.details),this.contextsInput&&(this.contextsInput.value=this.contexts),this.tagsInput&&(this.tagsInput.value=this.tags),t.projects&&t.projects.length>0&&(this.addProjectsFromStrings(t.projects),this.renderProjectsList()),t.userFields){console.debug("[TaskCreationModal] applyParsedData - parsed.userFields:",t.userFields),console.debug("[TaskCreationModal] applyParsedData - available user field definitions:",this.plugin.settings.userFields);for(let[i,s]of Object.entries(t.userFields)){let a=(n=this.plugin.settings.userFields)==null?void 0:n.find(o=>o.id===i);console.debug(`[TaskCreationModal] Looking for field ${i}, found:`,a),a?(Array.isArray(s)?this.userFields[a.key]=s.join(", "):this.userFields[a.key]=s,console.debug(`[TaskCreationModal] Applied user field ${a.displayName} (key: ${a.key}): ${ie(s)}`),console.debug("[TaskCreationModal] Current this.userFields:",this.userFields)):console.warn(`[TaskCreationModal] No user field definition found for field ID: ${i}`)}}else console.debug("[TaskCreationModal] applyParsedData - NO parsed.userFields");this.updateIconStates()}toggleDetailedForm(){this.isExpanded?(this.isExpanded=!1,this.detailsContainer.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.detailsContainer.classList.add("tn-static-display-none-6b99de8b"),this.containerEl.removeClass("expanded")):this.expandModal()}async initializeFormData(){this.priority=this.plugin.settings.defaultTaskPriority,this.status=this.plugin.settings.defaultTaskStatus;let t=this.plugin.settings.taskCreationDefaults;if(this.dueDate=qo(t.defaultDueDate),this.scheduledDate=qo(t.defaultScheduledDate),this.contexts=t.defaultContexts||"",this.tags=t.defaultTags||"",t.defaultProjects){let n=sa(t.defaultProjects);n.length>0&&this.initializeProjectsFromStrings(n)}if(t.defaultTimeEstimate&&t.defaultTimeEstimate>0&&(this.timeEstimate=t.defaultTimeEstimate),t.defaultReminders&&t.defaultReminders.length>0){let{convertDefaultRemindersToReminders:n}=await Promise.resolve().then(()=>(lP(),oP));this.reminders=n(t.defaultReminders)}if(this.plugin.settings.userFields){for(let n of this.plugin.settings.userFields)if(n.defaultValue!==void 0)if(n.type==="date"&&typeof n.defaultValue=="string"){let i=n.defaultValue,s=qo(i);s&&(this.userFields[n.key]=s)}else this.userFields[n.key]=n.defaultValue}this.options.prePopulatedValues&&this.applyPrePopulatedValues(this.options.prePopulatedValues),this.details=this.normalizeDetails(this.details),this.originalDetails=this.details}applyPrePopulatedValues(t){t.title!==void 0&&(this.title=t.title),t.due!==void 0&&(this.dueDate=t.due),t.scheduled!==void 0&&(this.scheduledDate=t.scheduled),t.priority!==void 0&&(this.priority=t.priority),t.status!==void 0&&(this.status=t.status),t.contexts!==void 0&&(this.contexts=t.contexts.join(", ")),t.projects!==void 0&&(t.projects.filter(i=>i&&typeof i=="string"&&i.trim()!=="").length>0&&this.initializeProjectsFromStrings(t.projects),this.renderProjectsList()),t.tags!==void 0&&(this.tags=Ai(t.tags.filter(n=>n!==this.plugin.settings.taskTag).join(", "))),t.timeEstimate!==void 0&&(this.timeEstimate=t.timeEstimate),t.recurrence!==void 0&&typeof t.recurrence=="string"&&(this.recurrenceRule=t.recurrence),t.recurrence_anchor!==void 0&&(this.recurrenceAnchor=t.recurrence_anchor)}async handleSave(){if(this.plugin.settings.enableNaturalLanguageInput){let t=this.getNLPInputValue().trim();if(t&&!this.title.trim()){let n=this.nlParser.parseInput(t);this.applyParsedData(n)}}if(!this.validateForm()){new to.Notice(this.t("modals.taskCreation.notices.titleRequired"));return}try{let t=this.buildTaskData(),n=await this.plugin.taskService.createTask(t,{applyDefaults:!1}),i=n.taskInfo,s=n.taskInfo.title.replace(/[<>:"/\\|?*]/g,"").trim(),a=n.file.basename;if(a.startsWith("task-")&&a!==s?new to.Notice(this.t("modals.taskCreation.notices.successShortened",{title:i.title})):new to.Notice(this.t("modals.taskCreation.notices.success",{title:i.title})),this.blockingItems.length>0){let o=cde(this.blockingItems);if(o.added.length>0){await this.plugin.taskService.updateBlockingRelationships(i,o.added,[],o.raw);let l=await this.plugin.cacheManager.getTaskInfo(i.path);l&&(i=l)}o.unresolved.length>0&&new to.Notice(this.t("modals.taskCreation.notices.blockingUnresolved",{entries:o.unresolved.join(", ")})),this.blockingItems=[]}this.selectedSubtaskFiles.length>0&&await this.applySubtaskAssignments(i),this.options.onTaskCreated&&this.options.onTaskCreated(i),this.close()}catch(t){console.error("Failed to create task:",t);let n=t instanceof Error&&t.message?t.message:String(t);new to.Notice(this.t("modals.taskCreation.notices.failure",{message:n}))}}buildTaskData(){return lde({title:this.title,dueDate:this.dueDate,scheduledDate:this.scheduledDate,priority:this.priority,status:this.status,contexts:this.contexts,projects:this.projects,tags:this.tags,timeEstimate:this.timeEstimate,recurrenceRule:this.recurrenceRule,recurrenceAnchor:this.recurrenceAnchor,reminders:this.reminders,blockedByItems:this.blockedByItems,details:this.details,userFields:this.userFields,creationContext:this.options.creationContext,taskIdentificationMethod:this.plugin.settings.taskIdentificationMethod,taskTag:this.plugin.settings.taskTag,normalizeDetails:t=>this.normalizeDetails(t)})}createTitleInput(t){this.plugin.settings.enableNaturalLanguageInput||super.createTitleInput(t)}async applySubtaskAssignments(t){let n=this.app.vault.getAbstractFileByPath(t.path);if(n instanceof to.TFile)for(let i of this.selectedSubtaskFiles)try{let s=await this.plugin.cacheManager.getTaskInfo(i.path);if(!s)continue;let a=this.buildProjectReference(n,i.path),o=`[[${n.basename}]]`,l=Array.isArray(s.projects)?s.projects:[];if(l.includes(a)||l.includes(o))continue;let d=[...l.filter(u=>u!==o),a];await this.plugin.updateTaskProperty(s,"projects",d)}catch(s){console.error("Failed to assign subtask:",s)}}onClose(){this.nlMarkdownEditor&&(this.nlMarkdownEditor.destroy(),this.nlMarkdownEditor=null),this.nlpSuggest&&(this.nlpSuggest.close(),this.nlpSuggest=null),this.removeAllEventListeners(),super.onClose()}}});var cy,mP,H$=v(()=>{cy=class{constructor(){this.inFlightRequests=new Map;this.prefetchQueue=new Set;this.prefetchPromises=new Map;this.activeTimeouts=new Set}async execute(e,t,n=5e3){if(this.inFlightRequests.has(e))return this.inFlightRequests.get(e);let i=this.createRequest(e,t,n);return this.inFlightRequests.set(e,i),i}async createRequest(e,t,n){try{let i=await t(),s=window.setTimeout(()=>{this.inFlightRequests.delete(e),this.activeTimeouts.delete(s)},n);return this.activeTimeouts.add(s),i}catch(i){throw this.inFlightRequests.delete(e),i}}prefetch(e,t,n="low"){if(!(this.inFlightRequests.has(e)||this.prefetchPromises.has(e)))if(n==="high")this.executePrefetch(e,t);else if(this.prefetchQueue.add(e),"requestIdleCallback"in window)requestIdleCallback(()=>{this.processPrefetchQueue(e,t)});else{let s=window.setTimeout(()=>{this.processPrefetchQueue(e,t),this.activeTimeouts.delete(s)},50);this.activeTimeouts.add(s)}}async executePrefetch(e,t){try{let n=t();this.prefetchPromises.set(e,n),await n;let i=window.setTimeout(()=>{this.prefetchPromises.delete(e),this.activeTimeouts.delete(i)},3e4);this.activeTimeouts.add(i)}catch(n){this.prefetchPromises.delete(e)}}processPrefetchQueue(e,t){this.prefetchQueue.has(e)&&(this.prefetchQueue.delete(e),this.executePrefetch(e,t))}getPrefetchedData(e){return this.prefetchPromises.get(e)||null}cancel(e){this.inFlightRequests.delete(e),this.prefetchPromises.delete(e),this.prefetchQueue.delete(e)}cancelAll(){this.inFlightRequests.clear(),this.prefetchPromises.clear(),this.prefetchQueue.clear();for(let e of this.activeTimeouts)window.clearTimeout(e);this.activeTimeouts.clear()}getStats(){return{inFlightCount:this.inFlightRequests.size,prefetchCount:this.prefetchPromises.size,queuedCount:this.prefetchQueue.size}}},mP=class{constructor(e){this.lastAccessTime=new Map;this.deduplicator=e}recordAccess(e,t,n){let i=this.getDateKey(e);this.lastAccessTime.set(i,Date.now()),this.prefetchAdjacentDates(e,t,n)}prefetchAdjacentDates(e,t,n){this.getAdjacentDates(e).forEach(({date:s,priority:a})=>{let o=`${t}-${this.getDateKey(s)}`;this.deduplicator.prefetch(o,()=>n(s),a)})}getAdjacentDates(e){let t=[],n=new Date(e);n.setDate(e.getDate()-1),t.push({date:n,priority:"high"});let i=new Date(e);i.setDate(e.getDate()+1),t.push({date:i,priority:"high"});for(let s=2;s<=7;s++){let a=new Date(e);a.setDate(e.getDate()-s),t.push({date:a,priority:"low"});let o=new Date(e);o.setDate(e.getDate()+s),t.push({date:o,priority:"low"})}return t}getDateKey(e){return e.toISOString().split("T")[0]}cleanup(){let e=Date.now(),t=1440*60*1e3;for(let[n,i]of this.lastAccessTime)e-i>t&&this.lastAccessTime.delete(n)}}});var dy,fP,Mde=v(()=>{dy=class{constructor(){this.updateQueue=[];this.isProcessing=!1;this.activeTimeouts=new Set}scheduleUpdate(e){this.updateQueue.push(e),this.isProcessing||(this.isProcessing=!0,window.requestAnimationFrame(()=>{this.processUpdates()}))}processUpdates(){let e=[...this.updateQueue];this.updateQueue=[];try{e.forEach(t=>{try{t()}catch(n){console.error("Error processing DOM update:",n)}})}finally{this.isProcessing=!1,this.updateQueue.length>0&&window.requestAnimationFrame(()=>{this.processUpdates()})}}updateAttributes(e,t){for(let[n,i]of Object.entries(t))i===null?e.removeAttribute(n):e.getAttribute(n)!==i&&e.setAttribute(n,i)}updateClasses(e,t){for(let[n,i]of Object.entries(t))i?e.classList.add(n):e.classList.remove(n)}updateTextContent(e,t){e.textContent!==t&&(e.textContent=t)}updateStyles(e,t){for(let[n,i]of Object.entries(t))i===null?e.style.removeProperty(n):e.style.setProperty(n,i)}preserveState(e){let t={scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,focused:activeDocument.activeElement===e,selection:null};return(e.instanceOf(HTMLInputElement)||e.instanceOf(HTMLTextAreaElement))&&(t.selection={start:e.selectionStart||0,end:e.selectionEnd||0}),t}restoreState(e,t){e.scrollTop=t.scrollTop,e.scrollLeft=t.scrollLeft,t.focused&&e.focus(),t.selection&&(e.instanceOf(HTMLInputElement)||e.instanceOf(HTMLTextAreaElement))&&e.setSelectionRange(t.selection.start,t.selection.end)}animateUpdate(e,t,n=1500){e.classList.add(`task-${t}`);let i=window.setTimeout(()=>{e.classList.remove(`task-${t}`),this.activeTimeouts.delete(i)},n);this.activeTimeouts.add(i)}updateList(e,t,n,i,s){let a=new Map,o=new Set;Array.from(e.children).forEach(d=>{let u=d.dataset.key;u&&(a.set(u,d),o.add(u))});let l=new Set(t.map(n)),c=activeDocument.createDocumentFragment();t.forEach(d=>{let u=n(d),p=a.get(u);if(p)s&&s(p,d),c.appendChild(p);else{let m=i(d);m.dataset.key=u,c.appendChild(m)}}),o.forEach(d=>{if(!l.has(d)){let u=a.get(d);u&&u.parentNode&&u.remove()}}),e.replaceChildren(c)}createOptimisticUpdate(e,t,n){return t(e),{commit:()=>{},revert:()=>{n(e)}}}destroy(){this.updateQueue=[],this.isProcessing=!1;for(let e of this.activeTimeouts)window.clearTimeout(e);this.activeTimeouts.clear()}},fP=class{constructor(){this.stateMap=new Map}saveState(e,t){let n=new dy;this.stateMap.set(e,n.preserveState(t))}restoreState(e,t){let n=this.stateMap.get(e);n&&new dy().restoreState(t,n)}clearState(e){e?this.stateMap.delete(e):this.stateMap.clear()}destroy(){this.stateMap.clear()}}});var uy,U$=v(()=>{uy=class r{constructor(e,t="open"){this.statuses=e;this.defaultStatus=t}normalizeStatusValue(e){return typeof e=="boolean"?e?"true":"false":String(e)}getNextStatus(e){var s;let t=this.getStatusesByOrder(),n=t.findIndex(a=>a.value===e);if(n===-1)return((s=t[0])==null?void 0:s.value)||this.defaultStatus;let i=(n+1)%t.length;return t[i].value}getPreviousStatus(e){var s;let t=this.getStatusesByOrder(),n=t.findIndex(a=>a.value===e);if(n===-1)return((s=t[t.length-1])==null?void 0:s.value)||this.defaultStatus;let i=(n-1+t.length)%t.length;return t[i].value}getStatusConfig(e){let t=this.normalizeStatusValue(e);return this.statuses.find(n=>this.normalizeStatusValue(n.value)===t)}getCompletedStatuses(){return this.statuses.filter(e=>e.isCompleted).map(e=>e.value)}getOpenStatuses(){return this.statuses.filter(e=>!e.isCompleted).map(e=>e.value)}getStatusesByOrder(){return[...this.statuses].sort((e,t)=>e.order-t.order)}isCompletedStatus(e){let t=this.getStatusConfig(e);return(t==null?void 0:t.isCompleted)||!1}getStatusOrder(e){let t=this.getStatusConfig(e);return(t==null?void 0:t.order)||0}getStatusStyles(){let e=[];for(let t of this.statuses){let n=`--status-${t.value.replace(/[^a-zA-Z0-9-]/g,"-")}-color`;e.push(`${n}: ${t.color};`)}return`:root { ${e.join(" ")} }`}getAllStatuses(){return[...this.statuses]}getNonCompletionStatuses(){return this.statuses.filter(e=>!e.isCompleted)}updateStatuses(e){this.statuses=e}static validateStatuses(e){let t=[];e.length<2&&t.push("At least 2 statuses are required"),e.some(l=>l.isCompleted)||t.push("At least one status must be marked as completed");let i=e.map(l=>l.value),s=new Set(i);i.length!==s.size&&t.push("Status values must be unique");let a=e.map(l=>l.id),o=new Set(a);a.length!==o.size&&t.push("Status IDs must be unique");for(let l of e){if(!l.value||l.value.trim()===""){t.push("Status values cannot be empty");break}if(!l.label||l.label.trim()===""){t.push("Status labels cannot be empty");break}if(!l.color||!l.color.match(/^#[0-9a-fA-F]{6}$/)){t.push("Status colors must be valid hex colors (#rrggbb)");break}}return{valid:t.length===0,errors:t}}static generateStatusId(e){let t=new Set(e.map(s=>s.id)),n=1,i=`status-${n}`;for(;t.has(i);)n++,i=`status-${n}`;return i}static createDefaultStatus(e){let t=r.generateStatusId(e),n=Math.max(...e.map(i=>i.order),0)+1;return{id:t,value:"new-status",label:"New status",color:"#808080",isCompleted:!1,order:n,autoArchive:!1,autoArchiveDelay:5}}}});var hP,Ade=v(()=>{hP=class r{constructor(e){this.priorities=e}getPriorityConfig(e){return this.priorities.find(t=>t.value===e)}getPrioritiesByWeight(){return[...this.priorities].sort((e,t)=>t.weight-e.weight)}getPrioritiesByWeightAsc(){return[...this.priorities].sort((e,t)=>e.weight-t.weight)}getNextPriority(e){var s;let t=this.getPrioritiesByWeightAsc(),n=t.findIndex(a=>a.value===e);if(n===-1)return((s=t[0])==null?void 0:s.value)||"normal";let i=(n+1)%t.length;return t[i].value}comparePriorities(e,t){let n=this.getPriorityConfig(e),i=this.getPriorityConfig(t),s=(n==null?void 0:n.weight)||0;return((i==null?void 0:i.weight)||0)-s}getPriorityStyles(){let e=[];for(let t of this.priorities){let n=`--priority-${t.value.replace(/[^a-zA-Z0-9-]/g,"-")}-color`;e.push(`${n}: ${t.color};`)}return`:root { ${e.join(" ")} }`}getAllPriorities(){return[...this.priorities]}updatePriorities(e){this.priorities=e}getHighestPriority(){var t;return(t=this.getPrioritiesByWeight()[0])==null?void 0:t.value}getLowestPriority(){var t;return(t=this.getPrioritiesByWeightAsc()[0])==null?void 0:t.value}getPriorityWeight(e){let t=this.getPriorityConfig(e);return(t==null?void 0:t.weight)||0}isHigherPriority(e,t){return this.comparePriorities(e,t)>0}static validatePriorities(e){let t=[];e.length<1&&t.push("At least 1 priority is required");let n=e.map(c=>c.value),i=new Set(n);n.length!==i.size&&t.push("Priority values must be unique");let s=e.map(c=>c.id),a=new Set(s);s.length!==a.size&&t.push("Priority IDs must be unique");let o=e.map(c=>c.weight),l=new Set(o);o.length!==l.size&&t.push("Priority weights must be unique");for(let c of e){if(!c.value||c.value.trim()===""){t.push("Priority values cannot be empty");break}if(!c.label||c.label.trim()===""){t.push("Priority labels cannot be empty");break}if(!c.color||!c.color.match(/^#[0-9a-fA-F]{6}$/)){t.push("Priority colors must be valid hex colors (#rrggbb)");break}if(typeof c.weight!="number"||c.weight<0){t.push("Priority weights must be non-negative numbers");break}}return{valid:t.length===0,errors:t}}static generatePriorityId(e){let t=new Set(e.map(s=>s.id)),n=1,i=`priority-${n}`;for(;t.has(i);)n++,i=`priority-${n}`;return i}static generatePriorityWeight(e){let t=e.map(n=>n.weight);return t.length===0?1:Math.max(...t)+1}static createDefaultPriority(e){let t=r.generatePriorityId(e),n=r.generatePriorityWeight(e);return{id:t,value:"new-priority",label:"New priority",color:"#808080",weight:n}}}});var Yo,gP,Ide=v(()=>{Yo=require("obsidian");Om();Qe();Cr();gP=class extends Yo.Events{constructor(t,n,i){super();this.initialized=!1;this.eventListeners=[];this.debouncedHandlers=new Map;this.DEBOUNCE_DELAY=300;this.app=t,this.settings=n,this.taskTag=n.taskTag,this.excludedFolders=n.excludedFolders?n.excludedFolders.split(",").map(s=>s.trim()).filter(s=>s.length>0):[],this.fieldMapper=i,this.disableNoteIndexing=n.disableNoteIndexing,this.storeTitleInFilename=n.storeTitleInFilename}initialize(){this.initialized||(this.setupNativeEventListeners(),this.initialized=!0,this.trigger("cache-initialized",{message:"Task manager ready"}))}getApp(){return this.app}isTaskFile(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let n=t;if(this.settings.taskIdentificationMethod==="property"){let i=this.settings.taskPropertyName,s=this.settings.taskPropertyValue;if(!i||!s)return!1;let a=n[i];return a===void 0?!1:Array.isArray(a)?a.some(o=>this.comparePropertyValues(o,s)):this.comparePropertyValues(a,s)}else return Array.isArray(n.tags)?n.tags.some(i=>{if(typeof i!="string")return!1;let s=i.startsWith("#")?i.slice(1):i;return vr.matchesHierarchicalTagExact(s,this.taskTag)}):!1}comparePropertyValues(t,n){if(typeof t=="boolean"&&typeof n=="string"){let i=n.toLowerCase();if(i==="true"||i==="false")return t===(i==="true")}return t===n}setupNativeEventListeners(){let t=this.app.metadataCache.on("changed",(s,a,o)=>{s instanceof Yo.TFile&&s.extension==="md"&&this.isValidFile(s.path)&&this.handleFileChangedDebounced(s,o)});this.eventListeners.push(t);let n=this.app.metadataCache.on("deleted",(s,a)=>{s instanceof Yo.TFile&&s.extension==="md"&&this.handleFileDeleted(s.path,a)});this.eventListeners.push(n);let i=this.app.vault.on("rename",(s,a)=>{s instanceof Yo.TFile&&s.extension==="md"&&this.handleFileRenamed(s,a)});this.eventListeners.push(i)}handleFileChangedDebounced(t,n){let i=t.path,s=this.debouncedHandlers.get(i);s&&window.clearTimeout(s);let a=window.setTimeout(()=>{this.debouncedHandlers.delete(i),this.handleFileChanged(t,n)},this.DEBOUNCE_DELAY);this.debouncedHandlers.set(i,a)}async handleFileChanged(t,n){this.trigger("file-updated",{path:t.path,file:t}),this.trigger("data-changed")}handleFileDeleted(t,n){let i=this.debouncedHandlers.get(t);i&&(window.clearTimeout(i),this.debouncedHandlers.delete(t)),this.trigger("file-deleted",{path:t,prevCache:n}),this.trigger("data-changed")}handleFileRenamed(t,n){let i=this.debouncedHandlers.get(n);i&&(window.clearTimeout(i),this.debouncedHandlers.delete(n)),this.trigger("file-renamed",{oldPath:n,newPath:t.path,file:t}),this.trigger("data-changed")}isValidFile(t){return!this.excludedFolders.some(n=>t.startsWith(n))}async getTaskInfo(t){let n=this.app.vault.getAbstractFileByPath(t);if(!(n instanceof Yo.TFile))return null;let i=this.app.metadataCache.getFileCache(n);return!(i!=null&&i.frontmatter)||!this.isTaskFile(i.frontmatter)?null:this.extractTaskInfoFromNative(t,i.frontmatter)}extractTaskInfoFromNative(t,n){if(!n||!this.fieldMapper||!this.isTaskFile(n))return null;try{let i=this.fieldMapper.mapFromFrontmatter(n,t,this.storeTitleInFilename),s=i.timeEntries?is(i.timeEntries):0,a=!1,o=[];this._dependencyCache?(a=this._dependencyCache.isTaskBlocked(t),o=this._dependencyCache.getBlockedTaskPaths(t)):a=Array.isArray(i.blockedBy)&&i.blockedBy.length>0;let l=o.length>0;return{...i,id:t,path:t,title:i.title||"Untitled task",status:i.status||this.settings.defaultTaskStatus,priority:i.priority||"normal",archived:i.archived||!1,tags:Array.isArray(i.tags)?i.tags:[],contexts:Array.isArray(i.contexts)?i.contexts:[],projects:Array.isArray(i.projects)?i.projects:[],totalTrackedTime:s,isBlocked:a,isBlocking:l,blocking:o.length>0?o:void 0}}catch(i){return console.error(`Error extracting task info from native metadata for ${t}:`,i),null}}async getAllTasks(){let t=[],n=this.app.vault.getMarkdownFiles();for(let i of n){if(!this.isValidFile(i.path))continue;let s=await this.getTaskInfo(i.path);s&&t.push(s)}return t}getAllTaskPaths(){let t=new Set,n=this.app.vault.getMarkdownFiles();for(let i of n){if(!this.isValidFile(i.path))continue;let s=this.app.metadataCache.getFileCache(i);s!=null&&s.frontmatter&&this.isTaskFile(s.frontmatter)&&t.add(i.path)}return t}getTasksForDate(t){var l,c;let n=[],i=this.app.vault.getMarkdownFiles(),s=tt(t),a=((l=this.fieldMapper)==null?void 0:l.toUserField("scheduled"))||"scheduled",o=((c=this.fieldMapper)==null?void 0:c.toUserField("due"))||"due";for(let d of i){if(!this.isValidFile(d.path))continue;let u=this.app.metadataCache.getFileCache(d);if(!(u!=null&&u.frontmatter)||!this.isTaskFile(u.frontmatter))continue;let p=u.frontmatter[a],m=u.frontmatter[o],f=typeof p=="string"&&p.length>0?tt(p):void 0,h=typeof m=="string"&&m.length>0?tt(m):void 0;(f===s||h===s)&&n.push(d.path)}return n}getTaskPathsByStatus(t){var a;let n=[],i=this.app.vault.getMarkdownFiles(),s=((a=this.fieldMapper)==null?void 0:a.toUserField("status"))||"status";for(let o of i){if(!this.isValidFile(o.path))continue;let l=this.app.metadataCache.getFileCache(o);!(l!=null&&l.frontmatter)||!this.isTaskFile(l.frontmatter)||l.frontmatter[s]===t&&n.push(o.path)}return n}getTaskPathsByPriority(t){var a;let n=[],i=this.app.vault.getMarkdownFiles(),s=((a=this.fieldMapper)==null?void 0:a.toUserField("priority"))||"priority";for(let o of i){if(!this.isValidFile(o.path))continue;let l=this.app.metadataCache.getFileCache(o);!(l!=null&&l.frontmatter)||!this.isTaskFile(l.frontmatter)||l.frontmatter[s]===t&&n.push(o.path)}return n}getOverdueTaskPaths(){var o,l,c;let t=new Set,n=this.app.vault.getMarkdownFiles(),i=cn(),s=((o=this.fieldMapper)==null?void 0:o.toUserField("due"))||"due",a=((l=this.fieldMapper)==null?void 0:l.toUserField("status"))||"status";for(let d of n){if(!this.isValidFile(d.path))continue;let u=this.app.metadataCache.getFileCache(d);if(!(u!=null&&u.frontmatter)||!this.isTaskFile(u.frontmatter))continue;let p=u.frontmatter[s],m=u.frontmatter[a],f=((c=this.settings.customStatuses)==null?void 0:c.some(h=>h.value===m&&h.isCompleted))||!1;p&&!f&&Yc(p,i)&&t.add(d.path)}return t}getAllStatuses(){var s;let t=new Set,n=this.app.vault.getMarkdownFiles(),i=((s=this.fieldMapper)==null?void 0:s.toUserField("status"))||"status";for(let a of n){if(!this.isValidFile(a.path))continue;let o=this.app.metadataCache.getFileCache(a);if(!(o!=null&&o.frontmatter)||!this.isTaskFile(o.frontmatter))continue;let l=o.frontmatter[i];l&&t.add(l)}return Array.from(t).sort()}getAllPriorities(){var s;let t=new Set,n=this.app.vault.getMarkdownFiles(),i=((s=this.fieldMapper)==null?void 0:s.toUserField("priority"))||"priority";for(let a of n){if(!this.isValidFile(a.path))continue;let o=this.app.metadataCache.getFileCache(a);if(!(o!=null&&o.frontmatter)||!this.isTaskFile(o.frontmatter))continue;let l=o.frontmatter[i];l&&t.add(l)}return Array.from(t).sort()}getAllTags(){let t=new Set,n=this.app.vault.getMarkdownFiles();for(let i of n){if(!this.isValidFile(i.path))continue;let s=this.app.metadataCache.getFileCache(i);if(!(s!=null&&s.frontmatter)||!this.isTaskFile(s.frontmatter))continue;let a=s.frontmatter.tags;Array.isArray(a)&&a.forEach(o=>{typeof o=="string"&&t.add(o)})}return Array.from(t).sort()}getAllContexts(){var s;let t=new Set,n=this.app.vault.getMarkdownFiles(),i=((s=this.fieldMapper)==null?void 0:s.toUserField("contexts"))||"context";for(let a of n){if(!this.isValidFile(a.path))continue;let o=this.app.metadataCache.getFileCache(a);if(!(o!=null&&o.frontmatter)||!this.isTaskFile(o.frontmatter))continue;let l=o.frontmatter[i];Array.isArray(l)?l.forEach(c=>{typeof c=="string"&&t.add(c)}):l&&t.add(l)}return Array.from(t).sort()}getAllProjects(){var s;let t=new Set,n=this.app.vault.getMarkdownFiles(),i=((s=this.fieldMapper)==null?void 0:s.toUserField("projects"))||"project";for(let a of n){if(!this.isValidFile(a.path))continue;let o=this.app.metadataCache.getFileCache(a);if(!(o!=null&&o.frontmatter)||!this.isTaskFile(o.frontmatter))continue;let l=o.frontmatter[i];Array.isArray(l)?l.forEach(c=>{typeof c=="string"&&t.add(c)}):l&&t.add(l)}return Array.from(t).sort()}getAllTimeEstimates(){var s;let t=new Map,n=this.app.vault.getMarkdownFiles(),i=((s=this.fieldMapper)==null?void 0:s.toUserField("timeEstimate"))||"timeEstimate";for(let a of n){if(!this.isValidFile(a.path))continue;let o=this.app.metadataCache.getFileCache(a);if(!(o!=null&&o.frontmatter)||!this.isTaskFile(o.frontmatter))continue;let l=o.frontmatter[i];typeof l=="number"&&l>0&&t.set(a.path,l)}return t}async getNotesForDate(t){if(this.disableNoteIndexing)return[];let n=[],i=ue(t),s=this.app.vault.getMarkdownFiles();for(let a of s){if(!this.isValidFile(a.path))continue;let o=this.app.metadataCache.getFileCache(a);if(!(o!=null&&o.frontmatter)||this.isTaskFile(o.frontmatter))continue;(o.frontmatter.date||o.frontmatter.scheduled)===i&&n.push({path:a.path,title:this.storeTitleInFilename?a.basename:o.frontmatter.title||a.basename,tags:o.frontmatter.tags||[]})}return n}async getTaskByPath(t){return this.getTaskInfo(t)}async getCachedTaskInfo(t){return this.getTaskInfo(t)}getCachedTaskInfoSync(t){let n=this.app.vault.getAbstractFileByPath(t);if(!(n instanceof Yo.TFile))return null;let i=this.app.metadataCache.getFileCache(n);return!(i!=null&&i.frontmatter)||!this.isTaskFile(i.frontmatter)?null:this.extractTaskInfoFromNative(t,i.frontmatter)}isInitialized(){return this.initialized}destroy(){this.debouncedHandlers.forEach(t=>{window.clearTimeout(t)}),this.debouncedHandlers.clear(),this.eventListeners.forEach(t=>{this.app.metadataCache.offref(t)}),this.eventListeners=[],this.initialized=!1}setDependencyCache(t){this._dependencyCache=t}getBlockingTaskPaths(t){return this._dependencyCache?this._dependencyCache.getBlockingTaskPaths(t):(console.warn("DependencyCache not set in TaskManager"),[])}getBlockedTaskPaths(t){return this._dependencyCache?this._dependencyCache.getBlockedTaskPaths(t):(console.warn("DependencyCache not set in TaskManager"),[])}isTaskBlocked(t){return this._dependencyCache?this._dependencyCache.isTaskBlocked(t):!1}getTasksReferencingProject(t){return this._dependencyCache?this._dependencyCache.getTasksReferencingProject(t):(console.warn("DependencyCache not set in TaskManager"),[])}isFileUsedAsProject(t){return this._dependencyCache?this._dependencyCache.isFileUsedAsProject(t):!1}async waitForFreshTaskData(t,n=10){let i=t instanceof Yo.TFile?t.path:t,s=t instanceof Yo.TFile?t:this.app.vault.getAbstractFileByPath(i);if(!(s instanceof Yo.TFile)){await new Promise(a=>window.setTimeout(a,100));return}for(let a=0;awindow.setTimeout(l,50*(a+1)))}console.warn(`TaskManager: Metadata cache not ready for ${i} after ${n} retries`)}updateConfig(t){this.settings=t,this.taskTag=t.taskTag,this.excludedFolders=t.excludedFolders?t.excludedFolders.split(",").map(n=>n.trim()).filter(n=>n.length>0):[],this.disableNoteIndexing=t.disableNoteIndexing,this.storeTitleInFilename=t.storeTitleInFilename,this.trigger("data-changed")}subscribe(t,n){return this.on(t,n),()=>{this.off(t,n)}}async getCalendarData(t,n){let i=await this.getAllTasks(),s={};for(let a of i)a.scheduled&&(s[a.scheduled]||(s[a.scheduled]=[]),s[a.scheduled].push(a)),a.due&&(s[a.due]||(s[a.due]=[]),s[a.due].includes(a)||s[a.due].push(a));return s}async getTaskInfoForDate(t){let n=ue(t),i=this.getTasksForDate(n),s=[];for(let a of i){let o=await this.getTaskInfo(a);o&&s.push(o)}return s}getTaskPathsByDate(t){return new Set(this.getTasksForDate(t))}getAllProjectsWithDetails(){return[]}getAllProjectFiles(){return[]}async rebuildDailyNotesCache(t,n){}async clearAllCaches(){this.trigger("data-changed")}clearCacheEntry(t){}updateTaskInfoInCache(t,n){this.trigger("file-updated",{path:t})}}});var Bu,yP,Nde=v(()=>{Bu=require("obsidian");Zc();yP=class extends Bu.Events{constructor(t,n,i,s,a){super();this.dependencySources=new Map;this.dependencyTargets=new Map;this.projectReferences=new Map;this.initialized=!1;this.indexesBuilt=!1;this.eventListeners=[];this.app=t,this.settings=n,this.fieldMapper=i,this.statusManager=s,this.isTaskFileCallback=a}initialize(){this.initialized||(this.setupEventListeners(),this.initialized=!0)}async buildIndexes(){if(this.indexesBuilt)return;let t=this.app.vault.getMarkdownFiles();for(let n of t){let i=this.app.metadataCache.getFileCache(n);!(i!=null&&i.frontmatter)||!this.isTaskFileCallback(i.frontmatter)||this.indexTaskFile(n.path,i.frontmatter)}this.indexesBuilt=!0}setupEventListeners(){let t=this.app.metadataCache.on("changed",(s,a,o)=>{s instanceof Bu.TFile&&s.extension==="md"&&this.handleFileChanged(s,o)});this.eventListeners.push(t);let n=this.app.metadataCache.on("deleted",(s,a)=>{s instanceof Bu.TFile&&s.extension==="md"&&this.handleFileDeleted(s.path)});this.eventListeners.push(n);let i=this.app.vault.on("rename",(s,a)=>{s instanceof Bu.TFile&&s.extension==="md"&&this.handleFileRenamed(s,a)});this.eventListeners.push(i)}handleFileChanged(t,n){let i=this.app.metadataCache.getFileCache(t);if(!(i!=null&&i.frontmatter)){this.clearFileFromIndexes(t.path);return}if(!this.isTaskFileCallback(i.frontmatter)){this.clearFileFromIndexes(t.path);return}this.clearForwardDependencies(t.path),this.indexTaskFile(t.path,i.frontmatter)}handleFileDeleted(t){this.clearFileFromIndexes(t)}handleFileRenamed(t,n){let i=this.app.metadataCache.getFileCache(t);this.clearFileFromIndexes(n),i!=null&&i.frontmatter&&this.isTaskFileCallback(i.frontmatter)&&this.indexTaskFile(t.path,i.frontmatter)}resolveProjectReference(t,n){if(!n||typeof n!="string")return null;let i=n.trim();if(!i)return null;let s=Em(this.app,t,i);return(s==null?void 0:s.path)||null}indexTaskFile(t,n){var l,c;let i=((l=this.fieldMapper)==null?void 0:l.toUserField("blockedBy"))||"blockedBy",s=((c=this.fieldMapper)==null?void 0:c.toUserField("projects"))||"project",a=n[i];if(a){let d=yu(a);if(d){let u=new Set;for(let p of d){let m=Em(this.app,t,p);m!=null&&m.path&&(u.add(m.path),this.dependencyTargets.has(m.path)||this.dependencyTargets.set(m.path,new Set),this.dependencyTargets.get(m.path).add(t))}u.size>0&&this.dependencySources.set(t,u)}}let o=n[s];if(o){let d=Array.isArray(o)?o:[o];for(let u of d)if(typeof u=="string"){let p=this.resolveProjectReference(t,u);p&&(this.projectReferences.has(p)||this.projectReferences.set(p,new Set),this.projectReferences.get(p).add(t))}}}clearForwardDependencies(t){let n=this.dependencySources.get(t);if(n){for(let i of n){let s=this.dependencyTargets.get(i);s&&(s.delete(t),s.size===0&&this.dependencyTargets.delete(i))}this.dependencySources.delete(t)}for(let[i,s]of this.projectReferences.entries())s.delete(t),s.size===0&&this.projectReferences.delete(i)}clearFileFromIndexes(t){let n=this.dependencySources.get(t);if(n){for(let s of n){let a=this.dependencyTargets.get(s);a&&(a.delete(t),a.size===0&&this.dependencyTargets.delete(s))}this.dependencySources.delete(t)}let i=this.dependencyTargets.get(t);if(i){for(let s of i){let a=this.dependencySources.get(s);a&&(a.delete(t),a.size===0&&this.dependencySources.delete(s))}this.dependencyTargets.delete(t)}for(let[s,a]of this.projectReferences.entries())a.delete(t),a.size===0&&this.projectReferences.delete(s)}getBlockingTaskPaths(t){this.indexesBuilt||(console.warn("DependencyCache: getBlockingTaskPaths called before indexes built, building now..."),this.buildIndexesSync());let n=this.dependencySources.get(t);return n?Array.from(n):[]}getBlockedTaskPaths(t){if(this.indexesBuilt||(console.warn("DependencyCache: getBlockedTaskPaths called before indexes built, building now..."),this.buildIndexesSync()),this.isCompletedTask(t))return[];let n=this.dependencyTargets.get(t);return n?Array.from(n):[]}isTaskBlocked(t){var s;let n=this.getBlockingTaskPaths(t);if(n.length===0)return!1;let i=((s=this.fieldMapper)==null?void 0:s.toUserField("status"))||"status";for(let a of n){let o=this.app.vault.getAbstractFileByPath(a);if(!(o instanceof Bu.TFile))continue;let l=this.app.metadataCache.getFileCache(o);if(!(l!=null&&l.frontmatter))continue;let c=l.frontmatter[i];if(!c||!this.statusManager.isCompletedStatus(c))return!0}return!1}isCompletedTask(t){var o;let n=this.app.vault.getAbstractFileByPath(t);if(!(n instanceof Bu.TFile))return!1;let i=this.app.metadataCache.getFileCache(n);if(!(i!=null&&i.frontmatter))return!1;let s=((o=this.fieldMapper)==null?void 0:o.toUserField("status"))||"status",a=i.frontmatter[s];return!!(a&&this.statusManager.isCompletedStatus(a))}getTasksReferencingProject(t){this.indexesBuilt||(console.warn("DependencyCache: getTasksReferencingProject called before indexes built, building now..."),this.buildIndexesSync());let n=this.projectReferences.get(t);return n?Array.from(n):[]}isFileUsedAsProject(t){return this.indexesBuilt||(console.warn("DependencyCache: isFileUsedAsProject called before indexes built, building now..."),this.buildIndexesSync()),this.projectReferences.has(t)}buildIndexesSync(){if(this.indexesBuilt)return;let t=this.app.vault.getMarkdownFiles();for(let n of t){let i=this.app.metadataCache.getFileCache(n);!(i!=null&&i.frontmatter)||!this.isTaskFileCallback(i.frontmatter)||this.indexTaskFile(n.path,i.frontmatter)}this.indexesBuilt=!0}destroy(){this.eventListeners.forEach(t=>{this.app.metadataCache.offref(t)}),this.eventListeners=[],this.dependencySources.clear(),this.dependencyTargets.clear(),this.projectReferences.clear(),this.initialized=!1,this.indexesBuilt=!1}}});function sr(r){if(r&&typeof r=="object")switch(r[os]){case Go:case yd:return!0}return!1}function Rt(r){if(r&&typeof r=="object")switch(r[os]){case vP:case Go:case ba:case yd:return!0}return!1}var vP,bP,Go,V$,ba,yd,os,Ta,ro,no,Pt,ot,io,TP,Gt=v(()=>{vP=Symbol.for("yaml.alias"),bP=Symbol.for("yaml.document"),Go=Symbol.for("yaml.map"),V$=Symbol.for("yaml.pair"),ba=Symbol.for("yaml.scalar"),yd=Symbol.for("yaml.seq"),os=Symbol.for("yaml.node.type"),Ta=r=>!!r&&typeof r=="object"&&r[os]===vP,ro=r=>!!r&&typeof r=="object"&&r[os]===bP,no=r=>!!r&&typeof r=="object"&&r[os]===Go,Pt=r=>!!r&&typeof r=="object"&&r[os]===V$,ot=r=>!!r&&typeof r=="object"&&r[os]===ba,io=r=>!!r&&typeof r=="object"&&r[os]===yd;TP=r=>(ot(r)||sr(r))&&!!r.anchor});function Ko(r,e){let t=Ode(e);ro(r)?py(null,r.contents,t,Object.freeze([r]))===jl&&(r.contents=null):py(null,r,t,Object.freeze([]))}function py(r,e,t,n){let i=Lde(r,e,t,n);if(Rt(i)||Pt(i))return Fde(r,n,i),py(r,i,t,n);if(typeof i!="symbol"){if(sr(e)){n=Object.freeze(n.concat(e));for(let s=0;s{Gt();Ns=Symbol("break visit"),Rde=Symbol("skip children"),jl=Symbol("remove node");Ko.BREAK=Ns;Ko.SKIP=Rde;Ko.REMOVE=jl;Vw.BREAK=Ns;Vw.SKIP=Rde;Vw.REMOVE=jl});var cHe,dHe,zl,W$=v(()=>{Gt();Ww();cHe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dHe=r=>r.replace(/[!,[\]{}]/g,e=>cHe[e]),zl=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,a),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return t(String(a)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+dHe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Rt(e.contents)){let s={};Ko(e.contents,(a,o)=>{Rt(o)&&o.tag&&(s[o.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(o=>o.startsWith(a)))&&t.push(`%TAG ${s} ${a}`);return t.join(` `)}};zl.defaultYaml={explicit:!1,version:"1.2"};zl.defaultTags={"!!":"tag:yaml.org,2002:"}});function kP(r){if(/[\x00-\x19\s,[\]{}]/.test(r)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(r)}`;throw new Error(t)}return!0}function Y$(r){let e=new Set;return Ko(r,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function G$(r,e){for(let t=1;;++t){let n=`${r}${t}`;if(!e.has(n))return n}}function $de(r,e){let t=[],n=new Map,i=null;return{onAnchor:s=>{t.push(s),i!=null||(i=Y$(r));let a=G$(e,i);return i.add(a),a},setAnchors:()=>{for(let s of t){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(ot(a.node)||sr(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:n}}var wP=v(()=>{Gt();Ww()});function qu(r,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i{});function zn(r,e,t){if(Array.isArray(r))return r.map((n,i)=>zn(n,String(i),t));if(r&&typeof r.toJSON=="function"){if(!t||!TP(r))return r.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(r,n),t.onCreate=s=>{n.res=s,delete t.onCreate};let i=r.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof r=="bigint"&&!(t!=null&&t.keep)?Number(r):r}var Hu=v(()=>{Gt()});var Uu,SP=v(()=>{K$();Gt();Hu();Uu=class{constructor(e){Object.defineProperty(this,os,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!ro(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=zn(this,"",a);if(typeof i=="function")for(let{count:l,res:c}of a.anchors.values())i(c,l);return typeof s=="function"?qu(s,{"":o},"",o):o}}});function xP(r,e,t){if(Ta(e)){let n=e.resolve(r),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(sr(e)){let n=0;for(let i of e.items){let s=xP(r,i,t);s>n&&(n=s)}return n}else if(Pt(e)){let n=xP(r,e.key,t),i=xP(r,e.value,t);return Math.max(n,i)}return 1}var Bl,Yw=v(()=>{wP();Ww();Gt();SP();Hu();Bl=class extends Uu{constructor(e){super(vP),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],Ko(e,{Node:(s,a)=>{(Ta(a)||TP(a))&&n.push(a)}}),t&&(t.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=t,a=this.resolve(i,t);if(!a){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=n.get(a);if(o||(zn(a,null,t),o=n.get(a)),!o||o.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=xP(i,a,n)),o.count*o.aliasCount>s)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(kP(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}}});var EP,we,_n=v(()=>{Gt();SP();Hu();EP=r=>!r||typeof r!="function"&&typeof r!="object",we=class extends Uu{constructor(e){super(ba),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:zn(this.value,e,t)}toString(){return String(this.value)}};we.BLOCK_FOLDED="BLOCK_FOLDED";we.BLOCK_LITERAL="BLOCK_LITERAL";we.PLAIN="PLAIN";we.QUOTE_DOUBLE="QUOTE_DOUBLE";we.QUOTE_SINGLE="QUOTE_SINGLE"});function pHe(r,e,t){var n;if(e){let i=t.filter(a=>a.tag===e),s=(n=i.find(a=>!a.format))!=null?n:i[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(i=>{var s;return((s=i.identify)==null?void 0:s.call(i,r))&&!i.format})}function vd(r,e,t){var u,p,m,f;if(ro(r)&&(r=r.contents),Rt(r))return r;if(Pt(r)){let h=(p=(u=t.schema[Go]).createNode)==null?void 0:p.call(u,t.schema,null,t);return h.items.push(r),h}(r instanceof String||r instanceof Number||r instanceof Boolean||typeof BigInt!="undefined"&&r instanceof BigInt)&&(r=r.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=t,l;if(n&&r&&typeof r=="object"){if(l=o.get(r),l)return(m=l.anchor)!=null||(l.anchor=i(r)),new Bl(l.anchor);l={anchor:null,node:null},o.set(r,l)}e!=null&&e.startsWith("!!")&&(e=uHe+e.slice(2));let c=pHe(r,e,a.tags);if(!c){if(r&&typeof r.toJSON=="function"&&(r=r.toJSON()),!r||typeof r!="object"){let h=new we(r);return l&&(l.node=h),h}c=r instanceof Map?a[Go]:Symbol.iterator in Object(r)?a[yd]:a[Go]}s&&(s(c),delete t.onTagObj);let d=c!=null&&c.createNode?c.createNode(t.schema,r,t):typeof((f=c==null?void 0:c.nodeClass)==null?void 0:f.from)=="function"?c.nodeClass.from(t.schema,r,t):new we(r);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}var uHe,Gw=v(()=>{Yw();Gt();_n();uHe="tag:yaml.org,2002:"});function Kw(r,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return vd(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:r,sourceObjects:new Map})}var hy,fy,DP=v(()=>{Gw();Gt();SP();hy=r=>r==null||typeof r=="object"&&!!r[Symbol.iterator]().next().done,fy=class extends Uu{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>Rt(n)||Pt(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(hy(e))this.add(t);else{let[n,...i]=e,s=this.get(n,!0);if(sr(s))s.addIn(i,t);else if(s===void 0&&this.schema)this.set(n,Kw(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(sr(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!t&&ot(s)?s.value:s:sr(s)?s.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Pt(t))return!1;let n=t.value;return n==null||e&&ot(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return sr(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let s=this.get(n,!0);if(sr(s))s.setIn(i,t);else if(s===void 0&&this.schema)this.set(n,Kw(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}});function so(r,e){return/^\n+$/.test(r)?r.substring(1):e?r.replace(/^(?! *$)/gm,e):r}var jde,ql,Zw=v(()=>{jde=r=>r.replace(/^(?!$)(?: $)?/gm,"#");ql=(r,e,t)=>r.endsWith(` `)?so(t,e):t.includes(` `)?` `+so(t,e):(r.endsWith(" ")?"":" ")+t});function Jw(r,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return r;ii-Math.max(2,s)?c.push(0):u=i-n);let p,m,f=!1,h=-1,g=-1,y=-1;t===CP&&(h=zde(r,h,e.length),h!==-1&&(u=h+l));for(let T;T=r[h+=1];){if(t===Qw&&T==="\\"){switch(g=h,r[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(T===` `)t===CP&&(h=zde(r,h,e.length)),u=h+e.length+l,p=void 0;else{if(T===" "&&m&&m!==" "&&m!==` `&&m!==" "){let w=r[h+1];w&&w!==" "&&w!==` `&&w!==" "&&(p=h)}if(h>=u)if(p)c.push(p),u=p+l,p=void 0;else if(t===Qw){for(;m===" "||m===" ";)m=T,T=r[h+=1],f=!0;let w=h>y+1?h-2:g-1;if(d[w])return r;c.push(w),d[w]=!0,u=w+l,p=void 0}else f=!0}m=T}if(f&&o&&o(),c.length===0)return r;a&&a();let k=r.slice(0,c[0]);for(let T=0;T{Z$="flow",CP="block",Qw="quoted"});function mHe(r,e,t){if(!e||e<0)return!1;let n=e-t,i=r.length;if(i<=n)return!1;for(let s=0,a=0;sn)return!0;if(a=s+1,i-a<=n)return!1}return!0}function Xw(r,e){let t=JSON.stringify(r);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(MP(r)?" ":""),a="",o=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(a+=t.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{a+=t.slice(o,l);let d=t.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=t.substr(l,6)}l+=5,o=l+1}break;case"n":if(n||t[l+2]==='"'||t.length `;let u,p;for(p=t.length;p>0;--p){let S=t[p-1];if(S!==` `&&S!==" "&&S!==" ")break}let m=t.substring(p),f=m.indexOf(` `);f===-1?u="-":t===m||f!==m.length-1?(u="+",s&&s()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===` `&&(m=m.slice(0,-1)),m=m.replace(J$,`$&${c}`));let h=!1,g,y=-1;for(g=0;g{E=!0});let D=Jw(`${k}${S}${m}`,c,CP,C);if(!E)return`>${w} ${c}${D}`}return t=t.replace(/\n+/g,`$&${c}`),`|${w} ${c}${k}${t}${m}`}function fHe(r,e,t,n){let{type:i,value:s}=r,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:d}=e;if(o&&s.includes(` `)||d&&/[[\]{},]/.test(s))return gy(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||d||!s.includes(` `)?gy(s,e):PP(r,e,t,n);if(!o&&!d&&i!==we.PLAIN&&s.includes(` `))return PP(r,e,t,n);if(MP(s)){if(l==="")return e.forceBlockIndent=!0,PP(r,e,t,n);if(o&&l===c)return gy(s,e)}let u=s.replace(/\n+/g,`$& ${l}`);if(a){let p=h=>{var g;return h.default&&h.tag!=="tag:yaml.org,2002:str"&&((g=h.test)==null?void 0:g.test(u))},{compat:m,tags:f}=e.doc.schema;if(f.some(p)||m!=null&&m.some(p))return gy(s,e)}return o?u:Jw(u,l,Z$,_P(e,!1))}function bd(r,e,t,n){let{implicitKey:i,inFlow:s}=e,a=typeof r.value=="string"?r:Object.assign({},r,{value:String(r.value)}),{type:o}=r;o!==we.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=we.QUOTE_DOUBLE);let l=d=>{switch(d){case we.BLOCK_FOLDED:case we.BLOCK_LITERAL:return i||s?gy(a.value,e):PP(a,e,t,n);case we.QUOTE_DOUBLE:return Xw(a.value,e);case we.QUOTE_SINGLE:return Q$(a.value,e);case we.PLAIN:return fHe(a,e,t,n);default:return null}},c=l(o);if(c===null){let{defaultKeyType:d,defaultStringType:u}=e.options,p=i&&d||u;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}var _P,MP,J$,eS=v(()=>{_n();Bde();_P=(r,e)=>({indentAtStart:e?r.indent.length:r.indentAtStart,lineWidth:r.options.lineWidth,minContentWidth:r.options.minContentWidth}),MP=r=>/^(%|---|\.\.\.)/m.test(r);try{J$=new RegExp(`(^|(?c.tag===e.tag);if(l.length>0)return(i=l.find(c=>c.format===e.format))!=null?i:l[0]}let t,n;if(ot(e)){n=e.value;let l=r.filter(c=>{var d;return(d=c.identify)==null?void 0:d.call(c,n)});if(l.length>1){let c=l.filter(d=>d.test);c.length>0&&(l=c)}t=(s=l.find(c=>c.format===e.format))!=null?s:l.find(c=>!c.format)}else n=e,t=r.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!t){let l=(o=(a=n==null?void 0:n.constructor)==null?void 0:a.name)!=null?o:n===null?"null":typeof n;throw new Error(`Tag not resolved for ${l} value`)}return t}function gHe(r,e,{anchors:t,doc:n}){var o;if(!n.directives)return"";let i=[],s=(ot(r)||sr(r))&&r.anchor;s&&kP(s)&&(t.add(s),i.push(`&${s}`));let a=(o=r.tag)!=null?o:e.default?null:e.tag;return a&&i.push(n.directives.tagString(a)),i.join(" ")}function Td(r,e,t,n){var l,c;if(Pt(r))return r.toString(e,t,n);if(Ta(r)){if(e.doc.directives)return r.toString(e);if((l=e.resolvedAliases)!=null&&l.has(r))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(r):e.resolvedAliases=new Set([r]),r=r.resolve(e.doc)}let i,s=Rt(r)?r:e.doc.createNode(r,{onTagObj:d=>i=d});i!=null||(i=hHe(e.doc.schema.tags,s));let a=gHe(s,i,e);a.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(s,e,t,n):ot(s)?bd(s,e,t,n):s.toString(e,t,n);return a?ot(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} ${e.indent}${o}`:o}var tS=v(()=>{wP();Gt();Zw();eS()});function qde({key:r,value:e},t,n,i){var C,D;let{allNullValues:s,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=t,p=Rt(r)&&r.comment||null;if(u){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(sr(r)||!Rt(r)&&typeof r=="object"){let A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!u&&(!r||p&&e==null&&!t.inFlow||sr(r)||(ot(r)?r.type===we.BLOCK_FOLDED||r.type===we.BLOCK_LITERAL:typeof r=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!s),indent:o+l});let f=!1,h=!1,g=Td(r,t,()=>f=!0,()=>h=!0);if(!m&&!t.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(s||e==null)return f&&n&&n(),g===""?"?":m?`? ${g}`:g}else if(s&&!u||e==null&&m)return g=`? ${g}`,p&&!f?g+=ql(g,t.indent,c(p)):h&&i&&i(),g;f&&(p=null),m?(p&&(g+=ql(g,t.indent,c(p))),g=`? ${g} ${o}:`):(g=`${g}:`,p&&(g+=ql(g,t.indent,c(p))));let y,k,T;Rt(e)?(y=!!e.spaceBefore,k=e.commentBefore,T=e.comment):(y=!1,k=null,T=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!m&&!p&&ot(e)&&(t.indentAtStart=g.length+1),h=!1,!d&&l.length>=2&&!t.inFlow&&!m&&io(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let w=!1,S=Td(e,t,()=>w=!0,()=>h=!0),E=" ";if(p||y||k){if(E=y?` `:"",k){let A=c(k);E+=` ${so(A,t.indent)}`}S===""&&!t.inFlow?E===` `&&(E=` `):E+=` ${t.indent}`}else if(!m&&sr(e)){let A=S[0],N=S.indexOf(` `),V=N!==-1,R=(D=(C=t.inFlow)!=null?C:e.flow)!=null?D:e.items.length===0;if(V||!R){let I=!1;if(V&&(A==="&"||A==="!")){let O=S.indexOf(" ");A==="&"&&O!==-1&&O{Gt();_n();tS();Zw()});function IP(r,e){(r==="debug"||r==="warn")&&console.warn(e)}var X$=v(()=>{});function tj(r,e,t){if(t=r&&Ta(t)?t.resolve(r.doc):t,io(t))for(let n of t.items)ej(r,e,n);else if(Array.isArray(t))for(let n of t)ej(r,e,n);else ej(r,e,t)}function ej(r,e,t){let n=r&&Ta(t)?t.resolve(r.doc):t;if(!no(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,r,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}var NP,Zo,Ude,RP=v(()=>{Gt();_n();NP="<<",Zo={identify:r=>r===NP||typeof r=="symbol"&&r.description===NP,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new we(Symbol(NP)),{addToJSMap:tj}),stringify:()=>NP},Ude=(r,e)=>(Zo.identify(e)||ot(e)&&(!e.type||e.type===we.PLAIN)&&Zo.identify(e.value))&&(r==null?void 0:r.doc.schema.tags.some(t=>t.tag===Zo.tag&&t.default))});function OP(r,e,{key:t,value:n}){if(Rt(t)&&t.addToJSMap)t.addToJSMap(r,e,n);else if(Ude(r,t))tj(r,e,n);else{let i=zn(t,"",r);if(e instanceof Map)e.set(i,zn(n,i,r));else if(e instanceof Set)e.add(i);else{let s=yHe(t,i,r),a=zn(n,s,r);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function yHe(r,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Rt(r)&&(t!=null&&t.doc)){let n=AP(t.doc,{});n.anchors=new Set;for(let s of t.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=r.toString(n);if(!t.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),IP(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}var rj=v(()=>{X$();RP();tS();Gt();Hu()});function yy(r,e,t){let n=vd(r,void 0,t),i=vd(e,void 0,t);return new tn(n,i)}var tn,Vu=v(()=>{Gw();Hde();rj();Gt();tn=class r{constructor(e,t=null){Object.defineProperty(this,os,{value:V$}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Rt(t)&&(t=t.clone(e)),Rt(n)&&(n=n.clone(e)),new r(t,n)}toJSON(e,t){let n=t!=null&&t.mapAsMap?new Map:{};return OP(t,n,this)}toString(e,t,n){return e!=null&&e.doc?qde(this,e,t,n):JSON.stringify(this)}}});function FP(r,e,t){var s;return(((s=e.inFlow)!=null?s:r.flow)?bHe:vHe)(r,e,t)}function vHe({comment:r,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){let{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:s,type:null}),u=!1,p=[];for(let f=0;fg=null,()=>u=!0);g&&(y+=ql(y,s,c(g))),u&&g&&(u=!1),p.push(n+y)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let f=1;fg=null);fd||y.includes(` `))&&(c=!0),u.push(y),d=u.length}let{start:p,end:m}=t;if(u.length===0)return p+m;if(!c){let f=u.reduce((h,g)=>h+g.length+2,2);c=e.options.lineWidth>0&&f>e.options.lineWidth}if(c){let f=p;for(let h of u)f+=h?` ${s}${i}${h}`:` `;return`${f} ${i}${m}`}else return`${p}${a}${u.join(" ")}${a}${m}`}function LP({indent:r,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=so(e(n),r);t.push(s.trimStart())}}var nj=v(()=>{Gt();tS();Zw()});function Wu(r,e){let t=ot(e)?e.value:e;for(let n of r)if(Pt(n)&&(n.key===e||n.key===t||ot(n.key)&&n.key.value===t))return n}var mn,Yu=v(()=>{nj();rj();DP();Gt();Vu();_n();mn=class extends fy{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Go,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),o=(l,c)=>{if(typeof s=="function")c=s.call(t,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||i)&&a.items.push(yy(l,c,n))};if(t instanceof Map)for(let[l,c]of t)o(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))o(l,t[l]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){var a;let n;Pt(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new tn(e,e==null?void 0:e.value):n=new tn(e.key,e.value);let i=Wu(this.items,n.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);ot(i.value)&&EP(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(l=>s(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Wu(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var s;let n=Wu(this.items,e),i=n==null?void 0:n.value;return(s=!t&&ot(i)?i.value:i)!=null?s:void 0}has(e){return!!Wu(this.items,e)}set(e,t){this.add(new tn(e,t),!0)}toJSON(e,t,n){let i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(let s of this.items)OP(t,i,s);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Pt(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),FP(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}});var Qo,vy=v(()=>{Gt();Yu();Qo={collection:"map",default:!0,nodeClass:mn,tag:"tag:yaml.org,2002:map",resolve(r,e){return no(r)||e("Expected a mapping for this tag"),r},createNode:(r,e,t)=>mn.from(r,e,t)}});function $P(r){let e=ot(r)?r.value:r;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var ui,Gu=v(()=>{Gw();nj();DP();Gt();_n();Hu();ui=class extends fy{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yd,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=$P(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=$P(e);if(typeof n!="number")return;let i=this.items[n];return!t&&ot(i)?i.value:i}has(e){let t=$P(e);return typeof t=="number"&&t{Gt();Gu();Jo={collection:"seq",default:!0,nodeClass:ui,tag:"tag:yaml.org,2002:seq",resolve(r,e){return io(r)||e("Expected a sequence for this tag"),r},createNode:(r,e,t)=>ui.from(r,e,t)}});var Ku,rS=v(()=>{eS();Ku={identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify(r,e,t,n){return e=Object.assign({actualString:!0},e),bd(r,e,t,n)}}});var of,jP=v(()=>{_n();of={identify:r=>r==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new we(null),stringify:({source:r},e)=>typeof r=="string"&&of.test.test(r)?r:e.options.nullStr}});var nS,ij=v(()=>{_n();nS={identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:r=>new we(r[0]==="t"||r[0]==="T"),stringify({source:r,value:e},t){if(r&&nS.test.test(r)){let n=r[0]==="t"||r[0]==="T";if(e===n)return r}return e?t.options.trueStr:t.options.falseStr}}});function ji({format:r,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(n);if(!r&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=e-(s.length-a-1);for(;o-- >0;)s+="0"}return s}var Ty=v(()=>{});var zP,BP,qP,sj=v(()=>{_n();Ty();zP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ji},BP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():ji(r)}},qP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(r){let e=new we(parseFloat(r)),t=r.indexOf(".");return t!==-1&&r[r.length-1]==="0"&&(e.minFractionDigits=r.length-t-1),e},stringify:ji}});function Vde(r,e,t){let{value:n}=r;return HP(n)&&n>=0?t+n.toString(e):ji(r)}var HP,aj,UP,VP,WP,oj=v(()=>{Ty();HP=r=>typeof r=="bigint"||Number.isInteger(r),aj=(r,e,t,{intAsBigInt:n})=>n?BigInt(r):parseInt(r.substring(e),t);UP={identify:r=>HP(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(r,e,t)=>aj(r,2,8,t),stringify:r=>Vde(r,8,"0o")},VP={identify:HP,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(r,e,t)=>aj(r,0,10,t),stringify:ji},WP={identify:r=>HP(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(r,e,t)=>aj(r,2,16,t),stringify:r=>Vde(r,16,"0x")}});var Wde,Yde=v(()=>{vy();jP();by();rS();ij();sj();oj();Wde=[Qo,Jo,Ku,of,nS,UP,VP,WP,zP,BP,qP]});function Gde(r){return typeof r=="bigint"||Number.isInteger(r)}var YP,THe,kHe,Kde,Zde=v(()=>{_n();vy();by();YP=({value:r})=>JSON.stringify(r),THe=[{identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify:YP},{identify:r=>r==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:YP},{identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:r=>r==="true",stringify:YP},{identify:Gde,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(r,e,{intAsBigInt:t})=>t?BigInt(r):parseInt(r,10),stringify:({value:r})=>Gde(r)?r.toString():JSON.stringify(r)},{identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:r=>parseFloat(r),stringify:YP}],kHe={default:!0,tag:"",test:/^/,resolve(r,e){return e(`Unresolved plain scalar ${JSON.stringify(r)}`),r}},Kde=[Qo,Jo].concat(THe,kHe)});var iS,lj=v(()=>{_n();eS();iS={identify:r=>r instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(r,e){if(typeof atob=="function"){let t=atob(r.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i1&&e("Each pair must have its own sequence indicator");let s=i.items[0]||new tn(new we(null));if(i.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${i.commentBefore} ${s.key.commentBefore}`:i.commentBefore),i.comment){let a=(t=s.value)!=null?t:s.key;a.comment=a.comment?`${i.comment} ${a.comment}`:i.comment}i=s}r.items[n]=Pt(i)?i:new tn(i)}}else e("Expected a sequence for this tag");return r}function dj(r,e,t){let{replacer:n}=t,i=new ui(r);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;i.items.push(yy(o,l,t))}return i}var sS,GP=v(()=>{Gt();Vu();_n();Gu();sS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cj,createNode:dj}});var ky,aS,uj=v(()=>{Gt();Hu();Yu();Gu();GP();ky=class r extends ui{constructor(){super(),this.add=mn.prototype.add.bind(this),this.delete=mn.prototype.delete.bind(this),this.get=mn.prototype.get.bind(this),this.has=mn.prototype.has.bind(this),this.set=mn.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(let i of this.items){let s,a;if(Pt(i)?(s=zn(i.key,"",t),a=zn(i.value,s,t)):s=zn(i,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,t,n){let i=dj(e,t,n),s=new this;return s.items=i.items,s}};ky.tag="tag:yaml.org,2002:omap";aS={collection:"seq",identify:r=>r instanceof Map,nodeClass:ky,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=cj(r,e),n=[];for(let{key:i}of t.items)ot(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ky,t)},createNode:(r,e,t)=>ky.from(r,e,t)}});function Qde({value:r,source:e},t){return e&&(r?pj:mj).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var pj,mj,Jde=v(()=>{_n();pj={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new we(!0),stringify:Qde},mj={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new we(!1),stringify:Qde}});var Xde,eue,tue,rue=v(()=>{_n();Ty();Xde={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ji},eue={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():ji(r)}},tue={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new we(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ji}});function KP(r,e,t,{intAsBigInt:n}){let i=r[0];if((i==="-"||i==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let a=BigInt(r);return i==="-"?BigInt(-1)*a:a}let s=parseInt(r,t);return i==="-"?-1*s:s}function fj(r,e,t){let{value:n}=r;if(oS(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return ji(r)}var oS,nue,iue,sue,aue,oue=v(()=>{Ty();oS=r=>typeof r=="bigint"||Number.isInteger(r);nue={identify:oS,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>KP(r,2,2,t),stringify:r=>fj(r,2,"0b")},iue={identify:oS,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>KP(r,1,8,t),stringify:r=>fj(r,8,"0")},sue={identify:oS,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>KP(r,0,10,t),stringify:ji},aue={identify:oS,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>KP(r,2,16,t),stringify:r=>fj(r,16,"0x")}});var wy,lS,hj=v(()=>{Gt();Vu();Yu();wy=class r extends mn{constructor(e){super(e),this.tag=r.tag}add(e){let t;Pt(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new tn(e.key,null):t=new tn(e,null),Wu(this.items,t.key)||this.items.push(t)}get(e,t){let n=Wu(this.items,e);return!t&&Pt(n)?ot(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Wu(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new tn(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),s.items.push(yy(a,null,n));return s}};wy.tag="tag:yaml.org,2002:set";lS={collection:"map",identify:r=>r instanceof Set,nodeClass:wy,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>wy.from(r,e,t),resolve(r,e){if(no(r)){if(r.hasAllNullValues(!0))return Object.assign(new wy,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}}});function gj(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return t==="-"?i(-1)*s:s}function lue(r){let{value:e}=r,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return ji(r);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ZP,QP,Sy,yj=v(()=>{Ty();ZP={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>gj(r,t),stringify:lue},QP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>gj(r,!1),stringify:lue},Sy={identify:r=>r instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(r){let e=r.match(Sy.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,s,a,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,s||0,a||0,o||0,l),d=e[8];if(d&&d!=="Z"){let u=gj(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:r})=>{var e;return(e=r==null?void 0:r.toISOString().replace(/(T00:00:00)?\.000Z$/,""))!=null?e:""}}});var vj,cue=v(()=>{vy();jP();by();rS();lj();Jde();rue();oue();RP();uj();GP();hj();yj();vj=[Qo,Jo,Ku,of,pj,mj,nue,iue,sue,aue,Xde,eue,tue,iS,Zo,aS,sS,lS,ZP,QP,Sy]});function JP(r,e,t){let n=due.get(e);if(n&&!r)return t&&!n.includes(Zo)?n.concat(Zo):n.slice();let i=n;if(!i)if(Array.isArray(r))i=[];else{let s=Array.from(due.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(r))for(let s of r)i=i.concat(s);else typeof r=="function"&&(i=r(i.slice()));return t&&(i=i.concat(Zo)),i.reduce((s,a)=>{let o=typeof a=="string"?uue[a]:a;if(!o){let l=JSON.stringify(a),c=Object.keys(uue).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(o)||s.push(o),s},[])}var due,uue,pue,mue=v(()=>{vy();jP();by();rS();ij();sj();oj();Yde();Zde();lj();RP();uj();GP();cue();hj();yj();due=new Map([["core",Wde],["failsafe",[Qo,Jo,Ku]],["json",Kde],["yaml11",vj],["yaml-1.1",vj]]),uue={binary:iS,bool:nS,float:qP,floatExp:BP,floatNaN:zP,floatTime:QP,int:VP,intHex:WP,intOct:UP,intTime:ZP,map:Qo,merge:Zo,null:of,omap:aS,pairs:sS,seq:Jo,set:lS,timestamp:Sy},pue={"tag:yaml.org,2002:binary":iS,"tag:yaml.org,2002:merge":Zo,"tag:yaml.org,2002:omap":aS,"tag:yaml.org,2002:pairs":sS,"tag:yaml.org,2002:set":lS,"tag:yaml.org,2002:timestamp":Sy}});var wHe,xy,bj=v(()=>{Gt();vy();by();rS();mue();wHe=(r,e)=>r.keye.key?1:0,xy=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?JP(e,"compat"):e?JP(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?pue:{},this.tags=JP(t,this.name,n),this.toStringOptions=o!=null?o:null,Object.defineProperty(this,Go,{value:Qo}),Object.defineProperty(this,ba,{value:Ku}),Object.defineProperty(this,yd,{value:Jo}),this.sortMapEntries=typeof a=="function"?a:a===!0?wHe:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}});function fue(r,e){var l;let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(t.push(c),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let i=AP(r,e),{commentString:s}=i.options;if(r.commentBefore){t.length!==1&&t.unshift("");let c=s(r.commentBefore);t.unshift(so(c,""))}let a=!1,o=null;if(r.contents){if(Rt(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let u=s(r.contents.commentBefore);t.push(so(u,""))}i.forceBlockIndent=!!r.comment,o=r.contents.comment}let c=o?void 0:()=>a=!0,d=Td(r.contents,i,()=>o=null,c);o&&(d+=ql(d,"",s(o))),(d[0]==="|"||d[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${d}`:t.push(d)}else t.push(Td(r.contents,i));if((l=r.directives)!=null&&l.docEnd)if(r.comment){let c=s(r.comment);c.includes(` `)?(t.push("..."),t.push(so(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=r.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&t[t.length-1]!==""&&t.push(""),t.push(so(s(c),"")))}return t.join(` `)+` `}var hue=v(()=>{Gt();tS();Zw()});function Ey(r){if(sr(r))return!0;throw new Error("Expected a YAML collection as document contents")}var Hl,cS=v(()=>{Yw();DP();Gt();Vu();Hu();bj();hue();wP();K$();Gw();W$();Hl=class r{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,os,{value:bP});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new zl({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(r.prototype,{[os]:{value:bP}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Rt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ey(this.contents)&&this.contents.add(e)}addIn(e,t){Ey(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Y$(this);e.anchor=!t||n.has(t)?G$(t||"a",n):t}return new Bl(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let g=k=>typeof k=="number"||k instanceof String||k instanceof Number,y=t.filter(g).map(String);y.length>0&&(t=t.concat(y)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:d}=n!=null?n:{},{onAnchor:u,setAnchors:p,sourceObjects:m}=$de(this,a||"a"),f={aliasDuplicateObjects:s!=null?s:!0,keepUndefined:l!=null?l:!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},h=vd(e,d,f);return o&&sr(h)&&(h.flow=!0),p(),h}createPair(e,t,n={}){let i=this.createNode(e,null,n),s=this.createNode(t,null,n);return new tn(i,s)}delete(e){return Ey(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hy(e)?this.contents==null?!1:(this.contents=null,!0):Ey(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return sr(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return hy(e)?!t&&ot(this.contents)?this.contents.value:this.contents:sr(this.contents)?this.contents.getIn(e,t):void 0}has(e){return sr(this.contents)?this.contents.has(e):!1}hasIn(e){return hy(e)?this.contents!==void 0:sr(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Kw(this.schema,[e],t):Ey(this.contents)&&this.contents.set(e,t)}setIn(e,t){hy(e)?this.contents=t:this.contents==null?this.contents=Kw(this.schema,Array.from(e),t):Ey(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new zl({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new zl({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new xy(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=zn(this.contents,t!=null?t:"",o);if(typeof s=="function")for(let{count:c,res:d}of o.anchors.values())s(d,c);return typeof a=="function"?qu(a,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return fue(this,e)}}});var Dy,ka,Cy,dS,uS=v(()=>{Dy=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},ka=class extends Dy{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Cy=class extends Dy{constructor(e,t,n){super("YAMLWarning",e,t,n)}},dS=(r,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let s=i-1,a=r.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let o=Math.min(s-39,a.length-79);a="\u2026"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let o=r.substring(e.lineStarts[n-2],e.lineStarts[n-1]);o.length>80&&(o=o.substring(0,79)+`\u2026 `),a=o+a}if(/[^ ]/.test(a)){let o=1,l=t.linePos[1];l&&l.line===n&&l.col>i&&(o=Math.max(1,Math.min(l.col-i,80-s)));let c=" ".repeat(s)+"^".repeat(o);t.message+=`: ${a} ${c} `}}});function Ul(r,{flow:e,indicator:t,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let l=!1,c=o,d=o,u="",p="",m=!1,f=!1,h=null,g=null,y=null,k=null,T=null,w=null,S=null;for(let D of r)switch(f&&(D.type!=="space"&&D.type!=="newline"&&D.type!=="comma"&&s(D.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),h&&(c&&D.type!=="comment"&&D.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),D.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&D.source.includes(" ")&&(h=D),d=!0;break;case"comment":{d||s(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=D.source.substring(1)||" ";u?u+=p+A:u=A,p="",c=!1;break}case"newline":c?u?u+=D.source:(!w||t!=="seq-item-ind")&&(l=!0):p+=D.source,c=!0,m=!0,(g||y)&&(k=D),d=!0;break;case"anchor":g&&s(D,"MULTIPLE_ANCHORS","A node can have at most one anchor"),D.source.endsWith(":")&&s(D.offset+D.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=D,S!=null||(S=D.offset),c=!1,d=!1,f=!0;break;case"tag":{y&&s(D,"MULTIPLE_TAGS","A node can have at most one tag"),y=D,S!=null||(S=D.offset),c=!1,d=!1,f=!0;break}case t:(g||y)&&s(D,"BAD_PROP_ORDER",`Anchors and tags must be after the ${D.source} indicator`),w&&s(D,"UNEXPECTED_TOKEN",`Unexpected ${D.source} in ${e!=null?e:"collection"}`),w=D,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){T&&s(D,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),T=D,c=!1,d=!1;break}default:s(D,"UNEXPECTED_TOKEN",`Unexpected ${D.type} token`),c=!1,d=!1}let E=r[r.length-1],C=E?E.offset+E.source.length:i;return f&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=a||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:w,spaceBefore:l,comment:u,hasNewline:m,anchor:g,tag:y,newlineAfterProp:k,end:C,start:S!=null?S:C}}var pS=v(()=>{});function Zu(r){if(!r)return null;switch(r.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(r.source.includes(` `))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Zu(e.key)||Zu(e.value))return!0}return!1;default:return!0}}var XP=v(()=>{});function mS(r,e,t){if((e==null?void 0:e.type)==="flow-collection"){let n=e.end[0];n.indent===r&&(n.source==="]"||n.source==="}")&&Zu(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}var Tj=v(()=>{XP()});function e_(r,e,t){let{uniqueKeys:n}=r.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||ot(s)&&ot(a)&&s.value===a.value;return e.some(s=>i(s.key,t))}var kj=v(()=>{Gt()});function yue({composeNode:r,composeEmptyNode:e},t,n,i,s){var d,u;let a=(d=s==null?void 0:s.nodeClass)!=null?d:mn,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let p of n.items){let{start:m,key:f,sep:h,value:g}=p,y=Ul(m,{indicator:"explicit-key-ind",next:f!=null?f:h==null?void 0:h[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),k=!y.found;if(k){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(l,"BAD_INDENT",gue)),!y.anchor&&!y.tag&&!h){c=y.end,y.comment&&(o.comment?o.comment+=` `+y.comment:o.comment=y.comment);continue}(y.newlineAfterProp||Zu(f))&&i(f!=null?f:m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=y.found)==null?void 0:u.indent)!==n.indent&&i(l,"BAD_INDENT",gue);t.atKey=!0;let T=y.end,w=f?r(t,f,y,i):e(t,T,m,null,y,i);t.schema.compat&&mS(n.indent,f,i),t.atKey=!1,e_(t,o.items,w)&&i(T,"DUPLICATE_KEY","Map keys must be unique");let S=Ul(h!=null?h:[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=S.end,S.found){k&&((g==null?void 0:g.type)==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&y.start{Vu();Yu();pS();XP();Tj();kj();gue="All mapping items must start at the same column"});function bue({composeNode:r,composeEmptyNode:e},t,n,i,s){var d;let a=(d=s==null?void 0:s.nodeClass)!=null?d:ui,o=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:u,value:p}of n.items){let m=Ul(u,{indicator:"seq-item-ind",next:p,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||p)p&&p.type==="block-seq"?i(m.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(o.comment=m.comment);continue}let f=p?r(t,p,m,i):e(t,m.end,u,null,m,i);t.schema.compat&&mS(n.indent,p,i),l=f.range[2],o.items.push(f)}return o.range=[n.offset,l,c!=null?c:l],o}var Tue=v(()=>{Gu();pS();Tj()});function Vl(r,e,t,n){let i="";if(r){let s=!1,a="";for(let o of r){let{source:l,type:c}=o;switch(c){case"space":s=!0;break;case"comment":{t&&!s&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";i?i+=a+d:i=d,a="";break}case"newline":i&&(a+=l),s=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}var Py=v(()=>{});function kue({composeNode:r,composeEmptyNode:e},t,n,i,s){var g,y;let a=n.start.source==="{",o=a?"flow map":"flow sequence",l=(g=s==null?void 0:s.nodeClass)!=null?g:a?mn:ui,c=new l(t.schema);c.flow=!0;let d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset+n.start.source.length;for(let k=0;k0){let k=Vl(f,h,t.options.strict,i);k.comment&&(c.comment?c.comment+=` `+k.comment:c.comment=k.comment),c.range=[n.offset,h,k.offset]}else c.range=[n.offset,h,h];return c}var wj,Sj,wue=v(()=>{Gt();Vu();Yu();Gu();Py();pS();XP();kj();wj="Block collections are not allowed within flow collections",Sj=r=>r&&(r.type==="block-map"||r.type==="block-seq")});function xj(r,e,t,n,i,s){let a=t.type==="block-map"?yue(r,e,t,n,s):t.type==="block-seq"?bue(r,e,t,n,s):kue(r,e,t,n,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function Sue(r,e,t,n,i){var p,m,f;let s=n.tag,a=s?e.directives.tagName(s.source,h=>i(s,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:g}=n,y=h&&s?h.offset>s.offset?h:s:h!=null?h:s;y&&(!g||g.offseth.tag===a&&h.collection===o);if(!l){let h=e.schema.knownTags[a];if(h&&h.collection===o)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${o} collection, but expects ${(p=h.collection)!=null?p:"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),xj(r,e,t,i,a)}let c=xj(r,e,t,i,a,l),d=(f=(m=l.resolve)==null?void 0:m.call(l,c,h=>i(s,"TAG_RESOLVE_FAILED",h),e.options))!=null?f:c,u=Rt(d)?d:new we(d);return u.range=c.range,u.tag=a,l!=null&&l.format&&(u.format=l.format),u}var xue=v(()=>{Gt();_n();Yu();Gu();vue();Tue();wue()});function t_(r,e,t){let n=e.offset,i=SHe(e,r.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?we.BLOCK_FOLDED:we.BLOCK_LITERAL,a=e.source?xHe(e.source):[],o=a.length;for(let h=a.length-1;h>=0;--h){let g=a[h][1];if(g===""||g==="\r")o=h;else break}if(o===0){let h=i.chomp==="+"&&a.length>0?` `.repeat(Math.max(1,a.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:s,comment:i.comment,range:[n,g,g]}}let l=e.indent+i.indent,c=e.offset+i.length,d=0;for(let h=0;hl&&(l=g.length);else{g.length=o;--h)a[h][0].length>l&&(o=h+1);let u="",p="",m=!1;for(let h=0;hl||y[0]===" "?(p===" "?p=` `:!m&&p===` `&&(p=` `),u+=p+g.slice(l)+y,p=` `,m=!0):y===""?p===` `?u+=` `:p=` `:(u+=p+y,p=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=o;h{_n()});function r_(r,e,t){let{offset:n,type:i,source:s,end:a}=r,o,l,c=(p,m,f)=>t(n+p,m,f);switch(i){case"scalar":o=we.PLAIN,l=EHe(s,c);break;case"single-quoted-scalar":o=we.QUOTE_SINGLE,l=DHe(s,c);break;case"double-quoted-scalar":o=we.QUOTE_DOUBLE,l=CHe(s,c);break;default:return t(r,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let d=n+s.length,u=Vl(a,d,e,t);return{value:l,type:o,comment:u.comment,range:[n,d,u.offset]}}function EHe(r,e){let t="";switch(r[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${r[0]}`;break}case"@":case"`":{t=`reserved character ${r[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Eue(r)}function DHe(r,e){return(r[r.length-1]!=="'"||r.length===1)&&e(r.length,"MISSING_CHAR","Missing closing 'quote"),Eue(r.slice(1,-1)).replace(/''/g,"'")}function Eue(r){var l;let e,t;try{e=new RegExp(`(.*?)(?s?r.slice(s,n+1):i)}else t+=i}return(r[r.length-1]!=='"'||r.length===1)&&e(r.length,"MISSING_CHAR",'Missing closing "quote'),t}function PHe(r,e){let t="",n=r[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&r[e+2]!==` `);)n===` `&&(t+=` `),e+=1,n=r[e+1];return t||(t=" "),{fold:t,offset:e}}function MHe(r,e,t,n){let i=r.substr(e,t),a=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let o=r.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(a)}var _He,Dj=v(()=>{_n();Py();_He={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "}});function Cj(r,e,t,n){let{value:i,type:s,comment:a,range:o}=e.type==="block-scalar"?t_(r,e,n):r_(e,r.options.strict,n),l=t?r.directives.tagName(t.source,u=>n(t,"TAG_RESOLVE_FAILED",u)):null,c;r.options.stringKeys&&r.atKey?c=r.schema[ba]:l?c=AHe(r.schema,i,l,t,n):e.type==="scalar"?c=IHe(r,i,e,n):c=r.schema[ba];let d;try{let u=c.resolve(i,p=>n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),r.options);d=ot(u)?u:new we(u)}catch(u){let p=u instanceof Error?u.message:String(u);n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),d=new we(i)}return d.range=o,d.source=i,s&&(d.type=s),l&&(d.tag=l),c.format&&(d.format=c.format),a&&(d.comment=a),d}function AHe(r,e,t,n,i){var o;if(t==="!")return r[ba];let s=[];for(let l of r.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if((o=l.test)!=null&&o.test(e))return l;let a=r.knownTags[t];return a&&!a.collection?(r.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),r[ba])}function IHe({atKey:r,directives:e,schema:t},n,i,s){var o;let a=t.tags.find(l=>{var c;return(l.default===!0||r&&l.default==="key")&&((c=l.test)==null?void 0:c.test(n))})||t[ba];if(t.compat){let l=(o=t.compat.find(c=>{var d;return c.default&&((d=c.test)==null?void 0:d.test(n))}))!=null?o:t[ba];if(a.tag!==l.tag){let c=e.tagString(a.tag),d=e.tagString(l.tag),u=`Value may be parsed as either ${c} or ${d}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}var Due=v(()=>{Gt();_n();Ej();Dj()});function Cue(r,e,t){if(e){t!=null||(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":r-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)r+=i.source.length,i=e[++n];break}}return r}var Pue=v(()=>{});function Pj(r,e,t,n){let i=r.atKey,{spaceBefore:s,comment:a,anchor:o,tag:l}=t,c,d=!0;switch(e.type){case"alias":c=RHe(r,e,n),(o||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Cj(r,e,l,n),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Sue(NHe,r,e,t,n),o&&(c.anchor=o.source.substring(1));break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),c=n_(r,e.offset,void 0,null,t,n),d=!1}}return o&&c.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&r.options.stringKeys&&(!ot(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l!=null?l:e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?c.comment=a:c.commentBefore=a),r.options.keepSourceTokens&&d&&(c.srcToken=e),c}function n_(r,e,t,n,{spaceBefore:i,comment:s,anchor:a,tag:o,end:l},c){let d={type:"scalar",offset:Cue(e,t,n),indent:-1,source:""},u=Cj(r,d,o,c);return a&&(u.anchor=a.source.substring(1),u.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),s&&(u.comment=s,u.range[2]=l),u}function RHe({options:r},{offset:e,source:t,end:n},i){let s=new Bl(t.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+t.length,o=Vl(n,a,r.strict,i);return s.range=[e,a,o.offset],o.comment&&(s.comment=o.comment),s}var NHe,_ue=v(()=>{Yw();Gt();xue();Due();Py();Pue();NHe={composeNode:Pj,composeEmptyNode:n_}});function Mue(r,e,{offset:t,start:n,value:i,end:s},a){let o=Object.assign({_directives:e},r),l=new Hl(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Ul(n,{indicator:"doc-start",next:i!=null?i:s==null?void 0:s[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Pj(c,i,d,a):n_(c,d.end,n,null,d,a);let u=l.contents.range[2],p=Vl(s,u,!1,a);return p.comment&&(l.comment=p.comment),l.range=[t,u,p.offset],l}var Aue=v(()=>{cS();_ue();Py();pS()});function fS(r){if(typeof r=="number")return[r,r+1];if(Array.isArray(r))return r.length===2?r:[r[0],r[1]];let{offset:e,source:t}=r;return[e,e+(typeof t=="string"?t.length:1)]}function Iue(r){var i;let e="",t=!1,n=!1;for(let s=0;s{W$();cS();uS();Gt();Aue();Py();lf=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,s)=>{let a=fS(t);s?this.warnings.push(new Cy(a,n,i)):this.errors.push(new ka(a,n,i))},this.directives=new zl({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=Iue(this.prelude);if(n){let s=e.contents;if(t)e.comment=e.comment?`${e.comment} ${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(sr(s)&&!s.flow&&s.items.length>0){let a=s.items[0];Pt(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${n} ${o}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Iue(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let s=fS(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Mue(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new ka(fS(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new ka(fS(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Vl(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n} ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ka(fS(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Hl(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}});function Nue(r,e=!0,t){if(r){let n=(i,s,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(o,s,a);else throw new ka([o,o+1],s,a)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return r_(r,e,n);case"block-scalar":return t_({options:{strict:e}},r,n)}}return null}function Rue(r,e){var c;let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,o=bd({type:a,value:r},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:` `}];switch(o[0]){case"|":case">":{let d=o.indexOf(` `),u=o.substring(0,d),p=o.substring(d+1)+` `,m=[{type:"block-scalar-header",offset:s,indent:n,source:u}];return Lue(m,l)||m.push({type:"newline",offset:-1,indent:n,source:` `}),{type:"block-scalar",offset:s,indent:n,props:m,source:p}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:o,end:l};default:return{type:"scalar",offset:s,indent:n,source:o,end:l}}}function Oue(r,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=t,o="indent"in r?r.indent:null;if(n&&typeof o=="number"&&(o+=2),!a)switch(r.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let c=r.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=bd({type:a,value:e},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":OHe(r,l);break;case'"':Mj(r,l,"double-quoted-scalar");break;case"'":Mj(r,l,"single-quoted-scalar");break;default:Mj(r,l,"scalar")}}function OHe(r,e){let t=e.indexOf(` `),n=e.substring(0,t),i=e.substring(t+1)+` `;if(r.type==="block-scalar"){let s=r.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,r.source=i}else{let{offset:s}=r,a="indent"in r?r.indent:-1,o=[{type:"block-scalar-header",offset:s,indent:a,source:n}];Lue(o,"end"in r?r.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:` `});for(let l of Object.keys(r))l!=="type"&&l!=="offset"&&delete r[l];Object.assign(r,{type:"block-scalar",indent:a,props:o,source:i})}}function Lue(r,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":r.push(t);break;case"newline":return r.push(t),!0}return!1}function Mj(r,e,t){switch(r.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":r.type=t,r.source=e;break;case"block-scalar":{let n=r.props.slice(1),i=e.length;r.props[0].type==="block-scalar-header"&&(i-=r.props[0].source.length);for(let s of n)s.offset+=i;delete r.props,Object.assign(r,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:r.offset+e.length,indent:r.indent,source:` `};delete r.items,Object.assign(r,{type:t,source:e,end:[i]});break}default:{let n="indent"in r?r.indent:-1,i="end"in r&&Array.isArray(r.end)?r.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(r))s!=="type"&&s!=="offset"&&delete r[s];Object.assign(r,{type:t,indent:n,source:e,end:i})}}}var Fue=v(()=>{Ej();Dj();uS();eS()});function s_(r){switch(r.type){case"block-scalar":{let e="";for(let t of r.props)e+=s_(t);return e+r.source}case"block-map":case"block-seq":{let e="";for(let t of r.items)e+=i_(t);return e}case"flow-collection":{let e=r.start.source;for(let t of r.items)e+=i_(t);for(let t of r.end)e+=t.source;return e}case"document":{let e=i_(r);if(r.end)for(let t of r.end)e+=t.source;return e}default:{let e=r.source;if("end"in r&&r.end)for(let t of r.end)e+=t.source;return e}}}function i_({start:r,key:e,sep:t,value:n}){let i="";for(let s of r)i+=s.source;if(e&&(i+=s_(e)),t)for(let s of t)i+=s.source;return n&&(i+=s_(n)),i}var $ue,jue=v(()=>{$ue=r=>"type"in r?s_(r):i_(r)});function Qu(r,e){"type"in r&&r.type==="document"&&(r={start:r.start,value:r.value}),Bue(Object.freeze([]),r,e)}function Bue(r,e,t){let n=t(e,r);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a{Aj=Symbol("break visit"),LHe=Symbol("skip children"),zue=Symbol("remove item");Qu.BREAK=Aj;Qu.SKIP=LHe;Qu.REMOVE=zue;Qu.itemAtPath=(r,e)=>{let t=r;for(let[n,i]of e){let s=t==null?void 0:t[n];if(s&&"items"in s)t=s.items[i];else return}return t};Qu.parentCollection=(r,e)=>{let t=Qu.itemAtPath(r,e.slice(0,-1)),n=e[e.length-1][0],i=t==null?void 0:t[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")}});var Nj={};et(Nj,{BOM:()=>hS,DOCUMENT:()=>gS,FLOW_END:()=>yS,SCALAR:()=>_y,createScalarToken:()=>Rue,isCollection:()=>FHe,isScalar:()=>$He,prettyToken:()=>jHe,resolveAsScalar:()=>Nue,setScalarValue:()=>Oue,stringify:()=>$ue,tokenType:()=>Ij,visit:()=>Qu});function jHe(r){switch(r){case hS:return"";case gS:return"";case yS:return"";case _y:return"";default:return JSON.stringify(r)}}function Ij(r){switch(r){case hS:return"byte-order-mark";case gS:return"doc-mode";case yS:return"flow-error-end";case _y:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(r[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}var hS,gS,yS,_y,FHe,$He,a_=v(()=>{Fue();jue();que();hS="\uFEFF",gS="",yS="",_y="",FHe=r=>!!r&&"items"in r,$He=r=>!!r&&(r.type==="scalar"||r.type==="single-quoted-scalar"||r.type==="double-quoted-scalar"||r.type==="block-scalar")});function Xo(r){switch(r){case void 0:case" ":case` `:case"\r":case" ":return!0;default:return!1}}var Hue,zHe,o_,BHe,Rj,My,Oj=v(()=>{a_();Hue=new Set("0123456789ABCDEFabcdef"),zHe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),o_=new Set(",[]{}"),BHe=new Set(` ,[]{} \r `),Rj=r=>!r||BHe.has(r),My=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){var i;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=(i=this.next)!=null?i:"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===` `?!0:t==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return t===` `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Xo(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Xo(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Xo(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Rj),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Xo(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":t+=1;break;case` `:e=s,t=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let o=s;for(;a===" ";)a=this.buffer[--s];if(a===` `&&s>=this.pos&&s+1+t>o)e=s;else break}while(!0);return yield _y,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Xo(s)||e&&o_.has(s))break;t=n}else if(Xo(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===` `?(n+=1,i=` `,s=this.buffer[n+1]):t=n),s==="#"||e&&o_.has(s))break;if(i===` `){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&o_.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield _y,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Rj))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(Xo(t)||e&&o_.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Xo(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(zHe.has(t))t=this.buffer[++e];else if(t==="%"&&Hue.has(this.buffer[e+1])&&Hue.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}});var Ay,Lj=v(()=>{Ay=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[s]=0;)switch(r[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=r[++e])==null?void 0:t.type)==="space";);return r.splice(e,r.length)}function Vue(r){if(r.start.type==="flow-seq-start")for(let e of r.items)e.sep&&!e.value&&!Ju(e.start,"explicit-key-ind")&&!Ju(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Wue(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var cf,Fj=v(()=>{a_();Oj();cf=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new My,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Ij(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e!=null?e:this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Vue(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Uue(i.start)===-1&&(t.indent===0||i.start.every(s=>s.type!=="comment"||s.indent=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,s=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",a=[];if(s&&t.sep&&!t.value){let o=[];for(let l=0;le.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ju(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(Wue(t.key)&&!Ju(t.sep,"newline")){let o=Iy(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if(Ju(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Iy(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:a,key:null,sep:[this.sourceToken]}):Ju(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||t.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Ju(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2],s=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Ju(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=l_(n),s=Iy(i);Vue(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(` `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(` `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=l_(e),n=Iy(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=l_(e),n=Iy(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}});function Yue(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new Ay||null,prettyErrors:e}}function Gue(r,e={}){let{lineCounter:t,prettyErrors:n}=Yue(e),i=new cf(t==null?void 0:t.addNewLine),s=new lf(e),a=Array.from(s.compose(i.parse(r)));if(n&&t)for(let o of a)o.errors.forEach(dS(r,t)),o.warnings.forEach(dS(r,t));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function $j(r,e={}){let{lineCounter:t,prettyErrors:n}=Yue(e),i=new cf(t==null?void 0:t.addNewLine),s=new lf(e),a=null;for(let o of s.compose(i.parse(r),!0,r.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new ka(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(a.errors.forEach(dS(r,t)),a.warnings.forEach(dS(r,t))),a}function Kue(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=$j(r,t);if(!i)return null;if(i.warnings.forEach(s=>IP(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Zue(r,e,t){var i;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(r===void 0){let{keepUndefined:s}=(i=t!=null?t:e)!=null?i:{};if(!s)return}return ro(r)&&!n?r.toString(t):new Hl(r,n,t).toString(t)}var Que=v(()=>{_j();cS();uS();X$();Gt();Lj();Fj()});var jj={};et(jj,{Alias:()=>Bl,CST:()=>Nj,Composer:()=>lf,Document:()=>Hl,Lexer:()=>My,LineCounter:()=>Ay,Pair:()=>tn,Parser:()=>cf,Scalar:()=>we,Schema:()=>xy,YAMLError:()=>Dy,YAMLMap:()=>mn,YAMLParseError:()=>ka,YAMLSeq:()=>ui,YAMLWarning:()=>Cy,isAlias:()=>Ta,isCollection:()=>sr,isDocument:()=>ro,isMap:()=>no,isNode:()=>Rt,isPair:()=>Pt,isScalar:()=>ot,isSeq:()=>io,parse:()=>Kue,parseAllDocuments:()=>Gue,parseDocument:()=>$j,stringify:()=>Zue,visit:()=>Ko,visitAsync:()=>Vw});var zj=v(()=>{_j();cS();bj();uS();Yw();Gt();Vu();_n();Yu();Gu();a_();Oj();Lj();Fj();Que();Ww()});var Jue,Xue=v(()=>{zj();zj();Jue=jj});function c_(r,e){let t=qHe(r),n=t.frontmatter?HHe(t.frontmatter,e):{},i=UHe(t.body,e);return{frontmatter:n,body:i}}function qHe(r){var t,n;let e=r.split(` `);if(((t=e[0])==null?void 0:t.trim())==="---"){let i=-1;for(let s=1;s0){let a=e.slice(1,i).join(` `),l=e.slice(i+1).join(` `);return{frontmatter:a.trim()||null,body:l}}}return{frontmatter:null,body:r}}function HHe(r,e){try{let t=VHe(r,e),n=Jue.parse(t);return typeof n!="object"||n===null?(console.warn("Template frontmatter did not parse to a valid object"),{}):n}catch(t){return console.error("Error processing template frontmatter:",t),{}}}function UHe(r,e){return WHe(r,e)}function VHe(r,e){var k;let t=r,n=new Date,i=e.title||"",s=vS(i)?`"${df(i)}"`:i;t=t.replace(/\{\{title\}\}/g,s),t=t.replace(/\{\{priority\}\}/g,e.priority||""),t=t.replace(/\{\{status\}\}/g,e.status||"");let a=Array.isArray(e.contexts)?e.contexts.join(", "):"";t=t.replace(/\{\{contexts\}\}/g,a);let o=Array.isArray(e.tags)?e.tags.join(", "):"";t=t.replace(/\{\{tags\}\}/g,o);let l=Array.isArray(e.tags)?e.tags.map(T=>`#${T}`).join(" "):"";t=t.replace(/\{\{hashtags\}\}/g,l),t=t.replace(/\{\{timeEstimate\}\}/g,((k=e.timeEstimate)==null?void 0:k.toString())||""),t=t.replace(/\{\{dueDate\}\}/g,e.dueDate||""),t=t.replace(/\{\{scheduledDate\}\}/g,e.scheduledDate||""),t=t.replace(/\{\{details\}\}/g,e.details||"");let c=e.parentNote||"",d=c?`"${df(c)}"`:"";t=t.replace(/\{\{parentNote\}\}/g,d),t=t.replace(/\{\{date\}\}/g,P(n,"yyyy-MM-dd")),t=t.replace(/\{\{time\}\}/g,P(n,"HH:mm")),t=t.replace(/\{\{year\}\}/g,P(n,"yyyy")),t=t.replace(/\{\{month\}\}/g,P(n,"MM")),t=t.replace(/\{\{day\}\}/g,P(n,"dd")),t=t.replace(/\{\{hour\}\}/g,P(n,"HH")),t=t.replace(/\{\{minute\}\}/g,P(n,"mm")),t=t.replace(/\{\{second\}\}/g,P(n,"ss")),t=t.replace(/\{\{timestamp\}\}/g,P(n,"yyyy-MM-dd-HHmmss")),t=t.replace(/\{\{dateTime\}\}/g,P(n,"yyyy-MM-dd-HHmm")),t=t.replace(/\{\{shortDate\}\}/g,P(n,"yyMMdd")),t=t.replace(/\{\{shortYear\}\}/g,P(n,"yy")),t=t.replace(/\{\{monthName\}\}/g,P(n,"MMMM")),t=t.replace(/\{\{monthNameShort\}\}/g,P(n,"MMM")),t=t.replace(/\{\{dayName\}\}/g,P(n,"EEEE")),t=t.replace(/\{\{dayNameShort\}\}/g,P(n,"EEE")),t=t.replace(/\{\{week\}\}/g,P(n,"ww")),t=t.replace(/\{\{quarter\}\}/g,P(n,"q")),t=t.replace(/\{\{time12\}\}/g,P(n,"hh:mm a")),t=t.replace(/\{\{time24\}\}/g,P(n,"HH:mm")),t=t.replace(/\{\{hourPadded\}\}/g,P(n,"HH")),t=t.replace(/\{\{hour12\}\}/g,P(n,"hh")),t=t.replace(/\{\{ampm\}\}/g,P(n,"a")),t=t.replace(/\{\{unix\}\}/g,Math.floor(n.getTime()/1e3).toString()),t=t.replace(/\{\{unixMs\}\}/g,n.getTime().toString()),t=t.replace(/\{\{milliseconds\}\}/g,P(n,"SSS")),t=t.replace(/\{\{ms\}\}/g,P(n,"SSS")),t=t.replace(/\{\{timezone\}\}/g,P(n,"xxx")),t=t.replace(/\{\{timezoneShort\}\}/g,P(n,"xx")),t=t.replace(/\{\{utcOffset\}\}/g,P(n,"xxx")),t=t.replace(/\{\{utcOffsetShort\}\}/g,P(n,"xx")),t=t.replace(/\{\{utcZ\}\}/g,"Z");let u=P(n,"yyMMdd"),p=new Date(n);p.setHours(0,0,0,0);let m=Math.floor((n.getTime()-p.getTime())/1e3),f=`${u}${m.toString(36)}`;t=t.replace(/\{\{zettel\}\}/g,f),t=t.replace(/\{\{nano\}\}/g,Date.now().toString()+Math.random().toString(36).substring(2,7));let h=e.priority||"",g=e.status||"";t=t.replace(/\{\{priorityShort\}\}/g,h.substring(0,1).toUpperCase()),t=t.replace(/\{\{statusShort\}\}/g,g.substring(0,1).toUpperCase());let y=e.title||"";if(t=t.replace(/\{\{titleLower\}\}/g,y.toLowerCase()),t=t.replace(/\{\{titleUpper\}\}/g,y.toUpperCase()),t=t.replace(/\{\{titleSnake\}\}/g,y.toLowerCase().replace(/\s+/g,"_")),t=t.replace(/\{\{titleKebab\}\}/g,y.toLowerCase().replace(/\s+/g,"-")),t=t.replace(/\{\{titleCamel\}\}/g,y.replace(/(?:^\w|[A-Z]|\b\w)/g,(T,w)=>w===0?T.toLowerCase():T.toUpperCase()).replace(/\s+/g,"")),t=t.replace(/\{\{titlePascal\}\}/g,y.replace(/(?:^\w|[A-Z]|\b\w)/g,T=>T.toUpperCase()).replace(/\s+/g,"")),"icsEventTitle"in e){let T=e,w=T.icsEventTitle||"",S=vS(w)?`"${df(w)}"`:w;t=t.replace(/\{\{icsEventTitle\}\}/g,S),t=t.replace(/\{\{icsEventStart\}\}/g,T.icsEventStart||""),t=t.replace(/\{\{icsEventEnd\}\}/g,T.icsEventEnd||"");let E=T.icsEventLocation||"",C=E&&vS(E)?`"${df(E)}"`:E;t=t.replace(/\{\{icsEventLocation\}\}/g,C);let D=T.icsEventDescription||"",A=D&&vS(D)?`"${df(D)}"`:D;t=t.replace(/\{\{icsEventDescription\}\}/g,A),t=t.replace(/\{\{icsEventUrl\}\}/g,T.icsEventUrl||"");let N=T.icsEventSubscription||"",V=N&&vS(N)?`"${df(N)}"`:N;t=t.replace(/\{\{icsEventSubscription\}\}/g,V);let R=T.icsEventId||"",I=R?`"${df(R)}"`:"";t=t.replace(/\{\{icsEventId\}\}/g,I)}return t}function vS(r){if(!r)return!1;let e=/[[\]{}:>|*&!%#`@,]/,t=/^[-?]/,n=/^\d+\.?\d*$/,i=/^(true|false|yes|no|on|off)$/i;return e.test(r)||t.test(r)||n.test(r)||i.test(r)}function df(r){return r?r.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):""}function WHe(r,e){var f;let t=r,n=new Date;t=t.replace(/\{\{title\}\}/g,e.title||""),t=t.replace(/\{\{priority\}\}/g,e.priority||""),t=t.replace(/\{\{status\}\}/g,e.status||"");let i=Array.isArray(e.contexts)?e.contexts.join(", "):"";t=t.replace(/\{\{contexts\}\}/g,i);let s=Array.isArray(e.tags)?e.tags.join(", "):"";t=t.replace(/\{\{tags\}\}/g,s);let a=Array.isArray(e.tags)?e.tags.map(h=>`#${h}`).join(" "):"";t=t.replace(/\{\{hashtags\}\}/g,a),t=t.replace(/\{\{timeEstimate\}\}/g,((f=e.timeEstimate)==null?void 0:f.toString())||""),t=t.replace(/\{\{dueDate\}\}/g,e.dueDate||""),t=t.replace(/\{\{scheduledDate\}\}/g,e.scheduledDate||""),t=t.replace(/\{\{details\}\}/g,e.details||""),t=t.replace(/\{\{parentNote\}\}/g,e.parentNote||""),t=t.replace(/\{\{date\}\}/g,P(n,"yyyy-MM-dd")),t=t.replace(/\{\{time\}\}/g,P(n,"HH:mm")),t=t.replace(/\{\{year\}\}/g,P(n,"yyyy")),t=t.replace(/\{\{month\}\}/g,P(n,"MM")),t=t.replace(/\{\{day\}\}/g,P(n,"dd")),t=t.replace(/\{\{hour\}\}/g,P(n,"HH")),t=t.replace(/\{\{minute\}\}/g,P(n,"mm")),t=t.replace(/\{\{second\}\}/g,P(n,"ss")),t=t.replace(/\{\{timestamp\}\}/g,P(n,"yyyy-MM-dd-HHmmss")),t=t.replace(/\{\{dateTime\}\}/g,P(n,"yyyy-MM-dd-HHmm")),t=t.replace(/\{\{shortDate\}\}/g,P(n,"yyMMdd")),t=t.replace(/\{\{shortYear\}\}/g,P(n,"yy")),t=t.replace(/\{\{monthName\}\}/g,P(n,"MMMM")),t=t.replace(/\{\{monthNameShort\}\}/g,P(n,"MMM")),t=t.replace(/\{\{dayName\}\}/g,P(n,"EEEE")),t=t.replace(/\{\{dayNameShort\}\}/g,P(n,"EEE")),t=t.replace(/\{\{week\}\}/g,P(n,"ww")),t=t.replace(/\{\{quarter\}\}/g,P(n,"q")),t=t.replace(/\{\{time12\}\}/g,P(n,"hh:mm a")),t=t.replace(/\{\{time24\}\}/g,P(n,"HH:mm")),t=t.replace(/\{\{hourPadded\}\}/g,P(n,"HH")),t=t.replace(/\{\{hour12\}\}/g,P(n,"hh")),t=t.replace(/\{\{ampm\}\}/g,P(n,"a")),t=t.replace(/\{\{unix\}\}/g,Math.floor(n.getTime()/1e3).toString()),t=t.replace(/\{\{unixMs\}\}/g,n.getTime().toString()),t=t.replace(/\{\{milliseconds\}\}/g,P(n,"SSS")),t=t.replace(/\{\{ms\}\}/g,P(n,"SSS")),t=t.replace(/\{\{timezone\}\}/g,P(n,"xxx")),t=t.replace(/\{\{timezoneShort\}\}/g,P(n,"xx")),t=t.replace(/\{\{utcOffset\}\}/g,P(n,"xxx")),t=t.replace(/\{\{utcOffsetShort\}\}/g,P(n,"xx")),t=t.replace(/\{\{utcZ\}\}/g,"Z");let o=P(n,"yyMMdd"),l=new Date(n);l.setHours(0,0,0,0);let c=Math.floor((n.getTime()-l.getTime())/1e3),d=`${o}${c.toString(36)}`;t=t.replace(/\{\{zettel\}\}/g,d),t=t.replace(/\{\{nano\}\}/g,Date.now().toString()+Math.random().toString(36).substring(2,7));let u=e.priority||"",p=e.status||"";t=t.replace(/\{\{priorityShort\}\}/g,u.substring(0,1).toUpperCase()),t=t.replace(/\{\{statusShort\}\}/g,p.substring(0,1).toUpperCase());let m=e.title||"";if(t=t.replace(/\{\{titleLower\}\}/g,m.toLowerCase()),t=t.replace(/\{\{titleUpper\}\}/g,m.toUpperCase()),t=t.replace(/\{\{titleSnake\}\}/g,m.toLowerCase().replace(/\s+/g,"_")),t=t.replace(/\{\{titleKebab\}\}/g,m.toLowerCase().replace(/\s+/g,"-")),t=t.replace(/\{\{titleCamel\}\}/g,m.replace(/(?:^\w|[A-Z]|\b\w)/g,(h,g)=>g===0?h.toLowerCase():h.toUpperCase()).replace(/\s+/g,"")),t=t.replace(/\{\{titlePascal\}\}/g,m.replace(/(?:^\w|[A-Z]|\b\w)/g,h=>h.toUpperCase()).replace(/\s+/g,"")),"icsEventTitle"in e){let h=e;t=t.replace(/\{\{icsEventTitle\}\}/g,h.icsEventTitle||""),t=t.replace(/\{\{icsEventStart\}\}/g,h.icsEventStart||""),t=t.replace(/\{\{icsEventEnd\}\}/g,h.icsEventEnd||""),t=t.replace(/\{\{icsEventLocation\}\}/g,h.icsEventLocation||""),t=t.replace(/\{\{icsEventDescription\}\}/g,h.icsEventDescription||""),t=t.replace(/\{\{icsEventUrl\}\}/g,h.icsEventUrl||""),t=t.replace(/\{\{icsEventSubscription\}\}/g,h.icsEventSubscription||""),t=t.replace(/\{\{icsEventId\}\}/g,h.icsEventId||"")}return t}function epe(r,e){return{...e,...r}}var d_=v(()=>{Tn();Xue()});function u_(r,e={}){if(!r)return r;let{date:t=new Date,taskData:n,icsData:i,extractProjectBasename:s}=e,a=r;if(n){let c=Array.isArray(n.contexts)&&n.contexts.length>0?n.contexts[0]:"";a=a.replace(/\{\{context\}\}/g,c);let d=Array.isArray(n.projects)&&n.projects.length>0?s?s(n.projects[0]):n.projects[0]:"";a=a.replace(/\{\{project\}\}/g,d);let u=Array.isArray(n.projects)&&n.projects.length>0?n.projects.map(N=>s?s(N):N).join("/"):"";a=a.replace(/\{\{projects\}\}/g,u);let p=Array.isArray(n.contexts)&&n.contexts.length>0?n.contexts.join("/"):"";a=a.replace(/\{\{contexts\}\}/g,p);let m=n.priority||"";a=a.replace(/\{\{priority\}\}/g,m);let f=n.status||"";a=a.replace(/\{\{status\}\}/g,f);let h=n.title?n.title.replace(/[<>:"/\\|?*]/g,"_"):"";a=a.replace(/\{\{title\}\}/g,h);let g=n.due||"";a=a.replace(/\{\{dueDate\}\}/g,g);let y=n.scheduled||"";a=a.replace(/\{\{scheduledDate\}\}/g,y);let k=m?m.substring(0,1).toUpperCase():"";a=a.replace(/\{\{priorityShort\}\}/g,k);let T=f?f.substring(0,1).toUpperCase():"";a=a.replace(/\{\{statusShort\}\}/g,T);let w=h?h.toLowerCase():"";a=a.replace(/\{\{titleLower\}\}/g,w);let S=h?h.toUpperCase():"";a=a.replace(/\{\{titleUpper\}\}/g,S);let E=h?h.toLowerCase().replace(/\s+/g,"_"):"";a=a.replace(/\{\{titleSnake\}\}/g,E);let C=h?h.toLowerCase().replace(/\s+/g,"-"):"";a=a.replace(/\{\{titleKebab\}\}/g,C);let D=h?h.replace(/(?:^\w|[A-Z]|\b\w)/g,(N,V)=>V===0?N.toLowerCase():N.toUpperCase()).replace(/\s+/g,""):"";a=a.replace(/\{\{titleCamel\}\}/g,D);let A=h?h.replace(/(?:^\w|[A-Z]|\b\w)/g,N=>N.toUpperCase()).replace(/\s+/g,""):"";a=a.replace(/\{\{titlePascal\}\}/g,A)}if(i){let c=i.title?i.title.replace(/[<>:"/\\|?*]/g,"_"):"";a=a.replace(/\{\{icsEventTitle\}\}/g,c);let d=c?c.toLowerCase():"";a=a.replace(/\{\{icsEventTitleLower\}\}/g,d);let u=c?c.toUpperCase():"";a=a.replace(/\{\{icsEventTitleUpper\}\}/g,u);let p=c?c.toLowerCase().replace(/\s+/g,"_"):"";a=a.replace(/\{\{icsEventTitleSnake\}\}/g,p);let m=c?c.toLowerCase().replace(/\s+/g,"-"):"";a=a.replace(/\{\{icsEventTitleKebab\}\}/g,m);let f=c?c.replace(/(?:^\w|[A-Z]|\b\w)/g,(k,T)=>T===0?k.toLowerCase():k.toUpperCase()).replace(/\s+/g,""):"";a=a.replace(/\{\{icsEventTitleCamel\}\}/g,f);let h=c?c.replace(/(?:^\w|[A-Z]|\b\w)/g,k=>k.toUpperCase()).replace(/\s+/g,""):"";a=a.replace(/\{\{icsEventTitlePascal\}\}/g,h);let g=i.location?i.location.replace(/[<>:"/\\|?*]/g,"_"):"";a=a.replace(/\{\{icsEventLocation\}\}/g,g);let y=i.description?i.description.replace(/[<>:"/\\|?*]/g,"_"):"";a=a.replace(/\{\{icsEventDescription\}\}/g,y)}a=a.replace(/\{\{year\}\}/g,P(t,"yyyy")),a=a.replace(/\{\{month\}\}/g,P(t,"MM")),a=a.replace(/\{\{day\}\}/g,P(t,"dd")),a=a.replace(/\{\{date\}\}/g,P(t,"yyyy-MM-dd")),a=a.replace(/\{\{time\}\}/g,P(t,"HHmmss")),a=a.replace(/\{\{timestamp\}\}/g,P(t,"yyyy-MM-dd-HHmmss")),a=a.replace(/\{\{dateTime\}\}/g,P(t,"yyyy-MM-dd-HHmm")),a=a.replace(/\{\{hour\}\}/g,P(t,"HH")),a=a.replace(/\{\{minute\}\}/g,P(t,"mm")),a=a.replace(/\{\{second\}\}/g,P(t,"ss")),a=a.replace(/\{\{shortDate\}\}/g,P(t,"yyMMdd")),a=a.replace(/\{\{shortYear\}\}/g,P(t,"yy")),a=a.replace(/\{\{monthName\}\}/g,P(t,"MMMM")),a=a.replace(/\{\{monthNameShort\}\}/g,P(t,"MMM")),a=a.replace(/\{\{dayName\}\}/g,P(t,"EEEE")),a=a.replace(/\{\{dayNameShort\}\}/g,P(t,"EEE")),a=a.replace(/\{\{week\}\}/g,P(t,"ww")),a=a.replace(/\{\{quarter\}\}/g,P(t,"q")),a=a.replace(/\{\{time12\}\}/g,P(t,"hh:mm a")),a=a.replace(/\{\{time24\}\}/g,P(t,"HH:mm")),a=a.replace(/\{\{hourPadded\}\}/g,P(t,"HH")),a=a.replace(/\{\{hour12\}\}/g,P(t,"hh")),a=a.replace(/\{\{ampm\}\}/g,P(t,"a")),a=a.replace(/\{\{unix\}\}/g,Math.floor(t.getTime()/1e3).toString()),a=a.replace(/\{\{unixMs\}\}/g,t.getTime().toString()),a=a.replace(/\{\{milliseconds\}\}/g,P(t,"SSS")),a=a.replace(/\{\{ms\}\}/g,P(t,"SSS")),a=a.replace(/\{\{timezone\}\}/g,P(t,"xxx")),a=a.replace(/\{\{timezoneShort\}\}/g,P(t,"xx")),a=a.replace(/\{\{utcOffset\}\}/g,P(t,"xxx")),a=a.replace(/\{\{utcOffsetShort\}\}/g,P(t,"xx")),a=a.replace(/\{\{utcZ\}\}/g,"Z");let o=(()=>{let c=P(t,"yyMMdd"),d=new Date(t);d.setHours(0,0,0,0);let p=Math.floor((t.getTime()-d.getTime())/1e3).toString(36);return`${c}${p}`})();a=a.replace(/\{\{zettel\}\}/g,o);let l=Date.now().toString()+Math.random().toString(36).substring(2,7);return a=a.replace(/\{\{nano\}\}/g,l),a}var Bj=v(()=>{Tn()});function tpe(r,e){if(!r||!e)throw new Error("Invalid context or settings provided");if(!r.title||typeof r.title!="string")throw new Error("Context must have a valid title");if(r.title.trim().length===0)throw new Error("Title cannot be empty");let t=r.date||new Date;if(!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid date provided in context");try{let n=e.icsIntegration;if(n)switch(n.icsNoteFilenameFormat){case"title":return rn(r.title);case"zettel":return uf(t);case"timestamp":return npe(t);case"custom":{let i={icsEventTitle:r.icsEventTitle?rn(r.icsEventTitle):rn(r.title),icsEventLocation:r.icsEventLocation?rn(r.icsEventLocation):"",icsEventDescription:r.icsEventDescription?rn(r.icsEventDescription.substring(0,50)):"",icsEventTitleWithDate:rn(`${r.icsEventTitle||r.title} - ${P(t,"PPP")}`)};return ipe(r,n.customICSNoteFilenameTemplate,t,i)}default:return rn(r.title)}return rn(r.title)}catch(n){return console.error("Error generating ICS note filename:",n),rn(r.title)}}function rpe(r,e){if(!r||!e)throw new Error("Invalid context or settings provided");if(!r.title||typeof r.title!="string")throw new Error("Context must have a valid title");if(r.title.trim().length===0)throw new Error("Title cannot be empty");let t=r.date||new Date;if(!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid date provided in context");if(e.storeTitleInFilename)return rn(r.title);try{switch(e.taskFilenameFormat){case"title":return rn(r.title);case"zettel":return uf(t);case"timestamp":return npe(t);case"custom":return ipe(r,e.customFilenameTemplate,t);default:return uf(t)}}catch(n){return console.error("Error generating filename:",n),uf(t)}}function uf(r){let e=P(r,"yyMMdd"),t=new Date(r);t.setHours(0,0,0,0);let i=Math.floor((r.getTime()-t.getTime())/1e3).toString(36);return`${e}${i}`}function npe(r){return P(r,"yyyy-MM-dd-HHmmss")}function ipe(r,e,t,n){var i;if(!r||!e||!t)throw new Error("Invalid inputs for custom filename generation");if(typeof e!="string"||e.trim().length===0)throw new Error("Template must be a non-empty string");if(!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid date for filename generation");try{let s=rn(r.title),a=r.priority&&["low","normal","medium","high"].includes(r.priority)?r.priority:"normal",o=r.status?rn(r.status):"open",l=Array.isArray(r.contexts)?r.contexts:[],c=Array.isArray(r.tags)?r.tags:[],d={title:s,date:P(t,"yyyy-MM-dd"),time:P(t,"HHmmss"),priority:a,status:o,timestamp:P(t,"yyyy-MM-dd-HHmmss"),dateTime:P(t,"yyyy-MM-dd-HHmm"),year:P(t,"yyyy"),month:P(t,"MM"),day:P(t,"dd"),hour:P(t,"HH"),minute:P(t,"mm"),second:P(t,"ss"),dueDate:r.dueDate||"",scheduledDate:r.scheduledDate||"",context:l[0]?rn(l[0]):"",contexts:l.map(p=>rn(p)).join("/"),tags:c.map(p=>rn(p)).join(", "),hashtags:c.map(p=>`#${rn(p)}`).join(" "),timeEstimate:((i=r.timeEstimate)==null?void 0:i.toString())||"",details:r.details?rn(r.details.substring(0,50)):"",parentNote:r.parentNote?rn(r.parentNote):"",shortDate:P(t,"yyMMdd"),shortYear:P(t,"yy"),monthName:P(t,"MMMM"),monthNameShort:P(t,"MMM"),dayName:P(t,"EEEE"),dayNameShort:P(t,"EEE"),week:P(t,"ww"),quarter:P(t,"q"),time12:P(t,"hh:mm a"),time24:P(t,"HH:mm"),hourPadded:P(t,"HH"),hour12:P(t,"hh"),ampm:P(t,"a"),unix:Math.floor(t.getTime()/1e3).toString(),unixMs:t.getTime().toString(),milliseconds:P(t,"SSS"),ms:P(t,"SSS"),timezone:P(t,"xxx"),timezoneShort:P(t,"xx"),utcOffset:P(t,"xxx"),utcOffsetShort:P(t,"xx"),utcZ:"Z",priorityShort:a.substring(0,1).toUpperCase(),statusShort:o.substring(0,1).toUpperCase(),titleLower:s.toLowerCase(),titleUpper:s.toUpperCase(),titleSnake:s.toLowerCase().replace(/\s+/g,"_"),titleKebab:s.toLowerCase().replace(/\s+/g,"-"),titleCamel:s.replace(/(?:^\w|[A-Z]|\b\w)/g,(p,m)=>m===0?p.toLowerCase():p.toUpperCase()).replace(/\s+/g,""),titlePascal:s.replace(/(?:^\w|[A-Z]|\b\w)/g,p=>p.toUpperCase()).replace(/\s+/g,""),zettel:uf(t),nano:Date.now().toString()+Math.random().toString(36).substring(2,7),...n||{}},u=e;if(e.length>500)throw new Error("Template too long");return Object.entries(d).forEach(([p,m])=>{try{let f=new RegExp(`\\{\\{${p}\\}\\}`,"g");u=u.replace(f,m);let h=new RegExp(`\\{${p}\\}`,"g");u=u.replace(h,m)}catch(f){console.warn(`Error replacing template variable ${p}:`,f)}}),u=u.replace(/\{\{[^}]+\}\}/g,""),u=u.replace(/\{[^}]+\}/g,""),u.trim()||(u=s||uf(t)),rn(u)}catch(s){return console.error("Error generating custom filename:",s),rn(r.title)||uf(t)}}function rn(r){if(!r||typeof r!="string")return"untitled";try{let e=r.trim().replace(/\s+/g," ").replace(/[<>:"/\\|?*#[\]]/g,"").replace(/./g,n=>{let i=n.charCodeAt(0);return i<=31||i>=127&&i<=159?"":n}).replace(/^\.+|\.+$/g,"").trim();return(!e||e.length===0)&&(e="untitled"),["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"].includes(e.toUpperCase())&&(e=`task-${e}`),e}catch(e){return console.error("Error sanitizing filename:",e),"untitled"}}async function Ny(r,e,t){if(!r||typeof r!="string")throw new Error("Base filename must be a non-empty string");if(typeof e!="string")throw new Error("Folder path must be a string");if(!t)throw new Error("Vault must be provided");let n=rn(r);if(!n)throw new Error("Base filename cannot be sanitized to a valid name");let i=e.replace(/\.\./g,"").trim();try{let s=(0,qj.normalizePath)(`${i}/${n}.md`);if(s.length>260)throw new Error("Generated path too long");if(!t.getAbstractFileByPath(s))return n;for(let l=2;l<=999;l++){let c=`${n}-${l}`,d=(0,qj.normalizePath)(`${i}/${c}.md`);if(d.length>260)break;if(!t.getAbstractFileByPath(d))return c}let a=Date.now().toString(36),o=`${n.substring(0,50)}-${a}`;return rn(o)}catch(s){return console.error("Error generating unique filename:",s),`task-${Date.now().toString(36)}`}}var qj,p_=v(()=>{Tn();qj=require("obsidian")});var spe,m_,ape=v(()=>{spe=require("obsidian");On();gT();p_();Cr();Qe();jr();d_();m_=class{constructor(e){this.deps=e}setWebhookNotifier(e){this.deps.webhookNotifier=e}async createTask(e,t={}){var s;let{applyDefaults:n=!0}=t,{plugin:i}=this.deps;try{if(n&&(e=await this.deps.applyTaskCreationDefaults(e)),!e.title||!e.title.trim())throw new Error("Title is required");let a=i.settings.storeTitleInFilename?this.deps.sanitizeTitleForFilename(e.title.trim()):this.deps.sanitizeTitleForStorage(e.title.trim()),o=e.priority||i.settings.defaultTaskPriority,l=e.status||i.settings.defaultTaskStatus,c=e.dateCreated||Ve(),d=e.dateModified||Ve(),u=e.contexts||[],p=e.projects||[],m=e.tags||[];i.settings.taskIdentificationMethod==="tag"&&(m.includes(i.settings.taskTag)||(m=[i.settings.taskTag,...m]));let f={title:a,priority:o,status:l,date:new Date,dueDate:e.due,scheduledDate:e.scheduled},h=rpe(f,i.settings),g=await this.resolveTargetFolder(e);g&&await Nm(i.app.vault,g);let y=await Ny(h,g,i.app.vault),k=g?`${g}/${y}.md`:`${y}.md`,T={title:a,status:l,priority:o,due:e.due||void 0,scheduled:e.scheduled||void 0,contexts:u.length>0?u:void 0,projects:p.length>0?p:void 0,timeEstimate:e.timeEstimate&&e.timeEstimate>0?e.timeEstimate:void 0,dateCreated:c,dateModified:d,recurrence:e.recurrence||void 0,recurrence_anchor:e.recurrence_anchor||void 0,reminders:e.reminders&&e.reminders.length>0?e.reminders:void 0,icsEventId:e.icsEventId||void 0},w=i.fieldMapper.getUserFields();if(w.length>0){let z=e,B=T;for(let W of w)Object.prototype.hasOwnProperty.call(z,W.key)&&z[W.key]!==void 0&&(B[W.key]=z[W.key])}if(T.recurrence&&typeof T.recurrence=="string"&&!T.recurrence.includes("DTSTART:")){let z={...T,title:a,status:l,priority:o,path:"",archived:!1},B=nd(z);B&&(T.recurrence=B)}let E=i.settings.taskIdentificationMethod==="tag"?i.settings.taskTag:void 0,C=i.fieldMapper.mapToFrontmatter(T,E,i.settings.storeTitleInFilename);if(i.settings.taskIdentificationMethod==="property"){let z=i.settings.taskPropertyName,B=i.settings.taskPropertyValue;if(z&&B){let W=B.toLowerCase(),Y=W==="true"||W==="false"?W==="true":B;C[z]=Y}m.length>0&&(C.tags=m)}else C.tags=m;let D=await this.deps.applyTemplate(e),A=D.body?D.body.replace(/\r\n/g,` `).trimEnd():e.details?e.details.replace(/\r\n/g,` `).trimEnd():"",N=epe(C,D.frontmatter);e.customFrontmatter&&(N={...N,...e.customFrontmatter});let R=`--- ${(0,spe.stringifyYaml)(N)}--- `;A.length>0&&(R+=`${A} `);let I=await i.app.vault.create(k,R),O={...T,...N,title:ie(N.title||T.title||a),status:ie(N.status||T.status||l),priority:ie(N.priority||T.priority||o),path:I.path,tags:m,archived:!1,details:A};try{i.cacheManager.waitForFreshTaskData&&await i.cacheManager.waitForFreshTaskData(I),i.cacheManager.updateTaskInfoInCache(I.path,O)}catch(z){console.error("Error updating cache for new task:",z)}if(i.emitter.trigger(Vt,{path:I.path,updatedTask:O}),this.deps.webhookNotifier)try{await this.deps.webhookNotifier.triggerWebhook("task.created",{task:O})}catch(z){console.warn("Failed to trigger webhook for task creation:",z)}return(s=i.taskCalendarSyncService)!=null&&s.isEnabled()&&i.settings.googleCalendarExport.syncOnTaskCreate&&i.taskCalendarSyncService.syncTaskToCalendar(O).catch(z=>{console.warn("Failed to sync task to Google Calendar:",z)}),{file:I,taskInfo:O}}catch(a){let o=a instanceof Error?a.message:String(a);throw console.error("Error creating task:",{error:o,stack:a instanceof Error?a.stack:void 0,taskData:e}),new Error(`Failed to create task: ${o}`)}}async resolveTargetFolder(e){var s;let{plugin:t}=this.deps,n="";if(e.creationContext==="inline-conversion"||e.creationContext==="modal-inline-creation"){let a=t.settings.inlineTaskConvertFolder||"";if(a.trim()){if(n=a,a.includes("{{currentNotePath}}")||a.includes("{{currentNoteTitle}}")){let l=t.app.workspace.getActiveFile();if(a.includes("{{currentNotePath}}")){let c=((s=l==null?void 0:l.parent)==null?void 0:s.path)||"";n=n.replace(/\{\{currentNotePath\}\}/g,c)}if(a.includes("{{currentNoteTitle}}")){let c=(l==null?void 0:l.basename)||"";n=n.replace(/\{\{currentNoteTitle\}\}/g,c)}}return this.deps.processFolderTemplate(n,e)}let o=t.settings.tasksFolder||"";return this.deps.processFolderTemplate(o,e)}let i=t.settings.tasksFolder||"";return this.deps.processFolderTemplate(i,e)}}});var f_,h_,ope=v(()=>{f_=require("obsidian");On();gT();Cr();p_();Qe();h_=class{constructor(e){this.deps=e}setWebhookNotifier(e){this.deps.webhookNotifier=e}setAutoArchiveService(e){this.deps.autoArchiveService=e}async updateTask(e,t){var i;let{plugin:n}=this.deps;try{let s=n.app.vault.getAbstractFileByPath(e.path);if(!(s instanceof f_.TFile))throw new Error(`Cannot find task file: ${e.path}`);Array.isArray(t.timeEntries)&&(t.timeEntries=t.timeEntries.map(u=>{let p={...u};return delete p.duration,p}));let a=n.settings.storeTitleInFilename&&t.title&&t.title!==e.title,o=e.path;if(a&&t.title){let u=s.parent?s.parent.path:"",p=await Ny(t.title,u,n.app.vault);o=u?`${u}/${p}.md`:`${p}.md`}let l=this.getRecurrenceUpdates(e,t),c=null;if(Object.prototype.hasOwnProperty.call(t,"details")&&(c=typeof t.details=="string"?t.details.replace(/\r\n/g,` `):""),await n.app.fileManager.processFrontMatter(s,u=>{let p={...e,...t,...l,dateModified:Ve()},m=n.fieldMapper.mapToFrontmatter(p,n.settings.taskIdentificationMethod==="tag"?n.settings.taskTag:void 0,n.settings.storeTitleInFilename);if(Object.entries(m).forEach(([h,g])=>{g!==void 0&&(u[h]=g)}),t.status!==void 0&&this.deps.updateCompletedDateInFrontmatter(u,t.status,!!e.recurrence),n.settings.taskIdentificationMethod==="property"){let h=n.settings.taskPropertyName,g=n.settings.taskPropertyValue;if(h&&g){let y=g.toLowerCase(),k=y==="true"||y==="false"?y==="true":g;u[h]=k}}let f=t.customFrontmatter;if(f&&Object.entries(f).forEach(([h,g])=>{g===null?delete u[h]:u[h]=g}),this.removeUnsetMappedFields(u,t),a&&delete u[n.fieldMapper.toUserField("title")],Object.prototype.hasOwnProperty.call(t,"tags")){let h=Array.isArray(t.tags)?[...t.tags]:[];h.length>0?u.tags=h:delete u.tags}}),a&&await n.app.fileManager.renameFile(s,o),c!==null){let u=n.app.vault.getAbstractFileByPath(o);if(u instanceof f_.TFile){let p=await n.app.vault.read(u),{frontmatter:m}=Cg(p),f=m!==null?`--- ${m} --- `:"",h=c.trimEnd(),g=h.length>0?`${h} `:"";await n.app.vault.modify(u,`${f}${g}`)}}let d={...e,...t,...l,path:o,dateModified:Ve()};c!==null&&(d.details=c),t.status!==void 0&&!e.recurrence&&(n.statusManager.isCompletedStatus(t.status)?e.completedDate||(d.completedDate=mg()):d.completedDate=void 0),a&&n.cacheManager.clearCacheEntry(e.path);try{let u=n.app.vault.getAbstractFileByPath(o);if(u instanceof f_.TFile&&n.cacheManager.waitForFreshTaskData){let p={};t.title!==void 0&&(p.title=t.title),t.status!==void 0&&(p.status=t.status),t.priority!==void 0&&(p.priority=t.priority),Object.keys(p).length>0&&await n.cacheManager.waitForFreshTaskData(u)}n.cacheManager.updateTaskInfoInCache(o,d)}catch(u){console.error("Error updating task cache:",{error:u instanceof Error?u.message:String(u),taskPath:o})}try{n.emitter.trigger(Vt,{path:o,originalTask:e,updatedTask:d})}catch(u){console.error("Error emitting task update event:",{error:u instanceof Error?u.message:String(u),taskPath:o})}if(this.deps.webhookNotifier)try{let u=n.statusManager.isCompletedStatus(e.status),p=n.statusManager.isCompletedStatus(d.status);!u&&p?await this.deps.webhookNotifier.triggerWebhook("task.completed",{task:d}):await this.deps.webhookNotifier.triggerWebhook("task.updated",{task:d,previous:e})}catch(u){console.warn("Failed to trigger webhook for task update:",u)}if((i=n.taskCalendarSyncService)!=null&&i.isEnabled()){let u=n.statusManager.isCompletedStatus(e.status),p=n.statusManager.isCompletedStatus(d.status);(!u&&p?n.taskCalendarSyncService.completeTaskInCalendar(d):n.taskCalendarSyncService.updateTaskInCalendar(d,e)).catch(f=>{console.warn("Failed to sync task update to Google Calendar:",f)})}return await this.handleAutoArchive(e,d,t.status),d}catch(s){let a=s instanceof Error?s.message:String(s);throw console.error("Error updating task:",{error:a,stack:s instanceof Error?s.stack:void 0,taskPath:e.path,updates:t}),new Error(`Failed to update task: ${a}`)}}getRecurrenceUpdates(e,t){let{plugin:n}=this.deps,i={};if(t.recurrence!==void 0&&t.recurrence!==e.recurrence){let s={...e,...t},a=Am(s,n.settings.maintainDueDateOffsetInRecurring);if(a.scheduled&&(i.scheduled=a.scheduled),a.due&&(i.due=a.due),typeof t.recurrence=="string"&&t.recurrence&&!t.recurrence.includes("DTSTART:")){let o={...e,...t,...i},l=nd(o);l&&(i.recurrence=l)}}else if(t.recurrence!==void 0&&!e.recurrence&&t.recurrence&&typeof t.recurrence=="string"&&!t.recurrence.includes("DTSTART:")){let s={...e,...t},a=nd(s);a&&(i.recurrence=a)}if(t.scheduled!==void 0&&t.scheduled!==e.scheduled&&e.recurrence&&typeof e.recurrence=="string"&&!e.recurrence.includes("DTSTART:")){let s={...e,...t},a=nd(s);a&&(i.recurrence=a)}return i}removeUnsetMappedFields(e,t){let{plugin:n}=this.deps;if(Object.prototype.hasOwnProperty.call(t,"due")&&t.due===void 0&&delete e[n.fieldMapper.toUserField("due")],Object.prototype.hasOwnProperty.call(t,"scheduled")&&t.scheduled===void 0&&delete e[n.fieldMapper.toUserField("scheduled")],Object.prototype.hasOwnProperty.call(t,"contexts")&&t.contexts===void 0&&delete e[n.fieldMapper.toUserField("contexts")],Object.prototype.hasOwnProperty.call(t,"projects")){let i=n.fieldMapper.toUserField("projects"),s=Array.isArray(t.projects)?t.projects:[];s.length>0?e[i]=s:delete e[i]}Object.prototype.hasOwnProperty.call(t,"timeEstimate")&&t.timeEstimate===void 0&&delete e[n.fieldMapper.toUserField("timeEstimate")],Object.prototype.hasOwnProperty.call(t,"completedDate")&&t.completedDate===void 0&&delete e[n.fieldMapper.toUserField("completedDate")],Object.prototype.hasOwnProperty.call(t,"recurrence")&&t.recurrence===void 0&&delete e[n.fieldMapper.toUserField("recurrence")],Object.prototype.hasOwnProperty.call(t,"blockedBy")&&t.blockedBy===void 0&&delete e[n.fieldMapper.toUserField("blockedBy")]}async handleAutoArchive(e,t,n){if(!(!this.deps.autoArchiveService||n===void 0||n===e.status))try{let i=this.deps.plugin.statusManager.getStatusConfig(t.status);if(!i)return;i.autoArchive?await this.deps.autoArchiveService.scheduleAutoArchive(t,i):await this.deps.autoArchiveService.cancelAutoArchive(t.path)}catch(i){console.warn("Failed to handle auto-archive for status change:",i)}}}});var Bn,g_,lpe=v(()=>{On();Bn=require("obsidian");d_();gT();Cr();Zc();Bo();Qe();Bj();ape();ope();g_=class{constructor(e){this.plugin=e;this.taskCreationService=new m_({plugin:this.plugin,webhookNotifier:this.webhookNotifier,applyTaskCreationDefaults:t=>this.applyTaskCreationDefaults(t),applyTemplate:t=>this.applyTemplate(t),processFolderTemplate:(t,n,i)=>this.processFolderTemplate(t,n,i),sanitizeTitleForFilename:t=>this.sanitizeTitleForFilename(t),sanitizeTitleForStorage:t=>this.sanitizeTitleForStorage(t)}),this.taskUpdateService=new h_({plugin:this.plugin,webhookNotifier:this.webhookNotifier,autoArchiveService:this.autoArchiveService,updateCompletedDateInFrontmatter:(t,n,i)=>this.updateCompletedDateInFrontmatter(t,n,i)})}hasGoogleCalendarLink(e){return!!e.googleCalendarEventId}createArchiveCalendarDeletionTask(e,t){return{...t,googleCalendarEventId:e.googleCalendarEventId}}clearGoogleCalendarMetadata(e){e.googleCalendarEventId=void 0}async deleteArchivedTaskFromCalendar(e){return!this.plugin.taskCalendarSyncService||await this.plugin.taskCalendarSyncService.deleteTaskFromCalendar(e)?!0:(console.warn("Failed to delete archived task from Google Calendar during archive:",{taskPath:e.path,eventId:e.googleCalendarEventId}),!1)}translate(e,t){return this.plugin.i18n.translate(e,t)}sanitizeTitleForFilename(e){if(!e||typeof e!="string")return"untitled";try{let t=e.trim().replace(/\s+/g," ").replace(/[<>:"/\\|?*#[\]]/g,"").replace(/./g,n=>{let i=n.charCodeAt(0);return i<=31||i>=127&&i<=159?"":n}).replace(/^\.+|\.+$/g,"").trim();return(!t||t.length===0)&&(t="untitled"),t}catch(t){return console.error("Error sanitizing title:",t),"untitled"}}sanitizeTitleForStorage(e){if(!e||typeof e!="string")return"untitled";try{let t=e.trim().replace(/\s+/g," ").replace(/./g,n=>{let i=n.charCodeAt(0);return i<=31||i>=127&&i<=159?"":n}).trim();return(!t||t.length===0)&&(t="untitled"),t}catch(t){return console.error("Error sanitizing title:",t),"untitled"}}setWebhookNotifier(e){this.webhookNotifier=e,this.taskCreationService.setWebhookNotifier(e),this.taskUpdateService.setWebhookNotifier(e)}setAutoArchiveService(e){this.autoArchiveService=e,this.taskUpdateService.setAutoArchiveService(e)}normalizeStatusValue(e){return typeof e=="boolean"?e?"true":"false":typeof e=="string"?e:typeof e=="number"?String(e):""}processFolderTemplate(e,t,n=new Date){let i=t?{title:t.title,priority:t.priority,status:t.status,contexts:t.contexts,projects:t.projects,due:t.due,scheduled:t.scheduled}:void 0;return u_(e,{date:n,taskData:i,extractProjectBasename:s=>this.extractProjectBasename(s)})}async createTask(e,t={}){return this.taskCreationService.createTask(e,t)}async applyTemplate(e){var n,i,s,a;let t=this.plugin.settings.taskCreationDefaults;if(!t.useBodyTemplate||!((n=t.bodyTemplate)!=null&&n.trim()))return{frontmatter:{},body:((i=e.details)==null?void 0:i.trim())||""};try{let o=(0,Bn.normalizePath)(t.bodyTemplate.trim());o.endsWith(".md")||(o+=".md");let l=this.plugin.app.vault.getAbstractFileByPath(o);if(l instanceof Bn.TFile){let c=await this.plugin.app.vault.read(l),d={title:e.title||"",priority:e.priority||"",status:e.status||"",contexts:Array.isArray(e.contexts)?e.contexts:[],tags:Array.isArray(e.tags)?e.tags:[],timeEstimate:e.timeEstimate||0,dueDate:e.due||"",scheduledDate:e.scheduled||"",details:e.details||"",parentNote:e.parentNote||""};return c_(c,d)}else return console.warn(`Task body template not found: ${o}`),new Bn.Notice(this.translate("services.task.notices.templateNotFound",{path:o})),{frontmatter:{},body:((s=e.details)==null?void 0:s.trim())||""}}catch(o){return console.error("Error reading task body template:",o),new Bn.Notice(this.translate("services.task.notices.templateReadError",{template:t.bodyTemplate})),{frontmatter:{},body:((a=e.details)==null?void 0:a.trim())||""}}}async applyTaskCreationDefaults(e){let t=this.plugin.settings.taskCreationDefaults,n={...e};if(n.due===void 0&&t.defaultDueDate!=="none"&&(n.due=qo(t.defaultDueDate)),n.scheduled===void 0&&t.defaultScheduledDate!=="none"&&(n.scheduled=qo(t.defaultScheduledDate)),!n.contexts&&t.defaultContexts&&(n.contexts=t.defaultContexts.split(",").map(s=>s.trim()).filter(s=>s)),!n.projects&&t.defaultProjects&&(n.projects=t.defaultProjects.split(",").map(s=>s.trim()).filter(s=>s)),!n.tags&&t.defaultTags&&(n.tags=t.defaultTags.split(",").map(s=>s.trim()).filter(s=>s)),!n.timeEstimate&&t.defaultTimeEstimate>0&&(n.timeEstimate=t.defaultTimeEstimate),!n.recurrence&&t.defaultRecurrence&&t.defaultRecurrence!=="none"){let s={daily:"FREQ=DAILY",weekly:"FREQ=WEEKLY",monthly:"FREQ=MONTHLY",yearly:"FREQ=YEARLY"};n.recurrence=s[t.defaultRecurrence]||void 0}if(!n.reminders&&t.defaultReminders&&t.defaultReminders.length>0){let{convertDefaultRemindersToReminders:s}=await Promise.resolve().then(()=>(lP(),oP));n.reminders=s(t.defaultReminders)}let i=this.plugin.settings.userFields;if(i&&i.length>0){n.customFrontmatter||(n.customFrontmatter={});for(let s of i)if(s.defaultValue!==void 0&&n.customFrontmatter[s.key]===void 0)if(s.type==="date"&&typeof s.defaultValue=="string"){let a=qo(s.defaultValue);a&&(n.customFrontmatter[s.key]=a)}else n.customFrontmatter[s.key]=s.defaultValue}return n}async toggleStatus(e){try{let n=this.plugin.statusManager.isCompletedStatus(e.status)?this.plugin.settings.defaultTaskStatus:this.plugin.statusManager.getCompletedStatuses()[0]||"done";return await this.updateProperty(e,"status",n)}catch(t){let n=t instanceof Error?t.message:String(t);throw console.error("Error toggling task status:",{error:n,stack:t instanceof Error?t.stack:void 0,taskPath:e.path,currentStatus:e.status}),new Error(`Failed to toggle task status: ${n}`)}}async updateProperty(e,t,n,i={}){try{let s=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(s instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let a=await this.plugin.cacheManager.getTaskInfo(e.path)||e,o={...a},l=t==="status"?this.normalizeStatusValue(n):n;if(o[t]=l,o.dateModified=Ve(),t==="status"&&!a.recurrence){let c=this.normalizeStatusValue(l);this.plugin.statusManager.isCompletedStatus(c)?o.completedDate=mg():o.completedDate=void 0}return await this.plugin.app.fileManager.processFrontMatter(s,c=>{let d=this.plugin.fieldMapper.toUserField(t);if(t==="status"){let p=this.normalizeStatusValue(l),m=p.toLowerCase(),f=m==="true"||m==="false"?m==="true":p;c[d]=f,this.updateCompletedDateInFrontmatter(c,p,!!a.recurrence)}else(t==="due"||t==="scheduled")&&!n?delete c[d]:c[d]=l;let u=this.plugin.fieldMapper.toUserField("dateModified");c[u]=o.dateModified}),await this.applyPropertyChangeSideEffects(s,e,o,t,e[t],l),o}catch(s){let a=s instanceof Error?s.message:String(s);throw console.error("Error updating task property:",{error:a,stack:s instanceof Error?s.stack:void 0,taskPath:e.path,property:t,value:n}),new Error(`Failed to update task property: ${a}`)}}async applyPropertyChangeSideEffects(e,t,n,i,s,a){var o;try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(e),this.plugin.cacheManager.updateTaskInfoInCache(t.path,n)}catch(l){console.error("Error updating task cache:",{error:l instanceof Error?l.message:String(l),taskPath:t.path})}try{if(this.plugin.emitter.trigger(Vt,{path:t.path,originalTask:t,updatedTask:n}),i==="status"){let l=this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(s)),c=this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(a));if(l!==c){let d=this.plugin.cacheManager.getBlockedTaskPaths(t.path);for(let u of d)try{let p=await this.plugin.cacheManager.getTaskInfo(u);p&&this.plugin.emitter.trigger(Vt,{path:u,originalTask:p,updatedTask:p})}catch(p){console.error(`Error triggering update for dependent task ${u}:`,p)}}}}catch(l){console.error("Error emitting task update event:",{error:l instanceof Error?l.message:String(l),taskPath:t.path})}if(this.webhookNotifier)try{let l=i==="status"&&this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(s)),c=i==="status"&&this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(a));i==="status"&&!l&&c?await this.webhookNotifier.triggerWebhook("task.completed",{task:n}):await this.webhookNotifier.triggerWebhook("task.updated",{task:n,previous:t})}catch(l){console.warn("Failed to trigger webhook for property update:",l)}if((o=this.plugin.taskCalendarSyncService)!=null&&o.isEnabled()){let l=i==="status"&&this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(s)),c=i==="status"&&this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(a));(i==="status"&&!l&&c?this.plugin.taskCalendarSyncService.completeTaskInCalendar(n):this.plugin.taskCalendarSyncService.updateTaskInCalendar(n,t)).catch(u=>{console.warn("Failed to sync task update to Google Calendar:",u)})}if(this.autoArchiveService&&i==="status"&&a!==s)try{let l=this.plugin.statusManager.getStatusConfig(a);l&&(l.autoArchive?await this.autoArchiveService.scheduleAutoArchive(n,l):await this.autoArchiveService.cancelAutoArchive(n.path))}catch(l){console.warn("Failed to handle auto-archive for status property change:",l)}}async toggleArchive(e){var l,c,d,u;let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let n=this.plugin.fieldMapper.getMapping().archiveTag,i=e.archived,s={...e};s.archived=!i,s.dateModified=Ve(),s.tags||(s.tags=[]),i?s.tags=s.tags.filter(p=>p!==n):s.tags.includes(n)||(s.tags=[...s.tags,n]),await this.plugin.app.fileManager.processFrontMatter(t,p=>{let m=this.plugin.fieldMapper.toUserField("dateModified");i?p.tags&&Array.isArray(p.tags)&&(p.tags=p.tags.filter(f=>f!==n),p.tags.length===0&&delete p.tags):(p.tags?Array.isArray(p.tags)||(p.tags=[p.tags]):p.tags=[],p.tags.includes(n)||p.tags.push(n)),p[m]=s.dateModified});let a=t;if(this.plugin.settings.moveArchivedTasks)try{if(!i&&((l=this.plugin.settings.archiveFolder)!=null&&l.trim())){let p=this.plugin.settings.archiveFolder.trim(),m=this.processFolderTemplate(p,{title:s.title||"",priority:s.priority,status:s.status,contexts:s.contexts,projects:s.projects});await Nm(this.plugin.app.vault,m);let f=`${m}/${t.name}`;if(this.plugin.app.vault.getAbstractFileByPath(f))throw new Error(`A file named "${t.name}" already exists in the archive folder "${m}". Cannot move task to avoid overwriting existing file.`);await this.plugin.app.fileManager.renameFile(t,f);let g=this.plugin.app.vault.getAbstractFileByPath(f);if(!(g instanceof Bn.TFile))throw new Error(`Failed to resolve moved task file: ${f}`);a=g,s.path=f,this.plugin.cacheManager.clearCacheEntry(e.path)}else if(i&&((c=this.plugin.settings.tasksFolder)!=null&&c.trim())){let p=this.plugin.settings.tasksFolder.trim(),m=this.processFolderTemplate(p,{title:s.title||"",priority:s.priority,status:s.status,contexts:s.contexts,projects:s.projects});await Nm(this.plugin.app.vault,m);let f=`${m}/${t.name}`;if(this.plugin.app.vault.getAbstractFileByPath(f))throw new Error(`A file named "${t.name}" already exists in the tasks folder "${m}". Cannot move task to avoid overwriting existing file.`);await this.plugin.app.fileManager.renameFile(t,f);let g=this.plugin.app.vault.getAbstractFileByPath(f);if(!(g instanceof Bn.TFile))throw new Error(`Failed to resolve moved task file: ${f}`);a=g,s.path=f,this.plugin.cacheManager.clearCacheEntry(e.path)}}catch(p){let m=p instanceof Error?p.message:String(p),f=i?"unarchiving":"archiving";console.error(`Error moving ${f} task:`,m),new Bn.Notice(this.translate("services.task.notices.moveTaskFailed",{operation:f,error:m}))}let o=!0;if((d=this.plugin.taskCalendarSyncService)!=null&&d.isEnabled()&&s.archived&&this.hasGoogleCalendarLink(e)){let p=this.createArchiveCalendarDeletionTask(e,s);o=await this.deleteArchivedTaskFromCalendar(p),o&&this.clearGoogleCalendarMetadata(s)}try{a instanceof Bn.TFile&&this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(a),this.plugin.cacheManager.updateTaskInfoInCache(s.path,s)}catch(p){console.error("Error updating cache for archived task:",p)}if(this.plugin.emitter.trigger(Vt,{path:s.path,originalTask:e,updatedTask:s}),this.webhookNotifier)try{s.archived?await this.webhookNotifier.triggerWebhook("task.archived",{task:s}):await this.webhookNotifier.triggerWebhook("task.unarchived",{task:s})}catch(p){console.warn("Failed to trigger webhook for task archive/unarchive:",p)}return(u=this.plugin.taskCalendarSyncService)!=null&&u.isEnabled()&&(s.archived?!o&&this.hasGoogleCalendarLink(s)&&console.warn("Archived task still has Google Calendar links and will need retry cleanup:",s.path):this.plugin.taskCalendarSyncService.updateTaskInCalendar(s,e).catch(p=>{console.warn("Failed to sync unarchived task to Google Calendar:",p)})),s}async startTimeTracking(e){var a;let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);if(this.plugin.getActiveTimeSession(e))throw new Error("Time tracking is already active for this task");let i={...e};i.dateModified=Ve(),i.timeEntries||(i.timeEntries=[]),i.timeEntries=i.timeEntries.map(o=>{let l={...o};return delete l.duration,l});let s={startTime:new Date().toISOString(),description:"Work session"};i.timeEntries=[...i.timeEntries,s],await this.plugin.app.fileManager.processFrontMatter(t,o=>{let l=this.plugin.fieldMapper.toUserField("timeEntries"),c=this.plugin.fieldMapper.toUserField("dateModified");o[l]||(o[l]=[]),Array.isArray(o[l])&&(o[l]=o[l].map(d=>{let u={...d};return delete u.duration,u})),o[l].push(s),o[c]=i.dateModified});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(t),this.plugin.cacheManager.updateTaskInfoInCache(e.path,i)}catch(o){console.error("Error updating cache for time tracking start:",o)}if(this.plugin.emitter.trigger(Vt,{path:e.path,originalTask:e,updatedTask:i}),this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("time.started",{task:i,session:(a=i.timeEntries)==null?void 0:a[i.timeEntries.length-1]})}catch(o){console.warn("Failed to trigger webhook for time tracking start:",o)}return i}async stopTimeTracking(e){var a;let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let n=this.plugin.getActiveTimeSession(e);if(!n)throw new Error("No active time tracking session for this task");let i=new Date().toISOString(),s={...e};if(s.dateModified=Ve(),s.timeEntries&&Array.isArray(s.timeEntries)){s.timeEntries=s.timeEntries.map(l=>{let c={...l};return delete c.duration,c});let o=s.timeEntries.findIndex(l=>l.startTime===n.startTime&&!l.endTime);o!==-1&&(s.timeEntries=[...s.timeEntries],s.timeEntries[o]={...s.timeEntries[o],endTime:i})}await this.plugin.app.fileManager.processFrontMatter(t,o=>{let l=this.plugin.fieldMapper.toUserField("timeEntries"),c=this.plugin.fieldMapper.toUserField("dateModified");if(o[l]&&Array.isArray(o[l])){o[l]=o[l].map(u=>{let p={...u};return delete p.duration,p});let d=o[l].findIndex(u=>u.startTime===n.startTime&&!u.endTime);d!==-1&&(o[l][d].endTime=i)}o[c]=s.dateModified});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(t),this.plugin.cacheManager.updateTaskInfoInCache(e.path,s)}catch(o){console.error("Error updating cache for time tracking stop:",o)}if(this.plugin.emitter.trigger(Vt,{path:e.path,originalTask:e,updatedTask:s}),this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("time.stopped",{task:s,session:(a=s.timeEntries)==null?void 0:a[s.timeEntries.length-1]})}catch(o){console.warn("Failed to trigger webhook for time tracking stop:",o)}return s}async updateTask(e,t){return this.taskUpdateService.updateTask(e,t)}async updateBlockingRelationships(e,t,n,i={}){let s=Array.from(new Set(n)),a=Array.from(new Set(t));for(let o of s){let l=await this.plugin.cacheManager.getTaskInfo(o);if(!l)continue;let c=this.computeBlockedByUpdate(l,e.path,"remove");if(c===null)continue;let d={blockedBy:c.length>0?c:void 0};await this.updateTask(l,d)}for(let o of a){let l=await this.plugin.cacheManager.getTaskInfo(o);if(!l)continue;let c=this.computeBlockedByUpdate(l,e.path,"add",i[o]);c!==null&&await this.updateTask(l,{blockedBy:c})}}computeBlockedByUpdate(e,t,n,i){var c;let s=Array.isArray(e.blockedBy)?e.blockedBy.map(d=>El(d)).filter(d=>!!d):[];if(s.length===0&&n==="remove")return null;let a=!1,o=!1,l=[];for(let d of s){let u=Em(this.plugin.app,e.path,d);if(u&&u.path===t&&(o=!0,n==="remove")){a=!0;continue}l.push(d)}if(n==="add"&&!o){let d=i?El(i):null,p={uid:Ba(this.plugin.app,e.path,t,this.plugin.settings.useFrontmatterMarkdownLinks),reltype:(c=d==null?void 0:d.reltype)!=null?c:Ds};d!=null&&d.gap&&(p.gap=d.gap),l.push(p),a=!0}return a?l:null}async deleteTask(e){var t;try{let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);if((t=this.plugin.taskCalendarSyncService)!=null&&t.isEnabled()&&e.googleCalendarEventId)try{await this.plugin.taskCalendarSyncService.deleteTaskFromCalendarByPath(e.path,e.googleCalendarEventId)}catch(i){console.warn("Failed to delete task from Google Calendar:",i)}if(await this.plugin.app.fileManager.trashFile(n),this.plugin.cacheManager.clearCacheEntry(e.path),this.plugin.emitter.trigger(ug,{path:e.path,deletedTask:e}),this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("task.deleted",{task:e})}catch(i){console.warn("Failed to trigger webhook for task deletion:",i)}}catch(n){let i=n instanceof Error?n.message:String(n);throw console.error("Error deleting task:",{error:i,stack:n instanceof Error?n.stack:void 0,taskPath:e.path}),new Error(`Failed to delete task: ${i}`)}}async resolveRecurringTaskActionDate(e,t){if(t)return t;let n=await this.plugin.cacheManager.getTaskInfo(e.path)||e;return this.getRecurringTaskActionDate(n)}getRecurringTaskActionDate(e,t){if(t)return t;if(e.recurrence_anchor!=="completion"&&e.scheduled)return st(tt(e.scheduled));let n=kr();return en(n)}async toggleRecurringTaskComplete(e,t){var p;let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let i=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!i.recurrence)throw new Error("Task is not recurring");let s=this.getRecurringTaskActionDate(i,t),a=ue(s),o=Array.isArray(i.complete_instances)?i.complete_instances:[],c=!o.includes(a),d={...i};if(d.dateModified=Ve(),c){o.includes(a)||(d.complete_instances=[...o,a]);let m=Array.isArray(i.skipped_instances)?i.skipped_instances:[];d.skipped_instances=m.filter(f=>f!==a)}else{d.complete_instances=o.filter(f=>f!==a);let m=Array.isArray(i.skipped_instances)?i.skipped_instances:[];d.skipped_instances=m.filter(f=>f!==a)}if(c&&typeof d.recurrence=="string"){if((d.recurrence_anchor||"scheduled")==="completion"){let f=qD(d.recurrence,a);f&&(d.recurrence=f)}else if(!d.recurrence.includes("DTSTART:")){let f=nd(d);f&&(d.recurrence=f)}}let u=Am(d,this.plugin.settings.maintainDueDateOffsetInRecurring);if(u.scheduled&&(d.scheduled=u.scheduled),u.due&&(d.due=u.due),await this.plugin.app.fileManager.processFrontMatter(n,m=>{let f=this.plugin.fieldMapper.toUserField("completeInstances"),h=this.plugin.fieldMapper.toUserField("skippedInstances"),g=this.plugin.fieldMapper.toUserField("dateModified"),y=this.plugin.fieldMapper.toUserField("scheduled"),k=this.plugin.fieldMapper.toUserField("due"),T=this.plugin.fieldMapper.toUserField("recurrence");m[f]||(m[f]=[]),m[h]||(m[h]=[]);let w=m[f];c?w.includes(a)||(m[f]=[...w,a]):m[f]=w.filter(S=>S!==a),m[h]=d.skipped_instances||[],d.recurrence!==i.recurrence&&(m[T]=d.recurrence),d.scheduled&&(m[y]=d.scheduled),d.due&&(m[k]=d.due),m[g]=d.dateModified}),c&&this.plugin.settings.resetCheckboxesOnRecurrence){let m=await this.plugin.app.vault.read(n),{frontmatter:f,body:h}=Cg(m),{content:g,changed:y}=_ne(h);if(y){let k=f!==null?`--- ${f} --- `:"",T=g.trimEnd(),w=T.length>0?`${k}${T} `:k;await this.plugin.app.vault.modify(n,w),d.details=g.replace(/\r\n/g,` `).trimEnd()}}try{if(this.plugin.cacheManager.waitForFreshTaskData){let m={complete_instances:d.complete_instances};d.scheduled!==i.scheduled&&(m.scheduled=d.scheduled),d.due!==i.due&&(m.due=d.due),await this.plugin.cacheManager.waitForFreshTaskData(n)}this.plugin.cacheManager.updateTaskInfoInCache(i.path,d)}catch(m){console.error("Error updating cache for recurring task:",m)}if(this.plugin.emitter.trigger(Vt,{path:i.path,originalTask:i,updatedTask:d}),c&&this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("recurring.instance.completed",{task:d,date:a,targetDate:s})}catch(m){console.error("Error triggering recurring task completion webhook:",m)}return(p=this.plugin.taskCalendarSyncService)!=null&&p.isEnabled()&&this.plugin.taskCalendarSyncService.updateTaskInCalendar(d,i).catch(m=>{console.warn("Failed to sync recurring task update to Google Calendar:",m)}),d}async toggleRecurringTaskSkipped(e,t){var p;let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let i=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!i.recurrence)throw new Error("Task is not recurring");let s=this.getRecurringTaskActionDate(i,t),a=ue(s),o=Array.isArray(i.skipped_instances)?i.skipped_instances:[],c=!o.includes(a),d={...i};if(d.dateModified=Ve(),c){o.includes(a)||(d.skipped_instances=[...o,a]);let m=Array.isArray(i.complete_instances)?i.complete_instances:[];d.complete_instances=m.filter(f=>f!==a)}else d.skipped_instances=o.filter(m=>m!==a);let u=Am(d,this.plugin.settings.maintainDueDateOffsetInRecurring);u.scheduled&&(d.scheduled=u.scheduled),u.due&&(d.due=u.due),await this.plugin.app.fileManager.processFrontMatter(n,m=>{let f=this.plugin.fieldMapper.toUserField("skippedInstances"),h=this.plugin.fieldMapper.toUserField("completeInstances"),g=this.plugin.fieldMapper.toUserField("dateModified"),y=this.plugin.fieldMapper.toUserField("scheduled"),k=this.plugin.fieldMapper.toUserField("due");m[f]||(m[f]=[]),m[f]=d.skipped_instances||[],m[h]||(m[h]=[]),m[h]=d.complete_instances||[],d.scheduled&&(m[y]=d.scheduled),d.due&&(m[k]=d.due),m[g]=d.dateModified});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(n),this.plugin.cacheManager.updateTaskInfoInCache(i.path,d)}catch(m){console.error("Error updating cache for skipped recurring task:",m)}if(this.plugin.emitter.trigger(Vt,{path:i.path,originalTask:i,updatedTask:d}),c&&this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("recurring.instance.skipped",{task:d,date:a,targetDate:s})}catch(m){console.error("Error triggering recurring task skip webhook:",m)}return(p=this.plugin.taskCalendarSyncService)!=null&&p.isEnabled()&&this.plugin.taskCalendarSyncService.updateTaskInCalendar(d,i).catch(m=>{console.warn("Failed to sync recurring task skip to Google Calendar:",m)}),d}async deleteTimeEntry(e,t){let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Bn.TFile))throw new Error(`Cannot find task file: ${e.path}`);if(!e.timeEntries||!Array.isArray(e.timeEntries))throw new Error("Task has no time entries");if(t<0||t>=e.timeEntries.length)throw new Error("Invalid time entry index");let i={...e};i.dateModified=Ve(),i.timeEntries=e.timeEntries.filter((s,a)=>a!==t),await this.plugin.app.fileManager.processFrontMatter(n,s=>{let a=this.plugin.fieldMapper.toUserField("timeEntries"),o=this.plugin.fieldMapper.toUserField("dateModified");s[a]&&Array.isArray(s[a])&&(s[a]=s[a].filter((l,c)=>c!==t)),s[o]=i.dateModified});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(n),this.plugin.cacheManager.updateTaskInfoInCache(e.path,i)}catch(s){console.error("Error updating cache for time entry deletion:",s)}return this.plugin.emitter.trigger(Vt,{path:e.path,originalTask:e,updatedTask:i}),i}updateCompletedDateInFrontmatter(e,t,n){if(n)return;let i=this.plugin.fieldMapper.toUserField("completedDate");this.plugin.statusManager.isCompletedStatus(t)?e[i]=mg():e[i]&&delete e[i]}extractProjectBasename(e){return bg(e,this.plugin.app)}}});var Wl,bS=v(()=>{Wl=class{constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{let n=this.events[e];if(!n)return;let i=n.filter(s=>s!==t);i.length>0?this.events[e]=i:delete this.events[e]}}emit(e,...t){this.events[e]&&this.events[e].forEach(n=>{n(...t)})}removeAllListeners(e){e?delete this.events[e]:this.events={}}}});var y_,cpe=v(()=>{jr();y_=class{constructor(e){this.deps=e;this.indexQueryCache=new Map;this.cacheTimers=new Map;this.cacheTimeout=3e4}getIndexOptimizedTaskPaths(e){let t=this.analyzeQueryOptimizationSafety(e);if(!t.canOptimize)return this.deps.cacheManager.getAllTaskPaths();if(t.strategy==="intersect"){let n=this.getPathsForIndexableCondition(t.conditions[0]);for(let i=1;ii.type==="condition"&&this.isIndexableCondition(i)).length===t.length}hasIndexableConditionInOrGroup(e,t){return this.checkNodeForOrWithIndexable(e,t)}checkNodeForOrWithIndexable(e,t){if(e.type==="condition")return!1;if(e.type==="group"){if(e.conjunction==="or"&&e.children.some(i=>i.type==="condition"&&t.includes(i)))return!0;for(let n of e.children)if(this.checkNodeForOrWithIndexable(n,t))return!0}return!1}findIndexableConditions(e){let t=[];if(e.type==="condition")this.isIndexableCondition(e)&&t.push(e);else if(e.type==="group")for(let n of e.children)t.push(...this.findIndexableConditions(n));return t}isIndexableCondition(e){let{property:t,operator:n,value:i}=e;return!!(t==="status"&&n==="is"&&i||t==="due"&&(n==="is"||n==="is-before"||n==="is-after")&&i||t==="scheduled"&&(n==="is"||n==="is-before"||n==="is-after")&&i)}getCachedIndexResult(e,t){let n=this.indexQueryCache.get(e);if(n)return new Set(n);let i=t();this.indexQueryCache.set(e,new Set(i));let s=this.cacheTimers.get(e);s&&window.clearTimeout(s);let a=window.setTimeout(()=>{this.indexQueryCache.delete(e),this.cacheTimers.delete(e)},this.cacheTimeout);return this.cacheTimers.set(e,a),i}getPathsForIndexableCondition(e){let{property:t,operator:n,value:i}=e,s=`${t}:${n}:${ie(i)}`;return this.getCachedIndexResult(s,()=>t==="status"&&n==="is"&&i&&typeof i=="string"?new Set(this.deps.cacheManager.getTaskPathsByStatus(i)):(t==="due"||t==="scheduled")&&n==="is"&&i&&typeof i=="string"?new Set(this.deps.cacheManager.getTasksForDate(i)):(t==="due"||t==="scheduled")&&(n==="is-before"||n==="is-after")&&i&&typeof i=="string"?this.getTaskPathsForDateRange(t,n,i):this.deps.cacheManager.getAllTaskPaths())}getTaskPathsForDateRange(e,t,n){return this.deps.cacheManager.getAllTaskPaths()}intersectPathSets(e,t){let n=new Set;for(let i of e)t.has(i)&&n.add(i);return n}}});var dpe={};et(dpe,{HierarchicalGroupingService:()=>Uj});function Hj(r){return r==null?"":typeof r=="string"?r.trim():typeof r=="number"||typeof r=="boolean"?String(r):""}var Uj,upe=v(()=>{Uj=class{constructor(e){this.resolveUserFieldValues=e}group(e,t,n,i="asc",s=[]){let a=new Map,o=(c,d)=>{var p,m,f,h,g,y,k,T;if(!d||d==="none")return["all"];let u=w=>{let S=w.map(Hj).filter(E=>E!=="");return S.length?S:[]};if(d.startsWith("user:")){let w=d.slice(5);if(this.resolveUserFieldValues){let C=this.resolveUserFieldValues(c,w)||[],D=u(C);return D.length?D:[`No ${w}`]}let S=(p=c.customProperties)==null?void 0:p[w];if(Array.isArray(S)){let C=u(S);return C.length?C:[`No ${w}`]}let E=Hj(S);return E!==""?[E]:[`No ${w}`]}switch(d){case"status":return[((m=c.status)!=null?m:"").trim()||"No Status"];case"priority":return[((f=c.priority)!=null?f:"").trim()||"No Priority"];case"context":{let w=u((h=c.contexts)!=null?h:[]);return w.length?w:["No Context"]}case"project":{let w=u((g=c.projects)!=null?g:[]).map(C=>{let D=C.match(/^\[\[([^|\]]+)(?:\|([^\]]+))?\]\]$/);if(D){let A=D[1]||"";return D[2]||A.split("#")[0].split("/").pop()||A||C}return C}),S=[],E=new Set;for(let C of w)E.has(C)||(E.add(C),S.push(C));return S.length?S:["No Project"]}case"tags":{let w=u((y=c.tags)!=null?y:[]);return w.length?w:["No Tag"]}case"due":{let w=((k=c.due)!=null?k:"").trim();return w?[w.split("T")[0]]:["No Due Date"]}case"scheduled":{let w=((T=c.scheduled)!=null?T:"").trim();return w?[w.split("T")[0]]:["No Scheduled Date"]}default:{let S=c[d];if(Array.isArray(S)){let C=u(S);return C.length?C:[`No ${d}`]}let E=Hj(S);return E!==""?[E]:[`No ${d}`]}}};for(let c of e){let d=o(c,t),u=o(c,n);for(let p of d){a.has(p)||a.set(p,new Map);let m=a.get(p);for(let f of u)m.has(f)||m.set(f,[]),m.get(f).push(c)}}let l=new Map;for(let[c,d]of a){let u=this.sortSubgroups(d,n,i,s);l.set(c,u)}return l}sortSubgroups(e,t,n,i){let s=Array.from(e.keys()),a=this.sortSubgroupKeys(s,t,n,i),o=new Map;for(let l of a)o.set(l,e.get(l));return o}sortSubgroupKeys(e,t,n,i){let s=o=>/^No\s/i.test(o);if(typeof t=="string"&&t.startsWith("user:")){let o=t.slice(5),l=i.find(u=>(u.id||u.key)===o),c=(u,p)=>{if(s(u)&&!s(p))return-1;if(!s(u)&&s(p))return 1;if((l==null?void 0:l.type)==="number"){let m=parseFloat(u),f=parseFloat(p),h=isNaN(m)?Number.POSITIVE_INFINITY:m,g=isNaN(f)?Number.POSITIVE_INFINITY:f;if(h!==g)return h-g}else if((l==null?void 0:l.type)==="boolean"){let m=u==="true"?0:u==="false"?1:2,f=p==="true"?0:p==="false"?1:2;if(m!==f)return m-f}else if((l==null?void 0:l.type)==="date"){let m=Date.parse(u),f=Date.parse(p),h=isNaN(m)?Number.POSITIVE_INFINITY:m,g=isNaN(f)?Number.POSITIVE_INFINITY:f;if(h!==g)return h-g}return u.localeCompare(p)},d=e.slice().sort(c);return n==="desc"?d.reverse():d}let a=e.slice().sort((o,l)=>s(o)&&!s(l)?-1:!s(o)&&s(l)?1:o.localeCompare(l));return n==="desc"?a.reverse():a}}});var pf,Ry,v_,ppe=v(()=>{pf=require("obsidian");Bo();bS();Om();Cr();Tn();gu();Qe();cpe();jr();Ry=class Ry extends Wl{constructor(t,n,i,s){super();this.plugin=s;this.filterOptionsCache=null;this.filterOptionsCacheTimestamp=0;this.filterOptionsCacheTTL=3e5;this.filterOptionsComputeCount=0;this.filterOptionsCacheHits=0;this.cacheManager=t,this.statusManager=n,this.priorityManager=i,this.queryPlanner=new y_({cacheManager:t}),Ry.lastInstance=this}translate(t,n,i){var s;try{if((s=this.plugin)!=null&&s.i18n)return this.plugin.i18n.translate(t,i)}catch(a){console.error("FilterService translation error:",a)}return n}static translateStatic(t,n){let i=Ry.lastInstance;return i?i.translate(t,n):n}getLocale(){var t,n,i;try{let s=(i=(n=(t=this.plugin)==null?void 0:t.i18n)==null?void 0:n.getCurrentLocale)==null?void 0:i.call(n);if(s)return s}catch(s){console.error("FilterService locale error:",s)}return"en"}getDueGroupLabel(t){switch(t){case"overdue":return this.translate("services.filter.groupLabels.due.overdue","Overdue");case"today":return this.translate("services.filter.groupLabels.due.today","Today");case"tomorrow":return this.translate("services.filter.groupLabels.due.tomorrow","Tomorrow");case"nextSevenDays":return this.translate("services.filter.groupLabels.due.nextSevenDays","Next seven days");case"later":return this.translate("services.filter.groupLabels.due.later","Later");case"none":return this.translate("services.filter.groupLabels.due.none","No due date");case"invalid":default:return this.translate("services.filter.groupLabels.invalidDate","Invalid date")}}getScheduledGroupLabel(t){switch(t){case"past":return this.translate("services.filter.groupLabels.scheduled.past","Past scheduled");case"today":return this.translate("services.filter.groupLabels.scheduled.today","Today");case"tomorrow":return this.translate("services.filter.groupLabels.scheduled.tomorrow","Tomorrow");case"nextSevenDays":return this.translate("services.filter.groupLabels.scheduled.nextSevenDays","Next seven days");case"later":return this.translate("services.filter.groupLabels.scheduled.later","Later");case"none":return this.translate("services.filter.groupLabels.scheduled.none","No scheduled date");case"invalid":default:return this.translate("services.filter.groupLabels.invalidDate","Invalid date")}}getNoProjectLabel(){return this.translate("services.filter.groupLabels.noProject","No project")}getNoTagsLabel(){return this.translate("services.filter.groupLabels.noTags","No tags")}getInvalidDateLabel(){return this.translate("services.filter.groupLabels.invalidDate","Invalid date")}async getGroupedTasks(t,n){try{vr.validateFilterNode(t,!1);let i=this.queryPlanner.getIndexOptimizedTaskPaths(t),a=(await this.pathsToTaskInfos(Array.from(i))).filter(l=>this.evaluateFilterNode(t,l,n)),o=this.sortTasks(a,t.sortKey||"due",t.sortDirection||"asc");return this.currentSortKey=t.sortKey||"due",this.currentSortDirection=t.sortDirection||"asc",this.groupTasks(o,t.groupKey||"none",n)}catch(i){if(i instanceof di||i instanceof id)return console.error("Filter error:",i.message,{nodeId:i.nodeId,field:i.field}),new Map;throw i}}async getHierarchicalGroupedTasks(t,n){var i,s;try{vr.validateFilterNode(t,!1);let a=this.queryPlanner.getIndexOptimizedTaskPaths(t),l=(await this.pathsToTaskInfos(Array.from(a))).filter(p=>this.evaluateFilterNode(t,p,n)),c=this.sortTasks(l,t.sortKey||"due",t.sortDirection||"asc");this.currentSortKey=t.sortKey||"due",this.currentSortDirection=t.sortDirection||"asc";let d=this.groupTasks(c,t.groupKey||"none",n),u=t.subgroupKey;if(u&&u!=="none"&&t.groupKey&&t.groupKey!=="none"){let{HierarchicalGroupingService:p}=await Promise.resolve().then(()=>(upe(),dpe)),m=(k,T)=>{var C,D,A;let S=(((D=(C=this.plugin)==null?void 0:C.settings)==null?void 0:D.userFields)||[]).find(N=>(N.id||N.key)===T||N.key===T),E=`No ${(S==null?void 0:S.displayName)||(S==null?void 0:S.key)||T}`;if(!S)return[E];try{let N=this.cacheManager.getApp(),V=N.vault.getAbstractFileByPath(k.path);if(!(V instanceof pf.TFile))return[E];let R=(A=N.metadataCache.getFileCache(V))==null?void 0:A.frontmatter,I=R?R[S.key]:void 0;switch(S.type){case"boolean":{if(typeof I=="boolean")return[I?"true":"false"];if(I==null)return[E];let O=String(I).trim().toLowerCase();return O==="true"||O==="false"?[O]:[E]}case"number":{if(typeof I=="number")return[String(I)];if(typeof I=="string"){let O=I.match(/^(\d+(?:\.\d+)?)/);return O?[O[1]]:[E]}return[E]}case"date":return I?[String(I)]:[E];case"list":{let O=this.normalizeUserListValue(I).filter(z=>!/^\[\[/.test(z));return O.length>0?O:[E]}case"text":default:{let O=String(I!=null?I:"").trim();return O?[O]:[E]}}}catch(N){return[E]}},h=new p(m).group(c,t.groupKey,u,this.currentSortDirection,((s=(i=this.plugin)==null?void 0:i.settings)==null?void 0:s.userFields)||[]),g=Array.from(d.keys()),y=new Map;for(let k of g){let T=h.get(k);T&&y.set(k,T)}for(let[k,T]of h)y.has(k)||y.set(k,T);return{groups:d,hierarchicalGroups:y}}return{groups:d}}catch(a){if(a instanceof di||a instanceof id)return console.error("Filter error (hierarchical):",a.message,{nodeId:a.nodeId}),{groups:new Map};throw a}}getCacheStats(){return this.queryPlanner.getCacheStats()}async pathsToTaskInfos(t){let n=[];for(let s=0;sthis.cacheManager.getCachedTaskInfo(l)));for(let l of o)l&&n.push(l)}return n}evaluateFilterNode(t,n,i){return t.type==="condition"?this.evaluateCondition(t,n,i):t.type==="group"?this.evaluateGroup(t,n,i):!0}evaluateGroup(t,n,i){if(t.children.length===0)return!0;let s=t.children.filter(a=>a.type==="condition"?vr.isFilterNodeComplete(a):!0);return s.length===0?!0:t.conjunction==="and"?s.every(a=>this.evaluateFilterNode(a,n,i)):t.conjunction==="or"?s.some(a=>this.evaluateFilterNode(a,n,i)):!0}normalizeUserListValue(t){let n=[],i=o=>{if(!o)return;let l=String(o).trim();if(!l)return;let c=l.match(/^\[\[([^|\]]+)(?:\|([^\]]+))?\]\]$/);if(c){let d=c[1]||"",p=c[2]||d.split("#")[0].split("/").pop()||d;p&&n.push(p),n.push(l);return}n.push(l)};if(Array.isArray(t))for(let o of t)i(ie(o));else if(typeof t=="string"){let o=sa(t);for(let l of o)i(l)}else t!=null&&i(ie(t));let s=new Set,a=[];for(let o of n)s.has(o)||(s.add(o),a.push(o));return a}evaluateCondition(t,n,i){var c,d,u;let{property:s,operator:a,value:o}=t;if(typeof s=="string"&&s.startsWith("user:")){let p=s.slice(5),f=(((d=(c=this.plugin)==null?void 0:c.settings)==null?void 0:d.userFields)||[]).find(y=>(y.id||y.key)===p),h;if(f)try{let y=this.cacheManager.getApp(),k=y.vault.getAbstractFileByPath(n.path);if(k instanceof pf.TFile){let T=(u=y.metadataCache.getFileCache(k))==null?void 0:u.frontmatter,w=T?T[f.key]:void 0;switch(f.type){case"boolean":h=typeof w=="boolean"?w:String(w).toLowerCase()==="true";break;case"number":h=typeof w=="number"?w:w!=null?parseFloat(String(w)):void 0;break;case"list":h=this.normalizeUserListValue(w);break;default:h=w!=null?String(w):void 0}}}catch(y){}if((f==null?void 0:f.type)==="list"&&(a==="contains"||a==="does-not-contain")){let y=Array.isArray(h)?h:h!=null?[String(h)]:[],T=(Array.isArray(o)?o:[String(o!=null?o:"")]).some(w=>typeof w=="string"&&y.some(S=>typeof S=="string"&&S.toLowerCase().includes(w.toLowerCase())));return a==="contains"?T:!T}let g=(f==null?void 0:f.type)==="date"?"due":s;return vr.applyOperator(h,a,o,t.id,g)}let l=vr.getTaskPropertyValue(n,s);if(s==="status.isCompleted"){let p=Pg(n,i||new Date,this.statusManager.getCompletedStatuses()[0]);l=this.statusManager.isCompletedStatus(p)}return s==="projects"&&(a==="contains"||a==="does-not-contain")?this.evaluateProjectsCondition(l,a,o):vr.applyOperator(l,a,o,t.id,s)}evaluateProjectsCondition(t,n,i){if(!Array.isArray(t)||typeof i!="string")return!1;let s=this.extractProjectName(i);if(!s)return!1;let a=t.some(o=>{if(!o||typeof o!="string")return!1;let l=this.extractProjectName(o);return l?l===s?!0:this.compareProjectWikilinks(o,i):!1});return n==="contains"?a:!a}extractProjectName(t){var i;if(!t||typeof t!="string")return null;let n=bg(t,(i=this.plugin)==null?void 0:i.app);return n||null}compareProjectWikilinks(t,n){var l;if(!((l=this.plugin)!=null&&l.app))return!1;let i=this.extractWikilinkPath(t),s=this.extractWikilinkPath(n);if(!i||!s)return!1;let a=this.plugin.app.metadataCache.getFirstLinkpathDest(i,""),o=this.plugin.app.metadataCache.getFirstLinkpathDest(s,"");return a&&o?a.path===o.path:!1}extractWikilinkPath(t){return!t||typeof t!="string"?null:t.startsWith("[[")&&t.endsWith("]]")?t.slice(2,-2):t}resolveProjectToAbsolutePath(t){var s;if(!t||typeof t!="string")return t||"";if(!((s=this.plugin)!=null&&s.app))return t;let n=this.parseLinkToPath(t),i=this.plugin.app.metadataCache.getFirstLinkpathDest(n,"");return i?i.path.replace(/\.md$/,""):n.replace(/\.md$/,"")}parseLinkToPath(t){return dn(t)}getPreferredProjectFormat(t){let n=this.getNoProjectLabel();return!t||t===n?t:t.includes("/")||t.endsWith(".md")?`[[${t}]]`:`[[${t}]]`}async getTaskPathsInDateRange(t,n){let i=new Set,s=st(t),a=st(n);for(let d=new Date(s);d<=a;d.setDate(d.getDate()+1)){let u=P(d,"yyyy-MM-dd");this.cacheManager.getTaskPathsByDate(u).forEach(m=>i.add(m))}let o=this.cacheManager.getAllTaskPaths(),l=50,c=Array.from(o);for(let d=0;dthis.cacheManager.getCachedTaskInfo(m)));for(let m of p)if(m&&m.recurrence&&!m.due){for(let f=new Date(s);f<=a;f.setDate(f.getDate()+1))if(WD(m,f)){i.add(m.path);break}}}return i}getOverdueTaskPaths(){return this.cacheManager.getOverdueTaskPaths()}combineTaskPathSets(t){let n=new Set;return t.forEach(i=>{i.forEach(s=>n.add(s))}),n}isDateInRange(t,n,i){try{let s=tt(t),a=tt(n),o=tt(i),l=nT(s),c=nT(a),d=nT(o);return l>=c&&l<=d}catch(s){return console.error("Error checking date range:",{dateString:t,startDateString:n,endDateString:i,error:s}),!1}}isSameDayAs(t,n){try{let i=P(t,"yyyy-MM-dd");return Ln(i,n)}catch(i){return console.error("Error comparing date object with date string:",{dateObj:t,dateString:n,error:i}),!1}}sortTasks(t,n,i){return t.sort((s,a)=>{let o=0;if(typeof n=="string"&&n.startsWith("user:"))o=this.compareByUserField(s,a,n);else switch(n){case"due":o=this.compareDates(s.due,a.due);break;case"scheduled":o=this.compareDates(s.scheduled,a.scheduled);break;case"priority":o=this.comparePriorities(s.priority,a.priority);break;case"status":o=this.compareStatuses(s.status,a.status);break;case"title":o=s.title.localeCompare(a.title);break;case"dateCreated":o=this.compareDates(s.dateCreated,a.dateCreated);break;case"completedDate":o=this.compareDates(s.completedDate,a.completedDate);break;case"tags":o=this.compareTags(s.tags,a.tags);break}return o===0&&(o=this.applyFallbackSorting(s,a,n)),i==="desc"?-o:o})}compareDates(t,n){if(!t&&!n)return 0;if(!t)return 1;if(!n)return-1;try{return Kc(t,n)?-1:Kc(n,t)?1:0}catch(i){return console.error("Error comparing dates time-aware:",{dateA:t,dateB:n,error:i}),t.localeCompare(n)}}comparePriorities(t,n){let i=this.priorityManager.getPriorityWeight(t);return this.priorityManager.getPriorityWeight(n)-i}compareStatuses(t,n){let i=this.statusManager.getStatusOrder(t),s=this.statusManager.getStatusOrder(n);return i-s}compareTags(t,n){let i=t&&t.length>0?t:[],s=n&&n.length>0?n:[];if(i.length===0&&s.length===0)return 0;if(i.length===0)return 1;if(s.length===0)return-1;let a=i[0].toLowerCase(),o=s[0].toLowerCase();return a.localeCompare(o)}applyFallbackSorting(t,n,i){let a=["scheduled","due","priority","title"].filter(o=>o!==i);for(let o of a){let l=0;switch(o){case"scheduled":l=this.compareDates(t.scheduled,n.scheduled);break;case"due":l=this.compareDates(t.due,n.due);break;case"priority":l=this.comparePriorities(t.priority,n.priority);break;case"title":l=t.title.localeCompare(n.title);break}if(l!==0)return l}return 0}compareByUserField(t,n,i){var u,p;let s=i.slice(5),o=(((p=(u=this.plugin)==null?void 0:u.settings)==null?void 0:p.userFields)||[]).find(m=>(m.id||m.key)===s);if(!o)return 0;let l=m=>{var f;try{let h=this.cacheManager.getApp(),g=h.vault.getAbstractFileByPath(m.path),y=g instanceof pf.TFile?(f=h.metadataCache.getFileCache(g))==null?void 0:f.frontmatter:void 0;return y?y[o.key]:void 0}catch(h){return}},c=l(t),d=l(n);switch(o.type){case"number":{let m=typeof c=="number"?c:c!=null?parseFloat(String(c)):NaN,f=typeof d=="number"?d:d!=null?parseFloat(String(d)):NaN,h=!isNaN(m),g=!isNaN(f);return h&&g?m-f:h&&!g?-1:!h&&g?1:0}case"boolean":{let m=g=>{if(typeof g=="boolean")return g;if(g==null)return;let y=ie(g).trim().toLowerCase();if(y==="true")return!0;if(y==="false")return!1},f=m(c),h=m(d);return f===h?0:f===!0?-1:h===!0?1:f===!1?-1:h===!1?1:0}case"date":{let m=c?Date.parse(String(c)):NaN,f=d?Date.parse(String(d)):NaN,h=!isNaN(m),g=!isNaN(f);return h&&g?m-f:h&&!g?-1:!h&&g?1:0}case"list":{let m=g=>{if(Array.isArray(g))return this.normalizeUserListValue(g)[0];if(typeof g=="string")return g.trim().length===0?"":this.normalizeUserListValue(g)[0]},f=m(c),h=m(d);return(f==null||f==="")&&(h==null||h==="")?0:f==null||f===""?1:h==null||h===""?-1:f.localeCompare(h)}case"text":default:{let m=c!=null?String(c):"",f=d!=null?String(d):"";return m.localeCompare(f)}}}groupTasks(t,n,i){var a,o,l,c,d;if(n==="none")return new Map([["all",t]]);let s=new Map;for(let u of t)if(n==="project"){let p=ku(u.projects||[]);if(p.length>0)for(let m of p){let f=this.resolveProjectToAbsolutePath(m);s.has(f)||s.set(f,[]),(a=s.get(f))==null||a.push(u)}else{let m=this.getNoProjectLabel();s.has(m)||s.set(m,[]),(o=s.get(m))==null||o.push(u)}}else if(n==="tags"){let p=u.tags||[];if(p.length>0)for(let m of p)s.has(m)||s.set(m,[]),(l=s.get(m))==null||l.push(u);else{let m=this.getNoTagsLabel();s.has(m)||s.set(m,[]),(c=s.get(m))==null||c.push(u)}}else{let p;if(typeof n=="string"&&n.startsWith("user:"))p=this.getUserFieldGroupValue(u,n);else switch(n){case"status":p=u.status||"no-status";break;case"priority":p=u.priority||"unknown";break;case"context":p=u.contexts&&u.contexts.length>0?u.contexts[0]:"none";break;case"due":p=this.getDueDateGroup(u,i);break;case"scheduled":p=this.getScheduledDateGroup(u,i);break;case"completedDate":p=this.getCompletedDateGroup(u);break;default:p="unknown"}s.has(p)||s.set(p,[]),(d=s.get(p))==null||d.push(u)}return this.sortGroups(s,n)}getUserFieldGroupValue(t,n){var o,l,c;let i=n.slice(5),a=(((l=(o=this.plugin)==null?void 0:o.settings)==null?void 0:l.userFields)||[]).find(d=>(d.id||d.key)===i);if(!a)return"unknown-field";try{let d=this.cacheManager.getApp(),u=d.vault.getAbstractFileByPath(t.path);if(!(u instanceof pf.TFile))return"no-value";let p=(c=d.metadataCache.getFileCache(u))==null?void 0:c.frontmatter,m=p?p[a.key]:void 0;switch(a.type){case"boolean":{if(typeof m=="boolean")return m?"true":"false";if(m==null)return"no-value";let f=String(m).trim().toLowerCase();return f==="true"?"true":f==="false"?"false":"no-value"}case"number":{if(typeof m=="number")return String(m);if(typeof m=="string"){let f=m.match(/^(\d+(?:\.\d+)?)/);return f?f[1]:"non-numeric"}return"no-value"}case"date":return m?String(m):"no-date";case"list":{if(Array.isArray(m)){let f=this.normalizeUserListValue(m);return f.length>0?f[0]:"empty"}if(typeof m=="string"){if(m.trim().length===0)return"empty";let f=this.normalizeUserListValue(m);return f.length>0?f[0]:"empty"}return"no-value"}case"text":default:return m?String(m).trim()||"empty":"no-value"}}catch(d){return console.error("Error extracting user field value for grouping",d),"error"}}getDueDateGroup(t,n){var o,l,c;let i=n||new Date;i.setHours(0,0,0,0);let s=this.statusManager.isCompletedStatus(t.status),a=(c=(l=(o=this.plugin)==null?void 0:o.settings)==null?void 0:l.hideCompletedFromOverdue)!=null?c:!0;if(t.recurrence)if(WD(t,i)){let d=P(i,"yyyy-MM-dd");return this.getDateGroupFromDateStringWithTask(d,s,a)}else return t.due?this.getDateGroupFromDateStringWithTask(t.due,s,a):this.getDueGroupLabel("none");return t.due?this.getDateGroupFromDateStringWithTask(t.due,s,a):this.getDueGroupLabel("none")}getDateGroupFromDateString(t){let n=cn();if(rs(t))return this.getDueGroupLabel("overdue");let i=tt(t);if(Ln(i,n))return this.getDueGroupLabel("today");try{let s=new Date;s.setDate(s.getDate()+1);let a=P(s,"yyyy-MM-dd");if(Ln(i,a))return this.getDueGroupLabel("tomorrow");let o=new Date;o.setDate(o.getDate()+7);let l=P(o,"yyyy-MM-dd");return Yc(i,l)||Ln(i,l)?this.getDueGroupLabel("nextSevenDays"):this.getDueGroupLabel("later")}catch(s){return console.error(`Error categorizing date ${t}:`,s),this.getInvalidDateLabel()}}getDueDateGroupFromDate(t){return this.getDateGroupFromDateString(t)}getDueDateGroupForTask(t){var s,a,o;if(!t.due)return"No due date";let n=this.statusManager.isCompletedStatus(t.status),i=(o=(a=(s=this.plugin)==null?void 0:s.settings)==null?void 0:a.hideCompletedFromOverdue)!=null?o:!0;return this.getDateGroupFromDateStringWithTask(t.due,n,i)}getDateGroupFromDateStringWithTask(t,n,i){let s=cn();if(rs(t,n,i))return this.getDueGroupLabel("overdue");let a=tt(t);if(Ln(a,s))return this.getDueGroupLabel("today");try{let o=new Date;o.setDate(o.getDate()+1);let l=P(o,"yyyy-MM-dd");if(Ln(a,l))return this.getDueGroupLabel("tomorrow");let c=new Date;c.setDate(c.getDate()+7);let d=P(c,"yyyy-MM-dd");return Yc(a,d)||Ln(a,d)?this.getDueGroupLabel("nextSevenDays"):this.getDueGroupLabel("later")}catch(o){return console.error(`Error categorizing date ${t}:`,o),this.getInvalidDateLabel()}}getScheduledDateGroup(t,n){var a,o,l;if(!t.scheduled)return this.getScheduledGroupLabel("none");let i=this.statusManager.isCompletedStatus(t.status),s=(l=(o=(a=this.plugin)==null?void 0:a.settings)==null?void 0:o.hideCompletedFromOverdue)!=null?l:!0;return this.getScheduledDateGroupForTask(t.scheduled,i,s)}getScheduledDateGroupForTask(t,n,i){let s=cn();if(rs(t,n,i))return this.getScheduledGroupLabel("past");let a=tt(t);if(Ln(a,s))return this.getScheduledGroupLabel("today");try{let o=new Date;o.setDate(o.getDate()+1);let l=P(o,"yyyy-MM-dd");if(Ln(a,l))return this.getScheduledGroupLabel("tomorrow");let c=new Date;c.setDate(c.getDate()+7);let d=P(c,"yyyy-MM-dd");return Yc(a,d)||Ln(a,d)?this.getScheduledGroupLabel("nextSevenDays"):this.getScheduledGroupLabel("later")}catch(o){return console.error(`Error categorizing scheduled date ${t}:`,o),this.getInvalidDateLabel()}}getScheduledDateGroupFromDate(t){let n=cn();if(rs(t))return this.getScheduledGroupLabel("past");let i=tt(t);if(Ln(i,n))return this.getScheduledGroupLabel("today");try{let s=new Date;s.setDate(s.getDate()+1);let a=P(s,"yyyy-MM-dd");if(Ln(i,a))return this.getScheduledGroupLabel("tomorrow");let o=new Date;o.setDate(o.getDate()+7);let l=P(o,"yyyy-MM-dd");return Yc(i,l)||Ln(i,l)?this.getScheduledGroupLabel("nextSevenDays"):this.getScheduledGroupLabel("later")}catch(s){return console.error(`Error categorizing scheduled date ${t}:`,s),this.getInvalidDateLabel()}}getCompletedDateGroup(t){if(!t.completedDate)return"Not completed";try{let n=ia(t.completedDate);return P(n,"yyyy-MM-dd")}catch(n){return console.error(`Error formatting completed date ${t.completedDate}:`,n),"Invalid date"}}sortGroups(t,n){let i=new Map,s;if(typeof n=="string"&&n.startsWith("user:"))s=this.sortUserFieldGroups(Array.from(t.keys()),n),this.currentSortKey===n&&this.currentSortDirection==="desc"&&s.reverse();else switch(n){case"priority":s=Array.from(t.keys()).sort((a,o)=>{let l=this.priorityManager.getPriorityWeight(a);return this.priorityManager.getPriorityWeight(o)-l});break;case"status":s=Array.from(t.keys()).sort((a,o)=>{let l=this.statusManager.getStatusOrder(a),c=this.statusManager.getStatusOrder(o);return l-c});break;case"due":{let a=["overdue","today","tomorrow","nextSevenDays","later","none"],o=new Map(a.map((l,c)=>[this.getDueGroupLabel(l),c]));s=Array.from(t.keys()).sort((l,c)=>{var p,m;let d=(p=o.get(l))!=null?p:a.length,u=(m=o.get(c))!=null?m:a.length;return d-u});break}case"scheduled":{let a=["past","today","tomorrow","nextSevenDays","later","none"],o=new Map(a.map((l,c)=>[this.getScheduledGroupLabel(l),c]));s=Array.from(t.keys()).sort((l,c)=>{var p,m;let d=(p=o.get(l))!=null?p:a.length,u=(m=o.get(c))!=null?m:a.length;return d-u});break}case"project":s=Array.from(t.keys()).sort((a,o)=>{let l=this.getNoProjectLabel();return a===l?1:o===l?-1:a==null?1:o==null?-1:a.localeCompare(o,this.getLocale())});break;case"tags":s=Array.from(t.keys()).sort((a,o)=>{let l=this.getNoTagsLabel();return a===l?1:o===l?-1:a==null?1:o==null?-1:a.localeCompare(o,this.getLocale())});break;case"completedDate":s=Array.from(t.keys()).sort((a,o)=>{let l="Not completed";if(a===l)return 1;if(o===l)return-1;if(a==="Invalid date")return 1;if(o==="Invalid date")return-1;if(a==null||o==null){if(a==null)return 1;if(o==null)return-1}return o.localeCompare(a)});break;default:s=Array.from(t.keys()).sort((a,o)=>a==null?1:o==null?-1:a.localeCompare(o,this.getLocale()))}for(let a of s){let o=t.get(a);o&&i.set(a,o)}return i}sortUserFieldGroups(t,n){var o,l;let i=n.slice(5),a=(((l=(o=this.plugin)==null?void 0:o.settings)==null?void 0:l.userFields)||[]).find(c=>(c.id||c.key)===i);if(!a)return t.sort();switch(a.type){case"number":return t.sort((c,d)=>{let u=parseFloat(c),p=parseFloat(d),m=!isNaN(u),f=!isNaN(p);return m&&f?p-u:m&&!f?-1:!m&&f||c==null?1:d==null?-1:c.localeCompare(d)});case"boolean":return t.sort((c,d)=>c==="true"&&d==="false"?-1:c==="false"&&d==="true"||c==null?1:d==null?-1:c.localeCompare(d));case"date":return t.sort((c,d)=>{let u=Date.parse(c),p=Date.parse(d),m=!isNaN(u),f=!isNaN(p);return m&&f?u-p:m&&!f?-1:!m&&f||c==null?1:d==null?-1:c.localeCompare(d)});case"text":case"list":default:return t.sort((c,d)=>c==null?1:d==null?-1:c.localeCompare(d))}}async getFilterOptions(){let t=Date.now();if(this.filterOptionsCache&&t-this.filterOptionsCacheTimestamp3e4&&this.invalidateFilterOptionsCache()}invalidateFilterOptionsCache(){this.filterOptionsCache&&(this.filterOptionsCache=null)}refreshFilterOptions(){this.invalidateFilterOptionsCache()}getFilterOptionsCacheStats(){let t=Date.now(),n=this.filterOptionsCache?t-this.filterOptionsCacheTimestamp:0,i=this.filterOptionsCache?Math.max(0,this.filterOptionsCacheTTL-n):0,s=this.filterOptionsCacheHits+this.filterOptionsComputeCount,a=s>0?(this.filterOptionsCacheHits/s*100).toFixed(1)+"%":"0%";return{cacheHits:this.filterOptionsCacheHits,computeCount:this.filterOptionsComputeCount,hitRate:a,isCurrentlyCached:!!this.filterOptionsCache,cacheAge:n,ttlRemaining:i}}createDefaultQuery(){return{type:"group",id:vr.generateId(),conjunction:"and",children:[],sortKey:"due",sortDirection:"asc",groupKey:"none"}}addQuickToggleCondition(t,n,i){let s=JSON.parse(JSON.stringify(t));if(this.removeQuickToggleCondition(s,n),!i){let a;switch(n){case"showCompleted":a={type:"condition",id:vr.generateId(),property:"status.isCompleted",operator:"is-not-checked",value:null};break;case"showArchived":a={type:"condition",id:vr.generateId(),property:"archived",operator:"is-not-checked",value:null};break;case"showRecurrent":a={type:"condition",id:vr.generateId(),property:"recurrence",operator:"is-empty",value:null};break}s.children.push(a)}return s}removeQuickToggleCondition(t,n){let i;switch(n){case"showCompleted":i="status.isCompleted";break;case"showArchived":i="archived";break;case"showRecurrent":i="recurrence";break}t.children=t.children.filter(s=>s.type==="condition"?s.property!==i:!0)}normalizeQuery(t){let n=this.createDefaultQuery();return{...n,...t,type:"group",id:t.id||n.id,conjunction:t.conjunction||n.conjunction,children:t.children||n.children,sortKey:t.sortKey||n.sortKey,sortDirection:t.sortDirection||n.sortDirection,groupKey:t.groupKey||n.groupKey}}initialize(){this.cacheManager.on("file-updated",()=>{this.queryPlanner.clearIndexQueryCache(),this.checkAndInvalidateFilterOptionsCache(),this.emit("data-changed")}),this.cacheManager.on("file-added",()=>{this.queryPlanner.clearIndexQueryCache(),this.checkAndInvalidateFilterOptionsCache(),this.emit("data-changed")}),this.cacheManager.on("file-deleted",()=>{this.queryPlanner.clearIndexQueryCache(),this.checkAndInvalidateFilterOptionsCache(),this.emit("data-changed")}),this.cacheManager.on("file-renamed",()=>{this.queryPlanner.clearIndexQueryCache(),this.checkAndInvalidateFilterOptionsCache(),this.emit("data-changed")}),this.cacheManager.on("indexes-built",()=>{this.queryPlanner.clearIndexQueryCache(),this.checkAndInvalidateFilterOptionsCache(),this.emit("data-changed")})}cleanup(){this.queryPlanner.clearIndexQueryCache(),this.invalidateFilterOptionsCache(),this.removeAllListeners()}static createDateRangeFromDates(t){if(t.length===0)throw new Error(Ry.translateStatic("services.filter.errors.noDatesProvided","No dates provided"));let n=t[0],i=t[t.length-1];return{start:P(n,"yyyy-MM-dd"),end:P(i,"yyyy-MM-dd")}}static shouldIncludeOverdueForRange(t,n){if(!n)return!1;let s=P(new Date,"yyyy-MM-dd");return t.some(a=>P(a,"yyyy-MM-dd")===s)}async getTasksForDate(t,n,i=!1){let s=ue(t),a=iT(s),o=this.cacheManager.getAllTaskPaths(),d=(await this.pathsToTaskInfos(Array.from(o))).filter(u=>this.evaluateFilterNode(n,u)).filter(u=>{var p,m,f;if(u.recurrence){let h=st(s);return WD(u,h)}if(u.due&&tt(u.due)===s||u.scheduled&&tt(u.scheduled)===s)return!0;if(i&&a){let h=this.statusManager.isCompletedStatus(u.status),g=(f=(m=(p=this.plugin)==null?void 0:p.settings)==null?void 0:m.hideCompletedFromOverdue)!=null?f:!0;if(u.due&&tt(u.due)!==s&&rs(u.due,h,g)||u.scheduled&&tt(u.scheduled)!==s&&rs(u.scheduled,h,g))return!0}return!1});return this.sortTasks(d,n.sortKey||"due",n.sortDirection||"asc")}async getOverdueTasks(t){let n=this.cacheManager.getAllTaskPaths(),a=(await this.pathsToTaskInfos(Array.from(n))).filter(o=>this.evaluateFilterNode(t,o)).filter(o=>{var d,u,p;let l=this.statusManager.isCompletedStatus(o.status),c=(p=(u=(d=this.plugin)==null?void 0:d.settings)==null?void 0:u.hideCompletedFromOverdue)!=null?p:!0;return o.recurrence?!!(o.due&&rs(o.due,l,c)||o.scheduled&&rs(o.scheduled,l,c)):!!(o.due&&rs(o.due,l,c)||o.scheduled&&rs(o.scheduled,l,c))});return this.sortTasks(a,t.sortKey||"due",t.sortDirection||"asc")}async getAgendaDataWithOverdue(t,n,i=!1){let s=[];for(let o of t){let l=await this.getTasksForDate(o,n,!1);s.push({date:new Date(o),tasks:l})}let a=i?await this.getOverdueTasks(n):[];return{dailyData:s,overdueTasks:a}}async getAgendaData(t,n,i=!1){let s=[];for(let a of t){let o=await this.getTasksForDate(a,n,i&&DL(a));s.push({date:new Date(a),tasks:o})}return s}async getFlatAgendaData(t,n,i=!1){let s=await this.getAgendaData(t,n,i),a=[];for(let o of s)for(let l of o.tasks)a.push({...l,agendaDate:o.date});return a}extractUniqueFolders(){let t=this.cacheManager.getAllTaskPaths(),n=new Set;for(let a of t){let o=a.lastIndexOf("/");if(o>0){let l=a.substring(0,o);n.add(l)}else o===-1&&n.add("")}let i=Array.from(n).sort(),s=this.translate("services.filter.folders.root","(Root)");return i.map(a=>a===""?s:a)}extractProjectNamesFromTaskValue(t,n){if(!t||t.trim()===""||t==='""')return[];let i=t.replace(/^"(.*)"$/,"$1");if(i.startsWith("[[")&&i.endsWith("]]")){let s=i.slice(2,-2),a=(0,pf.parseLinktext)(s),o=this.cacheManager.getApp().metadataCache.getFirstLinkpathDest(a.path,n);if(o)return[o.basename];{let l=a.subpath||(a.path.includes("/")?a.path.split("/").pop():a.path);return l?[l]:[]}}else return[i]}};Ry.lastInstance=null;v_=Ry});var Oy,Vj=v(()=>{Oy=class{constructor(e,t){this.cache=e;this.statusManager=t}getStats(e){let t={},n={},i=0,s=0,a=0,o=0,l=0,c=0,d=new Date().toISOString().split("T")[0];for(let u of e){t[u.status]=(t[u.status]||0)+1,n[u.priority]=(n[u.priority]||0)+1;let p=this.statusManager.isCompletedStatus(u.status);u.archived&&o++,p&&i++,!p&&!u.archived&&s++,u.due&&u.due0&&(l++,c+=u.totalTrackedTime||0)}return{total:e.length,statusCounts:t,priorityCounts:n,completed:i,active:s,overdue:a,archived:o,withTimeEntries:l,totalTrackedMinutes:c,totalTrackedHours:Math.round(c/60*100)/100}}async getAggregatedTimeEstimate(e){let t=this.cache.getAllTimeEstimates();if(t.size===0)return 0;let{start:n,end:i}=this.getDateRange(e),s=0;for(let[a,o]of t.entries()){let l=await this.cache.getTaskInfo(a);l&&this.isTaskInRange(l,n,i)&&(s+=o)}return s}isTaskInRange(e,t,n){let i=e.due||e.scheduled;if(!i)return!1;let s=new Date(i);return s>=t&&s<=n}getDateRange(e){if(typeof e!="string")return e;let t=new Date,n=new Date(t),i=new Date(t);switch(e){case"daily":n.setHours(0,0,0,0),i.setHours(23,59,59,999);break;case"weekly":{let s=t.getDay(),a=t.getDate()-s+(s===0?-6:1);n.setDate(a),n.setHours(0,0,0,0),i.setDate(n.getDate()+6),i.setHours(23,59,59,999);break}case"monthly":n.setDate(1),n.setHours(0,0,0,0),i.setMonth(n.getMonth()+1),i.setDate(0),i.setHours(23,59,59,999);break;case"yearly":n.setMonth(0,1),n.setHours(0,0,0,0),i.setFullYear(n.getFullYear()+1),i.setDate(0),i.setHours(23,59,59,999);break}return{start:n,end:i}}}});var b_,mpe=v(()=>{bS();Om();b_=class extends Wl{constructor(t,n){super();this.filterState={};this.viewPreferences={};this.savedViews=[];this.storageKey="tasknotes-view-filter-state";this.preferencesStorageKey="tasknotes-view-preferences";this.savedViewsStorageKey="tasknotes-saved-views";this.app=t,this.plugin=n,this.loadFromStorage(),this.loadPreferencesFromStorage(),this.savedViews=[...this.plugin.settings.savedViews]}async initializeSavedViews(){await this.migrateAndLoadSavedViews()}getFilterState(t){let n=this.filterState[t];if(n){if(typeof n!="object"||n.type!=="group"||!Array.isArray(n.children)||typeof n.conjunction!="string"){console.warn(`ViewStateManager: Ignoring old format filter state for ${t}, will use default`),delete this.filterState[t],this.saveToStorage();return}return vr.deepCloneFilterQuery(n)}}setFilterState(t,n){this.filterState[t]=vr.deepCloneFilterQuery(n),this.saveToStorage(),this.emit("filter-state-changed",{viewType:t,query:vr.deepCloneFilterQuery(n)})}clearFilterState(t){delete this.filterState[t],this.saveToStorage(),this.emit("filter-state-cleared",{viewType:t})}clearAllFilterStates(){this.filterState={},this.saveToStorage(),this.emit("all-filter-states-cleared")}getViewPreferences(t){return this.viewPreferences[t]}setViewPreferences(t,n){this.viewPreferences[t]={...n},this.savePreferencesToStorage(),this.emit("view-preferences-changed",{viewType:t,preferences:n})}clearViewPreferences(t){delete this.viewPreferences[t],this.savePreferencesToStorage(),this.emit("view-preferences-cleared",{viewType:t})}clearAllViewPreferences(){this.viewPreferences={},this.savePreferencesToStorage(),this.emit("all-view-preferences-cleared")}loadFromStorage(){try{let t=this.app.loadLocalStorage(this.storageKey);t&&typeof t=="string"&&(this.filterState=JSON.parse(t))}catch(t){console.warn("Failed to load view filter state from storage:",t),this.filterState={}}}saveToStorage(){try{this.app.saveLocalStorage(this.storageKey,JSON.stringify(this.filterState))}catch(t){console.warn("Failed to save view filter state to storage:",t)}}loadPreferencesFromStorage(){try{let t=this.app.loadLocalStorage(this.preferencesStorageKey);t&&typeof t=="string"&&(this.viewPreferences=JSON.parse(t))}catch(t){console.warn("Failed to load view preferences from storage:",t),this.viewPreferences={}}}savePreferencesToStorage(){try{this.app.saveLocalStorage(this.preferencesStorageKey,JSON.stringify(this.viewPreferences))}catch(t){console.warn("Failed to save view preferences to storage:",t)}}getAllFilterStates(){return{...this.filterState}}getSavedViews(){return this.savedViews.map(t=>({...t,query:vr.deepCloneFilterQuery(t.query),viewOptions:t.viewOptions?{...t.viewOptions}:void 0}))}saveView(t,n,i,s){let a={id:this.generateId(),name:t,query:vr.deepCloneFilterQuery(n),viewOptions:i?{...i}:void 0,visibleProperties:s?[...s]:void 0};return this.savedViews.push(a),this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews()),a}updateView(t,n){let i=this.savedViews.findIndex(a=>a.id===t);if(i===-1)throw new Error(`Saved view with ID ${t} not found`);let s={...n};s.query&&(s.query=vr.deepCloneFilterQuery(s.query)),s.viewOptions&&(s.viewOptions={...s.viewOptions}),this.savedViews[i]={...this.savedViews[i],...s},this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}deleteView(t){let n=this.savedViews.findIndex(i=>i.id===t);if(n===-1)throw new Error(`Saved view with ID ${t} not found`);this.savedViews.splice(n,1),this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}getSavedView(t){let n=this.savedViews.find(i=>i.id===t);if(n)return{...n,query:vr.deepCloneFilterQuery(n.query),viewOptions:n.viewOptions?{...n.viewOptions}:void 0,visibleProperties:n.visibleProperties?[...n.visibleProperties]:void 0}}clearAllSavedViews(){this.savedViews=[],this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}updateSavedViewProperties(t,n){let i=this.savedViews.find(s=>s.id===t);i&&(i.visibleProperties=n,this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews()))}getSavedViewProperties(t){let n=this.savedViews.find(i=>i.id===t);return n==null?void 0:n.visibleProperties}reorderSavedViews(t,n){if(t<0||t>=this.savedViews.length||n<0||n>this.savedViews.length||t===n)return;n=Math.min(n,this.savedViews.length-1);let[i]=this.savedViews.splice(t,1);this.savedViews.splice(n,0,i),this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}generateId(){return Date.now().toString(36)+Math.random().toString(36).slice(2,11)}async migrateAndLoadSavedViews(){try{this.savedViews=[...this.plugin.settings.savedViews];let t=this.app.loadLocalStorage(this.savedViewsStorageKey);if(t&&typeof t=="string"&&this.savedViews.length===0){let n=JSON.parse(t);this.savedViews=[...n],await this.saveSavedViewsToPluginData(),this.app.saveLocalStorage(this.savedViewsStorageKey,null)}}catch(t){console.warn("Failed to load/migrate saved views:",t),this.savedViews=[]}}async saveSavedViewsToPluginData(){try{this.plugin.settings.savedViews=[...this.savedViews],await this.plugin.saveSettings()}catch(t){console.warn("Failed to save saved views to plugin data:",t)}}needsMigration(){let n=!!this.app.loadLocalStorage(this.savedViewsStorageKey),i=this.plugin.settings.savedViews&&this.plugin.settings.savedViews.length>0;return n&&!i}async performMigration(){try{this.clearAllFilterStates(),await this.migrateAndLoadSavedViews(),this.emit("migration-complete")}catch(t){console.error("Error during ViewStateManager migration:",t),this.savedViews=[],await this.saveSavedViewsToPluginData()}}cleanup(){this.removeAllListeners()}}});var fpe,T_,hpe=v(()=>{fpe=require("obsidian");Bo();T_=class{constructor(e){this.projectIndex=new Map;this.indexLastBuilt=0;this.INDEX_TTL=3e4;this.stats={indexBuilds:0,indexHits:0,indexMisses:0};this.plugin=e}getFilesLinkingToProject(e){let t=this.plugin.app.metadataCache.resolvedLinks,n=[];for(let[i,s]of Object.entries(t))s&&s[e]>0&&n.push(i);return n}getUnresolvedProjectReferences(e){let n=this.plugin.app.metadataCache.unresolvedLinks[e];return n?Object.keys(n).filter(i=>!i.includes("#")&&!i.includes("|")):[]}async getTasksLinkedToProject(e){try{let t=this.getFilesLinkingToProject(e.path),n=[];for(let i of t){let s=await this.plugin.cacheManager.getTaskInfo(i);s&&await this.isLinkFromProjectsField(i,e.path)&&n.push(s)}return n}catch(t){return console.error("Error getting tasks linked to project:",t),[]}}async isTaskUsedAsProject(e){return this.isTaskUsedAsProjectSync(e)}async isLinkFromProjectsField(e,t){var n;try{let i=this.plugin.app.vault.getAbstractFileByPath(e);if(!(i instanceof fpe.TFile))return!1;let s=this.plugin.app.metadataCache.getFileCache(i),a=this.plugin.fieldMapper.toUserField("projects");if(!((n=s==null?void 0:s.frontmatter)!=null&&n[a]))return!1;let o=s.frontmatter[a];if(!Array.isArray(o))return!1;for(let l of o){if(!l||typeof l!="string")continue;let c=dn(l);if(c===l&&!l.startsWith("[["))continue;let d=this.plugin.app.metadataCache.getFirstLinkpathDest(c,e);if(d&&d.path===t)return!0}return!1}catch(i){return console.error("Error checking if link is from projects field:",i),!1}}isTaskUsedAsProjectSync(e){return this.ensureIndexBuilt(),this.projectIndex.has(e)?(this.stats.indexHits++,this.projectIndex.get(e)):(this.stats.indexMisses++,!1)}buildProjectIndex(){this.projectIndex.clear(),this.stats.indexBuilds++;try{let e=this.plugin.app.metadataCache.resolvedLinks,t=new Set;for(let[n,i]of Object.entries(e)){if(!i)continue;let s=this.plugin.app.metadataCache.getCache(n);if(!(s!=null&&s.frontmatter)||!this.plugin.cacheManager.isTaskFile(s.frontmatter))continue;let a=this.plugin.fieldMapper.toUserField("projects"),o=s.frontmatter[a];if(Array.isArray(o))for(let l of o){if(!l||typeof l!="string")continue;let c=dn(l);if(c===l&&!l.startsWith("[["))continue;let d=this.plugin.app.metadataCache.getFirstLinkpathDest(c,n);d&&t.add(d.path)}}for(let n of t)this.projectIndex.set(n,!0);this.indexLastBuilt=Date.now()}catch(e){console.error("Error building project index:",e)}}ensureIndexBuilt(){Date.now()-this.indexLastBuilt>this.INDEX_TTL&&this.buildProjectIndex()}destroy(){this.projectIndex.clear(),this.stats={indexBuilds:0,indexHits:0,indexMisses:0}}sortTasks(e){return e.sort((t,n)=>{let i=this.plugin.statusManager.isCompletedStatus(t.status),s=this.plugin.statusManager.isCompletedStatus(n.status);if(i!==s)return i?1:-1;let a=this.plugin.priorityManager.getPriorityWeight(t.priority),o=this.plugin.priorityManager.getPriorityWeight(n.priority);return a!==o?o-a:t.due&&n.due?new Date(t.due).getTime()-new Date(n.due).getTime():t.due?-1:n.due?1:t.title.localeCompare(n.title)})}}});var k_,gpe=v(()=>{k_=class{constructor(e){this.expandedProjects=new Set;this.plugin=e}isExpanded(e){return this.expandedProjects.has(e)}toggle(e){return this.expandedProjects.has(e)?(this.expandedProjects.delete(e),!1):(this.expandedProjects.add(e),!0)}setExpanded(e,t){t?this.expandedProjects.add(e):this.expandedProjects.delete(e)}getExpandedProjects(){return Array.from(this.expandedProjects)}clearAll(){this.expandedProjects.clear()}collapseAll(){this.clearAll()}}});var w_,ype=v(()=>{w_=class{constructor(e){this.processorInterval=null;this.PROCESSOR_INTERVAL_MS=6e4;this.plugin=e}hasGoogleCalendarLink(e){return!!e.googleCalendarEventId}normalizeStatusValue(e){return typeof e=="boolean"?e?"true":"false":String(e)}getCalendarCleanupState(){let e=this.plugin.settings.googleCalendarExport;return!(e!=null&&e.enabled)||!(e!=null&&e.syncOnTaskDelete)?"skip":this.plugin.taskCalendarSyncService&&this.plugin.taskCalendarSyncService.isEnabled()?"ready":"retry"}async start(){await this.processQueue(),this.processorInterval=window.setInterval(()=>{this.processQueue().catch(e=>{console.error("Error processing auto-archive queue:",e)})},this.PROCESSOR_INTERVAL_MS)}stop(){this.processorInterval&&(window.clearInterval(this.processorInterval),this.processorInterval=null)}async scheduleAutoArchive(e,t){if(!t.autoArchive)return;let n=Date.now(),i=n+t.autoArchiveDelay*60*1e3,s={taskPath:e.path,statusChangeTimestamp:n,archiveAfterTimestamp:i,statusValue:t.value};await this.cancelAutoArchive(e.path);let a=await this.getQueue();a.push(s),await this.saveQueue(a)}async cancelAutoArchive(e){let t=await this.getQueue(),n=t.filter(i=>i.taskPath!==e);n.length!==t.length&&await this.saveQueue(n)}async processQueue(){let e=await this.getQueue();if(e.length===0)return;let t=Date.now(),n=[],i=[];for(let o of e)t>=o.archiveAfterTimestamp?n.push(o):i.push(o);if(n.length===0)return;let s=[];for(let o of n)try{await this.processItem(o)||s.push(o)}catch(l){console.error(`Error processing auto-archive for ${o.taskPath}:`,l),s.push(o)}let a=[...s,...i];await this.saveQueue(a)}async processItem(e){let t=await this.plugin.cacheManager.getTaskByPath(e.taskPath);if(!t||this.normalizeStatusValue(t.status)!==this.normalizeStatusValue(e.statusValue))return!0;if(t.archived){if(this.hasGoogleCalendarLink(t)){let n=this.getCalendarCleanupState();if(n==="skip")return!0;if(n==="retry")return console.warn(`Auto-archive Google cleanup deferred until calendar sync is ready for ${e.taskPath}`),!1;let i=await this.plugin.taskCalendarSyncService.deleteTaskFromCalendar(t);return i||console.warn(`Auto-archive Google cleanup still pending for ${e.taskPath}`),i}return!0}try{let n=await this.plugin.taskService.toggleArchive(t);if(n.archived&&this.hasGoogleCalendarLink(n)){e.taskPath=n.path;let i=this.getCalendarCleanupState();return i==="skip"?!0:(i==="retry"&&console.warn(`Auto-archive Google cleanup deferred until calendar sync is ready for ${e.taskPath}`),!1)}return!0}catch(n){return console.error(`Failed to archive task ${e.taskPath}:`,n),!1}}async getQueue(){let e=await this.plugin.loadData();return(e==null?void 0:e.autoArchiveQueue)||[]}async saveQueue(e){let t=await this.plugin.loadData()||{};t.autoArchiveQueue=e,await this.plugin.saveData(t)}async clearQueue(){await this.saveQueue([])}async getQueueStatus(){let e=await this.getQueue();return{count:e.length,items:e}}}});function Xu(r,e){for(var t in e)r[t]=e[t];return r}function Dpe(r){var e=r.parentNode;e&&e.removeChild(r)}function _(r,e,t){var n,i,s,a={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?C_.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(s in r.defaultProps)a[s]===void 0&&(a[s]=r.defaultProps[s]);return S_(r,a,n,i,null)}function S_(r,e,t,n,i){var s={type:r,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++wpe:i};return i==null&&Le.vnode!=null&&Le.vnode(s),s}function nn(){return{current:null}}function jt(r){return r.children}function GHe(r,e,t,n,i){var s;for(s in t)s==="children"||s==="key"||s in e||E_(r,s,null,t[s],n);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||t[s]===e[s]||E_(r,s,e[s],t[s],n)}function bpe(r,e,t){e[0]==="-"?r.setProperty(e,t==null?"":t):r[e]=t==null?"":typeof t!="number"||YHe.test(e)?t:t+"px"}function E_(r,e,t,n,i){var s;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof n=="string"&&(r.style.cssText=n=""),n)for(e in n)t&&e in t||bpe(r.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||bpe(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+s]=t,t?n||r.addEventListener(e,s?kpe:Tpe,s):r.removeEventListener(e,s?kpe:Tpe,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in r)try{r[e]=t==null?"":t;break e}catch(a){}typeof t=="function"||(t==null||t===!1&&e.indexOf("-")==-1?r.removeAttribute(e):r.setAttribute(e,t))}}function Tpe(r){Ly=!0;try{return this.l[r.type+!1](Le.event?Le.event(r):r)}finally{Ly=!1}}function kpe(r){Ly=!0;try{return this.l[r.type+!0](Le.event?Le.event(r):r)}finally{Ly=!1}}function pi(r,e){this.props=r,this.context=e}function TS(r,e){if(e==null)return r.__?TS(r.__,r.__.__k.indexOf(r)+1):null;for(var t;ee&&mf.sort(function(l,c){return l.__v.__b-c.__v.__b}));D_.__r=0}function Ppe(r,e,t,n,i,s,a,o,l,c){var d,u,p,m,f,h,g,y=n&&n.__k||Epe,k=y.length;for(t.__k=[],d=0;d0?S_(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null){if(m.__=t,m.__b=t.__b+1,(p=y[d])===null||p&&m.key==p.key&&m.type===p.type)y[d]=void 0;else for(u=0;u=0;e--)if((t=r.__k[e])&&(n=Ape(t)))return n}return null}function Gj(r,e,t,n,i,s,a,o,l){var c,d,u,p,m,f,h,g,y,k,T,w,S,E,C,D=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,o=e.__e=t.__e,e.__h=null,s=[o]),(c=Le.__b)&&c(e);try{e:if(typeof D=="function"){if(g=e.props,y=(c=D.contextType)&&n[c.__c],k=c?y?y.props.value:c.__:n,t.__c?h=(d=e.__c=t.__c).__=d.__E:("prototype"in D&&D.prototype.render?e.__c=d=new D(g,k):(e.__c=d=new pi(g,k),d.constructor=D,d.render=QHe),y&&y.sub(d),d.props=g,d.state||(d.state={}),d.context=k,d.__n=n,u=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Xu({},d.__s)),Xu(d.__s,D.getDerivedStateFromProps(g,d.__s))),p=d.props,m=d.state,d.__v=e,u)D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(D.getDerivedStateFromProps==null&&g!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(g,k),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(g,d.__s,k)===!1||e.__v===t.__v){for(e.__v!==t.__v&&(d.props=g,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(A){A&&(A.__=e)}),T=0;T{x_={},Epe=[],YHe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;C_=Epe.slice,Le={__e:function(r,e,t,n){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(r)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(r,n||{}),a=i.__d),a)return i.__E=i}catch(o){r=o}throw r}},wpe=0,Yj=function(r){return r!=null&&r.constructor===void 0},Ly=!1,pi.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Xu({},this.state),typeof r=="function"&&(r=r(Xu({},t),this.props)),r&&Xu(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),Wj(this))},pi.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),Wj(this))},pi.prototype.render=jt,mf=[],Spe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,D_.__r=0,xpe=0});function eUe(){for(var r;r=qpe.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(__),r.__H.__h.forEach(Qj),r.__H.__h=[]}catch(e){r.__H.__h=[],Le.__e(e,r.__v)}}function tUe(r){var e,t=function(){clearTimeout(n),Bpe&&cancelAnimationFrame(e),setTimeout(r)},n=setTimeout(t,100);Bpe&&(e=requestAnimationFrame(t))}function __(r){var e=Yl,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),Yl=e}function Qj(r){var e=Yl;r.__c=r.__(),Yl=e}var XHe,Yl,Kj,Ope,qpe,Zj,Lpe,Fpe,$pe,jpe,zpe,Bpe,Jj=v(()=>{kd();qpe=[],Zj=[],Lpe=Le.__b,Fpe=Le.__r,$pe=Le.diffed,jpe=Le.__c,zpe=Le.unmount;Le.__b=function(r){Yl=null,Lpe&&Lpe(r)},Le.__r=function(r){Fpe&&Fpe(r),XHe=0;var e=(Yl=r.__c).__H;e&&(Kj===Yl?(e.__h=[],Yl.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=Zj,t.__N=t.i=void 0})):(e.__h.forEach(__),e.__h.forEach(Qj),e.__h=[])),Kj=Yl},Le.diffed=function(r){$pe&&$pe(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(qpe.push(e)!==1&&Ope===Le.requestAnimationFrame||((Ope=Le.requestAnimationFrame)||tUe)(eUe)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==Zj&&(t.__=t.__V),t.i=void 0,t.__V=Zj})),Kj=Yl=null},Le.__c=function(r,e){e.some(function(t){try{t.__h.forEach(__),t.__h=t.__h.filter(function(n){return!n.__||Qj(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Le.__e(n,t.__v)}}),jpe&&jpe(r,e)},Le.unmount=function(r){zpe&&zpe(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{__(n)}catch(i){e=i}}),t.__H=void 0,e&&Le.__e(e,t.__v))};Bpe=typeof requestAnimationFrame=="function"});function rUe(r,e){for(var t in e)r[t]=e[t];return r}function Hpe(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var n in e)if(n!=="__source"&&r[n]!==e[n])return!0;return!1}function Upe(r){this.props=r}function Jpe(r,e,t){return r&&(r.__c&&r.__c.__H&&(r.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),r.__c.__H=null),(r=rUe({},r)).__c!=null&&(r.__c.__P===t&&(r.__c.__P=e),r.__c=null),r.__k=r.__k&&r.__k.map(function(n){return Jpe(n,e,t)})),r}function Xpe(r,e,t){return r&&(r.__v=null,r.__k=r.__k&&r.__k.map(function(n){return Xpe(n,e,t)}),r.__c&&r.__c.__P===e&&(r.__e&&t.insertBefore(r.__e,r.__d),r.__c.__e=!0,r.__c.__P=t)),r}function Xj(){this.__u=0,this.t=null,this.__b=null}function eme(r){var e=r.__.__c;return e&&e.__a&&e.__a(r)}function M_(){this.u=null,this.o=null}function iUe(r){return this.getChildContext=function(){return r.context},r.children}function sUe(r){var e=this,t=r.i;e.componentWillUnmount=function(){ep(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),r.__v?(e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(n){this.childNodes.push(n),e.i.appendChild(n)},insertBefore:function(n,i){this.childNodes.push(n),e.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n)}}),ep(_(iUe,{context:e.context},r.__v),e.l)):e.l&&e.componentWillUnmount()}function ez(r,e){var t=_(sUe,{__v:r,i:e});return t.containerInfo=e,t}function dUe(){}function uUe(){return this.cancelBubble}function pUe(){return this.defaultPrevented}var Vpe,QJt,nUe,Wpe,Ype,aUe,oUe,lUe,cUe,Gpe,mUe,Kpe,Zpe,Qpe,wS=v(()=>{kd();kd();Jj();Jj();(Upe.prototype=new pi).isPureReactComponent=!0,Upe.prototype.shouldComponentUpdate=function(r,e){return Hpe(this.props,r)||Hpe(this.state,e)};Vpe=Le.__b;Le.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),Vpe&&Vpe(r)};QJt=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,nUe=Le.__e;Le.__e=function(r,e,t,n){if(r.then){for(var i,s=e;s=s.__;)if((i=s.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(r,e)}nUe(r,e,t,n)};Wpe=Le.unmount;Le.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&r.__h===!0&&(r.type=null),Wpe&&Wpe(r)},(Xj.prototype=new pi).__c=function(r,e){var t=e.__c,n=this;n.t==null&&(n.t=[]),n.t.push(t);var i=eme(n.__v),s=!1,a=function(){s||(s=!0,t.__R=null,i?i(o):o())};t.__R=a;var o=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Xpe(c,c.__c.__P,c.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.t.pop();)d.forceUpdate()}},l=e.__h===!0;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),r.then(a,a)},Xj.prototype.componentWillUnmount=function(){this.t=[]},Xj.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Jpe(this.__b,t,n.__O=n.__P)}this.__b=null}var i=e.__a&&_(jt,null,r.fallback);return i&&(i.__h=null),[_(jt,null,e.__a?null:r.children),i]};Ype=function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]{yme(e,r)})}function hme(r){r.isConnected&&r.getRootNode&&gme(r.getRootNode())}function gme(r){let e=uz.get(r);if(!e||!e.isConnected){if(e=r.querySelector("style[data-fullcalendar]"),!e){e=document.createElement("style"),e.setAttribute("data-fullcalendar","");let t=hUe();t&&(e.nonce=t);let n=r===document?document.head:r,i=r===document?n.querySelector("script,link[rel=stylesheet],link[as=style],style"):n.firstChild;n.insertBefore(e,i)}uz.set(r,e),fUe(e)}}function fUe(r){for(let e of fme)yme(r,e)}function yme(r,e){let{sheet:t}=r,n=t.cssRules.length;e.split("}").forEach((i,s)=>{i=i.trim(),i&&t.insertRule(i+"}",n+s)})}function hUe(){return tz===void 0&&(tz=gUe()),tz}function gUe(){let r=document.querySelector('meta[name="csp-nonce"]');if(r&&r.hasAttribute("content"))return r.getAttribute("content");let e=document.querySelector("script[nonce]");return e&&e.nonce||""}function $S(r){r.parentNode&&r.parentNode.removeChild(r)}function qn(r,e){if(r.closest)return r.closest(e);if(!document.documentElement.contains(r))return null;do{if(Y_(r,e))return r;r=r.parentElement||r.parentNode}while(r!==null&&r.nodeType===1);return null}function Y_(r,e){return(r.matches||r.matchesSelector||r.msMatchesSelector).call(r,e)}function vme(r,e){let t=r instanceof HTMLElement?[r]:r,n=[];for(let i=0;i{let n=qn(t.target,r);n&&e.call(n,t,n)}}function wz(r,e,t,n){let i=bUe(t,n);return r.addEventListener(e,i),()=>{r.removeEventListener(e,i)}}function bme(r,e,t,n){let i;return wz(r,"mouseover",e,(s,a)=>{if(a!==i){i=a,t(s,a);let o=l=>{i=null,n(l,a),a.removeEventListener("mouseleave",o)};a.addEventListener("mouseleave",o)}})}function Sz(r,e){let t=n=>{e(n),rme.forEach(i=>{r.removeEventListener(i,t)})};rme.forEach(n=>{r.addEventListener(n,t)})}function Tme(r){return Object.assign({onClick:r},kme(r))}function kme(r){return{tabIndex:0,onKeyDown(e){(e.key==="Enter"||e.key===" ")&&(r(e),e.preventDefault())}}}function Cd(){return nme+=1,String(nme)}function qy(){document.body.classList.add("fc-not-allowed")}function Hy(){document.body.classList.remove("fc-not-allowed")}function xz(r){r.style.userSelect="none",r.style.webkitUserSelect="none",r.addEventListener("selectstart",jS)}function Ez(r){r.style.userSelect="",r.style.webkitUserSelect="",r.removeEventListener("selectstart",jS)}function Dz(r){r.addEventListener("contextmenu",jS)}function Cz(r){r.removeEventListener("contextmenu",jS)}function wme(r){let e=[],t=[],n,i;for(typeof r=="string"?t=r.split(/\s*,\s*/):typeof r=="function"?t=[r]:Array.isArray(r)&&(t=r),n=0;nn.replace("$"+s,i||""),r):t}function Pz(r,e){return r-e}function SS(r){return r%1===0}function kUe(r){let e=r.querySelector(".fc-scrollgrid-shrink-frame"),t=r.querySelector(".fc-scrollgrid-shrink-cushion");if(!e)throw new Error("needs fc-scrollgrid-shrink-frame className");if(!t)throw new Error("needs fc-scrollgrid-shrink-cushion className");return r.getBoundingClientRect().width-e.getBoundingClientRect().width+t.getBoundingClientRect().width}function nt(r,e){return typeof r=="string"?SUe(r):typeof r=="object"&&r?sme(r):typeof r=="number"?sme({[e||"milliseconds"]:r}):null}function SUe(r){let e=wUe.exec(r);if(e){let t=e[1]?-1:1;return{years:0,months:0,days:t*(e[2]?parseInt(e[2],10):0),milliseconds:t*((e[3]?parseInt(e[3],10):0)*60*60*1e3+(e[4]?parseInt(e[4],10):0)*60*1e3+(e[5]?parseInt(e[5],10):0)*1e3+(e[6]?parseInt(e[6],10):0))}}return null}function sme(r){let e={years:r.years||r.year||0,months:r.months||r.month||0,days:r.days||r.day||0,milliseconds:(r.hours||r.hour||0)*60*60*1e3+(r.minutes||r.minute||0)*60*1e3+(r.seconds||r.second||0)*1e3+(r.milliseconds||r.millisecond||r.ms||0)},t=r.weeks||r.week;return t&&(e.days+=t*7,e.specifiedWeeks=!0),e}function xUe(r,e){return r.years===e.years&&r.months===e.months&&r.days===e.days&&r.milliseconds===e.milliseconds}function zS(r,e){return{years:r.years+e.years,months:r.months+e.months,days:r.days+e.days,milliseconds:r.milliseconds+e.milliseconds}}function Eme(r,e){return{years:r.years-e.years,months:r.months-e.months,days:r.days-e.days,milliseconds:r.milliseconds-e.milliseconds}}function _z(r,e){return{years:r.years*e,months:r.months*e,days:r.days*e,milliseconds:r.milliseconds*e}}function EUe(r){return Fy(r)/365}function DUe(r){return Fy(r)/30}function Fy(r){return wa(r)/864e5}function wa(r){return r.years*(365*864e5)+r.months*(30*864e5)+r.days*864e5+r.milliseconds}function BS(r,e){let t=null;for(let n=0;n=1?Math.min(i,s):i}function rz(r,e,t,n){let i=Rs([e,0,1+OUe(e,t,n)]),s=ar(r),a=Math.round(Xl(i,s));return Math.floor(a/7)+1}function OUe(r,e,t){let n=7+e-t;return-((7+Rs([r,0,n]).getUTCDay()-e)%7)+n-1}function ame(r){return[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()]}function ome(r){return new Date(r[0],r[1]||0,r[2]==null?1:r[2],r[3]||0,r[4]||0,r[5]||0)}function rp(r){return[r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()]}function Rs(r){return r.length===1&&(r=r.concat([0])),new Date(Date.UTC(...r))}function Az(r){return!isNaN(r.valueOf())}function np(r){return r.getUTCHours()*1e3*60*60+r.getUTCMinutes()*1e3*60+r.getUTCSeconds()*1e3+r.getUTCMilliseconds()}function Z_(r,e,t=!1){let n=r.toISOString();return n=n.replace(".000",""),t&&(n=n.replace("T00:00:00Z","")),n.length>10&&(e==null?n=n.replace("Z",""):e!==0&&(n=n.replace("Z",Nz(e,!0)))),n}function lp(r){return r.toISOString().replace(/T.*$/,"")}function Vy(r){return r.toISOString().match(/^\d{4}-\d{2}/)[0]}function Iz(r){return hf(r.getUTCHours(),2)+":"+hf(r.getUTCMinutes(),2)+":"+hf(r.getUTCSeconds(),2)}function Nz(r,e=!1){let t=r<0?"-":"+",n=Math.abs(r),i=Math.floor(n/60),s=Math.round(n%60);return e?`${t+hf(i,2)}:${hf(s,2)}`:`GMT${t}${i}${s?`:${hf(s,2)}`:""}`}function Se(r,e,t){let n,i;return function(...s){if(!n)i=r.apply(this,s);else if(!Jl(n,s)){t&&t(i);let a=r.apply(this,s);(!e||!e(a,i))&&(i=a)}return n=s,i}}function Wy(r,e,t){let n,i;return s=>{if(!n)i=r.call(this,s);else if(!zi(n,s)){t&&t(i);let a=r.call(this,s);(!e||!e(a,i))&&(i=a)}return n=s,i}}function lme(r,e,t){let n=Object.keys(r).length;return n===1&&r.timeZoneName==="short"?i=>Nz(i.timeZoneOffset):n===0&&e.week?i=>UUe(t.computeWeekNumber(i.marker),t.weekText,t.weekTextLong,t.locale,e.week):zUe(r,e,t)}function zUe(r,e,t){r=Object.assign({},r),e=Object.assign({},e),BUe(r,e),r.timeZone="UTC";let n=new Intl.DateTimeFormat(t.locale.codes,r),i;if(e.omitZeroMinute){let s=Object.assign({},r);delete s.minute,i=new Intl.DateTimeFormat(t.locale.codes,s)}return s=>{let{marker:a}=s,o;i&&!a.getUTCMinutes()?o=i:o=n;let l=o.format(a);return qUe(l,s,r,e,t)}}function BUe(r,e){r.timeZoneName&&(r.hour||(r.hour="2-digit"),r.minute||(r.minute="2-digit")),r.timeZoneName==="long"&&(r.timeZoneName="short"),e.omitZeroMinute&&(r.second||r.millisecond)&&delete e.omitZeroMinute}function qUe(r,e,t,n,i){return r=r.replace($Ue,""),t.timeZoneName==="short"&&(r=HUe(r,i.timeZone==="UTC"||e.timeZoneOffset==null?"UTC":Nz(e.timeZoneOffset))),n.omitCommas&&(r=r.replace(LUe,"").trim()),n.omitZeroMinute&&(r=r.replace(":00","")),n.meridiem===!1?r=r.replace(A_,"").trim():n.meridiem==="narrow"?r=r.replace(A_,(s,a)=>a.toLocaleLowerCase()):n.meridiem==="short"?r=r.replace(A_,(s,a)=>`${a.toLocaleLowerCase()}m`):n.meridiem==="lowercase"&&(r=r.replace(A_,s=>s.toLocaleLowerCase())),r=r.replace(FUe," "),r=r.trim(),r}function HUe(r,e){let t=!1;return r=r.replace(jUe,()=>(t=!0,e)),t||(r+=` ${e}`),r}function UUe(r,e,t,n,i){let s=[];return i==="long"?s.push(t):(i==="short"||i==="narrow")&&s.push(e),(i==="long"||i==="short")&&s.push(" "),s.push(n.simpleNumberFormat.format(r)),n.options.direction==="rtl"&&s.reverse(),s.join("")}function VUe(r,e,t){return t.getMarkerYear(r)!==t.getMarkerYear(e)?5:t.getMarkerMonth(r)!==t.getMarkerMonth(e)?4:t.getMarkerDay(r)!==t.getMarkerDay(e)?2:np(r)!==np(e)?1:0}function WUe(r,e){let t={};for(let n in r)(!(n in $_)||$_[n]<=e)&&(t[n]=r[n]);return t}function YUe(r,e,t,n){let i=0;for(;i=0;s-=1){let a=r[s][n];if(typeof a=="object"&&a)i.unshift(a);else if(a!==void 0){t[n]=a;break}}i.length&&(t[n]=J_(i))}}for(let n=r.length-1;n>=0;n-=1){let i=r[n];for(let s in i)s in t||(t[s]=i[s])}return t}function wd(r,e){let t={};for(let n in r)e(r[n],n)&&(t[n]=r[n]);return t}function oo(r,e){let t={};for(let n in r)t[n]=e(r[n],n);return t}function Fz(r){let e={};for(let t of r)e[t]=!0;return e}function X_(r){let e=[];for(let t in r)e.push(r[t]);return e}function zi(r,e){if(r===e)return!0;for(let t in r)if(z_.call(r,t)&&!(t in e))return!1;for(let t in e)if(z_.call(e,t)&&r[t]!==e[t])return!1;return!0}function KUe(r,e){let t=ZUe(r,e);for(let n of t)if(!GUe.test(n))return!1;return!0}function ZUe(r,e){let t=[];for(let n in r)z_.call(r,n)&&(n in e||t.push(n));for(let n in e)z_.call(e,n)&&r[n]!==e[n]&&t.push(n);return t}function L_(r,e,t={}){if(r===e)return!0;for(let n in e)if(!(n in r&&QUe(r[n],e[n],t[n])))return!1;for(let n in r)if(!(n in e))return!1;return!0}function QUe(r,e,t){return r===e||t===!0?!0:t?t(r,e):!1}function _me(r,e=0,t,n=1){let i=[];t==null&&(t=Object.keys(r).length);for(let s=e;s{this.props.value!==a.value&&s.forEach(o=>{o.context=a.value,o.forceUpdate()})},this.sub=a=>{s.push(a);let o=a.componentWillUnmount;a.componentWillUnmount=()=>{s.splice(s.indexOf(a),1),o&&o.call(a)}}}return i},e}function Nme(r,e,t,n,i,s,a,o,l,c,d,u,p,m){return{dateEnv:i,nowManager:s,options:t,pluginHooks:o,emitter:d,dispatch:l,getCurrentData:c,calendarApi:u,viewSpec:r,viewApi:e,dateProfileGenerator:n,theme:a,isRtl:t.direction==="rtl",addResizeHandler(f){d.on("_resize",f)},removeResizeHandler(f){d.off("_resize",f)},createScrollResponder(f){return new B_(f,d,nt(t.scrollTime),t.scrollTimeReset)},registerInteractiveComponent:p,unregisterInteractiveComponent:m}}function tVe(r){let e=Object.create(this.prototype.propEquality);Object.assign(e,r),this.prototype.propEquality=e}function rVe(r){let e=Object.create(this.prototype.stateEquality);Object.assign(e,r),this.prototype.stateEquality=e}function xa(r,e){typeof r=="function"?r(e):r&&(r.current=e)}function yz(r,e){var t;return!!(e.handleCustomRendering&&r&&(!((t=e.customRenderingMetaMap)===null||t===void 0)&&t[r]))}function $z(r,e,t){let n=Object.assign(Object.assign({},r.elAttrs),{ref:t});return(r.elClasses||e)&&(n.className=(r.elClasses||[]).concat(e||[]).concat(n.className||[]).filter(Boolean).join(" ")),r.elStyle&&(n.style=r.elStyle),n}function nVe(r){return!!r}function iVe(r,e){let t=r.props;return _(CS,Object.assign({renderProps:t.renderProps,generatorName:t.generatorName,customGenerator:t.customGenerator,defaultGenerator:t.defaultGenerator,renderId:r.context},e))}function sVe(r,e){let t=typeof r=="function"?r(e):r||[];return typeof t=="string"?[t]:t}function zz(r){return[`fc-${r.type}-view`,"fc-view"]}function aVe(r,e){let t=null,n=null;return r.start&&(t=e.createMarker(r.start)),r.end&&(n=e.createMarker(r.end)),!t&&!n||t&&n&&nn&&t.push({start:n,end:s.start}),s.end>n&&(n=s.end);return ne.start)&&(r.start===null||e.end===null||r.start=r.start)&&(r.end===null||e.end!==null&&e.end<=r.end)}function ao(r,e){return(r.start===null||e>=r.start)&&(r.end===null||e=e.end?new Date(e.end.valueOf()-1):r}function Ome(r){let e=Math.floor(Xl(r.start,r.end))||1,t=ar(r.start),n=Gr(t,e);return{start:t,end:n}}function tM(r,e=nt(0)){let t=null,n=null;if(r.end){n=ar(r.end);let i=r.end.valueOf()-n.valueOf();i&&i>=wa(e)&&(n=Gr(n,1))}return r.start&&(t=ar(r.start),n&&n<=t&&(n=Gr(t,1))),{start:t,end:n}}function Bz(r){let e=tM(r);return Xl(e.start,e.end)>1}function ip(r,e,t,n){return n==="year"?nt(t.diffWholeYears(r,e),"year"):n==="month"?nt(t.diffWholeMonths(r,e),"month"):Dme(r,e)}function Gy(r,e,t,n){return{instanceId:Cd(),defId:r,range:e,forcedStartTzo:t==null?null:t,forcedEndTzo:n==null?null:n}}function cVe(r,e,t,n){for(let i=0;i!a[l.defId].recurringDef);for(let l in a){let c=a[l];if(c.recurringDef){let{duration:d}=c.recurringDef;d||(d=c.allDay?s.defaultAllDayEventDuration:s.defaultTimedEventDuration);let u=dVe(c,d,e,n,i.recurringTypes);for(let p of u){let m=Gy(l,{start:p,end:n.add(p,d)});o[m.instanceId]=m}}}return{defs:a,instances:o}}function dVe(r,e,t,n,i){let a=i[r.recurringDef.typeId].expand(r.recurringDef.typeData,{start:n.subtract(t.start,e),end:t.end},n);return r.allDay&&(a=a.map(ar)),a}function Fme(r,e,t,n,i=qz(t),s,a){let{refined:o,extra:l}=HS(r,t,i),c=mVe(e,t),d=cVe(o,c,t.dateEnv,t.pluginHooks.recurringTypes);if(d){let p=jy(o,l,e?e.sourceId:"",d.allDay,!!d.duration,t,s);return p.recurringDef={typeId:d.typeId,typeData:d.typeData,duration:d.duration},{def:p,instance:null}}let u=pVe(o,c,t,n);if(u){let p=jy(o,l,e?e.sourceId:"",u.allDay,u.hasEnd,t,s),m=Gy(p.defId,u.range,u.forcedStartTzo,u.forcedEndTzo);return a&&p.publicId&&a[p.publicId]&&(m.instanceId=a[p.publicId]),{def:p,instance:m}}return null}function HS(r,e,t=qz(e)){return qS(r,t)}function qz(r){return Object.assign(Object.assign(Object.assign({},q_),uVe),r.pluginHooks.eventRefiners)}function jy(r,e,t,n,i,s,a){let o={title:r.title||"",groupId:r.groupId||"",publicId:r.id||"",url:r.url||"",recurringDef:null,defId:(a&&r.id?a[r.id]:"")||Cd(),sourceId:t,allDay:n,hasEnd:i,interactive:r.interactive,ui:Ky(r,s),extendedProps:Object.assign(Object.assign({},r.extendedProps||{}),e)};for(let l of s.pluginHooks.eventDefMemberAdders)Object.assign(o,l(r));return Object.freeze(o.ui.classNames),Object.freeze(o.extendedProps),o}function pVe(r,e,t,n){let{allDay:i}=r,s,a=null,o=!1,l,c=null,d=r.start!=null?r.start:r.date;if(s=t.dateEnv.createMarkerMeta(d),s)a=s.marker;else if(!n)return null;return r.end!=null&&(l=t.dateEnv.createMarkerMeta(r.end)),i==null&&(e!=null?i=e:i=(!s||s.isTimeUnspecified)&&(!l||l.isTimeUnspecified)),i&&a&&(a=ar(a)),l&&(c=l.marker,i&&(c=ar(c)),a&&c<=a&&(c=null)),c?o=!0:n||(o=t.options.forceEventDuration||!1,c=t.dateEnv.add(a,i?t.options.defaultAllDayEventDuration:t.options.defaultTimedEventDuration)),{allDay:i,hasEnd:o,range:{start:a,end:c},forcedStartTzo:s?s.forcedTzo:null,forcedEndTzo:l?l.forcedTzo:null}}function mVe(r,e){let t=null;return r&&(t=r.defaultAllDay),t==null&&(t=e.options.defaultAllDay),t}function PS(r,e,t,n,i,s){let a=Hn(),o=qz(t);for(let l of r){let c=Fme(l,e,t,n,o,i,s);c&&bf(c,a)}return a}function bf(r,e=Hn()){return e.defs[r.def.defId]=r.def,r.instance&&(e.instances[r.instance.instanceId]=r.instance),e}function US(r,e){let t=r.instances[e];if(t){let n=r.defs[t.defId],i=nM(r,s=>fVe(n,s));return i.defs[n.defId]=n,i.instances[t.instanceId]=t,i}return Hn()}function fVe(r,e){return!!(r.groupId&&r.groupId===e.groupId)}function Hn(){return{defs:{},instances:{}}}function rM(r,e){return{defs:Object.assign(Object.assign({},r.defs),e.defs),instances:Object.assign(Object.assign({},r.instances),e.instances)}}function nM(r,e){let t=wd(r.defs,e),n=wd(r.instances,i=>t[i.defId]);return{defs:t,instances:n}}function hVe(r,e){let{defs:t,instances:n}=r,i={},s={};for(let a in t)e.defs[a]||(i[a]=t[a]);for(let a in n)!e.instances[a]&&i[n[a].defId]&&(s[a]=n[a]);return{defs:i,instances:s}}function gVe(r,e){return Array.isArray(r)?PS(r,null,e,!0):typeof r=="object"&&r?PS([r],null,e,!0):r!=null?String(r):null}function vz(r){return Array.isArray(r)?r:typeof r=="string"?r.split(/\s+/):[]}function Ky(r,e){let t=gVe(r.constraint,e);return{display:r.display||null,startEditable:r.startEditable!=null?r.startEditable:r.editable,durationEditable:r.durationEditable!=null?r.durationEditable:r.editable,constraints:t!=null?[t]:[],overlap:r.overlap!=null?r.overlap:null,allows:r.allow!=null?[r.allow]:[],backgroundColor:r.backgroundColor||r.color||"",borderColor:r.borderColor||r.color||"",textColor:r.textColor||"",classNames:(r.className||[]).concat(r.classNames||[])}}function Hz(r){return r.reduce(vVe,yVe)}function vVe(r,e){return{display:e.display!=null?e.display:r.display,startEditable:e.startEditable!=null?e.startEditable:r.startEditable,durationEditable:e.durationEditable!=null?e.durationEditable:r.durationEditable,constraints:r.constraints.concat(e.constraints),overlap:typeof e.overlap=="boolean"?e.overlap:r.overlap,allows:r.allows.concat(e.allows),backgroundColor:e.backgroundColor||r.backgroundColor,borderColor:e.borderColor||r.borderColor,textColor:e.textColor||r.textColor,classNames:r.classNames.concat(e.classNames)}}function Uz(r,e,t=Vz(e)){let n;if(typeof r=="string"?n={url:r}:typeof r=="function"||Array.isArray(r)?n={events:r}:typeof r=="object"&&r&&(n=r),n){let{refined:i,extra:s}=qS(n,t),a=TVe(i,e);if(a)return{_raw:r,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:i.defaultAllDay,eventDataTransform:i.eventDataTransform,success:i.success,failure:i.failure,publicId:i.id||"",sourceId:Cd(),sourceDefId:a.sourceDefId,meta:a.meta,ui:Ky(i,e),extendedProps:s}}return null}function Vz(r){return Object.assign(Object.assign(Object.assign({},q_),bVe),r.pluginHooks.eventSourceRefiners)}function TVe(r,e){let t=e.pluginHooks.eventSourceDefs;for(let n=t.length-1;n>=0;n-=1){let s=t[n].parseMeta(r);if(s)return{sourceDefId:n,meta:s}}return null}function $me(r,e,t,n,i){switch(e.type){case"RECEIVE_EVENTS":return kVe(r,t[e.sourceId],e.fetchId,e.fetchRange,e.rawEvents,i);case"RESET_RAW_EVENTS":return wVe(r,t[e.sourceId],e.rawEvents,n.activeRange,i);case"ADD_EVENTS":return SVe(r,e.eventStore,n?n.activeRange:null,i);case"RESET_EVENTS":return e.eventStore;case"MERGE_EVENTS":return rM(r,e.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?vf(r,n.activeRange,i):r;case"REMOVE_EVENTS":return hVe(r,e.eventStore);case"REMOVE_EVENT_SOURCE":return zme(r,e.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return nM(r,s=>!s.sourceId);case"REMOVE_ALL_EVENTS":return Hn();default:return r}}function kVe(r,e,t,n,i,s){if(e&&t===e.latestFetchId){let a=PS(jme(i,e,s),e,s);return n&&(a=vf(a,n,s)),rM(zme(r,e.sourceId),a)}return r}function wVe(r,e,t,n,i){let{defIdMap:s,instanceIdMap:a}=EVe(r),o=PS(jme(t,e,i),e,i,!1,s,a);return vf(o,n,i)}function jme(r,e,t){let n=t.options.eventDataTransform,i=e?e.eventDataTransform:null;return i&&(r=ume(r,i)),n&&(r=ume(r,n)),r}function ume(r,e){let t;if(!e)t=r;else{t=[];for(let n of r){let i=e(n);i?t.push(i):i==null&&t.push(n)}}return t}function SVe(r,e,t,n){return t&&(e=vf(e,t,n)),rM(r,e)}function Wz(r,e,t){let{defs:n}=r,i=oo(r.instances,s=>n[s.defId].allDay?s:Object.assign(Object.assign({},s),{range:{start:t.createMarker(e.toDate(s.range.start,s.forcedStartTzo)),end:t.createMarker(e.toDate(s.range.end,s.forcedEndTzo))},forcedStartTzo:t.canComputeOffset?null:s.forcedStartTzo,forcedEndTzo:t.canComputeOffset?null:s.forcedEndTzo}));return{defs:n,instances:i}}function zme(r,e){return nM(r,t=>t.sourceId!==e)}function xVe(r,e){return{defs:r.defs,instances:wd(r.instances,t=>!e[t.instanceId])}}function EVe(r){let{defs:e,instances:t}=r,n={},i={};for(let s in e){let a=e[s],{publicId:o}=a;o&&(n[o]=s)}for(let s in t){let a=t[s],o=e[a.defId],{publicId:l}=o;l&&(i[l]=s)}return{defIdMap:n,instanceIdMap:i}}function DVe(r,e,t){(r[e]||(r[e]=[])).push(t)}function CVe(r,e,t){t?r[e]&&(r[e]=r[e].filter(n=>n!==t)):delete r[e]}function Yz(r,e){return PS(_Ve(r),null,e)}function _Ve(r){let e;return r===!0?e=[{}]:Array.isArray(r)?e=r.filter(t=>t.daysOfWeek):typeof r=="object"&&r?e=[r]:e=[],e=e.map(t=>Object.assign(Object.assign({},PVe),t)),e}function iM(r,e,t){t.emitter.trigger("select",Object.assign(Object.assign({},Gz(r,t)),{jsEvent:e?e.origEvent:null,view:t.viewApi||t.calendarApi.view}))}function MVe(r,e){e.emitter.trigger("unselect",{jsEvent:r?r.origEvent:null,view:e.viewApi||e.calendarApi.view})}function Gz(r,e){let t={};for(let n of e.pluginHooks.dateSpanTransforms)Object.assign(t,n(r,e));return Object.assign(t,qVe(r,e.dateEnv)),t}function _S(r,e,t){let{dateEnv:n,options:i}=t,s=e;return r?(s=ar(s),s=n.add(s,i.defaultAllDayEventDuration)):s=n.add(s,i.defaultTimedEventDuration),s}function VS(r,e,t,n){let i=H_(r.defs,e),s=Hn();for(let a in r.defs){let o=r.defs[a];s.defs[a]=AVe(o,i[a],t,n)}for(let a in r.instances){let o=r.instances[a],l=s.defs[o.defId];s.instances[a]=IVe(o,l,i[o.defId],t,n)}return s}function AVe(r,e,t,n){let i=t.standardProps||{};i.hasEnd==null&&e.durationEditable&&(t.startDelta||t.endDelta)&&(i.hasEnd=!0);let s=Object.assign(Object.assign(Object.assign({},r),i),{ui:Object.assign(Object.assign({},r.ui),i.ui)});t.extendedProps&&(s.extendedProps=Object.assign(Object.assign({},s.extendedProps),t.extendedProps));for(let a of n.pluginHooks.eventDefMutationAppliers)a(s,t,n);return!s.hasEnd&&n.options.forceEventDuration&&(s.hasEnd=!0),s}function IVe(r,e,t,n,i){let{dateEnv:s}=i,a=n.standardProps&&n.standardProps.allDay===!0,o=n.standardProps&&n.standardProps.hasEnd===!1,l=Object.assign({},r);return a&&(l.range=Ome(l.range)),n.datesDelta&&t.startEditable&&(l.range={start:s.add(l.range.start,n.datesDelta),end:s.add(l.range.end,n.datesDelta)}),n.startDelta&&t.durationEditable&&(l.range={start:s.add(l.range.start,n.startDelta),end:l.range.end}),n.endDelta&&t.durationEditable&&(l.range={start:l.range.start,end:s.add(l.range.end,n.endDelta)}),o&&(l.range={start:l.range.start,end:_S(e.allDay,l.range.start,i)}),e.allDay&&(l.range={start:ar(l.range.start),end:ar(l.range.end)}),l.range.endqme(t,e))}function qme(r,e){let t=[];return e[""]&&t.push(e[""]),e[r.defId]&&t.push(e[r.defId]),t.push(r.ui),Hz(t)}function Pf(r,e){let t=r.map(NVe);return t.sort((n,i)=>Sme(n,i,e)),t.map(n=>n._seg)}function NVe(r){let{eventRange:e}=r,t=e.def,n=e.instance?e.instance.range:e.range,i=n.start?n.start.valueOf():0,s=n.end?n.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},t.extendedProps),t),{id:t.publicId,start:i,end:s,duration:s-i,allDay:Number(t.allDay),_seg:r})}function RVe(r,e){let{pluginHooks:t}=e,n=t.isDraggableTransformers,{def:i,ui:s}=r.eventRange,a=s.startEditable;for(let o of n)a=o(a,i,s,e);return a}function OVe(r,e){return r.isStart&&r.eventRange.ui.durationEditable&&e.options.eventResizableFromStart}function LVe(r,e){return r.isEnd&&r.eventRange.ui.durationEditable}function dp(r,e,t,n,i,s,a){let{dateEnv:o,options:l}=t,{displayEventTime:c,displayEventEnd:d}=l,u=r.eventRange.def,p=r.eventRange.instance;c==null&&(c=n!==!1),d==null&&(d=i!==!1);let m=p.range.start,f=p.range.end,h=s||r.start||r.eventRange.range.start,g=a||r.end||r.eventRange.range.end,y=ar(m).valueOf()===ar(h).valueOf(),k=ar(Gl(f,-1)).valueOf()===ar(Gl(g,-1)).valueOf();return c&&!u.allDay&&(y||k)?(h=y?m:h,g=k?f:g,d&&u.hasEnd?o.formatRange(h,g,e,{forcedStartTzo:s?null:p.forcedStartTzo,forcedEndTzo:a?null:p.forcedEndTzo}):o.format(h,e,{forcedTzo:s?null:p.forcedStartTzo})):""}function Ea(r,e,t){let n=r.eventRange.range;return{isPast:n.end<=(t||e.start),isFuture:n.start>=(t||e.end),isToday:e&&ao(e,n.start)}}function FVe(r){let e=["fc-event"];return r.isMirror&&e.push("fc-event-mirror"),r.isDraggable&&e.push("fc-event-draggable"),(r.isStartResizable||r.isEndResizable)&&e.push("fc-event-resizable"),r.isDragging&&e.push("fc-event-dragging"),r.isResizing&&e.push("fc-event-resizing"),r.isSelected&&e.push("fc-event-selected"),r.isStart&&e.push("fc-event-start"),r.isEnd&&e.push("fc-event-end"),r.isPast&&e.push("fc-event-past"),r.isToday&&e.push("fc-event-today"),r.isFuture&&e.push("fc-event-future"),e}function WS(r){return r.instance?r.instance.instanceId:`${r.def.defId}:${r.range.start.toISOString()}`}function Zy(r,e){let{def:t,instance:n}=r.eventRange,{url:i}=t;if(i)return{href:i};let{emitter:s,options:a}=e,{eventInteractive:o}=a;return o==null&&(o=t.interactive,o==null&&(o=!!s.hasHandlers("eventClick"))),o?kme(l=>{s.trigger("eventClick",{el:l.target,event:new wr(e,t,n),jsEvent:l,view:e.viewApi})}):{}}function jVe(r,e,t){let n=zVe(r,e),{range:i}=n;if(!i.start)return null;if(!i.end){if(t==null)return null;i.end=e.add(i.start,t)}return n}function zVe(r,e){let{refined:t,extra:n}=qS(r,$Ve),i=t.start?e.createMarkerMeta(t.start):null,s=t.end?e.createMarkerMeta(t.end):null,{allDay:a}=t;return a==null&&(a=i&&i.isTimeUnspecified&&(!s||s.isTimeUnspecified)),Object.assign({range:{start:i?i.marker:null,end:s?s.marker:null},allDay:a},n)}function Zz(r,e){return Rme(r.range,e.range)&&r.allDay===e.allDay&&BVe(r,e)}function BVe(r,e){for(let t in e)if(t!=="range"&&t!=="allDay"&&r[t]!==e[t])return!1;for(let t in r)if(!(t in e))return!1;return!0}function qVe(r,e){return Object.assign(Object.assign({},Hme(r.range,e,r.allDay)),{allDay:r.allDay})}function Qz(r,e,t){return Object.assign(Object.assign({},Hme(r,e,t)),{timeZone:e.timeZone})}function Hme(r,e,t){return{start:e.toDate(r.start),end:e.toDate(r.end),startStr:e.formatIso(r.start,{omitTime:t}),endStr:e.formatIso(r.end,{omitTime:t})}}function HVe(r,e,t){let n=HS({editable:!1},t),i=jy(n.refined,n.extra,"",r.allDay,!0,t);return{def:i,ui:qme(i,e),instance:Gy(i.defId,r.range),range:r.range,isStart:!0,isEnd:!0}}function Jz(r,e,t){let n=!1,i=function(o){n||(n=!0,e(o))},s=function(o){n||(n=!0,t(o))},a=r(i,s);a&&typeof a.then=="function"&&a.then(i,s)}function Xz(r,e,t){r=r.toUpperCase();let n={method:r};return r==="GET"?e+=(e.indexOf("?")===-1?"?":"&")+new URLSearchParams(t):(n.body=new URLSearchParams(t),n.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(e,n).then(i=>{if(i.ok)return i.json().then(s=>[s,i],()=>{throw new U_("Failure parsing JSON",i)});throw new U_("Request failed",i)})}function e2(){return iz==null&&(iz=UVe()),iz}function UVe(){if(typeof document=="undefined")return!0;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.innerHTML="
",r.querySelector("table").style.height="100px",r.querySelector("div").style.height="100%",document.body.appendChild(r);let t=r.querySelector("div").offsetHeight>0;return document.body.removeChild(r),t}function Ume(r,e){return{component:r,el:e.el,useEventCenter:e.useEventCenter!=null?e.useEventCenter:!0,isHitComboAllowed:e.isHitComboAllowed||null}}function YS(r){return{[r.component.uid]:r}}function VVe(r){let e=ar(r),t=Gr(e,1);return{start:e,end:t}}function t2(r,e){return r.left>=e.left&&r.left=e.top&&r.topt:e&&r>=e.end)}}function Qy(r,e){let t=["fc-day",`fc-day-${CUe[r.dow]}`];return r.isDisabled?t.push("fc-day-disabled"):(r.isToday&&(t.push("fc-day-today"),t.push(e.getClass("today"))),r.isPast&&t.push("fc-day-past"),r.isFuture&&t.push("fc-day-future"),r.isOther&&t.push("fc-day-other")),t}function rc(r,e,t="day",n=!0){let{dateEnv:i,options:s,calendarApi:a}=r,o=i.format(e,t==="week"?GVe:YVe);if(s.navLinks){let l=i.toDate(e),c=d=>{let u=t==="day"?s.navLinkDayClick:t==="week"?s.navLinkWeekClick:null;typeof u=="function"?u.call(a,i.toDate(e),d):(typeof u=="string"&&(t=u),a.zoomTo(e,t))};return Object.assign({title:Uy(s.navLinkHint,[o,l],o),"data-navlink":""},n?Tme(c):{onClick:c})}return{"aria-label":o}}function Vme(){return az===null&&(az=KVe()),az}function KVe(){let r=document.createElement("div");Cf(r,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),r.innerHTML="
",document.body.appendChild(r);let t=r.firstChild.getBoundingClientRect().left>r.getBoundingClientRect().left;return $S(r),t}function Wme(){return oz||(oz=ZVe()),oz}function ZVe(){let r=document.createElement("div");r.style.overflow="scroll",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",document.body.appendChild(r);let e=Yme(r);return document.body.removeChild(r),e}function Yme(r){return{x:r.offsetHeight-r.clientHeight,y:r.offsetWidth-r.clientWidth}}function Gme(r,e=!1){let t=window.getComputedStyle(r),n=parseInt(t.borderLeftWidth,10)||0,i=parseInt(t.borderRightWidth,10)||0,s=parseInt(t.borderTopWidth,10)||0,a=parseInt(t.borderBottomWidth,10)||0,o=Yme(r),l=o.y-n-i,c=o.x-s-a,d={borderLeft:n,borderRight:i,borderTop:s,borderBottom:a,scrollbarBottom:c,scrollbarLeft:0,scrollbarRight:0};return Vme()&&t.direction==="rtl"?d.scrollbarLeft=l:d.scrollbarRight=l,e&&(d.paddingLeft=parseInt(t.paddingLeft,10)||0,d.paddingRight=parseInt(t.paddingRight,10)||0,d.paddingTop=parseInt(t.paddingTop,10)||0,d.paddingBottom=parseInt(t.paddingBottom,10)||0),d}function s2(r,e=!1,t){let n=t?r.getBoundingClientRect():KS(r),i=Gme(r,e),s={left:n.left+i.borderLeft+i.scrollbarLeft,right:n.right-i.borderRight-i.scrollbarRight,top:n.top+i.borderTop,bottom:n.bottom-i.borderBottom-i.scrollbarBottom};return e&&(s.left+=i.paddingLeft,s.right-=i.paddingRight,s.top+=i.paddingTop,s.bottom-=i.paddingBottom),s}function KS(r){let e=r.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY}}function QVe(r){let e=aM(r),t=r.getBoundingClientRect();for(let n of e){let i=sM(t,n.getBoundingClientRect());if(i)t=i;else return null}return t}function aM(r){let e=[];for(;r instanceof HTMLElement;){let t=window.getComputedStyle(r);if(t.position==="fixed")break;/(auto|scroll)/.test(t.overflow+t.overflowY+t.overflowX)&&e.push(r),r=r.parentNode}return e}function N_(r,e){let t=r.length;if(t!==e.length)return!1;for(let n=0;nt(r[i-1]))return[i,0];for(;na)n=s+1;else return[s,1]}return[n,0]}function QS(r){let{refined:e,extra:t}=qS(r,XVe);return{startTime:e.startTime||null,duration:e.duration||null,create:e.create!=null?e.create:!0,sourceId:e.sourceId,leftoverProps:t}}function Kme(r,e){return!r||e>10?zt({weekday:"short"}):e>1?zt({weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}):zt({weekday:"long"})}function Qme(r){return r.text}function tWe(r,e,t){return r||Kme(e,t)}function R_(r,e){let t=r.activeRange;return e?t:{start:Gl(t.start,r.slotMinTime.milliseconds),end:Gl(t.end,r.slotMaxTime.milliseconds-864e5)}}function JS(r,e,t){let{instances:n}=r.mutatedEvents;for(let i in n)if(!Yy(e.validRange,n[i].range))return!1;return Jme({eventDrag:r},t)}function o2(r,e,t){return Yy(e.validRange,r.range)?Jme({dateSelection:r},t):!1}function Jme(r,e){let t=e.getCurrentData(),n=Object.assign({businessHours:t.businessHours,dateSelection:"",eventStore:t.eventStore,eventUiBases:t.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null},r);return(e.pluginHooks.isPropsValid||Xme)(n,e)}function Xme(r,e,t={},n){return!(r.eventDrag&&!rWe(r,e,t,n)||r.dateSelection&&!nWe(r,e,t,n))}function rWe(r,e,t,n){let i=e.getCurrentData(),s=r.eventDrag,a=s.mutatedEvents,o=a.defs,l=a.instances,c=H_(o,s.isEvent?r.eventUiBases:{"":i.selectionConfig});n&&(c=oo(c,n));let d=xVe(r.eventStore,s.affectedEvents.instances),u=d.defs,p=d.instances,m=H_(u,r.eventUiBases);for(let f in l){let h=l[f],g=h.range,y=c[h.defId],k=o[h.defId];if(!efe(y.constraints,g,d,r.businessHours,e))return!1;let{eventOverlap:T}=e.options,w=typeof T=="function"?T:null;for(let E in p){let C=p[E];if(eM(g,C.range)&&(m[C.defId].overlap===!1&&s.isEvent||y.overlap===!1||w&&!w(new wr(e,u[C.defId],C),new wr(e,k,h))))return!1}let S=i.eventStore;for(let E of y.allows){let C=Object.assign(Object.assign({},t),{range:h.range,allDay:k.allDay}),D=S.defs[k.defId],A=S.instances[f],N;if(D?N=new wr(e,D,A):N=new wr(e,k),!E(Gz(C,e),N))return!1}}return!0}function nWe(r,e,t,n){let i=r.eventStore,s=i.defs,a=i.instances,o=r.dateSelection,l=o.range,{selectionConfig:c}=e.getCurrentData();if(n&&(c=n(c)),!efe(c.constraints,l,i,r.businessHours,e))return!1;let{selectOverlap:d}=e.options,u=typeof d=="function"?d:null;for(let p in a){let m=a[p];if(eM(l,m.range)&&(c.overlap===!1||u&&!u(new wr(e,s[m.defId],m),null)))return!1}for(let p of c.allows){let m=Object.assign(Object.assign({},t),o);if(!p(Gz(m,e),null))return!1}return!0}function efe(r,e,t,n,i){for(let s of r)if(!sWe(iWe(s,e,t,n,i),e))return!1;return!0}function iWe(r,e,t,n,i){return r==="businessHours"?cz(vf(n,e,i)):typeof r=="string"?cz(nM(t,s=>s.groupId===r)):typeof r=="object"&&r?cz(vf(r,e,i)):[]}function cz(r){let{instances:e}=r,t=[];for(let n in e)t.push(e[n].range);return t}function sWe(r,e){for(let t of r)if(Yy(t,e))return!0;return!1}function tfe(r){let e=vme(r,".fc-scrollgrid-shrink"),t=0;for(let n of e)t=Math.max(t,kUe(n));return Math.ceil(t)}function l2(r,e){return r.liquid&&e.liquid}function rfe(r,e){return e.maxHeight!=null||l2(r,e)}function nfe(r,e,t,n){let{expandRows:i}=t;return typeof e.content=="function"?e.content(t):_("table",{role:"presentation",className:[e.tableClassName,r.syncRowHeights?"fc-scrollgrid-sync-table":""].join(" "),style:{minWidth:t.tableMinWidth,width:t.clientWidth,height:i?t.clientHeight:""}},t.tableColGroupNode,_(n?"thead":"tbody",{role:"presentation"},typeof e.rowContent=="function"?e.rowContent(t):e.rowContent))}function ife(r,e){return Jl(r,e,zi)}function sfe(r,e){let t=[];for(let n of r){let i=n.span||1;for(let s=0;se.eventRange.range.end?r:e}var fme,uz,tz,yUe,gf,vUe,tme,rme,nme,ime,wUe,CUe,nz,$_,A_,LUe,FUe,$Ue,jUe,pz,mz,fz,Rz,ec,Oz,Lz,cp,Pme,z_,GUe,Mme,hz,eVe,ES,Sd,gz,B_,lo,Kl,ht,CS,jz,fn,Sa,yf,F_,Lme,uVe,q_,yVe,bVe,xd,PVe,tp,wr,$Ve,U_,iz,MS,el,_f,Os,AS,sz,IS,YVe,GVe,az,oz,tl,Tf,NS,RS,Mn,kf,FS,Jy,XVe,Zme,V_,eWe,W_,Ed,wf,Sf,xf,O_,By,Ls,sp,Dd,ap,ex,lWe,op,Ef,rx,dz,bz,Tz,Df,c2=v(()=>{kd();kd();wS();fme=[],uz=new Map;typeof document!="undefined"&&gme(document);yUe=':root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}';Ql(yUe);gf=class{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:t}=this;t[e]=(t[e]||0)+1,this.clearTimeout()}resume(e="",t){let{pauseDepths:n}=this;e in n&&(t?delete n[e]:(n[e]-=1,n[e]<=0&&delete n[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}};vUe=/(top|left|right|bottom|width|height)$/i;tme=0;rme=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];nme=0;ime=["years","months","days","milliseconds"],wUe=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;CUe=["sun","mon","tue","wed","thu","fri","sat"];nz={week:3,separator:9,omitZeroMinute:9,meridiem:9,omitCommas:9},$_={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},A_=/\s*([ap])\.?m\.?/i,LUe=/,/g,FUe=/\s+/g,$Ue=/\u200e/g,jUe=/UTC|GMT/,pz=class{constructor(e){let t={},n={},i=9;for(let s in e)s in nz?(n[s]=e[s],nz[s]<9&&(i=Math.min(nz[s],i))):(t[s]=e[s],s in $_&&(i=Math.min($_[s],i)));this.standardDateProps=t,this.extendedSettings=n,this.smallestUnitNum=i,this.buildFormattingFunc=Se(lme)}format(e,t){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,t)(e)}formatRange(e,t,n,i){let{standardDateProps:s,extendedSettings:a}=this,o=VUe(e.marker,t.marker,n.calendarSystem);if(!o)return this.format(e,n);let l=o;l>1&&(s.year==="numeric"||s.year==="2-digit")&&(s.month==="numeric"||s.month==="2-digit")&&(s.day==="numeric"||s.day==="2-digit")&&(l=1);let c=this.format(e,n),d=this.format(t,n);if(c===d)return c;let u=WUe(s,l),p=lme(u,a,n),m=p(e),f=p(t),h=YUe(c,m,d,f),g=a.separator||i||n.defaultSeparator||"";return h?h.before+m+g+f+h.after:c+g+d}getSmallestUnit(){switch(this.smallestUnitNum){case 7:case 6:case 5:return"year";case 4:return"month";case 3:return"week";case 2:return"day";default:return"time"}}};mz=class{constructor(e){this.cmdStr=e}format(e,t,n){return t.cmdFormatter(this.cmdStr,j_(e,null,t,n))}formatRange(e,t,n,i){return n.cmdFormatter(this.cmdStr,j_(e,t,n,i))}},fz=class{constructor(e){this.func=e}format(e,t,n){return this.func(j_(e,null,t,n))}formatRange(e,t,n,i){return this.func(j_(e,t,n,i))}};Rz={navLinkDayClick:F,navLinkWeekClick:F,duration:nt,bootstrapFontAwesome:F,buttonIcons:F,customButtons:F,defaultAllDayEventDuration:nt,defaultTimedEventDuration:nt,nextDayThreshold:nt,scrollTime:nt,scrollTimeReset:Boolean,slotMinTime:nt,slotMaxTime:nt,dayPopoverFormat:zt,slotDuration:nt,snapDuration:nt,headerToolbar:F,footerToolbar:F,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:zt,dayHeaderClassNames:F,dayHeaderContent:F,dayHeaderDidMount:F,dayHeaderWillUnmount:F,dayCellClassNames:F,dayCellContent:F,dayCellDidMount:F,dayCellWillUnmount:F,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:F,weekNumbers:Boolean,weekNumberClassNames:F,weekNumberContent:F,weekNumberDidMount:F,weekNumberWillUnmount:F,editable:Boolean,viewClassNames:F,viewDidMount:F,viewWillUnmount:F,nowIndicator:Boolean,nowIndicatorSnap:F,nowIndicatorClassNames:F,nowIndicatorContent:F,nowIndicatorDidMount:F,nowIndicatorWillUnmount:F,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:F,locale:F,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:F,eventOrder:wme,eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:F,contentHeight:F,direction:String,weekNumberFormat:zt,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:F,initialDate:F,now:F,eventDataTransform:F,stickyHeaderDates:F,stickyFooterScrollbar:F,viewHeight:F,defaultAllDay:Boolean,eventSourceFailure:F,eventSourceSuccess:F,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:F,eventConstraint:F,eventAllow:F,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:F,eventContent:F,eventDidMount:F,eventWillUnmount:F,selectConstraint:F,selectOverlap:F,selectAllow:F,droppable:Boolean,unselectCancel:String,slotLabelFormat:F,slotLaneClassNames:F,slotLaneContent:F,slotLaneDidMount:F,slotLaneWillUnmount:F,slotLabelClassNames:F,slotLabelContent:F,slotLabelDidMount:F,slotLabelWillUnmount:F,dayMaxEvents:F,dayMaxEventRows:F,dayMinWidth:Number,slotLabelInterval:nt,allDayText:String,allDayClassNames:F,allDayContent:F,allDayDidMount:F,allDayWillUnmount:F,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:zt,rerenderDelay:Number,moreLinkText:F,moreLinkHint:F,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:F,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:nt,hiddenDays:F,fixedWeekCount:Boolean,validRange:F,visibleRange:F,titleFormat:F,eventInteractive:Boolean,noEventsText:String,viewHint:F,navLinkHint:F,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:F,moreLinkClassNames:F,moreLinkContent:F,moreLinkDidMount:F,moreLinkWillUnmount:F,monthStartFormat:zt,handleCustomRendering:F,customRenderingMetaMap:F,customRenderingReplaces:Boolean},ec={eventDisplay:"auto",defaultRangeSeparator:" - ",titleRangeSeparator:" \u2013 ",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",dayHeaders:!0,initialView:"",aspectRatio:1.35,headerToolbar:{start:"title",center:"",end:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",themeSystem:"standard",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",dayPopoverFormat:{month:"long",day:"numeric",year:"numeric"},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"},nowIndicatorSnap:"auto"},Oz={datesSet:F,eventsSet:F,eventAdd:F,eventChange:F,eventRemove:F,windowResize:F,eventClick:F,eventMouseEnter:F,eventMouseLeave:F,select:F,unselect:F,loading:F,_unmount:F,_beforeprint:F,_afterprint:F,_noEventDrop:F,_noEventResize:F,_resize:F,_scrollRequest:F},Lz={buttonText:F,buttonHints:F,views:F,plugins:F,initialEvents:F,events:F,eventSources:F},cp={headerToolbar:ff,footerToolbar:ff,buttonText:ff,buttonHints:ff,buttonIcons:ff,dateIncrement:ff,plugins:I_,events:I_,eventSources:I_,resources:I_};Pme={type:String,component:F,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:F,usesMinMaxTime:Boolean,classNames:F,content:F,didMount:F,willUnmount:F};({hasOwnProperty:z_}=Object.prototype);GUe=/^on[A-Z]/;Mme={};hz=class{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return Rs(e)}markerToArray(e){return rp(e)}};JUe("gregory",hz);eVe=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;ES=class{constructor(e){let t=this.timeZone=e.timeZone,n=t!=="local"&&t!=="UTC";e.namedTimeZoneImpl&&n&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(t)),this.canComputeOffset=!!(!n||this.namedTimeZoneImpl),this.calendarSystem=XUe(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation==="ISO"&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay=="number"&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation=="function"&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=e.weekText!=null?e.weekText:e.locale.options.weekText,this.weekTextLong=(e.weekTextLong!=null?e.weekTextLong:e.locale.options.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let t=this.createMarkerMeta(e);return t===null?null:t.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker(new Date().valueOf()):Rs(ame(new Date))}createMarkerMeta(e){if(typeof e=="string")return this.parse(e);let t=null;return typeof e=="number"?t=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(t=this.timestampToMarker(e))):Array.isArray(e)&&(t=Rs(e)),t===null||!Az(t)?null:{marker:t,isTimeUnspecified:!1,forcedTzo:null}}parse(e){let t=Ame(e);if(t===null)return null;let{marker:n}=t,i=null;return t.timeZoneOffset!==null&&(this.canComputeOffset?n=this.timestampToMarker(n.valueOf()-t.timeZoneOffset*60*1e3):i=t.timeZoneOffset),{marker:n,isTimeUnspecified:t.isTimeUnspecified,forcedTzo:i}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t.years,n[1]+=t.months,n[2]+=t.days,n[6]+=t.milliseconds,this.calendarSystem.arrayToMarker(n)}subtract(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]-=t.years,n[1]-=t.months,n[2]-=t.days,n[6]-=t.milliseconds,this.calendarSystem.arrayToMarker(n)}addYears(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t,this.calendarSystem.arrayToMarker(n)}addMonths(e,t){let n=this.calendarSystem.markerToArray(e);return n[1]+=t,this.calendarSystem.arrayToMarker(n)}diffWholeYears(e,t){let{calendarSystem:n}=this;return np(e)===np(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)&&n.getMarkerMonth(e)===n.getMarkerMonth(t)?n.getMarkerYear(t)-n.getMarkerYear(e):null}diffWholeMonths(e,t){let{calendarSystem:n}=this;return np(e)===np(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)?n.getMarkerMonth(t)-n.getMarkerMonth(e)+(n.getMarkerYear(t)-n.getMarkerYear(e))*12:null}greatestWholeUnit(e,t){let n=this.diffWholeYears(e,t);return n!==null?{unit:"year",value:n}:(n=this.diffWholeMonths(e,t),n!==null?{unit:"month",value:n}:(n=Cme(e,t),n!==null?{unit:"week",value:n}:(n=$y(e,t),n!==null?{unit:"day",value:n}:(n=PUe(e,t),SS(n)?{unit:"hour",value:n}:(n=_Ue(e,t),SS(n)?{unit:"minute",value:n}:(n=MUe(e,t),SS(n)?{unit:"second",value:n}:{unit:"millisecond",value:t.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,t,n){let i;return n.years&&(i=this.diffWholeYears(e,t),i!==null)?i/EUe(n):n.months&&(i=this.diffWholeMonths(e,t),i!==null)?i/DUe(n):n.days&&(i=$y(e,t),i!==null)?i/Fy(n):(t.valueOf()-e.valueOf())/wa(n)}startOf(e,t){return t==="year"?this.startOfYear(e):t==="month"?this.startOfMonth(e):t==="week"?this.startOfWeek(e):t==="day"?ar(e):t==="hour"?AUe(e):t==="minute"?IUe(e):t==="second"?NUe(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):RUe(e,this.weekDow,this.weekDoy)}format(e,t,n={}){return t.format({marker:e,timeZoneOffset:n.forcedTzo!=null?n.forcedTzo:this.offsetForMarker(e)},this)}formatRange(e,t,n,i={}){return i.isEndExclusive&&(t=Gl(t,-1)),n.formatRange({marker:e,timeZoneOffset:i.forcedStartTzo!=null?i.forcedStartTzo:this.offsetForMarker(e)},{marker:t,timeZoneOffset:i.forcedEndTzo!=null?i.forcedEndTzo:this.offsetForMarker(t)},this,i.defaultSeparator)}formatIso(e,t={}){let n=null;return t.omitTimeZoneOffset||(t.forcedTzo!=null?n=t.forcedTzo:n=this.offsetForMarker(e)),Z_(e,n,t.omitTime)}timestampToMarker(e){return this.timeZone==="local"?Rs(ame(new Date(e))):this.timeZone==="UTC"||!this.namedTimeZoneImpl?new Date(e):Rs(this.namedTimeZoneImpl.timestampToArray(e))}offsetForMarker(e){return this.timeZone==="local"?-ome(rp(e)).getTimezoneOffset():this.timeZone==="UTC"?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(rp(e)):null}toDate(e,t){return this.timeZone==="local"?ome(rp(e)):this.timeZone==="UTC"?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-this.namedTimeZoneImpl.offsetForArray(rp(e))*1e3*60):new Date(e.valueOf()-(t||0))}},Sd=class{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let t,n;if(typeof e=="object"&&e){t=Object.assign({},this.iconClasses);for(n in e)t[n]=this.applyIconOverridePrefix(e[n]);this.iconClasses=t}else e===!1&&(this.iconClasses={})}applyIconOverridePrefix(e){let t=this.iconOverridePrefix;return t&&e.indexOf(t)!==0&&(e=t+e),e}getClass(e){return this.classes[e]||""}getIconClass(e,t){let n;return t&&this.rtlIconClasses?n=this.rtlIconClasses[e]||this.iconClasses[e]:n=this.iconClasses[e],n?`${this.baseIconClass} ${n}`:""}getCustomButtonIconClass(e){let t;return this.iconOverrideCustomButtonOption&&(t=e[this.iconOverrideCustomButtonOption],t)?`${this.baseIconClass} ${this.applyIconOverridePrefix(t)}`:""}};Sd.prototype.classes={};Sd.prototype.iconClasses={};Sd.prototype.baseIconClass="";Sd.prototype.iconOverridePrefix="";gz=class extends pi{render(){return _("div",{})}componentDidMount(){this.setState({})}};B_=class{constructor(e,t,n,i){this.execFunc=e,this.emitter=t,this.scrollTime=n,this.scrollTimeReset=i,this.handleScrollRequest=s=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},s),this.drain()},t.on("_scrollRequest",this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off("_scrollRequest",this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}},lo=Ime({});Kl=class extends pi{shouldComponentUpdate(e,t){return!L_(this.props,e,this.propEquality)||!L_(this.state,t,this.stateEquality)}safeSetState(e){L_(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}};Kl.addPropsEquality=tVe;Kl.addStateEquality=rVe;Kl.contextType=lo;Kl.prototype.propEquality={};Kl.prototype.stateEquality={};ht=class extends Kl{};ht.contextType=lo;CS=class extends ht{constructor(){super(...arguments),this.id=Cd(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{let{options:t}=this.context,{generatorName:n}=this.props;(!t.customRenderingReplaces||!yz(n,t))&&this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&xa(this.props.elRef,e)}}render(){let{props:e,context:t}=this,{options:n}=t,{customGenerator:i,defaultGenerator:s,renderProps:a}=e,o=$z(e,[],this.handleEl),l=!1,c,d=[],u;if(i!=null){let p=typeof i=="function"?i(a,_):i;if(p===!0)l=!0;else{let m=p&&typeof p=="object";m&&"html"in p?o.dangerouslySetInnerHTML={__html:p.html}:m&&"domNodes"in p?d=Array.prototype.slice.call(p.domNodes):(m?Yj(p):typeof p!="function")?c=p:u=p}}else l=!yz(e.generatorName,n);return l&&s&&(c=s(a)),this.queuedDomNodes=d,this.currentGeneratorMeta=u,_(e.elTag,o,c)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){var t;let{props:n,context:i}=this,{handleCustomRendering:s,customRenderingMetaMap:a}=i.options;if(s){let o=(t=this.currentGeneratorMeta)!==null&&t!==void 0?t:a==null?void 0:a[n.generatorName];o&&s(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:o},n),{elClasses:(n.elClasses||[]).filter(nVe)}))}}applyQueueudDomNodes(){let{queuedDomNodes:e,currentDomNodes:t}=this,n=this.base;if(!Jl(e,t)){t.forEach($S);for(let i of e)n.appendChild(i);this.currentDomNodes=e}}};CS.addPropsEquality({elClasses:Jl,elStyle:zi,elAttrs:KUe,renderProps:zi});jz=Ime(0),fn=class extends pi{constructor(){super(...arguments),this.InnerContent=iVe.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(xa(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){let{props:e}=this,t=sVe(e.classNameGenerator,e.renderProps);if(e.children){let n=$z(e,t,this.handleEl),i=e.children(this.InnerContent,e.renderProps,n);return e.elTag?_(e.elTag,n,i):i}else return _(CS,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||"div",elClasses:(e.elClasses||[]).concat(t),renderId:this.context}))}componentDidMount(){var e,t;this.el?(t=(e=this.props).didMount)===null||t===void 0||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el})):this.didMountMisfire=!0}componentWillUnmount(){var e,t;(t=(e=this.props).willUnmount)===null||t===void 0||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}};fn.contextType=jz;Sa=class extends ht{render(){let{props:e,context:t}=this,{options:n}=t,i={view:t.viewApi};return _(fn,{elRef:e.elRef,elTag:e.elTag||"div",elAttrs:e.elAttrs,elClasses:[...zz(e.viewSpec),...e.elClasses||[]],elStyle:e.elStyle,renderProps:i,classNameGenerator:n.viewClassNames,generatorName:void 0,didMount:n.viewDidMount,willUnmount:n.viewWillUnmount},()=>e.children)}};yf=class{constructor(e){this.props=e,this.initHiddenDays()}buildPrev(e,t,n){let{dateEnv:i}=this.props,s=i.subtract(i.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(s,-1,n)}buildNext(e,t,n){let{dateEnv:i}=this.props,s=i.add(i.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(s,1,n)}build(e,t,n=!0){let{props:i}=this,s,a,o,l,c,d;return s=this.buildValidRange(),s=this.trimHiddenDays(s),n&&(e=lVe(e,s)),a=this.buildCurrentRangeInfo(e,t),o=/^(year|month|week|day)$/.test(a.unit),l=this.buildRenderRange(this.trimHiddenDays(a.range),a.unit,o),l=this.trimHiddenDays(l),c=l,i.showNonCurrentDates||(c=ls(c,a.range)),c=this.adjustActiveRange(c),c=ls(c,s),d=eM(a.range,s),ao(l,e)||(e=l.start),{currentDate:e,validRange:s,currentRange:a.range,currentRangeUnit:a.unit,isRangeAllDay:o,activeRange:c,renderRange:l,slotMinTime:i.slotMinTime,slotMaxTime:i.slotMaxTime,isValid:d,dateIncrement:this.buildDateIncrement(a.duration)}}buildValidRange(){let e=this.props.validRangeInput,t=typeof e=="function"?e.call(this.props.calendarApi,this.props.dateEnv.toDate(this.props.nowManager.getDateMarker())):e;return this.refineRange(t)||{start:null,end:null}}buildCurrentRangeInfo(e,t){let{props:n}=this,i=null,s=null,a=null,o;return n.duration?(i=n.duration,s=n.durationUnit,a=this.buildRangeFromDuration(e,t,i,s)):(o=this.props.dayCount)?(s="day",a=this.buildRangeFromDayCount(e,t,o)):(a=this.buildCustomVisibleRange(e))?s=n.dateEnv.greatestWholeUnit(a.start,a.end).unit:(i=this.getFallbackDuration(),s=xS(i).unit,a=this.buildRangeFromDuration(e,t,i,s)),{duration:i,unit:s,range:a}}getFallbackDuration(){return nt({day:1})}adjustActiveRange(e){let{dateEnv:t,usesMinMaxTime:n,slotMinTime:i,slotMaxTime:s}=this.props,{start:a,end:o}=e;return n&&(Fy(i)<0&&(a=ar(a),a=t.add(a,i)),Fy(s)>1&&(o=ar(o),o=Gr(o,-1),o=t.add(o,s))),{start:a,end:o}}buildRangeFromDuration(e,t,n,i){let{dateEnv:s,dateAlignment:a}=this.props,o,l,c;if(!a){let{dateIncrement:u}=this.props;u&&wa(u){DS(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{DS(()=>{this.setState({forPrint:!1})})}}render(){let{props:e}=this,{options:t}=e,{forPrint:n}=this.state,i=n||t.height==="auto"||t.contentHeight==="auto",s=!i&&t.height!=null?t.height:"",a=["fc",n?"fc-media-print":"fc-media-screen",`fc-direction-${t.direction}`,e.theme.getClass("root")];return e2()||a.push("fc-liquid-hack"),e.children(a,s,i,n)}componentDidMount(){let{emitter:e}=this.props;e.on("_beforeprint",this.handleBeforePrint),e.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off("_beforeprint",this.handleBeforePrint),e.off("_afterprint",this.handleAfterPrint)}},el=class{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}};_f={},Os=class extends pi{constructor(e,t){super(e,t),this.handleRefresh=()=>{let n=this.computeTiming();n.state.nowDate.valueOf()!==this.state.nowDate.valueOf()&&this.setState(n.state),this.clearTimeout(),this.setTimeout(n.waitMs)},this.handleVisibilityChange=()=>{document.hidden||this.handleRefresh()},this.state=this.computeTiming().state}render(){let{props:e,state:t}=this;return e.children(t.nowDate,t.todayRange)}componentDidMount(){this.setTimeout(),this.context.nowManager.addResetListener(this.handleRefresh),document.addEventListener("visibilitychange",this.handleVisibilityChange)}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout(),this.context.nowManager.removeResetListener(this.handleRefresh),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}computeTiming(){let{props:e,context:t}=this,n=t.nowManager.getDateMarker(),{nowIndicatorSnap:i}=t.options;i==="auto"&&(i=/year|month|week|day/.test(e.unit)||(e.unitValue||1)===1);let s,a;return i?(s=t.dateEnv.startOf(n,e.unit),a=t.dateEnv.add(s,nt(1,e.unit)).valueOf()-n.valueOf()):(s=n,a=1e3*60),a=Math.min(1e3*60*60*24,a),{state:{nowDate:s,todayRange:VVe(s)},waitMs:a}}setTimeout(e=this.computeTiming().waitMs){this.timeoutId=setTimeout(()=>{let t=this.computeTiming();this.setState(t.state,()=>{this.setTimeout(t.waitMs)})},e)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}};Os.contextType=lo;AS=class{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger("_resize",!0)}setOption(e,t){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:t})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,t){let{currentDataManager:n}=this;n.currentCalendarOptionsRefiners[e]?n.emitter.on(e,t):console.warn(`Unknown listener name '${e}'`)}off(e,t){this.currentDataManager.emitter.off(e,t)}trigger(e,...t){this.currentDataManager.emitter.trigger(e,...t)}changeView(e,t){this.batchRendering(()=>{if(this.unselect(),t)if(t.start&&t.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:t});else{let{dateEnv:n}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:n.createMarker(t)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,t){let n=this.getCurrentData(),i;t=t||"day",i=n.viewSpecs[t]||this.getUnitViewSpec(t),this.unselect(),i?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:i.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:t,toolbarConfig:n}=this.getCurrentData(),i=[].concat(n.header?n.header.viewsWithButtons:[],n.footer?n.footer.viewsWithButtons:[]),s,a;for(let o in t)i.push(o);for(s=0;s{this.dispatch({type:"REMOVE_EVENTS",eventStore:Bme(e)})}})}getEventById(e){let t=this.getCurrentData(),{defs:n,instances:i}=t.eventStore;e=String(e);for(let s in n){let a=n[s];if(a.publicId===e){if(a.recurringDef)return new wr(t,a,null);for(let o in i){let l=i[o];if(l.defId===a.defId)return new wr(t,a,l)}}}return null}getEvents(){let e=this.getCurrentData();return tc(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),t=e.eventSources,n=[];for(let i in t)n.push(new tp(e,t[i]));return n}getEventSourceById(e){let t=this.getCurrentData(),n=t.eventSources;e=String(e);for(let i in n)if(n[i].publicId===e)return new tp(t,n[i]);return null}addEventSource(e){let t=this.getCurrentData();if(e instanceof tp)return t.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let n=Uz(e,t);return n?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[n]}),new tp(t,n)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let t=nt(e);t&&this.trigger("_scrollRequest",{time:t})}};sz=Hn(),IS=class{constructor(){this.getKeysForEventDefs=Se(this._getKeysForEventDefs),this.splitDateSelection=Se(this._splitDateSpan),this.splitEventStore=Se(this._splitEventStore),this.splitIndividualUi=Se(this._splitIndividualUi),this.splitEventDrag=Se(this._splitInteraction),this.splitEventResize=Se(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let t=this.getKeyInfo(e),n=this.getKeysForEventDefs(e.eventStore),i=this.splitDateSelection(e.dateSelection),s=this.splitIndividualUi(e.eventUiBases,n),a=this.splitEventStore(e.eventStore,n),o=this.splitEventDrag(e.eventDrag),l=this.splitEventResize(e.eventResize),c={};this.eventUiBuilders=oo(t,(d,u)=>this.eventUiBuilders[u]||Se(WVe));for(let d in t){let u=t[d],p=a[d]||sz,m=this.eventUiBuilders[d];c[d]={businessHours:u.businessHours||e.businessHours,dateSelection:i[d]||null,eventStore:p,eventUiBases:m(e.eventUiBases[""],u.ui,s[d]),eventSelection:p.instances[e.eventSelection]?e.eventSelection:"",eventDrag:o[d]||null,eventResize:l[d]||null}}return c}_splitDateSpan(e){let t={};if(e){let n=this.getKeysForDateSpan(e);for(let i of n)t[i]=e}return t}_getKeysForEventDefs(e){return oo(e.defs,t=>this.getKeysForEventDef(t))}_splitEventStore(e,t){let{defs:n,instances:i}=e,s={};for(let a in n)for(let o of t[a])s[o]||(s[o]=Hn()),s[o].defs[a]=n[a];for(let a in i){let o=i[a];for(let l of t[o.defId])s[l]&&(s[l].instances[a]=o)}return s}_splitIndividualUi(e,t){let n={};for(let i in e)if(i)for(let s of t[i])n[s]||(n[s]={}),n[s][i]=e[i];return n}_splitInteraction(e){let t={};if(e){let n=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),i=this._getKeysForEventDefs(e.mutatedEvents),s=this._splitEventStore(e.mutatedEvents,i),a=o=>{t[o]||(t[o]={affectedEvents:n[o]||sz,mutatedEvents:s[o]||sz,isEvent:e.isEvent})};for(let o in n)a(o);for(let o in s)a(o)}return t}};YVe=zt({year:"numeric",month:"long",day:"numeric"}),GVe=zt({week:"long"});az=null;tl=class{constructor(e,t,n,i){this.els=t;let s=this.originClientRect=e.getBoundingClientRect();n&&this.buildElHorizontals(s.left),i&&this.buildElVerticals(s.top)}buildElHorizontals(e){let t=[],n=[];for(let i of this.els){let s=i.getBoundingClientRect();t.push(s.left-e),n.push(s.right-e)}this.lefts=t,this.rights=n}buildElVerticals(e){let t=[],n=[];for(let i of this.els){let s=i.getBoundingClientRect();t.push(s.top-e),n.push(s.bottom-e)}this.tops=t,this.bottoms=n}leftToIndex(e){let{lefts:t,rights:n}=this,i=t.length,s;for(s=0;s=t[s]&&e=t[s]&&e0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()0}canScrollRight(){return this.getScrollLeft()t.thickness||1){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let t=[];for(let n of e)this.insertEntry(n,t);return t}insertEntry(e,t){let n=this.findInsertion(e);this.isInsertionValid(n,e)?this.insertEntryAt(e,n):this.handleInvalidInsertion(n,e,t)}isInsertionValid(e,t){return(this.maxCoord===-1||e.levelCoord+this.getEntryThickness(t)<=this.maxCoord)&&(this.maxStackCnt===-1||e.stackCnts.end&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:s.end,end:i.end}},n)}insertEntryAt(e,t){let{entriesByLevel:n,levelCoords:i}=this;t.lateral===-1?(lz(i,t.level,t.levelCoord),lz(n,t.level,[e])):lz(n[t.level],t.lateral,e),this.stackCnts[Zl(e)]=t.stackCnt}findInsertion(e){let{levelCoords:t,entriesByLevel:n,strictOrder:i,stackCnts:s}=this,a=t.length,o=0,l=-1,c=-1,d=null,u=0;for(let f=0;f=o+this.getEntryThickness(e))break;let g=n[f],y,k=LS(g,e.span.start,OS),T=k[0]+k[1];for(;(y=g[T])&&y.span.starto&&(o=w,d=y,l=f,c=T),w===o&&(u=Math.max(u,s[Zl(y)]+1)),T+=1}}let p=0;if(d)for(p=l+1;p1?rc(this.context,a):{},p=e.toDate(a);e.namedTimeZoneImpl&&(p=Gl(p,36e5));let m=Object.assign(Object.assign(Object.assign({date:p,view:i},s.extraRenderProps),{text:d}),l);return _(fn,{elTag:"th",elClasses:c,elAttrs:Object.assign({role:"columnheader",colSpan:s.colSpan,"data-date":l.isDisabled?void 0:lp(a)},s.extraDataAttrs),renderProps:m,generatorName:"dayHeaderContent",customGenerator:t.dayHeaderContent,defaultGenerator:Qme,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount},f=>_("div",{className:"fc-scrollgrid-sync-inner"},!l.isDisabled&&_(f,{elTag:"a",elAttrs:u,elClasses:["fc-col-header-cell-cushion",s.isSticky&&"fc-sticky"]})))}},eWe=zt({weekday:"long"}),W_=class extends ht{render(){let{props:e}=this,{dateEnv:t,theme:n,viewApi:i,options:s}=this.context,a=Gr(new Date(2592e5),e.dow),o={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},l=t.format(a,e.dayHeaderFormat),c=Object.assign(Object.assign(Object.assign(Object.assign({date:a},o),{view:i}),e.extraRenderProps),{text:l});return _(fn,{elTag:"th",elClasses:[Zme,...Qy(o,n),...e.extraClassNames||[]],elAttrs:Object.assign({role:"columnheader",colSpan:e.colSpan},e.extraDataAttrs),renderProps:c,generatorName:"dayHeaderContent",customGenerator:s.dayHeaderContent,defaultGenerator:Qme,classNameGenerator:s.dayHeaderClassNames,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount},d=>_("div",{className:"fc-scrollgrid-sync-inner"},_(d,{elTag:"a",elClasses:["fc-col-header-cell-cushion",e.isSticky&&"fc-sticky"],elAttrs:{"aria-label":t.format(a,eWe)}})))}},Ed=class extends ht{constructor(){super(...arguments),this.createDayHeaderFormatter=Se(tWe)}render(){let{context:e}=this,{dates:t,dateProfile:n,datesRepDistinctDays:i,renderIntro:s}=this.props,a=this.createDayHeaderFormatter(e.options.dayHeaderFormat,i,t.length);return _(Os,{unit:"day"},(o,l)=>_("tr",{role:"row"},s&&s("day"),t.map(c=>i?_(V_,{key:c.toISOString(),date:c,dateProfile:n,todayRange:l,colCnt:t.length,dayHeaderFormat:a}):_(W_,{key:c.getUTCDay(),dow:c.getUTCDay(),dayHeaderFormat:a}))))}};wf=class{constructor(e,t){let n=e.start,{end:i}=e,s=[],a=[],o=-1;for(;n=t.length?t[t.length-1]+1:t[n]}},Sf=class{constructor(e,t){let{dates:n}=e,i,s,a;if(t){for(s=n[0].getUTCDay(),i=1;i{this.el=e,xa(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:t,liquidIsAbsolute:n}=e,i=t&&n,s=["fc-scroller"];return t&&(n?s.push("fc-scroller-liquid-absolute"):s.push("fc-scroller-liquid")),_("div",{ref:this.handleEl,className:s.join(" "),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:i&&-(e.overcomeLeft||0)||"",right:i&&-(e.overcomeRight||0)||"",bottom:i&&-(e.overcomeBottom||0)||"",marginLeft:!i&&-(e.overcomeLeft||0)||"",marginRight:!i&&-(e.overcomeRight||0)||"",marginBottom:!i&&-(e.overcomeBottom||0)||"",maxHeight:e.maxHeight||""}},e.children)}needsXScrolling(){if(O_.test(this.props.overflowX))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:n}=e;for(let i=0;it)return!0;return!1}needsYScrolling(){if(O_.test(this.props.overflowY))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:n}=e;for(let i=0;it)return!0;return!1}getXScrollbarWidth(){return O_.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return O_.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}},Ls=class{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(t,n)=>{let{depths:i,currentMap:s}=this,a=!1,o=!1;t!==null?(a=n in s,s[n]=t,i[n]=(i[n]||0)+1,o=!0):(i[n]-=1,i[n]||(delete s[n],delete this.callbackMap[n],a=!0)),this.masterCallback&&(a&&this.masterCallback(null,String(n)),o&&this.masterCallback(t,String(n)))}}createRef(e){let t=this.callbackMap[e];return t||(t=this.callbackMap[e]=n=>{this.handleValue(n,String(e))}),t}collect(e,t,n){return _me(this.currentMap,e,t,n)}getAll(){return X_(this.currentMap)}};sp=class extends ht{constructor(){super(...arguments),this.processCols=Se(e=>e,ife),this.renderMicroColGroup=Se(sfe),this.scrollerRefs=new Ls,this.scrollerElRefs=new Ls(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:t,context:n}=this,i=e.sections||[],s=this.processCols(e.cols),a=this.renderMicroColGroup(s,t.shrinkWidth),o=lfe(e.liquid,n);e.collapsibleWidth&&o.push("fc-scrollgrid-collapsible");let l=i.length,c=0,d,u=[],p=[],m=[];for(;c{}},i);return _(i?"th":"td",{ref:n.elRef,role:"presentation"},_("div",{className:`fc-scroller-harness${d?" fc-scroller-harness-liquid":""}`},_(By,{ref:this.scrollerRefs.createRef(p),elRef:this.scrollerElRefs.createRef(p),overflowY:u,overflowX:s.liquid?"hidden":"visible",maxHeight:e.maxHeight,liquid:d,liquidIsAbsolute:!0},m)))}_handleScrollerEl(e,t){let n=aWe(this.props.sections,t);n&&xa(n.chunk.scrollerElRef,e)}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return ofe(this.props.cols)?tfe(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=Wme(),{scrollerRefs:t,scrollerElRefs:n}=this,i=!1,s={},a={};for(let o in t.currentMap){let l=t.currentMap[o];if(l&&l.needsYScrolling()){i=!0;break}}for(let o of this.props.sections){let l=o.key,c=n.currentMap[l];if(c){let d=c.parentNode;s[l]=Math.floor(d.getBoundingClientRect().width-(i?e.y:0)),a[l]=Math.floor(d.getBoundingClientRect().height)}}return{forceYScrollbars:i,scrollerClientWidths:s,scrollerClientHeights:a}}};sp.addStateEquality({scrollerClientWidths:zi,scrollerClientHeights:zi});Dd=class extends ht{constructor(){super(...arguments),this.buildPublicEvent=Se((e,t,n)=>new wr(e,t,n)),this.handleEl=e=>{this.el=e,xa(this.props.elRef,e),e&&pme(e,this.props.seg)}}render(){let{props:e,context:t}=this,{options:n}=t,{seg:i}=e,{eventRange:s}=i,{ui:a}=s,o={event:this.buildPublicEvent(t,s.def,s.instance),view:t.viewApi,timeText:e.timeText,textColor:a.textColor,backgroundColor:a.backgroundColor,borderColor:a.borderColor,isDraggable:!e.disableDragging&&RVe(i,t),isStartResizable:!e.disableResizing&&OVe(i,t),isEndResizable:!e.disableResizing&&LVe(i),isMirror:!!(e.isDragging||e.isResizing||e.isDateSelecting),isStart:!!i.isStart,isEnd:!!i.isEnd,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing};return _(fn,{elRef:this.handleEl,elTag:e.elTag,elAttrs:e.elAttrs,elClasses:[...FVe(o),...i.eventRange.ui.classNames,...e.elClasses||[]],elStyle:e.elStyle,renderProps:o,generatorName:"eventContent",customGenerator:n.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:n.eventClassNames,didMount:n.eventDidMount,willUnmount:n.eventWillUnmount},e.children)}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&pme(this.el,this.props.seg)}},ap=class extends ht{render(){let{props:e,context:t}=this,{options:n}=t,{seg:i}=e,{ui:s}=i.eventRange,a=n.eventTimeFormat||e.defaultTimeFormat,o=dp(i,a,t,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return _(Dd,Object.assign({},e,{elTag:"a",elStyle:{borderColor:s.borderColor,backgroundColor:s.backgroundColor},elAttrs:Zy(i,t),defaultGenerator:oWe,timeText:o}),(l,c)=>_(jt,null,_(l,{elTag:"div",elClasses:["fc-event-main"],elStyle:{color:c.textColor}}),!!c.isStartResizable&&_("div",{className:"fc-event-resizer fc-event-resizer-start"}),!!c.isEndResizable&&_("div",{className:"fc-event-resizer fc-event-resizer-end"})))}};ap.addPropsEquality({seg:zi});ex=r=>_(lo.Consumer,null,e=>{let{options:t}=e,n={isAxis:r.isAxis,date:e.dateEnv.toDate(r.date),view:e.viewApi};return _(fn,{elRef:r.elRef,elTag:r.elTag||"div",elAttrs:r.elAttrs,elClasses:r.elClasses,elStyle:r.elStyle,renderProps:n,generatorName:"nowIndicatorContent",customGenerator:t.nowIndicatorContent,classNameGenerator:t.nowIndicatorClassNames,didMount:t.nowIndicatorDidMount,willUnmount:t.nowIndicatorWillUnmount},r.children)}),lWe=zt({day:"numeric"}),op=class extends ht{constructor(){super(...arguments),this.refineRenderProps=Wy(cWe)}render(){let{props:e,context:t}=this,{options:n}=t,i=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:t.viewApi,dateEnv:t.dateEnv,monthStartFormat:n.monthStartFormat});return _(fn,{elRef:e.elRef,elTag:e.elTag,elAttrs:Object.assign(Object.assign({},e.elAttrs),i.isDisabled?{}:{"data-date":lp(e.date)}),elClasses:[...Qy(i,t.theme),...e.elClasses||[]],elStyle:e.elStyle,renderProps:i,generatorName:"dayCellContent",customGenerator:n.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:i.isDisabled?void 0:n.dayCellClassNames,didMount:n.dayCellDidMount,willUnmount:n.dayCellWillUnmount},e.children)}};Ef=class extends ht{render(){let{props:e}=this,{seg:t}=e;return _(Dd,{elTag:"div",elClasses:["fc-bg-event"],elStyle:{backgroundColor:t.eventRange.ui.backgroundColor},defaultGenerator:dWe,seg:t,timeText:"",isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}};rx=r=>_(lo.Consumer,null,e=>{let{dateEnv:t,options:n}=e,{date:i}=r,s=n.weekNumberFormat||r.defaultFormat,a=t.computeWeekNumber(i),o=t.format(i,s),l={num:a,text:o,date:i};return _(fn,{elRef:r.elRef,elTag:r.elTag,elAttrs:r.elAttrs,elClasses:r.elClasses,elStyle:r.elStyle,renderProps:l,generatorName:"weekNumberContent",customGenerator:n.weekNumberContent,defaultGenerator:uWe,classNameGenerator:n.weekNumberClassNames,didMount:n.weekNumberDidMount,willUnmount:n.weekNumberWillUnmount},r.children)});dz=10,bz=class extends ht{constructor(){super(...arguments),this.state={titleId:Fs()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&xa(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{let t=G_(e);this.rootEl.contains(t)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:t}=this.context,{props:n,state:i}=this,s=["fc-popover",e.getClass("popover")].concat(n.extraClassNames||[]);return ez(_("div",Object.assign({},n.extraAttrs,{id:n.id,className:s.join(" "),"aria-labelledby":i.titleId,ref:this.handleRootEl}),_("div",{className:"fc-popover-header "+e.getClass("popoverHeader")},_("span",{className:"fc-popover-title",id:i.titleId},n.title),_("span",{className:"fc-popover-close "+e.getIconClass("close"),title:t.closeHint,onClick:this.handleCloseClick})),_("div",{className:"fc-popover-body "+e.getClass("popoverContent")},n.children)),n.parentEl)}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:t,alignGridTop:n}=this.props,{rootEl:i}=this,s=QVe(t);if(s){let a=i.getBoundingClientRect(),o=n?qn(t,".fc-scrollgrid").getBoundingClientRect().top:s.top,l=e?s.right-a.width:s.left;o=Math.max(o,dz),l=Math.min(l,document.documentElement.clientWidth-dz-a.width),l=Math.max(l,dz);let c=i.offsetParent.getBoundingClientRect();Cf(i,{top:o-c.top,left:l-c.left})}}},Tz=class extends Mn{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:t}=this.context,{props:n}=this,{startDate:i,todayRange:s,dateProfile:a}=n,o=t.format(i,e.dayPopoverFormat);return _(op,{elRef:this.handleRootEl,date:i,dateProfile:a,todayRange:s},(l,c,d)=>_(bz,{elRef:d.ref,id:n.id,title:o,extraClassNames:["fc-more-popover"].concat(d.className||[]),extraAttrs:d,parentEl:n.parentEl,alignmentEl:n.alignmentEl,alignGridTop:n.alignGridTop,onClose:n.onClose},ev(e)&&_(l,{elTag:"div",elClasses:["fc-more-popover-misc"]}),n.children))}queryHit(e,t,n,i){let{rootEl:s,props:a}=this;return e>=0&&e=0&&t{this.linkEl=e,this.props.elRef&&xa(this.props.elRef,e)},this.handleClick=e=>{let{props:t,context:n}=this,{moreLinkClick:i}=n.options,s=mme(t).start;function a(o){let{def:l,instance:c,range:d}=o.eventRange;return{event:new wr(n,l,c),start:n.dateEnv.toDate(d.start),end:n.dateEnv.toDate(d.end),isStart:o.isStart,isEnd:o.isEnd}}typeof i=="function"&&(i=i({date:s,allDay:!!t.allDayDate,allSegs:t.allSegs.map(a),hiddenSegs:t.hiddenSegs.map(a),jsEvent:e,view:n.viewApi})),!i||i==="popover"?this.setState({isPopoverOpen:!0}):typeof i=="string"&&n.calendarApi.zoomTo(s,i)},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:t}=this;return _(lo.Consumer,null,n=>{let{viewApi:i,options:s,calendarApi:a}=n,{moreLinkText:o}=s,{moreCnt:l}=e,c=mme(e),d=typeof o=="function"?o.call(a,l):`+${l} ${o}`,u=Uy(s.moreLinkHint,[l],d),p={num:l,shortText:`+${l}`,text:d,view:i};return _(jt,null,!!e.moreCnt&&_(fn,{elTag:e.elTag||"a",elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],"fc-more-link"],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),Tme(this.handleClick)),{title:u,"aria-expanded":t.isPopoverOpen,"aria-controls":t.isPopoverOpen?t.popoverId:""}),renderProps:p,generatorName:"moreLinkContent",customGenerator:s.moreLinkContent,defaultGenerator:e.defaultGenerator||pWe,classNameGenerator:s.moreLinkClassNames,didMount:s.moreLinkDidMount,willUnmount:s.moreLinkWillUnmount},e.children),t.isPopoverOpen&&_(Tz,{id:t.popoverId,startDate:c.start,endDate:c.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=qn(this.linkEl,".fc-view-harness"))}}});function yWe(r){let e=r.length>0?r[0].code:"en",t=gWe.concat(r),n={en:yfe};for(let i of t)n[i.code]=i;return{map:n,defaultCode:e}}function vfe(r,e){return typeof r=="object"&&!Array.isArray(r)?bfe(r.code,[r.code],r):vWe(r,e)}function vWe(r,e){let t=[].concat(r||[]),n=bWe(t,e)||yfe;return bfe(r,t,n)}function bWe(r,e){for(let t=0;t0;i-=1){let s=n.slice(0,i).join("-");if(e[s])return e[s]}}return null}function bfe(r,e,t){let n=J_([gfe,t],["buttonText"]);delete n.code;let{week:i}=n;return delete n.week,{codeArg:r,codes:e,week:i,simpleNumberFormat:new Intl.NumberFormat(r),options:n}}function Bi(r){return{id:Cd(),name:r.name,premiumReleaseDate:r.premiumReleaseDate?new Date(r.premiumReleaseDate):void 0,deps:r.deps||[],reducers:r.reducers||[],isLoadingFuncs:r.isLoadingFuncs||[],contextInit:[].concat(r.contextInit||[]),eventRefiners:r.eventRefiners||{},eventDefMemberAdders:r.eventDefMemberAdders||[],eventSourceRefiners:r.eventSourceRefiners||{},isDraggableTransformers:r.isDraggableTransformers||[],eventDragMutationMassagers:r.eventDragMutationMassagers||[],eventDefMutationAppliers:r.eventDefMutationAppliers||[],dateSelectionTransformers:r.dateSelectionTransformers||[],datePointTransforms:r.datePointTransforms||[],dateSpanTransforms:r.dateSpanTransforms||[],views:r.views||{},viewPropsTransformers:r.viewPropsTransformers||[],isPropsValid:r.isPropsValid||null,externalDefTransforms:r.externalDefTransforms||[],viewContainerAppends:r.viewContainerAppends||[],eventDropTransformers:r.eventDropTransformers||[],componentInteractions:r.componentInteractions||[],calendarInteractions:r.calendarInteractions||[],themeClasses:r.themeClasses||{},eventSourceDefs:r.eventSourceDefs||[],cmdFormatter:r.cmdFormatter,recurringTypes:r.recurringTypes||[],namedTimeZonedImpl:r.namedTimeZonedImpl,initialView:r.initialView||"",elementDraggingImpl:r.elementDraggingImpl,optionChangeHandlers:r.optionChangeHandlers||{},scrollGridImpl:r.scrollGridImpl||null,listenerRefiners:r.listenerRefiners||{},optionRefiners:r.optionRefiners||{},propSetHandlers:r.propSetHandlers||{}}}function TWe(r,e){let t={},n={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function i(s){for(let a of s){let o=a.name,l=t[o];l===void 0?(t[o]=a.id,i(a.deps),n=wWe(n,a)):l!==a.id&&console.warn(`Duplicate plugin '${o}'`)}}return r&&i(r),i(e),n}function kWe(){let r=[],e=[],t;return(n,i)=>((!t||!Jl(n,r)||!Jl(i,e))&&(t=TWe(n,i)),r=n,e=i,t)}function wWe(r,e){return{premiumReleaseDate:SWe(r.premiumReleaseDate,e.premiumReleaseDate),reducers:r.reducers.concat(e.reducers),isLoadingFuncs:r.isLoadingFuncs.concat(e.isLoadingFuncs),contextInit:r.contextInit.concat(e.contextInit),eventRefiners:Object.assign(Object.assign({},r.eventRefiners),e.eventRefiners),eventDefMemberAdders:r.eventDefMemberAdders.concat(e.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},r.eventSourceRefiners),e.eventSourceRefiners),isDraggableTransformers:r.isDraggableTransformers.concat(e.isDraggableTransformers),eventDragMutationMassagers:r.eventDragMutationMassagers.concat(e.eventDragMutationMassagers),eventDefMutationAppliers:r.eventDefMutationAppliers.concat(e.eventDefMutationAppliers),dateSelectionTransformers:r.dateSelectionTransformers.concat(e.dateSelectionTransformers),datePointTransforms:r.datePointTransforms.concat(e.datePointTransforms),dateSpanTransforms:r.dateSpanTransforms.concat(e.dateSpanTransforms),views:Object.assign(Object.assign({},r.views),e.views),viewPropsTransformers:r.viewPropsTransformers.concat(e.viewPropsTransformers),isPropsValid:e.isPropsValid||r.isPropsValid,externalDefTransforms:r.externalDefTransforms.concat(e.externalDefTransforms),viewContainerAppends:r.viewContainerAppends.concat(e.viewContainerAppends),eventDropTransformers:r.eventDropTransformers.concat(e.eventDropTransformers),calendarInteractions:r.calendarInteractions.concat(e.calendarInteractions),componentInteractions:r.componentInteractions.concat(e.componentInteractions),themeClasses:Object.assign(Object.assign({},r.themeClasses),e.themeClasses),eventSourceDefs:r.eventSourceDefs.concat(e.eventSourceDefs),cmdFormatter:e.cmdFormatter||r.cmdFormatter,recurringTypes:r.recurringTypes.concat(e.recurringTypes),namedTimeZonedImpl:e.namedTimeZonedImpl||r.namedTimeZonedImpl,initialView:r.initialView||e.initialView,elementDraggingImpl:r.elementDraggingImpl||e.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},r.optionChangeHandlers),e.optionChangeHandlers),scrollGridImpl:e.scrollGridImpl||r.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},r.listenerRefiners),e.listenerRefiners),optionRefiners:Object.assign(Object.assign({},r.optionRefiners),e.optionRefiners),propSetHandlers:Object.assign(Object.assign({},r.propSetHandlers),e.propSetHandlers)}}function SWe(r,e){return r===void 0?e:e===void 0?r:new Date(Math.max(r.valueOf(),e.valueOf()))}function xWe(r,e){let t={},n;for(n in r)u2(n,t,r,e);for(n in e)u2(n,t,r,e);return t}function u2(r,e,t,n){if(e[r])return e[r];let i=EWe(r,e,t,n);return i&&(e[r]=i),i}function EWe(r,e,t,n){let i=t[r],s=n[r],a=d=>i&&i[d]!==null?i[d]:s&&s[d]!==null?s[d]:null,o=a("component"),l=a("superType"),c=null;if(l){if(l===r)throw new Error("Can't have a custom view type that references itself");c=u2(l,e,t,n)}return!o&&c&&(o=c.component),o?{type:r,component:o,defaults:Object.assign(Object.assign({},c?c.defaults:{}),i?i.rawOptions:{}),overrides:Object.assign(Object.assign({},c?c.overrides:{}),s?s.rawOptions:{})}:null}function dfe(r){return oo(r,DWe)}function DWe(r){let e=typeof r=="function"?{component:r}:r,{component:t}=e;return e.content?t=ufe(e):t&&!(t.prototype instanceof ht)&&(t=ufe(Object.assign(Object.assign({},e),{content:t}))),{superType:e.type,component:t,rawOptions:e}}function ufe(r){return e=>_(lo.Consumer,null,t=>_(fn,{elTag:"div",elClasses:zz(t.viewSpec),renderProps:Object.assign(Object.assign({},e),{nextDayThreshold:t.options.nextDayThreshold}),generatorName:void 0,customGenerator:r.content,classNameGenerator:r.classNames,didMount:r.didMount,willUnmount:r.willUnmount}))}function CWe(r,e,t,n){let i=dfe(r),s=dfe(e.views),a=xWe(i,s);return oo(a,o=>PWe(o,s,e,t,n))}function PWe(r,e,t,n,i){let s=r.overrides.duration||r.defaults.duration||n.duration||t.duration,a=null,o="",l="",c={};if(s&&(a=_We(s),a)){let p=xS(a);o=p.unit,p.value===1&&(l=o,c=e[o]?e[o].rawOptions:{})}let d=p=>{let m=p.buttonText||{},f=r.defaults.buttonTextKey;return f!=null&&m[f]!=null?m[f]:m[r.type]!=null?m[r.type]:m[l]!=null?m[l]:null},u=p=>{let m=p.buttonHints||{},f=r.defaults.buttonTextKey;return f!=null&&m[f]!=null?m[f]:m[r.type]!=null?m[r.type]:m[l]!=null?m[l]:null};return{type:r.type,component:r.component,duration:a,durationUnit:o,singleUnit:l,optionDefaults:r.defaults,optionOverrides:Object.assign(Object.assign({},c),r.overrides),buttonTextOverride:d(n)||d(t)||r.overrides.buttonText,buttonTextDefault:d(i)||r.defaults.buttonText||d(ec)||r.type,buttonTitleOverride:u(n)||u(t)||r.overrides.buttonHint,buttonTitleDefault:u(i)||r.defaults.buttonHint||u(ec)}}function _We(r){let e=JSON.stringify(r),t=pfe[e];return t===void 0&&(t=nt(r),pfe[e]=t),t}function MWe(r,e){switch(e.type){case"CHANGE_VIEW_TYPE":r=e.viewType}return r}function AWe(r,e){switch(e.type){case"CHANGE_DATE":return e.dateMarker;default:return r}}function IWe(r,e,t){let n=r.initialDate;return n!=null?e.createMarker(n):t.getDateMarker()}function NWe(r,e){switch(e.type){case"SET_OPTION":return Object.assign(Object.assign({},r),{[e.optionName]:e.rawOptionValue});default:return r}}function RWe(r,e,t,n){let i;switch(e.type){case"CHANGE_VIEW_TYPE":return n.build(e.dateMarker||t);case"CHANGE_DATE":return n.build(e.dateMarker);case"PREV":if(i=n.buildPrev(r,t),i.isValid)return i;break;case"NEXT":if(i=n.buildNext(r,t),i.isValid)return i;break}return r}function OWe(r,e,t){let n=e?e.activeRange:null;return kfe({},qWe(r,t),n,t)}function LWe(r,e,t,n){let i=t?t.activeRange:null;switch(e.type){case"ADD_EVENT_SOURCES":return kfe(r,e.sources,i,n);case"REMOVE_EVENT_SOURCE":return $We(r,e.sourceId);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return t?wfe(r,i,n):r;case"FETCH_EVENT_SOURCES":return T2(r,e.sourceIds?Fz(e.sourceIds):Sfe(r,n),i,e.isRefetch||!1,n);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return BWe(r,e.sourceId,e.fetchId,e.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return r}}function FWe(r,e,t){let n=e?e.activeRange:null;return T2(r,Sfe(r,t),n,!0,t)}function Tfe(r){for(let e in r)if(r[e].isFetching)return!0;return!1}function kfe(r,e,t,n){let i={};for(let s of e)i[s.sourceId]=s;return t&&(i=wfe(i,t,n)),Object.assign(Object.assign({},r),i)}function $We(r,e){return wd(r,t=>t.sourceId!==e)}function wfe(r,e,t){return T2(r,wd(r,n=>jWe(n,e,t)),e,!1,t)}function jWe(r,e,t){return xfe(r,t)?!t.options.lazyFetching||!r.fetchRange||r.isFetching||e.startr.fetchRange.end:!r.latestFetchId}function T2(r,e,t,n,i){let s={};for(let a in r){let o=r[a];e[a]?s[a]=zWe(o,t,n,i):s[a]=o}return s}function zWe(r,e,t,n){let{options:i,calendarApi:s}=n,a=n.pluginHooks.eventSourceDefs[r.sourceDefId],o=Cd();return a.fetch({eventSource:r,range:e,isRefetch:t,context:n},l=>{let{rawEvents:c}=l;i.eventSourceSuccess&&(c=i.eventSourceSuccess.call(s,c,l.response)||c),r.success&&(c=r.success.call(s,c,l.response)||c),n.dispatch({type:"RECEIVE_EVENTS",sourceId:r.sourceId,fetchId:o,fetchRange:e,rawEvents:c})},l=>{let c=!1;i.eventSourceFailure&&(i.eventSourceFailure.call(s,l),c=!0),r.failure&&(r.failure(l),c=!0),c||console.warn(l.message,l),n.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:r.sourceId,fetchId:o,fetchRange:e,error:l})}),Object.assign(Object.assign({},r),{isFetching:!0,latestFetchId:o})}function BWe(r,e,t,n){let i=r[e];return i&&t===i.latestFetchId?Object.assign(Object.assign({},r),{[e]:Object.assign(Object.assign({},i),{isFetching:!1,fetchRange:n})}):r}function Sfe(r,e){return wd(r,t=>xfe(t,e))}function qWe(r,e){let t=Vz(e),n=[].concat(r.eventSources||[]),i=[];r.initialEvents&&n.unshift(r.initialEvents),r.events&&n.unshift(r.events);for(let s of n){let a=Uz(s,e,t);a&&i.push(a)}return i}function xfe(r,e){return!e.pluginHooks.eventSourceDefs[r.sourceDefId].ignoreRange}function HWe(r,e){switch(e.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return e.selection;default:return r}}function UWe(r,e){switch(e.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return e.eventInstanceId;default:return r}}function VWe(r,e){let t;switch(e.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return t=e.state,{affectedEvents:t.affectedEvents,mutatedEvents:t.mutatedEvents,isEvent:t.isEvent};default:return r}}function WWe(r,e){let t;switch(e.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return t=e.state,{affectedEvents:t.affectedEvents,mutatedEvents:t.mutatedEvents,isEvent:t.isEvent};default:return r}}function YWe(r,e,t,n,i){let s=r.headerToolbar?mfe(r.headerToolbar,r,e,t,n,i):null,a=r.footerToolbar?mfe(r.footerToolbar,r,e,t,n,i):null;return{header:s,footer:a}}function mfe(r,e,t,n,i,s){let a={},o=[],l=!1;for(let c in r){let d=r[c],u=GWe(d,e,t,n,i,s);a[c]=u.widgets,o.push(...u.viewsWithButtons),l=l||u.hasTitle}return{sectionWidgets:a,viewsWithButtons:o,hasTitle:l}}function GWe(r,e,t,n,i,s){let a=e.direction==="rtl",o=e.customButtons||{},l=t.buttonText||{},c=e.buttonText||{},d=t.buttonHints||{},u=e.buttonHints||{},p=r?r.split(" "):[],m=[],f=!1;return{widgets:p.map(g=>g.split(",").map(y=>{if(y==="title")return f=!0,{buttonName:y};let k,T,w,S,E,C;if(k=o[y])w=D=>{k.click&&k.click.call(D.target,D,D.target)},(S=n.getCustomButtonIconClass(k))||(S=n.getIconClass(y,a))||(E=k.text),C=k.hint||k.text;else if(T=i[y]){m.push(y),w=()=>{s.changeView(y)},(E=T.buttonTextOverride)||(S=n.getIconClass(y,a))||(E=T.buttonTextDefault);let D=T.buttonTextOverride||T.buttonTextDefault;C=Uy(T.buttonTitleOverride||T.buttonTitleDefault||e.viewHint,[D,y],D)}else if(s[y])if(w=()=>{s[y]()},(E=l[y])||(S=n.getIconClass(y,a))||(E=c[y]),y==="prevYear"||y==="nextYear"){let D=y==="prevYear"?"prev":"next";C=Uy(d[D]||u[D],[c.year||"year","year"],c[y])}else C=D=>Uy(d[y]||u[y],[c[D]||D,D],c[y]);return{buttonName:y,buttonClick:w,buttonIcon:S,buttonText:E,buttonHint:C}})),viewsWithButtons:m,hasTitle:f}}function r4e(r,e,t){let{dateEnv:n,options:i}=t,s,a,o,l,c={};return s=r.startParam,s==null&&(s=i.startParam),a=r.endParam,a==null&&(a=i.endParam),o=r.timeZoneParam,o==null&&(o=i.timeZoneParam),typeof r.extraParams=="function"?l=r.extraParams():l=r.extraParams||{},Object.assign(c,l),c[s]=n.formatIso(e.start),c[a]=n.formatIso(e.end),n.timeZone!=="local"&&(c[o]=n.timeZone),c}function a4e(r,e,t,n,i){let s=r?Fz(r):null,a=ar(i.start),o=i.end,l=[];for(e&&(e.milliseconds<0?o=Gr(o,1):e.milliseconds>=1e3*60*60*24&&(a=Gr(a,-1)));a1?{year:"numeric",month:"short",day:"numeric"}:{year:"numeric",month:"long",day:"numeric"}}function m4e(r,e,t,n,i,s,a,o){let l=vfe(e||a.defaultCode,a.map);return new ES({calendarSystem:"gregory",timeZone:r,namedTimeZoneImpl:s.namedTimeZonedImpl,locale:l,weekNumberCalculation:t,firstDay:n,weekText:i,cmdFormatter:s.cmdFormatter,defaultSeparator:o})}function f4e(r,e){let t=e.themeClasses[r.themeSystem]||nc;return new t(r)}function h4e(r){let e=r.dateProfileGeneratorClass||yf;return new e(r)}function g4e(r,e,t){return new p2(r,e,t)}function y4e(r){return oo(r,e=>e.ui)}function v4e(r,e,t){let n={"":e};for(let i in r){let s=r[i];s.sourceId&&t[s.sourceId]&&(n[i]=t[s.sourceId])}return n}function b4e(r){let{options:e}=r;return{eventUiSingleBase:Ky({display:e.eventDisplay,editable:e.editable,startEditable:e.eventStartEditable,durationEditable:e.eventDurationEditable,constraint:e.eventConstraint,overlap:typeof e.eventOverlap=="boolean"?e.eventOverlap:void 0,allow:e.eventAllow,backgroundColor:e.eventBackgroundColor,borderColor:e.eventBorderColor,textColor:e.eventTextColor,color:e.eventColor},r),selectionConfig:Ky({constraint:e.selectConstraint,overlap:typeof e.selectOverlap=="boolean"?e.selectOverlap:void 0,allow:e.selectAllow},r)}}function d2(r,e){for(let t of e.pluginHooks.isLoadingFuncs)if(t(r))return!0;return!1}function T4e(r){return Yz(r.options.businessHours,r)}function hfe(r,e){for(let t in r)console.warn(`Unknown option '${t}'`+(e?` for view '${e}'`:""))}function k4e(r,e,t,n,i,s){let a=t.build(i,void 0,!1),o=t.buildPrev(e,n,!1),l=t.buildNext(e,n,!1);return{title:s,activeButton:r.type,navUnit:r.singleUnit,isTodayEnabled:a.isValid&&!ao(e.currentRange,i),isPrevEnabled:o.isValid,isNextEnabled:l.isValid}}function w4e(r){return r.map(e=>new e)}var gWe,gfe,yfe,nc,pfe,p2,KWe,ZWe,QWe,JWe,XWe,e4e,t4e,n4e,i4e,s4e,o4e,d4e,m2,lM,f2,h2,cM,g2,y2,v2,b2,dM,Af=v(()=>{c2();kd();wS();gWe=[],gfe={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",weekTextLong:"Week",closeHint:"Close",timeHint:"Time",eventHint:"Event",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"},yfe=Object.assign(Object.assign({},gfe),{buttonHints:{prev:"Previous $0",next:"Next $0",today(r,e){return e==="day"?"Today":`This ${r}`}},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint(r){return`Show ${r} more event${r===1?"":"s"}`}});nc=class extends Sd{};nc.prototype.classes={root:"fc-theme-standard",tableCellShaded:"fc-cell-shaded",buttonGroup:"fc-button-group",button:"fc-button fc-button-primary",buttonActive:"fc-button-active"};nc.prototype.baseIconClass="fc-icon";nc.prototype.iconClasses={close:"fc-icon-x",prev:"fc-icon-chevron-left",next:"fc-icon-chevron-right",prevYear:"fc-icon-chevrons-left",nextYear:"fc-icon-chevrons-right"};nc.prototype.rtlIconClasses={prev:"fc-icon-chevron-right",next:"fc-icon-chevron-left",prevYear:"fc-icon-chevrons-right",nextYear:"fc-icon-chevrons-left"};nc.prototype.iconOverrideOption="buttonIcons";nc.prototype.iconOverrideCustomButtonOption="icon";nc.prototype.iconOverridePrefix="fc-icon-";pfe={};p2=class{constructor(e,t,n){this.type=e,this.getCurrentData=t,this.dateEnv=n}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}},KWe={ignoreRange:!0,parseMeta(r){return Array.isArray(r.events)?r.events:null},fetch(r,e){e({rawEvents:r.eventSource.meta})}},ZWe=Bi({name:"array-event-source",eventSourceDefs:[KWe]}),QWe={parseMeta(r){return typeof r.events=="function"?r.events:null},fetch(r,e,t){let{dateEnv:n}=r.context,i=r.eventSource.meta;Jz(i.bind(null,Qz(r.range,n)),s=>e({rawEvents:s}),t)}},JWe=Bi({name:"func-event-source",eventSourceDefs:[QWe]}),XWe={method:String,extraParams:F,startParam:String,endParam:String,timeZoneParam:String},e4e={parseMeta(r){return r.url&&(r.format==="json"||!r.format)?{url:r.url,format:"json",method:(r.method||"GET").toUpperCase(),extraParams:r.extraParams,startParam:r.startParam,endParam:r.endParam,timeZoneParam:r.timeZoneParam}:null},fetch(r,e,t){let{meta:n}=r.eventSource,i=r4e(n,r.range,r.context);Xz(n.method,n.url,i).then(([s,a])=>{e({rawEvents:s,response:a})},t)}},t4e=Bi({name:"json-event-source",eventSourceRefiners:XWe,eventSourceDefs:[e4e]});n4e={daysOfWeek:F,startTime:nt,endTime:nt,duration:nt,startRecur:F,endRecur:F},i4e={parse(r,e){if(r.daysOfWeek||r.startTime||r.endTime||r.startRecur||r.endRecur){let t={daysOfWeek:r.daysOfWeek||null,startTime:r.startTime||null,endTime:r.endTime||null,startRecur:r.startRecur?e.createMarker(r.startRecur):null,endRecur:r.endRecur?e.createMarker(r.endRecur):null,dateEnv:e},n;return r.duration&&(n=r.duration),!n&&r.startTime&&r.endTime&&(n=Eme(r.endTime,r.startTime)),{allDayGuess:!r.startTime&&!r.endTime,duration:n,typeData:t}}return null},expand(r,e,t){let n=ls(e,{start:r.startRecur,end:r.endRecur});return n?a4e(r.daysOfWeek,r.startTime,r.dateEnv,t,n):[]}},s4e=Bi({name:"simple-recurring-event",recurringTypes:[i4e],eventRefiners:n4e});o4e=Bi({name:"change-handler",optionChangeHandlers:{events(r,e){ffe([r],e)},eventSources:ffe}});d4e=[ZWe,JWe,t4e,s4e,o4e,Bi({name:"misc",isLoadingFuncs:[r=>Tfe(r.eventSources)],propSetHandlers:{dateProfile:l4e,eventStore:c4e}})],m2=class{constructor(e,t){this.runTaskOption=e,this.drainedOption=t,this.queue=[],this.delayedRunner=new gf(this.drain.bind(this))}request(e,t){this.queue.push(e),this.delayedRunner.request(t)}pause(e){this.delayedRunner.pause(e)}resume(e,t){this.delayedRunner.resume(e,t)}drain(){let{queue:e}=this;for(;e.length;){let t=[],n;for(;n=e.shift();)this.runTask(n),t.push(n);this.drained(t)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}};lM=class{constructor(){this.resetListeners=new Set}handleInput(e,t){let n=this.dateEnv;if(e!==n&&(typeof t=="function"?this.nowFn=t:n||(this.nowAnchorDate=e.toDate(t?e.createMarker(t):e.createNowMarker()),this.nowAnchorQueried=Date.now()),this.dateEnv=e,n))for(let i of this.resetListeners.values())i()}getDateMarker(){return this.nowAnchorDate?this.dateEnv.timestampToMarker(this.nowAnchorDate.valueOf()+(Date.now()-this.nowAnchorQueried)):this.dateEnv.createMarker(this.nowFn())}addResetListener(e){this.resetListeners.add(e)}removeResetListener(e){this.resetListeners.delete(e)}},f2=class{constructor(e){this.computeCurrentViewData=Se(this._computeCurrentViewData),this.organizeRawLocales=Se(yWe),this.buildLocale=Se(vfe),this.buildPluginHooks=kWe(),this.buildDateEnv=Se(m4e),this.buildTheme=Se(f4e),this.parseToolbars=Se(YWe),this.buildViewSpecs=Se(CWe),this.buildDateProfileGenerator=Wy(h4e),this.buildViewApi=Se(g4e),this.buildViewUiProps=Wy(b4e),this.buildEventUiBySource=Se(y4e,zi),this.buildEventUiBases=Se(v4e),this.parseContextBusinessHours=Wy(T4e),this.buildTitle=Se(u4e),this.nowManager=new lM,this.emitter=new xd,this.actionRunner=new m2(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=p=>{this.actionRunner.request(p)},this.props=e,this.actionRunner.pause(),this.nowManager=new lM;let t={},n=this.computeOptionsData(e.optionOverrides,t,e.calendarApi),i=n.calendarOptions.initialView||n.pluginHooks.initialView,s=this.computeCurrentViewData(i,n,e.optionOverrides,t);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(s.options);let a={nowManager:this.nowManager,dateEnv:n.dateEnv,options:n.calendarOptions,pluginHooks:n.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},o=IWe(n.calendarOptions,n.dateEnv,this.nowManager),l=s.dateProfileGenerator.build(o);ao(l.activeRange,o)||(o=l.currentRange.start);for(let p of n.pluginHooks.contextInit)p(a);let c=OWe(n.calendarOptions,l,a),d={dynamicOptionOverrides:t,currentViewType:i,currentDate:o,dateProfile:l,businessHours:this.parseContextBusinessHours(a),eventSources:c,eventUiBases:{},eventStore:Hn(),renderableEventStore:Hn(),dateSelection:null,eventSelection:"",eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(a).selectionConfig},u=Object.assign(Object.assign({},a),d);for(let p of n.pluginHooks.reducers)Object.assign(d,p(null,null,u));d2(d,a)&&this.emitter.trigger("loading",!0),this.state=d,this.updateData(),this.actionRunner.resume()}resetOptions(e,t){let{props:n}=this;t===void 0?n.optionOverrides=e:(n.optionOverrides=Object.assign(Object.assign({},n.optionOverrides||{}),e),this.optionsForRefining.push(...t)),(t===void 0||t.length)&&this.actionRunner.request({type:"NOTHING"})}_handleAction(e){let{props:t,state:n,emitter:i}=this,s=NWe(n.dynamicOptionOverrides,e),a=this.computeOptionsData(t.optionOverrides,s,t.calendarApi),o=MWe(n.currentViewType,e),l=this.computeCurrentViewData(o,a,t.optionOverrides,s);t.calendarApi.currentDataManager=this,i.setThisContext(t.calendarApi),i.setOptions(l.options);let c={nowManager:this.nowManager,dateEnv:a.dateEnv,options:a.calendarOptions,pluginHooks:a.pluginHooks,calendarApi:t.calendarApi,dispatch:this.dispatch,emitter:i,getCurrentData:this.getCurrentData},{currentDate:d,dateProfile:u}=n;this.data&&this.data.dateProfileGenerator!==l.dateProfileGenerator&&(u=l.dateProfileGenerator.build(d)),d=AWe(d,e),u=RWe(u,e,d,l.dateProfileGenerator),(e.type==="PREV"||e.type==="NEXT"||!ao(u.currentRange,d))&&(d=u.currentRange.start);let p=LWe(n.eventSources,e,u,c),m=$me(n.eventStore,e,p,u,c),h=Tfe(p)&&!l.options.progressiveEventRendering&&n.renderableEventStore||m,{eventUiSingleBase:g,selectionConfig:y}=this.buildViewUiProps(c),k=this.buildEventUiBySource(p),T=this.buildEventUiBases(h.defs,g,k),w={dynamicOptionOverrides:s,currentViewType:o,currentDate:d,dateProfile:u,eventSources:p,eventStore:m,renderableEventStore:h,selectionConfig:y,eventUiBases:T,businessHours:this.parseContextBusinessHours(c),dateSelection:HWe(n.dateSelection,e),eventSelection:UWe(n.eventSelection,e),eventDrag:VWe(n.eventDrag,e),eventResize:WWe(n.eventResize,e)},S=Object.assign(Object.assign({},c),w);for(let D of a.pluginHooks.reducers)Object.assign(w,D(n,e,S));let E=d2(n,c),C=d2(w,c);!E&&C?i.trigger("loading",!0):E&&!C&&i.trigger("loading",!1),this.state=w,t.onAction&&t.onAction(e)}updateData(){let{props:e,state:t}=this,n=this.data,i=this.computeOptionsData(e.optionOverrides,t.dynamicOptionOverrides,e.calendarApi),s=this.computeCurrentViewData(t.currentViewType,i,e.optionOverrides,t.dynamicOptionOverrides),a=this.data=Object.assign(Object.assign(Object.assign({nowManager:this.nowManager,viewTitle:this.buildTitle(t.dateProfile,s.options,i.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},i),s),t),o=i.pluginHooks.optionChangeHandlers,l=n&&n.calendarOptions,c=i.calendarOptions;if(l&&l!==c){l.timeZone!==c.timeZone&&(t.eventSources=a.eventSources=FWe(a.eventSources,t.dateProfile,a),t.eventStore=a.eventStore=Wz(a.eventStore,n.dateEnv,a.dateEnv),t.renderableEventStore=a.renderableEventStore=Wz(a.renderableEventStore,n.dateEnv,a.dateEnv));for(let d in o)(this.optionsForHandling.indexOf(d)!==-1||l[d]!==c[d])&&o[d](c[d],a)}this.optionsForHandling=[],e.onData&&e.onData(a)}computeOptionsData(e,t,n){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&t===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:i,pluginHooks:s,localeDefaults:a,availableLocaleData:o,extra:l}=this.processRawCalendarOptions(e,t);hfe(l);let c=this.buildDateEnv(i.timeZone,i.locale,i.weekNumberCalculation,i.firstDay,i.weekText,s,o,i.defaultRangeSeparator),d=this.buildViewSpecs(s.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,a),u=this.buildTheme(i,s),p=this.parseToolbars(i,this.stableOptionOverrides,u,d,n);return this.stableCalendarOptionsData={calendarOptions:i,pluginHooks:s,dateEnv:c,viewSpecs:d,theme:u,toolbarConfig:p,localeDefaults:a,availableRawLocales:o.map}}processRawCalendarOptions(e,t){let{locales:n,locale:i}=Q_([ec,e,t]),s=this.organizeRawLocales(n),a=s.map,o=this.buildLocale(i||s.defaultCode,a).options,l=this.buildPluginHooks(e.plugins||[],d4e),c=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Rz),Oz),Lz),l.listenerRefiners),l.optionRefiners),d={},u=Q_([ec,o,e,t]),p={},m=this.currentCalendarOptionsInput,f=this.currentCalendarOptionsRefined,h=!1;for(let g in u)this.optionsForRefining.indexOf(g)===-1&&(u[g]===m[g]||cp[g]&&g in m&&cp[g](m[g],u[g]))?p[g]=f[g]:c[g]?(p[g]=c[g](u[g]),h=!0):d[g]=m[g];return h&&(this.currentCalendarOptionsInput=u,this.currentCalendarOptionsRefined=p,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=t),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:l,availableLocaleData:s,localeDefaults:o,extra:d}}_computeCurrentViewData(e,t,n,i){let s=t.viewSpecs[e];if(!s)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:a,extra:o}=this.processRawViewOptions(s,t.pluginHooks,t.localeDefaults,n,i);hfe(o),this.nowManager.handleInput(t.dateEnv,a.now);let l=this.buildDateProfileGenerator({dateProfileGeneratorClass:s.optionDefaults.dateProfileGeneratorClass,nowManager:this.nowManager,duration:s.duration,durationUnit:s.durationUnit,usesMinMaxTime:s.optionDefaults.usesMinMaxTime,dateEnv:t.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,showNonCurrentDates:a.showNonCurrentDates,dayCount:a.dayCount,dateAlignment:a.dateAlignment,dateIncrement:a.dateIncrement,hiddenDays:a.hiddenDays,weekends:a.weekends,validRangeInput:a.validRange,visibleRangeInput:a.visibleRange,fixedWeekCount:a.fixedWeekCount}),c=this.buildViewApi(e,this.getCurrentData,t.dateEnv);return{viewSpec:s,options:a,dateProfileGenerator:l,viewApi:c}}processRawViewOptions(e,t,n,i,s){let a=Q_([ec,e.optionDefaults,n,i,e.optionOverrides,s]),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Rz),Oz),Lz),Pme),t.listenerRefiners),t.optionRefiners),l={},c=this.currentViewOptionsInput,d=this.currentViewOptionsRefined,u=!1,p={};for(let m in a)a[m]===c[m]||cp[m]&&cp[m](a[m],c[m])?l[m]=d[m]:(a[m]===this.currentCalendarOptionsInput[m]||cp[m]&&cp[m](a[m],this.currentCalendarOptionsInput[m])?m in this.currentCalendarOptionsRefined&&(l[m]=this.currentCalendarOptionsRefined[m]):o[m]?l[m]=o[m](a[m]):p[m]=a[m],u=!0);return u&&(this.currentViewOptionsInput=a,this.currentViewOptionsRefined=l),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:p}}};h2=class extends ht{render(){let e=this.props.widgetGroups.map(t=>this.renderWidgetGroup(t));return _("div",{className:"fc-toolbar-chunk"},...e)}renderWidgetGroup(e){let{props:t}=this,{theme:n}=this.context,i=[],s=!0;for(let a of e){let{buttonName:o,buttonClick:l,buttonText:c,buttonIcon:d,buttonHint:u}=a;if(o==="title")s=!1,i.push(_("h2",{className:"fc-toolbar-title",id:t.titleId},t.title));else{let p=o===t.activeButton,m=!t.isTodayEnabled&&o==="today"||!t.isPrevEnabled&&o==="prev"||!t.isNextEnabled&&o==="next",f=[`fc-${o}-button`,n.getClass("button")];p&&f.push(n.getClass("buttonActive")),i.push(_("button",{type:"button",title:typeof u=="function"?u(t.navUnit):u,disabled:m,"aria-pressed":p,className:f.join(" "),onClick:l},c||(d?_("span",{className:d,role:"img"}):"")))}}if(i.length>1){let a=s&&n.getClass("buttonGroup")||"";return _("div",{className:a},...i)}return i[0]}},cM=class extends ht{render(){let{model:e,extraClassName:t}=this.props,n=!1,i,s,a=e.sectionWidgets,o=a.center;return a.left?(n=!0,i=a.left):i=a.start,a.right?(n=!0,s=a.right):s=a.end,_("div",{className:[t||"","fc-toolbar",n?"fc-toolbar-ltr":""].join(" ")},this.renderSection("start",i||[]),this.renderSection("center",o||[]),this.renderSection("end",s||[]))}renderSection(e,t){let{props:n}=this;return _(h2,{key:e,widgetGroups:t,title:n.title,navUnit:n.navUnit,activeButton:n.activeButton,isTodayEnabled:n.isTodayEnabled,isPrevEnabled:n.isPrevEnabled,isNextEnabled:n.isNextEnabled,titleId:n.titleId})}},g2=class extends ht{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,xa(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:t}=this,{aspectRatio:n}=e,i=["fc-view-harness",n||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],s="",a="";return n?t.availableWidth!==null?s=t.availableWidth/n:a=`${1/n*100}%`:s=e.height||"",_("div",{"aria-labelledby":e.labeledById,ref:this.handleEl,className:i.join(" "),style:{height:s,paddingBottom:a}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}},y2=class extends el{constructor(e){super(e),this.handleSegClick=(t,n)=>{let{component:i}=this,{context:s}=i,a=Pd(n);if(a&&i.isValidSegDownEl(t.target)){let o=qn(t.target,".fc-event-forced-url"),l=o?o.querySelector("a[href]").href:"";s.emitter.trigger("eventClick",{el:n,event:new wr(i.context,a.eventRange.def,a.eventRange.instance),jsEvent:t,view:s.viewApi}),l&&!t.defaultPrevented&&(window.location.href=l)}},this.destroy=wz(e.el,"click",".fc-event",this.handleSegClick)}},v2=class extends el{constructor(e){super(e),this.handleEventElRemove=t=>{t===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(t,n)=>{Pd(n)&&(this.currentSegEl=n,this.triggerEvent("eventMouseEnter",t,n))},this.handleSegLeave=(t,n)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",t,n))},this.removeHoverListeners=bme(e.el,".fc-event",this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,t,n){let{component:i}=this,{context:s}=i,a=Pd(n);(!t||i.isValidSegDownEl(t.target))&&s.emitter.trigger(e,{el:n,event:new wr(s,a.eventRange.def,a.eventRange.instance),jsEvent:t,view:s.viewApi})}},b2=class extends Kl{constructor(){super(...arguments),this.buildViewContext=Se(Nme),this.buildViewPropTransformers=Se(w4e),this.buildToolbarProps=Se(k4e),this.headerRef=nn(),this.footerRef=nn(),this.interactionsStore={},this.state={viewLabelId:Fs()},this.registerInteractiveComponent=(e,t)=>{let n=Ume(e,t),a=[y2,v2].concat(this.props.pluginHooks.componentInteractions).map(o=>new o(n));this.interactionsStore[e.uid]=a,_f[e.uid]=n},this.unregisterInteractiveComponent=e=>{let t=this.interactionsStore[e.uid];if(t){for(let n of t)n.destroy();delete this.interactionsStore[e.uid]}delete _f[e.uid]},this.resizeRunner=new gf(()=>{this.props.emitter.trigger("_resize",!0),this.props.emitter.trigger("windowResize",{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:t}=this.props;t.handleWindowResize&&e.target===window&&this.resizeRunner.request(t.windowResizeDelay)}}render(){let{props:e}=this,{toolbarConfig:t,options:n}=e,i=!1,s="",a;e.isHeightAuto||e.forPrint?s="":n.height!=null?i=!0:n.contentHeight!=null?s=n.contentHeight:a=Math.max(n.aspectRatio,.5);let o=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.nowManager,e.theme,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),l=t.header&&t.header.hasTitle?this.state.viewLabelId:void 0;return _(lo.Provider,{value:o},_(Os,{unit:"day"},c=>{let d=this.buildToolbarProps(e.viewSpec,e.dateProfile,e.dateProfileGenerator,e.currentDate,c,e.viewTitle);return _(jt,null,t.header&&_(cM,Object.assign({ref:this.headerRef,extraClassName:"fc-header-toolbar",model:t.header,titleId:l},d)),_(g2,{liquid:i,height:s,aspectRatio:a,labeledById:l},this.renderView(e),this.buildAppendContent()),t.footer&&_(cM,Object.assign({ref:this.footerRef,extraClassName:"fc-footer-toolbar",model:t.footer,titleId:""},d)))}))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(n=>new n(e)),window.addEventListener("resize",this.handleWindowResize);let{propSetHandlers:t}=e.pluginHooks;for(let n in t)t[n](e[n],e)}componentDidUpdate(e){let{props:t}=this,{propSetHandlers:n}=t.pluginHooks;for(let i in n)t[i]!==e[i]&&n[i](t[i],t)}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger("_unmount")}buildAppendContent(){let{props:e}=this,t=e.pluginHooks.viewContainerAppends.map(n=>n(e));return _(jt,{},...t)}renderView(e){let{pluginHooks:t}=e,{viewSpec:n}=e,i={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},s=this.buildViewPropTransformers(t.viewPropsTransformers);for(let o of s)Object.assign(i,o.transform(i,e));let a=n.component;return _(a,Object.assign({},i))}};dM=class extends AS{constructor(e,t={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=n=>{switch(n.type){case"SET_EVENT_DRAG":case"SET_EVENT_RESIZE":this.renderRunner.tryDrain()}},this.handleData=n=>{this.currentData=n,this.renderRunner.request(n.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:n}=this;DS(()=>{ep(_(MS,{options:n.calendarOptions,theme:n.theme,emitter:n.emitter},(i,s,a,o)=>(this.setClassNames(i),this.setHeight(s),_(jz.Provider,{value:this.customContentRenderId},_(b2,Object.assign({isHeightAuto:a,forPrint:o},n))))),this.el)})}else this.isRendered&&(this.isRendered=!1,ep(null,this.el),this.setClassNames([]),this.setHeight(""))},hme(e),this.el=e,this.renderRunner=new gf(this.handleRenderRequest),new f2({optionOverrides:t,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){DS(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause("batchRendering"),e(),this.renderRunner.resume("batchRendering")}pauseRendering(){this.renderRunner.pause("pauseRendering")}resumeRendering(){this.renderRunner.resume("pauseRendering",!0)}resetOptions(e,t){this.currentDataManager.resetOptions(e,t)}setClassNames(e){if(!Jl(e,this.currentClassNames)){let{classList:t}=this.el;for(let n of this.currentClassNames)t.remove(n);for(let n of e)t.add(n);this.currentClassNames=e}}setHeight(e){kz(this.el,"height",e)}}});var If=v(()=>{c2();kd();wS()});function S4e(r){return r.button===0&&!r.ctrlKey}function x4e(){k2+=1,setTimeout(()=>{k2-=1},Jy.touchMouseIgnoreWait)}function E4e(){uM+=1,uM===1&&window.addEventListener("touchmove",Dfe,{passive:!1})}function D4e(){uM-=1,uM||window.removeEventListener("touchmove",Dfe,{passive:!1})}function Dfe(r){w2&&r.preventDefault()}function C4e(r){let e=r.tagName;return e==="HTML"||e==="BODY"}function gM(r,e){return!r&&!e?!0:!!r!=!!e?!1:Zz(r.dateSpan,e.dateSpan)}function I2(r,e){let t={};for(let n of e.pluginHooks.datePointTransforms)Object.assign(t,n(r,e));return Object.assign(t,P4e(r,e.dateEnv)),t}function P4e(r,e){return{date:e.toDate(r.range.start),dateStr:e.formatIso(r.range.start,{omitTime:r.allDay}),allDay:r.allDay}}function _4e(r){let{options:e}=r.context,t=e.selectLongPressDelay;return t==null&&(t=e.longPressDelay),t}function M4e(r,e,t){let n=r.dateSpan,i=e.dateSpan,s=[n.range.start,n.range.end,i.range.start,i.range.end];s.sort(Pz);let a={};for(let o of t){let l=o(r,e);if(l===!1)return null;l&&Object.assign(a,l)}return a.range={start:s[0],end:s[3]},a.allDay=n.allDay,a}function A4e(r,e,t,n){let i=r.dateSpan,s=e.dateSpan,a=i.range.start,o=s.range.start,l={};i.allDay!==s.allDay&&(l.allDay=s.allDay,l.hasEnd=e.context.options.allDayMaintainDuration,s.allDay?a=ar(t):a=t);let c=ip(a,o,r.context.dateEnv,r.componentId===e.componentId?r.largeUnit:null);c.milliseconds&&(l.allDay=!1);let d={datesDelta:c,standardProps:l};for(let u of n)u(d,r,e);return d}function I4e(r){let{options:e}=r.context,t=e.eventLongPressDelay;return t==null&&(t=e.longPressDelay),t}function N4e(r,e,t,n){let i=r.context.dateEnv,s=r.dateSpan.range.start,a=e.dateSpan.range.start,o=ip(s,a,i,r.largeUnit);if(t){if(i.add(n.start,o)n.start)return{endDelta:o};return null}function L4e(r,e,t){let n=Object.assign({},e.leftoverProps);for(let d of t.pluginHooks.externalDefTransforms)Object.assign(n,d(r,e));let{refined:i,extra:s}=HS(n,t),a=jy(i,s,e.sourceId,r.allDay,t.options.forceEventDuration||!!e.duration,t),o=r.range.start;r.allDay&&e.startTime&&(o=t.dateEnv.add(o,e.startTime));let l=e.duration?t.dateEnv.add(o,e.duration):_S(r.allDay,o,t),c=Gy(a.defId,{start:o,end:l});return{def:a,instance:c}}function F4e(r){let e=$4e(r,"event"),t=e?JSON.parse(e):{create:!1};return QS(t)}function $4e(r,e){let t=Jy.dataAttrPrefix,n=(t?t+"-":"")+e;return r.getAttribute("data-"+n)||""}var k2,uM,w2,pM,S2,mM,fM,x2,Efe,E2,up,D2,Nf,C2,P2,nx,_2,M2,R4e,O4e,A2,hM,Cfe,N2=v(()=>{Af();If();Jy.touchMouseIgnoreWait=500;k2=0,uM=0,w2=!1,pM=class{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=t=>{if(!this.shouldIgnoreMouse()&&S4e(t)&&this.tryStart(t)){let n=this.createEventFromMouse(t,!0);this.emitter.trigger("pointerdown",n),this.initScrollWatch(n),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=t=>{let n=this.createEventFromMouse(t);this.recordCoords(n),this.emitter.trigger("pointermove",n)},this.handleMouseUp=t=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(t)),this.cleanup()},this.handleTouchStart=t=>{if(this.tryStart(t)){this.isTouchDragging=!0;let n=this.createEventFromTouch(t,!0);this.emitter.trigger("pointerdown",n),this.initScrollWatch(n);let i=t.target;this.shouldIgnoreMove||i.addEventListener("touchmove",this.handleTouchMove),i.addEventListener("touchend",this.handleTouchEnd),i.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=t=>{let n=this.createEventFromTouch(t);this.recordCoords(n),this.emitter.trigger("pointermove",n)},this.handleTouchEnd=t=>{if(this.isDragging){let n=t.target;n.removeEventListener("touchmove",this.handleTouchMove),n.removeEventListener("touchend",this.handleTouchEnd),n.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(t)),this.cleanup(),this.isTouchDragging=!1,x4e()}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=t=>{if(!this.shouldIgnoreMove){let n=window.scrollX-this.prevScrollX+this.prevPageX,i=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:t,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:n,pageY:i,deltaX:n-this.origPageX,deltaY:i-this.origPageY})}},this.containerEl=e,this.emitter=new xd,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),E4e()}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),D4e()}tryStart(e){let t=this.querySubjectEl(e),n=e.target;return t&&(!this.handleSelector||qn(n,this.handleSelector))?(this.subjectEl=t,this.isDragging=!0,this.wasTouchScroll=!1,!0):!1}cleanup(){w2=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?qn(e.target,this.selector):this.containerEl}shouldIgnoreMouse(){return k2||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(w2=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,t){let n=0,i=0;return t?(this.origPageX=e.pageX,this.origPageY=e.pageY):(n=e.pageX-this.origPageX,i=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:n,deltaY:i}}createEventFromTouch(e,t){let n=e.touches,i,s,a=0,o=0;return n&&n.length?(i=n[0].pageX,s=n[0].pageY):(i=e.pageX,s=e.pageY),t?(this.origPageX=i,this.origPageY=s):(a=i-this.origPageX,o=s-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:i,pageY:s,deltaX:a,deltaY:o}}};S2=class{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(e,t,n){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=t-window.scrollX,this.origScreenY=n-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,t){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=t-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)}stop(e,t){let n=()=>{this.cleanup(),t()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(n,this.revertDuration):setTimeout(n,0)}doRevertAnimation(e,t){let n=this.mirrorEl,i=this.sourceEl.getBoundingClientRect();n.style.transition="top "+t+"ms,left "+t+"ms",Cf(n,{left:i.left,top:i.top}),Sz(n,()=>{n.style.transition="",e()})}cleanup(){this.mirrorEl&&($S(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&Cf(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,t=this.mirrorEl;return t||(t=this.mirrorEl=this.sourceEl.cloneNode(!0),t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.pointerEvents="none",t.classList.add("fc-event-dragging"),Cf(t,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(t)),t}},mM=class extends Tf{constructor(e,t){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=t,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}},fM=class extends mM{constructor(e,t){super(new NS(e),t)}getEventTarget(){return this.scrollController.el}computeClientRect(){return s2(this.scrollController.el)}},x2=class extends mM{constructor(e){super(new RS,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}},Efe=typeof performance=="function"?performance.now:Date.now,E2=class{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let t=Efe();this.handleSide(e,(t-this.msSinceRequest)/1e3),this.requestAnimation(t)}else this.isAnimating=!1}}}start(e,t,n){this.isEnabled&&(this.scrollCaches=this.buildCaches(n),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,t))}handleMove(e,t){if(this.isEnabled){let n=e-window.scrollX,i=t-window.scrollY,s=this.pointerScreenY===null?0:i-this.pointerScreenY,a=this.pointerScreenX===null?0:n-this.pointerScreenX;s<0?this.everMovedUp=!0:s>0&&(this.everMovedDown=!0),a<0?this.everMovedLeft=!0:a>0&&(this.everMovedRight=!0),this.pointerScreenX=n,this.pointerScreenY=i,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(Efe()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,t){let{scrollCache:n}=e,{edgeThreshold:i}=this,s=i-e.distance,a=s*s/(i*i)*this.maxVelocity*t,o=1;switch(e.name){case"left":o=-1;case"right":n.setScrollLeft(n.getScrollLeft()+a*o);break;case"top":o=-1;case"bottom":n.setScrollTop(n.getScrollTop()+a*o);break}}computeBestEdge(e,t){let{edgeThreshold:n}=this,i=null,s=this.scrollCaches||[];for(let a of s){let o=a.clientRect,l=e-o.left,c=o.right-e,d=t-o.top,u=o.bottom-t;l>=0&&c>=0&&d>=0&&u>=0&&(d<=n&&this.everMovedUp&&a.canScrollUp()&&(!i||i.distance>d)&&(i={scrollCache:a,name:"top",distance:d}),u<=n&&this.everMovedDown&&a.canScrollDown()&&(!i||i.distance>u)&&(i={scrollCache:a,name:"bottom",distance:u}),l<=n&&this.everMovedLeft&&a.canScrollLeft()&&(!i||i.distance>l)&&(i={scrollCache:a,name:"left",distance:l}),c<=n&&this.everMovedRight&&a.canScrollRight()&&(!i||i.distance>c)&&(i={scrollCache:a,name:"right",distance:c}))}return i}buildCaches(e){return this.queryScrollEls(e).map(t=>t===window?new x2(!1):new fM(t,!1))}queryScrollEls(e){let t=[];for(let n of this.scrollQuery)typeof n=="object"?t.push(n):t.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(n)));return t}},up=class extends FS{constructor(e,t){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=i=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,xz(document.body),Dz(document.body),i.isTouch||i.origEvent.preventDefault(),this.emitter.trigger("pointerdown",i),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(i.subjectEl,i.pageX,i.pageY),this.startDelay(i),this.minDistance||this.handleDistanceSurpassed(i)))},this.onPointerMove=i=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",i),!this.isDistanceSurpassed){let s=this.minDistance,a,{deltaX:o,deltaY:l}=i;a=o*o+l*l,a>=s*s&&this.handleDistanceSurpassed(i)}this.isDragging&&(i.origEvent.type!=="scroll"&&(this.mirror.handleMove(i.pageX,i.pageY),this.autoScroller.handleMove(i.pageX,i.pageY)),this.emitter.trigger("dragmove",i))}},this.onPointerUp=i=>{this.isInteracting&&(this.isInteracting=!1,Ez(document.body),Cz(document.body),this.emitter.trigger("pointerup",i),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(i)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let n=this.pointer=new pM(e);n.emitter.on("pointerdown",this.onPointerDown),n.emitter.on("pointermove",this.onPointerMove),n.emitter.on("pointerup",this.onPointerUp),t&&(n.selector=t),this.mirror=new S2,this.autoScroller=new E2}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){typeof this.delay=="number"?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(!this.pointer.wasTouchScroll||this.touchScrollAllowed)&&(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),this.touchScrollAllowed===!1&&this.pointer.cancelTouchScroll())}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}setIgnoreMove(e){this.pointer.shouldIgnoreMove=e}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}},D2=class{constructor(e){this.el=e,this.origRect=KS(e),this.scrollCaches=aM(e).map(t=>new fM(t,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let t of this.scrollCaches)e+=t.origScrollLeft-t.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let t of this.scrollCaches)e+=t.origScrollTop-t.getScrollTop();return e}isWithinClipping(e,t){let n={left:e,top:t};for(let i of this.scrollCaches)if(!C4e(i.getEventTarget())&&!t2(n,i.clientRect))return!1;return!0}};Nf=class{constructor(e,t){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=n=>{let{dragging:i}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(n),this.initialHit||!this.requireInitial?(i.setIgnoreMove(!1),this.emitter.trigger("pointerdown",n)):i.setIgnoreMove(!0)},this.handleDragStart=n=>{this.emitter.trigger("dragstart",n),this.handleMove(n,!0)},this.handleDragMove=n=>{this.emitter.trigger("dragmove",n),this.handleMove(n)},this.handlePointerUp=n=>{this.releaseHits(),this.emitter.trigger("pointerup",n)},this.handleDragEnd=n=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,n),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",n)},this.droppableStore=t,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new xd}processFirstCoord(e){let t={left:e.pageX,top:e.pageY},n=t,i=e.subjectEl,s;i instanceof HTMLElement&&(s=KS(i),n=r2(n,s));let a=this.initialHit=this.queryHitForOffset(n.left,n.top);if(a){if(this.useSubjectCenter&&s){let o=sM(s,a.rect);o&&(n=n2(o))}this.coordAdjust=i2(n,t)}else this.coordAdjust={left:0,top:0}}handleMove(e,t){let n=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);(t||!gM(this.movingHit,n))&&(this.movingHit=n,this.emitter.trigger("hitupdate",n,!1,e))}prepareHits(){this.offsetTrackers=oo(this.droppableStore,e=>(e.component.prepareHits(),new D2(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let t in e)e[t].destroy();this.offsetTrackers={}}queryHitForOffset(e,t){let{droppableStore:n,offsetTrackers:i}=this,s=null;for(let a in n){let o=n[a].component,l=i[a];if(l&&l.isWithinClipping(e,t)){let c=l.computeLeft(),d=l.computeTop(),u=e-c,p=t-d,{origRect:m}=l,f=m.right-m.left,h=m.bottom-m.top;if(u>=0&&u=0&&ps.layer)&&(g.componentId=a,g.context=o.context,g.rect.left+=c,g.rect.right+=c,g.rect.top+=d,g.rect.bottom+=d,s=g)}}}return s}};C2=class extends el{constructor(e){super(e),this.handlePointerDown=n=>{let{dragging:i}=this,s=n.origEvent.target;i.setIgnoreMove(!this.component.isValidDateDownEl(s))},this.handleDragEnd=n=>{let{component:i}=this,{pointer:s}=this.dragging;if(!s.wasTouchScroll){let{initialHit:a,finalHit:o}=this.hitDragging;if(a&&o&&gM(a,o)){let{context:l}=i,c=Object.assign(Object.assign({},I2(a.dateSpan,l)),{dayEl:a.dayEl,jsEvent:n.origEvent,view:l.viewApi||l.calendarApi.view});l.emitter.trigger("dateClick",c)}}},this.dragging=new up(e.el),this.dragging.autoScroller.isEnabled=!1;let t=this.hitDragging=new Nf(this.dragging,YS(e));t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}},P2=class extends el{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=a=>{let{component:o,dragging:l}=this,{options:c}=o.context,d=c.selectable&&o.isValidDateDownEl(a.origEvent.target);l.setIgnoreMove(!d),l.delay=a.isTouch?_4e(o):null},this.handleDragStart=a=>{this.component.context.calendarApi.unselect(a)},this.handleHitUpdate=(a,o)=>{let{context:l}=this.component,c=null,d=!1;if(a){let u=this.hitDragging.initialHit;a.componentId===u.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(u,a)||(c=M4e(u,a,l.pluginHooks.dateSelectionTransformers)),(!c||!o2(c,a.dateProfile,l))&&(d=!0,c=null)}c?l.dispatch({type:"SELECT_DATES",selection:c}):o||l.dispatch({type:"UNSELECT_DATES"}),d?qy():Hy(),o||(this.dragSelection=c)},this.handlePointerUp=a=>{this.dragSelection&&(iM(this.dragSelection,a,this.component.context),this.dragSelection=null)};let{component:t}=e,{options:n}=t.context,i=this.dragging=new up(e.el);i.touchScrollAllowed=!1,i.minDistance=n.selectMinDistance||0,i.autoScroller.isEnabled=n.dragScroll;let s=this.hitDragging=new Nf(this.dragging,YS(e));s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}};nx=class r extends el{constructor(e){super(e),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=a=>{let o=a.origEvent.target,{component:l,dragging:c}=this,{mirror:d}=c,{options:u}=l.context,p=l.context;this.subjectEl=a.subjectEl;let m=this.subjectSeg=Pd(a.subjectEl),h=(this.eventRange=m.eventRange).instance.instanceId;this.relevantEvents=US(p.getCurrentData().eventStore,h),c.minDistance=a.isTouch?0:u.eventDragMinDistance,c.delay=a.isTouch&&h!==l.props.eventSelection?I4e(l):null,u.fixedMirrorParent?d.parentNode=u.fixedMirrorParent:d.parentNode=qn(o,".fc"),d.revertDuration=u.dragRevertDuration;let g=l.isValidSegDownEl(o)&&!qn(o,".fc-event-resizer");c.setIgnoreMove(!g),this.isDragging=g&&a.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=a=>{let o=this.component.context,l=this.eventRange,c=l.instance.instanceId;a.isTouch?c!==this.component.props.eventSelection&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:c}):o.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(o.calendarApi.unselect(a),o.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new wr(o,l.def,l.instance),jsEvent:a.origEvent,view:o.viewApi}))},this.handleHitUpdate=(a,o)=>{if(!this.isDragging)return;let l=this.relevantEvents,c=this.hitDragging.initialHit,d=this.component.context,u=null,p=null,m=null,f=!1,h={affectedEvents:l,mutatedEvents:Hn(),isEvent:!0};if(a){u=a.context;let g=u.options;d===u||g.editable&&g.droppable?(p=A4e(c,a,this.eventRange.instance.range.start,u.getCurrentData().pluginHooks.eventDragMutationMassagers),p&&(m=VS(l,u.getCurrentData().eventUiBases,p,u),h.mutatedEvents=m,JS(h,a.dateProfile,u)||(f=!0,p=null,m=null,h.mutatedEvents=Hn()))):u=null}this.displayDrag(u,h),f?qy():Hy(),o||(d===u&&gM(c,a)&&(p=null),this.dragging.setMirrorNeedsRevert(!p),this.dragging.setMirrorIsVisible(!a||!this.subjectEl.getRootNode().querySelector(".fc-event-mirror")),this.receivingContext=u,this.validMutation=p,this.mutatedRelevantEvents=m)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=a=>{if(this.isDragging){let o=this.component.context,l=o.viewApi,{receivingContext:c,validMutation:d}=this,u=this.eventRange.def,p=this.eventRange.instance,m=new wr(o,u,p),f=this.relevantEvents,h=this.mutatedRelevantEvents,{finalHit:g}=this.hitDragging;if(this.clearDrag(),o.emitter.trigger("eventDragStop",{el:this.subjectEl,event:m,jsEvent:a.origEvent,view:l}),d){if(c===o){let y=new wr(o,h.defs[u.defId],p?h.instances[p.instanceId]:null);o.dispatch({type:"MERGE_EVENTS",eventStore:h});let k={oldEvent:m,event:y,relatedEvents:tc(h,o,p),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:f})}},T={};for(let w of o.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(T,w(d,o));o.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},k),T),{el:a.subjectEl,delta:d.datesDelta,jsEvent:a.origEvent,view:l})),o.emitter.trigger("eventChange",k)}else if(c){let y={event:m,relatedEvents:tc(f,o,p),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:f})}};o.emitter.trigger("eventLeave",Object.assign(Object.assign({},y),{draggedEl:a.subjectEl,view:l})),o.dispatch({type:"REMOVE_EVENTS",eventStore:f}),o.emitter.trigger("eventRemove",y);let k=h.defs[u.defId],T=h.instances[p.instanceId],w=new wr(c,k,T);c.dispatch({type:"MERGE_EVENTS",eventStore:h});let S={event:w,relatedEvents:tc(h,c,T),revert(){c.dispatch({type:"REMOVE_EVENTS",eventStore:h})}};c.emitter.trigger("eventAdd",S),a.isTouch&&c.dispatch({type:"SELECT_EVENT",eventInstanceId:p.instanceId}),c.emitter.trigger("drop",Object.assign(Object.assign({},I2(g.dateSpan,c)),{draggedEl:a.subjectEl,jsEvent:a.origEvent,view:g.context.viewApi})),c.emitter.trigger("eventReceive",Object.assign(Object.assign({},S),{draggedEl:a.subjectEl,view:g.context.viewApi}))}}else o.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:t}=this,{options:n}=t.context,i=this.dragging=new up(e.el);i.pointer.selector=r.SELECTOR,i.touchScrollAllowed=!1,i.autoScroller.isEnabled=n.dragScroll;let s=this.hitDragging=new Nf(this.dragging,_f);s.useSubjectCenter=e.useEventCenter,s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp),s.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,t){let n=this.component.context,i=this.receivingContext;i&&i!==e&&(i===n?i.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:t.affectedEvents,mutatedEvents:Hn(),isEvent:!0}}):i.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){let e=this.component.context,{receivingContext:t}=this;t&&t.dispatch({type:"UNSET_EVENT_DRAG"}),e!==t&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}};nx.SELECTOR=".fc-event-draggable, .fc-event-resizable";_2=class extends el{constructor(e){super(e),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=s=>{let{component:a}=this,o=this.querySegEl(s),l=Pd(o),c=this.eventRange=l.eventRange;this.dragging.minDistance=a.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(s.origEvent.target)||s.isTouch&&this.component.props.eventSelection!==c.instance.instanceId)},this.handleDragStart=s=>{let{context:a}=this.component,o=this.eventRange;this.relevantEvents=US(a.getCurrentData().eventStore,this.eventRange.instance.instanceId);let l=this.querySegEl(s);this.draggingSegEl=l,this.draggingSeg=Pd(l),a.calendarApi.unselect(),a.emitter.trigger("eventResizeStart",{el:l,event:new wr(a,o.def,o.instance),jsEvent:s.origEvent,view:a.viewApi})},this.handleHitUpdate=(s,a,o)=>{let{context:l}=this.component,c=this.relevantEvents,d=this.hitDragging.initialHit,u=this.eventRange.instance,p=null,m=null,f=!1,h={affectedEvents:c,mutatedEvents:Hn(),isEvent:!0};s&&(s.componentId===d.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(d,s)||(p=N4e(d,s,o.subjectEl.classList.contains("fc-event-resizer-start"),u.range))),p&&(m=VS(c,l.getCurrentData().eventUiBases,p,l),h.mutatedEvents=m,JS(h,s.dateProfile,l)||(f=!0,p=null,m=null,h.mutatedEvents=null)),m?l.dispatch({type:"SET_EVENT_RESIZE",state:h}):l.dispatch({type:"UNSET_EVENT_RESIZE"}),f?qy():Hy(),a||(p&&gM(d,s)&&(p=null),this.validMutation=p,this.mutatedRelevantEvents=m)},this.handleDragEnd=s=>{let{context:a}=this.component,o=this.eventRange.def,l=this.eventRange.instance,c=new wr(a,o,l),d=this.relevantEvents,u=this.mutatedRelevantEvents;if(a.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:c,jsEvent:s.origEvent,view:a.viewApi}),this.validMutation){let p=new wr(a,u.defs[o.defId],l?u.instances[l.instanceId]:null);a.dispatch({type:"MERGE_EVENTS",eventStore:u});let m={oldEvent:c,event:p,relatedEvents:tc(u,a,l),revert(){a.dispatch({type:"MERGE_EVENTS",eventStore:d})}};a.emitter.trigger("eventResize",Object.assign(Object.assign({},m),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||nt(0),endDelta:this.validMutation.endDelta||nt(0),jsEvent:s.origEvent,view:a.viewApi})),a.emitter.trigger("eventChange",m)}else a.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:t}=e,n=this.dragging=new up(e.el);n.pointer.selector=".fc-event-resizer",n.touchScrollAllowed=!1,n.autoScroller.isEnabled=t.context.options.dragScroll;let i=this.hitDragging=new Nf(this.dragging,YS(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return qn(e.subjectEl,".fc-event")}};M2=class{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=n=>{n.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=n=>{let i=this.context.options.unselectCancel,s=G_(n.origEvent);this.matchesCancel=!!qn(s,i),this.matchesEvent=!!qn(s,nx.SELECTOR)},this.onDocumentPointerUp=n=>{let{context:i}=this,{documentPointer:s}=this,a=i.getCurrentData();if(!s.wasTouchScroll){if(a.dateSelection&&!this.isRecentPointerDateSelect){let o=i.options.unselectAuto;o&&(!o||!this.matchesCancel)&&i.calendarApi.unselect(n)}a.eventSelection&&!this.matchesEvent&&i.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let t=this.documentPointer=new pM(document);t.shouldIgnoreMove=!0,t.shouldWatchScroll=!1,t.emitter.on("pointerdown",this.onDocumentPointerDown),t.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}},R4e={fixedMirrorParent:F},O4e={dateClick:F,eventDragStart:F,eventDragStop:F,eventDrop:F,eventResizeStart:F,eventResizeStop:F,eventResize:F,drop:F,eventReceive:F,eventLeave:F},A2=class{constructor(e,t){this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=i=>{this.dragMeta=this.buildDragMeta(i.subjectEl)},this.handleHitUpdate=(i,s,a)=>{let{dragging:o}=this.hitDragging,l=null,c=null,d=!1,u={affectedEvents:Hn(),mutatedEvents:Hn(),isEvent:this.dragMeta.create};i&&(l=i.context,this.canDropElOnCalendar(a.subjectEl,l)&&(c=L4e(i.dateSpan,this.dragMeta,l),u.mutatedEvents=bf(c),d=!JS(u,i.dateProfile,l),d&&(u.mutatedEvents=Hn(),c=null))),this.displayDrag(l,u),o.setMirrorIsVisible(s||!c||!document.querySelector(".fc-event-mirror")),d?qy():Hy(),s||(o.setMirrorNeedsRevert(!c),this.receivingContext=l,this.droppableEvent=c)},this.handleDragEnd=i=>{let{receivingContext:s,droppableEvent:a}=this;if(this.clearDrag(),s&&a){let o=this.hitDragging.finalHit,l=o.context.viewApi,c=this.dragMeta;if(s.emitter.trigger("drop",Object.assign(Object.assign({},I2(o.dateSpan,s)),{draggedEl:i.subjectEl,jsEvent:i.origEvent,view:l})),c.create){let d=bf(a);s.dispatch({type:"MERGE_EVENTS",eventStore:d}),i.isTouch&&s.dispatch({type:"SELECT_EVENT",eventInstanceId:a.instance.instanceId}),s.emitter.trigger("eventReceive",{event:new wr(s,a.def,a.instance),relatedEvents:[],revert(){s.dispatch({type:"REMOVE_EVENTS",eventStore:d})},draggedEl:i.subjectEl,view:l})}}this.receivingContext=null,this.droppableEvent=null};let n=this.hitDragging=new Nf(e,_f);n.requireInitial=!1,n.emitter.on("dragstart",this.handleDragStart),n.emitter.on("hitupdate",this.handleHitUpdate),n.emitter.on("dragend",this.handleDragEnd),this.suppliedDragMeta=t}buildDragMeta(e){return typeof this.suppliedDragMeta=="object"?QS(this.suppliedDragMeta):typeof this.suppliedDragMeta=="function"?QS(this.suppliedDragMeta(e)):F4e(e)}displayDrag(e,t){let n=this.receivingContext;n&&n!==e&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){this.receivingContext&&this.receivingContext.dispatch({type:"UNSET_EVENT_DRAG"})}canDropElOnCalendar(e,t){let n=t.options.dropAccept;return typeof n=="function"?n.call(t.calendarApi,e):typeof n=="string"&&n?!!Y_(e,n):!0}};Jy.dataAttrPrefix="";hM=class{constructor(e,t={}){this.handlePointerDown=i=>{let{dragging:s}=this,{minDistance:a,longPressDelay:o}=this.settings;s.minDistance=a!=null?a:i.isTouch?0:ec.eventDragMinDistance,s.delay=i.isTouch?o!=null?o:ec.longPressDelay:0},this.handleDragStart=i=>{i.isTouch&&this.dragging.delay&&i.subjectEl.classList.contains("fc-event")&&this.dragging.mirror.getMirrorEl().classList.add("fc-event-selected")},this.settings=t;let n=this.dragging=new up(e);n.touchScrollAllowed=!1,t.itemSelector!=null&&(n.pointer.selector=t.itemSelector),t.appendTo!=null&&(n.mirror.parentNode=t.appendTo),n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragstart",this.handleDragStart),new A2(n,t.eventData)}destroy(){this.dragging.destroy()}},Cfe=Bi({name:"@fullcalendar/interaction",componentInteractions:[C2,P2,nx,_2],calendarInteractions:[M2],elementDraggingImpl:up,optionRefiners:R4e,listenerRefiners:O4e})});var yM,Pfe=v(()=>{N2();yM=class{constructor(e){this.draggableInstances=new Map;this.plugin=e}makeTaskCardDraggable(e,t){if(this.draggableInstances.has(e))return;e.dataset.taskPath=t;let n=new hM(e);this.draggableInstances.set(e,n),e.classList.remove("tn-static-cursor-pointer-2723efcc","tn-static-cursor-pointer-3b6a3a65"),e.classList.add("tn-static-cursor-grab-dad79857"),e.addEventListener("dragstart",i=>{e.classList.add("task-card--dragging"),i.dataTransfer&&(i.dataTransfer.setData("text/plain",t),i.dataTransfer.setData("application/x-task-path",t),i.dataTransfer.effectAllowed="copy")}),e.addEventListener("dragend",()=>{e.classList.remove("task-card--dragging")})}removeDraggable(e){let t=this.draggableInstances.get(e);t&&(t.destroy(),this.draggableInstances.delete(e))}destroy(){this.draggableInstances.forEach(e=>{e.destroy()}),this.draggableInstances.clear()}}});var tv,vM,_fe=v(()=>{H$();tv=require("obsidian");Wo();vM=class{constructor(e){this.statusBarElement=null;this.updateTimeout=null;this.plugin=e,this.requestDeduplicator=new cy}initialize(){this.plugin.settings.showTrackedTasksInStatusBar&&(this.statusBarElement=this.plugin.addStatusBarItem(),this.statusBarElement.addClass("tasknotes-status-bar"),this.statusBarElement.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),this.statusBarElement.classList.add("tn-static-cursor-pointer-3b6a3a65"),this.statusBarElement.addEventListener("click",()=>{this.handleStatusBarClick()}),this.updateStatusBar())}async updateStatusBar(){if(!(!this.statusBarElement||!this.plugin.settings.showTrackedTasksInStatusBar))try{let e=await this.requestDeduplicator.execute("update-status-bar",()=>this.getTrackedTasks());this.renderStatusBar(e)}catch(e){console.error("Error updating status bar:",e)}}async getTrackedTasks(){return(await this.plugin.cacheManager.getAllTasks()).filter(t=>t.archived?!1:this.plugin.getActiveTimeSession(t)!==null)}renderStatusBar(e){if(!this.statusBarElement)return;let t=e.length;if(t===0){this.statusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.statusBarElement.classList.add("tn-static-display-none-6b99de8b");return}this.statusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.statusBarElement.style.removeProperty("display"),this.statusBarElement.empty(),this.statusBarElement.createEl("span",{cls:"tasknotes-status-icon",text:"\u23F1\uFE0F"});let n=this.statusBarElement.createEl("span",{cls:"tasknotes-status-text"});if(t===1){let i=e[0],s=i.title.length>30?i.title.substring(0,30)+"...":i.title;n.setText(`Tracking: ${s}`),(0,tv.setTooltip)(this.statusBarElement,`Currently tracking: ${i.title}`,{placement:"top"})}else{n.setText(`Tracking ${t} tasks`);let i=e.slice(0,5).map(a=>a.title).join(` `),s=t>5?`${i} ... and ${t-5} more`:i;(0,tv.setTooltip)(this.statusBarElement,`Currently tracking: ${s}`,{placement:"top"})}}async handleStatusBarClick(){try{let e=await this.getTrackedTasks();if(e.length===0)return;if(e.length===1){let t=e[0],n=this.plugin.app.vault.getAbstractFileByPath(t.path);n instanceof tv.TFile&&await this.plugin.app.workspace.getLeaf(!1).openFile(n)}else pn(this.plugin,e,t=>{(async()=>{if(t){let n=this.plugin.app.vault.getAbstractFileByPath(t.path);n instanceof tv.TFile&&await this.plugin.app.workspace.getLeaf(!1).openFile(n)}})()})}catch(e){console.error("Error handling status bar click:",e)}}requestUpdate(){this.updateTimeout&&window.clearTimeout(this.updateTimeout),this.updateTimeout=window.setTimeout(()=>{this.updateStatusBar()},100)}updateVisibility(){this.plugin.settings.showTrackedTasksInStatusBar?this.statusBarElement?this.updateStatusBar():this.initialize():this.hide()}hide(){this.statusBarElement&&(this.statusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.statusBarElement.classList.add("tn-static-display-none-6b99de8b"))}destroy(){this.updateTimeout&&(window.clearTimeout(this.updateTimeout),this.updateTimeout=null),this.requestDeduplicator&&this.requestDeduplicator.cancelAll(),this.statusBarElement=null}}});var TM,bM,Mfe=v(()=>{TM=require("obsidian");On();Qe();bM=class{constructor(e){this.notificationQueue=[];this.processedReminders=new Set;this.lastBroadScanTime=Date.now();this.lastQuickCheckTime=Date.now();this.BROAD_SCAN_INTERVAL=300*1e3;this.QUICK_CHECK_INTERVAL=30*1e3;this.QUEUE_WINDOW=300*1e3;this.plugin=e}async initialize(){this.plugin.settings.enableNotifications&&(this.plugin.settings.notificationType==="system"&&"Notification"in window&&Notification.permission==="default"&&await Notification.requestPermission(),this.setupTaskUpdateListener(),this.startBroadScan(),this.startQuickCheck(),await this.scanTasksAndBuildQueue())}destroy(){this.broadScanInterval&&window.clearInterval(this.broadScanInterval),this.quickCheckInterval&&window.clearInterval(this.quickCheckInterval),this.taskUpdateListener&&this.plugin.emitter.offref(this.taskUpdateListener),this.notificationQueue=[],this.processedReminders.clear()}startBroadScan(){this.broadScanInterval=window.setInterval(()=>{(async()=>{let e=Date.now();e-this.lastBroadScanTime>this.BROAD_SCAN_INTERVAL+6e4&&await this.handleSystemWakeUp(),await this.scanTasksAndBuildQueue(),this.lastBroadScanTime=e})()},this.BROAD_SCAN_INTERVAL)}startQuickCheck(){this.quickCheckInterval=window.setInterval(()=>{let e=Date.now();e-this.lastQuickCheckTime>this.QUICK_CHECK_INTERVAL+6e4,this.checkNotificationQueue(),this.lastQuickCheckTime=e},this.QUICK_CHECK_INTERVAL)}async scanTasksAndBuildQueue(){this.notificationQueue=[];let e=await this.plugin.cacheManager.getAllTasks(),t=Date.now(),n=t+this.QUEUE_WINDOW;for(let i of e)if(!(!i.reminders||i.reminders.length===0))for(let s of i.reminders){let a=`${i.path}-${s.id}`;if(this.processedReminders.has(a))continue;let o=this.calculateNotificationTime(i,s);o!==null&&o>t&&o<=n&&this.notificationQueue.push({taskPath:i.path,reminder:s,notifyAt:o})}this.notificationQueue.sort((i,s)=>i.notifyAt-s.notifyAt)}calculateNotificationTime(e,t){try{if(t.type==="absolute")return t.absoluteTime?Mr(t.absoluteTime).getTime():null;if(t.type==="relative"){if(!t.relatedTo||!t.offset)return null;let n=t.relatedTo==="due"?e.due:e.scheduled;if(!n)return null;let i=Mr(n),s=this.parseISO8601Duration(t.offset);return s===null?null:i.getTime()+s}}catch(n){return console.error("Error calculating notification time:",n),null}return null}parseISO8601Duration(e){let t=e.match(/^(-?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/);if(!t)return null;let[,n,i,s,a,o,l,c,d]=t,u=0;return i&&(u+=parseInt(i)*365*24*60*60*1e3),s&&(u+=parseInt(s)*30*24*60*60*1e3),a&&(u+=parseInt(a)*7*24*60*60*1e3),o&&(u+=parseInt(o)*24*60*60*1e3),l&&(u+=parseInt(l)*60*60*1e3),c&&(u+=parseInt(c)*60*1e3),d&&(u+=parseInt(d)*1e3),n==="-"?-u:u}checkNotificationQueue(){let e=Date.now(),t=[];for(let n=0;n=0;n--)this.notificationQueue.splice(t[n],1)}async triggerNotification(e){let t=this.plugin.app.vault.getAbstractFileByPath(e.taskPath);if(!(t instanceof TM.TFile))return;let n=this.plugin.app.metadataCache.getFileCache(t);if(!n||!n.frontmatter)return;let i=this.plugin.fieldMapper.mapFromFrontmatter(n.frontmatter,e.taskPath,this.plugin.settings.storeTitleInFilename),s=e.reminder.description||this.generateDefaultMessage(i,e.reminder);if(this.plugin.settings.notificationType==="system")if("Notification"in window&&Notification.permission==="granted"){let a=new Notification("TaskNotes Reminder",{body:s,tag:`tasknotes-${e.taskPath}-${e.reminder.id}`});a.onclick=()=>{this.plugin.app.workspace.openLinkText(e.taskPath,"",!1),a.close()}}else this.showInAppNotice(s,e.taskPath);else this.showInAppNotice(s,e.taskPath);this.plugin.apiService&&await this.plugin.apiService.triggerWebhook("reminder.triggered",{task:i,reminder:e.reminder,notificationTime:new Date(e.notifyAt).toISOString(),message:s,notificationType:this.plugin.settings.notificationType})}showInAppNotice(e,t){let n=new TM.Notice(e,0),i=n.noticeEl;i.addEventListener("click",()=>{this.plugin.app.workspace.openLinkText(t,"",!1),n.hide()}),i.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),i.classList.add("tn-static-cursor-pointer-3b6a3a65")}generateDefaultMessage(e,t){if(t.type==="absolute")return`Reminder: ${e.title}`;{let n=t.relatedTo==="due"?"due":"scheduled",i=this.formatDurationForDisplay(t.offset||"");return i.startsWith("-")?`${e.title} is ${n} in ${i.substring(1)}`:i==="PT0S"||i==="PT0M"?`${e.title} is ${n} now`:`${e.title} was ${n} ${i} ago`}}formatDurationForDisplay(e){let t=this.parseISO8601Duration(e);if(t===null)return e;let n=Math.abs(t),i=Math.floor(n/(60*1e3)),s=Math.floor(n/(3600*1e3)),a=Math.floor(n/(1440*60*1e3)),o="";return a>0?o=`${a} day${a>1?"s":""}`:s>0?o=`${s} hour${s>1?"s":""}`:i>0?o=`${i} minute${i>1?"s":""}`:o="now",t<0?`-${o}`:o}async refreshReminders(){await this.scanTasksAndBuildQueue()}clearProcessedRemindersForTask(e){let t=[];for(let n of this.processedReminders)n.startsWith(`${e}-`)&&t.push(n);t.forEach(n=>this.processedReminders.delete(n))}setupTaskUpdateListener(){this.taskUpdateListener=this.plugin.emitter.on(Vt,async({path:e,originalTask:t,updatedTask:n})=>{if(!e||!n)return;this.removeNotificationsForTask(e),this.clearProcessedRemindersForTask(e);let i=Date.now(),s=i+this.QUEUE_WINDOW;if(n.reminders&&n.reminders.length>0){for(let a of n.reminders){let o=`${e}-${a.id}`;if(this.processedReminders.has(o))continue;let l=this.calculateNotificationTime(n,a);l!==null&&l>i&&l<=s&&this.notificationQueue.push({taskPath:e,reminder:a,notifyAt:l})}this.notificationQueue.sort((a,o)=>a.notifyAt-o.notifyAt)}})}removeNotificationsForTask(e){this.notificationQueue=this.notificationQueue.filter(t=>t.taskPath!==e)}async handleSystemWakeUp(){let e=Date.now(),t=[];for(let n of this.processedReminders){let[i,s]=n.split("-",2);if(!(!i||!s))try{let a=await this.plugin.cacheManager.getTaskInfo(i);if(a&&a.reminders){let o=a.reminders.find(l=>l.id===s);if(o){let l=this.calculateNotificationTime(a,o);l&&l<=e&&t.push(n)}}}catch(a){t.push(n)}}t.forEach(n=>this.processedReminders.delete(n)),await this.scanTasksAndBuildQueue()}}});var kM,Afe=v(()=>{On();kM=class{constructor(e){this.globalTaskVersionCache=new Map;this.lastGlobalRefreshTime=0;this.globalTaskCount=0;this.viewHandlers=new Map;this.viewDebounceTimers=new Map;this.viewPendingUpdates=new Map;this.viewConfigs=new Map;this.updateInProgress=new Set;this.eventListener=null;this.plugin=e,this.setupGlobalEventListener()}registerView(e,t){this.viewConfigs.set(e.viewId,{debounceDelay:100,maxBatchSize:5,changeDetectionEnabled:!0,...e}),this.viewHandlers.set(e.viewId,t),this.viewPendingUpdates.set(e.viewId,new Set)}unregisterView(e){let t=this.viewDebounceTimers.get(e);t&&(window.clearTimeout(t),this.viewDebounceTimers.delete(e)),this.viewConfigs.delete(e),this.viewHandlers.delete(e),this.viewPendingUpdates.delete(e),this.updateInProgress.delete(e)}setupGlobalEventListener(){this.eventListener=this.plugin.emitter.on(Vt,async({path:e,originalTask:t,updatedTask:n})=>{if(!e||!n){await this.triggerFullRefreshForAllViews();return}n.path||(n.path=e),this.hasTaskChanged(n)&&await this.handleTaskUpdateForAllViews(n,t)})}async handleTaskUpdateForAllViews(e,t){let n=[];for(let[i,s]of this.viewHandlers)s.shouldRefreshForTask&&!s.shouldRefreshForTask(t,e)||n.push(this.scheduleViewUpdate(i,e.path));await Promise.all(n),Math.random()<.1&&await this.cleanupTaskVersionCache()}async scheduleViewUpdate(e,t){let n=this.viewConfigs.get(e);if(!n)return;let i=this.viewPendingUpdates.get(e);i&&i.add(t);let s=this.viewDebounceTimers.get(e);s&&window.clearTimeout(s);let a=window.setTimeout(()=>{this.processPendingUpdatesForView(e)},n.debounceDelay);this.viewDebounceTimers.set(e,a)}async processPendingUpdatesForView(e){if(this.updateInProgress.has(e))return;let t=this.viewConfigs.get(e),n=this.viewHandlers.get(e),i=this.viewPendingUpdates.get(e);if(!(!t||!n||!i||i.size===0)){this.updateInProgress.add(e);try{let s=Array.from(i);if(i.clear(),s.length>t.maxBatchSize)await n.refresh();else{let a=s.map(o=>n.updateForTask(o,"update").catch(l=>{console.error(`[ViewPerformanceService] Error updating task ${o} in ${e}:`,l)}));await Promise.all(a)}}catch(s){console.error(`[ViewPerformanceService] Error processing updates for ${e}:`,s),await n.refresh()}finally{this.updateInProgress.delete(e),this.viewDebounceTimers.delete(e)}}}async triggerFullRefreshForAllViews(){let e=[];for(let[t,n]of this.viewHandlers)this.updateInProgress.has(t)||e.push(n.refresh(!0));await Promise.all(e),this.lastGlobalRefreshTime=Date.now()}hasTaskChanged(e){let t=this.globalTaskVersionCache.get(e.path),n=e.dateModified||Date.now().toString();return t!==n?(this.globalTaskVersionCache.set(e.path,n),!0):!1}shouldDoFullRefresh(){let e=Date.now()-this.lastGlobalRefreshTime,t=this.globalTaskVersionCache.size;return e>600*1e3||Math.abs(t-this.globalTaskCount)>20||t===0}async cleanupTaskVersionCache(){try{let e=this.plugin.cacheManager.getAllTaskPaths(),t=new Set(e);for(let n of this.globalTaskVersionCache.keys())t.has(n)||this.globalTaskVersionCache.delete(n);this.globalTaskCount=t.size,this.globalTaskVersionCache.size>2e3&&(this.globalTaskVersionCache.clear(),this.lastGlobalRefreshTime=0)}catch(e){console.error("[ViewPerformanceService] Error during cache cleanup:",e)}}async forceRefreshAll(){this.globalTaskVersionCache.clear(),await this.triggerFullRefreshForAllViews()}getStats(){return{registeredViews:Array.from(this.viewConfigs.keys()),cacheSize:this.globalTaskVersionCache.size,activeUpdates:Array.from(this.updateInProgress),totalPendingUpdates:Array.from(this.viewPendingUpdates.values()).reduce((e,t)=>e+t.size,0),lastGlobalRefresh:new Date(this.lastGlobalRefreshTime).toISOString()}}destroy(){this.eventListener&&(this.plugin.emitter.offref(this.eventListener),this.eventListener=null);for(let e of this.viewDebounceTimers.values())window.clearTimeout(e);this.viewHandlers.clear(),this.viewDebounceTimers.clear(),this.viewPendingUpdates.clear(),this.viewConfigs.clear(),this.updateInProgress.clear(),this.globalTaskVersionCache.clear()}}});var pp,wM,Ife=v(()=>{pp=require("obsidian");On();Wo();$i();hd();wM=class extends pp.ItemView{constructor(t,n){super(t);this.timerDisplay=null;this.statusDisplay=null;this.progressCircle=null;this.progressContainer=null;this.startButton=null;this.pauseButton=null;this.stopButton=null;this.taskDisplay=null;this.statsDisplay=null;this.taskSelectButton=null;this.taskClearButton=null;this.currentSelectedTask=null;this.taskCardContainer=null;this.addTimeButton=null;this.subtractTimeButton=null;this.skipBreakButton=null;this.statElements={pomodoros:null};this.resizeObserver=null;this.resizeTimeout=null;this.functionListeners=[];this.currentCircleSize=300;this.currentCircumference=0;this.listeners=[];this.plugin=n,this.registerEvents()}refreshStats(){this.updateStats().catch(t=>{console.error("Failed to update stats:",t)})}getViewType(){return Vc}getDisplayText(){return this.plugin.i18n.translate("views.pomodoro.title")}getIcon(){return"clock"}t(t,n){return this.plugin.i18n.translate(t,n)}registerEvents(){this.listeners.forEach(o=>this.plugin.emitter.offref(o)),this.listeners=[];let t=this.plugin.emitter.on(hD,({session:o,task:l})=>{this.updateDisplay(o,l)});this.listeners.push(t);let n=this.plugin.emitter.on(gD,({session:o,nextType:l})=>{this.onPomodoroComplete(o,l)});this.listeners.push(n);let i=this.plugin.emitter.on(yD,()=>{this.updateDisplay(void 0,void 0,{refreshStats:!0})});this.listeners.push(i);let s=this.plugin.emitter.on(Fo,({timeRemaining:o,session:l})=>{this.updateTimer(o),this.updateDisplay(l)});this.listeners.push(s);let a=this.plugin.emitter.on(Vt,async({path:o,originalTask:l,updatedTask:c})=>{if(!o||!c)return;if(this.currentSelectedTask&&(this.currentSelectedTask.path===o||l&&this.currentSelectedTask.path===l.path)){this.currentSelectedTask=c,this.updateTaskCardDisplay(c);let u=this.plugin.pomodoroService.getState();u.currentSession&&l&&l.path!==c.path&&u.currentSession.taskPath===l.path&&await this.plugin.pomodoroService.assignTaskToCurrentSession(c)}});this.listeners.push(a)}async onOpen(){await this.plugin.onReady(),await this.render(),this.ensureResizeHandlingSetup(),this.plugin.app.workspace.layoutReady?window.setTimeout(()=>this.ensureResizeHandlingSetup(),50):this.plugin.app.workspace.onLayoutReady(()=>{this.ensureResizeHandlingSetup()})}async onClose(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeTimeout&&(window.clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.listeners.forEach(t=>this.plugin.emitter.offref(t)),this.functionListeners.forEach(t=>t()),this.timerDisplay=null,this.statusDisplay=null,this.progressCircle=null,this.progressContainer=null,this.startButton=null,this.pauseButton=null,this.stopButton=null,this.taskDisplay=null,this.statsDisplay=null,this.taskSelectButton=null,this.taskClearButton=null,this.currentSelectedTask=null,this.taskCardContainer=null,this.statElements={pomodoros:null},this.contentEl.empty()}async render(){let t=this.contentEl.createDiv({cls:"tasknotes-plugin pomodoro-view"});this.statusDisplay=t.createDiv({cls:"pomodoro-view__status",text:this.t("views.pomodoro.status.ready")});let n=t.createDiv({cls:"pomodoro-view__timer-section"});this.progressContainer=n.createDiv({cls:"pomodoro-view__progress-container"});let i=activeDocument.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("class","pomodoro-view__progress-svg"),i.setAttribute("width","300"),i.setAttribute("height","300"),i.setAttribute("viewBox","0 0 300 300"),this.progressContainer.appendChild(i);let s=activeDocument.createElementNS("http://www.w3.org/2000/svg","circle");s.setAttributeNS(null,"cx","150"),s.setAttributeNS(null,"cy","150"),s.setAttributeNS(null,"r","140"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"stroke","var(--tn-border-color)"),s.setAttributeNS(null,"stroke-width","2"),i.appendChild(s),this.progressCircle=activeDocument.createElementNS("http://www.w3.org/2000/svg","circle"),this.progressCircle.setAttributeNS(null,"cx","150"),this.progressCircle.setAttributeNS(null,"cy","150"),this.progressCircle.setAttributeNS(null,"r","140"),this.progressCircle.setAttributeNS(null,"fill","none"),this.progressCircle.setAttributeNS(null,"stroke","var(--tn-interactive-accent)"),this.progressCircle.setAttributeNS(null,"stroke-width","4"),this.progressCircle.setAttributeNS(null,"stroke-linecap","round");let o=2*Math.PI*140;this.progressCircle.setAttributeNS(null,"stroke-dasharray",o.toString()),this.progressCircle.setAttributeNS(null,"stroke-dashoffset",o.toString()),this.progressCircle.addClass("pomodoro-view__progress-circle"),i.appendChild(this.progressCircle);let l=this.progressContainer.createDiv({cls:"pomodoro-view__timer-overlay"}),d=`${this.plugin.settings.pomodoroWorkDuration.toString().padStart(2,"0")}:00`;this.timerDisplay=l.createDiv({cls:"pomodoro-view__timer-display",text:d});let u=l.createDiv({cls:"pomodoro-view__time-controls"});this.subtractTimeButton=u.createEl("button",{cls:"pomodoro-view__time-adjust-button pomodoro-view__subtract-time",text:"-"}),this.addTimeButton=u.createEl("button",{cls:"pomodoro-view__time-adjust-button pomodoro-view__add-time",text:"+"}),this.taskDisplay=t.createDiv({cls:"pomodoro-view__task-display"});let p=t.createDiv({cls:"pomodoro-view__task-selector"}),m=p.createDiv({cls:"pomodoro-view__task-buttons"});this.taskSelectButton=m.createEl("button",{cls:"pomodoro-view__task-select-button",text:this.t("views.pomodoro.buttons.chooseTask")}),this.taskClearButton=m.createEl("button",{cls:"pomodoro-view__task-clear-button pomodoro-view__task-clear-button--hidden",text:this.t("views.pomodoro.buttons.clearTask")}),this.taskCardContainer=p.createDiv({cls:"pomodoro-view__task-card-container"});let f=t.createDiv({cls:"pomodoro-view__control-section"}),h=f.createDiv({cls:"pomodoro-view__primary-controls"});this.startButton=h.createEl("button",{text:this.t("views.pomodoro.buttons.start"),cls:"pomodoro-view__start-button"}),this.pauseButton=h.createEl("button",{text:this.t("views.pomodoro.buttons.pause"),cls:"pomodoro-view__pause-button"}),this.pauseButton.addClass("pomodoro-view__pause-button--hidden"),this.stopButton=h.createEl("button",{text:this.t("views.pomodoro.buttons.stop"),cls:"pomodoro-view__stop-button"}),this.stopButton.addClass("pomodoro-view__stop-button--hidden"),this.skipBreakButton=f.createEl("button",{cls:"pomodoro-view__skip-break-button",text:this.t("views.pomodoro.buttons.skipBreak")}),this.skipBreakButton.addClass("pomodoro-view__skip-break-button--hidden");let g=t.createDiv({cls:"pomodoro-view__stats-section"});this.statsDisplay=g.createDiv({cls:"pomodoro-view__stats"});let y=this.statsDisplay.createDiv({cls:"pomodoro-view__stat pomodoro-view__stat--clickable"});if(this.statElements.pomodoros=y.createSpan({cls:"pomodoro-view__stat-value",text:"0"}),y.createSpan({cls:"pomodoro-view__stat-label",text:this.t("views.pomodoro.statsLabel")}),this.registerDomEvent(y,"click",()=>{this.plugin.activatePomodoroStatsView()}),this.registerDomEvent(this.startButton,"click",async()=>{var k,T,w;if(!((k=this.startButton)!=null&&k.hasClass("is-loading"))){(T=this.startButton)==null||T.addClass("pomodoro-view__start-button--loading");try{let S=this.plugin.pomodoroService.getState();S.currentSession&&!S.isRunning?await this.plugin.pomodoroService.resumePomodoro():S.nextSessionType==="short-break"?await this.plugin.pomodoroService.startBreak(!1):S.nextSessionType==="long-break"?await this.plugin.pomodoroService.startBreak(!0):await this.plugin.pomodoroService.startPomodoro(this.currentSelectedTask||void 0)}finally{(w=this.startButton)==null||w.removeClass("pomodoro-view__start-button--loading")}}}),this.registerDomEvent(this.pauseButton,"click",()=>{this.plugin.pomodoroService.pausePomodoro()}),this.registerDomEvent(this.stopButton,"click",()=>{this.plugin.pomodoroService.stopPomodoro()}),this.registerDomEvent(this.skipBreakButton,"click",()=>{let k=this.plugin.pomodoroService.getState();k.currentSession?this.plugin.pomodoroService.stopPomodoro():(k.nextSessionType==="short-break"||k.nextSessionType==="long-break")&&this.plugin.pomodoroService.startPomodoro(this.currentSelectedTask||void 0)}),this.registerDomEvent(this.addTimeButton,"click",()=>{this.adjustSessionTime(60)}),this.registerDomEvent(this.subtractTimeButton,"click",()=>{this.adjustSessionTime(-60)}),this.registerDomEvent(this.taskSelectButton,"click",async()=>{await this.openTaskSelector()}),this.registerDomEvent(this.taskClearButton,"click",async()=>{await this.selectTask(null)}),this.restoreLastSelectedTask(),this.updateDisplay(),this.refreshStats(),this.plugin.pomodoroService){let k=this.plugin.pomodoroService.getState();this.updateTimer(k.timeRemaining)}}setupResizeHandling(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeTimeout&&(window.clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.functionListeners.forEach(a=>a()),this.functionListeners=[];let t=this.contentEl.ownerDocument.defaultView||window,n=()=>{this.resizeTimeout&&t.clearTimeout(this.resizeTimeout),this.resizeTimeout=t.setTimeout(()=>{this.updateResponsiveLayout()},150)};if(t.ResizeObserver){this.resizeObserver=new t.ResizeObserver(n);let a=this.contentEl.querySelector(".pomodoro-view");a&&this.resizeObserver.observe(a)}let i=this.plugin.app.workspace.on("layout-change",n);this.listeners.push(i),t.addEventListener("resize",n),this.functionListeners.push(()=>t.removeEventListener("resize",n));let s=this.plugin.app.workspace.on("active-leaf-change",a=>{a===this.leaf&&t.setTimeout(()=>{this.updateResponsiveLayout()},100)});this.listeners.push(s),this.updateResponsiveLayout()}ensureResizeHandlingSetup(t=0){let i=Math.min(100*Math.pow(1.5,t),1e3);window.setTimeout(()=>{if(!this.resizeObserver){let s=this.contentEl.querySelector(".pomodoro-view");s?s.getBoundingClientRect().width>0?this.setupResizeHandling():t<10&&this.ensureResizeHandlingSetup(t+1):t<10&&this.ensureResizeHandlingSetup(t+1)}},i)}updateResponsiveLayout(){let t=this.contentEl.querySelector(".pomodoro-view");if(!t)return;let n=t.getBoundingClientRect(),i=n.width,s=n.height,a=Math.min(i/600,1),o=Math.min(s/800,1),l=Math.min(a*.7+o*.3,1);t.classList.remove("pomodoro-view--tiny","pomodoro-view--extra-narrow","pomodoro-view--very-narrow","pomodoro-view--narrow","pomodoro-view--small","pomodoro-view--medium-small","pomodoro-view--medium","pomodoro-view--wide"),i<=200?t.classList.add("pomodoro-view--tiny"):i<=250?t.classList.add("pomodoro-view--extra-narrow"):i<=300?t.classList.add("pomodoro-view--very-narrow"):i<=350?t.classList.add("pomodoro-view--narrow"):i<=400?t.classList.add("pomodoro-view--small"):i<=500?t.classList.add("pomodoro-view--medium-small"):i<=600?t.classList.add("pomodoro-view--medium"):t.classList.add("pomodoro-view--wide");let c=t.querySelector(".pomodoro-view__timer-display");if(c){let d,u;i<=200?(d=2,u="700"):i<=250?(d=2.2,u="650"):i<=300?(d=2.5,u="600"):i<=350?(d=3,u="600"):i<=400?(d=3.2,u="550"):i<=500?(d=3.6,u="500"):i<=600?(d=4,u="500"):(d=4.5,u="400");let m=`${Math.max(d*l,1.5).toFixed(1)}rem`;c.style.fontSize=m,c.style.fontWeight=u}this.updateProgressCircleSize(i,s)}updateProgressCircleSize(t,n){if(!this.progressContainer)return;let i=this.progressContainer.querySelector(".pomodoro-view__progress-svg");if(!i)return;let s=Math.min(t*.8,n*.4),a;if(t<=200?a=Math.max(120,Math.min(s,t-40)):t<=250?a=Math.max(150,Math.min(s,t-50)):t<=300?a=Math.max(180,Math.min(s,t-60)):t<=350?a=Math.max(200,Math.min(s,t-70)):t<=400?a=Math.max(230,Math.min(s,t-80)):t<=500?a=Math.max(250,Math.min(s,t-100)):t<=600?a=Math.max(280,Math.min(s,300)):a=Math.max(300,Math.min(s,t*.5,400)),a===this.currentCircleSize)return;this.currentCircleSize=a,i.setAttribute("width",a.toString()),i.setAttribute("height",a.toString()),i.setAttribute("viewBox",`0 0 ${a} ${a}`),this.progressContainer.style.width=`${a}px`,this.progressContainer.style.height=`${a}px`;let o=a/2,l=o-20;if(i.querySelectorAll("circle").forEach(d=>{d.setAttribute("cx",o.toString()),d.setAttribute("cy",o.toString()),d.setAttribute("r",l.toString())}),this.progressCircle){let d=2*Math.PI*l;if(this.currentCircumference=d,this.progressCircle.setAttribute("stroke-dasharray",d.toString()),this.progressCircle.setAttribute("stroke-dashoffset",d.toString()),this.plugin.pomodoroService){let u=this.plugin.pomodoroService.getState();this.updateProgress(u)}}}async openTaskSelector(){try{let n=(await this.plugin.cacheManager.getAllTasks()).filter(i=>!i.archived);if(n.length===0){new pp.Notice(this.t("views.pomodoro.notices.noTasks"));return}pn(this.plugin,n,i=>{this.selectTask(i)})}catch(t){console.error("Error opening task selector:",t),new pp.Notice(this.t("views.pomodoro.notices.loadFailed"))}}async selectTask(t){this.currentSelectedTask=t,this.taskSelectButton&&(t?(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.changeTask"),(0,pp.setTooltip)(this.taskSelectButton,this.t("views.pomodoro.buttons.selectDifferentTask"),{placement:"top"}),this.taskSelectButton.removeClass("pomodoro-view__task-select-button--no-task")):(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.chooseTask"),this.taskSelectButton.removeAttribute("title"),this.taskSelectButton.addClass("pomodoro-view__task-select-button--no-task"))),this.taskClearButton&&(t?this.taskClearButton.removeClass("pomodoro-view__task-clear-button--hidden"):this.taskClearButton.addClass("pomodoro-view__task-clear-button--hidden")),this.updateTaskCardDisplay(t),await this.plugin.pomodoroService.saveLastSelectedTask(t==null?void 0:t.path);let n=this.plugin.pomodoroService.getState();n.currentSession&&n.currentSession.type==="work"&&await this.plugin.pomodoroService.assignTaskToCurrentSession(t||void 0)}updateTaskCardDisplay(t){if(this.taskCardContainer)if(this.taskCardContainer.empty(),t){let n=this.plugin.settings.defaultVisibleProperties?Fi(this.plugin.settings.defaultVisibleProperties,this.plugin):void 0,i=pr(t,this.plugin,n);this.taskCardContainer.appendChild(i),this.taskCardContainer.removeClass("pomodoro-view__task-card-container--empty")}else this.taskCardContainer.addClass("pomodoro-view__task-card-container--empty")}async restoreLastSelectedTask(){try{if(!this.plugin.pomodoroService)return;let t=await this.plugin.pomodoroService.getLastSelectedTaskPath();if(t){let n=await this.plugin.cacheManager.getTaskByPath(t);n&&!this.plugin.statusManager.isCompletedStatus(n.status)&&!n.archived&&await this.selectTask(n)}}catch(t){console.error("Error restoring last selected task:",t)}}async updateTaskButtonFromPath(t){try{let n=await this.plugin.cacheManager.getTaskInfo(t);if(n){this.currentSelectedTask=n,this.taskSelectButton&&(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.changeTask"),(0,pp.setTooltip)(this.taskSelectButton,this.t("views.pomodoro.buttons.selectDifferentTask"),{placement:"top"}),this.taskSelectButton.removeClass("pomodoro-no-task"),this.taskSelectButton.removeClass("pomodoro-view__task-select-button--no-task")),this.taskClearButton&&this.taskClearButton.removeClass("pomodoro-view__task-clear-button--hidden"),this.updateTaskCardDisplay(n);return}this.currentSelectedTask=null,this.taskSelectButton&&(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.chooseTask"),this.taskSelectButton.removeAttribute("title"),this.taskSelectButton.addClass("pomodoro-view__task-select-button--no-task")),this.taskClearButton&&this.taskClearButton.addClass("pomodoro-view__task-clear-button--hidden"),this.updateTaskCardDisplay(null)}catch(n){console.error("Error updating task button from path:",n)}}updateDisplay(t,n,i={}){var a,o;if(!this.plugin.pomodoroService){this.statusDisplay&&(this.statusDisplay.textContent=this.t("views.pomodoro.status.ready"),this.statusDisplay.className="pomodoro-status pomodoro-view__status");return}let s=this.plugin.pomodoroService.getState();if(this.updateTimer(s.timeRemaining),this.updateProgress(s),this.statusDisplay)if(s.isRunning&&s.currentSession){let l=s.currentSession.type==="work"?this.t("views.pomodoro.status.working"):s.currentSession.type==="short-break"?this.t("views.pomodoro.status.shortBreak"):this.t("views.pomodoro.status.longBreak");this.statusDisplay.textContent=l,this.statusDisplay.className=`pomodoro-status pomodoro-view__status pomodoro-status-${s.currentSession.type} pomodoro-view__status--${s.currentSession.type}`}else s.currentSession&&!s.isRunning?(this.statusDisplay.textContent=this.t("views.pomodoro.status.paused"),this.statusDisplay.className="pomodoro-status pomodoro-view__status pomodoro-status-paused pomodoro-view__status--paused"):(this.statusDisplay.textContent=this.t("views.pomodoro.status.ready"),this.statusDisplay.className="pomodoro-status pomodoro-view__status");if(this.taskDisplay){let l=(a=s.currentSession)==null?void 0:a.taskPath,c=this.taskDisplay.dataset.currentTaskPath;l!==c&&(this.taskDisplay.empty(),this.taskDisplay.dataset.currentTaskPath=l||"")}if(this.taskSelectButton&&(o=s.currentSession)!=null&&o.taskPath&&!this.currentSelectedTask&&this.updateTaskButtonFromPath(s.currentSession.taskPath),this.startButton&&this.pauseButton&&this.stopButton&&(s.isRunning?(this.startButton.addClass("pomodoro-view__start-button--hidden"),this.pauseButton.removeClass("pomodoro-view__pause-button--hidden"),this.stopButton.removeClass("pomodoro-view__stop-button--hidden")):s.currentSession?(this.startButton.removeClass("pomodoro-view__start-button--hidden"),this.startButton.textContent=this.t("views.pomodoro.buttons.resume"),this.pauseButton.addClass("pomodoro-view__pause-button--hidden"),this.stopButton.removeClass("pomodoro-view__stop-button--hidden")):(this.startButton.removeClass("pomodoro-view__start-button--hidden"),s.nextSessionType==="short-break"?this.startButton.textContent=this.t("views.pomodoro.buttons.startShortBreak"):s.nextSessionType==="long-break"?this.startButton.textContent=this.t("views.pomodoro.buttons.startLongBreak"):this.startButton.textContent=this.t("views.pomodoro.buttons.start"),this.pauseButton.addClass("pomodoro-view__pause-button--hidden"),this.stopButton.addClass("pomodoro-view__stop-button--hidden"))),this.skipBreakButton){let l=s.currentSession&&(s.currentSession.type==="short-break"||s.currentSession.type==="long-break"),c=!s.currentSession&&(s.nextSessionType==="short-break"||s.nextSessionType==="long-break");l||c?(this.skipBreakButton.removeClass("pomodoro-view__skip-break-button--hidden"),this.skipBreakButton.textContent=this.t("views.pomodoro.buttons.skipBreak")):this.skipBreakButton.addClass("pomodoro-view__skip-break-button--hidden")}this.addTimeButton&&this.subtractTimeButton&&(this.addTimeButton.removeClass("pomodoro-view__time-adjust-button--hidden"),this.subtractTimeButton.removeClass("pomodoro-view__time-adjust-button--hidden")),i.refreshStats&&this.refreshStats()}updateTimer(t){if(this.timerDisplay){let n=Math.max(0,Math.floor(t)),i=Math.floor(n/60),s=n%60;this.timerDisplay.textContent=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`,n<=60&&n>0?this.timerDisplay.addClass("pomodoro-view__timer-display--warning"):this.timerDisplay.removeClass("pomodoro-view__timer-display--warning")}}updateProgress(t){if(!this.progressCircle)return;let n=this.currentCircumference;if(n===0){let c=this.progressCircle.getAttribute("r"),d=c?parseInt(c):140;n=2*Math.PI*d,this.currentCircumference=n}if(!t.currentSession){this.progressCircle.setAttributeNS(null,"stroke-dashoffset",n.toString()),this.progressCircle.removeClass("pomodoro-view__progress-circle--work"),this.progressCircle.removeClass("pomodoro-view__progress-circle--short-break"),this.progressCircle.removeClass("pomodoro-view__progress-circle--long-break"),this.progressCircle.removeClass("pomodoro-view__progress-circle--warning");return}let i=t.currentSession.activePeriods||[],s=0;for(let c of i)if(c.endTime){let d=new Date(c.startTime).getTime(),u=new Date(c.endTime).getTime();s+=Math.floor((u-d)/1e3)}else if(t.isRunning){let d=new Date(c.startTime).getTime(),u=Date.now();s+=Math.floor((u-d)/1e3)}let a=t.currentSession.plannedDuration*60,o=a>0?Math.max(0,Math.min(1,s/a)):0,l=n-o*n;this.progressCircle.setAttributeNS(null,"stroke-dashoffset",l.toString()),this.progressCircle.removeClass("pomodoro-view__progress-circle--work"),this.progressCircle.removeClass("pomodoro-view__progress-circle--short-break"),this.progressCircle.removeClass("pomodoro-view__progress-circle--long-break"),this.progressCircle.addClass(`pomodoro-view__progress-circle--${t.currentSession.type}`),t.timeRemaining<=60&&t.timeRemaining>0?this.progressCircle.addClass("pomodoro-view__progress-circle--warning"):this.progressCircle.removeClass("pomodoro-view__progress-circle--warning")}async updateStats(){try{if(!this.plugin.pomodoroService){this.statElements.pomodoros&&(this.statElements.pomodoros.textContent="0");return}let t=await this.plugin.pomodoroService.getTodayStats();this.statElements.pomodoros&&this.statElements.pomodoros.textContent!==t.pomodorosCompleted.toString()&&(this.statElements.pomodoros.textContent=t.pomodorosCompleted.toString())}catch(t){console.error("Failed to update stats:",t),this.statElements.pomodoros&&(this.statElements.pomodoros.textContent="0")}}adjustSessionTime(t){if(!this.plugin.pomodoroService)return;let n=this.plugin.pomodoroService.getState();if(n.currentSession)this.plugin.pomodoroService.adjustSessionTime(t);else{let i=Math.max(60,n.timeRemaining+t);this.plugin.pomodoroService.adjustPreparedTimer(i)}if(this.plugin.pomodoroService){let i=this.plugin.pomodoroService.getState();this.updateTimer(i.timeRemaining),this.updateProgress(i)}}onPomodoroComplete(t,n){if(this.updateDisplay(void 0,void 0,{refreshStats:!0}),this.statusDisplay)if(t.type==="work"){let i=n==="long-break",s=this.t(i?"views.pomodoro.status.breakLength.long":"views.pomodoro.status.breakLength.short");this.statusDisplay.textContent=this.t("views.pomodoro.status.breakPrompt",{length:s})}else this.statusDisplay.textContent=this.t("views.pomodoro.status.breakComplete")}}});function SM(r){if(r.activePeriods&&Array.isArray(r.activePeriods))return r.activePeriods.filter(e=>e.endTime).reduce((e,t)=>{let n=new Date(t.startTime),s=new Date(t.endTime).getTime()-n.getTime();return e+Math.round(s/(1e3*60))},0);if(r.duration!==void 0)return r.duration;if(r.startTime&&r.endTime){let e=new Date(r.startTime),n=new Date(r.endTime).getTime()-e.getTime();return Math.round(n/(1e3*60))}return 0}var Nfe,xM=v(()=>{Nfe=` let timerInterval; self.onmessage = function(e) { const { command, duration } = e.data; if (command === 'start') { if (timerInterval) { clearInterval(timerInterval); } let timeRemaining = duration; timerInterval = setInterval(() => { timeRemaining--; // Notificar al hilo principal cada segundo para actualizar la UI self.postMessage({ type: 'tick', timeRemaining: timeRemaining }); if (timeRemaining <= 0) { self.postMessage({ type: 'done' }); clearInterval(timerInterval); timerInterval = null; } }, 1000); } else if (command === 'stop') { if (timerInterval) { clearInterval(timerInterval); timerInterval = null; } } }; `});function ix(r){return[...r].sort((e,t)=>new Date(e.startTime).getTime()-new Date(t.startTime).getTime())}function j4e(r){var n;let e=(n=r.match(/^(\d{4}-\d{2}-\d{2})(?:[T\s]|$)/))==null?void 0:n[1];if(e)return e;let t=new Date(r);return isNaN(t.getTime())?"":ue(t)}function sx(r){return j4e(r.startTime)}function Rfe(r,e){return e?r.filter(t=>sx(t)===e):[]}function Ofe(r,e,t){let n=ue(e),i=ue(t);if(!n||!i)return[];let[s,a]=n<=i?[n,i]:[i,n];return r.filter(o=>{let l=sx(o);return l>=s&&l<=a})}function Lfe(r,e){let t=ue(r),n=ue(e);if(!t||!n)return[];let[i,s]=t<=n?[t,n]:[n,t],[a,o,l]=i.split("-").map(Number),[c,d,u]=s.split("-").map(Number),p=new Date(Date.UTC(a,o-1,l)),m=new Date(Date.UTC(c,d-1,u)),f=[];for(;p<=m;)f.push(ue(p)),p.setUTCDate(p.getUTCDate()+1);return f}function rv(r){let e=ix(r).filter(o=>o.type==="work"),t=e.filter(o=>o.completed),n=0;for(let o=e.length-1;o>=0&&e[o].completed;o--)n++;let i=t.reduce((o,l)=>o+SM(l),0),s=t.length>0?i/t.length:0,a=e.length>0?t.length/e.length*100:0;return{pomodorosCompleted:t.length,currentStreak:n,totalMinutes:i,averageSessionLength:Math.round(s),completionRate:Math.round(a)}}var R2=v(()=>{Qe();xM()});function z4e(r){return Number.isInteger(r)&&r>=0&&r<=6}var _d,EM,Ffe=v(()=>{_d=require("obsidian");Tn();On();Qe();xM();R2();EM=class extends _d.ItemView{constructor(t,n){super(t);this.overviewStatsEl=null;this.todayStatsEl=null;this.weekStatsEl=null;this.recentSessionsEl=null;this.overallStatsEl=null;this.plugin=n}getViewType(){return cg}getDisplayText(){return this.plugin.i18n.translate("views.pomodoroStats.title")}getIcon(){return"bar-chart"}t(t,n){return this.plugin.i18n.translate(t,n)}async onOpen(){await this.plugin.onReady(),await this.waitForPomodoroService(),await this.render()}async onClose(){this.contentEl.empty()}async render(){this.contentEl.empty();let t=this.contentEl.createDiv({cls:"tasknotes-plugin tasknotes-container pomodoro-stats-container pomodoro-stats-view"}),n=t.createDiv({cls:"pomodoro-stats-header pomodoro-stats-view__header"});new _d.Setting(n).setName(this.t("views.pomodoroStats.heading")).setHeading();let i=n.createEl("button",{cls:"pomodoro-stats-refresh-button pomodoro-stats-view__refresh-button",text:this.t("views.pomodoroStats.refresh")});this.registerDomEvent(i,"click",()=>{this.refreshStats()});let s=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new _d.Setting(s).setName(this.t("views.pomodoroStats.sections.overview")).setHeading(),this.overviewStatsEl=s.createDiv({cls:"pomodoro-overview-grid pomodoro-stats-view__overview-grid"});let a=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new _d.Setting(a).setName(this.t("views.pomodoroStats.sections.today")).setHeading(),this.todayStatsEl=a.createDiv({cls:"pomodoro-stats-grid pomodoro-stats-view__stats-grid"});let o=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new _d.Setting(o).setName(this.t("views.pomodoroStats.sections.week")).setHeading(),this.weekStatsEl=o.createDiv({cls:"pomodoro-stats-grid pomodoro-stats-view__stats-grid"});let l=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new _d.Setting(l).setName(this.t("views.pomodoroStats.sections.allTime")).setHeading(),this.overallStatsEl=l.createDiv({cls:"pomodoro-stats-grid pomodoro-stats-view__stats-grid"});let c=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new _d.Setting(c).setName(this.t("views.pomodoroStats.sections.recent")).setHeading(),this.recentSessionsEl=c.createDiv({cls:"pomodoro-recent-sessions pomodoro-stats-view__recent-sessions"}),await this.refreshStats()}async waitForPomodoroService(){let t=Date.now();for(;!this.plugin.pomodoroService&&Date.now()-t<5e3;)await new Promise(n=>window.setTimeout(n,50))}async refreshStats(){try{if(!this.plugin.pomodoroService)return;let t=kr(),n=en(t),i=new Date(t);i.setDate(i.getDate()-1);let s=en(i),a=this.plugin.settings.calendarViewSettings.firstDay||0,l={weekStartsOn:z4e(a)?a:0},c=Xi(n,l),d=tg(n,l),[u,p,m,f]=await Promise.all([this.plugin.pomodoroService.getTodayStats(),this.plugin.pomodoroService.getStatsForDate(s),this.plugin.pomodoroService.getStatsForDateRange(c,d),this.plugin.pomodoroService.getSessionHistory()]),h=rv(f);this.overviewStatsEl&&this.renderOverviewStats(this.overviewStatsEl,u,h,p),this.todayStatsEl&&this.renderStatsGrid(this.todayStatsEl,u),this.weekStatsEl&&this.renderStatsGrid(this.weekStatsEl,m),this.overallStatsEl&&this.renderStatsGrid(this.overallStatsEl,h),this.recentSessionsEl&&this.renderRecentSessions(this.recentSessionsEl,f)}catch(t){console.error("Failed to refresh stats:",t)}}renderRecentSessions(t,n){var s;let i=n.filter(a=>a.type==="work").slice(-10).reverse();if(t.empty(),i.length===0){t.createDiv({cls:"pomodoro-no-sessions pomodoro-stats-view__no-sessions",text:this.t("views.pomodoroStats.recents.empty")});return}for(let a of i){let o=t.createDiv({cls:"pomodoro-session-item pomodoro-stats-view__session-item"}),l=o.createSpan({cls:"session-date pomodoro-stats-view__session-date"}),c=this.plugin.settings.calendarViewSettings.timeFormat;l.textContent=P(new Date(a.startTime),c==="12"?"MMM d, h:mm a":"MMM d, HH:mm");let d=o.createSpan({cls:"session-duration pomodoro-stats-view__session-duration"}),u=SM(a);d.textContent=this.t("views.pomodoroStats.recents.duration",{minutes:u});let p=o.createSpan({cls:"session-status pomodoro-stats-view__session-status"});if(p.textContent=this.t(a.completed?"views.pomodoroStats.recents.status.completed":"views.pomodoroStats.recents.status.interrupted"),p.addClass(a.completed?"status-completed":"status-interrupted"),p.addClass(a.completed?"pomodoro-stats-view__session-status--completed":"pomodoro-stats-view__session-status--interrupted"),a.taskPath){let m=o.createSpan({cls:"session-task pomodoro-stats-view__session-task"}),f=((s=a.taskPath.split("/").pop())==null?void 0:s.replace(".md",""))||"";m.textContent=f}}}renderOverviewStats(t,n,i,s){t.empty();let a=y=>{if(y<60)return`${y}m`;let k=Math.floor(y/60),T=y%60;return T>0?`${k}h${T}m`:`${k}h`},o=n.pomodorosCompleted-s.pomodorosCompleted,l=n.totalMinutes-s.totalMinutes,c=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),d=c.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});if(d.textContent=n.pomodorosCompleted.toString(),c.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.todayPomos.label")}),o!==0){let y=c.createDiv({cls:"overview-change pomodoro-stats-view__overview-change"});y.textContent=o>0?this.t("views.pomodoroStats.overviewCards.todayPomos.change.more",{count:o}):this.t("views.pomodoroStats.overviewCards.todayPomos.change.less",{count:Math.abs(o)}),y.addClass(o>0?"positive":"negative")}let u=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),p=u.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});p.textContent=i.pomodorosCompleted.toString(),u.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.totalPomos.label")});let m=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),f=m.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});if(f.textContent=a(n.totalMinutes),m.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.todayFocus.label")}),l!==0){let y=m.createDiv({cls:"overview-change pomodoro-stats-view__overview-change"});y.textContent=l>0?this.t("views.pomodoroStats.overviewCards.todayFocus.change.more",{duration:a(Math.abs(l))}):this.t("views.pomodoroStats.overviewCards.todayFocus.change.less",{duration:a(Math.abs(l))}),y.addClass(l>0?"positive":"negative")}let h=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),g=h.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});g.textContent=a(i.totalMinutes),h.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.totalFocus.label")})}renderStatsGrid(t,n){t.empty();let i=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});i.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.pomodorosCompleted.toString()}),i.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.pomodoros")});let s=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});s.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.currentStreak.toString()}),s.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.streak")});let a=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});a.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.totalMinutes.toString()}),a.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.minutes")});let o=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});o.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.averageSessionLength.toString()}),o.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.average")});let l=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});l.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:`${n.completionRate}%`}),l.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.completion")})}}});function B4e(r){return Number.isInteger(r)&&r>=0&&r<=6}var co,DM,$fe=v(()=>{co=require("obsidian");Tn();On();Cr();Qe();$i();hd();Bo();DM=class extends co.ItemView{constructor(t,n){super(t);this.overviewStatsEl=null;this.todayStatsEl=null;this.weekStatsEl=null;this.monthStatsEl=null;this.projectsStatsEl=null;this.filtersEl=null;this.currentFilters={dateRange:"all",selectedProjects:[],minTimeSpent:0};this.drilldownModal=null;this.currentDrilldownData=null;this.listeners=[];this.statsCache=new Map;this.lastCacheTime=0;this.CACHE_DURATION=6e4;this.debounceTimeout=null;this.plugin=n}getViewType(){return dg}getDisplayText(){return this.plugin.i18n.translate("views.stats.title")}getIcon(){return"bar-chart-4"}async onOpen(){await this.plugin.onReady();let t=this.plugin.emitter.on(Vt,async({path:n,originalTask:i,updatedTask:s})=>{if(!n||!s||!this.drilldownModal||!this.currentDrilldownData)return;this.currentDrilldownData.tasks.some(o=>o.path===n||i&&o.path===i.path)&&await this.refreshDrilldownModal()});this.listeners.push(t),await this.render()}async onClose(){this.contentEl.empty(),this.listeners.forEach(t=>this.plugin.emitter.offref(t)),this.listeners=[]}async render(){let t=this.contentEl.createDiv({cls:"tasknotes-plugin tasknotes-container stats-container stats-view"}),n=t.createDiv({cls:"stats-header stats-view__header"});new co.Setting(n).setName(this.plugin.i18n.translate("views.stats.taskProjectStats")).setHeading();let i=n.createEl("button",{cls:"stats-refresh-button stats-view__refresh-button",text:this.plugin.i18n.translate("views.stats.refreshButton")});this.registerDomEvent(i,"click",()=>{this.refreshStats()});let s=t.createDiv({cls:"stats-section stats-view__section"});new co.Setting(s).setName(this.plugin.i18n.translate("views.stats.sections.filters")).setHeading(),this.filtersEl=s.createDiv({cls:"stats-filters stats-view__filters"}),this.renderFilters();let a=t.createDiv({cls:"stats-section stats-view__section"});new co.Setting(a).setName(this.plugin.i18n.translate("views.stats.sections.overview")).setHeading(),this.overviewStatsEl=a.createDiv({cls:"stats-overview-grid stats-view__overview-grid"});let o=t.createDiv({cls:"stats-section stats-view__section"});new co.Setting(o).setName(this.plugin.i18n.translate("views.stats.sections.today")).setHeading(),this.todayStatsEl=o.createDiv({cls:"stats-grid stats-view__stats-grid"});let l=t.createDiv({cls:"stats-section stats-view__section"});new co.Setting(l).setName(this.plugin.i18n.translate("views.stats.sections.thisWeek")).setHeading(),this.weekStatsEl=l.createDiv({cls:"stats-grid stats-view__stats-grid"});let c=t.createDiv({cls:"stats-section stats-view__section"});new co.Setting(c).setName(this.plugin.i18n.translate("views.stats.sections.thisMonth")).setHeading(),this.monthStatsEl=c.createDiv({cls:"stats-grid stats-view__stats-grid"});let d=t.createDiv({cls:"stats-section stats-view__section"});new co.Setting(d).setName(this.plugin.i18n.translate("views.stats.sections.projectBreakdown")).setHeading(),this.projectsStatsEl=d.createDiv({cls:"stats-projects stats-view__projects"}),await this.refreshStats()}async refreshStats(){try{this.clearCache();let t=await Promise.allSettled([this.updateOverviewStats(),this.updateTodayStats(),this.updateWeekStats(),this.updateMonthStats(),this.updateProjectStats()])}catch(t){}}async getAllTasks(){let t=`all-tasks-${JSON.stringify(this.currentFilters)}`;if(this.isCacheValid()&&this.statsCache.has(t)){let s=this.statsCache.get(t);if(s)return s}let n=this.plugin.cacheManager.getAllTaskPaths(),i=[];for(let s of n)try{let a=await this.plugin.cacheManager.getTaskInfo(s);a&&i.push(a)}catch(a){}return i=this.applyTaskFilters(i),this.statsCache.set(t,i),this.lastCacheTime=Date.now(),i}applyTaskFilters(t){let n=t,i=this.getFilterDateRange();return(i.start||i.end)&&(n=n.filter(s=>{if(s.timeEntries&&s.timeEntries.length>0)return s.timeEntries.some(a=>{if(!a.startTime)return!1;let o=new Date(a.startTime);return!(i.start&&oi.end)});if(s.completedDate){let a=new Date(s.completedDate);return!(i.start&&ai.end)}if(s.dateCreated){let a=new Date(s.dateCreated);return!(i.start&&ai.end)}return!(i.start||i.end)})),this.currentFilters.minTimeSpent>0&&(n=n.filter(s=>is(s.timeEntries||[])>=this.currentFilters.minTimeSpent)),n}async updateOverviewStats(){if(!this.overviewStatsEl)return;let t=await this.getAllTasks(),n=this.calculateOverallStats(t);this.renderOverviewStats(this.overviewStatsEl,n)}async updateTodayStats(){if(!this.todayStatsEl)return;let t=kr(),n=await this.calculateStatsForRange(Oo(t),Hb(t));this.renderTimeRangeStats(this.todayStatsEl,n)}async updateWeekStats(){if(!this.weekStatsEl)return;let t=kr(),n=this.plugin.settings.calendarViewSettings.firstDay||0,s={weekStartsOn:B4e(n)?n:0},a=Xi(t,s),o=tg(t,s),l=await this.calculateStatsForRange(a,o);this.renderTimeRangeStats(this.weekStatsEl,l)}async updateMonthStats(){if(!this.monthStatsEl)return;let t=kr(),n=cD(t),i=lD(t),s=await this.calculateStatsForRange(n,i);this.renderTimeRangeStats(this.monthStatsEl,s)}async updateProjectStats(){if(!this.projectsStatsEl)return;let t=await this.getAllTasks(),n=this.calculateProjectStats(t);await this.renderProjectStats(this.projectsStatsEl,n)}consolidateProjectName(t){var n;if(!t||typeof t!="string")return t;if(t.startsWith("[[")&&t.endsWith("]]")){let i=this.extractWikilinkPath(t);if(i&&((n=this.plugin)!=null&&n.app)){let s=this.plugin.app.metadataCache.getFirstLinkpathDest(i,"");if(s)return s.basename;let a=this.extractProjectName(t);if(a)return a}}if(t.includes("|")){let i=t.split("|");return i[i.length-1]||t}if(t.includes("/")){let i=t.split("/");return i[i.length-1]||t}return t}extractWikilinkPath(t){if(!t||typeof t!="string"||!t.startsWith("[[")||!t.endsWith("]]"))return null;let n=t.slice(2,-2);return(0,co.parseLinktext)(n).path}extractProjectName(t){var i;return t&&bg(t,(i=this.plugin)==null?void 0:i.app)||null}calculateOverallStats(t){let n=0,i=0,s=0,a=new Set;for(let o of t){n+=is(o.timeEntries||[]),i+=o.timeEstimate||0,this.plugin.statusManager.isCompletedStatus(o.status)&&s++;let l=this.getTaskProjects(o);for(let c of l)a.add(c)}return{totalTimeSpent:n,totalTimeEstimate:i,totalTasks:t.length,completedTasks:s,activeProjects:a.size,completionRate:t.length>0?s/t.length*100:0,avgTimePerTask:t.length>0?n/t.length:0}}async calculateStatsForRange(t,n){let s=(await this.getAllTasks()).filter(l=>{if(l.timeEntries&&l.timeEntries.length>0)return l.timeEntries.some(c=>{if(!c.startTime)return!1;let d=new Date(c.startTime);return d>=t&&d<=n});if(l.completedDate){let c=new Date(l.completedDate);return c>=t&&c<=n}if(l.dateCreated){let c=new Date(l.dateCreated);return c>=t&&c<=n}return!1}),a=this.calculateOverallStats(s),o=this.calculateProjectStats(s);return{overall:a,projects:o}}calculateProjectStats(t){let n=new Map;for(let a of t){let o=is(a.timeEntries||[]),l=a.timeEstimate||0,c=this.plugin.statusManager.isCompletedStatus(a.status),d;a.timeEntries&&a.timeEntries.length>0?d=[...a.timeEntries].sort((m,f)=>new Date(f.startTime).getTime()-new Date(m.startTime).getTime())[0].startTime:a.completedDate?d=a.completedDate:a.dateModified&&(d=a.dateModified);let u=this.getTaskProjects(a);for(let p of u){n.has(p)||n.set(p,{tasks:[],totalTime:0,totalTimeEstimate:0,completedCount:0,lastActivity:void 0});let m=n.get(p);m&&(m.tasks.push(a),m.totalTime+=o,m.totalTimeEstimate+=l,c&&m.completedCount++,d&&(!m.lastActivity||new Date(d)>new Date(m.lastActivity))&&(m.lastActivity=d))}}let i=[];for(let[a,o]of n.entries())i.push({projectName:a,totalTimeSpent:o.totalTime,totalTimeEstimate:o.totalTimeEstimate,taskCount:o.tasks.length,completedTaskCount:o.completedCount,avgTimePerTask:o.tasks.length>0?o.totalTime/o.tasks.length:0,lastActivity:o.lastActivity});let s=this.plugin.i18n.translate("views.stats.noProject");return i.sort((a,o)=>a.projectName===s?1:o.projectName===s?-1:o.totalTimeSpent-a.totalTimeSpent),i}renderFilters(){if(!this.filtersEl)return;this.filtersEl.empty();let t=this.filtersEl.createDiv({cls:"stats-view__filter-grid"}),n=t.createDiv({cls:"stats-view__filter-item"}),i=n.createDiv({cls:"stats-view__filter-label"});i.textContent=this.plugin.i18n.translate("views.stats.sections.dateRange");let s=n.createEl("select",{cls:"stats-view__filter-select"}),a=[{value:"all",text:this.plugin.i18n.translate("views.stats.timeRanges.allTime")},{value:"7days",text:this.plugin.i18n.translate("views.stats.timeRanges.last7Days")},{value:"30days",text:this.plugin.i18n.translate("views.stats.timeRanges.last30Days")},{value:"90days",text:this.plugin.i18n.translate("views.stats.timeRanges.last90Days")},{value:"custom",text:this.plugin.i18n.translate("views.stats.timeRanges.customRange")}];for(let m of a){let f=s.createEl("option",{value:m.value,text:m.text});m.value===this.currentFilters.dateRange&&(f.selected=!0)}this.registerDomEvent(s,"change",()=>{this.currentFilters.dateRange=s.value,this.renderCustomDateInputs(),this.applyFilters()});let o=t.createDiv({cls:"stats-view__custom-dates"});this.currentFilters.dateRange==="custom"&&this.renderCustomDateInputs(o);let l=t.createDiv({cls:"stats-view__filter-item"}),c=l.createDiv({cls:"stats-view__filter-label"});c.textContent=this.plugin.i18n.translate("views.stats.filters.minTime");let d=l.createEl("input",{cls:"stats-view__filter-input",type:"number",value:this.currentFilters.minTimeSpent.toString(),placeholder:"0"});this.registerDomEvent(d,"input",()=>{this.currentFilters.minTimeSpent=parseInt(d.value)||0,this.applyFilters()});let p=t.createDiv({cls:"stats-view__filter-buttons"}).createEl("button",{cls:"stats-view__filter-button stats-view__filter-button--reset",text:this.plugin.i18n.translate("views.stats.resetFiltersButton")});this.registerDomEvent(p,"click",()=>{this.currentFilters={dateRange:"all",selectedProjects:[],minTimeSpent:0},this.renderFilters(),this.applyFilters()})}renderCustomDateInputs(t){var i;let n=t||((i=this.filtersEl)==null?void 0:i.querySelector(".stats-view__custom-dates"));if(n&&(n.empty(),this.currentFilters.dateRange==="custom")){let s=n.createDiv({cls:"stats-view__date-input-container"});s.createDiv({cls:"stats-view__date-label",text:this.plugin.i18n.translate("views.stats.dateRangeFrom")});let a=s.createEl("input",{cls:"stats-view__date-input",type:"date",value:this.currentFilters.customStartDate||""}),o=n.createDiv({cls:"stats-view__date-input-container"});o.createDiv({cls:"stats-view__date-label",text:this.plugin.i18n.translate("views.stats.dateRangeTo")});let l=o.createEl("input",{cls:"stats-view__date-input",type:"date",value:this.currentFilters.customEndDate||""});this.registerDomEvent(a,"change",()=>{this.currentFilters.customStartDate=a.value,this.applyFilters()}),this.registerDomEvent(l,"change",()=>{this.currentFilters.customEndDate=l.value,this.applyFilters()})}}async applyFilters(){this.debounceTimeout&&window.clearTimeout(this.debounceTimeout),this.debounceTimeout=window.setTimeout(()=>{(async()=>(await this.refreshStats(),this.debounceTimeout=null))()},300)}isCacheValid(){return Date.now()-this.lastCacheTime0?n.map(i=>this.consolidateProjectName(i)).filter(i=>typeof i=="string"&&i.length>0):[this.plugin.i18n.translate("views.stats.noProject")]}catch(n){return[this.plugin.i18n.translate("views.stats.noProject")]}}getFilterDateRange(){let t=kr();switch(this.currentFilters.dateRange){case"7days":return{start:Oo(sg(t,7)),end:Hb(t)};case"30days":return{start:Oo(sg(t,30)),end:Hb(t)};case"90days":return{start:Oo(sg(t,90)),end:Hb(t)};case"custom":return{start:this.currentFilters.customStartDate?new Date(`${this.currentFilters.customStartDate}T00:00:00`):void 0,end:this.currentFilters.customEndDate?new Date(`${this.currentFilters.customEndDate}T23:59:59.999`):void 0};case"all":default:return{}}}renderOverviewStats(t,n){t.empty();let i=h=>{if(h<60)return`${Math.round(h)}m`;let g=Math.floor(h/60),y=Math.round(h%60);return y>0?`${g}h ${y}m`:`${g}h`},s=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),a=s.createDiv({cls:"overview-value stats-view__overview-value"});a.textContent=`${i(n.totalTimeSpent)} / ${i(n.totalTimeEstimate)}`,s.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.timeTrackedEstimated")});let o=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),l=o.createDiv({cls:"overview-value stats-view__overview-value"});l.textContent=n.totalTasks.toString(),o.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.totalTasks")});let c=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),d=c.createDiv({cls:"overview-value stats-view__overview-value"});d.textContent=`${Math.round(n.completionRate)}%`,c.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.completionRate")});let u=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),p=u.createDiv({cls:"overview-value stats-view__overview-value"});p.textContent=n.activeProjects.toString(),u.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.activeProjects")});let m=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),f=m.createDiv({cls:"overview-value stats-view__overview-value"});f.textContent=i(n.avgTimePerTask),m.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.avgTimePerTask")})}renderTimeRangeStats(t,n){t.empty();let i=c=>{if(c<60)return`${Math.round(c)}m`;let d=Math.floor(c/60),u=Math.round(c%60);return u>0?`${d}h ${u}m`:`${d}h`},s=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});s.createDiv({cls:"stat-value stats-view__stat-value",text:`${i(n.overall.totalTimeSpent)} / ${i(n.overall.totalTimeEstimate)}`}),s.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.cards.timeTrackedEstimated")});let a=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});a.createDiv({cls:"stat-value stats-view__stat-value",text:n.overall.totalTasks.toString()}),a.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.labels.tasks")});let o=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});o.createDiv({cls:"stat-value stats-view__stat-value",text:n.overall.completedTasks.toString()}),o.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.labels.completed")});let l=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});l.createDiv({cls:"stat-value stats-view__stat-value",text:n.overall.activeProjects.toString()}),l.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.labels.projects")})}async renderProjectStats(t,n){if(t.empty(),n.length===0){t.createDiv({cls:"stats-no-data stats-view__no-data",text:this.plugin.i18n.translate("views.stats.noProjectData")});return}let i=a=>{if(a<60)return`${Math.round(a)}m`;let o=Math.floor(a/60),l=Math.round(a%60);return l>0?`${o}h ${l}m`:`${o}h`},s=a=>{if(!a)return this.plugin.i18n.translate("views.stats.notAvailable");try{let o=new Date(a);return P(o,"MMM d, yyyy")}catch(o){return this.plugin.i18n.translate("views.stats.notAvailable")}};for(let a of n){let o=["stats-project-item","stats-view__project-item","stats-view__project-item--clickable"];a.projectName===this.plugin.i18n.translate("views.stats.noProject")&&o.push("stats-view__project-item--no-project");let l=t.createDiv({cls:o.join(" ")});this.registerDomEvent(l,"click",()=>{this.openProjectDrilldown(a.projectName)});let c=l.createDiv({cls:"stats-view__project-header"}),d=c.createDiv({cls:"project-name stats-view__project-name"});d.textContent=a.projectName,c.createDiv({cls:"stats-view__click-indicator",text:"\u2192"});let u=a.taskCount>0?a.completedTaskCount/a.taskCount*100:0,p=l.createDiv({cls:"stats-view__project-content-grid"}),m=p.createDiv({cls:"stats-view__progress-container"});this.renderProgressCircle(m,u,a.completedTaskCount,a.taskCount);let f=p.createDiv({cls:"stats-view__stats-container"});if(a.totalTimeSpent>0||a.totalTimeEstimate>0){let k=f.createDiv({cls:"stats-view__time-bar"}),w=k.createDiv({cls:"stats-view__time-bar-visual"}).createDiv({cls:"stats-view__time-bar-fill"}),S=0;a.totalTimeEstimate>0?S=a.totalTimeSpent/a.totalTimeEstimate*100:a.totalTimeSpent>0&&(S=100,w.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-red-134bc721","tn-static-background-color-var-text-accent-a954c70f"),w.classList.add("tn-static-background-color-var-color-base-40-ef5f175e")),w.style.width=`${Math.min(S,100)}%`,S>100&&(w.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-text-accent-a954c70f"),w.classList.add("tn-static-background-color-var-color-red-134bc721"));let E=k.createDiv({cls:"stats-view__time-bar-label"});E.textContent=`${i(a.totalTimeSpent)} / ${i(a.totalTimeEstimate)}`}let h=f.createDiv({cls:"project-stats stats-view__project-stats"});if(a.lastActivity){let k=h.createDiv({cls:"project-stat stats-view__project-stat"});k.textContent=`Last activity: ${s(a.lastActivity)}`}if(a.avgTimePerTask>0){let k=h.createDiv({cls:"project-stat stats-view__project-stat"});k.textContent=`Avg: ${i(a.avgTimePerTask)}/task`}let g=f.createDiv({cls:"stats-view__trend-container"}),y=g.createDiv({cls:"stats-view__sparkline"});try{let k=await this.calculateProjectTrend(a.projectName);k.length>0&&k.some(T=>T.value>0)?this.renderSparkline(y,k):g.remove()}catch(k){g.remove()}}}renderProgressCircle(t,n,i,s){let c=2*Math.PI*27.5,d=c-n/100*c,u=activeDocument.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("width","60"),u.setAttribute("height","60"),u.setAttribute("viewBox","0 0 60 60"),u.classList.add("stats-view__progress-circle-svg");let p=activeDocument.createElementNS("http://www.w3.org/2000/svg","circle");p.setAttribute("cx",(60/2).toString()),p.setAttribute("cy",(60/2).toString()),p.setAttribute("r",27.5.toString()),p.classList.add("stats-view__progress-circle-bg");let m=activeDocument.createElementNS("http://www.w3.org/2000/svg","circle");m.setAttribute("cx",(60/2).toString()),m.setAttribute("cy",(60/2).toString()),m.setAttribute("r",27.5.toString()),m.setAttribute("stroke-dasharray",`${c} ${c}`),m.setAttribute("stroke-dashoffset",d.toString()),m.classList.add("stats-view__progress-circle-fg");let f=activeDocument.createElementNS("http://www.w3.org/2000/svg","text");f.setAttribute("x","50%"),f.setAttribute("y","50%"),f.setAttribute("dy","0.3em"),f.setAttribute("text-anchor","middle"),f.classList.add("stats-view__progress-circle-text"),f.textContent=`${Math.round(n)}%`,u.appendChild(p),u.appendChild(m),u.appendChild(f),t.appendChild(u);let h=t.createDiv({cls:"stats-view__progress-label"});h.textContent=`${i}/${s} tasks`}async calculateProjectTrend(t){try{let n=this.plugin.cacheManager.getAllTaskPaths(),i=[];for(let o of n)try{let l=await this.plugin.cacheManager.getTaskInfo(o);l&&this.getTaskProjects(l).includes(t)&&i.push(l)}catch(l){}let s=[],a=kr();for(let o=29;o>=0;o--){let l=sg(a,o),c=P(l,"yyyy-MM-dd"),d=0;for(let u of i)if(u.timeEntries)for(let p of u.timeEntries)p.startTime&&P(new Date(p.startTime),"yyyy-MM-dd")===c&&(d+=is([p]));s.push({date:c,value:d})}return s}catch(n){return[]}}renderSparkline(t,n){if(t.empty(),n.length===0)return;let i=100,s=20,a=Math.max(...n.map(d=>d.value));if(a===0)return;let o=activeDocument.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width",i.toString()),o.setAttribute("height",s.toString()),o.setAttribute("viewBox",`0 0 ${i} ${s}`),o.classList.add("stats-view__sparkline-svg");let l=activeDocument.createElementNS("http://www.w3.org/2000/svg","path"),c="";n.forEach((d,u)=>{let p=u/(n.length-1)*i,m=s-d.value/a*s;u===0?c+=`M ${p} ${m}`:c+=` L ${p} ${m}`}),l.setAttribute("d",c),l.setAttribute("fill","none"),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","1.5"),l.setAttribute("opacity","0.7"),o.appendChild(l),t.appendChild(o)}async openProjectDrilldown(t){this.closeDrilldownModal();let n=this.contentEl.ownerDocument,i=n.body.createDiv({cls:"stats-view__modal-backdrop"});this.drilldownModal=i;let s=i.createDiv({cls:"stats-view__modal tasknotes-plugin"}),a=s.createDiv({cls:"stats-view__modal-header"}),o=a.createDiv({cls:"stats-view__modal-title"});o.textContent=`${t} - Detailed View`;let l=a.createEl("button",{cls:"stats-view__modal-close",text:"\xD7"}),c=s.createDiv({cls:"stats-view__modal-content"});c.textContent=this.plugin.i18n.translate("views.stats.loading"),this.registerDomEvent(l,"click",()=>this.closeDrilldownModal()),this.registerDomEvent(i,"click",u=>{u.target===i&&this.closeDrilldownModal()});let d=u=>{u.key==="Escape"&&(this.closeDrilldownModal(),n.removeEventListener("keydown",d))};n.addEventListener("keydown",d);try{let u=await this.getProjectDrilldownData(t);this.currentDrilldownData=u,this.renderDrilldownContent(c,u)}catch(u){console.error("Error loading drill-down data:",u),c.textContent=this.plugin.i18n.translate("notices.statsLoadingFailed")}}closeDrilldownModal(){this.drilldownModal&&(this.drilldownModal.remove(),this.drilldownModal=null,this.currentDrilldownData=null)}async refreshDrilldownModal(){if(!this.drilldownModal||!this.currentDrilldownData)return;let t=this.drilldownModal.querySelector(".stats-view__modal-content");if(t)try{let n=await this.getProjectDrilldownData(this.currentDrilldownData.projectName);this.currentDrilldownData=n,this.renderDrilldownContent(t,n)}catch(n){console.error("Error refreshing drill-down modal:",n)}}async getProjectDrilldownData(t){var p;let n=this.plugin.cacheManager.getAllTaskPaths(),i=[];for(let m of n)try{let f=await this.plugin.cacheManager.getTaskInfo(m);f&&this.getTaskProjects(f).includes(t)&&i.push(f)}catch(f){console.error(`Failed to get task for drill-down: ${m}`,f)}let s=i.reduce((m,f)=>m+is(f.timeEntries||[]),0),a=i.reduce((m,f)=>m+(f.timeEstimate||0),0),o=i.filter(m=>this.plugin.statusManager.isCompletedStatus(m.status)).length,l=i.length>0?o/i.length*100:0,c=i.filter(m=>{var f;return((f=m.timeEntries)==null?void 0:f.length)||m.completedDate}).sort((m,f)=>{var y,k;let h=(y=m.timeEntries)!=null&&y.length?Math.max(...m.timeEntries.map(T=>new Date(T.startTime).getTime())):m.completedDate?new Date(m.completedDate).getTime():0;return((k=f.timeEntries)!=null&&k.length?Math.max(...f.timeEntries.map(T=>new Date(T.startTime).getTime())):f.completedDate?new Date(f.completedDate).getTime():0)-h}).slice(0,10),d=[],u=kr();for(let m=29;m>=0;m--){let f=sg(u,m),h=P(f,"yyyy-MM-dd"),g=0,y=0,k=0;for(let T of i){if(T.timeEntries){let w=T.timeEntries.filter(S=>P(new Date(S.startTime),"yyyy-MM-dd")===h);w.length>0&&(g+=is(w),y++)}T.completedDate&&P(new Date(T.completedDate),"yyyy-MM-dd")===h&&(k++,(p=T.timeEntries)!=null&&p.some(w=>P(new Date(w.startTime),"yyyy-MM-dd")===h)||y++)}d.push({date:h,timeSpent:g,taskCount:y,completedTasks:k})}return{projectName:t,tasks:i,totalTimeSpent:s,totalTimeEstimate:a,completionRate:l,timeByDay:d,recentActivity:c}}renderDrilldownContent(t,n){t.empty();let i=S=>{if(S<60)return`${Math.round(S)}m`;let E=Math.floor(S/60),C=Math.round(S%60);return C>0?`${E}h ${C}m`:`${E}h`},a=t.createDiv({cls:"stats-view__drilldown-overview"}).createDiv({cls:"stats-view__drilldown-stats"}),o=a.createDiv({cls:"stats-view__drilldown-card"});o.createDiv({cls:"stats-view__drilldown-value",text:`${i(n.totalTimeSpent)} / ${i(n.totalTimeEstimate)}`}),o.createDiv({cls:"stats-view__drilldown-label",text:"Total Time"});let l=a.createDiv({cls:"stats-view__drilldown-card"});l.createDiv({cls:"stats-view__drilldown-value",text:n.tasks.length.toString()}),l.createDiv({cls:"stats-view__drilldown-label",text:"Total Tasks"});let c=a.createDiv({cls:"stats-view__drilldown-card"});c.createDiv({cls:"stats-view__drilldown-value",text:`${Math.round(n.completionRate)}%`}),c.createDiv({cls:"stats-view__drilldown-label",text:"Completed"});let d=a.createDiv({cls:"stats-view__drilldown-card"}),u=n.tasks.length>0?n.totalTimeSpent/n.tasks.length:0,p=n.tasks.length>0?n.totalTimeEstimate/n.tasks.length:0;d.createDiv({cls:"stats-view__drilldown-value",text:`${i(u)} / ${i(p)}`}),d.createDiv({cls:"stats-view__drilldown-label",text:"Avg per Task"});let m=t.createDiv({cls:"stats-view__drilldown-section"});m.createDiv({cls:"stats-view__drilldown-heading",text:"Activity Over Time (Last 30 Days)"});let f=m.createDiv({cls:"stats-view__activity-chart"});this.renderActivityChart(f,n.timeByDay);let h=t.createDiv({cls:"stats-view__drilldown-section"}),g=h.createDiv({cls:"stats-view__section-header"});g.createDiv({cls:"stats-view__drilldown-heading",text:"All Project Tasks"});let k=g.createDiv({cls:"stats-view__task-filters"}).createEl("select",{cls:"stats-view__filter-select"});k.createEl("option",{value:"all",text:this.plugin.i18n.translate("views.stats.filters.allTasks")}),k.createEl("option",{value:"active",text:this.plugin.i18n.translate("views.stats.filters.activeOnly")}),k.createEl("option",{value:"completed",text:this.plugin.i18n.translate("views.stats.filters.completedOnly")});let T=h.createDiv({cls:"stats-view__task-list"}),w=(S="all")=>{T.empty();let E=n.tasks;if(S==="active"?E=n.tasks.filter(D=>!this.plugin.statusManager.isCompletedStatus(D.status)):S==="completed"&&(E=n.tasks.filter(D=>this.plugin.statusManager.isCompletedStatus(D.status))),E.sort((D,A)=>{let N=this.plugin.statusManager.isCompletedStatus(D.status),V=this.plugin.statusManager.isCompletedStatus(A.status);if(N!==V)return N?1:-1;let R=I=>{var O;return(O=I.timeEntries)!=null&&O.length?Math.max(...I.timeEntries.map(z=>new Date(z.startTime).getTime())):I.dateModified?new Date(I.dateModified).getTime():0};return R(A)-R(D)}),E.length===0){T.createDiv({cls:"stats-view__no-data",text:this.plugin.i18n.translate("views.stats.noTasks")});return}let C=T.createDiv({cls:"stats-view__task-count"});C.textContent=`Showing ${E.length} task${E.length!==1?"s":""}`;for(let D of E){let A=this.plugin.settings.defaultVisibleProperties?Fi(this.plugin.settings.defaultVisibleProperties,this.plugin):void 0,N=pr(D,this.plugin,A);T.appendChild(N)}};w("all"),this.registerDomEvent(k,"change",()=>{w(k.value)})}renderActivityChart(t,n){if(t.empty(),n.length===0)return;let i=Math.max(...n.map(a=>a.timeSpent));if(i===0){t.createDiv({cls:"stats-view__no-data",text:"No time tracking data"});return}let s=t.createDiv({cls:"stats-view__bar-chart"});for(let a of n){let l=s.createDiv({cls:"stats-view__bar-container"}).createDiv({cls:"stats-view__bar"}),c=a.timeSpent/i*40;l.style.height=`${c}px`;let d=`${P(new Date(a.date),"MMM d")}: ${Math.round(a.timeSpent)}m`;l.setAttribute("title",d)}}}});function q4e(r,e=O2){return r.replace(/\(((?:#\d+\s*)(?:,\s*#\d+\s*)*)\)/g,(t,n)=>`(${n.split(",").map(s=>s.trim()).filter(Boolean).map(s=>{let a=s.slice(1);return`[#${a}](${e}/issues/${a})`}).join(", ")})`)}var PM,ax,jfe,O2,CM,L2=v(()=>{PM=require("obsidian");Tn();ax="tasknotes-release-notes",jfe="https://github.com/callumalpass/tasknotes/releases",O2="https://github.com/callumalpass/tasknotes";CM=class extends PM.ItemView{constructor(e,t,n,i){super(e),this.plugin=t,this.releaseNotesBundle=n,this.version=i}getViewType(){return ax}getDisplayText(){return this.plugin.i18n.translate("views.releaseNotes.title",{version:this.version})}getIcon(){return"book-open"}transformIssueLinks(e){return q4e(e)}formatDate(e){if(!e)return"";try{let t=ia(e);return P(t,"MMMM d, yyyy")}catch(t){return""}}async createVersionSection(e,t,n){let i=e.createDiv({cls:"release-notes-version-section"});i.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-8px-fdf33f23"),i.classList.add("tn-static-margin-bottom-20px-49f14f8f"),i.classList.remove("tn-static-border-none-2eda1daa","tn-static-padding-12px-43bef435"),i.classList.add("tn-static-border-1px-solid-var-background-mo-b65b5121"),i.classList.remove("tn-static-border-radius-4px-c290c56e","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),i.classList.add("tn-static-border-radius-6px-0dc8408c"),i.classList.remove("tn-static-flex-1-14e3b769"),i.classList.add("tn-static-overflow-hidden-69824400");let s=i.createDiv({cls:"release-notes-version-header"});s.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-16px-16px-16px-f1aa998c","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-20px-769fed37","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2px-8px-c8eea84a","tn-static-padding-2rem-42aa6d9c"),s.classList.add("tn-static-padding-16px-287f770e"),s.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),s.classList.add("tn-static-cursor-pointer-3b6a3a65"),s.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),s.classList.add("tn-static-display-flex-75816cae"),s.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-flex-end-455f8cca"),s.classList.add("tn-static-justify-content-space-between-a562f4fd"),s.classList.remove("tn-static-align-items-baseline-4b95b5c7","tn-static-align-items-flex-start-0486f781"),s.classList.add("tn-static-align-items-center-7c619740"),s.style.backgroundColor=t.isCurrent?"var(--background-secondary)":"var(--background-primary)",s.classList.add("tn-static-transition-background-color-0-2s-8142f01e"),s.addEventListener("mouseenter",()=>{s.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-color-red-134bc721","tn-static-background-color-var-text-accent-a954c70f"),s.classList.add("tn-static-background-color-var-background-se-9087a23e")}),s.addEventListener("mouseleave",()=>{s.style.backgroundColor=t.isCurrent?"var(--background-secondary)":"var(--background-primary)"});let a=s.createDiv({cls:"release-notes-version-info"});a.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),a.classList.add("tn-static-display-flex-75816cae"),a.classList.remove("tn-static-align-items-center-7c619740","tn-static-align-items-flex-start-0486f781"),a.classList.add("tn-static-align-items-baseline-4b95b5c7"),a.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-10px-f3d7ce77","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),a.classList.add("tn-static-gap-12px-ed7b3d87");let o=a.createEl("h2",{text:t.version});if(o.classList.remove("tn-static-margin-0-auto-266e9b04","tn-static-margin-0-db0d5f36","tn-static-margin-0-var-size-4-2-77f7dc08","tn-static-margin-2px-0-edce9b14","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),o.classList.add("tn-static-margin-0-11696618"),o.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-0-9em-65025e95","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),o.classList.add("tn-static-font-size-1-2em-3a352995"),o.classList.remove("tn-static-cursor-pointer-2723efcc","tn-static-font-weight-500-02a2d333","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd"),o.classList.add("tn-static-font-weight-600-eed0f8fb"),t.isCurrent){let m=a.createEl("span",{text:"Current"});m.classList.remove("tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-0-9em-65025e95","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),m.classList.add("tn-static-font-size-0-75em-948e16e5"),m.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-16px-16px-16px-f1aa998c","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-16px-287f770e","tn-static-padding-20px-769fed37","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2rem-42aa6d9c"),m.classList.add("tn-static-padding-2px-8px-c8eea84a"),m.classList.remove("tn-static-border-radius-6px-0dc8408c","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),m.classList.add("tn-static-border-radius-4px-c290c56e"),m.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-color-red-134bc721"),m.classList.add("tn-static-background-color-var-text-accent-a954c70f"),m.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),m.classList.add("tn-static-color-var-text-on-accent-f3e1679d"),m.classList.remove("tn-static-cursor-pointer-2723efcc","tn-static-font-weight-600-eed0f8fb","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd"),m.classList.add("tn-static-font-weight-500-02a2d333")}if(t.date){let m=a.createEl("span",{text:this.formatDate(t.date)});m.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),m.classList.add("tn-static-color-var-text-muted-5872de20"),m.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),m.classList.add("tn-static-font-size-0-9em-65025e95")}let l=s.createEl("span",{text:n?"\u25BC":"\u25B6"});l.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-9em-65025e95","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),l.classList.add("tn-static-font-size-0-8em-19dc7c13"),l.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),l.classList.add("tn-static-color-var-text-muted-5872de20");let c=i.createDiv({cls:"release-notes-version-content"});c.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-16px-287f770e","tn-static-padding-20px-769fed37","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2px-8px-c8eea84a","tn-static-padding-2rem-42aa6d9c"),c.classList.add("tn-static-padding-0-16px-16px-16px-f1aa998c"),c.style.display=n?"block":"none";let d=this.transformIssueLinks(t.content),p=`${this.plugin.i18n.translate("views.releaseNotes.baseFilesNotice")} ${d}`;await PM.MarkdownRenderer.render(this.plugin.app,p,c,"",this),s.addEventListener("click",()=>{let m=c.style.display!=="none";c.style.display=m?"none":"block",l.textContent=m?"\u25B6":"\u25BC"})}async onOpen(){let{contentEl:e}=this;e.empty(),e.addClass("tasknotes-release-notes-view");let t=e.createDiv({cls:"tasknotes-release-notes-container"});t.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-16px-16px-16px-f1aa998c","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-16px-287f770e","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2px-8px-c8eea84a","tn-static-padding-2rem-42aa6d9c"),t.classList.add("tn-static-padding-20px-769fed37"),t.classList.add("tn-static-max-width-900px-1d34c094"),t.classList.remove("tn-static-margin-0-11696618","tn-static-margin-0-db0d5f36","tn-static-margin-0-var-size-4-2-77f7dc08","tn-static-margin-2px-0-edce9b14","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),t.classList.add("tn-static-margin-0-auto-266e9b04");let n=t.createEl("div",{cls:"release-notes-header"});n.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-8px-fdf33f23"),n.classList.add("tn-static-margin-bottom-20px-49f14f8f"),n.createEl("h1",{text:this.plugin.i18n.translate("views.releaseNotes.header",{version:this.version})});let i=t.createEl("p");i.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-8px-fdf33f23"),i.classList.add("tn-static-margin-bottom-20px-49f14f8f"),i.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),i.classList.add("tn-static-font-size-0-9em-65025e95"),i.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),i.classList.add("tn-static-color-var-text-muted-5872de20");let s=this.plugin.i18n.translate("views.releaseNotes.starMessage"),a=s.toLowerCase().lastIndexOf("github");if(a!==-1){i.appendText(s.substring(0,a));let d=i.createEl("a",{text:s.substring(a,a+6),href:O2});d.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),d.classList.add("tn-static-color-var-text-accent-65b47ee3"),d.addEventListener("click",u=>{u.preventDefault(),window.open(O2,"_blank")}),i.appendText(s.substring(a+6))}else i.appendText(s);let o=t.createEl("div",{cls:"release-notes-versions"});for(let d=0;d{d.preventDefault(),window.open(jfe,"_blank")})}async onClose(){let{contentEl:e}=this;e.empty()}}});var zfe,Bfe=v(()=>{zfe=`# TaskNotes 4.7.2 ## Changed - Improved local lint checks so package and CSS issues reported by Obsidian's online review can be caught before submission. - Cleaned up stylesheet compatibility issues reported by Obsidian's online review without changing the intended TaskNotes appearance. - Improved spacing and alignment in task, timeblock, and webhook modals after the stylesheet cleanup. - Reworked optional calendar and ICS subscription refresh scheduling to avoid interval-based network polling while preserving the same refresh intervals. - Cleaned up additional source patterns reported by Obsidian's online review, including unsafe default object stringification and redundant external type unions. - Prevented a console error when plugin listeners are cleaned up after reloads. - Added a local lint check to prevent interval-based polling in files that also perform network requests. `});var qfe,Hfe=v(()=>{qfe="# TaskNotes 4.7.1\n\n## Changed\n\n- Release assets are now built with GitHub artifact attestations so users and reviewers can verify the provenance of `main.js`, `manifest.json`, and `styles.css`.\n"});var Ufe,Vfe=v(()=>{Ufe=`# TaskNotes 4.7.0 ## Changed - Enabled lint checks that mirror Obsidian community plugin review findings, including dynamic code execution, Promise handling, deprecated APIs, unsafe stringification, directive comments, Node built-in imports, and explicit \`any\` usage. - Clarified privacy documentation for optional integrations that make periodic background network refreshes. - Cleaned up internal Obsidian and Bases compatibility adapters used by search and grouped views. - (#1839, #1881) Updated default Base urgency scoring so timed tasks earlier in the day sort above later tasks with the same priority and date - Thanks to @loukandr for the contribution ## Fixed - Fixed project autocomplete searches so non-empty \`+\` queries only return files matching the query in the basename, title, aliases, or explicitly searchable metadata rows. - (#1713) Fixed all-tasks ICS export when a task uses a space-separated scheduled datetime such as \`2025-08-12 18:00\` - Thanks to @bepolymathe for requesting this and @m4to-3pe for following up - Fixed Pomodoro stats reopening immediately after a plugin reload before the Pomodoro service has finished initializing. - (#1872) Fixed unarchiving moved tasks so the destination task folder processes template variables such as \`{{project}}\` before moving the file - Thanks to @OXI-717 for reporting - (#1870) Fixed custom user field NLP triggers with file autosuggest so selecting a wikilink suggestion stores the link in the user field instead of leaving it in the task title - Thanks to @Sineapple for reporting - (#1878) Fixed completed tasks still appearing as active blockers for dependent tasks - Thanks to @macbikegeek for reporting - (#1880) Fixed the status bar time-tracking label for task titles that contain a dash - Thanks to @ubidev for reporting - (#1854) Fixed modal task completion so completed tasks receive a completed date consistently - Thanks to @misolex for reporting - (#1124, #1838, #1881) Fixed default Base views and formulas excluding tasks scheduled or due today at a non-midnight time from day-level comparisons - Thanks to @kmaustral for reporting and @loukandr for the fix ## Removed - Removed JavaScript webhook transform support and examples. JSON webhook transform templates remain supported. `});var Wfe,Yfe=v(()=>{Wfe=`# TaskNotes 4.6.0 ## Changed - TaskNotes now requires Obsidian 1.12.2 or later, matching the Obsidian APIs used by the plugin. - Improved internal code quality by resolving lint warnings, moving static inline styles into CSS utilities, and extending sentence-case lint coverage to English localization strings, with no intended behavior changes. ## Fixed - Fixed TaskNotes failing to load when Obsidian opened without an active Markdown file. `});var Gfe,Kfe,Zfe=v(()=>{Bfe();Hfe();Vfe();Yfe();Gfe="4.7.2",Kfe=[{version:"4.7.2",content:zfe,date:"2026-05-14T22:13:36+10:00",isCurrent:!0},{version:"4.7.1",content:qfe,date:"2026-05-14T08:02:31+10:00",isCurrent:!1},{version:"4.7.0",content:Ufe,date:"2026-05-14T06:40:12+10:00",isCurrent:!1},{version:"4.6.0",content:Wfe,date:"2026-05-13T08:24:23+10:00",isCurrent:!1}]});var Qfe={};et(Qfe,{TaskLinkDetectionService:()=>ox});var Rf,ox,F2=v(()=>{Rf=require("obsidian"),ox=class{constructor(e){this.linkCache=new Map;this.plugin=e}async detectTaskLink(e,t,n="wikilink"){let i=n==="wikilink"?this.parseWikilink(e):this.parseMarkdownLink(e);if(!i)return{isValidTaskLink:!1};let{linkPath:s,displayText:a}=i,o=`${t}:${s}`,l=this.linkCache.get(o);if(l){let p=this.plugin.app.vault.getAbstractFileByPath(s);if(p instanceof Rf.TFile&&p.stat.mtime===l.lastModified)return l.result}let c=this.resolveLinkPath(s,t);if(!c){let p={isValidTaskLink:!1};return this.cacheResult(o,p,0),p}let d=this.plugin.app.vault.getAbstractFileByPath(c);if(!(d instanceof Rf.TFile)){let p={isValidTaskLink:!1};return this.cacheResult(o,p,0),p}try{let p=await this.plugin.cacheManager.getTaskInfo(c);if(p){let m={isValidTaskLink:!0,taskPath:c,taskInfo:p,displayText:a};return this.cacheResult(o,m,d.stat.mtime),m}}catch(p){console.debug("TaskLinkDetectionService: Error checking task info for link:",c,p)}let u={isValidTaskLink:!1};return this.cacheResult(o,u,d.stat.mtime),u}parseWikilink(e){let t=e.slice(2,-2).trim();if(!t)return null;let n=t.indexOf("|");if(n!==-1){let s=t.slice(0,n).trim(),a=t.slice(n+1).trim();return!s||!a?null:{linkPath:(0,Rf.parseLinktext)(s).path,displayText:a}}let i=(0,Rf.parseLinktext)(t);return{linkPath:i.path,displayText:i.subpath||void 0}}parseMarkdownLink(e){let t=e.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(!t)return null;let n=t[1].trim(),i=t[2].trim();if(i.startsWith("<")&&i.endsWith(">")&&(i=i.slice(1,-1).trim()),!i)return null;try{i=decodeURIComponent(i)}catch(a){console.debug("TaskLinkDetectionService: Failed to decode URI component:",i,a)}let s=(0,Rf.parseLinktext)(i);return{linkPath:s.path,displayText:n||s.subpath||void 0}}resolveLinkPath(e,t){try{let n=this.plugin.app.metadataCache.getFirstLinkpathDest(e,t);return(n==null?void 0:n.path)||null}catch(n){return console.debug("Error resolving link path:",e,n),null}}cacheResult(e,t,n){if(this.linkCache.set(e,{result:t,lastModified:n}),this.linkCache.size>1e3){let i=this.linkCache.keys().next().value;this.linkCache.delete(i)}}clearCacheForFile(e){for(let[t]of this.linkCache)t.includes(e)&&this.linkCache.delete(t)}clearCache(){this.linkCache.clear()}findWikilinks(e){let t=[],n=/\[\[([^\]]+)\]\]/g,i;for(;(i=n.exec(e))!==null;)t.push({match:i[0],start:i.index,end:i.index+i[0].length,type:"wikilink"});let s=/\[([^\]]*)\]\(([^)]+)\)/g;for(n.lastIndex=0;(i=s.exec(e))!==null;)t.push({match:i[0],start:i.index,end:i.index+i[0].length,type:"markdown"});return t.sort((a,o)=>a.start-o.start)}cleanup(){this.linkCache.clear()}}});var Jfe,nv,$2=v(()=>{Jfe=require("@codemirror/view");_M();$i();hd();Qe();nv=class r extends Jfe.WidgetType{constructor(e,t,n,i,s=en(new Date)){super(),this.taskInfo=e,this.plugin=t,this.originalText=n,this.displayText=i,this.targetDate=s,this.targetDateKey=ue(s)}toDOM(e){let t=this.plugin.settings.inlineVisibleProperties||["status","priority","due","scheduled","recurrence"],n=Fi(t,this.plugin),i=activeDocument.createElement("span");i.className="tasknotes-plugin tasknotes-inline-widget",i.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),i.classList.add("tn-static-display-inline-cccfa456"),i.classList.add("tn-static-vertical-align-baseline-657d9c46");let s=pr(this.taskInfo,this.plugin,n,{layout:"inline",targetDate:this.targetDate});return i.appendChild(s),s.dataset.originalText=this.originalText,s.addEventListener("tasknotes:task-updated",()=>{window.setTimeout(()=>{e&&typeof e.dispatch=="function"&&mp(e,this.taskInfo.path)},50)}),i}eq(e){return e instanceof r?this.taskInfo.path===e.taskInfo.path&&this.taskInfo.status===e.taskInfo.status&&this.taskInfo.title===e.taskInfo.title&&this.taskInfo.priority===e.taskInfo.priority&&this.taskInfo.archived===e.taskInfo.archived&&this.taskInfo.due===e.taskInfo.due&&this.taskInfo.scheduled===e.taskInfo.scheduled&&this.taskInfo.recurrence===e.taskInfo.recurrence&&this.targetDateKey===e.targetDateKey&&JSON.stringify(this.taskInfo.complete_instances)===JSON.stringify(e.taskInfo.complete_instances)&&JSON.stringify(this.taskInfo.skipped_instances)===JSON.stringify(e.taskInfo.skipped_instances)&&this.taskInfo.dateModified===e.taskInfo.dateModified:!1}ignoreEvent(e){return e.type==="mousedown"||e.type==="click"}get estimatedHeight(){return-1}get block(){return!1}}});function H4e(r){let e=new Map,t=new Map;return rl.ViewPlugin.fromClass(class{constructor(n){this.eventListeners=[];this.view=n,this.decorations=this.buildDecorations(n),this.setupEventListeners()}destroy(){this.eventListeners.forEach(n=>{r.emitter.offref(n)}),this.eventListeners=[]}setupEventListeners(){let n=r.emitter.on(Fa,()=>{this.refreshDecorations()}),i=r.emitter.on(Vt,()=>{this.refreshDecorations()}),s=r.emitter.on(ug,l=>{l!=null&&l.path&&t.delete(l.path),this.refreshDecorations()}),a=r.emitter.on(Tm,()=>{t.clear(),this.refreshDecorations()}),o=r.emitter.on("settings-changed",()=>{this.refreshDecorations()});this.eventListeners.push(n,i,s,a,o)}refreshDecorations(){this.view&&typeof this.view.dispatch=="function"&&queueMicrotask(()=>{try{e.clear(),this.view.dispatch({effects:[MM.of({})]})}catch(n){console.error("Error dispatching task link update:",n)}})}update(n){var s,a;if(this.view=n.view,!((s=r==null?void 0:r.settings)!=null&&s.enableTaskLinkOverlay)){this.decorations=rl.Decoration.none;return}try{if(!n.state.field(nl.editorLivePreviewField)){this.decorations=rl.Decoration.none;return}}catch(o){this.decorations=rl.Decoration.none;return}let i=n.transactions.some(o=>o.effects.some(l=>l.is(MM)));if(n.docChanged||n.selectionSet||i){if(i){let o=(a=n.transactions.flatMap(l=>l.effects).find(l=>l.is(MM)))==null?void 0:a.value;if(o!=null&&o.taskPath)for(let[l]of e.entries())l.includes(o.taskPath)&&e.delete(l);else e.clear()}this.decorations=this.buildDecorations(n.view)}}buildDecorations(n){var i,s;try{if(!((i=r==null?void 0:r.settings)!=null&&i.enableTaskLinkOverlay))return rl.Decoration.none;if(!n.state.field(nl.editorLivePreviewField))return rl.Decoration.none;let o=n.state.field(nl.editorInfoField,!1),l=(s=o==null?void 0:o.file)==null?void 0:s.path;return U4e(n.state,r,e,l,t)}catch(a){return console.error("Error building task link decorations:",a),rl.Decoration.none}}},{decorations:n=>n.decorations})}function U4e(r,e,t,n,i){var l,c;let s=new AM.RangeSetBuilder;if(!r||!e||!t)return s.finish();let a=r.doc;if(!a||!e.app||!e.app.workspace)return s.finish();let o=e.taskLinkDetectionService||new ox(e);if(!n){let d=e.app.workspace.getActiveViewOfType(nl.MarkdownView);if(!d)return s.finish();n=(l=d.file)==null?void 0:l.path}if(!n||typeof n!="string"||n.length===0)return s.finish();try{let d=a.toString();if(typeof d!="string"||d.length>1e5)return s.finish();let u=(c=r.selection)==null?void 0:c.main.head,p=o.findWikilinks(d);if(!Array.isArray(p))return s.finish();for(let m of p)try{if(!m||typeof m.match!="string"||typeof m.start!="number"||typeof m.end!="number"||m.start<0||m.end<=m.start||m.start>=d.length||m.end>d.length||e.settings.disableOverlayOnAlias&&m.type==="wikilink"&&m.match.includes("|"))continue;let f=m.type==="wikilink"?V4e(m.match):W4e(m.match);if(!f)continue;let{linkPath:h}=f;if(!h||typeof h!="string"||h.trim().length===0)continue;let g=Y4e(h,n,e);if(!g)continue;let y=G4e(g,e);if(y){if(!y.title||typeof y.title!="string"||u!==void 0&&u>=m.start&&u=m.start&&u500)return null;let t=e.indexOf("|");if(t!==-1){let i=e.slice(0,t).trim(),s=e.slice(t+1).trim();if(!i||!s)return null;let a=(0,nl.parseLinktext)(i);return a.path?{linkPath:a.path,displayText:s}:null}let n=(0,nl.parseLinktext)(e);return n.path?{linkPath:n.path,displayText:n.subpath||void 0}:null}function W4e(r){if(!r||typeof r!="string")return null;let e=r.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(!e)return null;let t=e[1].trim(),n=e[2].trim();if(n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1).trim()),!n||n.length===0||n.length>500)return null;try{n=decodeURIComponent(n)}catch(s){}let i=(0,nl.parseLinktext)(n);return i.path?{linkPath:i.path,displayText:t||i.subpath||void 0}:null}function Y4e(r,e,t){if(!r||typeof r!="string"||r.trim().length===0||!e||typeof e!="string"||!t||!t.app||!t.app.metadataCache)return null;try{let n=t.app.metadataCache.getFirstLinkpathDest(r,e);return!n||!n.path||typeof n.path!="string"?null:n.path}catch(n){return null}}function G4e(r,e){if(!r||typeof r!="string"||r.trim().length===0||!e)return null;try{let t=/[<>:"|?*]/,n=r.split("").some(a=>{let o=a.charCodeAt(0);return o<=31||o===127});if(t.test(r)||n)return null;let i=e.cacheManager;if(!i||!i.getCachedTaskInfoSync)return null;let s=i.getCachedTaskInfoSync(r);return s&&typeof s=="object"&&s.title?s:null}catch(t){return null}}function Xfe(r){return H4e(r)}function mp(r,e){if(!r||typeof r.dispatch!="function"){console.warn("Invalid EditorView passed to dispatchTaskUpdate:",r);return}try{r.dispatch({effects:[MM.of({taskPath:e})]})}catch(t){console.error("Error dispatching task update:",t)}}var AM,rl,nl,MM,_M=v(()=>{AM=require("@codemirror/state"),rl=require("@codemirror/view"),nl=require("obsidian");On();F2();$2();MM=AM.StateEffect.define()});var iv,j2=v(()=>{iv=class{constructor(){this.states=new WeakMap}schedule(e,t){let n=this.getState(e);if(n.version+=1,n.running){n.rerun=!0;return}n.running=!0,this.runLoop(e,t)}getState(e){let t=this.states.get(e);return t||(t={running:!1,rerun:!1,version:0},this.states.set(e,t)),t}async runLoop(e,t){let n=this.getState(e);try{do{n.rerun=!1;let i=n.version;await t({isCurrent:()=>{var s;return((s=this.states.get(e))==null?void 0:s.version)===i}})}while(n.rerun)}finally{n.running=!1,n.rerun&&(n.running=!0,this.runLoop(e,t))}}}});function the(r){if(!r||typeof r!="object")return!1;let e=r;return"parent"in e&&e.parent==null}function z2(r){return!!(r!=null&&r.closest(K4e))}function IM(r){if(z2(r.dom))return!0;try{let e=r.state.field(ehe.editorInfoField,!1);return the(e==null?void 0:e.leaf)?!0:z2(e==null?void 0:e.containerEl)}catch(e){return console.debug("[TaskNotes] Error checking markdown widget editor context:",e),!1}}function NM(r){var t;if(the(r))return!0;let e=(t=r.view)==null?void 0:t.containerEl;return z2(e)}var ehe,K4e,B2=v(()=>{ehe=require("obsidian"),K4e=[".blp-inline-edit-root",".internal-embed.markdown-embed",".markdown-embed",".popover.hover-popover"].join(", ")});async function nhe(r,e){let t=activeDocument.createElement("div");t.className=`tasknotes-plugin ${RM}`,t.setAttribute("contenteditable","false"),t.setAttribute("spellcheck","false"),t.setAttribute("data-widget-type","relationships");let n=activeDocument.createElement("div");n.className="relationships__bases-container",t.appendChild(n);let i=new uo.Component;i.load(),t.component=i;try{let s=r.settings.commandFileMapping.relationships;if(!s){let o=activeDocument.createElement("div");return o.className="relationships__error",o.textContent="Relationships view not configured",n.appendChild(o),t}let a=`![[${s}]]`;await uo.MarkdownRenderer.render(r.app,a,n,e,i)}catch(s){console.error("[TaskNotes] Error rendering Bases view in relationships widget:",s);let a=activeDocument.createElement("div");a.className="relationships__error",a.textContent="Failed to load relationships view",n.appendChild(a)}return t}function ihe(r){return rhe.ViewPlugin.fromClass(class extends q2{constructor(e){super(e,r)}destroy(){super.destroy()}})}async function Q4e(r,e,t){var l,c,d;let n=r.view;if(!(n instanceof uo.MarkdownView)||n.getMode()!=="preview"||NM(r))return;let i=n.file;if(!i||!e.settings.showRelationships)return;let s=!1,a=!1,o=e.app.metadataCache.getFileCache(i);if(o!=null&&o.frontmatter?(s=e.cacheManager.isTaskFile(o.frontmatter),a=((c=e.dependencyCache)==null?void 0:c.isFileUsedAsProject(i.path))||!1):a=((l=e.dependencyCache)==null?void 0:l.isFileUsedAsProject(i.path))||!1,!s&&!a){try{n.previewMode.containerEl.querySelectorAll(`.${RM}`).forEach(m=>{var h;(h=m.component)==null||h.unload(),m.remove()})}catch(u){console.debug("[TaskNotes] Error cleaning up relationships widget in reading mode:",u)}return}try{let p=n.previewMode.containerEl;p.querySelectorAll(`.${RM}`).forEach(y=>{var T;(T=y.component)==null||T.unload(),y.remove()});let m=e.settings.relationshipsPosition||"bottom",f=i.path,h=await nhe(e,f);if(t&&!t.isCurrent()){(d=h.component)==null||d.unload(),h.remove();return}let g=p.querySelector(".markdown-preview-sizer");if(!g){console.warn("[TaskNotes] Could not find .markdown-preview-sizer for relationships in reading mode");return}if(m==="top"){let y=g.querySelector(".tasknotes-task-card-note-widget");if(y!=null&&y.nextSibling)g.insertBefore(h,y.nextSibling);else{let k=g.querySelector(".metadata-container");k!=null&&k.nextSibling?g.insertBefore(h,k.nextSibling):g.insertBefore(h,g.firstChild)}}else{let y=p.querySelector(".embedded-backlinks");y!=null&&y.parentElement?y.parentElement.insertBefore(h,y):g.appendChild(h)}}catch(u){console.error("[TaskNotes] Error injecting relationships widget in reading mode:",u)}}function she(r){let e=[],t=[],n=new iv,i=p=>{n.schedule(p,m=>Q4e(p,r,m))},s=null,a=()=>{s&&window.clearTimeout(s),s=window.setTimeout(()=>{r.app.workspace.getLeavesOfType("markdown").forEach(m=>{i(m)})},100)},o=r.app.workspace.on("layout-change",a);e.push(o);let l=r.app.workspace.on("active-leaf-change",p=>{p&&i(p)});e.push(l);let c=new Map,d=r.app.metadataCache.on("changed",p=>{let m=c.get(p.path);m&&window.clearTimeout(m);let f=window.setTimeout(()=>{c.delete(p.path),r.app.workspace.getLeavesOfType("markdown").forEach(g=>{let y=g.view;y instanceof uo.MarkdownView&&y.file===p&&i(g)})},500);c.set(p.path,f)});return t.push(d),r.app.workspace.getLeavesOfType("markdown").forEach(p=>{i(p)}),()=>{s&&window.clearTimeout(s),e.forEach(p=>r.app.workspace.offref(p)),t.forEach(p=>r.app.metadataCache.offref(p))}}var rhe,uo,RM,Z4e,q2,ahe=v(()=>{rhe=require("@codemirror/view"),uo=require("obsidian");j2();B2();RM="tasknotes-relationships-widget",Z4e="task-card-injected";q2=class{constructor(e,t){this.plugin=t;this.currentFile=null;this.currentWidget=null;this.widgetContainer=null;this.debounceTimer=null;this.eventListeners=[];this.view=e,this.currentFile=this.getFileFromView(e),this.setupEventListeners(),this.injectWidget(e)}update(e){this.view=e.view;let t=this.getFileFromView(e.view);t!==this.currentFile&&(this.currentFile=t,this.debouncedInjectWidget(e.view))}destroy(){this.debounceTimer&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=null),this.removeWidget(),this.eventListeners.forEach(e=>{this.plugin.emitter.offref(e)}),this.eventListeners=[]}setupEventListeners(){let e=this.plugin.emitter.on(Z4e,()=>{this.debouncedInjectWidget(this.view)});this.eventListeners.push(e);let t=this.plugin.emitter.on("settings-changed",()=>{this.debouncedInjectWidget(this.view)});this.eventListeners.push(t)}debouncedInjectWidget(e){this.debounceTimer&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.injectWidget(e)},100)}getFileFromView(e){try{let t=e.state.field(uo.editorInfoField,!1);return(t==null?void 0:t.file)||null}catch(t){return console.debug("[TaskNotes] Error getting file from editor view:",t),null}}isTableCellEditor(e){try{let t=e.dom;if(!t)return!1;if(IM(e)||t.closest("td, th")||t.closest(".cm-table-widget")||t.closest(".popover.hover-popover")||t.closest(".markdown-embed[data-type='footnote']"))return!0;let o=e.state.field(uo.editorInfoField,!1);if(!(o!=null&&o.file)){let l=t.parentElement,c=0,d=20;for(;l&&l!==activeDocument.body&&c{var i;n!==this.currentWidget&&((i=n.component)==null||i.unload(),n.remove())})}catch(t){console.error("[TaskNotes] Error cleaning up orphaned relationships widgets:",t)}}async injectWidget(e){var t,n,i,s,a,o,l;if(this.removeWidget(),!this.isTableCellEditor(e)){this.cleanupOrphanedWidgets(e);try{if(!this.plugin.settings.showRelationships)return;let c=this.currentFile||this.getFileFromView(e);if(!(c instanceof uo.TFile))return;let d=!1,u=!1,p=this.plugin.app.metadataCache.getFileCache(c);if(p!=null&&p.frontmatter?(d=this.plugin.cacheManager.isTaskFile(p.frontmatter),u=((n=this.plugin.dependencyCache)==null?void 0:n.isFileUsedAsProject(c.path))||!1):u=((t=this.plugin.dependencyCache)==null?void 0:t.isFileUsedAsProject(c.path))||!1,!d&&!u)return;let m=c.path,f=this.plugin.settings.relationshipsPosition||"bottom",h=(i=e.dom.closest(".markdown-source-view"))==null?void 0:i.querySelector(".cm-sizer");if(!h){console.warn("[TaskNotes] Could not find .cm-sizer container for relationships widget");return}let g=await nhe(this.plugin,m);if(this.currentWidget=g,this.widgetContainer=h,f==="top"){let y=h.querySelector(".tasknotes-task-card-note-widget");if(y&&y.nextSibling)(s=y.parentElement)==null||s.insertBefore(g,y.nextSibling);else{let k=h.querySelector(".metadata-container");k&&k.nextSibling?(a=k.parentElement)==null||a.insertBefore(g,k.nextSibling):h.insertBefore(g,h.firstChild)}}else{let y=(o=h.parentElement)==null?void 0:o.querySelector(".embedded-backlinks");y?(l=y.parentElement)==null||l.insertBefore(g,y):h.appendChild(g)}}catch(c){console.error("[TaskNotes] Error injecting relationships widget:",c),this.removeWidget()}}}}});function lhe(r,e){let t=activeDocument.createElement("div");t.className=`tasknotes-plugin task-card-note-widget ${OM}`,t.setAttribute("contenteditable","false"),t.setAttribute("spellcheck","false"),t.setAttribute("data-widget-type","task-card");let n=new ic.Component;n.load(),t.component=n;let i=r.settings.defaultVisibleProperties?Fi(r.settings.defaultVisibleProperties,r):void 0,s=pr(e,r,i);return s.classList.add("task-card-note-widget__card"),t.appendChild(s),t}function che(r){return ohe.ViewPlugin.fromClass(class extends H2{constructor(e){super(e,r)}destroy(){super.destroy()}})}async function X4e(r,e,t){var a;let n=r.view;if(!(n instanceof ic.MarkdownView)||n.getMode()!=="preview"||NM(r))return;let i=n.file;if(!i||!e.settings.showTaskCardInNote)return;let s=e.cacheManager.getCachedTaskInfoSync(i.path);if(!s){try{n.previewMode.containerEl.querySelectorAll(`.${OM}`).forEach(c=>{var u;(u=c.component)==null||u.unload(),c.remove()})}catch(o){console.debug("[TaskNotes] Error cleaning up task card in reading mode:",o)}return}try{let l=n.previewMode.containerEl;l.querySelectorAll(`.${OM}`).forEach(p=>{var f;(f=p.component)==null||f.unload(),p.remove()});let c=lhe(e,s);if(t&&!t.isCurrent()){(a=c.component)==null||a.unload(),c.remove();return}let d=l.querySelector(".markdown-preview-sizer");if(!d){console.warn("[TaskNotes] Could not find .markdown-preview-sizer for task card in reading mode");return}let u=d.querySelector(".metadata-container");u!=null&&u.nextSibling?d.insertBefore(c,u.nextSibling):d.insertBefore(c,d.firstChild)}catch(o){console.error("[TaskNotes] Error injecting task card widget in reading mode:",o)}}function dhe(r){let e=[],t=[],n=[],i=new iv,s=h=>{i.schedule(h,g=>X4e(h,r,g))},a=null,o=()=>{a&&window.clearTimeout(a),a=window.setTimeout(()=>{r.app.workspace.getLeavesOfType("markdown").forEach(g=>{s(g)})},100)},l=r.app.workspace.on("layout-change",o);e.push(l);let c=r.app.workspace.on("active-leaf-change",h=>{h&&s(h)});e.push(c);let d=new Map,u=r.app.metadataCache.on("changed",h=>{let g=d.get(h.path);g&&window.clearTimeout(g);let y=window.setTimeout(()=>{d.delete(h.path),r.app.workspace.getLeavesOfType("markdown").forEach(T=>{let w=T.view;w instanceof ic.MarkdownView&&w.file===h&&s(T)})},500);d.set(h.path,y)});t.push(u);let p=r.emitter.on(Vt,o);n.push(p);let m=r.emitter.on(Fa,o);return n.push(m),r.app.workspace.getLeavesOfType("markdown").forEach(h=>{s(h)}),()=>{a&&window.clearTimeout(a),e.forEach(h=>r.app.workspace.offref(h)),t.forEach(h=>r.app.metadataCache.offref(h)),n.forEach(h=>r.emitter.offref(h))}}var ohe,ic,OM,J4e,H2,uhe=v(()=>{ohe=require("@codemirror/view");On();ic=require("obsidian");$i();hd();j2();B2();OM="tasknotes-task-card-note-widget",J4e="task-card-injected";H2=class{constructor(e,t){this.plugin=t;this.cachedTask=null;this.currentFile=null;this.eventListeners=[];this.currentWidget=null;this.widgetContainer=null;this.debounceTimer=null;this.view=e,this.currentFile=this.getFileFromView(e),this.setupEventListeners(),this.loadTaskForCurrentFile(e)}update(e){this.view=e.view;let t=this.getFileFromView(e.view);t!==this.currentFile&&(this.currentFile=t,this.loadTaskForCurrentFile(e.view))}destroy(){this.debounceTimer&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=null),this.removeWidget(),this.eventListeners.forEach(e=>{this.plugin.emitter.offref(e)}),this.eventListeners=[]}setupEventListeners(){let e=()=>{this.debounceTimer&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.loadTaskForCurrentFile(this.view)},100)},t=this.plugin.emitter.on(Fa,e),n=this.plugin.emitter.on(Vt,e),i=this.plugin.emitter.on(ug,e),s=this.plugin.emitter.on(Tm,e),a=this.plugin.emitter.on("settings-changed",e);this.eventListeners.push(t,n,i,s,a)}removeWidget(){var e;this.currentWidget&&((e=this.currentWidget.component)==null||e.unload(),this.currentWidget.remove(),this.currentWidget=null),this.widgetContainer=null}cleanupOrphanedWidgets(e){try{let t=e.dom.closest(".workspace-leaf-content");if(!t){console.debug("[TaskNotes] Could not find workspace-leaf-content for orphan cleanup");return}t.querySelectorAll(`.${OM}`).forEach(n=>{var i;n!==this.currentWidget&&((i=n.component)==null||i.unload(),n.remove())})}catch(t){console.error("[TaskNotes] Error cleaning up orphaned task card widgets:",t)}}loadTaskForCurrentFile(e){var n,i,s,a,o,l,c,d,u,p,m,f,h;let t=this.getFileFromView(e);if(t instanceof ic.TFile)try{let g=this.plugin.cacheManager.getCachedTaskInfoSync(t.path),y=T=>!(T!=null&&T.timeEntries)||T.timeEntries.length===0?!1:!T.timeEntries[T.timeEntries.length-1].endTime;(((n=this.cachedTask)==null?void 0:n.title)!==(g==null?void 0:g.title)||((i=this.cachedTask)==null?void 0:i.status)!==(g==null?void 0:g.status)||((s=this.cachedTask)==null?void 0:s.priority)!==(g==null?void 0:g.priority)||((a=this.cachedTask)==null?void 0:a.due)!==(g==null?void 0:g.due)||((o=this.cachedTask)==null?void 0:o.scheduled)!==(g==null?void 0:g.scheduled)||((l=this.cachedTask)==null?void 0:l.path)!==(g==null?void 0:g.path)||((c=this.cachedTask)==null?void 0:c.archived)!==(g==null?void 0:g.archived)||((d=this.cachedTask)==null?void 0:d.timeEstimate)!==(g==null?void 0:g.timeEstimate)||((u=this.cachedTask)==null?void 0:u.recurrence)!==(g==null?void 0:g.recurrence)||y(this.cachedTask)!==y(g)||JSON.stringify(((p=this.cachedTask)==null?void 0:p.tags)||[])!==JSON.stringify((g==null?void 0:g.tags)||[])||JSON.stringify(((m=this.cachedTask)==null?void 0:m.contexts)||[])!==JSON.stringify((g==null?void 0:g.contexts)||[])||JSON.stringify(((f=this.cachedTask)==null?void 0:f.projects)||[])!==JSON.stringify((g==null?void 0:g.projects)||[])||JSON.stringify(((h=this.cachedTask)==null?void 0:h.complete_instances)||[])!==JSON.stringify((g==null?void 0:g.complete_instances)||[]))&&(this.cachedTask=g,this.injectWidget(e))}catch(g){console.error("[TaskNotes] Error loading task for task note:",g)}else this.cachedTask!==null&&(this.cachedTask=null,this.injectWidget(e))}getFileFromView(e){try{let t=e.state.field(ic.editorInfoField,!1);return(t==null?void 0:t.file)||null}catch(t){return console.debug("[TaskNotes] Error getting file from editor view:",t),null}}isTableCellEditor(e){try{let t=e.dom;if(!t)return!1;if(IM(e)||t.closest("td, th")||t.closest(".cm-table-widget")||t.closest(".popover.hover-popover")||t.closest(".markdown-embed[data-type='footnote']"))return!0;let o=e.state.field(ic.editorInfoField,!1);if(!(o!=null&&o.file)){let l=t.parentElement,c=0,d=20;for(;l&&l!==activeDocument.body&&c{$2();U2=class{constructor(e){this.plugin=e}createPostProcessor(){return(e,t)=>{if(!this.plugin.settings.enableTaskLinkOverlay)return;let n=e.querySelectorAll("a");for(let i of Array.from(n)){let s=i,a=s.getAttribute("href");s.classList.contains("internal-link")?this.processLink(s,t.sourcePath,"internal"):a&&!a.startsWith("http://")&&!a.startsWith("https://")&&!a.includes("://")&&this.processLink(s,t.sourcePath,"external")}}}async processLink(e,t,n){try{let i=e.getAttribute("href");if(!i)return;let s=i;if(n==="internal"){if(i.startsWith("app://")){let l=new URL(i);s=decodeURIComponent(l.pathname),s.startsWith("/")&&(s=s.substring(1))}}else{if(i.startsWith("http://")||i.startsWith("https://")||i.includes("://"))return;s=i}let a=this.resolveLinkPath(s,t);if(!a)return;let o=this.getTaskInfo(a);if(!o)return;await this.replaceWithTaskWidget(e,o,s)}catch(i){console.debug("Error processing link in reading mode:",i)}}resolveLinkPath(e,t){try{let n=this.plugin.app.metadataCache.getFirstLinkpathDest(e,t);return(n==null?void 0:n.path)||null}catch(n){return console.debug("Error resolving link path:",e,n),null}}getTaskInfo(e){try{if(!e||typeof e!="string"||e.trim().length===0)return null;let t=this.plugin.cacheManager;if(!t||!t.getCachedTaskInfoSync)return null;let n=t.getCachedTaskInfoSync(e);return n&&typeof n=="object"&&n.title?n:null}catch(t){return console.debug("Error getting task info for:",e,t),null}}async replaceWithTaskWidget(e,t,n){var i;try{let s=e.textContent||`[[${n}]]`;if(this.plugin.settings.disableOverlayOnAlias){let d=e.textContent||"";if(d!==n&&d!==t.title)return}let a,o=e.textContent||"";o!==n&&o!==t.title&&(a=o);let l=new nv(t,this.plugin,s,a),c=this.createReadingModeWidget(l,t,s,a);(i=e.parentNode)==null||i.replaceChild(c,e)}catch(s){console.error("Error replacing wikilink with task widget:",s)}}createReadingModeWidget(e,t,n,i){let s={},a=e.toDOM(s);return a.classList.add("task-inline-preview--reading-mode"),a}}});function r3e(r,e,t){let n;switch(r){case"P":e&&e==="-"?t.isNegative=!0:t.isNegative=!1;break;case"D":n="days";break;case"W":n="weeks";break;case"H":n="hours";break;case"M":n="minutes";break;case"S":n="seconds";break;default:return 0}if(n){if(!e&&e!==0)throw new Error('invalid duration value: Missing number before "'+r+'"');let i=parseInt(e,10);if(dx(i))throw new Error('invalid duration value: Invalid number "'+e+'" before "'+r+'"');t[n]=i}return 1}function dr(r){let e={},t=e.component=[];if(e.stack=[t],dr._eachLine(r,function(n,i){dr._handleContentLine(i,e)}),e.stack.length>1)throw new Nd("invalid ical body. component began but did not end");return e=null,t.length==1?t[0]:t}function c3e(r){let e,t,n,i,s;if(!r||r.name!=="vcalendar")return r;for(e=r.getAllSubcomponents(),t=[],n={},s=0;s0&&r[t-1]==="\\")t+=1;else return t;return-1}function Lf(r,e,t){if(!r.length)return 0;let n=0,i=r.length-1,s,a;for(;n<=i;)if(s=n+Math.floor((i-n)/2),a=t(e,r[s]),a<0)i=s-1;else if(a>0)n=s+1;else break;return a<0?s:a>0?s+1:s}function $f(r,e){if(!r||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if("clone"in r)return r.clone();if(Array.isArray(r)){let t=[];for(let n=0;n65535?2:1:(e+=ac.newLineChar+" "+t.slice(0,Math.max(0,n)),t=t.slice(Math.max(0,n)),n=i=0)}return e.slice(ac.newLineChar.length+1)}function zs(r){switch(typeof r!="string"&&(typeof r=="number"&&(r=parseInt(r)),r=String(r)),r.length){case 0:return"00";case 1:return"0"+r;default:return r}}function ni(r){return r<0?Math.ceil(r):Math.floor(r)}function jf(r,e){for(let t in r){let n=Object.getOwnPropertyDescriptor(r,t);n&&!Object.getOwnPropertyDescriptor(e,t)&&Object.defineProperty(e,t,n)}return e}function fp(r,e,t,n){let i=n;if(n[0]==="+"&&(i=n.slice(1)),i=qi(i),e!==void 0&&n '+e);if(t!==void 0&&n>t)throw new Error(r+': invalid value "'+n+'" must be < '+e);return i}function G2(r,e){return{matches:/.*/,fromICAL:function(n,i){return y3e(n,r,i)},toICAL:function(n,i){let s=e;return i&&(s=new RegExp(s.source+"|"+i,s.flags)),n.replace(s,function(a){switch(a){case"\\":return"\\\\";case";":return"\\;";case",":return"\\,";case` `:return"\\n";default:return a}})}}}function g3e(r){switch(r){case"\\\\":return"\\";case"\\;":return";";case"\\,":return",";case"\\n":case"\\N":return` `;default:return r}}function y3e(r,e,t){return r.indexOf("\\")===-1?r:(t&&(e=new RegExp(e.source+"|\\\\"+t,e.flags)),r.replace(e,g3e))}function sn(r){typeof r[0]=="string"&&(r=[r]);let e=0,t=r.length,n="";for(;ee[0]?1:e[0]>r[0]?-1:0}var qM,e3e,t3e,Ca,cx,av,ye,xe,n3e,HM,Y2,i3e,s3e,a3e,o3e,Nd,l3e,ov,lv,Qt,mr,cs,UM,d3e,Id,Of,js,ux,sv,u3e,p3e,Che,m3e,fhe,il,V2,W2,f3e,h3e,hhe,ghe,Jt,px,VM,LM,FM,$M,$s,yhe,vhe,bhe,Z2,Q2,v3e,An,b3e,Da,T3e,k3e,w3e,S3e,x3e,Md,The,khe,fr,BM,whe,E3e,She,jM,zM,hp,Ff,gp,sc,yp,D3e,C3e,po,WM,lx,YM,K2,ac,Phe=v(()=>{qM=class r{constructor(e){M(this,"icaltype","binary");this.value=e}static fromString(e){return new r(e)}decodeValue(){return this._b64_decode(this.value)}setEncodedValue(e){this.value=this._b64_encode(e)}_b64_encode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,i,s,a,o,l,c,d,u=0,p=0,m="",f=[];if(!e)return e;do n=e.charCodeAt(u++),i=e.charCodeAt(u++),s=e.charCodeAt(u++),d=n<<16|i<<8|s,a=d>>18&63,o=d>>12&63,l=d>>6&63,c=d&63,f[p++]=t.charAt(a)+t.charAt(o)+t.charAt(l)+t.charAt(c);while(u>16&255,i=d>>8&255,s=d&255,l==64?f[p++]=String.fromCharCode(n):c==64?f[p++]=String.fromCharCode(n,i):f[p++]=String.fromCharCode(n,i,s);while(un)-(t0?-1:0}toString(){return this.start+"/"+(this.end||this.duration)}toJSON(){return[this.start.toString(),(this.end||this.duration).toString()]}toICALString(){return this.start.toICALString()+"/"+(this.end||this.duration).toICALString()}},ye=class ye{constructor(e,t){M(this,"icalclass","icaltime");M(this,"_cachedUnixTime",null);M(this,"zone",null);M(this,"_pendingNormalization",!1);this.wrappedJSObject=this,this._time=Object.create(null),this._time.year=0,this._time.month=1,this._time.day=1,this._time.hour=0,this._time.minute=0,this._time.second=0,this._time.isDate=!1,this.fromData(e,t)}static daysInMonth(e,t){let n=[0,31,28,31,30,31,30,31,31,30,31,30,31],i=30;return e<1||e>12||(i=n[e],e==2&&(i+=ye.isLeapYear(t))),i}static isLeapYear(e){return e<=1752?e%4==0:e%4==0&&e%100!=0||e%400==0}static fromDayOfYear(e,t){let n=t,i=e,s=new ye;s.auto_normalize=!1;let a=ye.isLeapYear(n)?1:0;if(i<1)return n--,a=ye.isLeapYear(n)?1:0,i+=ye.daysInYearPassedMonth[a][12],ye.fromDayOfYear(i,n);if(i>ye.daysInYearPassedMonth[a][12])return a=ye.isLeapYear(n)?1:0,i-=ye.daysInYearPassedMonth[a][12],n++,ye.fromDayOfYear(i,n);s.year=n,s.isDate=!0;for(let o=11;o>=0;o--)if(i>ye.daysInYearPassedMonth[a][o]){s.month=o+1,s.day=i-ye.daysInYearPassedMonth[a][o];break}return s.auto_normalize=!0,s}static fromStringv2(e){return new ye({year:parseInt(e.slice(0,4),10),month:parseInt(e.slice(5,7),10),day:parseInt(e.slice(8,10),10),isDate:!0})}static fromDateString(e){return new ye({year:qi(e.slice(0,4)),month:qi(e.slice(5,7)),day:qi(e.slice(8,10)),isDate:!0})}static fromDateTimeString(e,t){if(e.length<19)throw new Error('invalid date-time value: "'+e+'"');let n,i;e.slice(-1)==="Z"?n=mr.utcTimezone:t&&(i=t.getParameter("tzid"),t.parent&&(t.parent.name==="standard"||t.parent.name==="daylight"?n=mr.localTimezone:i&&(n=t.parent.getTimeZoneByID(i))));let s={year:qi(e.slice(0,4)),month:qi(e.slice(5,7)),day:qi(e.slice(8,10)),hour:qi(e.slice(11,13)),minute:qi(e.slice(14,16)),second:qi(e.slice(17,19))};return i&&!n&&(s.timezone=i),new ye(s,n)}static fromString(e,t){return e.length>10?ye.fromDateTimeString(e,t):ye.fromDateString(e)}static fromJSDate(e,t){return new ye().fromJSDate(e,t)}static now(){return ye.fromJSDate(new Date,!1)}static weekOneStarts(e,t){let n=ye.fromData({year:e,month:1,day:1,isDate:!0}),i=n.dayOfWeek(),s=t||ye.DEFAULT_WEEK_START;return i>ye.THURSDAY&&(n.day+=7),s>ye.THURSDAY&&(n.day-=7),n.day-=i-s,n}static getDominicalLetter(e){let t="GFEDCBA",n=(e+(e/4|0)+(e/400|0)-(e/100|0)-1)%7;return ye.isLeapYear(e)?t[(n+6)%7]+t[n]:t[n]}static get epochTime(){return La(this,av)||Bc(this,av,ye.fromData({year:1970,month:1,day:1,hour:0,minute:0,second:0,isDate:!1,timezone:"Z"})),La(this,av)}static _cmp_attr(e,t,n){return e[n]>t[n]?1:e[n]=0){o.day=1,s!=0&&s--,a=o.day;let l=o.dayOfWeek(),c=e-l;c<0&&(c+=7),a+=c,a-=e,i=e}else{o.day=n;let l=o.dayOfWeek();s++,i=l-e,i<0&&(i+=7),i=n-i}return i+=s*7,a+i}isNthWeekDay(e,t){let n=this.dayOfWeek();return t===0&&n===e||this.nthWeekDay(e,t)===this.day}weekNumber(e){let t=(this.year<<12)+(this.month<<8)+(this.day<<3)+e;if(t in ye._wnCache)return ye._wnCache[t];let n,i=this.clone();i.isDate=!0;let s=this.year;i.month==12&&i.day>25?(n=ye.weekOneStarts(s+1,e),i.compare(n)<0?n=ye.weekOneStarts(s,e):s++):(n=ye.weekOneStarts(s,e),i.compare(n)<0&&(n=ye.weekOneStarts(--s,e)));let a=i.subtractDate(n).toSeconds()/86400,o=ni(a/7)+1;return ye._wnCache[t]=o,o}addDuration(e){let t=e.isNegative?-1:1,n=this.second,i=this.minute,s=this.hour,a=this.day;n+=t*e.seconds,i+=t*e.minutes,s+=t*e.hours,a+=t*e.days,a+=t*7*e.weeks,this.second=n,this.minute=i,this.hour=s,this.day=a,this._cachedUnixTime=null}subtractDate(e){let t=this.toUnixTime()+this.utcOffset(),n=e.toUnixTime()+e.utcOffset();return Ca.fromSeconds(t-n)}subtractDateTz(e){let t=this.toUnixTime(),n=e.toUnixTime();return Ca.fromSeconds(t-n)}compare(e){if(e instanceof cx)return-1*e.compare(this);{let t=this.toUnixTime(),n=e.toUnixTime();return t>n?1:n>t?-1:0}}compareDateOnlyTz(e,t){let n=this.convertToZone(t),i=e.convertToZone(t),s=0;return(s=ye._cmp_attr(n,i,"year"))!=0||(s=ye._cmp_attr(n,i,"month"))!=0||(s=ye._cmp_attr(n,i,"day"))!=0,s}convertToZone(e){let t=this.clone(),n=this.zone.tzid==e.tzid;return!this.isDate&&!n&&mr.convert_time(t,this.zone,e),t.zone=e,t}utcOffset(){return this.zone==mr.localTimezone||this.zone==mr.utcTimezone?0:this.zone.utcOffset(this)}toICALString(){let e=this.toString();return e.length>10?fr.icalendar.value["date-time"].toICAL(e):fr.icalendar.value.date.toICAL(e)}toString(){let e=this.year+"-"+zs(this.month)+"-"+zs(this.day);return this.isDate||(e+="T"+zs(this.hour)+":"+zs(this.minute)+":"+zs(this.second),this.zone===mr.utcTimezone&&(e+="Z")),e}toJSDate(){return this.zone==mr.localTimezone?this.isDate?new Date(this.year,this.month-1,this.day):new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second,0):new Date(this.toUnixTime()*1e3)}_normalize(){return this._time.isDate&&(this._time.hour=0,this._time.minute=0,this._time.second=0),this.adjust(0,0,0,0),this}adjust(e,t,n,i,s){let a,o,l=0,c=0,d,u,p,m,f,h=s||this._time;if(h.isDate||(d=h.second+i,h.second=d%60,a=ni(d/60),h.second<0&&(h.second+=60,a--),u=h.minute+n+a,h.minute=u%60,o=ni(u/60),h.minute<0&&(h.minute+=60,o--),p=h.hour+t+o,h.hour=p%24,l=ni(p/24),h.hour<0&&(h.hour+=24,l--)),h.month>12?c=ni((h.month-1)/12):h.month<1&&(c=ni(h.month/12)-1),h.year+=c,h.month-=12*c,m=h.day+e+l,m>0)for(;f=ye.daysInMonth(h.month,h.year),!(m<=f);)h.month++,h.month>12&&(h.year++,h.month=1),m-=f;else for(;m<=0;)h.month==1?(h.year--,h.month=12):h.month--,m+=ye.daysInMonth(h.month,h.year);return h.day=m,this._cachedUnixTime=null,this}fromUnixTime(e){this.zone=mr.utcTimezone;let t=new Date(e*1e3);this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this._time.isDate?(this.hour=0,this.minute=0,this.second=0):(this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()),this._cachedUnixTime=null}toUnixTime(){if(this._cachedUnixTime!==null)return this._cachedUnixTime;let e=this.utcOffset(),t=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second-e);return this._cachedUnixTime=t/1e3,this._cachedUnixTime}toJSON(){let e=["year","month","day","hour","minute","second","isDate"],t=Object.create(null),n=0,i=e.length,s;for(;nt&&(n=-1);let c;if(n!==-1){if(a=r.slice(0,Math.max(0,n)).toLowerCase(),c=dr._parseParameters(r.slice(Math.max(0,n)),0,e.designSet),c[2]==-1)throw new Nd("Invalid parameters in '"+r+"'");l=c[0];let y;if(typeof c[1]=="string"?y=c[1].length:y=c[1].reduce((k,T)=>k+T.length,0),i=y+c[2]+n,(s=r.slice(Math.max(0,i)).indexOf(HM))!==-1)o=r.slice(Math.max(0,i+s+1));else throw new Nd("Missing parameter value in '"+r+"'")}else if(t!==-1){if(a=r.slice(0,Math.max(0,t)).toLowerCase(),o=r.slice(Math.max(0,t+1)),a==="begin"){let y=[o.toLowerCase(),[],[]];e.stack.length===1?e.component.push(y):e.component[2].push(y),e.stack.push(e.component),e.component=y,e.designSet||(e.designSet=fr.getDesignSet(e.component[0]));return}else if(a==="end"){e.component=e.stack.pop();return}}else throw new Nd('invalid line (no token ";" or ":") "'+r+'"');let d,u=!1,p=!1,m,f,h;e.designSet.propertyGroups&&a.indexOf(".")!==-1?(f=a.split("."),l.group=f[0],h=f[1]):h=a,h in e.designSet.property&&(m=e.designSet.property[h],"multiValue"in m&&(u=m.multiValue),"structuredValue"in m&&(p=m.structuredValue),o&&"detectType"in m&&(d=m.detectType(o))),d||("value"in l?d=l.value.toLowerCase():m?d=m.defaultType:d=s3e),delete l.value;let g;u&&p?(o=dr._parseMultiValue(o,p,d,[],u,e.designSet,p),g=[h,l,d,o]):u?(g=[h,l,d],dr._parseMultiValue(o,u,d,g,null,e.designSet,!1)):p?(o=dr._parseMultiValue(o,p,d,[],null,e.designSet,p),g=[h,l,d,o]):(o=dr._parseValue(o,d,e.designSet,!1),g=[h,l,d,o]),e.component[0]==="vcard"&&e.component[1].length===0&&!(a==="version"&&o==="4.0")&&(e.designSet=fr.getDesignSet("vcard3")),e.component[1].push(g)};dr._parseValue=function(r,e,t,n){return e in t.value&&"fromICAL"in t.value[e]?t.value[e].fromICAL(r,n):r};dr._parseParameters=function(r,e,t){let n=e,i=0,s=i3e,a={},o,l,c,d=-1,u,p,m;for(;i!==!1&&(i=r.indexOf(s,i+1))!==-1;){if(o=r.slice(n+1,i),o.length==0)throw new Nd("Empty parameter name in '"+r+"'");if(l=o.toLowerCase(),m=!1,p=!1,l in t.param&&t.param[l].valueType?u=t.param[l].valueType:u=a3e,l in t.param&&(p=t.param[l].multiValue,t.param[l].multiValueSeparateDQuote&&(m=dr._rfc6868Escape('"'+p+'"'))),r[i+1]==='"'){if(d=i+2,i=r.indexOf('"',d),p&&i!=-1){let y=!0;for(;y;)r[i+1]==p&&r[i+2]=='"'?i=r.indexOf('"',i+3):y=!1}if(i===-1)throw new Nd('invalid line (no matching double quote) "'+r+'"');c=r.slice(d,i),n=r.indexOf(Y2,i);let g=r.indexOf(HM,i);(n===-1||g!==-1&&n>g)&&(i=!1)}else{d=i+1;let g=r.indexOf(Y2,d),y=r.indexOf(HM,d);y!==-1&&g>y?(g=y,i=!1):g===-1?(y===-1?g=r.length:g=y,i=!1):(n=g,i=g),c=r.slice(d,g)}let h=c.length;if(c=dr._rfc6868Escape(c),d+=h-c.length,p){let g=m||p;c=dr._parseMultiValue(c,g,u,[],null,t)}else c=dr._parseValue(c,u,t);p&&l in a?Array.isArray(a[l])?a[l].push(c):a[l]=[a[l],c]:a[l]=c}return[a,c,d]};dr._rfc6868Escape=function(r){return r.replace(/\^['n^]/g,function(e){return o3e[e]})};dr._parseMultiValue=function(r,e,t,n,i,s,a){let o=0,l=0,c;if(e.length===0)return r;for(;(o=Ehe(r,e,l))!==-1;)c=r.slice(l,o),i?c=dr._parseMultiValue(c,i,t,[],null,s,a):c=dr._parseValue(c,t,s,a),n.push(c),l=o+e.length;return c=r.slice(l),i?c=dr._parseMultiValue(c,i,t,[],null,s,a):c=dr._parseValue(c,t,s,a),n.push(c),n.length==1?n[0]:n};dr._eachLine=function(r,e){let t=r.length,n=r.search(n3e),i=n,s,a,o;do i=r.indexOf(` `,n)+1,i>1&&r[i-2]==="\r"?o=2:o=1,i===0&&(i=t,o=0),a=r[n],a===" "||a===" "?s+=r.slice(n+1,i-o):(s&&e(null,s),s=r.slice(n,i-o)),n=i;while(i!==t);s=s.trim(),s.length&&e(null,s)};l3e=["tzid","location","tznames","latitude","longitude"],Qt=class Qt{constructor(e){M(this,"tzid","");M(this,"location","");M(this,"tznames","");M(this,"latitude",0);M(this,"longitude",0);M(this,"component",null);M(this,"expandedUntilYear",0);M(this,"icalclass","icaltimezone");this.wrappedJSObject=this,this.fromData(e)}static _compare_change_fn(e,t){return e.yeart.year?1:e.montht.month?1:e.dayt.day?1:e.hourt.hour?1:e.minutet.minute?1:e.secondt.second?1:0}static convert_time(e,t,n){if(e.isDate||t.tzid==n.tzid||t==Qt.localTimezone||n==Qt.localTimezone)return e.zone=n,e;let i=t.utcOffset(e);return e.adjust(0,0,0,-i),i=n.utcOffset(e),e.adjust(0,0,0,i),null}static fromData(e){return new Qt().fromData(e)}static get utcTimezone(){return La(this,ov)||Bc(this,ov,Qt.fromData({tzid:"UTC"})),La(this,ov)}static get localTimezone(){return La(this,lv)||Bc(this,lv,Qt.fromData({tzid:"floating"})),La(this,lv)}static adjust_change(e,t,n,i,s){return xe.prototype.adjust.call(e,t,n,i,s,e)}fromData(e){if(this.expandedUntilYear=0,this.changes=[],e instanceof po)this.component=e;else{if(e&&"component"in e)if(typeof e.component=="string"){let t=dr(e.component);this.component=new po(t)}else e.component instanceof po?this.component=e.component:this.component=null;for(let t of l3e)e&&t in e&&(this[t]=e[t])}return this.component instanceof po&&!this.tzid&&(this.tzid=this.component.getFirstPropertyValue("tzid")),this}utcOffset(e){if(this==Qt.utcTimezone||this==Qt.localTimezone||(this._ensureCoverage(e.year),!this.changes.length))return 0;let t={year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second},n=this._findNearbyChange(t),i=-1,s=1;for(;;){let l=$f(this.changes[n],!0);if(l.utcOffset=0?i=n:s=-1,s==-1&&i!=-1)break;if(n+=s,n<0)return 0;if(n>=this.changes.length)break}let a=this.changes[i];if(a.utcOffset-a.prevUtcOffset<0&&i>0){let l=$f(a,!0);if(Qt.adjust_change(l,0,0,0,l.prevUtcOffset),Qt._compare_change_fn(t,l)<0){let c=this.changes[i-1],d=!1;a.is_daylight!=d&&c.is_daylight==d&&(a=c)}}return a.utcOffset}_findNearbyChange(e){let t=Lf(this.changes,e,Qt._compare_change_fn);return t>=this.changes.length?this.changes.length-1:t}_ensureCoverage(e){if(Qt._minimumExpansionYear==-1){let n=xe.now();Qt._minimumExpansionYear=n.year}let t=e;if(tt||!u));)s.year=u.year,s.month=u.month,s.day=u.day,s.hour=u.hour,s.minute=u.minute,s.second=u.second,s.isDate=u.isDate,Qt.adjust_change(s,0,0,0,-s.prevUtcOffset),n.push(s)}}return n}toString(){return this.tznames?this.tznames:this.tzid}};ov=new WeakMap,lv=new WeakMap,gm(Qt,ov,null),gm(Qt,lv,null),M(Qt,"_minimumExpansionYear",-1),M(Qt,"EXTRA_COVERAGE",5);mr=Qt,cs=null,UM={get count(){return cs===null?0:Object.keys(cs).length},reset:function(){cs=Object.create(null);let r=mr.utcTimezone;cs.Z=r,cs.UTC=r,cs.GMT=r},_hard_reset:function(){cs=null},has:function(r){return cs===null?!1:!!cs[r]},get:function(r){return cs===null&&this.reset(),cs[r]},register:function(r,e){if(cs===null&&this.reset(),typeof r=="string"&&e instanceof mr&&([r,e]=[e,r]),e||(r instanceof mr?e=r.tzid:r.name==="vtimezone"&&(r=new mr(r),e=r.tzid)),!e)throw new TypeError("Neither a timezone nor a name was passed");if(r instanceof mr)cs[e]=r;else throw new TypeError("timezone must be ICAL.Timezone or ICAL.Component")},remove:function(r){return cs===null?null:delete cs[r]}};d3e=Object.freeze({__proto__:null,binsearchInsert:Lf,clone:$f,extend:jf,foldline:Dhe,formatClassType:Ad,isStrictlyNaN:dx,pad2:zs,strictParseInt:qi,trunc:ni,unescapedIndexOf:Ehe,updateTimezones:c3e}),Id=class r{constructor(e){M(this,"hours",0);M(this,"minutes",0);M(this,"factor",1);M(this,"icaltype","utc-offset");this.fromData(e)}static fromString(e){let t={};return t.factor=e[0]==="+"?1:-1,t.hours=qi(e.slice(1,3)),t.minutes=qi(e.slice(4,6)),new r(t)}static fromSeconds(e){let t=new r;return t.fromSeconds(e),t}clone(){return r.fromSeconds(this.toSeconds())}fromData(e){if(e)for(let[t,n]of Object.entries(e))this[t]=n;this._normalize()}fromSeconds(e){let t=Math.abs(e);return this.factor=e<0?-1:1,this.hours=ni(t/3600),t-=this.hours*3600,this.minutes=ni(t/60),this}toSeconds(){return this.factor*(60*this.minutes+3600*this.hours)}compare(e){let t=this.toSeconds(),n=e.toSeconds();return(t>n)-(n>t)}_normalize(){let e=this.toSeconds(),t=this.factor;for(;e<-43200;)e+=97200;for(;e>50400;)e-=97200;this.fromSeconds(e),e==0&&(this.factor=t)}toICALString(){return fr.icalendar.value["utc-offset"].toICAL(this.toString())}toString(){return(this.factor==1?"+":"-")+zs(this.hours)+":"+zs(this.minutes)}},Of=class r extends xe{constructor(t,n,i){super(t,n);M(this,"icalclass","vcardtime");M(this,"icaltype","date-and-or-time");this.icaltype=i||"date-and-or-time"}static fromDateAndOrTimeString(t,n){function i(g,y,k){return g?qi(g.slice(y,y+k)):null}let s=t.split("T"),a=s[0],o=s[1],l=o?fr.vcard.value.time._splitZone(o):[],c=l[0],d=l[1],u=a?a.length:0,p=d?d.length:0,m=a&&a[0]=="-"&&a[1]=="-",f=d&&d[0]=="-",h={year:m?null:i(a,0,4),month:m&&(u==4||u==7)?i(a,2,2):u==7||u==10?i(a,5,2):null,day:u==5?i(a,3,2):u==7&&m?i(a,5,2):u==10?i(a,8,2):null,hour:f?null:i(d,0,2),minute:f&&p==3?i(d,1,2):p>4?f?i(d,1,2):i(d,3,2):null,second:p==4?i(d,2,2):p==6?i(d,4,2):p==8?i(d,6,2):null};return c=="Z"?c=mr.utcTimezone:c&&c[3]==":"?c=Id.fromString(c):c=null,new r(h,c,n)}clone(){return new r(this._time,this.zone,this.icaltype)}_normalize(){return this}utcOffset(){return this.zone instanceof Id?this.zone.toSeconds():xe.prototype.utcOffset.apply(this,arguments)}toICALString(){return fr.vcard.value[this.icaltype].toICAL(this.toString())}toString(){let t=this.year,n=this.month,i=this.day,s=this.hour,a=this.minute,o=this.second,l=t!==null,c=n!==null,d=i!==null,u=s!==null,p=a!==null,m=o!==null,f=(l?zs(t)+(c||d?"-":""):c||d?"--":"")+(c?zs(n):"")+(d?"-"+zs(i):""),h=(u?zs(s):"-")+(u&&p?":":"")+(p?zs(a):"")+(!u&&!p?"-":"")+(p&&m?":":"")+(m?zs(o):""),g;switch(this.zone===mr.utcTimezone?g="Z":this.zone instanceof Id?g=this.zone.toString():this.zone===mr.localTimezone?g="":this.zone instanceof mr?g=Id.fromSeconds(this.zone.utcOffset(this)).toString():g="",this.icaltype){case"time":return h+g;case"date-and-or-time":case"date-time":return f+(h=="--"?"":"T"+h+g);case"date":return f}return null}},js=class js{constructor(e){M(this,"completed",!1);M(this,"rule",null);M(this,"dtstart",null);M(this,"last",null);M(this,"occurrence_number",0);M(this,"by_indices",null);M(this,"initialized",!1);M(this,"by_data",null);M(this,"days",null);M(this,"days_index",0);this.fromData(e)}fromData(e){if(this.rule=Ad(e.rule,il),!this.rule)throw new Error("iterator requires a (ICAL.Recur) rule");if(this.dtstart=Ad(e.dtstart,xe),!this.dtstart)throw new Error("iterator requires a (ICAL.Time) dtstart");if(e.by_data?this.by_data=e.by_data:this.by_data=$f(this.rule.parts,!0),e.occurrence_number&&(this.occurrence_number=e.occurrence_number),this.days=e.days||[],e.last&&(this.last=Ad(e.last,xe)),this.by_indices=e.by_indices,this.by_indices||(this.by_indices={BYSECOND:0,BYMINUTE:0,BYHOUR:0,BYDAY:0,BYMONTH:0,BYWEEKNO:0,BYMONTHDAY:0}),this.initialized=e.initialized||!1,!this.initialized)try{this.init()}catch(t){if(t instanceof sv)this.completed=!0;else throw t}}init(){this.initialized=!0,this.last=this.dtstart.clone();let e=this.by_data;if("BYDAY"in e&&this.sort_byday_rules(e.BYDAY),"BYYEARDAY"in e&&("BYMONTH"in e||"BYWEEKNO"in e||"BYMONTHDAY"in e))throw new Error("Invalid BYYEARDAY rule");if("BYWEEKNO"in e&&"BYMONTHDAY"in e)throw new Error("BYWEEKNO does not fit to BYMONTHDAY");if(this.rule.freq=="MONTHLY"&&("BYYEARDAY"in e||"BYWEEKNO"in e))throw new Error("For MONTHLY recurrences neither BYYEARDAY nor BYWEEKNO may appear");if(this.rule.freq=="WEEKLY"&&("BYYEARDAY"in e||"BYMONTHDAY"in e))throw new Error("For WEEKLY recurrences neither BYMONTHDAY nor BYYEARDAY may appear");if(this.rule.freq!="YEARLY"&&"BYYEARDAY"in e)throw new Error("BYYEARDAY may only appear in YEARLY rules");if(this.last.second=this.setup_defaults("BYSECOND","SECONDLY",this.dtstart.second),this.last.minute=this.setup_defaults("BYMINUTE","MINUTELY",this.dtstart.minute),this.last.hour=this.setup_defaults("BYHOUR","HOURLY",this.dtstart.hour),this.last.day=this.setup_defaults("BYMONTHDAY","DAILY",this.dtstart.day),this.last.month=this.setup_defaults("BYMONTH","MONTHLY",this.dtstart.month),this.rule.freq=="WEEKLY")if("BYDAY"in e){let[,t]=this.ruleDayOfWeek(e.BYDAY[0],this.rule.wkst),n=t-this.last.dayOfWeek(this.rule.wkst);(this.last.dayOfWeek(this.rule.wkst)=0||n<0)&&(this.last.day+=n)}else{let t=il.numericDayToIcalDay(this.dtstart.dayOfWeek());e.BYDAY=[t]}if(this.rule.freq=="YEARLY"){let t=this.rule.until?this.rule.until.year:2e4;for(;this.last.year<=t&&(this.expand_year_days(this.last.year),!(this.days.length>0));)this.increment_year(this.rule.interval);if(this.days.length==0)throw new sv;if(!this._nextByYearDay()&&!this.next_year()&&!this.next_year()&&!this.next_year())throw new sv}if(this.rule.freq=="MONTHLY"){if(this.has_by_data("BYDAY")){let t=null,n=this.last.clone(),i=xe.daysInMonth(this.last.month,this.last.year);for(let s of this.by_data.BYDAY){this.last=n.clone();let[a,o]=this.ruleDayOfWeek(s),l=this.last.nthWeekDay(o,a);if(a>=6||a<=-6)throw new Error("Malformed values in BYDAY part");if(l>i||l<=0){if(t&&t.month==n.month)continue;for(;l>i||l<=0;)this.increment_month(),i=xe.daysInMonth(this.last.month,this.last.year),l=this.last.nthWeekDay(o,a)}this.last.day=l,(!t||this.last.compare(t)<0)&&(t=this.last.clone())}if(this.last=t.clone(),this.has_by_data("BYMONTHDAY")&&this._byDayAndMonthDay(!0),this.last.day>i||this.last.day==0)throw new Error("Malformed values in BYDAY part")}else if(this.has_by_data("BYMONTHDAY")){this.last.day=1;let t=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY).filter(n=>n>=this.last.day);if(t.length)this.last.day=t[0],this.by_data.BYMONTHDAY=t;else if(!this.next_month()&&!this.next_month()&&!this.next_month())throw new sv}}}next(e=!1){let t=this.last?this.last.clone():null;if((this.rule.count&&this.occurrence_number>=this.rule.count||this.rule.until&&this.last.compare(this.rule.until)>0)&&(this.completed=!0),this.completed)return null;if(this.occurrence_number==0&&this.last.compare(this.dtstart)>=0)return this.occurrence_number++,this.last;let n,i=0;do switch(n=1,this.rule.freq){case"SECONDLY":this.next_second();break;case"MINUTELY":this.next_minute();break;case"HOURLY":this.next_hour();break;case"DAILY":this.next_day();break;case"WEEKLY":this.next_week();break;case"MONTHLY":if(n=this.next_month(),n)i=0;else if(++i==336)return this.completed=!0,null;break;case"YEARLY":if(n=this.next_year(),n)i=0;else if(++i==28)return this.completed=!0,null;break;default:return null}while(!this.check_contracting_rules()||this.last.compare(this.dtstart)<0||!n);if(this.last.compare(t)==0){if(e)throw new Error("Same occurrence found twice, protecting you from death by recursion");this.next(!0)}return this.rule.until&&this.last.compare(this.rule.until)>0?(this.completed=!0,null):(this.occurrence_number++,this.last)}next_second(){return this.next_generic("BYSECOND","SECONDLY","second","minute")}increment_second(e){return this.increment_generic(e,"second",60,"minute")}next_minute(){return this.next_generic("BYMINUTE","MINUTELY","minute","hour","next_second")}increment_minute(e){return this.increment_generic(e,"minute",60,"hour")}next_hour(){return this.next_generic("BYHOUR","HOURLY","hour","monthday","next_minute")}increment_hour(e){this.increment_generic(e,"hour",24,"monthday")}next_day(){let e=this.rule.freq=="DAILY";return this.next_hour()==0||(e?this.increment_monthday(this.rule.interval):this.increment_monthday(1)),0}next_week(){let e=0;if(this.next_weekday_by_week()==0)return e;if(this.has_by_data("BYWEEKNO")){this.by_indices.BYWEEKNO++,this.by_indices.BYWEEKNO==this.by_data.BYWEEKNO.length&&(this.by_indices.BYWEEKNO=0,e=1),this.last.month=1,this.last.day=1;let t=this.by_data.BYWEEKNO[this.by_indices.BYWEEKNO];this.last.day+=7*t,e&&this.increment_year(1)}else this.increment_monthday(7*this.rule.interval);return e}normalizeByMonthDayRules(e,t,n){let i=xe.daysInMonth(t,e),s=[],a=0,o=n.length,l;for(;ai)){if(l<0)l=i+(l+1);else if(l===0)continue;s.indexOf(l)===-1&&s.push(l)}}return s.sort(function(c,d){return c-d})}_byDayAndMonthDay(e){let t,n=this.by_data.BYDAY,i,s=0,a,o=n.length,l=0,c,d=this,u=this.last.day;function p(){for(c=xe.daysInMonth(d.last.month,d.last.year),t=d.normalizeByMonthDayRules(d.last.year,d.last.month,d.by_data.BYMONTHDAY),a=t.length;t[s]<=u&&!(e&&t[s]==u)&&sc){m();continue}let h=t[s++];if(h>=i)u=h;else{m();continue}for(let g=0;gt&&(this.last.day=1,this.increment_month(),this.is_day_in_byday(this.last)?(!this.has_by_data("BYSETPOS")||this.check_set_position(1))&&(e=1):e=0)}else if(this.has_by_data("BYMONTHDAY")){if(this.by_indices.BYMONTHDAY++,this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length&&(this.by_indices.BYMONTHDAY=0,this.increment_month(),this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length))return 0;let t=xe.daysInMonth(this.last.month,this.last.year),n=this.by_data.BYMONTHDAY[this.by_indices.BYMONTHDAY];n<0&&(n=t+n+1),n>t?(this.last.day=1,e=this.is_day_in_byday(this.last)):this.last.day=n}else{this.increment_month();let t=xe.daysInMonth(this.last.month,this.last.year);this.by_data.BYMONTHDAY[0]>t?e=0:this.last.day=this.by_data.BYMONTHDAY[0]}return e}next_weekday_by_week(){let e=0;if(this.next_hour()==0)return e;if(!this.has_by_data("BYDAY"))return 1;for(;;){let t=new xe;this.by_indices.BYDAY++,this.by_indices.BYDAY==Object.keys(this.by_data.BYDAY).length&&(this.by_indices.BYDAY=0,e=1);let n=this.by_data.BYDAY[this.by_indices.BYDAY],s=this.ruleDayOfWeek(n)[1];s-=this.rule.wkst,s<0&&(s+=7),t.year=this.last.year,t.month=this.last.month,t.day=this.last.day;let a=t.startDoyWeek(this.rule.wkst);if(s+a<1&&!e)continue;let o=xe.fromDayOfYear(a+s,this.last.year);return this.last.year=o.year,this.last.month=o.month,this.last.day=o.day,e}}next_year(){return this.next_hour()==0||(this.days.length==0||++this.days_index==this.days.length)&&(this.days_index=0,this.increment_year(this.rule.interval),this.has_by_data("BYMONTHDAY")&&(this.by_data.BYMONTHDAY=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY)),this.expand_year_days(this.last.year),this.days.length==0)?0:this._nextByYearDay()}_nextByYearDay(){let e=this.days[this.days_index],t=this.last.year;if(Math.abs(e)==366&&!xe.isLeapYear(this.last.year))return 0;e<1&&(e+=1,t+=1);let n=xe.fromDayOfYear(e,t);return this.last.day=n.day,this.last.month=n.month,1}ruleDayOfWeek(e,t){let n=e.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);if(n){let i=parseInt(n[1]||0,10);return e=il.icalDayToNumericDay(n[2],t),[i,e]}else return[0,0]}next_generic(e,t,n,i,s){let a=e in this.by_data,o=this.rule.freq==t,l=0;if(s&&this[s]()==0)return l;if(a){this.by_indices[e]++;let c=this.by_data[e];this.by_indices[e]==c.length&&(this.by_indices[e]=0,l=1),this.last[n]=c[this.by_indices[e]]}else o&&this["increment_"+n](this.rule.interval);return a&&l&&o&&this["increment_"+i](1),l}increment_monthday(e){for(let t=0;tn&&(this.last.day-=n,this.increment_month())}}increment_month(){if(this.last.day=1,this.has_by_data("BYMONTH"))this.by_indices.BYMONTH++,this.by_indices.BYMONTH==this.by_data.BYMONTH.length&&(this.by_indices.BYMONTH=0,this.increment_year(1)),this.last.month=this.by_data.BYMONTH[this.by_indices.BYMONTH];else{this.rule.freq=="MONTHLY"?this.last.month+=this.rule.interval:this.last.month++,this.last.month--;let e=ni(this.last.month/12);this.last.month%=12,this.last.month++,e!=0&&this.increment_year(e)}this.has_by_data("BYMONTHDAY")&&(this.by_data.BYMONTHDAY=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY))}increment_year(e){this.last.day=1,this.last.year+=e}increment_generic(e,t,n,i){this.last[t]+=e;let s=ni(this.last[t]/n);this.last[t]%=n,s!=0&&this["increment_"+i](s)}has_by_data(e){return e in this.rule.parts}expand_year_days(e){let t=new xe;this.days=[];let n={},i=["BYDAY","BYWEEKNO","BYMONTHDAY","BYMONTH","BYYEARDAY"];for(let o of i)o in this.rule.parts&&(n[o]=this.rule.parts[o]);if("BYMONTH"in n&&"BYWEEKNO"in n){let o=1,l={};t.year=e,t.isDate=!0;for(let c=0;c0?(g=y+(f-1)*7,g<=l&&this.days.push(d+g)):(g=k+(f+1)*7,g>0&&this.days.push(d+g))}}this.days.sort(function(o,l){return o-l})}else if(s==2&&"BYDAY"in n&&"BYMONTHDAY"in n){let o=this.expand_by_day(e);for(let l of o){let c=xe.fromDayOfYear(l,e);this.by_data.BYMONTHDAY.indexOf(c.day)>=0&&this.days.push(l)}}else if(s==3&&"BYDAY"in n&&"BYMONTHDAY"in n&&"BYMONTH"in n){let o=this.expand_by_day(e);for(let l of o){let c=xe.fromDayOfYear(l,e);this.by_data.BYMONTH.indexOf(c.month)>=0&&this.by_data.BYMONTHDAY.indexOf(c.day)>=0&&this.days.push(l)}}else if(s==2&&"BYDAY"in n&&"BYWEEKNO"in n){let o=this.expand_by_day(e);for(let l of o){let d=xe.fromDayOfYear(l,e).weekNumber(this.rule.wkst);this.by_data.BYWEEKNO.indexOf(d)&&this.days.push(l)}}else if(!(s==3&&"BYDAY"in n&&"BYWEEKNO"in n&&"BYMONTHDAY"in n))if(s==1&&"BYYEARDAY"in n)this.days=this.days.concat(this.by_data.BYYEARDAY);else if(s==2&&"BYYEARDAY"in n&&"BYDAY"in n){let o=xe.isLeapYear(e)?366:365,l=new Set(this.expand_by_day(e));for(let c of this.by_data.BYYEARDAY)c<0&&(c+=o+1),l.has(c)&&this.days.push(c)}else this.days=[]}}let a=xe.isLeapYear(e)?366:365;return this.days.sort((o,l)=>(o<0&&(o+=a+1),l<0&&(l+=a+1),o-l)),0}expand_by_day(e){let t=[],n=this.last.clone();n.year=e,n.month=1,n.day=1,n.isDate=!0;let i=n.dayOfWeek();n.month=12,n.day=31,n.isDate=!0;let s=n.dayOfWeek(),a=n.dayOfYear();for(let o of this.by_data.BYDAY){let l=this.ruleDayOfWeek(o),c=l[0],d=l[1];if(c==0){let u=(d+7-i)%7+1;for(let p=u;p<=a;p+=7)t.push(p)}else if(c>0){let u;d>=i?u=d-i+1:u=d-i+8,t.push(u+(c-1)*7)}else{let u;c=-c,d<=s?u=a-s+d:u=a-s+d-7,t.push(u-(c-1)*7)}}return t}is_day_in_byday(e){if(this.by_data.BYDAY)for(let t of this.by_data.BYDAY){let n=this.ruleDayOfWeek(t),i=n[0],s=n[1],a=e.dayOfWeek();if(i==0&&s==a||e.nthWeekDay(s,i)==e.day)return 1}return 0}check_set_position(e){return this.has_by_data("BYSETPOS")?this.by_data.BYSETPOS.indexOf(e)!==-1:!1}sort_byday_rules(e){for(let t=0;ts){let a=e[t];e[t]=e[n],e[n]=a}}}check_contract_restriction(e,t){let n=js._indexMap[e],i=js._expandMap[this.rule.freq][n],s=!1;if(e in this.by_data&&i==js.CONTRACT){let a=this.by_data[e];for(let o of a)if(o==t){s=!0;break}}else s=!0;return s}check_contracting_rules(){let e=this.last.dayOfWeek(),t=this.last.weekNumber(this.rule.wkst),n=this.last.dayOfYear();return this.check_contract_restriction("BYSECOND",this.last.second)&&this.check_contract_restriction("BYMINUTE",this.last.minute)&&this.check_contract_restriction("BYHOUR",this.last.hour)&&this.check_contract_restriction("BYDAY",il.numericDayToIcalDay(e))&&this.check_contract_restriction("BYWEEKNO",t)&&this.check_contract_restriction("BYMONTHDAY",this.last.day)&&this.check_contract_restriction("BYMONTH",this.last.month)&&this.check_contract_restriction("BYYEARDAY",n)}setup_defaults(e,t,n){let i=js._indexMap[e];return js._expandMap[this.rule.freq][i]!=js.CONTRACT&&(e in this.by_data||(this.by_data[e]=[n]),this.rule.freq!=t)?this.by_data[e][0]:n}toJSON(){let e=Object.create(null);return e.initialized=this.initialized,e.rule=this.rule.toJSON(),e.dtstart=this.dtstart.toJSON(),e.by_data=this.by_data,e.days=this.days,e.last=this.last.toJSON(),e.by_indices=this.by_indices,e.occurrence_number=this.occurrence_number,e}};M(js,"_indexMap",{BYSECOND:0,BYMINUTE:1,BYHOUR:2,BYDAY:3,BYMONTHDAY:4,BYYEARDAY:5,BYWEEKNO:6,BYMONTH:7,BYSETPOS:8}),M(js,"_expandMap",{SECONDLY:[1,1,1,1,1,1,1,1],MINUTELY:[2,1,1,1,1,1,1,1],HOURLY:[2,2,1,1,1,1,1,1],DAILY:[2,2,2,1,1,1,1,1],WEEKLY:[2,2,2,2,3,3,1,1],MONTHLY:[2,2,2,2,2,3,3,1],YEARLY:[2,2,2,2,2,2,2,2]}),M(js,"UNKNOWN",0),M(js,"CONTRACT",1),M(js,"EXPAND",2),M(js,"ILLEGAL",3);ux=js,sv=class extends Error{constructor(){super("Recurrence rule has no valid occurrences")}},u3e=/^(SU|MO|TU|WE|TH|FR|SA)$/,p3e=/^([+-])?(5[0-3]|[1-4][0-9]|[1-9])?(SU|MO|TU|WE|TH|FR|SA)$/,Che={SU:xe.SUNDAY,MO:xe.MONDAY,TU:xe.TUESDAY,WE:xe.WEDNESDAY,TH:xe.THURSDAY,FR:xe.FRIDAY,SA:xe.SATURDAY},m3e=Object.fromEntries(Object.entries(Che).map(r=>r.reverse())),fhe=["SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"],il=class r{constructor(e){M(this,"parts",null);M(this,"interval",1);M(this,"wkst",xe.MONDAY);M(this,"until",null);M(this,"count",null);M(this,"freq",null);M(this,"icalclass","icalrecur");M(this,"icaltype","recur");this.wrappedJSObject=this,this.parts={},e&&typeof e=="object"&&this.fromData(e)}static fromString(e){let t=this._stringToData(e,!1);return new r(t)}static fromData(e){return new r(e)}static _stringToData(e,t){let n=Object.create(null),i=e.split(";"),s=i.length;for(let a=0;a7&&(i-=7),m3e[i]}iterator(e){return new ux({rule:this,dtstart:e})}clone(){return new r(this.toJSON())}isFinite(){return!!(this.count||this.until)}isByCount(){return!!(this.count&&!this.until)}addComponent(e,t){let n=e.toUpperCase();n in this.parts?this.parts[n].push(t):this.parts[n]=[t]}setComponent(e,t){this.parts[e.toUpperCase()]=t.slice()}getComponent(e){let t=e.toUpperCase();return t in this.parts?this.parts[t].slice():[]}getNextOccurrence(e,t){let n=this.iterator(e),i;do i=n.next();while(i&&i.compare(t)<=0);return i&&t.zone&&(i.zone=t.zone),i}fromData(e){for(let t in e){let n=t.toUpperCase();n in W2?Array.isArray(e[t])?this.parts[n]=e[t]:this.parts[n]=[e[t]]:this[t]=e[t]}this.interval&&typeof this.interval!="number"&&V2.INTERVAL(this.interval,this),this.wkst&&typeof this.wkst!="number"&&(this.wkst=r.icalDayToNumericDay(this.wkst)),this.until&&!(this.until instanceof xe)&&(this.until=xe.fromString(this.until))}toJSON(){let e=Object.create(null);e.freq=this.freq,this.count&&(e.count=this.count),this.interval>1&&(e.interval=this.interval);for(let[t,n]of Object.entries(this.parts))Array.isArray(n)&&n.length==1?e[t.toLowerCase()]=n[0]:e[t.toLowerCase()]=$f(n);return this.until&&(e.until=this.until.toString()),"wkst"in this&&this.wkst!==xe.DEFAULT_WEEK_START&&(e.wkst=r.numericDayToIcalDay(this.wkst)),e}toString(){let e="FREQ="+this.freq;this.count&&(e+=";COUNT="+this.count),this.interval>1&&(e+=";INTERVAL="+this.interval);for(let[t,n]of Object.entries(this.parts))e+=";"+t+"="+n;return this.until&&(e+=";UNTIL="+this.until.toICALString()),"wkst"in this&&this.wkst!==xe.DEFAULT_WEEK_START&&(e+=";WKST="+r.numericDayToIcalDay(this.wkst)),e}};V2={FREQ:function(r,e,t){if(fhe.indexOf(r)!==-1)e.freq=r;else throw new Error('invalid frequency "'+r+'" expected: "'+fhe.join(", ")+'"')},COUNT:function(r,e,t){e.count=qi(r)},INTERVAL:function(r,e,t){e.interval=qi(r),e.interval<1&&(e.interval=1)},UNTIL:function(r,e,t){r.length>10?e.until=fr.icalendar.value["date-time"].fromICAL(r):e.until=fr.icalendar.value.date.fromICAL(r),t||(e.until=xe.fromString(e.until))},WKST:function(r,e,t){if(u3e.test(r))e.wkst=il.icalDayToNumericDay(r);else throw new Error('invalid WKST value "'+r+'"')}},W2={BYSECOND:fp.bind(void 0,"BYSECOND",0,60),BYMINUTE:fp.bind(void 0,"BYMINUTE",0,59),BYHOUR:fp.bind(void 0,"BYHOUR",0,23),BYDAY:function(r){if(p3e.test(r))return r;throw new Error('invalid BYDAY value "'+r+'"')},BYMONTHDAY:fp.bind(void 0,"BYMONTHDAY",-31,31),BYYEARDAY:fp.bind(void 0,"BYYEARDAY",-366,366),BYWEEKNO:fp.bind(void 0,"BYWEEKNO",-53,53),BYMONTH:fp.bind(void 0,"BYMONTH",1,12),BYSETPOS:fp.bind(void 0,"BYSETPOS",-366,366)},f3e=/\\\\|\\;|\\,|\\[Nn]/g,h3e=/\\|;|,|\n/g,hhe=/\\\\|\\,|\\[Nn]/g,ghe=/\\|,|\n/g;Jt={defaultType:"text"},px={defaultType:"text",multiValue:","},VM={defaultType:"text",structuredValue:";"},LM={defaultType:"integer"},FM={defaultType:"date-time",allowedTypes:["date-time","date"]},$M={defaultType:"date-time"},$s={defaultType:"uri"},yhe={defaultType:"utc-offset"},vhe={defaultType:"recur"},bhe={defaultType:"date-and-or-time",allowedTypes:["date-time","date","text"]};Z2={categories:px,url:$s,version:Jt,uid:Jt},Q2={boolean:{values:["TRUE","FALSE"],fromICAL:function(r){switch(r){case"TRUE":return!0;case"FALSE":return!1;default:return!1}},toICAL:function(r){return r?"TRUE":"FALSE"}},float:{matches:/^[+-]?\d+\.\d+$/,fromICAL:function(r){let e=parseFloat(r);return dx(e)?0:e},toICAL:function(r){return String(r)}},integer:{fromICAL:function(r){let e=parseInt(r);return dx(e)?0:e},toICAL:function(r){return String(r)}},"utc-offset":{toICAL:function(r){return r.length<7?r.slice(0,3)+r.slice(4,6):r.slice(0,3)+r.slice(4,6)+r.slice(7,9)},fromICAL:function(r){return r.length<6?r.slice(0,3)+":"+r.slice(3,5):r.slice(0,3)+":"+r.slice(3,5)+":"+r.slice(5,7)},decorate:function(r){return Id.fromString(r)},undecorate:function(r){return r.toString()}}},v3e={cutype:{values:["INDIVIDUAL","GROUP","RESOURCE","ROOM","UNKNOWN"],allowXName:!0,allowIanaToken:!0},"delegated-from":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},"delegated-to":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},encoding:{values:["8BIT","BASE64"]},fbtype:{values:["FREE","BUSY","BUSY-UNAVAILABLE","BUSY-TENTATIVE"],allowXName:!0,allowIanaToken:!0},member:{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},partstat:{values:["NEEDS-ACTION","ACCEPTED","DECLINED","TENTATIVE","DELEGATED","COMPLETED","IN-PROCESS"],allowXName:!0,allowIanaToken:!0},range:{values:["THISANDFUTURE"]},related:{values:["START","END"]},reltype:{values:["PARENT","CHILD","SIBLING"],allowXName:!0,allowIanaToken:!0},role:{values:["REQ-PARTICIPANT","CHAIR","OPT-PARTICIPANT","NON-PARTICIPANT"],allowXName:!0,allowIanaToken:!0},rsvp:{values:["TRUE","FALSE"]},"sent-by":{valueType:"cal-address"},tzid:{matches:/^\//},value:{values:["binary","boolean","cal-address","date","date-time","duration","float","integer","period","recur","text","time","uri","utc-offset"],allowXName:!0,allowIanaToken:!0}},An=jf(Q2,{text:G2(f3e,h3e),uri:{},binary:{decorate:function(r){return qM.fromString(r)},undecorate:function(r){return r.toString()}},"cal-address":{},date:{decorate:function(r,e){return fr.strict?xe.fromDateString(r,e):xe.fromString(r,e)},undecorate:function(r){return r.toString()},fromICAL:function(r){return!fr.strict&&r.length>=15?An["date-time"].fromICAL(r):r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6,8)},toICAL:function(r){let e=r.length;return e==10?r.slice(0,4)+r.slice(5,7)+r.slice(8,10):e>=19?An["date-time"].toICAL(r):r}},"date-time":{fromICAL:function(r){if(!fr.strict&&r.length==8)return An.date.fromICAL(r);{let e=r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6,8)+"T"+r.slice(9,11)+":"+r.slice(11,13)+":"+r.slice(13,15);return r[15]&&r[15]==="Z"&&(e+="Z"),e}},toICAL:function(r){let e=r.length;if(e==10&&!fr.strict)return An.date.toICAL(r);if(e>=19){let t=r.slice(0,4)+r.slice(5,7)+r.slice(8,13)+r.slice(14,16)+r.slice(17,19);return r[19]&&r[19]==="Z"&&(t+="Z"),t}else return r},decorate:function(r,e){return fr.strict?xe.fromDateTimeString(r,e):xe.fromString(r,e)},undecorate:function(r){return r.toString()}},duration:{decorate:function(r){return Ca.fromString(r)},undecorate:function(r){return r.toString()}},period:{fromICAL:function(r){let e=r.split("/");return e[0]=An["date-time"].fromICAL(e[0]),Ca.isValueString(e[1])||(e[1]=An["date-time"].fromICAL(e[1])),e},toICAL:function(r){return r=r.slice(),!fr.strict&&r[0].length==10?r[0]=An.date.toICAL(r[0]):r[0]=An["date-time"].toICAL(r[0]),Ca.isValueString(r[1])||(!fr.strict&&r[1].length==10?r[1]=An.date.toICAL(r[1]):r[1]=An["date-time"].toICAL(r[1])),r.join("/")},decorate:function(r,e){return cx.fromJSON(r,e,!fr.strict)},undecorate:function(r){return r.toJSON()}},recur:{fromICAL:function(r){return il._stringToData(r,!0)},toICAL:function(r){let e="";for(let[t,n]of Object.entries(r))t=="until"?n.length>10?n=An["date-time"].toICAL(n):n=An.date.toICAL(n):t=="wkst"?typeof n=="number"&&(n=il.numericDayToIcalDay(n)):Array.isArray(n)&&(n=n.join(",")),e+=t.toUpperCase()+"="+n+";";return e.slice(0,Math.max(0,e.length-1))},decorate:function(e){return il.fromData(e)},undecorate:function(r){return r.toJSON()}},time:{fromICAL:function(r){if(r.length<6)return r;let e=r.slice(0,2)+":"+r.slice(2,4)+":"+r.slice(4,6);return r[6]==="Z"&&(e+="Z"),e},toICAL:function(r){if(r.length<8)return r;let e=r.slice(0,2)+r.slice(3,5)+r.slice(6,8);return r[8]==="Z"&&(e+="Z"),e}}}),b3e=jf(Z2,{action:Jt,attach:{defaultType:"uri"},attendee:{defaultType:"cal-address"},calscale:Jt,class:Jt,comment:Jt,completed:$M,contact:Jt,created:$M,description:Jt,dtend:FM,dtstamp:$M,dtstart:FM,due:FM,duration:{defaultType:"duration"},exdate:{defaultType:"date-time",allowedTypes:["date-time","date"],multiValue:","},exrule:vhe,freebusy:{defaultType:"period",multiValue:","},geo:{defaultType:"float",structuredValue:";"},"last-modified":$M,location:Jt,method:Jt,organizer:{defaultType:"cal-address"},"percent-complete":LM,priority:LM,prodid:Jt,"related-to":Jt,repeat:LM,rdate:{defaultType:"date-time",allowedTypes:["date-time","date","period"],multiValue:",",detectType:function(r){return r.indexOf("/")!==-1?"period":r.indexOf("T")===-1?"date":"date-time"}},"recurrence-id":FM,resources:px,"request-status":VM,rrule:vhe,sequence:LM,status:Jt,summary:Jt,transp:Jt,trigger:{defaultType:"duration",allowedTypes:["duration","date-time"]},tzoffsetfrom:yhe,tzoffsetto:yhe,tzurl:$s,tzid:Jt,tzname:Jt}),Da=jf(Q2,{text:G2(hhe,ghe),uri:G2(hhe,ghe),date:{decorate:function(r){return Of.fromDateAndOrTimeString(r,"date")},undecorate:function(r){return r.toString()},fromICAL:function(r){return r.length==8?An.date.fromICAL(r):r[0]=="-"&&r.length==6?r.slice(0,4)+"-"+r.slice(4):r},toICAL:function(r){return r.length==10?An.date.toICAL(r):r[0]=="-"&&r.length==7?r.slice(0,4)+r.slice(5):r}},time:{decorate:function(r){return Of.fromDateAndOrTimeString("T"+r,"time")},undecorate:function(r){return r.toString()},fromICAL:function(r){let e=Da.time._splitZone(r,!0),t=e[0],n=e[1];return n.length==6?n=n.slice(0,2)+":"+n.slice(2,4)+":"+n.slice(4,6):n.length==4&&n[0]!="-"?n=n.slice(0,2)+":"+n.slice(2,4):n.length==5&&(n=n.slice(0,3)+":"+n.slice(3,5)),t.length==5&&(t[0]=="-"||t[0]=="+")&&(t=t.slice(0,3)+":"+t.slice(3)),n+t},toICAL:function(r){let e=Da.time._splitZone(r),t=e[0],n=e[1];return n.length==8?n=n.slice(0,2)+n.slice(3,5)+n.slice(6,8):n.length==5&&n[0]!="-"?n=n.slice(0,2)+n.slice(3,5):n.length==6&&(n=n.slice(0,3)+n.slice(4,6)),t.length==6&&(t[0]=="-"||t[0]=="+")&&(t=t.slice(0,3)+t.slice(4)),n+t},_splitZone:function(r,e){let t=r.length-1,n=r.length-(e?5:6),i=r[n],s,a;return r[t]=="Z"?(s=r[t],a=r.slice(0,Math.max(0,t))):r.length>6&&(i=="-"||i=="+")?(s=r.slice(n),a=r.slice(0,Math.max(0,n))):(s="",a=r),[s,a]}},"date-time":{decorate:function(r){return Of.fromDateAndOrTimeString(r,"date-time")},undecorate:function(r){return r.toString()},fromICAL:function(r){return Da["date-and-or-time"].fromICAL(r)},toICAL:function(r){return Da["date-and-or-time"].toICAL(r)}},"date-and-or-time":{decorate:function(r){return Of.fromDateAndOrTimeString(r,"date-and-or-time")},undecorate:function(r){return r.toString()},fromICAL:function(r){let e=r.split("T");return(e[0]?Da.date.fromICAL(e[0]):"")+(e[1]?"T"+Da.time.fromICAL(e[1]):"")},toICAL:function(r){let e=r.split("T");return Da.date.toICAL(e[0])+(e[1]?"T"+Da.time.toICAL(e[1]):"")}},timestamp:An["date-time"],"language-tag":{matches:/^[a-zA-Z0-9-]+$/},"phone-number":{fromICAL:function(r){return Array.from(r).filter(function(e){return e==="\\"?void 0:e}).join("")},toICAL:function(r){return Array.from(r).map(function(e){return e===","||e===";"?"\\"+e:e}).join("")}}}),T3e={type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","time","date-time","date-and-or-time","timestamp","boolean","integer","float","utc-offset","language-tag"],allowXName:!0,allowIanaToken:!0}},k3e=jf(Z2,{adr:{defaultType:"text",structuredValue:";",multiValue:","},anniversary:bhe,bday:bhe,caladruri:$s,caluri:$s,clientpidmap:VM,email:Jt,fburl:$s,fn:Jt,gender:VM,geo:$s,impp:$s,key:$s,kind:Jt,lang:{defaultType:"language-tag"},logo:$s,member:$s,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:px,note:Jt,org:{defaultType:"text",structuredValue:";"},photo:$s,related:$s,rev:{defaultType:"timestamp"},role:Jt,sound:$s,source:$s,tel:{defaultType:"uri",allowedTypes:["uri","text"]},title:Jt,tz:{defaultType:"text",allowedTypes:["text","utc-offset","uri"]},xml:Jt}),w3e=jf(Q2,{binary:An.binary,date:Da.date,"date-time":Da["date-time"],"phone-number":Da["phone-number"],uri:An.uri,text:Da.text,time:An.time,vcard:An.text,"utc-offset":{toICAL:function(r){return r.slice(0,7)},fromICAL:function(r){return r.slice(0,7)},decorate:function(r){return Id.fromString(r)},undecorate:function(r){return r.toString()}}}),S3e={type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","date-time","phone-number","time","boolean","integer","float","utc-offset","vcard","binary"],allowXName:!0,allowIanaToken:!0}},x3e=jf(Z2,{fn:Jt,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:px,photo:{defaultType:"binary",allowedTypes:["binary","uri"]},bday:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(r){return r.indexOf("T")===-1?"date":"date-time"}},adr:{defaultType:"text",structuredValue:";",multiValue:","},label:Jt,tel:{defaultType:"phone-number"},email:Jt,mailer:Jt,tz:{defaultType:"utc-offset",allowedTypes:["utc-offset","text"]},geo:{defaultType:"float",structuredValue:";"},title:Jt,role:Jt,logo:{defaultType:"binary",allowedTypes:["binary","uri"]},agent:{defaultType:"vcard",allowedTypes:["vcard","text","uri"]},org:VM,note:px,prodid:Jt,rev:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(r){return r.indexOf("T")===-1?"date":"date-time"}},"sort-string":Jt,sound:{defaultType:"binary",allowedTypes:["binary","uri"]},class:Jt,key:{defaultType:"binary",allowedTypes:["binary","text"]}}),Md={name:"ical",value:An,param:v3e,property:b3e,propertyGroups:!1},The={name:"vcard4",value:Da,param:T3e,property:k3e,propertyGroups:!0},khe={name:"vcard3",value:w3e,param:S3e,property:x3e,propertyGroups:!0},fr={strict:!0,defaultSet:Md,defaultType:"unknown",components:{vcard:The,vcard3:khe,vevent:Md,vtodo:Md,vjournal:Md,valarm:Md,vtimezone:Md,daylight:Md,standard:Md},icalendar:Md,vcard:The,vcard3:khe,getDesignSet:function(r){return r&&r in fr.components?fr.components[r]:fr.defaultSet}},BM=`\r `,whe="unknown",E3e={'"':"^'","\n":"^n","^":"^^"};sn.component=function(r,e){let t=r[0].toUpperCase(),n="BEGIN:"+t+BM,i=r[1],s=0,a=i.length,o=r[0];for(o==="vcard"&&r[1].length>0&&!(r[1][0][0]==="version"&&r[1][0][3]==="4.0")&&(o="vcard3"),e=e||fr.getDesignSet(o);s0&&typeof e[0]=="object"&&"icaltype"in e[0]&&this.resetType(e[0].icaltype),this.isDecorated)for(;n=0;a--)(!n||s[a][gp]===n)&&this._removeObjectByIndex(e,i,a)}addSubcomponent(e){this._components||(this._components=[],this._hydratedComponentCount=0),e.parent&&e.parent.removeSubcomponent(e);let t=this.jCal[yp].push(e.jCal);return this._components[t-1]=e,this._hydratedComponentCount++,e.parent=this,e}removeSubcomponent(e){let t=this._removeObject(yp,"_components",e);return t&&this._hydratedComponentCount--,t}removeAllSubcomponents(e){let t=this._removeAllObjects(yp,"_components",e);return this._hydratedComponentCount=0,t}addProperty(e){if(!(e instanceof Ff))throw new TypeError("must be instance of ICAL.Property");this._properties||(this._properties=[],this._hydratedPropertyCount=0),e.parent&&e.parent.removeProperty(e);let t=this.jCal[sc].push(e.jCal);return this._properties[t-1]=e,this._hydratedPropertyCount++,e.parent=this,e}addPropertyWithValue(e,t){let n=new Ff(e);return n.setValue(t),this.addProperty(n),n}updatePropertyWithValue(e,t){let n=this.getFirstProperty(e);return n?n.setValue(t):n=this.addPropertyWithValue(e,t),n}removeProperty(e){let t=this._removeObject(sc,"_properties",e);return t&&this._hydratedPropertyCount--,t}removeAllProperties(e){let t=this._removeAllObjects(sc,"_properties",e);return this._hydratedPropertyCount=0,t}toJSON(){return this.jCal}toString(){return sn.component(this.jCal,this._designSet)}getTimeZoneByID(e){if(this.parent)return this.parent.getTimeZoneByID(e);if(!this._timezoneCache)return null;if(this._timezoneCache.has(e))return this._timezoneCache.get(e);let t=this.getAllSubcomponents("vtimezone");for(let n of t)if(n.getFirstProperty("tzid").getFirstValue()===e){let i=new mr({component:n,tzid:e});return this._timezoneCache.set(e,i),i}return null}},WM=class{constructor(e){M(this,"complete",!1);M(this,"ruleIterators",null);M(this,"ruleDates",null);M(this,"exDates",null);M(this,"ruleDateInc",0);M(this,"exDateInc",0);M(this,"exDate",null);M(this,"ruleDate",null);M(this,"dtstart",null);M(this,"last",null);this.ruleDates=[],this.exDates=[],this.fromData(e)}fromData(e){let t=Ad(e.dtstart,xe);if(t)this.dtstart=t;else throw new Error(".dtstart (ICAL.Time) must be given");if(e.component)this._init(e.component);else{if(this.last=Ad(e.last,xe)||t.clone(),!e.ruleIterators)throw new Error(".ruleIterators or .component must be given");this.ruleIterators=e.ruleIterators.map(function(n){return Ad(n,ux)}),this.ruleDateInc=e.ruleDateInc,this.exDateInc=e.exDateInc,e.ruleDates&&(this.ruleDates=e.ruleDates.map(n=>Ad(n,xe)),this.ruleDate=this.ruleDates[this.ruleDateInc]),e.exDates&&(this.exDates=e.exDates.map(n=>Ad(n,xe)),this.exDate=this.exDates[this.exDateInc]),typeof e.complete!="undefined"&&(this.complete=e.complete)}}_compare_special(e,t){return!e.isDate&&t.isDate?new xe({year:e.year,month:e.month,day:e.day}).compare(t):e.compare(t)}next(){let e,t,n,i=500,s=0;for(;;){if(s++>i)throw new Error("max tries have occurred, rule may be impossible to fulfill.");if(t=this.ruleDate,e=this._nextRecurrenceIter(this.last),!t&&!e){this.complete=!0;break}if((!t||e&&t.compare(e.last)>0)&&(t=e.last.clone(),e.next()),this.ruleDate===t&&this._nextRuleDay(),this.last=t,this.exDate&&(n=this._compare_special(this.last,this.exDate),n>0&&this._nextExDay(),n===0)){this._nextExDay();continue}return this.last}}toJSON(){function e(n){return n.toJSON()}let t=Object.create(null);return t.ruleIterators=this.ruleIterators.map(e),this.ruleDates&&(t.ruleDates=this.ruleDates.map(e)),this.exDates&&(t.exDates=this.exDates.map(e)),t.ruleDateInc=this.ruleDateInc,t.exDateInc=this.exDateInc,t.last=this.last.toJSON(),t.dtstart=this.dtstart.toJSON(),t.complete=this.complete,t}_extractDates(e,t){let n=[],i=e.getAllProperties(t);for(let s=0,a=i.length;sc.compare(d));n.splice(l,0,o)}return n}_init(e){if(this.ruleIterators=[],this.last=this.dtstart.clone(),!e.hasProperty("rdate")&&!e.hasProperty("rrule")&&!e.hasProperty("recurrence-id")){this.ruleDate=this.last.clone(),this.complete=!0;return}if(e.hasProperty("rdate")&&(this.ruleDates=this._extractDates(e,"rdate"),this.ruleDates[0]&&this.ruleDates[0].compare(this.dtstart)<0?(this.ruleDateInc=0,this.last=this.ruleDates[0].clone()):this.ruleDateInc=Lf(this.ruleDates,this.last,(t,n)=>t.compare(n)),this.ruleDate=this.ruleDates[this.ruleDateInc]),e.hasProperty("rrule")){let t=e.getAllProperties("rrule"),n=0,i=t.length,s,a;for(;n0)&&(a=n)}return a}},lx=class lx{constructor(e,t){M(this,"exceptions",null);M(this,"strictExceptions",!1);e instanceof po||(t=e,e=null),e?this.component=e:this.component=new po("vevent"),this._rangeExceptionCache=Object.create(null),this.exceptions=Object.create(null),this.rangeExceptions=[],t&&t.strictExceptions&&(this.strictExceptions=t.strictExceptions),t&&t.exceptions?t.exceptions.forEach(this.relateException,this):this.component.parent&&!this.isRecurrenceException()&&this.component.parent.getAllSubcomponents("vevent").forEach(function(n){n.hasProperty("recurrence-id")&&this.relateException(n)},this)}relateException(e){if(this.isRecurrenceException())throw new Error("cannot relate exception to exceptions");if(e instanceof po&&(e=new lx(e)),this.strictExceptions&&e.uid!==this.uid)throw new Error("attempted to relate unrelated exception");let t=e.recurrenceId.toString();if(this.exceptions[t]=e,e.modifiesFuture()){let n=[e.recurrenceId.toUnixTime(),t],i=Lf(this.rangeExceptions,n,xhe);this.rangeExceptions.splice(i,0,n)}}modifiesFuture(){return this.component.hasProperty("recurrence-id")?this.component.getFirstProperty("recurrence-id").getParameter("range")===lx.THISANDFUTURE:!1}findRangeException(e){if(!this.rangeExceptions.length)return null;let t=e.toUnixTime(),n=Lf(this.rangeExceptions,[t],xhe);if(n-=1,n<0)return null;let i=this.rangeExceptions[n];return t{Rd=require("obsidian");Phe();bS();jr();GM=class extends Wl{constructor(t){super();this.subscriptions=[];this.cache=new Map;this.refreshTimers=new Map;this.fileWatchers=new Map;this.pendingRefreshes=new Set;this.lastFetched=new Map;this.lastError=new Map;this.destroyed=!1;this.CACHE_GRACE_PERIOD=300*1e3;this.plugin=t}translate(t,n){return this.plugin.i18n.translate(t,n)}icalTimeToISOString(t){if(t.isDate){let i=t.year.toString().padStart(4,"0"),s=t.month.toString().padStart(2,"0"),a=t.day.toString().padStart(2,"0");return`${i}-${s}-${a}`}let n=t.toUnixTime();return new Date(n*1e3).toISOString()}async initialize(){this.destroyed=!1,await this.loadSubscriptions();let t=[];this.subscriptions.forEach(n=>{if(n.enabled){n.type==="remote"?this.startRefreshTimer(n):n.type==="local"&&this.startFileWatcher(n);let i=this.cache.get(n.id);(!i||new Date(i.expires)<=new Date)&&t.push(this.fetchSubscription(n.id))}}),await Promise.allSettled(t),this.emit("data-changed")}async loadSubscriptions(){try{let t=await this.plugin.loadData();this.subscriptions=(t==null?void 0:t.icsSubscriptions)||[]}catch(t){console.error("Failed to load ICS subscriptions:",t),this.subscriptions=[]}}async saveSubscriptions(){try{let t=await this.plugin.loadData()||{};t.icsSubscriptions=this.subscriptions,await this.plugin.saveData(t)}catch(t){throw console.error("Failed to save ICS subscriptions:",t),t}}getSubscriptions(){return[...this.subscriptions]}getLastFetched(t){return this.lastFetched.get(t)}getLastError(t){return this.lastError.get(t)}async addSubscription(t){let n={...t,id:this.generateId()};return this.subscriptions.push(n),await this.saveSubscriptions(),n.enabled&&(n.type==="remote"?(this.startRefreshTimer(n),await this.fetchSubscription(n.id)):n.type==="local"&&(this.startFileWatcher(n),await this.fetchSubscription(n.id))),this.emit("data-changed"),n}async updateSubscription(t,n){let i=this.subscriptions.findIndex(o=>o.id===t);if(i===-1)throw new Error("Subscription not found");let s=this.subscriptions[i],a={...s,...n};this.subscriptions[i]=a,await this.saveSubscriptions(),this.stopRefreshTimer(t),this.stopFileWatcher(t),a.enabled&&(a.type==="remote"?this.startRefreshTimer(a):a.type==="local"&&this.startFileWatcher(a)),(n.url&&n.url!==s.url||n.filePath&&n.filePath!==s.filePath)&&this.cache.delete(t),this.emit("data-changed")}async removeSubscription(t){let n=this.subscriptions.findIndex(i=>i.id===t);if(n===-1)throw new Error("Subscription not found");this.subscriptions.splice(n,1),await this.saveSubscriptions(),this.stopRefreshTimer(t),this.stopFileWatcher(t),this.cache.delete(t),this.lastFetched.delete(t),this.lastError.delete(t),this.emit("data-changed")}async fetchSubscription(t){let n=this.subscriptions.find(i=>i.id===t);if(!(!n||!n.enabled))try{let i;if(n.type==="remote"){if(!n.url)throw new Error("Remote subscription missing URL");i=(await(0,Rd.requestUrl)({url:n.url,method:"GET",headers:{Accept:"text/calendar,*/*;q=0.1","Accept-Language":"en-US,en;q=0.9","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"}})).text}else if(n.type==="local"){if(!n.filePath)throw new Error("Local subscription missing file path");i=await this.readLocalICSFile(n.filePath)}else throw new Error("Unknown subscription type");let s=this.parseICS(i,n.id),a={subscriptionId:t,events:s,lastUpdated:new Date().toISOString(),expires:new Date(Date.now()+n.refreshInterval*60*1e3).toISOString()};this.cache.set(t,a),this.lastFetched.set(t,new Date().toISOString()),this.lastError.delete(t),this.emit("data-changed")}catch(i){let s=i instanceof Error?i.message:String(i);this.lastError.set(t,s),n.type==="remote"?s.includes("404")?new Rd.Notice(this.translate("services.icsSubscription.notices.calendarNotFound",{name:n.name})):s.includes("500")||s.includes("OwaBasicUnsupportedException")?new Rd.Notice(this.translate("services.icsSubscription.notices.calendarAccessDenied",{name:n.name})):new Rd.Notice(this.translate("services.icsSubscription.notices.fetchRemoteFailed",{name:n.name,error:s})):new Rd.Notice(this.translate("services.icsSubscription.notices.readLocalFailed",{name:n.name,error:s}))}}parseICS(t,n){try{let i=ac.parse(t),s=new ac.Component(i);s.getAllSubcomponents("vtimezone").forEach(d=>{ac.TimezoneService.register(d)});let o=s.getAllSubcomponents("vevent"),l=[],c=new Map;return o.forEach(d=>{let u=new ac.Event(d),p=u.uid;if(!p)return;let m=d.getFirstPropertyValue("recurrence-id");if(m){c.has(p)||c.set(p,new Map);let f=ie(m);c.get(p).set(f,u)}}),o.forEach(d=>{try{let u=new ac.Event(d);if(d.getFirstPropertyValue("recurrence-id"))return;let m=d.getFirstPropertyValue("status");if(typeof m=="string"&&m.toUpperCase()==="CANCELLED")return;let f=d.getAllProperties("attendee");if(f&&f.length>0&&f.some(V=>{let R=V.getParameter("partstat");return typeof R=="string"&&R.toUpperCase()==="DECLINED"}))return;let h=u.summary||"Untitled Event",g=u.description||void 0,y=u.location||void 0,k=u.startDate,T=u.endDate;if(!k)return;let w=k.isDate,S=this.icalTimeToISOString(k),E=T?this.icalTimeToISOString(T):void 0,C=u.uid||`${n}-${l.length}`,D=`${n}-${C}`,A={id:D,subscriptionId:n,title:h,description:g,start:S,end:E,allDay:w,location:y,url:u.url||void 0};if(u.isRecurring()){let N=new Set;d.getAllProperties("exdate").forEach(Y=>{let ee=Y.getFirstValue();ee&&(Array.isArray(ee)?ee:[ee]).forEach(ce=>{ce&&typeof ce.toString=="function"&&N.add(ce.toString())})});let R=c.get(C)||new Map,I=u.iterator(k),O=new ac.Time;O.fromJSDate(new Date(Date.now()+365*24*60*60*1e3));let z,B=0,W=100;for(;(z=I.next())&&B0);){let Y=z.toString();if(N.has(Y)){B++;continue}let ee=R.get(Y);if(ee){let ae=ee.startDate,ce=ee.endDate;ae&&l.push({id:`${D}-${B}`,subscriptionId:n,title:ee.summary||h,description:ee.description||g,start:this.icalTimeToISOString(ae),end:ce?this.icalTimeToISOString(ce):void 0,allDay:ae.isDate,location:ee.location||y,url:ee.url||A.url})}else{let ae=this.icalTimeToISOString(z),ce=E;if(T&&k){let J=T.toUnixTime()-k.toUnixTime(),de=z.toUnixTime()+J;ce=new Date(de*1e3).toISOString()}l.push({...A,id:`${D}-${B}`,start:ae,end:ce})}B++}}else l.push(A)}catch(u){console.warn("Failed to parse individual event:",u)}}),l}catch(i){throw console.error("Failed to parse ICS data:",i),new Error("Invalid ICS format")}}getAllEvents(){let t=[],n=new Date;return this.subscriptions.forEach(i=>{if(!i.enabled)return;let s=this.cache.get(i.id);if(!s){this.pendingRefreshes.has(i.id)||(this.pendingRefreshes.add(i.id),this.fetchSubscription(i.id).finally(()=>this.pendingRefreshes.delete(i.id)));return}let a=new Date(s.expires),o=new Date(a.getTime()+this.CACHE_GRACE_PERIOD);na&&!this.pendingRefreshes.has(i.id)&&(this.pendingRefreshes.add(i.id),this.fetchSubscription(i.id).finally(()=>this.pendingRefreshes.delete(i.id)))):this.pendingRefreshes.has(i.id)||(this.pendingRefreshes.add(i.id),this.fetchSubscription(i.id).finally(()=>this.pendingRefreshes.delete(i.id)))}),t}getEventsForSubscription(t){let n=this.cache.get(t);if(!n){let l=this.subscriptions.find(c=>c.id===t);return l&&l.enabled&&!this.pendingRefreshes.has(t)&&(this.pendingRefreshes.add(t),this.fetchSubscription(t).finally(()=>this.pendingRefreshes.delete(t))),[]}let i=new Date,s=new Date(n.expires),a=new Date(s.getTime()+this.CACHE_GRACE_PERIOD);return i>=a?(this.pendingRefreshes.has(t)||(this.pendingRefreshes.add(t),this.fetchSubscription(t).finally(()=>this.pendingRefreshes.delete(t))),[]):(i>s&&!this.pendingRefreshes.has(t)&&(this.pendingRefreshes.add(t),this.fetchSubscription(t).finally(()=>this.pendingRefreshes.delete(t))),[...n.events])}async refreshAllSubscriptions(){let t=this.subscriptions.filter(n=>n.enabled);for(let n of t)await this.fetchSubscription(n.id)}async readLocalICSFile(t){try{let n=this.plugin.app.vault.getAbstractFileByPath(t);if(!n||!(n instanceof Rd.TFile))throw new Error(`File not found: ${t}`);if(n.extension!=="ics")throw new Error(`File is not an ICS file: ${t}`);return await this.plugin.app.vault.cachedRead(n)}catch(n){throw new Error(`Failed to read local ICS file "${t}": ${n instanceof Error?n.message:String(n)}`)}}startFileWatcher(t){if(!t.filePath)return;this.stopFileWatcher(t.id);let n=(o,l)=>{(o.path===t.filePath||l===t.filePath)&&window.setTimeout(()=>{this.fetchSubscription(t.id)},1e3)},i=this.plugin.app.vault.on("modify",n),s=this.plugin.app.vault.on("rename",n),a=this.plugin.app.vault.on("delete",o=>{o.path===t.filePath&&this.lastError.set(t.id,"Local ICS file was deleted")});this.fileWatchers.set(t.id,()=>{this.plugin.app.vault.offref(i),this.plugin.app.vault.offref(s),this.plugin.app.vault.offref(a)}),this.startFileRefreshTimer(t)}stopFileWatcher(t){let n=this.fileWatchers.get(t);n&&(n(),this.fileWatchers.delete(t))}async refreshSubscription(t){await this.fetchSubscription(t)}startRefreshTimer(t){this.stopRefreshTimer(t.id),this.startRemoteRefreshTimer(t)}startFileRefreshTimer(t){let n=t.refreshInterval*60*1e3,i=window.setTimeout(()=>{this.refreshTimers.delete(t.id),this.fetchSubscription(t.id).finally(()=>{this.shouldContinueRefresh(t.id)&&this.startFileRefreshTimer(t)})},n);this.refreshTimers.set(t.id,i)}startRemoteRefreshTimer(t){let n=t.refreshInterval*60*1e3,i=window.setTimeout(()=>{this.refreshTimers.delete(t.id),this.fetchSubscription(t.id).finally(()=>{this.shouldContinueRefresh(t.id)&&this.startRemoteRefreshTimer(t)})},n);this.refreshTimers.set(t.id,i)}shouldContinueRefresh(t){return!this.destroyed&&this.subscriptions.some(n=>n.id===t&&n.enabled)}stopRefreshTimer(t){let n=this.refreshTimers.get(t);n&&(window.clearTimeout(n),this.refreshTimers.delete(t))}generateId(){return"ics_"+Math.random().toString(36).substring(2,11)+Date.now().toString(36)}destroy(){this.destroyed=!0,this.refreshTimers.forEach(t=>window.clearTimeout(t)),this.refreshTimers.clear(),this.fileWatchers.forEach(t=>t()),this.fileWatchers.clear(),this.cache.clear(),this.pendingRefreshes.clear(),this.removeAllListeners()}getLocalICSFiles(){return this.plugin.app.vault.getFiles().filter(t=>t.extension==="ics").sort((t,n)=>t.path.localeCompare(n.path))}}});var Od,KM,Mhe=v(()=>{Od=require("obsidian");Tn();Bj();Qe();p_();Cr();d_();KM=class{constructor(e){this.plugin=e}translate(e,t){return this.plugin.i18n.translate(e,t)}async createTaskFromICS(e,t){var n;try{let i=this.plugin.icsSubscriptionService.getSubscriptions().find(l=>l.id===e.subscriptionId),s=(i==null?void 0:i.name)||"Unknown Calendar",a=(t==null?void 0:t.scheduled)!==void 0?t.scheduled:this.computeScheduledFromICSEvent(e),o={title:(t==null?void 0:t.title)||e.title,status:(t==null?void 0:t.status)||this.plugin.settings.defaultTaskStatus,priority:(t==null?void 0:t.priority)||this.plugin.settings.defaultTaskPriority,due:(t==null?void 0:t.due)!==void 0?t.due:(n=this.plugin.settings.icsIntegration)!=null&&n.useICSEndAsDue?this.computeDueFromICSEnd(e):void 0,scheduled:a,contexts:(t==null?void 0:t.contexts)||(e.location?[e.location]:void 0),projects:t==null?void 0:t.projects,tags:(t==null?void 0:t.tags)||[this.plugin.fieldMapper.toUserField("icsEventTag")],timeEstimate:(t==null?void 0:t.timeEstimate)||this.calculateEventDuration(e),details:(t==null?void 0:t.details)||this.buildICSEventDetails(e,s),icsEventId:[e.id],creationContext:"ics-event",dateCreated:Ve(),dateModified:Ve(),...Object.fromEntries(Object.entries(t||{}).filter(([l])=>l!=="due"))};return await this.plugin.taskService.createTask(o,{applyDefaults:!1})}catch(i){let s=i instanceof Error?i.message:String(i);throw console.error("Error creating task from ICS event:",{error:s,icsEventId:e.id,icsEventTitle:e.title}),new Error(`Failed to create task from ICS event: ${s}`)}}computeScheduledFromICSEvent(e){try{if(!e.start)return;let t=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,n=new Date(t);return e.allDay?ue(n):P(n,"yyyy-MM-dd'T'HH:mm")}catch(t){return console.warn("Failed to compute scheduled from ICS event start:",{start:e.start,error:t}),e.start}}computeDueFromICSEnd(e){try{if(!e.end)return;if(e.allDay){if(!e.start)return;let i=/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,s=new Date(i);return ue(s)}let t=/^\d{4}-\d{2}-\d{2}$/.test(e.end)?e.end+"T00:00:00":e.end,n=new Date(t);return P(n,"yyyy-MM-dd'T'HH:mm")}catch(t){console.warn("Failed to compute due from ICS event end:",{end:e.end,error:t});return}}async createNoteFromICS(e,t){var n;try{let i=this.plugin.icsSubscriptionService.getSubscriptions().find(N=>N.id===e.subscriptionId),s=(i==null?void 0:i.name)||"Unknown Calendar",a=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,o=new Date(a),l=(t==null?void 0:t.title)||`${e.title} - ${P(o,"PPP")}`,c=(t==null?void 0:t.folder)||((n=this.plugin.settings.icsIntegration)==null?void 0:n.defaultNoteFolder)||"",d=u_(c,{date:o,icsData:{title:e.title,location:e.location,description:e.description}}),u={title:e.title,priority:"",status:"",date:o,dueDate:e.end,scheduledDate:e.start,icsEventTitle:e.title,icsEventLocation:e.location,icsEventDescription:e.description},p=tpe(u,this.plugin.settings),m=await Ny(p,d,this.plugin.app.vault),f=d?`${d}/${m}.md`:`${m}.md`;d&&await Nm(this.plugin.app.vault,d);let h={title:l,priority:"",status:"",contexts:e.location?[e.location]:[],tags:[this.plugin.fieldMapper.toUserField("icsEventTag")],timeEstimate:0,dueDate:e.end||"",scheduledDate:e.start||"",details:e.description||"",parentNote:"",icsEventTitle:e.title,icsEventStart:e.start,icsEventEnd:e.end||"",icsEventLocation:e.location||"",icsEventDescription:e.description||"",icsEventUrl:e.url||"",icsEventSubscription:s,icsEventId:e.id},g=this.plugin.fieldMapper.toUserField("dateCreated"),y=this.plugin.fieldMapper.toUserField("dateModified"),k={title:l,[g]:Ve(),[y]:Ve(),tags:[this.plugin.fieldMapper.toUserField("icsEventTag")],[this.plugin.fieldMapper.toUserField("icsEventId")]:[e.id]},T=this.buildICSEventDetails(e,s);if(t!=null&&t.template)try{let N=(0,Od.normalizePath)(t.template.trim()),V=this.plugin.app.vault.getAbstractFileByPath(N.endsWith(".md")?N:`${N}.md`);if(V instanceof Od.TFile){let R=await this.plugin.app.vault.read(V),I=c_(R,h);k={...k,...I.frontmatter},T=I.body||T}else console.warn(`ICS note template not found: ${N}`),new Od.Notice(this.translate("services.icsNote.notices.templateNotFound",{path:N}))}catch(N){console.error("Error processing ICS note template:",N),new Od.Notice(this.translate("services.icsNote.notices.templateProcessError",{template:t.template}))}let S=`${Object.keys(k).length>0?`--- ${Object.entries(k).map(([N,V])=>`${N}: ${this.formatYamlValue(V)}`).join(` `)} --- `:""}${T}`,E=await this.plugin.app.vault.create(f,S),C=Array.isArray(k.tags)?k.tags.filter(N=>typeof N=="string"):[],D=typeof k[g]=="string"?k[g]:void 0,A={title:l,path:E.path,tags:C,createdDate:D,lastModified:Date.now()};return{file:E,noteInfo:A}}catch(i){let s=i instanceof Error?i.message:String(i);throw console.error("Error creating note from ICS event:",{error:s,icsEventId:e.id,icsEventTitle:e.title}),new Error(`Failed to create note from ICS event: ${s}`)}}async findRelatedNotes(e){try{let t=[],n=this.plugin.fieldMapper.toUserField("icsEventId"),i=await this.plugin.cacheManager.getAllTasks();for(let a of i)a.icsEventId&&a.icsEventId.includes(e.id)&&t.push(a);let s=this.plugin.app.vault.getMarkdownFiles();for(let a of s)try{let o=this.plugin.app.metadataCache.getFileCache(a),l=o==null?void 0:o.frontmatter,c=l==null?void 0:l[n],d=Array.isArray(c)?c.includes(e.id):c===e.id;if(l&&d){let u={title:l.title||a.basename,path:a.path,tags:l.tags||[],createdDate:l.dateCreated,lastModified:a.stat.mtime};t.push(u)}}catch(o){continue}return t}catch(t){return console.error("Error finding related notes for ICS event:",t),[]}}async linkNoteToICS(e,t){try{let n=this.plugin.app.vault.getAbstractFileByPath(e);if(!(n instanceof Od.TFile))throw new Error(`Cannot find note file: ${e}`);await this.plugin.app.fileManager.processFrontMatter(n,i=>{let s=this.plugin.fieldMapper.toUserField("icsEventId"),a=i[s];a?Array.isArray(a)||(a=[a]):a=[],a.includes(t.id)||a.push(t.id),i[s]=a;let o=this.plugin.fieldMapper.toUserField("dateModified");i[o]=Ve()}),new Od.Notice(this.translate("services.icsNote.notices.linkedToEvent",{title:t.title}))}catch(n){let i=n instanceof Error?n.message:String(n);throw console.error("Error linking note to ICS event:",{error:i,notePath:e,icsEventId:t.id}),new Error(`Failed to link note to ICS event: ${i}`)}}buildICSEventDetails(e,t){let n=[];if(n.push(`# ${e.title}`),n.push(""),e.start){let i=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,s=new Date(i);n.push(`**Start:** ${P(s,"PPPp")}`)}if(e.end&&!e.allDay){let i=/^\d{4}-\d{2}-\d{2}$/.test(e.end)?e.end+"T00:00:00":e.end,s=new Date(i);n.push(`**End:** ${P(s,"PPPp")}`)}return e.location&&n.push(`**Location:** ${e.location}`),n.push(`**Calendar:** ${t}`),e.description&&(n.push(""),n.push("## Description"),n.push(e.description)),e.url&&(n.push(""),n.push(`**Event URL:** ${e.url}`)),n.join(` `)}formatYamlValue(e){return typeof e=="string"?e.includes(":")||e.includes("#")||e.includes("[")||e.includes("{")?`"${e.replace(/"/g,'\\"')}"`:e:Array.isArray(e)?`[${e.map(t=>typeof t=="string"?`"${t}"`:t).join(", ")}]`:String(e)}calculateEventDuration(e){if(!(!e.start||!e.end))try{let t=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,n=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.end)?e.end+"T00:00:00":e.end,i=new Date(t).getTime(),s=new Date(n).getTime();if(isNaN(i)||isNaN(s))return;let a=s-i,o=Math.round(a/(1e3*60));return o>0&&o<1440?o:void 0}catch(t){console.warn("Error calculating event duration:",t);return}}}});var ZM,mx,cv,jtr,QM=v(()=>{ZM={TOKEN_REFRESH_BUFFER_MS:3e5,CALLBACK_PORT_START:8080,CALLBACK_PORT_END:8090},mx={REFRESH_INTERVAL_MS:900*1e3,MIN_MANUAL_REFRESH_INTERVAL_MS:30*1e3,MAX_RESULTS_PER_REQUEST:2500,VIEW_RANGE:{DAYS_BEFORE:30,DAYS_AFTER:90},DEFAULT_EVENT_DURATION_MS:3600*1e3,RATE_LIMIT:{MAX_RETRIES:3,INITIAL_BACKOFF_MS:1e3,MAX_BACKOFF_MS:16e3,BACKOFF_MULTIPLIER:2}},cv={REFRESH_INTERVAL_MS:900*1e3,MIN_MANUAL_REFRESH_INTERVAL_MS:30*1e3,MAX_RESULTS_PER_REQUEST:50,VIEW_RANGE:{DAYS_BEFORE:30,DAYS_AFTER:90},DEFAULT_EVENT_DURATION_MS:3600*1e3,RATE_LIMIT:{MAX_RETRIES:3,INITIAL_BACKOFF_MS:1e3,MAX_BACKOFF_MS:16e3,BACKOFF_MULTIPLIER:2}},jtr={SECOND_MS:1e3,MINUTE_MS:60*1e3,HOUR_MS:3600*1e3,DAY_MS:1440*60*1e3}});var fx,hx,Bs,zf,gx,mi,vp,dv,mo,Bf,uv=v(()=>{fx=class extends Error{constructor(t,n){super(t);this.code=n;this.name="TaskNotesServiceError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},hx=class extends fx{constructor(t,n,i){super(t,i);this.provider=n;this.name="OAuthError"}},Bs=class extends hx{constructor(e){super(`${e} authentication expired. Please reconnect.`,e,"TOKEN_EXPIRED"),this.name="TokenExpiredError"}},zf=class extends hx{constructor(t,n,i){let s=`${t} connection expired. Please reconnect in Settings > Integrations.`;super(s,t,"TOKEN_REFRESH_FAILED");this.oauthErrorCode=n;this.oauthErrorDescription=i;this.name="TokenRefreshError"}},gx=class extends hx{constructor(e){super(`${e} OAuth is not configured. Please provide OAuth credentials in settings.`,e,"NOT_CONFIGURED"),this.name="OAuthNotConfiguredError"}},mi=class extends fx{constructor(t,n,i){super(t,i);this.statusCode=n;this.name="GoogleCalendarError"}},vp=class extends mi{constructor(e){super(`Calendar event not found: ${e}`,404,"EVENT_NOT_FOUND"),this.name="EventNotFoundError"}},dv=class extends mi{constructor(e){super(`Calendar not found: ${e}`,404,"CALENDAR_NOT_FOUND"),this.name="CalendarNotFoundError"}},mo=class extends mi{constructor(e){let t=e?`Rate limit exceeded. Retry after ${e} seconds.`:"Rate limit exceeded. Please try again later.";super(t,429,"RATE_LIMIT"),this.name="RateLimitError"}},Bf=class extends fx{constructor(t,n){super(t,"VALIDATION_ERROR");this.field=n;this.name="ValidationError"}}});function Ahe(){if(!qs.Platform.isDesktopApp)throw new Error("OAuth redirect handling is only available on desktop.");return J2||(J2=require("http")),J2}var qs,J2,JM,Ihe=v(()=>{qs=require("obsidian");QM();uv();J2=null;JM=class{constructor(e){this.callbackServer=null;this.pendingOAuthState=new Map;this.tokenRefreshPromises=new Map;this.configs={google:{provider:"google",clientId:"",redirectUri:"http://127.0.0.1:8080",scope:["https://www.googleapis.com/auth/calendar.readonly","https://www.googleapis.com/auth/calendar.events"],authorizationEndpoint:"https://accounts.google.com/o/oauth2/v2/auth",tokenEndpoint:"https://oauth2.googleapis.com/token",deviceCodeEndpoint:"https://oauth2.googleapis.com/device/code",revocationEndpoint:"https://oauth2.googleapis.com/revoke"},microsoft:{provider:"microsoft",clientId:"",redirectUri:"http://localhost:8080",scope:["Calendars.Read","Calendars.ReadWrite","offline_access"],authorizationEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",deviceCodeEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",revocationEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout"}};this.plugin=e,this.loadClientIds()}async loadClientIds(){this.configs.google.clientId=this.plugin.settings.googleOAuthClientId||"",this.configs.google.clientSecret=this.plugin.settings.googleOAuthClientSecret||"",this.configs.microsoft.clientId=this.plugin.settings.microsoftOAuthClientId||"",this.configs.microsoft.clientSecret=this.plugin.settings.microsoftOAuthClientSecret||""}async authenticate(e){if(!this.configs[e].clientId)throw new gx(e);if(!(e==="google"&&this.plugin.settings.googleOAuthClientId||e==="microsoft"&&this.plugin.settings.microsoftOAuthClientId))throw new gx(e);return await this.authenticateStandard(e)}async authenticateStandard(e){try{let t=this.configs[e];if(!qs.Platform.isDesktopApp)throw new qs.Notice("OAUTH authentication requires the desktop app."),new Error("OAuth authentication requires the desktop app.");let n=this.generateCodeVerifier(),i=await this.generateCodeChallenge(n),s=this.generateState(),a=await this.findAvailablePort(ZM.CALLBACK_PORT_START,ZM.CALLBACK_PORT_END);await this.startCallbackServer(a);let o=t.redirectUri;t.redirectUri=`http://127.0.0.1:${a}`;try{let l=this.buildAuthorizationUrl(t,i,s);this.pendingOAuthState.set(s,{provider:e,codeVerifier:n,resolve:()=>{},reject:()=>{}}),new qs.Notice(`Opening browser for ${e} authorization...`),window.open(l,"_blank");let c=await this.waitForCallback(s,3e5),d=await this.exchangeCodeForTokens(t,c,n);await this.storeConnection(e,d),new qs.Notice(`Successfully connected to ${e} Calendar!`)}finally{t.redirectUri=o}}catch(t){throw console.error(`OAuth authentication failed for ${e}:`,t),new qs.Notice(`Failed to connect to ${e}: ${t.message}`),t}finally{await this.stopCallbackServer()}}async findAvailablePort(e,t){let n=Ahe();for(let i=e;i<=t;i++)try{return await new Promise((s,a)=>{let o=n.createServer();o.once("error",a),o.once("listening",()=>{o.close(),s()}),o.listen(i,"127.0.0.1")}),i}catch(s){continue}throw new Error(`No available ports found between ${e} and ${t}`)}generateCodeVerifier(){return this.base64UrlEncode(crypto.getRandomValues(new Uint8Array(32)))}async generateCodeChallenge(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return this.base64UrlEncode(new Uint8Array(n))}generateState(){return Array.from(crypto.getRandomValues(new Uint8Array(16))).map(e=>e.toString(16).padStart(2,"0")).join("")}base64UrlEncode(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),btoa(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}buildAuthorizationUrl(e,t,n){let i=new URLSearchParams({client_id:e.clientId,redirect_uri:e.redirectUri,response_type:"code",scope:e.scope.join(" "),state:n,code_challenge:t,code_challenge_method:"S256",access_type:"offline",prompt:"consent"});return`${e.authorizationEndpoint}?${i.toString()}`}async startCallbackServer(e){return new Promise((t,n)=>{if(this.callbackServer){t();return}let i;try{i=Ahe()}catch(s){n(s instanceof Error?s:new Error(String(s)));return}this.callbackServer=i.createServer((s,a)=>{this.handleCallback(s,a)}),this.callbackServer.once("error",s=>{console.error("OAuth callback server error:",s),n(s)}),this.callbackServer.listen(e,"127.0.0.1",()=>{t()})})}async stopCallbackServer(){return new Promise(e=>{if(!this.callbackServer){e();return}this.callbackServer.close(()=>{this.callbackServer=null,e()})})}handleCallback(e,t){let n=e.headers.host,i=Array.isArray(n)?n[0]:n!=null?n:"localhost",s=new URL(e.url||"",`http://${i}`),a=s.searchParams.get("code"),o=s.searchParams.get("state"),l=s.searchParams.get("error");if(t.writeHead(200,{"Content-Type":"text/html"}),l){t.end(` OAuth Error

Authorization Failed

Error: ${l}

You can close this window.

`);let d=o?this.pendingOAuthState.get(o):null;d&&o&&(d.reject(new Error(`OAuth error: ${l}`)),this.pendingOAuthState.delete(o));return}if(!a||!o){t.end(` OAuth Error

Invalid Callback

Missing required parameters.

You can close this window.

`);return}t.end(` OAuth Success

Authorization Successful!

You can close this window and return to Obsidian.