{"version":3,"sources":["components/ads-expansion-panel/ads-expansion-panel.tsx","components/ads-expansion-panel/ads-expansion-panel.scss?tag=ads-expansion-panel&encapsulation=shadow","components/core/global/pipeline.ts","components/core/utils/pipeline.ts","components/core/utils/components.ts","utils/imageHelper.tsx","utils/breakpointHelper.ts","utils/resizeHelper.ts","../node_modules/@fortawesome/pro-regular-svg-icons/faChevronDown.js"],"names":["AdsExpansionPanel","setInternalExpanded","newValue","internalExpanded","updateContentPanel","onClickHandler","evt","expansionChange","emit","expanded","expansionChangeHandler","undefined","onKeyDownHandler","code","preventDefault","this","el","setAttribute","identifier","component","newExpanded","shadowRoot","querySelector","classList","add","remove","isDefaultExpanded","Pipeline.addComponent","Pipeline.removeComponent","toggleAttributes","role","toString","tabIndex","contentAttributes","$icon","data","iconDownPathData","height","iconDownHeight","width","iconDownWidth","class","onClick","onKeyDown","name","id","window","pipeline","set","tagName","toLowerCase","config","getBoolean","trackEvent","COMPONENT_REGISTER","componentId","environment","version","host","location","err","console","log","sendCustomEvent","addComponent","Pipeline.add","removeComponent","delete","Pipeline.remove","generateId","namespace","generateRandomString","Math","random","substr","getClassFromSize","size","MEDIUM","SMALL","getClassFromLevel","level","PRIMARY","SECONDARY","TERTIARY","getMediaQueryBreakpointClassUp","bp","getMediaQueryBreakpointClassDown","showErrorMessage","message","ADS_CONSOLE_ERROR","warn","generateSVGImage","icon","className","xmlns","viewBox","d","MediaTypes","getBreakpointInPixels","breakpoint","parseInt","breakpoints","mediaQueryLists","addMatchMedia","mediaType","listenerFunction","foundMatchMedia","find","m","media","newMatchMedia","matchMedia","push","addEventListener","removeMatchMedia","removeEventListener","callbacks","onresize","map","cb","timeout","callback","setTimeout","duration","subscribeToWindowResize","timeoutDuration","unSubscribeToWindowResize","index","findIndex","clearTimeout","splice","Object","defineProperty","exports","value","aliases","svgPathData","prefix","iconName","definition"],"mappings":"wPAsBaA,G,cAAiB,WAM5B,6C,+EA8EQ,KAAAC,oBAAsB,SAACC,GAC7B,EAAK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AAvD,MACtBG,EAAgBU,KAAKF,GACrBA,EAAcG,iBAAiB,SAAUR,QAJzCC,EAAgBO,iBAAiB,SAAUR,IAclCS,EAAmB,SAC9BV,EACAL,EACAM,G,MAE4F,QAA5F,EAAAH,EAAgBK,MAAK,SAACC,GAAD,OAAOA,EAAEC,QAAF,WAAgBL,EAAhB,aAA8BrD,EAAOkD,YAAYF,GAAjD,eAAgE,SAAEgB,oBAAoB,SAAUV,IC7DxHW,EAA8B,GAEpCtE,OAAOuE,SAAW,WAChBD,EAAUE,KAAI,SAACC,GACT,YAAkBA,EAAGC,WACvBD,EAAGE,WACHF,EAAGC,QAAUE,YAAW,WACtBH,EAAGC,QAAU,OACZD,EAAGI,e,IAUCC,EAA0B,SAACH,GAA8D,IAAxCI,EAAwC,uDApB/E,GAqBrBT,EAAUJ,KAAK,CAAES,WAAUE,SAAUE,KAO1BC,EAA4B,SAACL,GACxC,IAAMM,EAAQX,EAAUY,WAAU,SAACT,GAAD,OAAwBA,EAAGE,WAAaA,KACtEM,GAAS,IACN,YAAkBX,EAAUW,GAAOP,UACtCS,aAAab,EAAUW,GAAOP,SAEhCJ,EAAUc,OAAOH,EAAO,M,6GCzC5BI,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtD,IAIIC,EAAU,GAEVC,EAAc,uJAElBH,EAAA,WAAqB,CACnBI,OATW,MAUXC,SATa,eAUb9C,KAAM,CATI,IACC,IAWT2C,EATU,OAWVC,IAGJH,EAAA,cAAwBA,EAAQM,WAChCN,EAAA,OApBa,MAqBbA,EAAA,SApBe,eAqBfA,EAAA,MApBY,IAqBZA,EAAA,OApBa,IAqBbA,EAAA,UAAoBE,EACpBF,EAAA,QApBc,OAqBdA,EAAA,YAAsBG,EACtBH,EAAA,QAAkBE","file":"static/js/17.300261c3.chunk.js","sourcesContent":["import * as Pipeline from '../core/utils/pipeline';\nimport { BaseComponent } from '../core/interfaces/BaseComponent';\nimport { Component, Element, Event, EventEmitter, Prop, State, VNode, Watch, h } from '@stencil/core';\nimport { ExpansionChangeEvent, ExpansionChangeHandler } from './ads-expansion-panel.types';\nimport { Theme } from '../core/types/globalTypes';\nimport { generateId } from '../core/utils/components';\nimport { generateSVGImage, isNullOrUndefined } from 'utils/index';\nimport { height as iconDownHeight, svgPathData as iconDownPathData, width as iconDownWidth } from '@fortawesome/pro-regular-svg-icons/faChevronDown';\n\n/**\n * The Expansion Panel component enables large amounts of content to be displayed in a small space through progressive disclosure.\n * The header title describes the category of the content enabling the user to decide which sections are relevant for them.\n * @tag `<ads-expansion-panel>`\n * @slot toggle - Content rendered as rich text inside the component toggle\n * @slot content - Content rendered as rich text inside the component panel\n * @example <ads-expansion-panel>Hello world</ads-expansion-panel>\n */\n@Component({\n tag: 'ads-expansion-panel',\n styleUrl: 'ads-expansion-panel.scss',\n shadow: true,\n})\nexport class AdsExpansionPanel implements BaseComponent {\n /**\n * @hidden\n */\n public component: string;\n\n constructor() {\n this.el.setAttribute('id', this.identifier || generateId('ads-expansion-panel'));\n this.component = 'ads-expansion-panel';\n }\n\n /**\n * The component element\n * @hidden\n */\n @Element() el: HTMLAdsExpansionPanelElement;\n\n /**\n * @hidden\n */\n @State() internalExpanded: boolean;\n\n /**\n * The unique identifier (optional)\n */\n @Prop({ attribute: 'id' }) identifier?: string;\n\n /**\n * The theme for this component instance (optional)\n * Values: \"default\", \"dark\"\n */\n @Prop({ reflect: true }) theme?: Theme;\n\n /**\n * Whether or not the panel is expanded (optional)\n */\n @Prop({ reflect: true, attribute: 'expanded' }) expanded?: boolean;\n\n /**\n * Whether or not the panel is expanded on first render (optional)\n * @default false\n */\n @Prop({ reflect: true }) isDefaultExpanded = false;\n\n /**\n * Callback function triggered on expansion change (optional)\n */\n @Prop() expansionChangeHandler?: ExpansionChangeHandler;\n\n /**\n * Emits the 'expansionChange' custom event.<br/>\n * Usage: `document.querySelector('ads-select').addEventListener('expansionChange', function(evt) {});`\n * @event\n */\n @Event({ bubbles: false }) expansionChange: EventEmitter<ExpansionChangeEvent>;\n\n /**\n * Handle identifier property changes\n * @param {string} newValue The new value for \"identifier\"\n * @hidden\n */\n @Watch('identifier')\n handleIdentifierChange(newValue: string): void {\n this.el.setAttribute('id', newValue || generateId('ads-expansion-panel'));\n }\n\n /**\n * Watch for expanded prop change\n * @param {boolean} newExpanded The new value for 'expanded'\n * @private\n * @hidden\n */\n @Watch('expanded')\n onValueChange(newExpanded: boolean): void {\n if (newExpanded !== undefined && newExpanded !== null) {\n this.setInternalExpanded(this.expanded);\n }\n }\n\n /**\n * Sets the internal state to the given value\n * @param {boolean} newValue The new selected option value\n * @returns {void}\n */\n private setInternalExpanded = (newValue: boolean): void => {\n this.internalExpanded = newValue;\n this.updateContentPanel();\n };\n\n /**\n * Update the classes on the content panel\n * @returns {void}\n */\n private updateContentPanel(): void {\n if (this.internalExpanded) {\n this.el.shadowRoot.querySelector('.c-expansion-panel').classList.add('is-expanded');\n } else {\n this.el.shadowRoot.querySelector('.c-expansion-panel').classList.remove('is-expanded');\n }\n }\n\n /**\n * Handle click events\n * @param {Event} evt The original event\n * @returns {void}\n */\n private onClickHandler = (evt: Event): void => {\n this.expansionChange.emit({ evt, expanded: this.internalExpanded });\n if (!isNullOrUndefined(this.expansionChangeHandler)) {\n this.expansionChangeHandler({ evt, expanded: this.internalExpanded });\n }\n if (this.expanded === undefined || this.expanded === null) {\n this.setInternalExpanded(!this.internalExpanded);\n }\n };\n\n /**\n * Handle key down events\n * @param {KeyboardEvent} evt The keyboard event\n * @returns {void}\n */\n private onKeyDownHandler = (evt: KeyboardEvent): void => {\n if (evt.code !== 'Tab') {\n evt.preventDefault();\n }\n if (evt.code !== 'Enter' && evt.code !== 'Space') {\n return;\n }\n this.expansionChange.emit({ evt, expanded: this.internalExpanded });\n if (!isNullOrUndefined(this.expansionChangeHandler)) {\n this.expansionChangeHandler({ evt, expanded: this.internalExpanded });\n }\n if (this.expanded === undefined || this.expanded === null) {\n this.setInternalExpanded(!this.internalExpanded);\n }\n };\n\n protected componentWillLoad(): void {\n this.internalExpanded =\n this.expanded !== undefined && this.expanded !== null\n ? this.expanded\n : this.isDefaultExpanded !== undefined && this.isDefaultExpanded !== null\n ? this.isDefaultExpanded\n : false;\n }\n\n protected componentDidLoad(): void {\n Pipeline.addComponent(this.el);\n this.updateContentPanel();\n }\n\n protected disconnectedCallback(): void {\n Pipeline.removeComponent(this.el);\n }\n\n protected render(): VNode {\n const toggleAttributes = {\n role: 'button',\n 'aria-controls': `ads:expansion-panel:${this.identifier}:content`,\n 'aria-expanded': this.internalExpanded.toString(),\n tabIndex: 0,\n };\n\n const contentAttributes = {\n 'aria-hidden': (!this.internalExpanded).toString(),\n };\n\n const $icon = { data: iconDownPathData, height: iconDownHeight, width: iconDownWidth };\n\n return (\n <div class=\"c-expansion-panel\">\n <div class=\"c-expansion-panel__toggle\" {...toggleAttributes} onClick={this.onClickHandler} onKeyDown={this.onKeyDownHandler}>\n <slot name=\"toggle\" />\n <span class=\"c-expansion-panel__toggle__icon\" role=\"presentation\">\n {generateSVGImage($icon)}\n </span>\n </div>\n {this.internalExpanded && <hr class=\"c-expansion-panel__hr\"></hr>}\n <div class=\"c-expansion-panel__content\" id={`ads:expansion-panel:${this.identifier}:content`} {...contentAttributes}>\n <slot name=\"content\" />\n </div>\n </div>\n ) as VNode;\n }\n}\n","@import 'core';\n\n/**\n * @prop --ads-expansion-panel-border-color: Toggle border color\n * @prop --ads-expansion-panel-content-background-color: Content background color\n * @prop --ads-expansion-panel-content-color: Content text color\n * @prop --ads-expansion-panel-content-padding: Content padding\n *\n * @prop --ads-expansion-panel-hr-color: Horizontal Rule Color\n *\n * @prop --ads-expansion-panel-toggle-background-color-hover: Hovered toggle background color\n * @prop --ads-expansion-panel-toggle-background-color: Toggle Background color\n * @prop --ads-expansion-panel-toggle-color-hover: Hovered toggle text color\n * @prop --ads-expansion-panel-toggle-color: Toggle text color\n * @prop --ads-expansion-panel-toggle-icon-color-hover: Hovered Toggle icon color\n * @prop --ads-expansion-panel-toggle-icon-color: Toggle icon color\n * @prop --ads-expansion-panel-toggle-padding: Toggle padding\n */\n\n:host {\n display: block;\n}\n\n::slotted(*) {\n display: contents !important;\n}\n\n:host([theme='default']) {\n @include ads-vars-component-expansion-panel-default;\n}\n\n:host([theme='dark']) {\n @include ads-vars-component-expansion-panel-dark;\n}\n\n:host([dir='ltr']) {\n @include ads-vars-component-expansion-panel-ltr;\n}\n\n:host([dir='rtl']) {\n @include ads-vars-component-expansion-panel-rtl;\n}\n\n.c-expansion-panel {\n @include ads-expansion-panel;\n}\n","import { EventTypes, environment, version } from './AppInsights/constants';\nimport { WindowGlobal } from '../types/globalTypes';\n\n/**\n * Send custom event to AppInsights\n * @param {string} component The reference to the component\n * @returns {void}\n * @hidden\n */\nconst sendCustomEvent = (component: HTMLElement): void => {\n try {\n (window as WindowGlobal)['AppInsights'].trackEvent(\n {\n name: EventTypes.COMPONENT_REGISTER,\n },\n {\n component: component.tagName.toLowerCase(),\n componentId: component.id,\n environment,\n version,\n host: window.location.host,\n }\n );\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('[APP INSIGHTS] Could not send event', err);\n }\n};\n\n/**\n * Add the component to the pipeline and send component events to AppInsights\n * @param {HTMLElement} component The component element\n * @returns {void}\n * @hidden\n */\nexport function add(component: HTMLElement): void {\n (window as WindowGlobal)['ArmDesignSystem'].pipeline.set(component.id, component.tagName.toLowerCase());\n\n // Disable sending events to AppInsights during unit tests\n if (!(window as WindowGlobal)['ArmDesignSystem'].config.getBoolean('_isTesting')) {\n sendCustomEvent(component);\n }\n}\n\n/**\n * Remove the component from the pipeline\n * @param {HTMLElement} component The component element\n * @returns {void}\n * @hidden\n */\nexport function remove(component: HTMLElement): void {\n (window as WindowGlobal)['ArmDesignSystem'].pipeline.delete(component.id);\n}\n","import * as Pipeline from '../global/pipeline';\n\n/**\n * Add a component to the ADS pipeline\n * @param {HTMLElement} component The component element\n * @return {void}\n */\nexport const addComponent = (component: HTMLElement): void => {\n Pipeline.add(component);\n};\n\n/**\n * Remove a component from the ADS pipeline\n * @param {HTMLElement} component The component element\n * @return {void}\n */\nexport const removeComponent = (component: HTMLElement): void => {\n Pipeline.remove(component);\n};\n","import { Breakpoint, ButtonLevel, ButtonLevels, ButtonSize, ButtonSizes, WindowGlobal } from '../types/globalTypes';\nimport { EventTypes, environment, version } from '../global/AppInsights/constants';\n\nexport type ShadowRootLegacy = ShadowRoot & { tagName: string };\n\n/**\n * Generates a unique component ID\n * @param {string} namespace The unique id's namespace (e.g. ads)\n * @returns {string} A generated random id (e.g. ads-1234)\n */\nexport const generateId = (namespace = 'ads'): string => {\n return `${namespace}-${generateRandomString()}`;\n};\n\n/**\n * Generates a randon string\n * @returns {string} A generated random string\n */\nexport const generateRandomString = (): string => {\n return Math.random().toString(36).substr(2, 16);\n};\n\n/**\n * Generates a size class based on a button size\n * @param {ButtonSize} size The size of the button (e.g. ButtonSizes.SMALL)\n * @returns {string} The button size class (e.g. 'is-small')\n */\nexport const getClassFromSize = (size: ButtonSize): string => {\n switch (size) {\n case ButtonSizes.MEDIUM:\n return 'is-medium';\n case ButtonSizes.SMALL:\n return 'is-small';\n default:\n return '';\n }\n};\n\n/**\n * Generates a level class based on button a level\n * @param {ButtonLevel} level The level of the button (e.g. ButtonLevels.PRIMARY)\n * @returns {string} The button level class (e.g. 'is-primary')\n */\nexport const getClassFromLevel = (level: ButtonLevel): string => {\n switch (level) {\n case ButtonLevels.PRIMARY:\n return 'is-primary';\n case ButtonLevels.SECONDARY:\n return 'is-secondary';\n case ButtonLevels.TERTIARY:\n return 'is-tertiary';\n default:\n return '';\n }\n};\n\n/**\n * Given a breakpoint it will return the appropriate class for the media-queries (breakpoints-up).\n * @param {Breakpoint} bp The breakpoint.\n * @returns {string} The class.\n */\nexport const getMediaQueryBreakpointClassUp = (bp: Breakpoint): string => `${bp.toString()}-up`;\n\n/**\n * Given a breakpoint it will return the appropriate class for the media-queries (breakpoints-down).\n * @param {Breakpoint} bp The breakpoint.\n * @returns {string} The class.\n */\nexport const getMediaQueryBreakpointClassDown = (bp: Breakpoint): string => `${bp.toString()}-down`;\n\n/**\n * Display an ADS warning with the given message\n * @param {string} message The error message to show\n * @param {string} component The reference to the component\n * @returns {void}\n */\nexport const showErrorMessage = (message: string, component: HTMLElement): void => {\n try {\n (window as WindowGlobal)['AppInsights'].trackEvent(\n {\n name: EventTypes.ADS_CONSOLE_ERROR as string,\n },\n {\n component: component.tagName.toLowerCase(),\n componentId: component.id,\n message: message,\n environment,\n version,\n host: window.location.host,\n }\n );\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('[APP INSIGHTS] Could not send console error', err);\n }\n // eslint-disable-next-line no-console\n console.warn(`ADS-Warning: ${message}`);\n};\n","import { SVGIconData } from '../components/core/interfaces/Icon';\nimport { h } from '@stencil/core';\n\n/**\n * Generates an SVG image\n * @param {IconData} icon The SVG image properties\n * @param {string} className The SVG image class name\n * @returns {HTMLElement} The generated SVG image\n */\nexport const generateSVGImage = (icon: SVGIconData, className?: string): HTMLElement => {\n return (\n <svg class={className ? className : null} xmlns=\"http://www.w3.org/2000/svg\" viewBox={`0 0 ${icon.width} ${icon.height}`}>\n <path d={icon.data} />\n </svg>\n ) as HTMLElement;\n};\n","import { Breakpoint } from '../components/core/types/globalTypes';\nimport { isNullOrUndefined } from './collection';\nimport config from './../styles/settings/configs/breakpoints-config.json';\n\n/**\n * Match media types\n */\nexport enum MediaTypes {\n minWidth = 'min-width',\n maxWidth = 'max-width',\n}\n\n/**\n * Returns the list all of breakpoint keys\n * @returns {Breakpoint[]} The list of breakpoints\n */\nexport const getBreakpoints = (): Breakpoint[] => Object.keys(config.breakpoints) as Breakpoint[];\n\n/**\n * Returns the breakpoint in pixels\n * @param {Breakpoint} breakpoint The breakpoint\n * @returns {number} The breakpoint value in pixels\n */\nexport const getBreakpointInPixels = (breakpoint: Breakpoint): number => parseInt(config.breakpoints[breakpoint], 10);\n\n/**\n * Returns the breakpoint key for given pixels\n * @param {number} pixels The pixels of the breakpoint\n * @returns {Breakpoint} The breakpoint key\n */\nexport const getBreakpointFromPixels = (pixels: number): Breakpoint =>\n Object.keys(config.breakpoints)[\n Object.values(config.breakpoints)\n .map((bp) => parseInt(bp, 10))\n .findIndex((bpPixels) => bpPixels === pixels)\n ] as Breakpoint;\n\nconst mediaQueryLists: MediaQueryList[] = [];\n\n/**\n * Adds matchMedia to window with the given properties.\n * @param {MediaTypes} mediaType The type of media\n * @param {Sizes} breakpoint The media size\n * @param {Function} listenerFunction Callback function for the listener\n */\nexport const addMatchMedia = (\n mediaType: MediaTypes,\n breakpoint: Breakpoint,\n listenerFunction: (this: MediaQueryList, ev: MediaQueryListEvent) => unknown\n): void => {\n const foundMatchMedia = mediaQueryLists.find((m) => m.media === `(${mediaType}: ${config.breakpoints[breakpoint]})`);\n if (!isNullOrUndefined(foundMatchMedia)) {\n foundMatchMedia.addEventListener('change', listenerFunction);\n } else {\n const newMatchMedia = window.matchMedia(`(${mediaType}: ${config.breakpoints[breakpoint]})`);\n mediaQueryLists.push(newMatchMedia);\n newMatchMedia.addEventListener('change', listenerFunction);\n }\n};\n\n/**\n * Removes matchMedia from window with the given properties.\n * @param {MediaTypes} mediaType The type of media\n * @param {Sizes} breakpoint The media size\n * @param {Function} listenerFunction Callback function to be removed from the listener\n */\nexport const removeMatchMedia = (\n mediaType: MediaTypes,\n breakpoint: Breakpoint,\n listenerFunction: (this: MediaQueryList, ev: MediaQueryListEvent) => unknown\n): void => {\n mediaQueryLists.find((m) => m.media === `(${mediaType}: ${config.breakpoints[breakpoint]})`)?.removeEventListener('change', listenerFunction);\n};\n\n/**\n * Matches the current window with the given media type and breakpoint\n * @param {MediaTypes} mediaType The media type\n * @param {Breakpoint} breakpoint The breakpoint\n * @returns {boolean} True if it matches, false otherwise\n */\nexport const mediaMatchingBreakpoint = (mediaType: MediaTypes, breakpoint: Breakpoint): boolean => {\n const foundMatchMedia = mediaQueryLists.find((m) => m.media === `(${mediaType}: ${config.breakpoints[breakpoint]})`);\n if (!isNullOrUndefined(foundMatchMedia)) {\n return foundMatchMedia.matches;\n }\n const newMatchMedia = window.matchMedia(`(${mediaType}: ${config.breakpoints[breakpoint]})`);\n mediaQueryLists.push(newMatchMedia);\n return newMatchMedia.matches;\n};\n","import { isNullOrUndefined } from './collection';\n\ninterface ResizeCallback {\n callback: () => void;\n duration: number;\n timeout?: NodeJS.Timeout;\n}\n\nconst defaultTimeout = 50;\n\nconst callbacks: ResizeCallback[] = [];\n\nwindow.onresize = () => {\n callbacks.map((cb: ResizeCallback) => {\n if (isNullOrUndefined(cb.timeout)) {\n cb.callback();\n cb.timeout = setTimeout(() => {\n cb.timeout = null;\n }, cb.duration);\n }\n });\n};\n\n/**\n * Subscribe to the resize listener\n * @param {function} callback The callback function to run on resize\n * @param {number} timeoutDuration The throttle timeout duration\n */\nexport const subscribeToWindowResize = (callback: () => void, timeoutDuration: number = defaultTimeout): void => {\n callbacks.push({ callback, duration: timeoutDuration });\n};\n\n/**\n * Unsubscribe to the resize listener\n * @param {function} callback The callback function to unsubscribe\n */\nexport const unSubscribeToWindowResize = (callback: () => void): void => {\n const index = callbacks.findIndex((cb: ResizeCallback) => cb.callback === callback);\n if (index >= 0) {\n if (!isNullOrUndefined(callbacks[index].timeout)) {\n clearTimeout(callbacks[index].timeout);\n }\n callbacks.splice(index, 1);\n }\n};\n","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'far';\nvar iconName = 'chevron-down';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f078';\nvar svgPathData = 'M239 401c9.4 9.4 24.6 9.4 33.9 0L465 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-175 175L81 175c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L239 401z';\n\nexports.definition = {\n prefix: prefix,\n iconName: iconName,\n icon: [\n width,\n height,\n aliases,\n unicode,\n svgPathData\n ]};\n\nexports.faChevronDown = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;"],"sourceRoot":""}