/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as s,h as t,H as e,g as i}from"./index-C_yiBYg2.js";import{s as o}from"./common-Dd0zJQbD.js";import{v as a}from"./has-closer-CQzjaTkv.js";import{v as l}from"./label-Dnmzb2S_.js";import{t as r}from"./i18n-LBpyQ66X.js";import{w as d}from"./validation-aqgnZOL6.js";import{d as c}from"./component-names-C3fyby67.js";import"./Alert-Cyr4RO_F.js";import{K as n}from"./Heading-1FTzB33X.js";import"./markdown-BSkXjaSn.js";import{n as f}from"./dev.utils-D2KUwuu5.js";import{d as h,K as m}from"./events-9-skLO0f.js";import"./i18n-CfLoIZ8T.js";import"./tslib.es6-CxX45GIN.js";import"./clsx-eK3rPvPS.js";import"./bem-Dj4gWVFO.js";import"./browser-DiRe0qUf.js";const b=class{constructor(e){s(this,e),this.nonce=f(),this.translateClose=r("kol-close"),this.close=()=>{var e;void 0!==(null===(e=this._on)||void 0===e?void 0:e.onClose)&&this._on.onClose(new Event("Close")),this.host&&h(this.host,m.close)},this.on={onClick:this.close},this._hasCloser=!1,this._level=0,this.state={_label:""},this.validateOnValue=e=>"object"==typeof e&&null!==e&&"function"==typeof e.onClose}render(){return t(e,{key:"31a21a7dd16b81042127406bc4cd091f16f230d4"},t("div",{key:"22001ed9c1f73d9b6445b0b6e36109c9cc8ef608","aria-labelledby":this.nonce,class:"kol-card",role:"group"},t(n,{key:"5b6760cafee75437ba6ef208d35e05e96ec3f76a",class:"kol-card__header",id:this.nonce,level:this.state._level},this.state._label),t("div",{key:"9b780b199200df0ce78ad4f3d2f1ad746f838a8e",class:"kol-card__content"},t("slot",{key:"cdf53c951f6980b6827db3bf37ea7ad216037c69"})),this.state._hasCloser&&t(c,{key:"dd2b363336c1f891f7c6dfa4a46eca9ab1850dcf",class:"kol-card__close-button kol-close-button","data-testid":"card-close-button",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:this.translateClose,_on:this.on,_tooltipAlign:"left"})))}validateOn(e){this.validateOnValue(e)&&o(this,"_on",{onClose:e.onClose})}validateHasCloser(e){a(this,e)}validateLabel(e){l(this,e,{required:!0})}validateLevel(e){d(this,e)}componentWillLoad(){this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on)}get host(){return i(this)}static get watchers(){return{_on:["validateOn"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"]}}};export{b as kol_card_wc};