{"version":3,"file":"ngx-tethys-icon.mjs","sources":["../../../src/icon/config.ts","../../../src/icon/icon-registry.ts","../../../src/icon/icon.component.ts","../../../src/icon/icon.module.ts","../../../src/icon/ngx-tethys-icon.ts"],"sourcesContent":["let printErrorWhenNotFound = true;\n\nexport function setPrintErrorWhenIconNotFound(value: boolean) {\n    printErrorWhenNotFound = value;\n}\n\nexport function getWhetherPrintErrorWhenIconNotFound() {\n    return printErrorWhenNotFound;\n}\n","import { forkJoin, Observable, of, throwError } from 'rxjs';\nimport { catchError, finalize, map, share, tap } from 'rxjs/operators';\n\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, SecurityContext, inject, DOCUMENT } from '@angular/core';\nimport { DomSanitizer, SafeHtml, SafeResourceUrl } from '@angular/platform-browser';\nimport { isString } from 'ngx-tethys/util';\n\nclass SvgIconConfig {\n    url!: SafeResourceUrl | null;\n    svgElement!: SVGElement | null;\n\n    constructor(data: SafeResourceUrl | SVGElement) {\n        // Note that we can't use `instanceof SVGElement` here,\n        // because it'll break during server-side rendering.\n        if (data && !!(data as any).nodeName) {\n            this.svgElement = data as SVGElement;\n        } else {\n            this.url = data as SafeResourceUrl;\n        }\n    }\n}\n\nexport type IconMode = 'font' | 'svg';\n\nexport type SvgResourceUrl = SafeResourceUrl | string;\n\nexport type SvgHtml = SafeHtml | string;\n\n/**\n * @order 20\n */\n@Injectable({\n    providedIn: 'root'\n})\nexport class ThyIconRegistry {\n    private sanitizer = inject(DomSanitizer);\n    private httpClient = inject(HttpClient, { optional: false });\n    private document = inject(DOCUMENT);\n\n    private defaultFontSetClass = 'wt-icon';\n    private internalIconMode: IconMode = 'svg';\n    private svgIconConfigs = new Map<string, SvgIconConfig>();\n    private svgIconSetConfigs = new Map<string, SvgIconConfig[]>();\n    private inProgressUrlFetches = new Map<string, Observable<string>>();\n\n    public get iconMode() {\n        return this.internalIconMode;\n    }\n\n    private getIconNameNotFoundError(iconName: string): Error {\n        return Error(`Unable to find icon with the name \"${iconName}\"`);\n    }\n\n    private getIconFailedToSanitizeLiteralError(literal: SvgHtml): Error {\n        return Error(\n            `The literal provided to ThyIconRegistry was not trusted as safe HTML by ` +\n                `Angular's DomSanitizer. Attempted literal was \"${literal}\".`\n        );\n    }\n\n    private internalAddSvgIconSet(namespace: string, config: SvgIconConfig): this {\n        const configNamespace = this.svgIconSetConfigs.get(namespace);\n\n        if (configNamespace) {\n            configNamespace.push(config);\n        } else {\n            this.svgIconSetConfigs.set(namespace, [config]);\n        }\n\n        return this;\n    }\n\n    private cloneSvg(svg: SVGElement): SVGElement {\n        return svg.cloneNode(true) as SVGElement;\n    }\n\n    private fetchUrl(safeUrl: SafeResourceUrl | null): Observable<string> {\n        if (safeUrl == null) {\n            throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n        }\n\n        const url = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl)!;\n\n        if ((typeof ngDevMode === 'undefined' || ngDevMode) && !url) {\n            throw new Error(\n                `The URL provided to ThyIconRegistry was not trusted as a resource URL ` +\n                    `via Angular's DomSanitizer. Attempted URL was \"${url}\".`\n            );\n        }\n\n        // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n        // already a request in progress for that URL. It's necessary to call share() on the\n        // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n        const inProgressFetch = this.inProgressUrlFetches.get(url);\n\n        if (inProgressFetch) {\n            return inProgressFetch;\n        } else {\n            // TODO(jelbourn): for some reason, the `finalize` operator \"loses\" the generic type on the\n            // Observable. Figure out why and fix it.\n            const req = this.httpClient.get(url, { responseType: 'text' }).pipe(\n                finalize(() => this.inProgressUrlFetches.delete(url)),\n                share()\n            );\n\n            this.inProgressUrlFetches.set(url, req);\n            return req;\n        }\n    }\n\n    private toSvgElement(element: Element): SVGElement {\n        const svg = this.svgElementFromString('<svg></svg>');\n\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < element.childNodes.length; i++) {\n            if (element.childNodes[i].nodeType === this.document.ELEMENT_NODE) {\n                svg.appendChild(element.childNodes[i].cloneNode(true));\n            }\n        }\n\n        return svg;\n    }\n\n    private extractSvgIconFromIconSet(iconSet: SVGElement, iconName: string): SVGElement | null {\n        // Use the `id=\"iconName\"` syntax in order to escape special\n        // characters in the ID (versus using the #iconName syntax).\n        const iconSource = iconSet.querySelector(`[id=\"${iconName}\"]`);\n\n        if (!iconSource) {\n            return null;\n        }\n\n        // Clone the element and remove the ID to prevent multiple elements from being added\n        // to the page with the same ID.\n        const iconElement = iconSource.cloneNode(true) as Element;\n        iconElement.removeAttribute('id');\n\n        // If the icon node is itself an <svg> node, clone and return it directly. If not, set it as\n        // the content of a new <svg> node.\n        if (iconElement.nodeName.toLowerCase() === 'svg') {\n            return this.setSvgAttributes(iconElement as SVGElement);\n        }\n\n        // If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note\n        // that the same could be achieved by referring to it via <use href=\"#id\">, however the <use>\n        // tag is problematic on Firefox, because it needs to include the current page path.\n        if (iconElement.nodeName.toLowerCase() === 'symbol') {\n            return this.setSvgAttributes(this.toSvgElement(iconElement));\n        }\n\n        // createElement('SVG') doesn't work as expected; the DOM ends up with\n        // the correct nodes, but the SVG content doesn't render. Instead we\n        // have to create an empty SVG node using innerHTML and append its content.\n        // Elements created using DOMParser.parseFromString have the same problem.\n        // http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display\n        const svg = this.svgElementFromString('<svg></svg>');\n        // Clone the node so we don't remove it from the parent icon set element.\n        svg.appendChild(iconElement);\n\n        return this.setSvgAttributes(svg);\n    }\n\n    private extractIconWithNameFromIconSetConfigs(iconName: string, iconSetConfigs: SvgIconConfig[]): SVGElement | null {\n        // Iterate backwards, so icon sets added later have precedence.\n        for (let i = iconSetConfigs.length - 1; i >= 0; i--) {\n            const config = iconSetConfigs[i];\n            if (config.svgElement) {\n                const foundIcon = this.extractSvgIconFromIconSet(config.svgElement, iconName);\n                if (foundIcon) {\n                    return foundIcon;\n                }\n            }\n        }\n        return null;\n    }\n\n    private svgElementFromString(str: string): SVGElement {\n        const div = this.document.createElement('DIV');\n        div.innerHTML = str;\n        const svg = div.querySelector('svg') as SVGElement;\n\n        if (!svg) {\n            throw Error('<svg> tag not found');\n        }\n\n        return svg;\n    }\n\n    private setSvgAttributes(svg: SVGElement): SVGElement {\n        svg.setAttribute('fit', '');\n        svg.setAttribute('height', '1em');\n        svg.setAttribute('width', '1em');\n        svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n        svg.setAttribute('focusable', 'false'); // Disable IE11 default behavior to make SVGs focusable.\n        return svg;\n    }\n\n    private createSvgElementForSingleIcon(responseText: string): SVGElement {\n        const svg = this.svgElementFromString(responseText);\n        this.setSvgAttributes(svg);\n        return svg;\n    }\n\n    private loadSvgIconFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n        return this.fetchUrl(config.url).pipe(map(svgText => this.createSvgElementForSingleIcon(svgText)));\n    }\n\n    private loadSvgIconSetFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n        // If the SVG for this icon set has already been parsed, do nothing.\n        if (config.svgElement) {\n            return of(config.svgElement);\n        }\n\n        return this.fetchUrl(config.url).pipe(\n            map(svgText => {\n                // It is possible that the icon set was parsed and cached by an earlier request, so parsing\n                // only needs to occur if the cache is yet unset.\n                if (!config.svgElement) {\n                    config.svgElement = this.svgElementFromString(svgText);\n                }\n\n                return config.svgElement;\n            })\n        );\n    }\n\n    private getSvgFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n        if (config.svgElement) {\n            // We already have the SVG element for this icon, return a copy.\n            return of(this.cloneSvg(config.svgElement));\n        } else {\n            // Fetch the icon from the config's URL, cache it, and return a copy.\n            return this.loadSvgIconFromConfig(config).pipe(\n                tap(svg => (config.svgElement = svg)),\n                map(svg => this.cloneSvg(svg))\n            );\n        }\n    }\n\n    private getSvgFromIconSetConfigs(name: string, iconSetConfigs: SvgIconConfig[]): Observable<SVGElement> {\n        // For all the icon set SVG elements we've fetched, see if any contain an icon with the\n        // requested name.\n        const namedIcon = this.extractIconWithNameFromIconSetConfigs(name, iconSetConfigs);\n\n        if (namedIcon) {\n            // We could cache namedIcon in svgIconConfigs, but since we have to make a copy every\n            // time anyway, there's probably not much advantage compared to just always extracting\n            // it from the icon set.\n            return of(namedIcon);\n        }\n\n        // Not found in any cached icon sets. If there are icon sets with URLs that we haven't\n        // fetched, fetch them now and look for iconName in the results.\n        const iconSetFetchRequests: Observable<SVGElement | null>[] = iconSetConfigs\n            .filter(iconSetConfig => !iconSetConfig.svgElement)\n            .map(iconSetConfig => {\n                return this.loadSvgIconSetFromConfig(iconSetConfig).pipe(\n                    catchError((err: HttpErrorResponse): Observable<SVGElement | null> => {\n                        const url = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconSetConfig.url);\n\n                        // Swallow errors fetching individual URLs so the\n                        // combined Observable won't necessarily fail.\n                        console.error(`Loading icon set URL: ${url} failed: ${err.message}`);\n                        return of(null);\n                    })\n                );\n            });\n\n        // Fetch all the icon set URLs. When the requests complete, every IconSet should have a\n        // cached SVG element (unless the request failed), and we can check again for the icon.\n        return forkJoin(iconSetFetchRequests).pipe(\n            map(() => {\n                const foundIcon = this.extractIconWithNameFromIconSetConfigs(name, iconSetConfigs);\n\n                if (!foundIcon) {\n                    throw this.getIconNameNotFoundError(name);\n                }\n\n                return foundIcon;\n            })\n        );\n    }\n\n    private internalAddSvgIconConfig(namespace: string, iconName: string, config: SvgIconConfig): this {\n        this.svgIconConfigs.set(this.buildIconKey(namespace, iconName), config);\n        return this;\n    }\n\n    public buildIconKey(namespace: string, name: string) {\n        return `${namespace}:${name}`;\n    }\n\n    public splitIconName(iconName: string): [string, string] {\n        if (!iconName) {\n            return ['', ''];\n        }\n        const parts = iconName.split(':');\n        switch (parts.length) {\n            case 1:\n                return ['', parts[0]]; // Use default namespace.\n            case 2:\n                return parts as [string, string];\n            default:\n                throw Error(`Invalid icon name: \"${iconName}\"`);\n        }\n    }\n\n    public addSvgIconSetInNamespace(namespace: string, url: SvgResourceUrl): this {\n        url = isString(url) ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : url;\n        return this.internalAddSvgIconSet(namespace, new SvgIconConfig(url));\n    }\n\n    /**\n     * 添加SVG图标集，添加到默认命名空间\n     */\n    public addSvgIconSet(url: SvgResourceUrl): this {\n        return this.addSvgIconSetInNamespace('', url);\n    }\n\n    public addSvgIconSetLiteralInNamespace(namespace: string, literal: SafeHtml): this {\n        const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n\n        if (!sanitizedLiteral) {\n            throw this.getIconFailedToSanitizeLiteralError(literal);\n        }\n\n        const svgElement = this.svgElementFromString(sanitizedLiteral);\n        return this.internalAddSvgIconSet(namespace, new SvgIconConfig(svgElement));\n    }\n\n    public addSvgIconSetLiteral(literal: SafeHtml): this {\n        return this.addSvgIconSetLiteralInNamespace('', literal);\n    }\n\n    /**\n     * @description.en-us Registers an icon by URL in the specified namespace.\n     * @description 添加单个SVG图标到指定的命名空间\n     * @param namespace Namespace in which the icon should be registered.\n     * @param iconName Name under which the icon should be registered.\n     * @param url\n     */\n    public addSvgIconInNamespace(namespace: string, iconName: string, url: SvgResourceUrl): this {\n        url = isString(url) ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : url;\n        return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(url));\n    }\n\n    /**\n     * @description.en-us Registers an icon by URL in the default namespace.\n     * @description 添加单个SVG图标\n     * @param iconName Name under which the icon should be registered.\n     * @param url\n     */\n    public addSvgIcon(iconName: string, url: SvgResourceUrl): this {\n        return this.addSvgIconInNamespace('', iconName, url);\n    }\n\n    /**\n     * @description.en-us Registers an icon using an HTML string in the default namespace.\n     * @description 添加单个SVG图标字符串，直接传入 SVG HTML 字符串\n     * @param iconName Name under which the icon should be registered.\n     * @param literal SVG source of the icon.\n     */\n    public addSvgIconLiteral(iconName: string, literal: SvgHtml): this {\n        return this.addSvgIconLiteralInNamespace('', iconName, literal);\n    }\n\n    /**\n     * @description.en-us Registers an icon using an HTML string in the specified namespace.\n     * @description 添加单个SVG图标字符串到指定的命名空间，直接传入 SVG HTML 字符串\n     * @param namespace Namespace in which the icon should be registered.\n     * @param iconName Name under which the icon should be registered.\n     * @param literal SVG source of the icon.\n     */\n    public addSvgIconLiteralInNamespace(namespace: string, iconName: string, literal: SvgHtml): this {\n        literal = isString(literal) ? this.sanitizer.bypassSecurityTrustHtml(literal) : literal;\n        const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n\n        if (!sanitizedLiteral) {\n            throw this.getIconFailedToSanitizeLiteralError(literal);\n        }\n\n        const svgElement = this.createSvgElementForSingleIcon(sanitizedLiteral);\n        return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));\n    }\n\n    public getDefaultFontSetClass() {\n        return this.defaultFontSetClass;\n    }\n\n    public getFontSetClassByAlias(fontSet: string) {\n        return fontSet;\n    }\n\n    /**\n     * 获取某个图标\n     */\n    public getSvgIcon(name: string, namespace: string = ''): Observable<SVGElement> {\n        // Return (copy of) cached icon if possible.\n        const key = this.buildIconKey(namespace, name);\n        const config = this.svgIconConfigs.get(key);\n\n        if (config) {\n            return this.getSvgFromConfig(config);\n        }\n\n        // See if we have any icon sets registered for the namespace.\n        const iconSetConfigs = this.svgIconSetConfigs.get(namespace);\n\n        if (iconSetConfigs) {\n            return this.getSvgFromIconSetConfigs(name, iconSetConfigs);\n        }\n\n        return throwError(this.getIconNameNotFoundError(key));\n    }\n\n    public setIconMode(mode: IconMode) {\n        this.internalIconMode = mode;\n    }\n}\n","import { useHostRenderer } from '@tethys/cdk/dom';\nimport { take } from 'rxjs/operators';\n\nimport {\n    Component,\n    ElementRef,\n    Renderer2,\n    SecurityContext,\n    ViewEncapsulation,\n    computed,\n    effect,\n    inject,\n    input,\n    numberAttribute\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { coerceBooleanProperty, isImagePathSource } from 'ngx-tethys/util';\nimport { getWhetherPrintErrorWhenIconNotFound } from './config';\nimport { ThyIconRegistry } from './icon-registry';\n\nconst iconSuffixMap = {\n    fill: 'fill',\n    twotone: 'tt'\n};\n\nconst SVG_NAME_SPACE = 'http://www.w3.org/2000/svg';\n\nconst XLINK_NAME_SPACE = 'http://www.w3.org/1999/xlink';\n\nconst SVG_EL_ATTRS: Record<string, string> = {\n    viewBox: '0 0 24 24',\n    fit: '',\n    width: '1em',\n    height: '1em',\n    preserveAspectRatio: 'xMidYMid meet',\n    focusable: 'false'\n};\n\nconst IMAGE_EL_ATTRS: Record<string, string> = {\n    x: '0',\n    y: '0',\n    width: '100%',\n    height: '100%',\n    preserveAspectRatio: 'xMidYMid meet'\n};\n\nfunction setElementAttributes(render: Renderer2, element: Element, attributes: Record<string, string>): void {\n    for (const [name, value] of Object.entries(attributes)) {\n        render.setAttribute(element, name, value);\n    }\n}\n\n/**\n * 图标组件\n * @name thy-icon,[thy-icon]\n * @order 10\n */\n@Component({\n    selector: 'thy-icon, [thy-icon]',\n    template: '<ng-content></ng-content>',\n    encapsulation: ViewEncapsulation.None,\n    host: {\n        class: 'thy-icon',\n        '[class.thy-icon-legging]': 'legging()'\n    }\n})\nexport class ThyIcon {\n    private render = inject(Renderer2);\n    private elementRef = inject(ElementRef);\n    private iconRegistry = inject(ThyIconRegistry);\n    private sanitizer = inject(DomSanitizer);\n\n    /**\n     * 图标的外观\n     * @type outline | fill | twotone\n     * @default outline\n     */\n    readonly thyAppearance = input<'outline' | 'fill' | 'twotone'>();\n\n    /**\n     * 图标的类型（已废弃，将在 v23 彻底删除），请使用 thyAppearance\n     * @deprecated please use thyAppearance, will be removed in v23\n     * @type outline | fill | twotone\n     */\n    readonly thyIconType = input<'outline' | 'fill' | 'twotone'>();\n\n    readonly thyTwotoneColor = input<string>();\n\n    /**\n     * 图标的名字\n     * @description 与已废弃的 `thyIconName` 二选一，至少提供一个，否则不会渲染图标\n     */\n    readonly thyName = input<string>();\n\n    /**\n     * 图标的名字（已废弃，将在 v23 彻底删除），请使用 thyName\n     * @deprecated please use thyName, will be removed in v23\n     */\n    readonly thyIconName = input<string>();\n\n    /**\n     * 图标的旋转角度\n     * @default 0\n     */\n    readonly thyRotate = input<number, unknown>(undefined, { transform: numberAttribute });\n\n    /**\n     * 图标的旋转角度（已废弃，将在 v23 彻底删除），请使用 thyRotate\n     * @deprecated please use thyRotate, will be removed in v23\n     * @default 0\n     */\n    readonly thyIconRotate = input<number, unknown>(undefined, { transform: numberAttribute });\n\n    readonly thySet = input<string>();\n\n    /**\n     * 图标集（已废弃，将在 v23 彻底删除），请使用 thySet\n     * @deprecated please use thySet, will be removed in v23\n     */\n    readonly thyIconSet = input<string>();\n\n    /**\n     * 图标打底色，镂空的图标，会透过颜色来\n     */\n    readonly thyLegging = input<boolean | undefined, unknown>(undefined, {\n        transform: (value: unknown) => (value === undefined ? undefined : coerceBooleanProperty(value))\n    });\n\n    /**\n     * 图标打底色（已废弃，将在 v23 彻底删除），镂空的图标，会透过颜色来，请使用 thyLegging\n     * @deprecated please use thyLegging, will be removed in v23\n     */\n    readonly thyIconLegging = input(false, { transform: coerceBooleanProperty });\n\n    readonly thyLinearGradient = input<boolean | undefined, unknown>(undefined, {\n        transform: (value: unknown) => (value === undefined ? undefined : coerceBooleanProperty(value))\n    });\n\n    /**\n     * 是否支持 Safari SVG LinearGradient（已废弃，将在 v23 彻底删除），请使用 thyLinearGradient\n     * @deprecated please use thyLinearGradient, will be removed in v23\n     */\n    readonly thyIconLinearGradient = input(false, { transform: coerceBooleanProperty });\n\n    readonly appearance = computed(() => this.thyAppearance() || this.thyIconType() || 'outline');\n\n    readonly name = computed(() => this.thyName() ?? this.thyIconName());\n\n    readonly rotate = computed(() => this.thyRotate() ?? this.thyIconRotate());\n\n    readonly set = computed(() => this.thySet() ?? this.thyIconSet());\n\n    readonly legging = computed(() => this.thyLegging() ?? this.thyIconLegging());\n\n    readonly linearGradient = computed(() => this.thyLinearGradient() ?? this.thyIconLinearGradient());\n\n    private hostRenderer = useHostRenderer();\n\n    constructor() {\n        effect(() => {\n            this.updateClasses();\n        });\n        effect(() => {\n            this.setStyleRotate();\n        });\n    }\n\n    private updateClasses() {\n        const rawName = this.name();\n        if (!rawName) {\n            return;\n        }\n        if (isImagePathSource(rawName)) {\n            this.setImageElement(rawName.trim());\n            return;\n        }\n\n        const [namespace, iconName] = this.iconRegistry.splitIconName(rawName);\n        if (iconName) {\n            if (this.iconRegistry.iconMode === 'svg') {\n                this.iconRegistry\n                    .getSvgIcon(this.buildIconNameByType(iconName), namespace)\n                    .pipe(take(1))\n                    .subscribe(\n                        svg => {\n                            this.setSvgElement(svg);\n                        },\n                        (error: Error) => {\n                            if (getWhetherPrintErrorWhenIconNotFound()) {\n                                console.error(`Error retrieving icon: ${error.message}`);\n                            }\n                        }\n                    );\n                this.hostRenderer.updateClass([`thy-icon${namespace ? `-${namespace}` : ``}-${this.buildIconNameByType(iconName)}`]);\n            } else {\n                const fontSetClass = this.set()\n                    ? this.iconRegistry.getFontSetClassByAlias(this.set()!)\n                    : this.iconRegistry.getDefaultFontSetClass();\n                this.hostRenderer.updateClass([fontSetClass, `${fontSetClass}-${this.name()}`]);\n            }\n        }\n    }\n\n    private setStyleRotate() {\n        if (this.rotate() !== undefined) {\n            // 基于 effect 无法保证在 setSvgElement 之前执行，所以这里增加判断\n            const svg = this.elementRef.nativeElement.querySelector('svg');\n            if (!svg) {\n                return;\n            }\n            this.render.setStyle(svg, 'transform', `rotate(${this.rotate()}deg)`);\n        }\n    }\n\n    private setImageElement(src: string) {\n        this.clearSvgElement();\n\n        const trusted = this.sanitizer.bypassSecurityTrustResourceUrl(src);\n        const safeUrl = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, trusted);\n        if (!safeUrl) {\n            return;\n        }\n\n        const doc = this.elementRef.nativeElement.ownerDocument;\n        const svg = doc.createElementNS(SVG_NAME_SPACE, 'svg');\n        setElementAttributes(this.render, svg, SVG_EL_ATTRS);\n\n        const imageEl = doc.createElementNS(SVG_NAME_SPACE, 'image');\n        setElementAttributes(this.render, imageEl, { ...IMAGE_EL_ATTRS, href: safeUrl });\n        imageEl.setAttributeNS(XLINK_NAME_SPACE, 'xlink:href', safeUrl);\n\n        this.render.appendChild(svg, imageEl);\n        this.render.appendChild(this.elementRef.nativeElement, svg);\n        this.setStyleRotate();\n    }\n\n    //#region svg element\n\n    private setSvgElement(svg: SVGElement) {\n        this.clearSvgElement();\n\n        // Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.\n        // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/\n        // Do this before inserting the element into the DOM, in order to avoid a style recalculation.\n        const styleTags = svg.querySelectorAll('style') as NodeListOf<HTMLStyleElement>;\n\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < styleTags.length; i++) {\n            styleTags[i].textContent += ' ';\n        }\n\n        if (this.appearance() === 'twotone') {\n            const allPaths = svg.querySelectorAll('path');\n            if (allPaths.length > 1) {\n                allPaths.forEach((child, index: number) => {\n                    if (child.getAttribute('id')!.includes('secondary-color')) {\n                        child.setAttribute('fill', this.thyTwotoneColor()!);\n                    }\n                });\n            }\n        }\n\n        // Note: we do this fix here, rather than the icon registry, because the\n        // references have to point to the URL at the time that the icon was created.\n        // if (this._location) {\n        //     const path = this._location.getPathname();\n        //     this._previousPath = path;\n        //     this._cacheChildrenWithExternalReferences(svg);\n        //     this._prependPathToReferences(path);\n        // }\n        if (this.linearGradient()) {\n            this.setBaseUrl(svg);\n            this.clearTitleElement(svg);\n        }\n\n        this.elementRef.nativeElement.appendChild(svg);\n        this.setStyleRotate();\n    }\n\n    private clearSvgElement() {\n        const layoutElement: HTMLElement = this.elementRef.nativeElement;\n        let childCount = layoutElement.childNodes.length;\n\n        // if (this._elementsWithExternalReferences) {\n        //     this._elementsWithExternalReferences.clear();\n        // }\n\n        // Remove existing non-element child nodes and SVGs, and add the new SVG element. Note that\n        // we can't use innerHTML, because IE will throw if the element has a data binding.\n        while (childCount--) {\n            const child = layoutElement.childNodes[childCount];\n\n            // of any loose text nodes, as well as any SVG elements in order to remove any old icons.\n            if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') {\n                layoutElement.removeChild(child);\n            }\n        }\n    }\n\n    //#endregion\n\n    private buildIconNameByType(iconName: string) {\n        const appearance = this.appearance();\n        if (['fill', 'twotone'].indexOf(appearance) >= 0) {\n            const suffix = iconSuffixMap[appearance as keyof typeof iconSuffixMap];\n            return iconName.includes(`-${suffix}`) ? iconName : `${iconName}-${suffix}`;\n        } else {\n            return iconName;\n        }\n    }\n\n    /**\n     * Support Safari SVG LinearGradient.\n     * @param svg\n     */\n    private setBaseUrl(svg: SVGElement) {\n        const styleElements = svg.querySelectorAll('style');\n        styleElements.forEach((n: HTMLElement) => {\n            if (n.style.cssText.includes('url')) {\n                n.style.fill = n.style.fill.replace('url(\"', `url(\"${location.pathname}`);\n            }\n            if (n.style.cssText.includes('clip-path')) {\n                n.style.clipPath = n.style.clipPath.replace('url(\"', `url(\"${location.pathname}`);\n            }\n        });\n    }\n\n    private clearTitleElement(svg: SVGElement) {\n        const titleElement = svg.querySelector('title');\n        titleElement && titleElement.remove();\n    }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { ThyIcon } from './icon.component';\n\n@NgModule({\n    declarations: [],\n    exports: [ThyIcon],\n    imports: [ThyIcon, CommonModule, FormsModule],\n    providers: []\n})\nexport class ThyIconModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAI,sBAAsB,GAAG,IAAI;AAE3B,SAAU,6BAA6B,CAAC,KAAc,EAAA;IACxD,sBAAsB,GAAG,KAAK;AAClC;SAEgB,oCAAoC,GAAA;AAChD,IAAA,OAAO,sBAAsB;AACjC;;ACAA,MAAM,aAAa,CAAA;AAIf,IAAA,WAAA,CAAY,IA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