/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as t,h as s,g as e}from"./index-Brmny3Vg.js";import{K as i}from"./Alert-COvq80W3.js";import{b as a,e as o,s as r}from"./common-DEEjER7G.js";import{v as l}from"./has-closer-GBI76y-L.js";import{v as n}from"./label-Cg7TG_7b.js";import{d as h,K as d}from"./events-BhfZTW2e.js";import{w as c}from"./validation-VhuthteS.js";import"./tslib.es6-QNbPBOk5.js";import"./clsx-COFh-Vc8.js";import"./component-names-Dy77vq43.js";import"./i18n-CaL2ODdQ.js";import"./i18n-B2d_exHc.js";import"./bem-registry-B9CzNnO1.js";import"./component-DHo2YdSx.js";import"./Heading-Hh3eykel.js";import"./level-CfQolHx4.js";import"./normalizers-pgU77mXp.js";import"./_Uint8Array-kJHDjtoP.js";import"./isArray-CcrBs4JM.js";const m=["default","info","success","warning","error"];const v=t=>typeof t==="string"&&m.includes(t);const p=(t,s)=>{a(t,"_type",v,new Set(m),s)};const f=["card","msg"];const j=t=>typeof t==="string"&&f.includes(t);const _=(t,s)=>{a(t,"_variant",j,new Set(f),s)};const b=class{constructor(s){t(this,s);this.close=()=>{var t,s;(s=(t=this._on)===null||t===void 0?void 0:t.onClose)===null||s===void 0?void 0:s.call(t,new Event("Close"));if(this.host){h(this.host,d.close)}};this.handleAlertTimeout=()=>{this.validateAlert(false)};this._alert=false;this._hasCloser=false;this._level=0;this._type="default";this._variant="msg";this.state={_level:0};this.validateOnValue=t=>typeof t==="object"&&t!==null&&typeof t.onClose==="function"}render(){const{_alert:t,_hasCloser:e,_label:a,_level:o,_type:r,_variant:l}=this.state;const n={alert:t,hasCloser:e,label:a,level:o,type:r,variant:l,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return s(i,Object.assign({key:"ab90b52cbda1d61514c3acd292d0bd6d91f0c9d5"},n),s("slot",{key:"6a7e2a89cfabde71c1140d4cf5de28e99bc09ef4"}))}validateAlert(t){o(this,"_alert",t)}validateHasCloser(t){l(this,t)}validateLabel(t){n(this,t)}validateLevel(t){c(this,t)}validateOn(t){if(this.validateOnValue(t)){r(this,"_on",{onClose:t.onClose})}}validateType(t){p(this,t)}validateVariant(t){_(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{b as kol_alert_wc};
//# sourceMappingURL=kol-alert-wc.entry.js.map