/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as t,h as s,H as a}from"./index-a5e15b1e.js";import{F as e,v as i}from"./index-c3ae175d.js";import{a as r}from"./i18n-73edd5e1.js";import"./index-eb50dd62.js";import"./dev.utils-c7d151c6.js";const n=a=>0===a.length?"":a[0].toUpperCase(),l=a=>{const t=a.split(/\s+/),s=t.at(0),e=t.at(-1);return t.length>=2&&s&&e?`${n(s)}${n(e)}`:n(a)},d=class{constructor(a){t(this,a),this._src=void 0,this._label=void 0,this.state={_src:"",_label:""}}render(){return s(a,null,s("div",{"aria-label":r("kol-avatar-alt",{placeholders:{name:this.state._label}}),class:"container",role:"img"},this.state._src?s("img",{alt:"","aria-hidden":"true",class:"image",src:this.state._src}):s("span",{"aria-hidden":"true",class:"initials"},l(this.state._label.trim()))))}validateSrc(a){e(this,a)}validateLabel(a){i(this,a,{required:!0})}componentWillLoad(){this.validateSrc(this._src),this.validateLabel(this._label)}static get watchers(){return{_src:["validateSrc"],_label:["validateLabel"]}}};export{d as kol_avatar_wc};