/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-f0fde70b.js"),index$1=require("./index-cb2ce614.js"),i18n=require("./i18n-9f4d1694.js");require("./i18n-c3fa5bd7.js");const formatNameAsInitial=a=>0===a.length?"":a[0].toUpperCase(),formatLabelAsInitials=a=>{const e=a.split(/\s+/),t=e.at(0),i=e.at(-1);return e.length>=2&&t&&i?`${formatNameAsInitial(t)}${formatNameAsInitial(i)}`:formatNameAsInitial(a)},KolAvatarWc=class{constructor(a){index.registerInstance(this,a),this._src=void 0,this._label=void 0,this.state={_src:"",_label:""}}render(){return index.h(index.Host,{key:"f0faaa1a4b75a9e31a241db182d9995b847c7c2b",class:"kol-avatar-wc"},index.h("div",{key:"2a06a185324e0bc06e2843f909b236fa4dfed4f9","aria-label":i18n.translate("kol-avatar-alt",{placeholders:{name:this.state._label}}),class:"container",role:"img"},this.state._src?index.h("img",{alt:"","aria-hidden":"true",class:"image",src:this.state._src}):index.h("span",{"aria-hidden":"true",class:"initials"},formatLabelAsInitials(this.state._label.trim()))))}validateSrc(a){index$1.validateImageSource(this,a)}validateLabel(a){index$1.validateLabel(this,a,{required:!0})}componentWillLoad(){this.validateSrc(this._src),this.validateLabel(this._label)}static get watchers(){return{_src:["validateSrc"],_label:["validateLabel"]}}};exports.kol_avatar_wc=KolAvatarWc;