BIMviewer
2459 строк · 76.5 Кб
1/*!
2* Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
3* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
4*/
5(function () {6'use strict';7
8function _typeof(obj) {9if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {10_typeof = function (obj) {11return typeof obj;12};13} else {14_typeof = function (obj) {15return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;16};17}18
19return _typeof(obj);20}21
22function _classCallCheck(instance, Constructor) {23if (!(instance instanceof Constructor)) {24throw new TypeError("Cannot call a class as a function");25}26}27
28function _defineProperties(target, props) {29for (var i = 0; i < props.length; i++) {30var descriptor = props[i];31descriptor.enumerable = descriptor.enumerable || false;32descriptor.configurable = true;33if ("value" in descriptor) descriptor.writable = true;34Object.defineProperty(target, descriptor.key, descriptor);35}36}37
38function _createClass(Constructor, protoProps, staticProps) {39if (protoProps) _defineProperties(Constructor.prototype, protoProps);40if (staticProps) _defineProperties(Constructor, staticProps);41return Constructor;42}43
44function _defineProperty(obj, key, value) {45if (key in obj) {46Object.defineProperty(obj, key, {47value: value,48enumerable: true,49configurable: true,50writable: true51});52} else {53obj[key] = value;54}55
56return obj;57}58
59function _objectSpread(target) {60for (var i = 1; i < arguments.length; i++) {61var source = arguments[i] != null ? arguments[i] : {};62var ownKeys = Object.keys(source);63
64if (typeof Object.getOwnPropertySymbols === 'function') {65ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {66return Object.getOwnPropertyDescriptor(source, sym).enumerable;67}));68}69
70ownKeys.forEach(function (key) {71_defineProperty(target, key, source[key]);72});73}74
75return target;76}77
78function _slicedToArray(arr, i) {79return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();80}81
82function _toConsumableArray(arr) {83return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();84}85
86function _arrayWithoutHoles(arr) {87if (Array.isArray(arr)) {88for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];89
90return arr2;91}92}93
94function _arrayWithHoles(arr) {95if (Array.isArray(arr)) return arr;96}97
98function _iterableToArray(iter) {99if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);100}101
102function _iterableToArrayLimit(arr, i) {103var _arr = [];104var _n = true;105var _d = false;106var _e = undefined;107
108try {109for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {110_arr.push(_s.value);111
112if (i && _arr.length === i) break;113}114} catch (err) {115_d = true;116_e = err;117} finally {118try {119if (!_n && _i["return"] != null) _i["return"]();120} finally {121if (_d) throw _e;122}123}124
125return _arr;126}127
128function _nonIterableSpread() {129throw new TypeError("Invalid attempt to spread non-iterable instance");130}131
132function _nonIterableRest() {133throw new TypeError("Invalid attempt to destructure non-iterable instance");134}135
136var noop = function noop() {};137
138var _WINDOW = {};139var _DOCUMENT = {};140var _MUTATION_OBSERVER = null;141var _PERFORMANCE = {142mark: noop,143measure: noop144};145
146try {147if (typeof window !== 'undefined') _WINDOW = window;148if (typeof document !== 'undefined') _DOCUMENT = document;149if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;150if (typeof performance !== 'undefined') _PERFORMANCE = performance;151} catch (e) {}152
153var _ref = _WINDOW.navigator || {},154_ref$userAgent = _ref.userAgent,155userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;156
157var WINDOW = _WINDOW;158var DOCUMENT = _DOCUMENT;159var MUTATION_OBSERVER = _MUTATION_OBSERVER;160var PERFORMANCE = _PERFORMANCE;161var IS_BROWSER = !!WINDOW.document;162var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';163var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');164
165var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';166var UNITS_IN_GRID = 16;167var DEFAULT_FAMILY_PREFIX = 'fa';168var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';169var DATA_FA_I2SVG = 'data-fa-i2svg';170var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';171var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';172var DATA_PREFIX = 'data-prefix';173var DATA_ICON = 'data-icon';174var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';175var MUTATION_APPROACH_ASYNC = 'async';176var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];177var PRODUCTION = function () {178try {179return "production" === 'production';180} catch (e) {181return false;182}183}();184var PREFIX_TO_STYLE = {185'fas': 'solid',186'far': 'regular',187'fal': 'light',188'fad': 'duotone',189'fab': 'brands',190'fa': 'solid'191};192var STYLE_TO_PREFIX = {193'solid': 'fas',194'regular': 'far',195'light': 'fal',196'duotone': 'fad',197'brands': 'fab'198};199var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';200var FONT_FAMILY_PATTERN = /Font Awesome 5 (Solid|Regular|Light|Duotone|Brands|Free|Pro)/;201var FONT_WEIGHT_TO_PREFIX = {202'900': 'fas',203'400': 'far',204'normal': 'far',205'300': 'fal'206};207var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];208var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);209var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];210var DUOTONE_CLASSES = {211GROUP: 'group',212SWAP_OPACITY: 'swap-opacity',213PRIMARY: 'primary',214SECONDARY: 'secondary'215};216var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'flip-both', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY].concat(oneToTen.map(function (n) {217return "".concat(n, "x");218})).concat(oneToTwenty.map(function (n) {219return "w-".concat(n);220}));221
222var initial = WINDOW.FontAwesomeConfig || {};223
224function getAttrConfig(attr) {225var element = DOCUMENT.querySelector('script[' + attr + ']');226
227if (element) {228return element.getAttribute(attr);229}230}231
232function coerce(val) {233// Getting an empty string will occur if the attribute is set on the HTML tag but without a value234// We'll assume that this is an indication that it should be toggled to true235// For example <script data-search-pseudo-elements src="..."></script>236if (val === '') return true;237if (val === 'false') return false;238if (val === 'true') return true;239return val;240}241
242if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {243var attrs = [['data-family-prefix', 'familyPrefix'], ['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']];244attrs.forEach(function (_ref) {245var _ref2 = _slicedToArray(_ref, 2),246attr = _ref2[0],247key = _ref2[1];248
249var val = coerce(getAttrConfig(attr));250
251if (val !== undefined && val !== null) {252initial[key] = val;253}254});255}256
257var _default = {258familyPrefix: DEFAULT_FAMILY_PREFIX,259replacementClass: DEFAULT_REPLACEMENT_CLASS,260autoReplaceSvg: true,261autoAddCss: true,262autoA11y: true,263searchPseudoElements: false,264observeMutations: true,265mutateApproach: 'async',266keepOriginalSource: true,267measurePerformance: false,268showMissingIcons: true269};270
271var _config = _objectSpread({}, _default, initial);272
273if (!_config.autoReplaceSvg) _config.observeMutations = false;274
275var config = _objectSpread({}, _config);276
277WINDOW.FontAwesomeConfig = config;278
279var w = WINDOW || {};280if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};281if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};282if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};283if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];284var namespace = w[NAMESPACE_IDENTIFIER];285
286var functions = [];287
288var listener = function listener() {289DOCUMENT.removeEventListener('DOMContentLoaded', listener);290loaded = 1;291functions.map(function (fn) {292return fn();293});294};295
296var loaded = false;297
298if (IS_DOM) {299loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);300if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);301}302
303function domready (fn) {304if (!IS_DOM) return;305loaded ? setTimeout(fn, 0) : functions.push(fn);306}307
308var PENDING = 'pending';309var SETTLED = 'settled';310var FULFILLED = 'fulfilled';311var REJECTED = 'rejected';312
313var NOOP = function NOOP() {};314
315var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';316var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;317var asyncQueue = [];318var asyncTimer;319
320function asyncFlush() {321// run promise callbacks322for (var i = 0; i < asyncQueue.length; i++) {323asyncQueue[i][0](asyncQueue[i][1]);324} // reset async asyncQueue325
326
327asyncQueue = [];328asyncTimer = false;329}330
331function asyncCall(callback, arg) {332asyncQueue.push([callback, arg]);333
334if (!asyncTimer) {335asyncTimer = true;336asyncSetTimer(asyncFlush, 0);337}338}339
340function invokeResolver(resolver, promise) {341function resolvePromise(value) {342resolve(promise, value);343}344
345function rejectPromise(reason) {346reject(promise, reason);347}348
349try {350resolver(resolvePromise, rejectPromise);351} catch (e) {352rejectPromise(e);353}354}355
356function invokeCallback(subscriber) {357var owner = subscriber.owner;358var settled = owner._state;359var value = owner._data;360var callback = subscriber[settled];361var promise = subscriber.then;362
363if (typeof callback === 'function') {364settled = FULFILLED;365
366try {367value = callback(value);368} catch (e) {369reject(promise, e);370}371}372
373if (!handleThenable(promise, value)) {374if (settled === FULFILLED) {375resolve(promise, value);376}377
378if (settled === REJECTED) {379reject(promise, value);380}381}382}383
384function handleThenable(promise, value) {385var resolved;386
387try {388if (promise === value) {389throw new TypeError('A promises callback cannot return that same promise.');390}391
392if (value && (typeof value === 'function' || _typeof(value) === 'object')) {393// then should be retrieved only once394var then = value.then;395
396if (typeof then === 'function') {397then.call(value, function (val) {398if (!resolved) {399resolved = true;400
401if (value === val) {402fulfill(promise, val);403} else {404resolve(promise, val);405}406}407}, function (reason) {408if (!resolved) {409resolved = true;410reject(promise, reason);411}412});413return true;414}415}416} catch (e) {417if (!resolved) {418reject(promise, e);419}420
421return true;422}423
424return false;425}426
427function resolve(promise, value) {428if (promise === value || !handleThenable(promise, value)) {429fulfill(promise, value);430}431}432
433function fulfill(promise, value) {434if (promise._state === PENDING) {435promise._state = SETTLED;436promise._data = value;437asyncCall(publishFulfillment, promise);438}439}440
441function reject(promise, reason) {442if (promise._state === PENDING) {443promise._state = SETTLED;444promise._data = reason;445asyncCall(publishRejection, promise);446}447}448
449function publish(promise) {450promise._then = promise._then.forEach(invokeCallback);451}452
453function publishFulfillment(promise) {454promise._state = FULFILLED;455publish(promise);456}457
458function publishRejection(promise) {459promise._state = REJECTED;460publish(promise);461
462if (!promise._handled && isNode) {463global.process.emit('unhandledRejection', promise._data, promise);464}465}466
467function notifyRejectionHandled(promise) {468global.process.emit('rejectionHandled', promise);469}470/**471* @class
472*/
473
474
475function P(resolver) {476if (typeof resolver !== 'function') {477throw new TypeError('Promise resolver ' + resolver + ' is not a function');478}479
480if (this instanceof P === false) {481throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');482}483
484this._then = [];485invokeResolver(resolver, this);486}487
488P.prototype = {489constructor: P,490_state: PENDING,491_then: null,492_data: undefined,493_handled: false,494then: function then(onFulfillment, onRejection) {495var subscriber = {496owner: this,497then: new this.constructor(NOOP),498fulfilled: onFulfillment,499rejected: onRejection500};501
502if ((onRejection || onFulfillment) && !this._handled) {503this._handled = true;504
505if (this._state === REJECTED && isNode) {506asyncCall(notifyRejectionHandled, this);507}508}509
510if (this._state === FULFILLED || this._state === REJECTED) {511// already resolved, call callback async512asyncCall(invokeCallback, subscriber);513} else {514// subscribe515this._then.push(subscriber);516}517
518return subscriber.then;519},520catch: function _catch(onRejection) {521return this.then(null, onRejection);522}523};524
525P.all = function (promises) {526if (!Array.isArray(promises)) {527throw new TypeError('You must pass an array to Promise.all().');528}529
530return new P(function (resolve, reject) {531var results = [];532var remaining = 0;533
534function resolver(index) {535remaining++;536return function (value) {537results[index] = value;538
539if (! --remaining) {540resolve(results);541}542};543}544
545for (var i = 0, promise; i < promises.length; i++) {546promise = promises[i];547
548if (promise && typeof promise.then === 'function') {549promise.then(resolver(i), reject);550} else {551results[i] = promise;552}553}554
555if (!remaining) {556resolve(results);557}558});559};560
561P.race = function (promises) {562if (!Array.isArray(promises)) {563throw new TypeError('You must pass an array to Promise.race().');564}565
566return new P(function (resolve, reject) {567for (var i = 0, promise; i < promises.length; i++) {568promise = promises[i];569
570if (promise && typeof promise.then === 'function') {571promise.then(resolve, reject);572} else {573resolve(promise);574}575}576});577};578
579P.resolve = function (value) {580if (value && _typeof(value) === 'object' && value.constructor === P) {581return value;582}583
584return new P(function (resolve) {585resolve(value);586});587};588
589P.reject = function (reason) {590return new P(function (resolve, reject) {591reject(reason);592});593};594
595var picked = typeof Promise === 'function' ? Promise : P;596
597var d = UNITS_IN_GRID;598var meaninglessTransform = {599size: 16,600x: 0,601y: 0,602rotate: 0,603flipX: false,604flipY: false605};606
607function isReserved(name) {608return ~RESERVED_CLASSES.indexOf(name);609}610
611function bunker(fn) {612try {613fn();614} catch (e) {615if (!PRODUCTION) {616throw e;617}618}619}620function insertCss(css) {621if (!css || !IS_DOM) {622return;623}624
625var style = DOCUMENT.createElement('style');626style.setAttribute('type', 'text/css');627style.innerHTML = css;628var headChildren = DOCUMENT.head.childNodes;629var beforeChild = null;630
631for (var i = headChildren.length - 1; i > -1; i--) {632var child = headChildren[i];633var tagName = (child.tagName || '').toUpperCase();634
635if (['STYLE', 'LINK'].indexOf(tagName) > -1) {636beforeChild = child;637}638}639
640DOCUMENT.head.insertBefore(style, beforeChild);641return css;642}643var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';644function nextUniqueId() {645var size = 12;646var id = '';647
648while (size-- > 0) {649id += idPool[Math.random() * 62 | 0];650}651
652return id;653}654function toArray(obj) {655var array = [];656
657for (var i = (obj || []).length >>> 0; i--;) {658array[i] = obj[i];659}660
661return array;662}663function classArray(node) {664if (node.classList) {665return toArray(node.classList);666} else {667return (node.getAttribute('class') || '').split(' ').filter(function (i) {668return i;669});670}671}672function getIconName(familyPrefix, cls) {673var parts = cls.split('-');674var prefix = parts[0];675var iconName = parts.slice(1).join('-');676
677if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {678return iconName;679} else {680return null;681}682}683function htmlEscape(str) {684return "".concat(str).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');685}686function joinAttributes(attributes) {687return Object.keys(attributes || {}).reduce(function (acc, attributeName) {688return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");689}, '').trim();690}691function joinStyles(styles) {692return Object.keys(styles || {}).reduce(function (acc, styleName) {693return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");694}, '');695}696function transformIsMeaningful(transform) {697return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;698}699function transformForSvg(_ref) {700var transform = _ref.transform,701containerWidth = _ref.containerWidth,702iconWidth = _ref.iconWidth;703var outer = {704transform: "translate(".concat(containerWidth / 2, " 256)")705};706var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");707var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");708var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");709var inner = {710transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)711};712var path = {713transform: "translate(".concat(iconWidth / 2 * -1, " -256)")714};715return {716outer: outer,717inner: inner,718path: path719};720}721function transformForCss(_ref2) {722var transform = _ref2.transform,723_ref2$width = _ref2.width,724width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,725_ref2$height = _ref2.height,726height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,727_ref2$startCentered = _ref2.startCentered,728startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;729var val = '';730
731if (startCentered && IS_IE) {732val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");733} else if (startCentered) {734val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");735} else {736val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");737}738
739val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");740val += "rotate(".concat(transform.rotate, "deg) ");741return val;742}743
744var ALL_SPACE = {745x: 0,746y: 0,747width: '100%',748height: '100%'749};750
751function fillBlack(abstract) {752var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;753
754if (abstract.attributes && (abstract.attributes.fill || force)) {755abstract.attributes.fill = 'black';756}757
758return abstract;759}760
761function deGroup(abstract) {762if (abstract.tag === 'g') {763return abstract.children;764} else {765return [abstract];766}767}768
769function makeIconMasking (_ref) {770var children = _ref.children,771attributes = _ref.attributes,772main = _ref.main,773mask = _ref.mask,774transform = _ref.transform;775var mainWidth = main.width,776mainPath = main.icon;777var maskWidth = mask.width,778maskPath = mask.icon;779var trans = transformForSvg({780transform: transform,781containerWidth: maskWidth,782iconWidth: mainWidth783});784var maskRect = {785tag: 'rect',786attributes: _objectSpread({}, ALL_SPACE, {787fill: 'white'788})789};790var maskInnerGroupChildrenMixin = mainPath.children ? {791children: mainPath.children.map(fillBlack)792} : {};793var maskInnerGroup = {794tag: 'g',795attributes: _objectSpread({}, trans.inner),796children: [fillBlack(_objectSpread({797tag: mainPath.tag,798attributes: _objectSpread({}, mainPath.attributes, trans.path)799}, maskInnerGroupChildrenMixin))]800};801var maskOuterGroup = {802tag: 'g',803attributes: _objectSpread({}, trans.outer),804children: [maskInnerGroup]805};806var maskId = "mask-".concat(nextUniqueId());807var clipId = "clip-".concat(nextUniqueId());808var maskTag = {809tag: 'mask',810attributes: _objectSpread({}, ALL_SPACE, {811id: maskId,812maskUnits: 'userSpaceOnUse',813maskContentUnits: 'userSpaceOnUse'814}),815children: [maskRect, maskOuterGroup]816};817var defs = {818tag: 'defs',819children: [{820tag: 'clipPath',821attributes: {822id: clipId823},824children: deGroup(maskPath)825}, maskTag]826};827children.push(defs, {828tag: 'rect',829attributes: _objectSpread({830fill: 'currentColor',831'clip-path': "url(#".concat(clipId, ")"),832mask: "url(#".concat(maskId, ")")833}, ALL_SPACE)834});835return {836children: children,837attributes: attributes838};839}840
841function makeIconStandard (_ref) {842var children = _ref.children,843attributes = _ref.attributes,844main = _ref.main,845transform = _ref.transform,846styles = _ref.styles;847var styleString = joinStyles(styles);848
849if (styleString.length > 0) {850attributes['style'] = styleString;851}852
853if (transformIsMeaningful(transform)) {854var trans = transformForSvg({855transform: transform,856containerWidth: main.width,857iconWidth: main.width858});859children.push({860tag: 'g',861attributes: _objectSpread({}, trans.outer),862children: [{863tag: 'g',864attributes: _objectSpread({}, trans.inner),865children: [{866tag: main.icon.tag,867children: main.icon.children,868attributes: _objectSpread({}, main.icon.attributes, trans.path)869}]870}]871});872} else {873children.push(main.icon);874}875
876return {877children: children,878attributes: attributes879};880}881
882function asIcon (_ref) {883var children = _ref.children,884main = _ref.main,885mask = _ref.mask,886attributes = _ref.attributes,887styles = _ref.styles,888transform = _ref.transform;889
890if (transformIsMeaningful(transform) && main.found && !mask.found) {891var width = main.width,892height = main.height;893var offset = {894x: width / height / 2,895y: 0.5896};897attributes['style'] = joinStyles(_objectSpread({}, styles, {898'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")899}));900}901
902return [{903tag: 'svg',904attributes: attributes,905children: children906}];907}908
909function asSymbol (_ref) {910var prefix = _ref.prefix,911iconName = _ref.iconName,912children = _ref.children,913attributes = _ref.attributes,914symbol = _ref.symbol;915var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;916return [{917tag: 'svg',918attributes: {919style: 'display: none;'920},921children: [{922tag: 'symbol',923attributes: _objectSpread({}, attributes, {924id: id925}),926children: children927}]928}];929}930
931function makeInlineSvgAbstract(params) {932var _params$icons = params.icons,933main = _params$icons.main,934mask = _params$icons.mask,935prefix = params.prefix,936iconName = params.iconName,937transform = params.transform,938symbol = params.symbol,939title = params.title,940extra = params.extra,941_params$watchable = params.watchable,942watchable = _params$watchable === void 0 ? false : _params$watchable;943
944var _ref = mask.found ? mask : main,945width = _ref.width,946height = _ref.height;947
948var widthClass = "fa-w-".concat(Math.ceil(width / height * 16));949var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {950return extra.classes.indexOf(c) === -1;951}).concat(extra.classes).join(' ');952var content = {953children: [],954attributes: _objectSpread({}, extra.attributes, {955'data-prefix': prefix,956'data-icon': iconName,957'class': attrClass,958'role': extra.attributes.role || 'img',959'xmlns': 'http://www.w3.org/2000/svg',960'viewBox': "0 0 ".concat(width, " ").concat(height)961})962};963
964if (watchable) {965content.attributes[DATA_FA_I2SVG] = '';966}967
968if (title) content.children.push({969tag: 'title',970attributes: {971id: content.attributes['aria-labelledby'] || "title-".concat(nextUniqueId())972},973children: [title]974});975
976var args = _objectSpread({}, content, {977prefix: prefix,978iconName: iconName,979main: main,980mask: mask,981transform: transform,982symbol: symbol,983styles: extra.styles984});985
986var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),987children = _ref2.children,988attributes = _ref2.attributes;989
990args.children = children;991args.attributes = attributes;992
993if (symbol) {994return asSymbol(args);995} else {996return asIcon(args);997}998}999function makeLayersTextAbstract(params) {1000var content = params.content,1001width = params.width,1002height = params.height,1003transform = params.transform,1004title = params.title,1005extra = params.extra,1006_params$watchable2 = params.watchable,1007watchable = _params$watchable2 === void 0 ? false : _params$watchable2;1008
1009var attributes = _objectSpread({}, extra.attributes, title ? {1010'title': title1011} : {}, {1012'class': extra.classes.join(' ')1013});1014
1015if (watchable) {1016attributes[DATA_FA_I2SVG] = '';1017}1018
1019var styles = _objectSpread({}, extra.styles);1020
1021if (transformIsMeaningful(transform)) {1022styles['transform'] = transformForCss({1023transform: transform,1024startCentered: true,1025width: width,1026height: height1027});1028styles['-webkit-transform'] = styles['transform'];1029}1030
1031var styleString = joinStyles(styles);1032
1033if (styleString.length > 0) {1034attributes['style'] = styleString;1035}1036
1037var val = [];1038val.push({1039tag: 'span',1040attributes: attributes,1041children: [content]1042});1043
1044if (title) {1045val.push({1046tag: 'span',1047attributes: {1048class: 'sr-only'1049},1050children: [title]1051});1052}1053
1054return val;1055}1056function makeLayersCounterAbstract(params) {1057var content = params.content,1058title = params.title,1059extra = params.extra;1060
1061var attributes = _objectSpread({}, extra.attributes, title ? {1062'title': title1063} : {}, {1064'class': extra.classes.join(' ')1065});1066
1067var styleString = joinStyles(extra.styles);1068
1069if (styleString.length > 0) {1070attributes['style'] = styleString;1071}1072
1073var val = [];1074val.push({1075tag: 'span',1076attributes: attributes,1077children: [content]1078});1079
1080if (title) {1081val.push({1082tag: 'span',1083attributes: {1084class: 'sr-only'1085},1086children: [title]1087});1088}1089
1090return val;1091}1092
1093var noop$1 = function noop() {};1094
1095var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {1096mark: noop$1,1097measure: noop$11098};1099var preamble = "FA \"5.11.2\"";1100
1101var begin = function begin(name) {1102p.mark("".concat(preamble, " ").concat(name, " begins"));1103return function () {1104return end(name);1105};1106};1107
1108var end = function end(name) {1109p.mark("".concat(preamble, " ").concat(name, " ends"));1110p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));1111};1112
1113var perf = {1114begin: begin,1115end: end1116};1117
1118/**1119* Internal helper to bind a function known to have 4 arguments
1120* to a given context.
1121*/
1122
1123var bindInternal4 = function bindInternal4(func, thisContext) {1124return function (a, b, c, d) {1125return func.call(thisContext, a, b, c, d);1126};1127};1128
1129/**1130* # Reduce
1131*
1132* A fast object `.reduce()` implementation.
1133*
1134* @param {Object} subject The object to reduce over.
1135* @param {Function} fn The reducer function.
1136* @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
1137* @param {Object} thisContext The context for the reducer.
1138* @return {mixed} The final result.
1139*/
1140
1141
1142var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {1143var keys = Object.keys(subject),1144length = keys.length,1145iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,1146i,1147key,1148result;1149
1150if (initialValue === undefined) {1151i = 1;1152result = subject[keys[0]];1153} else {1154i = 0;1155result = initialValue;1156}1157
1158for (; i < length; i++) {1159key = keys[i];1160result = iterator(result, subject[key], key, subject);1161}1162
1163return result;1164};1165
1166function toHex(unicode) {1167var result = '';1168
1169for (var i = 0; i < unicode.length; i++) {1170var hex = unicode.charCodeAt(i).toString(16);1171result += ('000' + hex).slice(-4);1172}1173
1174return result;1175}1176
1177function defineIcons(prefix, icons) {1178var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};1179var _params$skipHooks = params.skipHooks,1180skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;1181var normalized = Object.keys(icons).reduce(function (acc, iconName) {1182var icon = icons[iconName];1183var expanded = !!icon.icon;1184
1185if (expanded) {1186acc[icon.iconName] = icon.icon;1187} else {1188acc[iconName] = icon;1189}1190
1191return acc;1192}, {});1193
1194if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {1195namespace.hooks.addPack(prefix, normalized);1196} else {1197namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);1198}1199/**1200* Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
1201* of new styles we needed to differentiate between them. Prefix `fa` is now an alias
1202* for `fas` so we'll easy the upgrade process for our users by automatically defining
1203* this as well.
1204*/
1205
1206
1207if (prefix === 'fas') {1208defineIcons('fa', icons);1209}1210}1211
1212var styles = namespace.styles,1213shims = namespace.shims;1214var _byUnicode = {};1215var _byLigature = {};1216var _byOldName = {};1217var build = function build() {1218var lookup = function lookup(reducer) {1219return reduce(styles, function (o, style, prefix) {1220o[prefix] = reduce(style, reducer, {});1221return o;1222}, {});1223};1224
1225_byUnicode = lookup(function (acc, icon, iconName) {1226if (icon[3]) {1227acc[icon[3]] = iconName;1228}1229
1230return acc;1231});1232_byLigature = lookup(function (acc, icon, iconName) {1233var ligatures = icon[2];1234acc[iconName] = iconName;1235ligatures.forEach(function (ligature) {1236acc[ligature] = iconName;1237});1238return acc;1239});1240var hasRegular = 'far' in styles;1241_byOldName = reduce(shims, function (acc, shim) {1242var oldName = shim[0];1243var prefix = shim[1];1244var iconName = shim[2];1245
1246if (prefix === 'far' && !hasRegular) {1247prefix = 'fas';1248}1249
1250acc[oldName] = {1251prefix: prefix,1252iconName: iconName1253};1254return acc;1255}, {});1256};1257build();1258function byUnicode(prefix, unicode) {1259return (_byUnicode[prefix] || {})[unicode];1260}1261function byLigature(prefix, ligature) {1262return (_byLigature[prefix] || {})[ligature];1263}1264function byOldName(name) {1265return _byOldName[name] || {1266prefix: null,1267iconName: null1268};1269}1270
1271var styles$1 = namespace.styles;1272var emptyCanonicalIcon = function emptyCanonicalIcon() {1273return {1274prefix: null,1275iconName: null,1276rest: []1277};1278};1279function getCanonicalIcon(values) {1280return values.reduce(function (acc, cls) {1281var iconName = getIconName(config.familyPrefix, cls);1282
1283if (styles$1[cls]) {1284acc.prefix = cls;1285} else if (config.autoFetchSvg && ['fas', 'far', 'fal', 'fad', 'fab', 'fa'].indexOf(cls) > -1) {1286acc.prefix = cls;1287} else if (iconName) {1288var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};1289acc.iconName = shim.iconName || iconName;1290acc.prefix = shim.prefix || acc.prefix;1291} else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {1292acc.rest.push(cls);1293}1294
1295return acc;1296}, emptyCanonicalIcon());1297}1298function iconFromMapping(mapping, prefix, iconName) {1299if (mapping && mapping[prefix] && mapping[prefix][iconName]) {1300return {1301prefix: prefix,1302iconName: iconName,1303icon: mapping[prefix][iconName]1304};1305}1306}1307
1308function toHtml(abstractNodes) {1309var tag = abstractNodes.tag,1310_abstractNodes$attrib = abstractNodes.attributes,1311attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,1312_abstractNodes$childr = abstractNodes.children,1313children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;1314
1315if (typeof abstractNodes === 'string') {1316return htmlEscape(abstractNodes);1317} else {1318return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");1319}1320}1321
1322var noop$2 = function noop() {};1323
1324function isWatched(node) {1325var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;1326return typeof i2svg === 'string';1327}1328
1329function getMutator() {1330if (config.autoReplaceSvg === true) {1331return mutators.replace;1332}1333
1334var mutator = mutators[config.autoReplaceSvg];1335return mutator || mutators.replace;1336}1337
1338var mutators = {1339replace: function replace(mutation) {1340var node = mutation[0];1341var abstract = mutation[1];1342var newOuterHTML = abstract.map(function (a) {1343return toHtml(a);1344}).join('\n');1345
1346if (node.parentNode && node.outerHTML) {1347node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " -->") : '');1348} else if (node.parentNode) {1349var newNode = document.createElement('span');1350node.parentNode.replaceChild(newNode, node);1351newNode.outerHTML = newOuterHTML;1352}1353},1354nest: function nest(mutation) {1355var node = mutation[0];1356var abstract = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.1357// Short-circuit to the standard replacement1358
1359if (~classArray(node).indexOf(config.replacementClass)) {1360return mutators.replace(mutation);1361}1362
1363var forSvg = new RegExp("".concat(config.familyPrefix, "-.*"));1364delete abstract[0].attributes.style;1365delete abstract[0].attributes.id;1366var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {1367if (cls === config.replacementClass || cls.match(forSvg)) {1368acc.toSvg.push(cls);1369} else {1370acc.toNode.push(cls);1371}1372
1373return acc;1374}, {1375toNode: [],1376toSvg: []1377});1378abstract[0].attributes.class = splitClasses.toSvg.join(' ');1379var newInnerHTML = abstract.map(function (a) {1380return toHtml(a);1381}).join('\n');1382node.setAttribute('class', splitClasses.toNode.join(' '));1383node.setAttribute(DATA_FA_I2SVG, '');1384node.innerHTML = newInnerHTML;1385}1386};1387
1388function performOperationSync(op) {1389op();1390}1391
1392function perform(mutations, callback) {1393var callbackFunction = typeof callback === 'function' ? callback : noop$2;1394
1395if (mutations.length === 0) {1396callbackFunction();1397} else {1398var frame = performOperationSync;1399
1400if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {1401frame = WINDOW.requestAnimationFrame || performOperationSync;1402}1403
1404frame(function () {1405var mutator = getMutator();1406var mark = perf.begin('mutate');1407mutations.map(mutator);1408mark();1409callbackFunction();1410});1411}1412}1413var disabled = false;1414function disableObservation() {1415disabled = true;1416}1417function enableObservation() {1418disabled = false;1419}1420var mo = null;1421function observe(options) {1422if (!MUTATION_OBSERVER) {1423return;1424}1425
1426if (!config.observeMutations) {1427return;1428}1429
1430var treeCallback = options.treeCallback,1431nodeCallback = options.nodeCallback,1432pseudoElementsCallback = options.pseudoElementsCallback,1433_options$observeMutat = options.observeMutationsRoot,1434observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;1435mo = new MUTATION_OBSERVER(function (objects) {1436if (disabled) return;1437toArray(objects).forEach(function (mutationRecord) {1438if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {1439if (config.searchPseudoElements) {1440pseudoElementsCallback(mutationRecord.target);1441}1442
1443treeCallback(mutationRecord.target);1444}1445
1446if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {1447pseudoElementsCallback(mutationRecord.target.parentNode);1448}1449
1450if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {1451if (mutationRecord.attributeName === 'class') {1452var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),1453prefix = _getCanonicalIcon.prefix,1454iconName = _getCanonicalIcon.iconName;1455
1456if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);1457if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);1458} else {1459nodeCallback(mutationRecord.target);1460}1461}1462});1463});1464if (!IS_DOM) return;1465mo.observe(observeMutationsRoot, {1466childList: true,1467attributes: true,1468characterData: true,1469subtree: true1470});1471}1472function disconnect() {1473if (!mo) return;1474mo.disconnect();1475}1476
1477function styleParser (node) {1478var style = node.getAttribute('style');1479var val = [];1480
1481if (style) {1482val = style.split(';').reduce(function (acc, style) {1483var styles = style.split(':');1484var prop = styles[0];1485var value = styles.slice(1);1486
1487if (prop && value.length > 0) {1488acc[prop] = value.join(':').trim();1489}1490
1491return acc;1492}, {});1493}1494
1495return val;1496}1497
1498function classParser (node) {1499var existingPrefix = node.getAttribute('data-prefix');1500var existingIconName = node.getAttribute('data-icon');1501var innerText = node.innerText !== undefined ? node.innerText.trim() : '';1502var val = getCanonicalIcon(classArray(node));1503
1504if (existingPrefix && existingIconName) {1505val.prefix = existingPrefix;1506val.iconName = existingIconName;1507}1508
1509if (val.prefix && innerText.length > 1) {1510val.iconName = byLigature(val.prefix, node.innerText);1511} else if (val.prefix && innerText.length === 1) {1512val.iconName = byUnicode(val.prefix, toHex(node.innerText));1513}1514
1515return val;1516}1517
1518var parseTransformString = function parseTransformString(transformString) {1519var transform = {1520size: 16,1521x: 0,1522y: 0,1523flipX: false,1524flipY: false,1525rotate: 01526};1527
1528if (!transformString) {1529return transform;1530} else {1531return transformString.toLowerCase().split(' ').reduce(function (acc, n) {1532var parts = n.toLowerCase().split('-');1533var first = parts[0];1534var rest = parts.slice(1).join('-');1535
1536if (first && rest === 'h') {1537acc.flipX = true;1538return acc;1539}1540
1541if (first && rest === 'v') {1542acc.flipY = true;1543return acc;1544}1545
1546rest = parseFloat(rest);1547
1548if (isNaN(rest)) {1549return acc;1550}1551
1552switch (first) {1553case 'grow':1554acc.size = acc.size + rest;1555break;1556
1557case 'shrink':1558acc.size = acc.size - rest;1559break;1560
1561case 'left':1562acc.x = acc.x - rest;1563break;1564
1565case 'right':1566acc.x = acc.x + rest;1567break;1568
1569case 'up':1570acc.y = acc.y - rest;1571break;1572
1573case 'down':1574acc.y = acc.y + rest;1575break;1576
1577case 'rotate':1578acc.rotate = acc.rotate + rest;1579break;1580}1581
1582return acc;1583}, transform);1584}1585};1586function transformParser (node) {1587return parseTransformString(node.getAttribute('data-fa-transform'));1588}1589
1590function symbolParser (node) {1591var symbol = node.getAttribute('data-fa-symbol');1592return symbol === null ? false : symbol === '' ? true : symbol;1593}1594
1595function attributesParser (node) {1596var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {1597if (acc.name !== 'class' && acc.name !== 'style') {1598acc[attr.name] = attr.value;1599}1600
1601return acc;1602}, {});1603var title = node.getAttribute('title');1604
1605if (config.autoA11y) {1606if (title) {1607extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(nextUniqueId());1608} else {1609extraAttributes['aria-hidden'] = 'true';1610extraAttributes['focusable'] = 'false';1611}1612}1613
1614return extraAttributes;1615}1616
1617function maskParser (node) {1618var mask = node.getAttribute('data-fa-mask');1619
1620if (!mask) {1621return emptyCanonicalIcon();1622} else {1623return getCanonicalIcon(mask.split(' ').map(function (i) {1624return i.trim();1625}));1626}1627}1628
1629function blankMeta() {1630return {1631iconName: null,1632title: null,1633prefix: null,1634transform: meaninglessTransform,1635symbol: false,1636mask: null,1637extra: {1638classes: [],1639styles: {},1640attributes: {}1641}1642};1643}1644function parseMeta(node) {1645var _classParser = classParser(node),1646iconName = _classParser.iconName,1647prefix = _classParser.prefix,1648extraClasses = _classParser.rest;1649
1650var extraStyles = styleParser(node);1651var transform = transformParser(node);1652var symbol = symbolParser(node);1653var extraAttributes = attributesParser(node);1654var mask = maskParser(node);1655return {1656iconName: iconName,1657title: node.getAttribute('title'),1658prefix: prefix,1659transform: transform,1660symbol: symbol,1661mask: mask,1662extra: {1663classes: extraClasses,1664styles: extraStyles,1665attributes: extraAttributes1666}1667};1668}1669
1670function MissingIcon(error) {1671this.name = 'MissingIcon';1672this.message = error || 'Icon unavailable';1673this.stack = new Error().stack;1674}1675MissingIcon.prototype = Object.create(Error.prototype);1676MissingIcon.prototype.constructor = MissingIcon;1677
1678var FILL = {1679fill: 'currentColor'1680};1681var ANIMATION_BASE = {1682attributeType: 'XML',1683repeatCount: 'indefinite',1684dur: '2s'1685};1686var RING = {1687tag: 'path',1688attributes: _objectSpread({}, FILL, {1689d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'1690})1691};1692
1693var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {1694attributeName: 'opacity'1695});1696
1697var DOT = {1698tag: 'circle',1699attributes: _objectSpread({}, FILL, {1700cx: '256',1701cy: '364',1702r: '28'1703}),1704children: [{1705tag: 'animate',1706attributes: _objectSpread({}, ANIMATION_BASE, {1707attributeName: 'r',1708values: '28;14;28;28;14;28;'1709})1710}, {1711tag: 'animate',1712attributes: _objectSpread({}, OPACITY_ANIMATE, {1713values: '1;0;1;1;0;1;'1714})1715}]1716};1717var QUESTION = {1718tag: 'path',1719attributes: _objectSpread({}, FILL, {1720opacity: '1',1721d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'1722}),1723children: [{1724tag: 'animate',1725attributes: _objectSpread({}, OPACITY_ANIMATE, {1726values: '1;0;0;0;0;1;'1727})1728}]1729};1730var EXCLAMATION = {1731tag: 'path',1732attributes: _objectSpread({}, FILL, {1733opacity: '0',1734d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'1735}),1736children: [{1737tag: 'animate',1738attributes: _objectSpread({}, OPACITY_ANIMATE, {1739values: '0;0;1;1;0;0;'1740})1741}]1742};1743var missing = {1744tag: 'g',1745children: [RING, DOT, QUESTION, EXCLAMATION]1746};1747
1748var styles$2 = namespace.styles;1749function asFoundIcon(icon) {1750var width = icon[0];1751var height = icon[1];1752
1753var _icon$slice = icon.slice(4),1754_icon$slice2 = _slicedToArray(_icon$slice, 1),1755vectorData = _icon$slice2[0];1756
1757var element = null;1758
1759if (Array.isArray(vectorData)) {1760element = {1761tag: 'g',1762attributes: {1763class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)1764},1765children: [{1766tag: 'path',1767attributes: {1768class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),1769fill: 'currentColor',1770d: vectorData[0]1771}1772}, {1773tag: 'path',1774attributes: {1775class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),1776fill: 'currentColor',1777d: vectorData[1]1778}1779}]1780};1781} else {1782element = {1783tag: 'path',1784attributes: {1785fill: 'currentColor',1786d: vectorData1787}1788};1789}1790
1791return {1792found: true,1793width: width,1794height: height,1795icon: element1796};1797}1798function findIcon(iconName, prefix) {1799return new picked(function (resolve, reject) {1800var val = {1801found: false,1802width: 512,1803height: 512,1804icon: missing1805};1806
1807if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {1808var icon = styles$2[prefix][iconName];1809return resolve(asFoundIcon(icon));1810}1811
1812var headers = {};1813
1814if (_typeof(WINDOW.FontAwesomeKitConfig) === 'object' && typeof window.FontAwesomeKitConfig.token === 'string') {1815headers['fa-kit-token'] = WINDOW.FontAwesomeKitConfig.token;1816}1817
1818if (iconName && prefix && !config.showMissingIcons) {1819reject(new MissingIcon("Icon is missing for prefix ".concat(prefix, " with icon name ").concat(iconName)));1820} else {1821resolve(val);1822}1823});1824}1825
1826var styles$3 = namespace.styles;1827
1828function generateSvgReplacementMutation(node, nodeMeta) {1829var iconName = nodeMeta.iconName,1830title = nodeMeta.title,1831prefix = nodeMeta.prefix,1832transform = nodeMeta.transform,1833symbol = nodeMeta.symbol,1834mask = nodeMeta.mask,1835extra = nodeMeta.extra;1836return new picked(function (resolve, reject) {1837picked.all([findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix)]).then(function (_ref) {1838var _ref2 = _slicedToArray(_ref, 2),1839main = _ref2[0],1840mask = _ref2[1];1841
1842resolve([node, makeInlineSvgAbstract({1843icons: {1844main: main,1845mask: mask1846},1847prefix: prefix,1848iconName: iconName,1849transform: transform,1850symbol: symbol,1851mask: mask,1852title: title,1853extra: extra,1854watchable: true1855})]);1856});1857});1858}1859
1860function generateLayersText(node, nodeMeta) {1861var title = nodeMeta.title,1862transform = nodeMeta.transform,1863extra = nodeMeta.extra;1864var width = null;1865var height = null;1866
1867if (IS_IE) {1868var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);1869var boundingClientRect = node.getBoundingClientRect();1870width = boundingClientRect.width / computedFontSize;1871height = boundingClientRect.height / computedFontSize;1872}1873
1874if (config.autoA11y && !title) {1875extra.attributes['aria-hidden'] = 'true';1876}1877
1878return picked.resolve([node, makeLayersTextAbstract({1879content: node.innerHTML,1880width: width,1881height: height,1882transform: transform,1883title: title,1884extra: extra,1885watchable: true1886})]);1887}1888
1889function generateMutation(node) {1890var nodeMeta = parseMeta(node);1891
1892if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {1893return generateLayersText(node, nodeMeta);1894} else {1895return generateSvgReplacementMutation(node, nodeMeta);1896}1897}1898
1899function onTree(root) {1900var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;1901if (!IS_DOM) return;1902var htmlClassList = DOCUMENT.documentElement.classList;1903
1904var hclAdd = function hclAdd(suffix) {1905return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));1906};1907
1908var hclRemove = function hclRemove(suffix) {1909return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));1910};1911
1912var prefixes = config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);1913var prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(function (p) {1914return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");1915})).join(', ');1916
1917if (prefixesDomQuery.length === 0) {1918return;1919}1920
1921var candidates = [];1922
1923try {1924candidates = toArray(root.querySelectorAll(prefixesDomQuery));1925} catch (e) {// noop1926}1927
1928if (candidates.length > 0) {1929hclAdd('pending');1930hclRemove('complete');1931} else {1932return;1933}1934
1935var mark = perf.begin('onTree');1936var mutations = candidates.reduce(function (acc, node) {1937try {1938var mutation = generateMutation(node);1939
1940if (mutation) {1941acc.push(mutation);1942}1943} catch (e) {1944if (!PRODUCTION) {1945if (e instanceof MissingIcon) {1946console.error(e);1947}1948}1949}1950
1951return acc;1952}, []);1953return new picked(function (resolve, reject) {1954picked.all(mutations).then(function (resolvedMutations) {1955perform(resolvedMutations, function () {1956hclAdd('active');1957hclAdd('complete');1958hclRemove('pending');1959if (typeof callback === 'function') callback();1960mark();1961resolve();1962});1963}).catch(function () {1964mark();1965reject();1966});1967});1968}1969function onNode(node) {1970var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;1971generateMutation(node).then(function (mutation) {1972if (mutation) {1973perform([mutation], callback);1974}1975});1976}1977
1978function replaceForPosition(node, position) {1979var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));1980return new picked(function (resolve, reject) {1981if (node.getAttribute(pendingAttribute) !== null) {1982// This node is already being processed1983return resolve();1984}1985
1986var children = toArray(node.children);1987var alreadyProcessedPseudoElement = children.filter(function (c) {1988return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;1989})[0];1990var styles = WINDOW.getComputedStyle(node, position);1991var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);1992var fontWeight = styles.getPropertyValue('font-weight');1993
1994if (alreadyProcessedPseudoElement && !fontFamily) {1995// If we've already processed it but the current computed style does not result in a font-family,1996// that probably means that a class name that was previously present to make the icon has been1997// removed. So we now should delete the icon.1998node.removeChild(alreadyProcessedPseudoElement);1999return resolve();2000} else if (fontFamily) {2001var content = styles.getPropertyValue('content');2002var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands'].indexOf(fontFamily[1]) ? STYLE_TO_PREFIX[fontFamily[1].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];2003var hexValue = toHex(content.length === 3 ? content.substr(1, 1) : content);2004var iconName = byUnicode(prefix, hexValue);2005var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't2006// already done so with the same prefix and iconName2007
2008if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {2009node.setAttribute(pendingAttribute, iconIdentifier);2010
2011if (alreadyProcessedPseudoElement) {2012// Delete the old one, since we're replacing it with a new one2013node.removeChild(alreadyProcessedPseudoElement);2014}2015
2016var meta = blankMeta();2017var extra = meta.extra;2018extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;2019findIcon(iconName, prefix).then(function (main) {2020var abstract = makeInlineSvgAbstract(_objectSpread({}, meta, {2021icons: {2022main: main,2023mask: emptyCanonicalIcon()2024},2025prefix: prefix,2026iconName: iconIdentifier,2027extra: extra,2028watchable: true2029}));2030var element = DOCUMENT.createElement('svg');2031
2032if (position === ':before') {2033node.insertBefore(element, node.firstChild);2034} else {2035node.appendChild(element);2036}2037
2038element.outerHTML = abstract.map(function (a) {2039return toHtml(a);2040}).join('\n');2041node.removeAttribute(pendingAttribute);2042resolve();2043}).catch(reject);2044} else {2045resolve();2046}2047} else {2048resolve();2049}2050});2051}2052
2053function replace(node) {2054return picked.all([replaceForPosition(node, ':before'), replaceForPosition(node, ':after')]);2055}2056
2057function processable(node) {2058return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');2059}2060
2061function searchPseudoElements (root) {2062if (!IS_DOM) return;2063return new picked(function (resolve, reject) {2064var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);2065var end = perf.begin('searchPseudoElements');2066disableObservation();2067picked.all(operations).then(function () {2068end();2069enableObservation();2070resolve();2071}).catch(function () {2072end();2073enableObservation();2074reject();2075});2076});2077}2078
2079var baseStyles = "svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.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{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.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-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;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}.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:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:.4;opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:1;opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}.fad.fa-inverse{color:#fff}";2080
2081function css () {2082var dfp = DEFAULT_FAMILY_PREFIX;2083var drc = DEFAULT_REPLACEMENT_CLASS;2084var fp = config.familyPrefix;2085var rc = config.replacementClass;2086var s = baseStyles;2087
2088if (fp !== dfp || rc !== drc) {2089var dPatt = new RegExp("\\.".concat(dfp, "\\-"), 'g');2090var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), 'g');2091var rPatt = new RegExp("\\.".concat(drc), 'g');2092s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));2093}2094
2095return s;2096}2097
2098var Library =2099/*#__PURE__*/2100function () {2101function Library() {2102_classCallCheck(this, Library);2103
2104this.definitions = {};2105}2106
2107_createClass(Library, [{2108key: "add",2109value: function add() {2110var _this = this;2111
2112for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {2113definitions[_key] = arguments[_key];2114}2115
2116var additions = definitions.reduce(this._pullDefinitions, {});2117Object.keys(additions).forEach(function (key) {2118_this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);2119defineIcons(key, additions[key]);2120build();2121});2122}2123}, {2124key: "reset",2125value: function reset() {2126this.definitions = {};2127}2128}, {2129key: "_pullDefinitions",2130value: function _pullDefinitions(additions, definition) {2131var normalized = definition.prefix && definition.iconName && definition.icon ? {21320: definition2133} : definition;2134Object.keys(normalized).map(function (key) {2135var _normalized$key = normalized[key],2136prefix = _normalized$key.prefix,2137iconName = _normalized$key.iconName,2138icon = _normalized$key.icon;2139if (!additions[prefix]) additions[prefix] = {};2140additions[prefix][iconName] = icon;2141});2142return additions;2143}2144}]);2145
2146return Library;2147}();2148
2149function ensureCss() {2150if (config.autoAddCss && !_cssInserted) {2151insertCss(css());2152
2153_cssInserted = true;2154}2155}2156
2157function apiObject(val, abstractCreator) {2158Object.defineProperty(val, 'abstract', {2159get: abstractCreator2160});2161Object.defineProperty(val, 'html', {2162get: function get() {2163return val.abstract.map(function (a) {2164return toHtml(a);2165});2166}2167});2168Object.defineProperty(val, 'node', {2169get: function get() {2170if (!IS_DOM) return;2171var container = DOCUMENT.createElement('div');2172container.innerHTML = val.html;2173return container.children;2174}2175});2176return val;2177}2178
2179function findIconDefinition(iconLookup) {2180var _iconLookup$prefix = iconLookup.prefix,2181prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,2182iconName = iconLookup.iconName;2183if (!iconName) return;2184return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);2185}2186
2187function resolveIcons(next) {2188return function (maybeIconDefinition) {2189var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};2190var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});2191var mask = params.mask;2192
2193if (mask) {2194mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});2195}2196
2197return next(iconDefinition, _objectSpread({}, params, {2198mask: mask2199}));2200};2201}2202
2203var library = new Library();2204var noAuto = function noAuto() {2205config.autoReplaceSvg = false;2206config.observeMutations = false;2207disconnect();2208};2209var _cssInserted = false;2210var dom = {2211i2svg: function i2svg() {2212var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};2213
2214if (IS_DOM) {2215ensureCss();2216var _params$node = params.node,2217node = _params$node === void 0 ? DOCUMENT : _params$node,2218_params$callback = params.callback,2219callback = _params$callback === void 0 ? function () {} : _params$callback;2220
2221if (config.searchPseudoElements) {2222searchPseudoElements(node);2223}2224
2225return onTree(node, callback);2226} else {2227return picked.reject('Operation requires a DOM of some kind.');2228}2229},2230css: css,2231insertCss: function insertCss$$1() {2232if (!_cssInserted) {2233insertCss(css());2234
2235_cssInserted = true;2236}2237},2238watch: function watch() {2239var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};2240var autoReplaceSvgRoot = params.autoReplaceSvgRoot,2241observeMutationsRoot = params.observeMutationsRoot;2242
2243if (config.autoReplaceSvg === false) {2244config.autoReplaceSvg = true;2245}2246
2247config.observeMutations = true;2248domready(function () {2249autoReplace({2250autoReplaceSvgRoot: autoReplaceSvgRoot2251});2252observe({2253treeCallback: onTree,2254nodeCallback: onNode,2255pseudoElementsCallback: searchPseudoElements,2256observeMutationsRoot: observeMutationsRoot2257});2258});2259}2260};2261var parse = {2262transform: function transform(transformString) {2263return parseTransformString(transformString);2264}2265};2266var icon = resolveIcons(function (iconDefinition) {2267var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};2268var _params$transform = params.transform,2269transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,2270_params$symbol = params.symbol,2271symbol = _params$symbol === void 0 ? false : _params$symbol,2272_params$mask = params.mask,2273mask = _params$mask === void 0 ? null : _params$mask,2274_params$title = params.title,2275title = _params$title === void 0 ? null : _params$title,2276_params$classes = params.classes,2277classes = _params$classes === void 0 ? [] : _params$classes,2278_params$attributes = params.attributes,2279attributes = _params$attributes === void 0 ? {} : _params$attributes,2280_params$styles = params.styles,2281styles = _params$styles === void 0 ? {} : _params$styles;2282if (!iconDefinition) return;2283var prefix = iconDefinition.prefix,2284iconName = iconDefinition.iconName,2285icon = iconDefinition.icon;2286return apiObject(_objectSpread({2287type: 'icon'2288}, iconDefinition), function () {2289ensureCss();2290
2291if (config.autoA11y) {2292if (title) {2293attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(nextUniqueId());2294} else {2295attributes['aria-hidden'] = 'true';2296attributes['focusable'] = 'false';2297}2298}2299
2300return makeInlineSvgAbstract({2301icons: {2302main: asFoundIcon(icon),2303mask: mask ? asFoundIcon(mask.icon) : {2304found: false,2305width: null,2306height: null,2307icon: {}2308}2309},2310prefix: prefix,2311iconName: iconName,2312transform: _objectSpread({}, meaninglessTransform, transform),2313symbol: symbol,2314title: title,2315extra: {2316attributes: attributes,2317styles: styles,2318classes: classes2319}2320});2321});2322});2323var text = function text(content) {2324var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};2325var _params$transform2 = params.transform,2326transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2,2327_params$title2 = params.title,2328title = _params$title2 === void 0 ? null : _params$title2,2329_params$classes2 = params.classes,2330classes = _params$classes2 === void 0 ? [] : _params$classes2,2331_params$attributes2 = params.attributes,2332attributes = _params$attributes2 === void 0 ? {} : _params$attributes2,2333_params$styles2 = params.styles,2334styles = _params$styles2 === void 0 ? {} : _params$styles2;2335return apiObject({2336type: 'text',2337content: content2338}, function () {2339ensureCss();2340return makeLayersTextAbstract({2341content: content,2342transform: _objectSpread({}, meaninglessTransform, transform),2343title: title,2344extra: {2345attributes: attributes,2346styles: styles,2347classes: ["".concat(config.familyPrefix, "-layers-text")].concat(_toConsumableArray(classes))2348}2349});2350});2351};2352var counter = function counter(content) {2353var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};2354var _params$title3 = params.title,2355title = _params$title3 === void 0 ? null : _params$title3,2356_params$classes3 = params.classes,2357classes = _params$classes3 === void 0 ? [] : _params$classes3,2358_params$attributes3 = params.attributes,2359attributes = _params$attributes3 === void 0 ? {} : _params$attributes3,2360_params$styles3 = params.styles,2361styles = _params$styles3 === void 0 ? {} : _params$styles3;2362return apiObject({2363type: 'counter',2364content: content2365}, function () {2366ensureCss();2367return makeLayersCounterAbstract({2368content: content.toString(),2369title: title,2370extra: {2371attributes: attributes,2372styles: styles,2373classes: ["".concat(config.familyPrefix, "-layers-counter")].concat(_toConsumableArray(classes))2374}2375});2376});2377};2378var layer = function layer(assembler) {2379var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};2380var _params$classes4 = params.classes,2381classes = _params$classes4 === void 0 ? [] : _params$classes4;2382return apiObject({2383type: 'layer'2384}, function () {2385ensureCss();2386var children = [];2387assembler(function (args) {2388Array.isArray(args) ? args.map(function (a) {2389children = children.concat(a.abstract);2390}) : children = children.concat(args.abstract);2391});2392return [{2393tag: 'span',2394attributes: {2395class: ["".concat(config.familyPrefix, "-layers")].concat(_toConsumableArray(classes)).join(' ')2396},2397children: children2398}];2399});2400};2401var api = {2402noAuto: noAuto,2403config: config,2404dom: dom,2405library: library,2406parse: parse,2407findIconDefinition: findIconDefinition,2408icon: icon,2409text: text,2410counter: counter,2411layer: layer,2412toHtml: toHtml2413};2414
2415var autoReplace = function autoReplace() {2416var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};2417var _params$autoReplaceSv = params.autoReplaceSvgRoot,2418autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;2419if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({2420node: autoReplaceSvgRoot2421});2422};2423
2424function bootstrap() {2425if (IS_BROWSER) {2426if (!WINDOW.FontAwesome) {2427WINDOW.FontAwesome = api;2428}2429
2430domready(function () {2431autoReplace();2432observe({2433treeCallback: onTree,2434nodeCallback: onNode,2435pseudoElementsCallback: searchPseudoElements2436});2437});2438}2439
2440namespace.hooks = _objectSpread({}, namespace.hooks, {2441addPack: function addPack(prefix, icons) {2442namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, icons);2443build();2444autoReplace();2445},2446addShims: function addShims(shims) {2447var _namespace$shims;2448
2449(_namespace$shims = namespace.shims).push.apply(_namespace$shims, _toConsumableArray(shims));2450
2451build();2452autoReplace();2453}2454});2455}2456
2457bunker(bootstrap);2458
2459}());2460