ng-hub-ui-avatar
Version:
A universal avatar component for Angular applications that fetches / generates avatar based on the information you have about the user. Supports initials, Gravatar integration, custom images and styling options. Perfect for user profiles and comment syste
1 lines • 57.3 kB
Source Map (JSON)
{"version":3,"file":"ng-hub-ui-avatar.mjs","sources":["../../../projects/avatar/src/lib/avatar-config.token.ts","../../../projects/avatar/src/lib/avatar-config.service.ts","../../../projects/avatar/src/lib/sources/avatar-source.enum.ts","../../../projects/avatar/src/lib/avatar.service.ts","../../../projects/avatar/src/lib/sources/async-source.ts","../../../projects/avatar/src/lib/shared/resolve-hub-accent.ts","../../../projects/avatar/src/lib/sources/facebook.ts","../../../projects/avatar/src/lib/sources/custom.ts","../../../projects/avatar/src/lib/sources/initials.ts","../../../projects/avatar/src/lib/sources/gravatar.ts","../../../projects/avatar/src/lib/sources/value.ts","../../../projects/avatar/src/lib/sources/github.ts","../../../projects/avatar/src/lib/sources/custom-no-cache.ts","../../../projects/avatar/src/lib/sources/source.factory.ts","../../../projects/avatar/src/lib/avatar.component.ts","../../../projects/avatar/src/lib/avatar.module.ts","../../../projects/avatar/src/lib/avatar.providers.ts","../../../projects/avatar/src/public_api.ts","../../../projects/avatar/src/ng-hub-ui-avatar.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\n/**\n * Token used to inject the AvatarConfig object\n */\nexport const AVATAR_CONFIG = new InjectionToken<AvatarConfig>('avatar.config');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport type { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarSource } from './sources/avatar-source.enum';\n\n@Injectable({ providedIn: 'root' })\nexport class AvatarConfigService {\n\tconstructor(\n\t\t@Optional()\n\t\t@Inject(AVATAR_CONFIG)\n\t\tpublic userConfig: AvatarConfig\n\t) {}\n\n\tpublic getAvatarSources(defaultSources: AvatarSource[]): AvatarSource[] {\n\t\tif (\n\t\t\tthis.userConfig &&\n\t\t\tthis.userConfig.sourcePriorityOrder &&\n\t\t\tthis.userConfig.sourcePriorityOrder.length\n\t\t) {\n\t\t\tconst uniqueSources = [\n\t\t\t\t...new Set(this.userConfig.sourcePriorityOrder)\n\t\t\t];\n\t\t\tconst validSources = uniqueSources.filter((source) =>\n\t\t\t\tdefaultSources.includes(source)\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...validSources,\n\t\t\t\t...defaultSources.filter(\n\t\t\t\t\t(source) => !validSources.includes(source)\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\t\treturn defaultSources;\n\t}\n\n\tpublic getAvatarColors(defaultColors: string[]): string[] {\n\t\treturn (\n\t\t\t(this.userConfig &&\n\t\t\t\tthis.userConfig.colors &&\n\t\t\t\tthis.userConfig.colors.length &&\n\t\t\t\tthis.userConfig.colors) ||\n\t\t\tdefaultColors\n\t\t);\n\t}\n\n\tpublic getDisableSrcCache(defaultDisableSrcCache: boolean): boolean {\n\t\tif (\n\t\t\tthis.userConfig == null ||\n\t\t\tthis.userConfig.disableSrcCache == null\n\t\t) {\n\t\t\treturn defaultDisableSrcCache;\n\t\t} else {\n\t\t\treturn this.userConfig.disableSrcCache;\n\t\t}\n\t}\n}\n","export enum AvatarSource {\n FACEBOOK = 'facebook',\n GRAVATAR = 'gravatar',\n GITHUB = 'github',\n CUSTOM = 'custom',\n INITIALS = 'initials',\n VALUE = 'value'\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\n\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\n\n/**\n * list of Supported avatar sources\n */\nexport const defaultSources = [\n AvatarSource.FACEBOOK,\n AvatarSource.GRAVATAR,\n AvatarSource.GITHUB,\n AvatarSource.CUSTOM,\n AvatarSource.INITIALS,\n AvatarSource.VALUE\n];\n\n/**\n * list of default colors\n */\nexport const defaultColors = [\n '#1abc9c',\n '#3498db',\n '#f1c40f',\n '#8e44ad',\n '#e74c3c',\n '#d35400',\n '#2c3e50',\n '#7f8c8d'\n];\n\n/**\n * Default disable custom source cache settings\n */\nexport const defaultDisableSrcCache = false;\n\n/**\n * Provides utilities methods related to Avatar component\n */\n@Injectable({providedIn: 'root'})\nexport class AvatarService {\n public avatarSources: AvatarSource[] = defaultSources;\n public avatarColors: string[] = defaultColors;\n\n private readonly failedSources = new Map<string, Source>();\n\n constructor(\n private http: HttpClient,\n private avatarConfigService: AvatarConfigService\n ) {\n this.overrideAvatarSources();\n this.overrideAvatarColors();\n }\n\n public fetchAvatar(avatarUrl: string): Observable<unknown> {\n return this.http.get(avatarUrl);\n }\n\n public getRandomColor(avatarText: string): string {\n if (!avatarText) {\n return 'transparent';\n }\n const asciiCodeSum = this.calculateAsciiCode(avatarText);\n return this.avatarColors[asciiCodeSum % this.avatarColors.length];\n }\n\n public compareSources(\n sourceType1: AvatarSource,\n sourceType2: AvatarSource\n ): number {\n return (\n this.getSourcePriority(sourceType1) - this.getSourcePriority(sourceType2)\n );\n }\n\n public isSource(source: string): boolean {\n return this.avatarSources.includes(source as AvatarSource);\n }\n\n public isTextAvatar(sourceType: AvatarSource): boolean {\n return [AvatarSource.INITIALS, AvatarSource.VALUE].includes(sourceType);\n }\n\n private buildSourceKey(source: Source): string {\n return source.sourceType + '-' + source.sourceId;\n }\n\n public sourceHasFailedBefore(source: Source): boolean {\n return this.failedSources.has(this.buildSourceKey(source));\n }\n\n public markSourceAsFailed(source: Source): void {\n this.failedSources.set(this.buildSourceKey(source), source);\n }\n\n private overrideAvatarSources(): void {\n this.avatarSources = this.avatarConfigService.getAvatarSources(\n defaultSources\n );\n }\n\n private overrideAvatarColors(): void {\n this.avatarColors = this.avatarConfigService.getAvatarColors(defaultColors);\n }\n\n private calculateAsciiCode(value: string): number {\n return value\n .split('')\n .map(letter => letter.charCodeAt(0))\n .reduce((previous: number, current: number) => previous + current);\n }\n\n private getSourcePriority(sourceType: AvatarSource) {\n return this.avatarSources.indexOf(sourceType);\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Contract of all async sources.\n * Every async source must implement the processResponse method that extracts the avatar url from the data\n */\nexport abstract class AsyncSource implements Source {\n readonly abstract sourceType: AvatarSource;\n\n constructor(public sourceId: string) {}\n\n abstract getAvatar(size: number): string;\n abstract processResponse(data: unknown, size?: number): string | null;\n}\n","/**\n * Normalises an accent colour into a paintable value for a `--hub-*-accent` CSS slot,\n * accepting ANY colour. A bareword (a semantic name, a host-registered accent, or a CSS\n * named colour) resolves to its design-system token `var(--hub-sys-color-<name>, <name>)`\n * — the raw word is the fallback so an unregistered name still paints. A literal `#hex` /\n * `rgb()` / `oklch()` / `var(...)` is passed through unchanged. Returns `null` when the\n * value is unset or blank, so the SCSS default (or a builtin `@each`) can take over.\n *\n * @param value The raw accent value to normalise.\n * @returns The paintable CSS value, or `null` when unset/blank.\n */\nexport function resolveHubAccent(value: string | null | undefined): string | null {\n\tconst color = value?.trim();\n\tif (!color) {\n\t\treturn null;\n\t}\n\treturn /^[a-zA-Z][\\w-]*$/.test(color) ? `var(--hub-sys-color-${color}, ${color})` : color;\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Facebook source implementation.\n * Fetch avatar source based on facebook identifier\n * and image size\n */\nexport class Facebook implements Source {\n readonly sourceType: AvatarSource = AvatarSource.FACEBOOK;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return (\n 'https://graph.facebook.com/' +\n `${this.sourceId}/picture?width=${size}&height=${size}`\n );\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Custom source implementation.\n * return custom image as an avatar\n *\n */\nexport class Custom implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Initials source implementation.\n * return the initials of the given value\n */\nexport class Initials implements Source {\n readonly sourceType: AvatarSource = AvatarSource.INITIALS;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return this.getInitials(this.sourceId, size);\n }\n\n /**\n * Returns the initial letters of a name in a string.\n */\n private getInitials(name: string, size: number): string {\n name = name.trim();\n\n if (!name) {\n return '';\n }\n\n const initials = name.split(' ');\n\n if (size && size < initials.length) {\n return this.constructInitials(initials.slice(0, size));\n } else {\n return this.constructInitials(initials);\n }\n }\n\n /**\n * Iterates a person's name string to get the initials of each word in uppercase.\n */\n private constructInitials(elements: string[]): string {\n if (!elements || !elements.length) {\n return '';\n }\n\n return elements\n .filter(element => element && element.length > 0)\n .map(element => element[0].toUpperCase())\n .join('');\n }\n}\n","import { Md5 } from 'ts-md5';\nimport { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\nfunction isRetina(): boolean {\n if (typeof window !== 'undefined' && window !== null) {\n if (window.devicePixelRatio > 1.25) {\n return true;\n }\n\n const mediaQuery = '(-webkit-min-device-pixel-ratio: 1.25), (min--moz-device-pixel-ratio: 1.25), (-o-min-device-pixel-ratio: 5/4), (min-resolution: 1.25dppx)';\n if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Gravatar source implementation.\n * Fetch avatar source based on gravatar email\n */\nexport class Gravatar implements Source {\n readonly sourceType: AvatarSource = AvatarSource.GRAVATAR;\n public sourceId: string;\n\n constructor(public value: string) {\n this.sourceId = value.match('^[a-f0-9]{32}$')\n ? value\n : Md5.hashStr(value).toString();\n }\n\n public getAvatar(size: number): string {\n const avatarSize = isRetina() ? size * 2 : size;\n return `https://secure.gravatar.com/avatar/${\n this.sourceId\n }?s=${avatarSize}&d=404`;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Value source implementation.\n * return the value as avatar\n */\nexport class Value implements Source {\n readonly sourceType: AvatarSource = AvatarSource.VALUE;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { AsyncSource } from './async-source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * GitHub source implementation.\n * Fetch avatar source based on github identifier\n */\nexport class Github extends AsyncSource {\n readonly sourceType: AvatarSource = AvatarSource.GITHUB;\n\n constructor(sourceId: string) {\n super(sourceId);\n }\n\n public getAvatar(): string {\n return `https://api.github.com/users/${this.sourceId}`;\n }\n\n /**\n * extract github avatar from json data\n */\n public processResponse(data: { avatar_url: string }, size?: number): string {\n if (size) {\n return `${data.avatar_url}&s=${size}`;\n }\n return data.avatar_url;\n }\n}\n","import {Source} from './source';\nimport {AvatarSource} from './avatar-source.enum';\n\n/**\n * Custom source implementation (with no cache).\n * return custom image as an avatar\n *\n */\nexport class CustomNoCache implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n const urlSuffix = Math.random();\n return `${this.sourceId}${this.sourceId.indexOf('?') > -1 ? '&' : '?'}_=${urlSuffix}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Source } from './source';\nimport { Facebook } from './facebook';\nimport { Custom } from './custom';\nimport { Initials } from './initials';\nimport { Gravatar } from './gravatar';\nimport { Value } from './value';\nimport { Github } from './github';\nimport { SourceCreator } from './source.creator';\nimport { AvatarSource } from './avatar-source.enum';\nimport { AvatarConfigService } from '../avatar-config.service';\nimport { defaultDisableSrcCache } from '../avatar.service';\nimport { CustomNoCache } from './custom-no-cache';\n\n/**\n * Factory class that implements factory method pattern.\n * Used to create Source implementation class based\n * on the source Type\n */\n@Injectable({providedIn: 'root'})\nexport class SourceFactory {\n private sources: { [key: string]: SourceCreator } = {};\n\n constructor(avatarConfigService: AvatarConfigService) {\n const disableSrcCache = avatarConfigService.getDisableSrcCache(defaultDisableSrcCache);\n this.sources[AvatarSource.FACEBOOK] = Facebook;\n this.sources[AvatarSource.GRAVATAR] = Gravatar;\n this.sources[AvatarSource.CUSTOM] = disableSrcCache ? CustomNoCache : Custom;\n this.sources[AvatarSource.INITIALS] = Initials;\n this.sources[AvatarSource.VALUE] = Value;\n this.sources[AvatarSource.GITHUB] = Github;\n }\n\n public newInstance(sourceType: AvatarSource, sourceValue: string): Source {\n return new this.sources[sourceType](sourceValue);\n }\n}\n","import { AfterContentInit, Component, ElementRef, OnChanges, OnDestroy, SecurityContext, SimpleChanges, ViewChild, booleanAttribute, computed, input, output } from '@angular/core';\n\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\nimport { map, takeWhile } from 'rxjs/operators';\nimport { AvatarService } from './avatar.service';\nimport { AsyncSource } from './sources/async-source';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { resolveHubAccent } from './shared/resolve-hub-accent';\nimport { Source } from './sources/source';\nimport { SourceFactory } from './sources/source.factory';\n\ntype StyleObject = Record<string, string | number | null | undefined>;\ntype Style = StyleObject | string;\n\n/**\n * Semantic colours for the avatar badge and the avatar colour variants. Each maps\n * to a design-system `--hub-sys-color-*` token. Use them to colour a presence dot\n * (e.g. `success` = online, `warning` = away, `danger` = busy, `secondary` = offline)\n * or a labelled badge. Any custom string is also accepted (set `--hub-avatar-badge-color`).\n */\nexport type HubAvatarBadgeColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';\n\n/**\n * Universal avatar component that\n * generates avatar from different sources\n *\n * export\n * class AvatarComponent\n * implements {OnChanges}\n */\n\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: 'hub-avatar',\n\tstandalone: true,\n\tstyleUrl: './avatar.component.scss',\n\ttemplate: `\n\t\t<div (click)=\"onAvatarClicked()\" class=\"avatar-container\" [class.hub-avatar--custom]=\"hasCustomContent\" [style]=\"hostStyle\">\n\t\t\t<span #customContent class=\"hub-avatar__custom\" [style]=\"customContentStyle\"><ng-content></ng-content></span>\n\t\t\t@if (!hasCustomContent) {\n\t\t\t\t@if (avatarSrc) {\n\t\t\t\t\t<img\n\t\t\t\t\t\t[src]=\"avatarSrc\"\n\t\t\t\t\t\t[alt]=\"customAlt() ? customAlt() : avatarAlt\"\n\t\t\t\t\t\t[width]=\"size()\"\n\t\t\t\t\t\t[height]=\"size()\"\n\t\t\t\t\t\t[style]=\"avatarStyle\"\n\t\t\t\t\t\t[referrerPolicy]=\"referrerpolicy()\"\n\t\t\t\t\t\t(error)=\"fetchAvatarSource()\"\n\t\t\t\t\t\tclass=\"avatar-content\"\n\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t/>\n\t\t\t\t} @else {\n\t\t\t\t\t@if (avatarText) {\n\t\t\t\t\t\t<div class=\"avatar-content\" [style]=\"avatarStyle\">\n\t\t\t\t\t\t\t{{ avatarText }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t</div>\n\t\t@if (_hasBadge()) {\n\t\t\t<span\n\t\t\t\tclass=\"hub-avatar__badge\"\n\t\t\t\t[class.hub-avatar__badge--dot]=\"_isDot()\"\n\t\t\t\t[class.hub-avatar__badge--label]=\"!_isDot()\"\n\t\t\t\t[attr.aria-hidden]=\"_isDot() ? 'true' : null\"\n\t\t\t\t>{{ _badgeText() }}</span\n\t\t\t>\n\t\t}\n\t`,\n\thost: {\n\t\t'[attr.data-badge-color]': 'badgeColor() || null',\n\t\t'[style.--hub-avatar-badge-color]': 'badgeColorVar()',\n\t\t'[style.--hub-avatar-size]': 'avatarSizePx'\n\t}\n})\nexport class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy {\n\treadonly round = input(true);\n\treadonly size = input<string | number>(50);\n\treadonly textSizeRatio = input(3);\n\treadonly bgColor = input<string>();\n\treadonly fgColor = input('#FFF');\n\treadonly borderColor = input<string>();\n\t/**\n\t * When `true` (default) an initials avatar gets a background colour derived from\n\t * a hash of its `name`, applied inline. Set to `false` to suppress that inline\n\t * colour so the avatar can be themed via the `--hub-avatar-bg-color` CSS variable\n\t * without needing `!important`. An explicit `bgColor` always wins over both.\n\t */\n\treadonly autoColor = input(true, { transform: booleanAttribute });\n\treadonly style = input<Style>({});\n\treadonly cornerRadius = input<string | number>(0);\n\treadonly facebook = input<string | null>(undefined, { alias: 'facebookId' });\n\treadonly gravatar = input<string | null>(undefined, { alias: 'gravatarId' });\n\treadonly github = input<string | null>(undefined, { alias: 'githubId' });\n\treadonly custom = input<string | SafeUrl | null>(undefined, { alias: 'src' });\n\treadonly customAlt = input<string | null>(undefined, { alias: 'alt' });\n\treadonly initials = input<string | null>(undefined, { alias: 'name' });\n\treadonly value = input<string | null>();\n\treadonly referrerpolicy = input<string | null>();\n\treadonly placeholder = input<string>();\n\treadonly initialsSize = input<string | number>(0);\n\t/**\n\t * Overlay badge at the bottom-end corner. A boolean / empty value renders a plain\n\t * dot (great for a presence indicator); a string or number renders a labelled badge\n\t * (e.g. a count like `\"4k\"`). `null` / absent (default) renders nothing.\n\t *\n\t * @example <hub-avatar badge badgeColor=\"success\" /> // dot\n\t * @example <hub-avatar badge=\"4k\" badgeColor=\"danger\" /> // labelled\n\t */\n\treadonly badge = input<string | number | boolean | null>(null);\n\n\t/**\n\t * Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).\n\t * Maps to a `--hub-sys-color-*` token; any custom string also works (set\n\t * `--hub-avatar-badge-color`). When unset the badge uses a neutral default.\n\t */\n\treadonly badgeColor = input<HubAvatarBadgeColor | (string & {}) | null>(null);\n\n\t/**\n\t * Normalises {@link badgeColor} into a paintable value for the `--hub-avatar-badge-color`\n\t * accent slot, accepting ANY colour. A bareword (a semantic name, a host-registered accent,\n\t * or a CSS named colour) resolves to its design-system token `var(--hub-sys-color-<name>,\n\t * <name>)` — the raw word is the fallback so an unregistered name still paints. A literal\n\t * `#hex` / `rgb()` / `oklch()` / `var(...)` is passed through unchanged. `null` when unset,\n\t * so the SCSS default (and the builtin `@each` per `data-badge-color`) takes over.\n\t */\n\tprotected readonly badgeColorVar = computed(() => resolveHubAccent(this.badgeColor()));\n\n\t/** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */\n\tprotected readonly _hasBadge = computed(() => {\n\t\tconst b = this.badge();\n\t\treturn b !== null && b !== undefined && b !== false;\n\t});\n\n\t/** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */\n\tprotected readonly _badgeText = computed(() => {\n\t\tconst b = this.badge();\n\t\tif (b === true || b === '' || b === null || b === undefined || b === false) {\n\t\t\treturn '';\n\t\t}\n\t\treturn String(b);\n\t});\n\n\t/** True when the badge is a plain dot (shown, but with no text content). */\n\tprotected readonly _isDot = computed(() => this._hasBadge() && this._badgeText() === '');\n\n\treadonly clickOnAvatar = output<Source>();\n\n\t/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */\n\t@ViewChild('customContent', { static: true }) private customContentRef?: ElementRef<HTMLElement>;\n\n\t/** True when the consumer projected custom content (an icon, SVG, image, …) into the avatar. */\n\thasCustomContent = false;\n\n\t/** Inline style applied to the projected-content slot (honours `bgColor` / `fgColor` / `borderColor` / `style`). */\n\tcustomContentStyle: StyleObject = {};\n\n\tisAlive = true;\n\tavatarSrc: SafeUrl | null = null;\n\tavatarAlt: SafeUrl | null = null;\n\tavatarText: string | null = null;\n\tavatarStyle: StyleObject = {};\n\thostStyle: StyleObject = {};\n\n\tprivate currentIndex = -1;\n\tprivate sources: Source[] = [];\n\n\tconstructor(\n\t\tprivate sourceFactory: SourceFactory,\n\t\tprivate avatarService: AvatarService,\n\t\tprivate sanitizer: DomSanitizer\n\t) {}\n\n\tonAvatarClicked(): void {\n\t\tthis.clickOnAvatar.emit(this.sources[this.currentIndex]);\n\t}\n\n\t/**\n\t * Detects projected content once it is available and, when present, computes its style.\n\t * Runs after content init so `<ng-content>` nodes are already in place.\n\t */\n\tngAfterContentInit(): void {\n\t\tconst host = this.customContentRef?.nativeElement;\n\t\tthis.hasCustomContent = !!host && this.hasMeaningfulProjectedContent(host);\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Returns true when the projected slot holds a real element or non-whitespace text,\n\t * so whitespace-only projection does not flip the avatar into custom-content mode.\n\t *\n\t * @param host The element wrapping the projected content.\n\t */\n\tprivate hasMeaningfulProjectedContent(host: HTMLElement): boolean {\n\t\treturn Array.from(host.childNodes).some(\n\t\t\t(node) =>\n\t\t\t\tnode.nodeType === Node.ELEMENT_NODE ||\n\t\t\t\t(node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim().length > 0)\n\t\t);\n\t}\n\n\t/**\n\t * Builds the inline style for the projected-content slot. Sensible visible defaults\n\t * (a themed background circle and a readable foreground colour) come from CSS tokens;\n\t * the `bgColor` / `fgColor` / `borderColor` / `style` inputs override them when set.\n\t */\n\tprivate getCustomContentStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\tbackgroundColor: bgColor ? bgColor : undefined,\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t * The avatar size as a px string. Exposed on the host as `--hub-avatar-size`\n\t * so the status dot (and any token-driven child) scales with the avatar.\n\t */\n\tget avatarSizePx(): string {\n\t\treturn (parseFloat(String(this.size())) || 50) + 'px';\n\t}\n\n\t/**\n\t * Detect inputs change\n\t *\n\t * param {{ [propKey: string]: SimpleChange }} changes\n\t *\n\t * memberof AvatarComponent\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tfor (const propName in changes) {\n\t\t\tif (this.avatarService.isSource(propName)) {\n\t\t\t\tconst sourceType: AvatarSource = AvatarSource[propName.toUpperCase() as keyof typeof AvatarSource];\n\t\t\t\tconst currentValue = changes[propName].currentValue;\n\t\t\t\tif (currentValue && typeof currentValue === 'string') {\n\t\t\t\t\tthis.addSource(sourceType, currentValue);\n\t\t\t\t} else {\n\t\t\t\t\tconst sanitized = this.sanitizer.sanitize(SecurityContext.URL, currentValue);\n\t\t\t\t\tif (sanitized) {\n\t\t\t\t\t\tthis.addSource(sourceType, sanitized);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.removeSource(sourceType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Reinitialize when any source input changes so fallback order is recalculated.\n\t\tthis.initializeAvatar();\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Fetch avatar source\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tfetchAvatarSource(): void {\n\t\tconst previousSource = this.sources[this.currentIndex];\n\t\tif (previousSource) {\n\t\t\tthis.avatarService.markSourceAsFailed(previousSource);\n\t\t}\n\n\t\tconst source = this.findNextSource();\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.avatarService.isTextAvatar(source.sourceType)) {\n\t\t\tthis.buildTextAvatar(source);\n\t\t\tthis.avatarSrc = null;\n\t\t} else {\n\t\t\tthis.buildImageAvatar(source);\n\t\t}\n\t}\n\n\tprivate findNextSource(): Source | null {\n\t\twhile (++this.currentIndex < this.sources.length) {\n\t\t\tconst source = this.sources[this.currentIndex];\n\t\t\tif (source && !this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.isAlive = false;\n\t}\n\n\t/**\n\t * Initialize the avatar component and its fallback system\n\t */\n\tprivate initializeAvatar(): void {\n\t\tconst computedBorderRadius = this.round()\n\t\t\t? '50%'\n\t\t\t: this.cornerRadius() + 'px';\n\t\tthis.hostStyle = {\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\tborderRadius: computedBorderRadius\n\t\t};\n\n\t\tthis.currentIndex = -1;\n\t\tif (this.sources.length > 0) {\n\t\t\tthis.sortAvatarSources();\n\t\t\tthis.fetchAvatarSource();\n\t\t}\n\t}\n\n\tprivate sortAvatarSources(): void {\n\t\tthis.sources.sort((source1: Source, source2: Source) =>\n\t\t\tthis.avatarService.compareSources(source1.sourceType, source2.sourceType)\n\t\t);\n\t}\n\n\tprivate buildTextAvatar(avatarSource: Source): void {\n\t\tthis.avatarText = avatarSource.getAvatar(+this.initialsSize());\n\t\tthis.avatarStyle = this.getInitialsStyle(avatarSource.sourceId);\n\t}\n\n\tprivate buildImageAvatar(avatarSource: Source): void {\n\t\tthis.avatarStyle = this.getImageStyle();\n\t\tif (avatarSource instanceof AsyncSource) {\n\t\t\tthis.fetchAndProcessAsyncAvatar(avatarSource);\n\t\t} else {\n\t\t\tthis.avatarSrc = this.sanitizer.bypassSecurityTrustUrl(avatarSource.getAvatar(+this.size()));\n\t\t\tthis.avatarAlt = avatarSource.getAvatar(+this.size());\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * returns initials style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getInitialsStyle(avatarValue: string): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\ttextAlign: 'center',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '100%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\ttextTransform: 'uppercase',\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\t// Explicit `bgColor` wins; otherwise the hash colour is applied inline only\n\t\t\t// while `autoColor` is on. With `[autoColor]=\"false\"` no inline background is\n\t\t\t// emitted, so `.avatar-content { background-color: var(--hub-avatar-bg-color, …) }`\n\t\t\t// takes over and the consumer can theme the avatar through the token.\n\t\t\tbackgroundColor: bgColor ? bgColor : this.autoColor() ? this.avatarService.getRandomColor(avatarValue) : undefined,\n\t\t\t// Only the size is set inline (it scales with `size`); the family comes from\n\t\t\t// `.avatar-content { font-family: var(--hub-avatar-font-family, …) }` so the\n\t\t\t// initials honour the same token as the rest of the avatar (a `font` shorthand\n\t\t\t// here would pin Helvetica and shadow it).\n\t\t\tfontSize: Math.floor(+this.size() / this.textSizeRatio()) + 'px',\n\t\t\tlineHeight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t *\n\t * returns image style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getImageStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\treturn {\n\t\t\tmaxWidth: '100%',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '50%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\tprivate getCustomStyleObject(): StyleObject {\n\t\tconst customStyle = this.style();\n\t\tif (!customStyle) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (typeof customStyle === 'string') {\n\t\t\treturn this.parseInlineStyleString(customStyle);\n\t\t}\n\n\t\treturn customStyle;\n\t}\n\n\tprivate parseInlineStyleString(styleString: string): StyleObject {\n\t\tconst styleObject: StyleObject = {};\n\t\tstyleString\n\t\t\t.split(';')\n\t\t\t.map((declaration) => declaration.trim())\n\t\t\t.filter((declaration) => declaration.length > 0)\n\t\t\t.forEach((declaration) => {\n\t\t\t\tconst separatorIndex = declaration.indexOf(':');\n\t\t\t\tif (separatorIndex <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst property = declaration.slice(0, separatorIndex).trim();\n\t\t\t\tconst value = declaration.slice(separatorIndex + 1).trim();\n\t\t\t\tif (property && value) {\n\t\t\t\t\tstyleObject[property] = value;\n\t\t\t\t}\n\t\t\t});\n\t\treturn styleObject;\n\t}\n\n\t/**\n\t * Fetch avatar image asynchronously.\n\t *\n\t * param {Source} source represents avatar source\n\t * memberof AvatarComponent\n\t */\n\tprivate fetchAndProcessAsyncAvatar(source: AsyncSource): void {\n\t\tif (this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.avatarService\n\t\t\t.fetchAvatar(source.getAvatar(+this.size()))\n\t\t\t.pipe(\n\t\t\t\ttakeWhile(() => this.isAlive),\n\t\t\t\tmap((response) => source.processResponse(response, +this.size()))\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (avatarSrc) => (this.avatarSrc = avatarSrc),\n\t\t\t\terror: () => {\n\t\t\t\t\tthis.fetchAvatarSource();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Add avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t * param sourceValue source value e.g facebookId value, etc.\n\t */\n\tprivate addSource(sourceType: AvatarSource, sourceValue: string): void {\n\t\tconst source = this.sources.find((s) => s.sourceType === sourceType);\n\t\tif (source) {\n\t\t\tsource.sourceId = sourceValue;\n\t\t} else {\n\t\t\tthis.sources.push(this.sourceFactory.newInstance(sourceType, sourceValue));\n\t\t}\n\t}\n\n\t/**\n\t * Remove avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t */\n\tprivate removeSource(sourceType: AvatarSource): void {\n\t\tthis.sources = this.sources.filter((source) => source.sourceType !== sourceType);\n\t}\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarComponent } from './avatar.component';\n\n/**\n * Backward-compatibility module for `<hub-avatar>`.\n *\n * @deprecated `AvatarComponent` is now a standalone component. Import it directly\n * (`imports: [AvatarComponent]`) and, if you need custom configuration, register\n * `provideAvatar()` in your application providers. This module only re-exports the\n * standalone component and will be removed in a future major version.\n */\n@NgModule({\n\timports: [AvatarComponent],\n\texports: [AvatarComponent]\n})\nexport class AvatarModule {\n\t/**\n\t * @deprecated Use `provideAvatar(config)` with the standalone APIs instead.\n\t * Kept so existing `AvatarModule.forRoot()` consumers keep working.\n\t */\n\tstatic forRoot(avatarConfig?: AvatarConfig): ModuleWithProviders<AvatarModule> {\n\t\treturn {\n\t\t\tngModule: AvatarModule,\n\t\t\tproviders: [\n\t\t\t\t{\n\t\t\t\t\tprovide: AVATAR_CONFIG,\n\t\t\t\t\tuseValue: avatarConfig ? avatarConfig : {}\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t}\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\n\n/**\n * Registers the avatar configuration for standalone applications.\n *\n * Standalone-friendly replacement for `AvatarModule.forRoot()`. Add it to your\n * `bootstrapApplication` providers (or a route's `providers`) to customise the\n * avatar source priority, colour palette or src-cache behaviour. Calling it is\n * optional — `<hub-avatar>` works out of the box with sensible defaults.\n *\n * ```ts\n * import { provideAvatar } from 'ng-hub-ui-avatar';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideAvatar({ sourcePriorityOrder: [AvatarSource.GRAVATAR, AvatarSource.INITIALS] })\n * ]\n * });\n * ```\n *\n * @param config Optional avatar configuration.\n * @returns Environment providers to add to the application config.\n */\nexport function provideAvatar(config?: AvatarConfig): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: AVATAR_CONFIG,\n\t\t\tuseValue: config ?? {}\n\t\t}\n\t]);\n}\n","/*\n * Public API Surface of ng-hub-ui-avatar\n */\nexport * from './lib/avatar-config';\nexport * from './lib/avatar.component';\nexport * from './lib/avatar.module';\nexport * from './lib/avatar.providers';\nexport * from './lib/avatar.service';\nexport * from './lib/sources/avatar-source.enum';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.AvatarConfigService","i1.AvatarConfigService","i1.SourceFactory","i2.AvatarService"],"mappings":";;;;;;;AAGA;;AAEG;AACI,MAAM,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe,CAAC;;MCCjE,mBAAmB,CAAA;AAIvB,IAAA,UAAA;AAHR,IAAA,WAAA,CAGQ,UAAwB,EAAA;QAAxB,IAAA,CAAA,UAAU,GAAV,UAAU;IACf;AAEI,IAAA,gBAAgB,CAAC,cAA8B,EAAA;QACrD,IACC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,mBAAmB;AACnC,YAAA,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,EACzC;AACD,YAAA,MAAM,aAAa,GAAG;gBACrB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB;aAC9C;AACD,YAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAChD,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/B;YACD,OAAO;AACN,gBAAA,GAAG,YAAY;AACf,gBAAA,GAAG,cAAc,CAAC,MAAM,CACvB,CAAC,MAAM,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;aAE3C;QACF;AACA,QAAA,OAAO,cAAc;IACtB;AAEO,IAAA,eAAe,CAAC,aAAuB,EAAA;AAC7C,QAAA,QACC,CAAC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,MAAM;AACtB,YAAA,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM;AAC7B,YAAA,IAAI,CAAC,UAAU,CAAC,MAAM;AACvB,YAAA,aAAa;IAEf;AAEO,IAAA,kBAAkB,CAAC,sBAA+B,EAAA;AACxD,QAAA,IACC,IAAI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