import{r as s,c as t,h as i,H as a,g as e}from"./p-ClISz4NF.js";import{v as o}from"./p-NOJjz9dT.js";import{W as n,c as h}from"./p-BjcqOprh.js";import{c}from"./p-vN03FcXN.js";import{g as r,b as l,t as d}from"./p-CoD1xawt.js";import"./p-CgDnDrq5.js";import"./p-CQvUntGY.js";import"./p-U40vKHrs.js";import"./p-BcQO4NH2.js";var p;(function(s){s["DIV"]="div";s["BUTTON"]="button"})(p||(p={}));const m=class{constructor(i){s(this,i);this.govChange=t(this,"gov-change");this.hydrated=false;this.color="primary";this.size="m";this.collapsible=false;this.disabled=false;this.isExpanded=false;this.h=r(this.host);this.triggerId=c("GovWizardItem");this.contentId=c("GovWizardContent")}validateColor(s){o(h,s,n.root)}emmitChange(){this.govChange.emit({expanded:this.isExpanded,component:n.root})}componentWillLoad(){this.validateColor(this.color)}connectedCallback(){this.hydrated=true}render(){const s=this.identifier||this.triggerId;const t=this.collapsible?p.BUTTON:p.DIV;const e=this.h.hasSlot("prefix")&&i("span",{key:"7a71f037abd3c10c7754b96089ca6d6ac9cdd9b8",class:n.prefix},i("slot",{key:"2098b7afb20be95e403b4306bc904828dd4a038e",name:"prefix"}));return i(a,{key:"2b152deb4456bad539e85ca2ccf815eefc0cb311",class:this.h.classes(n.root),"is-expanded":this.isExpanded,color:this.color,size:this.size,role:"listitem",collapsible:this.collapsible,hydrated:this.hydrated},i("div",{key:"8ad3628d1c591c3bb83c7aab740eb4f27b585cdb",class:n.header},e,this.collapsible?i(t,{id:s,class:this.h.classes(n.label),"aria-expanded":l(this.isExpanded),"aria-controls":this.contentId,disabled:this.disabled,"aria-disabled":d(this.disabled),onClick:s=>{s.preventDefault();s.stopPropagation();this.toggle()}},i("span",{class:n.headline},i("slot",{name:"headline"}),this.collapsible&&i("gov-icon",{class:n.chevron,name:"chevron-down",type:"components"})),i("slot",{name:"annotation"})):i(t,{class:this.h.classes(n.label)},i("span",{class:n.headline},i("slot",{name:"headline"}),this.collapsible&&i("gov-icon",{class:n.chevron,name:"chevron-down",type:"components"})),i("slot",{name:"annotation"}))),this.collapsible?i("div",{class:n.content,id:this.contentId,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":s},i("slot",null)):i("div",{class:n.content,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded},i("slot",null)))}async open(){this.isExpanded=true;this.emmitChange()}async close(){this.isExpanded=false;this.emmitChange()}async toggle(){this.isExpanded=!this.isExpanded;this.emmitChange()}async currentState(){return this.isExpanded}get host(){return e(this)}static get watchers(){return{color:["validateColor"]}}};export{m as gov_wizard_item};
//# sourceMappingURL=p-6f173022.entry.js.map