{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/components/cards/ContentCard.js","webpack://@verndale/toolkit/./src/js/helpers/index.js"],"names":[],"mappings":"8JAIA,eAA0B,KAAU,CAClC,eAAgB,CACd,KAAK,IAAM,CACT,iBAAkB,KAAK,GAAG,cAAc,oCACxC,QAAS,KAAK,GAAG,cAAc,4CAC/B,KAAM,KAAK,GAAG,cAAc,qCAG9B,KAAK,gBAAkB,KAAK,IAAI,QAAQ,UAExC,KAAK,cAGP,cAAe,CACb,OAAO,iBAAiB,SAAU,SAAS,KAAK,aAAa,KAAK,MAAO,MAG3E,cAAe,CACb,KAAK,IAAI,QAAQ,UAAY,KAAK,gBAGpC,aAAc,CACZ,KAAM,GAAkB,KAAK,IAAI,iBAAiB,wBAAwB,OAC1E,GAAI,GAAmB,IACrB,KAAO,KAAK,IAAI,QAAQ,aAAe,GACrC,KAAK,IAAI,QAAQ,UAAY,KAAK,IAAI,QAAQ,UAAU,QAAQ,cAAe,OAInF,KAAS,IAAI,MACX,KAAK,IAAI,QAAQ,YAAY,KAAK,IAAI,MAI1C,cAAe,CACb,KAAK,eACL,KAAK,eAIT,UAAe,G,+KCxCR,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/1236.6bfe9bc2e991e132d153.js","sourcesContent":["import { Component } from '@verndale/core';\nimport { debounce } from '../../helpers/index';\n\n\nclass ContentCard extends Component {\n setupDefaults() {\n this.dom = {\n contentContainer: this.el.querySelector('.bicentennial-content-card__copy'),\n content: this.el.querySelector('.bicentennial-content-card__copy-content'),\n link: this.el.querySelector('.bicentennial-content-card__link')\n };\n\n this.originalContent = this.dom.content.innerText;\n\n this.addEllipsis();\n }\n\n addListeners() {\n window.addEventListener('resize', debounce(this.handleResize.bind(this), 200));\n }\n\n resetContent() {\n this.dom.content.innerText = this.originalContent;\n }\n\n addEllipsis() {\n const containerHeight = this.dom.contentContainer.getBoundingClientRect().height;\n if (containerHeight >= 124) {\n while (this.dom.content.clientHeight > containerHeight) {\n this.dom.content.innerText = this.dom.content.innerText.replace(/\\W*\\s(\\S)*$/, '...');\n }\n }\n\n if (this.dom.link) {\n this.dom.content.appendChild(this.dom.link);\n }\n }\n\n handleResize() {\n this.resetContent();\n this.addEllipsis();\n }\n}\n\nexport default ContentCard;\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":""}