{"version":3,"file":"site.min.js","sources":["../js/base/_size.js","../js/base/_isTouch.js","../js/base/_keyboardFocus.js","../js/base/_share.js","../js/_general.js","../js/_nav.js","../js/_tabs.js","../js/_cards.js","../js/_focus_tabs.js","../js/_jump.js","../js/_expert-slider.js","../js/_home.js","../js/_modal.js","../js/_search.js","../js/_overlays.js","../js/_gTranslate.js","../js/site.js","../js/base/_fitvid.js"],"sourcesContent":["\nimport debug from 'bows';\n\nconst sizeResize = {\n\txlarge: [],\n\tlarge: [],\n\tmedium: [],\n\tsmall: [],\n\tany: [],\n\tbody: document.body,\n\tsmall_max: 640,\n\tmedium_max: 1000,\n\tlarge_max: 1200,\n\tpause: 100,\n\tcurrentSize: '',\n\tpreviousSize: ''\n};\n\n\nexport function addXlarge(func, params) {\n\tsizeResize.xlarge.push([func, params]);\n}\n\nexport function addLarge(func, params) {\n\tsizeResize.large.push([func, params]);\n}\n\nexport function addMedium(func, params) {\n\tsizeResize.medium.push([func, params]);\n}\n\nexport function addSmall(func, params) {\n\tsizeResize.small.push([func, params]);\n}\n\nexport function addAny(func, params) {\n\tsizeResize.any.push([func, params]);\n}\n\nexport function getWidth() {\n\treturn sizeResize.body.clientWidth;\n}\n\nexport function getCurrent(width) {\n\tsizeResize.previousSize = sizeResize.currentSize;\n\tif (width <= sizeResize.small_max) {\n\t\tsizeResize.currentSize = 'small';\n\t} else if (width > sizeResize.small_max && width <= sizeResize.medium_max) {\n\t\tsizeResize.currentSize = 'medium';\n\t} else if (width > sizeResize.medium_max && width <= sizeResize.large_max) {\n\t\tsizeResize.currentSize = 'large';\n\t} else {\n\t\tsizeResize.currentSize = 'xlarge';\n\t}\n\treturn sizeResize.currentSize;\n}\n\nexport function runFunctions() {\n\tsizeResize.body.classList.remove('size--xlarge');\n\tsizeResize.body.classList.remove('size--large');\n\tsizeResize.body.classList.remove('size--medium');\n\tsizeResize.body.classList.remove('size--small');\n\tif (sizeResize.currentSize === 'small') {\n\t\tsizeResize.body.classList.add('size--small');\n\t\tfor (var i = 0; i < sizeResize.small.length; i++) {\n\t\t\tsizeResize.small[i][0].apply(this, sizeResize.small[i][1]);\n\t\t}\n\t} else if (sizeResize.currentSize === 'medium') {\n\t\tsizeResize.body.classList.add('size--medium');\n\t\tfor (var i = 0; i < sizeResize.medium.length; i++) {\n\t\t\tsizeResize.medium[i][0].apply(this, sizeResize.medium[i][1]);\n\t\t}\n\t} else if (sizeResize.currentSize === 'large') {\n\t\tsizeResize.body.classList.add('size--large');\n\t\tfor (var i = 0; i < sizeResize.large.length; i++) {\n\t\t\tsizeResize.large[i][0].apply(this, sizeResize.large[i][1]);\n\t\t}\n\t} else if (sizeResize.currentSize === 'xlarge') {\n\t\tsizeResize.body.classList.add('size--xlarge');\n\t\tfor (var i = 0; i < sizeResize.xlarge.length; i++) {\n\t\t\tsizeResize.xlarge[i][0].apply(this, sizeResize.xlarge[i][1]);\n\t\t}\n\t}\n\n\tfor (var i = 0; i < sizeResize.any.length; i++) {\n\t\tsizeResize.any[i][0].apply(this, sizeResize.any[i][1]);\n\t}\n}\n\nexport function sizeCheck() {\n\tconst _this = this;\n\tif (_this.getCurrent(_this.getWidth()) === sizeResize.previousSize) {\n\t\treturn false;\n\t}\n\n\t_this.runFunctions();\n}\n\nexport function init() {\n\tconst _this = this;\n\t_this.getCurrent(_this.getWidth());\n\t_this.runFunctions();\n\n\tvar endResizeEvent;\n\twindow.onresize = function () {\n\t\tclearTimeout(endResizeEvent);\n\t\tendResizeEvent = setTimeout(function () {\n\t\t\t// Run code here, resizing has \"stopped\"\n\t\t\t_this.sizeCheck();\n\t\t}, sizeResize.pause);\n\t}\n}\n\n\nexport default {\n\tinit: init,\n\taddXlarge: addXlarge,\n\taddLarge: addLarge,\n\taddMedium: addMedium,\n\taddSmall: addSmall,\n\taddAny: addAny,\n\tgetWidth: getWidth,\n\tgetCurrent: getCurrent,\n\trunFunctions: runFunctions,\n\tsizeCheck: sizeCheck\n};\n","let istouch = {\n $html: ''\n};\n\nexport function is_touch_device() {\n return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));\n}\n\nexport function init() {\n const _this = this;\n istouch.$html = document.querySelector('html');\n if (!_this.is_touch_device()) {\n istouch.$html.classList.add('no-touchevents');\n } else {\n istouch.$html.classList.add('touchevents');\n }\n}\n\n\nexport default {\n init: init,\n is_touch_device: is_touch_device\n};\n","import debug from \"bows\";\n\nconst log = debug('keyboardFocus');\nconst keyboardFocusClass = 'keyboard--focus';\n\n// Internal flag\nlet keyboardFocus = false;\n\nexport function init() {\n\t// Keydown event trigger\n\twindow.addEventListener('keydown', (e) => {\n\t\tif ( e.defaultPrevented || keyboardFocus ) {\n\t\t\treturn; // Do nothing\n\t\t}\n\t\t// Capture certain keys (or alt key press)\n\t\tif ( 'Tab' === e.key || 'Enter' === e.key || e.altKey ) {\n\t\t\tkeyboardFocus = true;\n\t\t\tdocument.body.classList.add(keyboardFocusClass);\n\t\t\tlog('site.keyboardFocus', keyboardFocus);\n\t\t}\n\t});\n\n\t// Mousedown event cancel\n\twindow.addEventListener('mousedown', (e) => {\n\t\tif ( e.defaultPrevented || ! keyboardFocus ) {\n\t\t\treturn; // Do nothing\n\t\t}\n\t\t// Cancel keyboard active\n\t\tkeyboardFocus = false;\n\t\tdocument.body.classList.remove(keyboardFocusClass);\n\t\tlog('site.keyboardFocus', keyboardFocus);\n\t});\n};\n\nexport default {\n\tinit: init\n};\n","//import $ from \"jquery\";\nimport debug from \"bows\";\n\nconst elem = document.querySelectorAll(\".share__link--modal\");\nconst log = debug(\"share\");\n\nexport function sharePop(e) {\n\t//elem.addEventListener(\"click\", function(e) {\n\n\tconst href = $(this).attr(\"href\");\n\tconst t = (window.screen.height - 350) / 2;\n\tconst l = (window.screen.width - 550) / 2;\n\tlog(l);\n\tconst opts = [\n\t\t\"scrollbars=yes\",\n\t\t\"resizable=yes\",\n\t\t\"toolbar=no\",\n\t\t\"location=yes\",\n\t\t\"width=550\",\n\t\t\"height=350\",\n\t\t\"top=\" + t,\n\t\t\"left=\" + l\n\t];\n\treturn window.open(href, \"sharer\", opts.join(\",\"));\n\t//});\n}\n\nexport function init() {\n\tlog(`share init`);\n\tif (elem !== undefined) {\n\t\tfor (let i = 0; i < elem.length; i++) {\n\t\t\telem[i].addEventListener(\"click\", sharePop);\n\t\t}\n\t}\n\n\tlet clipboard = new ClipboardJS('[data-clipboard-text]');\n\tlet copied = document.querySelector('.share__copied');\n\n\tclipboard.on('success', function (e) {\n\t\tcopied.textContent = \"Page URL Copied\";\n\t\tcopied.classList.add('share__copied--success');\n\t\tsetTimeout(() => {\n\t\t\tcopied.classList.remove('share__copied--success');\n\t\t}, 3000);\n\t\tsetTimeout(() => {\n\t\t\tcopied.textContent = \"\";\n\t\t}, 3500);\n\t});\n\n\tclipboard.on('error', function (e) {\n\t\tcopied.textContent = \"URL not copied\";\n\t\tcopied.classList.add('share__copied--error');\n\t\tsetTimeout(() => {\n\t\t\tcopied.classList.remove('share__copied--error');\n\t\t}, 1000);\n\t\tsetTimeout(() => {\n\t\t\tcopied.textContent = \"\";\n\t\t}, 1250);\n\t});\n}\n\nexport default {\n\tinit: init,\n\tsharePop: sharePop\n};\n","import $ from \"jquery\";\nimport debug from \"bows\";\n\nconst log = debug(\"general\");\nconst body = $('body');\nconst $btn = $('.btn');\n\nconst $personLink = $('.person__link');\nconst $featuredResources = $('main').find('.featured-resources');\n\nconst $wysiwyg_tables = $('.wysiwyg').find('table');\nconst $top_link = $('a[href=\"#top\"]');\n\nfunction buttonFix() {\n\t$btn.wrapInner('');\n}\n\nfunction isPullFooterCTA() {\n\t$featuredResources.each(function () {\n\t\tlet $this = $(this);\n\t\tlet isLast = $this.nextAll().length;\n\t\tlet isHP = $this.closest('.hp-bg').length;\n\t\tlog(isHP);\n\t\tif (isLast === 0 && isHP === 0) {\n\t\t\t$('.footer-cta').addClass('footer-cta--pull');\n\t\t}\n\n\t})\n}\n\nfunction fix_tables() {\n\t$wysiwyg_tables.each(function () {\n\t\tlet $this = $(this);\n\n\t\t$this.wrap('
');\n\t\t$this.removeAttr('width');\n\t\t$this.find('td, th').removeAttr('width');\n\t});\n}\n\nfunction to_top() {\n\t$top_link.on('click', function () {\n\n\n\t\tlet $where = $('#top');\n\t\tlet whereTo = $where.offset().top;\n\n\t\t$('html, body').animate({\n\t\t\tscrollTop: whereTo\n\t\t}, 500, 'swing');\n\n\t\t$where.attr('tabindex', -1).addClass('removetabindex').focus();\n\n\t});\n}\n\nexport function init() {\n\tif ($btn.length) {\n\t\tbuttonFix();\n\t}\n\n\tif ($personLink.length) {\n\t\t$('.person__link').hover(function () {\n\t\t\t$(this).closest('.person').addClass('person--hover');\n\t\t}, function () {\n\t\t\t$(this).closest('.person').removeClass('person--hover');\n\t\t}).on('focus', function () {\n\t\t\t$(this).closest('.person').addClass('person--hover');\n\t\t}).on('blur', function () {\n\t\t\t$(this).closest('.person').removeClass('person--hover');\n\t\t});\n\t}\n\n\t$('.removetabindex').on('blur', function () {\n\t\t$(this).removeClass('removetabindex');\n\t});\n\n\tif ($featuredResources.length) {\n\t\tisPullFooterCTA();\n\t}\n\n\tif ($wysiwyg_tables.length) {\n\t\tfix_tables();\n\t}\n\n\tif ($top_link.length) {\n\t\tto_top();\n\t}\n}\n\nexport default {\n\tinit\n};\n","import $ from \"jquery\";\nimport debug from \"bows\";\n\nconst log = debug(\"nav\");\nconst navToggles = $('.nav-mobile__btn');\nconst btnMM = $('.btn-mm');\nconst navMobile = $('.nav-mobile');\n\nfunction toggleNav() {\n\tlet $this = $(this);\n\t$this.toggleClass('nav-mobile__btn--active');\n\t$this.siblings('.nav-mobile__list').slideToggle();\n}\n\nfunction toggleMobile() {\n\tlet $this = $(this);\n\t$this.toggleClass('btn-mm--active');\n\tnavMobile.slideToggle();\n}\n\nexport function init() {\n\tif (navToggles.length) {\n\t\tnavToggles.on('click', toggleNav);\n\t}\n\n\tif (btnMM.length) {\n\t\tbtnMM.on('click', toggleMobile);\n\t}\n}\n\nexport default {\n\tinit\n};\n","// https://codepen.io/heydon/pen/veeaEa\n//import $ from \"jquery\";\nimport debug from \"bows\";\n\nconst log = debug(\"tabs\");\n\n// Get relevant elements and collections\nconst tabbed = document.querySelectorAll('.tabbed');\nfunction doEachTab(tablist, tabs, panels, select) {\n\n\tlet hash = window.location.hash;\n\n\t// The tab switching function\n\tconst switchTab = (oldTab, newTab, notSelect) => {\n\n\t\t// log(oldTab);\n\t\t// log(newTab);\n\t\tnewTab.focus();\n\t\t// Make the active tab focusable by the user (Tab key)\n\t\tnewTab.removeAttribute('tabindex');\n\t\t// Set the selected state\n\t\tnewTab.setAttribute('aria-selected', 'true');\n\t\toldTab.removeAttribute('aria-selected');\n\t\toldTab.setAttribute('tabindex', '-1');\n\t\t// Get the indices of the new and old tabs to find the correct\n\t\t// tab panels to show and hide\n\n\n\t\tlet index = Array.prototype.indexOf.call(tabs, newTab);\n\t\tlet oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\n\t\tlet newHash = newTab.getAttribute('href');\n\n\t\tpanels[oldIndex].hidden = true;\n\t\tpanels[index].hidden = false;\n\n\t\t//Update select\n\t\tif (notSelect === true) {\n\t\t\tupdateSelect(select, index)\n\t\t}\n\n\t\tlet title = document.title;\n\t\tlet url = window.location.href.replace(window.location.hash,'') + newHash\n\t\tlog(title, url);\n\t\twindow.history.pushState({}, title, url);\n\n\t}\n\n\t// Add the tablist role to the first