plugins.mjs 113 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072
  1. function ownKeys(object, enumerableOnly) {
  2. var keys = Object.keys(object);
  3. if (Object.getOwnPropertySymbols) {
  4. var symbols = Object.getOwnPropertySymbols(object);
  5. enumerableOnly && (symbols = symbols.filter(function (sym) {
  6. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  7. })), keys.push.apply(keys, symbols);
  8. }
  9. return keys;
  10. }
  11. function _objectSpread2(target) {
  12. for (var i = 1; i < arguments.length; i++) {
  13. var source = null != arguments[i] ? arguments[i] : {};
  14. i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
  15. _defineProperty(target, key, source[key]);
  16. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
  17. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  18. });
  19. }
  20. return target;
  21. }
  22. function _typeof(obj) {
  23. "@babel/helpers - typeof";
  24. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  25. return typeof obj;
  26. } : function (obj) {
  27. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  28. }, _typeof(obj);
  29. }
  30. function _wrapRegExp() {
  31. _wrapRegExp = function (re, groups) {
  32. return new BabelRegExp(re, void 0, groups);
  33. };
  34. var _super = RegExp.prototype,
  35. _groups = new WeakMap();
  36. function BabelRegExp(re, flags, groups) {
  37. var _this = new RegExp(re, flags);
  38. return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
  39. }
  40. function buildGroups(result, re) {
  41. var g = _groups.get(re);
  42. return Object.keys(g).reduce(function (groups, name) {
  43. return groups[name] = result[g[name]], groups;
  44. }, Object.create(null));
  45. }
  46. return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
  47. var result = _super.exec.call(this, str);
  48. return result && (result.groups = buildGroups(result, this)), result;
  49. }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
  50. if ("string" == typeof substitution) {
  51. var groups = _groups.get(this);
  52. return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
  53. return "$" + groups[name];
  54. }));
  55. }
  56. if ("function" == typeof substitution) {
  57. var _this = this;
  58. return _super[Symbol.replace].call(this, str, function () {
  59. var args = arguments;
  60. return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
  61. });
  62. }
  63. return _super[Symbol.replace].call(this, str, substitution);
  64. }, _wrapRegExp.apply(this, arguments);
  65. }
  66. function _classCallCheck(instance, Constructor) {
  67. if (!(instance instanceof Constructor)) {
  68. throw new TypeError("Cannot call a class as a function");
  69. }
  70. }
  71. function _defineProperties(target, props) {
  72. for (var i = 0; i < props.length; i++) {
  73. var descriptor = props[i];
  74. descriptor.enumerable = descriptor.enumerable || false;
  75. descriptor.configurable = true;
  76. if ("value" in descriptor) descriptor.writable = true;
  77. Object.defineProperty(target, descriptor.key, descriptor);
  78. }
  79. }
  80. function _createClass(Constructor, protoProps, staticProps) {
  81. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  82. if (staticProps) _defineProperties(Constructor, staticProps);
  83. Object.defineProperty(Constructor, "prototype", {
  84. writable: false
  85. });
  86. return Constructor;
  87. }
  88. function _defineProperty(obj, key, value) {
  89. if (key in obj) {
  90. Object.defineProperty(obj, key, {
  91. value: value,
  92. enumerable: true,
  93. configurable: true,
  94. writable: true
  95. });
  96. } else {
  97. obj[key] = value;
  98. }
  99. return obj;
  100. }
  101. function _inherits(subClass, superClass) {
  102. if (typeof superClass !== "function" && superClass !== null) {
  103. throw new TypeError("Super expression must either be null or a function");
  104. }
  105. subClass.prototype = Object.create(superClass && superClass.prototype, {
  106. constructor: {
  107. value: subClass,
  108. writable: true,
  109. configurable: true
  110. }
  111. });
  112. Object.defineProperty(subClass, "prototype", {
  113. writable: false
  114. });
  115. if (superClass) _setPrototypeOf(subClass, superClass);
  116. }
  117. function _setPrototypeOf(o, p) {
  118. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  119. o.__proto__ = p;
  120. return o;
  121. };
  122. return _setPrototypeOf(o, p);
  123. }
  124. function _slicedToArray(arr, i) {
  125. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  126. }
  127. function _toConsumableArray(arr) {
  128. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  129. }
  130. function _arrayWithoutHoles(arr) {
  131. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  132. }
  133. function _arrayWithHoles(arr) {
  134. if (Array.isArray(arr)) return arr;
  135. }
  136. function _iterableToArray(iter) {
  137. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  138. }
  139. function _iterableToArrayLimit(arr, i) {
  140. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  141. if (_i == null) return;
  142. var _arr = [];
  143. var _n = true;
  144. var _d = false;
  145. var _s, _e;
  146. try {
  147. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  148. _arr.push(_s.value);
  149. if (i && _arr.length === i) break;
  150. }
  151. } catch (err) {
  152. _d = true;
  153. _e = err;
  154. } finally {
  155. try {
  156. if (!_n && _i["return"] != null) _i["return"]();
  157. } finally {
  158. if (_d) throw _e;
  159. }
  160. }
  161. return _arr;
  162. }
  163. function _unsupportedIterableToArray(o, minLen) {
  164. if (!o) return;
  165. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  166. var n = Object.prototype.toString.call(o).slice(8, -1);
  167. if (n === "Object" && o.constructor) n = o.constructor.name;
  168. if (n === "Map" || n === "Set") return Array.from(o);
  169. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  170. }
  171. function _arrayLikeToArray(arr, len) {
  172. if (len == null || len > arr.length) len = arr.length;
  173. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  174. return arr2;
  175. }
  176. function _nonIterableSpread() {
  177. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  178. }
  179. function _nonIterableRest() {
  180. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  181. }
  182. var _plugins = [];
  183. var _hooks = {};
  184. var providers = {};
  185. var defaultProviderKeys = Object.keys(providers);
  186. function registerPlugins(nextPlugins, _ref) {
  187. var obj = _ref.mixoutsTo;
  188. _plugins = nextPlugins;
  189. _hooks = {};
  190. Object.keys(providers).forEach(function (k) {
  191. if (defaultProviderKeys.indexOf(k) === -1) {
  192. delete providers[k];
  193. }
  194. });
  195. _plugins.forEach(function (plugin) {
  196. var mixout = plugin.mixout ? plugin.mixout() : {};
  197. Object.keys(mixout).forEach(function (tk) {
  198. if (typeof mixout[tk] === 'function') {
  199. obj[tk] = mixout[tk];
  200. }
  201. if (_typeof(mixout[tk]) === 'object') {
  202. Object.keys(mixout[tk]).forEach(function (sk) {
  203. if (!obj[tk]) {
  204. obj[tk] = {};
  205. }
  206. obj[tk][sk] = mixout[tk][sk];
  207. });
  208. }
  209. });
  210. if (plugin.hooks) {
  211. var hooks = plugin.hooks();
  212. Object.keys(hooks).forEach(function (hook) {
  213. if (!_hooks[hook]) {
  214. _hooks[hook] = [];
  215. }
  216. _hooks[hook].push(hooks[hook]);
  217. });
  218. }
  219. if (plugin.provides) {
  220. plugin.provides(providers);
  221. }
  222. });
  223. return obj;
  224. }
  225. function chainHooks(hook, accumulator) {
  226. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  227. args[_key - 2] = arguments[_key];
  228. }
  229. var hookFns = _hooks[hook] || [];
  230. hookFns.forEach(function (hookFn) {
  231. accumulator = hookFn.apply(null, [accumulator].concat(args)); // eslint-disable-line no-useless-call
  232. });
  233. return accumulator;
  234. }
  235. function callHooks(hook) {
  236. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  237. args[_key2 - 1] = arguments[_key2];
  238. }
  239. var hookFns = _hooks[hook] || [];
  240. hookFns.forEach(function (hookFn) {
  241. hookFn.apply(null, args);
  242. });
  243. return undefined;
  244. }
  245. function callProvided() {
  246. var hook = arguments[0];
  247. var args = Array.prototype.slice.call(arguments, 1);
  248. return providers[hook] ? providers[hook].apply(null, args) : undefined;
  249. }
  250. var noop = function noop() {};
  251. var _WINDOW = {};
  252. var _DOCUMENT = {};
  253. var _MUTATION_OBSERVER = null;
  254. var _PERFORMANCE = {
  255. mark: noop,
  256. measure: noop
  257. };
  258. try {
  259. if (typeof window !== 'undefined') _WINDOW = window;
  260. if (typeof document !== 'undefined') _DOCUMENT = document;
  261. if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
  262. if (typeof performance !== 'undefined') _PERFORMANCE = performance;
  263. } catch (e) {}
  264. var _ref = _WINDOW.navigator || {},
  265. _ref$userAgent = _ref.userAgent,
  266. userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
  267. var WINDOW = _WINDOW;
  268. var DOCUMENT = _DOCUMENT;
  269. var MUTATION_OBSERVER = _MUTATION_OBSERVER;
  270. var PERFORMANCE = _PERFORMANCE;
  271. var IS_BROWSER = !!WINDOW.document;
  272. var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
  273. var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
  274. var _familyProxy, _familyProxy2, _familyProxy3, _familyProxy4, _familyProxy5;
  275. var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
  276. var UNITS_IN_GRID = 16;
  277. var DEFAULT_CSS_PREFIX = 'fa';
  278. var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
  279. var DATA_FA_I2SVG = 'data-fa-i2svg';
  280. var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
  281. var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
  282. var DATA_PREFIX = 'data-prefix';
  283. var DATA_ICON = 'data-icon';
  284. var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
  285. var MUTATION_APPROACH_ASYNC = 'async';
  286. var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
  287. var PRODUCTION = function () {
  288. try {
  289. return process.env.NODE_ENV === 'production';
  290. } catch (e) {
  291. return false;
  292. }
  293. }();
  294. var FAMILY_CLASSIC = 'classic';
  295. var FAMILY_SHARP = 'sharp';
  296. var FAMILIES = [FAMILY_CLASSIC, FAMILY_SHARP];
  297. function familyProxy(obj) {
  298. // Defaults to the classic family if family is not available
  299. return new Proxy(obj, {
  300. get: function get(target, prop) {
  301. return prop in target ? target[prop] : target[FAMILY_CLASSIC];
  302. }
  303. });
  304. }
  305. var PREFIX_TO_STYLE = familyProxy((_familyProxy = {}, _defineProperty(_familyProxy, FAMILY_CLASSIC, {
  306. 'fa': 'solid',
  307. 'fas': 'solid',
  308. 'fa-solid': 'solid',
  309. 'far': 'regular',
  310. 'fa-regular': 'regular',
  311. 'fal': 'light',
  312. 'fa-light': 'light',
  313. 'fat': 'thin',
  314. 'fa-thin': 'thin',
  315. 'fad': 'duotone',
  316. 'fa-duotone': 'duotone',
  317. 'fab': 'brands',
  318. 'fa-brands': 'brands',
  319. 'fak': 'kit',
  320. 'fakd': 'kit',
  321. 'fa-kit': 'kit',
  322. 'fa-kit-duotone': 'kit'
  323. }), _defineProperty(_familyProxy, FAMILY_SHARP, {
  324. 'fa': 'solid',
  325. 'fass': 'solid',
  326. 'fa-solid': 'solid',
  327. 'fasr': 'regular',
  328. 'fa-regular': 'regular',
  329. 'fasl': 'light',
  330. 'fa-light': 'light',
  331. 'fast': 'thin',
  332. 'fa-thin': 'thin'
  333. }), _familyProxy));
  334. var STYLE_TO_PREFIX = familyProxy((_familyProxy2 = {}, _defineProperty(_familyProxy2, FAMILY_CLASSIC, {
  335. solid: 'fas',
  336. regular: 'far',
  337. light: 'fal',
  338. thin: 'fat',
  339. duotone: 'fad',
  340. brands: 'fab',
  341. kit: 'fak'
  342. }), _defineProperty(_familyProxy2, FAMILY_SHARP, {
  343. solid: 'fass',
  344. regular: 'fasr',
  345. light: 'fasl',
  346. thin: 'fast'
  347. }), _familyProxy2));
  348. var PREFIX_TO_LONG_STYLE = familyProxy((_familyProxy3 = {}, _defineProperty(_familyProxy3, FAMILY_CLASSIC, {
  349. fab: 'fa-brands',
  350. fad: 'fa-duotone',
  351. fak: 'fa-kit',
  352. fal: 'fa-light',
  353. far: 'fa-regular',
  354. fas: 'fa-solid',
  355. fat: 'fa-thin'
  356. }), _defineProperty(_familyProxy3, FAMILY_SHARP, {
  357. fass: 'fa-solid',
  358. fasr: 'fa-regular',
  359. fasl: 'fa-light',
  360. fast: 'fa-thin'
  361. }), _familyProxy3));
  362. var LONG_STYLE_TO_PREFIX = familyProxy((_familyProxy4 = {}, _defineProperty(_familyProxy4, FAMILY_CLASSIC, {
  363. 'fa-brands': 'fab',
  364. 'fa-duotone': 'fad',
  365. 'fa-kit': 'fak',
  366. 'fa-light': 'fal',
  367. 'fa-regular': 'far',
  368. 'fa-solid': 'fas',
  369. 'fa-thin': 'fat'
  370. }), _defineProperty(_familyProxy4, FAMILY_SHARP, {
  371. 'fa-solid': 'fass',
  372. 'fa-regular': 'fasr',
  373. 'fa-light': 'fasl',
  374. 'fa-thin': 'fast'
  375. }), _familyProxy4));
  376. var ICON_SELECTION_SYNTAX_PATTERN = /fa(s|r|l|t|d|b|k|ss|sr|sl|st)?[\-\ ]/; // eslint-disable-line no-useless-escape
  377. var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
  378. var FONT_FAMILY_PATTERN = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i;
  379. var FONT_WEIGHT_TO_PREFIX = familyProxy((_familyProxy5 = {}, _defineProperty(_familyProxy5, FAMILY_CLASSIC, {
  380. 900: 'fas',
  381. 400: 'far',
  382. normal: 'far',
  383. 300: 'fal',
  384. 100: 'fat'
  385. }), _defineProperty(_familyProxy5, FAMILY_SHARP, {
  386. 900: 'fass',
  387. 400: 'fasr',
  388. 300: 'fasl',
  389. 100: 'fast'
  390. }), _familyProxy5));
  391. var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  392. var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
  393. var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
  394. var DUOTONE_CLASSES = {
  395. GROUP: 'duotone-group',
  396. SWAP_OPACITY: 'swap-opacity',
  397. PRIMARY: 'primary',
  398. SECONDARY: 'secondary'
  399. };
  400. var prefixes = new Set();
  401. Object.keys(STYLE_TO_PREFIX[FAMILY_CLASSIC]).map(prefixes.add.bind(prefixes));
  402. Object.keys(STYLE_TO_PREFIX[FAMILY_SHARP]).map(prefixes.add.bind(prefixes));
  403. var RESERVED_CLASSES = [].concat(FAMILIES, _toConsumableArray(prefixes), ['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', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY]).concat(oneToTen.map(function (n) {
  404. return "".concat(n, "x");
  405. })).concat(oneToTwenty.map(function (n) {
  406. return "w-".concat(n);
  407. }));
  408. var initial = WINDOW.FontAwesomeConfig || {};
  409. function getAttrConfig(attr) {
  410. var element = DOCUMENT.querySelector('script[' + attr + ']');
  411. if (element) {
  412. return element.getAttribute(attr);
  413. }
  414. }
  415. function coerce(val) {
  416. // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
  417. // We'll assume that this is an indication that it should be toggled to true
  418. if (val === '') return true;
  419. if (val === 'false') return false;
  420. if (val === 'true') return true;
  421. return val;
  422. }
  423. if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
  424. var 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']];
  425. attrs.forEach(function (_ref) {
  426. var _ref2 = _slicedToArray(_ref, 2),
  427. attr = _ref2[0],
  428. key = _ref2[1];
  429. var val = coerce(getAttrConfig(attr));
  430. if (val !== undefined && val !== null) {
  431. initial[key] = val;
  432. }
  433. });
  434. }
  435. var _default = {
  436. styleDefault: 'solid',
  437. familyDefault: 'classic',
  438. cssPrefix: DEFAULT_CSS_PREFIX,
  439. replacementClass: DEFAULT_REPLACEMENT_CLASS,
  440. autoReplaceSvg: true,
  441. autoAddCss: true,
  442. autoA11y: true,
  443. searchPseudoElements: false,
  444. observeMutations: true,
  445. mutateApproach: 'async',
  446. keepOriginalSource: true,
  447. measurePerformance: false,
  448. showMissingIcons: true
  449. }; // familyPrefix is deprecated but we must still support it if present
  450. if (initial.familyPrefix) {
  451. initial.cssPrefix = initial.familyPrefix;
  452. }
  453. var _config = _objectSpread2(_objectSpread2({}, _default), initial);
  454. if (!_config.autoReplaceSvg) _config.observeMutations = false;
  455. var config = {};
  456. Object.keys(_default).forEach(function (key) {
  457. Object.defineProperty(config, key, {
  458. enumerable: true,
  459. set: function set(val) {
  460. _config[key] = val;
  461. _onChangeCb.forEach(function (cb) {
  462. return cb(config);
  463. });
  464. },
  465. get: function get() {
  466. return _config[key];
  467. }
  468. });
  469. }); // familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0
  470. Object.defineProperty(config, 'familyPrefix', {
  471. enumerable: true,
  472. set: function set(val) {
  473. _config.cssPrefix = val;
  474. _onChangeCb.forEach(function (cb) {
  475. return cb(config);
  476. });
  477. },
  478. get: function get() {
  479. return _config.cssPrefix;
  480. }
  481. });
  482. WINDOW.FontAwesomeConfig = config;
  483. var _onChangeCb = [];
  484. function onChange(cb) {
  485. _onChangeCb.push(cb);
  486. return function () {
  487. _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
  488. };
  489. }
  490. var w = WINDOW || {};
  491. if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
  492. if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
  493. if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
  494. if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
  495. var namespace = w[NAMESPACE_IDENTIFIER];
  496. var functions = [];
  497. var listener = function listener() {
  498. DOCUMENT.removeEventListener('DOMContentLoaded', listener);
  499. loaded = 1;
  500. functions.map(function (fn) {
  501. return fn();
  502. });
  503. };
  504. var loaded = false;
  505. if (IS_DOM) {
  506. loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
  507. if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
  508. }
  509. function domready (fn) {
  510. if (!IS_DOM) return;
  511. loaded ? setTimeout(fn, 0) : functions.push(fn);
  512. }
  513. var d = UNITS_IN_GRID;
  514. var meaninglessTransform = {
  515. size: 16,
  516. x: 0,
  517. y: 0,
  518. rotate: 0,
  519. flipX: false,
  520. flipY: false
  521. };
  522. function insertCss(css) {
  523. if (!css || !IS_DOM) {
  524. return;
  525. }
  526. var style = DOCUMENT.createElement('style');
  527. style.setAttribute('type', 'text/css');
  528. style.innerHTML = css;
  529. var headChildren = DOCUMENT.head.childNodes;
  530. var beforeChild = null;
  531. for (var i = headChildren.length - 1; i > -1; i--) {
  532. var child = headChildren[i];
  533. var tagName = (child.tagName || '').toUpperCase();
  534. if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
  535. beforeChild = child;
  536. }
  537. }
  538. DOCUMENT.head.insertBefore(style, beforeChild);
  539. return css;
  540. }
  541. var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  542. function nextUniqueId() {
  543. var size = 12;
  544. var id = '';
  545. while (size-- > 0) {
  546. id += idPool[Math.random() * 62 | 0];
  547. }
  548. return id;
  549. }
  550. function toArray(obj) {
  551. var array = [];
  552. for (var i = (obj || []).length >>> 0; i--;) {
  553. array[i] = obj[i];
  554. }
  555. return array;
  556. }
  557. function classArray(node) {
  558. if (node.classList) {
  559. return toArray(node.classList);
  560. } else {
  561. return (node.getAttribute('class') || '').split(' ').filter(function (i) {
  562. return i;
  563. });
  564. }
  565. }
  566. function htmlEscape(str) {
  567. return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  568. }
  569. function joinAttributes(attributes) {
  570. return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
  571. return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
  572. }, '').trim();
  573. }
  574. function joinStyles(styles) {
  575. return Object.keys(styles || {}).reduce(function (acc, styleName) {
  576. return acc + "".concat(styleName, ": ").concat(styles[styleName].trim(), ";");
  577. }, '');
  578. }
  579. function transformIsMeaningful(transform) {
  580. return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
  581. }
  582. function transformForSvg(_ref) {
  583. var transform = _ref.transform,
  584. containerWidth = _ref.containerWidth,
  585. iconWidth = _ref.iconWidth;
  586. var outer = {
  587. transform: "translate(".concat(containerWidth / 2, " 256)")
  588. };
  589. var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
  590. var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
  591. var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
  592. var inner = {
  593. transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
  594. };
  595. var path = {
  596. transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
  597. };
  598. return {
  599. outer: outer,
  600. inner: inner,
  601. path: path
  602. };
  603. }
  604. function transformForCss(_ref2) {
  605. var transform = _ref2.transform,
  606. _ref2$width = _ref2.width,
  607. width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
  608. _ref2$height = _ref2.height,
  609. height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
  610. _ref2$startCentered = _ref2.startCentered,
  611. startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
  612. var val = '';
  613. if (startCentered && IS_IE) {
  614. val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
  615. } else if (startCentered) {
  616. val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
  617. } else {
  618. val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
  619. }
  620. val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
  621. val += "rotate(".concat(transform.rotate, "deg) ");
  622. return val;
  623. }
  624. function toHtml(abstractNodes) {
  625. var tag = abstractNodes.tag,
  626. _abstractNodes$attrib = abstractNodes.attributes,
  627. attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
  628. _abstractNodes$childr = abstractNodes.children,
  629. children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
  630. if (typeof abstractNodes === 'string') {
  631. return htmlEscape(abstractNodes);
  632. } else {
  633. return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
  634. }
  635. }
  636. function iconFromMapping(mapping, prefix, iconName) {
  637. if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
  638. return {
  639. prefix: prefix,
  640. iconName: iconName,
  641. icon: mapping[prefix][iconName]
  642. };
  643. }
  644. }
  645. /**
  646. * Internal helper to bind a function known to have 4 arguments
  647. * to a given context.
  648. */
  649. var bindInternal4 = function bindInternal4(func, thisContext) {
  650. return function (a, b, c, d) {
  651. return func.call(thisContext, a, b, c, d);
  652. };
  653. };
  654. /**
  655. * # Reduce
  656. *
  657. * A fast object `.reduce()` implementation.
  658. *
  659. * @param {Object} subject The object to reduce over.
  660. * @param {Function} fn The reducer function.
  661. * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
  662. * @param {Object} thisContext The context for the reducer.
  663. * @return {mixed} The final result.
  664. */
  665. var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
  666. var keys = Object.keys(subject),
  667. length = keys.length,
  668. iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
  669. i,
  670. key,
  671. result;
  672. if (initialValue === undefined) {
  673. i = 1;
  674. result = subject[keys[0]];
  675. } else {
  676. i = 0;
  677. result = initialValue;
  678. }
  679. for (; i < length; i++) {
  680. key = keys[i];
  681. result = iterator(result, subject[key], key, subject);
  682. }
  683. return result;
  684. };
  685. /**
  686. * ucs2decode() and codePointAt() are both works of Mathias Bynens and licensed under MIT
  687. *
  688. * Copyright Mathias Bynens <https://mathiasbynens.be/>
  689. * Permission is hereby granted, free of charge, to any person obtaining
  690. * a copy of this software and associated documentation files (the
  691. * "Software"), to deal in the Software without restriction, including
  692. * without limitation the rights to use, copy, modify, merge, publish,
  693. * distribute, sublicense, and/or sell copies of the Software, and to
  694. * permit persons to whom the Software is furnished to do so, subject to
  695. * the following conditions:
  696. * The above copyright notice and this permission notice shall be
  697. * included in all copies or substantial portions of the Software.
  698. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  699. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  700. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  701. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  702. * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  703. * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  704. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  705. */
  706. function ucs2decode(string) {
  707. var output = [];
  708. var counter = 0;
  709. var length = string.length;
  710. while (counter < length) {
  711. var value = string.charCodeAt(counter++);
  712. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  713. var extra = string.charCodeAt(counter++);
  714. if ((extra & 0xFC00) == 0xDC00) {
  715. // eslint-disable-line eqeqeq
  716. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  717. } else {
  718. output.push(value);
  719. counter--;
  720. }
  721. } else {
  722. output.push(value);
  723. }
  724. }
  725. return output;
  726. }
  727. function toHex(unicode) {
  728. var decoded = ucs2decode(unicode);
  729. return decoded.length === 1 ? decoded[0].toString(16) : null;
  730. }
  731. function codePointAt(string, index) {
  732. var size = string.length;
  733. var first = string.charCodeAt(index);
  734. var second;
  735. if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
  736. second = string.charCodeAt(index + 1);
  737. if (second >= 0xDC00 && second <= 0xDFFF) {
  738. return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
  739. }
  740. }
  741. return first;
  742. }
  743. function normalizeIcons(icons) {
  744. return Object.keys(icons).reduce(function (acc, iconName) {
  745. var icon = icons[iconName];
  746. var expanded = !!icon.icon;
  747. if (expanded) {
  748. acc[icon.iconName] = icon.icon;
  749. } else {
  750. acc[iconName] = icon;
  751. }
  752. return acc;
  753. }, {});
  754. }
  755. function defineIcons(prefix, icons) {
  756. var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  757. var _params$skipHooks = params.skipHooks,
  758. skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
  759. var normalized = normalizeIcons(icons);
  760. if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
  761. namespace.hooks.addPack(prefix, normalizeIcons(icons));
  762. } else {
  763. namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);
  764. }
  765. /**
  766. * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
  767. * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
  768. * for `fas` so we'll ease the upgrade process for our users by automatically defining
  769. * this as well.
  770. */
  771. if (prefix === 'fas') {
  772. defineIcons('fa', icons);
  773. }
  774. }
  775. var duotonePathRe = [/*#__PURE__*/_wrapRegExp(/path d="((?:(?!")[\s\S])+)".*path d="((?:(?!")[\s\S])+)"/, {
  776. d1: 1,
  777. d2: 2
  778. }), /*#__PURE__*/_wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)".*path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
  779. cls1: 1,
  780. d1: 2,
  781. cls2: 3,
  782. d2: 4
  783. }), /*#__PURE__*/_wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
  784. cls1: 1,
  785. d1: 2
  786. })];
  787. var _LONG_STYLE, _PREFIXES, _PREFIXES_FOR_FAMILY;
  788. var styles = namespace.styles,
  789. shims = namespace.shims;
  790. var LONG_STYLE = (_LONG_STYLE = {}, _defineProperty(_LONG_STYLE, FAMILY_CLASSIC, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])), _defineProperty(_LONG_STYLE, FAMILY_SHARP, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])), _LONG_STYLE);
  791. var _defaultUsablePrefix = null;
  792. var _byUnicode = {};
  793. var _byLigature = {};
  794. var _byOldName = {};
  795. var _byOldUnicode = {};
  796. var _byAlias = {};
  797. var PREFIXES = (_PREFIXES = {}, _defineProperty(_PREFIXES, FAMILY_CLASSIC, Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC])), _defineProperty(_PREFIXES, FAMILY_SHARP, Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP])), _PREFIXES);
  798. function isReserved(name) {
  799. return ~RESERVED_CLASSES.indexOf(name);
  800. }
  801. function getIconName(cssPrefix, cls) {
  802. var parts = cls.split('-');
  803. var prefix = parts[0];
  804. var iconName = parts.slice(1).join('-');
  805. if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
  806. return iconName;
  807. } else {
  808. return null;
  809. }
  810. }
  811. var build = function build() {
  812. var lookup = function lookup(reducer) {
  813. return reduce(styles, function (o, style, prefix) {
  814. o[prefix] = reduce(style, reducer, {});
  815. return o;
  816. }, {});
  817. };
  818. _byUnicode = lookup(function (acc, icon, iconName) {
  819. if (icon[3]) {
  820. acc[icon[3]] = iconName;
  821. }
  822. if (icon[2]) {
  823. var aliases = icon[2].filter(function (a) {
  824. return typeof a === 'number';
  825. });
  826. aliases.forEach(function (alias) {
  827. acc[alias.toString(16)] = iconName;
  828. });
  829. }
  830. return acc;
  831. });
  832. _byLigature = lookup(function (acc, icon, iconName) {
  833. acc[iconName] = iconName;
  834. if (icon[2]) {
  835. var aliases = icon[2].filter(function (a) {
  836. return typeof a === 'string';
  837. });
  838. aliases.forEach(function (alias) {
  839. acc[alias] = iconName;
  840. });
  841. }
  842. return acc;
  843. });
  844. _byAlias = lookup(function (acc, icon, iconName) {
  845. var aliases = icon[2];
  846. acc[iconName] = iconName;
  847. aliases.forEach(function (alias) {
  848. acc[alias] = iconName;
  849. });
  850. return acc;
  851. }); // If we have a Kit, we can't determine if regular is available since we
  852. // could be auto-fetching it. We'll have to assume that it is available.
  853. var hasRegular = 'far' in styles || config.autoFetchSvg;
  854. var shimLookups = reduce(shims, function (acc, shim) {
  855. var maybeNameMaybeUnicode = shim[0];
  856. var prefix = shim[1];
  857. var iconName = shim[2];
  858. if (prefix === 'far' && !hasRegular) {
  859. prefix = 'fas';
  860. }
  861. if (typeof maybeNameMaybeUnicode === 'string') {
  862. acc.names[maybeNameMaybeUnicode] = {
  863. prefix: prefix,
  864. iconName: iconName
  865. };
  866. }
  867. if (typeof maybeNameMaybeUnicode === 'number') {
  868. acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
  869. prefix: prefix,
  870. iconName: iconName
  871. };
  872. }
  873. return acc;
  874. }, {
  875. names: {},
  876. unicodes: {}
  877. });
  878. _byOldName = shimLookups.names;
  879. _byOldUnicode = shimLookups.unicodes;
  880. _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
  881. family: config.familyDefault
  882. });
  883. };
  884. onChange(function (c) {
  885. _defaultUsablePrefix = getCanonicalPrefix(c.styleDefault, {
  886. family: config.familyDefault
  887. });
  888. });
  889. build();
  890. function byUnicode(prefix, unicode) {
  891. return (_byUnicode[prefix] || {})[unicode];
  892. }
  893. function byLigature(prefix, ligature) {
  894. return (_byLigature[prefix] || {})[ligature];
  895. }
  896. function byAlias(prefix, alias) {
  897. return (_byAlias[prefix] || {})[alias];
  898. }
  899. function byOldName(name) {
  900. return _byOldName[name] || {
  901. prefix: null,
  902. iconName: null
  903. };
  904. }
  905. function byOldUnicode(unicode) {
  906. var oldUnicode = _byOldUnicode[unicode];
  907. var newUnicode = byUnicode('fas', unicode);
  908. return oldUnicode || (newUnicode ? {
  909. prefix: 'fas',
  910. iconName: newUnicode
  911. } : null) || {
  912. prefix: null,
  913. iconName: null
  914. };
  915. }
  916. function getDefaultUsablePrefix() {
  917. return _defaultUsablePrefix;
  918. }
  919. var emptyCanonicalIcon = function emptyCanonicalIcon() {
  920. return {
  921. prefix: null,
  922. iconName: null,
  923. rest: []
  924. };
  925. };
  926. function getCanonicalPrefix(styleOrPrefix) {
  927. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  928. var _params$family = params.family,
  929. family = _params$family === void 0 ? FAMILY_CLASSIC : _params$family;
  930. var style = PREFIX_TO_STYLE[family][styleOrPrefix];
  931. var prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
  932. var defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
  933. return prefix || defined || null;
  934. }
  935. var PREFIXES_FOR_FAMILY = (_PREFIXES_FOR_FAMILY = {}, _defineProperty(_PREFIXES_FOR_FAMILY, FAMILY_CLASSIC, Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])), _defineProperty(_PREFIXES_FOR_FAMILY, FAMILY_SHARP, Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])), _PREFIXES_FOR_FAMILY);
  936. function getCanonicalIcon(values) {
  937. var _famProps;
  938. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  939. var _params$skipLookups = params.skipLookups,
  940. skipLookups = _params$skipLookups === void 0 ? false : _params$skipLookups;
  941. var famProps = (_famProps = {}, _defineProperty(_famProps, FAMILY_CLASSIC, "".concat(config.cssPrefix, "-").concat(FAMILY_CLASSIC)), _defineProperty(_famProps, FAMILY_SHARP, "".concat(config.cssPrefix, "-").concat(FAMILY_SHARP)), _famProps);
  942. var givenPrefix = null;
  943. var family = FAMILY_CLASSIC;
  944. if (values.includes(famProps[FAMILY_CLASSIC]) || values.some(function (v) {
  945. return PREFIXES_FOR_FAMILY[FAMILY_CLASSIC].includes(v);
  946. })) {
  947. family = FAMILY_CLASSIC;
  948. }
  949. if (values.includes(famProps[FAMILY_SHARP]) || values.some(function (v) {
  950. return PREFIXES_FOR_FAMILY[FAMILY_SHARP].includes(v);
  951. })) {
  952. family = FAMILY_SHARP;
  953. }
  954. var canonical = values.reduce(function (acc, cls) {
  955. var iconName = getIconName(config.cssPrefix, cls);
  956. if (styles[cls]) {
  957. cls = LONG_STYLE[family].includes(cls) ? LONG_STYLE_TO_PREFIX[family][cls] : cls;
  958. givenPrefix = cls;
  959. acc.prefix = cls;
  960. } else if (PREFIXES[family].indexOf(cls) > -1) {
  961. givenPrefix = cls;
  962. acc.prefix = getCanonicalPrefix(cls, {
  963. family: family
  964. });
  965. } else if (iconName) {
  966. acc.iconName = iconName;
  967. } else if (cls !== config.replacementClass && cls !== famProps[FAMILY_CLASSIC] && cls !== famProps[FAMILY_SHARP]) {
  968. acc.rest.push(cls);
  969. }
  970. if (!skipLookups && acc.prefix && acc.iconName) {
  971. var shim = givenPrefix === 'fa' ? byOldName(acc.iconName) : {};
  972. var aliasIconName = byAlias(acc.prefix, acc.iconName);
  973. if (shim.prefix) {
  974. givenPrefix = null;
  975. }
  976. acc.iconName = shim.iconName || aliasIconName || acc.iconName;
  977. acc.prefix = shim.prefix || acc.prefix;
  978. if (acc.prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
  979. // Allow a fallback from the regular style to solid if regular is not available
  980. // but only if we aren't auto-fetching SVGs
  981. acc.prefix = 'fas';
  982. }
  983. }
  984. return acc;
  985. }, emptyCanonicalIcon());
  986. if (values.includes('fa-brands') || values.includes('fab')) {
  987. canonical.prefix = 'fab';
  988. }
  989. if (values.includes('fa-duotone') || values.includes('fad')) {
  990. canonical.prefix = 'fad';
  991. }
  992. if (!canonical.prefix && family === FAMILY_SHARP && (styles['fass'] || config.autoFetchSvg)) {
  993. canonical.prefix = 'fass';
  994. canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;
  995. }
  996. if (canonical.prefix === 'fa' || givenPrefix === 'fa') {
  997. // The fa prefix is not canonical. So if it has made it through until this point
  998. // we will shift it to the correct prefix.
  999. canonical.prefix = getDefaultUsablePrefix() || 'fas';
  1000. }
  1001. return canonical;
  1002. }
  1003. var Library = /*#__PURE__*/function () {
  1004. function Library() {
  1005. _classCallCheck(this, Library);
  1006. this.definitions = {};
  1007. }
  1008. _createClass(Library, [{
  1009. key: "add",
  1010. value: function add() {
  1011. var _this = this;
  1012. for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
  1013. definitions[_key] = arguments[_key];
  1014. }
  1015. var additions = definitions.reduce(this._pullDefinitions, {});
  1016. Object.keys(additions).forEach(function (key) {
  1017. _this.definitions[key] = _objectSpread2(_objectSpread2({}, _this.definitions[key] || {}), additions[key]);
  1018. defineIcons(key, additions[key]); // TODO can we stop doing this? We can't get the icons by 'fa-solid' any longer so this probably needs to change
  1019. var longPrefix = PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC][key];
  1020. if (longPrefix) defineIcons(longPrefix, additions[key]);
  1021. build();
  1022. });
  1023. }
  1024. }, {
  1025. key: "reset",
  1026. value: function reset() {
  1027. this.definitions = {};
  1028. }
  1029. }, {
  1030. key: "_pullDefinitions",
  1031. value: function _pullDefinitions(additions, definition) {
  1032. var normalized = definition.prefix && definition.iconName && definition.icon ? {
  1033. 0: definition
  1034. } : definition;
  1035. Object.keys(normalized).map(function (key) {
  1036. var _normalized$key = normalized[key],
  1037. prefix = _normalized$key.prefix,
  1038. iconName = _normalized$key.iconName,
  1039. icon = _normalized$key.icon;
  1040. var aliases = icon[2];
  1041. if (!additions[prefix]) additions[prefix] = {};
  1042. if (aliases.length > 0) {
  1043. aliases.forEach(function (alias) {
  1044. if (typeof alias === 'string') {
  1045. additions[prefix][alias] = icon;
  1046. }
  1047. });
  1048. }
  1049. additions[prefix][iconName] = icon;
  1050. });
  1051. return additions;
  1052. }
  1053. }]);
  1054. return Library;
  1055. }();
  1056. function findIconDefinition(iconLookup) {
  1057. if (iconLookup.prefix === 'fa') {
  1058. iconLookup.prefix = 'fas';
  1059. }
  1060. var iconName = iconLookup.iconName;
  1061. var prefix = iconLookup.prefix || getDefaultUsablePrefix();
  1062. if (!iconName) return;
  1063. iconName = byAlias(prefix, iconName) || iconName;
  1064. return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
  1065. }
  1066. var library = new Library();
  1067. var noAuto = function noAuto() {
  1068. config.autoReplaceSvg = false;
  1069. config.observeMutations = false;
  1070. callHooks('noAuto');
  1071. };
  1072. var dom = {
  1073. i2svg: function i2svg() {
  1074. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1075. if (IS_DOM) {
  1076. callHooks('beforeI2svg', params);
  1077. callProvided('pseudoElements2svg', params);
  1078. return callProvided('i2svg', params);
  1079. } else {
  1080. return Promise.reject('Operation requires a DOM of some kind.');
  1081. }
  1082. },
  1083. watch: function watch() {
  1084. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1085. var autoReplaceSvgRoot = params.autoReplaceSvgRoot;
  1086. if (config.autoReplaceSvg === false) {
  1087. config.autoReplaceSvg = true;
  1088. }
  1089. config.observeMutations = true;
  1090. domready(function () {
  1091. autoReplace({
  1092. autoReplaceSvgRoot: autoReplaceSvgRoot
  1093. });
  1094. callHooks('watch', params);
  1095. });
  1096. }
  1097. };
  1098. var parse = {
  1099. icon: function icon(_icon) {
  1100. if (_icon === null) {
  1101. return null;
  1102. }
  1103. if (_typeof(_icon) === 'object' && _icon.prefix && _icon.iconName) {
  1104. return {
  1105. prefix: _icon.prefix,
  1106. iconName: byAlias(_icon.prefix, _icon.iconName) || _icon.iconName
  1107. };
  1108. }
  1109. if (Array.isArray(_icon) && _icon.length === 2) {
  1110. var iconName = _icon[1].indexOf('fa-') === 0 ? _icon[1].slice(3) : _icon[1];
  1111. var prefix = getCanonicalPrefix(_icon[0]);
  1112. return {
  1113. prefix: prefix,
  1114. iconName: byAlias(prefix, iconName) || iconName
  1115. };
  1116. }
  1117. if (typeof _icon === 'string' && (_icon.indexOf("".concat(config.cssPrefix, "-")) > -1 || _icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {
  1118. var canonicalIcon = getCanonicalIcon(_icon.split(' '), {
  1119. skipLookups: true
  1120. });
  1121. return {
  1122. prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),
  1123. iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName
  1124. };
  1125. }
  1126. if (typeof _icon === 'string') {
  1127. var _prefix = getDefaultUsablePrefix();
  1128. return {
  1129. prefix: _prefix,
  1130. iconName: byAlias(_prefix, _icon) || _icon
  1131. };
  1132. }
  1133. }
  1134. };
  1135. var api = {
  1136. noAuto: noAuto,
  1137. config: config,
  1138. dom: dom,
  1139. parse: parse,
  1140. library: library,
  1141. findIconDefinition: findIconDefinition,
  1142. toHtml: toHtml
  1143. };
  1144. var autoReplace = function autoReplace() {
  1145. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1146. var _params$autoReplaceSv = params.autoReplaceSvgRoot,
  1147. autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
  1148. if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
  1149. node: autoReplaceSvgRoot
  1150. });
  1151. };
  1152. var baseStyles = ":root, :host {\n --fa-font-solid: normal 900 1em/1 \"Font Awesome 6 Solid\";\n --fa-font-regular: normal 400 1em/1 \"Font Awesome 6 Regular\";\n --fa-font-light: normal 300 1em/1 \"Font Awesome 6 Light\";\n --fa-font-thin: normal 100 1em/1 \"Font Awesome 6 Thin\";\n --fa-font-duotone: normal 900 1em/1 \"Font Awesome 6 Duotone\";\n --fa-font-sharp-solid: normal 900 1em/1 \"Font Awesome 6 Sharp\";\n --fa-font-sharp-regular: normal 400 1em/1 \"Font Awesome 6 Sharp\";\n --fa-font-sharp-light: normal 300 1em/1 \"Font Awesome 6 Sharp\";\n --fa-font-sharp-thin: normal 100 1em/1 \"Font Awesome 6 Sharp\";\n --fa-font-brands: normal 400 1em/1 \"Font Awesome 6 Brands\";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}";
  1153. function css() {
  1154. var dcp = DEFAULT_CSS_PREFIX;
  1155. var drc = DEFAULT_REPLACEMENT_CLASS;
  1156. var fp = config.cssPrefix;
  1157. var rc = config.replacementClass;
  1158. var s = baseStyles;
  1159. if (fp !== dcp || rc !== drc) {
  1160. var dPatt = new RegExp("\\.".concat(dcp, "\\-"), 'g');
  1161. var customPropPatt = new RegExp("\\--".concat(dcp, "\\-"), 'g');
  1162. var rPatt = new RegExp("\\.".concat(drc), 'g');
  1163. s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
  1164. }
  1165. return s;
  1166. }
  1167. var _cssInserted = false;
  1168. function ensureCss() {
  1169. if (config.autoAddCss && !_cssInserted) {
  1170. insertCss(css());
  1171. _cssInserted = true;
  1172. }
  1173. }
  1174. var injectCss = {
  1175. mixout: function mixout() {
  1176. return {
  1177. dom: {
  1178. css: css,
  1179. insertCss: ensureCss
  1180. }
  1181. };
  1182. },
  1183. hooks: function hooks() {
  1184. return {
  1185. beforeDOMElementCreation: function beforeDOMElementCreation() {
  1186. ensureCss();
  1187. },
  1188. beforeI2svg: function beforeI2svg() {
  1189. ensureCss();
  1190. }
  1191. };
  1192. }
  1193. };
  1194. function domVariants(val, abstractCreator) {
  1195. Object.defineProperty(val, 'abstract', {
  1196. get: abstractCreator
  1197. });
  1198. Object.defineProperty(val, 'html', {
  1199. get: function get() {
  1200. return val.abstract.map(function (a) {
  1201. return toHtml(a);
  1202. });
  1203. }
  1204. });
  1205. Object.defineProperty(val, 'node', {
  1206. get: function get() {
  1207. if (!IS_DOM) return;
  1208. var container = DOCUMENT.createElement('div');
  1209. container.innerHTML = val.html;
  1210. return container.children;
  1211. }
  1212. });
  1213. return val;
  1214. }
  1215. function asIcon (_ref) {
  1216. var children = _ref.children,
  1217. main = _ref.main,
  1218. mask = _ref.mask,
  1219. attributes = _ref.attributes,
  1220. styles = _ref.styles,
  1221. transform = _ref.transform;
  1222. if (transformIsMeaningful(transform) && main.found && !mask.found) {
  1223. var width = main.width,
  1224. height = main.height;
  1225. var offset = {
  1226. x: width / height / 2,
  1227. y: 0.5
  1228. };
  1229. attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {
  1230. 'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
  1231. }));
  1232. }
  1233. return [{
  1234. tag: 'svg',
  1235. attributes: attributes,
  1236. children: children
  1237. }];
  1238. }
  1239. function asSymbol (_ref) {
  1240. var prefix = _ref.prefix,
  1241. iconName = _ref.iconName,
  1242. children = _ref.children,
  1243. attributes = _ref.attributes,
  1244. symbol = _ref.symbol;
  1245. var id = symbol === true ? "".concat(prefix, "-").concat(config.cssPrefix, "-").concat(iconName) : symbol;
  1246. return [{
  1247. tag: 'svg',
  1248. attributes: {
  1249. style: 'display: none;'
  1250. },
  1251. children: [{
  1252. tag: 'symbol',
  1253. attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {
  1254. id: id
  1255. }),
  1256. children: children
  1257. }]
  1258. }];
  1259. }
  1260. function makeInlineSvgAbstract(params) {
  1261. var _params$icons = params.icons,
  1262. main = _params$icons.main,
  1263. mask = _params$icons.mask,
  1264. prefix = params.prefix,
  1265. iconName = params.iconName,
  1266. transform = params.transform,
  1267. symbol = params.symbol,
  1268. title = params.title,
  1269. maskId = params.maskId,
  1270. titleId = params.titleId,
  1271. extra = params.extra,
  1272. _params$watchable = params.watchable,
  1273. watchable = _params$watchable === void 0 ? false : _params$watchable;
  1274. var _ref = mask.found ? mask : main,
  1275. width = _ref.width,
  1276. height = _ref.height;
  1277. var isUploadedIcon = prefix === 'fak';
  1278. var attrClass = [config.replacementClass, iconName ? "".concat(config.cssPrefix, "-").concat(iconName) : ''].filter(function (c) {
  1279. return extra.classes.indexOf(c) === -1;
  1280. }).filter(function (c) {
  1281. return c !== '' || !!c;
  1282. }).concat(extra.classes).join(' ');
  1283. var content = {
  1284. children: [],
  1285. attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {
  1286. 'data-prefix': prefix,
  1287. 'data-icon': iconName,
  1288. 'class': attrClass,
  1289. 'role': extra.attributes.role || 'img',
  1290. 'xmlns': 'http://www.w3.org/2000/svg',
  1291. 'viewBox': "0 0 ".concat(width, " ").concat(height)
  1292. })
  1293. };
  1294. var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
  1295. width: "".concat(width / height * 16 * 0.0625, "em")
  1296. } : {};
  1297. if (watchable) {
  1298. content.attributes[DATA_FA_I2SVG] = '';
  1299. }
  1300. if (title) {
  1301. content.children.push({
  1302. tag: 'title',
  1303. attributes: {
  1304. id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
  1305. },
  1306. children: [title]
  1307. });
  1308. delete content.attributes.title;
  1309. }
  1310. var args = _objectSpread2(_objectSpread2({}, content), {}, {
  1311. prefix: prefix,
  1312. iconName: iconName,
  1313. main: main,
  1314. mask: mask,
  1315. maskId: maskId,
  1316. transform: transform,
  1317. symbol: symbol,
  1318. styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles)
  1319. });
  1320. var _ref2 = mask.found && main.found ? callProvided('generateAbstractMask', args) || {
  1321. children: [],
  1322. attributes: {}
  1323. } : callProvided('generateAbstractIcon', args) || {
  1324. children: [],
  1325. attributes: {}
  1326. },
  1327. children = _ref2.children,
  1328. attributes = _ref2.attributes;
  1329. args.children = children;
  1330. args.attributes = attributes;
  1331. if (symbol) {
  1332. return asSymbol(args);
  1333. } else {
  1334. return asIcon(args);
  1335. }
  1336. }
  1337. function makeLayersTextAbstract(params) {
  1338. var content = params.content,
  1339. width = params.width,
  1340. height = params.height,
  1341. transform = params.transform,
  1342. title = params.title,
  1343. extra = params.extra,
  1344. _params$watchable2 = params.watchable,
  1345. watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
  1346. var attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
  1347. 'title': title
  1348. } : {}), {}, {
  1349. 'class': extra.classes.join(' ')
  1350. });
  1351. if (watchable) {
  1352. attributes[DATA_FA_I2SVG] = '';
  1353. }
  1354. var styles = _objectSpread2({}, extra.styles);
  1355. if (transformIsMeaningful(transform)) {
  1356. styles['transform'] = transformForCss({
  1357. transform: transform,
  1358. startCentered: true,
  1359. width: width,
  1360. height: height
  1361. });
  1362. styles['-webkit-transform'] = styles['transform'];
  1363. }
  1364. var styleString = joinStyles(styles);
  1365. if (styleString.length > 0) {
  1366. attributes['style'] = styleString;
  1367. }
  1368. var val = [];
  1369. val.push({
  1370. tag: 'span',
  1371. attributes: attributes,
  1372. children: [content]
  1373. });
  1374. if (title) {
  1375. val.push({
  1376. tag: 'span',
  1377. attributes: {
  1378. class: 'sr-only'
  1379. },
  1380. children: [title]
  1381. });
  1382. }
  1383. return val;
  1384. }
  1385. function makeLayersCounterAbstract(params) {
  1386. var content = params.content,
  1387. title = params.title,
  1388. extra = params.extra;
  1389. var attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
  1390. 'title': title
  1391. } : {}), {}, {
  1392. 'class': extra.classes.join(' ')
  1393. });
  1394. var styleString = joinStyles(extra.styles);
  1395. if (styleString.length > 0) {
  1396. attributes['style'] = styleString;
  1397. }
  1398. var val = [];
  1399. val.push({
  1400. tag: 'span',
  1401. attributes: attributes,
  1402. children: [content]
  1403. });
  1404. if (title) {
  1405. val.push({
  1406. tag: 'span',
  1407. attributes: {
  1408. class: 'sr-only'
  1409. },
  1410. children: [title]
  1411. });
  1412. }
  1413. return val;
  1414. }
  1415. var styles$1 = namespace.styles;
  1416. function asFoundIcon(icon) {
  1417. var width = icon[0];
  1418. var height = icon[1];
  1419. var _icon$slice = icon.slice(4),
  1420. _icon$slice2 = _slicedToArray(_icon$slice, 1),
  1421. vectorData = _icon$slice2[0];
  1422. var element = null;
  1423. if (Array.isArray(vectorData)) {
  1424. element = {
  1425. tag: 'g',
  1426. attributes: {
  1427. class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
  1428. },
  1429. children: [{
  1430. tag: 'path',
  1431. attributes: {
  1432. class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
  1433. fill: 'currentColor',
  1434. d: vectorData[0]
  1435. }
  1436. }, {
  1437. tag: 'path',
  1438. attributes: {
  1439. class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
  1440. fill: 'currentColor',
  1441. d: vectorData[1]
  1442. }
  1443. }]
  1444. };
  1445. } else {
  1446. element = {
  1447. tag: 'path',
  1448. attributes: {
  1449. fill: 'currentColor',
  1450. d: vectorData
  1451. }
  1452. };
  1453. }
  1454. return {
  1455. found: true,
  1456. width: width,
  1457. height: height,
  1458. icon: element
  1459. };
  1460. }
  1461. var missingIconResolutionMixin = {
  1462. found: false,
  1463. width: 512,
  1464. height: 512
  1465. };
  1466. function maybeNotifyMissing(iconName, prefix) {
  1467. if (!PRODUCTION && !config.showMissingIcons && iconName) {
  1468. console.error("Icon with name \"".concat(iconName, "\" and prefix \"").concat(prefix, "\" is missing."));
  1469. }
  1470. }
  1471. function findIcon(iconName, prefix) {
  1472. var givenPrefix = prefix;
  1473. if (prefix === 'fa' && config.styleDefault !== null) {
  1474. prefix = getDefaultUsablePrefix();
  1475. }
  1476. return new Promise(function (resolve, reject) {
  1477. var val = {
  1478. found: false,
  1479. width: 512,
  1480. height: 512,
  1481. icon: callProvided('missingIconAbstract') || {}
  1482. };
  1483. if (givenPrefix === 'fa') {
  1484. var shim = byOldName(iconName) || {};
  1485. iconName = shim.iconName || iconName;
  1486. prefix = shim.prefix || prefix;
  1487. }
  1488. if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
  1489. var icon = styles$1[prefix][iconName];
  1490. return resolve(asFoundIcon(icon));
  1491. }
  1492. maybeNotifyMissing(iconName, prefix);
  1493. resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {
  1494. icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}
  1495. }));
  1496. });
  1497. }
  1498. var noop$1 = function noop() {};
  1499. var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
  1500. mark: noop$1,
  1501. measure: noop$1
  1502. };
  1503. var preamble = "FA \"6.5.0\"";
  1504. var begin = function begin(name) {
  1505. p.mark("".concat(preamble, " ").concat(name, " begins"));
  1506. return function () {
  1507. return end(name);
  1508. };
  1509. };
  1510. var end = function end(name) {
  1511. p.mark("".concat(preamble, " ").concat(name, " ends"));
  1512. p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
  1513. };
  1514. var perf = {
  1515. begin: begin,
  1516. end: end
  1517. };
  1518. var noop$2 = function noop() {};
  1519. function isWatched(node) {
  1520. var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
  1521. return typeof i2svg === 'string';
  1522. }
  1523. function hasPrefixAndIcon(node) {
  1524. var prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
  1525. var icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
  1526. return prefix && icon;
  1527. }
  1528. function hasBeenReplaced(node) {
  1529. return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);
  1530. }
  1531. function getMutator() {
  1532. if (config.autoReplaceSvg === true) {
  1533. return mutators.replace;
  1534. }
  1535. var mutator = mutators[config.autoReplaceSvg];
  1536. return mutator || mutators.replace;
  1537. }
  1538. function createElementNS(tag) {
  1539. return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);
  1540. }
  1541. function createElement(tag) {
  1542. return DOCUMENT.createElement(tag);
  1543. }
  1544. function convertSVG(abstractObj) {
  1545. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1546. var _params$ceFn = params.ceFn,
  1547. ceFn = _params$ceFn === void 0 ? abstractObj.tag === 'svg' ? createElementNS : createElement : _params$ceFn;
  1548. if (typeof abstractObj === 'string') {
  1549. return DOCUMENT.createTextNode(abstractObj);
  1550. }
  1551. var tag = ceFn(abstractObj.tag);
  1552. Object.keys(abstractObj.attributes || []).forEach(function (key) {
  1553. tag.setAttribute(key, abstractObj.attributes[key]);
  1554. });
  1555. var children = abstractObj.children || [];
  1556. children.forEach(function (child) {
  1557. tag.appendChild(convertSVG(child, {
  1558. ceFn: ceFn
  1559. }));
  1560. });
  1561. return tag;
  1562. }
  1563. function nodeAsComment(node) {
  1564. var comment = " ".concat(node.outerHTML, " ");
  1565. /* BEGIN.ATTRIBUTION */
  1566. comment = "".concat(comment, "Font Awesome fontawesome.com ");
  1567. /* END.ATTRIBUTION */
  1568. return comment;
  1569. }
  1570. var mutators = {
  1571. replace: function replace(mutation) {
  1572. var node = mutation[0];
  1573. if (node.parentNode) {
  1574. mutation[1].forEach(function (_abstract) {
  1575. node.parentNode.insertBefore(convertSVG(_abstract), node);
  1576. });
  1577. if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {
  1578. var comment = DOCUMENT.createComment(nodeAsComment(node));
  1579. node.parentNode.replaceChild(comment, node);
  1580. } else {
  1581. node.remove();
  1582. }
  1583. }
  1584. },
  1585. nest: function nest(mutation) {
  1586. var node = mutation[0];
  1587. var _abstract2 = mutation[1]; // If we already have a replaced node we do not want to continue nesting within it.
  1588. // Short-circuit to the standard replacement
  1589. if (~classArray(node).indexOf(config.replacementClass)) {
  1590. return mutators.replace(mutation);
  1591. }
  1592. var forSvg = new RegExp("".concat(config.cssPrefix, "-.*"));
  1593. delete _abstract2[0].attributes.id;
  1594. if (_abstract2[0].attributes.class) {
  1595. var splitClasses = _abstract2[0].attributes.class.split(' ').reduce(function (acc, cls) {
  1596. if (cls === config.replacementClass || cls.match(forSvg)) {
  1597. acc.toSvg.push(cls);
  1598. } else {
  1599. acc.toNode.push(cls);
  1600. }
  1601. return acc;
  1602. }, {
  1603. toNode: [],
  1604. toSvg: []
  1605. });
  1606. _abstract2[0].attributes.class = splitClasses.toSvg.join(' ');
  1607. if (splitClasses.toNode.length === 0) {
  1608. node.removeAttribute('class');
  1609. } else {
  1610. node.setAttribute('class', splitClasses.toNode.join(' '));
  1611. }
  1612. }
  1613. var newInnerHTML = _abstract2.map(function (a) {
  1614. return toHtml(a);
  1615. }).join('\n');
  1616. node.setAttribute(DATA_FA_I2SVG, '');
  1617. node.innerHTML = newInnerHTML;
  1618. }
  1619. };
  1620. function performOperationSync(op) {
  1621. op();
  1622. }
  1623. function perform(mutations, callback) {
  1624. var callbackFunction = typeof callback === 'function' ? callback : noop$2;
  1625. if (mutations.length === 0) {
  1626. callbackFunction();
  1627. } else {
  1628. var frame = performOperationSync;
  1629. if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
  1630. frame = WINDOW.requestAnimationFrame || performOperationSync;
  1631. }
  1632. frame(function () {
  1633. var mutator = getMutator();
  1634. var mark = perf.begin('mutate');
  1635. mutations.map(mutator);
  1636. mark();
  1637. callbackFunction();
  1638. });
  1639. }
  1640. }
  1641. var disabled = false;
  1642. function disableObservation() {
  1643. disabled = true;
  1644. }
  1645. function enableObservation() {
  1646. disabled = false;
  1647. }
  1648. var mo = null;
  1649. function observe(options) {
  1650. if (!MUTATION_OBSERVER) {
  1651. return;
  1652. }
  1653. if (!config.observeMutations) {
  1654. return;
  1655. }
  1656. var _options$treeCallback = options.treeCallback,
  1657. treeCallback = _options$treeCallback === void 0 ? noop$2 : _options$treeCallback,
  1658. _options$nodeCallback = options.nodeCallback,
  1659. nodeCallback = _options$nodeCallback === void 0 ? noop$2 : _options$nodeCallback,
  1660. _options$pseudoElemen = options.pseudoElementsCallback,
  1661. pseudoElementsCallback = _options$pseudoElemen === void 0 ? noop$2 : _options$pseudoElemen,
  1662. _options$observeMutat = options.observeMutationsRoot,
  1663. observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
  1664. mo = new MUTATION_OBSERVER(function (objects) {
  1665. if (disabled) return;
  1666. var defaultPrefix = getDefaultUsablePrefix();
  1667. toArray(objects).forEach(function (mutationRecord) {
  1668. if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
  1669. if (config.searchPseudoElements) {
  1670. pseudoElementsCallback(mutationRecord.target);
  1671. }
  1672. treeCallback(mutationRecord.target);
  1673. }
  1674. if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
  1675. pseudoElementsCallback(mutationRecord.target.parentNode);
  1676. }
  1677. if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
  1678. if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {
  1679. var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
  1680. prefix = _getCanonicalIcon.prefix,
  1681. iconName = _getCanonicalIcon.iconName;
  1682. mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);
  1683. if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);
  1684. } else if (hasBeenReplaced(mutationRecord.target)) {
  1685. nodeCallback(mutationRecord.target);
  1686. }
  1687. }
  1688. });
  1689. });
  1690. if (!IS_DOM) return;
  1691. mo.observe(observeMutationsRoot, {
  1692. childList: true,
  1693. attributes: true,
  1694. characterData: true,
  1695. subtree: true
  1696. });
  1697. }
  1698. function disconnect() {
  1699. if (!mo) return;
  1700. mo.disconnect();
  1701. }
  1702. function styleParser (node) {
  1703. var style = node.getAttribute('style');
  1704. var val = [];
  1705. if (style) {
  1706. val = style.split(';').reduce(function (acc, style) {
  1707. var styles = style.split(':');
  1708. var prop = styles[0];
  1709. var value = styles.slice(1);
  1710. if (prop && value.length > 0) {
  1711. acc[prop] = value.join(':').trim();
  1712. }
  1713. return acc;
  1714. }, {});
  1715. }
  1716. return val;
  1717. }
  1718. function classParser (node) {
  1719. var existingPrefix = node.getAttribute('data-prefix');
  1720. var existingIconName = node.getAttribute('data-icon');
  1721. var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
  1722. var val = getCanonicalIcon(classArray(node));
  1723. if (!val.prefix) {
  1724. val.prefix = getDefaultUsablePrefix();
  1725. }
  1726. if (existingPrefix && existingIconName) {
  1727. val.prefix = existingPrefix;
  1728. val.iconName = existingIconName;
  1729. }
  1730. if (val.iconName && val.prefix) {
  1731. return val;
  1732. }
  1733. if (val.prefix && innerText.length > 0) {
  1734. val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));
  1735. }
  1736. if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {
  1737. val.iconName = node.firstChild.data;
  1738. }
  1739. return val;
  1740. }
  1741. function attributesParser (node) {
  1742. var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
  1743. if (acc.name !== 'class' && acc.name !== 'style') {
  1744. acc[attr.name] = attr.value;
  1745. }
  1746. return acc;
  1747. }, {});
  1748. var title = node.getAttribute('title');
  1749. var titleId = node.getAttribute('data-fa-title-id');
  1750. if (config.autoA11y) {
  1751. if (title) {
  1752. extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
  1753. } else {
  1754. extraAttributes['aria-hidden'] = 'true';
  1755. extraAttributes['focusable'] = 'false';
  1756. }
  1757. }
  1758. return extraAttributes;
  1759. }
  1760. function blankMeta() {
  1761. return {
  1762. iconName: null,
  1763. title: null,
  1764. titleId: null,
  1765. prefix: null,
  1766. transform: meaninglessTransform,
  1767. symbol: false,
  1768. mask: {
  1769. iconName: null,
  1770. prefix: null,
  1771. rest: []
  1772. },
  1773. maskId: null,
  1774. extra: {
  1775. classes: [],
  1776. styles: {},
  1777. attributes: {}
  1778. }
  1779. };
  1780. }
  1781. function parseMeta(node) {
  1782. var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  1783. styleParser: true
  1784. };
  1785. var _classParser = classParser(node),
  1786. iconName = _classParser.iconName,
  1787. prefix = _classParser.prefix,
  1788. extraClasses = _classParser.rest;
  1789. var extraAttributes = attributesParser(node);
  1790. var pluginMeta = chainHooks('parseNodeAttributes', {}, node);
  1791. var extraStyles = parser.styleParser ? styleParser(node) : [];
  1792. return _objectSpread2({
  1793. iconName: iconName,
  1794. title: node.getAttribute('title'),
  1795. titleId: node.getAttribute('data-fa-title-id'),
  1796. prefix: prefix,
  1797. transform: meaninglessTransform,
  1798. mask: {
  1799. iconName: null,
  1800. prefix: null,
  1801. rest: []
  1802. },
  1803. maskId: null,
  1804. symbol: false,
  1805. extra: {
  1806. classes: extraClasses,
  1807. styles: extraStyles,
  1808. attributes: extraAttributes
  1809. }
  1810. }, pluginMeta);
  1811. }
  1812. var styles$2 = namespace.styles;
  1813. function generateMutation(node) {
  1814. var nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {
  1815. styleParser: false
  1816. }) : parseMeta(node);
  1817. if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
  1818. return callProvided('generateLayersText', node, nodeMeta);
  1819. } else {
  1820. return callProvided('generateSvgReplacementMutation', node, nodeMeta);
  1821. }
  1822. }
  1823. var knownPrefixes = new Set();
  1824. FAMILIES.map(function (family) {
  1825. knownPrefixes.add("fa-".concat(family));
  1826. });
  1827. Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC]).map(knownPrefixes.add.bind(knownPrefixes));
  1828. Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP]).map(knownPrefixes.add.bind(knownPrefixes));
  1829. knownPrefixes = _toConsumableArray(knownPrefixes);
  1830. function onTree(root) {
  1831. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  1832. if (!IS_DOM) return Promise.resolve();
  1833. var htmlClassList = DOCUMENT.documentElement.classList;
  1834. var hclAdd = function hclAdd(suffix) {
  1835. return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
  1836. };
  1837. var hclRemove = function hclRemove(suffix) {
  1838. return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
  1839. };
  1840. var prefixes = config.autoFetchSvg ? knownPrefixes : FAMILIES.map(function (f) {
  1841. return "fa-".concat(f);
  1842. }).concat(Object.keys(styles$2));
  1843. if (!prefixes.includes('fa')) {
  1844. prefixes.push('fa');
  1845. }
  1846. var prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(function (p) {
  1847. return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");
  1848. })).join(', ');
  1849. if (prefixesDomQuery.length === 0) {
  1850. return Promise.resolve();
  1851. }
  1852. var candidates = [];
  1853. try {
  1854. candidates = toArray(root.querySelectorAll(prefixesDomQuery));
  1855. } catch (e) {// noop
  1856. }
  1857. if (candidates.length > 0) {
  1858. hclAdd('pending');
  1859. hclRemove('complete');
  1860. } else {
  1861. return Promise.resolve();
  1862. }
  1863. var mark = perf.begin('onTree');
  1864. var mutations = candidates.reduce(function (acc, node) {
  1865. try {
  1866. var mutation = generateMutation(node);
  1867. if (mutation) {
  1868. acc.push(mutation);
  1869. }
  1870. } catch (e) {
  1871. if (!PRODUCTION) {
  1872. if (e.name === 'MissingIcon') {
  1873. console.error(e);
  1874. }
  1875. }
  1876. }
  1877. return acc;
  1878. }, []);
  1879. return new Promise(function (resolve, reject) {
  1880. Promise.all(mutations).then(function (resolvedMutations) {
  1881. perform(resolvedMutations, function () {
  1882. hclAdd('active');
  1883. hclAdd('complete');
  1884. hclRemove('pending');
  1885. if (typeof callback === 'function') callback();
  1886. mark();
  1887. resolve();
  1888. });
  1889. }).catch(function (e) {
  1890. mark();
  1891. reject(e);
  1892. });
  1893. });
  1894. }
  1895. function onNode(node) {
  1896. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  1897. generateMutation(node).then(function (mutation) {
  1898. if (mutation) {
  1899. perform([mutation], callback);
  1900. }
  1901. });
  1902. }
  1903. function resolveIcons(next) {
  1904. return function (maybeIconDefinition) {
  1905. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1906. var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
  1907. var mask = params.mask;
  1908. if (mask) {
  1909. mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
  1910. }
  1911. return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {
  1912. mask: mask
  1913. }));
  1914. };
  1915. }
  1916. var render = function render(iconDefinition) {
  1917. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1918. var _params$transform = params.transform,
  1919. transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
  1920. _params$symbol = params.symbol,
  1921. symbol = _params$symbol === void 0 ? false : _params$symbol,
  1922. _params$mask = params.mask,
  1923. mask = _params$mask === void 0 ? null : _params$mask,
  1924. _params$maskId = params.maskId,
  1925. maskId = _params$maskId === void 0 ? null : _params$maskId,
  1926. _params$title = params.title,
  1927. title = _params$title === void 0 ? null : _params$title,
  1928. _params$titleId = params.titleId,
  1929. titleId = _params$titleId === void 0 ? null : _params$titleId,
  1930. _params$classes = params.classes,
  1931. classes = _params$classes === void 0 ? [] : _params$classes,
  1932. _params$attributes = params.attributes,
  1933. attributes = _params$attributes === void 0 ? {} : _params$attributes,
  1934. _params$styles = params.styles,
  1935. styles = _params$styles === void 0 ? {} : _params$styles;
  1936. if (!iconDefinition) return;
  1937. var prefix = iconDefinition.prefix,
  1938. iconName = iconDefinition.iconName,
  1939. icon = iconDefinition.icon;
  1940. return domVariants(_objectSpread2({
  1941. type: 'icon'
  1942. }, iconDefinition), function () {
  1943. callHooks('beforeDOMElementCreation', {
  1944. iconDefinition: iconDefinition,
  1945. params: params
  1946. });
  1947. if (config.autoA11y) {
  1948. if (title) {
  1949. attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
  1950. } else {
  1951. attributes['aria-hidden'] = 'true';
  1952. attributes['focusable'] = 'false';
  1953. }
  1954. }
  1955. return makeInlineSvgAbstract({
  1956. icons: {
  1957. main: asFoundIcon(icon),
  1958. mask: mask ? asFoundIcon(mask.icon) : {
  1959. found: false,
  1960. width: null,
  1961. height: null,
  1962. icon: {}
  1963. }
  1964. },
  1965. prefix: prefix,
  1966. iconName: iconName,
  1967. transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
  1968. symbol: symbol,
  1969. title: title,
  1970. maskId: maskId,
  1971. titleId: titleId,
  1972. extra: {
  1973. attributes: attributes,
  1974. styles: styles,
  1975. classes: classes
  1976. }
  1977. });
  1978. });
  1979. };
  1980. var replaceElements = {
  1981. mixout: function mixout() {
  1982. return {
  1983. icon: resolveIcons(render)
  1984. };
  1985. },
  1986. hooks: function hooks() {
  1987. return {
  1988. mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
  1989. accumulator.treeCallback = onTree;
  1990. accumulator.nodeCallback = onNode;
  1991. return accumulator;
  1992. }
  1993. };
  1994. },
  1995. provides: function provides(providers$$1) {
  1996. providers$$1.i2svg = function (params) {
  1997. var _params$node = params.node,
  1998. node = _params$node === void 0 ? DOCUMENT : _params$node,
  1999. _params$callback = params.callback,
  2000. callback = _params$callback === void 0 ? function () {} : _params$callback;
  2001. return onTree(node, callback);
  2002. };
  2003. providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {
  2004. var iconName = nodeMeta.iconName,
  2005. title = nodeMeta.title,
  2006. titleId = nodeMeta.titleId,
  2007. prefix = nodeMeta.prefix,
  2008. transform = nodeMeta.transform,
  2009. symbol = nodeMeta.symbol,
  2010. mask = nodeMeta.mask,
  2011. maskId = nodeMeta.maskId,
  2012. extra = nodeMeta.extra;
  2013. return new Promise(function (resolve, reject) {
  2014. Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({
  2015. found: false,
  2016. width: 512,
  2017. height: 512,
  2018. icon: {}
  2019. })]).then(function (_ref) {
  2020. var _ref2 = _slicedToArray(_ref, 2),
  2021. main = _ref2[0],
  2022. mask = _ref2[1];
  2023. resolve([node, makeInlineSvgAbstract({
  2024. icons: {
  2025. main: main,
  2026. mask: mask
  2027. },
  2028. prefix: prefix,
  2029. iconName: iconName,
  2030. transform: transform,
  2031. symbol: symbol,
  2032. maskId: maskId,
  2033. title: title,
  2034. titleId: titleId,
  2035. extra: extra,
  2036. watchable: true
  2037. })]);
  2038. }).catch(reject);
  2039. });
  2040. };
  2041. providers$$1.generateAbstractIcon = function (_ref3) {
  2042. var children = _ref3.children,
  2043. attributes = _ref3.attributes,
  2044. main = _ref3.main,
  2045. transform = _ref3.transform,
  2046. styles = _ref3.styles;
  2047. var styleString = joinStyles(styles);
  2048. if (styleString.length > 0) {
  2049. attributes['style'] = styleString;
  2050. }
  2051. var nextChild;
  2052. if (transformIsMeaningful(transform)) {
  2053. nextChild = callProvided('generateAbstractTransformGrouping', {
  2054. main: main,
  2055. transform: transform,
  2056. containerWidth: main.width,
  2057. iconWidth: main.width
  2058. });
  2059. }
  2060. children.push(nextChild || main.icon);
  2061. return {
  2062. children: children,
  2063. attributes: attributes
  2064. };
  2065. };
  2066. }
  2067. };
  2068. var layers = {
  2069. mixout: function mixout() {
  2070. return {
  2071. layer: function layer(assembler) {
  2072. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2073. var _params$classes = params.classes,
  2074. classes = _params$classes === void 0 ? [] : _params$classes;
  2075. return domVariants({
  2076. type: 'layer'
  2077. }, function () {
  2078. callHooks('beforeDOMElementCreation', {
  2079. assembler: assembler,
  2080. params: params
  2081. });
  2082. var children = [];
  2083. assembler(function (args) {
  2084. Array.isArray(args) ? args.map(function (a) {
  2085. children = children.concat(a.abstract);
  2086. }) : children = children.concat(args.abstract);
  2087. });
  2088. return [{
  2089. tag: 'span',
  2090. attributes: {
  2091. class: ["".concat(config.cssPrefix, "-layers")].concat(_toConsumableArray(classes)).join(' ')
  2092. },
  2093. children: children
  2094. }];
  2095. });
  2096. }
  2097. };
  2098. }
  2099. };
  2100. var layersCounter = {
  2101. mixout: function mixout() {
  2102. return {
  2103. counter: function counter(content) {
  2104. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2105. var _params$title = params.title,
  2106. title = _params$title === void 0 ? null : _params$title,
  2107. _params$classes = params.classes,
  2108. classes = _params$classes === void 0 ? [] : _params$classes,
  2109. _params$attributes = params.attributes,
  2110. attributes = _params$attributes === void 0 ? {} : _params$attributes,
  2111. _params$styles = params.styles,
  2112. styles = _params$styles === void 0 ? {} : _params$styles;
  2113. return domVariants({
  2114. type: 'counter',
  2115. content: content
  2116. }, function () {
  2117. callHooks('beforeDOMElementCreation', {
  2118. content: content,
  2119. params: params
  2120. });
  2121. return makeLayersCounterAbstract({
  2122. content: content.toString(),
  2123. title: title,
  2124. extra: {
  2125. attributes: attributes,
  2126. styles: styles,
  2127. classes: ["".concat(config.cssPrefix, "-layers-counter")].concat(_toConsumableArray(classes))
  2128. }
  2129. });
  2130. });
  2131. }
  2132. };
  2133. }
  2134. };
  2135. var layersText = {
  2136. mixout: function mixout() {
  2137. return {
  2138. text: function text(content) {
  2139. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2140. var _params$transform = params.transform,
  2141. transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
  2142. _params$title = params.title,
  2143. title = _params$title === void 0 ? null : _params$title,
  2144. _params$classes = params.classes,
  2145. classes = _params$classes === void 0 ? [] : _params$classes,
  2146. _params$attributes = params.attributes,
  2147. attributes = _params$attributes === void 0 ? {} : _params$attributes,
  2148. _params$styles = params.styles,
  2149. styles = _params$styles === void 0 ? {} : _params$styles;
  2150. return domVariants({
  2151. type: 'text',
  2152. content: content
  2153. }, function () {
  2154. callHooks('beforeDOMElementCreation', {
  2155. content: content,
  2156. params: params
  2157. });
  2158. return makeLayersTextAbstract({
  2159. content: content,
  2160. transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
  2161. title: title,
  2162. extra: {
  2163. attributes: attributes,
  2164. styles: styles,
  2165. classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray(classes))
  2166. }
  2167. });
  2168. });
  2169. }
  2170. };
  2171. },
  2172. provides: function provides(providers$$1) {
  2173. providers$$1.generateLayersText = function (node, nodeMeta) {
  2174. var title = nodeMeta.title,
  2175. transform = nodeMeta.transform,
  2176. extra = nodeMeta.extra;
  2177. var width = null;
  2178. var height = null;
  2179. if (IS_IE) {
  2180. var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
  2181. var boundingClientRect = node.getBoundingClientRect();
  2182. width = boundingClientRect.width / computedFontSize;
  2183. height = boundingClientRect.height / computedFontSize;
  2184. }
  2185. if (config.autoA11y && !title) {
  2186. extra.attributes['aria-hidden'] = 'true';
  2187. }
  2188. return Promise.resolve([node, makeLayersTextAbstract({
  2189. content: node.innerHTML,
  2190. width: width,
  2191. height: height,
  2192. transform: transform,
  2193. title: title,
  2194. extra: extra,
  2195. watchable: true
  2196. })]);
  2197. };
  2198. }
  2199. };
  2200. var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
  2201. var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
  2202. function hexValueFromContent(content) {
  2203. var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
  2204. var codePoint = codePointAt(cleaned, 0);
  2205. var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
  2206. var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
  2207. return {
  2208. value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
  2209. isSecondary: isPrependTen || isDoubled
  2210. };
  2211. }
  2212. function replaceForPosition(node, position) {
  2213. var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
  2214. return new Promise(function (resolve, reject) {
  2215. if (node.getAttribute(pendingAttribute) !== null) {
  2216. // This node is already being processed
  2217. return resolve();
  2218. }
  2219. var children = toArray(node.children);
  2220. var alreadyProcessedPseudoElement = children.filter(function (c) {
  2221. return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
  2222. })[0];
  2223. var styles = WINDOW.getComputedStyle(node, position);
  2224. var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
  2225. var fontWeight = styles.getPropertyValue('font-weight');
  2226. var content = styles.getPropertyValue('content');
  2227. if (alreadyProcessedPseudoElement && !fontFamily) {
  2228. // If we've already processed it but the current computed style does not result in a font-family,
  2229. // that probably means that a class name that was previously present to make the icon has been
  2230. // removed. So we now should delete the icon.
  2231. node.removeChild(alreadyProcessedPseudoElement);
  2232. return resolve();
  2233. } else if (fontFamily && content !== 'none' && content !== '') {
  2234. var _content = styles.getPropertyValue('content');
  2235. var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
  2236. var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
  2237. var _hexValueFromContent = hexValueFromContent(_content),
  2238. hexValue = _hexValueFromContent.value,
  2239. isSecondary = _hexValueFromContent.isSecondary;
  2240. var isV4 = fontFamily[0].startsWith('FontAwesome');
  2241. var iconName = byUnicode(prefix, hexValue);
  2242. var iconIdentifier = iconName;
  2243. if (isV4) {
  2244. var iconName4 = byOldUnicode(hexValue);
  2245. if (iconName4.iconName && iconName4.prefix) {
  2246. iconName = iconName4.iconName;
  2247. prefix = iconName4.prefix;
  2248. }
  2249. } // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
  2250. // already done so with the same prefix and iconName
  2251. if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
  2252. node.setAttribute(pendingAttribute, iconIdentifier);
  2253. if (alreadyProcessedPseudoElement) {
  2254. // Delete the old one, since we're replacing it with a new one
  2255. node.removeChild(alreadyProcessedPseudoElement);
  2256. }
  2257. var meta = blankMeta();
  2258. var extra = meta.extra;
  2259. extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
  2260. findIcon(iconName, prefix).then(function (main) {
  2261. var _abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {
  2262. icons: {
  2263. main: main,
  2264. mask: emptyCanonicalIcon()
  2265. },
  2266. prefix: prefix,
  2267. iconName: iconIdentifier,
  2268. extra: extra,
  2269. watchable: true
  2270. }));
  2271. var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
  2272. if (position === '::before') {
  2273. node.insertBefore(element, node.firstChild);
  2274. } else {
  2275. node.appendChild(element);
  2276. }
  2277. element.outerHTML = _abstract.map(function (a) {
  2278. return toHtml(a);
  2279. }).join('\n');
  2280. node.removeAttribute(pendingAttribute);
  2281. resolve();
  2282. }).catch(reject);
  2283. } else {
  2284. resolve();
  2285. }
  2286. } else {
  2287. resolve();
  2288. }
  2289. });
  2290. }
  2291. function replace(node) {
  2292. return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
  2293. }
  2294. function processable(node) {
  2295. return 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');
  2296. }
  2297. function searchPseudoElements(root) {
  2298. if (!IS_DOM) return;
  2299. return new Promise(function (resolve, reject) {
  2300. var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
  2301. var end = perf.begin('searchPseudoElements');
  2302. disableObservation();
  2303. Promise.all(operations).then(function () {
  2304. end();
  2305. enableObservation();
  2306. resolve();
  2307. }).catch(function () {
  2308. end();
  2309. enableObservation();
  2310. reject();
  2311. });
  2312. });
  2313. }
  2314. var pseudoElements = {
  2315. hooks: function hooks() {
  2316. return {
  2317. mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
  2318. accumulator.pseudoElementsCallback = searchPseudoElements;
  2319. return accumulator;
  2320. }
  2321. };
  2322. },
  2323. provides: function provides(providers$$1) {
  2324. providers$$1.pseudoElements2svg = function (params) {
  2325. var _params$node = params.node,
  2326. node = _params$node === void 0 ? DOCUMENT : _params$node;
  2327. if (config.searchPseudoElements) {
  2328. searchPseudoElements(node);
  2329. }
  2330. };
  2331. }
  2332. };
  2333. var _unwatched = false;
  2334. var mutationObserver = {
  2335. mixout: function mixout() {
  2336. return {
  2337. dom: {
  2338. unwatch: function unwatch() {
  2339. disableObservation();
  2340. _unwatched = true;
  2341. }
  2342. }
  2343. };
  2344. },
  2345. hooks: function hooks() {
  2346. return {
  2347. bootstrap: function bootstrap() {
  2348. observe(chainHooks('mutationObserverCallbacks', {}));
  2349. },
  2350. noAuto: function noAuto() {
  2351. disconnect();
  2352. },
  2353. watch: function watch(params) {
  2354. var observeMutationsRoot = params.observeMutationsRoot;
  2355. if (_unwatched) {
  2356. enableObservation();
  2357. } else {
  2358. observe(chainHooks('mutationObserverCallbacks', {
  2359. observeMutationsRoot: observeMutationsRoot
  2360. }));
  2361. }
  2362. }
  2363. };
  2364. }
  2365. };
  2366. var parseTransformString = function parseTransformString(transformString) {
  2367. var transform = {
  2368. size: 16,
  2369. x: 0,
  2370. y: 0,
  2371. flipX: false,
  2372. flipY: false,
  2373. rotate: 0
  2374. };
  2375. return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
  2376. var parts = n.toLowerCase().split('-');
  2377. var first = parts[0];
  2378. var rest = parts.slice(1).join('-');
  2379. if (first && rest === 'h') {
  2380. acc.flipX = true;
  2381. return acc;
  2382. }
  2383. if (first && rest === 'v') {
  2384. acc.flipY = true;
  2385. return acc;
  2386. }
  2387. rest = parseFloat(rest);
  2388. if (isNaN(rest)) {
  2389. return acc;
  2390. }
  2391. switch (first) {
  2392. case 'grow':
  2393. acc.size = acc.size + rest;
  2394. break;
  2395. case 'shrink':
  2396. acc.size = acc.size - rest;
  2397. break;
  2398. case 'left':
  2399. acc.x = acc.x - rest;
  2400. break;
  2401. case 'right':
  2402. acc.x = acc.x + rest;
  2403. break;
  2404. case 'up':
  2405. acc.y = acc.y - rest;
  2406. break;
  2407. case 'down':
  2408. acc.y = acc.y + rest;
  2409. break;
  2410. case 'rotate':
  2411. acc.rotate = acc.rotate + rest;
  2412. break;
  2413. }
  2414. return acc;
  2415. }, transform);
  2416. };
  2417. var powerTransforms = {
  2418. mixout: function mixout() {
  2419. return {
  2420. parse: {
  2421. transform: function transform(transformString) {
  2422. return parseTransformString(transformString);
  2423. }
  2424. }
  2425. };
  2426. },
  2427. hooks: function hooks() {
  2428. return {
  2429. parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
  2430. var transformString = node.getAttribute('data-fa-transform');
  2431. if (transformString) {
  2432. accumulator.transform = parseTransformString(transformString);
  2433. }
  2434. return accumulator;
  2435. }
  2436. };
  2437. },
  2438. provides: function provides(providers) {
  2439. providers.generateAbstractTransformGrouping = function (_ref) {
  2440. var main = _ref.main,
  2441. transform = _ref.transform,
  2442. containerWidth = _ref.containerWidth,
  2443. iconWidth = _ref.iconWidth;
  2444. var outer = {
  2445. transform: "translate(".concat(containerWidth / 2, " 256)")
  2446. };
  2447. var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
  2448. var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
  2449. var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
  2450. var inner = {
  2451. transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
  2452. };
  2453. var path = {
  2454. transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
  2455. };
  2456. var operations = {
  2457. outer: outer,
  2458. inner: inner,
  2459. path: path
  2460. };
  2461. return {
  2462. tag: 'g',
  2463. attributes: _objectSpread2({}, operations.outer),
  2464. children: [{
  2465. tag: 'g',
  2466. attributes: _objectSpread2({}, operations.inner),
  2467. children: [{
  2468. tag: main.icon.tag,
  2469. children: main.icon.children,
  2470. attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)
  2471. }]
  2472. }]
  2473. };
  2474. };
  2475. }
  2476. };
  2477. var ALL_SPACE = {
  2478. x: 0,
  2479. y: 0,
  2480. width: '100%',
  2481. height: '100%'
  2482. };
  2483. function fillBlack(_abstract) {
  2484. var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  2485. if (_abstract.attributes && (_abstract.attributes.fill || force)) {
  2486. _abstract.attributes.fill = 'black';
  2487. }
  2488. return _abstract;
  2489. }
  2490. function deGroup(_abstract2) {
  2491. if (_abstract2.tag === 'g') {
  2492. return _abstract2.children;
  2493. } else {
  2494. return [_abstract2];
  2495. }
  2496. }
  2497. var masks = {
  2498. hooks: function hooks() {
  2499. return {
  2500. parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
  2501. var maskData = node.getAttribute('data-fa-mask');
  2502. var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
  2503. return i.trim();
  2504. }));
  2505. if (!mask.prefix) {
  2506. mask.prefix = getDefaultUsablePrefix();
  2507. }
  2508. accumulator.mask = mask;
  2509. accumulator.maskId = node.getAttribute('data-fa-mask-id');
  2510. return accumulator;
  2511. }
  2512. };
  2513. },
  2514. provides: function provides(providers) {
  2515. providers.generateAbstractMask = function (_ref) {
  2516. var children = _ref.children,
  2517. attributes = _ref.attributes,
  2518. main = _ref.main,
  2519. mask = _ref.mask,
  2520. explicitMaskId = _ref.maskId,
  2521. transform = _ref.transform;
  2522. var mainWidth = main.width,
  2523. mainPath = main.icon;
  2524. var maskWidth = mask.width,
  2525. maskPath = mask.icon;
  2526. var trans = transformForSvg({
  2527. transform: transform,
  2528. containerWidth: maskWidth,
  2529. iconWidth: mainWidth
  2530. });
  2531. var maskRect = {
  2532. tag: 'rect',
  2533. attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
  2534. fill: 'white'
  2535. })
  2536. };
  2537. var maskInnerGroupChildrenMixin = mainPath.children ? {
  2538. children: mainPath.children.map(fillBlack)
  2539. } : {};
  2540. var maskInnerGroup = {
  2541. tag: 'g',
  2542. attributes: _objectSpread2({}, trans.inner),
  2543. children: [fillBlack(_objectSpread2({
  2544. tag: mainPath.tag,
  2545. attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)
  2546. }, maskInnerGroupChildrenMixin))]
  2547. };
  2548. var maskOuterGroup = {
  2549. tag: 'g',
  2550. attributes: _objectSpread2({}, trans.outer),
  2551. children: [maskInnerGroup]
  2552. };
  2553. var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
  2554. var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
  2555. var maskTag = {
  2556. tag: 'mask',
  2557. attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
  2558. id: maskId,
  2559. maskUnits: 'userSpaceOnUse',
  2560. maskContentUnits: 'userSpaceOnUse'
  2561. }),
  2562. children: [maskRect, maskOuterGroup]
  2563. };
  2564. var defs = {
  2565. tag: 'defs',
  2566. children: [{
  2567. tag: 'clipPath',
  2568. attributes: {
  2569. id: clipId
  2570. },
  2571. children: deGroup(maskPath)
  2572. }, maskTag]
  2573. };
  2574. children.push(defs, {
  2575. tag: 'rect',
  2576. attributes: _objectSpread2({
  2577. fill: 'currentColor',
  2578. 'clip-path': "url(#".concat(clipId, ")"),
  2579. mask: "url(#".concat(maskId, ")")
  2580. }, ALL_SPACE)
  2581. });
  2582. return {
  2583. children: children,
  2584. attributes: attributes
  2585. };
  2586. };
  2587. }
  2588. };
  2589. var missingIconIndicator = {
  2590. provides: function provides(providers) {
  2591. var reduceMotion = false;
  2592. if (WINDOW.matchMedia) {
  2593. reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
  2594. }
  2595. providers.missingIconAbstract = function () {
  2596. var gChildren = [];
  2597. var FILL = {
  2598. fill: 'currentColor'
  2599. };
  2600. var ANIMATION_BASE = {
  2601. attributeType: 'XML',
  2602. repeatCount: 'indefinite',
  2603. dur: '2s'
  2604. }; // Ring
  2605. gChildren.push({
  2606. tag: 'path',
  2607. attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
  2608. d: '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'
  2609. })
  2610. });
  2611. var OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
  2612. attributeName: 'opacity'
  2613. });
  2614. var dot = {
  2615. tag: 'circle',
  2616. attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
  2617. cx: '256',
  2618. cy: '364',
  2619. r: '28'
  2620. }),
  2621. children: []
  2622. };
  2623. if (!reduceMotion) {
  2624. dot.children.push({
  2625. tag: 'animate',
  2626. attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
  2627. attributeName: 'r',
  2628. values: '28;14;28;28;14;28;'
  2629. })
  2630. }, {
  2631. tag: 'animate',
  2632. attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
  2633. values: '1;0;1;1;0;1;'
  2634. })
  2635. });
  2636. }
  2637. gChildren.push(dot);
  2638. gChildren.push({
  2639. tag: 'path',
  2640. attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
  2641. opacity: '1',
  2642. d: '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'
  2643. }),
  2644. children: reduceMotion ? [] : [{
  2645. tag: 'animate',
  2646. attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
  2647. values: '1;0;0;0;0;1;'
  2648. })
  2649. }]
  2650. });
  2651. if (!reduceMotion) {
  2652. // Exclamation
  2653. gChildren.push({
  2654. tag: 'path',
  2655. attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
  2656. opacity: '0',
  2657. d: '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'
  2658. }),
  2659. children: [{
  2660. tag: 'animate',
  2661. attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
  2662. values: '0;0;1;1;0;0;'
  2663. })
  2664. }]
  2665. });
  2666. }
  2667. return {
  2668. tag: 'g',
  2669. attributes: {
  2670. 'class': 'missing'
  2671. },
  2672. children: gChildren
  2673. };
  2674. };
  2675. }
  2676. };
  2677. var svgSymbols = {
  2678. hooks: function hooks() {
  2679. return {
  2680. parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
  2681. var symbolData = node.getAttribute('data-fa-symbol');
  2682. var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
  2683. accumulator['symbol'] = symbol;
  2684. return accumulator;
  2685. }
  2686. };
  2687. }
  2688. };
  2689. function register(plugins) {
  2690. return registerPlugins(plugins, {
  2691. mixoutsTo: api
  2692. });
  2693. }
  2694. export { register, injectCss as InjectCSS, replaceElements as ReplaceElements, layers as Layers, layersCounter as LayersCounter, layersText as LayersText, pseudoElements as PseudoElements, mutationObserver as MutationObserver, powerTransforms as PowerTransforms, masks as Masks, missingIconIndicator as MissingIconIndicator, svgSymbols as SvgSymbols };