{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/components/cards/GenericCard.js","webpack://@verndale/toolkit/./src/js/helpers/index.js"],"names":[],"mappings":"8JAGA,eAAqB,KAAU,CAC7B,eAAgB,CACd,KAAK,IAAM,CACT,YAAa,KAAK,GAAG,cAAc,0BACnC,eAAgB,KAAK,GAAG,cACtB,uCAGJ,KAAK,sBAGP,qBAAsB,CACpB,KAAM,GAAS,KAAK,IAAI,eAAiB,GAAK,GAE9C,KAAK,GAAG,MAAM,YACZ,sBACA,GAAG,KAAK,IAAI,YAAY,aAAe,OAI3C,cAAe,CACb,OAAO,iBACL,SACA,SAAS,KAAK,oBAAoB,KAAK,MAAO,OAKpD,UAAe,G,+KC3BR,KAAM,GAAW,CAAC,EAAU,IAAS,CAC1C,GAAI,GACJ,MAAO,IAAI,IAAS,CAClB,aAAa,GACb,EAAU,WAAW,IAAM,CACzB,EAAS,GAAG,IACX,KAIM,EAAW,CAAC,EAAU,IAAS,CAC1C,GAAI,GACJ,MAAO,IAAI,IAAS,CAClB,GACE,GAAS,GAAG,GACZ,EAAa,GACb,WAAW,IAAM,CACf,EAAa,IACZ,MASI,EAAc,GAAM,CAC/B,GACE,EAAG,SAAW,GACb,EAAG,WAAa,GAAK,EAAG,aAAa,cAAgB,KAEtD,MAAO,GAGT,GAAI,EAAG,SACL,MAAO,GAIT,OAAQ,EAAG,cACJ,IACH,MAAO,CAAC,CAAC,EAAG,MAAQ,EAAG,MAAQ,aAC5B,QACH,MAAO,GAAG,OAAS,UAAY,EAAG,OAAS,WACxC,aACA,aACA,WACH,MAAO,WAEP,MAAO,KAQA,EAAU,CACrB,IAAK,EACL,OAAQ,GACR,IAAK,GACL,MAAO,GACP,OAAQ,GACR,SAAU,GACV,IAAK,GACL,KAAM,GACN,KAAM,GACN,GAAI,GACJ,MAAO,GACP,KAAM,IAMK,EAAc,CACzB,OAAQ,IACR,OAAQ,IACR,gBAAiB,KACjB,QAAS,KACT,KAAM,MAOK,EAA2B,CACtC,eAAgB,GAChB,WAAY,GACZ,OAAQ,GACR,cAAe,EACf,aAAc,EACd,MAAO,IACP,cAAe,GACf,oBAAqB,IAOV,EAAiB,GACxB,MAAO,IAAU,SACZ,EAAM,QAAQ,wBAAyB,CAAC,EAAG,IAChD,OAAO,aAAa,SAAS,EAAG,MAE7B","file":"scripts/4761.5942dd3f0629e545da7d.js","sourcesContent":["import { Component } from '@verndale/core';\nimport { debounce } from '../../helpers';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n cardContent: this.el.querySelector('.generic-card__content'),\n cardSubheading: this.el.querySelector(\n '.generic-card__optional-subheading'\n )\n };\n this.setDecorationHeight();\n }\n\n setDecorationHeight() {\n const offset = this.dom.cardSubheading ? 34 : 28;\n\n this.el.style.setProperty(\n '--decoration-height',\n `${this.dom.cardContent.offsetHeight - offset}px`\n );\n }\n\n addListeners() {\n window.addEventListener(\n 'resize',\n debounce(this.setDecorationHeight.bind(this), 100)\n );\n }\n}\n\nexport default Module;\n","// /**\n// * debounce function\n// * Delays the processing of the event\n// */\nexport const debounce = (callback, wait) => {\n let timerId;\n return (...args) => {\n clearTimeout(timerId);\n timerId = setTimeout(() => {\n callback(...args);\n }, wait);\n };\n};\n\nexport const throttle = (callback, wait) => {\n let inThrottle;\n return (...args) => {\n if (!inThrottle) {\n callback(...args);\n inThrottle = true;\n setTimeout(() => {\n inThrottle = false;\n }, wait);\n }\n };\n};\n// /**\n// * Checks if an element is focusable\n// *\n// * @param {Object} el - HTML element you want to check if it's focusable\n// */\nexport const isFocusable = el => {\n if (\n el.tabIndex > 0 ||\n (el.tabIndex === 0 && el.getAttribute('tabIndex') !== null)\n ) {\n return true;\n }\n\n if (el.disabled) {\n return false;\n }\n\n /* eslint-disable indent */\n switch (el.nodeName) {\n case 'A':\n return !!el.href && el.rel !== 'ignore';\n case 'INPUT':\n return el.type !== 'hidden' && el.type !== 'file';\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n default:\n return false;\n }\n /* eslint-enable indent */\n};\n\n// /**\n// * Key code list object\n// */\nexport const keyCode = {\n TAB: 9,\n RETURN: 13,\n ESC: 27,\n SPACE: 32,\n PAGEUP: 33,\n PAGEDOWN: 34,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n};\n\n// /**\n// * Breakpoints list object\n// */\nexport const breakpoints = {\n mobile: 360,\n tablet: 768,\n tabletLandscape: 1024,\n desktop: 1280,\n wide: 1600\n};\n\n// /**\n// * Bicentennial Swiper Object\n// */\n\nexport const bicentennialSwiperConfig = {\n allowTouchMove: false,\n autoHeight: false,\n rewind: true,\n slidesPerView: 1,\n spaceBetween: 0,\n speed: 1000,\n watchOverflow: true,\n watchSlidesProgress: true\n}\n\n// /**\n// * Convert Unicode characters inside a string to their actual characters\n// */\n\nexport const convertUnicode = (input) => {\n if (typeof input === 'string') {\n return input.replace(/\\\\+u([0-9a-fA-F]{4})/g, (a, b) =>\n String.fromCharCode(parseInt(b, 16)))\n }\n return input;\n};\n"],"sourceRoot":""}