import{p as s,H as t,c as i,h as e,a}from"./index.js";import{v as o}from"./p-BKP-F1qP.js";import{b as n,c}from"./p-CZr7GBEo.js";import{c as l}from"./p-vN03FcXN.js";import{g as r,b as d,c as h}from"./p-DKo9A5gq.js";import{d as m}from"./p-BJnSrRNH.js";var p;(function(s){s["DIV"]="div";s["BUTTON"]="button"})(p||(p={}));const b=s(class s extends t{constructor(){super();this.__registerHost();this.govChange=i(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=l("GovWizardItem");this.contentId=l("GovWizardContent")}validateColor(s){o(c,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 i=this.h.hasSlot("prefix")&&e("span",{key:"7a71f037abd3c10c7754b96089ca6d6ac9cdd9b8",class:n.prefix},e("slot",{key:"2098b7afb20be95e403b4306bc904828dd4a038e",name:"prefix"}));return e(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},e("div",{key:"8ad3628d1c591c3bb83c7aab740eb4f27b585cdb",class:n.header},i,this.collapsible?e(t,{id:s,class:this.h.classes(n.label),"aria-expanded":d(this.isExpanded),"aria-controls":this.contentId,disabled:this.disabled,"aria-disabled":h(this.disabled),onClick:s=>{s.preventDefault();s.stopPropagation();this.toggle()}},e("span",{class:n.headline},e("slot",{name:"headline"}),this.collapsible&&e("gov-icon",{class:n.chevron,name:"chevron-down",type:"components"})),e("slot",{name:"annotation"})):e(t,{class:this.h.classes(n.label)},e("span",{class:n.headline},e("slot",{name:"headline"}),this.collapsible&&e("gov-icon",{class:n.chevron,name:"chevron-down",type:"components"})),e("slot",{name:"annotation"}))),this.collapsible?e("div",{class:n.content,id:this.contentId,"aria-hidden":d(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":s},e("slot",null)):e("div",{class:n.content,"aria-hidden":d(!this.isExpanded),hidden:!this.isExpanded},e("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 this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-wizard-item",{color:[1],size:[1],identifier:[1],collapsible:[4],disabled:[4],isExpanded:[1028,"is-expanded"],open:[64],close:[64],toggle:[64],currentState:[64]},undefined,{color:["validateColor"]}]);function f(){if(typeof customElements==="undefined"){return}const s=["gov-wizard-item","gov-icon"];s.forEach((s=>{switch(s){case"gov-wizard-item":if(!customElements.get(s)){customElements.define(s,b)}break;case"gov-icon":if(!customElements.get(s)){m()}break}}))}f();const u=b;const v=f;export{u as GovWizardItem,v as defineCustomElement};
//# sourceMappingURL=gov-wizard-item.js.map