{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/helpers/index.ts","webpack://@verndale/toolkit/./src/js/modules/featuredCaseStudy.ts"],"names":["debounce","callback","wait","timerId","args","darkColorPalette","lightColorPalette","getRandomColor","background","FeaturedCaseStudy","Component","el","randomColor"],"mappings":"2JAIO,MAAMA,EAAW,CAACC,EAAmCC,IAAiB,CAC3E,IAAIC,EAEJ,MAAO,IAAIC,IAAoB,CAC7B,aAAaD,CAAO,EACpBA,EAAU,WAAW,IAAM,CACzBF,EAAS,GAAGG,CAAI,CAClB,EAAGF,CAAI,CACT,CACF,EAOaG,EAAyC,CACpD,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,QAAS,KAAM,SAAU,EACjC,CAAE,KAAM,aAAc,KAAM,SAAU,CACxC,EAEaC,EAA0C,CACrD,CAAE,KAAM,MAAO,KAAM,SAAU,EAC/B,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,OAAQ,KAAM,SAAU,EAChC,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,QAAS,KAAM,SAAU,EACjC,CAAE,KAAM,aAAc,KAAM,SAAU,CACxC,EAEaC,EAAiB,CAC5BC,EAA+B,UAE3BA,IAAe,QAEfF,EAAkB,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAkB,MAAM,GAKvED,EAAiB,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAiB,MAAM,E,mFC5CvE,MAAMI,UAA0BC,WAAU,CACxC,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAER,KAAK,oBAAoB,CAC3B,CAEA,eAAgB,CACd,KAAK,IAAM,CACT,QAAS,KAAK,GAAG,cAA2B,UAAU,CACxD,CACF,CAEA,qBAAsB,CACpB,MAAMC,G,EAAcL,MAAe,MAAM,EAExC,KAAK,IAAI,QAA2B,UAAU,IAC7C,YAAYK,EAAY,WAC1B,CACF,CACF,CAEA,QAAeH,C","file":"scripts/5278.bacce187b1c35aaec50c.js","sourcesContent":["// /**\n// * debounce function\n// * Delays the processing of the event\n// */\nexport const debounce = (callback: (args: unknown) => void, wait: number) => {\n let timerId: ReturnType;\n\n return (...args: [unknown]) => {\n clearTimeout(timerId);\n timerId = setTimeout(() => {\n callback(...args);\n }, wait);\n };\n};\n\ninterface IColorPalette {\n name: string;\n code: string;\n}\n\nexport const darkColorPalette: Array = [\n { name: 'orange', code: '#f47920' },\n { name: 'yellow', code: '#f4b450' },\n { name: 'green', code: '#0f9d58' },\n { name: 'light-blue', code: '#009cde' }\n];\n\nexport const lightColorPalette: Array = [\n { name: 'red', code: '#da291c' },\n { name: 'purple', code: '#492d8c' },\n { name: 'blue', code: '#2e67b2' },\n { name: 'orange', code: '#f47920' },\n { name: 'yellow', code: '#f4b450' },\n { name: 'green', code: '#0f9d58' },\n { name: 'light-blue', code: '#009cde' }\n];\n\nexport const getRandomColor = (\n background: 'light' | 'dark' = 'light'\n): IColorPalette => {\n if (background === 'light') {\n const lightRandomColor =\n lightColorPalette[Math.floor(Math.random() * lightColorPalette.length)];\n return lightRandomColor;\n }\n\n const darkRandomColor =\n darkColorPalette[Math.floor(Math.random() * darkColorPalette.length)];\n return darkRandomColor;\n};\n","import { Component } from '@verndale/core';\nimport { getRandomColor } from '../helpers';\n\nclass FeaturedCaseStudy extends Component {\n constructor(el: HTMLElement) {\n super(el);\n\n this.generateRandomColor();\n }\n\n setupDefaults() {\n this.dom = {\n picture: this.el.querySelector('.picture')\n };\n }\n\n generateRandomColor() {\n const randomColor = getRandomColor('dark');\n\n (this.dom.picture as HTMLDivElement).classList.add(\n `picture--${randomColor.name}-glow`\n );\n }\n}\n\nexport default FeaturedCaseStudy;\n"],"sourceRoot":""}