@fortawesome/fontawesome-free
Version:
The iconic font, CSS, and SVG framework
1,246 lines (1,215 loc) • 107 kB
JavaScript
/*!
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
*/
(function () {
'use strict';
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
function _inherits(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: !0,
configurable: !0
}
}), Object.defineProperty(t, "prototype", {
writable: !1
}), e && _setPrototypeOf(t, e);
}
function ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function (r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
_defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
return t.__proto__ = e, t;
}, _setPrototypeOf(t, e);
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _wrapRegExp() {
_wrapRegExp = function (e, r) {
return new BabelRegExp(e, void 0, r);
};
var e = RegExp.prototype,
r = new WeakMap();
function BabelRegExp(e, t, p) {
var o = RegExp(e, t);
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);
}
function buildGroups(e, t) {
var p = r.get(t);
return Object.keys(p).reduce(function (r, t) {
var o = p[t];
if ("number" == typeof o) r[t] = e[o];else {
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
r[t] = e[o[i]];
}
return r;
}, Object.create(null));
}
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
var t = e.exec.call(this, r);
if (t) {
t.groups = buildGroups(t, this);
var p = t.indices;
p && (p.groups = buildGroups(p, this));
}
return t;
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
if ("string" == typeof p) {
var o = r.get(this);
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) {
var t = o[r];
return "$" + (Array.isArray(t) ? t.join("$") : t);
}));
}
if ("function" == typeof p) {
var i = this;
return e[Symbol.replace].call(this, t, function () {
var e = arguments;
return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
});
}
return e[Symbol.replace].call(this, t, p);
}, _wrapRegExp.apply(this, arguments);
}
const noop = () => {};
let _WINDOW = {};
let _DOCUMENT = {};
let _MUTATION_OBSERVER = null;
let _PERFORMANCE = {
mark: noop,
measure: noop
};
try {
if (typeof window !== 'undefined') _WINDOW = window;
if (typeof document !== 'undefined') _DOCUMENT = document;
if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
if (typeof performance !== 'undefined') _PERFORMANCE = performance;
} catch (e) {}
const {
userAgent = ''
} = _WINDOW.navigator || {};
const WINDOW = _WINDOW;
const DOCUMENT = _DOCUMENT;
const MUTATION_OBSERVER = _MUTATION_OBSERVER;
const PERFORMANCE = _PERFORMANCE;
const IS_BROWSER = !!WINDOW.document;
const IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
const IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
var p = /fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,
g = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;
var S = {
classic: {
fa: "solid",
fas: "solid",
"fa-solid": "solid",
far: "regular",
"fa-regular": "regular",
fal: "light",
"fa-light": "light",
fat: "thin",
"fa-thin": "thin",
fab: "brands",
"fa-brands": "brands"
},
duotone: {
fa: "solid",
fad: "solid",
"fa-solid": "solid",
"fa-duotone": "solid",
fadr: "regular",
"fa-regular": "regular",
fadl: "light",
"fa-light": "light",
fadt: "thin",
"fa-thin": "thin"
},
sharp: {
fa: "solid",
fass: "solid",
"fa-solid": "solid",
fasr: "regular",
"fa-regular": "regular",
fasl: "light",
"fa-light": "light",
fast: "thin",
"fa-thin": "thin"
},
"sharp-duotone": {
fa: "solid",
fasds: "solid",
"fa-solid": "solid",
fasdr: "regular",
"fa-regular": "regular",
fasdl: "light",
"fa-light": "light",
fasdt: "thin",
"fa-thin": "thin"
}
},
A = {
GROUP: "duotone-group",
SWAP_OPACITY: "swap-opacity",
PRIMARY: "primary",
SECONDARY: "secondary"
},
P = ["fa-classic", "fa-duotone", "fa-sharp", "fa-sharp-duotone"];
var s = "classic",
t = "duotone",
r = "sharp",
o = "sharp-duotone",
L = [s, t, r, o];
var G = {
classic: {
900: "fas",
400: "far",
normal: "far",
300: "fal",
100: "fat"
},
duotone: {
900: "fad",
400: "fadr",
300: "fadl",
100: "fadt"
},
sharp: {
900: "fass",
400: "fasr",
300: "fasl",
100: "fast"
},
"sharp-duotone": {
900: "fasds",
400: "fasdr",
300: "fasdl",
100: "fasdt"
}
};
var lt = {
"Font Awesome 6 Free": {
900: "fas",
400: "far"
},
"Font Awesome 6 Pro": {
900: "fas",
400: "far",
normal: "far",
300: "fal",
100: "fat"
},
"Font Awesome 6 Brands": {
400: "fab",
normal: "fab"
},
"Font Awesome 6 Duotone": {
900: "fad",
400: "fadr",
normal: "fadr",
300: "fadl",
100: "fadt"
},
"Font Awesome 6 Sharp": {
900: "fass",
400: "fasr",
normal: "fasr",
300: "fasl",
100: "fast"
},
"Font Awesome 6 Sharp Duotone": {
900: "fasds",
400: "fasdr",
normal: "fasdr",
300: "fasdl",
100: "fasdt"
}
};
var pt = new Map([["classic", {
defaultShortPrefixId: "fas",
defaultStyleId: "solid",
styleIds: ["solid", "regular", "light", "thin", "brands"],
futureStyleIds: [],
defaultFontWeight: 900
}], ["sharp", {
defaultShortPrefixId: "fass",
defaultStyleId: "solid",
styleIds: ["solid", "regular", "light", "thin"],
futureStyleIds: [],
defaultFontWeight: 900
}], ["duotone", {
defaultShortPrefixId: "fad",
defaultStyleId: "solid",
styleIds: ["solid", "regular", "light", "thin"],
futureStyleIds: [],
defaultFontWeight: 900
}], ["sharp-duotone", {
defaultShortPrefixId: "fasds",
defaultStyleId: "solid",
styleIds: ["solid", "regular", "light", "thin"],
futureStyleIds: [],
defaultFontWeight: 900
}]]),
xt = {
classic: {
solid: "fas",
regular: "far",
light: "fal",
thin: "fat",
brands: "fab"
},
duotone: {
solid: "fad",
regular: "fadr",
light: "fadl",
thin: "fadt"
},
sharp: {
solid: "fass",
regular: "fasr",
light: "fasl",
thin: "fast"
},
"sharp-duotone": {
solid: "fasds",
regular: "fasdr",
light: "fasdl",
thin: "fasdt"
}
};
var Ft = ["fak", "fa-kit", "fakd", "fa-kit-duotone"],
St = {
kit: {
fak: "kit",
"fa-kit": "kit"
},
"kit-duotone": {
fakd: "kit-duotone",
"fa-kit-duotone": "kit-duotone"
}
},
At = ["kit"];
var Ct = {
kit: {
"fa-kit": "fak"
},
"kit-duotone": {
"fa-kit-duotone": "fakd"
}
};
var Lt = ["fak", "fakd"],
Wt = {
kit: {
fak: "fa-kit"
},
"kit-duotone": {
fakd: "fa-kit-duotone"
}
};
var Et = {
kit: {
kit: "fak"
},
"kit-duotone": {
"kit-duotone": "fakd"
}
};
var t$1 = {
GROUP: "duotone-group",
SWAP_OPACITY: "swap-opacity",
PRIMARY: "primary",
SECONDARY: "secondary"
},
r$1 = ["fa-classic", "fa-duotone", "fa-sharp", "fa-sharp-duotone"];
var bt$1 = ["fak", "fa-kit", "fakd", "fa-kit-duotone"];
var Yt = {
"Font Awesome Kit": {
400: "fak",
normal: "fak"
},
"Font Awesome Kit Duotone": {
400: "fakd",
normal: "fakd"
}
};
var ua = {
classic: {
"fa-brands": "fab",
"fa-duotone": "fad",
"fa-light": "fal",
"fa-regular": "far",
"fa-solid": "fas",
"fa-thin": "fat"
},
duotone: {
"fa-regular": "fadr",
"fa-light": "fadl",
"fa-thin": "fadt"
},
sharp: {
"fa-solid": "fass",
"fa-regular": "fasr",
"fa-light": "fasl",
"fa-thin": "fast"
},
"sharp-duotone": {
"fa-solid": "fasds",
"fa-regular": "fasdr",
"fa-light": "fasdl",
"fa-thin": "fasdt"
}
},
I$1 = {
classic: ["fas", "far", "fal", "fat", "fad"],
duotone: ["fadr", "fadl", "fadt"],
sharp: ["fass", "fasr", "fasl", "fast"],
"sharp-duotone": ["fasds", "fasdr", "fasdl", "fasdt"]
},
ga = {
classic: {
fab: "fa-brands",
fad: "fa-duotone",
fal: "fa-light",
far: "fa-regular",
fas: "fa-solid",
fat: "fa-thin"
},
duotone: {
fadr: "fa-regular",
fadl: "fa-light",
fadt: "fa-thin"
},
sharp: {
fass: "fa-solid",
fasr: "fa-regular",
fasl: "fa-light",
fast: "fa-thin"
},
"sharp-duotone": {
fasds: "fa-solid",
fasdr: "fa-regular",
fasdl: "fa-light",
fasdt: "fa-thin"
}
},
x = ["fa-solid", "fa-regular", "fa-light", "fa-thin", "fa-duotone", "fa-brands"],
Ia = ["fa", "fas", "far", "fal", "fat", "fad", "fadr", "fadl", "fadt", "fab", "fass", "fasr", "fasl", "fast", "fasds", "fasdr", "fasdl", "fasdt", ...r$1, ...x],
m$1 = ["solid", "regular", "light", "thin", "duotone", "brands"],
c$1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
F$1 = c$1.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
ma = [...Object.keys(I$1), ...m$1, "2xs", "xs", "sm", "lg", "xl", "2xl", "beat", "border", "fade", "beat-fade", "bounce", "flip-both", "flip-horizontal", "flip-vertical", "flip", "fw", "inverse", "layers-counter", "layers-text", "layers", "li", "pull-left", "pull-right", "pulse", "rotate-180", "rotate-270", "rotate-90", "rotate-by", "shake", "spin-pulse", "spin-reverse", "spin", "stack-1x", "stack-2x", "stack", "ul", t$1.GROUP, t$1.SWAP_OPACITY, t$1.PRIMARY, t$1.SECONDARY].concat(c$1.map(a => "".concat(a, "x"))).concat(F$1.map(a => "w-".concat(a)));
var wa = {
"Font Awesome 5 Free": {
900: "fas",
400: "far"
},
"Font Awesome 5 Pro": {
900: "fas",
400: "far",
normal: "far",
300: "fal"
},
"Font Awesome 5 Brands": {
400: "fab",
normal: "fab"
},
"Font Awesome 5 Duotone": {
900: "fad"
}
};
const NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
const UNITS_IN_GRID = 16;
const DEFAULT_CSS_PREFIX = 'fa';
const DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
const DATA_FA_I2SVG = 'data-fa-i2svg';
const DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
const DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
const DATA_PREFIX = 'data-prefix';
const DATA_ICON = 'data-icon';
const HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
const MUTATION_APPROACH_ASYNC = 'async';
const TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
const PRODUCTION = (() => {
try {
return "production" === 'production';
} catch (e$$1) {
return false;
}
})();
function familyProxy(obj) {
// Defaults to the classic family if family is not available
return new Proxy(obj, {
get(target, prop) {
return prop in target ? target[prop] : target[s];
}
});
}
const _PREFIX_TO_STYLE = _objectSpread2({}, S);
// We changed FACSSClassesToStyleId in the icons repo to be canonical and as such, "classic" family does not have any
// duotone styles. But we do still need duotone in _PREFIX_TO_STYLE below, so we are manually adding
// {'fa-duotone': 'duotone'}
_PREFIX_TO_STYLE[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
'fa-duotone': 'duotone'
}), S[s]), St['kit']), St['kit-duotone']);
const PREFIX_TO_STYLE = familyProxy(_PREFIX_TO_STYLE);
const _STYLE_TO_PREFIX = _objectSpread2({}, xt);
// We changed FAStyleIdToShortPrefixId in the icons repo to be canonical and as such, "classic" family does not have any
// duotone styles. But we do still need duotone in _STYLE_TO_PREFIX below, so we are manually adding {duotone: 'fad'}
_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
duotone: 'fad'
}), _STYLE_TO_PREFIX[s]), Et['kit']), Et['kit-duotone']);
const STYLE_TO_PREFIX = familyProxy(_STYLE_TO_PREFIX);
const _PREFIX_TO_LONG_STYLE = _objectSpread2({}, ga);
_PREFIX_TO_LONG_STYLE[s] = _objectSpread2(_objectSpread2({}, _PREFIX_TO_LONG_STYLE[s]), Wt['kit']);
const PREFIX_TO_LONG_STYLE = familyProxy(_PREFIX_TO_LONG_STYLE);
const _LONG_STYLE_TO_PREFIX = _objectSpread2({}, ua);
_LONG_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2({}, _LONG_STYLE_TO_PREFIX[s]), Ct['kit']);
const LONG_STYLE_TO_PREFIX = familyProxy(_LONG_STYLE_TO_PREFIX);
const ICON_SELECTION_SYNTAX_PATTERN = p; // eslint-disable-line no-useless-escape
const LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
const FONT_FAMILY_PATTERN = g;
const _FONT_WEIGHT_TO_PREFIX = _objectSpread2({}, G);
const FONT_WEIGHT_TO_PREFIX = familyProxy(_FONT_WEIGHT_TO_PREFIX);
const ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
const DUOTONE_CLASSES = A;
const RESERVED_CLASSES = [...At, ...ma];
const initial = WINDOW.FontAwesomeConfig || {};
function getAttrConfig(attr) {
var element = DOCUMENT.querySelector('script[' + attr + ']');
if (element) {
return element.getAttribute(attr);
}
}
function coerce(val) {
// Getting an empty string will occur if the attribute is set on the HTML tag but without a value
// We'll assume that this is an indication that it should be toggled to true
if (val === '') return true;
if (val === 'false') return false;
if (val === 'true') return true;
return val;
}
if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
const attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
attrs.forEach(_ref => {
let [attr, key] = _ref;
const val = coerce(getAttrConfig(attr));
if (val !== undefined && val !== null) {
initial[key] = val;
}
});
}
const _default = {
styleDefault: 'solid',
familyDefault: s,
cssPrefix: DEFAULT_CSS_PREFIX,
replacementClass: DEFAULT_REPLACEMENT_CLASS,
autoReplaceSvg: true,
autoAddCss: true,
autoA11y: true,
searchPseudoElements: false,
observeMutations: true,
mutateApproach: 'async',
keepOriginalSource: true,
measurePerformance: false,
showMissingIcons: true
};
// familyPrefix is deprecated but we must still support it if present
if (initial.familyPrefix) {
initial.cssPrefix = initial.familyPrefix;
}
const _config = _objectSpread2(_objectSpread2({}, _default), initial);
if (!_config.autoReplaceSvg) _config.observeMutations = false;
const config = {};
Object.keys(_default).forEach(key => {
Object.defineProperty(config, key, {
enumerable: true,
set: function (val) {
_config[key] = val;
_onChangeCb.forEach(cb => cb(config));
},
get: function () {
return _config[key];
}
});
});
// familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0
Object.defineProperty(config, 'familyPrefix', {
enumerable: true,
set: function (val) {
_config.cssPrefix = val;
_onChangeCb.forEach(cb => cb(config));
},
get: function () {
return _config.cssPrefix;
}
});
WINDOW.FontAwesomeConfig = config;
const _onChangeCb = [];
function onChange(cb) {
_onChangeCb.push(cb);
return () => {
_onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
};
}
const d$2 = UNITS_IN_GRID;
const meaninglessTransform = {
size: 16,
x: 0,
y: 0,
rotate: 0,
flipX: false,
flipY: false
};
function bunker(fn) {
try {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
fn(...args);
} catch (e) {
if (!PRODUCTION) {
throw e;
}
}
}
function insertCss(css) {
if (!css || !IS_DOM) {
return;
}
const style = DOCUMENT.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = css;
const headChildren = DOCUMENT.head.childNodes;
let beforeChild = null;
for (let i = headChildren.length - 1; i > -1; i--) {
const child = headChildren[i];
const tagName = (child.tagName || '').toUpperCase();
if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
beforeChild = child;
}
}
DOCUMENT.head.insertBefore(style, beforeChild);
return css;
}
const idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
function nextUniqueId() {
let size = 12;
let id = '';
while (size-- > 0) {
id += idPool[Math.random() * 62 | 0];
}
return id;
}
function toArray(obj) {
const array = [];
for (let i = (obj || []).length >>> 0; i--;) {
array[i] = obj[i];
}
return array;
}
function classArray(node) {
if (node.classList) {
return toArray(node.classList);
} else {
return (node.getAttribute('class') || '').split(' ').filter(i => i);
}
}
function htmlEscape(str) {
return "".concat(str).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
}
function joinAttributes(attributes) {
return Object.keys(attributes || {}).reduce((acc, attributeName) => {
return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
}, '').trim();
}
function joinStyles(styles) {
return Object.keys(styles || {}).reduce((acc, styleName) => {
return acc + "".concat(styleName, ": ").concat(styles[styleName].trim(), ";");
}, '');
}
function transformIsMeaningful(transform) {
return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
}
function transformForSvg(_ref) {
let {
transform,
containerWidth,
iconWidth
} = _ref;
const outer = {
transform: "translate(".concat(containerWidth / 2, " 256)")
};
const innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
const innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
const innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
const inner = {
transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
};
const path = {
transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
};
return {
outer,
inner,
path
};
}
function transformForCss(_ref2) {
let {
transform,
width = UNITS_IN_GRID,
height = UNITS_IN_GRID,
startCentered = false
} = _ref2;
let val = '';
if (startCentered && IS_IE) {
val += "translate(".concat(transform.x / d$2 - width / 2, "em, ").concat(transform.y / d$2 - height / 2, "em) ");
} else if (startCentered) {
val += "translate(calc(-50% + ".concat(transform.x / d$2, "em), calc(-50% + ").concat(transform.y / d$2, "em)) ");
} else {
val += "translate(".concat(transform.x / d$2, "em, ").concat(transform.y / d$2, "em) ");
}
val += "scale(".concat(transform.size / d$2 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d$2 * (transform.flipY ? -1 : 1), ") ");
val += "rotate(".concat(transform.rotate, "deg) ");
return val;
}
var baseStyles = ":host,:root{--fa-font-solid:normal 900 1em/1 \"Font Awesome 6 Free\";--fa-font-regular:normal 400 1em/1 \"Font Awesome 6 Free\";--fa-font-light:normal 300 1em/1 \"Font Awesome 6 Pro\";--fa-font-thin:normal 100 1em/1 \"Font Awesome 6 Pro\";--fa-font-duotone:normal 900 1em/1 \"Font Awesome 6 Duotone\";--fa-font-duotone-regular:normal 400 1em/1 \"Font Awesome 6 Duotone\";--fa-font-duotone-light:normal 300 1em/1 \"Font Awesome 6 Duotone\";--fa-font-duotone-thin:normal 100 1em/1 \"Font Awesome 6 Duotone\";--fa-font-brands:normal 400 1em/1 \"Font Awesome 6 Brands\";--fa-font-sharp-solid:normal 900 1em/1 \"Font Awesome 6 Sharp\";--fa-font-sharp-regular:normal 400 1em/1 \"Font Awesome 6 Sharp\";--fa-font-sharp-light:normal 300 1em/1 \"Font Awesome 6 Sharp\";--fa-font-sharp-thin:normal 100 1em/1 \"Font Awesome 6 Sharp\";--fa-font-sharp-duotone-solid:normal 900 1em/1 \"Font Awesome 6 Sharp Duotone\";--fa-font-sharp-duotone-regular:normal 400 1em/1 \"Font Awesome 6 Sharp Duotone\";--fa-font-sharp-duotone-light:normal 300 1em/1 \"Font Awesome 6 Sharp Duotone\";--fa-font-sharp-duotone-thin:normal 100 1em/1 \"Font Awesome 6 Sharp Duotone\"}svg:not(:host).svg-inline--fa,svg:not(:root).svg-inline--fa{overflow:visible;box-sizing:content-box}.svg-inline--fa{display:var(--fa-display,inline-block);height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-2xs{vertical-align:.1em}.svg-inline--fa.fa-xs{vertical-align:0}.svg-inline--fa.fa-sm{vertical-align:-.0714285705em}.svg-inline--fa.fa-lg{vertical-align:-.2em}.svg-inline--fa.fa-xl{vertical-align:-.25em}.svg-inline--fa.fa-2xl{vertical-align:-.3125em}.svg-inline--fa.fa-pull-left{margin-right:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-pull-right{margin-left:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-li{width:var(--fa-li-width,2em);top:.25em}.svg-inline--fa.fa-fw{width:var(--fa-fw-width,1.25em)}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{transform-origin:center center}.fa-layers-text{left:50%;top:50%;transform:translate(-50%,-50%);transform-origin:center center}.fa-layers-counter{background-color:var(--fa-counter-background-color,#ff253a);border-radius:var(--fa-counter-border-radius,1em);box-sizing:border-box;color:var(--fa-inverse,#fff);line-height:var(--fa-counter-line-height,1);max-width:var(--fa-counter-max-width,5em);min-width:var(--fa-counter-min-width,1.5em);overflow:hidden;padding:var(--fa-counter-padding,.25em .5em);right:var(--fa-right,0);text-overflow:ellipsis;top:var(--fa-top,0);transform:scale(var(--fa-counter-scale,.25));transform-origin:top right}.fa-layers-bottom-right{bottom:var(--fa-bottom,0);right:var(--fa-right,0);top:auto;transform:scale(var(--fa-layers-scale,.25));transform-origin:bottom right}.fa-layers-bottom-left{bottom:var(--fa-bottom,0);left:var(--fa-left,0);right:auto;top:auto;transform:scale(var(--fa-layers-scale,.25));transform-origin:bottom left}.fa-layers-top-right{top:var(--fa-top,0);right:var(--fa-right,0);transform:scale(var(--fa-layers-scale,.25));transform-origin:top right}.fa-layers-top-left{left:var(--fa-left,0);right:auto;top:var(--fa-top,0);transform:scale(var(--fa-layers-scale,.25));transform-origin:top left}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.0833333337em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.0714285718em;vertical-align:.0535714295em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.0416666682em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(-1 * var(--fa-li-width,2em));position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-color:var(--fa-border-color,#eee);border-radius:var(--fa-border-radius,.1em);border-style:var(--fa-border-style,solid);border-width:var(--fa-border-width,.08em);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{animation-name:fa-beat;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{animation-name:fa-bounce;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{animation-name:fa-fade;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade{animation-name:fa-beat-fade;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{animation-name:fa-flip;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{animation-name:fa-shake;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin{animation-name:fa-spin;animation-delay:var(--fa-animation-delay,0s);animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,2s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{animation-name:fa-spin;animation-direction:var(--fa-animation-direction,normal);animation-duration:var(--fa-animation-duration,1s);animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{animation-delay:-1ms;animation-duration:1ms;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@keyframes fa-beat{0%,90%{transform:scale(1)}45%{transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-bounce{0%{transform:scale(1,1) translateY(0)}10%{transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em))}64%{transform:scale(1,1) translateY(0)}100%{transform:scale(1,1) translateY(0)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-beat-fade{0%,100%{opacity:var(--fa-beat-fade-opacity,.4);transform:scale(1)}50%{opacity:1;transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-flip{50%{transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-shake{0%{transform:rotate(-15deg)}4%{transform:rotate(15deg)}24%,8%{transform:rotate(-18deg)}12%,28%{transform:rotate(18deg)}16%{transform:rotate(-22deg)}20%{transform:rotate(22deg)}32%{transform:rotate(-12deg)}36%{transform:rotate(12deg)}100%,40%{transform:rotate(0)}}@keyframes fa-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.fa-rotate-90{transform:rotate(90deg)}.fa-rotate-180{transform:rotate(180deg)}.fa-rotate-270{transform:rotate(270deg)}.fa-flip-horizontal{transform:scale(-1,1)}.fa-flip-vertical{transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1,-1)}.fa-rotate-by{transform:rotate(var(--fa-rotate-angle,0))}.fa-stack{display:inline-block;vertical-align:middle;height:2em;position:relative;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:var(--fa-stack-z-index,auto)}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-inverse{color:var(--fa-inverse,#fff)}.fa-sr-only,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fa-sr-only-focusable:not(:focus),.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}";
function css() {
const dcp = DEFAULT_CSS_PREFIX;
const drc = DEFAULT_REPLACEMENT_CLASS;
const fp = config.cssPrefix;
const rc = config.replacementClass;
let s = baseStyles;
if (fp !== dcp || rc !== drc) {
const dPatt = new RegExp("\\.".concat(dcp, "\\-"), 'g');
const customPropPatt = new RegExp("\\--".concat(dcp, "\\-"), 'g');
const rPatt = new RegExp("\\.".concat(drc), 'g');
s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
}
return s;
}
let _cssInserted = false;
function ensureCss() {
if (config.autoAddCss && !_cssInserted) {
insertCss(css());
_cssInserted = true;
}
}
var InjectCSS = {
mixout() {
return {
dom: {
css,
insertCss: ensureCss
}
};
},
hooks() {
return {
beforeDOMElementCreation() {
ensureCss();
},
beforeI2svg() {
ensureCss();
}
};
}
};
const w = WINDOW || {};
if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
var namespace = w[NAMESPACE_IDENTIFIER];
const functions = [];
const listener = function () {
DOCUMENT.removeEventListener('DOMContentLoaded', listener);
loaded = 1;
functions.map(fn => fn());
};
let loaded = false;
if (IS_DOM) {
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
}
function domready (fn) {
if (!IS_DOM) return;
loaded ? setTimeout(fn, 0) : functions.push(fn);
}
function toHtml(abstractNodes) {
const {
tag,
attributes = {},
children = []
} = abstractNodes;
if (typeof abstractNodes === 'string') {
return htmlEscape(abstractNodes);
} else {
return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
}
}
function iconFromMapping(mapping, prefix, iconName) {
if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
return {
prefix,
iconName,
icon: mapping[prefix][iconName]
};
}
}
/**
* Internal helper to bind a function known to have 4 arguments
* to a given context.
*/
var bindInternal4 = function bindInternal4(func, thisContext) {
return function (a, b, c, d) {
return func.call(thisContext, a, b, c, d);
};
};
/**
* # Reduce
*
* A fast object `.reduce()` implementation.
*
* @param {Object} subject The object to reduce over.
* @param {Function} fn The reducer function.
* @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
* @param {Object} thisContext The context for the reducer.
* @return {mixed} The final result.
*/
var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
var keys = Object.keys(subject),
length = keys.length,
iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
i,
key,
result;
if (initialValue === undefined) {
i = 1;
result = subject[keys[0]];
} else {
i = 0;
result = initialValue;
}
for (; i < length; i++) {
key = keys[i];
result = iterator(result, subject[key], key, subject);
}
return result;
};
/**
* ucs2decode() and codePointAt() are both works of Mathias Bynens and licensed under MIT
*
* Copyright Mathias Bynens <https://mathiasbynens.be/>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function ucs2decode(string) {
const output = [];
let counter = 0;
const length = string.length;
while (counter < length) {
const value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
const extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) {
// eslint-disable-line eqeqeq
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
function toHex(unicode) {
const decoded = ucs2decode(unicode);
return decoded.length === 1 ? decoded[0].toString(16) : null;
}
function codePointAt(string, index) {
const size = string.length;
let first = string.charCodeAt(index);
let second;
if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
second = string.charCodeAt(index + 1);
if (second >= 0xDC00 && second <= 0xDFFF) {
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
}
}
return first;
}
function normalizeIcons(icons) {
return Object.keys(icons).reduce((acc, iconName) => {
const icon = icons[iconName];
const expanded = !!icon.icon;
if (expanded) {
acc[icon.iconName] = icon.icon;
} else {
acc[iconName] = icon;
}
return acc;
}, {});
}
function defineIcons(prefix, icons) {
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
const {
skipHooks = false
} = params;
const normalized = normalizeIcons(icons);
if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
namespace.hooks.addPack(prefix, normalizeIcons(icons));
} else {
namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);
}
/**
* Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
* of new styles we needed to differentiate between them. Prefix `fa` is now an alias
* for `fas` so we'll ease the upgrade process for our users by automatically defining
* this as well.
*/
if (prefix === 'fas') {
defineIcons('fa', icons);
}
}
const duotonePathRe = [/*#__PURE__*/_wrapRegExp(/path d="([^"]+)".*path d="([^"]+)"/, {
d1: 1,
d2: 2
}), /*#__PURE__*/_wrapRegExp(/path class="([^"]+)".*d="([^"]+)".*path class="([^"]+)".*d="([^"]+)"/, {
cls1: 1,
d1: 2,
cls2: 3,
d2: 4
}), /*#__PURE__*/_wrapRegExp(/path class="([^"]+)".*d="([^"]+)"/, {
cls1: 1,
d1: 2
})];
const {
styles,
shims
} = namespace;
const FAMILY_NAMES = Object.keys(PREFIX_TO_LONG_STYLE);
const PREFIXES_FOR_FAMILY = FAMILY_NAMES.reduce((acc, familyId) => {
acc[familyId] = Object.keys(PREFIX_TO_LONG_STYLE[familyId]);
return acc;
}, {});
let _defaultUsablePrefix = null;
let _byUnicode = {};
let _byLigature = {};
let _byOldName = {};
let _byOldUnicode = {};
let _byAlias = {};
function isReserved(name) {
return ~RESERVED_CLASSES.indexOf(name);
}
function getIconName(cssPrefix, cls) {
const parts = cls.split('-');
const prefix = parts[0];
const iconName = parts.slice(1).join('-');
if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
return iconName;
} else {
return null;
}
}
const build = () => {
const lookup = reducer => {
return reduce(styles, (o$$1, style, prefix) => {
o$$1[prefix] = reduce(style, reducer, {});
return o$$1;
}, {});
};
_byUnicode = lookup((acc, icon, iconName) => {
if (icon[3]) {
acc[icon[3]] = iconName;
}
if (icon[2]) {
const aliases = icon[2].filter(a$$1 => {
return typeof a$$1 === 'number';
});
aliases.forEach(alias => {
acc[alias.toString(16)] = iconName;
});
}
return acc;
});
_byLigature = lookup((acc, icon, iconName) => {
acc[iconName] = iconName;
if (icon[2]) {
const aliases = icon[2].filter(a$$1 => {
return typeof a$$1 === 'string';
});
aliases.forEach(alias => {
acc[alias] = iconName;
});
}
return acc;
});
_byAlias = lookup((acc, icon, iconName) => {
const aliases = icon[2];
acc[iconName] = iconName;
aliases.forEach(alias => {
acc[alias] = iconName;
});
return acc;
});
// If we have a Kit, we can't determine if regular is available since we
// could be auto-fetching it. We'll have to assume that it is available.
const hasRegular = 'far' in styles || config.autoFetchSvg;
const shimLookups = reduce(shims, (acc, shim) => {
const maybeNameMaybeUnicode = shim[0];
let prefix = shim[1];
const iconName = shim[2];
if (prefix === 'far' && !hasRegular) {
prefix = 'fas';
}
if (typeof maybeNameMaybeUnicode === 'string') {
acc.names[maybeNameMaybeUnicode] = {
prefix,
iconName
};
}
if (typeof maybeNameMaybeUnicode === 'number') {
acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
prefix,
iconName
};
}
return acc;
}, {
names: {},
unicodes: {}
});
_byOldName = shimLookups.names;
_byOldUnicode = shimLookups.unicodes;
_defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
family: config.familyDefault
});
};
onChange(c$$1 => {
_defaultUsablePrefix = getCanonicalPrefix(c$$1.styleDefault, {
family: config.familyDefault
});
});
build();
function byUnicode(prefix, unicode) {
return (_byUnicode[prefix] || {})[unicode];
}
function byLigature(prefix, ligature) {
return (_byLigature[prefix] || {})[ligature];
}
function byAlias(prefix, alias) {
return (_byAlias[prefix] || {})[alias];
}
function byOldName(name) {
return _byOldName[name] || {
prefix: null,
iconName: null
};
}
function byOldUnicode(unicode) {
const oldUnicode = _byOldUnicode[unicode];
const newUnicode = byUnicode('fas', unicode);
return oldUnicode || (newUnicode ? {
prefix: 'fas',
iconName: newUnicode
} : null) || {
prefix: null,
iconName: null
};
}
function getDefaultUsablePrefix() {
return _defaultUsablePrefix;
}
const emptyCanonicalIcon = () => {
return {
prefix: null,
iconName: null,
rest: []
};
};
function getFamilyId(values) {
let family = s;
const famProps = FAMILY_NAMES.reduce((acc, familyId) => {
acc[familyId] = "".concat(config.cssPrefix, "-").concat(familyId);
return acc;
}, {});
L.forEach(familyId => {
if (values.includes(famProps[familyId]) || values.some(v$$1 => PREFIXES_FOR_FAMILY[familyId].includes(v$$1))) {
family = familyId;
}
});
return family;
}
function getCanonicalPrefix(styleOrPrefix) {
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
const {
family = s
} = params;
const style = PREFIX_TO_STYLE[family][styleOrPrefix];
// handles the exception of passing in only a family of 'duotone' with no style
if (family === t && !styleOrPrefix) {
return 'fad';
}
const prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
const defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
const result = prefix || defined || null;
return result;
}
function moveNonFaClassesToRest(classNames) {
let rest = [];
let iconName = null;
classNames.forEach(cls => {
const result = getIconName(config.cssPrefix, cls);
if (result) {
iconName = result;
} else if (cls) {
rest.push(cls);
}
});
return {
iconName,
rest
};
}
function sortedUniqueValues(arr) {
return arr.sort().filter((value, index, arr) => {
return arr.indexOf(value) === index;
});
}
function getCanonicalIcon(values) {
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
const {
skipLookups = false
} = params;
let givenPrefix = null;
const faCombinedClasses = Ia.concat(bt$1);
const faStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => faCombinedClasses.includes(cls)));
const nonStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => !Ia.includes(cls)));
const faStyles = faStyleOrFamilyClasses.filter(cls => {
givenPrefix = cls;
return !P.includes(cls);
});
const [styleFromValues = null] = faStyles;
const family = getFamilyId(faStyleOrFamilyClasses);
const canonical = _objectSpread2(_objectSpread2({}, moveNonFaClassesToRest(nonStyleOrFamilyClasses)), {}, {
prefix: getCanonicalPrefix(styleFromValues, {
family
})
});
return _objectSpread2(_objectSpread2(_objectSpread2({}, canonical), getDefaultCanonicalPrefix({
values,
family,
styles,
config,
canonical,
givenPrefix
})), applyShimAndAlias(skipLookups, givenPrefix, canonical));
}
function applyShimAndAlias(skipLookups, givenPrefix, canonical) {
let {
prefix,
iconName
} = canonical;
if (skipLookups || !prefix || !iconName) {
return {
prefix,
iconName
};
}
const shim = givenPrefix === 'fa' ? byOldName(iconName) : {};
const aliasIconName = byAlias(prefix, iconName);
iconName = shim.iconName || aliasIconName || iconName;
prefix = shim.prefix || prefix;
if (prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
// Allow a fallback from the regular style to solid if regular is not available
// but only if we aren't auto-fetching SVGs
prefix = 'fas';
}
return {
prefix,
iconName
};
}
const newCanonicalFamilies = L.filter(familyId => {
return familyId !== s || familyId !== t;
});
const newCanonicalStyles = Object.keys(ga).filter(key => key !== s).map(key => Object.keys(ga[key])).flat();
function getDefaultCanonicalPrefix(prefixOptions) {
const {
values,
family,
canonical,
givenPrefix = '',
styles = {},
config: config$$1 = {}
} = prefixOptions;
const isDuotoneFamily = family === t;
const valuesHasDuotone = values.includes('fa-duotone') || values.includes('fad');
const defaultFamilyIsDuotone = config$$1.familyDefault === 'duotone';
const canonicalPrefixIsDuotone = canonical.prefix === 'fad' || canonical.prefix === 'fa-duotone';
if (!isDuotoneFamily && (valuesHasDuotone || defaultFamilyIsDuotone || canonicalPrefixIsDuotone)) {
canonical.prefix = 'fad';
}
if (values.includes('fa-brands') || values.includes('fab')) {
canonical.prefix = 'fab';
}
if (!canonical.prefix && newCanonicalFamilies.includes(family)) {
const validPrefix = Object.keys(styles).find(key => newCanonicalStyles.includes(key));
if (validPrefix || config$$1.autoFetchSvg) {
const defaultPref