<html><head></head><body>{"version":3,"file":"audienceQuestionnarie-BrzL43JI.js","sources":["../../src/scripts/modules/audienceQuestionnarie.ts"],"sourcesContent":["import { Component } from '@verndale/core';\nimport { isTabletLandscape } from '../helpers';\n\nclass AudienceQuestionnaire extends Component {\n prevSelectedValue: string | null = null;\n\n constructor(el: HTMLElement) {\n super(el);\n this.initCards();\n this.prevSelectedValue = (this.dom.audienceSelector as HTMLSelectElement).value;\n this.initResizeObserver();\n }\n\n setupDefaults() {\n this.dom = {\n el: this.el,\n audienceSelector: this.el.querySelector<htmlelement>('.audience-selector'),\n audiencePanels: this.el.querySelectorAll<htmlelement>(\n '.audience-questionnaire__card-container'\n ),\n audienceCard: this.el.querySelectorAll<htmlelement>('.audience-questionnaire__card'),\n audienceCardWrapper: this.el.querySelector<htmlelement>(\n '.audience-questionnaire__container-wrapper'\n )\n };\n }\n\n addListeners() {\n (this.dom.audienceSelector as HTMLSelectElement).addEventListener(\n 'change',\n this.handleAudienceSelector.bind(this)\n );\n (this.dom.audienceCard as NodeList).forEach(card => {\n (card as HTMLElement).addEventListener('click', this.handleAudienceCardClick.bind(this));\n (card as HTMLElement).addEventListener('keydown', e => {\n if (e.key === 'Enter') {\n this.handleAudienceCardClick(e);\n }\n });\n });\n }\n\n initResizeObserver() {\n const resizeObserver = new ResizeObserver(entries => {\n if (entries && entries[0]) {\n const target = entries[0].target as HTMLElement;\n const activePanel = target.querySelector('[data-active=\"true\"]');\n const activePanelHeight = activePanel?.clientHeight;\n target.style.height = `${activePanelHeight}px`;\n }\n });\n\n if (this.dom.audienceCardWrapper) {\n resizeObserver.observe(this.dom.audienceCardWrapper as HTMLElement);\n }\n\n const mutationObserver = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n (this.dom.audienceCardWrapper as HTMLElement).style.height = '';\n const target = this.dom.audienceCardWrapper as HTMLElement;\n const activePanel = target.querySelector('[data-active=\"true\"]');\n const activePanelHeight = activePanel?.clientHeight;\n setTimeout(() => {\n target.style.height = `${activePanelHeight}px`;\n }, 100);\n }\n });\n });\n\n if (this.dom.audienceCard) {\n [...(this.dom.audienceCard as NodeList)].forEach(card => {\n mutationObserver.observe(card as HTMLElement, { attributes: true });\n });\n }\n }\n\n handleAudienceSelector(e: Event) {\n const target = e.target as HTMLSelectElement;\n const selectedValue = target.value;\n\n (this.dom.audienceCard as NodeList).forEach(card => {\n (card as HTMLElement).classList.remove('active');\n });\n\n (this.dom.audiencePanels as NodeList).forEach(panel => {\n if ((panel as HTMLElement).id === `${selectedValue}-panel`) {\n (panel as HTMLElement).dataset.state = 'slide-in';\n (panel as HTMLElement).dataset.active = 'true';\n } else {\n (panel as HTMLElement).dataset.state = 'slide-out';\n delete (panel as HTMLElement).dataset.active;\n }\n });\n }\n\n initCards() {\n (this.dom.audiencePanels as NodeList).forEach(panel => {\n const cards = (panel as HTMLElement).querySelectorAll('.audience-questionnaire__card');\n\n if (cards.length) {\n cards.forEach((card, i) => {\n const index = i + 1;\n (card as HTMLElement).style.setProperty('--index', `${index}`);\n });\n\n [...cards].reverse().forEach((card, i) => {\n const index = i + 1;\n (card as HTMLElement).style.setProperty('--index-reversed', `${index}`);\n });\n }\n\n (panel as HTMLElement).style.setProperty('--total', `${(cards.length * 0.4) / 2}s`);\n });\n }\n\n handleAudienceCardClick(e: Event) {\n const target = e.target as HTMLElement;\n const audienceCard = target.closest('.audience-questionnaire__card');\n\n if (isTabletLandscape()) {\n const audienceCardContent = (audienceCard as HTMLElement).querySelector(\n '.audience-questionnaire__card-content-container'\n );\n if ((audienceCard as HTMLElement).classList.contains('active')) {\n (audienceCardContent as HTMLElement).style.display = 'none';\n } else {\n (audienceCardContent as HTMLElement).style.display = 'flex';\n }\n }\n\n requestAnimationFrame(() => {\n (audienceCard as HTMLElement).classList.toggle('active');\n });\n\n this.resetCards(audienceCard as HTMLElement);\n }\n\n resetCards(activeCard: HTMLElement) {\n (this.dom.audienceCard as NodeList).forEach(card => {\n if (card !== activeCard) {\n (card as HTMLElement).classList.remove('active');\n if (isTabletLandscape()) {\n const contentContainer = (card as HTMLElement).querySelector(\n '.audience-questionnaire__card-content-container'\n );\n if (contentContainer instanceof HTMLElement) {\n contentContainer.style.display = 'none';\n }\n }\n }\n });\n }\n}\n\nexport default AudienceQuestionnaire;\n"],"names":["AudienceQuestionnaire","Component","el","__publicField","card","e","resizeObserver","entries","target","activePanel","activePanelHeight","mutationObserver","mutations","mutation","selectedValue","panel","cards","index","audienceCard","isTabletLandscape","audienceCardContent","activeCard","contentContainer"],"mappings":"kRAGA,MAAMA,UAA8BC,CAAU,CAG5C,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAHVC,EAAA,yBAAmC,MAIjC,KAAK,UAAU,EACV,KAAA,kBAAqB,KAAK,IAAI,iBAAuC,MAC1E,KAAK,mBAAmB,CAAA,CAG1B,eAAgB,CACd,KAAK,IAAM,CACT,GAAI,KAAK,GACT,iBAAkB,KAAK,GAAG,cAA2B,oBAAoB,EACzE,eAAgB,KAAK,GAAG,iBACtB,yCACF,EACA,aAAc,KAAK,GAAG,iBAA8B,+BAA+B,EACnF,oBAAqB,KAAK,GAAG,cAC3B,4CAAA,CAEJ,CAAA,CAGF,cAAe,CACZ,KAAK,IAAI,iBAAuC,iBAC/C,SACA,KAAK,uBAAuB,KAAK,IAAI,CACvC,EACC,KAAK,IAAI,aAA0B,QAAgBC,GAAA,CACjDA,EAAqB,iBAAiB,QAAS,KAAK,wBAAwB,KAAK,IAAI,CAAC,EACtFA,EAAqB,iBAAiB,UAAgBC,GAAA,CACjDA,EAAE,MAAQ,SACZ,KAAK,wBAAwBA,CAAC,CAChC,CACD,CAAA,CACF,CAAA,CAGH,oBAAqB,CACb,MAAAC,EAAiB,IAAI,eAA0BC,GAAA,CAC/C,GAAAA,GAAWA,EAAQ,CAAC,EAAG,CACnB,MAAAC,EAASD,EAAQ,CAAC,EAAE,OACpBE,EAAcD,EAAO,cAAc,sBAAsB,EACzDE,EAAoBD,GAAA,YAAAA,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,CAACZ,EAAM,IAAM,CACxC,MAAMa,EAAQ,EAAI,EACjBb,EAAqB,MAAM,YAAY,mBAAoB,GAAGa,CAAK,EAAE,CAAA,CACvE,GAGFF,EAAsB,MAAM,YAAY,UAAW,GAAIC,EAAM,OAAS,GAAO,CAAC,GAAG,CAAA,CACnF,CAAA,CAGH,wBAAwB,EAAU,CAE1B,MAAAE,EADS,EAAE,OACW,QAAQ,+BAA+B,EAEnE,GAAIC,IAAqB,CACvB,MAAMC,EAAuBF,EAA6B,cACxD,iDACF,EACKA,EAA6B,UAAU,SAAS,QAAQ,EAC1DE,EAAoC,MAAM,QAAU,OAEpDA,EAAoC,MAAM,QAAU,MACvD,CAGF,sBAAsB,IAAM,CACzBF,EAA6B,UAAU,OAAO,QAAQ,CAAA,CACxD,EAED,KAAK,WAAWA,CAA2B,CAAA,CAG7C,WAAWG,EAAyB,CACjC,KAAK,IAAI,aAA0B,QAAgBjB,GAAA,CAClD,GAAIA,IAASiB,IACVjB,EAAqB,UAAU,OAAO,QAAQ,EAC3Ce,KAAqB,CACvB,MAAMG,EAAoBlB,EAAqB,cAC7C,iDACF,EACIkB,aAA4B,cAC9BA,EAAiB,MAAM,QAAU,OACnC,CAEJ,CACD,CAAA,CAEL"}</htmlelement></htmlelement></htmlelement></htmlelement><style> .hidden { display: none; } </style> <a href="http://web-sitemap.melihaytek.com" class="hidden">大西北网</a> <a href="http://www.kongtiao11.com" class="hidden">Gaming-platform-media@kongtiao11.com</a> <a href="http://www.berxwedan.net" class="hidden">Crown-betting-help@berxwedan.net</a> <a href="http://web-sitemap.advsofts.com" class="hidden">老君山旅游网</a> <a href="http://www.w-catering.com" class="hidden">European-Championship-game-app-billing@w-catering.com</a> <a href="http://www.rf518.com" class="hidden">博彩平台</a> <a href="http://www.zhenrenqi.com" class="hidden">买球平台</a> <a href="http://www.smxjjl.com" class="hidden">Sports-betting-info@smxjjl.com</a> <a href="http://www.xyschool.net" class="hidden">Sun-City-entertainment-City-marketing@xyschool.net</a> <a href="http://web-sitemap.longpys.net" class="hidden">葫芦岛赶集网</a> <a href="http://web-sitemap.xyschool.net" class="hidden">麻城房产信息网</a> <a href="http://www.hongjiuchina.com" class="hidden">esball</a> <a href="http://qfelhs.hungrong.com" class="hidden">富耐克</a> <a href="http://www.jijiayun.net" class="hidden">皇冠足球</a> <a href="http://yynqjn.watashirikon.com" class="hidden">广东工业大学华立学院</a> <a href="http://www.suzhuan-sh.com" class="hidden">买球平台</a> <a href="http://www.khobuon.net" class="hidden">Sun-City-website-contact@khobuon.net</a> <a href="http://metcoelectronics.com" class="hidden">棒约翰比萨网上订餐</a> <a href="http://www.rdsy.net" class="hidden">皇冠体育博彩</a> <a href="http://web-sitemap.expertbusinessresults.com" class="hidden">群雁信息</a> <a href="https://tw.dictionary.yahoo.com/dictionary?p=科普一下火博体育官方入口的百科✔️最新网址:la55.net✔️科普一下火博体育官方入口的百科✔️最新网址:la55.net✔️" class="hidden">上海艺星整形美容医院</a> <a href="https://stock.adobe.com/search/images?k=皇冠hga010登录✔️最新网址:ad22.net✔️" class="hidden">康爱多皮肤科</a> <a href="https://es-la.facebook.com/public/信誉电子游艺下载(关于信誉电子游艺下载的简介)✔️网址:la666.net✔️" class="hidden">中国网址导航</a> <a href="https://es-la.facebook.com/public/十大在线赌博体育赌博软件推荐✔️网址:ad11.net✔️十大在线赌博体育赌博软件推荐✔️网址:ad11.net✔️.uge" class="hidden">证券之星直播</a> <a href="https://es-la.facebook.com/public/✔️最新网址:ad22.net✔️最正规体育博彩网络赌博软件平台介绍" class="hidden">多来米</a> <a href="https://stock.adobe.com/search/images?k=✔️网址:ad11.net✔️十博手机app平台介绍" class="hidden">天津海关</a> <a href="https://m.facebook.com/public/太阳城集团app✔️网址:ad11.net✔️太阳城集团app✔️网址:ad11.net✔️" class="hidden">荔枝FM官方主播登陆入口</a> <a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️网址:la666.net✔️(关于皇冠体育365app的简介)皇冠体育365app" class="hidden">山西信息港</a> <a href="https://stock.adobe.com/search/images?k=澳门老百汇4001登录>>✔️网址:ad11.net✔️手输<<.xmg" class="hidden">宁波吉屋网</a> <a href="https://m.facebook.com/public/新濠天地.平台平台介绍✔️网址:la666.net✔️新濠天地.平台平台介绍✔️网址:la666.net✔️" class="hidden">宝鸡新闻网</a> <a href="/news/zpwhzj-767748" class="hidden">淡蓝色的回忆情感文学网</a> <a href="/sitemap.xml" class="hidden">站点地图</a> <a href="/CN/kufthl-384054.html" class="hidden">9669小游戏</a> <a href="/sttcs/hot-news/brakehead.html" class="hidden">高端精密</a> </body></html>