import{p as t,H as s,c as e,h as o,a as i}from"./index.js";import{g as a,t as n}from"./p-DKo9A5gq.js";import{F as c}from"./p-5itQzbON.js";import{v as l}from"./p-BKP-F1qP.js";import{C as r}from"./p-U40vKHrs.js";import{p as h}from"./p-CQvUntGY.js";import{A as d,a as b,i as f}from"./p-CXgom82_.js";import{d as m}from"./p-CWqMiVYH.js";import{d as v}from"./p-BJnSrRNH.js";const p=h(r,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var g;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(g||(g={}));const u={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const y=t(class t extends s{constructor(){super();this.__registerHost();this.govClose=e(this,"gov-close");this.hydrated=false;this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){l(p,t,u.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}connectedCallback(){this.hydrated=true}render(){const t=o("gov-button",{key:"aaaf43a5b48ccded5f30061b7b6dfd09da11e970",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:u.close},o("gov-icon",{key:"3f4f5c3b15842ff258035badfbf9286dacdba8b5",name:"x-lg",type:"components"}));return o(i,{key:"7d52bcf1a541c5c536755a16e13dd66209d7ba98",class:this.h.classes(u.root),color:this.color,type:this.type,hydrated:this.hydrated},o("section",Object.assign({key:"e52815b07de6e3fae05bb4429ab925300fde0a50",class:u.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&o("span",{key:"d1424933f1f122693d45803eb500aff8c7b45dd7"},o("slot",{key:"94ab048d5e2e506773402a55d399f3c315307153",name:"icon"})),o("div",{key:"b59bbe4b7516d0b4e96e19618613d9e82551cd39",class:u.content},this.h.hasSlot("headline")?o(c,null,o("div",{class:u.headline},o("slot",{name:"headline"}),o("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},o("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),o("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},o("slot",null))):o("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:u.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-infobar",{color:[1],type:[1],role:[1],accessibleCloseLabel:[1,"accessible-close-label"],accessibleToggleLabel:[1,"accessible-toggle-label"],closable:[4],toggleContent:[32],inheritedAttributes:[32]},undefined,{color:["validateColor"]}]);function C(){if(typeof customElements==="undefined"){return}const t=["gov-infobar","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-infobar":if(!customElements.get(t)){customElements.define(t,y)}break;case"gov-button":if(!customElements.get(t)){m()}break;case"gov-icon":if(!customElements.get(t)){v()}break}}))}C();const k=y;const j=C;export{k as GovInfobar,j as defineCustomElement};
//# sourceMappingURL=gov-infobar.js.map