import{r,h as i,H as a}from"./p-B2f84Zog.js";import{c as t,u as e}from"./p-D4ys0pep.js";const n=":host{display:inline-block}div{--color-background-container:var(--pine-color-background-container-hover);-ms-flex-align:center;align-items:center;background-color:var(--color-background-container);border-radius:var(--border-radius-admin-round, var(--pine-border-radius-full));display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;position:relative}:host(.pds-avatar--admin) div{--border-radius-admin-round:var(--pine-dimension-150);border-radius:var(--border-radius-admin-round)}:host(.pds-avatar--has-image) div{background:transparent}@supports selector(:has){div:has(img){background-color:transparent}}.pds-avatar__button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:var(--pine-dimension-none);border-radius:var(--pine-border-radius-full);cursor:pointer;display:-ms-flexbox;display:flex;padding:var(--pine-dimension-none)}.pds-avatar__button:focus-visible{outline:var(--pine-outline-focus)}.pds-avatar__badge{background-color:transparent;border:var(--pine-dimension-none);border-color:transparent;border-radius:var(--pine-border-radius-round);inset-block-end:var(--pine-dimension-none);inset-inline-end:var(--pine-dimension-none);position:absolute}img{border-radius:var(--border-radius-admin-round, var(--pine-border-radius-full));height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.pds-avatar__initials{color:var(--pine-color-brand);fill:var(--pine-color-brand);font-size:var(--pine-font-size-085);font-weight:var(--pine-font-weight-semi-bold);height:100%;text-align:center;width:100%}.pds-avatar__initials text{text-anchor:middle}";const s=class{constructor(a){r(this,a);this.alt=null;this.badge=false;this.dropdown=false;this.image=null;this.initials=null;this.size="lg";this.variant="customer";this.renderAssetWrapper=()=>{const r={height:this.avatarSize(),width:this.avatarSize()};return i("div",{style:r,part:"asset-wrapper"},this.renderIconOrImage(),this.renderBadge())};this.renderAvatar=()=>this.dropdown?i("button",{class:"pds-avatar__button",type:"button",part:"button","aria-label":"Avatar dropdown trigger"},this.renderAssetWrapper()):this.renderAssetWrapper();this.renderBadge=()=>this.badge&&i("pds-icon",{color:"var(--pine-color-purple-600)",class:"pds-avatar__badge",icon:t,size:"33.53%"});this.renderIconOrImage=()=>{if(this.image){return i("img",{alt:this.alt,src:this.image})}if(this.initials){return i("svg",{class:"pds-avatar__initials",viewBox:"0 0 32 32"},i("text",{x:"16",y:"20"},this.initials))}return i("pds-icon",{color:"var(--pine-color-brand)",icon:e,size:"33.53%"})};this.classNames=()=>({"pds-avatar":true,[`pds-avatar--has-image`]:this.image!==""&&this.image!==null,[`pds-avatar--has-initials`]:this.initials!==""&&this.initials!==null,[`pds-avatar--${this.variant}`]:this.variant==="admin"})}avatarSize(){const r={xs:"24px",sm:"32px",md:"40px",lg:"56px",xl:"64px"};if(r[this.size]){return r[this.size]}else{return this.size}}render(){return i(a,{key:"7bdd177a6b7064ed12cabeb21d96b0a0cc6071ae",id:this.componentId,class:Object.assign({},this.classNames())},this.renderAvatar())}};s.style=n;export{s as pds_avatar};
//# sourceMappingURL=p-984db3fc.entry.js.map