diff --git a/dist/dialogFormContent.html b/dist/dialogFormContent.html index ce92a93..387d1d3 100644 --- a/dist/dialogFormContent.html +++ b/dist/dialogFormContent.html @@ -1 +1 @@ - Add newTodotitle, description, dueDate and priorityTitle Project Description When? Priority Low Medium HighAdd \ No newline at end of file + Add newTodotitle, description, dueDate and priorityTitle Project Description When? Priority Low Medium HighAdd \ No newline at end of file diff --git a/dist/main.bundle.js b/dist/main.bundle.js index 9aa82f3..b5ae6d3 100644 --- a/dist/main.bundle.js +++ b/dist/main.bundle.js @@ -1,3 +1,3 @@ /*! For license information please see main.bundle.js.LICENSE.txt */ -(self.webpackChunktodoornot=self.webpackChunktodoornot||[]).push([[179],{856:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:a,seal:r,create:c}=Object,{apply:l,construct:s}="undefined"!=typeof Reflect&&Reflect;a||(a=function(e){return e}),r||(r=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const d=E(Array.prototype.forEach),u=E(Array.prototype.pop),f=E(Array.prototype.push),m=E(String.prototype.toLowerCase),p=E(String.prototype.toString),g=E(String.prototype.match),h=E(String.prototype.replace),v=E(String.prototype.indexOf),y=E(String.prototype.trim),D=E(Object.prototype.hasOwnProperty),w=E(RegExp.prototype.test),b=(C=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:m;t&&t(e,null);let a=o.length;for(;a--;){let t=o[a];if("string"==typeof t){const e=i(t);e!==t&&(n(o)||(o[a]=e),t=e)}e[t]=!0}return e}function T(e){for(let t=0;t/gm),B=r(/\${[\w\W]*}/gm),U=r(/^data-[\-\w.\u00B7-\uFFFF]/),W=r(/^aria-[\-\w]+$/),q=r(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z=r(/^(?:\w+script|data):/i),G=r(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V=r(/^html$/i);var K=Object.freeze({__proto__:null,MUSTACHE_EXPR:R,ERB_EXPR:Y,TMPLIT_EXPR:B,DATA_ATTR:U,ARIA_ATTR:W,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:z,ATTR_WHITESPACE:G,DOCTYPE_NAME:V});const J=function(){return"undefined"==typeof window?null:window};return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J();const o=e=>t(e);if(o.version="3.0.9",o.removed=[],!n||!n.document||9!==n.document.nodeType)return o.isSupported=!1,o;let{document:i}=n;const r=i,l=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:C,Node:E,Element:T,NodeFilter:R,NamedNodeMap:Y=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:U,trustedTypes:W}=n,z=T.prototype,G=k(z,"cloneNode"),$=k(z,"nextSibling"),Z=k(z,"childNodes"),X=k(z,"parentNode");if("function"==typeof C){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let Q,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:oe,getElementsByTagName:ie}=i,{importNode:ae}=r;let re={};o.isSupported="function"==typeof e&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ce,ERB_EXPR:le,TMPLIT_EXPR:se,DATA_ATTR:de,ARIA_ATTR:ue,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:me}=K;let{IS_ALLOWED_URI:pe}=K,ge=null;const he=M({},[...S,...A,..._,...I,...O]);let ve=null;const ye=M({},[...P,...j,...F,...H]);let De=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,be=null,Ce=!0,Ee=!0,Me=!1,Te=!0,xe=!1,ke=!1,Se=!1,Ae=!1,_e=!1,Ne=!1,Ie=!1,Le=!0,Oe=!1,Pe=!0,je=!1,Fe={},He=null;const Re=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Be=M({},["audio","video","img","source","image","track"]);let Ue=null;const We=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",ze="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let Ve=Ge,Ke=!1,Je=null;const $e=M({},[qe,ze,Ge],p);let Ze=null;const Xe=["application/xhtml+xml","text/html"];let Qe=null,et=null;const tt=i.createElement("form"),nt=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!et||et!==e){if(e&&"object"==typeof e||(e={}),e=x(e),Ze=-1===Xe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Qe="application/xhtml+xml"===Ze?p:m,ge=D(e,"ALLOWED_TAGS")?M({},e.ALLOWED_TAGS,Qe):he,ve=D(e,"ALLOWED_ATTR")?M({},e.ALLOWED_ATTR,Qe):ye,Je=D(e,"ALLOWED_NAMESPACES")?M({},e.ALLOWED_NAMESPACES,p):$e,Ue=D(e,"ADD_URI_SAFE_ATTR")?M(x(We),e.ADD_URI_SAFE_ATTR,Qe):We,Ye=D(e,"ADD_DATA_URI_TAGS")?M(x(Be),e.ADD_DATA_URI_TAGS,Qe):Be,He=D(e,"FORBID_CONTENTS")?M({},e.FORBID_CONTENTS,Qe):Re,we=D(e,"FORBID_TAGS")?M({},e.FORBID_TAGS,Qe):{},be=D(e,"FORBID_ATTR")?M({},e.FORBID_ATTR,Qe):{},Fe=!!D(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,Ee=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,xe=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,_e=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,Oe=e.SANITIZE_NAMED_PROPS||!1,Pe=!1!==e.KEEP_CONTENT,je=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||q,Ve=e.NAMESPACE||Ge,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&nt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&nt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(Ee=!1),Ne&&(_e=!0),Fe&&(ge=M({},O),ve=[],!0===Fe.html&&(M(ge,S),M(ve,P)),!0===Fe.svg&&(M(ge,A),M(ve,j),M(ve,H)),!0===Fe.svgFilters&&(M(ge,_),M(ve,j),M(ve,H)),!0===Fe.mathMl&&(M(ge,I),M(ve,F),M(ve,H))),e.ADD_TAGS&&(ge===he&&(ge=x(ge)),M(ge,e.ADD_TAGS,Qe)),e.ADD_ATTR&&(ve===ye&&(ve=x(ve)),M(ve,e.ADD_ATTR,Qe)),e.ADD_URI_SAFE_ATTR&&M(Ue,e.ADD_URI_SAFE_ATTR,Qe),e.FORBID_CONTENTS&&(He===Re&&(He=x(He)),M(He,e.FORBID_CONTENTS,Qe)),Pe&&(ge["#text"]=!0),ke&&M(ge,["html","head","body"]),ge.table&&(M(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,ee=Q.createHTML("")}else void 0===Q&&(Q=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(W,l)),null!==Q&&"string"==typeof ee&&(ee=Q.createHTML(""));a&&a(e),et=e}},it=M({},["mi","mo","mn","ms","mtext"]),at=M({},["foreignobject","desc","title","annotation-xml"]),rt=M({},["title","style","font","a","script"]),ct=M({},[...A,..._,...N]),lt=M({},[...I,...L]),st=function(e){f(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},dt=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(_e||Ne)try{st(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ut=function(e){let t=null,n=null;if(Ae)e=""+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&Ve===Ge&&(e=''+e+"");const o=Q?Q.createHTML(e):e;if(Ve===Ge)try{t=(new U).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Ve,"template",null);try{t.documentElement.innerHTML=Ke?ee:o}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Ve===Ge?ie.call(t,ke?"html":"body")[0]:ke?t.documentElement:a},ft=function(e){return ne.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,null)},mt=function(e){return"function"==typeof E&&e instanceof E},pt=function(e,t,n){re[e]&&d(re[e],(e=>{e.call(o,t,n,et)}))},gt=function(e){let t=null;if(pt("beforeSanitizeElements",e,null),(n=e)instanceof B&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof Y)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return st(e),!0;var n;const i=Qe(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:i,allowedTags:ge}),e.hasChildNodes()&&!mt(e.firstElementChild)&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return st(e),!0;if(!ge[i]||we[i]){if(!we[i]&&vt(i)){if(De.tagNameCheck instanceof RegExp&&w(De.tagNameCheck,i))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(i))return!1}if(Pe&&!He[i]){const t=X(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t)for(let o=n.length-1;o>=0;--o)t.insertBefore(G(n[o],!0),$(e))}return st(e),!0}return e instanceof T&&!function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Ve,tagName:"template"});const n=m(e.tagName),o=m(t.tagName);return!!Je[e.namespaceURI]&&(e.namespaceURI===ze?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===qe?"svg"===n&&("annotation-xml"===o||it[o]):Boolean(ct[n]):e.namespaceURI===qe?t.namespaceURI===Ge?"math"===n:t.namespaceURI===ze?"math"===n&&at[o]:Boolean(lt[n]):e.namespaceURI===Ge?!(t.namespaceURI===ze&&!at[o])&&!(t.namespaceURI===qe&&!it[o])&&!lt[n]&&(rt[n]||!ct[n]):!("application/xhtml+xml"!==Ze||!Je[e.namespaceURI]))}(e)?(st(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!w(/<\/no(script|embed|frames)/i,e.innerHTML)?(xe&&3===e.nodeType&&(t=e.textContent,d([ce,le,se],(e=>{t=h(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),pt("afterSanitizeElements",e,null),!1):(st(e),!0)},ht=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in i||n in tt))return!1;if(Ee&&!be[t]&&w(de,t));else if(Ce&&w(ue,t));else if(!ve[t]||be[t]){if(!(vt(e)&&(De.tagNameCheck instanceof RegExp&&w(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&w(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&w(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Ue[t]);else if(w(pe,h(n,me,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Ye[e])if(Me&&!w(fe,h(n,me,"")));else if(n)return!1;return!0},vt=function(e){return"annotation-xml"!==e&&e.indexOf("-")>0},yt=function(e){pt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const a=t[i],{name:r,namespaceURI:c,value:l}=a,s=Qe(r);let f="value"===r?l:y(l);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,n),f=n.attrValue,n.forceKeepAttr)continue;if(dt(r,e),!n.keepAttr)continue;if(!Te&&w(/\/>/i,f)){dt(r,e);continue}xe&&d([ce,le,se],(e=>{f=h(f,e," ")}));const m=Qe(e.nodeName);if(ht(m,s,f)){if(!Oe||"id"!==s&&"name"!==s||(dt(r,e),f="user-content-"+f),Q&&"object"==typeof W&&"function"==typeof W.getAttributeType)if(c);else switch(W.getAttributeType(m,s)){case"TrustedHTML":f=Q.createHTML(f);break;case"TrustedScriptURL":f=Q.createScriptURL(f)}try{c?e.setAttributeNS(c,r,f):e.setAttribute(r,f),u(o.removed)}catch(e){}}}pt("afterSanitizeAttributes",e,null)},Dt=function e(t){let n=null;const o=ft(t);for(pt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)pt("uponSanitizeShadowNode",n,null),gt(n)||(n.content instanceof s&&e(n.content),yt(n));pt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,a=null,c=null;if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!mt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Se||ot(t),o.removed=[],"string"==typeof e&&(je=!1),je){if(e.nodeName){const t=Qe(e.nodeName);if(!ge[t]||we[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof E)n=ut("\x3c!----\x3e"),i=n.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!_e&&!xe&&!ke&&-1===e.indexOf("<"))return Q&&Ie?Q.createHTML(e):e;if(n=ut(e),!n)return _e?null:Ie?ee:""}n&&Ae&&st(n.firstChild);const l=ft(je?e:n);for(;a=l.nextNode();)gt(a)||(a.content instanceof s&&Dt(a.content),yt(a));if(je)return e;if(_e){if(Ne)for(c=oe.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(ve.shadowroot||ve.shadowrootmode)&&(c=ae.call(r,c,!0)),c}let u=ke?n.outerHTML:n.innerHTML;return ke&&ge["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&w(V,n.ownerDocument.doctype.name)&&(u="\n"+u),xe&&d([ce,le,se],(e=>{u=h(u,e," ")})),Q&&Ie?Q.createHTML(u):u},o.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Se=!0},o.clearConfig=function(){et=null,Se=!1},o.isValidAttribute=function(e,t,n){et||ot({});const o=Qe(e),i=Qe(t);return ht(o,i,n)},o.addHook=function(e,t){"function"==typeof t&&(re[e]=re[e]||[],f(re[e],t))},o.removeHook=function(e){if(re[e])return u(re[e])},o.removeHooks=function(e){re[e]&&(re[e]=[])},o.removeAllHooks=function(){re={}},o}()}()},895:()=>{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n{"use strict";const o=document.querySelector("body"),i=document.querySelector("#cs-navigation"),a=document.querySelector("#cs-navigation .cs-toggle");var r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],c={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},l={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const s=l;var d=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},u=function(e){return!0===e?1:0};function f(e,t){var n;return function(){var o=this,i=arguments;clearTimeout(n),n=setTimeout((function(){return e.apply(o,i)}),t)}}var m=function(e){return e instanceof Array?e:[e]};function p(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function g(e,t,n){var o=window.document.createElement(e);return t=t||"",n=n||"",o.className=t,void 0!==n&&(o.textContent=n),o}function h(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function v(e,t){return t(e)?e:e.parentNode?v(e.parentNode,t):void 0}function y(e,t){var n=g("div","numInputWrapper"),o=g("input","numInput "+e),i=g("span","arrowUp"),a=g("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?o.type="number":(o.type="text",o.pattern="\\d*"),void 0!==t)for(var r in t)o.setAttribute(r,t[r]);return n.appendChild(o),n.appendChild(i),n.appendChild(a),n}function D(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var w=function(){},b=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},C={D:w,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*u(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var o=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(o-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:w,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},E={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},M={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[M.w(e,t,n)]},F:function(e,t,n){return b(M.n(e,t,n)-1,!1,t)},G:function(e,t,n){return d(M.h(e,t,n))},H:function(e){return d(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[u(e.getHours()>11)]},M:function(e,t){return b(e.getMonth(),!0,t)},S:function(e){return d(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return d(e.getFullYear(),4)},d:function(e){return d(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return d(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return d(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},T=function(e){var t=e.config,n=void 0===t?c:t,o=e.l10n,i=void 0===o?l:o,a=e.isMobile,r=void 0!==a&&a;return function(e,t,o){var a=o||i;return void 0===n.formatDate||r?t.split("").map((function(t,o,i){return M[t]&&"\\"!==i[o-1]?M[t](e,a,n):"\\"!==t?t:""})).join(""):n.formatDate(e,t,a)}},x=function(e){var t=e.config,n=void 0===t?c:t,o=e.l10n,i=void 0===o?l:o;return function(e,t,o,a){if(0===e||e){var r,l=a||i,s=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var d=t||(n||c).dateFormat,u=String(e).trim();if("today"===u)r=new Date,o=!0;else if(n&&n.parseDate)r=n.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))r=new Date(e);else{for(var f=void 0,m=[],p=0,g=0,h="";pMath.min(t,n)&&e=0?new Date:new Date(n.config.minDate.getTime()),o=I(n.config);t.setHours(o.hours,o.minutes,o.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,o=D(e),i=o;void 0!==n.amPM&&o===n.amPM&&(n.amPM.textContent=n.l10n.amPM[u(n.amPM.textContent===n.l10n.amPM[0])]);var a=parseFloat(i.getAttribute("min")),r=parseFloat(i.getAttribute("max")),c=parseFloat(i.getAttribute("step")),l=parseInt(i.value,10),s=l+c*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==i.value&&2===i.value.length){var f=i===n.hourElement,m=i===n.minuteElement;sr&&(s=i===n.hourElement?s-r-u(!n.amPM):a,m&&U(void 0,1,n.hourElement)),n.amPM&&f&&(1===c?s+l===23:Math.abs(s-l)>c)&&(n.amPM.textContent=n.l10n.amPM[u(n.amPM.textContent===n.l10n.amPM[0])]),i.value=d(s)}}(e);var i=n._input.value;w(),xe(),n._input.value!==i&&n._debouncedChange()}function w(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,o=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,a=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=o,t=n.amPM.textContent,o=e%12+12*u(t===n.l10n.amPM[1]));var r=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===k(n.latestSelectedDateObj,n.config.minDate,!0),c=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===k(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var l=A(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),s=A(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=A(o,i,a);if(d>s&&d=12)]),void 0!==n.secondElement&&(n.secondElement.value=d(o)))}function j(e){var t=D(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&oe(n)}function F(e,t,o,i){return t instanceof Array?t.forEach((function(t){return F(e,t,o,i)})):e instanceof Array?e.forEach((function(e){return F(e,t,o,i)})):(e.addEventListener(t,o,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,o,i)}}))}function R(){be("onChange")}function Y(e,t){var o=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate=0&&k(e,n.selectedDates[1])<=0}(t)&&!Ee(t)&&r.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend",""+n.config.getWeek(t)+""),be("onDayCreate",r),r}function q(e){e.focus(),"range"===n.config.mode&&le(e)}function z(e){for(var t=e>0?0:n.config.showMonths-1,o=e>0?n.config.showMonths:-1,i=t;i!=o;i+=e)for(var a=n.daysContainer.children[i],r=e>0?0:a.children.length-1,c=e>0?a.children.length:-1,l=r;l!=c;l+=e){var s=a.children[l];if(-1===s.className.indexOf("hidden")&&ie(s.dateObj))return s}}function G(e,t){var i=o(),a=ae(i||document.body),r=void 0!==e?e:a?i:void 0!==n.selectedDateElem&&ae(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&ae(n.todayDateElem)?n.todayDateElem:z(t>0?1:-1);void 0===r?n._input.focus():a?function(e,t){for(var o=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,a=t>0?1:-1,r=o-n.currentMonth;r!=i;r+=a)for(var c=n.daysContainer.children[r],l=o-n.currentMonth===r?e.$i+t:t<0?c.children.length-1:0,s=c.children.length,d=l;d>=0&&d0?s:-1);d+=a){var u=c.children[d];if(-1===u.className.indexOf("hidden")&&ie(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return q(u)}n.changeMonth(a),G(z(a),0)}(r,t):q(r)}function V(e,t){for(var o=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),a=n.utils.getDaysInMonth(t,e),r=window.document.createDocumentFragment(),c=n.config.showMonths>1,l=c?"prevMonthDay hidden":"prevMonthDay",s=c?"nextMonthDay hidden":"nextMonthDay",d=i+1-o,u=0;d<=i;d++,u++)r.appendChild(W("flatpickr-day "+l,new Date(e,t-1,d),0,u));for(d=1;d<=a;d++,u++)r.appendChild(W("flatpickr-day",new Date(e,t,d),0,u));for(var f=a+1;f<=42-o&&(1===n.config.showMonths||u%7!=0);f++,u++)r.appendChild(W("flatpickr-day "+s,new Date(e,t+1,f%a),0,u));var m=g("div","dayContainer");return m.appendChild(r),m}function K(){if(void 0!==n.daysContainer){h(n.daysContainer),n.weekNumbers&&h(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&en.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var o=g("option","flatpickr-monthDropdown-month");o.value=new Date(n.currentYear,t).getMonth().toString(),o.textContent=b(t,n.config.shorthandCurrentMonth,n.l10n),o.tabIndex=-1,n.currentMonth===t&&(o.selected=!0),n.monthsDropdownContainer.appendChild(o)}}}function $(){var e,t=g("div","flatpickr-month"),o=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=g("span","cur-month"):(n.monthsDropdownContainer=g("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),F(n.monthsDropdownContainer,"change",(function(e){var t=D(e),o=parseInt(t.value,10);n.changeMonth(o-n.currentMonth),be("onMonthChange")})),J(),e=n.monthsDropdownContainer);var i=y("cur-year",{tabindex:"-1"}),a=i.getElementsByTagName("input")[0];a.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&a.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(a.setAttribute("max",n.config.maxDate.getFullYear().toString()),a.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var r=g("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(i),o.appendChild(r),t.appendChild(o),{container:t,yearElement:a,monthElement:e}}function Z(){h(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=$();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function X(){n.weekdayContainer?h(n.weekdayContainer):n.weekdayContainer=g("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=g("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return Q(),n.weekdayContainer}function Q(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=O(n.l10n.weekdays.shorthand);e>0&&e\n "+t.join("")+"\n \n "}}function ee(e,t){void 0===t&&(t=!0);var o=t?e:e-n.currentMonth;o<0&&!0===n._hidePrevMonthArrow||o>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=o,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,be("onYearChange"),J()),K(),be("onMonthChange"),Me())}function te(e){return n.calendarContainer.contains(e)}function ne(e){if(n.isOpen&&!n.config.inline){var t=D(e),o=te(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||o||te(e.relatedTarget)),a=!n.config.ignoredFocusElements.some((function(e){return e.contains(t)}));i&&a&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&l(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function oe(e){if(!(!e||n.config.minDate&&en.config.maxDate.getFullYear())){var t=e,o=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),o&&(n.redraw(),be("onYearChange"),J())}}function ie(e,t){var o;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&k(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&k(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===i)return!1;for(var a=!!n.config.enable,r=null!==(o=n.config.enable)&&void 0!==o?o:n.config.disable,c=0,l=void 0;c=l.from.getTime()&&i.getTime()<=l.to.getTime())return a}return!a}function ae(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function re(e){var t=e.target===n._input,o=n._input.value.trimEnd()!==Te();!t||!o||e.relatedTarget&&te(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function ce(t){var i=D(t),a=n.config.wrap?e.contains(i):i===n._input,r=n.config.allowInput,c=n.isOpen&&(!r||!a),s=n.config.inline&&a&&!r;if(13===t.keyCode&&a){if(r)return n.setDate(n._input.value,!0,i===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),i.blur();n.open()}else if(te(i)||c||s){var d=!!n.timeContainer&&n.timeContainer.contains(i);switch(t.keyCode){case 13:d?(t.preventDefault(),l(),ge()):he(t);break;case 27:t.preventDefault(),ge();break;case 8:case 46:a&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(d||a)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var u=o();if(void 0!==n.daysContainer&&(!1===r||u&&ae(u))){var f=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),ee(f),G(z(1),0)):G(void 0,f)}}break;case 38:case 40:t.preventDefault();var m=40===t.keyCode?1:-1;n.daysContainer&&void 0!==i.$i||i===n.input||i===n.altInput?t.ctrlKey?(t.stopPropagation(),oe(n.currentYear-m),G(z(1),0)):d||G(void 0,7*m):i===n.currentYearElement?oe(n.currentYear-m):n.config.enableTime&&(!d&&n.hourElement&&n.hourElement.focus(),l(t),n._debouncedChange());break;case 9:if(d){var p=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter((function(e){return e})),g=p.indexOf(i);if(-1!==g){var h=p[g+(t.shiftKey?-1:1)];t.preventDefault(),(h||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(i)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&i===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],w(),xe();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],w(),xe()}(a||te(i))&&be("onKeyDown",t)}function le(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var o=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),a=Math.min(o,n.selectedDates[0].getTime()),r=Math.max(o,n.selectedDates[0].getTime()),c=!1,l=0,s=0,d=a;da&&dl)?l=d:d>i&&(!s||d ."+t)).forEach((function(t){var a=t.dateObj.getTime(),r=l>0&&a0&&a>s;if(r)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));c&&!r||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)})),void 0!==e&&(e.classList.add(o<=n.selectedDates[0].getTime()?"startRange":"endRange"),io&&a===i&&t.classList.add("endRange"),a>=l&&(0===s||a<=s)&&S(a,i,o)&&t.classList.add("inRange")))}))}}function se(){!n.isOpen||n.config.static||n.config.inline||me()}function de(e){return function(t){var o=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),i=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==o&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter((function(e){return ie(e)})),n.selectedDates.length||"min"!==e||C(o),xe()),n.daysContainer&&(pe(),void 0!==o?n.currentYearElement[e]=o.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==o&&i.getFullYear()===o.getFullYear())}}function ue(){return n.config.wrap?e.querySelector("[data-input]"):e}function fe(){"object"!=typeof n.config.locale&&void 0===H.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=L(L({},H.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?H.l10ns[n.config.locale]:void 0),E.D="("+n.l10n.weekdays.shorthand.join("|")+")",E.l="("+n.l10n.weekdays.longhand.join("|")+")",E.M="("+n.l10n.months.shorthand.join("|")+")",E.F="("+n.l10n.months.longhand.join("|")+")",E.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===L(L({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===H.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=T(n),n.parseDate=x({config:n.config,l10n:n.l10n})}function me(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){be("onPreCalendarPosition");var t=e||n._positionElement,o=Array.prototype.reduce.call(n.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),i=n.calendarContainer.offsetWidth,a=n.config.position.split(" "),r=a[0],c=a.length>1?a[1]:null,l=t.getBoundingClientRect(),s=window.innerHeight-l.bottom,d="above"===r||"below"!==r&&so,u=window.pageYOffset+l.top+(d?-o-2:t.offsetHeight+2);if(p(n.calendarContainer,"arrowTop",!d),p(n.calendarContainer,"arrowBottom",d),!n.config.inline){var f=window.pageXOffset+l.left,m=!1,g=!1;"center"===c?(f-=(i-l.width)/2,m=!0):"right"===c&&(f-=i-l.width,g=!0),p(n.calendarContainer,"arrowLeft",!m&&!g),p(n.calendarContainer,"arrowCenter",m),p(n.calendarContainer,"arrowRight",g);var h=window.document.body.offsetWidth-(window.pageXOffset+l.right),v=f+i>window.document.body.offsetWidth,y=h+i>window.document.body.offsetWidth;if(p(n.calendarContainer,"rightMost",v),!n.config.static)if(n.calendarContainer.style.top=u+"px",v)if(y){var D=function(){for(var e=null,t=0;tn.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=o,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var r=Ee(i);r?n.selectedDates.splice(parseInt(r),1):n.selectedDates.push(i)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==k(i,n.selectedDates[0],!0)&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(w(),a){var c=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),c&&(be("onYearChange"),J()),be("onMonthChange")}if(Me(),K(),xe(),a||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():q(o),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var l="single"===n.config.mode&&!n.config.enableTime,s="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(l||s)&&ge()}R()}}n.parseDate=x({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=F,n._setHoursFromDate=C,n._positionCalendar=me,n.changeMonth=ee,n.changeYear=oe,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var o=I(n.config);M(o.hours,o.minutes,o.seconds)}n.redraw(),e&&be("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),be("onClose")},n.onMouseOver=le,n._createElement=g,n.createDay=W,n.destroy=function(){void 0!==n.config&&be("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete n[e]}catch(e){}}))},n.isEnabled=ie,n.jumpToDate=Y,n.updateValue=xe,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var o=D(e);o&&o.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void be("onOpen")}if(!n._input.disabled&&!n.config.inline){var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),be("onOpen"),me(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return n.hourElement.select()}),50))}},n.redraw=pe,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var o in Object.assign(n.config,e),e)void 0!==ve[o]&&ve[o].forEach((function(e){return e()}));else n.config[e]=t,void 0!==ve[e]?ve[e].forEach((function(e){return e()})):r.indexOf(e)>-1&&(n.config[e]=m(t));n.redraw(),xe(!0)},n.setDate=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);ye(e,o),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),Y(void 0,t),C(),0===n.selectedDates.length&&n.clear(!1),xe(t),t&&be("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var ve={locale:[fe,Q],showMonths:[Z,a,X],minDate:[Y],maxDate:[Y],positionElement:[we],clickOpens:[function(){!0===n.config.clickOpens?(F(n._input,"focus",n.open),F(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function ye(e,t){var o=[];if(e instanceof Array)o=e.map((function(e){return n.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)o=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":o=[n.parseDate(e,t)];break;case"multiple":o=e.split(n.config.conjunction).map((function(e){return n.parseDate(e,t)}));break;case"range":o=e.split(n.l10n.rangeSeparator).map((function(e){return n.parseDate(e,t)}))}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?o:o.filter((function(e){return e instanceof Date&&ie(e,!1)})),"range"===n.config.mode&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function De(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function we(){n._positionElement=n.config.positionElement||n._input}function be(e,t){if(void 0!==n.config){var o=n.config[e];if(void 0!==o&&o.length>0)for(var i=0;o[i]&&i1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=b(o.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=o.getMonth().toString(),e.value=o.getFullYear().toString()})),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYearn.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function Te(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map((function(e){return n.formatDate(e,t)})).filter((function(e,t,o){return"range"!==n.config.mode||n.config.enableTime||o.indexOf(e)===t})).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function xe(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=Te(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=Te(n.config.altFormat)),!1!==e&&be("onValueUpdate")}function ke(e){var t=D(e),o=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);o||i?ee(o?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var o=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=L(L({},JSON.parse(JSON.stringify(e.dataset||{}))),t),l={};n.config.parseDate=a.parseDate,n.config.formatDate=a.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=De(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=De(e)}});var s="time"===a.mode;if(!a.dateFormat&&(a.enableTime||s)){var d=H.defaultConfig.dateFormat||c.dateFormat;l.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):d+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var u=H.defaultConfig.altFormat||c.altFormat;l.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):u+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:de("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:de("max")});var f=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:f("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:f("max")}),"time"===a.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,l,a);for(var p=0;p-1?n.config[h]=m(g[h]).map(i).concat(n.config[h]):void 0===a[h]&&(n.config[h]=g[h])}a.altInputClass||(n.config.altInputClass=ue().className+" "+n.config.altInputClass),be("onParseConfig")}(),fe(),n.input=ue(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=g(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),we()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&ye(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=g("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=g("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=g("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=g("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,Z(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(p(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(p(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],Me(),n.monthNav)),n.innerContainer=g("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=g("div","flatpickr-weekwrapper");e.appendChild(g("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=g("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),o=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(o),n.weekNumbers=i,n.weekWrapper=o}n.rContainer=g("div","flatpickr-rContainer"),n.rContainer.appendChild(X()),n.daysContainer||(n.daysContainer=g("div","flatpickr-days"),n.daysContainer.tabIndex=-1),K(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=I(n.config);n.timeContainer=g("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=g("span","flatpickr-time-separator",":"),o=y("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=o.getElementsByTagName("input")[0];var i=y("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=d(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=d(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(o),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var a=y("flatpickr-second");n.secondElement=a.getElementsByTagName("input")[0],n.secondElement.value=d(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(g("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(a)}return n.config.time_24hr||(n.amPM=g("span","flatpickr-am-pm",n.l10n.amPM[u((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),p(n.calendarContainer,"rangeMode","range"===n.config.mode),p(n.calendarContainer,"animate",!0===n.config.animate),p(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var a=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!a&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var r=g("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(r,n.element),r.appendChild(n.element),n.altInput&&r.appendChild(n.altInput),r.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),(function(t){return F(t,"click",n[e])}))})),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=g("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}F(n.mobileInput,"change",(function(e){n.setDate(D(e).value,!1,n.mobileFormatStr),be("onChange"),be("onClose")}))}();else{var e=f(se,50);if(n._debouncedChange=f(R,P),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(n.daysContainer,"mouseover",(function(e){"range"===n.config.mode&&le(D(e))})),F(n._input,"keydown",ce),void 0!==n.calendarContainer&&F(n.calendarContainer,"keydown",ce),n.config.inline||n.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"touchstart",ne):F(window.document,"mousedown",ne),F(window.document,"focus",ne,{capture:!0}),!0===n.config.clickOpens&&(F(n._input,"focus",n.open),F(n._input,"click",n.open)),void 0!==n.daysContainer&&(F(n.monthNav,"click",ke),F(n.monthNav,["keyup","increment"],j),F(n.daysContainer,"click",he)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){F(n.timeContainer,["increment"],l),F(n.timeContainer,"blur",l,{capture:!0}),F(n.timeContainer,"click",B),F([n.hourElement,n.minuteElement],["focus","click"],(function(e){return D(e).select()})),void 0!==n.secondElement&&F(n.secondElement,"focus",(function(){return n.secondElement&&n.secondElement.select()})),void 0!==n.amPM&&F(n.amPM,"click",(function(e){l(e)}))}n.config.allowInput&&F(n._input,"blur",re)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&C(n.config.noCalendar?n.latestSelectedDateObj:void 0),xe(!1)),a();var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&o&&me(),be("onReady")}(),n}function F(e,t){for(var n=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),o=[],i=0;i{e.todos.forEach((e=>{const n=V(e);t.appendChild(n)}))})),t}(t);return i?n.appendChild(i):console.error("Error rendering todo list: Data empty or null"),n}function V(e){const t=function(e,t,n,o){const i=document.createElement("li");i.setAttribute("class",t);const a=o(n);return i.appendChild(a),i}(0,`todo-container ${J(e.priority)}`,e,K);return t.id=`todo-${e.id}`,t}function K(e){const t=U("class","todo-content"),n=U("class","todo-checkbox"),o=W("class","todo-title",e.title),i=function(e,t,n){const o=document.createElement("p");return o.setAttribute("class","todo-dueDate"),o.textContent=n,o}(0,0,e.dueDate),a=U("class","todo-item"),r=U("class","todo-item");a.classList.add("details"),a.textContent="Details",a.id=e.id+"details";const c=a.id;r.classList.add("delete"),r.id=e.id+"delete";const l=new ce(e.id,e.title,e.project,e.description,e.dueDate,e.priority,e.completed);l.checkboxHandler(n,o,i,e.id),l.todoDeleteHandler(r,e.id,e.project),l.todoDetailsHandler(a,c,e.id);const s=function(){const e=document.createElement("div");return e.innerHTML=B.sanitize(''),e}();return r.appendChild(s),t.appendChild(n),t.appendChild(o),t.appendChild(i),t.appendChild(a),t.appendChild(r),t}function J(e){switch(e){case"low":default:return"priority-low";case"medium":return"priority-medium";case"high":return"priority-high"}}function $(e){console.error("Error retrieving data from local storage: ",e)}function Z(e,t){return new Promise(((n,o)=>{try{const o=JSON.stringify(t);localStorage.setItem(e,o),n()}catch(e){o(e)}}))}function X(e){try{const t=localStorage.getItem(e);return JSON.parse(t)}catch(e){return console.error("Error retrieving data from local storage: ",e),null}}!function(e){const t=new Date,n=t.getDay();if(1!==n){const e=n-1;t.setDate(t.getDate()-e)}let o=new Date(t);e.projects.forEach((e=>{const t=e.todos,n=Math.ceil(t.length/7);let i=0;for(let e=0;e<7;e++){const e=t.slice(i,i+n),a=new Date(o);e.forEach(((e,t)=>{a.setDate(o.getDate()+t),e.dueDate=a.toISOString().split("T")[0]})),i+=n,o.setDate(o.getDate()+1)}}))}(z);const Q="projects";class ee{constructor(e,t){this.id=e,this.name=t,this.todos=[]}}class te{constructor(){this.projects=[]}addTodoToProject(e){let t=this.getProjectByName(e.project);if(t)t.todos.push(e);else{const n=Date.now();t=new ee(n,e.project),this.projects.push(t),t.todos.push(e)}}removeTodoFromProject(e,t){const n=this.getProjectByName(e);n?n.todos=n.todos.filter((e=>e.id!==t)):console.log("No project found with name:",e)}getProjectByName(e){return this.projects.find((t=>t.name===e))}getProjectById(e){const t=X(Q);if(!t)return null;const n=t.find((t=>t.id===e));return n?{...n,todos:n.todos||[]}:null}displayProjectsInNavigationBar(){const e=X(Q);if(!e||0===e.length)return void console.error("No projects found in local storage.");const t=document.getElementById("projects");if(!t)return void console.error("Projects dropdown not found.");const n=t.querySelector(".cs-drop-ul");n?e.forEach((e=>{const t=document.createElement("li");t.classList.add("cs-drop-li");const o=document.createElement("div");o.classList.add("cs-li-link","cs-drop-link"),o.textContent=e.name,o.setAttribute("id",e.id),t.appendChild(o),n.appendChild(t)})):console.error("Dropdown list not found within projects dropdown.")}}const ne=new te,oe="projects";function ie(e){let t;q(e);try{t=X(oe),t||Z(oe,z.projects)}catch(e){$(e),Z(oe,z.projects)}const n=document.querySelector("#content"),o=G(t);n.appendChild(o)}const ae="projects";class re{constructor(e,t,n,o,i,a){this.id=e,this.title=t,this.project=n,this.description=o,this.dueDate=i,this.priority=a,this.completed=!1}}class ce{constructor(e,t,n,o,i,a,r){this.todoId=e,this.todoTitle=t,this.projectName=n,this.todoDescription=o,this.todoDueDate=i,this.todoPriority=a,this.todoCompleted=r}checkboxHandler(e,t,n,o){const i=X(ae),a=this.findTodoById(i,o);if(!a)return void console.error("Todo with ID",o,"not found.");a.completed&&(e.classList.add("todo-checked"),t.style.textDecoration="line-through",n.style.textDecoration="line-through"),e.addEventListener("click",(e=>{e.preventDefault(),r()}));const r=()=>{e.classList.toggle("todo-checked");const i=e.classList.contains("todo-checked");t.style.textDecoration=i?"line-through":"",n.style.textDecoration=i?"line-through":"",this.updateTodoCompletion(o,i)};e.removeEventListener("click",(()=>{r()}))}todoDeleteHandler(e,t,n){e.addEventListener("click",(e=>{e.preventDefault(),o()}));const o=()=>{const e=t;let o=X(ae),i=function(e,t){if(!e||!Array.isArray(e))return console.error("Existing data is not in the expected format."),e;for(const n of e)n.todos&&Array.isArray(n.todos)?n.todos=n.todos.filter((e=>e.id!==t)):console.error("Project todos are not in the expected format.");return e}(o,e);Z(ae,i),ne.removeTodoFromProject(n,e);const a=document.querySelector("#content"),r=G(o);q(a),a.appendChild(r)};e.removeEventListener("click",(()=>{o()}))}updateTodoCompletion(e,t){try{const n=X(ae);if(null===n)return void console.error("Cannot update todo completion status: No existing data found in local storage");const o=n.map((n=>({...n,todos:n.todos.map((n=>n.id===e?{...n,completed:t}:n))})));Z(ae,o)}catch(e){console.error(e)}}todoDetailsHandler(e,t,n){e.addEventListener("click",(e=>{e.preventDefault(),o()}));const o=async()=>{try{const o=X(ae),i=this.findTodoById(o,n);if(!i)return void console.error("Todo with id: ",n,"not found in local storage");await de(e,t,i)}catch(e){console.error("Error handling details click: ",e)}};e.removeEventListener("click",(()=>{o()}))}getTodosDueToday(e){const t=(new Date).toISOString().split("T")[0];return this.getFilteredProjects(e,t,t)}getTodosDueThisWeek(e){const t=new Date,n=t.getDay(),o=new Date(t);o.setDate(t.getDate()-n+(0===n?-6:1)),o.setHours(0,0,0,0);const i=new Date(o);return i.setDate(o.getDate()+6),i.setHours(23,59,59,999),this.getFilteredProjects(e,o,i)}getFilteredProjects(e,t,n){return e.map((e=>({...e,todos:e.todos.filter((e=>{const o=new Date(e.dueDate);return o>=new Date(t)&&o<=new Date(n)}))}))).filter((e=>e.todos.length>0))}getTodosForProject(e,t){if(!e)return console.error("No existing data found in local storage"),null;const n=e.filter((e=>e.name===t));return 0===!n.length?(console.error(`Project '${t}' not found`),null):n}findTodoById(e,t){for(const n of e)for(const e of n.todos)if(e.id===t)return e;return null}}const le="projects";class se{constructor(e,t){this.document=e,this.projectManager=t,this.formElement=this.document.getElementById("todo-form")}async handleSubmit(e){e.preventDefault();try{const e=this.extractFormData(),t=this.createTodoFromFormData(e);let n=X(le);n||(n=z.projects);const o=this.addTodoToExistingData(n,t);await Z(le,o),this.addNewTodoToList(t),this.clearForm(),this.closeDialog(),me(document.getElementById("dialog"))}catch(e){console.error("Error handling form submission: ",e)}}async handleSave(e,t){e.preventDefault();try{const e=this.extractFormData(t);e.project!==t.project&&this.updateProjectNameInManager(t.project,e.project,t);const n={...t,...e};await async function(e,t,n){try{let o=X(e);if(!o)return console.error("Cannot edit data: No existing data found in local storage."),!1;let i=-1,a=-1;for(let e=0;ee.id===t)),-1!==a){i=e;break}if(-1===i||-1===a)throw new Error("Todo with specified id not found in existing data.");return n.project!==o[i].name?o=function(e,t,n,o){e[t].todos[n].project=o;const i=e.findIndex((e=>e.name===o));if(-1===i){const i=Date.now(),a=new ee(i,o);a.todos.push(e[t].todos[n]),e.push(a)}else e[i].todos.push(e[t].todos[n]);return e[t].todos.splice(n,1),e}(o,i,a,n.project):o[i].todos[a]={...o[i].todos[a],...n},await Z(e,o),!0}catch(e){return console.error("Error editing data in local storage: ",e),!1}}(le,t.id,n),this.updatedTodoInList(n),this.clearForm(),this.closeDialog(),me(document.getElementById("dialog"))}catch(e){console.error("Error saving data: ",e)}}updateProjectNameInManager(e,t,n){const o=X(le);if(!o)return void console.error("No existing data found in local storage.");const i=o.findIndex((t=>t.name===e));if(-1!==i){const e=o[i];e.todos=e.todos.filter((e=>e.id!==n.id)),o[i]=e;const a=o.findIndex((e=>e.name===t));if(-1===a){const e=Date.now(),i=new ee(e,t);i.todos.push(n),o.push(i)}else o[a].todos.push(n);Z(le,o)}else console.error("Project with specified name not found in existing data.")}extractFormData(e={}){const t=new FormData(this.formElement);return{id:e.id||"",title:t.get("title"),project:t.get("project"),description:t.get("description"),dueDate:t.get("dueDate"),priority:t.get("priority")}}addNewTodoToList(e){const t=document.querySelector(".todo-list"),n=V(e);t.appendChild(n)}addTodoToExistingData(e,t){const n=e.findIndex((e=>e.name===t.project));return-1!==n?e[n].todos.push(t):e.push({id:Date.now(),name:t.project,todos:[t]}),e}updatedTodoInList(e){const t=document.querySelector(".todo-list").querySelector(`#todo-${e.id}`);t&&(t.querySelector(".todo-title").textContent=e.title,t.querySelector(".todo-dueDate").textContent=e.dueDate,t.className=`todo-container ${J(e.priority)}`)}createTodoFromFormData(e){const t=Math.random().toFixed(),n=Date.now()+t;return new re(n,e.title,e.project,e.description,e.dueDate,e.priority)}populateTodoForm(e){const t=this.formElement;t.elements.id=e.id,t.elements.title.value=e.title,t.elements.project.value=e.project,t.elements.description.value=e.description,t.elements.dueDate.value=e.dueDate,t.elements.priority.value=e.priority}closeDialog(){this.document.getElementById("dialog").close()}clearForm(){this.formElement.reset()}}async function de(e,t,n){try{const o=document.getElementById("newTodoButton"),i=document.getElementById(t),a=await async function(){const e=document.createElement("dialog");e.id="dialog";const t=await fetch("dialogFormContent.html");if(!t.ok)throw new Error("Failed to fetch dialog form content");return e.innerHTML=await t.text(),document.body.appendChild(e),e}();e===o?function(e){e.showModal(),Y();const t=ue(e,"submit","Add");t.addEventListener("click",(e=>{n(e)}));const n=e=>{fe().handleSubmit(e)};t.removeEventListener("click",(()=>{n()}))}(a):e===i&&function(e,t){e.showModal(),Y();const n=ue(e,"save","Save");fe().populateTodoForm(t),n.addEventListener("click",(e=>{o(e)}));const o=e=>{fe().handleSave(e,t)};n.removeEventListener("click",(()=>{o()}))}(a,n),function(e){const t=e.querySelector("#dialog-close-btn");t.addEventListener("click",(()=>{n()}));const n=()=>{e.querySelector("#todo-form").reset(),e.close(),me(e)};t.removeEventListener("click",(()=>{n()}))}(a)}catch(e){console.error("Error in dialogHandler:",e)}}function ue(e,t,n){const o=e.querySelector("#form-button");return o.setAttribute("type",t),o.textContent=n,o}function fe(){return new se(document,ne)}function me(e){document.body.removeChild(e)}const pe="projects",ge="projects",he="projects",ve=["home","today","week","projects"],ye=document.getElementById("newTodoButton"),De=document.getElementById("content");!function(){function e(){document.body.classList.add("dark-mode"),localStorage.setItem("theme","dark")}function t(){document.body.classList.remove("dark-mode"),localStorage.setItem("theme","light")}!function(){let n="light";localStorage.getItem("theme")?n=localStorage.getItem("theme"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(n="dark"),"dark"===n?e():t()}();const n=document.getElementById("dark-mode-toggle");n.addEventListener("click",(e=>{e.preventDefault(),o()}));const o=()=>{"light"===localStorage.getItem("theme")?e():t()};n.removeEventListener("click",(()=>{o()}))}(),function(){a.addEventListener("click",(function(){a.classList.toggle("cs-active"),i.classList.toggle("cs-active"),o.classList.toggle("cs-open"),function(){const e=document.querySelector("#cs-expanded");"false"===e.getAttribute("aria-expanded")?e.setAttribute("aria-expanded","true"):e.setAttribute("aria-expanded","false")}()}));const e=Array.from(document.querySelectorAll("#cs-navigation .cs-dropdown"));for(const t of e){const e=()=>{t.classList.toggle("cs-active")};t.addEventListener("click",e)}}(),ie(De),(new te).displayProjectsInNavigationBar();try{ve.forEach((e=>{const t=document.getElementById(e);t.addEventListener("click",(()=>{n()}));const n=()=>{switch(e){case"home":default:ie(De);break;case"today":!function(e){let t;q(e);try{t=X(pe),t||Z(pe,z.projects)}catch(e){$(e),Z(pe,z.projects)}const n=(new ce).getTodosDueToday(t),o=document.querySelector("#content"),i=G(n);o.appendChild(i);const a=document.querySelector(".title");a.textContent=a.textContent+" Due Today"}(De);break;case"week":!function(e){let t;q(e);try{t=X(ge),t||Z(ge,z.projects)}catch(e){$(e),Z(ge,z.projects)}const n=(new ce).getTodosDueThisWeek(t),o=document.querySelector("#content"),i=G(n);o.appendChild(i);const a=document.querySelector(".title");a.textContent=a.textContent+" Due This Week"}(De)}!function(e){const t=document.querySelector("body"),n=document.querySelector("#cs-navigation"),o=document.querySelector("#cs-navigation .cs-toggle");try{ve.forEach((i=>{const a=document.getElementById(i);a&&(i===e?(a.classList.add("cs-active"),o.classList.remove("cs-active"),n.classList.remove("cs-active"),t.classList.remove("cs-open")):a.classList.remove("cs-active"))}))}catch(e){console.error("Error updating navigation state: ",e)}}(e)};t.removeEventListener("click",(()=>{n()}))}))}catch(e){console.error("Error setting up event listeners for tab navigation: ",e)}try{const e=document.getElementById("projects");e.addEventListener("click",(e=>{t(e)}));const t=e=>{if(e.target.classList.contains("cs-drop-link")){e.preventDefault();const t=e.target.textContent.trim();!function(e,t){let n;q(e);try{n=X(he),n||Z(he,z.projects)}catch(e){$(e),Z(he,z.projects)}const o=(new ce).getTodosForProject(n,t),i=document.querySelector("#content"),a=G(o);i.appendChild(a);const r=document.querySelector(".title"),c="In "+t;r.textContent=r.textContent+" "+c}(De,t)}};e.removeEventListener("click",(()=>{t()}))}catch(e){console.error("Error handling dropdown buttons: ",e)}try{const e=async()=>{await de(ye,"newTodoButton")};ye.addEventListener("click",(()=>{e()})),ye.removeEventListener("click",(()=>{e()}))}catch(e){!function(e){console.error("Error instantiating dialog",e)}(e)}}},e=>{e(e.s=605)}]); +(self.webpackChunktodoornot=self.webpackChunktodoornot||[]).push([[179],{856:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:a,seal:r,create:c}=Object,{apply:l,construct:s}="undefined"!=typeof Reflect&&Reflect;a||(a=function(e){return e}),r||(r=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const d=E(Array.prototype.forEach),u=E(Array.prototype.pop),f=E(Array.prototype.push),m=E(String.prototype.toLowerCase),p=E(String.prototype.toString),g=E(String.prototype.match),h=E(String.prototype.replace),v=E(String.prototype.indexOf),y=E(String.prototype.trim),D=E(Object.prototype.hasOwnProperty),w=E(RegExp.prototype.test),b=(C=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:m;t&&t(e,null);let a=o.length;for(;a--;){let t=o[a];if("string"==typeof t){const e=i(t);e!==t&&(n(o)||(o[a]=e),t=e)}e[t]=!0}return e}function T(e){for(let t=0;t/gm),B=r(/\${[\w\W]*}/gm),U=r(/^data-[\-\w.\u00B7-\uFFFF]/),W=r(/^aria-[\-\w]+$/),q=r(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z=r(/^(?:\w+script|data):/i),G=r(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V=r(/^html$/i);var K=Object.freeze({__proto__:null,MUSTACHE_EXPR:R,ERB_EXPR:Y,TMPLIT_EXPR:B,DATA_ATTR:U,ARIA_ATTR:W,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:z,ATTR_WHITESPACE:G,DOCTYPE_NAME:V});const $=function(){return"undefined"==typeof window?null:window};return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$();const o=e=>t(e);if(o.version="3.0.9",o.removed=[],!n||!n.document||9!==n.document.nodeType)return o.isSupported=!1,o;let{document:i}=n;const r=i,l=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:C,Node:E,Element:T,NodeFilter:R,NamedNodeMap:Y=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:U,trustedTypes:W}=n,z=T.prototype,G=k(z,"cloneNode"),J=k(z,"nextSibling"),Z=k(z,"childNodes"),X=k(z,"parentNode");if("function"==typeof C){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let Q,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:oe,getElementsByTagName:ie}=i,{importNode:ae}=r;let re={};o.isSupported="function"==typeof e&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ce,ERB_EXPR:le,TMPLIT_EXPR:se,DATA_ATTR:de,ARIA_ATTR:ue,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:me}=K;let{IS_ALLOWED_URI:pe}=K,ge=null;const he=M({},[...S,...A,...I,...N,...O]);let ve=null;const ye=M({},[...P,...j,...F,...H]);let De=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,be=null,Ce=!0,Ee=!0,Me=!1,Te=!0,xe=!1,ke=!1,Se=!1,Ae=!1,Ie=!1,_e=!1,Ne=!1,Le=!0,Oe=!1,Pe=!0,je=!1,Fe={},He=null;const Re=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Be=M({},["audio","video","img","source","image","track"]);let Ue=null;const We=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",ze="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let Ve=Ge,Ke=!1,$e=null;const Je=M({},[qe,ze,Ge],p);let Ze=null;const Xe=["application/xhtml+xml","text/html"];let Qe=null,et=null;const tt=i.createElement("form"),nt=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!et||et!==e){if(e&&"object"==typeof e||(e={}),e=x(e),Ze=-1===Xe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Qe="application/xhtml+xml"===Ze?p:m,ge=D(e,"ALLOWED_TAGS")?M({},e.ALLOWED_TAGS,Qe):he,ve=D(e,"ALLOWED_ATTR")?M({},e.ALLOWED_ATTR,Qe):ye,$e=D(e,"ALLOWED_NAMESPACES")?M({},e.ALLOWED_NAMESPACES,p):Je,Ue=D(e,"ADD_URI_SAFE_ATTR")?M(x(We),e.ADD_URI_SAFE_ATTR,Qe):We,Ye=D(e,"ADD_DATA_URI_TAGS")?M(x(Be),e.ADD_DATA_URI_TAGS,Qe):Be,He=D(e,"FORBID_CONTENTS")?M({},e.FORBID_CONTENTS,Qe):Re,we=D(e,"FORBID_TAGS")?M({},e.FORBID_TAGS,Qe):{},be=D(e,"FORBID_ATTR")?M({},e.FORBID_ATTR,Qe):{},Fe=!!D(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,Ee=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,xe=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,Ne=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,Oe=e.SANITIZE_NAMED_PROPS||!1,Pe=!1!==e.KEEP_CONTENT,je=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||q,Ve=e.NAMESPACE||Ge,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&nt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&nt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(Ee=!1),_e&&(Ie=!0),Fe&&(ge=M({},O),ve=[],!0===Fe.html&&(M(ge,S),M(ve,P)),!0===Fe.svg&&(M(ge,A),M(ve,j),M(ve,H)),!0===Fe.svgFilters&&(M(ge,I),M(ve,j),M(ve,H)),!0===Fe.mathMl&&(M(ge,N),M(ve,F),M(ve,H))),e.ADD_TAGS&&(ge===he&&(ge=x(ge)),M(ge,e.ADD_TAGS,Qe)),e.ADD_ATTR&&(ve===ye&&(ve=x(ve)),M(ve,e.ADD_ATTR,Qe)),e.ADD_URI_SAFE_ATTR&&M(Ue,e.ADD_URI_SAFE_ATTR,Qe),e.FORBID_CONTENTS&&(He===Re&&(He=x(He)),M(He,e.FORBID_CONTENTS,Qe)),Pe&&(ge["#text"]=!0),ke&&M(ge,["html","head","body"]),ge.table&&(M(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,ee=Q.createHTML("")}else void 0===Q&&(Q=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(W,l)),null!==Q&&"string"==typeof ee&&(ee=Q.createHTML(""));a&&a(e),et=e}},it=M({},["mi","mo","mn","ms","mtext"]),at=M({},["foreignobject","desc","title","annotation-xml"]),rt=M({},["title","style","font","a","script"]),ct=M({},[...A,...I,..._]),lt=M({},[...N,...L]),st=function(e){f(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},dt=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Ie||_e)try{st(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ut=function(e){let t=null,n=null;if(Ae)e=""+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&Ve===Ge&&(e=''+e+"");const o=Q?Q.createHTML(e):e;if(Ve===Ge)try{t=(new U).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Ve,"template",null);try{t.documentElement.innerHTML=Ke?ee:o}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Ve===Ge?ie.call(t,ke?"html":"body")[0]:ke?t.documentElement:a},ft=function(e){return ne.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,null)},mt=function(e){return"function"==typeof E&&e instanceof E},pt=function(e,t,n){re[e]&&d(re[e],(e=>{e.call(o,t,n,et)}))},gt=function(e){let t=null;if(pt("beforeSanitizeElements",e,null),(n=e)instanceof B&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof Y)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return st(e),!0;var n;const i=Qe(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:i,allowedTags:ge}),e.hasChildNodes()&&!mt(e.firstElementChild)&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return st(e),!0;if(!ge[i]||we[i]){if(!we[i]&&vt(i)){if(De.tagNameCheck instanceof RegExp&&w(De.tagNameCheck,i))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(i))return!1}if(Pe&&!He[i]){const t=X(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t)for(let o=n.length-1;o>=0;--o)t.insertBefore(G(n[o],!0),J(e))}return st(e),!0}return e instanceof T&&!function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Ve,tagName:"template"});const n=m(e.tagName),o=m(t.tagName);return!!$e[e.namespaceURI]&&(e.namespaceURI===ze?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===qe?"svg"===n&&("annotation-xml"===o||it[o]):Boolean(ct[n]):e.namespaceURI===qe?t.namespaceURI===Ge?"math"===n:t.namespaceURI===ze?"math"===n&&at[o]:Boolean(lt[n]):e.namespaceURI===Ge?!(t.namespaceURI===ze&&!at[o])&&!(t.namespaceURI===qe&&!it[o])&&!lt[n]&&(rt[n]||!ct[n]):!("application/xhtml+xml"!==Ze||!$e[e.namespaceURI]))}(e)?(st(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!w(/<\/no(script|embed|frames)/i,e.innerHTML)?(xe&&3===e.nodeType&&(t=e.textContent,d([ce,le,se],(e=>{t=h(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),pt("afterSanitizeElements",e,null),!1):(st(e),!0)},ht=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in i||n in tt))return!1;if(Ee&&!be[t]&&w(de,t));else if(Ce&&w(ue,t));else if(!ve[t]||be[t]){if(!(vt(e)&&(De.tagNameCheck instanceof RegExp&&w(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&w(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&w(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Ue[t]);else if(w(pe,h(n,me,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Ye[e])if(Me&&!w(fe,h(n,me,"")));else if(n)return!1;return!0},vt=function(e){return"annotation-xml"!==e&&e.indexOf("-")>0},yt=function(e){pt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const a=t[i],{name:r,namespaceURI:c,value:l}=a,s=Qe(r);let f="value"===r?l:y(l);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,n),f=n.attrValue,n.forceKeepAttr)continue;if(dt(r,e),!n.keepAttr)continue;if(!Te&&w(/\/>/i,f)){dt(r,e);continue}xe&&d([ce,le,se],(e=>{f=h(f,e," ")}));const m=Qe(e.nodeName);if(ht(m,s,f)){if(!Oe||"id"!==s&&"name"!==s||(dt(r,e),f="user-content-"+f),Q&&"object"==typeof W&&"function"==typeof W.getAttributeType)if(c);else switch(W.getAttributeType(m,s)){case"TrustedHTML":f=Q.createHTML(f);break;case"TrustedScriptURL":f=Q.createScriptURL(f)}try{c?e.setAttributeNS(c,r,f):e.setAttribute(r,f),u(o.removed)}catch(e){}}}pt("afterSanitizeAttributes",e,null)},Dt=function e(t){let n=null;const o=ft(t);for(pt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)pt("uponSanitizeShadowNode",n,null),gt(n)||(n.content instanceof s&&e(n.content),yt(n));pt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,a=null,c=null;if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!mt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Se||ot(t),o.removed=[],"string"==typeof e&&(je=!1),je){if(e.nodeName){const t=Qe(e.nodeName);if(!ge[t]||we[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof E)n=ut("\x3c!----\x3e"),i=n.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Ie&&!xe&&!ke&&-1===e.indexOf("<"))return Q&&Ne?Q.createHTML(e):e;if(n=ut(e),!n)return Ie?null:Ne?ee:""}n&&Ae&&st(n.firstChild);const l=ft(je?e:n);for(;a=l.nextNode();)gt(a)||(a.content instanceof s&&Dt(a.content),yt(a));if(je)return e;if(Ie){if(_e)for(c=oe.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(ve.shadowroot||ve.shadowrootmode)&&(c=ae.call(r,c,!0)),c}let u=ke?n.outerHTML:n.innerHTML;return ke&&ge["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&w(V,n.ownerDocument.doctype.name)&&(u="\n"+u),xe&&d([ce,le,se],(e=>{u=h(u,e," ")})),Q&&Ne?Q.createHTML(u):u},o.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Se=!0},o.clearConfig=function(){et=null,Se=!1},o.isValidAttribute=function(e,t,n){et||ot({});const o=Qe(e),i=Qe(t);return ht(o,i,n)},o.addHook=function(e,t){"function"==typeof t&&(re[e]=re[e]||[],f(re[e],t))},o.removeHook=function(e){if(re[e])return u(re[e])},o.removeHooks=function(e){re[e]&&(re[e]=[])},o.removeAllHooks=function(){re={}},o}()}()},895:()=>{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n{"use strict";const o=document.querySelector("body"),i=document.querySelector("#cs-navigation"),a=document.querySelector("#cs-navigation .cs-toggle");var r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],c={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},l={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const s=l;var d=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},u=function(e){return!0===e?1:0};function f(e,t){var n;return function(){var o=this,i=arguments;clearTimeout(n),n=setTimeout((function(){return e.apply(o,i)}),t)}}var m=function(e){return e instanceof Array?e:[e]};function p(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function g(e,t,n){var o=window.document.createElement(e);return t=t||"",n=n||"",o.className=t,void 0!==n&&(o.textContent=n),o}function h(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function v(e,t){return t(e)?e:e.parentNode?v(e.parentNode,t):void 0}function y(e,t){var n=g("div","numInputWrapper"),o=g("input","numInput "+e),i=g("span","arrowUp"),a=g("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?o.type="number":(o.type="text",o.pattern="\\d*"),void 0!==t)for(var r in t)o.setAttribute(r,t[r]);return n.appendChild(o),n.appendChild(i),n.appendChild(a),n}function D(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var w=function(){},b=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},C={D:w,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*u(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var o=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(o-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:w,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},E={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},M={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[M.w(e,t,n)]},F:function(e,t,n){return b(M.n(e,t,n)-1,!1,t)},G:function(e,t,n){return d(M.h(e,t,n))},H:function(e){return d(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[u(e.getHours()>11)]},M:function(e,t){return b(e.getMonth(),!0,t)},S:function(e){return d(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return d(e.getFullYear(),4)},d:function(e){return d(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return d(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return d(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},T=function(e){var t=e.config,n=void 0===t?c:t,o=e.l10n,i=void 0===o?l:o,a=e.isMobile,r=void 0!==a&&a;return function(e,t,o){var a=o||i;return void 0===n.formatDate||r?t.split("").map((function(t,o,i){return M[t]&&"\\"!==i[o-1]?M[t](e,a,n):"\\"!==t?t:""})).join(""):n.formatDate(e,t,a)}},x=function(e){var t=e.config,n=void 0===t?c:t,o=e.l10n,i=void 0===o?l:o;return function(e,t,o,a){if(0===e||e){var r,l=a||i,s=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var d=t||(n||c).dateFormat,u=String(e).trim();if("today"===u)r=new Date,o=!0;else if(n&&n.parseDate)r=n.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))r=new Date(e);else{for(var f=void 0,m=[],p=0,g=0,h="";pMath.min(t,n)&&e=0?new Date:new Date(n.config.minDate.getTime()),o=N(n.config);t.setHours(o.hours,o.minutes,o.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,o=D(e),i=o;void 0!==n.amPM&&o===n.amPM&&(n.amPM.textContent=n.l10n.amPM[u(n.amPM.textContent===n.l10n.amPM[0])]);var a=parseFloat(i.getAttribute("min")),r=parseFloat(i.getAttribute("max")),c=parseFloat(i.getAttribute("step")),l=parseInt(i.value,10),s=l+c*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==i.value&&2===i.value.length){var f=i===n.hourElement,m=i===n.minuteElement;sr&&(s=i===n.hourElement?s-r-u(!n.amPM):a,m&&U(void 0,1,n.hourElement)),n.amPM&&f&&(1===c?s+l===23:Math.abs(s-l)>c)&&(n.amPM.textContent=n.l10n.amPM[u(n.amPM.textContent===n.l10n.amPM[0])]),i.value=d(s)}}(e);var i=n._input.value;w(),xe(),n._input.value!==i&&n._debouncedChange()}function w(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,o=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,a=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=o,t=n.amPM.textContent,o=e%12+12*u(t===n.l10n.amPM[1]));var r=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===k(n.latestSelectedDateObj,n.config.minDate,!0),c=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===k(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var l=A(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),s=A(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=A(o,i,a);if(d>s&&d=12)]),void 0!==n.secondElement&&(n.secondElement.value=d(o)))}function j(e){var t=D(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&oe(n)}function F(e,t,o,i){return t instanceof Array?t.forEach((function(t){return F(e,t,o,i)})):e instanceof Array?e.forEach((function(e){return F(e,t,o,i)})):(e.addEventListener(t,o,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,o,i)}}))}function R(){be("onChange")}function Y(e,t){var o=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate=0&&k(e,n.selectedDates[1])<=0}(t)&&!Ee(t)&&r.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend",""+n.config.getWeek(t)+""),be("onDayCreate",r),r}function q(e){e.focus(),"range"===n.config.mode&&le(e)}function z(e){for(var t=e>0?0:n.config.showMonths-1,o=e>0?n.config.showMonths:-1,i=t;i!=o;i+=e)for(var a=n.daysContainer.children[i],r=e>0?0:a.children.length-1,c=e>0?a.children.length:-1,l=r;l!=c;l+=e){var s=a.children[l];if(-1===s.className.indexOf("hidden")&&ie(s.dateObj))return s}}function G(e,t){var i=o(),a=ae(i||document.body),r=void 0!==e?e:a?i:void 0!==n.selectedDateElem&&ae(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&ae(n.todayDateElem)?n.todayDateElem:z(t>0?1:-1);void 0===r?n._input.focus():a?function(e,t){for(var o=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,a=t>0?1:-1,r=o-n.currentMonth;r!=i;r+=a)for(var c=n.daysContainer.children[r],l=o-n.currentMonth===r?e.$i+t:t<0?c.children.length-1:0,s=c.children.length,d=l;d>=0&&d0?s:-1);d+=a){var u=c.children[d];if(-1===u.className.indexOf("hidden")&&ie(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return q(u)}n.changeMonth(a),G(z(a),0)}(r,t):q(r)}function V(e,t){for(var o=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),a=n.utils.getDaysInMonth(t,e),r=window.document.createDocumentFragment(),c=n.config.showMonths>1,l=c?"prevMonthDay hidden":"prevMonthDay",s=c?"nextMonthDay hidden":"nextMonthDay",d=i+1-o,u=0;d<=i;d++,u++)r.appendChild(W("flatpickr-day "+l,new Date(e,t-1,d),0,u));for(d=1;d<=a;d++,u++)r.appendChild(W("flatpickr-day",new Date(e,t,d),0,u));for(var f=a+1;f<=42-o&&(1===n.config.showMonths||u%7!=0);f++,u++)r.appendChild(W("flatpickr-day "+s,new Date(e,t+1,f%a),0,u));var m=g("div","dayContainer");return m.appendChild(r),m}function K(){if(void 0!==n.daysContainer){h(n.daysContainer),n.weekNumbers&&h(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&en.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var o=g("option","flatpickr-monthDropdown-month");o.value=new Date(n.currentYear,t).getMonth().toString(),o.textContent=b(t,n.config.shorthandCurrentMonth,n.l10n),o.tabIndex=-1,n.currentMonth===t&&(o.selected=!0),n.monthsDropdownContainer.appendChild(o)}}}function J(){var e,t=g("div","flatpickr-month"),o=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=g("span","cur-month"):(n.monthsDropdownContainer=g("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),F(n.monthsDropdownContainer,"change",(function(e){var t=D(e),o=parseInt(t.value,10);n.changeMonth(o-n.currentMonth),be("onMonthChange")})),$(),e=n.monthsDropdownContainer);var i=y("cur-year",{tabindex:"-1"}),a=i.getElementsByTagName("input")[0];a.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&a.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(a.setAttribute("max",n.config.maxDate.getFullYear().toString()),a.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var r=g("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(i),o.appendChild(r),t.appendChild(o),{container:t,yearElement:a,monthElement:e}}function Z(){h(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=J();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function X(){n.weekdayContainer?h(n.weekdayContainer):n.weekdayContainer=g("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=g("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return Q(),n.weekdayContainer}function Q(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=O(n.l10n.weekdays.shorthand);e>0&&e\n "+t.join("")+"\n \n "}}function ee(e,t){void 0===t&&(t=!0);var o=t?e:e-n.currentMonth;o<0&&!0===n._hidePrevMonthArrow||o>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=o,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,be("onYearChange"),$()),K(),be("onMonthChange"),Me())}function te(e){return n.calendarContainer.contains(e)}function ne(e){if(n.isOpen&&!n.config.inline){var t=D(e),o=te(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||o||te(e.relatedTarget)),a=!n.config.ignoredFocusElements.some((function(e){return e.contains(t)}));i&&a&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&l(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function oe(e){if(!(!e||n.config.minDate&&en.config.maxDate.getFullYear())){var t=e,o=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),o&&(n.redraw(),be("onYearChange"),$())}}function ie(e,t){var o;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&k(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&k(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===i)return!1;for(var a=!!n.config.enable,r=null!==(o=n.config.enable)&&void 0!==o?o:n.config.disable,c=0,l=void 0;c=l.from.getTime()&&i.getTime()<=l.to.getTime())return a}return!a}function ae(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function re(e){var t=e.target===n._input,o=n._input.value.trimEnd()!==Te();!t||!o||e.relatedTarget&&te(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function ce(t){var i=D(t),a=n.config.wrap?e.contains(i):i===n._input,r=n.config.allowInput,c=n.isOpen&&(!r||!a),s=n.config.inline&&a&&!r;if(13===t.keyCode&&a){if(r)return n.setDate(n._input.value,!0,i===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),i.blur();n.open()}else if(te(i)||c||s){var d=!!n.timeContainer&&n.timeContainer.contains(i);switch(t.keyCode){case 13:d?(t.preventDefault(),l(),ge()):he(t);break;case 27:t.preventDefault(),ge();break;case 8:case 46:a&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(d||a)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var u=o();if(void 0!==n.daysContainer&&(!1===r||u&&ae(u))){var f=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),ee(f),G(z(1),0)):G(void 0,f)}}break;case 38:case 40:t.preventDefault();var m=40===t.keyCode?1:-1;n.daysContainer&&void 0!==i.$i||i===n.input||i===n.altInput?t.ctrlKey?(t.stopPropagation(),oe(n.currentYear-m),G(z(1),0)):d||G(void 0,7*m):i===n.currentYearElement?oe(n.currentYear-m):n.config.enableTime&&(!d&&n.hourElement&&n.hourElement.focus(),l(t),n._debouncedChange());break;case 9:if(d){var p=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter((function(e){return e})),g=p.indexOf(i);if(-1!==g){var h=p[g+(t.shiftKey?-1:1)];t.preventDefault(),(h||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(i)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&i===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],w(),xe();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],w(),xe()}(a||te(i))&&be("onKeyDown",t)}function le(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var o=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),a=Math.min(o,n.selectedDates[0].getTime()),r=Math.max(o,n.selectedDates[0].getTime()),c=!1,l=0,s=0,d=a;da&&dl)?l=d:d>i&&(!s||d ."+t)).forEach((function(t){var a=t.dateObj.getTime(),r=l>0&&a0&&a>s;if(r)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));c&&!r||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)})),void 0!==e&&(e.classList.add(o<=n.selectedDates[0].getTime()?"startRange":"endRange"),io&&a===i&&t.classList.add("endRange"),a>=l&&(0===s||a<=s)&&S(a,i,o)&&t.classList.add("inRange")))}))}}function se(){!n.isOpen||n.config.static||n.config.inline||me()}function de(e){return function(t){var o=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),i=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==o&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter((function(e){return ie(e)})),n.selectedDates.length||"min"!==e||C(o),xe()),n.daysContainer&&(pe(),void 0!==o?n.currentYearElement[e]=o.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==o&&i.getFullYear()===o.getFullYear())}}function ue(){return n.config.wrap?e.querySelector("[data-input]"):e}function fe(){"object"!=typeof n.config.locale&&void 0===H.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=L(L({},H.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?H.l10ns[n.config.locale]:void 0),E.D="("+n.l10n.weekdays.shorthand.join("|")+")",E.l="("+n.l10n.weekdays.longhand.join("|")+")",E.M="("+n.l10n.months.shorthand.join("|")+")",E.F="("+n.l10n.months.longhand.join("|")+")",E.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===L(L({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===H.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=T(n),n.parseDate=x({config:n.config,l10n:n.l10n})}function me(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){be("onPreCalendarPosition");var t=e||n._positionElement,o=Array.prototype.reduce.call(n.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),i=n.calendarContainer.offsetWidth,a=n.config.position.split(" "),r=a[0],c=a.length>1?a[1]:null,l=t.getBoundingClientRect(),s=window.innerHeight-l.bottom,d="above"===r||"below"!==r&&so,u=window.pageYOffset+l.top+(d?-o-2:t.offsetHeight+2);if(p(n.calendarContainer,"arrowTop",!d),p(n.calendarContainer,"arrowBottom",d),!n.config.inline){var f=window.pageXOffset+l.left,m=!1,g=!1;"center"===c?(f-=(i-l.width)/2,m=!0):"right"===c&&(f-=i-l.width,g=!0),p(n.calendarContainer,"arrowLeft",!m&&!g),p(n.calendarContainer,"arrowCenter",m),p(n.calendarContainer,"arrowRight",g);var h=window.document.body.offsetWidth-(window.pageXOffset+l.right),v=f+i>window.document.body.offsetWidth,y=h+i>window.document.body.offsetWidth;if(p(n.calendarContainer,"rightMost",v),!n.config.static)if(n.calendarContainer.style.top=u+"px",v)if(y){var D=function(){for(var e=null,t=0;tn.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=o,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var r=Ee(i);r?n.selectedDates.splice(parseInt(r),1):n.selectedDates.push(i)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==k(i,n.selectedDates[0],!0)&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(w(),a){var c=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),c&&(be("onYearChange"),$()),be("onMonthChange")}if(Me(),K(),xe(),a||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():q(o),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var l="single"===n.config.mode&&!n.config.enableTime,s="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(l||s)&&ge()}R()}}n.parseDate=x({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=F,n._setHoursFromDate=C,n._positionCalendar=me,n.changeMonth=ee,n.changeYear=oe,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var o=N(n.config);M(o.hours,o.minutes,o.seconds)}n.redraw(),e&&be("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),be("onClose")},n.onMouseOver=le,n._createElement=g,n.createDay=W,n.destroy=function(){void 0!==n.config&&be("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete n[e]}catch(e){}}))},n.isEnabled=ie,n.jumpToDate=Y,n.updateValue=xe,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var o=D(e);o&&o.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void be("onOpen")}if(!n._input.disabled&&!n.config.inline){var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),be("onOpen"),me(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return n.hourElement.select()}),50))}},n.redraw=pe,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var o in Object.assign(n.config,e),e)void 0!==ve[o]&&ve[o].forEach((function(e){return e()}));else n.config[e]=t,void 0!==ve[e]?ve[e].forEach((function(e){return e()})):r.indexOf(e)>-1&&(n.config[e]=m(t));n.redraw(),xe(!0)},n.setDate=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);ye(e,o),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),Y(void 0,t),C(),0===n.selectedDates.length&&n.clear(!1),xe(t),t&&be("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var ve={locale:[fe,Q],showMonths:[Z,a,X],minDate:[Y],maxDate:[Y],positionElement:[we],clickOpens:[function(){!0===n.config.clickOpens?(F(n._input,"focus",n.open),F(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function ye(e,t){var o=[];if(e instanceof Array)o=e.map((function(e){return n.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)o=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":o=[n.parseDate(e,t)];break;case"multiple":o=e.split(n.config.conjunction).map((function(e){return n.parseDate(e,t)}));break;case"range":o=e.split(n.l10n.rangeSeparator).map((function(e){return n.parseDate(e,t)}))}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?o:o.filter((function(e){return e instanceof Date&&ie(e,!1)})),"range"===n.config.mode&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function De(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function we(){n._positionElement=n.config.positionElement||n._input}function be(e,t){if(void 0!==n.config){var o=n.config[e];if(void 0!==o&&o.length>0)for(var i=0;o[i]&&i1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=b(o.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=o.getMonth().toString(),e.value=o.getFullYear().toString()})),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYearn.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function Te(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map((function(e){return n.formatDate(e,t)})).filter((function(e,t,o){return"range"!==n.config.mode||n.config.enableTime||o.indexOf(e)===t})).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function xe(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=Te(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=Te(n.config.altFormat)),!1!==e&&be("onValueUpdate")}function ke(e){var t=D(e),o=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);o||i?ee(o?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var o=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=L(L({},JSON.parse(JSON.stringify(e.dataset||{}))),t),l={};n.config.parseDate=a.parseDate,n.config.formatDate=a.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=De(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=De(e)}});var s="time"===a.mode;if(!a.dateFormat&&(a.enableTime||s)){var d=H.defaultConfig.dateFormat||c.dateFormat;l.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):d+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var u=H.defaultConfig.altFormat||c.altFormat;l.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):u+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:de("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:de("max")});var f=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:f("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:f("max")}),"time"===a.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,l,a);for(var p=0;p-1?n.config[h]=m(g[h]).map(i).concat(n.config[h]):void 0===a[h]&&(n.config[h]=g[h])}a.altInputClass||(n.config.altInputClass=ue().className+" "+n.config.altInputClass),be("onParseConfig")}(),fe(),n.input=ue(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=g(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),we()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&ye(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=g("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=g("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=g("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=g("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,Z(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(p(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(p(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],Me(),n.monthNav)),n.innerContainer=g("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=g("div","flatpickr-weekwrapper");e.appendChild(g("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=g("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),o=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(o),n.weekNumbers=i,n.weekWrapper=o}n.rContainer=g("div","flatpickr-rContainer"),n.rContainer.appendChild(X()),n.daysContainer||(n.daysContainer=g("div","flatpickr-days"),n.daysContainer.tabIndex=-1),K(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=N(n.config);n.timeContainer=g("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=g("span","flatpickr-time-separator",":"),o=y("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=o.getElementsByTagName("input")[0];var i=y("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=d(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=d(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(o),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var a=y("flatpickr-second");n.secondElement=a.getElementsByTagName("input")[0],n.secondElement.value=d(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(g("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(a)}return n.config.time_24hr||(n.amPM=g("span","flatpickr-am-pm",n.l10n.amPM[u((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),p(n.calendarContainer,"rangeMode","range"===n.config.mode),p(n.calendarContainer,"animate",!0===n.config.animate),p(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var a=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!a&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var r=g("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(r,n.element),r.appendChild(n.element),n.altInput&&r.appendChild(n.altInput),r.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),(function(t){return F(t,"click",n[e])}))})),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=g("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}F(n.mobileInput,"change",(function(e){n.setDate(D(e).value,!1,n.mobileFormatStr),be("onChange"),be("onClose")}))}();else{var e=f(se,50);if(n._debouncedChange=f(R,P),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(n.daysContainer,"mouseover",(function(e){"range"===n.config.mode&&le(D(e))})),F(n._input,"keydown",ce),void 0!==n.calendarContainer&&F(n.calendarContainer,"keydown",ce),n.config.inline||n.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"touchstart",ne):F(window.document,"mousedown",ne),F(window.document,"focus",ne,{capture:!0}),!0===n.config.clickOpens&&(F(n._input,"focus",n.open),F(n._input,"click",n.open)),void 0!==n.daysContainer&&(F(n.monthNav,"click",ke),F(n.monthNav,["keyup","increment"],j),F(n.daysContainer,"click",he)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){F(n.timeContainer,["increment"],l),F(n.timeContainer,"blur",l,{capture:!0}),F(n.timeContainer,"click",B),F([n.hourElement,n.minuteElement],["focus","click"],(function(e){return D(e).select()})),void 0!==n.secondElement&&F(n.secondElement,"focus",(function(){return n.secondElement&&n.secondElement.select()})),void 0!==n.amPM&&F(n.amPM,"click",(function(e){l(e)}))}n.config.allowInput&&F(n._input,"blur",re)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&C(n.config.noCalendar?n.latestSelectedDateObj:void 0),xe(!1)),a();var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&o&&me(),be("onReady")}(),n}function F(e,t){for(var n=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),o=[],i=0;i{e.todos.forEach((e=>{const n=V(e);t.appendChild(n)}))})),t}(t);return i?n.appendChild(i):console.error("Error rendering todo list: Data empty or null"),n}function V(e){const t=function(e,t,n,o){const i=document.createElement("li");i.setAttribute("class",t);const a=o(n);return i.appendChild(a),i}(0,`todo-container ${$(e.priority)}`,e,K);return t.id=`todo-${e.id}`,t}function K(e){const t=U("class","todo-content"),n=U("class","todo-checkbox"),o=W("class","todo-title",e.title),i=function(e,t,n){const o=document.createElement("p");return o.setAttribute("class","todo-dueDate"),o.textContent=n,o}(0,0,e.dueDate),a=U("class","todo-item"),r=U("class","todo-item");n.id="checkbox-"+e.id,a.classList.add("details"),a.textContent="Details",a.id="details-"+e.id;const c=a.id;r.classList.add("delete"),r.id="delete-"+e.id;const l=new ce(e.id,e.title,e.project,e.description,e.dueDate,e.priority,e.completed);l.checkboxHandler(n,o,i,e.id),l.todoDeleteHandler(r,e.id,e.project),l.todoDetailsHandler(a,c,e.id);const s=function(){const e=document.createElement("div");return e.innerHTML=B.sanitize(''),e}();return r.appendChild(s),t.appendChild(n),t.appendChild(o),t.appendChild(i),t.appendChild(a),t.appendChild(r),t}function $(e){switch(e){case"low":default:return"priority-low";case"medium":return"priority-medium";case"high":return"priority-high"}}function J(e){console.error("Error retrieving data from local storage: ",e)}function Z(e,t){return new Promise(((n,o)=>{try{const o=JSON.stringify(t);localStorage.setItem(e,o),n()}catch(e){o(e)}}))}function X(e){try{const t=localStorage.getItem(e);return JSON.parse(t)}catch(e){return console.error("Error retrieving data from local storage: ",e),null}}!function(e){const t=new Date,n=t.getDay();if(1!==n){const e=n-1;t.setDate(t.getDate()-e)}let o=new Date(t);e.projects.forEach((e=>{const t=e.todos,n=Math.ceil(t.length/7);let i=0;for(let e=0;e<7;e++){const e=t.slice(i,i+n),a=new Date(o);e.forEach(((e,t)=>{a.setDate(o.getDate()+t),e.dueDate=a.toISOString().split("T")[0]})),i+=n,o.setDate(o.getDate()+1)}}))}(z);const Q="projects";class ee{constructor(e,t){this.id=e,this.name=t,this.todos=[]}}class te{constructor(){this.projects=[]}addTodoToProject(e){let t=this.getProjectByName(e.project);if(t)t.todos.push(e);else{const n=Date.now();t=new ee(n,e.project),this.projects.push(t),t.todos.push(e)}}removeTodoFromProject(e,t){const n=this.getProjectByName(e);n?n.todos=n.todos.filter((e=>e.id!==t)):console.log("No project found with name:",e)}getProjectByName(e){return this.projects.find((t=>t.name===e))}getProjectById(e){const t=X(Q);if(!t)return null;const n=t.find((t=>t.id===e));return n?{...n,todos:n.todos||[]}:null}displayProjectsInNavigationBar(){const e=X(Q);if(!e||0===e.length)return void console.error("No projects found in local storage.");const t=document.getElementById("projects");if(!t)return void console.error("Projects dropdown not found.");const n=t.querySelector(".cs-drop-ul");n?e.forEach((e=>{const t=document.createElement("li");t.classList.add("cs-drop-li");const o=document.createElement("div");o.classList.add("cs-li-link","cs-drop-link"),o.textContent=e.name,o.setAttribute("id",e.id),t.appendChild(o),n.appendChild(t)})):console.error("Dropdown list not found within projects dropdown.")}}const ne=new te,oe="projects";function ie(e){let t;q(e);try{t=X(oe),t||Z(oe,z.projects)}catch(e){J(e),Z(oe,z.projects)}const n=document.querySelector("#content"),o=G(t);n.appendChild(o)}const ae="projects";class re{constructor(e,t,n,o,i,a){this.id=e,this.title=t,this.project=n,this.description=o,this.dueDate=i,this.priority=a,this.completed=!1}}class ce{constructor(e,t,n,o,i,a,r){this.todoId=e,this.todoTitle=t,this.projectName=n,this.todoDescription=o,this.todoDueDate=i,this.todoPriority=a,this.todoCompleted=r}checkboxHandler(e,t,n,o){const i=X(ae),a=this.findTodoById(i,o);if(!a)return void console.error("Todo with ID",o,"not found.");a.completed&&(e.classList.add("todo-checked"),t.style.textDecoration="line-through",n.style.textDecoration="line-through");const r=e=>{e.preventDefault(),c()},c=()=>{e.classList.toggle("todo-checked");const i=e.classList.contains("todo-checked");t.style.textDecoration=i?"line-through":"",n.style.textDecoration=i?"line-through":"",this.updateTodoCompletion(o,i)};return e.addEventListener("click",r),()=>{e.removeEventListener("click",r)}}todoDetailsHandler(e,t,n){const o=e=>{e.preventDefault(),i()},i=async()=>{try{const o=X(ae),i=this.findTodoById(o,n);if(!i)return void console.error("Todo with id: ",n,"not found in local storage");await de(e,t,i)}catch(e){console.error("Error handling details click: ",e)}};return e.addEventListener("click",o),()=>{e.removeEventListener("click",o)}}todoDeleteHandler(e,t,n){const o=e=>{e.preventDefault(),i()},i=()=>{const i=t;e.removeEventListener("click",o);const a=document.getElementById(`checkbox-${t}`),r=document.getElementById(`details-${t}`);if(a&&r){const e=this.checkboxHandler(a,this.todoTitle,this.todoDueDate,this.todoId),t=this.todoDetailsHandler(r,this.todoDetailsId,this.todoId);e(),t();let o=X(ae),c=function(e,t){if(!e||!Array.isArray(e))return console.error("Existing data is not in the expected format."),e;for(const n of e)n.todos&&Array.isArray(n.todos)?n.todos=n.todos.filter((e=>e.id!==t)):console.error("Project todos are not in the expected format.");return e}(o,i);Z(ae,c),ne.removeTodoFromProject(n,i);const l=document.querySelector("#content"),s=G(o);q(l),l.appendChild(s)}};e.addEventListener("click",o)}updateTodoCompletion(e,t){try{const n=X(ae);if(null===n)return void console.error("Cannot update todo completion status: No existing data found in local storage");const o=n.map((n=>({...n,todos:n.todos.map((n=>n.id===e?{...n,completed:t}:n))})));Z(ae,o)}catch(e){console.error(e)}}getTodosDueToday(e){const t=(new Date).toISOString().split("T")[0];return this.getFilteredProjects(e,t,t)}getTodosDueThisWeek(e){const t=new Date,n=t.getDay(),o=new Date(t);o.setDate(t.getDate()-n+(0===n?-6:1)),o.setHours(0,0,0,0);const i=new Date(o);return i.setDate(o.getDate()+6),i.setHours(23,59,59,999),this.getFilteredProjects(e,o,i)}getFilteredProjects(e,t,n){return e.map((e=>({...e,todos:e.todos.filter((e=>{const o=new Date(e.dueDate);return o>=new Date(t)&&o<=new Date(n)}))}))).filter((e=>e.todos.length>0))}getTodosForProject(e,t){if(!e)return console.error("No existing data found in local storage"),null;const n=e.filter((e=>e.name===t));return 0===!n.length?(console.error(`Project '${t}' not found`),null):n}findTodoById(e,t){for(const n of e)for(const e of n.todos)if(e.id===t)return e;return null}}const le="projects";class se{constructor(e,t){this.document=e,this.projectManager=t,this.formElement=this.document.getElementById("todo-form")}async handleSubmit(e){e.preventDefault();try{const e=this.extractFormData(),t=this.createTodoFromFormData(e);let n=X(le);n||(n=z.projects);const o=this.addTodoToExistingData(n,t);await Z(le,o),this.addNewTodoToList(t),this.clearForm(),this.closeDialog(),me(document.getElementById("dialog"))}catch(e){console.error("Error handling form submission: ",e)}}async handleSave(e,t){e.preventDefault();try{const e=this.extractFormData(t);e.project!==t.project&&this.updateProjectNameInManager(t.project,e.project,t);const n={...t,...e};await async function(e,t,n){try{let o=X(e);if(!o)return console.error("Cannot edit data: No existing data found in local storage."),!1;let i=-1,a=-1;for(let e=0;ee.id===t)),-1!==a){i=e;break}if(-1===i||-1===a)throw new Error("Todo with specified id not found in existing data.");return n.project!==o[i].name?o=function(e,t,n,o){e[t].todos[n].project=o;const i=e.findIndex((e=>e.name===o));if(-1===i){const i=Date.now(),a=new ee(i,o);a.todos.push(e[t].todos[n]),e.push(a)}else e[i].todos.push(e[t].todos[n]);return e[t].todos.splice(n,1),e}(o,i,a,n.project):o[i].todos[a]={...o[i].todos[a],...n},await Z(e,o),!0}catch(e){return console.error("Error editing data in local storage: ",e),!1}}(le,t.id,n),this.updatedTodoInList(n),this.clearForm(),this.closeDialog(),me(document.getElementById("dialog"))}catch(e){console.error("Error saving data: ",e)}}updateProjectNameInManager(e,t,n){const o=X(le);if(!o)return void console.error("No existing data found in local storage.");const i=o.findIndex((t=>t.name===e));if(-1!==i){const e=o[i];e.todos=e.todos.filter((e=>e.id!==n.id)),o[i]=e;const a=o.findIndex((e=>e.name===t));if(-1===a){const e=Date.now(),i=new ee(e,t);i.todos.push(n),o.push(i)}else o[a].todos.push(n);Z(le,o)}else console.error("Project with specified name not found in existing data.")}extractFormData(e={}){const t=new FormData(this.formElement);return{id:e.id||"",title:t.get("title"),project:t.get("project"),description:t.get("description"),dueDate:t.get("dueDate"),priority:t.get("priority")}}addNewTodoToList(e){const t=document.querySelector(".todo-list"),n=V(e);t.appendChild(n)}addTodoToExistingData(e,t){const n=e.findIndex((e=>e.name===t.project));return-1!==n?e[n].todos.push(t):e.push({id:Date.now(),name:t.project,todos:[t]}),e}updatedTodoInList(e){const t=document.querySelector(".todo-list").querySelector(`#todo-${e.id}`);t&&(t.querySelector(".todo-title").textContent=e.title,t.querySelector(".todo-dueDate").textContent=e.dueDate,t.className=`todo-container ${$(e.priority)}`)}createTodoFromFormData(e){const t=Math.random().toFixed(),n=Date.now()+t;return new re(n,e.title,e.project,e.description,e.dueDate,e.priority)}populateTodoForm(e){const t=this.formElement;t.elements.id=e.id,t.elements.title.value=e.title,t.elements.project.value=e.project,t.elements.description.value=e.description,t.elements.dueDate.value=e.dueDate,t.elements.priority.value=e.priority}closeDialog(){this.document.getElementById("dialog").close()}clearForm(){this.formElement.reset()}}async function de(e,t,n){try{const o=document.getElementById("newTodoButton"),i=document.getElementById(t),a=await async function(){const e=document.createElement("dialog");e.id="dialog";const t=await fetch("dialogFormContent.html");if(!t.ok)throw new Error("Failed to fetch dialog form content");return e.innerHTML=await t.text(),document.body.appendChild(e),e}();e===o?function(e){e.showModal(),Y();const t=fe();ue(e,"submit","Add");const n=document.querySelector("#todo-form");n.addEventListener("submit",(function e(o){o.preventDefault(),t.handleSubmit(o),n.removeEventListener("submit",e)}))}(a):e===i&&function(e,t){e.showModal(),Y();const n=fe(),o=ue(e,"save","Save");n.populateTodoForm(t),o.addEventListener("click",(e=>{i(e)}));const i=e=>{n.handleSave(e,t),o.removeEventListener("click",i)}}(a,n),function(e){const t=e.querySelector("#dialog-close-btn");t.addEventListener("click",(function n(){e.querySelector("#todo-form").reset(),e.close(),me(e),t.removeEventListener("click",n)}))}(a)}catch(e){console.error("Error in dialogHandler:",e)}}function ue(e,t,n){const o=e.querySelector("#form-button");return o.setAttribute("type",t),o.textContent=n,o}function fe(){return new se(document,ne)}function me(e){document.body.removeChild(e)}const pe="projects",ge="projects",he="projects",ve=["home","today","week","projects"],ye=document.getElementById("newTodoButton"),De=document.getElementById("content");!function(){function e(){document.body.classList.add("dark-mode"),localStorage.setItem("theme","dark")}function t(){document.body.classList.remove("dark-mode"),localStorage.setItem("theme","light")}!function(){let n="light";localStorage.getItem("theme")?n=localStorage.getItem("theme"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(n="dark"),"dark"===n?e():t()}(),document.getElementById("dark-mode-toggle").addEventListener("click",(function(n){n.preventDefault(),"light"===localStorage.getItem("theme")?e():t()}))}(),function(){a.addEventListener("click",(function(){a.classList.toggle("cs-active"),i.classList.toggle("cs-active"),o.classList.toggle("cs-open"),function(){const e=document.querySelector("#cs-expanded");"false"===e.getAttribute("aria-expanded")?e.setAttribute("aria-expanded","true"):e.setAttribute("aria-expanded","false")}()}));const e=Array.from(document.querySelectorAll("#cs-navigation .cs-dropdown"));for(const t of e){const e=()=>{t.classList.toggle("cs-active")};t.addEventListener("click",e)}}(),ie(De),(new te).displayProjectsInNavigationBar();try{ve.forEach((e=>{document.getElementById(e).addEventListener("click",(function(){switch(e){case"home":default:ie(De);break;case"today":!function(e){let t;q(e);try{t=X(pe),t||Z(pe,z.projects)}catch(e){J(e),Z(pe,z.projects)}const n=(new ce).getTodosDueToday(t),o=document.querySelector("#content"),i=G(n);o.appendChild(i);const a=document.querySelector(".title");a.textContent=a.textContent+" Due Today"}(De);break;case"week":!function(e){let t;q(e);try{t=X(ge),t||Z(ge,z.projects)}catch(e){J(e),Z(ge,z.projects)}const n=(new ce).getTodosDueThisWeek(t),o=document.querySelector("#content"),i=G(n);o.appendChild(i);const a=document.querySelector(".title");a.textContent=a.textContent+" Due This Week"}(De)}!function(e){const t=document.querySelector("body"),n=document.querySelector("#cs-navigation"),o=document.querySelector("#cs-navigation .cs-toggle");try{ve.forEach((i=>{const a=document.getElementById(i);a&&(i===e?(a.classList.add("cs-active"),o.classList.remove("cs-active"),n.classList.remove("cs-active"),t.classList.remove("cs-open")):a.classList.remove("cs-active"))}))}catch(e){console.error("Error updating navigation state: ",e)}}(e)}))}))}catch(we){console.error("Error setting up event listeners for tab navigation: ",we)}try{function be(e){if(e.target.classList.contains("cs-drop-link")){e.preventDefault();const t=e.target.textContent.trim();!function(e,t){let n;q(e);try{n=X(he),n||Z(he,z.projects)}catch(e){J(e),Z(he,z.projects)}const o=(new ce).getTodosForProject(n,t),i=document.querySelector("#content"),a=G(o);i.appendChild(a);const r=document.querySelector(".title"),c="In "+t;r.textContent=r.textContent+" "+c}(De,t)}}document.getElementById("projects").addEventListener("click",be)}catch(Ce){console.error("Error handling dropdown buttons: ",Ce)}try{const Ee=async()=>{await de(ye,"newTodoButton")};ye.addEventListener("click",(()=>{Ee()}))}catch(Me){!function(e){console.error("Error instantiating dialog",e)}(Me)}}},e=>{e(e.s=605)}]); //# sourceMappingURL=main.bundle.js.map \ No newline at end of file diff --git a/dist/main.bundle.js.map b/dist/main.bundle.js.map index 6ecf481..4cc60fd 100644 --- a/dist/main.bundle.js.map +++ b/dist/main.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"main.bundle.js","mappings":";yFAGiEA,EAAOC,QAG/D,WAAe,aAEtB,MAAM,QACJC,EAAO,eACPC,EAAc,SACdC,EAAQ,eACRC,EAAc,yBACdC,GACEC,OACJ,IAAI,OACFC,EAAM,KACNC,EAAI,OACJC,GACEH,QACA,MACFI,EAAK,UAC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,EAAMvI,OAAOtD,YAAY1N,QDpFlD,SAA4BwF,EAASi/B,GAEhD,IAAI3H,EADJxE,EAAU9yB,GAGV,IAEIs3B,EAAevB,EAAwB,IAElCuB,GAED9B,EAAuB,GAAsBzC,EAAWC,SAEhE,CAAE,MAAO/e,GACLshB,EAAmBthB,GAEnBuhB,EAAuB,GAAsBzC,EAAWC,SAC5D,CAGA,MACMS,GADc,IAAIwB,IACQ0E,mBAC5BrC,EACA2H,GAIElH,EAAUr5B,SAASuN,cAAc,YACjC+rB,EAAgBxE,EAAgBC,GACtCsE,EAAQ1tB,YAAY2tB,GAEpB,MAAMvH,EAAQ/xB,SAASuN,cAAc,UAC/BizB,EAAiB,MAAQD,EAC/BxO,EAAMvoB,YAAcuoB,EAAMvoB,YAAc,IAAMg3B,CAClD,CCsDYC,CAAmBn/B,GAASi/B,EAChC,GAEJF,EAAS/e,oBAAoB,SAAS,KAClCgf,GAA4B,GAEpC,CAAE,MAAO/qB,GACL/O,QAAQ+O,MAAM,oCAAqCA,EACvD,CAKA,IACI,MAAMmrB,EAA2BpG,gBACvBE,GAAckD,GAAe,gBAAgB,EAEvDA,GAActc,iBAAiB,SAAS,KACpCsf,GAA0B,IAE9BhD,GAAcpc,oBAAoB,SAAS,KACvCof,GAA0B,GAElC,CAAE,MAAOnrB,IViCF,SAA2BA,GAC9B/O,QAAQ+O,MAAM,6BAA8BA,EAChD,CUlCIorB,CAAkBprB,EACtB","sources":["webpack://todoornot/./node_modules/dompurify/dist/purify.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/polyfills.js","webpack://todoornot/./src/modules/utility/mobileNavigation.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/types/options.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/l10n/default.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/index.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/dom.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/formatting.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/dates.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/index.js","webpack://todoornot/./src/modules/utility/datePicker.js","webpack://todoornot/./src/modules/utility/elementRender.js","webpack://todoornot/./src/modules/pageData/sampleData.js","webpack://todoornot/./src/modules/utility/todoRenderer.js","webpack://todoornot/./src/modules/utility/localStorageManager.js","webpack://todoornot/./src/modules/entities/project.js","webpack://todoornot/./src/modules/pageLoaders/homePageLoader.js","webpack://todoornot/./src/modules/entities/todoItems.js","webpack://todoornot/./src/modules/utility/todoFormHandler.js","webpack://todoornot/./src/modules/utility/dialogHandler.js","webpack://todoornot/./src/modules/pageLoaders/todayPageLoader.js","webpack://todoornot/./src/modules/pageLoaders/weekPageLoader.js","webpack://todoornot/./src/modules/pageLoaders/projectsPageLoader.js","webpack://todoornot/./src/index.js","webpack://todoornot/./src/modules/utility/darkMode.js"],"sourcesContent":["/*! @license DOMPurify 3.0.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.9/LICENSE */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.DOMPurify = factory());\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.0.9';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && tagName.indexOf('-') > 0;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n","\"use strict\";\nif (typeof Object.assign !== \"function\") {\n Object.assign = function (target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!target) {\n throw TypeError(\"Cannot convert undefined or null to object\");\n }\n var _loop_1 = function (source) {\n if (source) {\n Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });\n }\n };\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var source = args_1[_a];\n _loop_1(source);\n }\n return target;\n };\n}\n","// Select DOM elements for mobile navigation\nconst CSbody = document.querySelector('body');\nconst CSnavbarMenu = document.querySelector('#cs-navigation');\nconst CShamburgerMenu = document.querySelector('#cs-navigation .cs-toggle');\n\n/**\n * Sets up event listeners for mobile navigation toggling\n */\nexport default function mobileNavigationToggling() {\n CShamburgerMenu.addEventListener('click', function () {\n CShamburgerMenu.classList.toggle('cs-active');\n CSnavbarMenu.classList.toggle('cs-active');\n CSbody.classList.toggle('cs-open');\n // run the function to check the aria-expanded value\n ariaExpanded();\n });\n\n function classListToggle(params) {\n CShamburgerMenu.classList.toggle('cs-active');\n CSnavbarMenu.classList.toggle('cs-active');\n CSbody.classList.toggle('cs-open');\n }\n\n /**\n * Checks and toggles the 'aria-expanded' attribute on the navigation list\n */\n function ariaExpanded() {\n const csUL = document.querySelector('#cs-expanded');\n const csExpanded = csUL.getAttribute('aria-expanded');\n\n // Toggle the 'aria-expanded' attribute based on its current state.\n if (csExpanded === 'false') {\n csUL.setAttribute('aria-expanded', 'true');\n } else {\n csUL.setAttribute('aria-expanded', 'false');\n }\n }\n\n // Set up click event listeners for dropdown items in the mobile navigation\n const dropDowns = Array.from(\n document.querySelectorAll('#cs-navigation .cs-dropdown')\n );\n for (const item of dropDowns) {\n const onClick = () => {\n item.classList.toggle('cs-active');\n };\n item.addEventListener('click', onClick);\n }\n}\n","export var HOOKS = [\n \"onChange\",\n \"onClose\",\n \"onDayCreate\",\n \"onDestroy\",\n \"onKeyDown\",\n \"onMonthChange\",\n \"onOpen\",\n \"onParseConfig\",\n \"onReady\",\n \"onValueUpdate\",\n \"onYearChange\",\n \"onPreCalendarPosition\",\n];\nexport var defaults = {\n _disable: [],\n allowInput: false,\n allowInvalidPreload: false,\n altFormat: \"F j, Y\",\n altInput: false,\n altInputClass: \"form-control input\",\n animate: typeof window === \"object\" &&\n window.navigator.userAgent.indexOf(\"MSIE\") === -1,\n ariaDateFormat: \"F j, Y\",\n autoFillDefaultTime: true,\n clickOpens: true,\n closeOnSelect: true,\n conjunction: \", \",\n dateFormat: \"Y-m-d\",\n defaultHour: 12,\n defaultMinute: 0,\n defaultSeconds: 0,\n disable: [],\n disableMobile: false,\n enableSeconds: false,\n enableTime: false,\n errorHandler: function (err) {\n return typeof console !== \"undefined\" && console.warn(err);\n },\n getWeek: function (givenDate) {\n var date = new Date(givenDate.getTime());\n date.setHours(0, 0, 0, 0);\n date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));\n var week1 = new Date(date.getFullYear(), 0, 4);\n return (1 +\n Math.round(((date.getTime() - week1.getTime()) / 86400000 -\n 3 +\n ((week1.getDay() + 6) % 7)) /\n 7));\n },\n hourIncrement: 1,\n ignoredFocusElements: [],\n inline: false,\n locale: \"default\",\n minuteIncrement: 5,\n mode: \"single\",\n monthSelectorType: \"dropdown\",\n nextArrow: \"\",\n noCalendar: false,\n now: new Date(),\n onChange: [],\n onClose: [],\n onDayCreate: [],\n onDestroy: [],\n onKeyDown: [],\n onMonthChange: [],\n onOpen: [],\n onParseConfig: [],\n onReady: [],\n onValueUpdate: [],\n onYearChange: [],\n onPreCalendarPosition: [],\n plugins: [],\n position: \"auto\",\n positionElement: undefined,\n prevArrow: \"\",\n shorthandCurrentMonth: false,\n showMonths: 1,\n static: false,\n time_24hr: false,\n weekNumbers: false,\n wrap: false,\n};\n","export var english = {\n weekdays: {\n shorthand: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n longhand: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n },\n months: {\n shorthand: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n longhand: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n },\n daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n firstDayOfWeek: 0,\n ordinal: function (nth) {\n var s = nth % 100;\n if (s > 3 && s < 21)\n return \"th\";\n switch (s % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n },\n rangeSeparator: \" to \",\n weekAbbreviation: \"Wk\",\n scrollTitle: \"Scroll to increment\",\n toggleTitle: \"Click to toggle\",\n amPM: [\"AM\", \"PM\"],\n yearAriaLabel: \"Year\",\n monthAriaLabel: \"Month\",\n hourAriaLabel: \"Hour\",\n minuteAriaLabel: \"Minute\",\n time_24hr: false,\n};\nexport default english;\n","export var pad = function (number, length) {\n if (length === void 0) { length = 2; }\n return (\"000\" + number).slice(length * -1);\n};\nexport var int = function (bool) { return (bool === true ? 1 : 0); };\nexport function debounce(fn, wait) {\n var t;\n return function () {\n var _this = this;\n var args = arguments;\n clearTimeout(t);\n t = setTimeout(function () { return fn.apply(_this, args); }, wait);\n };\n}\nexport var arrayify = function (obj) {\n return obj instanceof Array ? obj : [obj];\n};\n","export function toggleClass(elem, className, bool) {\n if (bool === true)\n return elem.classList.add(className);\n elem.classList.remove(className);\n}\nexport function createElement(tag, className, content) {\n var e = window.document.createElement(tag);\n className = className || \"\";\n content = content || \"\";\n e.className = className;\n if (content !== undefined)\n e.textContent = content;\n return e;\n}\nexport function clearNode(node) {\n while (node.firstChild)\n node.removeChild(node.firstChild);\n}\nexport function findParent(node, condition) {\n if (condition(node))\n return node;\n else if (node.parentNode)\n return findParent(node.parentNode, condition);\n return undefined;\n}\nexport function createNumberInput(inputClassName, opts) {\n var wrapper = createElement(\"div\", \"numInputWrapper\"), numInput = createElement(\"input\", \"numInput \" + inputClassName), arrowUp = createElement(\"span\", \"arrowUp\"), arrowDown = createElement(\"span\", \"arrowDown\");\n if (navigator.userAgent.indexOf(\"MSIE 9.0\") === -1) {\n numInput.type = \"number\";\n }\n else {\n numInput.type = \"text\";\n numInput.pattern = \"\\\\d*\";\n }\n if (opts !== undefined)\n for (var key in opts)\n numInput.setAttribute(key, opts[key]);\n wrapper.appendChild(numInput);\n wrapper.appendChild(arrowUp);\n wrapper.appendChild(arrowDown);\n return wrapper;\n}\nexport function getEventTarget(event) {\n try {\n if (typeof event.composedPath === \"function\") {\n var path = event.composedPath();\n return path[0];\n }\n return event.target;\n }\n catch (error) {\n return event.target;\n }\n}\n","import { int, pad } from \"../utils\";\nvar doNothing = function () { return undefined; };\nexport var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? \"shorthand\" : \"longhand\"][monthNumber]; };\nexport var revFormat = {\n D: doNothing,\n F: function (dateObj, monthName, locale) {\n dateObj.setMonth(locale.months.longhand.indexOf(monthName));\n },\n G: function (dateObj, hour) {\n dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));\n },\n H: function (dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n J: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n K: function (dateObj, amPM, locale) {\n dateObj.setHours((dateObj.getHours() % 12) +\n 12 * int(new RegExp(locale.amPM[1], \"i\").test(amPM)));\n },\n M: function (dateObj, shortMonth, locale) {\n dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));\n },\n S: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },\n W: function (dateObj, weekNum, locale) {\n var weekNumber = parseInt(weekNum);\n var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);\n date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);\n return date;\n },\n Y: function (dateObj, year) {\n dateObj.setFullYear(parseFloat(year));\n },\n Z: function (_, ISODate) { return new Date(ISODate); },\n d: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n h: function (dateObj, hour) {\n dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));\n },\n i: function (dateObj, minutes) {\n dateObj.setMinutes(parseFloat(minutes));\n },\n j: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n l: doNothing,\n m: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n n: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n s: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n u: function (_, unixMillSeconds) {\n return new Date(parseFloat(unixMillSeconds));\n },\n w: doNothing,\n y: function (dateObj, year) {\n dateObj.setFullYear(2000 + parseFloat(year));\n },\n};\nexport var tokenRegex = {\n D: \"\",\n F: \"\",\n G: \"(\\\\d\\\\d|\\\\d)\",\n H: \"(\\\\d\\\\d|\\\\d)\",\n J: \"(\\\\d\\\\d|\\\\d)\\\\w+\",\n K: \"\",\n M: \"\",\n S: \"(\\\\d\\\\d|\\\\d)\",\n U: \"(.+)\",\n W: \"(\\\\d\\\\d|\\\\d)\",\n Y: \"(\\\\d{4})\",\n Z: \"(.+)\",\n d: \"(\\\\d\\\\d|\\\\d)\",\n h: \"(\\\\d\\\\d|\\\\d)\",\n i: \"(\\\\d\\\\d|\\\\d)\",\n j: \"(\\\\d\\\\d|\\\\d)\",\n l: \"\",\n m: \"(\\\\d\\\\d|\\\\d)\",\n n: \"(\\\\d\\\\d|\\\\d)\",\n s: \"(\\\\d\\\\d|\\\\d)\",\n u: \"(.+)\",\n w: \"(\\\\d\\\\d|\\\\d)\",\n y: \"(\\\\d{2})\",\n};\nexport var formats = {\n Z: function (date) { return date.toISOString(); },\n D: function (date, locale, options) {\n return locale.weekdays.shorthand[formats.w(date, locale, options)];\n },\n F: function (date, locale, options) {\n return monthToStr(formats.n(date, locale, options) - 1, false, locale);\n },\n G: function (date, locale, options) {\n return pad(formats.h(date, locale, options));\n },\n H: function (date) { return pad(date.getHours()); },\n J: function (date, locale) {\n return locale.ordinal !== undefined\n ? date.getDate() + locale.ordinal(date.getDate())\n : date.getDate();\n },\n K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },\n M: function (date, locale) {\n return monthToStr(date.getMonth(), true, locale);\n },\n S: function (date) { return pad(date.getSeconds()); },\n U: function (date) { return date.getTime() / 1000; },\n W: function (date, _, options) {\n return options.getWeek(date);\n },\n Y: function (date) { return pad(date.getFullYear(), 4); },\n d: function (date) { return pad(date.getDate()); },\n h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },\n i: function (date) { return pad(date.getMinutes()); },\n j: function (date) { return date.getDate(); },\n l: function (date, locale) {\n return locale.weekdays.longhand[date.getDay()];\n },\n m: function (date) { return pad(date.getMonth() + 1); },\n n: function (date) { return date.getMonth() + 1; },\n s: function (date) { return date.getSeconds(); },\n u: function (date) { return date.getTime(); },\n w: function (date) { return date.getDay(); },\n y: function (date) { return String(date.getFullYear()).substring(2); },\n};\n","import { tokenRegex, revFormat, formats, } from \"./formatting\";\nimport { defaults } from \"../types/options\";\nimport { english } from \"../l10n/default\";\nexport var createDateFormatter = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d;\n return function (dateObj, frmt, overrideLocale) {\n var locale = overrideLocale || l10n;\n if (config.formatDate !== undefined && !isMobile) {\n return config.formatDate(dateObj, frmt, locale);\n }\n return frmt\n .split(\"\")\n .map(function (c, i, arr) {\n return formats[c] && arr[i - 1] !== \"\\\\\"\n ? formats[c](dateObj, locale, config)\n : c !== \"\\\\\"\n ? c\n : \"\";\n })\n .join(\"\");\n };\n};\nexport var createDateParser = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;\n return function (date, givenFormat, timeless, customLocale) {\n if (date !== 0 && !date)\n return undefined;\n var locale = customLocale || l10n;\n var parsedDate;\n var dateOrig = date;\n if (date instanceof Date)\n parsedDate = new Date(date.getTime());\n else if (typeof date !== \"string\" &&\n date.toFixed !== undefined)\n parsedDate = new Date(date);\n else if (typeof date === \"string\") {\n var format = givenFormat || (config || defaults).dateFormat;\n var datestr = String(date).trim();\n if (datestr === \"today\") {\n parsedDate = new Date();\n timeless = true;\n }\n else if (config && config.parseDate) {\n parsedDate = config.parseDate(date, format);\n }\n else if (/Z$/.test(datestr) ||\n /GMT$/.test(datestr)) {\n parsedDate = new Date(date);\n }\n else {\n var matched = void 0, ops = [];\n for (var i = 0, matchIndex = 0, regexStr = \"\"; i < format.length; i++) {\n var token = format[i];\n var isBackSlash = token === \"\\\\\";\n var escaped = format[i - 1] === \"\\\\\" || isBackSlash;\n if (tokenRegex[token] && !escaped) {\n regexStr += tokenRegex[token];\n var match = new RegExp(regexStr).exec(date);\n if (match && (matched = true)) {\n ops[token !== \"Y\" ? \"push\" : \"unshift\"]({\n fn: revFormat[token],\n val: match[++matchIndex],\n });\n }\n }\n else if (!isBackSlash)\n regexStr += \".\";\n }\n parsedDate =\n !config || !config.noCalendar\n ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)\n : new Date(new Date().setHours(0, 0, 0, 0));\n ops.forEach(function (_a) {\n var fn = _a.fn, val = _a.val;\n return (parsedDate = fn(parsedDate, val, locale) || parsedDate);\n });\n parsedDate = matched ? parsedDate : undefined;\n }\n }\n if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {\n config.errorHandler(new Error(\"Invalid date provided: \" + dateOrig));\n return undefined;\n }\n if (timeless === true)\n parsedDate.setHours(0, 0, 0, 0);\n return parsedDate;\n };\n};\nexport function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n}\nexport function compareTimes(date1, date2) {\n return (3600 * (date1.getHours() - date2.getHours()) +\n 60 * (date1.getMinutes() - date2.getMinutes()) +\n date1.getSeconds() -\n date2.getSeconds());\n}\nexport var isBetween = function (ts, ts1, ts2) {\n return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);\n};\nexport var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {\n return hours * 3600 + minutes * 60 + seconds;\n};\nexport var parseSeconds = function (secondsSinceMidnight) {\n var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;\n return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];\n};\nexport var duration = {\n DAY: 86400000,\n};\nexport function getDefaultHours(config) {\n var hours = config.defaultHour;\n var minutes = config.defaultMinute;\n var seconds = config.defaultSeconds;\n if (config.minDate !== undefined) {\n var minHour = config.minDate.getHours();\n var minMinutes = config.minDate.getMinutes();\n var minSeconds = config.minDate.getSeconds();\n if (hours < minHour) {\n hours = minHour;\n }\n if (hours === minHour && minutes < minMinutes) {\n minutes = minMinutes;\n }\n if (hours === minHour && minutes === minMinutes && seconds < minSeconds)\n seconds = config.minDate.getSeconds();\n }\n if (config.maxDate !== undefined) {\n var maxHr = config.maxDate.getHours();\n var maxMinutes = config.maxDate.getMinutes();\n hours = Math.min(hours, maxHr);\n if (hours === maxHr)\n minutes = Math.min(maxMinutes, minutes);\n if (hours === maxHr && minutes === maxMinutes)\n seconds = config.maxDate.getSeconds();\n }\n return { hours: hours, minutes: minutes, seconds: seconds };\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { defaults as defaultOptions, HOOKS, } from \"./types/options\";\nimport English from \"./l10n/default\";\nimport { arrayify, debounce, int, pad } from \"./utils\";\nimport { clearNode, createElement, createNumberInput, findParent, toggleClass, getEventTarget, } from \"./utils/dom\";\nimport { compareDates, createDateParser, createDateFormatter, duration, isBetween, getDefaultHours, calculateSecondsSinceMidnight, parseSeconds, } from \"./utils/dates\";\nimport { tokenRegex, monthToStr } from \"./utils/formatting\";\nimport \"./utils/polyfills\";\nvar DEBOUNCED_CHANGE_MS = 300;\nfunction FlatpickrInstance(element, instanceConfig) {\n var self = {\n config: __assign(__assign({}, defaultOptions), flatpickr.defaultConfig),\n l10n: English,\n };\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n self._handlers = [];\n self.pluginElements = [];\n self.loadedPlugins = [];\n self._bind = bind;\n self._setHoursFromDate = setHoursFromDate;\n self._positionCalendar = positionCalendar;\n self.changeMonth = changeMonth;\n self.changeYear = changeYear;\n self.clear = clear;\n self.close = close;\n self.onMouseOver = onMouseOver;\n self._createElement = createElement;\n self.createDay = createDay;\n self.destroy = destroy;\n self.isEnabled = isEnabled;\n self.jumpToDate = jumpToDate;\n self.updateValue = updateValue;\n self.open = open;\n self.redraw = redraw;\n self.set = set;\n self.setDate = setDate;\n self.toggle = toggle;\n function setupHelperFunctions() {\n self.utils = {\n getDaysInMonth: function (month, yr) {\n if (month === void 0) { month = self.currentMonth; }\n if (yr === void 0) { yr = self.currentYear; }\n if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))\n return 29;\n return self.l10n.daysInMonth[month];\n },\n };\n }\n function init() {\n self.element = self.input = element;\n self.isOpen = false;\n parseConfig();\n setupLocale();\n setupInputs();\n setupDates();\n setupHelperFunctions();\n if (!self.isMobile)\n build();\n bindEvents();\n if (self.selectedDates.length || self.config.noCalendar) {\n if (self.config.enableTime) {\n setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined);\n }\n updateValue(false);\n }\n setCalendarWidth();\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n if (!self.isMobile && isSafari) {\n positionCalendar();\n }\n triggerEvent(\"onReady\");\n }\n function getClosestActiveElement() {\n var _a;\n return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode())\n .activeElement || document.activeElement);\n }\n function bindToInstance(fn) {\n return fn.bind(self);\n }\n function setCalendarWidth() {\n var config = self.config;\n if (config.weekNumbers === false && config.showMonths === 1) {\n return;\n }\n else if (config.noCalendar !== true) {\n window.requestAnimationFrame(function () {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.style.visibility = \"hidden\";\n self.calendarContainer.style.display = \"block\";\n }\n if (self.daysContainer !== undefined) {\n var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;\n self.daysContainer.style.width = daysWidth + \"px\";\n self.calendarContainer.style.width =\n daysWidth +\n (self.weekWrapper !== undefined\n ? self.weekWrapper.offsetWidth\n : 0) +\n \"px\";\n self.calendarContainer.style.removeProperty(\"visibility\");\n self.calendarContainer.style.removeProperty(\"display\");\n }\n });\n }\n }\n function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate === undefined ||\n compareDates(new Date(), self.config.minDate) >= 0\n ? new Date()\n : new Date(self.config.minDate.getTime());\n var defaults = getDefaultHours(self.config);\n defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());\n self.selectedDates = [defaultDate];\n self.latestSelectedDateObj = defaultDate;\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }\n function ampm2military(hour, amPM) {\n return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);\n }\n function military2ampm(hour) {\n switch (hour % 24) {\n case 0:\n case 12:\n return 12;\n default:\n return hour % 12;\n }\n }\n function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (self.config.maxTime !== undefined &&\n self.config.minTime !== undefined &&\n self.config.minTime > self.config.maxTime) {\n var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds());\n var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds());\n var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds);\n if (currentTime > maxBound && currentTime < minBound) {\n var result = parseSeconds(minBound);\n hours = result[0];\n minutes = result[1];\n seconds = result[2];\n }\n }\n else {\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours() && minutes < minTime.getMinutes())\n minutes = minTime.getMinutes();\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n }\n setHours(hours, minutes, seconds);\n }\n function setHoursFromDate(dateObj) {\n var date = dateObj || self.latestSelectedDateObj;\n if (date && date instanceof Date) {\n setHours(date.getHours(), date.getMinutes(), date.getSeconds());\n }\n }\n function setHours(hours, minutes, seconds) {\n if (self.latestSelectedDateObj !== undefined) {\n self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);\n }\n if (!self.hourElement || !self.minuteElement || self.isMobile)\n return;\n self.hourElement.value = pad(!self.config.time_24hr\n ? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)\n : hours);\n self.minuteElement.value = pad(minutes);\n if (self.amPM !== undefined)\n self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];\n if (self.secondElement !== undefined)\n self.secondElement.value = pad(seconds);\n }\n function onYearInput(event) {\n var eventTarget = getEventTarget(event);\n var year = parseInt(eventTarget.value) + (event.delta || 0);\n if (year / 1000 > 1 ||\n (event.key === \"Enter\" && !/[^\\d]/.test(year.toString()))) {\n changeYear(year);\n }\n }\n function bind(element, event, handler, options) {\n if (event instanceof Array)\n return event.forEach(function (ev) { return bind(element, ev, handler, options); });\n if (element instanceof Array)\n return element.forEach(function (el) { return bind(el, event, handler, options); });\n element.addEventListener(event, handler, options);\n self._handlers.push({\n remove: function () { return element.removeEventListener(event, handler, options); },\n });\n }\n function triggerChange() {\n triggerEvent(\"onChange\");\n }\n function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(self._input, \"keydown\", onKeyDown);\n if (self.calendarContainer !== undefined) {\n bind(self.calendarContainer, \"keydown\", onKeyDown);\n }\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n });\n }\n }\n if (self.config.allowInput) {\n bind(self._input, \"blur\", onBlur);\n }\n }\n function jumpToDate(jumpDate, triggerChange) {\n var jumpTo = jumpDate !== undefined\n ? self.parseDate(jumpDate)\n : self.latestSelectedDateObj ||\n (self.config.minDate && self.config.minDate > self.now\n ? self.config.minDate\n : self.config.maxDate && self.config.maxDate < self.now\n ? self.config.maxDate\n : self.now);\n var oldYear = self.currentYear;\n var oldMonth = self.currentMonth;\n try {\n if (jumpTo !== undefined) {\n self.currentYear = jumpTo.getFullYear();\n self.currentMonth = jumpTo.getMonth();\n }\n }\n catch (e) {\n e.message = \"Invalid date supplied: \" + jumpTo;\n self.config.errorHandler(e);\n }\n if (triggerChange && self.currentYear !== oldYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n if (triggerChange &&\n (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {\n triggerEvent(\"onMonthChange\");\n }\n self.redraw();\n }\n function timeIncrement(e) {\n var eventTarget = getEventTarget(e);\n if (~eventTarget.className.indexOf(\"arrow\"))\n incrementNumInput(e, eventTarget.classList.contains(\"arrowUp\") ? 1 : -1);\n }\n function incrementNumInput(e, delta, inputElem) {\n var target = e && getEventTarget(e);\n var input = inputElem ||\n (target && target.parentNode && target.parentNode.firstChild);\n var event = createEvent(\"increment\");\n event.delta = delta;\n input && input.dispatchEvent(event);\n }\n function build() {\n var fragment = window.document.createDocumentFragment();\n self.calendarContainer = createElement(\"div\", \"flatpickr-calendar\");\n self.calendarContainer.tabIndex = -1;\n if (!self.config.noCalendar) {\n fragment.appendChild(buildMonthNav());\n self.innerContainer = createElement(\"div\", \"flatpickr-innerContainer\");\n if (self.config.weekNumbers) {\n var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;\n self.innerContainer.appendChild(weekWrapper);\n self.weekNumbers = weekNumbers;\n self.weekWrapper = weekWrapper;\n }\n self.rContainer = createElement(\"div\", \"flatpickr-rContainer\");\n self.rContainer.appendChild(buildWeekdays());\n if (!self.daysContainer) {\n self.daysContainer = createElement(\"div\", \"flatpickr-days\");\n self.daysContainer.tabIndex = -1;\n }\n buildDays();\n self.rContainer.appendChild(self.daysContainer);\n self.innerContainer.appendChild(self.rContainer);\n fragment.appendChild(self.innerContainer);\n }\n if (self.config.enableTime) {\n fragment.appendChild(buildTime());\n }\n toggleClass(self.calendarContainer, \"rangeMode\", self.config.mode === \"range\");\n toggleClass(self.calendarContainer, \"animate\", self.config.animate === true);\n toggleClass(self.calendarContainer, \"multiMonth\", self.config.showMonths > 1);\n self.calendarContainer.appendChild(fragment);\n var customAppend = self.config.appendTo !== undefined &&\n self.config.appendTo.nodeType !== undefined;\n if (self.config.inline || self.config.static) {\n self.calendarContainer.classList.add(self.config.inline ? \"inline\" : \"static\");\n if (self.config.inline) {\n if (!customAppend && self.element.parentNode)\n self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);\n else if (self.config.appendTo !== undefined)\n self.config.appendTo.appendChild(self.calendarContainer);\n }\n if (self.config.static) {\n var wrapper = createElement(\"div\", \"flatpickr-wrapper\");\n if (self.element.parentNode)\n self.element.parentNode.insertBefore(wrapper, self.element);\n wrapper.appendChild(self.element);\n if (self.altInput)\n wrapper.appendChild(self.altInput);\n wrapper.appendChild(self.calendarContainer);\n }\n }\n if (!self.config.static && !self.config.inline)\n (self.config.appendTo !== undefined\n ? self.config.appendTo\n : window.document.body).appendChild(self.calendarContainer);\n }\n function createDay(className, date, _dayNumber, i) {\n var dateIsEnabled = isEnabled(date, true), dayElement = createElement(\"span\", className, date.getDate().toString());\n dayElement.dateObj = date;\n dayElement.$i = i;\n dayElement.setAttribute(\"aria-label\", self.formatDate(date, self.config.ariaDateFormat));\n if (className.indexOf(\"hidden\") === -1 &&\n compareDates(date, self.now) === 0) {\n self.todayDateElem = dayElement;\n dayElement.classList.add(\"today\");\n dayElement.setAttribute(\"aria-current\", \"date\");\n }\n if (dateIsEnabled) {\n dayElement.tabIndex = -1;\n if (isDateSelected(date)) {\n dayElement.classList.add(\"selected\");\n self.selectedDateElem = dayElement;\n if (self.config.mode === \"range\") {\n toggleClass(dayElement, \"startRange\", self.selectedDates[0] &&\n compareDates(date, self.selectedDates[0], true) === 0);\n toggleClass(dayElement, \"endRange\", self.selectedDates[1] &&\n compareDates(date, self.selectedDates[1], true) === 0);\n if (className === \"nextMonthDay\")\n dayElement.classList.add(\"inRange\");\n }\n }\n }\n else {\n dayElement.classList.add(\"flatpickr-disabled\");\n }\n if (self.config.mode === \"range\") {\n if (isDateInRange(date) && !isDateSelected(date))\n dayElement.classList.add(\"inRange\");\n }\n if (self.weekNumbers &&\n self.config.showMonths === 1 &&\n className !== \"prevMonthDay\" &&\n i % 7 === 6) {\n self.weekNumbers.insertAdjacentHTML(\"beforeend\", \"\" + self.config.getWeek(date) + \"\");\n }\n triggerEvent(\"onDayCreate\", dayElement);\n return dayElement;\n }\n function focusOnDayElem(targetNode) {\n targetNode.focus();\n if (self.config.mode === \"range\")\n onMouseOver(targetNode);\n }\n function getFirstAvailableDay(delta) {\n var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n for (var m = startMonth; m != endMonth; m += delta) {\n var month = self.daysContainer.children[m];\n var startIndex = delta > 0 ? 0 : month.children.length - 1;\n var endIndex = delta > 0 ? month.children.length : -1;\n for (var i = startIndex; i != endIndex; i += delta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 && isEnabled(c.dateObj))\n return c;\n }\n }\n return undefined;\n }\n function getNextAvailableDay(current, delta) {\n var givenMonth = current.className.indexOf(\"Month\") === -1\n ? current.dateObj.getMonth()\n : self.currentMonth;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n var loopDelta = delta > 0 ? 1 : -1;\n for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {\n var month = self.daysContainer.children[m];\n var startIndex = givenMonth - self.currentMonth === m\n ? current.$i + delta\n : delta < 0\n ? month.children.length - 1\n : 0;\n var numMonthDays = month.children.length;\n for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 &&\n isEnabled(c.dateObj) &&\n Math.abs(current.$i - i) >= Math.abs(delta))\n return focusOnDayElem(c);\n }\n }\n self.changeMonth(loopDelta);\n focusOnDay(getFirstAvailableDay(loopDelta), 0);\n return undefined;\n }\n function focusOnDay(current, offset) {\n var activeElement = getClosestActiveElement();\n var dayFocused = isInView(activeElement || document.body);\n var startElem = current !== undefined\n ? current\n : dayFocused\n ? activeElement\n : self.selectedDateElem !== undefined && isInView(self.selectedDateElem)\n ? self.selectedDateElem\n : self.todayDateElem !== undefined && isInView(self.todayDateElem)\n ? self.todayDateElem\n : getFirstAvailableDay(offset > 0 ? 1 : -1);\n if (startElem === undefined) {\n self._input.focus();\n }\n else if (!dayFocused) {\n focusOnDayElem(startElem);\n }\n else {\n getNextAvailableDay(startElem, offset);\n }\n }\n function buildMonthDays(year, month) {\n var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;\n var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year);\n var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? \"prevMonthDay hidden\" : \"prevMonthDay\", nextMonthDayClass = isMultiMonth ? \"nextMonthDay hidden\" : \"nextMonthDay\";\n var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;\n for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day \" + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));\n }\n for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day\", new Date(year, month, dayNumber), dayNumber, dayIndex));\n }\n for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&\n (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day \" + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));\n }\n var dayContainer = createElement(\"div\", \"dayContainer\");\n dayContainer.appendChild(days);\n return dayContainer;\n }\n function buildDays() {\n if (self.daysContainer === undefined) {\n return;\n }\n clearNode(self.daysContainer);\n if (self.weekNumbers)\n clearNode(self.weekNumbers);\n var frag = document.createDocumentFragment();\n for (var i = 0; i < self.config.showMonths; i++) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));\n }\n self.daysContainer.appendChild(frag);\n self.days = self.daysContainer.firstChild;\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n onMouseOver();\n }\n }\n function buildMonthSwitch() {\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType !== \"dropdown\")\n return;\n var shouldBuildMonth = function (month) {\n if (self.config.minDate !== undefined &&\n self.currentYear === self.config.minDate.getFullYear() &&\n month < self.config.minDate.getMonth()) {\n return false;\n }\n return !(self.config.maxDate !== undefined &&\n self.currentYear === self.config.maxDate.getFullYear() &&\n month > self.config.maxDate.getMonth());\n };\n self.monthsDropdownContainer.tabIndex = -1;\n self.monthsDropdownContainer.innerHTML = \"\";\n for (var i = 0; i < 12; i++) {\n if (!shouldBuildMonth(i))\n continue;\n var month = createElement(\"option\", \"flatpickr-monthDropdown-month\");\n month.value = new Date(self.currentYear, i).getMonth().toString();\n month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);\n month.tabIndex = -1;\n if (self.currentMonth === i) {\n month.selected = true;\n }\n self.monthsDropdownContainer.appendChild(month);\n }\n }\n function buildMonth() {\n var container = createElement(\"div\", \"flatpickr-month\");\n var monthNavFragment = window.document.createDocumentFragment();\n var monthElement;\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n monthElement = createElement(\"span\", \"cur-month\");\n }\n else {\n self.monthsDropdownContainer = createElement(\"select\", \"flatpickr-monthDropdown-months\");\n self.monthsDropdownContainer.setAttribute(\"aria-label\", self.l10n.monthAriaLabel);\n bind(self.monthsDropdownContainer, \"change\", function (e) {\n var target = getEventTarget(e);\n var selectedMonth = parseInt(target.value, 10);\n self.changeMonth(selectedMonth - self.currentMonth);\n triggerEvent(\"onMonthChange\");\n });\n buildMonthSwitch();\n monthElement = self.monthsDropdownContainer;\n }\n var yearInput = createNumberInput(\"cur-year\", { tabindex: \"-1\" });\n var yearElement = yearInput.getElementsByTagName(\"input\")[0];\n yearElement.setAttribute(\"aria-label\", self.l10n.yearAriaLabel);\n if (self.config.minDate) {\n yearElement.setAttribute(\"min\", self.config.minDate.getFullYear().toString());\n }\n if (self.config.maxDate) {\n yearElement.setAttribute(\"max\", self.config.maxDate.getFullYear().toString());\n yearElement.disabled =\n !!self.config.minDate &&\n self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();\n }\n var currentMonth = createElement(\"div\", \"flatpickr-current-month\");\n currentMonth.appendChild(monthElement);\n currentMonth.appendChild(yearInput);\n monthNavFragment.appendChild(currentMonth);\n container.appendChild(monthNavFragment);\n return {\n container: container,\n yearElement: yearElement,\n monthElement: monthElement,\n };\n }\n function buildMonths() {\n clearNode(self.monthNav);\n self.monthNav.appendChild(self.prevMonthNav);\n if (self.config.showMonths) {\n self.yearElements = [];\n self.monthElements = [];\n }\n for (var m = self.config.showMonths; m--;) {\n var month = buildMonth();\n self.yearElements.push(month.yearElement);\n self.monthElements.push(month.monthElement);\n self.monthNav.appendChild(month.container);\n }\n self.monthNav.appendChild(self.nextMonthNav);\n }\n function buildMonthNav() {\n self.monthNav = createElement(\"div\", \"flatpickr-months\");\n self.yearElements = [];\n self.monthElements = [];\n self.prevMonthNav = createElement(\"span\", \"flatpickr-prev-month\");\n self.prevMonthNav.innerHTML = self.config.prevArrow;\n self.nextMonthNav = createElement(\"span\", \"flatpickr-next-month\");\n self.nextMonthNav.innerHTML = self.config.nextArrow;\n buildMonths();\n Object.defineProperty(self, \"_hidePrevMonthArrow\", {\n get: function () { return self.__hidePrevMonthArrow; },\n set: function (bool) {\n if (self.__hidePrevMonthArrow !== bool) {\n toggleClass(self.prevMonthNav, \"flatpickr-disabled\", bool);\n self.__hidePrevMonthArrow = bool;\n }\n },\n });\n Object.defineProperty(self, \"_hideNextMonthArrow\", {\n get: function () { return self.__hideNextMonthArrow; },\n set: function (bool) {\n if (self.__hideNextMonthArrow !== bool) {\n toggleClass(self.nextMonthNav, \"flatpickr-disabled\", bool);\n self.__hideNextMonthArrow = bool;\n }\n },\n });\n self.currentYearElement = self.yearElements[0];\n updateNavigationCurrentMonth();\n return self.monthNav;\n }\n function buildTime() {\n self.calendarContainer.classList.add(\"hasTime\");\n if (self.config.noCalendar)\n self.calendarContainer.classList.add(\"noCalendar\");\n var defaults = getDefaultHours(self.config);\n self.timeContainer = createElement(\"div\", \"flatpickr-time\");\n self.timeContainer.tabIndex = -1;\n var separator = createElement(\"span\", \"flatpickr-time-separator\", \":\");\n var hourInput = createNumberInput(\"flatpickr-hour\", {\n \"aria-label\": self.l10n.hourAriaLabel,\n });\n self.hourElement = hourInput.getElementsByTagName(\"input\")[0];\n var minuteInput = createNumberInput(\"flatpickr-minute\", {\n \"aria-label\": self.l10n.minuteAriaLabel,\n });\n self.minuteElement = minuteInput.getElementsByTagName(\"input\")[0];\n self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;\n self.hourElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getHours()\n : self.config.time_24hr\n ? defaults.hours\n : military2ampm(defaults.hours));\n self.minuteElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getMinutes()\n : defaults.minutes);\n self.hourElement.setAttribute(\"step\", self.config.hourIncrement.toString());\n self.minuteElement.setAttribute(\"step\", self.config.minuteIncrement.toString());\n self.hourElement.setAttribute(\"min\", self.config.time_24hr ? \"0\" : \"1\");\n self.hourElement.setAttribute(\"max\", self.config.time_24hr ? \"23\" : \"12\");\n self.hourElement.setAttribute(\"maxlength\", \"2\");\n self.minuteElement.setAttribute(\"min\", \"0\");\n self.minuteElement.setAttribute(\"max\", \"59\");\n self.minuteElement.setAttribute(\"maxlength\", \"2\");\n self.timeContainer.appendChild(hourInput);\n self.timeContainer.appendChild(separator);\n self.timeContainer.appendChild(minuteInput);\n if (self.config.time_24hr)\n self.timeContainer.classList.add(\"time24hr\");\n if (self.config.enableSeconds) {\n self.timeContainer.classList.add(\"hasSeconds\");\n var secondInput = createNumberInput(\"flatpickr-second\");\n self.secondElement = secondInput.getElementsByTagName(\"input\")[0];\n self.secondElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getSeconds()\n : defaults.seconds);\n self.secondElement.setAttribute(\"step\", self.minuteElement.getAttribute(\"step\"));\n self.secondElement.setAttribute(\"min\", \"0\");\n self.secondElement.setAttribute(\"max\", \"59\");\n self.secondElement.setAttribute(\"maxlength\", \"2\");\n self.timeContainer.appendChild(createElement(\"span\", \"flatpickr-time-separator\", \":\"));\n self.timeContainer.appendChild(secondInput);\n }\n if (!self.config.time_24hr) {\n self.amPM = createElement(\"span\", \"flatpickr-am-pm\", self.l10n.amPM[int((self.latestSelectedDateObj\n ? self.hourElement.value\n : self.config.defaultHour) > 11)]);\n self.amPM.title = self.l10n.toggleTitle;\n self.amPM.tabIndex = -1;\n self.timeContainer.appendChild(self.amPM);\n }\n return self.timeContainer;\n }\n function buildWeekdays() {\n if (!self.weekdayContainer)\n self.weekdayContainer = createElement(\"div\", \"flatpickr-weekdays\");\n else\n clearNode(self.weekdayContainer);\n for (var i = self.config.showMonths; i--;) {\n var container = createElement(\"div\", \"flatpickr-weekdaycontainer\");\n self.weekdayContainer.appendChild(container);\n }\n updateWeekdays();\n return self.weekdayContainer;\n }\n function updateWeekdays() {\n if (!self.weekdayContainer) {\n return;\n }\n var firstDayOfWeek = self.l10n.firstDayOfWeek;\n var weekdays = __spreadArrays(self.l10n.weekdays.shorthand);\n if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {\n weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek));\n }\n for (var i = self.config.showMonths; i--;) {\n self.weekdayContainer.children[i].innerHTML = \"\\n \\n \" + weekdays.join(\"\") + \"\\n \\n \";\n }\n }\n function buildWeeks() {\n self.calendarContainer.classList.add(\"hasWeeks\");\n var weekWrapper = createElement(\"div\", \"flatpickr-weekwrapper\");\n weekWrapper.appendChild(createElement(\"span\", \"flatpickr-weekday\", self.l10n.weekAbbreviation));\n var weekNumbers = createElement(\"div\", \"flatpickr-weeks\");\n weekWrapper.appendChild(weekNumbers);\n return {\n weekWrapper: weekWrapper,\n weekNumbers: weekNumbers,\n };\n }\n function changeMonth(value, isOffset) {\n if (isOffset === void 0) { isOffset = true; }\n var delta = isOffset ? value : value - self.currentMonth;\n if ((delta < 0 && self._hidePrevMonthArrow === true) ||\n (delta > 0 && self._hideNextMonthArrow === true))\n return;\n self.currentMonth += delta;\n if (self.currentMonth < 0 || self.currentMonth > 11) {\n self.currentYear += self.currentMonth > 11 ? 1 : -1;\n self.currentMonth = (self.currentMonth + 12) % 12;\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n buildDays();\n triggerEvent(\"onMonthChange\");\n updateNavigationCurrentMonth();\n }\n function clear(triggerChangeEvent, toInitial) {\n if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }\n if (toInitial === void 0) { toInitial = true; }\n self.input.value = \"\";\n if (self.altInput !== undefined)\n self.altInput.value = \"\";\n if (self.mobileInput !== undefined)\n self.mobileInput.value = \"\";\n self.selectedDates = [];\n self.latestSelectedDateObj = undefined;\n if (toInitial === true) {\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n }\n if (self.config.enableTime === true) {\n var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n setHours(hours, minutes, seconds);\n }\n self.redraw();\n if (triggerChangeEvent)\n triggerEvent(\"onChange\");\n }\n function close() {\n self.isOpen = false;\n if (!self.isMobile) {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.classList.remove(\"open\");\n }\n if (self._input !== undefined) {\n self._input.classList.remove(\"active\");\n }\n }\n triggerEvent(\"onClose\");\n }\n function destroy() {\n if (self.config !== undefined)\n triggerEvent(\"onDestroy\");\n for (var i = self._handlers.length; i--;) {\n self._handlers[i].remove();\n }\n self._handlers = [];\n if (self.mobileInput) {\n if (self.mobileInput.parentNode)\n self.mobileInput.parentNode.removeChild(self.mobileInput);\n self.mobileInput = undefined;\n }\n else if (self.calendarContainer && self.calendarContainer.parentNode) {\n if (self.config.static && self.calendarContainer.parentNode) {\n var wrapper = self.calendarContainer.parentNode;\n wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);\n if (wrapper.parentNode) {\n while (wrapper.firstChild)\n wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);\n wrapper.parentNode.removeChild(wrapper);\n }\n }\n else\n self.calendarContainer.parentNode.removeChild(self.calendarContainer);\n }\n if (self.altInput) {\n self.input.type = \"text\";\n if (self.altInput.parentNode)\n self.altInput.parentNode.removeChild(self.altInput);\n delete self.altInput;\n }\n if (self.input) {\n self.input.type = self.input._type;\n self.input.classList.remove(\"flatpickr-input\");\n self.input.removeAttribute(\"readonly\");\n }\n [\n \"_showTimeInput\",\n \"latestSelectedDateObj\",\n \"_hideNextMonthArrow\",\n \"_hidePrevMonthArrow\",\n \"__hideNextMonthArrow\",\n \"__hidePrevMonthArrow\",\n \"isMobile\",\n \"isOpen\",\n \"selectedDateElem\",\n \"minDateHasTime\",\n \"maxDateHasTime\",\n \"days\",\n \"daysContainer\",\n \"_input\",\n \"_positionElement\",\n \"innerContainer\",\n \"rContainer\",\n \"monthNav\",\n \"todayDateElem\",\n \"calendarContainer\",\n \"weekdayContainer\",\n \"prevMonthNav\",\n \"nextMonthNav\",\n \"monthsDropdownContainer\",\n \"currentMonthElement\",\n \"currentYearElement\",\n \"navigationCurrentMonth\",\n \"selectedDateElem\",\n \"config\",\n ].forEach(function (k) {\n try {\n delete self[k];\n }\n catch (_) { }\n });\n }\n function isCalendarElem(elem) {\n return self.calendarContainer.contains(elem);\n }\n function documentClick(e) {\n if (self.isOpen && !self.config.inline) {\n var eventTarget_1 = getEventTarget(e);\n var isCalendarElement = isCalendarElem(eventTarget_1);\n var isInput = eventTarget_1 === self.input ||\n eventTarget_1 === self.altInput ||\n self.element.contains(eventTarget_1) ||\n (e.path &&\n e.path.indexOf &&\n (~e.path.indexOf(self.input) ||\n ~e.path.indexOf(self.altInput)));\n var lostFocus = !isInput &&\n !isCalendarElement &&\n !isCalendarElem(e.relatedTarget);\n var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {\n return elem.contains(eventTarget_1);\n });\n if (lostFocus && isIgnored) {\n if (self.config.allowInput) {\n self.setDate(self._input.value, false, self.config.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined &&\n self.input.value !== \"\" &&\n self.input.value !== undefined) {\n updateTime();\n }\n self.close();\n if (self.config &&\n self.config.mode === \"range\" &&\n self.selectedDates.length === 1)\n self.clear(false);\n }\n }\n }\n function changeYear(newYear) {\n if (!newYear ||\n (self.config.minDate && newYear < self.config.minDate.getFullYear()) ||\n (self.config.maxDate && newYear > self.config.maxDate.getFullYear()))\n return;\n var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;\n self.currentYear = newYearNum || self.currentYear;\n if (self.config.maxDate &&\n self.currentYear === self.config.maxDate.getFullYear()) {\n self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);\n }\n else if (self.config.minDate &&\n self.currentYear === self.config.minDate.getFullYear()) {\n self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);\n }\n if (isNewYear) {\n self.redraw();\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n }\n function isEnabled(date, timeless) {\n var _a;\n if (timeless === void 0) { timeless = true; }\n var dateToCheck = self.parseDate(date, undefined, timeless);\n if ((self.config.minDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||\n (self.config.maxDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))\n return false;\n if (!self.config.enable && self.config.disable.length === 0)\n return true;\n if (dateToCheck === undefined)\n return false;\n var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;\n for (var i = 0, d = void 0; i < array.length; i++) {\n d = array[i];\n if (typeof d === \"function\" &&\n d(dateToCheck))\n return bool;\n else if (d instanceof Date &&\n dateToCheck !== undefined &&\n d.getTime() === dateToCheck.getTime())\n return bool;\n else if (typeof d === \"string\") {\n var parsed = self.parseDate(d, undefined, true);\n return parsed && parsed.getTime() === dateToCheck.getTime()\n ? bool\n : !bool;\n }\n else if (typeof d === \"object\" &&\n dateToCheck !== undefined &&\n d.from &&\n d.to &&\n dateToCheck.getTime() >= d.from.getTime() &&\n dateToCheck.getTime() <= d.to.getTime())\n return bool;\n }\n return !bool;\n }\n function isInView(elem) {\n if (self.daysContainer !== undefined)\n return (elem.className.indexOf(\"hidden\") === -1 &&\n elem.className.indexOf(\"flatpickr-disabled\") === -1 &&\n self.daysContainer.contains(elem));\n return false;\n }\n function onBlur(e) {\n var isInput = e.target === self._input;\n var valueChanged = self._input.value.trimEnd() !== getDateStr();\n if (isInput &&\n valueChanged &&\n !(e.relatedTarget && isCalendarElem(e.relatedTarget))) {\n self.setDate(self._input.value, true, e.target === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n }\n }\n function onKeyDown(e) {\n var eventTarget = getEventTarget(e);\n var isInput = self.config.wrap\n ? element.contains(eventTarget)\n : eventTarget === self._input;\n var allowInput = self.config.allowInput;\n var allowKeydown = self.isOpen && (!allowInput || !isInput);\n var allowInlineKeydown = self.config.inline && isInput && !allowInput;\n if (e.keyCode === 13 && isInput) {\n if (allowInput) {\n self.setDate(self._input.value, true, eventTarget === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n self.close();\n return eventTarget.blur();\n }\n else {\n self.open();\n }\n }\n else if (isCalendarElem(eventTarget) ||\n allowKeydown ||\n allowInlineKeydown) {\n var isTimeObj = !!self.timeContainer &&\n self.timeContainer.contains(eventTarget);\n switch (e.keyCode) {\n case 13:\n if (isTimeObj) {\n e.preventDefault();\n updateTime();\n focusAndClose();\n }\n else\n selectDate(e);\n break;\n case 27:\n e.preventDefault();\n focusAndClose();\n break;\n case 8:\n case 46:\n if (isInput && !self.config.allowInput) {\n e.preventDefault();\n self.clear();\n }\n break;\n case 37:\n case 39:\n if (!isTimeObj && !isInput) {\n e.preventDefault();\n var activeElement = getClosestActiveElement();\n if (self.daysContainer !== undefined &&\n (allowInput === false ||\n (activeElement && isInView(activeElement)))) {\n var delta_1 = e.keyCode === 39 ? 1 : -1;\n if (!e.ctrlKey)\n focusOnDay(undefined, delta_1);\n else {\n e.stopPropagation();\n changeMonth(delta_1);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n }\n }\n else if (self.hourElement)\n self.hourElement.focus();\n break;\n case 38:\n case 40:\n e.preventDefault();\n var delta = e.keyCode === 40 ? 1 : -1;\n if ((self.daysContainer &&\n eventTarget.$i !== undefined) ||\n eventTarget === self.input ||\n eventTarget === self.altInput) {\n if (e.ctrlKey) {\n e.stopPropagation();\n changeYear(self.currentYear - delta);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n else if (!isTimeObj)\n focusOnDay(undefined, delta * 7);\n }\n else if (eventTarget === self.currentYearElement) {\n changeYear(self.currentYear - delta);\n }\n else if (self.config.enableTime) {\n if (!isTimeObj && self.hourElement)\n self.hourElement.focus();\n updateTime(e);\n self._debouncedChange();\n }\n break;\n case 9:\n if (isTimeObj) {\n var elems = [\n self.hourElement,\n self.minuteElement,\n self.secondElement,\n self.amPM,\n ]\n .concat(self.pluginElements)\n .filter(function (x) { return x; });\n var i = elems.indexOf(eventTarget);\n if (i !== -1) {\n var target = elems[i + (e.shiftKey ? -1 : 1)];\n e.preventDefault();\n (target || self._input).focus();\n }\n }\n else if (!self.config.noCalendar &&\n self.daysContainer &&\n self.daysContainer.contains(eventTarget) &&\n e.shiftKey) {\n e.preventDefault();\n self._input.focus();\n }\n break;\n default:\n break;\n }\n }\n if (self.amPM !== undefined && eventTarget === self.amPM) {\n switch (e.key) {\n case self.l10n.amPM[0].charAt(0):\n case self.l10n.amPM[0].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[0];\n setHoursFromInputs();\n updateValue();\n break;\n case self.l10n.amPM[1].charAt(0):\n case self.l10n.amPM[1].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[1];\n setHoursFromInputs();\n updateValue();\n break;\n }\n }\n if (isInput || isCalendarElem(eventTarget)) {\n triggerEvent(\"onKeyDown\", e);\n }\n }\n function onMouseOver(elem, cellClass) {\n if (cellClass === void 0) { cellClass = \"flatpickr-day\"; }\n if (self.selectedDates.length !== 1 ||\n (elem &&\n (!elem.classList.contains(cellClass) ||\n elem.classList.contains(\"flatpickr-disabled\"))))\n return;\n var hoverDate = elem\n ? elem.dateObj.getTime()\n : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());\n var containsDisabled = false;\n var minRange = 0, maxRange = 0;\n for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {\n if (!isEnabled(new Date(t), true)) {\n containsDisabled =\n containsDisabled || (t > rangeStartDate && t < rangeEndDate);\n if (t < initialDate && (!minRange || t > minRange))\n minRange = t;\n else if (t > initialDate && (!maxRange || t < maxRange))\n maxRange = t;\n }\n }\n var hoverableCells = Array.from(self.rContainer.querySelectorAll(\"*:nth-child(-n+\" + self.config.showMonths + \") > .\" + cellClass));\n hoverableCells.forEach(function (dayElem) {\n var date = dayElem.dateObj;\n var timestamp = date.getTime();\n var outOfRange = (minRange > 0 && timestamp < minRange) ||\n (maxRange > 0 && timestamp > maxRange);\n if (outOfRange) {\n dayElem.classList.add(\"notAllowed\");\n [\"inRange\", \"startRange\", \"endRange\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n return;\n }\n else if (containsDisabled && !outOfRange)\n return;\n [\"startRange\", \"inRange\", \"endRange\", \"notAllowed\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n if (elem !== undefined) {\n elem.classList.add(hoverDate <= self.selectedDates[0].getTime()\n ? \"startRange\"\n : \"endRange\");\n if (initialDate < hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"startRange\");\n else if (initialDate > hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"endRange\");\n if (timestamp >= minRange &&\n (maxRange === 0 || timestamp <= maxRange) &&\n isBetween(timestamp, initialDate, hoverDate))\n dayElem.classList.add(\"inRange\");\n }\n });\n }\n function onResize() {\n if (self.isOpen && !self.config.static && !self.config.inline)\n positionCalendar();\n }\n function open(e, positionElement) {\n if (positionElement === void 0) { positionElement = self._positionElement; }\n if (self.isMobile === true) {\n if (e) {\n e.preventDefault();\n var eventTarget = getEventTarget(e);\n if (eventTarget) {\n eventTarget.blur();\n }\n }\n if (self.mobileInput !== undefined) {\n self.mobileInput.focus();\n self.mobileInput.click();\n }\n triggerEvent(\"onOpen\");\n return;\n }\n else if (self._input.disabled || self.config.inline) {\n return;\n }\n var wasOpen = self.isOpen;\n self.isOpen = true;\n if (!wasOpen) {\n self.calendarContainer.classList.add(\"open\");\n self._input.classList.add(\"active\");\n triggerEvent(\"onOpen\");\n positionCalendar(positionElement);\n }\n if (self.config.enableTime === true && self.config.noCalendar === true) {\n if (self.config.allowInput === false &&\n (e === undefined ||\n !self.timeContainer.contains(e.relatedTarget))) {\n setTimeout(function () { return self.hourElement.select(); }, 50);\n }\n }\n }\n function minMaxDateSetter(type) {\n return function (date) {\n var dateObj = (self.config[\"_\" + type + \"Date\"] = self.parseDate(date, self.config.dateFormat));\n var inverseDateObj = self.config[\"_\" + (type === \"min\" ? \"max\" : \"min\") + \"Date\"];\n if (dateObj !== undefined) {\n self[type === \"min\" ? \"minDateHasTime\" : \"maxDateHasTime\"] =\n dateObj.getHours() > 0 ||\n dateObj.getMinutes() > 0 ||\n dateObj.getSeconds() > 0;\n }\n if (self.selectedDates) {\n self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });\n if (!self.selectedDates.length && type === \"min\")\n setHoursFromDate(dateObj);\n updateValue();\n }\n if (self.daysContainer) {\n redraw();\n if (dateObj !== undefined)\n self.currentYearElement[type] = dateObj.getFullYear().toString();\n else\n self.currentYearElement.removeAttribute(type);\n self.currentYearElement.disabled =\n !!inverseDateObj &&\n dateObj !== undefined &&\n inverseDateObj.getFullYear() === dateObj.getFullYear();\n }\n };\n }\n function parseConfig() {\n var boolOpts = [\n \"wrap\",\n \"weekNumbers\",\n \"allowInput\",\n \"allowInvalidPreload\",\n \"clickOpens\",\n \"time_24hr\",\n \"enableTime\",\n \"noCalendar\",\n \"altInput\",\n \"shorthandCurrentMonth\",\n \"inline\",\n \"static\",\n \"enableSeconds\",\n \"disableMobile\",\n ];\n var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig);\n var formats = {};\n self.config.parseDate = userConfig.parseDate;\n self.config.formatDate = userConfig.formatDate;\n Object.defineProperty(self.config, \"enable\", {\n get: function () { return self.config._enable; },\n set: function (dates) {\n self.config._enable = parseDateRules(dates);\n },\n });\n Object.defineProperty(self.config, \"disable\", {\n get: function () { return self.config._disable; },\n set: function (dates) {\n self.config._disable = parseDateRules(dates);\n },\n });\n var timeMode = userConfig.mode === \"time\";\n if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {\n var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaultOptions.dateFormat;\n formats.dateFormat =\n userConfig.noCalendar || timeMode\n ? \"H:i\" + (userConfig.enableSeconds ? \":S\" : \"\")\n : defaultDateFormat + \" H:i\" + (userConfig.enableSeconds ? \":S\" : \"\");\n }\n if (userConfig.altInput &&\n (userConfig.enableTime || timeMode) &&\n !userConfig.altFormat) {\n var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaultOptions.altFormat;\n formats.altFormat =\n userConfig.noCalendar || timeMode\n ? \"h:i\" + (userConfig.enableSeconds ? \":S K\" : \" K\")\n : defaultAltFormat + (\" h:i\" + (userConfig.enableSeconds ? \":S\" : \"\") + \" K\");\n }\n Object.defineProperty(self.config, \"minDate\", {\n get: function () { return self.config._minDate; },\n set: minMaxDateSetter(\"min\"),\n });\n Object.defineProperty(self.config, \"maxDate\", {\n get: function () { return self.config._maxDate; },\n set: minMaxDateSetter(\"max\"),\n });\n var minMaxTimeSetter = function (type) { return function (val) {\n self.config[type === \"min\" ? \"_minTime\" : \"_maxTime\"] = self.parseDate(val, \"H:i:S\");\n }; };\n Object.defineProperty(self.config, \"minTime\", {\n get: function () { return self.config._minTime; },\n set: minMaxTimeSetter(\"min\"),\n });\n Object.defineProperty(self.config, \"maxTime\", {\n get: function () { return self.config._maxTime; },\n set: minMaxTimeSetter(\"max\"),\n });\n if (userConfig.mode === \"time\") {\n self.config.noCalendar = true;\n self.config.enableTime = true;\n }\n Object.assign(self.config, formats, userConfig);\n for (var i = 0; i < boolOpts.length; i++)\n self.config[boolOpts[i]] =\n self.config[boolOpts[i]] === true ||\n self.config[boolOpts[i]] === \"true\";\n HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {\n self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);\n });\n self.isMobile =\n !self.config.disableMobile &&\n !self.config.inline &&\n self.config.mode === \"single\" &&\n !self.config.disable.length &&\n !self.config.enable &&\n !self.config.weekNumbers &&\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n for (var i = 0; i < self.config.plugins.length; i++) {\n var pluginConf = self.config.plugins[i](self) || {};\n for (var key in pluginConf) {\n if (HOOKS.indexOf(key) > -1) {\n self.config[key] = arrayify(pluginConf[key])\n .map(bindToInstance)\n .concat(self.config[key]);\n }\n else if (typeof userConfig[key] === \"undefined\")\n self.config[key] = pluginConf[key];\n }\n }\n if (!userConfig.altInputClass) {\n self.config.altInputClass =\n getInputElem().className + \" \" + self.config.altInputClass;\n }\n triggerEvent(\"onParseConfig\");\n }\n function getInputElem() {\n return self.config.wrap\n ? element.querySelector(\"[data-input]\")\n : element;\n }\n function setupLocale() {\n if (typeof self.config.locale !== \"object\" &&\n typeof flatpickr.l10ns[self.config.locale] === \"undefined\")\n self.config.errorHandler(new Error(\"flatpickr: invalid locale \" + self.config.locale));\n self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === \"object\"\n ? self.config.locale\n : self.config.locale !== \"default\"\n ? flatpickr.l10ns[self.config.locale]\n : undefined));\n tokenRegex.D = \"(\" + self.l10n.weekdays.shorthand.join(\"|\") + \")\";\n tokenRegex.l = \"(\" + self.l10n.weekdays.longhand.join(\"|\") + \")\";\n tokenRegex.M = \"(\" + self.l10n.months.shorthand.join(\"|\") + \")\";\n tokenRegex.F = \"(\" + self.l10n.months.longhand.join(\"|\") + \")\";\n tokenRegex.K = \"(\" + self.l10n.amPM[0] + \"|\" + self.l10n.amPM[1] + \"|\" + self.l10n.amPM[0].toLowerCase() + \"|\" + self.l10n.amPM[1].toLowerCase() + \")\";\n var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {})));\n if (userConfig.time_24hr === undefined &&\n flatpickr.defaultConfig.time_24hr === undefined) {\n self.config.time_24hr = self.l10n.time_24hr;\n }\n self.formatDate = createDateFormatter(self);\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n }\n function positionCalendar(customPositionElement) {\n if (typeof self.config.position === \"function\") {\n return void self.config.position(self, customPositionElement);\n }\n if (self.calendarContainer === undefined)\n return;\n triggerEvent(\"onPreCalendarPosition\");\n var positionElement = customPositionElement || self._positionElement;\n var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(\" \"), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === \"above\" ||\n (configPosVertical !== \"below\" &&\n distanceFromBottom < calendarHeight &&\n inputBounds.top > calendarHeight);\n var top = window.pageYOffset +\n inputBounds.top +\n (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);\n toggleClass(self.calendarContainer, \"arrowTop\", !showOnTop);\n toggleClass(self.calendarContainer, \"arrowBottom\", showOnTop);\n if (self.config.inline)\n return;\n var left = window.pageXOffset + inputBounds.left;\n var isCenter = false;\n var isRight = false;\n if (configPosHorizontal === \"center\") {\n left -= (calendarWidth - inputBounds.width) / 2;\n isCenter = true;\n }\n else if (configPosHorizontal === \"right\") {\n left -= calendarWidth - inputBounds.width;\n isRight = true;\n }\n toggleClass(self.calendarContainer, \"arrowLeft\", !isCenter && !isRight);\n toggleClass(self.calendarContainer, \"arrowCenter\", isCenter);\n toggleClass(self.calendarContainer, \"arrowRight\", isRight);\n var right = window.document.body.offsetWidth -\n (window.pageXOffset + inputBounds.right);\n var rightMost = left + calendarWidth > window.document.body.offsetWidth;\n var centerMost = right + calendarWidth > window.document.body.offsetWidth;\n toggleClass(self.calendarContainer, \"rightMost\", rightMost);\n if (self.config.static)\n return;\n self.calendarContainer.style.top = top + \"px\";\n if (!rightMost) {\n self.calendarContainer.style.left = left + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n else if (!centerMost) {\n self.calendarContainer.style.left = \"auto\";\n self.calendarContainer.style.right = right + \"px\";\n }\n else {\n var doc = getDocumentStyleSheet();\n if (doc === undefined)\n return;\n var bodyWidth = window.document.body.offsetWidth;\n var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);\n var centerBefore = \".flatpickr-calendar.centerMost:before\";\n var centerAfter = \".flatpickr-calendar.centerMost:after\";\n var centerIndex = doc.cssRules.length;\n var centerStyle = \"{left:\" + inputBounds.left + \"px;right:auto;}\";\n toggleClass(self.calendarContainer, \"rightMost\", false);\n toggleClass(self.calendarContainer, \"centerMost\", true);\n doc.insertRule(centerBefore + \",\" + centerAfter + centerStyle, centerIndex);\n self.calendarContainer.style.left = centerLeft + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n }\n function getDocumentStyleSheet() {\n var editableSheet = null;\n for (var i = 0; i < document.styleSheets.length; i++) {\n var sheet = document.styleSheets[i];\n if (!sheet.cssRules)\n continue;\n try {\n sheet.cssRules;\n }\n catch (err) {\n continue;\n }\n editableSheet = sheet;\n break;\n }\n return editableSheet != null ? editableSheet : createStyleSheet();\n }\n function createStyleSheet() {\n var style = document.createElement(\"style\");\n document.head.appendChild(style);\n return style.sheet;\n }\n function redraw() {\n if (self.config.noCalendar || self.isMobile)\n return;\n buildMonthSwitch();\n updateNavigationCurrentMonth();\n buildDays();\n }\n function focusAndClose() {\n self._input.focus();\n if (window.navigator.userAgent.indexOf(\"MSIE\") !== -1 ||\n navigator.msMaxTouchPoints !== undefined) {\n setTimeout(self.close, 0);\n }\n else {\n self.close();\n }\n }\n function selectDate(e) {\n e.preventDefault();\n e.stopPropagation();\n var isSelectable = function (day) {\n return day.classList &&\n day.classList.contains(\"flatpickr-day\") &&\n !day.classList.contains(\"flatpickr-disabled\") &&\n !day.classList.contains(\"notAllowed\");\n };\n var t = findParent(getEventTarget(e), isSelectable);\n if (t === undefined)\n return;\n var target = t;\n var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));\n var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||\n selectedDate.getMonth() >\n self.currentMonth + self.config.showMonths - 1) &&\n self.config.mode !== \"range\";\n self.selectedDateElem = target;\n if (self.config.mode === \"single\")\n self.selectedDates = [selectedDate];\n else if (self.config.mode === \"multiple\") {\n var selectedIndex = isDateSelected(selectedDate);\n if (selectedIndex)\n self.selectedDates.splice(parseInt(selectedIndex), 1);\n else\n self.selectedDates.push(selectedDate);\n }\n else if (self.config.mode === \"range\") {\n if (self.selectedDates.length === 2) {\n self.clear(false, false);\n }\n self.latestSelectedDateObj = selectedDate;\n self.selectedDates.push(selectedDate);\n if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n setHoursFromInputs();\n if (shouldChangeMonth) {\n var isNewYear = self.currentYear !== selectedDate.getFullYear();\n self.currentYear = selectedDate.getFullYear();\n self.currentMonth = selectedDate.getMonth();\n if (isNewYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n triggerEvent(\"onMonthChange\");\n }\n updateNavigationCurrentMonth();\n buildDays();\n updateValue();\n if (!shouldChangeMonth &&\n self.config.mode !== \"range\" &&\n self.config.showMonths === 1)\n focusOnDayElem(target);\n else if (self.selectedDateElem !== undefined &&\n self.hourElement === undefined) {\n self.selectedDateElem && self.selectedDateElem.focus();\n }\n if (self.hourElement !== undefined)\n self.hourElement !== undefined && self.hourElement.focus();\n if (self.config.closeOnSelect) {\n var single = self.config.mode === \"single\" && !self.config.enableTime;\n var range = self.config.mode === \"range\" &&\n self.selectedDates.length === 2 &&\n !self.config.enableTime;\n if (single || range) {\n focusAndClose();\n }\n }\n triggerChange();\n }\n var CALLBACKS = {\n locale: [setupLocale, updateWeekdays],\n showMonths: [buildMonths, setCalendarWidth, buildWeekdays],\n minDate: [jumpToDate],\n maxDate: [jumpToDate],\n positionElement: [updatePositionElement],\n clickOpens: [\n function () {\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n else {\n self._input.removeEventListener(\"focus\", self.open);\n self._input.removeEventListener(\"click\", self.open);\n }\n },\n ],\n };\n function set(option, value) {\n if (option !== null && typeof option === \"object\") {\n Object.assign(self.config, option);\n for (var key in option) {\n if (CALLBACKS[key] !== undefined)\n CALLBACKS[key].forEach(function (x) { return x(); });\n }\n }\n else {\n self.config[option] = value;\n if (CALLBACKS[option] !== undefined)\n CALLBACKS[option].forEach(function (x) { return x(); });\n else if (HOOKS.indexOf(option) > -1)\n self.config[option] = arrayify(value);\n }\n self.redraw();\n updateValue(true);\n }\n function setSelectedDate(inputDate, format) {\n var dates = [];\n if (inputDate instanceof Array)\n dates = inputDate.map(function (d) { return self.parseDate(d, format); });\n else if (inputDate instanceof Date || typeof inputDate === \"number\")\n dates = [self.parseDate(inputDate, format)];\n else if (typeof inputDate === \"string\") {\n switch (self.config.mode) {\n case \"single\":\n case \"time\":\n dates = [self.parseDate(inputDate, format)];\n break;\n case \"multiple\":\n dates = inputDate\n .split(self.config.conjunction)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n case \"range\":\n dates = inputDate\n .split(self.l10n.rangeSeparator)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n default:\n break;\n }\n }\n else\n self.config.errorHandler(new Error(\"Invalid date supplied: \" + JSON.stringify(inputDate)));\n self.selectedDates = (self.config.allowInvalidPreload\n ? dates\n : dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }));\n if (self.config.mode === \"range\")\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n function setDate(date, triggerChange, format) {\n if (triggerChange === void 0) { triggerChange = false; }\n if (format === void 0) { format = self.config.dateFormat; }\n if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))\n return self.clear(triggerChange);\n setSelectedDate(date, format);\n self.latestSelectedDateObj =\n self.selectedDates[self.selectedDates.length - 1];\n self.redraw();\n jumpToDate(undefined, triggerChange);\n setHoursFromDate();\n if (self.selectedDates.length === 0) {\n self.clear(false);\n }\n updateValue(triggerChange);\n if (triggerChange)\n triggerEvent(\"onChange\");\n }\n function parseDateRules(arr) {\n return arr\n .slice()\n .map(function (rule) {\n if (typeof rule === \"string\" ||\n typeof rule === \"number\" ||\n rule instanceof Date) {\n return self.parseDate(rule, undefined, true);\n }\n else if (rule &&\n typeof rule === \"object\" &&\n rule.from &&\n rule.to)\n return {\n from: self.parseDate(rule.from, undefined),\n to: self.parseDate(rule.to, undefined),\n };\n return rule;\n })\n .filter(function (x) { return x; });\n }\n function setupDates() {\n self.selectedDates = [];\n self.now = self.parseDate(self.config.now) || new Date();\n var preloadedDate = self.config.defaultDate ||\n ((self.input.nodeName === \"INPUT\" ||\n self.input.nodeName === \"TEXTAREA\") &&\n self.input.placeholder &&\n self.input.value === self.input.placeholder\n ? null\n : self.input.value);\n if (preloadedDate)\n setSelectedDate(preloadedDate, self.config.dateFormat);\n self._initialDate =\n self.selectedDates.length > 0\n ? self.selectedDates[0]\n : self.config.minDate &&\n self.config.minDate.getTime() > self.now.getTime()\n ? self.config.minDate\n : self.config.maxDate &&\n self.config.maxDate.getTime() < self.now.getTime()\n ? self.config.maxDate\n : self.now;\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n if (self.selectedDates.length > 0)\n self.latestSelectedDateObj = self.selectedDates[0];\n if (self.config.minTime !== undefined)\n self.config.minTime = self.parseDate(self.config.minTime, \"H:i\");\n if (self.config.maxTime !== undefined)\n self.config.maxTime = self.parseDate(self.config.maxTime, \"H:i\");\n self.minDateHasTime =\n !!self.config.minDate &&\n (self.config.minDate.getHours() > 0 ||\n self.config.minDate.getMinutes() > 0 ||\n self.config.minDate.getSeconds() > 0);\n self.maxDateHasTime =\n !!self.config.maxDate &&\n (self.config.maxDate.getHours() > 0 ||\n self.config.maxDate.getMinutes() > 0 ||\n self.config.maxDate.getSeconds() > 0);\n }\n function setupInputs() {\n self.input = getInputElem();\n if (!self.input) {\n self.config.errorHandler(new Error(\"Invalid input element specified\"));\n return;\n }\n self.input._type = self.input.type;\n self.input.type = \"text\";\n self.input.classList.add(\"flatpickr-input\");\n self._input = self.input;\n if (self.config.altInput) {\n self.altInput = createElement(self.input.nodeName, self.config.altInputClass);\n self._input = self.altInput;\n self.altInput.placeholder = self.input.placeholder;\n self.altInput.disabled = self.input.disabled;\n self.altInput.required = self.input.required;\n self.altInput.tabIndex = self.input.tabIndex;\n self.altInput.type = \"text\";\n self.input.setAttribute(\"type\", \"hidden\");\n if (!self.config.static && self.input.parentNode)\n self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);\n }\n if (!self.config.allowInput)\n self._input.setAttribute(\"readonly\", \"readonly\");\n updatePositionElement();\n }\n function updatePositionElement() {\n self._positionElement = self.config.positionElement || self._input;\n }\n function setupMobile() {\n var inputType = self.config.enableTime\n ? self.config.noCalendar\n ? \"time\"\n : \"datetime-local\"\n : \"date\";\n self.mobileInput = createElement(\"input\", self.input.className + \" flatpickr-mobile\");\n self.mobileInput.tabIndex = 1;\n self.mobileInput.type = inputType;\n self.mobileInput.disabled = self.input.disabled;\n self.mobileInput.required = self.input.required;\n self.mobileInput.placeholder = self.input.placeholder;\n self.mobileFormatStr =\n inputType === \"datetime-local\"\n ? \"Y-m-d\\\\TH:i:S\"\n : inputType === \"date\"\n ? \"Y-m-d\"\n : \"H:i:S\";\n if (self.selectedDates.length > 0) {\n self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);\n }\n if (self.config.minDate)\n self.mobileInput.min = self.formatDate(self.config.minDate, \"Y-m-d\");\n if (self.config.maxDate)\n self.mobileInput.max = self.formatDate(self.config.maxDate, \"Y-m-d\");\n if (self.input.getAttribute(\"step\"))\n self.mobileInput.step = String(self.input.getAttribute(\"step\"));\n self.input.type = \"hidden\";\n if (self.altInput !== undefined)\n self.altInput.type = \"hidden\";\n try {\n if (self.input.parentNode)\n self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);\n }\n catch (_a) { }\n bind(self.mobileInput, \"change\", function (e) {\n self.setDate(getEventTarget(e).value, false, self.mobileFormatStr);\n triggerEvent(\"onChange\");\n triggerEvent(\"onClose\");\n });\n }\n function toggle(e) {\n if (self.isOpen === true)\n return self.close();\n self.open(e);\n }\n function triggerEvent(event, data) {\n if (self.config === undefined)\n return;\n var hooks = self.config[event];\n if (hooks !== undefined && hooks.length > 0) {\n for (var i = 0; hooks[i] && i < hooks.length; i++)\n hooks[i](self.selectedDates, self.input.value, self, data);\n }\n if (event === \"onChange\") {\n self.input.dispatchEvent(createEvent(\"change\"));\n self.input.dispatchEvent(createEvent(\"input\"));\n }\n }\n function createEvent(name) {\n var e = document.createEvent(\"Event\");\n e.initEvent(name, true, true);\n return e;\n }\n function isDateSelected(date) {\n for (var i = 0; i < self.selectedDates.length; i++) {\n var selectedDate = self.selectedDates[i];\n if (selectedDate instanceof Date &&\n compareDates(selectedDate, date) === 0)\n return \"\" + i;\n }\n return false;\n }\n function isDateInRange(date) {\n if (self.config.mode !== \"range\" || self.selectedDates.length < 2)\n return false;\n return (compareDates(date, self.selectedDates[0]) >= 0 &&\n compareDates(date, self.selectedDates[1]) <= 0);\n }\n function updateNavigationCurrentMonth() {\n if (self.config.noCalendar || self.isMobile || !self.monthNav)\n return;\n self.yearElements.forEach(function (yearElement, i) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n self.monthElements[i].textContent =\n monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + \" \";\n }\n else {\n self.monthsDropdownContainer.value = d.getMonth().toString();\n }\n yearElement.value = d.getFullYear().toString();\n });\n self._hidePrevMonthArrow =\n self.config.minDate !== undefined &&\n (self.currentYear === self.config.minDate.getFullYear()\n ? self.currentMonth <= self.config.minDate.getMonth()\n : self.currentYear < self.config.minDate.getFullYear());\n self._hideNextMonthArrow =\n self.config.maxDate !== undefined &&\n (self.currentYear === self.config.maxDate.getFullYear()\n ? self.currentMonth + 1 > self.config.maxDate.getMonth()\n : self.currentYear > self.config.maxDate.getFullYear());\n }\n function getDateStr(specificFormat) {\n var format = specificFormat ||\n (self.config.altInput ? self.config.altFormat : self.config.dateFormat);\n return self.selectedDates\n .map(function (dObj) { return self.formatDate(dObj, format); })\n .filter(function (d, i, arr) {\n return self.config.mode !== \"range\" ||\n self.config.enableTime ||\n arr.indexOf(d) === i;\n })\n .join(self.config.mode !== \"range\"\n ? self.config.conjunction\n : self.l10n.rangeSeparator);\n }\n function updateValue(triggerChange) {\n if (triggerChange === void 0) { triggerChange = true; }\n if (self.mobileInput !== undefined && self.mobileFormatStr) {\n self.mobileInput.value =\n self.latestSelectedDateObj !== undefined\n ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)\n : \"\";\n }\n self.input.value = getDateStr(self.config.dateFormat);\n if (self.altInput !== undefined) {\n self.altInput.value = getDateStr(self.config.altFormat);\n }\n if (triggerChange !== false)\n triggerEvent(\"onValueUpdate\");\n }\n function onMonthNavClick(e) {\n var eventTarget = getEventTarget(e);\n var isPrevMonth = self.prevMonthNav.contains(eventTarget);\n var isNextMonth = self.nextMonthNav.contains(eventTarget);\n if (isPrevMonth || isNextMonth) {\n changeMonth(isPrevMonth ? -1 : 1);\n }\n else if (self.yearElements.indexOf(eventTarget) >= 0) {\n eventTarget.select();\n }\n else if (eventTarget.classList.contains(\"arrowUp\")) {\n self.changeYear(self.currentYear + 1);\n }\n else if (eventTarget.classList.contains(\"arrowDown\")) {\n self.changeYear(self.currentYear - 1);\n }\n }\n function timeWrapper(e) {\n e.preventDefault();\n var isKeyDown = e.type === \"keydown\", eventTarget = getEventTarget(e), input = eventTarget;\n if (self.amPM !== undefined && eventTarget === self.amPM) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n var min = parseFloat(input.getAttribute(\"min\")), max = parseFloat(input.getAttribute(\"max\")), step = parseFloat(input.getAttribute(\"step\")), curValue = parseInt(input.value, 10), delta = e.delta ||\n (isKeyDown ? (e.which === 38 ? 1 : -1) : 0);\n var newValue = curValue + step * delta;\n if (typeof input.value !== \"undefined\" && input.value.length === 2) {\n var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;\n if (newValue < min) {\n newValue =\n max +\n newValue +\n int(!isHourElem) +\n (int(isHourElem) && int(!self.amPM));\n if (isMinuteElem)\n incrementNumInput(undefined, -1, self.hourElement);\n }\n else if (newValue > max) {\n newValue =\n input === self.hourElement ? newValue - max - int(!self.amPM) : min;\n if (isMinuteElem)\n incrementNumInput(undefined, 1, self.hourElement);\n }\n if (self.amPM &&\n isHourElem &&\n (step === 1\n ? newValue + curValue === 23\n : Math.abs(newValue - curValue) > step)) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n input.value = pad(newValue);\n }\n }\n init();\n return self;\n}\nfunction _flatpickr(nodeList, config) {\n var nodes = Array.prototype.slice\n .call(nodeList)\n .filter(function (x) { return x instanceof HTMLElement; });\n var instances = [];\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n try {\n if (node.getAttribute(\"data-fp-omit\") !== null)\n continue;\n if (node._flatpickr !== undefined) {\n node._flatpickr.destroy();\n node._flatpickr = undefined;\n }\n node._flatpickr = FlatpickrInstance(node, config || {});\n instances.push(node._flatpickr);\n }\n catch (e) {\n console.error(e);\n }\n }\n return instances.length === 1 ? instances[0] : instances;\n}\nif (typeof HTMLElement !== \"undefined\" &&\n typeof HTMLCollection !== \"undefined\" &&\n typeof NodeList !== \"undefined\") {\n HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n HTMLElement.prototype.flatpickr = function (config) {\n return _flatpickr([this], config);\n };\n}\nvar flatpickr = function (selector, config) {\n if (typeof selector === \"string\") {\n return _flatpickr(window.document.querySelectorAll(selector), config);\n }\n else if (selector instanceof Node) {\n return _flatpickr([selector], config);\n }\n else {\n return _flatpickr(selector, config);\n }\n};\nflatpickr.defaultConfig = {};\nflatpickr.l10ns = {\n en: __assign({}, English),\n default: __assign({}, English),\n};\nflatpickr.localize = function (l10n) {\n flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n);\n};\nflatpickr.setDefaults = function (config) {\n flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config);\n};\nflatpickr.parseDate = createDateParser({});\nflatpickr.formatDate = createDateFormatter({});\nflatpickr.compareDates = compareDates;\nif (typeof jQuery !== \"undefined\" && typeof jQuery.fn !== \"undefined\") {\n jQuery.fn.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n}\nDate.prototype.fp_incr = function (days) {\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === \"string\" ? parseInt(days, 10) : days));\n};\nif (typeof window !== \"undefined\") {\n window.flatpickr = flatpickr;\n}\nexport default flatpickr;\n","import flatpickr from 'flatpickr';\nimport { format } from 'date-fns';\nimport 'flatpickr/dist/flatpickr.min.css';\nimport 'flatpickr/dist/themes/dark.css';\n\nexport function datePickerHandler() {\n // Initialize Flatpickr on the dueDate input field\n const dueDateInput = document.getElementById('dueDate');\n const fp = flatpickr(dueDateInput, {\n static: true,\n dateFormat: 'Y-m-d',\n minDate: 'today',\n theme: 'dark',\n });\n\n // // Add an event listener to the input field to format the date using date-fns when it changes\n // dueDateInput.addEventListener('change', (event) => {\n // const selectedDate = new Date(event.target.value);\n // console.log(selectedDate);\n // const formattedDate = format(selectedDate, 'P');\n\n // fp.set('dateFormat', formattedDate);\n // });\n}\n","import * as DOMPurify from 'dompurify';\n\n/**\n * Creates a section HTML element with specified attribute and value\n * @param {string} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @returns {HTMLElement} - The created section element\n */\nexport function createSection(attributeName, attributeValue) {\n const section = document.createElement('section');\n section.setAttribute(attributeName, attributeValue);\n return section;\n}\n\n/**\n * Creates a div HTML element with a specified attribute name and value\n * @param {object} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @returns {HTMLDivElement} - The created div element\n */\nexport function createDiv(attributeName, attributeValue) {\n const div = document.createElement('div');\n div.setAttribute(attributeName, attributeValue);\n return div;\n}\n\n/**\n * Creates a picture element with provided attributes and sources\n * @param {object} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @param {object} imageSources - Object containing picture sources for different screen sizes\n * @returns {HTMLPictureElement} - The created picture element\n */\nexport function createPicture(attributeName, attributeValue, imageSources) {\n const picture = document.createElement('picture');\n picture.setAttribute(attributeName, attributeValue);\n\n Object.keys(imageSources).forEach((key) => {\n if (key === 'img') {\n const img = document.createElement('img');\n setAttributes(img, imageSources[key]);\n picture.appendChild(img);\n } else {\n const source = document.createElement('source');\n setAttributes(source, imageSources[key]);\n picture.appendChild(source);\n }\n });\n\n return picture;\n}\n\n/**\n * Creates a list (ul) element with provided attributes. The list items are created using a rendering export function passed as an argument\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute (e.g., 'cs-stats')\n * @param {object} itemData - Data to populate the list with. Expects an object where each property can be rendered as a list item\n * @param {Function} renderItem - export function that takes an item of data and returns a list item (li) element\n * @returns {HTMLUListElement} - The created unordered list element\n */\nexport function createList(\n attributeName,\n attributeValue,\n itemData,\n renderItem\n) {\n const list = document.createElement('ul');\n list.setAttribute(attributeName, attributeValue);\n\n for (let key in itemData) {\n if (itemData.hasOwnProperty(key)) {\n list.appendChild(renderItem(itemData[key]));\n }\n }\n\n return list;\n}\n\n/**\n * Creates a list item (li) element using a provided rendering export function for the item's content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute (e.g., 'cs-stat')\n * @param {object} item - Data item to be rendered inside the list item\n * @param {Function} renderContent - export function that takes the item and returns the content to be placed inside the list item\n * @returns {HTMLLIElement} - The created list item\n */\nexport function createListItem(\n attributeName,\n attributeValue,\n item,\n renderContent\n) {\n const listItem = document.createElement('li');\n listItem.setAttribute(attributeName, attributeValue);\n\n const content = renderContent(item);\n listItem.appendChild(content);\n\n return listItem;\n}\n\n/**\n * Creates a span element with a specified class and text content\n * @param {string} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the span\n * @returns {HTMLElement} - The created span element\n */\nexport function createSpan(attributeName, attributeValue, text) {\n const span = document.createElement('span');\n span.setAttribute(attributeName, attributeValue);\n span.innerText = text;\n\n return span;\n}\n\n/**\n * Creates a topper element (span) with a specified class and text content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the topper\n * @returns {HTMLElement} - The created topper element\n */\nexport function createTopper(attributeName, attributeValue, text) {\n const topper = document.createElement('span');\n topper.setAttribute(attributeName, attributeValue);\n topper.innerText = text;\n\n return topper;\n}\n\n/**\n * Creates a title element (h2) with a specified class and text content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the title\n * @returns {HTMLHeadingElement} - The created title element\n */\nexport function createTitle(attributeName, attributeValue, text) {\n const title = document.createElement('h2');\n title.setAttribute(attributeName, attributeValue);\n title.textContent = text;\n\n return title;\n}\n\n/**\n * Creates a paragraph element (p) with a specified class and text content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the paragraph\n * @returns {HTMLParagraphElement} - The created paragraph element\n */\nexport function createParagraph(attributeName, attributeValue, text) {\n const paragraph = document.createElement('p');\n paragraph.setAttribute(attributeName, attributeValue);\n paragraph.textContent = text;\n\n return paragraph;\n}\n\n/**\n * Sets multiple attributes on a DOM element based on a provided object\n * @param {HTMLElement} element - The DOM element to set attributes on\n * @param {object} attributes - Object containing key-value pairs for attributes\n */\nexport function setAttributes(element, attributes) {\n Object.keys(attributes).forEach((attr) => {\n element.setAttribute(attr, attributes[attr]);\n });\n}\n\n/**\n * Clears the content of a specified parent element\n * @param {HTMLElement} parent - The parent element whose content is to be cleared\n * @returns {boolean} - Returns true to indicate the operation was successful\n */\nexport function clearPage(parent) {\n parent.textContent = '';\n\n return true;\n}\n\n/**\n * Creates a link (anchor) element with specified attributes and text content\n * @param {string} href - The attribute name to set on the link (e.g., 'href')\n * @param {string} hrefValue - The value for the href attribute\n * @param {string} attributeName - the Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - The value for the attribute\n * @param {string} text - The text content for the link\n * @returns {HTMLAnchorElement} - The created anchor element\n */\nexport function createLink(\n href,\n hrefValue,\n attributeName,\n attributeValue,\n text\n) {\n const link = document.createElement('a');\n\n link.setAttribute(href, hrefValue);\n link.innerText = text;\n link.setAttribute(attributeName, attributeValue);\n link.setAttribute('target', '_blank');\n\n return link;\n}\n\n/**\n * Creates an element containing SVG code for a bin icon representing a delete action.\n * This function serves as workaround because SVG did not render in the DOM with the icon inside of it.\n * All fill values are left empty so that they can be redefined from the parent element's CSS properties,\n * allowing for easier customization of the icon's color.\n * @returns {HTMLDivElement} - The created 'SVG' div element.\n */\n\nexport function createDeleteIcon() {\n const deleteIcon = document.createElement('div');\n const svgCode = ``;\n deleteIcon.innerHTML = DOMPurify.sanitize(svgCode);\n\n return deleteIcon;\n}\n","export const sampleData = {\n projects: [\n {\n id: 1,\n name: 'Work',\n todos: [\n {\n id: 11,\n title: 'Meeting with clients',\n project: 'Work',\n description: 'Discuss project requirements',\n dueDate: '',\n priority: 'high',\n completed: true,\n },\n {\n id: 22,\n title: 'Prepare presentation',\n project: 'Work',\n description: 'Create slides for the upcoming presentation',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n ],\n },\n {\n id: 2,\n name: 'Personal',\n todos: [\n {\n id: 33,\n title: 'Go grocery shopping',\n project: 'Personal',\n description: 'Buy fruits, vegetables, and milk',\n dueDate: '',\n priority: 'high',\n completed: true,\n },\n {\n id: 44,\n title: 'Gym workout',\n project: 'Personal',\n description: 'Cardio and weight training session',\n dueDate: '',\n priority: 'low',\n completed: false,\n },\n ],\n },\n {\n id: 3,\n name: 'Home Improvement',\n todos: [\n {\n id: 55,\n title: 'Paint living room walls',\n project: 'Home Improvement',\n description: 'Choose paint color and buy supplies',\n dueDate: '',\n priority: 'medium',\n completed: true,\n },\n {\n id: 66,\n title: 'Fix leaking faucet',\n project: 'Home Improvement',\n description: 'Call plumber to fix the kitchen faucet',\n dueDate: '',\n priority: 'high',\n completed: true,\n },\n ],\n },\n {\n id: 4,\n name: 'Fitness Goals',\n todos: [\n {\n id: 77,\n title: 'Run 5 miles',\n project: 'Fitness Goals',\n description: 'Run in the park early morning',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 88,\n title: 'Try new yoga class',\n project: 'Fitness Goals',\n description: 'Attend the evening yoga class at the gym',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n ],\n },\n {\n id: 5,\n name: 'Vacation Planning',\n todos: [\n {\n id: 99,\n title: 'Book flight tickets',\n project: 'Vacation Planning',\n description: 'Search for best deals and book tickets',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 1010,\n title: 'Research accommodation options',\n project: 'Vacation Planning',\n description: 'Find suitable hotels or Airbnb',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n {\n id: 1111,\n title: 'Plan itinerary',\n project: 'Vacation Planning',\n description:\n 'Research attractions and create a travel plan',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 1212,\n title: 'Pack luggage',\n project: 'Vacation Planning',\n description: 'Make a list of essentials and pack luggage',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n {\n id: 1313,\n title: 'Check travel documents',\n project: 'Vacation Planning',\n description:\n 'Ensure passports, visas, and tickets are ready',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 1414,\n title: 'Confirm accommodation bookings',\n project: 'Vacation Planning',\n description: 'Double-check hotel or Airbnb reservations',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n ],\n },\n ],\n};\n\n/**\n * Adjusts the due dates of todos in the sample data to distribute them evenly across the current week.\n * Week starts with Monday.\n *\n * @param {Object} sampleData - The sample data object containing projects and todos.\n */\nfunction adjustDueDatesForCurrentWeek(sampleData) {\n // Get the current date\n const currentDate = new Date();\n // Adjust to Monday it it's not already Monday\n const currentDayOfWeek = currentDate.getDay();\n if (currentDayOfWeek !== 1) {\n const difference = currentDayOfWeek - 1;\n currentDate.setDate(currentDate.getDate() - difference);\n }\n\n // Calculate the total number of days in the current week\n const totalDays = 7;\n\n // Distribute the todos evenly across the days of the week\n let currentDay = new Date(currentDate);\n sampleData.projects.forEach((project) => {\n const todos = project.todos;\n const todosPerDay = Math.ceil(todos.length / totalDays);\n let currentTodoIndex = 0;\n\n for (let i = 0; i < totalDays; i++) {\n const todosForCurrentDay = todos.slice(\n currentTodoIndex,\n currentTodoIndex + todosPerDay\n );\n const dueDate = new Date(currentDay);\n todosForCurrentDay.forEach((todo, index) => {\n // Calculate due date based on index to evenly distribute todos\n dueDate.setDate(currentDay.getDate() + index);\n todo.dueDate = dueDate.toISOString().split('T')[0];\n });\n\n currentTodoIndex += todosPerDay;\n // Increment the current day\n currentDay.setDate(currentDay.getDate() + 1);\n }\n });\n}\n\n// Call the function with the sampleData\nadjustDueDatesForCurrentWeek(sampleData);\n","import {\n createDiv,\n createTitle,\n createList,\n createListItem,\n createParagraph,\n createDeleteIcon,\n} from '../utility/elementRender.js';\n\nimport { sampleData } from '../pageData/sampleData.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\n\n/**\n * Renders the primary container for the home page.\n *\n * @param {Object|Array} projectData - The data containing project(s) information.\n * If an object is provided, it should represent a single project.\n * If an array is provided, it should contain multiple project objects.\n * @returns {HTMLDivElement} - The container div element.\n */\nexport function renderContainer(projectData) {\n // Use projectsData if provided, Otherwise fallback to sample data\n const project = projectData || sampleData.projects;\n\n const container = createDiv('class', 'todo-home-container');\n const title = createTitle('class', 'title', 'Todos');\n container.appendChild(title);\n\n // Render the list of todos\n const todosList = renderTodosList(project);\n if (todosList) {\n container.appendChild(todosList);\n } else {\n console.error('Error rendering todo list: Data empty or null');\n }\n\n return container;\n}\n\n/**\n * Renders a list of todos.\n *\n * @param {Array} projects - Array of project objects, each containing todo items.\n * @returns {HTMLUListElement} - The list element containing todos.\n */\nexport function renderTodosList(projects) {\n if (!projects || projects.length === 0) {\n return null;\n }\n\n const list = createList('class', 'todo-list');\n\n projects.forEach((project) => {\n project.todos.forEach((todo) => {\n const listItem = renderTodoItem(todo);\n list.appendChild(listItem);\n });\n });\n\n return list;\n}\n\n/**\n * Renders a single todo item.\n *\n * @param {Object} todo - Todo object.\n * @returns {HTMLLIElement} - The list item element representing a todo.\n */\nexport function renderTodoItem(todo) {\n const priorityClass = getPriorityClass(todo.priority);\n const listItem = createListItem(\n 'class',\n `todo-container ${priorityClass}`,\n todo,\n renderTodoContent\n );\n listItem.id = `todo-${todo.id}`;\n return listItem;\n}\n\n/**\n * Renders the content of a single todo item.\n *\n * @param {Object} todo - The todo object containing information about todo content.\n * @returns {HTMLDivElement} - The container div element representing the content of the todo item.\n */\nexport function renderTodoContent(todo) {\n const container = createDiv('class', 'todo-content');\n const checkbox = createDiv('class', 'todo-checkbox');\n const todoTitle = createTitle('class', 'todo-title', todo.title);\n const todoDueDate = createParagraph('class', 'todo-dueDate', todo.dueDate);\n const todoDetails = createDiv('class', 'todo-item');\n const todoDelete = createDiv('class', 'todo-item');\n\n todoDetails.classList.add('details');\n todoDetails.textContent = 'Details';\n todoDetails.id = todo.id + 'details';\n const todoDetailsId = todoDetails.id;\n\n todoDelete.classList.add('delete');\n todoDelete.id = todo.id + 'delete';\n\n const todoManager = new TodoManager(\n todo.id,\n todo.title,\n todo.project,\n todo.description,\n todo.dueDate,\n todo.priority,\n todo.completed\n );\n\n todoManager.checkboxHandler(checkbox, todoTitle, todoDueDate, todo.id);\n todoManager.todoDeleteHandler(todoDelete, todo.id, todo.project);\n todoManager.todoDetailsHandler(todoDetails, todoDetailsId, todo.id);\n\n const deleteIcon = createDeleteIcon();\n todoDelete.appendChild(deleteIcon);\n\n container.appendChild(checkbox);\n container.appendChild(todoTitle);\n container.appendChild(todoDueDate);\n container.appendChild(todoDetails);\n container.appendChild(todoDelete);\n\n return container;\n}\n\n/**\n * Determines the CSS class name for visual representation of todo item priority.\n *\n * @param {String} priority - The priority value of the todo item.\n * @returns {String} - The CSS class name corresponding to the priority.\n */\nexport function getPriorityClass(priority) {\n switch (priority) {\n case 'low':\n return 'priority-low';\n case 'medium':\n return 'priority-medium';\n case 'high':\n return 'priority-high';\n default:\n return 'priority-low'; // Default class if priority is not specified\n }\n}\n\n/**\n * Handles the error that occurs while retrieving data from local storage.\n *\n * @param {Error} error - The error object representing the storage error.\n */\nexport function handleStorageError(error) {\n console.error('Error retrieving data from local storage: ', error);\n}\n\n/**\n * Handles the error that occurs while instantiating dialog.\n *\n * @param {Error} error - The error object representing the dialog error.\n */\nexport function handleDialogError(error) {\n console.error('Error instantiating dialog', error);\n}","import { Project } from '../entities/project';\n\n/**\n * Saves data to local storage.\n *\n * @param {string} key - The key to store the data under.\n * @param {any} data - The data to be saved.\n * @returns {Promise} A promise that resolves when the data is successfully saved, or rejects with an error.\n */\nexport function saveDataToLocalStorage(key, data) {\n return new Promise((resolve, reject) => {\n try {\n const serializedData = JSON.stringify(data);\n localStorage.setItem(key, serializedData);\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n}\n\n/**\n * Retrieves data from local storage.\n *\n * @param {string} key - The key to retrieve the data from.\n * @returns {any} The retrieved data, or null if the data is not found or an error occurs.\n */\nexport function getDataFromLocalStorage(key) {\n try {\n const serializedData = localStorage.getItem(key);\n const result = JSON.parse(serializedData);\n return result;\n } catch (error) {\n console.error('Error retrieving data from local storage: ', error);\n return null;\n }\n}\n\n/**\n * Removes data from local storage.\n *\n * @param {string} key - The key of the data to be removed.\n * @returns {boolean} True if the data is successfully removed, false otherwise.\n */\nexport function removeDataFromStorage(key) {\n try {\n localStorage.removeItem(key);\n return true;\n } catch (error) {\n console.error('Error removing data from local storage: ', error);\n return false;\n }\n}\n\n/**\n * Removes a todo item from the existing data in local storage.\n *\n * @param {Array} existingData - The existing data in local storage.\n * @param {string} todoIDToRemove - The ID of the todo item to remove.\n * @returns {Array} The updated existing data with the specified todo item removed.\n */\nexport function removeTodoFromLocalStorage(existingData, todoIDToRemove) {\n // Check if existingData is null or undefined\n if (!existingData || !Array.isArray(existingData)) {\n console.error('Existing data is not in the expected format.');\n return existingData;\n }\n\n for (const project of existingData) {\n if (!project.todos || !Array.isArray(project.todos)) {\n console.error('Project todos are not in the expected format.');\n continue; // Skip to the next project\n }\n\n // Remove todo with the specified ID from the project's todos array\n project.todos = project.todos.filter(\n (todo) => todo.id !== todoIDToRemove\n );\n }\n\n return existingData;\n}\n\n/**\n * Edits a todo item in the existing data in local storage.\n *\n * @param {string} key - The key of the data in local storage.\n * @param {string} todoId - The ID of the todo item to edit.\n * @param {object} newData - The new data to update the todo item with.\n * @returns {Promise} A promise that resolves to true if the data is successfully edited, or false otherwise.\n */\nexport async function editDataInLocalStorage(key, todoId, newData) {\n try {\n let existingData = getDataFromLocalStorage(key);\n if (!existingData) {\n console.error(\n 'Cannot edit data: No existing data found in local storage.'\n );\n return false;\n }\n\n // Find the project and todo index\n let projectIndex = -1;\n let todoIndex = -1;\n for (let i = 0; i < existingData.length; i++) {\n todoIndex = existingData[i].todos.findIndex(\n (todo) => todo.id === todoId\n );\n if (todoIndex !== -1) {\n projectIndex = i;\n break;\n }\n }\n\n if (projectIndex === -1 || todoIndex === -1) {\n throw new Error(\n 'Todo with specified id not found in existing data.'\n );\n }\n\n // Check if the project name has been changed\n if (newData.project !== existingData[projectIndex].name) {\n // Call the updateTodoProject method\n existingData = updateTodoProject(\n existingData,\n projectIndex,\n todoIndex,\n newData.project\n );\n } else {\n // Update the todo item with the provided newData\n existingData[projectIndex].todos[todoIndex] = {\n ...existingData[projectIndex].todos[todoIndex],\n ...newData,\n };\n }\n\n // Save the updated data to local storage\n await saveDataToLocalStorage(key, existingData);\n return true;\n } catch (error) {\n console.error('Error editing data in local storage: ', error);\n return false;\n }\n}\n\n/**\n * Update the project name in the existing data retrieved from local storage and manages todo item relocation.\n * If a project with the new project name does not exist, a new project is created.\n * If the todo with the specified ID is not found in the existing data, no changes are made.\n *\n * @param {Array} existingData - The existing data retrieved from local storage.\n * @param {number} projectIndex - The index of the project containing the todo item to be updated.\n * @param {number} todoIndex - The index of the todo item within the project to be updated.\n * @param {number} newProjectName - The new project name.\n * @returns {Array} The updated existing data with the project and todo item modifications.\n */\nfunction updateTodoProject(\n existingData,\n projectIndex,\n todoIndex,\n newProjectName\n) {\n // Update the project name in the todo item\n existingData[projectIndex].todos[todoIndex].project = newProjectName;\n\n // Check if a project already exists with the new project name\n const newProjectIndex = existingData.findIndex(\n (project) => project.name === newProjectName\n );\n\n if (newProjectIndex === -1) {\n // Create a new project with the new project name\n const newProjectId = Date.now();\n const newProject = new Project(newProjectId, newProjectName);\n newProject.todos.push(existingData[projectIndex].todos[todoIndex]);\n existingData.push(newProject);\n } else {\n // Add the todo item to the existing project with the new project name\n existingData[newProjectIndex].todos.push(\n existingData[projectIndex].todos[todoIndex]\n );\n }\n\n // Remove the todo item from the original project\n existingData[projectIndex].todos.splice(todoIndex, 1);\n\n return existingData;\n}\n","import { getDataFromLocalStorage } from '../utility/localStorageManager';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Represents a project.\n *\n * @class\n */\nexport class Project {\n /**\n * Creates a new project.\n *\n * @constructor\n * @param {number} id - The ID of the project.\n * @param {string} name - The name of the project.\n */\n constructor(id, name) {\n this.id = id;\n this.name = name;\n this.todos = [];\n }\n}\n\n/**\n * Represents a project manager.\n *\n * @class\n */\nexport class ProjectManager {\n /**\n * Creates a new project manager.\n *\n * @constructor\n */\n constructor() {\n this.projects = [];\n }\n\n /**\n * Adds a todo to a project.\n *\n * If the project doesn't exist, a new project will be created.\n * @param {object} todo - The todo object to be added.\n */\n addTodoToProject(todo) {\n let project = this.getProjectByName(todo.project);\n\n if (project) {\n project.todos.push(todo);\n } else {\n const id = Date.now();\n project = new Project(id, todo.project);\n this.projects.push(project);\n project.todos.push(todo);\n }\n }\n\n /**\n * Removes a todo from a project.\n *\n * @param {string} projectName - The name of the project.\n * @param {number} todoId - The ID of the todo to be removed.\n */\n removeTodoFromProject(projectName, todoId) {\n const project = this.getProjectByName(projectName);\n if (project) {\n project.todos = project.todos.filter((todo) => todo.id !== todoId);\n } else {\n console.log('No project found with name:', projectName);\n }\n }\n\n /**\n * Gets a project by its name.\n *\n * @param {string} name - The name of the project.\n * @returns {Project|undefined} The project with the specified name, or undefined if not found.\n */\n getProjectByName(name) {\n return this.projects.find((project) => project.name === name);\n }\n\n /**\n * Retrieve a project by its ID, including its todos.\n *\n * @param {number} projectId - The ID of the project to retrieve.\n * @returns {Object|null} - The project object with todos if found, or null if not found.\n */\n getProjectById(projectId) {\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n if (!existingData) {\n // Handle the case where no data is found in local storage\n return null;\n }\n const selectedProject = existingData.find(\n (project) => project.id === projectId\n );\n if (selectedProject) {\n return {\n ...selectedProject,\n todos: selectedProject.todos || [], // Ensure todos array exists\n };\n }\n return null;\n }\n\n /**\n * Displays the projects in the navigation bar.\n */\n displayProjectsInNavigationBar() {\n const projects = getDataFromLocalStorage(PROJECTS_STORAGE_KEY); // Retrieve projects from local storage\n\n if (!projects || projects.length === 0) {\n console.error('No projects found in local storage.');\n return;\n }\n\n const projectsDropdown = document.getElementById('projects'); // Get the projects dropdown element\n\n if (!projectsDropdown) {\n console.error('Projects dropdown not found.');\n return;\n }\n\n const dropdownList = projectsDropdown.querySelector('.cs-drop-ul'); // Get the dropdown list within the projects dropdown\n\n if (!dropdownList) {\n console.error('Dropdown list not found within projects dropdown.');\n return;\n }\n\n projects.forEach((project) => {\n const projectItem = document.createElement('li'); // Create a new list item\n projectItem.classList.add('cs-drop-li');\n\n const projectLink = document.createElement('div'); // Create a link for the project\n projectLink.classList.add('cs-li-link', 'cs-drop-link');\n projectLink.textContent = project.name; // Assuming each project object has a 'name' property\n projectLink.setAttribute('id', project.id);\n\n projectItem.appendChild(projectLink); // Add the project link to the list item\n dropdownList.appendChild(projectItem); // Add the list item to the dropdown list\n });\n }\n}\n","import { clearPage } from '../utility/elementRender.js';\n\nimport { handleStorageError, renderContainer } from '../utility/todoRenderer.js';\n\nimport { ProjectManager } from '../entities/project.js';\n\nimport {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\n\n// Instantiate ProjectManager for managing projects\n// Manages projects and their associated todos\nconst projectManager = new ProjectManager();\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the home page content.\n *\n * @param {HTMLElement} content - The parent element where the home page will be rendered.\n */\nexport default function homePageLoader(content) {\n clearPage(content);\n let existingData;\n\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(\n PROJECTS_STORAGE_KEY,\n sampleData.projects\n );\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(existingData);\n section.appendChild(todoContainer);\n\n\n}\n\nexport { projectManager };","import { projectManager } from '../pageLoaders/homePageLoader.js';\nimport { renderContainer } from '../utility/todoRenderer.js';\nimport { dialogHandler } from '../utility/dialogHandler.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport {\n getDataFromLocalStorage,\n removeTodoFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Represents a Todo item.\n *\n * @class\n */\nexport class Todo {\n /**\n * Create a Todo item.\n *\n * @constructor\n * @param {number} id - The ID of the Todo item.\n * @param {string} title - The title of the Todo item.\n * @param {string} project - The project of the Todo item.\n * @param {string} description - The description of the Todo item.\n * @param {string} dueDate - The due date of the Todo item.\n * @param {string} priority - The priority of the Todo item.\n */\n constructor(id, title, project, description, dueDate, priority) {\n this.id = id;\n this.title = title;\n this.project = project;\n this.description = description;\n this.dueDate = dueDate;\n this.priority = priority;\n this.completed = false;\n }\n}\n\n/**\n * Represents a Todo Manager.\n *\n * @class\n */\nexport class TodoManager {\n /**\n * Create a Todo Manager.\n *\n * @constructor\n * @param {number} todoId - The ID of the Todo item.\n * @param {string} todoTitle - The title of the Todo item.\n * @param {string} projectName - The project name of the Todo item.\n * @param {string} todoDescription - The description of the Todo item.\n * @param {string} todoDueDate - The due date of the Todo item.\n * @param {string} todoPriority - The priority of the Todo item.\n * @param {boolean} todoCompleted - The completion status of the Todo item.\n */\n constructor(\n todoId,\n todoTitle,\n projectName,\n todoDescription,\n todoDueDate,\n todoPriority,\n todoCompleted\n ) {\n this.todoId = todoId;\n this.todoTitle = todoTitle;\n this.projectName = projectName;\n this.todoDescription = todoDescription;\n this.todoDueDate = todoDueDate;\n this.todoPriority = todoPriority;\n this.todoCompleted = todoCompleted;\n }\n\n /**\n * Handles the checkbox click event for a Todo item.\n *\n * @param {HTMLElement} checkbox - The checkbox element.\n * @param {HTMLElement} todoTitle - The title element of the Todo item.\n * @param {HTMLElement} todoDueDate - The due date element of the Todo item.\n * @param {number} todoId - The ID of the Todo item.\n */\n checkboxHandler(checkbox, todoTitle, todoDueDate, todoId) {\n // Retrieve the completion status from local storage\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n const todo = this.findTodoById(existingData, todoId);\n if (!todo) {\n console.error('Todo with ID', todoId, 'not found.');\n return;\n }\n const isCompleted = todo.completed;\n\n // Set initial visual representation based on completion status\n if (isCompleted) {\n checkbox.classList.add('todo-checked');\n todoTitle.style.textDecoration = 'line-through';\n todoDueDate.style.textDecoration = 'line-through';\n }\n\n checkbox.addEventListener('click', (event) => {\n event.preventDefault();\n handleCheckBoxClick();\n });\n const handleCheckBoxClick = () => {\n // Toggle the 'todo-checked' class\n checkbox.classList.toggle('todo-checked');\n\n // Toggle line through todo title and due date\n const isCompleted = checkbox.classList.contains('todo-checked');\n todoTitle.style.textDecoration = isCompleted ? 'line-through' : '';\n todoDueDate.style.textDecoration = isCompleted\n ? 'line-through'\n : '';\n\n // Update todo completion status in local storage\n this.updateTodoCompletion(todoId, isCompleted);\n };\n checkbox.removeEventListener('click', () => {\n handleCheckBoxClick();\n });\n }\n\n /**\n * Handles the delete button click event for a Todo item.\n *\n * @param {HTMLElement} todoDelete - The delete button element.\n * @param {number} todoId - The ID of the Todo item.\n * @param {string} projectName - The project name of the Todo item.\n */\n todoDeleteHandler(todoDelete, todoId, projectName) {\n todoDelete.addEventListener('click', (event) => {\n event.preventDefault();\n handleDeleteButtonClick();\n });\n const handleDeleteButtonClick = () => {\n const todoToRemove = todoId;\n\n let existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n let updatedData = removeTodoFromLocalStorage(\n existingData,\n todoToRemove\n );\n\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, updatedData);\n\n projectManager.removeTodoFromProject(projectName, todoToRemove);\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(existingData);\n clearPage(section);\n section.appendChild(todoContainer);\n };\n todoDelete.removeEventListener('click', () => {\n handleDeleteButtonClick();\n });\n }\n\n /**\n * Updates the completion status of a Todo item.\n *\n * @param {number} todoId - The ID of the Todo item.\n * @param {boolean} isCompleted - The completion status of the Todo item.\n */\n updateTodoCompletion(todoId, isCompleted) {\n try {\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n if (existingData === null) {\n console.error(\n 'Cannot update todo completion status: No existing data found in local storage'\n );\n return;\n }\n\n const updatedData = existingData.map((project) => ({\n ...project,\n todos: project.todos.map((todo) => {\n if (todo.id === todoId) {\n return { ...todo, completed: isCompleted };\n }\n return todo;\n }),\n }));\n\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, updatedData);\n } catch (error) {\n console.error(error);\n }\n }\n\n /**\n * Handles the details button click event for a Todo item.\n *\n * @param {HTMLElement} todoDetails - The details button element.\n * @param {HTMLElement} todoDetailsId - The details ID element.\n * @param {number} id - The ID of the Todo item.\n */\n todoDetailsHandler(todoDetails, todoDetailsId, id) {\n todoDetails.addEventListener('click', (event) => {\n event.preventDefault();\n handleDetailsButtonClick();\n });\n const handleDetailsButtonClick = async () => {\n try {\n // Retrieve todo data from local storage based on todo ID\n const existingData =\n getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n const todoData = this.findTodoById(existingData, id);\n\n if (!todoData) {\n console.error(\n 'Todo with id: ',\n id,\n 'not found in local storage'\n );\n return;\n }\n\n await dialogHandler(todoDetails, todoDetailsId, todoData); // Pass details element and its id\n } catch (error) {\n console.error('Error handling details click: ', error);\n }\n };\n todoDetails.removeEventListener('click', () => {\n handleDetailsButtonClick();\n });\n }\n\n /**\n * Retrieves the todos that are due today.\n *\n * @param {Array} existingData - The existing todo items data.\n * @returns {Array} - The filtered todo items due today.\n */\n getTodosDueToday(existingData) {\n // Get today's date in format ('Y-m-d')\n const today = new Date().toISOString().split('T')[0];\n // Get filtered projects based on today\n const filteredTodosForToday = this.getFilteredProjects(\n existingData,\n today,\n today\n );\n return filteredTodosForToday;\n }\n\n /**\n * Retrieves todos due within the current week.\n *\n * @param {Array} existingData - The existing todo data.\n * @returns {Array} - The filtered todos due within the current week.\n */\n getTodosDueThisWeek(existingData) {\n // Define constants for days of the week using numeric values\n const SUNDAY = 0;\n const MONDAY = 1;\n const SATURDAY = 6;\n\n // Get today's date\n const today = new Date();\n const currentDayOfWeek = today.getDay();\n\n // Calculate the start of the week (Monday)\n const startOfWeek = new Date(today);\n startOfWeek.setDate(\n today.getDate() -\n currentDayOfWeek +\n (currentDayOfWeek === SUNDAY ? -SATURDAY : MONDAY)\n );\n startOfWeek.setHours(0, 0, 0, 0); // Set time to start of day\n\n // Calculate the end of the week (Sunday)\n const endOfWeek = new Date(startOfWeek);\n endOfWeek.setDate(startOfWeek.getDate() + SATURDAY); // End of week is 6 days from start\n endOfWeek.setHours(23, 59, 59, 999); // Set time to end of day\n\n const filteredTodosForThisWeek = this.getFilteredProjects(\n existingData,\n startOfWeek,\n endOfWeek\n );\n\n return filteredTodosForThisWeek;\n }\n\n /**\n * Filters projects and their todos based on the dueDate\n * being within the specified date range.\n *\n * @param {Array} existingData - The array of existing projects and todos.\n * @param {string} startDate - The start date of the date range.\n * @param {string} endDate - The end date of the date range.\n * @returns {Array} - The filtered projects and their todos.\n */\n getFilteredProjects(existingData, startDate, endDate) {\n // Filter projects and their todos based on the dueDate being within the specified date range\n // Need to filter projects because renderTodosList method expects projects\n const filteredProjects = existingData\n .map((project) => ({\n ...project,\n todos: project.todos.filter((todo) => {\n // Convert todo due date string to a Date object\n const todoDueDate = new Date(todo.dueDate);\n // Check if todo due date falls within the specified date range\n const todoDateRange =\n todoDueDate >= new Date(startDate) &&\n todoDueDate <= new Date(endDate);\n\n return todoDateRange;\n }),\n }))\n .filter((project) => project.todos.length > 0);\n\n return filteredProjects;\n }\n\n /**\n * Retrieves todos for a specific project from existing data.\n *\n * @param {Array} existingData - The existing data containing todos for multiple projects.\n * @param {string} projectName - The name of the project to retrieve todos for.\n * @returns {Array|null} - An array of todos for the specified project, or null if the project is not found.\n */\n getTodosForProject(existingData, projectName) {\n // const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n if (!existingData) {\n console.error('No existing data found in local storage');\n return null;\n }\n\n const filteredProjects = existingData.filter(\n (project) => project.name === projectName\n );\n\n if (!filteredProjects.length === 0) {\n console.error(`Project '${projectName}' not found`);\n return null;\n }\n return filteredProjects;\n }\n\n /**\n * Finds a Todo item by its ID.\n *\n * @param {Array} existingData - The existing data from local storage.\n * @param {number} todoId - The ID of the Todo item.\n * @returns {object|null} - The Todo item if found, otherwise null.\n */\n findTodoById(existingData, todoId) {\n for (const project of existingData) {\n for (const todo of project.todos) {\n if (todo.id === todoId) {\n return todo;\n }\n }\n }\n return null; // Return null if no todo with the specified ID is found\n }\n}\n","import { Todo } from '../entities/todoItems.js';\nimport { Project, ProjectManager } from '../entities/project.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport { getPriorityClass, renderTodoItem } from './todoRenderer.js';\nimport { removeDialog } from './dialogHandler.js';\nimport {\n saveDataToLocalStorage,\n getDataFromLocalStorage,\n editDataInLocalStorage,\n} from './localStorageManager.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n/**\n * Represents a form handler for managing todo items.\n */\nexport class TodoFormHandler {\n /**\n * Creates an instance of TodoFormHandler.\n *\n * @param {Document} document - The document object.\n * @param {ProjectManager} projectManager - The project manager object.\n */\n constructor(document, projectManager) {\n this.document = document;\n this.projectManager = projectManager;\n this.formElement = this.document.getElementById('todo-form');\n }\n\n /**\n * Handles the form submission event.\n *\n * @param {Event} event - The form submission event.\n */\n async handleSubmit(event) {\n event.preventDefault();\n try {\n const formData = this.extractFormData();\n const newTodo = this.createTodoFromFormData(formData);\n // Retrieve existing data from local storage\n let existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n if (!existingData) {\n existingData = sampleData.projects; // Fall back to sample data if no existing data\n }\n\n // Add the new todo to existing data\n const updatedData = this.addTodoToExistingData(\n existingData,\n newTodo\n );\n\n // Save the updated data back to local storage\n await saveDataToLocalStorage(PROJECTS_STORAGE_KEY, updatedData);\n\n this.addNewTodoToList(newTodo);\n this.clearForm();\n this.closeDialog();\n\n const dialog = document.getElementById('dialog');\n removeDialog(dialog);\n } catch (error) {\n console.error('Error handling form submission: ', error);\n }\n }\n\n /**\n * Handles the save event for a specific todo item.\n *\n * @param {Event} event - The save event.\n * @param {Todo} todoData - The todo item data.\n */\n async handleSave(event, todoData) {\n event.preventDefault();\n try {\n // Extract the relevant data from the form\n const formData = this.extractFormData(todoData);\n\n // Check if the project name has changed\n if (formData.project !== todoData.project) {\n this.updateProjectNameInManager(\n todoData.project,\n formData.project,\n todoData\n );\n }\n\n // Merge the extracted form data with the existing todo data\n const updatedTodoData = { ...todoData, ...formData };\n // Save the updated data to local storage\n await editDataInLocalStorage(\n PROJECTS_STORAGE_KEY,\n todoData.id,\n updatedTodoData\n );\n\n this.updatedTodoInList(updatedTodoData);\n this.clearForm();\n this.closeDialog();\n\n const dialog = document.getElementById('dialog');\n removeDialog(dialog);\n } catch (error) {\n console.error('Error saving data: ', error);\n }\n }\n\n /**\n * Update the project name in the existing data retrieved from local storage.\n *\n * @param {string} oldProjectName - The old project name.\n * @param {string} newProjectName - The new project name.\n * @param {Todo} todo - The todo item associated with the project.\n */\n updateProjectNameInManager(oldProjectName, newProjectName, todo) {\n // Retrieve existing data from local storage\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n if (!existingData) {\n console.error('No existing data found in local storage.');\n return;\n }\n // Find the project index with the old name\n const projectIndex = existingData.findIndex(\n (project) => project.name === oldProjectName\n );\n\n if (projectIndex !== -1) {\n // Remove the todo item from the original project\n const updatedProject = existingData[projectIndex];\n updatedProject.todos = updatedProject.todos.filter(\n (existingTodo) => existingTodo.id !== todo.id\n );\n\n // Save the updated project back to existing data\n existingData[projectIndex] = updatedProject;\n\n // Create a new project with the new name if it doesn't exist\n const newProjectIndex = existingData.findIndex(\n (project) => project.name === newProjectName\n );\n\n if (newProjectIndex === -1) {\n const newProjectId = Date.now();\n const newProject = new Project(newProjectId, newProjectName);\n newProject.todos.push(todo);\n existingData.push(newProject);\n } else {\n // Add the todo item to the existing project with the new name\n existingData[newProjectIndex].todos.push(todo);\n }\n\n // Save the updated data back to local storage\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, existingData);\n } else {\n console.error(\n 'Project with specified name not found in existing data.'\n );\n }\n }\n\n /**\n * Extracts form data from the todo form.\n *\n * @param {Todo} [todoData={}] - The todo item data.\n * @returns {Object} - The extracted form data.\n */\n extractFormData(todoData = {}) {\n const formData = new FormData(this.formElement);\n return {\n id: todoData.id || '',\n title: formData.get('title'),\n project: formData.get('project'),\n description: formData.get('description'),\n dueDate: formData.get('dueDate'),\n priority: formData.get('priority'),\n };\n }\n\n /**\n * Adds a new todo item to the todo list.\n *\n * @param {Todo} newTodo - The new todo item.\n */\n addNewTodoToList(newTodo) {\n // Get the container element where todos are displayed\n const todoList = document.querySelector('.todo-list');\n\n // Render the new todo item\n const newTodoItem = renderTodoItem(newTodo);\n\n // Append the new todo item to the existing list\n todoList.appendChild(newTodoItem);\n }\n\n /**\n * Adds a new todo item to the existing data.\n *\n * @param {Array} existingData - The existing data.\n * @param {Todo} newTodo - The new todo item.\n * @returns {Array} - The updated data.\n */\n addTodoToExistingData(existingData, newTodo) {\n // Check if there's a project matching the new todo's project name\n const projectIndex = existingData.findIndex(\n (project) => project.name === newTodo.project\n );\n\n if (projectIndex !== -1) {\n // Add the new todo to the existing project\n existingData[projectIndex].todos.push(newTodo);\n } else {\n // Create a new project with the new todo\n existingData.push({\n id: Date.now(), // Generate a unique id\n name: newTodo.project,\n todos: [newTodo],\n });\n }\n\n return existingData;\n }\n\n /**\n * Updates a todo item in the todo list.\n *\n * @param {Todo} updatedTodo - The updated todo item.\n */\n updatedTodoInList(updatedTodo) {\n // Get the container where todos are displayed\n const todoList = document.querySelector('.todo-list');\n\n // Find the existing todo item in the list by its ID\n const todoItem = todoList.querySelector(`#todo-${updatedTodo.id}`);\n\n if (todoItem) {\n todoItem.querySelector('.todo-title').textContent =\n updatedTodo.title;\n todoItem.querySelector('.todo-dueDate').textContent =\n updatedTodo.dueDate;\n todoItem.className = `todo-container ${getPriorityClass(\n updatedTodo.priority\n )}`;\n }\n }\n\n /**\n * Creates a new todo item from form data.\n *\n * @param {Object} formData - The form data.\n * @returns {Todo} - The new todo item.\n */\n createTodoFromFormData(formData) {\n const random = Math.random().toFixed();\n const id = Date.now() + random;\n return new Todo(\n id,\n formData.title,\n formData.project,\n formData.description,\n formData.dueDate,\n formData.priority\n );\n }\n\n /**\n * Populates the todo form with data.\n *\n * @param {Todo} todoData - The todo item data.\n */\n populateTodoForm(todoData) {\n const todoForm = this.formElement;\n todoForm.elements.id = todoData.id;\n todoForm.elements['title'].value = todoData.title;\n todoForm.elements['project'].value = todoData.project;\n todoForm.elements['description'].value = todoData.description;\n todoForm.elements['dueDate'].value = todoData.dueDate;\n todoForm.elements['priority'].value = todoData.priority;\n }\n\n /**\n * Closes the dialog.\n */\n closeDialog() {\n const dialog = this.document.getElementById('dialog');\n dialog.close();\n }\n\n /**\n * Clears the form.\n */\n clearForm() {\n this.formElement.reset();\n }\n}\n","import { datePickerHandler } from '../utility/datePicker.js';\nimport { TodoFormHandler } from '../utility/todoFormHandler.js';\nimport { projectManager } from '../pageLoaders/homePageLoader.js';\n\n/**\n * Handles the dialog functionality based on the button clicked.\n *\n * @param {HTMLElement} button - The button element that triggered the dialog.\n * @param {String} id - The ID of the button element.\n * @param {Object} todoData - The data associated with the todo.\n */\nexport async function dialogHandler(button, id, todoData) {\n try {\n const newTodoButton = document.getElementById('newTodoButton');\n const detailsButton = document.getElementById(id);\n const dialog = await createDialog();\n\n if (button === newTodoButton) {\n setupNewTodoDialog(dialog);\n } else if (button === detailsButton) {\n setupDetailsDialog(dialog, todoData);\n }\n\n setupDialogClose(dialog);\n } catch (error) {\n console.error('Error in dialogHandler:', error);\n }\n}\n\n/**\n * Creates a dialog element and appends it to the document body.\n *\n * @returns {Promise} - A promise that resolves to the created dialog element.\n */\nasync function createDialog() {\n const dialog = document.createElement('dialog');\n dialog.id = 'dialog';\n\n const response = await fetch('dialogFormContent.html');\n if (!response.ok) {\n throw new Error('Failed to fetch dialog form content');\n }\n\n dialog.innerHTML = await response.text();\n document.body.appendChild(dialog);\n\n return dialog;\n}\n\n/**\n * Sets up the dialog for adding a new todo.\n *\n * @param {HTMLElement} dialog - The dialog element.\n */\nfunction setupNewTodoDialog(dialog) {\n dialog.showModal();\n datePickerHandler();\n\n const formButton = setupFormButton(dialog, 'submit', 'Add');\n\n formButton.addEventListener('click', (event) => {\n newFormButtonEventHandler(event);\n });\n const newFormButtonEventHandler = (event) => {\n todoFormInit().handleSubmit(event);\n };\n formButton.removeEventListener('click', () => {\n newFormButtonEventHandler();\n });\n}\n\n/**\n * Sets up the dialog for editing todo details.\n *\n * @param {HTMLElement} dialog - The dialog element.\n * @param {Object} todoData - The data associated with the todo.\n */\nfunction setupDetailsDialog(dialog, todoData) {\n dialog.showModal();\n datePickerHandler();\n\n const formButton = setupFormButton(dialog, 'save', 'Save');\n todoFormInit().populateTodoForm(todoData);\n\n formButton.addEventListener('click', (event) => {\n detailsFormButtonEventHandler(event);\n });\n const detailsFormButtonEventHandler = (event) => {\n todoFormInit().handleSave(event, todoData);\n };\n formButton.removeEventListener('click', () => {\n detailsFormButtonEventHandler();\n });\n}\n\n/**\n * Sets up the form button inside the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element.\n * @param {String} type - The type of the form button.\n * @param {String} text - The text content of the form button.\n * @returns {HTMLElement} - The form button element.\n */\nfunction setupFormButton(dialog, type, text) {\n const formButton = dialog.querySelector('#form-button');\n formButton.setAttribute('type', type);\n formButton.textContent = text;\n return formButton;\n}\n\n/**\n * Sets up the close functionality for the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element.\n */\nfunction setupDialogClose(dialog) {\n const dialogClose = dialog.querySelector('#dialog-close-btn');\n\n dialogClose.addEventListener('click', () => {\n dialogCloseEventHandler();\n });\n const dialogCloseEventHandler = () => {\n const formElement = dialog.querySelector('#todo-form');\n formElement.reset();\n dialog.close();\n removeDialog(dialog);\n };\n dialogClose.removeEventListener('click', () => {\n dialogCloseEventHandler();\n });\n}\n\n/**\n * Initializes the TodoFormHandler and returns an instance of it.\n *\n * @returns {TodoFormHandler} - An instance of the TodoFormHandler class.\n */\nfunction todoFormInit() {\n const todoFormHandler = new TodoFormHandler(document, projectManager);\n return todoFormHandler;\n}\n\n/**\n * Removes the dialog element from the document body.\n *\n * @param {HTMLElement} dialog - The dialog element to be removed.\n */\nexport function removeDialog(dialog) {\n document.body.removeChild(dialog);\n}\n","import {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport {\n handleStorageError,\n renderContainer,\n} from '../utility/todoRenderer.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the today page content.\n *\n * @param {HTMLElement} content - The parent element where the today page will be rendered.\n */\nexport default function todayPageLoader(content) {\n clearPage(content);\n let existingData;\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n const todoManager = new TodoManager();\n const todoDueToday = todoManager.getTodosDueToday(existingData);\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(todoDueToday);\n section.appendChild(todoContainer);\n\n const title = document.querySelector('.title');\n const titleForToday = 'Due Today';\n title.textContent = title.textContent + ' ' + titleForToday;\n}\n","import {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport {\n handleStorageError,\n renderContainer,\n} from '../utility/todoRenderer.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the week page content.\n *\n * @param {HTMLElement} content - The parent element where the week page will be rendered.\n */\nexport default function weekPageLoader(content) {\n clearPage(content);\n let existingData;\n\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n const todoManager = new TodoManager();\n const todoDueThisWeek = todoManager.getTodosDueThisWeek(existingData);\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(todoDueThisWeek);\n section.appendChild(todoContainer);\n\n const title = document.querySelector('.title');\n const titleForToday = 'Due This Week';\n title.textContent = title.textContent + ' ' + titleForToday;\n}\n","import {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport {\n handleStorageError,\n renderContainer,\n} from '../utility/todoRenderer.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the projects page content.\n *\n * @param {HTMLElement} content - The parent element where the projects page will be rendered.\n */\nexport default function projectsPageLoader(content, selectedProjectName) {\n clearPage(content);\n let existingData;\n\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n\n // Filter todos for the selected project\n const todoManager = new TodoManager();\n const projectData = todoManager.getTodosForProject(\n existingData,\n selectedProjectName\n );\n\n // Render todos for the selected project\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(projectData);\n section.appendChild(todoContainer);\n\n const title = document.querySelector('.title');\n const titleOfProject = 'In ' + selectedProjectName;\n title.textContent = title.textContent + ' ' + titleOfProject;\n}\n","/**\n * @file This file is the entry point of the application and\n * contains the main logic for loading different pages and handling navigation.\n * It imports CSS stylesheets, functionality modules, and images.\n * It also sets up event listeners for tab navigation, for the \"New Todo\" button and\n * updates the active state of navigation buttons.\n * @module index\n */\n// Importing global, main, and dark mode CSS stylesheets\nimport './styles/global.css';\nimport './styles/main.css';\nimport './styles/dark.css';\n\n// Importing functionality modules\nimport darkModeToggler from './modules/utility/darkMode.js';\nimport mobileNavigationToggling from './modules/utility/mobileNavigation.js';\nimport { dialogHandler } from './modules/utility/dialogHandler.js';\nimport { handleDialogError } from './modules/utility/todoRenderer.js';\n\n// Importing page loader functions\nimport homePageLoader from './modules/pageLoaders/homePageLoader.js';\nimport todayPageLoader from './modules/pageLoaders/todayPageLoader.js';\nimport weekPageLoader from './modules/pageLoaders/weekPageLoader.js';\nimport projectsPageLoader from './modules/pageLoaders/projectsPageLoader.js';\nimport { ProjectManager } from './modules/entities/project.js';\n\n// Global variables setup\n// Navigation button IDs\nconst navigationButtons = ['home', 'today', 'week', 'projects'];\nconst newTodoButton = document.getElementById('newTodoButton');\nconst content = document.getElementById('content');\n\n// Activate dark mode toggle functionality\ndarkModeToggler();\n\n// Set up mobile navigation toggle functionality\nmobileNavigationToggling();\n\n// Load the initial home page content\nhomePageLoader(content);\n\n// Add projects in navigation bar\nconst projectManager = new ProjectManager();\nprojectManager.displayProjectsInNavigationBar();\n\n/**\n * Set up click event listeners for tab navigation in the header.\n * This allows switching between different pages\n * (home, todos for today, todos for this week, projects) and\n * ensures the appropriate content is loaded and displayed.\n */\ntry {\n navigationButtons.forEach((navigationButton) => {\n const button = document.getElementById(navigationButton);\n\n button.addEventListener('click', () => {\n buttonEventHandler();\n });\n\n const buttonEventHandler = () => {\n switch (navigationButton) {\n case 'home':\n homePageLoader(content);\n break;\n case 'today':\n todayPageLoader(content);\n break;\n case 'week':\n weekPageLoader(content);\n break;\n default:\n homePageLoader(content); // Default page if page is not specified\n }\n updateNavigationActiveState(navigationButton);\n };\n\n button.removeEventListener('click', () => {\n buttonEventHandler();\n });\n });\n} catch (error) {\n console.error(\n 'Error setting up event listeners for tab navigation: ',\n error\n );\n}\n\n/**\n * Handles the click event for dropdown buttons for Projects\n */\ntry {\n // Add event listeners to Project dropdown items\n const dropdown = document.getElementById('projects');\n dropdown.addEventListener('click', (event) => {\n dropdownButtonEventHandler(event);\n });\n const dropdownButtonEventHandler = (event) => {\n // Check if the clicked element is a dropdown item\n if (event.target.classList.contains('cs-drop-link')) {\n // Prevent default behavior of links\n event.preventDefault();\n\n // Get the text content of the clicked item\n const selectedProjectName = event.target.textContent.trim();\n\n // Pass the selected project name to the projectsPageLoader function\n projectsPageLoader(content, selectedProjectName);\n }\n };\n dropdown.removeEventListener('click', () => {\n dropdownButtonEventHandler();\n });\n} catch (error) {\n console.error('Error handling dropdown buttons: ', error);\n}\n\n/**\n * Handles the click event for the \"New Todo\" button and opens a dialog.\n */\ntry {\n const handleNewTodoButtonClick = async () => {\n await dialogHandler(newTodoButton, 'newTodoButton');\n };\n newTodoButton.addEventListener('click', () => {\n handleNewTodoButtonClick();\n });\n newTodoButton.removeEventListener('click', () => {\n handleNewTodoButtonClick();\n });\n} catch (error) {\n handleDialogError(error);\n}\n\n/**\n * Updates the active state of navigation buttons and removes active state in mobile navigation.\n *\n * @param {string} activeButtonId - The ID of the navigation button to be marked as active.\n */\nexport function updateNavigationActiveState(activeButtonId) {\n // Selecting elements related to mobile navigation\n const body = document.querySelector('body');\n const navbarMenu = document.querySelector('#cs-navigation');\n const hamburgerMenu = document.querySelector('#cs-navigation .cs-toggle');\n\n try {\n navigationButtons.forEach((buttonId) => {\n const buttonElement = document.getElementById(buttonId);\n if (buttonElement) {\n if (buttonId === activeButtonId) {\n buttonElement.classList.add('cs-active');\n\n // Close mobile navigation menu when a navigation button is activated\n hamburgerMenu.classList.remove('cs-active');\n navbarMenu.classList.remove('cs-active');\n body.classList.remove('cs-open');\n } else {\n buttonElement.classList.remove('cs-active');\n }\n }\n });\n } catch (error) {\n console.error('Error updating navigation state: ', error);\n }\n}\n","//\n// The Dark Mode System\n//\n\nexport default function darkModeToggler() {\n // helper functions to toggle dark mode\n function enableDarkMode() {\n document.body.classList.add('dark-mode');\n localStorage.setItem('theme', 'dark');\n }\n function disableDarkMode() {\n document.body.classList.remove('dark-mode');\n localStorage.setItem('theme', 'light');\n }\n\n // determines a new users dark mode preferences\n function detectColorScheme() {\n // default to the light theme\n let theme = 'light';\n\n // check localStorage for a saved 'theme' variable. if it's there, the user has visited before, so apply the necessary theme choices\n if (localStorage.getItem('theme')) {\n theme = localStorage.getItem('theme');\n }\n // if it's not there, check to see if the user has applied dark mode preferences themselves in the browser\n else if (\n window.matchMedia &&\n window.matchMedia('(prefers-color-scheme: dark)').matches\n ) {\n theme = 'dark';\n }\n\n // if there is no preference set, the default of light will be used. apply accordingly\n theme === 'dark' ? enableDarkMode() : disableDarkMode();\n }\n\n // run on page load\n detectColorScheme();\n\n // add event listener to the dark mode button toggle\n const darkModeButton = document.getElementById('dark-mode-toggle');\n darkModeButton.addEventListener('click', (event) => {\n event.preventDefault();\n darkModeButtonHandler();\n });\n const darkModeButtonHandler = () => {\n // on click, check localStorage for the dark mode value, use to apply the opposite of what's saved\n localStorage.getItem('theme') === 'light'\n ? enableDarkMode()\n : disableDarkMode();\n };\n darkModeButton.removeEventListener('click', () => {\n darkModeButtonHandler();\n });\n}\n"],"names":["module","exports","entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","Object","freeze","seal","create","apply","construct","Reflect","x","fun","thisValue","args","Func","arrayForEach","unapply","Array","prototype","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringToString","toString","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","func","TypeError","_len2","arguments","length","_key2","thisArg","_len","_key","addToSet","set","array","transformCaseFunc","undefined","l","element","lcElement","cleanArray","index","clone","object","newObject","property","value","isArray","constructor","lookupGetter","prop","desc","get","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","text","html","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","EXPRESSIONS","__proto__","getGlobal","window","createDOMPurify","DOMPurify","root","version","removed","document","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","trustedTypes","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","createHTMLDocument","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","createHTML","createScriptURL","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","scriptUrl","_","console","warn","_createTrustedTypesPolicy","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_forceRemove","node","parentNode","removeChild","remove","_removeAttribute","name","attribute","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","elm","nodeName","textContent","attributes","namespaceURI","hasChildNodes","tagName","allowedTags","firstElementChild","_isBasicCustomElement","i","parent","parentTagName","Boolean","_checkValidNamespace","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","attr","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","hookFunction","removeHook","removeHooks","removeAllHooks","factory","assign","target","_i","_loop_1","source","keys","key","_a","args_1","CSbody","querySelector","CSnavbarMenu","CShamburgerMenu","HOOKS","defaults","_disable","allowInput","allowInvalidPreload","altFormat","altInput","altInputClass","animate","navigator","userAgent","ariaDateFormat","autoFillDefaultTime","clickOpens","closeOnSelect","conjunction","dateFormat","defaultHour","defaultMinute","defaultSeconds","disable","disableMobile","enableSeconds","enableTime","errorHandler","err","getWeek","givenDate","date","Date","getTime","setHours","setDate","getDate","getDay","week1","getFullYear","Math","round","hourIncrement","ignoredFocusElements","inline","locale","minuteIncrement","mode","monthSelectorType","nextArrow","noCalendar","now","onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition","plugins","position","positionElement","prevArrow","shorthandCurrentMonth","showMonths","static","time_24hr","weekNumbers","wrap","english","weekdays","shorthand","longhand","months","daysInMonth","firstDayOfWeek","ordinal","nth","s","rangeSeparator","weekAbbreviation","scrollTitle","toggleTitle","amPM","yearAriaLabel","monthAriaLabel","hourAriaLabel","minuteAriaLabel","pad","number","slice","bool","debounce","fn","wait","t","_this","this","clearTimeout","setTimeout","arrayify","obj","toggleClass","elem","className","classList","add","e","clearNode","findParent","condition","createNumberInput","inputClassName","opts","wrapper","numInput","arrowUp","arrowDown","type","pattern","getEventTarget","event","composedPath","error","doNothing","monthToStr","monthNumber","revFormat","D","F","dateObj","monthName","setMonth","G","hour","getHours","parseFloat","H","J","day","K","M","shortMonth","S","seconds","setSeconds","U","unixSeconds","W","weekNum","weekNumber","parseInt","Y","year","setFullYear","Z","ISODate","d","h","minutes","setMinutes","j","m","month","n","u","unixMillSeconds","w","y","tokenRegex","formats","toISOString","options","getMonth","getSeconds","getMinutes","substring","createDateFormatter","_b","config","_c","l10n","_d","isMobile","frmt","overrideLocale","formatDate","split","map","c","arr","join","createDateParser","givenFormat","timeless","customLocale","parsedDate","dateOrig","toFixed","format","datestr","parseDate","matched","ops","matchIndex","regexStr","token","isBackSlash","escaped","exec","val","isNaN","Error","compareDates","date1","date2","isBetween","ts","ts1","ts2","min","max","calculateSecondsSinceMidnight","hours","parseSeconds","secondsSinceMidnight","floor","duration","DAY","getDefaultHours","minDate","minHour","minMinutes","minSeconds","maxDate","maxHr","maxMinutes","__assign","p","__spreadArrays","il","r","k","a","jl","DEBOUNCED_CHANGE_MS","FlatpickrInstance","instanceConfig","self","flatpickr","defaultConfig","getClosestActiveElement","calendarContainer","getRootNode","activeElement","bindToInstance","bind","setCalendarWidth","requestAnimationFrame","style","visibility","display","daysContainer","daysWidth","days","offsetWidth","width","weekWrapper","removeProperty","updateTime","selectedDates","defaultDate","getMilliseconds","latestSelectedDateObj","preventDefault","isKeyDown","eventTarget","input","step","curValue","newValue","delta","which","isHourElem","hourElement","isMinuteElem","minuteElement","incrementNumInput","abs","timeWrapper","prevValue","_input","setHoursFromInputs","updateValue","_debouncedChange","secondElement","limitMinHours","minTime","minDateHasTime","limitMaxHours","maxTime","maxDateHasTime","minBound","maxBound","currentTime","result","setHoursFromDate","onYearInput","changeYear","handler","ev","el","addEventListener","_handlers","removeEventListener","triggerChange","triggerEvent","jumpToDate","jumpDate","jumpTo","oldYear","currentYear","oldMonth","currentMonth","message","buildMonthSwitch","redraw","timeIncrement","contains","inputElem","createEvent","dispatchEvent","createDay","_dayNumber","dateIsEnabled","isEnabled","dayElement","$i","todayDateElem","tabIndex","isDateSelected","selectedDateElem","isDateInRange","insertAdjacentHTML","focusOnDayElem","targetNode","focus","onMouseOver","getFirstAvailableDay","startMonth","endMonth","children","startIndex","endIndex","focusOnDay","current","offset","dayFocused","isInView","startElem","givenMonth","loopDelta","numMonthDays","changeMonth","getNextAvailableDay","buildMonthDays","firstOfMonth","prevMonthDays","utils","getDaysInMonth","isMultiMonth","prevMonthDayClass","nextMonthDayClass","dayNumber","dayIndex","dayNum","dayContainer","buildDays","frag","shouldBuildMonth","monthsDropdownContainer","selected","buildMonth","monthElement","container","monthNavFragment","selectedMonth","yearInput","tabindex","yearElement","disabled","buildMonths","monthNav","prevMonthNav","yearElements","monthElements","nextMonthNav","buildWeekdays","weekdayContainer","updateWeekdays","splice","isOffset","_hidePrevMonthArrow","_hideNextMonthArrow","updateNavigationCurrentMonth","isCalendarElem","documentClick","isOpen","eventTarget_1","isCalendarElement","lostFocus","path","relatedTarget","isIgnored","some","timeContainer","close","clear","newYear","newYearNum","isNewYear","dateToCheck","enable","parsed","to","onBlur","isInput","valueChanged","trimEnd","getDateStr","allowKeydown","allowInlineKeydown","keyCode","blur","open","isTimeObj","focusAndClose","selectDate","delta_1","ctrlKey","stopPropagation","currentYearElement","elems","concat","pluginElements","filter","shiftKey","charAt","cellClass","hoverDate","initialDate","rangeStartDate","rangeEndDate","containsDisabled","minRange","maxRange","rContainer","querySelectorAll","dayElem","timestamp","outOfRange","onResize","positionCalendar","minMaxDateSetter","inverseDateObj","getInputElem","setupLocale","l10ns","default","JSON","parse","stringify","dataset","customPositionElement","_positionElement","calendarHeight","reduce","acc","child","offsetHeight","calendarWidth","configPos","configPosVertical","configPosHorizontal","inputBounds","getBoundingClientRect","distanceFromBottom","innerHeight","bottom","showOnTop","top","pageYOffset","left","pageXOffset","isCenter","isRight","right","rightMost","centerMost","editableSheet","styleSheets","sheet","cssRules","head","getDocumentStyleSheet","bodyWidth","centerLeft","centerIndex","centerStyle","insertRule","centerBefore","msMaxTouchPoints","selectedDate","shouldChangeMonth","selectedIndex","sort","b","single","range","loadedPlugins","_bind","_setHoursFromDate","_positionCalendar","triggerChangeEvent","toInitial","mobileInput","_initialDate","_createElement","destroy","lastChild","_type","click","wasOpen","select","option","CALLBACKS","setSelectedDate","toggle","updatePositionElement","inputDate","dates","parseDateRules","rule","initEvent","specificFormat","dObj","mobileFormatStr","onMonthNavClick","isPrevMonth","isNextMonth","boolOpts","userConfig","defineProperty","_enable","timeMode","defaultDateFormat","defaultAltFormat","_minDate","_maxDate","minMaxTimeSetter","_minTime","_maxTime","pluginConf","parseConfig","placeholder","required","nextSibling","preloadedDate","setupDates","yr","__hidePrevMonthArrow","__hideNextMonthArrow","innerContainer","buildWeeks","separator","hourInput","minuteInput","military2ampm","secondInput","title","buildTime","customAppend","appendTo","build","evt","inputType","defaultValue","setupMobile","debouncedResize","ontouchstart","capture","bindEvents","isSafari","init","_flatpickr","nodeList","nodes","HTMLElement","instances","HTMLCollection","NodeList","selector","en","localize","setDefaults","jQuery","fp_incr","datePickerHandler","dueDateInput","getElementById","theme","createDiv","attributeName","attributeValue","div","createTitle","clearPage","sampleData","projects","id","todos","project","description","dueDate","priority","completed","renderContainer","projectData","todosList","list","itemData","renderItem","createList","todo","listItem","renderTodoItem","renderTodosList","item","renderContent","createListItem","getPriorityClass","renderTodoContent","checkbox","todoTitle","todoDueDate","paragraph","createParagraph","todoDetails","todoDelete","todoDetailsId","todoManager","TodoManager","checkboxHandler","todoDeleteHandler","todoDetailsHandler","deleteIcon","createDeleteIcon","handleStorageError","saveDataToLocalStorage","Promise","resolve","reject","serializedData","localStorage","setItem","getDataFromLocalStorage","getItem","currentDate","currentDayOfWeek","difference","currentDay","todosPerDay","ceil","currentTodoIndex","todosForCurrentDay","adjustDueDatesForCurrentWeek","PROJECTS_STORAGE_KEY","Project","ProjectManager","addTodoToProject","getProjectByName","removeTodoFromProject","projectName","todoId","log","find","getProjectById","projectId","existingData","selectedProject","displayProjectsInNavigationBar","projectsDropdown","dropdownList","projectItem","projectLink","projectManager","homePageLoader","section","todoContainer","Todo","todoDescription","todoPriority","todoCompleted","findTodoById","textDecoration","handleCheckBoxClick","isCompleted","updateTodoCompletion","handleDeleteButtonClick","todoToRemove","updatedData","todoIDToRemove","removeTodoFromLocalStorage","handleDetailsButtonClick","async","todoData","dialogHandler","getTodosDueToday","today","getFilteredProjects","getTodosDueThisWeek","startOfWeek","endOfWeek","startDate","endDate","getTodosForProject","filteredProjects","TodoFormHandler","handleSubmit","formData","extractFormData","newTodo","createTodoFromFormData","addTodoToExistingData","addNewTodoToList","clearForm","closeDialog","removeDialog","handleSave","updateProjectNameInManager","updatedTodoData","newData","projectIndex","todoIndex","findIndex","newProjectName","newProjectIndex","newProjectId","newProject","updateTodoProject","editDataInLocalStorage","updatedTodoInList","oldProjectName","updatedProject","existingTodo","FormData","todoList","newTodoItem","updatedTodo","todoItem","random","populateTodoForm","todoForm","elements","reset","button","newTodoButton","detailsButton","dialog","response","fetch","ok","createDialog","showModal","formButton","setupFormButton","newFormButtonEventHandler","todoFormInit","setupNewTodoDialog","detailsFormButtonEventHandler","setupDetailsDialog","dialogClose","dialogCloseEventHandler","setupDialogClose","navigationButtons","enableDarkMode","disableDarkMode","matchMedia","detectColorScheme","darkModeButton","darkModeButtonHandler","darkModeToggler","csUL","ariaExpanded","dropDowns","onClick","mobileNavigationToggling","navigationButton","buttonEventHandler","todoDueToday","todayPageLoader","todoDueThisWeek","weekPageLoader","activeButtonId","navbarMenu","hamburgerMenu","buttonId","buttonElement","updateNavigationActiveState","dropdown","dropdownButtonEventHandler","selectedProjectName","titleOfProject","projectsPageLoader","handleNewTodoButtonClick","handleDialogError"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"main.bundle.js","mappings":";yFAGiEA,EAAOC,QAG/D,WAAe,aAEtB,MAAM,QACJC,EAAO,eACPC,EAAc,SACdC,EAAQ,eACRC,EAAc,yBACdC,GACEC,OACJ,IAAI,OACFC,EAAM,KACNC,EAAI,OACJC,GACEH,QACA,MACFI,EAAK,UACLC,GACqB,oBAAZC,SAA2BA,QACjCL,IACHA,EAAS,SAAgBM,GACvB,OAAOA,CACT,GAEGL,IACHA,EAAO,SAAcK,GACnB,OAAOA,CACT,GAEGH,IACHA,EAAQ,SAAeI,EAAKC,EAAWC,GACrC,OAAOF,EAAIJ,MAAMK,EAAWC,EAC9B,GAEGL,IACHA,EAAY,SAAmBM,EAAMD,GACnC,OAAO,IAAIC,KAAQD,EACrB,GAEF,MAAME,EAAeC,EAAQC,MAAMC,UAAUC,SACvCC,EAAWJ,EAAQC,MAAMC,UAAUG,KACnCC,EAAYN,EAAQC,MAAMC,UAAUK,MACpCC,EAAoBR,EAAQS,OAAOP,UAAUQ,aAC7CC,EAAiBX,EAAQS,OAAOP,UAAUU,UAC1CC,EAAcb,EAAQ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U,CACN,CACIC,GAAI,EACJjtB,KAAM,OACNktB,MAAO,CACH,CACID,GAAI,GACJxC,MAAO,uBACP0C,QAAS,OACTC,YAAa,+BACbC,QAAS,GACTC,SAAU,OACVC,WAAW,GAEf,CACIN,GAAI,GACJxC,MAAO,uBACP0C,QAAS,OACTC,YAAa,8CACbC,QAAS,GACTC,SAAU,SACVC,WAAW,KAIvB,CACIN,GAAI,EACJjtB,KAAM,WACNktB,MAAO,CACH,CACID,GAAI,GACJxC,MAAO,sBACP0C,QAAS,WACTC,YAAa,mCACbC,QAAS,GACTC,SAAU,OACVC,WAAW,GAEf,CACIN,GAAI,GACJxC,MAAO,cACP0C,QAAS,WACTC,YAAa,qCACbC,QAAS,GACTC,SAAU,MACVC,WAAW,KAIvB,CACIN,GAAI,EACJjtB,KAAM,mBACNktB,MAAO,CACH,CACID,GAAI,GACJxC,MAAO,0BACP0C,QAAS,mBACTC,YAAa,sCACbC,QAAS,GACTC,SAAU,SACVC,WAAW,GAEf,CACIN,GAAI,GACJxC,MAAO,qBACP0C,QAAS,mBACTC,YAAa,yCACbC,QAAS,GACTC,SAAU,OACVC,WAAW,KAIvB,CACIN,GAAI,EACJjtB,KAAM,gBACNktB,MAAO,CACH,CACID,GAAI,GACJxC,MAAO,cACP0C,QAAS,gBACTC,YAAa,gCACbC,QAAS,GACTC,SAAU,OACVC,WAAW,GAEf,CACIN,GAAI,GACJxC,MAAO,qBACP0C,QAAS,gBACTC,YAAa,2CACbC,QAAS,GACTC,SAAU,SACVC,WAAW,KAIvB,CACIN,GAAI,EACJjtB,KAAM,oBACNktB,MAAO,CACH,CACID,GAAI,GACJxC,MAAO,sBACP0C,QAAS,oBACTC,YAAa,yCACbC,QAAS,GACTC,SAAU,OACVC,WAAW,GAEf,CACIN,GAAI,KACJxC,MAAO,iCACP0C,QAAS,oBACTC,YAAa,iCACbC,QAAS,GACTC,SAAU,SACVC,WAAW,GAEf,CACIN,GAAI,KACJxC,MAAO,iBACP0C,QAAS,oBACT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AQD,EAC/B3O,EAAMvoB,YAAcuoB,EAAMvoB,YAAc,IAAMm3B,CAClD,CC+CYC,CAAmBt/B,GAASo/B,EAChC,CACJ,CAfiB1gC,SAAS6zB,eAAe,YAChCzS,iBAAiB,QAASqf,GAevC,CAAE,MAAOlrB,IACL/O,QAAQ+O,MAAM,oCAAqCA,GACvD,CAKA,IACI,MAAMsrB,GAA2B1G,gBACvBE,GAAc2D,GAAe,gBAAgB,EAEvDA,GAAc5c,iBAAiB,SAAS,KACpCyf,IAA0B,GAElC,CAAE,MAAOtrB,KV+CF,SAA2BA,GAC9B/O,QAAQ+O,MAAM,6BAA8BA,EAChD,CUhDIurB,CAAkBvrB,GACtB","sources":["webpack://todoornot/./node_modules/dompurify/dist/purify.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/polyfills.js","webpack://todoornot/./src/modules/utility/mobileNavigation.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/types/options.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/l10n/default.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/index.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/dom.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/formatting.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/utils/dates.js","webpack://todoornot/./node_modules/flatpickr/dist/esm/index.js","webpack://todoornot/./src/modules/utility/datePicker.js","webpack://todoornot/./src/modules/utility/elementRender.js","webpack://todoornot/./src/modules/pageData/sampleData.js","webpack://todoornot/./src/modules/utility/todoRenderer.js","webpack://todoornot/./src/modules/utility/localStorageManager.js","webpack://todoornot/./src/modules/entities/project.js","webpack://todoornot/./src/modules/pageLoaders/homePageLoader.js","webpack://todoornot/./src/modules/entities/todoItems.js","webpack://todoornot/./src/modules/utility/todoFormHandler.js","webpack://todoornot/./src/modules/utility/dialogHandler.js","webpack://todoornot/./src/modules/pageLoaders/todayPageLoader.js","webpack://todoornot/./src/modules/pageLoaders/weekPageLoader.js","webpack://todoornot/./src/modules/pageLoaders/projectsPageLoader.js","webpack://todoornot/./src/index.js","webpack://todoornot/./src/modules/utility/darkMode.js"],"sourcesContent":["/*! @license DOMPurify 3.0.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.9/LICENSE */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.DOMPurify = factory());\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.0.9';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && tagName.indexOf('-') > 0;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n","\"use strict\";\nif (typeof Object.assign !== \"function\") {\n Object.assign = function (target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!target) {\n throw TypeError(\"Cannot convert undefined or null to object\");\n }\n var _loop_1 = function (source) {\n if (source) {\n Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });\n }\n };\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var source = args_1[_a];\n _loop_1(source);\n }\n return target;\n };\n}\n","// Select DOM elements for mobile navigation\nconst CSbody = document.querySelector('body');\nconst CSnavbarMenu = document.querySelector('#cs-navigation');\nconst CShamburgerMenu = document.querySelector('#cs-navigation .cs-toggle');\n\n/**\n * Sets up event listeners for mobile navigation toggling\n */\nexport default function mobileNavigationToggling() {\n // Event listener for toggling the navigation menu when hamburger menu is clicked\n CShamburgerMenu.addEventListener('click', function () {\n CShamburgerMenu.classList.toggle('cs-active');\n CSnavbarMenu.classList.toggle('cs-active');\n CSbody.classList.toggle('cs-open');\n // Toggle aria-expanded attribute\n ariaExpanded();\n });\n\n // Function to toggle the 'aria-expanded' attribute on the navigation list\n function ariaExpanded() {\n const csUL = document.querySelector('#cs-expanded');\n const csExpanded = csUL.getAttribute('aria-expanded');\n\n // Toggle the 'aria-expanded' attribute based on its current state\n if (csExpanded === 'false') {\n csUL.setAttribute('aria-expanded', 'true');\n } else {\n csUL.setAttribute('aria-expanded', 'false');\n }\n }\n\n // Set up click event listeners for dropdown items in the mobile navigation\n const dropDowns = Array.from(\n document.querySelectorAll('#cs-navigation .cs-dropdown')\n );\n for (const item of dropDowns) {\n // Event listener for toggling dropdown visibility\n const onClick = () => {\n item.classList.toggle('cs-active');\n };\n item.addEventListener('click', onClick);\n }\n}\n","export var HOOKS = [\n \"onChange\",\n \"onClose\",\n \"onDayCreate\",\n \"onDestroy\",\n \"onKeyDown\",\n \"onMonthChange\",\n \"onOpen\",\n \"onParseConfig\",\n \"onReady\",\n \"onValueUpdate\",\n \"onYearChange\",\n \"onPreCalendarPosition\",\n];\nexport var defaults = {\n _disable: [],\n allowInput: false,\n allowInvalidPreload: false,\n altFormat: \"F j, Y\",\n altInput: false,\n altInputClass: \"form-control input\",\n animate: typeof window === \"object\" &&\n window.navigator.userAgent.indexOf(\"MSIE\") === -1,\n ariaDateFormat: \"F j, Y\",\n autoFillDefaultTime: true,\n clickOpens: true,\n closeOnSelect: true,\n conjunction: \", \",\n dateFormat: \"Y-m-d\",\n defaultHour: 12,\n defaultMinute: 0,\n defaultSeconds: 0,\n disable: [],\n disableMobile: false,\n enableSeconds: false,\n enableTime: false,\n errorHandler: function (err) {\n return typeof console !== \"undefined\" && console.warn(err);\n },\n getWeek: function (givenDate) {\n var date = new Date(givenDate.getTime());\n date.setHours(0, 0, 0, 0);\n date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));\n var week1 = new Date(date.getFullYear(), 0, 4);\n return (1 +\n Math.round(((date.getTime() - week1.getTime()) / 86400000 -\n 3 +\n ((week1.getDay() + 6) % 7)) /\n 7));\n },\n hourIncrement: 1,\n ignoredFocusElements: [],\n inline: false,\n locale: \"default\",\n minuteIncrement: 5,\n mode: \"single\",\n monthSelectorType: \"dropdown\",\n nextArrow: \"\",\n noCalendar: false,\n now: new Date(),\n onChange: [],\n onClose: [],\n onDayCreate: [],\n onDestroy: [],\n onKeyDown: [],\n onMonthChange: [],\n onOpen: [],\n onParseConfig: [],\n onReady: [],\n onValueUpdate: [],\n onYearChange: [],\n onPreCalendarPosition: [],\n plugins: [],\n position: \"auto\",\n positionElement: undefined,\n prevArrow: \"\",\n shorthandCurrentMonth: false,\n showMonths: 1,\n static: false,\n time_24hr: false,\n weekNumbers: false,\n wrap: false,\n};\n","export var english = {\n weekdays: {\n shorthand: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n longhand: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n },\n months: {\n shorthand: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n longhand: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n },\n daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n firstDayOfWeek: 0,\n ordinal: function (nth) {\n var s = nth % 100;\n if (s > 3 && s < 21)\n return \"th\";\n switch (s % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n },\n rangeSeparator: \" to \",\n weekAbbreviation: \"Wk\",\n scrollTitle: \"Scroll to increment\",\n toggleTitle: \"Click to toggle\",\n amPM: [\"AM\", \"PM\"],\n yearAriaLabel: \"Year\",\n monthAriaLabel: \"Month\",\n hourAriaLabel: \"Hour\",\n minuteAriaLabel: \"Minute\",\n time_24hr: false,\n};\nexport default english;\n","export var pad = function (number, length) {\n if (length === void 0) { length = 2; }\n return (\"000\" + number).slice(length * -1);\n};\nexport var int = function (bool) { return (bool === true ? 1 : 0); };\nexport function debounce(fn, wait) {\n var t;\n return function () {\n var _this = this;\n var args = arguments;\n clearTimeout(t);\n t = setTimeout(function () { return fn.apply(_this, args); }, wait);\n };\n}\nexport var arrayify = function (obj) {\n return obj instanceof Array ? obj : [obj];\n};\n","export function toggleClass(elem, className, bool) {\n if (bool === true)\n return elem.classList.add(className);\n elem.classList.remove(className);\n}\nexport function createElement(tag, className, content) {\n var e = window.document.createElement(tag);\n className = className || \"\";\n content = content || \"\";\n e.className = className;\n if (content !== undefined)\n e.textContent = content;\n return e;\n}\nexport function clearNode(node) {\n while (node.firstChild)\n node.removeChild(node.firstChild);\n}\nexport function findParent(node, condition) {\n if (condition(node))\n return node;\n else if (node.parentNode)\n return findParent(node.parentNode, condition);\n return undefined;\n}\nexport function createNumberInput(inputClassName, opts) {\n var wrapper = createElement(\"div\", \"numInputWrapper\"), numInput = createElement(\"input\", \"numInput \" + inputClassName), arrowUp = createElement(\"span\", \"arrowUp\"), arrowDown = createElement(\"span\", \"arrowDown\");\n if (navigator.userAgent.indexOf(\"MSIE 9.0\") === -1) {\n numInput.type = \"number\";\n }\n else {\n numInput.type = \"text\";\n numInput.pattern = \"\\\\d*\";\n }\n if (opts !== undefined)\n for (var key in opts)\n numInput.setAttribute(key, opts[key]);\n wrapper.appendChild(numInput);\n wrapper.appendChild(arrowUp);\n wrapper.appendChild(arrowDown);\n return wrapper;\n}\nexport function getEventTarget(event) {\n try {\n if (typeof event.composedPath === \"function\") {\n var path = event.composedPath();\n return path[0];\n }\n return event.target;\n }\n catch (error) {\n return event.target;\n }\n}\n","import { int, pad } from \"../utils\";\nvar doNothing = function () { return undefined; };\nexport var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? \"shorthand\" : \"longhand\"][monthNumber]; };\nexport var revFormat = {\n D: doNothing,\n F: function (dateObj, monthName, locale) {\n dateObj.setMonth(locale.months.longhand.indexOf(monthName));\n },\n G: function (dateObj, hour) {\n dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));\n },\n H: function (dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n J: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n K: function (dateObj, amPM, locale) {\n dateObj.setHours((dateObj.getHours() % 12) +\n 12 * int(new RegExp(locale.amPM[1], \"i\").test(amPM)));\n },\n M: function (dateObj, shortMonth, locale) {\n dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));\n },\n S: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },\n W: function (dateObj, weekNum, locale) {\n var weekNumber = parseInt(weekNum);\n var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);\n date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);\n return date;\n },\n Y: function (dateObj, year) {\n dateObj.setFullYear(parseFloat(year));\n },\n Z: function (_, ISODate) { return new Date(ISODate); },\n d: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n h: function (dateObj, hour) {\n dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));\n },\n i: function (dateObj, minutes) {\n dateObj.setMinutes(parseFloat(minutes));\n },\n j: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n l: doNothing,\n m: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n n: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n s: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n u: function (_, unixMillSeconds) {\n return new Date(parseFloat(unixMillSeconds));\n },\n w: doNothing,\n y: function (dateObj, year) {\n dateObj.setFullYear(2000 + parseFloat(year));\n },\n};\nexport var tokenRegex = {\n D: \"\",\n F: \"\",\n G: \"(\\\\d\\\\d|\\\\d)\",\n H: \"(\\\\d\\\\d|\\\\d)\",\n J: \"(\\\\d\\\\d|\\\\d)\\\\w+\",\n K: \"\",\n M: \"\",\n S: \"(\\\\d\\\\d|\\\\d)\",\n U: \"(.+)\",\n W: \"(\\\\d\\\\d|\\\\d)\",\n Y: \"(\\\\d{4})\",\n Z: \"(.+)\",\n d: \"(\\\\d\\\\d|\\\\d)\",\n h: \"(\\\\d\\\\d|\\\\d)\",\n i: \"(\\\\d\\\\d|\\\\d)\",\n j: \"(\\\\d\\\\d|\\\\d)\",\n l: \"\",\n m: \"(\\\\d\\\\d|\\\\d)\",\n n: \"(\\\\d\\\\d|\\\\d)\",\n s: \"(\\\\d\\\\d|\\\\d)\",\n u: \"(.+)\",\n w: \"(\\\\d\\\\d|\\\\d)\",\n y: \"(\\\\d{2})\",\n};\nexport var formats = {\n Z: function (date) { return date.toISOString(); },\n D: function (date, locale, options) {\n return locale.weekdays.shorthand[formats.w(date, locale, options)];\n },\n F: function (date, locale, options) {\n return monthToStr(formats.n(date, locale, options) - 1, false, locale);\n },\n G: function (date, locale, options) {\n return pad(formats.h(date, locale, options));\n },\n H: function (date) { return pad(date.getHours()); },\n J: function (date, locale) {\n return locale.ordinal !== undefined\n ? date.getDate() + locale.ordinal(date.getDate())\n : date.getDate();\n },\n K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },\n M: function (date, locale) {\n return monthToStr(date.getMonth(), true, locale);\n },\n S: function (date) { return pad(date.getSeconds()); },\n U: function (date) { return date.getTime() / 1000; },\n W: function (date, _, options) {\n return options.getWeek(date);\n },\n Y: function (date) { return pad(date.getFullYear(), 4); },\n d: function (date) { return pad(date.getDate()); },\n h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },\n i: function (date) { return pad(date.getMinutes()); },\n j: function (date) { return date.getDate(); },\n l: function (date, locale) {\n return locale.weekdays.longhand[date.getDay()];\n },\n m: function (date) { return pad(date.getMonth() + 1); },\n n: function (date) { return date.getMonth() + 1; },\n s: function (date) { return date.getSeconds(); },\n u: function (date) { return date.getTime(); },\n w: function (date) { return date.getDay(); },\n y: function (date) { return String(date.getFullYear()).substring(2); },\n};\n","import { tokenRegex, revFormat, formats, } from \"./formatting\";\nimport { defaults } from \"../types/options\";\nimport { english } from \"../l10n/default\";\nexport var createDateFormatter = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d;\n return function (dateObj, frmt, overrideLocale) {\n var locale = overrideLocale || l10n;\n if (config.formatDate !== undefined && !isMobile) {\n return config.formatDate(dateObj, frmt, locale);\n }\n return frmt\n .split(\"\")\n .map(function (c, i, arr) {\n return formats[c] && arr[i - 1] !== \"\\\\\"\n ? formats[c](dateObj, locale, config)\n : c !== \"\\\\\"\n ? c\n : \"\";\n })\n .join(\"\");\n };\n};\nexport var createDateParser = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;\n return function (date, givenFormat, timeless, customLocale) {\n if (date !== 0 && !date)\n return undefined;\n var locale = customLocale || l10n;\n var parsedDate;\n var dateOrig = date;\n if (date instanceof Date)\n parsedDate = new Date(date.getTime());\n else if (typeof date !== \"string\" &&\n date.toFixed !== undefined)\n parsedDate = new Date(date);\n else if (typeof date === \"string\") {\n var format = givenFormat || (config || defaults).dateFormat;\n var datestr = String(date).trim();\n if (datestr === \"today\") {\n parsedDate = new Date();\n timeless = true;\n }\n else if (config && config.parseDate) {\n parsedDate = config.parseDate(date, format);\n }\n else if (/Z$/.test(datestr) ||\n /GMT$/.test(datestr)) {\n parsedDate = new Date(date);\n }\n else {\n var matched = void 0, ops = [];\n for (var i = 0, matchIndex = 0, regexStr = \"\"; i < format.length; i++) {\n var token = format[i];\n var isBackSlash = token === \"\\\\\";\n var escaped = format[i - 1] === \"\\\\\" || isBackSlash;\n if (tokenRegex[token] && !escaped) {\n regexStr += tokenRegex[token];\n var match = new RegExp(regexStr).exec(date);\n if (match && (matched = true)) {\n ops[token !== \"Y\" ? \"push\" : \"unshift\"]({\n fn: revFormat[token],\n val: match[++matchIndex],\n });\n }\n }\n else if (!isBackSlash)\n regexStr += \".\";\n }\n parsedDate =\n !config || !config.noCalendar\n ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)\n : new Date(new Date().setHours(0, 0, 0, 0));\n ops.forEach(function (_a) {\n var fn = _a.fn, val = _a.val;\n return (parsedDate = fn(parsedDate, val, locale) || parsedDate);\n });\n parsedDate = matched ? parsedDate : undefined;\n }\n }\n if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {\n config.errorHandler(new Error(\"Invalid date provided: \" + dateOrig));\n return undefined;\n }\n if (timeless === true)\n parsedDate.setHours(0, 0, 0, 0);\n return parsedDate;\n };\n};\nexport function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n}\nexport function compareTimes(date1, date2) {\n return (3600 * (date1.getHours() - date2.getHours()) +\n 60 * (date1.getMinutes() - date2.getMinutes()) +\n date1.getSeconds() -\n date2.getSeconds());\n}\nexport var isBetween = function (ts, ts1, ts2) {\n return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);\n};\nexport var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {\n return hours * 3600 + minutes * 60 + seconds;\n};\nexport var parseSeconds = function (secondsSinceMidnight) {\n var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;\n return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];\n};\nexport var duration = {\n DAY: 86400000,\n};\nexport function getDefaultHours(config) {\n var hours = config.defaultHour;\n var minutes = config.defaultMinute;\n var seconds = config.defaultSeconds;\n if (config.minDate !== undefined) {\n var minHour = config.minDate.getHours();\n var minMinutes = config.minDate.getMinutes();\n var minSeconds = config.minDate.getSeconds();\n if (hours < minHour) {\n hours = minHour;\n }\n if (hours === minHour && minutes < minMinutes) {\n minutes = minMinutes;\n }\n if (hours === minHour && minutes === minMinutes && seconds < minSeconds)\n seconds = config.minDate.getSeconds();\n }\n if (config.maxDate !== undefined) {\n var maxHr = config.maxDate.getHours();\n var maxMinutes = config.maxDate.getMinutes();\n hours = Math.min(hours, maxHr);\n if (hours === maxHr)\n minutes = Math.min(maxMinutes, minutes);\n if (hours === maxHr && minutes === maxMinutes)\n seconds = config.maxDate.getSeconds();\n }\n return { hours: hours, minutes: minutes, seconds: seconds };\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { defaults as defaultOptions, HOOKS, } from \"./types/options\";\nimport English from \"./l10n/default\";\nimport { arrayify, debounce, int, pad } from \"./utils\";\nimport { clearNode, createElement, createNumberInput, findParent, toggleClass, getEventTarget, } from \"./utils/dom\";\nimport { compareDates, createDateParser, createDateFormatter, duration, isBetween, getDefaultHours, calculateSecondsSinceMidnight, parseSeconds, } from \"./utils/dates\";\nimport { tokenRegex, monthToStr } from \"./utils/formatting\";\nimport \"./utils/polyfills\";\nvar DEBOUNCED_CHANGE_MS = 300;\nfunction FlatpickrInstance(element, instanceConfig) {\n var self = {\n config: __assign(__assign({}, defaultOptions), flatpickr.defaultConfig),\n l10n: English,\n };\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n self._handlers = [];\n self.pluginElements = [];\n self.loadedPlugins = [];\n self._bind = bind;\n self._setHoursFromDate = setHoursFromDate;\n self._positionCalendar = positionCalendar;\n self.changeMonth = changeMonth;\n self.changeYear = changeYear;\n self.clear = clear;\n self.close = close;\n self.onMouseOver = onMouseOver;\n self._createElement = createElement;\n self.createDay = createDay;\n self.destroy = destroy;\n self.isEnabled = isEnabled;\n self.jumpToDate = jumpToDate;\n self.updateValue = updateValue;\n self.open = open;\n self.redraw = redraw;\n self.set = set;\n self.setDate = setDate;\n self.toggle = toggle;\n function setupHelperFunctions() {\n self.utils = {\n getDaysInMonth: function (month, yr) {\n if (month === void 0) { month = self.currentMonth; }\n if (yr === void 0) { yr = self.currentYear; }\n if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))\n return 29;\n return self.l10n.daysInMonth[month];\n },\n };\n }\n function init() {\n self.element = self.input = element;\n self.isOpen = false;\n parseConfig();\n setupLocale();\n setupInputs();\n setupDates();\n setupHelperFunctions();\n if (!self.isMobile)\n build();\n bindEvents();\n if (self.selectedDates.length || self.config.noCalendar) {\n if (self.config.enableTime) {\n setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined);\n }\n updateValue(false);\n }\n setCalendarWidth();\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n if (!self.isMobile && isSafari) {\n positionCalendar();\n }\n triggerEvent(\"onReady\");\n }\n function getClosestActiveElement() {\n var _a;\n return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode())\n .activeElement || document.activeElement);\n }\n function bindToInstance(fn) {\n return fn.bind(self);\n }\n function setCalendarWidth() {\n var config = self.config;\n if (config.weekNumbers === false && config.showMonths === 1) {\n return;\n }\n else if (config.noCalendar !== true) {\n window.requestAnimationFrame(function () {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.style.visibility = \"hidden\";\n self.calendarContainer.style.display = \"block\";\n }\n if (self.daysContainer !== undefined) {\n var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;\n self.daysContainer.style.width = daysWidth + \"px\";\n self.calendarContainer.style.width =\n daysWidth +\n (self.weekWrapper !== undefined\n ? self.weekWrapper.offsetWidth\n : 0) +\n \"px\";\n self.calendarContainer.style.removeProperty(\"visibility\");\n self.calendarContainer.style.removeProperty(\"display\");\n }\n });\n }\n }\n function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate === undefined ||\n compareDates(new Date(), self.config.minDate) >= 0\n ? new Date()\n : new Date(self.config.minDate.getTime());\n var defaults = getDefaultHours(self.config);\n defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());\n self.selectedDates = [defaultDate];\n self.latestSelectedDateObj = defaultDate;\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }\n function ampm2military(hour, amPM) {\n return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);\n }\n function military2ampm(hour) {\n switch (hour % 24) {\n case 0:\n case 12:\n return 12;\n default:\n return hour % 12;\n }\n }\n function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (self.config.maxTime !== undefined &&\n self.config.minTime !== undefined &&\n self.config.minTime > self.config.maxTime) {\n var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds());\n var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds());\n var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds);\n if (currentTime > maxBound && currentTime < minBound) {\n var result = parseSeconds(minBound);\n hours = result[0];\n minutes = result[1];\n seconds = result[2];\n }\n }\n else {\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours() && minutes < minTime.getMinutes())\n minutes = minTime.getMinutes();\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n }\n setHours(hours, minutes, seconds);\n }\n function setHoursFromDate(dateObj) {\n var date = dateObj || self.latestSelectedDateObj;\n if (date && date instanceof Date) {\n setHours(date.getHours(), date.getMinutes(), date.getSeconds());\n }\n }\n function setHours(hours, minutes, seconds) {\n if (self.latestSelectedDateObj !== undefined) {\n self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);\n }\n if (!self.hourElement || !self.minuteElement || self.isMobile)\n return;\n self.hourElement.value = pad(!self.config.time_24hr\n ? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)\n : hours);\n self.minuteElement.value = pad(minutes);\n if (self.amPM !== undefined)\n self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];\n if (self.secondElement !== undefined)\n self.secondElement.value = pad(seconds);\n }\n function onYearInput(event) {\n var eventTarget = getEventTarget(event);\n var year = parseInt(eventTarget.value) + (event.delta || 0);\n if (year / 1000 > 1 ||\n (event.key === \"Enter\" && !/[^\\d]/.test(year.toString()))) {\n changeYear(year);\n }\n }\n function bind(element, event, handler, options) {\n if (event instanceof Array)\n return event.forEach(function (ev) { return bind(element, ev, handler, options); });\n if (element instanceof Array)\n return element.forEach(function (el) { return bind(el, event, handler, options); });\n element.addEventListener(event, handler, options);\n self._handlers.push({\n remove: function () { return element.removeEventListener(event, handler, options); },\n });\n }\n function triggerChange() {\n triggerEvent(\"onChange\");\n }\n function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(self._input, \"keydown\", onKeyDown);\n if (self.calendarContainer !== undefined) {\n bind(self.calendarContainer, \"keydown\", onKeyDown);\n }\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n });\n }\n }\n if (self.config.allowInput) {\n bind(self._input, \"blur\", onBlur);\n }\n }\n function jumpToDate(jumpDate, triggerChange) {\n var jumpTo = jumpDate !== undefined\n ? self.parseDate(jumpDate)\n : self.latestSelectedDateObj ||\n (self.config.minDate && self.config.minDate > self.now\n ? self.config.minDate\n : self.config.maxDate && self.config.maxDate < self.now\n ? self.config.maxDate\n : self.now);\n var oldYear = self.currentYear;\n var oldMonth = self.currentMonth;\n try {\n if (jumpTo !== undefined) {\n self.currentYear = jumpTo.getFullYear();\n self.currentMonth = jumpTo.getMonth();\n }\n }\n catch (e) {\n e.message = \"Invalid date supplied: \" + jumpTo;\n self.config.errorHandler(e);\n }\n if (triggerChange && self.currentYear !== oldYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n if (triggerChange &&\n (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {\n triggerEvent(\"onMonthChange\");\n }\n self.redraw();\n }\n function timeIncrement(e) {\n var eventTarget = getEventTarget(e);\n if (~eventTarget.className.indexOf(\"arrow\"))\n incrementNumInput(e, eventTarget.classList.contains(\"arrowUp\") ? 1 : -1);\n }\n function incrementNumInput(e, delta, inputElem) {\n var target = e && getEventTarget(e);\n var input = inputElem ||\n (target && target.parentNode && target.parentNode.firstChild);\n var event = createEvent(\"increment\");\n event.delta = delta;\n input && input.dispatchEvent(event);\n }\n function build() {\n var fragment = window.document.createDocumentFragment();\n self.calendarContainer = createElement(\"div\", \"flatpickr-calendar\");\n self.calendarContainer.tabIndex = -1;\n if (!self.config.noCalendar) {\n fragment.appendChild(buildMonthNav());\n self.innerContainer = createElement(\"div\", \"flatpickr-innerContainer\");\n if (self.config.weekNumbers) {\n var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;\n self.innerContainer.appendChild(weekWrapper);\n self.weekNumbers = weekNumbers;\n self.weekWrapper = weekWrapper;\n }\n self.rContainer = createElement(\"div\", \"flatpickr-rContainer\");\n self.rContainer.appendChild(buildWeekdays());\n if (!self.daysContainer) {\n self.daysContainer = createElement(\"div\", \"flatpickr-days\");\n self.daysContainer.tabIndex = -1;\n }\n buildDays();\n self.rContainer.appendChild(self.daysContainer);\n self.innerContainer.appendChild(self.rContainer);\n fragment.appendChild(self.innerContainer);\n }\n if (self.config.enableTime) {\n fragment.appendChild(buildTime());\n }\n toggleClass(self.calendarContainer, \"rangeMode\", self.config.mode === \"range\");\n toggleClass(self.calendarContainer, \"animate\", self.config.animate === true);\n toggleClass(self.calendarContainer, \"multiMonth\", self.config.showMonths > 1);\n self.calendarContainer.appendChild(fragment);\n var customAppend = self.config.appendTo !== undefined &&\n self.config.appendTo.nodeType !== undefined;\n if (self.config.inline || self.config.static) {\n self.calendarContainer.classList.add(self.config.inline ? \"inline\" : \"static\");\n if (self.config.inline) {\n if (!customAppend && self.element.parentNode)\n self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);\n else if (self.config.appendTo !== undefined)\n self.config.appendTo.appendChild(self.calendarContainer);\n }\n if (self.config.static) {\n var wrapper = createElement(\"div\", \"flatpickr-wrapper\");\n if (self.element.parentNode)\n self.element.parentNode.insertBefore(wrapper, self.element);\n wrapper.appendChild(self.element);\n if (self.altInput)\n wrapper.appendChild(self.altInput);\n wrapper.appendChild(self.calendarContainer);\n }\n }\n if (!self.config.static && !self.config.inline)\n (self.config.appendTo !== undefined\n ? self.config.appendTo\n : window.document.body).appendChild(self.calendarContainer);\n }\n function createDay(className, date, _dayNumber, i) {\n var dateIsEnabled = isEnabled(date, true), dayElement = createElement(\"span\", className, date.getDate().toString());\n dayElement.dateObj = date;\n dayElement.$i = i;\n dayElement.setAttribute(\"aria-label\", self.formatDate(date, self.config.ariaDateFormat));\n if (className.indexOf(\"hidden\") === -1 &&\n compareDates(date, self.now) === 0) {\n self.todayDateElem = dayElement;\n dayElement.classList.add(\"today\");\n dayElement.setAttribute(\"aria-current\", \"date\");\n }\n if (dateIsEnabled) {\n dayElement.tabIndex = -1;\n if (isDateSelected(date)) {\n dayElement.classList.add(\"selected\");\n self.selectedDateElem = dayElement;\n if (self.config.mode === \"range\") {\n toggleClass(dayElement, \"startRange\", self.selectedDates[0] &&\n compareDates(date, self.selectedDates[0], true) === 0);\n toggleClass(dayElement, \"endRange\", self.selectedDates[1] &&\n compareDates(date, self.selectedDates[1], true) === 0);\n if (className === \"nextMonthDay\")\n dayElement.classList.add(\"inRange\");\n }\n }\n }\n else {\n dayElement.classList.add(\"flatpickr-disabled\");\n }\n if (self.config.mode === \"range\") {\n if (isDateInRange(date) && !isDateSelected(date))\n dayElement.classList.add(\"inRange\");\n }\n if (self.weekNumbers &&\n self.config.showMonths === 1 &&\n className !== \"prevMonthDay\" &&\n i % 7 === 6) {\n self.weekNumbers.insertAdjacentHTML(\"beforeend\", \"\" + self.config.getWeek(date) + \"\");\n }\n triggerEvent(\"onDayCreate\", dayElement);\n return dayElement;\n }\n function focusOnDayElem(targetNode) {\n targetNode.focus();\n if (self.config.mode === \"range\")\n onMouseOver(targetNode);\n }\n function getFirstAvailableDay(delta) {\n var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n for (var m = startMonth; m != endMonth; m += delta) {\n var month = self.daysContainer.children[m];\n var startIndex = delta > 0 ? 0 : month.children.length - 1;\n var endIndex = delta > 0 ? month.children.length : -1;\n for (var i = startIndex; i != endIndex; i += delta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 && isEnabled(c.dateObj))\n return c;\n }\n }\n return undefined;\n }\n function getNextAvailableDay(current, delta) {\n var givenMonth = current.className.indexOf(\"Month\") === -1\n ? current.dateObj.getMonth()\n : self.currentMonth;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n var loopDelta = delta > 0 ? 1 : -1;\n for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {\n var month = self.daysContainer.children[m];\n var startIndex = givenMonth - self.currentMonth === m\n ? current.$i + delta\n : delta < 0\n ? month.children.length - 1\n : 0;\n var numMonthDays = month.children.length;\n for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 &&\n isEnabled(c.dateObj) &&\n Math.abs(current.$i - i) >= Math.abs(delta))\n return focusOnDayElem(c);\n }\n }\n self.changeMonth(loopDelta);\n focusOnDay(getFirstAvailableDay(loopDelta), 0);\n return undefined;\n }\n function focusOnDay(current, offset) {\n var activeElement = getClosestActiveElement();\n var dayFocused = isInView(activeElement || document.body);\n var startElem = current !== undefined\n ? current\n : dayFocused\n ? activeElement\n : self.selectedDateElem !== undefined && isInView(self.selectedDateElem)\n ? self.selectedDateElem\n : self.todayDateElem !== undefined && isInView(self.todayDateElem)\n ? self.todayDateElem\n : getFirstAvailableDay(offset > 0 ? 1 : -1);\n if (startElem === undefined) {\n self._input.focus();\n }\n else if (!dayFocused) {\n focusOnDayElem(startElem);\n }\n else {\n getNextAvailableDay(startElem, offset);\n }\n }\n function buildMonthDays(year, month) {\n var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;\n var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year);\n var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? \"prevMonthDay hidden\" : \"prevMonthDay\", nextMonthDayClass = isMultiMonth ? \"nextMonthDay hidden\" : \"nextMonthDay\";\n var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;\n for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day \" + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));\n }\n for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day\", new Date(year, month, dayNumber), dayNumber, dayIndex));\n }\n for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&\n (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {\n days.appendChild(createDay(\"flatpickr-day \" + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));\n }\n var dayContainer = createElement(\"div\", \"dayContainer\");\n dayContainer.appendChild(days);\n return dayContainer;\n }\n function buildDays() {\n if (self.daysContainer === undefined) {\n return;\n }\n clearNode(self.daysContainer);\n if (self.weekNumbers)\n clearNode(self.weekNumbers);\n var frag = document.createDocumentFragment();\n for (var i = 0; i < self.config.showMonths; i++) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));\n }\n self.daysContainer.appendChild(frag);\n self.days = self.daysContainer.firstChild;\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n onMouseOver();\n }\n }\n function buildMonthSwitch() {\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType !== \"dropdown\")\n return;\n var shouldBuildMonth = function (month) {\n if (self.config.minDate !== undefined &&\n self.currentYear === self.config.minDate.getFullYear() &&\n month < self.config.minDate.getMonth()) {\n return false;\n }\n return !(self.config.maxDate !== undefined &&\n self.currentYear === self.config.maxDate.getFullYear() &&\n month > self.config.maxDate.getMonth());\n };\n self.monthsDropdownContainer.tabIndex = -1;\n self.monthsDropdownContainer.innerHTML = \"\";\n for (var i = 0; i < 12; i++) {\n if (!shouldBuildMonth(i))\n continue;\n var month = createElement(\"option\", \"flatpickr-monthDropdown-month\");\n month.value = new Date(self.currentYear, i).getMonth().toString();\n month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);\n month.tabIndex = -1;\n if (self.currentMonth === i) {\n month.selected = true;\n }\n self.monthsDropdownContainer.appendChild(month);\n }\n }\n function buildMonth() {\n var container = createElement(\"div\", \"flatpickr-month\");\n var monthNavFragment = window.document.createDocumentFragment();\n var monthElement;\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n monthElement = createElement(\"span\", \"cur-month\");\n }\n else {\n self.monthsDropdownContainer = createElement(\"select\", \"flatpickr-monthDropdown-months\");\n self.monthsDropdownContainer.setAttribute(\"aria-label\", self.l10n.monthAriaLabel);\n bind(self.monthsDropdownContainer, \"change\", function (e) {\n var target = getEventTarget(e);\n var selectedMonth = parseInt(target.value, 10);\n self.changeMonth(selectedMonth - self.currentMonth);\n triggerEvent(\"onMonthChange\");\n });\n buildMonthSwitch();\n monthElement = self.monthsDropdownContainer;\n }\n var yearInput = createNumberInput(\"cur-year\", { tabindex: \"-1\" });\n var yearElement = yearInput.getElementsByTagName(\"input\")[0];\n yearElement.setAttribute(\"aria-label\", self.l10n.yearAriaLabel);\n if (self.config.minDate) {\n yearElement.setAttribute(\"min\", self.config.minDate.getFullYear().toString());\n }\n if (self.config.maxDate) {\n yearElement.setAttribute(\"max\", self.config.maxDate.getFullYear().toString());\n yearElement.disabled =\n !!self.config.minDate &&\n self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();\n }\n var currentMonth = createElement(\"div\", \"flatpickr-current-month\");\n currentMonth.appendChild(monthElement);\n currentMonth.appendChild(yearInput);\n monthNavFragment.appendChild(currentMonth);\n container.appendChild(monthNavFragment);\n return {\n container: container,\n yearElement: yearElement,\n monthElement: monthElement,\n };\n }\n function buildMonths() {\n clearNode(self.monthNav);\n self.monthNav.appendChild(self.prevMonthNav);\n if (self.config.showMonths) {\n self.yearElements = [];\n self.monthElements = [];\n }\n for (var m = self.config.showMonths; m--;) {\n var month = buildMonth();\n self.yearElements.push(month.yearElement);\n self.monthElements.push(month.monthElement);\n self.monthNav.appendChild(month.container);\n }\n self.monthNav.appendChild(self.nextMonthNav);\n }\n function buildMonthNav() {\n self.monthNav = createElement(\"div\", \"flatpickr-months\");\n self.yearElements = [];\n self.monthElements = [];\n self.prevMonthNav = createElement(\"span\", \"flatpickr-prev-month\");\n self.prevMonthNav.innerHTML = self.config.prevArrow;\n self.nextMonthNav = createElement(\"span\", \"flatpickr-next-month\");\n self.nextMonthNav.innerHTML = self.config.nextArrow;\n buildMonths();\n Object.defineProperty(self, \"_hidePrevMonthArrow\", {\n get: function () { return self.__hidePrevMonthArrow; },\n set: function (bool) {\n if (self.__hidePrevMonthArrow !== bool) {\n toggleClass(self.prevMonthNav, \"flatpickr-disabled\", bool);\n self.__hidePrevMonthArrow = bool;\n }\n },\n });\n Object.defineProperty(self, \"_hideNextMonthArrow\", {\n get: function () { return self.__hideNextMonthArrow; },\n set: function (bool) {\n if (self.__hideNextMonthArrow !== bool) {\n toggleClass(self.nextMonthNav, \"flatpickr-disabled\", bool);\n self.__hideNextMonthArrow = bool;\n }\n },\n });\n self.currentYearElement = self.yearElements[0];\n updateNavigationCurrentMonth();\n return self.monthNav;\n }\n function buildTime() {\n self.calendarContainer.classList.add(\"hasTime\");\n if (self.config.noCalendar)\n self.calendarContainer.classList.add(\"noCalendar\");\n var defaults = getDefaultHours(self.config);\n self.timeContainer = createElement(\"div\", \"flatpickr-time\");\n self.timeContainer.tabIndex = -1;\n var separator = createElement(\"span\", \"flatpickr-time-separator\", \":\");\n var hourInput = createNumberInput(\"flatpickr-hour\", {\n \"aria-label\": self.l10n.hourAriaLabel,\n });\n self.hourElement = hourInput.getElementsByTagName(\"input\")[0];\n var minuteInput = createNumberInput(\"flatpickr-minute\", {\n \"aria-label\": self.l10n.minuteAriaLabel,\n });\n self.minuteElement = minuteInput.getElementsByTagName(\"input\")[0];\n self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;\n self.hourElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getHours()\n : self.config.time_24hr\n ? defaults.hours\n : military2ampm(defaults.hours));\n self.minuteElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getMinutes()\n : defaults.minutes);\n self.hourElement.setAttribute(\"step\", self.config.hourIncrement.toString());\n self.minuteElement.setAttribute(\"step\", self.config.minuteIncrement.toString());\n self.hourElement.setAttribute(\"min\", self.config.time_24hr ? \"0\" : \"1\");\n self.hourElement.setAttribute(\"max\", self.config.time_24hr ? \"23\" : \"12\");\n self.hourElement.setAttribute(\"maxlength\", \"2\");\n self.minuteElement.setAttribute(\"min\", \"0\");\n self.minuteElement.setAttribute(\"max\", \"59\");\n self.minuteElement.setAttribute(\"maxlength\", \"2\");\n self.timeContainer.appendChild(hourInput);\n self.timeContainer.appendChild(separator);\n self.timeContainer.appendChild(minuteInput);\n if (self.config.time_24hr)\n self.timeContainer.classList.add(\"time24hr\");\n if (self.config.enableSeconds) {\n self.timeContainer.classList.add(\"hasSeconds\");\n var secondInput = createNumberInput(\"flatpickr-second\");\n self.secondElement = secondInput.getElementsByTagName(\"input\")[0];\n self.secondElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getSeconds()\n : defaults.seconds);\n self.secondElement.setAttribute(\"step\", self.minuteElement.getAttribute(\"step\"));\n self.secondElement.setAttribute(\"min\", \"0\");\n self.secondElement.setAttribute(\"max\", \"59\");\n self.secondElement.setAttribute(\"maxlength\", \"2\");\n self.timeContainer.appendChild(createElement(\"span\", \"flatpickr-time-separator\", \":\"));\n self.timeContainer.appendChild(secondInput);\n }\n if (!self.config.time_24hr) {\n self.amPM = createElement(\"span\", \"flatpickr-am-pm\", self.l10n.amPM[int((self.latestSelectedDateObj\n ? self.hourElement.value\n : self.config.defaultHour) > 11)]);\n self.amPM.title = self.l10n.toggleTitle;\n self.amPM.tabIndex = -1;\n self.timeContainer.appendChild(self.amPM);\n }\n return self.timeContainer;\n }\n function buildWeekdays() {\n if (!self.weekdayContainer)\n self.weekdayContainer = createElement(\"div\", \"flatpickr-weekdays\");\n else\n clearNode(self.weekdayContainer);\n for (var i = self.config.showMonths; i--;) {\n var container = createElement(\"div\", \"flatpickr-weekdaycontainer\");\n self.weekdayContainer.appendChild(container);\n }\n updateWeekdays();\n return self.weekdayContainer;\n }\n function updateWeekdays() {\n if (!self.weekdayContainer) {\n return;\n }\n var firstDayOfWeek = self.l10n.firstDayOfWeek;\n var weekdays = __spreadArrays(self.l10n.weekdays.shorthand);\n if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {\n weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek));\n }\n for (var i = self.config.showMonths; i--;) {\n self.weekdayContainer.children[i].innerHTML = \"\\n \\n \" + weekdays.join(\"\") + \"\\n \\n \";\n }\n }\n function buildWeeks() {\n self.calendarContainer.classList.add(\"hasWeeks\");\n var weekWrapper = createElement(\"div\", \"flatpickr-weekwrapper\");\n weekWrapper.appendChild(createElement(\"span\", \"flatpickr-weekday\", self.l10n.weekAbbreviation));\n var weekNumbers = createElement(\"div\", \"flatpickr-weeks\");\n weekWrapper.appendChild(weekNumbers);\n return {\n weekWrapper: weekWrapper,\n weekNumbers: weekNumbers,\n };\n }\n function changeMonth(value, isOffset) {\n if (isOffset === void 0) { isOffset = true; }\n var delta = isOffset ? value : value - self.currentMonth;\n if ((delta < 0 && self._hidePrevMonthArrow === true) ||\n (delta > 0 && self._hideNextMonthArrow === true))\n return;\n self.currentMonth += delta;\n if (self.currentMonth < 0 || self.currentMonth > 11) {\n self.currentYear += self.currentMonth > 11 ? 1 : -1;\n self.currentMonth = (self.currentMonth + 12) % 12;\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n buildDays();\n triggerEvent(\"onMonthChange\");\n updateNavigationCurrentMonth();\n }\n function clear(triggerChangeEvent, toInitial) {\n if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }\n if (toInitial === void 0) { toInitial = true; }\n self.input.value = \"\";\n if (self.altInput !== undefined)\n self.altInput.value = \"\";\n if (self.mobileInput !== undefined)\n self.mobileInput.value = \"\";\n self.selectedDates = [];\n self.latestSelectedDateObj = undefined;\n if (toInitial === true) {\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n }\n if (self.config.enableTime === true) {\n var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n setHours(hours, minutes, seconds);\n }\n self.redraw();\n if (triggerChangeEvent)\n triggerEvent(\"onChange\");\n }\n function close() {\n self.isOpen = false;\n if (!self.isMobile) {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.classList.remove(\"open\");\n }\n if (self._input !== undefined) {\n self._input.classList.remove(\"active\");\n }\n }\n triggerEvent(\"onClose\");\n }\n function destroy() {\n if (self.config !== undefined)\n triggerEvent(\"onDestroy\");\n for (var i = self._handlers.length; i--;) {\n self._handlers[i].remove();\n }\n self._handlers = [];\n if (self.mobileInput) {\n if (self.mobileInput.parentNode)\n self.mobileInput.parentNode.removeChild(self.mobileInput);\n self.mobileInput = undefined;\n }\n else if (self.calendarContainer && self.calendarContainer.parentNode) {\n if (self.config.static && self.calendarContainer.parentNode) {\n var wrapper = self.calendarContainer.parentNode;\n wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);\n if (wrapper.parentNode) {\n while (wrapper.firstChild)\n wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);\n wrapper.parentNode.removeChild(wrapper);\n }\n }\n else\n self.calendarContainer.parentNode.removeChild(self.calendarContainer);\n }\n if (self.altInput) {\n self.input.type = \"text\";\n if (self.altInput.parentNode)\n self.altInput.parentNode.removeChild(self.altInput);\n delete self.altInput;\n }\n if (self.input) {\n self.input.type = self.input._type;\n self.input.classList.remove(\"flatpickr-input\");\n self.input.removeAttribute(\"readonly\");\n }\n [\n \"_showTimeInput\",\n \"latestSelectedDateObj\",\n \"_hideNextMonthArrow\",\n \"_hidePrevMonthArrow\",\n \"__hideNextMonthArrow\",\n \"__hidePrevMonthArrow\",\n \"isMobile\",\n \"isOpen\",\n \"selectedDateElem\",\n \"minDateHasTime\",\n \"maxDateHasTime\",\n \"days\",\n \"daysContainer\",\n \"_input\",\n \"_positionElement\",\n \"innerContainer\",\n \"rContainer\",\n \"monthNav\",\n \"todayDateElem\",\n \"calendarContainer\",\n \"weekdayContainer\",\n \"prevMonthNav\",\n \"nextMonthNav\",\n \"monthsDropdownContainer\",\n \"currentMonthElement\",\n \"currentYearElement\",\n \"navigationCurrentMonth\",\n \"selectedDateElem\",\n \"config\",\n ].forEach(function (k) {\n try {\n delete self[k];\n }\n catch (_) { }\n });\n }\n function isCalendarElem(elem) {\n return self.calendarContainer.contains(elem);\n }\n function documentClick(e) {\n if (self.isOpen && !self.config.inline) {\n var eventTarget_1 = getEventTarget(e);\n var isCalendarElement = isCalendarElem(eventTarget_1);\n var isInput = eventTarget_1 === self.input ||\n eventTarget_1 === self.altInput ||\n self.element.contains(eventTarget_1) ||\n (e.path &&\n e.path.indexOf &&\n (~e.path.indexOf(self.input) ||\n ~e.path.indexOf(self.altInput)));\n var lostFocus = !isInput &&\n !isCalendarElement &&\n !isCalendarElem(e.relatedTarget);\n var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {\n return elem.contains(eventTarget_1);\n });\n if (lostFocus && isIgnored) {\n if (self.config.allowInput) {\n self.setDate(self._input.value, false, self.config.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined &&\n self.input.value !== \"\" &&\n self.input.value !== undefined) {\n updateTime();\n }\n self.close();\n if (self.config &&\n self.config.mode === \"range\" &&\n self.selectedDates.length === 1)\n self.clear(false);\n }\n }\n }\n function changeYear(newYear) {\n if (!newYear ||\n (self.config.minDate && newYear < self.config.minDate.getFullYear()) ||\n (self.config.maxDate && newYear > self.config.maxDate.getFullYear()))\n return;\n var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;\n self.currentYear = newYearNum || self.currentYear;\n if (self.config.maxDate &&\n self.currentYear === self.config.maxDate.getFullYear()) {\n self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);\n }\n else if (self.config.minDate &&\n self.currentYear === self.config.minDate.getFullYear()) {\n self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);\n }\n if (isNewYear) {\n self.redraw();\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n }\n function isEnabled(date, timeless) {\n var _a;\n if (timeless === void 0) { timeless = true; }\n var dateToCheck = self.parseDate(date, undefined, timeless);\n if ((self.config.minDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||\n (self.config.maxDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))\n return false;\n if (!self.config.enable && self.config.disable.length === 0)\n return true;\n if (dateToCheck === undefined)\n return false;\n var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;\n for (var i = 0, d = void 0; i < array.length; i++) {\n d = array[i];\n if (typeof d === \"function\" &&\n d(dateToCheck))\n return bool;\n else if (d instanceof Date &&\n dateToCheck !== undefined &&\n d.getTime() === dateToCheck.getTime())\n return bool;\n else if (typeof d === \"string\") {\n var parsed = self.parseDate(d, undefined, true);\n return parsed && parsed.getTime() === dateToCheck.getTime()\n ? bool\n : !bool;\n }\n else if (typeof d === \"object\" &&\n dateToCheck !== undefined &&\n d.from &&\n d.to &&\n dateToCheck.getTime() >= d.from.getTime() &&\n dateToCheck.getTime() <= d.to.getTime())\n return bool;\n }\n return !bool;\n }\n function isInView(elem) {\n if (self.daysContainer !== undefined)\n return (elem.className.indexOf(\"hidden\") === -1 &&\n elem.className.indexOf(\"flatpickr-disabled\") === -1 &&\n self.daysContainer.contains(elem));\n return false;\n }\n function onBlur(e) {\n var isInput = e.target === self._input;\n var valueChanged = self._input.value.trimEnd() !== getDateStr();\n if (isInput &&\n valueChanged &&\n !(e.relatedTarget && isCalendarElem(e.relatedTarget))) {\n self.setDate(self._input.value, true, e.target === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n }\n }\n function onKeyDown(e) {\n var eventTarget = getEventTarget(e);\n var isInput = self.config.wrap\n ? element.contains(eventTarget)\n : eventTarget === self._input;\n var allowInput = self.config.allowInput;\n var allowKeydown = self.isOpen && (!allowInput || !isInput);\n var allowInlineKeydown = self.config.inline && isInput && !allowInput;\n if (e.keyCode === 13 && isInput) {\n if (allowInput) {\n self.setDate(self._input.value, true, eventTarget === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n self.close();\n return eventTarget.blur();\n }\n else {\n self.open();\n }\n }\n else if (isCalendarElem(eventTarget) ||\n allowKeydown ||\n allowInlineKeydown) {\n var isTimeObj = !!self.timeContainer &&\n self.timeContainer.contains(eventTarget);\n switch (e.keyCode) {\n case 13:\n if (isTimeObj) {\n e.preventDefault();\n updateTime();\n focusAndClose();\n }\n else\n selectDate(e);\n break;\n case 27:\n e.preventDefault();\n focusAndClose();\n break;\n case 8:\n case 46:\n if (isInput && !self.config.allowInput) {\n e.preventDefault();\n self.clear();\n }\n break;\n case 37:\n case 39:\n if (!isTimeObj && !isInput) {\n e.preventDefault();\n var activeElement = getClosestActiveElement();\n if (self.daysContainer !== undefined &&\n (allowInput === false ||\n (activeElement && isInView(activeElement)))) {\n var delta_1 = e.keyCode === 39 ? 1 : -1;\n if (!e.ctrlKey)\n focusOnDay(undefined, delta_1);\n else {\n e.stopPropagation();\n changeMonth(delta_1);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n }\n }\n else if (self.hourElement)\n self.hourElement.focus();\n break;\n case 38:\n case 40:\n e.preventDefault();\n var delta = e.keyCode === 40 ? 1 : -1;\n if ((self.daysContainer &&\n eventTarget.$i !== undefined) ||\n eventTarget === self.input ||\n eventTarget === self.altInput) {\n if (e.ctrlKey) {\n e.stopPropagation();\n changeYear(self.currentYear - delta);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n else if (!isTimeObj)\n focusOnDay(undefined, delta * 7);\n }\n else if (eventTarget === self.currentYearElement) {\n changeYear(self.currentYear - delta);\n }\n else if (self.config.enableTime) {\n if (!isTimeObj && self.hourElement)\n self.hourElement.focus();\n updateTime(e);\n self._debouncedChange();\n }\n break;\n case 9:\n if (isTimeObj) {\n var elems = [\n self.hourElement,\n self.minuteElement,\n self.secondElement,\n self.amPM,\n ]\n .concat(self.pluginElements)\n .filter(function (x) { return x; });\n var i = elems.indexOf(eventTarget);\n if (i !== -1) {\n var target = elems[i + (e.shiftKey ? -1 : 1)];\n e.preventDefault();\n (target || self._input).focus();\n }\n }\n else if (!self.config.noCalendar &&\n self.daysContainer &&\n self.daysContainer.contains(eventTarget) &&\n e.shiftKey) {\n e.preventDefault();\n self._input.focus();\n }\n break;\n default:\n break;\n }\n }\n if (self.amPM !== undefined && eventTarget === self.amPM) {\n switch (e.key) {\n case self.l10n.amPM[0].charAt(0):\n case self.l10n.amPM[0].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[0];\n setHoursFromInputs();\n updateValue();\n break;\n case self.l10n.amPM[1].charAt(0):\n case self.l10n.amPM[1].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[1];\n setHoursFromInputs();\n updateValue();\n break;\n }\n }\n if (isInput || isCalendarElem(eventTarget)) {\n triggerEvent(\"onKeyDown\", e);\n }\n }\n function onMouseOver(elem, cellClass) {\n if (cellClass === void 0) { cellClass = \"flatpickr-day\"; }\n if (self.selectedDates.length !== 1 ||\n (elem &&\n (!elem.classList.contains(cellClass) ||\n elem.classList.contains(\"flatpickr-disabled\"))))\n return;\n var hoverDate = elem\n ? elem.dateObj.getTime()\n : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());\n var containsDisabled = false;\n var minRange = 0, maxRange = 0;\n for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {\n if (!isEnabled(new Date(t), true)) {\n containsDisabled =\n containsDisabled || (t > rangeStartDate && t < rangeEndDate);\n if (t < initialDate && (!minRange || t > minRange))\n minRange = t;\n else if (t > initialDate && (!maxRange || t < maxRange))\n maxRange = t;\n }\n }\n var hoverableCells = Array.from(self.rContainer.querySelectorAll(\"*:nth-child(-n+\" + self.config.showMonths + \") > .\" + cellClass));\n hoverableCells.forEach(function (dayElem) {\n var date = dayElem.dateObj;\n var timestamp = date.getTime();\n var outOfRange = (minRange > 0 && timestamp < minRange) ||\n (maxRange > 0 && timestamp > maxRange);\n if (outOfRange) {\n dayElem.classList.add(\"notAllowed\");\n [\"inRange\", \"startRange\", \"endRange\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n return;\n }\n else if (containsDisabled && !outOfRange)\n return;\n [\"startRange\", \"inRange\", \"endRange\", \"notAllowed\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n if (elem !== undefined) {\n elem.classList.add(hoverDate <= self.selectedDates[0].getTime()\n ? \"startRange\"\n : \"endRange\");\n if (initialDate < hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"startRange\");\n else if (initialDate > hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"endRange\");\n if (timestamp >= minRange &&\n (maxRange === 0 || timestamp <= maxRange) &&\n isBetween(timestamp, initialDate, hoverDate))\n dayElem.classList.add(\"inRange\");\n }\n });\n }\n function onResize() {\n if (self.isOpen && !self.config.static && !self.config.inline)\n positionCalendar();\n }\n function open(e, positionElement) {\n if (positionElement === void 0) { positionElement = self._positionElement; }\n if (self.isMobile === true) {\n if (e) {\n e.preventDefault();\n var eventTarget = getEventTarget(e);\n if (eventTarget) {\n eventTarget.blur();\n }\n }\n if (self.mobileInput !== undefined) {\n self.mobileInput.focus();\n self.mobileInput.click();\n }\n triggerEvent(\"onOpen\");\n return;\n }\n else if (self._input.disabled || self.config.inline) {\n return;\n }\n var wasOpen = self.isOpen;\n self.isOpen = true;\n if (!wasOpen) {\n self.calendarContainer.classList.add(\"open\");\n self._input.classList.add(\"active\");\n triggerEvent(\"onOpen\");\n positionCalendar(positionElement);\n }\n if (self.config.enableTime === true && self.config.noCalendar === true) {\n if (self.config.allowInput === false &&\n (e === undefined ||\n !self.timeContainer.contains(e.relatedTarget))) {\n setTimeout(function () { return self.hourElement.select(); }, 50);\n }\n }\n }\n function minMaxDateSetter(type) {\n return function (date) {\n var dateObj = (self.config[\"_\" + type + \"Date\"] = self.parseDate(date, self.config.dateFormat));\n var inverseDateObj = self.config[\"_\" + (type === \"min\" ? \"max\" : \"min\") + \"Date\"];\n if (dateObj !== undefined) {\n self[type === \"min\" ? \"minDateHasTime\" : \"maxDateHasTime\"] =\n dateObj.getHours() > 0 ||\n dateObj.getMinutes() > 0 ||\n dateObj.getSeconds() > 0;\n }\n if (self.selectedDates) {\n self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });\n if (!self.selectedDates.length && type === \"min\")\n setHoursFromDate(dateObj);\n updateValue();\n }\n if (self.daysContainer) {\n redraw();\n if (dateObj !== undefined)\n self.currentYearElement[type] = dateObj.getFullYear().toString();\n else\n self.currentYearElement.removeAttribute(type);\n self.currentYearElement.disabled =\n !!inverseDateObj &&\n dateObj !== undefined &&\n inverseDateObj.getFullYear() === dateObj.getFullYear();\n }\n };\n }\n function parseConfig() {\n var boolOpts = [\n \"wrap\",\n \"weekNumbers\",\n \"allowInput\",\n \"allowInvalidPreload\",\n \"clickOpens\",\n \"time_24hr\",\n \"enableTime\",\n \"noCalendar\",\n \"altInput\",\n \"shorthandCurrentMonth\",\n \"inline\",\n \"static\",\n \"enableSeconds\",\n \"disableMobile\",\n ];\n var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig);\n var formats = {};\n self.config.parseDate = userConfig.parseDate;\n self.config.formatDate = userConfig.formatDate;\n Object.defineProperty(self.config, \"enable\", {\n get: function () { return self.config._enable; },\n set: function (dates) {\n self.config._enable = parseDateRules(dates);\n },\n });\n Object.defineProperty(self.config, \"disable\", {\n get: function () { return self.config._disable; },\n set: function (dates) {\n self.config._disable = parseDateRules(dates);\n },\n });\n var timeMode = userConfig.mode === \"time\";\n if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {\n var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaultOptions.dateFormat;\n formats.dateFormat =\n userConfig.noCalendar || timeMode\n ? \"H:i\" + (userConfig.enableSeconds ? \":S\" : \"\")\n : defaultDateFormat + \" H:i\" + (userConfig.enableSeconds ? \":S\" : \"\");\n }\n if (userConfig.altInput &&\n (userConfig.enableTime || timeMode) &&\n !userConfig.altFormat) {\n var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaultOptions.altFormat;\n formats.altFormat =\n userConfig.noCalendar || timeMode\n ? \"h:i\" + (userConfig.enableSeconds ? \":S K\" : \" K\")\n : defaultAltFormat + (\" h:i\" + (userConfig.enableSeconds ? \":S\" : \"\") + \" K\");\n }\n Object.defineProperty(self.config, \"minDate\", {\n get: function () { return self.config._minDate; },\n set: minMaxDateSetter(\"min\"),\n });\n Object.defineProperty(self.config, \"maxDate\", {\n get: function () { return self.config._maxDate; },\n set: minMaxDateSetter(\"max\"),\n });\n var minMaxTimeSetter = function (type) { return function (val) {\n self.config[type === \"min\" ? \"_minTime\" : \"_maxTime\"] = self.parseDate(val, \"H:i:S\");\n }; };\n Object.defineProperty(self.config, \"minTime\", {\n get: function () { return self.config._minTime; },\n set: minMaxTimeSetter(\"min\"),\n });\n Object.defineProperty(self.config, \"maxTime\", {\n get: function () { return self.config._maxTime; },\n set: minMaxTimeSetter(\"max\"),\n });\n if (userConfig.mode === \"time\") {\n self.config.noCalendar = true;\n self.config.enableTime = true;\n }\n Object.assign(self.config, formats, userConfig);\n for (var i = 0; i < boolOpts.length; i++)\n self.config[boolOpts[i]] =\n self.config[boolOpts[i]] === true ||\n self.config[boolOpts[i]] === \"true\";\n HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {\n self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);\n });\n self.isMobile =\n !self.config.disableMobile &&\n !self.config.inline &&\n self.config.mode === \"single\" &&\n !self.config.disable.length &&\n !self.config.enable &&\n !self.config.weekNumbers &&\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n for (var i = 0; i < self.config.plugins.length; i++) {\n var pluginConf = self.config.plugins[i](self) || {};\n for (var key in pluginConf) {\n if (HOOKS.indexOf(key) > -1) {\n self.config[key] = arrayify(pluginConf[key])\n .map(bindToInstance)\n .concat(self.config[key]);\n }\n else if (typeof userConfig[key] === \"undefined\")\n self.config[key] = pluginConf[key];\n }\n }\n if (!userConfig.altInputClass) {\n self.config.altInputClass =\n getInputElem().className + \" \" + self.config.altInputClass;\n }\n triggerEvent(\"onParseConfig\");\n }\n function getInputElem() {\n return self.config.wrap\n ? element.querySelector(\"[data-input]\")\n : element;\n }\n function setupLocale() {\n if (typeof self.config.locale !== \"object\" &&\n typeof flatpickr.l10ns[self.config.locale] === \"undefined\")\n self.config.errorHandler(new Error(\"flatpickr: invalid locale \" + self.config.locale));\n self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === \"object\"\n ? self.config.locale\n : self.config.locale !== \"default\"\n ? flatpickr.l10ns[self.config.locale]\n : undefined));\n tokenRegex.D = \"(\" + self.l10n.weekdays.shorthand.join(\"|\") + \")\";\n tokenRegex.l = \"(\" + self.l10n.weekdays.longhand.join(\"|\") + \")\";\n tokenRegex.M = \"(\" + self.l10n.months.shorthand.join(\"|\") + \")\";\n tokenRegex.F = \"(\" + self.l10n.months.longhand.join(\"|\") + \")\";\n tokenRegex.K = \"(\" + self.l10n.amPM[0] + \"|\" + self.l10n.amPM[1] + \"|\" + self.l10n.amPM[0].toLowerCase() + \"|\" + self.l10n.amPM[1].toLowerCase() + \")\";\n var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {})));\n if (userConfig.time_24hr === undefined &&\n flatpickr.defaultConfig.time_24hr === undefined) {\n self.config.time_24hr = self.l10n.time_24hr;\n }\n self.formatDate = createDateFormatter(self);\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n }\n function positionCalendar(customPositionElement) {\n if (typeof self.config.position === \"function\") {\n return void self.config.position(self, customPositionElement);\n }\n if (self.calendarContainer === undefined)\n return;\n triggerEvent(\"onPreCalendarPosition\");\n var positionElement = customPositionElement || self._positionElement;\n var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(\" \"), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === \"above\" ||\n (configPosVertical !== \"below\" &&\n distanceFromBottom < calendarHeight &&\n inputBounds.top > calendarHeight);\n var top = window.pageYOffset +\n inputBounds.top +\n (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);\n toggleClass(self.calendarContainer, \"arrowTop\", !showOnTop);\n toggleClass(self.calendarContainer, \"arrowBottom\", showOnTop);\n if (self.config.inline)\n return;\n var left = window.pageXOffset + inputBounds.left;\n var isCenter = false;\n var isRight = false;\n if (configPosHorizontal === \"center\") {\n left -= (calendarWidth - inputBounds.width) / 2;\n isCenter = true;\n }\n else if (configPosHorizontal === \"right\") {\n left -= calendarWidth - inputBounds.width;\n isRight = true;\n }\n toggleClass(self.calendarContainer, \"arrowLeft\", !isCenter && !isRight);\n toggleClass(self.calendarContainer, \"arrowCenter\", isCenter);\n toggleClass(self.calendarContainer, \"arrowRight\", isRight);\n var right = window.document.body.offsetWidth -\n (window.pageXOffset + inputBounds.right);\n var rightMost = left + calendarWidth > window.document.body.offsetWidth;\n var centerMost = right + calendarWidth > window.document.body.offsetWidth;\n toggleClass(self.calendarContainer, \"rightMost\", rightMost);\n if (self.config.static)\n return;\n self.calendarContainer.style.top = top + \"px\";\n if (!rightMost) {\n self.calendarContainer.style.left = left + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n else if (!centerMost) {\n self.calendarContainer.style.left = \"auto\";\n self.calendarContainer.style.right = right + \"px\";\n }\n else {\n var doc = getDocumentStyleSheet();\n if (doc === undefined)\n return;\n var bodyWidth = window.document.body.offsetWidth;\n var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);\n var centerBefore = \".flatpickr-calendar.centerMost:before\";\n var centerAfter = \".flatpickr-calendar.centerMost:after\";\n var centerIndex = doc.cssRules.length;\n var centerStyle = \"{left:\" + inputBounds.left + \"px;right:auto;}\";\n toggleClass(self.calendarContainer, \"rightMost\", false);\n toggleClass(self.calendarContainer, \"centerMost\", true);\n doc.insertRule(centerBefore + \",\" + centerAfter + centerStyle, centerIndex);\n self.calendarContainer.style.left = centerLeft + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n }\n function getDocumentStyleSheet() {\n var editableSheet = null;\n for (var i = 0; i < document.styleSheets.length; i++) {\n var sheet = document.styleSheets[i];\n if (!sheet.cssRules)\n continue;\n try {\n sheet.cssRules;\n }\n catch (err) {\n continue;\n }\n editableSheet = sheet;\n break;\n }\n return editableSheet != null ? editableSheet : createStyleSheet();\n }\n function createStyleSheet() {\n var style = document.createElement(\"style\");\n document.head.appendChild(style);\n return style.sheet;\n }\n function redraw() {\n if (self.config.noCalendar || self.isMobile)\n return;\n buildMonthSwitch();\n updateNavigationCurrentMonth();\n buildDays();\n }\n function focusAndClose() {\n self._input.focus();\n if (window.navigator.userAgent.indexOf(\"MSIE\") !== -1 ||\n navigator.msMaxTouchPoints !== undefined) {\n setTimeout(self.close, 0);\n }\n else {\n self.close();\n }\n }\n function selectDate(e) {\n e.preventDefault();\n e.stopPropagation();\n var isSelectable = function (day) {\n return day.classList &&\n day.classList.contains(\"flatpickr-day\") &&\n !day.classList.contains(\"flatpickr-disabled\") &&\n !day.classList.contains(\"notAllowed\");\n };\n var t = findParent(getEventTarget(e), isSelectable);\n if (t === undefined)\n return;\n var target = t;\n var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));\n var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||\n selectedDate.getMonth() >\n self.currentMonth + self.config.showMonths - 1) &&\n self.config.mode !== \"range\";\n self.selectedDateElem = target;\n if (self.config.mode === \"single\")\n self.selectedDates = [selectedDate];\n else if (self.config.mode === \"multiple\") {\n var selectedIndex = isDateSelected(selectedDate);\n if (selectedIndex)\n self.selectedDates.splice(parseInt(selectedIndex), 1);\n else\n self.selectedDates.push(selectedDate);\n }\n else if (self.config.mode === \"range\") {\n if (self.selectedDates.length === 2) {\n self.clear(false, false);\n }\n self.latestSelectedDateObj = selectedDate;\n self.selectedDates.push(selectedDate);\n if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n setHoursFromInputs();\n if (shouldChangeMonth) {\n var isNewYear = self.currentYear !== selectedDate.getFullYear();\n self.currentYear = selectedDate.getFullYear();\n self.currentMonth = selectedDate.getMonth();\n if (isNewYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n triggerEvent(\"onMonthChange\");\n }\n updateNavigationCurrentMonth();\n buildDays();\n updateValue();\n if (!shouldChangeMonth &&\n self.config.mode !== \"range\" &&\n self.config.showMonths === 1)\n focusOnDayElem(target);\n else if (self.selectedDateElem !== undefined &&\n self.hourElement === undefined) {\n self.selectedDateElem && self.selectedDateElem.focus();\n }\n if (self.hourElement !== undefined)\n self.hourElement !== undefined && self.hourElement.focus();\n if (self.config.closeOnSelect) {\n var single = self.config.mode === \"single\" && !self.config.enableTime;\n var range = self.config.mode === \"range\" &&\n self.selectedDates.length === 2 &&\n !self.config.enableTime;\n if (single || range) {\n focusAndClose();\n }\n }\n triggerChange();\n }\n var CALLBACKS = {\n locale: [setupLocale, updateWeekdays],\n showMonths: [buildMonths, setCalendarWidth, buildWeekdays],\n minDate: [jumpToDate],\n maxDate: [jumpToDate],\n positionElement: [updatePositionElement],\n clickOpens: [\n function () {\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n else {\n self._input.removeEventListener(\"focus\", self.open);\n self._input.removeEventListener(\"click\", self.open);\n }\n },\n ],\n };\n function set(option, value) {\n if (option !== null && typeof option === \"object\") {\n Object.assign(self.config, option);\n for (var key in option) {\n if (CALLBACKS[key] !== undefined)\n CALLBACKS[key].forEach(function (x) { return x(); });\n }\n }\n else {\n self.config[option] = value;\n if (CALLBACKS[option] !== undefined)\n CALLBACKS[option].forEach(function (x) { return x(); });\n else if (HOOKS.indexOf(option) > -1)\n self.config[option] = arrayify(value);\n }\n self.redraw();\n updateValue(true);\n }\n function setSelectedDate(inputDate, format) {\n var dates = [];\n if (inputDate instanceof Array)\n dates = inputDate.map(function (d) { return self.parseDate(d, format); });\n else if (inputDate instanceof Date || typeof inputDate === \"number\")\n dates = [self.parseDate(inputDate, format)];\n else if (typeof inputDate === \"string\") {\n switch (self.config.mode) {\n case \"single\":\n case \"time\":\n dates = [self.parseDate(inputDate, format)];\n break;\n case \"multiple\":\n dates = inputDate\n .split(self.config.conjunction)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n case \"range\":\n dates = inputDate\n .split(self.l10n.rangeSeparator)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n default:\n break;\n }\n }\n else\n self.config.errorHandler(new Error(\"Invalid date supplied: \" + JSON.stringify(inputDate)));\n self.selectedDates = (self.config.allowInvalidPreload\n ? dates\n : dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }));\n if (self.config.mode === \"range\")\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n function setDate(date, triggerChange, format) {\n if (triggerChange === void 0) { triggerChange = false; }\n if (format === void 0) { format = self.config.dateFormat; }\n if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))\n return self.clear(triggerChange);\n setSelectedDate(date, format);\n self.latestSelectedDateObj =\n self.selectedDates[self.selectedDates.length - 1];\n self.redraw();\n jumpToDate(undefined, triggerChange);\n setHoursFromDate();\n if (self.selectedDates.length === 0) {\n self.clear(false);\n }\n updateValue(triggerChange);\n if (triggerChange)\n triggerEvent(\"onChange\");\n }\n function parseDateRules(arr) {\n return arr\n .slice()\n .map(function (rule) {\n if (typeof rule === \"string\" ||\n typeof rule === \"number\" ||\n rule instanceof Date) {\n return self.parseDate(rule, undefined, true);\n }\n else if (rule &&\n typeof rule === \"object\" &&\n rule.from &&\n rule.to)\n return {\n from: self.parseDate(rule.from, undefined),\n to: self.parseDate(rule.to, undefined),\n };\n return rule;\n })\n .filter(function (x) { return x; });\n }\n function setupDates() {\n self.selectedDates = [];\n self.now = self.parseDate(self.config.now) || new Date();\n var preloadedDate = self.config.defaultDate ||\n ((self.input.nodeName === \"INPUT\" ||\n self.input.nodeName === \"TEXTAREA\") &&\n self.input.placeholder &&\n self.input.value === self.input.placeholder\n ? null\n : self.input.value);\n if (preloadedDate)\n setSelectedDate(preloadedDate, self.config.dateFormat);\n self._initialDate =\n self.selectedDates.length > 0\n ? self.selectedDates[0]\n : self.config.minDate &&\n self.config.minDate.getTime() > self.now.getTime()\n ? self.config.minDate\n : self.config.maxDate &&\n self.config.maxDate.getTime() < self.now.getTime()\n ? self.config.maxDate\n : self.now;\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n if (self.selectedDates.length > 0)\n self.latestSelectedDateObj = self.selectedDates[0];\n if (self.config.minTime !== undefined)\n self.config.minTime = self.parseDate(self.config.minTime, \"H:i\");\n if (self.config.maxTime !== undefined)\n self.config.maxTime = self.parseDate(self.config.maxTime, \"H:i\");\n self.minDateHasTime =\n !!self.config.minDate &&\n (self.config.minDate.getHours() > 0 ||\n self.config.minDate.getMinutes() > 0 ||\n self.config.minDate.getSeconds() > 0);\n self.maxDateHasTime =\n !!self.config.maxDate &&\n (self.config.maxDate.getHours() > 0 ||\n self.config.maxDate.getMinutes() > 0 ||\n self.config.maxDate.getSeconds() > 0);\n }\n function setupInputs() {\n self.input = getInputElem();\n if (!self.input) {\n self.config.errorHandler(new Error(\"Invalid input element specified\"));\n return;\n }\n self.input._type = self.input.type;\n self.input.type = \"text\";\n self.input.classList.add(\"flatpickr-input\");\n self._input = self.input;\n if (self.config.altInput) {\n self.altInput = createElement(self.input.nodeName, self.config.altInputClass);\n self._input = self.altInput;\n self.altInput.placeholder = self.input.placeholder;\n self.altInput.disabled = self.input.disabled;\n self.altInput.required = self.input.required;\n self.altInput.tabIndex = self.input.tabIndex;\n self.altInput.type = \"text\";\n self.input.setAttribute(\"type\", \"hidden\");\n if (!self.config.static && self.input.parentNode)\n self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);\n }\n if (!self.config.allowInput)\n self._input.setAttribute(\"readonly\", \"readonly\");\n updatePositionElement();\n }\n function updatePositionElement() {\n self._positionElement = self.config.positionElement || self._input;\n }\n function setupMobile() {\n var inputType = self.config.enableTime\n ? self.config.noCalendar\n ? \"time\"\n : \"datetime-local\"\n : \"date\";\n self.mobileInput = createElement(\"input\", self.input.className + \" flatpickr-mobile\");\n self.mobileInput.tabIndex = 1;\n self.mobileInput.type = inputType;\n self.mobileInput.disabled = self.input.disabled;\n self.mobileInput.required = self.input.required;\n self.mobileInput.placeholder = self.input.placeholder;\n self.mobileFormatStr =\n inputType === \"datetime-local\"\n ? \"Y-m-d\\\\TH:i:S\"\n : inputType === \"date\"\n ? \"Y-m-d\"\n : \"H:i:S\";\n if (self.selectedDates.length > 0) {\n self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);\n }\n if (self.config.minDate)\n self.mobileInput.min = self.formatDate(self.config.minDate, \"Y-m-d\");\n if (self.config.maxDate)\n self.mobileInput.max = self.formatDate(self.config.maxDate, \"Y-m-d\");\n if (self.input.getAttribute(\"step\"))\n self.mobileInput.step = String(self.input.getAttribute(\"step\"));\n self.input.type = \"hidden\";\n if (self.altInput !== undefined)\n self.altInput.type = \"hidden\";\n try {\n if (self.input.parentNode)\n self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);\n }\n catch (_a) { }\n bind(self.mobileInput, \"change\", function (e) {\n self.setDate(getEventTarget(e).value, false, self.mobileFormatStr);\n triggerEvent(\"onChange\");\n triggerEvent(\"onClose\");\n });\n }\n function toggle(e) {\n if (self.isOpen === true)\n return self.close();\n self.open(e);\n }\n function triggerEvent(event, data) {\n if (self.config === undefined)\n return;\n var hooks = self.config[event];\n if (hooks !== undefined && hooks.length > 0) {\n for (var i = 0; hooks[i] && i < hooks.length; i++)\n hooks[i](self.selectedDates, self.input.value, self, data);\n }\n if (event === \"onChange\") {\n self.input.dispatchEvent(createEvent(\"change\"));\n self.input.dispatchEvent(createEvent(\"input\"));\n }\n }\n function createEvent(name) {\n var e = document.createEvent(\"Event\");\n e.initEvent(name, true, true);\n return e;\n }\n function isDateSelected(date) {\n for (var i = 0; i < self.selectedDates.length; i++) {\n var selectedDate = self.selectedDates[i];\n if (selectedDate instanceof Date &&\n compareDates(selectedDate, date) === 0)\n return \"\" + i;\n }\n return false;\n }\n function isDateInRange(date) {\n if (self.config.mode !== \"range\" || self.selectedDates.length < 2)\n return false;\n return (compareDates(date, self.selectedDates[0]) >= 0 &&\n compareDates(date, self.selectedDates[1]) <= 0);\n }\n function updateNavigationCurrentMonth() {\n if (self.config.noCalendar || self.isMobile || !self.monthNav)\n return;\n self.yearElements.forEach(function (yearElement, i) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n self.monthElements[i].textContent =\n monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + \" \";\n }\n else {\n self.monthsDropdownContainer.value = d.getMonth().toString();\n }\n yearElement.value = d.getFullYear().toString();\n });\n self._hidePrevMonthArrow =\n self.config.minDate !== undefined &&\n (self.currentYear === self.config.minDate.getFullYear()\n ? self.currentMonth <= self.config.minDate.getMonth()\n : self.currentYear < self.config.minDate.getFullYear());\n self._hideNextMonthArrow =\n self.config.maxDate !== undefined &&\n (self.currentYear === self.config.maxDate.getFullYear()\n ? self.currentMonth + 1 > self.config.maxDate.getMonth()\n : self.currentYear > self.config.maxDate.getFullYear());\n }\n function getDateStr(specificFormat) {\n var format = specificFormat ||\n (self.config.altInput ? self.config.altFormat : self.config.dateFormat);\n return self.selectedDates\n .map(function (dObj) { return self.formatDate(dObj, format); })\n .filter(function (d, i, arr) {\n return self.config.mode !== \"range\" ||\n self.config.enableTime ||\n arr.indexOf(d) === i;\n })\n .join(self.config.mode !== \"range\"\n ? self.config.conjunction\n : self.l10n.rangeSeparator);\n }\n function updateValue(triggerChange) {\n if (triggerChange === void 0) { triggerChange = true; }\n if (self.mobileInput !== undefined && self.mobileFormatStr) {\n self.mobileInput.value =\n self.latestSelectedDateObj !== undefined\n ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)\n : \"\";\n }\n self.input.value = getDateStr(self.config.dateFormat);\n if (self.altInput !== undefined) {\n self.altInput.value = getDateStr(self.config.altFormat);\n }\n if (triggerChange !== false)\n triggerEvent(\"onValueUpdate\");\n }\n function onMonthNavClick(e) {\n var eventTarget = getEventTarget(e);\n var isPrevMonth = self.prevMonthNav.contains(eventTarget);\n var isNextMonth = self.nextMonthNav.contains(eventTarget);\n if (isPrevMonth || isNextMonth) {\n changeMonth(isPrevMonth ? -1 : 1);\n }\n else if (self.yearElements.indexOf(eventTarget) >= 0) {\n eventTarget.select();\n }\n else if (eventTarget.classList.contains(\"arrowUp\")) {\n self.changeYear(self.currentYear + 1);\n }\n else if (eventTarget.classList.contains(\"arrowDown\")) {\n self.changeYear(self.currentYear - 1);\n }\n }\n function timeWrapper(e) {\n e.preventDefault();\n var isKeyDown = e.type === \"keydown\", eventTarget = getEventTarget(e), input = eventTarget;\n if (self.amPM !== undefined && eventTarget === self.amPM) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n var min = parseFloat(input.getAttribute(\"min\")), max = parseFloat(input.getAttribute(\"max\")), step = parseFloat(input.getAttribute(\"step\")), curValue = parseInt(input.value, 10), delta = e.delta ||\n (isKeyDown ? (e.which === 38 ? 1 : -1) : 0);\n var newValue = curValue + step * delta;\n if (typeof input.value !== \"undefined\" && input.value.length === 2) {\n var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;\n if (newValue < min) {\n newValue =\n max +\n newValue +\n int(!isHourElem) +\n (int(isHourElem) && int(!self.amPM));\n if (isMinuteElem)\n incrementNumInput(undefined, -1, self.hourElement);\n }\n else if (newValue > max) {\n newValue =\n input === self.hourElement ? newValue - max - int(!self.amPM) : min;\n if (isMinuteElem)\n incrementNumInput(undefined, 1, self.hourElement);\n }\n if (self.amPM &&\n isHourElem &&\n (step === 1\n ? newValue + curValue === 23\n : Math.abs(newValue - curValue) > step)) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n input.value = pad(newValue);\n }\n }\n init();\n return self;\n}\nfunction _flatpickr(nodeList, config) {\n var nodes = Array.prototype.slice\n .call(nodeList)\n .filter(function (x) { return x instanceof HTMLElement; });\n var instances = [];\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n try {\n if (node.getAttribute(\"data-fp-omit\") !== null)\n continue;\n if (node._flatpickr !== undefined) {\n node._flatpickr.destroy();\n node._flatpickr = undefined;\n }\n node._flatpickr = FlatpickrInstance(node, config || {});\n instances.push(node._flatpickr);\n }\n catch (e) {\n console.error(e);\n }\n }\n return instances.length === 1 ? instances[0] : instances;\n}\nif (typeof HTMLElement !== \"undefined\" &&\n typeof HTMLCollection !== \"undefined\" &&\n typeof NodeList !== \"undefined\") {\n HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n HTMLElement.prototype.flatpickr = function (config) {\n return _flatpickr([this], config);\n };\n}\nvar flatpickr = function (selector, config) {\n if (typeof selector === \"string\") {\n return _flatpickr(window.document.querySelectorAll(selector), config);\n }\n else if (selector instanceof Node) {\n return _flatpickr([selector], config);\n }\n else {\n return _flatpickr(selector, config);\n }\n};\nflatpickr.defaultConfig = {};\nflatpickr.l10ns = {\n en: __assign({}, English),\n default: __assign({}, English),\n};\nflatpickr.localize = function (l10n) {\n flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n);\n};\nflatpickr.setDefaults = function (config) {\n flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config);\n};\nflatpickr.parseDate = createDateParser({});\nflatpickr.formatDate = createDateFormatter({});\nflatpickr.compareDates = compareDates;\nif (typeof jQuery !== \"undefined\" && typeof jQuery.fn !== \"undefined\") {\n jQuery.fn.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n}\nDate.prototype.fp_incr = function (days) {\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === \"string\" ? parseInt(days, 10) : days));\n};\nif (typeof window !== \"undefined\") {\n window.flatpickr = flatpickr;\n}\nexport default flatpickr;\n","import flatpickr from 'flatpickr';\nimport { format } from 'date-fns';\nimport 'flatpickr/dist/flatpickr.min.css';\nimport 'flatpickr/dist/themes/dark.css';\n\nexport function datePickerHandler() {\n // Initialize Flatpickr on the dueDate input field\n const dueDateInput = document.getElementById('dueDate');\n const fp = flatpickr(dueDateInput, {\n static: true,\n dateFormat: 'Y-m-d',\n minDate: 'today',\n theme: 'dark',\n });\n\n // // Add an event listener to the input field to format the date using date-fns when it changes\n // dueDateInput.addEventListener('change', (event) => {\n // const selectedDate = new Date(event.target.value);\n // console.log(selectedDate);\n // const formattedDate = format(selectedDate, 'P');\n\n // fp.set('dateFormat', formattedDate);\n // });\n}\n","import * as DOMPurify from 'dompurify';\n\n/**\n * Creates a section HTML element with specified attribute and value\n * @param {string} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @returns {HTMLElement} - The created section element\n */\nexport function createSection(attributeName, attributeValue) {\n const section = document.createElement('section');\n section.setAttribute(attributeName, attributeValue);\n return section;\n}\n\n/**\n * Creates a div HTML element with a specified attribute name and value\n * @param {object} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @returns {HTMLDivElement} - The created div element\n */\nexport function createDiv(attributeName, attributeValue) {\n const div = document.createElement('div');\n div.setAttribute(attributeName, attributeValue);\n return div;\n}\n\n/**\n * Creates a picture element with provided attributes and sources\n * @param {object} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @param {object} imageSources - Object containing picture sources for different screen sizes\n * @returns {HTMLPictureElement} - The created picture element\n */\nexport function createPicture(attributeName, attributeValue, imageSources) {\n const picture = document.createElement('picture');\n picture.setAttribute(attributeName, attributeValue);\n\n Object.keys(imageSources).forEach((key) => {\n if (key === 'img') {\n const img = document.createElement('img');\n setAttributes(img, imageSources[key]);\n picture.appendChild(img);\n } else {\n const source = document.createElement('source');\n setAttributes(source, imageSources[key]);\n picture.appendChild(source);\n }\n });\n\n return picture;\n}\n\n/**\n * Creates a list (ul) element with provided attributes. The list items are created using a rendering export function passed as an argument\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute (e.g., 'cs-stats')\n * @param {object} itemData - Data to populate the list with. Expects an object where each property can be rendered as a list item\n * @param {Function} renderItem - export function that takes an item of data and returns a list item (li) element\n * @returns {HTMLUListElement} - The created unordered list element\n */\nexport function createList(\n attributeName,\n attributeValue,\n itemData,\n renderItem\n) {\n const list = document.createElement('ul');\n list.setAttribute(attributeName, attributeValue);\n\n for (let key in itemData) {\n if (itemData.hasOwnProperty(key)) {\n list.appendChild(renderItem(itemData[key]));\n }\n }\n\n return list;\n}\n\n/**\n * Creates a list item (li) element using a provided rendering export function for the item's content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute (e.g., 'cs-stat')\n * @param {object} item - Data item to be rendered inside the list item\n * @param {Function} renderContent - export function that takes the item and returns the content to be placed inside the list item\n * @returns {HTMLLIElement} - The created list item\n */\nexport function createListItem(\n attributeName,\n attributeValue,\n item,\n renderContent\n) {\n const listItem = document.createElement('li');\n listItem.setAttribute(attributeName, attributeValue);\n\n const content = renderContent(item);\n listItem.appendChild(content);\n\n return listItem;\n}\n\n/**\n * Creates a span element with a specified class and text content\n * @param {string} attributeName - Name of the attribute\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the span\n * @returns {HTMLElement} - The created span element\n */\nexport function createSpan(attributeName, attributeValue, text) {\n const span = document.createElement('span');\n span.setAttribute(attributeName, attributeValue);\n span.innerText = text;\n\n return span;\n}\n\n/**\n * Creates a topper element (span) with a specified class and text content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the topper\n * @returns {HTMLElement} - The created topper element\n */\nexport function createTopper(attributeName, attributeValue, text) {\n const topper = document.createElement('span');\n topper.setAttribute(attributeName, attributeValue);\n topper.innerText = text;\n\n return topper;\n}\n\n/**\n * Creates a title element (h2) with a specified class and text content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the title\n * @returns {HTMLHeadingElement} - The created title element\n */\nexport function createTitle(attributeName, attributeValue, text) {\n const title = document.createElement('h2');\n title.setAttribute(attributeName, attributeValue);\n title.textContent = text;\n\n return title;\n}\n\n/**\n * Creates a paragraph element (p) with a specified class and text content\n * @param {string} attributeName - Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - Value for the attribute\n * @param {string} text - Text content for the paragraph\n * @returns {HTMLParagraphElement} - The created paragraph element\n */\nexport function createParagraph(attributeName, attributeValue, text) {\n const paragraph = document.createElement('p');\n paragraph.setAttribute(attributeName, attributeValue);\n paragraph.textContent = text;\n\n return paragraph;\n}\n\n/**\n * Sets multiple attributes on a DOM element based on a provided object\n * @param {HTMLElement} element - The DOM element to set attributes on\n * @param {object} attributes - Object containing key-value pairs for attributes\n */\nexport function setAttributes(element, attributes) {\n Object.keys(attributes).forEach((attr) => {\n element.setAttribute(attr, attributes[attr]);\n });\n}\n\n/**\n * Clears the content of a specified parent element\n * @param {HTMLElement} parent - The parent element whose content is to be cleared\n * @returns {boolean} - Returns true to indicate the operation was successful\n */\nexport function clearPage(parent) {\n parent.textContent = '';\n\n return true;\n}\n\n/**\n * Creates a link (anchor) element with specified attributes and text content\n * @param {string} href - The attribute name to set on the link (e.g., 'href')\n * @param {string} hrefValue - The value for the href attribute\n * @param {string} attributeName - the Name of the attribute (e.g., 'class')\n * @param {string} attributeValue - The value for the attribute\n * @param {string} text - The text content for the link\n * @returns {HTMLAnchorElement} - The created anchor element\n */\nexport function createLink(\n href,\n hrefValue,\n attributeName,\n attributeValue,\n text\n) {\n const link = document.createElement('a');\n\n link.setAttribute(href, hrefValue);\n link.innerText = text;\n link.setAttribute(attributeName, attributeValue);\n link.setAttribute('target', '_blank');\n\n return link;\n}\n\n/**\n * Creates an element containing SVG code for a bin icon representing a delete action.\n * This function serves as workaround because SVG did not render in the DOM with the icon inside of it.\n * All fill values are left empty so that they can be redefined from the parent element's CSS properties,\n * allowing for easier customization of the icon's color.\n * @returns {HTMLDivElement} - The created 'SVG' div element.\n */\n\nexport function createDeleteIcon() {\n const deleteIcon = document.createElement('div');\n const svgCode = ``;\n deleteIcon.innerHTML = DOMPurify.sanitize(svgCode);\n\n return deleteIcon;\n}\n","export const sampleData = {\n projects: [\n {\n id: 1,\n name: 'Work',\n todos: [\n {\n id: 11,\n title: 'Meeting with clients',\n project: 'Work',\n description: 'Discuss project requirements',\n dueDate: '',\n priority: 'high',\n completed: true,\n },\n {\n id: 22,\n title: 'Prepare presentation',\n project: 'Work',\n description: 'Create slides for the upcoming presentation',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n ],\n },\n {\n id: 2,\n name: 'Personal',\n todos: [\n {\n id: 33,\n title: 'Go grocery shopping',\n project: 'Personal',\n description: 'Buy fruits, vegetables, and milk',\n dueDate: '',\n priority: 'high',\n completed: true,\n },\n {\n id: 44,\n title: 'Gym workout',\n project: 'Personal',\n description: 'Cardio and weight training session',\n dueDate: '',\n priority: 'low',\n completed: false,\n },\n ],\n },\n {\n id: 3,\n name: 'Home Improvement',\n todos: [\n {\n id: 55,\n title: 'Paint living room walls',\n project: 'Home Improvement',\n description: 'Choose paint color and buy supplies',\n dueDate: '',\n priority: 'medium',\n completed: true,\n },\n {\n id: 66,\n title: 'Fix leaking faucet',\n project: 'Home Improvement',\n description: 'Call plumber to fix the kitchen faucet',\n dueDate: '',\n priority: 'high',\n completed: true,\n },\n ],\n },\n {\n id: 4,\n name: 'Fitness Goals',\n todos: [\n {\n id: 77,\n title: 'Run 5 miles',\n project: 'Fitness Goals',\n description: 'Run in the park early morning',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 88,\n title: 'Try new yoga class',\n project: 'Fitness Goals',\n description: 'Attend the evening yoga class at the gym',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n ],\n },\n {\n id: 5,\n name: 'Vacation Planning',\n todos: [\n {\n id: 99,\n title: 'Book flight tickets',\n project: 'Vacation Planning',\n description: 'Search for best deals and book tickets',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 1010,\n title: 'Research accommodation options',\n project: 'Vacation Planning',\n description: 'Find suitable hotels or Airbnb',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n {\n id: 1111,\n title: 'Plan itinerary',\n project: 'Vacation Planning',\n description:\n 'Research attractions and create a travel plan',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 1212,\n title: 'Pack luggage',\n project: 'Vacation Planning',\n description: 'Make a list of essentials and pack luggage',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n {\n id: 1313,\n title: 'Check travel documents',\n project: 'Vacation Planning',\n description:\n 'Ensure passports, visas, and tickets are ready',\n dueDate: '',\n priority: 'high',\n completed: false,\n },\n {\n id: 1414,\n title: 'Confirm accommodation bookings',\n project: 'Vacation Planning',\n description: 'Double-check hotel or Airbnb reservations',\n dueDate: '',\n priority: 'medium',\n completed: false,\n },\n ],\n },\n ],\n};\n\n/**\n * Adjusts the due dates of todos in the sample data to distribute them evenly across the current week.\n * Week starts with Monday.\n *\n * @param {Object} sampleData - The sample data object containing projects and todos.\n */\nfunction adjustDueDatesForCurrentWeek(sampleData) {\n // Get the current date\n const currentDate = new Date();\n // Adjust to Monday it it's not already Monday\n const currentDayOfWeek = currentDate.getDay();\n if (currentDayOfWeek !== 1) {\n const difference = currentDayOfWeek - 1;\n currentDate.setDate(currentDate.getDate() - difference);\n }\n\n // Calculate the total number of days in the current week\n const totalDays = 7;\n\n // Distribute the todos evenly across the days of the week\n let currentDay = new Date(currentDate);\n sampleData.projects.forEach((project) => {\n const todos = project.todos;\n const todosPerDay = Math.ceil(todos.length / totalDays);\n let currentTodoIndex = 0;\n\n for (let i = 0; i < totalDays; i++) {\n const todosForCurrentDay = todos.slice(\n currentTodoIndex,\n currentTodoIndex + todosPerDay\n );\n const dueDate = new Date(currentDay);\n todosForCurrentDay.forEach((todo, index) => {\n // Calculate due date based on index to evenly distribute todos\n dueDate.setDate(currentDay.getDate() + index);\n todo.dueDate = dueDate.toISOString().split('T')[0];\n });\n\n currentTodoIndex += todosPerDay;\n // Increment the current day\n currentDay.setDate(currentDay.getDate() + 1);\n }\n });\n}\n\n// Call the function with the sampleData\nadjustDueDatesForCurrentWeek(sampleData);\n","import {\n createDiv,\n createTitle,\n createList,\n createListItem,\n createParagraph,\n createDeleteIcon,\n} from '../utility/elementRender.js';\n\nimport { sampleData } from '../pageData/sampleData.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\n/**\n * Renders the primary container for the home page.\n *\n * @param {Object|Array} projectData - The data containing project(s) information.\n * If an object is provided, it should represent a single project.\n * If an array is provided, it should contain multiple project objects.\n * @returns {HTMLDivElement} - The container div element.\n */\nexport function renderContainer(projectData) {\n // Use projectsData if provided, Otherwise fallback to sample data\n const project = projectData || sampleData.projects;\n\n const container = createDiv('class', 'todo-home-container');\n const title = createTitle('class', 'title', 'Todos');\n container.appendChild(title);\n\n // Render the list of todos\n const todosList = renderTodosList(project);\n if (todosList) {\n container.appendChild(todosList);\n } else {\n console.error('Error rendering todo list: Data empty or null');\n }\n\n return container;\n}\n\n/**\n * Renders a list of todos.\n *\n * @param {Array} projects - Array of project objects, each containing todo items.\n * @returns {HTMLUListElement} - The list element containing todos.\n */\nexport function renderTodosList(projects) {\n if (!projects || projects.length === 0) {\n return null;\n }\n\n const list = createList('class', 'todo-list');\n\n projects.forEach((project) => {\n project.todos.forEach((todo) => {\n const listItem = renderTodoItem(todo);\n list.appendChild(listItem);\n });\n });\n\n return list;\n}\n\n/**\n * Renders a single todo item.\n *\n * @param {Object} todo - Todo object.\n * @returns {HTMLLIElement} - The list item element representing a todo.\n */\nexport function renderTodoItem(todo) {\n const priorityClass = getPriorityClass(todo.priority);\n const listItem = createListItem(\n 'class',\n `todo-container ${priorityClass}`,\n todo,\n renderTodoContent\n );\n listItem.id = `todo-${todo.id}`;\n return listItem;\n}\n\n/**\n * Renders the content of a single todo item.\n *\n * @param {Object} todo - The todo object containing information about todo content.\n * @returns {HTMLDivElement} - The container div element representing the content of the todo item.\n */\nexport function renderTodoContent(todo) {\n const container = createDiv('class', 'todo-content');\n const checkbox = createDiv('class', 'todo-checkbox');\n const todoTitle = createTitle('class', 'todo-title', todo.title);\n const todoDueDate = createParagraph('class', 'todo-dueDate', todo.dueDate);\n const todoDetails = createDiv('class', 'todo-item');\n const todoDelete = createDiv('class', 'todo-item');\n\n checkbox.id = 'checkbox-' + todo.id;\n\n todoDetails.classList.add('details');\n todoDetails.textContent = 'Details';\n todoDetails.id = 'details-' + todo.id;\n const todoDetailsId = todoDetails.id;\n\n todoDelete.classList.add('delete');\n todoDelete.id = 'delete-' + todo.id;\n\n const todoManager = new TodoManager(\n todo.id,\n todo.title,\n todo.project,\n todo.description,\n todo.dueDate,\n todo.priority,\n todo.completed\n );\n\n todoManager.checkboxHandler(checkbox, todoTitle, todoDueDate, todo.id);\n todoManager.todoDeleteHandler(todoDelete, todo.id, todo.project);\n todoManager.todoDetailsHandler(todoDetails, todoDetailsId, todo.id);\n\n const deleteIcon = createDeleteIcon();\n todoDelete.appendChild(deleteIcon);\n\n container.appendChild(checkbox);\n container.appendChild(todoTitle);\n container.appendChild(todoDueDate);\n container.appendChild(todoDetails);\n container.appendChild(todoDelete);\n\n return container;\n}\n\n/**\n * Determines the CSS class name for visual representation of todo item priority.\n *\n * @param {String} priority - The priority value of the todo item.\n * @returns {String} - The CSS class name corresponding to the priority.\n */\nexport function getPriorityClass(priority) {\n switch (priority) {\n case 'low':\n return 'priority-low';\n case 'medium':\n return 'priority-medium';\n case 'high':\n return 'priority-high';\n default:\n return 'priority-low'; // Default class if priority is not specified\n }\n}\n\n/**\n * Handles the error that occurs while retrieving data from local storage.\n *\n * @param {Error} error - The error object representing the storage error.\n */\nexport function handleStorageError(error) {\n console.error('Error retrieving data from local storage: ', error);\n}\n\n/**\n * Handles the error that occurs while instantiating dialog.\n *\n * @param {Error} error - The error object representing the dialog error.\n */\nexport function handleDialogError(error) {\n console.error('Error instantiating dialog', error);\n}\n","import { Project } from '../entities/project';\n\n/**\n * Saves data to local storage.\n *\n * @param {string} key - The key to store the data under.\n * @param {any} data - The data to be saved.\n * @returns {Promise} A promise that resolves when the data is successfully saved, or rejects with an error.\n */\nexport function saveDataToLocalStorage(key, data) {\n return new Promise((resolve, reject) => {\n try {\n const serializedData = JSON.stringify(data);\n localStorage.setItem(key, serializedData);\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n}\n\n/**\n * Retrieves data from local storage.\n *\n * @param {string} key - The key to retrieve the data from.\n * @returns {any} The retrieved data, or null if the data is not found or an error occurs.\n */\nexport function getDataFromLocalStorage(key) {\n try {\n const serializedData = localStorage.getItem(key);\n const result = JSON.parse(serializedData);\n return result;\n } catch (error) {\n console.error('Error retrieving data from local storage: ', error);\n return null;\n }\n}\n\n/**\n * Removes data from local storage.\n *\n * @param {string} key - The key of the data to be removed.\n * @returns {boolean} True if the data is successfully removed, false otherwise.\n */\nexport function removeDataFromStorage(key) {\n try {\n localStorage.removeItem(key);\n return true;\n } catch (error) {\n console.error('Error removing data from local storage: ', error);\n return false;\n }\n}\n\n/**\n * Removes a todo item from the existing data in local storage.\n *\n * @param {Array} existingData - The existing data in local storage.\n * @param {string} todoIDToRemove - The ID of the todo item to remove.\n * @returns {Array} The updated existing data with the specified todo item removed.\n */\nexport function removeTodoFromLocalStorage(existingData, todoIDToRemove) {\n // Check if existingData is null or undefined\n if (!existingData || !Array.isArray(existingData)) {\n console.error('Existing data is not in the expected format.');\n return existingData;\n }\n\n for (const project of existingData) {\n if (!project.todos || !Array.isArray(project.todos)) {\n console.error('Project todos are not in the expected format.');\n continue; // Skip to the next project\n }\n\n // Remove todo with the specified ID from the project's todos array\n project.todos = project.todos.filter(\n (todo) => todo.id !== todoIDToRemove\n );\n }\n\n return existingData;\n}\n\n/**\n * Edits a todo item in the existing data in local storage.\n *\n * @param {string} key - The key of the data in local storage.\n * @param {string} todoId - The ID of the todo item to edit.\n * @param {object} newData - The new data to update the todo item with.\n * @returns {Promise} A promise that resolves to true if the data is successfully edited, or false otherwise.\n */\nexport async function editDataInLocalStorage(key, todoId, newData) {\n try {\n let existingData = getDataFromLocalStorage(key);\n if (!existingData) {\n console.error(\n 'Cannot edit data: No existing data found in local storage.'\n );\n return false;\n }\n\n // Find the project and todo index\n let projectIndex = -1;\n let todoIndex = -1;\n for (let i = 0; i < existingData.length; i++) {\n todoIndex = existingData[i].todos.findIndex(\n (todo) => todo.id === todoId\n );\n if (todoIndex !== -1) {\n projectIndex = i;\n break;\n }\n }\n\n if (projectIndex === -1 || todoIndex === -1) {\n throw new Error(\n 'Todo with specified id not found in existing data.'\n );\n }\n\n // Check if the project name has been changed\n if (newData.project !== existingData[projectIndex].name) {\n // Call the updateTodoProject method\n existingData = updateTodoProject(\n existingData,\n projectIndex,\n todoIndex,\n newData.project\n );\n } else {\n // Update the todo item with the provided newData\n existingData[projectIndex].todos[todoIndex] = {\n ...existingData[projectIndex].todos[todoIndex],\n ...newData,\n };\n }\n\n // Save the updated data to local storage\n await saveDataToLocalStorage(key, existingData);\n return true;\n } catch (error) {\n console.error('Error editing data in local storage: ', error);\n return false;\n }\n}\n\n/**\n * Update the project name in the existing data retrieved from local storage and manages todo item relocation.\n * If a project with the new project name does not exist, a new project is created.\n * If the todo with the specified ID is not found in the existing data, no changes are made.\n *\n * @param {Array} existingData - The existing data retrieved from local storage.\n * @param {number} projectIndex - The index of the project containing the todo item to be updated.\n * @param {number} todoIndex - The index of the todo item within the project to be updated.\n * @param {number} newProjectName - The new project name.\n * @returns {Array} The updated existing data with the project and todo item modifications.\n */\nfunction updateTodoProject(\n existingData,\n projectIndex,\n todoIndex,\n newProjectName\n) {\n // Update the project name in the todo item\n existingData[projectIndex].todos[todoIndex].project = newProjectName;\n\n // Check if a project already exists with the new project name\n const newProjectIndex = existingData.findIndex(\n (project) => project.name === newProjectName\n );\n\n if (newProjectIndex === -1) {\n // Create a new project with the new project name\n const newProjectId = Date.now();\n const newProject = new Project(newProjectId, newProjectName);\n newProject.todos.push(existingData[projectIndex].todos[todoIndex]);\n existingData.push(newProject);\n } else {\n // Add the todo item to the existing project with the new project name\n existingData[newProjectIndex].todos.push(\n existingData[projectIndex].todos[todoIndex]\n );\n }\n\n // Remove the todo item from the original project\n existingData[projectIndex].todos.splice(todoIndex, 1);\n\n return existingData;\n}\n","import { getDataFromLocalStorage } from '../utility/localStorageManager';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Represents a project.\n *\n * @class\n */\nexport class Project {\n /**\n * Creates a new project.\n *\n * @constructor\n * @param {number} id - The ID of the project.\n * @param {string} name - The name of the project.\n */\n constructor(id, name) {\n this.id = id;\n this.name = name;\n this.todos = [];\n }\n}\n\n/**\n * Represents a project manager.\n *\n * @class\n */\nexport class ProjectManager {\n /**\n * Creates a new project manager.\n *\n * @constructor\n */\n constructor() {\n this.projects = [];\n }\n\n /**\n * Adds a todo to a project.\n *\n * If the project doesn't exist, a new project will be created.\n * @param {object} todo - The todo object to be added.\n */\n addTodoToProject(todo) {\n let project = this.getProjectByName(todo.project);\n\n if (project) {\n project.todos.push(todo);\n } else {\n const id = Date.now();\n project = new Project(id, todo.project);\n this.projects.push(project);\n project.todos.push(todo);\n }\n }\n\n /**\n * Removes a todo from a project.\n *\n * @param {string} projectName - The name of the project.\n * @param {number} todoId - The ID of the todo to be removed.\n */\n removeTodoFromProject(projectName, todoId) {\n const project = this.getProjectByName(projectName);\n if (project) {\n project.todos = project.todos.filter((todo) => todo.id !== todoId);\n } else {\n console.log('No project found with name:', projectName);\n }\n }\n\n /**\n * Gets a project by its name.\n *\n * @param {string} name - The name of the project.\n * @returns {Project|undefined} The project with the specified name, or undefined if not found.\n */\n getProjectByName(name) {\n return this.projects.find((project) => project.name === name);\n }\n\n /**\n * Retrieve a project by its ID, including its todos.\n *\n * @param {number} projectId - The ID of the project to retrieve.\n * @returns {Object|null} - The project object with todos if found, or null if not found.\n */\n getProjectById(projectId) {\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n if (!existingData) {\n // Handle the case where no data is found in local storage\n return null;\n }\n const selectedProject = existingData.find(\n (project) => project.id === projectId\n );\n if (selectedProject) {\n return {\n ...selectedProject,\n todos: selectedProject.todos || [], // Ensure todos array exists\n };\n }\n return null;\n }\n\n /**\n * Displays the projects in the navigation bar.\n */\n displayProjectsInNavigationBar() {\n const projects = getDataFromLocalStorage(PROJECTS_STORAGE_KEY); // Retrieve projects from local storage\n\n if (!projects || projects.length === 0) {\n console.error('No projects found in local storage.');\n return;\n }\n\n const projectsDropdown = document.getElementById('projects'); // Get the projects dropdown element\n\n if (!projectsDropdown) {\n console.error('Projects dropdown not found.');\n return;\n }\n\n const dropdownList = projectsDropdown.querySelector('.cs-drop-ul'); // Get the dropdown list within the projects dropdown\n\n if (!dropdownList) {\n console.error('Dropdown list not found within projects dropdown.');\n return;\n }\n\n projects.forEach((project) => {\n const projectItem = document.createElement('li'); // Create a new list item\n projectItem.classList.add('cs-drop-li');\n\n const projectLink = document.createElement('div'); // Create a link for the project\n projectLink.classList.add('cs-li-link', 'cs-drop-link');\n projectLink.textContent = project.name; // Assuming each project object has a 'name' property\n projectLink.setAttribute('id', project.id);\n\n projectItem.appendChild(projectLink); // Add the project link to the list item\n dropdownList.appendChild(projectItem); // Add the list item to the dropdown list\n });\n }\n}\n","import { clearPage } from '../utility/elementRender.js';\n\nimport { handleStorageError, renderContainer } from '../utility/todoRenderer.js';\n\nimport { ProjectManager } from '../entities/project.js';\n\nimport {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\n\n// Instantiate ProjectManager for managing projects\n// Manages projects and their associated todos\nconst projectManager = new ProjectManager();\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the home page content.\n *\n * @param {HTMLElement} content - The parent element where the home page will be rendered.\n */\nexport default function homePageLoader(content) {\n clearPage(content);\n let existingData;\n\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(\n PROJECTS_STORAGE_KEY,\n sampleData.projects\n );\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(existingData);\n section.appendChild(todoContainer);\n\n\n}\n\nexport { projectManager };","import { projectManager } from '../pageLoaders/homePageLoader.js';\nimport { renderContainer } from '../utility/todoRenderer.js';\nimport { dialogHandler } from '../utility/dialogHandler.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport {\n getDataFromLocalStorage,\n removeTodoFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Represents a Todo item.\n *\n * @class\n */\nexport class Todo {\n /**\n * Create a Todo item.\n *\n * @constructor\n * @param {number} id - The ID of the Todo item.\n * @param {string} title - The title of the Todo item.\n * @param {string} project - The project of the Todo item.\n * @param {string} description - The description of the Todo item.\n * @param {string} dueDate - The due date of the Todo item.\n * @param {string} priority - The priority of the Todo item.\n */\n constructor(id, title, project, description, dueDate, priority) {\n this.id = id;\n this.title = title;\n this.project = project;\n this.description = description;\n this.dueDate = dueDate;\n this.priority = priority;\n this.completed = false;\n }\n}\n\n/**\n * Represents a Todo Manager.\n *\n * @class\n */\nexport class TodoManager {\n /**\n * Create a Todo Manager.\n *\n * @constructor\n * @param {number} todoId - The ID of the Todo item.\n * @param {string} todoTitle - The title of the Todo item.\n * @param {string} projectName - The project name of the Todo item.\n * @param {string} todoDescription - The description of the Todo item.\n * @param {string} todoDueDate - The due date of the Todo item.\n * @param {string} todoPriority - The priority of the Todo item.\n * @param {boolean} todoCompleted - The completion status of the Todo item.\n */\n constructor(\n todoId,\n todoTitle,\n projectName,\n todoDescription,\n todoDueDate,\n todoPriority,\n todoCompleted\n ) {\n this.todoId = todoId;\n this.todoTitle = todoTitle;\n this.projectName = projectName;\n this.todoDescription = todoDescription;\n this.todoDueDate = todoDueDate;\n this.todoPriority = todoPriority;\n this.todoCompleted = todoCompleted;\n }\n\n /**\n * Handles the checkbox click event for a Todo item.\n *\n * @param {HTMLElement} checkbox - The checkbox element.\n * @param {HTMLElement} todoTitle - The title element of the Todo item.\n * @param {HTMLElement} todoDueDate - The due date element of the Todo item.\n * @param {number} todoId - The ID of the Todo item.\n */\n checkboxHandler(checkbox, todoTitle, todoDueDate, todoId) {\n // Retrieve the completion status from local storage\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n const todo = this.findTodoById(existingData, todoId);\n if (!todo) {\n console.error('Todo with ID', todoId, 'not found.');\n return;\n }\n const isCompleted = todo.completed;\n\n // Set initial visual representation based on completion status\n if (isCompleted) {\n checkbox.classList.add('todo-checked');\n todoTitle.style.textDecoration = 'line-through';\n todoDueDate.style.textDecoration = 'line-through';\n }\n\n // Function to handle checkbox click event\n const handleCheckBoxClick = (event) => {\n event.preventDefault();\n handleCheckBox();\n };\n\n // Function to toggle completion status and update visual representation\n const handleCheckBox = () => {\n // Toggle the 'todo-checked' class\n checkbox.classList.toggle('todo-checked');\n\n // Toggle line through todo title and due date\n const isCompleted = checkbox.classList.contains('todo-checked');\n todoTitle.style.textDecoration = isCompleted ? 'line-through' : '';\n todoDueDate.style.textDecoration = isCompleted\n ? 'line-through'\n : '';\n\n // Update todo completion status in local storage\n this.updateTodoCompletion(todoId, isCompleted);\n };\n\n // Add event listener to checkbox\n checkbox.addEventListener('click', handleCheckBoxClick);\n\n // Function to remove event listener from checkbox\n const removeEventListenerFromCheckBox = () => {\n checkbox.removeEventListener('click', handleCheckBoxClick);\n };\n\n return removeEventListenerFromCheckBox;\n }\n\n /**\n * Handles the details button click event for a Todo item.\n *\n * @param {HTMLElement} todoDetails - The details button element.\n * @param {HTMLElement} todoDetailsId - The details ID element.\n * @param {number} id - The ID of the Todo item.\n */\n todoDetailsHandler(todoDetails, todoDetailsId, id) {\n // Function to handle details button click event\n const handleDetailsButtonClick = (event) => {\n event.preventDefault();\n handleDetails();\n };\n\n // Function to handle details action\n const handleDetails = async () => {\n try {\n // Retrieve todo data from local storage based on todo ID\n const existingData =\n getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n const todoData = this.findTodoById(existingData, id);\n\n if (!todoData) {\n console.error(\n 'Todo with id: ',\n id,\n 'not found in local storage'\n );\n return;\n }\n\n // Open dialog with Todo details\n await dialogHandler(todoDetails, todoDetailsId, todoData);\n } catch (error) {\n console.error('Error handling details click: ', error);\n }\n };\n\n // Add event listener to details button\n todoDetails.addEventListener('click', handleDetailsButtonClick);\n\n // Function to remove event listener from details button\n const removeEventListenerFromDetails = () => {\n todoDetails.removeEventListener('click', handleDetailsButtonClick);\n };\n\n return removeEventListenerFromDetails;\n }\n\n /**\n * Handles the delete button click event for a Todo item.\n *\n * @param {HTMLElement} todoDelete - The delete button element.\n * @param {number} todoId - The ID of the Todo item.\n * @param {string} projectName - The project name of the Todo item.\n */\n todoDeleteHandler(todoDelete, todoId, projectName) {\n // Function to handle delete button click event\n const handleDeleteButtonClick = (event) => {\n event.preventDefault();\n handleDelete();\n };\n\n // Function to handle delete action\n const handleDelete = () => {\n const todoToRemove = todoId;\n\n // Remove event listener from delete button\n todoDelete.removeEventListener('click', handleDeleteButtonClick);\n\n // Remove event listeners for checkbox and details buttons\n const checkbox = document.getElementById(`checkbox-${todoId}`);\n const detailsButton = document.getElementById(`details-${todoId}`);\n\n if (checkbox && detailsButton) {\n const checkboxRemoveEventListener = this.checkboxHandler(\n checkbox,\n this.todoTitle,\n this.todoDueDate,\n this.todoId\n );\n const detailsRemoveEventListener = this.todoDetailsHandler(\n detailsButton,\n this.todoDetailsId,\n this.todoId\n );\n\n // Remove the event listeners before deleting todo item\n checkboxRemoveEventListener();\n detailsRemoveEventListener();\n\n // Remove todo item from local storage\n let existingData =\n getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n let updatedData = removeTodoFromLocalStorage(\n existingData,\n todoToRemove\n );\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, updatedData);\n\n // Remove todo item from project manager\n projectManager.removeTodoFromProject(projectName, todoToRemove);\n\n // Re-render the page\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(existingData);\n clearPage(section);\n section.appendChild(todoContainer);\n }\n };\n\n // Add event listener to delete button\n todoDelete.addEventListener('click', handleDeleteButtonClick);\n }\n\n /**\n * Updates the completion status of a Todo item.\n *\n * @param {number} todoId - The ID of the Todo item.\n * @param {boolean} isCompleted - The completion status of the Todo item.\n */\n updateTodoCompletion(todoId, isCompleted) {\n try {\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n if (existingData === null) {\n console.error(\n 'Cannot update todo completion status: No existing data found in local storage'\n );\n return;\n }\n\n // Update completion status of the Todo item in local storage\n const updatedData = existingData.map((project) => ({\n ...project,\n todos: project.todos.map((todo) => {\n if (todo.id === todoId) {\n return { ...todo, completed: isCompleted };\n }\n return todo;\n }),\n }));\n\n // Save update data to local storage\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, updatedData);\n } catch (error) {\n console.error(error);\n }\n }\n\n /**\n * Retrieves the todos that are due today.\n *\n * @param {Array} existingData - The existing todo items data.\n * @returns {Array} - The filtered todo items due today.\n */\n getTodosDueToday(existingData) {\n // Get today's date in format ('Y-m-d')\n const today = new Date().toISOString().split('T')[0];\n // Get filtered projects based on today\n const filteredTodosForToday = this.getFilteredProjects(\n existingData,\n today,\n today\n );\n return filteredTodosForToday;\n }\n\n /**\n * Retrieves todos due within the current week.\n *\n * @param {Array} existingData - The existing todo data.\n * @returns {Array} - The filtered todos due within the current week.\n */\n getTodosDueThisWeek(existingData) {\n // Define constants for days of the week using numeric values\n const SUNDAY = 0;\n const MONDAY = 1;\n const SATURDAY = 6;\n\n // Get today's date\n const today = new Date();\n const currentDayOfWeek = today.getDay();\n\n // Calculate the start of the week (Monday)\n const startOfWeek = new Date(today);\n startOfWeek.setDate(\n today.getDate() -\n currentDayOfWeek +\n (currentDayOfWeek === SUNDAY ? -SATURDAY : MONDAY)\n );\n startOfWeek.setHours(0, 0, 0, 0); // Set time to start of day\n\n // Calculate the end of the week (Sunday)\n const endOfWeek = new Date(startOfWeek);\n endOfWeek.setDate(startOfWeek.getDate() + SATURDAY); // End of week is 6 days from start\n endOfWeek.setHours(23, 59, 59, 999); // Set time to end of day\n\n const filteredTodosForThisWeek = this.getFilteredProjects(\n existingData,\n startOfWeek,\n endOfWeek\n );\n\n return filteredTodosForThisWeek;\n }\n\n /**\n * Filters projects and their todos based on the dueDate\n * being within the specified date range.\n *\n * @param {Array} existingData - The array of existing projects and todos.\n * @param {string} startDate - The start date of the date range.\n * @param {string} endDate - The end date of the date range.\n * @returns {Array} - The filtered projects and their todos.\n */\n getFilteredProjects(existingData, startDate, endDate) {\n // Filter projects and their todos based on the dueDate being within the specified date range\n // Need to filter projects because renderTodosList method expects projects\n const filteredProjects = existingData\n .map((project) => ({\n ...project,\n todos: project.todos.filter((todo) => {\n // Convert todo due date string to a Date object\n const todoDueDate = new Date(todo.dueDate);\n // Check if todo due date falls within the specified date range\n const todoDateRange =\n todoDueDate >= new Date(startDate) &&\n todoDueDate <= new Date(endDate);\n\n return todoDateRange;\n }),\n }))\n .filter((project) => project.todos.length > 0);\n\n return filteredProjects;\n }\n\n /**\n * Retrieves todos for a specific project from existing data.\n *\n * @param {Array} existingData - The existing data containing todos for multiple projects.\n * @param {string} projectName - The name of the project to retrieve todos for.\n * @returns {Array|null} - An array of todos for the specified project, or null if the project is not found.\n */\n getTodosForProject(existingData, projectName) {\n if (!existingData) {\n console.error('No existing data found in local storage');\n return null;\n }\n\n const filteredProjects = existingData.filter(\n (project) => project.name === projectName\n );\n\n if (!filteredProjects.length === 0) {\n console.error(`Project '${projectName}' not found`);\n return null;\n }\n return filteredProjects;\n }\n\n /**\n * Finds a Todo item by its ID.\n *\n * @param {Array} existingData - The existing data from local storage.\n * @param {number} todoId - The ID of the Todo item.\n * @returns {object|null} - The Todo item if found, otherwise null.\n */\n findTodoById(existingData, todoId) {\n for (const project of existingData) {\n for (const todo of project.todos) {\n if (todo.id === todoId) {\n return todo;\n }\n }\n }\n return null; // Return null if no todo with the specified ID is found\n }\n}\n","import { Todo } from '../entities/todoItems.js';\nimport { Project, ProjectManager } from '../entities/project.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport { getPriorityClass, renderTodoItem } from './todoRenderer.js';\nimport { removeDialog } from './dialogHandler.js';\nimport {\n saveDataToLocalStorage,\n getDataFromLocalStorage,\n editDataInLocalStorage,\n} from './localStorageManager.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n/**\n * Represents a form handler for managing todo items.\n */\nexport class TodoFormHandler {\n /**\n * Creates an instance of TodoFormHandler.\n *\n * @param {Document} document - The document object.\n * @param {ProjectManager} projectManager - The project manager object.\n */\n constructor(document, projectManager) {\n this.document = document;\n this.projectManager = projectManager;\n this.formElement = this.document.getElementById('todo-form');\n }\n\n /**\n * Handles the form submission event.\n *\n * @param {Event} event - The form submission event.\n */\n async handleSubmit(event) {\n event.preventDefault();\n try {\n const formData = this.extractFormData();\n const newTodo = this.createTodoFromFormData(formData);\n // Retrieve existing data from local storage\n let existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n if (!existingData) {\n existingData = sampleData.projects; // Fall back to sample data if no existing data\n }\n\n // Add the new todo to existing data\n const updatedData = this.addTodoToExistingData(\n existingData,\n newTodo\n );\n\n // Save the updated data back to local storage\n await saveDataToLocalStorage(PROJECTS_STORAGE_KEY, updatedData);\n\n this.addNewTodoToList(newTodo);\n this.clearForm();\n this.closeDialog();\n\n const dialog = document.getElementById('dialog');\n removeDialog(dialog);\n } catch (error) {\n console.error('Error handling form submission: ', error);\n }\n }\n\n /**\n * Handles the save event for a specific todo item.\n *\n * @param {Event} event - The save event.\n * @param {Todo} todoData - The todo item data.\n */\n async handleSave(event, todoData) {\n event.preventDefault();\n try {\n // Extract the relevant data from the form\n const formData = this.extractFormData(todoData);\n\n // Check if the project name has changed\n if (formData.project !== todoData.project) {\n this.updateProjectNameInManager(\n todoData.project,\n formData.project,\n todoData\n );\n }\n\n // Merge the extracted form data with the existing todo data\n const updatedTodoData = { ...todoData, ...formData };\n // Save the updated data to local storage\n await editDataInLocalStorage(\n PROJECTS_STORAGE_KEY,\n todoData.id,\n updatedTodoData\n );\n\n this.updatedTodoInList(updatedTodoData);\n this.clearForm();\n this.closeDialog();\n\n const dialog = document.getElementById('dialog');\n removeDialog(dialog);\n } catch (error) {\n console.error('Error saving data: ', error);\n }\n }\n\n /**\n * Update the project name in the existing data retrieved from local storage.\n *\n * @param {string} oldProjectName - The old project name.\n * @param {string} newProjectName - The new project name.\n * @param {Todo} todo - The todo item associated with the project.\n */\n updateProjectNameInManager(oldProjectName, newProjectName, todo) {\n // Retrieve existing data from local storage\n const existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n\n if (!existingData) {\n console.error('No existing data found in local storage.');\n return;\n }\n // Find the project index with the old name\n const projectIndex = existingData.findIndex(\n (project) => project.name === oldProjectName\n );\n\n if (projectIndex !== -1) {\n // Remove the todo item from the original project\n const updatedProject = existingData[projectIndex];\n updatedProject.todos = updatedProject.todos.filter(\n (existingTodo) => existingTodo.id !== todo.id\n );\n\n // Save the updated project back to existing data\n existingData[projectIndex] = updatedProject;\n\n // Create a new project with the new name if it doesn't exist\n const newProjectIndex = existingData.findIndex(\n (project) => project.name === newProjectName\n );\n\n if (newProjectIndex === -1) {\n const newProjectId = Date.now();\n const newProject = new Project(newProjectId, newProjectName);\n newProject.todos.push(todo);\n existingData.push(newProject);\n } else {\n // Add the todo item to the existing project with the new name\n existingData[newProjectIndex].todos.push(todo);\n }\n\n // Save the updated data back to local storage\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, existingData);\n } else {\n console.error(\n 'Project with specified name not found in existing data.'\n );\n }\n }\n\n /**\n * Extracts form data from the todo form.\n *\n * @param {Todo} [todoData={}] - The todo item data.\n * @returns {Object} - The extracted form data.\n */\n extractFormData(todoData = {}) {\n const formData = new FormData(this.formElement);\n return {\n id: todoData.id || '',\n title: formData.get('title'),\n project: formData.get('project'),\n description: formData.get('description'),\n dueDate: formData.get('dueDate'),\n priority: formData.get('priority'),\n };\n }\n\n /**\n * Adds a new todo item to the todo list.\n *\n * @param {Todo} newTodo - The new todo item.\n */\n addNewTodoToList(newTodo) {\n // Get the container element where todos are displayed\n const todoList = document.querySelector('.todo-list');\n\n // Render the new todo item\n const newTodoItem = renderTodoItem(newTodo);\n\n // Append the new todo item to the existing list\n todoList.appendChild(newTodoItem);\n }\n\n /**\n * Adds a new todo item to the existing data.\n *\n * @param {Array} existingData - The existing data.\n * @param {Todo} newTodo - The new todo item.\n * @returns {Array} - The updated data.\n */\n addTodoToExistingData(existingData, newTodo) {\n // Check if there's a project matching the new todo's project name\n const projectIndex = existingData.findIndex(\n (project) => project.name === newTodo.project\n );\n\n if (projectIndex !== -1) {\n // Add the new todo to the existing project\n existingData[projectIndex].todos.push(newTodo);\n } else {\n // Create a new project with the new todo\n existingData.push({\n id: Date.now(), // Generate a unique id\n name: newTodo.project,\n todos: [newTodo],\n });\n }\n\n return existingData;\n }\n\n /**\n * Updates a todo item in the todo list.\n *\n * @param {Todo} updatedTodo - The updated todo item.\n */\n updatedTodoInList(updatedTodo) {\n // Get the container where todos are displayed\n const todoList = document.querySelector('.todo-list');\n\n // Find the existing todo item in the list by its ID\n const todoItem = todoList.querySelector(`#todo-${updatedTodo.id}`);\n\n if (todoItem) {\n todoItem.querySelector('.todo-title').textContent =\n updatedTodo.title;\n todoItem.querySelector('.todo-dueDate').textContent =\n updatedTodo.dueDate;\n todoItem.className = `todo-container ${getPriorityClass(\n updatedTodo.priority\n )}`;\n }\n }\n\n /**\n * Creates a new todo item from form data.\n *\n * @param {Object} formData - The form data.\n * @returns {Todo} - The new todo item.\n */\n createTodoFromFormData(formData) {\n const random = Math.random().toFixed();\n const id = Date.now() + random;\n return new Todo(\n id,\n formData.title,\n formData.project,\n formData.description,\n formData.dueDate,\n formData.priority\n );\n }\n\n /**\n * Populates the todo form with data.\n *\n * @param {Todo} todoData - The todo item data.\n */\n populateTodoForm(todoData) {\n const todoForm = this.formElement;\n todoForm.elements.id = todoData.id;\n todoForm.elements['title'].value = todoData.title;\n todoForm.elements['project'].value = todoData.project;\n todoForm.elements['description'].value = todoData.description;\n todoForm.elements['dueDate'].value = todoData.dueDate;\n todoForm.elements['priority'].value = todoData.priority;\n }\n\n /**\n * Closes the dialog.\n */\n closeDialog() {\n const dialog = this.document.getElementById('dialog');\n dialog.close();\n }\n\n /**\n * Clears the form.\n */\n clearForm() {\n this.formElement.reset();\n }\n}\n","import { datePickerHandler } from '../utility/datePicker.js';\nimport { TodoFormHandler } from '../utility/todoFormHandler.js';\nimport { projectManager } from '../pageLoaders/homePageLoader.js';\n\n/**\n * Handles the dialog functionality based on the button clicked.\n *\n * @param {HTMLElement} button - The button element that triggered the dialog.\n * @param {String} id - The ID of the button element.\n * @param {Object} todoData - The data associated with the todo.\n */\nexport async function dialogHandler(button, id, todoData) {\n try {\n const newTodoButton = document.getElementById('newTodoButton');\n const detailsButton = document.getElementById(id);\n const dialog = await createDialog();\n\n if (button === newTodoButton) {\n setupNewTodoDialog(dialog);\n } else if (button === detailsButton) {\n setupDetailsDialog(dialog, todoData);\n }\n\n setupDialogClose(dialog);\n } catch (error) {\n console.error('Error in dialogHandler:', error);\n }\n}\n\n/**\n * Creates a dialog element and appends it to the document body.\n *\n * @returns {Promise} - A promise that resolves to the created dialog element.\n */\nasync function createDialog() {\n const dialog = document.createElement('dialog');\n dialog.id = 'dialog';\n\n const response = await fetch('dialogFormContent.html');\n if (!response.ok) {\n throw new Error('Failed to fetch dialog form content');\n }\n\n dialog.innerHTML = await response.text();\n document.body.appendChild(dialog);\n\n return dialog;\n}\n\n/**\n * Sets up the dialog for adding a new todo.\n *\n * @param {HTMLElement} dialog - The dialog element.\n */\nfunction setupNewTodoDialog(dialog) {\n dialog.showModal();\n datePickerHandler();\n\n const todoFormHandler = todoFormInit();\n setupFormButton(dialog, 'submit', 'Add');\n const form = document.querySelector('#todo-form');\n form.addEventListener('submit', newFormButtonEventHandler);\n\n function newFormButtonEventHandler(event) {\n event.preventDefault();\n todoFormHandler.handleSubmit(event);\n\n form.removeEventListener('submit', newFormButtonEventHandler);\n }\n}\n\n/**\n * Sets up the dialog for editing todo details.\n *\n * @param {HTMLElement} dialog - The dialog element.\n * @param {Object} todoData - The data associated with the todo.\n */\nfunction setupDetailsDialog(dialog, todoData) {\n dialog.showModal();\n datePickerHandler();\n\n const todoFormHandler = todoFormInit();\n\n const formButton = setupFormButton(dialog, 'save', 'Save');\n todoFormHandler.populateTodoForm(todoData);\n\n formButton.addEventListener('click', (event) => {\n detailsFormButtonEventHandler(event);\n });\n\n const detailsFormButtonEventHandler = (event) => {\n todoFormHandler.handleSave(event, todoData);\n\n formButton.removeEventListener('click', detailsFormButtonEventHandler);\n };\n}\n\n/**\n * Sets up the form button inside the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element.\n * @param {String} type - The type of the form button.\n * @param {String} text - The text content of the form button.\n * @returns {HTMLElement} - The form button element.\n */\nfunction setupFormButton(dialog, type, text) {\n const formButton = dialog.querySelector('#form-button');\n formButton.setAttribute('type', type);\n formButton.textContent = text;\n\n return formButton;\n}\n\n/**\n * Sets up the close functionality for the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element.\n */\nfunction setupDialogClose(dialog) {\n const dialogClose = dialog.querySelector('#dialog-close-btn');\n\n dialogClose.addEventListener('click', dialogCloseEventHandler);\n\n function dialogCloseEventHandler() {\n const formElement = dialog.querySelector('#todo-form');\n formElement.reset();\n dialog.close();\n removeDialog(dialog);\n\n dialogClose.removeEventListener('click', dialogCloseEventHandler);\n }\n}\n\n/**\n * Initializes the TodoFormHandler and returns an instance of it.\n *\n * @returns {TodoFormHandler} - An instance of the TodoFormHandler class.\n */\nfunction todoFormInit() {\n return new TodoFormHandler(document, projectManager);\n}\n\n/**\n * Removes the dialog element from the document body.\n *\n * @param {HTMLElement} dialog - The dialog element to be removed.\n */\nexport function removeDialog(dialog) {\n document.body.removeChild(dialog);\n}\n","import {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport {\n handleStorageError,\n renderContainer,\n} from '../utility/todoRenderer.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the today page content.\n *\n * @param {HTMLElement} content - The parent element where the today page will be rendered.\n */\nexport default function todayPageLoader(content) {\n clearPage(content);\n let existingData;\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n const todoManager = new TodoManager();\n const todoDueToday = todoManager.getTodosDueToday(existingData);\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(todoDueToday);\n section.appendChild(todoContainer);\n\n const title = document.querySelector('.title');\n const titleForToday = 'Due Today';\n title.textContent = title.textContent + ' ' + titleForToday;\n}\n","import {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport {\n handleStorageError,\n renderContainer,\n} from '../utility/todoRenderer.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the week page content.\n *\n * @param {HTMLElement} content - The parent element where the week page will be rendered.\n */\nexport default function weekPageLoader(content) {\n clearPage(content);\n let existingData;\n\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n const todoManager = new TodoManager();\n const todoDueThisWeek = todoManager.getTodosDueThisWeek(existingData);\n\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(todoDueThisWeek);\n section.appendChild(todoContainer);\n\n const title = document.querySelector('.title');\n const titleForToday = 'Due This Week';\n title.textContent = title.textContent + ' ' + titleForToday;\n}\n","import {\n getDataFromLocalStorage,\n saveDataToLocalStorage,\n} from '../utility/localStorageManager.js';\nimport { sampleData } from '../pageData/sampleData.js';\nimport {\n handleStorageError,\n renderContainer,\n} from '../utility/todoRenderer.js';\nimport { clearPage } from '../utility/elementRender.js';\nimport { TodoManager } from '../entities/todoItems.js';\n\nconst PROJECTS_STORAGE_KEY = 'projects';\n\n/**\n * Loads and displays the projects page content.\n *\n * @param {HTMLElement} content - The parent element where the projects page will be rendered.\n */\nexport default function projectsPageLoader(content, selectedProjectName) {\n clearPage(content);\n let existingData;\n\n try {\n // Try to retrieve existing data from local storage\n existingData = getDataFromLocalStorage(PROJECTS_STORAGE_KEY);\n // Check if existingData is null or undefined\n if (!existingData) {\n // If no existingData exists in local storage, save sample data\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n } catch (error) {\n handleStorageError(error);\n // Save sample data to local storage as as fallback\n saveDataToLocalStorage(PROJECTS_STORAGE_KEY, sampleData.projects);\n }\n\n // Filter todos for the selected project\n const todoManager = new TodoManager();\n const projectData = todoManager.getTodosForProject(\n existingData,\n selectedProjectName\n );\n\n // Render todos for the selected project\n const section = document.querySelector('#content');\n const todoContainer = renderContainer(projectData);\n section.appendChild(todoContainer);\n\n const title = document.querySelector('.title');\n const titleOfProject = 'In ' + selectedProjectName;\n title.textContent = title.textContent + ' ' + titleOfProject;\n}\n","/**\n * @file This file is the entry point of the application and\n * contains the main logic for loading different pages and handling navigation.\n * It imports CSS stylesheets, functionality modules, and images.\n * It also sets up event listeners for tab navigation, for the \"New Todo\" button and\n * updates the active state of navigation buttons.\n * @module index\n */\n// Importing global, main, and dark mode CSS stylesheets\nimport './styles/global.css';\nimport './styles/main.css';\nimport './styles/dark.css';\n\n// Importing functionality modules\nimport darkModeToggler from './modules/utility/darkMode.js';\nimport mobileNavigationToggling from './modules/utility/mobileNavigation.js';\nimport { dialogHandler } from './modules/utility/dialogHandler.js';\nimport { handleDialogError } from './modules/utility/todoRenderer.js';\n\n// Importing page loader functions\nimport homePageLoader from './modules/pageLoaders/homePageLoader.js';\nimport todayPageLoader from './modules/pageLoaders/todayPageLoader.js';\nimport weekPageLoader from './modules/pageLoaders/weekPageLoader.js';\nimport projectsPageLoader from './modules/pageLoaders/projectsPageLoader.js';\nimport { ProjectManager } from './modules/entities/project.js';\n\n// Global variables setup\n// Navigation button IDs\nconst navigationButtons = ['home', 'today', 'week', 'projects'];\nconst newTodoButton = document.getElementById('newTodoButton');\nconst content = document.getElementById('content');\n\n// Activate dark mode toggle functionality\ndarkModeToggler();\n\n// Set up mobile navigation toggle functionality\nmobileNavigationToggling();\n\n// Load the initial home page content\nhomePageLoader(content);\n\n// Add projects in navigation bar\nconst projectManager = new ProjectManager();\nprojectManager.displayProjectsInNavigationBar();\n\n/**\n * Set up click event listeners for tab navigation in the header.\n * This allows switching between different pages\n * (home, todos for today, todos for this week, projects) and\n * ensures the appropriate content is loaded and displayed.\n */\ntry {\n navigationButtons.forEach((navigationButton) => {\n const button = document.getElementById(navigationButton);\n\n button.addEventListener('click', buttonEventHandler);\n\n function buttonEventHandler() {\n switch (navigationButton) {\n case 'home':\n homePageLoader(content);\n break;\n case 'today':\n todayPageLoader(content);\n break;\n case 'week':\n weekPageLoader(content);\n break;\n default:\n homePageLoader(content); // Default page if page is not specified\n }\n updateNavigationActiveState(navigationButton);\n }\n });\n} catch (error) {\n console.error(\n 'Error setting up event listeners for tab navigation: ',\n error\n );\n}\n\n/**\n * Handles the click event for dropdown buttons for Projects\n */\ntry {\n // Add event listeners to Project dropdown items\n const dropdown = document.getElementById('projects');\n dropdown.addEventListener('click', dropdownButtonEventHandler);\n\n function dropdownButtonEventHandler(event) {\n // Check if the clicked element is a dropdown item\n if (event.target.classList.contains('cs-drop-link')) {\n // Prevent default behavior of links\n event.preventDefault();\n\n // Get the text content of the clicked item\n const selectedProjectName = event.target.textContent.trim();\n\n // Pass the selected project name to the projectsPageLoader function\n projectsPageLoader(content, selectedProjectName);\n }\n }\n} catch (error) {\n console.error('Error handling dropdown buttons: ', error);\n}\n\n/**\n * Handles the click event for the \"New Todo\" button and opens a dialog.\n */\ntry {\n const handleNewTodoButtonClick = async () => {\n await dialogHandler(newTodoButton, 'newTodoButton');\n };\n newTodoButton.addEventListener('click', () => {\n handleNewTodoButtonClick();\n });\n} catch (error) {\n handleDialogError(error);\n}\n\n/**\n * Updates the active state of navigation buttons and removes active state in mobile navigation.\n *\n * @param {string} activeButtonId - The ID of the navigation button to be marked as active.\n */\nexport function updateNavigationActiveState(activeButtonId) {\n // Selecting elements related to mobile navigation\n const body = document.querySelector('body');\n const navbarMenu = document.querySelector('#cs-navigation');\n const hamburgerMenu = document.querySelector('#cs-navigation .cs-toggle');\n\n try {\n navigationButtons.forEach((buttonId) => {\n const buttonElement = document.getElementById(buttonId);\n if (buttonElement) {\n if (buttonId === activeButtonId) {\n buttonElement.classList.add('cs-active');\n\n // Close mobile navigation menu when a navigation button is activated\n hamburgerMenu.classList.remove('cs-active');\n navbarMenu.classList.remove('cs-active');\n body.classList.remove('cs-open');\n } else {\n buttonElement.classList.remove('cs-active');\n }\n }\n });\n } catch (error) {\n console.error('Error updating navigation state: ', error);\n }\n}\n","/**\n * Toggles dark mode for the application based on user preferences and button clicks.\n *\n * This function enables dark mode if the user has previously chosen it or if their browser\n * preferences indicate a preference for dark mode. It also allows users to toggle between\n * light and dark mode by clicking a button.\n */\nexport default function darkModeToggler() {\n // Helper functions to toggle dark mode\n function enableDarkMode() {\n document.body.classList.add('dark-mode');\n localStorage.setItem('theme', 'dark');\n }\n function disableDarkMode() {\n document.body.classList.remove('dark-mode');\n localStorage.setItem('theme', 'light');\n }\n\n // Determines a new users dark mode preferences\n function detectColorScheme() {\n // Default to the light theme\n let theme = 'light';\n\n // Check localStorage for a saved 'theme' variable. if it's there, the user has visited before, so apply the necessary theme choices\n if (localStorage.getItem('theme')) {\n theme = localStorage.getItem('theme');\n }\n // If it's not there, check to see if the user has applied dark mode preferences themselves in the browser\n else if (\n window.matchMedia &&\n window.matchMedia('(prefers-color-scheme: dark)').matches\n ) {\n theme = 'dark';\n }\n\n // If there is no preference set, the default of light will be used. apply accordingly\n theme === 'dark' ? enableDarkMode() : disableDarkMode();\n }\n\n // Run on page load\n detectColorScheme();\n\n // Add event listener to the dark mode button toggle\n const darkModeButton = document.getElementById('dark-mode-toggle');\n darkModeButton.addEventListener('click', darkModeButtonHandler);\n\n // Handler function for the dark mode button click event\n function darkModeButtonHandler(event) {\n event.preventDefault();\n // Toggle between dark and light mode based on the current theme\n localStorage.getItem('theme') === 'light'\n ? enableDarkMode()\n : disableDarkMode();\n }\n}\n"],"names":["module","exports","entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","Object","freeze","seal","create","apply","construct","Reflect","x","fun","thisValue","args","Func","arrayForEach","unapply","Array","prototype","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringToString","toString","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","func","TypeError","_len2","arguments","length","_key2","thisArg","_len","_key","addToSet","set","array","transformCaseFunc","undefined","l","element","lcElement","cleanArray","index","clone","object","newObject","property","value","isArray","constructor","lookupGetter","prop","desc","get","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","text","html","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","EXPRESSIONS","__proto__","getGlobal","window","createDOMPurify","DOMPurify","root","version","removed","document","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","trustedTypes","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","createHTMLDocument","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","createHTML","createScriptURL","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","scriptUrl","_","console","warn","_createTrustedTypesPolicy","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_forceRemove","node","parentNode","removeChild","remove","_removeAttribute","name","attribute","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","elm","nodeName","textContent","attributes","namespaceURI","hasChildNodes","tagName","allowedTags","firstElementChild","_isBasicCustomElement","i","parent","parentTagName","Boolean","_checkValidNamespace","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","attr","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","hookFunction","removeHook","removeHooks","removeAllHooks","factory","assign","target","_i","_loop_1","source","keys","key","_a","args_1","CSbody","querySelector","CSnavbarMenu","CShamburgerMenu","HOOKS","defaults","_disable","allowInput","allowInvalidPreload","altFormat","altInput","altInputClass","animate","navigator","userAgent","ariaDateFormat","autoFillDefaultTime","clickOpens","closeOnSelect","conjunction","dateFormat","defaultHour","defaultMinute","defaultSeconds","disable","disableMobile","enableSeconds","enableTime","errorHandler","err","getWeek","givenDate","date","Date","getTime","setHours","setDate","getDate","getDay","week1","getFullYear","Math","round","hourIncrement","ignoredFocusElements","inline","locale","minuteIncrement","mode","monthSelectorType","nextArrow","noCalendar","now","onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition","plugins","position","positionElement","prevArrow","shorthandCurrentMonth","showMonths","static","time_24hr","weekNumbers","wrap","english","weekdays","shorthand","longhand","months","daysInMonth","firstDayOfWeek","ordinal","nth","s","rangeSeparator","weekAbbreviation","scrollTitle","toggleTitle","amPM","yearAriaLabel","monthAriaLabel","hourAriaLabel","minuteAriaLabel","pad","number","slice","bool","debounce","fn","wait","t","_this","this","clearTimeout","setTimeout","arrayify","obj","toggleClass","elem","className","classList","add","e","clearNode","findParent","condition","createNumberInput","inputClassName","opts","wrapper","numInput","arrowUp","arrowDown","type","pattern","getEventTarget","event","composedPath","error","doNothing","monthToStr","monthNumber","revFormat","D","F","dateObj","monthName","setMonth","G","hour","getHours","parseFloat","H","J","day","K","M","shortMonth","S","seconds","setSeconds","U","unixSeconds","W","weekNum","weekNumber","parseInt","Y","year","setFullYear","Z","ISODate","d","h","minutes","setMinutes","j","m","month","n","u","unixMillSeconds","w","y","tokenRegex","formats","toISOString","options","getMonth","getSeconds","getMinutes","substring","createDateFormatter","_b","config","_c","l10n","_d","isMobile","frmt","overrideLocale","formatDate","split","map","c","arr","join","createDateParser","givenFormat","timeless","customLocale","parsedDate","dateOrig","toFixed","format","datestr","parseDate","matched","ops","matchIndex","regexStr","token","isBackSlash","escaped","exec","val","isNaN","Error","compareDates","date1","date2","isBetween","ts","ts1","ts2","min","max","calculateSecondsSinceMidnight","hours","parseSeconds","secondsSinceMidnight","floor","duration","DAY","getDefaultHours","minDate","minHour","minMinutes","minSeconds","maxDate","maxHr","maxMinutes","__assign","p","__spreadArrays","il","r","k","a","jl","DEBOUNCED_CHANGE_MS","FlatpickrInstance","instanceConfig","self","flatpickr","defaultConfig","getClosestActiveElement","calendarContainer","getRootNode","activeElement","bindToInstance","bind","setCalendarWidth","requestAnimationFrame","style","visibility","display","daysContainer","daysWidth","days","offsetWidth","width","weekWrapper","removeProperty","updateTime","selectedDates","defaultDate","getMilliseconds","latestSelectedDateObj","preventDefault","isKeyDown","eventTarget","input","step","curValue","newValue","delta","which","isHourElem","hourElement","isMinuteElem","minuteElement","incrementNumInput","abs","timeWrapper","prevValue","_input","setHoursFromInputs","updateValue","_debouncedChange","secondElement","limitMinHours","minTime","minDateHasTime","limitMaxHours","maxTime","maxDateHasTime","minBound","maxBound","currentTime","result","setHoursFromDate","onYearInput","changeYear","handler","ev","el","addEventListener","_handlers","removeEventListener","triggerChange","triggerEvent","jumpToDate","jumpDate","jumpTo","oldYear","currentYear","oldMonth","currentMonth","message","buildMonthSwitch","redraw","timeIncrement","contains","inputElem","createEvent","dispatchEvent","createDay","_dayNumber","dateIsEnabled","isEnabled","dayElement","$i","todayDateElem","tabIndex","isDateSelected","selectedDateElem","isDateInRange","insertAdjacentHTML","focusOnDayElem","targetNode","focus","onMouseOver","getFirstAvailableDay","startMonth","endMonth","children","startIndex","endIndex","focusOnDay","current","offset","dayFocused","isInView","startElem","givenMonth","loopDelta","numMonthDays","changeMonth","getNextAvailableDay","buildMonthDays","firstOfMonth","prevMonthDays","utils","getDaysInMonth","isMultiMonth","prevMonthDayClass","nextMonthDayClass","dayNumber","dayIndex","dayNum","dayContainer","buildDays","frag","shouldBuildMonth","monthsDropdownContainer","selected","buildMonth","monthElement","container","monthNavFragment","selectedMonth","yearInput","tabindex","yearElement","disabled","buildMonths","monthNav","prevMonthNav","yearElements","monthElements","nextMonthNav","buildWeekdays","weekdayContainer","updateWeekdays","splice","isOffset","_hidePrevMonthArrow","_hideNextMonthArrow","updateNavigationCurrentMonth","isCalendarElem","documentClick","isOpen","eventTarget_1","isCalendarElement","lostFocus","path","relatedTarget","isIgnored","some","timeContainer","close","clear","newYear","newYearNum","isNewYear","dateToCheck","enable","parsed","to","onBlur","isInput","valueChanged","trimEnd","getDateStr","allowKeydown","allowInlineKeydown","keyCode","blur","open","isTimeObj","focusAndClose","selectDate","delta_1","ctrlKey","stopPropagation","currentYearElement","elems","concat","pluginElements","filter","shiftKey","charAt","cellClass","hoverDate","initialDate","rangeStartDate","rangeEndDate","containsDisabled","minRange","maxRange","rContainer","querySelectorAll","dayElem","timestamp","outOfRange","onResize","positionCalendar","minMaxDateSetter","inverseDateObj","getInputElem","setupLocale","l10ns","default","JSON","parse","stringify","dataset","customPositionElement","_positionElement","calendarHeight","reduce","acc","child","offsetHeight","calendarWidth","configPos","configPosVertical","configPosHorizontal","inputBounds","getBoundingClientRect","distanceFromBottom","innerHeight","bottom","showOnTop","top","pageYOffset","left","pageXOffset","isCenter","isRight","right","rightMost","centerMost","editableSheet","styleSheets","sheet","cssRules","head","getDocumentStyleSheet","bodyWidth","centerLeft","centerIndex","centerStyle","insertRule","centerBefore","msMaxTouchPoints","selectedDate","shouldChangeMonth","selectedIndex","sort","b","single","range","loadedPlugins","_bind","_setHoursFromDate","_positionCalendar","triggerChangeEvent","toInitial","mobileInput","_initialDate","_createElement","destroy","lastChild","_type","click","wasOpen","select","option","CALLBACKS","setSelectedDate","toggle","updatePositionElement","inputDate","dates","parseDateRules","rule","initEvent","specificFormat","dObj","mobileFormatStr","onMonthNavClick","isPrevMonth","isNextMonth","boolOpts","userConfig","defineProperty","_enable","timeMode","defaultDateFormat","defaultAltFormat","_minDate","_maxDate","minMaxTimeSetter","_minTime","_maxTime","pluginConf","parseConfig","placeholder","required","nextSibling","preloadedDate","setupDates","yr","__hidePrevMonthArrow","__hideNextMonthArrow","innerContainer","buildWeeks","separator","hourInput","minuteInput","military2ampm","secondInput","title","buildTime","customAppend","appendTo","build","evt","inputType","defaultValue","setupMobile","debouncedResize","ontouchstart","capture","bindEvents","isSafari","init","_flatpickr","nodeList","nodes","HTMLElement","instances","HTMLCollection","NodeList","selector","en","localize","setDefaults","jQuery","fp_incr","datePickerHandler","dueDateInput","getElementById","theme","createDiv","attributeName","attributeValue","div","createTitle","clearPage","sampleData","projects","id","todos","project","description","dueDate","priority","completed","renderContainer","projectData","todosList","list","itemData","renderItem","createList","todo","listItem","renderTodoItem","renderTodosList","item","renderContent","createListItem","getPriorityClass","renderTodoContent","checkbox","todoTitle","todoDueDate","paragraph","createParagraph","todoDetails","todoDelete","todoDetailsId","todoManager","TodoManager","checkboxHandler","todoDeleteHandler","todoDetailsHandler","deleteIcon","createDeleteIcon","handleStorageError","saveDataToLocalStorage","Promise","resolve","reject","serializedData","localStorage","setItem","getDataFromLocalStorage","getItem","currentDate","currentDayOfWeek","difference","currentDay","todosPerDay","ceil","currentTodoIndex","todosForCurrentDay","adjustDueDatesForCurrentWeek","PROJECTS_STORAGE_KEY","Project","ProjectManager","addTodoToProject","getProjectByName","removeTodoFromProject","projectName","todoId","log","find","getProjectById","projectId","existingData","selectedProject","displayProjectsInNavigationBar","projectsDropdown","dropdownList","projectItem","projectLink","projectManager","homePageLoader","section","todoContainer","Todo","todoDescription","todoPriority","todoCompleted","findTodoById","textDecoration","handleCheckBoxClick","handleCheckBox","isCompleted","updateTodoCompletion","handleDetailsButtonClick","handleDetails","async","todoData","dialogHandler","handleDeleteButtonClick","handleDelete","todoToRemove","detailsButton","checkboxRemoveEventListener","detailsRemoveEventListener","updatedData","todoIDToRemove","removeTodoFromLocalStorage","getTodosDueToday","today","getFilteredProjects","getTodosDueThisWeek","startOfWeek","endOfWeek","startDate","endDate","getTodosForProject","filteredProjects","TodoFormHandler","handleSubmit","formData","extractFormData","newTodo","createTodoFromFormData","addTodoToExistingData","addNewTodoToList","clearForm","closeDialog","removeDialog","handleSave","updateProjectNameInManager","updatedTodoData","newData","projectIndex","todoIndex","findIndex","newProjectName","newProjectIndex","newProjectId","newProject","updateTodoProject","editDataInLocalStorage","updatedTodoInList","oldProjectName","updatedProject","existingTodo","FormData","todoList","newTodoItem","updatedTodo","todoItem","random","populateTodoForm","todoForm","elements","reset","button","newTodoButton","dialog","response","fetch","ok","createDialog","showModal","todoFormHandler","todoFormInit","setupFormButton","form","newFormButtonEventHandler","setupNewTodoDialog","formButton","detailsFormButtonEventHandler","setupDetailsDialog","dialogClose","dialogCloseEventHandler","setupDialogClose","navigationButtons","enableDarkMode","disableDarkMode","matchMedia","detectColorScheme","darkModeToggler","csUL","ariaExpanded","dropDowns","onClick","mobileNavigationToggling","navigationButton","todoDueToday","todayPageLoader","todoDueThisWeek","weekPageLoader","activeButtonId","navbarMenu","hamburgerMenu","buttonId","buttonElement","updateNavigationActiveState","dropdownButtonEventHandler","selectedProjectName","titleOfProject","projectsPageLoader","handleNewTodoButtonClick","handleDialogError"],"sourceRoot":""} \ No newline at end of file
title, description, dueDate and priority