{"version":3,"sources":["webpack:///./js/components/init-homepage-top-banner-close.ts","webpack:///./node_modules/when-dom-ready/dist/index.es2015.js"],"names":["whenDomReady","then","document","querySelectorAll","forEach","warningBanner","closeButton","querySelector","addEventListener","classList","add","loadedStates","cb","doc","Promise","resolve","window","done","setTimeout","indexOf","readyState","resume","val"],"mappings":"2FAAA,mBAaAA,cAAeC,MAZf,WAC2BC,SAASC,iBAAiB,wBAClCC,SAAQ,SAAAC,GACnB,IAAMC,EAAcD,EAAcE,cAAc,8BAC3CD,GAGLA,EAAYE,iBAAiB,SAAS,WAClCH,EAAcI,UAAUC,IAAI,oB,gCCNxC,IAAIC,EAAe,CAAC,cAAe,YAG/BX,EAAe,SAAsBY,EAAIC,GAC5C,OAAO,IAAIC,SAAQ,SAAUC,GAExBH,GAAoB,mBAAPA,IAChBC,EAAMD,EACNA,EAAK,MAINC,EAAMA,GAAOG,OAAOd,SAGpB,IAAIe,EAAO,WACV,OAAOF,OAAcH,GAAMM,WAAWN,OAKO,IAA1CD,EAAaQ,QAAQN,EAAIO,YAC5BH,IAEAJ,EAAIL,iBAAiB,mBAAoBS,OAM5CjB,EAAaqB,OAAS,SAAUR,GAC/B,OAAO,SAAUS,GAChB,OAAOtB,EAAaa,GAAKZ,MAAK,WAC7B,OAAOqB,OAKK","file":"23-9444b5d4369c5a50d5e6.js","sourcesContent":["import whenDomReady from 'when-dom-ready';\r\nfunction initialise() {\r\n const warningBanners = document.querySelectorAll('.homepage-top-banner');\r\n warningBanners.forEach(warningBanner => {\r\n const closeButton = warningBanner.querySelector('.homepage-top-banner-close');\r\n if (!closeButton) {\r\n return;\r\n }\r\n closeButton.addEventListener('click', () => {\r\n warningBanner.classList.add('hidden');\r\n });\r\n });\r\n}\r\nwhenDomReady().then(initialise);\r\n","/* eslint no-void: \"off\" */\n\n// Loaded ready states\nvar loadedStates = ['interactive', 'complete'];\n\n// Return Promise\nvar whenDomReady = function whenDomReady(cb, doc) {\n\treturn new Promise(function (resolve) {\n\t\t// Allow doc to be passed in as the lone first param\n\t\tif (cb && typeof cb !== 'function') {\n\t\t\tdoc = cb;\n\t\t\tcb = null;\n\t\t}\n\n\t\t// Use global document if we don't have one\n\t\tdoc = doc || window.document;\n\n\t\t// Handle DOM load\n\t\tvar done = function done() {\n\t\t\treturn resolve(void (cb && setTimeout(cb)));\n\t\t};\n\n\t\t// Resolve now if DOM has already loaded\n\t\t// Otherwise wait for DOMContentLoaded\n\t\tif (loadedStates.indexOf(doc.readyState) !== -1) {\n\t\t\tdone();\n\t\t} else {\n\t\t\tdoc.addEventListener('DOMContentLoaded', done);\n\t\t}\n\t});\n};\n\n// Promise chain helper\nwhenDomReady.resume = function (doc) {\n\treturn function (val) {\n\t\treturn whenDomReady(doc).then(function () {\n\t\t\treturn val;\n\t\t});\n\t};\n};\n\nexport default whenDomReady;\n//# sourceMappingURL=index.es2015.js.map\n"],"sourceRoot":""}