/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as t,h as s,g as e}from"./index-C_yiBYg2.js";import{K as i}from"./Alert-Cyr4RO_F.js";import{w as a,d as o,s as l}from"./common-Dd0zJQbD.js";import{v as r}from"./has-closer-CQzjaTkv.js";import{v as n}from"./label-Dnmzb2S_.js";import{d as h,K as v}from"./events-9-skLO0f.js";import{w as d}from"./validation-aqgnZOL6.js";import"./tslib.es6-CxX45GIN.js";import"./clsx-eK3rPvPS.js";import"./component-names-C3fyby67.js";import"./i18n-LBpyQ66X.js";import"./i18n-CfLoIZ8T.js";import"./bem-Dj4gWVFO.js";import"./browser-DiRe0qUf.js";import"./Heading-1FTzB33X.js";const m=["default","info","success","warning","error"],c=t=>"string"==typeof t&&m.includes(t),f=(t,e)=>{a(t,"_type",c,new Set(m),e)},p=["card","msg"],_=t=>"string"==typeof t&&p.includes(t),b=(t,e)=>{a(t,"_variant",_,new Set(p),e)},j=class{constructor(e){t(this,e),this.close=()=>{var t,e;null===(e=null===(t=this._on)||void 0===t?void 0:t.onClose)||void 0===e||e.call(t,new Event("Close")),this.host&&h(this.host,v.close)},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this._alert=!1,this._hasCloser=!1,this._level=0,this._type="default",this._variant="msg",this.state={_level:0},this.validateOnValue=t=>"object"==typeof t&&null!==t&&"function"==typeof t.onClose}render(){const{_alert:t,_hasCloser:e,_label:a,_level:l,_type:o,_variant:r}=this.state,n={alert:t,hasCloser:e,label:a,level:l,type:o,variant:r,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return s(i,Object.assign({key:"5db3514131f644ab76a9bddc438cdf0af412e6e8"},n),s("slot",{key:"61ef793542ae680a090596e44fcb98b9f4e55708"}))}validateAlert(t){o(this,"_alert",t)}validateHasCloser(t){r(this,t)}validateLabel(t){n(this,t)}validateLevel(t){d(this,t)}validateOn(t){this.validateOnValue(t)&&l(this,"_on",{onClose:t.onClose})}validateType(t){f(this,t)}validateVariant(t){b(this,t)}componentWillLoad(){this.validateAlert(this._alert),this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateType(this._type),this.validateVariant(this._variant)}get host(){return e(this)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{j as kol_alert_wc};