text: (()=>{"use strict";function e(){document.getElementById("formTitle").value="",document.getElementById("formDesc").value="",document.getElementById("formDueDate").value="",document.getElementById("priority").value="",document.getElementById("project").value="",document.querySelector(".overlay").style.display="block",document.getElementById("subBtn")&&document.getElementById("subBtn").remove();const e=document.getElementById("newForm"),n=document.createElement("input");n.setAttribute("type","button"),n.value="Submit",n.setAttribute("id","subBtn"),n.addEventListener("click",t),e.appendChild(n)}function t(){const e=document.getElementById("formTitle"),t=document.getElementById("formDesc"),n=document.getElementById("formDueDate"),r=document.getElementById("priority"),a=document.getElementById("project");e.value&&n.value?(new ve(e.value,t.value,n.value,r.value,a.value,!1),ye(e.value,t.value,n.value,r.value,a.value),document.querySelector(".overlay").style.display="none"):alert("Please fill in Title and Due Date fields.")}function n(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function r(e){n(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function a(e){n(1,arguments);var t=r(e);return!isNaN(t)}var i={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"}};function o(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var u,c={date:o({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:o({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:o({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},s={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function l(e){return function(t,n){var r,a=n||{};if("formatting"===(a.context?String(a.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=a.width?String(a.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var u=e.defaultWidth,c=a.width?String(a.width):e.defaultWidth;r=e.values[c]||e.values[u]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function d(e){return function(t,n){var r=String(t),a=n||{},i=a.width,o=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],u=r.match(o);if(!u)return null;var c,s=u[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth];return c="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].test(s))return n}(l):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n].test(s))return n}(l),c=e.valueCallback?e.valueCallback(c):c,{value:c=a.valueCallback?a.valueCallback(c):c,rest:r.slice(s.length)}}}const m={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof i[e]?i[e]:1===t?i[e].one:i[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:c,formatRelative:function(e,t,n,r){return s[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:l({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:l({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:l({values:{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"]},defaultWidth:"wide"}),day:l({values:{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"]},defaultWidth:"wide"}),dayPeriod:l({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(u={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},a=n.match(u.matchPattern);if(!a)return null;var i=a[0],o=n.match(u.parsePattern);if(!o)return null;var c=u.valueCallback?u.valueCallback(o[0]):o[0];return{value:c=r.valueCallback?r.valueCallback(c):c,rest:n.slice(i.length)}}),era:d({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:d({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:d({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function h(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function f(e,t){n(2,arguments);var a=r(e).getTime(),i=h(t);return new Date(a+i)}function g(e,t){n(2,arguments);var r=h(t);return f(e,-r)}function p(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}const b=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return p("yy"===t?r%100:r,t.length)},v=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):p(n+1,2)},y=function(e,t){return p(e.getUTCDate(),t.length)},w=function(e,t){return p(e.getUTCHours()%12||12,t.length)},C=function(e,t){return p(e.getUTCHours(),t.length)},T=function(e,t){return p(e.getUTCMinutes(),t.length)},D=function(e,t){return p(e.getUTCSeconds(),t.length)},E=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return p(Math.floor(r*Math.pow(10,n-3)),t.length)};var A=864e5;function M(e){n(1,arguments);var t=1,a=r(e),i=a.getUTCDay(),o=(i<t?7:0)+i-t;return a.setUTCDate(a.getUTCDate()-o),a.setUTCHours(0,0,0,0),a}function S(e){n(1,arguments);var t=r(e),a=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(a+1,0,4),i.setUTCHours(0,0,0,0);var o=M(i),u=new Date(0);u.setUTCFullYear(a,0,4),u.setUTCHours(0,0,0,0);var c=M(u);return t.getTime()>=o.getTime()?a+1:t.getTime()>=c.getTime()?a:a-1}function x(e){n(1,arguments);var t=S(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var a=M(r);return a}var k=6048e5;function P(e,t){n(1,arguments);var a=t||{},i=a.locale,o=i&&i.options&&i.options.weekStartsOn,u=null==o?0:h(o),c=null==a.weekStartsOn?u:h(a.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=r(e),l=s.getUTCDay(),d=(l<c?7:0)+l-c;return s.setUTCDate(s.getUTCDate()-d),s.setUTCHours(0,0,0,0),s}function U(e,t){n(1,arguments);var a=r(e,t),i=a.getUTCFullYear(),o=t||{},u=o.locale,c=u&&u.options&&u.options.firstWeekContainsDate,s=null==c?1:h(c),l=null==o.firstWeekContainsDate?s:h(o.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(i+1,0,l),d.setUTCHours(0,0,0,0);var m=P(d,t),f=new Date(0);f.setUTCFullYear(i,0,l),f.setUTCHours(0,0,0,0);var g=P(f,t);return a.getTime()>=m.getTime()?i+1:a.getTime()>=g.getTime()?i:i-1}function N(e,t){n(1,arguments);var r=t||{},a=r.locale,i=a&&a.options&&a.options.firstWeekContainsDate,o=null==i?1:h(i),u=null==r.firstWeekContainsDate?o:h(r.firstWeekContainsDate),c=U(e,t),s=new Date(0);s.setUTCFullYear(c,0,u),s.setUTCHours(0,0,0,0);var l=P(s,t);return l}var q=6048e5;function j(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(0===i)return n+String(a);var o=t||"";return n+String(a)+o+p(i,2)}function L(e,t){return e%60==0?(e>0?"-":"+")+p(Math.abs(e)/60,2):B(e,t)}function B(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e);return r+p(Math.floor(a/60),2)+n+p(a%60,2)}const W={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return b(e,t)},Y:function(e,t,n,r){var a=U(e,r),i=a>0?a:1-a;return"YY"===t?p(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):p(i,t.length)},R:function(e,t){return p(S(e),t.length)},u:function(e,t){return p(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return p(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return p(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return v(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return p(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,a,i){var o=function(e,t){n(1,arguments);var a=r(e),i=P(a,t).getTime()-N(a,t).getTime();return Math.round(i/q)+1}(e,i);return"wo"===t?a.ordinalNumber(o,{unit:"week"}):p(o,t.length)},I:function(e,t,a){var i=function(e){n(1,arguments);var t=r(e),a=M(t).getTime()-x(t).getTime();return Math.round(a/k)+1}(e);return"Io"===t?a.ordinalNumber(i,{unit:"week"}):p(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):y(e,t)},D:function(e,t,a){var i=function(e){n(1,arguments);var t=r(e),a=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),o=a-i;return Math.floor(o/A)+1}(e);return"Do"===t?a.ordinalNumber(i,{unit:"dayOfYear"}):p(i,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var a=e.getUTCDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return p(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var a=e.getUTCDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return p(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),a=0===r?7:r;switch(t){case"i":return String(a);case"ii":return p(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,a=e.getUTCHours();switch(r=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,a=e.getUTCHours();switch(r=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return w(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):C(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):p(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):p(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):T(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):D(e,t)},S:function(e,t){return E(e,t)},X:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return L(a);case"XXXX":case"XX":return B(a);case"XXXXX":case"XXX":default:return B(a,":")}},x:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return L(a);case"xxxx":case"xx":return B(a);case"xxxxx":case"xxx":default:return B(a,":")}},O:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+j(a,":");case"OOOO":default:return"GMT"+B(a,":")}},z:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+j(a,":");case"zzzz":default:return"GMT"+B(a,":")}},t:function(e,t,n,r){var a=r._originalDate||e;return p(Math.floor(a.getTime()/1e3),t.length)},T:function(e,t,n,r){return p((r._originalDate||e).getTime(),t.length)}};function I(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Y(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}const O={p:Y,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),a=r[1],i=r[2];if(!i)return I(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",I(a,t)).replace("{{time}}",Y(i,t))}};var H=6e4;function F(e){return e.getTime()%H}function z(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var r=n>0?(H+F(t))%H:F(t);return n*H+r}var X=["D","DD"],$=["YY","YYYY"];function Q(e){return-1!==X.indexOf(e)}function G(e){return-1!==$.indexOf(e)}function R(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var J=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_=/^'([^]*?)'?$/,V=/''/g,K=/[a-zA-Z]/;function ee(e){return e.match(_)[1].replace(V,"'")}var te=36e5,ne={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},re=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ie=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oe(e){var t,n={},r=e.split(ne.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1],ne.timeZoneDelimiter.test(n.date)&&(n.date=e.split(ne.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var a=ne.timezone.exec(t);a?(n.time=t.replace(a[1],""),n.timezone=a[1]):n.time=t}return n}function ue(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:null};var a=r[1]&&parseInt(r[1]),i=r[2]&&parseInt(r[2]);return{year:null==i?a:100*i,restDateString:e.slice((r[1]||r[2]).length)}}function ce(e,t){if(null===t)return null;var n=e.match(re);if(!n)return null;var r=!!n[4],a=se(n[1]),i=se(n[2])-1,o=se(n[3]),u=se(n[4]),c=se(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,u,c)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var a=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+a),r}(t,u,c):new Date(NaN);var s=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(he[t]||(fe(e)?29:28))}(t,i,o)&&function(e,t){return t>=1&&t<=(fe(e)?366:365)}(t,a)?(s.setUTCFullYear(t,i,Math.max(a,o)),s):new Date(NaN)}function se(e){return e?parseInt(e):1}function le(e){var t=e.match(ae);if(!t)return null;var n=de(t[1]),r=de(t[2]),a=de(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,a)?n*te+6e4*r+1e3*a:NaN}function de(e){return e&&parseFloat(e.replace(",","."))||0}function me(e){if("Z"===e)return 0;var t=e.match(ie);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,a)?n*(r*te+6e4*a):NaN}var he=[31,null,31,30,31,30,31,31,30,31,30,31];function fe(e){return e%400==0||e%4==0&&e%100}let ge=[];const pe=document.querySelector("#content"),be=document.createElement("div");function ve(i,o,u,c,s,l){this.title=i,this.desc=o,this.dueDate=u,this.priorty=c,this.completeCheck=l,ge.push({title:i,desc:o,dueDate:u,priority:c,project:s,completeCheck:l});const d=function(e,t,i){n(2,arguments);var o=String(t),u=i||{},c=u.locale||m,s=c.options&&c.options.firstWeekContainsDate,l=null==s?1:h(s),d=null==u.firstWeekContainsDate?l:h(u.firstWeekContainsDate);if(!(d>=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=c.options&&c.options.weekStartsOn,p=null==f?0:h(f),b=null==u.weekStartsOn?p:h(u.weekStartsOn);if(!(b>=0&&b<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!c.localize)throw new RangeError("locale must contain localize property");if(!c.formatLong)throw new RangeError("locale must contain formatLong property");var v=r(e);if(!a(v))throw new RangeError("Invalid time value");var y=z(v),w=g(v,y),C={firstWeekContainsDate:d,weekStartsOn:b,locale:c,_originalDate:v};return o.match(Z).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,O[t])(e,c.formatLong,C):e})).join("").match(J).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return ee(n);var a=W[r];if(a)return!u.useAdditionalWeekYearTokens&&G(n)&&R(n,t,e),!u.useAdditionalDayOfYearTokens&&Q(n)&&R(n,t,e),a(w,n,c.localize,C);if(r.match(K))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("")}(new Date(function(e,t){n(1,arguments);var r=t||{},a=null==r.additionalDigits?2:h(r.additionalDigits);if(2!==a&&1!==a&&0!==a)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i,o=oe(e);if(o.date){var u=ue(o.date,a);i=ce(u.restDateString,u.year)}if(isNaN(i)||!i)return new Date(NaN);var c,s=i.getTime(),l=0;if(o.time&&(l=le(o.time),isNaN(l)||null===l))return new Date(NaN);if(!o.timezone){var d=new Date(s+l),m=new Date(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds());return m.setFullYear(d.getUTCFullYear()),m}return c=me(o.timezone),isNaN(c)?new Date(NaN):new Date(s+l+c)}(`${u}T00:00:00`)),"P"),f=document.querySelector(".cardside"),p=document.createElement("div");p.setAttribute("class","card"),p.setAttribute("data-proj",s),p.setAttribute("id",ge.length);const b=document.createElement("div");b.setAttribute("id","Title"),b.setAttribute("class",`titleIndex${ge.length}`),b.textContent=i,p.appendChild(b);const v=document.createElement("div");v.setAttribute("id","DueDate"),v.setAttribute("class",`dateIndex${ge.length}`),v.textContent=`Due on ${d}`,p.appendChild(v);const y=document.createElement("input");y.setAttribute("id","complete"),y.setAttribute("class",`complete${ge.length}`),y.setAttribute("type","checkbox"),l?(p.removeAttribute("class"),p.setAttribute("class","cardDone"),y.innerHTML='<i class="fas fa-check"></i>'):(p.removeAttribute("class"),p.setAttribute("class","card"),y.innerHTML=""),y.addEventListener("change",(()=>{!function(e){for(let t=1;t<=ge.length;t++){const n=document.querySelector(`.${e}`),r=document.getElementById(`${t}`);e==`complete${t}`&&(n.checked?(r.removeAttribute("class"),r.setAttribute("class","cardDone"),n.innerHTML='<i class="fas fa-check"></i>',ge[t-1].completeCheck=!0,ye()):(r.removeAttribute("class"),r.setAttribute("class","card"),n.innerHTML="",ge[t-1].completeCheck=!1,ye()))}}(y.getAttribute("class"))})),p.appendChild(y);const w=document.createElement("div");w.setAttribute("id","Desc"),w.setAttribute("class",`descIndex${ge.length}`),w.textContent=o,p.appendChild(w);const C=document.createElement("div");C.setAttribute("id","Priority"),C.setAttribute("class",`priIndex${ge.length}`),p.style.borderColor="low"==c?"green":"medium"==c?"yellow":"high"==c?"red":"white",p.appendChild(C);const T=document.createElement("input");T.setAttribute("id","delete"),T.setAttribute("type","button"),T.setAttribute("value","X"),T.addEventListener("click",(()=>{p.remove(),localStorage.removeItem(`item-${i}`)})),p.appendChild(T);const D=document.createElement("button");D.setAttribute("id","edit"),D.setAttribute("type","submit"),D.innerHTML='<i class="fas fa-pen"></i>',D.addEventListener("click",(()=>{const n=p.getAttribute("id");!function(n,r){e();const a=document.querySelector(`.titleIndex${r}`),i=document.querySelector(`.descIndex${r}`),o=document.querySelector(`.dateIndex${r}`),u=document.getElementById("formTitle");u.value=a.textContent;const c=document.getElementById("formDesc");c.value=i.textContent;const s=document.getElementById("formDueDate");s.value=ge[r-1].dueDate;const l=document.getElementById("priority");l.value=ge[r-1].priority;const d=document.getElementById("project");d.value=ge[r-1].project,document.getElementById("edBtn")&&document.getElementById("edBtn").remove();const m=document.querySelector("#subBtn");m.value="Edit",m.removeEventListener("click",t),m.addEventListener("click",(()=>{u.value&&s.value?(ge[r-1].title=u.value,a.textContent=u.value,ge[r-1].desc=c.value,i.textContent=c.value,ge[r-1].dueDate=s.value,o.textContent=`Due on ${s.value}`,ge[r-1].priority=l.value,"low"==l.value?n.style.borderColor="green":"medium"==l.value?n.style.borderColor="yellow":n.style.borderColor="high"==l?"red":"white",ge[r-1].project=d.value,n.setAttribute("data-proj",d.value),ye(),document.querySelector(".overlay").style.display="none"):alert("Please fill in Title and Due Date fields.")})),document.getElementById("newForm").appendChild(m)}(p,n)})),p.appendChild(D),f.appendChild(p)}function ye(){for(let e=0;e<ge.length;e++)localStorage.setItem(`item-${ge[e].title}`,JSON.stringify(ge[e]))}be.setAttribute("class","cardside"),pe.appendChild(be);const we=document.querySelector("#content"),Ce=document.createElement("div");Ce.setAttribute("class","sidebar"),we.appendChild(Ce);let Te=[];function De(){for(let e=0;e<Te.length;e++)localStorage.setItem(`proj-${Te[e]}`,Te[e])}!function(){const e=document.querySelector("#content"),t=document.createElement("div");t.setAttribute("class","overlay");const n=document.createElement("div");n.setAttribute("id","overlay");const r=document.createElement("form");r.setAttribute("id","newForm");const a=document.createElement("label");a.setAttribute("for","formTitle"),a.innerHTML="Title: ",r.appendChild(a);const i=document.createElement("input");i.setAttribute("type","text"),i.setAttribute("name","title"),i.setAttribute("id","formTitle"),i.placeholder="Title and Date are required",i.required=!0,r.appendChild(i);const o=document.createElement("label");o.setAttribute("for","formDesc"),o.setAttribute("id","descLabel"),o.innerHTML="Description: ",r.appendChild(o);const u=document.createElement("textarea");u.setAttribute("type","text"),u.setAttribute("name","desc"),u.setAttribute("id","formDesc"),u.required=!1,r.appendChild(u);const c=document.createElement("label");c.setAttribute("for","formDueDate"),c.innerHTML="Due Date: ",r.appendChild(c);const s=document.createElement("input");s.setAttribute("type","date"),s.setAttribute("name","dueDate"),s.setAttribute("id","formDueDate"),s.required=!0,r.appendChild(s);const l=document.createElement("label");l.setAttribute("for","formPriority"),l.innerHTML="Priority: ",r.appendChild(l);const d=document.createElement("select");d.setAttribute("name","priority"),d.setAttribute("id","priority"),d.required=!0,r.appendChild(d);const m=document.createElement("option");m.value="low",m.innerHTML="Low",d.appendChild(m);const h=document.createElement("option");h.value="medium",h.innerHTML="Medium",d.appendChild(h);const f=document.createElement("option");f.value="high",f.innerHTML="High",d.appendChild(f);const g=document.createElement("label");g.setAttribute("for","formProject"),g.innerHTML="Project: ",r.appendChild(g);const p=document.createElement("select");p.setAttribute("name","project"),p.setAttribute("id","project"),p.required=!1,r.appendChild(p);const b=document.createElement("input");b.setAttribute("type","button"),b.value="Cancel",b.setAttribute("id","cancelBtn"),b.addEventListener("click",(()=>{document.querySelector(".overlay").style.display="none"})),r.appendChild(b),n.appendChild(r),t.appendChild(n),e.appendChild(t)}(),function(){const e=document.querySelector("#content"),t=document.createElement("a");t.setAttribute("href","https://github.com/savwiley/todos"),e.appendChild(t);const n=document.createElement("i");n.setAttribute("class","fab fa-github-square"),n.setAttribute("title","View on GitHub"),t.appendChild(n)}(),function(){const e=document.querySelector("#content"),t=document.createElement("input");t.setAttribute("type","button"),t.setAttribute("id","clearBtn"),t.value="Clear History",t.addEventListener("click",(()=>{confirm("Are you sure? Choosing OK will delete all of your to-do items and projects.")&&(localStorage.clear(),location.reload())})),e.appendChild(t)}(),localStorage?function(){const e=Object.keys(localStorage);for(let t=0;t<e.length;t++)if(e[t].includes("item-")){const n=localStorage.getItem(e[t]),r=JSON.parse(n);new ve(r.title,r.desc,r.dueDate,r.priority,r.project,r.completeCheck)}}():ye(),function(){const t=document.createElement("input");t.setAttribute("id","newCard"),t.setAttribute("type","button"),t.value="New To-Do",t.addEventListener("click",e),document.querySelector(".sidebar").appendChild(t)}(),function(){const e=document.createElement("input");e.setAttribute("id","newProjForm"),e.setAttribute("type","text"),e.placeholder="Project Name",Ce.appendChild(e);const t=document.createElement("input");t.setAttribute("id","newProjBtn"),t.setAttribute("type","button"),t.value="+",t.addEventListener("click",(()=>{if(e.value){const t=document.createElement("input");t.setAttribute("class","projBtn"),t.setAttribute("id",Te.length),t.setAttribute("type","button"),t.value=e.value,Ce.appendChild(t),Te.push(e.value),De();const n=document.querySelector("#project"),r=document.createElement("option");r.value=Te.length-1,r.innerHTML=e.value,n.appendChild(r),e.value="",e.placeholder="Project Name",t.addEventListener("click",(()=>{document.querySelectorAll(".card").forEach((e=>{const n=e.getAttribute("data-proj"),r=t.getAttribute("id");e.style.display=n!==r?"none":"block"}))}));const a=document.createElement("input");a.setAttribute("type","button"),a.setAttribute("class","delProj"),a.setAttribute("id",Te.length),a.value="X",Ce.appendChild(a);let i=Te.length-1;a.addEventListener("click",(()=>{t.remove(),r.remove(),a.remove(),localStorage.removeItem(`proj${i}`)}))}else e.placeholder="MUST ENTER PROJECT NAME"})),Ce.appendChild(t)}(),function(){const e=document.createElement("input");e.setAttribute("class","projBtn"),e.setAttribute("id","defaultProj"),e.setAttribute("type","button"),e.value="See All",e.addEventListener("click",(()=>{document.querySelectorAll(".card").forEach((e=>{e.style.display="block"}))})),Ce.appendChild(e)}(),localStorage?function(){const e=Object.keys(localStorage);for(let t=0;t<e.length;t++)if(e[t].includes("proj-")){const n=localStorage.getItem(e[t]),r=document.createElement("input");r.setAttribute("class","projBtn"),r.setAttribute("id",Te.length),r.setAttribute("type","button"),r.value=n,Te.push(n);const a=document.querySelector("#project"),i=document.createElement("option");i.value=n,i.innerHTML=n,a.appendChild(i),r.addEventListener("click",(()=>{document.querySelectorAll(".card").forEach((e=>{const t=e.getAttribute("data-proj");e.style.display=t!==n?"none":"block"}))})),Ce.appendChild(r);const o=document.createElement("input");o.setAttribute("type","button"),o.setAttribute("class","delProj"),o.setAttribute("id",Te.length),o.value="X",Ce.appendChild(o),o.addEventListener("click",(()=>{r.remove(),i.remove(),o.remove(),localStorage.removeItem(e[t])}))}}():De()})();