{"version":3,"sources":["src/scripts/components/microsite-one-page.js"],"names":["$","jQuery","init","$links","$trigger","$target","binds","on","scrollToSection","toggleNav","toggleClass","e","preventDefault","anchor","attr","animate","scrollTop","offset","top"],"mappings":";;;;;AAAA,IAAIA,IAAIC,MAAR;;AAEA,SAASC,IAAT,GAAgB;AACd,MAAMC,SAASH,EAAE,iCAAF,CAAf;AACA,MAAMI,WAAWJ,EAAE,8BAAF,CAAjB;AACA,MAAMK,UAAUL,EAAE,qBAAF,CAAhB;;AAEA,MAAGA,EAAE,sBAAF,CAAH,EAA8B;AAC5BM;AACD;;AAED,WAASA,KAAT,GAAiB;AACfH,WAAOI,EAAP,CAAU,OAAV,EAAmBC,eAAnB;AACAJ,aAASG,EAAT,CAAY,OAAZ,EAAqBE,SAArB;AACD;;AAED,WAASA,SAAT,GAAqB;AACnBJ,YAAQK,WAAR,CAAoB,SAApB;AACD;;AAGD,WAASF,eAAT,CAAyBG,CAAzB,EAA4B;AAC1BA,MAAEC,cAAF;AACA,QAAIC,SAASb,EAAE,IAAF,EAAQc,IAAR,CAAa,MAAb,CAAb;;AAEAT,YAAQK,WAAR,CAAoB,SAApB;;AAEAV,MAAE,YAAF,EAAgBe,OAAhB,CAAwB;AACtBC,iBAAWhB,EAAEa,MAAF,EAAUI,MAAV,GAAmBC,GAAnB,GAAyB;AADd,KAAxB,EAEG,GAFH;AAGD;AACF;;QAEehB,I,GAARA,I","file":"microsite-one-page.js","sourcesContent":["var $ = jQuery;\n\nfunction init() {\n  const $links = $('.microsite-main-nav__links li a');\n  const $trigger = $('.microsite-main-nav__trigger');\n  const $target = $('.microsite-main-nav');\n\n  if($('.microsite-one-pager')) {\n    binds();\n  }\n\n  function binds() {\n    $links.on('click', scrollToSection);\n    $trigger.on('click', toggleNav);\n  }\n\n  function toggleNav() {\n    $target.toggleClass('_active');\n  }\n\n\n  function scrollToSection(e) {\n    e.preventDefault();\n    let anchor = $(this).attr('href');\n\n    $target.toggleClass('_active');\n\n    $('html, body').animate({\n      scrollTop: $(anchor).offset().top - 80\n    }, 200);\n  }\n}\n\nexport {init as init};\n"]}