@ttoss/components 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ import { __name } from "./chunk-V4MHYKRI.js";
2
3
 
3
4
  // ../../node_modules/.pnpm/@iconify-icon+react@2.3.0_react@19.1.1/node_modules/@iconify-icon/react/dist/iconify.mjs
4
5
  import React from "react";
@@ -42,6 +43,7 @@ function rotateFromString(value, defaultValue = 0) {
42
43
  }
43
44
  return value2 % 4;
44
45
  }
46
+ __name(cleanup, "cleanup");
45
47
  if (units === "") {
46
48
  const num = parseInt(value);
47
49
  return isNaN(num) ? 0 : cleanup(num);
@@ -65,6 +67,7 @@ function rotateFromString(value, defaultValue = 0) {
65
67
  }
66
68
  return defaultValue;
67
69
  }
70
+ __name(rotateFromString, "rotateFromString");
68
71
  var separator = /[\s,]+/;
69
72
  function flipFromString(custom, flip) {
70
73
  flip.split(separator).forEach(str => {
@@ -79,6 +82,7 @@ function flipFromString(custom, flip) {
79
82
  }
80
83
  });
81
84
  }
85
+ __name(flipFromString, "flipFromString");
82
86
  var defaultCustomisations = {
83
87
  ...defaultIconCustomisations,
84
88
  preserveAspectRatio: ""
@@ -87,7 +91,7 @@ function getCustomisations(node) {
87
91
  const customisations = {
88
92
  ...defaultCustomisations
89
93
  };
90
- const attr = (key, def) => node.getAttribute(key) || def;
94
+ const attr = /* @__PURE__ */__name((key, def) => node.getAttribute(key) || def, "attr");
91
95
  customisations.width = attr("width", null);
92
96
  customisations.height = attr("height", null);
93
97
  customisations.rotate = rotateFromString(attr("rotate", ""));
@@ -95,6 +99,7 @@ function getCustomisations(node) {
95
99
  customisations.preserveAspectRatio = attr("preserveAspectRatio", attr("preserveaspectratio", ""));
96
100
  return customisations;
97
101
  }
102
+ __name(getCustomisations, "getCustomisations");
98
103
  function haveCustomisationsChanged(value1, value2) {
99
104
  for (const key in defaultCustomisations) {
100
105
  if (value1[key] !== value2[key]) {
@@ -103,8 +108,9 @@ function haveCustomisationsChanged(value1, value2) {
103
108
  }
104
109
  return false;
105
110
  }
111
+ __name(haveCustomisationsChanged, "haveCustomisationsChanged");
106
112
  var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
107
- var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
113
+ var stringToIcon = /* @__PURE__ */__name((value, validate, allowSimpleName, provider = "") => {
108
114
  const colonSeparated = value.split(":");
109
115
  if (value.slice(0, 1) === "@") {
110
116
  if (colonSeparated.length < 2 || colonSeparated.length > 3) {
@@ -145,8 +151,8 @@ var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
145
151
  return validate && !validateIconName(result, allowSimpleName) ? null : result;
146
152
  }
147
153
  return null;
148
- };
149
- var validateIconName = (icon, allowSimpleName) => {
154
+ }, "stringToIcon");
155
+ var validateIconName = /* @__PURE__ */__name((icon, allowSimpleName) => {
150
156
  if (!icon) {
151
157
  return false;
152
158
  }
@@ -154,7 +160,7 @@ var validateIconName = (icon, allowSimpleName) => {
154
160
  // Check prefix: cannot be empty, unless allowSimpleName is enabled
155
161
  // Check name: cannot be empty
156
162
  (allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
157
- };
163
+ }, "validateIconName");
158
164
  function mergeIconTransformations(obj1, obj2) {
159
165
  const result = {};
160
166
  if (!obj1.hFlip !== !obj2.hFlip) {
@@ -169,6 +175,7 @@ function mergeIconTransformations(obj1, obj2) {
169
175
  }
170
176
  return result;
171
177
  }
178
+ __name(mergeIconTransformations, "mergeIconTransformations");
172
179
  function mergeIconData(parent, child) {
173
180
  const result = mergeIconTransformations(parent, child);
174
181
  for (const key in defaultExtendedIconProps) {
@@ -184,6 +191,7 @@ function mergeIconData(parent, child) {
184
191
  }
185
192
  return result;
186
193
  }
194
+ __name(mergeIconData, "mergeIconData");
187
195
  function getIconsTree(data, names) {
188
196
  const icons = data.icons;
189
197
  const aliases = data.aliases || /* @__PURE__ */Object.create(null);
@@ -202,9 +210,11 @@ function getIconsTree(data, names) {
202
210
  }
203
211
  return resolved[name];
204
212
  }
213
+ __name(resolve, "resolve");
205
214
  Object.keys(icons).concat(Object.keys(aliases)).forEach(resolve);
206
215
  return resolved;
207
216
  }
217
+ __name(getIconsTree, "getIconsTree");
208
218
  function internalGetIconData(data, name, tree) {
209
219
  const icons = data.icons;
210
220
  const aliases = data.aliases || /* @__PURE__ */Object.create(null);
@@ -212,10 +222,12 @@ function internalGetIconData(data, name, tree) {
212
222
  function parse(name2) {
213
223
  currentProps = mergeIconData(icons[name2] || aliases[name2], currentProps);
214
224
  }
225
+ __name(parse, "parse");
215
226
  parse(name);
216
227
  tree.forEach(parse);
217
228
  return mergeIconData(data, currentProps);
218
229
  }
230
+ __name(internalGetIconData, "internalGetIconData");
219
231
  function parseIconSet(data, callback) {
220
232
  const names = [];
221
233
  if (typeof data !== "object" || typeof data.icons !== "object") {
@@ -237,6 +249,7 @@ function parseIconSet(data, callback) {
237
249
  }
238
250
  return names;
239
251
  }
252
+ __name(parseIconSet, "parseIconSet");
240
253
  var optionalPropertyDefaults = {
241
254
  provider: "",
242
255
  aliases: {},
@@ -251,6 +264,7 @@ function checkOptionalProps(item, defaults) {
251
264
  }
252
265
  return true;
253
266
  }
267
+ __name(checkOptionalProps, "checkOptionalProps");
254
268
  function quicklyValidateIconSet(obj) {
255
269
  if (typeof obj !== "object" || obj === null) {
256
270
  return null;
@@ -291,6 +305,7 @@ function quicklyValidateIconSet(obj) {
291
305
  }
292
306
  return data;
293
307
  }
308
+ __name(quicklyValidateIconSet, "quicklyValidateIconSet");
294
309
  var dataStorage = /* @__PURE__ */Object.create(null);
295
310
  function newStorage(provider, prefix) {
296
311
  return {
@@ -300,10 +315,12 @@ function newStorage(provider, prefix) {
300
315
  missing: /* @__PURE__ */new Set()
301
316
  };
302
317
  }
318
+ __name(newStorage, "newStorage");
303
319
  function getStorage(provider, prefix) {
304
320
  const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */Object.create(null));
305
321
  return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
306
322
  }
323
+ __name(getStorage, "getStorage");
307
324
  function addIconSet(storage2, data) {
308
325
  if (!quicklyValidateIconSet(data)) {
309
326
  return [];
@@ -316,6 +333,7 @@ function addIconSet(storage2, data) {
316
333
  }
317
334
  });
318
335
  }
336
+ __name(addIconSet, "addIconSet");
319
337
  function addIconToStorage(storage2, name, icon) {
320
338
  try {
321
339
  if (typeof icon.body === "string") {
@@ -327,6 +345,7 @@ function addIconToStorage(storage2, name, icon) {
327
345
  } catch (err) {}
328
346
  return false;
329
347
  }
348
+ __name(addIconToStorage, "addIconToStorage");
330
349
  function listIcons$1(provider, prefix) {
331
350
  let allIcons = [];
332
351
  const providers = typeof provider === "string" ? [provider] : Object.keys(dataStorage);
@@ -339,6 +358,7 @@ function listIcons$1(provider, prefix) {
339
358
  });
340
359
  return allIcons;
341
360
  }
361
+ __name(listIcons$1, "listIcons$1");
342
362
  var simpleNames = false;
343
363
  function allowSimpleNames(allow) {
344
364
  if (typeof allow === "boolean") {
@@ -346,6 +366,7 @@ function allowSimpleNames(allow) {
346
366
  }
347
367
  return simpleNames;
348
368
  }
369
+ __name(allowSimpleNames, "allowSimpleNames");
349
370
  function getIconData(name) {
350
371
  const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
351
372
  if (icon) {
@@ -354,6 +375,7 @@ function getIconData(name) {
354
375
  return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
355
376
  }
356
377
  }
378
+ __name(getIconData, "getIconData");
357
379
  function addIcon$1(name, data) {
358
380
  const icon = stringToIcon(name, true, simpleNames);
359
381
  if (!icon) {
@@ -367,6 +389,7 @@ function addIcon$1(name, data) {
367
389
  return true;
368
390
  }
369
391
  }
392
+ __name(addIcon$1, "addIcon$1");
370
393
  function addCollection$1(data, provider) {
371
394
  if (typeof data !== "object") {
372
395
  return false;
@@ -397,9 +420,11 @@ function addCollection$1(data, provider) {
397
420
  const storage2 = getStorage(provider, prefix);
398
421
  return !!addIconSet(storage2, data);
399
422
  }
423
+ __name(addCollection$1, "addCollection$1");
400
424
  function iconLoaded$1(name) {
401
425
  return !!getIconData(name);
402
426
  }
427
+ __name(iconLoaded$1, "iconLoaded$1");
403
428
  function getIcon$1(name) {
404
429
  const result = getIconData(name);
405
430
  return result ? {
@@ -407,6 +432,7 @@ function getIcon$1(name) {
407
432
  ...result
408
433
  } : result;
409
434
  }
435
+ __name(getIcon$1, "getIcon$1");
410
436
  function sortIcons(icons) {
411
437
  const result = {
412
438
  loaded: [],
@@ -455,6 +481,7 @@ function sortIcons(icons) {
455
481
  });
456
482
  return result;
457
483
  }
484
+ __name(sortIcons, "sortIcons");
458
485
  function removeCallback(storages, id) {
459
486
  storages.forEach(storage2 => {
460
487
  const items = storage2.loaderCallbacks;
@@ -463,6 +490,7 @@ function removeCallback(storages, id) {
463
490
  }
464
491
  });
465
492
  }
493
+ __name(removeCallback, "removeCallback");
466
494
  function updateCallbacks(storage2) {
467
495
  if (!storage2.pendingCallbacksFlag) {
468
496
  storage2.pendingCallbacksFlag = true;
@@ -511,6 +539,7 @@ function updateCallbacks(storage2) {
511
539
  });
512
540
  }
513
541
  }
542
+ __name(updateCallbacks, "updateCallbacks");
514
543
  var idCounter = 0;
515
544
  function storeCallback(callback, icons, pendingSources) {
516
545
  const id = idCounter++;
@@ -529,13 +558,16 @@ function storeCallback(callback, icons, pendingSources) {
529
558
  });
530
559
  return abort;
531
560
  }
561
+ __name(storeCallback, "storeCallback");
532
562
  var storage = /* @__PURE__ */Object.create(null);
533
563
  function setAPIModule(provider, item) {
534
564
  storage[provider] = item;
535
565
  }
566
+ __name(setAPIModule, "setAPIModule");
536
567
  function getAPIModule(provider) {
537
568
  return storage[provider] || storage[""];
538
569
  }
570
+ __name(getAPIModule, "getAPIModule");
539
571
  function listToIcons(list, validate = true, simpleNames2 = false) {
540
572
  const result = [];
541
573
  list.forEach(item => {
@@ -546,6 +578,7 @@ function listToIcons(list, validate = true, simpleNames2 = false) {
546
578
  });
547
579
  return result;
548
580
  }
581
+ __name(listToIcons, "listToIcons");
549
582
  var defaultConfig = {
550
583
  resources: [],
551
584
  index: 0,
@@ -586,6 +619,7 @@ function sendQuery(config, payload, query, done) {
586
619
  timer = null;
587
620
  }
588
621
  }
622
+ __name(resetTimer, "resetTimer");
589
623
  function abort() {
590
624
  if (status === "pending") {
591
625
  status = "aborted";
@@ -598,6 +632,7 @@ function sendQuery(config, payload, query, done) {
598
632
  });
599
633
  queue = [];
600
634
  }
635
+ __name(abort, "abort");
601
636
  function subscribe(callback, overwrite) {
602
637
  if (overwrite) {
603
638
  doneCallbacks = [];
@@ -606,6 +641,7 @@ function sendQuery(config, payload, query, done) {
606
641
  doneCallbacks.push(callback);
607
642
  }
608
643
  }
644
+ __name(subscribe, "subscribe");
609
645
  function getQueryStatus() {
610
646
  return {
611
647
  startTime,
@@ -617,12 +653,14 @@ function sendQuery(config, payload, query, done) {
617
653
  abort
618
654
  };
619
655
  }
656
+ __name(getQueryStatus, "getQueryStatus");
620
657
  function failQuery() {
621
658
  status = "failed";
622
659
  doneCallbacks.forEach(callback => {
623
660
  callback(void 0, lastError);
624
661
  });
625
662
  }
663
+ __name(failQuery, "failQuery");
626
664
  function clearQueue() {
627
665
  queue.forEach(item => {
628
666
  if (item.status === "pending") {
@@ -631,6 +669,7 @@ function sendQuery(config, payload, query, done) {
631
669
  });
632
670
  queue = [];
633
671
  }
672
+ __name(clearQueue, "clearQueue");
634
673
  function moduleResponse(item, response, data) {
635
674
  const isError = response !== "success";
636
675
  queue = queue.filter(queued => queued !== item);
@@ -674,6 +713,7 @@ function sendQuery(config, payload, query, done) {
674
713
  callback(data);
675
714
  });
676
715
  }
716
+ __name(moduleResponse, "moduleResponse");
677
717
  function execNext() {
678
718
  if (status !== "pending") {
679
719
  return;
@@ -697,18 +737,20 @@ function sendQuery(config, payload, query, done) {
697
737
  const item = {
698
738
  status: "pending",
699
739
  resource,
700
- callback: (status2, data) => {
740
+ callback: /* @__PURE__ */__name((status2, data) => {
701
741
  moduleResponse(item, status2, data);
702
- }
742
+ }, "callback")
703
743
  };
704
744
  queue.push(item);
705
745
  queriesSent++;
706
746
  timer = setTimeout(execNext, config.rotate);
707
747
  query(resource, payload, item.callback);
708
748
  }
749
+ __name(execNext, "execNext");
709
750
  setTimeout(execNext);
710
751
  return getQueryStatus;
711
752
  }
753
+ __name(sendQuery, "sendQuery");
712
754
  function initRedundancy(cfg) {
713
755
  const config = {
714
756
  ...defaultConfig,
@@ -718,6 +760,7 @@ function initRedundancy(cfg) {
718
760
  function cleanup() {
719
761
  queries = queries.filter(item => item().status === "pending");
720
762
  }
763
+ __name(cleanup, "cleanup");
721
764
  function query(payload, queryCallback, doneCallback) {
722
765
  const query2 = sendQuery(config, payload, queryCallback, (data, error) => {
723
766
  cleanup();
@@ -728,22 +771,25 @@ function initRedundancy(cfg) {
728
771
  queries.push(query2);
729
772
  return query2;
730
773
  }
774
+ __name(query, "query");
731
775
  function find(callback) {
732
776
  return queries.find(value => {
733
777
  return callback(value);
734
778
  }) || null;
735
779
  }
780
+ __name(find, "find");
736
781
  const instance = {
737
782
  query,
738
783
  find,
739
- setIndex: index => {
784
+ setIndex: /* @__PURE__ */__name(index => {
740
785
  config.index = index;
741
- },
742
- getIndex: () => config.index,
786
+ }, "setIndex"),
787
+ getIndex: /* @__PURE__ */__name(() => config.index, "getIndex"),
743
788
  cleanup
744
789
  };
745
790
  return instance;
746
791
  }
792
+ __name(initRedundancy, "initRedundancy");
747
793
  function createAPIConfig(source) {
748
794
  let resources;
749
795
  if (typeof source.resources === "string") {
@@ -774,6 +820,7 @@ function createAPIConfig(source) {
774
820
  };
775
821
  return result;
776
822
  }
823
+ __name(createAPIConfig, "createAPIConfig");
777
824
  var configStorage = /* @__PURE__ */Object.create(null);
778
825
  var fallBackAPISources = ["https://api.simplesvg.com", "https://api.unisvg.com"];
779
826
  var fallBackAPI = [];
@@ -799,13 +846,17 @@ function addAPIProvider$1(provider, customConfig) {
799
846
  configStorage[provider] = config;
800
847
  return true;
801
848
  }
849
+ __name(addAPIProvider$1, "addAPIProvider$1");
802
850
  function getAPIConfig(provider) {
803
851
  return configStorage[provider];
804
852
  }
853
+ __name(getAPIConfig, "getAPIConfig");
805
854
  function listAPIProviders() {
806
855
  return Object.keys(configStorage);
807
856
  }
857
+ __name(listAPIProviders, "listAPIProviders");
808
858
  function emptyCallback$1() {}
859
+ __name(emptyCallback$1, "emptyCallback$1");
809
860
  var redundancyCache = /* @__PURE__ */Object.create(null);
810
861
  function getRedundancyCache(provider) {
811
862
  if (!redundancyCache[provider]) {
@@ -822,6 +873,7 @@ function getRedundancyCache(provider) {
822
873
  }
823
874
  return redundancyCache[provider];
824
875
  }
876
+ __name(getRedundancyCache, "getRedundancyCache");
825
877
  function sendAPIQuery(target, query, callback) {
826
878
  let redundancy;
827
879
  let send2;
@@ -853,7 +905,9 @@ function sendAPIQuery(target, query, callback) {
853
905
  }
854
906
  return redundancy.query(query, send2, callback)().abort;
855
907
  }
908
+ __name(sendAPIQuery, "sendAPIQuery");
856
909
  function emptyCallback() {}
910
+ __name(emptyCallback, "emptyCallback");
857
911
  function loadedNewIcons(storage2) {
858
912
  if (!storage2.iconsLoaderFlag) {
859
913
  storage2.iconsLoaderFlag = true;
@@ -863,6 +917,7 @@ function loadedNewIcons(storage2) {
863
917
  });
864
918
  }
865
919
  }
920
+ __name(loadedNewIcons, "loadedNewIcons");
866
921
  function checkIconNamesForAPI(icons) {
867
922
  const valid = [];
868
923
  const invalid = [];
@@ -874,6 +929,7 @@ function checkIconNamesForAPI(icons) {
874
929
  invalid
875
930
  };
876
931
  }
932
+ __name(checkIconNamesForAPI, "checkIconNamesForAPI");
877
933
  function parseLoaderResponse(storage2, icons, data) {
878
934
  function checkMissing() {
879
935
  const pending = storage2.pendingIcons;
@@ -886,6 +942,7 @@ function parseLoaderResponse(storage2, icons, data) {
886
942
  }
887
943
  });
888
944
  }
945
+ __name(checkMissing, "checkMissing");
889
946
  if (data && typeof data === "object") {
890
947
  try {
891
948
  const parsed = addIconSet(storage2, data);
@@ -900,6 +957,7 @@ function parseLoaderResponse(storage2, icons, data) {
900
957
  checkMissing();
901
958
  loadedNewIcons(storage2);
902
959
  }
960
+ __name(parseLoaderResponse, "parseLoaderResponse");
903
961
  function parsePossiblyAsyncResponse(response, callback) {
904
962
  if (response instanceof Promise) {
905
963
  response.then(data => {
@@ -911,6 +969,7 @@ function parsePossiblyAsyncResponse(response, callback) {
911
969
  callback(response);
912
970
  }
913
971
  }
972
+ __name(parsePossiblyAsyncResponse, "parsePossiblyAsyncResponse");
914
973
  function loadNewIcons(storage2, icons) {
915
974
  if (!storage2.iconsToLoad) {
916
975
  storage2.iconsToLoad = icons;
@@ -976,7 +1035,8 @@ function loadNewIcons(storage2, icons) {
976
1035
  });
977
1036
  }
978
1037
  }
979
- var loadIcons$1 = (icons, callback) => {
1038
+ __name(loadNewIcons, "loadNewIcons");
1039
+ var loadIcons$1 = /* @__PURE__ */__name((icons, callback) => {
980
1040
  const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
981
1041
  const sortedIcons = sortIcons(cleanedIcons);
982
1042
  if (!sortedIcons.pending.length) {
@@ -1031,8 +1091,8 @@ var loadIcons$1 = (icons, callback) => {
1031
1091
  }
1032
1092
  });
1033
1093
  return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1034
- };
1035
- var loadIcon$1 = icon => {
1094
+ }, "loadIcons$1");
1095
+ var loadIcon$1 = /* @__PURE__ */__name(icon => {
1036
1096
  return new Promise((fulfill, reject) => {
1037
1097
  const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
1038
1098
  if (!iconObj) {
@@ -1053,7 +1113,7 @@ var loadIcon$1 = icon => {
1053
1113
  reject(icon);
1054
1114
  });
1055
1115
  });
1056
- };
1116
+ }, "loadIcon$1");
1057
1117
  function testIconObject(value) {
1058
1118
  try {
1059
1119
  const obj = typeof value === "string" ? JSON.parse(value) : value;
@@ -1064,6 +1124,7 @@ function testIconObject(value) {
1064
1124
  }
1065
1125
  } catch (err) {}
1066
1126
  }
1127
+ __name(testIconObject, "testIconObject");
1067
1128
  function parseIconValue(value, onload) {
1068
1129
  if (typeof value === "object") {
1069
1130
  const data2 = testIconObject(value);
@@ -1108,6 +1169,7 @@ function parseIconValue(value, onload) {
1108
1169
  loading
1109
1170
  };
1110
1171
  }
1172
+ __name(parseIconValue, "parseIconValue");
1111
1173
  var isBuggedSafari = false;
1112
1174
  try {
1113
1175
  isBuggedSafari = navigator.vendor.indexOf("Apple") === 0;
@@ -1125,6 +1187,7 @@ function getRenderMode(body, mode) {
1125
1187
  }
1126
1188
  return body.indexOf("currentColor") === -1 ? "bg" : "mask";
1127
1189
  }
1190
+ __name(getRenderMode, "getRenderMode");
1128
1191
  var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
1129
1192
  var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
1130
1193
  function calculateSize$1(size, ratio, precision) {
@@ -1163,6 +1226,7 @@ function calculateSize$1(size, ratio, precision) {
1163
1226
  isNumber = !isNumber;
1164
1227
  }
1165
1228
  }
1229
+ __name(calculateSize$1, "calculateSize$1");
1166
1230
  function splitSVGDefs(content, tag = "defs") {
1167
1231
  let defs = "";
1168
1232
  const index = content.indexOf("<" + tag);
@@ -1184,14 +1248,17 @@ function splitSVGDefs(content, tag = "defs") {
1184
1248
  content
1185
1249
  };
1186
1250
  }
1251
+ __name(splitSVGDefs, "splitSVGDefs");
1187
1252
  function mergeDefsAndContent(defs, content) {
1188
1253
  return defs ? "<defs>" + defs + "</defs>" + content : content;
1189
1254
  }
1255
+ __name(mergeDefsAndContent, "mergeDefsAndContent");
1190
1256
  function wrapSVGContent(body, start, end) {
1191
1257
  const split = splitSVGDefs(body);
1192
1258
  return mergeDefsAndContent(split.defs, start + split.content + end);
1193
1259
  }
1194
- var isUnsetKeyword = value => value === "unset" || value === "undefined" || value === "none";
1260
+ __name(wrapSVGContent, "wrapSVGContent");
1261
+ var isUnsetKeyword = /* @__PURE__ */__name(value => value === "unset" || value === "undefined" || value === "none", "isUnsetKeyword");
1195
1262
  function iconToSVG(icon, customisations) {
1196
1263
  const fullIcon = {
1197
1264
  ...defaultIconProps,
@@ -1274,11 +1341,11 @@ function iconToSVG(icon, customisations) {
1274
1341
  height = customisationsHeight === null ? calculateSize$1(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
1275
1342
  }
1276
1343
  const attributes = {};
1277
- const setAttr = (prop, value) => {
1344
+ const setAttr = /* @__PURE__ */__name((prop, value) => {
1278
1345
  if (!isUnsetKeyword(value)) {
1279
1346
  attributes[prop] = value.toString();
1280
1347
  }
1281
- };
1348
+ }, "setAttr");
1282
1349
  setAttr("width", width);
1283
1350
  setAttr("height", height);
1284
1351
  const viewBox = [box.left, box.top, boxWidth, boxHeight];
@@ -1289,6 +1356,7 @@ function iconToSVG(icon, customisations) {
1289
1356
  body
1290
1357
  };
1291
1358
  }
1359
+ __name(iconToSVG, "iconToSVG");
1292
1360
  function iconToHTML$1(body, attributes) {
1293
1361
  let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1294
1362
  for (const attr in attributes) {
@@ -1296,16 +1364,20 @@ function iconToHTML$1(body, attributes) {
1296
1364
  }
1297
1365
  return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1298
1366
  }
1367
+ __name(iconToHTML$1, "iconToHTML$1");
1299
1368
  function encodeSVGforURL(svg) {
1300
1369
  return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1301
1370
  }
1371
+ __name(encodeSVGforURL, "encodeSVGforURL");
1302
1372
  function svgToData(svg) {
1303
1373
  return "data:image/svg+xml," + encodeSVGforURL(svg);
1304
1374
  }
1375
+ __name(svgToData, "svgToData");
1305
1376
  function svgToURL$1(svg) {
1306
1377
  return 'url("' + svgToData(svg) + '")';
1307
1378
  }
1308
- var detectFetch = () => {
1379
+ __name(svgToURL$1, "svgToURL$1");
1380
+ var detectFetch = /* @__PURE__ */__name(() => {
1309
1381
  let callback;
1310
1382
  try {
1311
1383
  callback = fetch;
@@ -1313,14 +1385,16 @@ var detectFetch = () => {
1313
1385
  return callback;
1314
1386
  }
1315
1387
  } catch (err) {}
1316
- };
1388
+ }, "detectFetch");
1317
1389
  var fetchModule = detectFetch();
1318
1390
  function setFetch(fetch2) {
1319
1391
  fetchModule = fetch2;
1320
1392
  }
1393
+ __name(setFetch, "setFetch");
1321
1394
  function getFetch() {
1322
1395
  return fetchModule;
1323
1396
  }
1397
+ __name(getFetch, "getFetch");
1324
1398
  function calculateMaxLength(provider, prefix) {
1325
1399
  const config = getAPIConfig(provider);
1326
1400
  if (!config) {
@@ -1340,10 +1414,12 @@ function calculateMaxLength(provider, prefix) {
1340
1414
  }
1341
1415
  return result;
1342
1416
  }
1417
+ __name(calculateMaxLength, "calculateMaxLength");
1343
1418
  function shouldAbort(status) {
1344
1419
  return status === 404;
1345
1420
  }
1346
- var prepare = (provider, prefix, icons) => {
1421
+ __name(shouldAbort, "shouldAbort");
1422
+ var prepare = /* @__PURE__ */__name((provider, prefix, icons) => {
1347
1423
  const results = [];
1348
1424
  const maxLength = calculateMaxLength(provider, prefix);
1349
1425
  const type = "icons";
@@ -1370,7 +1446,7 @@ var prepare = (provider, prefix, icons) => {
1370
1446
  });
1371
1447
  results.push(item);
1372
1448
  return results;
1373
- };
1449
+ }, "prepare");
1374
1450
  function getPath(provider) {
1375
1451
  if (typeof provider === "string") {
1376
1452
  const config = getAPIConfig(provider);
@@ -1380,7 +1456,8 @@ function getPath(provider) {
1380
1456
  }
1381
1457
  return "/";
1382
1458
  }
1383
- var send = (host, params, callback) => {
1459
+ __name(getPath, "getPath");
1460
+ var send = /* @__PURE__ */__name((host, params, callback) => {
1384
1461
  if (!fetchModule) {
1385
1462
  callback("abort", 424);
1386
1463
  return;
@@ -1436,7 +1513,7 @@ var send = (host, params, callback) => {
1436
1513
  }).catch(() => {
1437
1514
  callback("next", defaultError);
1438
1515
  });
1439
- };
1516
+ }, "send");
1440
1517
  var fetchAPIModule = {
1441
1518
  prepare,
1442
1519
  send
@@ -1444,14 +1521,17 @@ var fetchAPIModule = {
1444
1521
  function setCustomIconsLoader$1(loader, prefix, provider) {
1445
1522
  getStorage(provider || "", prefix).loadIcons = loader;
1446
1523
  }
1524
+ __name(setCustomIconsLoader$1, "setCustomIconsLoader$1");
1447
1525
  function setCustomIconLoader$1(loader, prefix, provider) {
1448
1526
  getStorage(provider || "", prefix).loadIcon = loader;
1449
1527
  }
1528
+ __name(setCustomIconLoader$1, "setCustomIconLoader$1");
1450
1529
  var nodeAttr = "data-style";
1451
1530
  var customStyle = "";
1452
1531
  function appendCustomStyle(style) {
1453
1532
  customStyle = style;
1454
1533
  }
1534
+ __name(appendCustomStyle, "appendCustomStyle");
1455
1535
  function updateStyle(parent, inline) {
1456
1536
  let styleNode = Array.from(parent.childNodes).find(node => node.hasAttribute && node.hasAttribute(nodeAttr));
1457
1537
  if (!styleNode) {
@@ -1461,6 +1541,7 @@ function updateStyle(parent, inline) {
1461
1541
  }
1462
1542
  styleNode.textContent = ":host{display:inline-block;vertical-align:" + (inline ? "-0.125em" : "0") + "}span,svg{display:block;margin:auto}" + customStyle;
1463
1543
  }
1544
+ __name(updateStyle, "updateStyle");
1464
1545
  function exportFunctions() {
1465
1546
  setAPIModule("", fetchAPIModule);
1466
1547
  allowSimpleNames(true);
@@ -1520,9 +1601,9 @@ function exportFunctions() {
1520
1601
  };
1521
1602
  return {
1522
1603
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1523
- enableCache: storage2 => {},
1604
+ enableCache: /* @__PURE__ */__name(storage2 => {}, "enableCache"),
1524
1605
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1525
- disableCache: storage2 => {},
1606
+ disableCache: /* @__PURE__ */__name(storage2 => {}, "disableCache"),
1526
1607
  iconLoaded: iconLoaded$1,
1527
1608
  iconExists: iconLoaded$1,
1528
1609
  // deprecated, kept to avoid breaking changes
@@ -1543,6 +1624,7 @@ function exportFunctions() {
1543
1624
  _api: _api2
1544
1625
  };
1545
1626
  }
1627
+ __name(exportFunctions, "exportFunctions");
1546
1628
  var monotoneProps = {
1547
1629
  "background-color": "currentColor"
1548
1630
  };
@@ -1568,6 +1650,7 @@ for (const prefix in propsToAddTo) {
1568
1650
  function fixSize(value) {
1569
1651
  return value ? value + (value.match(/^[-0-9.]+$/) ? "px" : "") : "inherit";
1570
1652
  }
1653
+ __name(fixSize, "fixSize");
1571
1654
  function renderSPAN(data, icon, useMask) {
1572
1655
  const node = document.createElement("span");
1573
1656
  let body = data.body;
@@ -1593,23 +1676,26 @@ function renderSPAN(data, icon, useMask) {
1593
1676
  }
1594
1677
  return node;
1595
1678
  }
1679
+ __name(renderSPAN, "renderSPAN");
1596
1680
  var policy;
1597
1681
  function createPolicy() {
1598
1682
  try {
1599
1683
  policy = window.trustedTypes.createPolicy("iconify", {
1600
1684
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
1601
- createHTML: s => s
1685
+ createHTML: /* @__PURE__ */__name(s => s, "createHTML")
1602
1686
  });
1603
1687
  } catch (err) {
1604
1688
  policy = null;
1605
1689
  }
1606
1690
  }
1691
+ __name(createPolicy, "createPolicy");
1607
1692
  function cleanUpInnerHTML(html) {
1608
1693
  if (policy === void 0) {
1609
1694
  createPolicy();
1610
1695
  }
1611
1696
  return policy ? policy.createHTML(html) : html;
1612
1697
  }
1698
+ __name(cleanUpInnerHTML, "cleanUpInnerHTML");
1613
1699
  function renderSVG(data) {
1614
1700
  const node = document.createElement("span");
1615
1701
  const attr = data.attributes;
@@ -1627,12 +1713,14 @@ function renderSVG(data) {
1627
1713
  node.innerHTML = cleanUpInnerHTML(html);
1628
1714
  return node.firstChild;
1629
1715
  }
1716
+ __name(renderSVG, "renderSVG");
1630
1717
  function findIconElement(parent) {
1631
1718
  return Array.from(parent.childNodes).find(node => {
1632
1719
  const tag = node.tagName && node.tagName.toUpperCase();
1633
1720
  return tag === "SPAN" || tag === "SVG";
1634
1721
  });
1635
1722
  }
1723
+ __name(findIconElement, "findIconElement");
1636
1724
  function renderIcon(parent, state) {
1637
1725
  const iconData = state.icon.data;
1638
1726
  const customisations = state.customisations;
@@ -1663,6 +1751,7 @@ function renderIcon(parent, state) {
1663
1751
  parent.appendChild(node);
1664
1752
  }
1665
1753
  }
1754
+ __name(renderIcon, "renderIcon");
1666
1755
  function setPendingState(icon, inline, lastState) {
1667
1756
  const lastRender = lastState && (lastState.rendered ? lastState : lastState.lastRender);
1668
1757
  return {
@@ -1672,6 +1761,7 @@ function setPendingState(icon, inline, lastState) {
1672
1761
  lastRender
1673
1762
  };
1674
1763
  }
1764
+ __name(setPendingState, "setPendingState");
1675
1765
  function defineIconifyIcon(name = "iconify-icon") {
1676
1766
  let customElements;
1677
1767
  let ParentClass;
@@ -1695,7 +1785,10 @@ function defineIconifyIcon(name = "iconify-icon") {
1695
1785
  "mode", "inline", "noobserver",
1696
1786
  // Customisations
1697
1787
  "width", "height", "rotate", "flip"];
1698
- const IconifyIcon2 = class extends ParentClass {
1788
+ const IconifyIcon = class extends ParentClass {
1789
+ static {
1790
+ __name(this, "IconifyIcon");
1791
+ }
1699
1792
  // Root
1700
1793
  _shadowRoot;
1701
1794
  // Initialised
@@ -1991,28 +2084,29 @@ function defineIconifyIcon(name = "iconify-icon") {
1991
2084
  }
1992
2085
  };
1993
2086
  attributes.forEach(attr => {
1994
- if (!(attr in IconifyIcon2.prototype)) {
1995
- Object.defineProperty(IconifyIcon2.prototype, attr, {
1996
- get: function () {
2087
+ if (!(attr in IconifyIcon.prototype)) {
2088
+ Object.defineProperty(IconifyIcon.prototype, attr, {
2089
+ get: /* @__PURE__ */__name(function () {
1997
2090
  return this.getAttribute(attr);
1998
- },
1999
- set: function (value) {
2091
+ }, "get"),
2092
+ set: /* @__PURE__ */__name(function (value) {
2000
2093
  if (value !== null) {
2001
2094
  this.setAttribute(attr, value);
2002
2095
  } else {
2003
2096
  this.removeAttribute(attr);
2004
2097
  }
2005
- }
2098
+ }, "set")
2006
2099
  });
2007
2100
  }
2008
2101
  });
2009
2102
  const functions = exportFunctions();
2010
2103
  for (const key in functions) {
2011
- IconifyIcon2[key] = IconifyIcon2.prototype[key] = functions[key];
2104
+ IconifyIcon[key] = IconifyIcon.prototype[key] = functions[key];
2012
2105
  }
2013
- customElements.define(name, IconifyIcon2);
2014
- return IconifyIcon2;
2106
+ customElements.define(name, IconifyIcon);
2107
+ return IconifyIcon;
2015
2108
  }
2109
+ __name(defineIconifyIcon, "defineIconifyIcon");
2016
2110
  var IconifyIconComponent = defineIconifyIcon() || exportFunctions();
2017
2111
  var {
2018
2112
  enableCache,
@@ -2056,9 +2150,8 @@ var Icon = React.forwardRef((props, ref) => {
2056
2150
 
2057
2151
  // ../react-icons/src/Icon.tsx
2058
2152
  import * as React2 from "react";
2059
- import { jsx } from "react/jsx-runtime";
2060
- var Icon2 = React2.forwardRef((props, ref) => {
2061
- return /* @__PURE__ */jsx(Icon, {
2153
+ var Icon2 = /* @__PURE__ */React2.forwardRef((props, ref) => {
2154
+ return /* @__PURE__ */React2.createElement(Icon, {
2062
2155
  ref,
2063
2156
  "data-testid": "iconify-icon",
2064
2157
  ...props