import{r as v,h as l,H as c,q as _,s as p,w as i}from"./index-BeCeuELg.js";import{w as f}from"./validation-4dfd3138-ComY-4MF.js";import{K as m}from"./Alert-733b0883-Df5pVzCu.js";import{v as b}from"./has-closer-a8a4f5f3-DXx-GQ_m.js";import{v as y}from"./label-3757689e-D7ErDa5R.js";import"./tslib.es6-1173d062-BGVaTf34.js";import"./i18n-43b7aa72-DSS4ELtF.js";import"./clsx-09a06a12-B-dksMZM.js";const s=["default","info","success","warning","error"],o=["card","msg"],H=class{constructor(t){v(this,t),this.close=()=>{var e,a;(a=(e=this._on)===null||e===void 0?void 0:e.onClose)===null||a===void 0||a.call(e,new Event("Close"))},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this.validateOnValue=e=>typeof e=="object"&&e!==null&&typeof e.onClose=="function",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:e,_label:a,_level:r,_type:n,_variant:d}=this.state,h={alert:t,hasCloser:e,label:a,level:r,type:n,variant:d,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return l(c,{key:"93a18daf255ec95713c85ec926081163cb70df4a"},l(m,Object.assign({key:"dcfb772612cbe77e683b839474ce1e6e56e22dc4"},h),l("slot",{key:"daaca45ea2680f9f458dd24c41947214f391d8b2"})))}validateAlert(t){_(this,"_alert",t)}validateHasCloser(t){b(this,t)}validateLabel(t){y(this,t)}validateLevel(t){f(this,t)}validateOn(t){this.validateOnValue(t)&&p(this,"_on",{onClose:t.onClose})}validateType(t){i(this,"_type",e=>typeof e=="string"&&s.includes(e),new Set(`String {${s.join(", ")}`),t)}validateVariant(t){i(this,"_variant",e=>typeof e=="string"&&o.includes(e),new Set(`AlertVariant {${o.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)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{H as kol_alert_wc};
//# sourceMappingURL=kol-alert-wc.entry-CUmYrMHT.js.map
