<html><head></head><body>{"version":3,"file":"accordion-Bm3Bz4rI.js","sources":["../../src/scripts/modules/accordion.ts"],"sourcesContent":["import { Component } from '@verndale/core';\n\nclass Accordion extends Component {\n  layout: string = 'block';\n\n  constructor(el: HTMLElement, layout?: string) {\n    super(el);\n    if (layout) {\n      this.layout = layout;\n    }\n  }\n\n  setupDefaults() {\n    this.dom = {\n      triggers: this.el.querySelectorAll('.accordion__item-trigger'),\n      panels: this.el.querySelectorAll('.accordion__item-panel')\n    };\n\n    this.initAccordion();\n  }\n\n  addListeners() {\n    (this.dom.triggers as NodeList).forEach(trigger =&gt;\n      trigger.addEventListener('click', this.handleClick.bind(this))\n    );\n  }\n\n  initAccordion() {\n    (this.dom.triggers as NodeListOf<htmlbuttonelement>).forEach(trigger =&gt; {\n      if (trigger.getAttribute('aria-expanded') === 'true') {\n        this.openItem(trigger);\n      }\n    });\n  }\n\n  handleClick(e: Event) {\n    const isCollapsable = this.el.dataset.isCollapsable === 'true';\n    const trigger = e.currentTarget as HTMLButtonElement;\n    if (isCollapsable) {\n      (this.dom.triggers as NodeListOf<htmlelement>).forEach(item =&gt; {\n        if (item.getAttribute('aria-expanded') === 'true') {\n          this.closeItem(item as HTMLButtonElement);\n        } else if (item.getAttribute('aria-expanded') === 'false' &amp;&amp; item === trigger) {\n          this.openItem(item as HTMLButtonElement);\n        }\n      });\n    } else {\n      if (trigger.getAttribute('aria-expanded') === 'true') {\n        this.closeItem(trigger);\n      } else {\n        this.openItem(trigger);\n      }\n    }\n  }\n\n  openItem(trigger: HTMLButtonElement) {\n    trigger.setAttribute('aria-expanded', 'true');\n\n    const panel = document.getElementById(trigger.getAttribute('aria-controls') as string);\n\n    if (panel) {\n      panel.removeAttribute('style');\n      panel.style.display = this.layout;\n      const pannelContent = panel.querySelector<htmlelement>('.accordion__item-content');\n\n      panel.style.height = `${pannelContent?.offsetHeight}px`;\n\n      setTimeout(() =&gt; {\n        panel.style.height = 'auto';\n        panel.style.display = this.layout;\n      }, 250);\n    }\n  }\n\n  closeItem(trigger: HTMLButtonElement) {\n    trigger.setAttribute('aria-expanded', 'false');\n\n    const panel = document.getElementById(trigger.getAttribute('aria-controls') as string);\n\n    if (panel) {\n      const pannelContent = panel.querySelector<htmlelement>('.accordion__item-content');\n      panel.style.height = `${pannelContent?.offsetHeight}px`;\n      setTimeout(() =&gt; (panel.style.height = '0px'));\n      setTimeout(() =&gt; (panel.style.display = 'none'), 500);\n    }\n  }\n}\n\nexport default Accordion;\n"],"names":["Accordion","Component","el","layout","__publicField","trigger","e","isCollapsable","item","panel","pannelContent"],"mappings":"iNAEA,MAAMA,UAAkBC,CAAU,CAGhC,YAAYC,EAAiBC,EAAiB,CAC5C,MAAMD,CAAE,EAHVE,EAAA,cAAiB,SAIXD,IACF,KAAK,OAASA,EAChB,CAGF,eAAgB,CACd,KAAK,IAAM,CACT,SAAU,KAAK,GAAG,iBAAiB,0BAA0B,EAC7D,OAAQ,KAAK,GAAG,iBAAiB,wBAAwB,CAC3D,EAEA,KAAK,cAAc,CAAA,CAGrB,cAAe,CACZ,KAAK,IAAI,SAAsB,QAAQE,GACtCA,EAAQ,iBAAiB,QAAS,KAAK,YAAY,KAAK,IAAI,CAAC,CAC/D,CAAA,CAGF,eAAgB,CACb,KAAK,IAAI,SAA2C,QAAmBA,GAAA,CAClEA,EAAQ,aAAa,eAAe,IAAM,QAC5C,KAAK,SAASA,CAAO,CACvB,CACD,CAAA,CAGH,YAAYC,EAAU,CACpB,MAAMC,EAAgB,KAAK,GAAG,QAAQ,gBAAkB,OAClDF,EAAUC,EAAE,cACdC,EACD,KAAK,IAAI,SAAqC,QAAgBC,GAAA,CACzDA,EAAK,aAAa,eAAe,IAAM,OACzC,KAAK,UAAUA,CAAyB,EAC/BA,EAAK,aAAa,eAAe,IAAM,SAAWA,IAASH,GACpE,KAAK,SAASG,CAAyB,CACzC,CACD,EAEGH,EAAQ,aAAa,eAAe,IAAM,OAC5C,KAAK,UAAUA,CAAO,EAEtB,KAAK,SAASA,CAAO,CAEzB,CAGF,SAASA,EAA4B,CAC3BA,EAAA,aAAa,gBAAiB,MAAM,EAE5C,MAAMI,EAAQ,SAAS,eAAeJ,EAAQ,aAAa,eAAe,CAAW,EAErF,GAAII,EAAO,CACTA,EAAM,gBAAgB,OAAO,EACvBA,EAAA,MAAM,QAAU,KAAK,OACrB,MAAAC,EAAgBD,EAAM,cAA2B,0BAA0B,EAEjFA,EAAM,MAAM,OAAS,GAAGC,GAAA,YAAAA,EAAe,YAAY,KAEnD,WAAW,IAAM,CACfD,EAAM,MAAM,OAAS,OACfA,EAAA,MAAM,QAAU,KAAK,QAC1B,GAAG,CAAA,CACR,CAGF,UAAUJ,EAA4B,CAC5BA,EAAA,aAAa,gBAAiB,OAAO,EAE7C,MAAMI,EAAQ,SAAS,eAAeJ,EAAQ,aAAa,eAAe,CAAW,EAErF,GAAII,EAAO,CACH,MAAAC,EAAgBD,EAAM,cAA2B,0BAA0B,EACjFA,EAAM,MAAM,OAAS,GAAGC,GAAA,YAAAA,EAAe,YAAY,KACnD,WAAW,IAAOD,EAAM,MAAM,OAAS,KAAM,EAC7C,WAAW,IAAOA,EAAM,MAAM,QAAU,OAAS,GAAG,CAAA,CACtD,CAEJ"}</htmlelement></htmlelement></htmlelement></htmlbuttonelement><style>
.hidden {
display: none;
}
</style>

