index.js 106 KB

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