/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as registerInstance,h,H as Host}from"./index-12b1e13a.js";import{w as watchHeadingLevel}from"./validation-14b61e5a.js";import{K as KolAlertFc}from"./Alert-5705426b.js";import{b as watchBoolean,s as setState,w as watchValidator}from"./prop.validators-9feb1d92.js";import{v as validateHasCloser}from"./has-closer-a4e62c58.js";import{v as validateLabel}from"./label-d0315384.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-d278f819.js";import"./dev.utils-fab45cbc.js";import"./index-da3e0c00.js";const alertTypeOptions=["default","info","success","warning","error"],alertVariantOptions=["card","msg"],KolAlertWc=class{constructor(e){registerInstance(this,e),this.close=()=>{var e,t;null===(t=null===(e=this._on)||void 0===e?void 0:e.onClose)||void 0===t||t.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:e,_hasCloser:t,_label:a,_level:l,_type:i,_variant:s}=this.state,o={alert:e,hasCloser:t,label:a,level:l,type:i,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return h(Host,{key:"477b8787c6570a9adae125553184e0273200583f"},h(KolAlertFc,Object.assign({key:"723d3d05c035e3280e59c92051fe72c2f11a7b96"},o),h("slot",{key:"c44a3281ce03a71d68e967a2c2a5ffd7f2dfc2ec"})))}validateAlert(e){watchBoolean(this,"_alert",e)}validateHasCloser(e){validateHasCloser(this,e)}validateLabel(e){validateLabel(this,e)}validateLevel(e){watchHeadingLevel(this,e)}validateOn(e){this.validateOnValue(e)&&setState(this,"_on",{onClose:e.onClose})}validateType(e){watchValidator(this,"_type",(e=>"string"==typeof e&&alertTypeOptions.includes(e)),new Set(`String {${alertTypeOptions.join(", ")}`),e)}validateVariant(e){watchValidator(this,"_variant",(e=>"string"==typeof e&&alertVariantOptions.includes(e)),new Set(`AlertVariant {${alertVariantOptions.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{KolAlertWc as kol_alert_wc};