{"version":3,"sources":["hero-dots.js"],"names":["viewport","Viewport","AndrewMartin","breakpoints","isTabletOrSmaller","matches","updateHeroDotsPosition","heroElement","document","querySelector","classList","contains","heroItem","heroImage","heroDots","top","Math","floor","getBoundingClientRect","height","style","concat","right","bottom","resize"],"mappings":"AAAA,IAAMA,SAAW,IAAIC,SAASC,aAAaC,aACrCC,kBAAoB,WAAH,OAASJ,SAASK,QAAQ,SAAS,EAEpDC,uBAAyB,WAC3B,IAAMC,EAAcC,SAASC,cAAc,SAC3C,GACIF,GACAA,EAAYG,UAAUC,SAAS,eAC/BP,oBACF,CACE,IAAMQ,EAAWJ,SAASC,cAAc,+BAClCI,EAAYL,SAASC,cAAc,8BACnCK,EAAWN,SAASC,cAAc,+BACxC,GAAIG,GAAYC,GAAaC,EAAU,CACnC,IACMC,EADkBC,KAAKC,MAAMJ,EAAUK,wBAAwBC,QACvC,GAC9BL,EAASM,MAAML,IAAG,GAAAM,OAAMN,EAAG,MAC3BD,EAASM,MAAME,MAAQ,OACvBR,EAASM,MAAMG,OAAS,MAC5B,CACJ,KAAO,CAEH,IAAMT,EAAWN,SAASC,cAAc,+BACpCK,IACAA,EAASM,MAAML,IAAM,GACrBD,EAASM,MAAMG,OAAS,GACxBT,EAASM,MAAME,MAAQ,GAE/B,CACJ,EAGAhB,yBAGAN,SAASwB,OAAO,WACZlB,wBACJ","file":"../../javascript/hero-dots.js","sourcesContent":["const viewport = new Viewport(AndrewMartin.breakpoints);\nconst isTabletOrSmaller = () => viewport.matches('tablet');\n\nconst updateHeroDotsPosition = () => {\n    const heroElement = document.querySelector('.hero');\n    if (\n        heroElement &&\n        heroElement.classList.contains('hero--home') &&\n        isTabletOrSmaller()\n    ) {\n        const heroItem = document.querySelector('.carousel--hero .hero__item');\n        const heroImage = document.querySelector('.carousel--hero .hero__img');\n        const heroDots = document.querySelector('.carousel--hero .slick-dots');\n        if (heroItem && heroImage && heroDots) {\n            const heroImageHeight = Math.floor(heroImage.getBoundingClientRect().height);\n            const top = heroImageHeight - 40; // margin adjust + height of dots\n            heroDots.style.top = `${top}px`;\n            heroDots.style.right = '15px';\n            heroDots.style.bottom = 'auto';\n        }\n    } else {\n        // remove the style bottom and let the CSS handle it\n        const heroDots = document.querySelector('.carousel--hero .slick-dots');\n        if (heroDots) {\n            heroDots.style.top = '';\n            heroDots.style.bottom = '';\n            heroDots.style.right = '';\n        }\n    }\n}\n\n// Run on load\nupdateHeroDotsPosition();\n\n// Run on resize\nviewport.resize(() => {\n    updateHeroDotsPosition();\n});\n"],"sourceRoot":"../../../../resources/javascript"}