index.mjs 100 KB

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