/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as t,h as e,H as a}from"./index-a0b4dca2.js";import{w as s}from"./validation-e83461ea.js";import{K as i}from"./Alert-a0cdc528.js";import{b as l,s as r,w as o}from"./prop.validators-c5e6ad2d.js";import{v as n}from"./has-closer-aa8f6369.js";import{v as d}from"./label-d70e7c34.js";import"./tslib.es6-2e5096f8.js";import"./clsx-09a06a12.js";import"./i18n-5fe08f1c.js";import"./i18n-7ea9f137.js";import"./reuse-32931294.js";import"./component-names-aa3cbc3c.js";import"./Heading-781aa65b.js";import"./dev.utils-fab45cbc.js";import"./index-541b643a.js";const h=["default","info","success","warning","error"],c=["card","msg"],v=class{constructor(e){t(this,e),this.close=()=>{var e,a;null===(a=null===(e=this._on)||void 0===e?void 0:e.onClose)||void 0===a||a.call(e,new Event("Close"))},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this.validateOnValue=e=>"object"==typeof e&&null!==e&&"function"==typeof e.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=1,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:1}}render(){const{_alert:t,_hasCloser:s,_label:l,_level:o,_type:r,_variant:n}=this.state,d={alert:t,hasCloser:s,label:l,level:o,type:r,variant:n,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return e(a,{key:"8474b6eb8e56583abb97f2aa7b786216b5cd14a0"},e(i,Object.assign({key:"ec4f2676790c69196690d3b91a09cbb3dddda0ab"},d),e("slot",{key:"af19597be7443687ce020ac5557aeee053baa602"})))}validateAlert(e){l(this,"_alert",e)}validateHasCloser(e){n(this,e)}validateLabel(e){d(this,e)}validateLevel(e){s(this,e)}validateOn(e){this.validateOnValue(e)&&r(this,"_on",{onClose:e.onClose})}validateType(e){o(this,"_type",(e=>"string"==typeof e&&h.includes(e)),new Set(`String {${h.join(", ")}`),e)}validateVariant(e){o(this,"_variant",(e=>"string"==typeof e&&c.includes(e)),new Set(`AlertVariant {${c.join(", ")}`),e)}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)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{v as kol_alert_wc};