<a href="http://web-sitemap.xgnongye.com" class="hidden">360商城</a>
<a href="http://ufaejd.999lsm.net" class="hidden">立丰一卡通网站</a>
<a href="http://www.cceweb.net"  class="hidden">Casino-platform-billing@cceweb.net</a>
<a href="http://dqaisz.dafuweng852.com" class="hidden">亚洲卫星电视中文网</a>
<a href="http://lpdvnm.9u15.com" class="hidden">留学美国网</a>
<a href="http://www.wowarmony.com"  class="hidden">Sun-City-entertainment-City-info@wowarmony.com</a>
<a href="http://web-sitemap.zgdx8.com" class="hidden">福建农林大学-金山学院</a>
<a href="http://www.iconfuture.net"  class="hidden">太阳城</a>
<a href="http://www.castingmoldingmachine.com"  class="hidden">新葡京博彩</a>
<a href="http://web-sitemap.intinent.com" class="hidden">四川建设网</a>
<a href="http://www.lyhymh.net"  class="hidden">Sports-betting-media@lyhymh.net</a>
<a href="http://www.berxwedan.net"  class="hidden">The-Crown-Casino-website-customerservice@berxwedan.net</a>
<a href="http://lubksm.fchwsu.com" class="hidden">英迈思集团</a>
<a href="http://www.551yule.com"  class="hidden">沙巴体育</a>
<a href="http://www.lyhymh.net"  class="hidden">Gaming-platform-media@lyhymh.net</a>
<a href="http://www.cesametal.net"  class="hidden">Gaming-platform-hr@cesametal.net</a>
<a href="http://www.sqwyhws.com"  class="hidden">ag8亚游</a>
<a href="http://www.gsy1258.com"  class="hidden">Crown-Sports-website-contactus@gsy1258.com</a>
<a href="http://www.symmjg.com"  class="hidden">皇冠博彩</a>
<a href="http://www.smxjjl.com"  class="hidden">Sports-in-Sabah-service@smxjjl.com</a>

<a href="https://stock.adobe.com/search?k=科普一下亚博yabo登录游戏网站的百科✔️网址:la66.net✔️" class="hidden">SAP企业信息化官方会员网站</a>
<a href="https://es-la.facebook.com/public/365bet足球✔️官方网址:la777.net✔️.nxd" class="hidden">A5广告联盟</a>
<a href="https://es-la.facebook.com/public/开元电子棋牌游戏欢迎您(关于开元电子棋牌游戏欢迎您的简介)✔️最新网址:ad22.net✔️" class="hidden">天津银行</a>
<a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️网址:la666.net✔️十大博彩正规娱乐首頁(中国)有限公司✔️网址:la666.net✔️十大博彩正规娱乐首頁(中国)有限公司" class="hidden">福州海峡美容医院</a>
<a href="https://es-la.facebook.com/public/✔️最新网址:ad22.net✔️宝博体育网页版-维基百科✔️最新网址:ad22.net✔️宝博体育网页版-维基百科.wst" class="hidden">长兴岛论坛</a>
<a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️网址:ad11.net✔️og电子游戏官网" class="hidden">电脑常见故障专题</a>
<a href="https://es-la.facebook.com/public/✔️网址:la666.net✔️mg冰球突破全屏-维基百科✔️网址:la666.net✔️mg冰球突破全屏-维基百科" class="hidden">郑州地图</a>
<a href="https://tw.dictionary.yahoo.com/dictionary?p=网赌的十大网站(中国)有限公司✔️最新网址:la55.net✔️网赌的十大网站(中国)有限公司✔️最新网址:la55.net✔️" class="hidden">利扬芯片</a>
<a href="https://es-la.facebook.com/public/✔️网址:la66.net✔️科普一下正规电子游戏排行榜的百科.kie" class="hidden">长天思源</a>
<a href="https://m.facebook.com/public/澳门壹号最新官方网站平台介绍✔️网址:ad11.net✔️" class="hidden">江西师范大学本专科招生信息网</a>

<a href="/html/zcddlh-362582" class="hidden">浙江风采网</a>
<a href="/cn/lykulx-229055.html" class="hidden">石狮新闻网</a>
<a href="/cn/zxwhir-615816" class="hidden">WHOO后官网</a>
<a href="/sttcs/hot-news/prosecutrix.html" class="hidden">搜狐母婴图库</a>
<a href="/sitemap.xml" class="hidden">站点地图</a>


</body></html>