{"version":3,"sources":["app.js"],"names":["_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","iter","Symbol","iterator","isArray","len","length","i","arr2","ready","fn","document","attachEvent","readyState","addEventListener","handleAlertBar","alertBar","querySelector","cookieIdentifier","getElementById","classList","item","getCookie","style","display","closeAlertBarButton","cookie","cname","ca","split","console","log","c","charAt","substring","indexOf","configureNotify","notify","configure","squareCorners","autoHide","error","warn","colors","headings","turnOnNotify","systemMessages","querySelectorAll","errorMessages","forEach","el","innerHTML","parentNode","removeChild","concat","feather","replace","mobileNavToggleButton","sideNavContent","contains","remove","icons","toSvg","add"],"mappings":"AAAA,aAEA,SAASA,mBAAmBC,GAAO,OAAOC,mBAAmBD,IAAQE,iBAAiBF,IAAQG,4BAA4BH,IAAQI,qBAElI,SAASA,qBAAuB,MAAM,IAAIC,UAAU,wIAEpD,SAASF,4BAA4BG,EAAGC,GAAU,GAAKD,EAAL,CAAgB,GAAiB,iBAANA,EAAgB,OAAOE,kBAAkBF,EAAGC,GAAS,IAAIE,EAAIC,OAAOC,UAAUC,SAASC,KAAKP,GAAGQ,MAAM,GAAI,GAAiE,MAAnD,WAANL,GAAkBH,EAAES,cAAaN,EAAIH,EAAES,YAAYC,MAAgB,QAANP,GAAqB,QAANA,EAAoBQ,MAAMC,KAAKZ,GAAc,cAANG,GAAqB,2CAA2CU,KAAKV,GAAWD,kBAAkBF,EAAGC,QAAzG,GAE7S,SAASL,iBAAiBkB,GAAQ,GAAsB,oBAAXC,QAA0BA,OAAOC,YAAYZ,OAAOU,GAAO,OAAOH,MAAMC,KAAKE,GAE1H,SAASnB,mBAAmBD,GAAO,GAAIiB,MAAMM,QAAQvB,GAAM,OAAOQ,kBAAkBR,GAEpF,SAASQ,kBAAkBR,EAAKwB,IAAkB,MAAPA,GAAeA,EAAMxB,EAAIyB,UAAQD,EAAMx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C,GAAgBG,QAAQ,SAAUC,GAC3Cb,OAAON,IAAImB,EAAGC,WACdD,EAAGE,WAAWC,YAAYH,KAE5BpD,MAAMC,KAAKiD,GAAeC,QAAQ,SAAUC,GAC1Cb,OAAOI,MAAMS,EAAGC,WAChBD,EAAGE,WAAWC,YAAYH,MAd1BpD,MAAMC,KAAK,GAAGuD,OAAO1E,mBAAmBkE,GAAiBlE,mBAAmBoE,KAAiBC,QAAQ,SAAUC,GAC7GA,EAAG3B,MAAMC,QAAU,aAiBzBf,MAAM,WAQJ,GANA8C,QAAQC,UAEJ7C,SAASM,cAAc,kBAAkBF,iBAE7C8B,eAEIlC,SAASM,cAAc,gBAAiB,CAC1C,IAAIwC,EAAwB9C,SAASM,cAAc,6BAC/CyC,EAAiB/C,SAASM,cAAc,aAAakC,UAEzDxC,SAASM,cAAc,6CAA6CkC,UAAYO,EAehFD,EAAsB3C,iBAAiB,QAbtB,WACX2C,EAAsBrC,UAAUuC,SAAS,WAE3CF,EAAsBrC,UAAUwC,OAAO,UACvCH,EAAsBN,UAAYI,QAAQM,MAAY,KAAEC,QAAU,sBAGlEL,EAAsBrC,UAAU2C,IAAI,UACpCN,EAAsBN,UAAYI,QAAQM,MAAS,EAAEC,QAAU","sourcesContent":["// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later/* global feather */\r\n/* global notify */\r\n\r\n// Our ready function\r\nconst ready = (fn) => {\r\n\tif (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\r\n\t\tfn();\r\n\t} else {\r\n\t\tdocument.addEventListener('DOMContentLoaded', fn);\r\n\t}\r\n};\r\n\r\n// Alert Bar\r\nconst handleAlertBar = () => {\r\n\tconst alertBar = document.querySelector('div.alert-bar');\r\n\tconst hideBar = () => {\r\n\t\talertBar.style.display = 'none';\r\n\t};\r\n\tconst showBar = () => {\r\n\t\talertBar.style.display = 'block';\r\n\t};\r\n\r\n\t//get name of first class of button to be used as the name of the cookie\r\n\tvar cookieIdentifier = document.getElementById('alert-close-button').classList.item(0);\r\n\r\n\tif (!getCookie(cookieIdentifier)) {\r\n\t\tshowBar();\r\n\t}\r\n\tconst closeAlertBarButton = document.querySelector('a.alert-bar-close');\r\n\r\n\tif (closeAlertBarButton) {\r\n\t\tcloseAlertBarButton.addEventListener('click', () => {\r\n\t\t\thideBar();\r\n\t\t\tdocument.cookie = cookieIdentifier + '=true; expires=Mon, 17 Mar 2038 23:59:59 GMT; SameSite=Lax; path=/';\r\n\t\t});\r\n\t}\r\n};\r\n\r\nfunction getCookie(cname) {\r\n\tvar name = cname + \"=\";\r\n\tvar ca = document.cookie.split(';');\r\n\tconsole.log(ca);\r\n\tfor(var i = 0; i < ca.length; i++) {\r\n\t var c = ca[i];\r\n\t while (c.charAt(0) == ' ') {\r\n\t\tc = c.substring(1);\r\n\t }\r\n\t if (c.indexOf(name) == 0) {\r\n\t\treturn c.substring(name.length, c.length);\r\n\t }\r\n\t}\r\n\treturn \"\";\r\n}\r\n\r\n\r\n\r\n// Configures notify\r\nconst configureNotify = () => {\r\n\tnotify.configure({\r\n\t\tsquareCorners: true,\r\n\t\tautoHide: {\r\n\t\t\terror: false,\r\n\t\t\tlog: false,\r\n\t\t\twarn: false\r\n\t\t},\r\n\t\tcolors: {\r\n\t\t\terror: '#d34259',\r\n\t\t\tlog: '#87bcde',\r\n\t\t\twarn: '#ffbc42'\r\n\t\t},\r\n\t\theadings: {\r\n\t\t\terror: 'Error:',\r\n\t\t\tlog: '',\r\n\t\t\twarn: 'Warning:'\r\n\t\t}\r\n\t});\r\n};\r\n\r\n// Replace all system messages and error messages with notify notifications\r\nconst turnOnNotify = () => {\r\n\t// First, just make sure notify is configured properly\r\n\tconfigureNotify();\r\n\r\n\t// Then grab all the messages\r\n\tconst systemMessages = document.querySelectorAll('.systemMessage');\r\n\tconst errorMessages = document.querySelectorAll('.errorMessage');\r\n\r\n\t// If notify isn't loaded for some reason, just make all the messages visible\r\n\tif (!notify) {\r\n\t\tArray.from([...systemMessages, ...errorMessages]).forEach(el => { el.style.display = 'initial'; });\r\n\t\treturn;\r\n\t}\r\n\r\n\t// If notify is there, then loop through all the messages, notify the user of\r\n\t// their contents, then remove them from the page.\r\n\tArray.from(systemMessages).forEach(el => {\r\n\t\tnotify.log(el.innerHTML);\r\n\t\tel.parentNode.removeChild(el);\r\n\t});\r\n\tArray.from(errorMessages).forEach(el => {\r\n\t\tnotify.error(el.innerHTML);\r\n\t\tel.parentNode.removeChild(el);\r\n\t});\r\n};\r\n\r\nready(() => {\r\n\t// Turn on feather icons\r\n\tfeather.replace();\r\n\r\n\t// Handle 'new template!' alert bar if it exists\r\n\tif (document.querySelector('div.alert-bar')) handleAlertBar();\r\n\r\n\t// Turn on notify\r\n\tturnOnNotify();\r\n\r\n\t// Mobile nav\r\n\tif (document.querySelector('nav.side-nav')) {\r\n\t\tconst mobileNavToggleButton = document.querySelector('.mobile-nav-toggle-button');\r\n\t\tconst sideNavContent = document.querySelector('.side-nav').innerHTML;\r\n\r\n\t\t// Copy the nav html into the mobile nav\r\n\t\tdocument.querySelector('.side-nav-mobile .side-nav-mobile-content').innerHTML = sideNavContent;\r\n\r\n\t\t// Function for toggling the mobile nav\r\n\t\tconst toggleMenu = () => {\r\n\t\t\tif (mobileNavToggleButton.classList.contains('active')) {\r\n\t\t\t\t// We want to hide the menu\r\n\t\t\t\tmobileNavToggleButton.classList.remove('active');\r\n\t\t\t\tmobileNavToggleButton.innerHTML = feather.icons['menu'].toSvg() + 'Menu';\r\n\t\t\t} else {\r\n\t\t\t\t// We want to show the menu\r\n\t\t\t\tmobileNavToggleButton.classList.add('active');\r\n\t\t\t\tmobileNavToggleButton.innerHTML = feather.icons['x'].toSvg() + 'Close Menu';\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Attach the toggle function to the button\r\n\t\tmobileNavToggleButton.addEventListener('click', toggleMenu);\r\n\r\n\t\t// Convert any flat html notifications to notify notifications\r\n\t\t// 10/02/2020: MB and RT - Commented out because an error was being thrown,\r\n\t\t//\t\t\t\t\t\t\tbecause the function is not defined anywhere.\r\n\t\t// convertMessagesToNotifications();\r\n\t}\r\n});\r\n// @license-end"],"file":"app.js"}