@symbo.ls/scratch 2.11.375 → 2.11.394

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.
package/dist/cjs/set.js CHANGED
@@ -293,6 +293,7 @@ var require_array = __commonJS({
293
293
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
294
294
  var array_exports = {};
295
295
  __export2(array_exports, {
296
+ addItemAfterEveryElement: () => addItemAfterEveryElement,
296
297
  arrayContainsOtherArray: () => arrayContainsOtherArray,
297
298
  createNestedObject: () => createNestedObject,
298
299
  cutArrayAfterValue: () => cutArrayAfterValue,
@@ -304,6 +305,7 @@ var require_array = __commonJS({
304
305
  removeFromArray: () => removeFromArray,
305
306
  removeValueFromArray: () => removeValueFromArray,
306
307
  removeValueFromArrayAll: () => removeValueFromArrayAll,
308
+ reorderArrayByValues: () => reorderArrayByValues,
307
309
  swapItemsInArray: () => swapItemsInArray
308
310
  });
309
311
  module2.exports = __toCommonJS2(array_exports);
@@ -388,6 +390,27 @@ var require_array = __commonJS({
388
390
  var removeValueFromArrayAll = (arr, value) => {
389
391
  return arr.filter((item) => item !== value);
390
392
  };
393
+ var addItemAfterEveryElement = (array, item) => {
394
+ const result = [];
395
+ for (let i = 0; i < array.length; i++) {
396
+ result.push(array[i]);
397
+ if (i < array.length - 1) {
398
+ result.push(item);
399
+ }
400
+ }
401
+ return result;
402
+ };
403
+ var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
404
+ const newArray = [...array];
405
+ const indexToMove = newArray.indexOf(valueToMove);
406
+ const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
407
+ if (indexToMove !== -1 && indexToInsertBefore !== -1) {
408
+ const removedItem = newArray.splice(indexToMove, 1)[0];
409
+ const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
410
+ newArray.splice(insertIndex, 0, removedItem);
411
+ }
412
+ return newArray;
413
+ };
391
414
  }
392
415
  });
393
416
 
@@ -664,7 +687,7 @@ var require_object = __commonJS({
664
687
  }
665
688
  return stringified;
666
689
  };
667
- var objectToString = (obj, indent = 0) => {
690
+ var objectToString = (obj = {}, indent = 0) => {
668
691
  const spaces = " ".repeat(indent);
669
692
  let str = "{\n";
670
693
  for (const [key, value] of Object.entries(obj)) {
@@ -731,7 +754,7 @@ var require_object = __commonJS({
731
754
  continue;
732
755
  const objProp = obj[prop];
733
756
  if ((0, import_types.isString)(objProp)) {
734
- if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
757
+ if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
735
758
  try {
736
759
  const evalProp = import_globals3.window.eval(`(${objProp})`);
737
760
  destringified[prop] = evalProp;
@@ -1119,20 +1142,21 @@ var require_cookie = __commonJS({
1119
1142
  });
1120
1143
  module2.exports = __toCommonJS2(cookie_exports);
1121
1144
  var import_types = require_types();
1145
+ var import_utils26 = require_cjs();
1122
1146
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1123
1147
  var setCookie = (cname, cvalue, exdays = 365) => {
1124
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1148
+ if ((0, import_types.isUndefined)(import_utils26.document) || (0, import_types.isUndefined)(import_utils26.document.cookie))
1125
1149
  return;
1126
1150
  const d = /* @__PURE__ */ new Date();
1127
1151
  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1128
1152
  const expires = `expires=${d.toUTCString()}`;
1129
- document.cookie = `${cname}=${cvalue};${expires};path=/`;
1153
+ import_utils26.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1130
1154
  };
1131
1155
  var getCookie = (cname) => {
1132
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1156
+ if ((0, import_types.isUndefined)(import_utils26.document) || (0, import_types.isUndefined)(import_utils26.document.cookie))
1133
1157
  return;
1134
1158
  const name = `${cname}=`;
1135
- const decodedCookie = decodeURIComponent(document.cookie);
1159
+ const decodedCookie = decodeURIComponent(import_utils26.document.cookie);
1136
1160
  const ca = decodedCookie.split(";");
1137
1161
  for (let i = 0; i < ca.length; i++) {
1138
1162
  let c = ca[i];
@@ -1671,6 +1695,7 @@ var require_cjs3 = __commonJS({
1671
1695
  var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1672
1696
  var array_exports = {};
1673
1697
  __export22(array_exports, {
1698
+ addItemAfterEveryElement: () => addItemAfterEveryElement,
1674
1699
  arrayContainsOtherArray: () => arrayContainsOtherArray,
1675
1700
  createNestedObject: () => createNestedObject,
1676
1701
  cutArrayAfterValue: () => cutArrayAfterValue,
@@ -1682,6 +1707,7 @@ var require_cjs3 = __commonJS({
1682
1707
  removeFromArray: () => removeFromArray,
1683
1708
  removeValueFromArray: () => removeValueFromArray,
1684
1709
  removeValueFromArrayAll: () => removeValueFromArrayAll,
1710
+ reorderArrayByValues: () => reorderArrayByValues,
1685
1711
  swapItemsInArray: () => swapItemsInArray
1686
1712
  });
1687
1713
  module22.exports = __toCommonJS22(array_exports);
@@ -1766,6 +1792,27 @@ var require_cjs3 = __commonJS({
1766
1792
  var removeValueFromArrayAll = (arr, value) => {
1767
1793
  return arr.filter((item) => item !== value);
1768
1794
  };
1795
+ var addItemAfterEveryElement = (array, item) => {
1796
+ const result = [];
1797
+ for (let i = 0; i < array.length; i++) {
1798
+ result.push(array[i]);
1799
+ if (i < array.length - 1) {
1800
+ result.push(item);
1801
+ }
1802
+ }
1803
+ return result;
1804
+ };
1805
+ var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
1806
+ const newArray = [...array];
1807
+ const indexToMove = newArray.indexOf(valueToMove);
1808
+ const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
1809
+ if (indexToMove !== -1 && indexToInsertBefore !== -1) {
1810
+ const removedItem = newArray.splice(indexToMove, 1)[0];
1811
+ const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
1812
+ newArray.splice(insertIndex, 0, removedItem);
1813
+ }
1814
+ return newArray;
1815
+ };
1769
1816
  }
1770
1817
  });
1771
1818
  var require_string2 = __commonJS2({
@@ -2038,7 +2085,7 @@ var require_cjs3 = __commonJS({
2038
2085
  }
2039
2086
  return stringified;
2040
2087
  };
2041
- var objectToString = (obj, indent = 0) => {
2088
+ var objectToString = (obj = {}, indent = 0) => {
2042
2089
  const spaces = " ".repeat(indent);
2043
2090
  let str = "{\n";
2044
2091
  for (const [key, value] of Object.entries(obj)) {
@@ -2105,7 +2152,7 @@ var require_cjs3 = __commonJS({
2105
2152
  continue;
2106
2153
  const objProp = obj[prop];
2107
2154
  if ((0, import_types.isString)(objProp)) {
2108
- if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2155
+ if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2109
2156
  try {
2110
2157
  const evalProp = import_globals3.window.eval(`(${objProp})`);
2111
2158
  destringified[prop] = evalProp;
@@ -2487,20 +2534,21 @@ var require_cjs3 = __commonJS({
2487
2534
  });
2488
2535
  module22.exports = __toCommonJS22(cookie_exports);
2489
2536
  var import_types = require_types2();
2537
+ var import_utils32 = require_cjs4();
2490
2538
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
2491
2539
  var setCookie = (cname, cvalue, exdays = 365) => {
2492
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
2540
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2493
2541
  return;
2494
2542
  const d = /* @__PURE__ */ new Date();
2495
2543
  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
2496
2544
  const expires = `expires=${d.toUTCString()}`;
2497
- document.cookie = `${cname}=${cvalue};${expires};path=/`;
2545
+ import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
2498
2546
  };
2499
2547
  var getCookie = (cname) => {
2500
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
2548
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2501
2549
  return;
2502
2550
  const name = `${cname}=`;
2503
- const decodedCookie = decodeURIComponent(document.cookie);
2551
+ const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
2504
2552
  const ca = decodedCookie.split(";");
2505
2553
  for (let i = 0; i < ca.length; i++) {
2506
2554
  let c = ca[i];
@@ -2720,6 +2768,7 @@ var require_cjs3 = __commonJS({
2720
2768
  findClosestNumber: () => findClosestNumber,
2721
2769
  findClosestNumberInFactory: () => findClosestNumberInFactory,
2722
2770
  formatDate: () => formatDate,
2771
+ loadJavascript: () => loadJavascript,
2723
2772
  loadJavascriptFile: () => loadJavascriptFile,
2724
2773
  removeChars: () => removeChars,
2725
2774
  toCamelCase: () => toCamelCase2,
@@ -2791,6 +2840,17 @@ var require_cjs3 = __commonJS({
2791
2840
  }
2792
2841
  });
2793
2842
  };
2843
+ var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
2844
+ try {
2845
+ const scriptEle = doc.createElement("script");
2846
+ scriptEle.type = type;
2847
+ scriptEle.async = async;
2848
+ scriptEle.innerHTML = body;
2849
+ doc.body.appendChild(scriptEle);
2850
+ } catch (error) {
2851
+ console.warn(error);
2852
+ }
2853
+ };
2794
2854
  var copyStringToClipboard = (str) => {
2795
2855
  const el = document.createElement("textarea");
2796
2856
  el.value = str;
@@ -2817,6 +2877,8 @@ var require_cjs3 = __commonJS({
2817
2877
  );
2818
2878
  var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
2819
2879
  var toDescriptionCase = (str = "") => {
2880
+ if (typeof str !== "string")
2881
+ return;
2820
2882
  const result = str.replace(/([A-Z])/g, " $1");
2821
2883
  return result.charAt(0).toUpperCase() + result.slice(1);
2822
2884
  };
@@ -2864,6 +2926,7 @@ __export(defaultConfig_exports, {
2864
2926
  ICONS: () => ICONS,
2865
2927
  MEDIA: () => MEDIA,
2866
2928
  RESET: () => RESET,
2929
+ SEMANTIC_ICONS: () => SEMANTIC_ICONS,
2867
2930
  SEQUENCE: () => SEQUENCE,
2868
2931
  SHADOW: () => SHADOW,
2869
2932
  SPACING: () => SPACING,
@@ -2975,6 +3038,7 @@ var SHADOW = {};
2975
3038
 
2976
3039
  // src/defaultConfig/icons.js
2977
3040
  var ICONS = {};
3041
+ var SEMANTIC_ICONS = {};
2978
3042
 
2979
3043
  // src/defaultConfig/timing.js
2980
3044
  var defaultProps3 = {
@@ -3055,7 +3119,7 @@ var FACTORY = {
3055
3119
  0: CONFIG
3056
3120
  };
3057
3121
  var getActiveConfig = (def) => {
3058
- return FACTORY[def || FACTORY.active];
3122
+ return FACTORY[def || FACTORY.active] || CONFIG;
3059
3123
  };
3060
3124
  var setActiveConfig = (newConfig) => {
3061
3125
  if (!(0, import_utils.isObject)(newConfig))
@@ -4118,9 +4182,10 @@ var setSVG = (val, key) => {
4118
4182
  }
4119
4183
  return val;
4120
4184
  };
4121
- var setIcon = (val, key) => {
4185
+ var setSvgIcon = (val, key) => {
4186
+ var _a;
4122
4187
  const CONFIG2 = getActiveConfig();
4123
- if (CONFIG2.useIconSprite) {
4188
+ if (CONFIG2.useIconSprite && !((_a = CONFIG2.SEMANTIC_ICONS) == null ? void 0 : _a[key])) {
4124
4189
  return setSVG(val, key);
4125
4190
  }
4126
4191
  return val;
@@ -4202,7 +4267,8 @@ var VALUE_TRANSFORMERS = {
4202
4267
  font: setFont,
4203
4268
  font_family: setFontFamily,
4204
4269
  theme: setTheme,
4205
- icons: setIcon,
4270
+ icons: setSvgIcon,
4271
+ semantic_icons: setSameValue,
4206
4272
  svg: setSVG,
4207
4273
  svg_data: setSameValue,
4208
4274
  typography: setSameValue,
@@ -4250,6 +4316,7 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
4250
4316
  globalTheme,
4251
4317
  useDocumentTheme,
4252
4318
  useDefaultConfig,
4319
+ SEMANTIC_ICONS: SEMANTIC_ICONS2,
4253
4320
  ...config
4254
4321
  } = recivedConfig;
4255
4322
  if (options.newConfig) {
@@ -4273,15 +4340,20 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
4273
4340
  CONFIG2.globalTheme = globalTheme;
4274
4341
  if (useDefaultConfig !== void 0)
4275
4342
  CONFIG2.useDefaultConfig = useDefaultConfig;
4343
+ if (SEMANTIC_ICONS2 !== void 0)
4344
+ CONFIG2.SEMANTIC_ICONS = SEMANTIC_ICONS2;
4276
4345
  if (CONFIG2.verbose)
4277
4346
  console.log(CONFIG2);
4278
4347
  if (!CONFIG2.__svg_cache)
4279
4348
  CONFIG2.__svg_cache = {};
4280
4349
  const keys = Object.keys(config);
4281
4350
  keys.map((key) => setEach(key, config[key]));
4282
- applyTypographySequence();
4283
- applySpacingSequence();
4284
- applyTimingSequence();
4351
+ if (config.TYPOGRAPHY)
4352
+ applyTypographySequence();
4353
+ if (config.SPACING)
4354
+ applySpacingSequence();
4355
+ if (config.TIMING)
4356
+ applyTimingSequence();
4285
4357
  applyDocument();
4286
4358
  applyReset();
4287
4359
  return CONFIG2;
@@ -293,6 +293,7 @@ var require_array = __commonJS({
293
293
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
294
294
  var array_exports = {};
295
295
  __export2(array_exports, {
296
+ addItemAfterEveryElement: () => addItemAfterEveryElement,
296
297
  arrayContainsOtherArray: () => arrayContainsOtherArray,
297
298
  createNestedObject: () => createNestedObject,
298
299
  cutArrayAfterValue: () => cutArrayAfterValue,
@@ -304,6 +305,7 @@ var require_array = __commonJS({
304
305
  removeFromArray: () => removeFromArray,
305
306
  removeValueFromArray: () => removeValueFromArray,
306
307
  removeValueFromArrayAll: () => removeValueFromArrayAll,
308
+ reorderArrayByValues: () => reorderArrayByValues,
307
309
  swapItemsInArray: () => swapItemsInArray
308
310
  });
309
311
  module2.exports = __toCommonJS2(array_exports);
@@ -388,6 +390,27 @@ var require_array = __commonJS({
388
390
  var removeValueFromArrayAll = (arr, value) => {
389
391
  return arr.filter((item) => item !== value);
390
392
  };
393
+ var addItemAfterEveryElement = (array, item) => {
394
+ const result = [];
395
+ for (let i = 0; i < array.length; i++) {
396
+ result.push(array[i]);
397
+ if (i < array.length - 1) {
398
+ result.push(item);
399
+ }
400
+ }
401
+ return result;
402
+ };
403
+ var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
404
+ const newArray = [...array];
405
+ const indexToMove = newArray.indexOf(valueToMove);
406
+ const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
407
+ if (indexToMove !== -1 && indexToInsertBefore !== -1) {
408
+ const removedItem = newArray.splice(indexToMove, 1)[0];
409
+ const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
410
+ newArray.splice(insertIndex, 0, removedItem);
411
+ }
412
+ return newArray;
413
+ };
391
414
  }
392
415
  });
393
416
 
@@ -664,7 +687,7 @@ var require_object = __commonJS({
664
687
  }
665
688
  return stringified;
666
689
  };
667
- var objectToString = (obj, indent = 0) => {
690
+ var objectToString = (obj = {}, indent = 0) => {
668
691
  const spaces = " ".repeat(indent);
669
692
  let str = "{\n";
670
693
  for (const [key, value] of Object.entries(obj)) {
@@ -731,7 +754,7 @@ var require_object = __commonJS({
731
754
  continue;
732
755
  const objProp = obj[prop];
733
756
  if ((0, import_types.isString)(objProp)) {
734
- if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
757
+ if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
735
758
  try {
736
759
  const evalProp = import_globals2.window.eval(`(${objProp})`);
737
760
  destringified[prop] = evalProp;
@@ -1119,20 +1142,21 @@ var require_cookie = __commonJS({
1119
1142
  });
1120
1143
  module2.exports = __toCommonJS2(cookie_exports);
1121
1144
  var import_types = require_types();
1145
+ var import_utils9 = require_cjs();
1122
1146
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1123
1147
  var setCookie = (cname, cvalue, exdays = 365) => {
1124
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1148
+ if ((0, import_types.isUndefined)(import_utils9.document) || (0, import_types.isUndefined)(import_utils9.document.cookie))
1125
1149
  return;
1126
1150
  const d = /* @__PURE__ */ new Date();
1127
1151
  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1128
1152
  const expires = `expires=${d.toUTCString()}`;
1129
- document.cookie = `${cname}=${cvalue};${expires};path=/`;
1153
+ import_utils9.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1130
1154
  };
1131
1155
  var getCookie = (cname) => {
1132
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1156
+ if ((0, import_types.isUndefined)(import_utils9.document) || (0, import_types.isUndefined)(import_utils9.document.cookie))
1133
1157
  return;
1134
1158
  const name = `${cname}=`;
1135
- const decodedCookie = decodeURIComponent(document.cookie);
1159
+ const decodedCookie = decodeURIComponent(import_utils9.document.cookie);
1136
1160
  const ca = decodedCookie.split(";");
1137
1161
  for (let i = 0; i < ca.length; i++) {
1138
1162
  let c = ca[i];
@@ -1671,6 +1695,7 @@ var require_cjs3 = __commonJS({
1671
1695
  var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1672
1696
  var array_exports = {};
1673
1697
  __export22(array_exports, {
1698
+ addItemAfterEveryElement: () => addItemAfterEveryElement,
1674
1699
  arrayContainsOtherArray: () => arrayContainsOtherArray,
1675
1700
  createNestedObject: () => createNestedObject,
1676
1701
  cutArrayAfterValue: () => cutArrayAfterValue,
@@ -1682,6 +1707,7 @@ var require_cjs3 = __commonJS({
1682
1707
  removeFromArray: () => removeFromArray,
1683
1708
  removeValueFromArray: () => removeValueFromArray,
1684
1709
  removeValueFromArrayAll: () => removeValueFromArrayAll,
1710
+ reorderArrayByValues: () => reorderArrayByValues,
1685
1711
  swapItemsInArray: () => swapItemsInArray
1686
1712
  });
1687
1713
  module22.exports = __toCommonJS22(array_exports);
@@ -1766,6 +1792,27 @@ var require_cjs3 = __commonJS({
1766
1792
  var removeValueFromArrayAll = (arr, value) => {
1767
1793
  return arr.filter((item) => item !== value);
1768
1794
  };
1795
+ var addItemAfterEveryElement = (array, item) => {
1796
+ const result = [];
1797
+ for (let i = 0; i < array.length; i++) {
1798
+ result.push(array[i]);
1799
+ if (i < array.length - 1) {
1800
+ result.push(item);
1801
+ }
1802
+ }
1803
+ return result;
1804
+ };
1805
+ var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
1806
+ const newArray = [...array];
1807
+ const indexToMove = newArray.indexOf(valueToMove);
1808
+ const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
1809
+ if (indexToMove !== -1 && indexToInsertBefore !== -1) {
1810
+ const removedItem = newArray.splice(indexToMove, 1)[0];
1811
+ const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
1812
+ newArray.splice(insertIndex, 0, removedItem);
1813
+ }
1814
+ return newArray;
1815
+ };
1769
1816
  }
1770
1817
  });
1771
1818
  var require_string2 = __commonJS2({
@@ -2038,7 +2085,7 @@ var require_cjs3 = __commonJS({
2038
2085
  }
2039
2086
  return stringified;
2040
2087
  };
2041
- var objectToString = (obj, indent = 0) => {
2088
+ var objectToString = (obj = {}, indent = 0) => {
2042
2089
  const spaces = " ".repeat(indent);
2043
2090
  let str = "{\n";
2044
2091
  for (const [key, value] of Object.entries(obj)) {
@@ -2105,7 +2152,7 @@ var require_cjs3 = __commonJS({
2105
2152
  continue;
2106
2153
  const objProp = obj[prop];
2107
2154
  if ((0, import_types.isString)(objProp)) {
2108
- if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2155
+ if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2109
2156
  try {
2110
2157
  const evalProp = import_globals2.window.eval(`(${objProp})`);
2111
2158
  destringified[prop] = evalProp;
@@ -2487,20 +2534,21 @@ var require_cjs3 = __commonJS({
2487
2534
  });
2488
2535
  module22.exports = __toCommonJS22(cookie_exports);
2489
2536
  var import_types = require_types2();
2537
+ var import_utils32 = require_cjs4();
2490
2538
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
2491
2539
  var setCookie = (cname, cvalue, exdays = 365) => {
2492
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
2540
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2493
2541
  return;
2494
2542
  const d = /* @__PURE__ */ new Date();
2495
2543
  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
2496
2544
  const expires = `expires=${d.toUTCString()}`;
2497
- document.cookie = `${cname}=${cvalue};${expires};path=/`;
2545
+ import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
2498
2546
  };
2499
2547
  var getCookie = (cname) => {
2500
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
2548
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2501
2549
  return;
2502
2550
  const name = `${cname}=`;
2503
- const decodedCookie = decodeURIComponent(document.cookie);
2551
+ const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
2504
2552
  const ca = decodedCookie.split(";");
2505
2553
  for (let i = 0; i < ca.length; i++) {
2506
2554
  let c = ca[i];
@@ -2720,6 +2768,7 @@ var require_cjs3 = __commonJS({
2720
2768
  findClosestNumber: () => findClosestNumber,
2721
2769
  findClosestNumberInFactory: () => findClosestNumberInFactory,
2722
2770
  formatDate: () => formatDate,
2771
+ loadJavascript: () => loadJavascript,
2723
2772
  loadJavascriptFile: () => loadJavascriptFile,
2724
2773
  removeChars: () => removeChars,
2725
2774
  toCamelCase: () => toCamelCase,
@@ -2791,6 +2840,17 @@ var require_cjs3 = __commonJS({
2791
2840
  }
2792
2841
  });
2793
2842
  };
2843
+ var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
2844
+ try {
2845
+ const scriptEle = doc.createElement("script");
2846
+ scriptEle.type = type;
2847
+ scriptEle.async = async;
2848
+ scriptEle.innerHTML = body;
2849
+ doc.body.appendChild(scriptEle);
2850
+ } catch (error) {
2851
+ console.warn(error);
2852
+ }
2853
+ };
2794
2854
  var copyStringToClipboard = (str) => {
2795
2855
  const el = document.createElement("textarea");
2796
2856
  el.value = str;
@@ -2817,6 +2877,8 @@ var require_cjs3 = __commonJS({
2817
2877
  );
2818
2878
  var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
2819
2879
  var toDescriptionCase = (str = "") => {
2880
+ if (typeof str !== "string")
2881
+ return;
2820
2882
  const result = str.replace(/([A-Z])/g, " $1");
2821
2883
  return result.charAt(0).toUpperCase() + result.slice(1);
2822
2884
  };
@@ -2865,6 +2927,7 @@ __export(defaultConfig_exports, {
2865
2927
  ICONS: () => ICONS,
2866
2928
  MEDIA: () => MEDIA,
2867
2929
  RESET: () => RESET,
2930
+ SEMANTIC_ICONS: () => SEMANTIC_ICONS,
2868
2931
  SEQUENCE: () => SEQUENCE,
2869
2932
  SHADOW: () => SHADOW,
2870
2933
  SPACING: () => SPACING,
@@ -2976,6 +3039,7 @@ var SHADOW = {};
2976
3039
 
2977
3040
  // src/defaultConfig/icons.js
2978
3041
  var ICONS = {};
3042
+ var SEMANTIC_ICONS = {};
2979
3043
 
2980
3044
  // src/defaultConfig/timing.js
2981
3045
  var defaultProps3 = {
@@ -3056,7 +3120,7 @@ var FACTORY = {
3056
3120
  0: CONFIG
3057
3121
  };
3058
3122
  var getActiveConfig = (def) => {
3059
- return FACTORY[def || FACTORY.active];
3123
+ return FACTORY[def || FACTORY.active] || CONFIG;
3060
3124
  };
3061
3125
 
3062
3126
  // src/utils/color.js