/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as t,h as e,g as s}from"./index-2ae1c631.js";import{w as i}from"./validation-14b61e5a.js";import{d as a,K as l}from"./events-5adf6b62.js";import{K as r}from"./Alert-15d42d1c.js";import{b as o,s as n,w as d}from"./prop.validators-9feb1d92.js";import{v as h}from"./has-closer-a4e62c58.js";import{v}from"./label-d0315384.js";import"./tslib.es6-1173d062.js";import"./clsx-09a06a12.js";import"./i18n-5fe08f1c.js";import"./i18n-7ea9f137.js";import"./reuse-32931294.js";import"./component-names-a18a51c8.js";import"./Heading-790c1275.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const c=["default","info","success","warning","error"],f=["card","msg"],p=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&&a(this.host,l.close)},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this.validateOnValue=t=>"object"==typeof t&&null!==t&&"function"==typeof t.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=0,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:0}}render(){const{_alert:t,_hasCloser:a,_label:s,_level:i,_type:l,_variant:o}=this.state,n={alert:t,hasCloser:a,label:s,level:i,type:l,variant:o,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return e(r,Object.assign({key:"8d045b87e0ccf5ee926c8774da3d94bda07d9660"},n),e("slot",{key:"a665623f7355e2e30b728d37d3d9e59e9ad0f43f"}))}validateAlert(t){o(this,"_alert",t)}validateHasCloser(t){h(this,t)}validateLabel(t){v(this,t)}validateLevel(t){i(this,t)}validateOn(t){this.validateOnValue(t)&&n(this,"_on",{onClose:t.onClose})}validateType(t){d(this,"_type",(t=>"string"==typeof t&&c.includes(t)),new Set(`String {${c.join(", ")}`),t)}validateVariant(t){d(this,"_variant",(t=>"string"==typeof t&&f.includes(t)),new Set(`AlertVariant {${f.join(", ")}`),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 s(this)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{p as kol_alert_wc};