import{r as i,c as t,h as s,H as a,g as e}from"./p-ClISz4NF.js";import{g as d,b as o}from"./p-CoD1xawt.js";import{c}from"./p-vN03FcXN.js";import{v as n}from"./p-CDIRBJsi.js";import{c as r}from"./p-CgDnDrq5.js";import{d as h}from"./p-CQvUntGY.js";import"./p-DNztiAH0.js";var l;(function(i){i["HORIZONTAL"]="horizontal";i["VERTICAL"]="vertical"})(l||(l={}));const f={root:"gov-card",header:"gov-card__header",arrow:"gov-card__arrow",inner:"gov-card__inner",img:"gov-card__img",icon:"gov-card__icon",content:"gov-card__content",footer:"gov-card__footer"};var b;(function(i){i["A"]="a";i["DIV"]="div"})(b||(b={}));const v=class{constructor(s){i(this,s);this.govToggle=t(this,"gov-toggle");this.hydrated=false;this.direction="vertical";this.collapsible=false;this.clickable=false;this.open=true;this.h=d(this.host);this.headlineId=c("GovCardHeadline");this.contentId=c("GovCardContent")}async componentDidRender(){if(r()){await h(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const i=this.href?b.A:b.DIV;return s(a,{key:"cdfd3d0c4298a3bf933073c558dad83f3765b6c2",class:this.h.classes(f.root),open:this.open,collapsible:o(this.collapsible),clickable:this.clickable,direction:this.direction,hydrated:this.hydrated},this.collapsible?s("button",{id:this.headlineId,class:f.header,"aria-label":this.accessibleTriggerLabel,"aria-labelledby":this.accessibleTriggerLabelledBy,"aria-expanded":o(this.open),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},s("slot",{name:"headline"}),s("gov-icon",{class:f.arrow,name:"chevron-down",type:"components"})):this.h.hasSlot("headline")?s("div",{class:f.header},s("slot",{name:"headline"})):null,s(i,{key:"6bb81b9dd553397f508a8042316fd09579154461",href:this.href,target:this.target,id:this.contentId,"aria-hidden":this.collapsible?o(!this.open):undefined,hidden:this.collapsible?!this.open:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined,class:f.inner},this.h.hasSlot("img")&&s("div",{key:"740547f9bc6e9be839cbf8edc44faddb6aaa5246",class:f.img},s("slot",{key:"abb25299c0f9b0b4ac1a4826648dd7a774894514",name:"img"})),this.h.hasSlot("icon")&&s("div",{key:"c768f9fd3f3ac79f907dd26601c109265d6d903d",class:f.icon},s("slot",{key:"8cf8ffde300503c874e32644d6c4111e6b608e36",name:"icon"})),s("div",{key:"1e3218226ffc179f0afb0da94c48a939b248c311",class:f.content},s("slot",{key:"2a0ac8f1ecd6a83537bfb2da85d06c9d9b3f2706"})),this.h.hasSlot("footer")&&s("div",{key:"04b7f39f60eab3db295b82072d1b06648d687b0b",class:f.footer},s("slot",{key:"4ec8ee6bf3b4ec9a02b30d5d2dc6b2fab6bb5065",name:"footer"}))))}onClickHandler(i){i.stopPropagation();if(this.collapsible){this.open=!this.open;this.govToggle.emit({open:this.open,element:this.host})}}async validateAccessibility(){if(this.collapsible){n(this.accessibleTriggerLabel,this.accessibleTriggerLabelledBy,f.root,this.host)}}get host(){return e(this)}};export{v as gov_card};
//# sourceMappingURL=p-4ce8e721.entry.js.map