@symbo.ls/scratch 2.11.36 → 2.11.92

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.
@@ -282,13 +282,13 @@ var require_cjs3 = __commonJS({
282
282
  document: () => document4,
283
283
  global: () => global,
284
284
  self: () => self,
285
- window: () => window3
285
+ window: () => window2
286
286
  });
287
287
  module2.exports = __toCommonJS2(globals_exports);
288
288
  var global = globalThis;
289
289
  var self = globalThis;
290
- var window3 = globalThis;
291
- var document4 = window3.document;
290
+ var window2 = globalThis;
291
+ var document4 = window2.document;
292
292
  }
293
293
  });
294
294
 
@@ -360,10 +360,10 @@ var require_types = __commonJS({
360
360
  isFunction: () => isFunction,
361
361
  isNot: () => isNot,
362
362
  isNull: () => isNull,
363
- isNumber: () => isNumber,
363
+ isNumber: () => isNumber2,
364
364
  isObject: () => isObject7,
365
365
  isObjectLike: () => isObjectLike3,
366
- isString: () => isString7,
366
+ isString: () => isString8,
367
367
  isUndefined: () => isUndefined,
368
368
  isValidHtmlTag: () => isValidHtmlTag
369
369
  });
@@ -376,8 +376,8 @@ var require_types = __commonJS({
376
376
  return false;
377
377
  return typeof arg === "object" && arg.constructor === Object;
378
378
  };
379
- var isString7 = (arg) => typeof arg === "string";
380
- var isNumber = (arg) => typeof arg === "number";
379
+ var isString8 = (arg) => typeof arg === "string";
380
+ var isNumber2 = (arg) => typeof arg === "number";
381
381
  var isFunction = (arg) => typeof arg === "function";
382
382
  var isBoolean = (arg) => arg === true || arg === false;
383
383
  var isNull = (arg) => arg === null;
@@ -388,7 +388,7 @@ var require_types = __commonJS({
388
388
  return typeof arg === "object";
389
389
  };
390
390
  var isDefined2 = (arg) => {
391
- return isObject7(arg) || isObjectLike3(arg) || isString7(arg) || isNumber(arg) || isFunction(arg) || isArray6(arg) || isObjectLike3(arg) || isBoolean(arg) || isNull(arg);
391
+ return isObject7(arg) || isObjectLike3(arg) || isString8(arg) || isNumber2(arg) || isFunction(arg) || isArray6(arg) || isObjectLike3(arg) || isBoolean(arg) || isNull(arg);
392
392
  };
393
393
  var isUndefined = (arg) => {
394
394
  return arg === void 0;
@@ -397,8 +397,8 @@ var require_types = __commonJS({
397
397
  boolean: isBoolean,
398
398
  array: isArray6,
399
399
  object: isObject7,
400
- string: isString7,
401
- number: isNumber,
400
+ string: isString8,
401
+ number: isNumber2,
402
402
  null: isNull,
403
403
  function: isFunction,
404
404
  objectLike: isObjectLike3,
@@ -443,6 +443,9 @@ var require_array = __commonJS({
443
443
  var array_exports = {};
444
444
  __export2(array_exports, {
445
445
  arrayContainsOtherArray: () => arrayContainsOtherArray,
446
+ createNestedObject: () => createNestedObject,
447
+ cutArrayAfterValue: () => cutArrayAfterValue,
448
+ cutArrayBeforeValue: () => cutArrayBeforeValue,
446
449
  joinArrays: () => joinArrays,
447
450
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
448
451
  mergeArray: () => mergeArray,
@@ -482,6 +485,73 @@ var require_array = __commonJS({
482
485
  var mergeAndCloneIfArray = (obj) => {
483
486
  return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
484
487
  };
488
+ var cutArrayBeforeValue = (arr, value) => {
489
+ const index = arr.indexOf(value);
490
+ if (index !== -1) {
491
+ return arr.slice(0, index);
492
+ }
493
+ return arr;
494
+ };
495
+ var cutArrayAfterValue = (arr, value) => {
496
+ const index = arr.indexOf(value);
497
+ if (index !== -1) {
498
+ return arr.slice(index + 1);
499
+ }
500
+ return arr;
501
+ };
502
+ var createNestedObject = (arr, lastValue) => {
503
+ let nestedObject = {};
504
+ if (arr.length === 0) {
505
+ return lastValue;
506
+ }
507
+ arr.reduce((obj, value, index) => {
508
+ if (!obj[value]) {
509
+ obj[value] = {};
510
+ }
511
+ if (index === arr.length - 1 && lastValue) {
512
+ obj[value] = lastValue;
513
+ }
514
+ return obj[value];
515
+ }, nestedObject);
516
+ return nestedObject;
517
+ };
518
+ }
519
+ });
520
+
521
+ // ../../node_modules/@domql/utils/dist/cjs/string.js
522
+ var require_string = __commonJS({
523
+ "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
524
+ "use strict";
525
+ var __defProp2 = Object.defineProperty;
526
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
527
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
528
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
529
+ var __export2 = (target, all) => {
530
+ for (var name in all)
531
+ __defProp2(target, name, { get: all[name], enumerable: true });
532
+ };
533
+ var __copyProps2 = (to, from, except, desc) => {
534
+ if (from && typeof from === "object" || typeof from === "function") {
535
+ for (let key of __getOwnPropNames2(from))
536
+ if (!__hasOwnProp2.call(to, key) && key !== except)
537
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
538
+ }
539
+ return to;
540
+ };
541
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
542
+ var string_exports = {};
543
+ __export2(string_exports, {
544
+ stringIncludesAny: () => stringIncludesAny
545
+ });
546
+ module2.exports = __toCommonJS2(string_exports);
547
+ var stringIncludesAny = (str, characters) => {
548
+ for (const char of characters) {
549
+ if (str.includes(char)) {
550
+ return true;
551
+ }
552
+ }
553
+ return false;
554
+ };
485
555
  }
486
556
  });
487
557
 
@@ -525,15 +595,18 @@ var require_object = __commonJS({
525
595
  merge: () => merge5,
526
596
  mergeArrayExclude: () => mergeArrayExclude,
527
597
  mergeIfExisted: () => mergeIfExisted,
598
+ objectToString: () => objectToString,
528
599
  overwrite: () => overwrite,
529
- overwriteDeep: () => overwriteDeep,
600
+ overwriteDeep: () => overwriteDeep2,
530
601
  overwriteShallow: () => overwriteShallow,
531
- removeFromObject: () => removeFromObject
602
+ removeFromObject: () => removeFromObject,
603
+ stringToObject: () => stringToObject
532
604
  });
533
605
  module2.exports = __toCommonJS2(object_exports);
534
606
  var import_globals3 = require_cjs3();
535
607
  var import_types = require_types();
536
608
  var import_array = require_array();
609
+ var import_string = require_string();
537
610
  var exec = (param, element, state, context) => {
538
611
  if ((0, import_types.isFunction)(param)) {
539
612
  return param(
@@ -551,7 +624,7 @@ var require_object = __commonJS({
551
624
  };
552
625
  var merge5 = (element, obj, excludeFrom = []) => {
553
626
  for (const e in obj) {
554
- if (excludeFrom.includes(e) || e.includes("__"))
627
+ if (excludeFrom.includes(e) || e.startsWith("__"))
555
628
  continue;
556
629
  const elementProp = element[e];
557
630
  const objProp = obj[e];
@@ -563,7 +636,7 @@ var require_object = __commonJS({
563
636
  };
564
637
  var deepMerge3 = (element, extend, excludeFrom = []) => {
565
638
  for (const e in extend) {
566
- if (excludeFrom.includes(e) || e.includes("__"))
639
+ if (excludeFrom.includes(e) || e.startsWith("__"))
567
640
  continue;
568
641
  const elementProp = element[e];
569
642
  const extendProp = extend[e];
@@ -578,7 +651,7 @@ var require_object = __commonJS({
578
651
  var clone = (obj, excludeFrom = []) => {
579
652
  const o = {};
580
653
  for (const prop in obj) {
581
- if (excludeFrom.includes(prop) || prop.includes("__"))
654
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
582
655
  continue;
583
656
  o[prop] = obj[prop];
584
657
  }
@@ -590,7 +663,7 @@ var require_object = __commonJS({
590
663
  }
591
664
  const o = {};
592
665
  for (const k in obj) {
593
- if (excludeFrom.includes(k) || k.includes("__"))
666
+ if (excludeFrom.includes(k) || k.startsWith("__"))
594
667
  continue;
595
668
  let v = obj[k];
596
669
  if (k === "extend" && (0, import_types.isArray)(v)) {
@@ -611,7 +684,7 @@ var require_object = __commonJS({
611
684
  var deepClone2 = (obj, excludeFrom = []) => {
612
685
  const o = (0, import_types.isArray)(obj) ? [] : {};
613
686
  for (const prop in obj) {
614
- if (excludeFrom.includes(prop) || prop.includes("__"))
687
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
615
688
  continue;
616
689
  let objProp = obj[prop];
617
690
  if (prop === "extend" && (0, import_types.isArray)(objProp)) {
@@ -650,6 +723,40 @@ var require_object = __commonJS({
650
723
  }
651
724
  return stringified;
652
725
  };
726
+ var objectToString = (obj, indent = 0) => {
727
+ const spaces = " ".repeat(indent);
728
+ let str = "{\n";
729
+ for (const [key, value] of Object.entries(obj)) {
730
+ const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
731
+ const stringedKey = keyAllowdChars ? `'${key}'` : key;
732
+ str += `${spaces} ${stringedKey}: `;
733
+ if ((0, import_types.isArray)(value)) {
734
+ str += "[\n";
735
+ for (const element of value) {
736
+ if ((0, import_types.isObject)(element) && element !== null) {
737
+ str += `${spaces} ${objectToString(element, indent + 2)},
738
+ `;
739
+ } else if ((0, import_types.isString)(element)) {
740
+ str += `${spaces} '${element}',
741
+ `;
742
+ } else {
743
+ str += `${spaces} ${element},
744
+ `;
745
+ }
746
+ }
747
+ str += `${spaces} ]`;
748
+ } else if ((0, import_types.isObject)(value)) {
749
+ str += objectToString(value, indent + 1);
750
+ } else if ((0, import_types.isString)(value)) {
751
+ str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
752
+ } else {
753
+ str += value;
754
+ }
755
+ str += ",\n";
756
+ }
757
+ str += `${spaces}}`;
758
+ return str;
759
+ };
653
760
  var detachFunctionsFromObject = (obj, detached = {}) => {
654
761
  for (const prop in obj) {
655
762
  const objProp = obj[prop];
@@ -720,6 +827,16 @@ var require_object = __commonJS({
720
827
  }
721
828
  return stringified;
722
829
  };
830
+ var stringToObject = (str) => {
831
+ let obj;
832
+ try {
833
+ obj = import_globals3.window.eval("(" + str + ")");
834
+ } catch (e) {
835
+ console.warn(e);
836
+ }
837
+ if (obj)
838
+ return obj;
839
+ };
723
840
  var diffObjects = (original, objToDiff, cache) => {
724
841
  for (const e in objToDiff) {
725
842
  if (e === "ref")
@@ -765,7 +882,7 @@ var require_object = __commonJS({
765
882
  const { ref } = element;
766
883
  const changes = {};
767
884
  for (const e in params) {
768
- if (excludeFrom.includes(e) || e.includes("__"))
885
+ if (excludeFrom.includes(e) || e.startsWith("__"))
769
886
  continue;
770
887
  const elementProp = element[e];
771
888
  const paramsProp = params[e];
@@ -778,20 +895,20 @@ var require_object = __commonJS({
778
895
  };
779
896
  var overwriteShallow = (obj, params, excludeFrom = []) => {
780
897
  for (const e in params) {
781
- if (excludeFrom.includes(e) || e.includes("__"))
898
+ if (excludeFrom.includes(e) || e.startsWith("__"))
782
899
  continue;
783
900
  obj[e] = params[e];
784
901
  }
785
902
  return obj;
786
903
  };
787
- var overwriteDeep = (obj, params, excludeFrom = []) => {
904
+ var overwriteDeep2 = (obj, params, excludeFrom = []) => {
788
905
  for (const e in params) {
789
- if (excludeFrom.includes(e) || e.includes("__"))
906
+ if (excludeFrom.includes(e) || e.startsWith("__"))
790
907
  continue;
791
908
  const objProp = obj[e];
792
909
  const paramsProp = params[e];
793
910
  if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
794
- overwriteDeep(objProp, paramsProp);
911
+ overwriteDeep2(objProp, paramsProp);
795
912
  } else if (paramsProp !== void 0) {
796
913
  obj[e] = paramsProp;
797
914
  }
@@ -967,6 +1084,7 @@ var require_cjs4 = __commonJS({
967
1084
  __reExport(utils_exports, require_array(), module2.exports);
968
1085
  __reExport(utils_exports, require_node(), module2.exports);
969
1086
  __reExport(utils_exports, require_log(), module2.exports);
1087
+ __reExport(utils_exports, require_string(), module2.exports);
970
1088
  }
971
1089
  });
972
1090
 
@@ -1223,10 +1341,11 @@ var getActiveConfig = (def) => {
1223
1341
  };
1224
1342
 
1225
1343
  // src/system/color.js
1226
- var import_utils8 = __toESM(require_cjs4(), 1);
1344
+ var import_utils9 = __toESM(require_cjs4(), 1);
1227
1345
 
1228
1346
  // src/utils/color.js
1229
1347
  var import_globals = __toESM(require_cjs3(), 1);
1348
+ var import_utils2 = __toESM(require_cjs4(), 1);
1230
1349
  var colorStringToRgbaArray = (color) => {
1231
1350
  if (color === "")
1232
1351
  return;
@@ -1299,7 +1418,25 @@ var getColorShade = (col, amt) => {
1299
1418
  g = 255;
1300
1419
  else if (g < 0)
1301
1420
  g = 0;
1302
- return (g | b << 8 | r << 16).toString(16);
1421
+ return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
1422
+ };
1423
+ var getRgbTone = (rgb, tone) => {
1424
+ if ((0, import_utils2.isString)(rgb))
1425
+ rgb = rgb.split(", ").map((v) => parseFloat(v));
1426
+ if ((0, import_utils2.isNumber)(tone))
1427
+ tone += "";
1428
+ const toHex = rgbArrayToHex(rgb);
1429
+ const abs = tone.slice(0, 1);
1430
+ if (abs === "-" || abs === "+") {
1431
+ const colorShade = getColorShade(toHex, parseFloat(tone));
1432
+ return hexToRgbArray(colorShade).join(", ");
1433
+ } else {
1434
+ const [r, g, b] = rgb;
1435
+ const hsl = rgbToHSL(r, g, b);
1436
+ const [h, s, l] = hsl;
1437
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1438
+ return newRgb;
1439
+ }
1303
1440
  };
1304
1441
 
1305
1442
  // src/utils/font.js
@@ -1329,13 +1466,13 @@ var getFontFaceEach = (name, weights) => {
1329
1466
  };
1330
1467
 
1331
1468
  // src/utils/sequence.js
1332
- var import_utils4 = __toESM(require_cjs4(), 1);
1469
+ var import_utils5 = __toESM(require_cjs4(), 1);
1333
1470
 
1334
1471
  // ../utils/src/index.js
1335
- var import_utils3 = __toESM(require_cjs4());
1472
+ var import_utils4 = __toESM(require_cjs4());
1336
1473
 
1337
1474
  // ../utils/src/scaling.js
1338
- var import_utils2 = __toESM(require_cjs4());
1475
+ var import_utils3 = __toESM(require_cjs4());
1339
1476
 
1340
1477
  // ../utils/src/index.js
1341
1478
  var toCamelCase = (str) => {
@@ -1343,13 +1480,13 @@ var toCamelCase = (str) => {
1343
1480
  return index === 0 ? word.toLowerCase() : word.toUpperCase();
1344
1481
  }).replaceAll(/\s+/g, "");
1345
1482
  };
1346
- var toDashCase = (val) => val.replace(/[A-Z]/g, (match, offset) => (offset > 0 ? "-" : "") + match.toLowerCase()).replace(".", "-");
1483
+ var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
1347
1484
  var arrayzeValue = (val) => {
1348
- if ((0, import_utils3.isString)(val))
1485
+ if ((0, import_utils4.isString)(val))
1349
1486
  return val.split(" ");
1350
- if ((0, import_utils3.isObject)(val))
1487
+ if ((0, import_utils4.isObject)(val))
1351
1488
  return Object.keys(val).map((v) => val[v]);
1352
- if ((0, import_utils3.isArray)(val))
1489
+ if ((0, import_utils4.isArray)(val))
1353
1490
  return val;
1354
1491
  };
1355
1492
 
@@ -1460,7 +1597,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1460
1597
  unit = UNIT2.default,
1461
1598
  useVariable
1462
1599
  } = sequenceProps;
1463
- if ((0, import_utils4.isString)(value) && value.slice(0, 2) === "--")
1600
+ if ((0, import_utils5.isString)(value) && value.slice(0, 2) === "--")
1464
1601
  return `var(${value})`;
1465
1602
  const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
1466
1603
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
@@ -1523,7 +1660,7 @@ var findHeadings = (propertyNames) => {
1523
1660
  };
1524
1661
 
1525
1662
  // src/utils/var.js
1526
- var import_utils6 = __toESM(require_cjs4(), 1);
1663
+ var import_utils7 = __toESM(require_cjs4(), 1);
1527
1664
  var applySequenceVars = (props, mediaName, options = {}) => {
1528
1665
  const CONFIG2 = getActiveConfig();
1529
1666
  const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
@@ -1555,7 +1692,7 @@ var applySequenceVars = (props, mediaName, options = {}) => {
1555
1692
  };
1556
1693
 
1557
1694
  // src/utils/sprite.js
1558
- var import_utils7 = __toESM(require_cjs4(), 1);
1695
+ var import_utils8 = __toESM(require_cjs4(), 1);
1559
1696
  var generateSprite = (icons) => {
1560
1697
  const CONFIG2 = getActiveConfig();
1561
1698
  let sprite = "";
@@ -1569,7 +1706,7 @@ var generateSprite = (icons) => {
1569
1706
  return sprite;
1570
1707
  };
1571
1708
  var parseRootAttributes = (htmlString) => {
1572
- if (!(0, import_utils7.isString)(htmlString)) {
1709
+ if (!(0, import_utils8.isString)(htmlString)) {
1573
1710
  return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
1574
1711
  }
1575
1712
  const match = htmlString.match(/<svg\s+(.*?)>/);
@@ -1589,7 +1726,7 @@ var replaceIdsAndUrls = (code, key) => {
1589
1726
  const urlRegex = /url\(#([^)]*)\)/g;
1590
1727
  const matches = code.match(/id="([^"]*)"/g);
1591
1728
  let replacedCode = code;
1592
- if ((0, import_utils7.isArray)(matches)) {
1729
+ if ((0, import_utils8.isArray)(matches)) {
1593
1730
  matches.forEach(() => {
1594
1731
  const randomKey = Math.floor(Math.random() * 1e5);
1595
1732
  replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
@@ -1616,7 +1753,7 @@ var convertSvgToSymbol = (key, code) => {
1616
1753
  // src/system/color.js
1617
1754
  var getColor = (value, key, config) => {
1618
1755
  const CONFIG2 = config || getActiveConfig();
1619
- if (!(0, import_utils8.isString)(value)) {
1756
+ if (!(0, import_utils9.isString)(value)) {
1620
1757
  if (CONFIG2.verbose)
1621
1758
  console.warn(value, "- type for color is not valid");
1622
1759
  return;
@@ -1625,7 +1762,7 @@ var getColor = (value, key, config) => {
1625
1762
  return `var(${value})`;
1626
1763
  if (key && value[key])
1627
1764
  value = value[key];
1628
- const [name, alpha, tone] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
1765
+ const [name, alpha, tone] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
1629
1766
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1630
1767
  let val = COLOR2[name] || GRADIENT2[name];
1631
1768
  if (!val) {
@@ -1640,22 +1777,11 @@ var getColor = (value, key, config) => {
1640
1777
  console.warn(value, " - does not have ", key);
1641
1778
  }
1642
1779
  let rgb = val.rgb;
1643
- if (!rgb)
1780
+ if (!rgb) {
1644
1781
  return CONFIG2.useVariable ? `var(${val.var})` : val.value;
1782
+ }
1645
1783
  if (tone && !val[tone]) {
1646
- const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
1647
- const abs = tone.slice(0, 1);
1648
- if (abs === "-" || abs === "+") {
1649
- rgb = hexToRgbArray(
1650
- getColorShade(toHex, parseFloat(tone))
1651
- ).join(", ");
1652
- } else {
1653
- const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
1654
- const hsl = rgbToHSL(r, g, b);
1655
- const [h, s, l] = hsl;
1656
- const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1657
- rgb = newRgb;
1658
- }
1784
+ rgb = getRgbTone(rgb, tone);
1659
1785
  val[tone] = { rgb, var: `${val.var}-${tone}` };
1660
1786
  }
1661
1787
  if (val[tone])
@@ -1668,17 +1794,17 @@ var getMediaColor = (value, globalTheme, config) => {
1668
1794
  const CONFIG2 = config || getActiveConfig();
1669
1795
  if (!globalTheme)
1670
1796
  globalTheme = CONFIG2.globalTheme;
1671
- if (!(0, import_utils8.isString)(value)) {
1797
+ if (!(0, import_utils9.isString)(value)) {
1672
1798
  if (CONFIG2.verbose)
1673
1799
  console.warn(value, "- type for color is not valid");
1674
1800
  return;
1675
1801
  }
1676
1802
  if (value.slice(0, 2) === "--")
1677
1803
  return `var(${value})`;
1678
- const [name] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
1804
+ const [name] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
1679
1805
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1680
1806
  const val = COLOR2[name] || GRADIENT2[name];
1681
- const isObj = (0, import_utils8.isObject)(val);
1807
+ const isObj = (0, import_utils9.isObject)(val);
1682
1808
  if (isObj && val.value)
1683
1809
  return getColor(value, `@${globalTheme}`, config);
1684
1810
  else if (isObj) {
@@ -1701,15 +1827,15 @@ var getMediaColor = (value, globalTheme, config) => {
1701
1827
  };
1702
1828
  var setColor = (val, key, suffix) => {
1703
1829
  const CONFIG2 = getActiveConfig();
1704
- if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
1830
+ if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--")
1705
1831
  val = getColor(val.slice(2));
1706
- if ((0, import_utils8.isArray)(val)) {
1832
+ if ((0, import_utils9.isArray)(val)) {
1707
1833
  return {
1708
1834
  "@light": setColor(val[0], key, "light"),
1709
1835
  "@dark": setColor(val[1], key, "dark")
1710
1836
  };
1711
1837
  }
1712
- if ((0, import_utils8.isObject)(val)) {
1838
+ if ((0, import_utils9.isObject)(val)) {
1713
1839
  const obj = {};
1714
1840
  for (const variant in val)
1715
1841
  obj[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -1732,15 +1858,15 @@ var setColor = (val, key, suffix) => {
1732
1858
  };
1733
1859
  var setGradient = (val, key, suffix) => {
1734
1860
  const CONFIG2 = getActiveConfig();
1735
- if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
1861
+ if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--")
1736
1862
  val = getColor(val.slice(2));
1737
- if ((0, import_utils8.isArray)(val)) {
1863
+ if ((0, import_utils9.isArray)(val)) {
1738
1864
  return {
1739
1865
  "@light": setGradient(val[0], key, "light"),
1740
1866
  "@dark": setGradient(val[0], key, "dark")
1741
1867
  };
1742
1868
  }
1743
- if ((0, import_utils8.isObject)(val)) {
1869
+ if ((0, import_utils9.isObject)(val)) {
1744
1870
  const obj = {};
1745
1871
  for (const variant in val)
1746
1872
  obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -1757,7 +1883,7 @@ var setGradient = (val, key, suffix) => {
1757
1883
  };
1758
1884
 
1759
1885
  // src/system/theme.js
1760
- var import_utils10 = __toESM(require_cjs4(), 1);
1886
+ var import_utils11 = __toESM(require_cjs4(), 1);
1761
1887
  var setThemeValue = (theme) => {
1762
1888
  const value = {};
1763
1889
  const { state, media, helpers, ...rest } = theme;
@@ -1780,7 +1906,7 @@ var getTheme = (value, modifier) => {
1780
1906
  if (CONFIG2.useVariable)
1781
1907
  return getMediaTheme(value, modifier);
1782
1908
  const { THEME: THEME2 } = CONFIG2;
1783
- if ((0, import_utils10.isString)(value)) {
1909
+ if ((0, import_utils11.isString)(value)) {
1784
1910
  const [theme, subtheme] = value.split(" ");
1785
1911
  const isOurTheme = THEME2[theme];
1786
1912
  if (isOurTheme) {
@@ -1789,7 +1915,7 @@ var getTheme = (value, modifier) => {
1789
1915
  value = [theme, subtheme || modifier];
1790
1916
  }
1791
1917
  }
1792
- if ((0, import_utils10.isObjectLike)(value) && value[1]) {
1918
+ if ((0, import_utils11.isObjectLike)(value) && value[1]) {
1793
1919
  const themeName = value[0];
1794
1920
  const subThemeName = value[1];
1795
1921
  const { helpers, media, state } = THEME2[themeName];
@@ -1799,11 +1925,11 @@ var getTheme = (value, modifier) => {
1799
1925
  return getThemeValue(helpers[subThemeName]);
1800
1926
  if (state && state[subThemeName])
1801
1927
  return getThemeValue(state[subThemeName]);
1802
- } else if ((0, import_utils10.isObject)(value))
1928
+ } else if ((0, import_utils11.isObject)(value))
1803
1929
  return setThemeValue(value);
1804
1930
  };
1805
1931
  var setInverseTheme = (theme, variant, value) => {
1806
- if ((0, import_utils10.isObject)(variant)) {
1932
+ if ((0, import_utils11.isObject)(variant)) {
1807
1933
  theme.variants.inverse.value = setThemeValue(variant);
1808
1934
  } else if (variant === true) {
1809
1935
  const { color, background } = value;
@@ -1818,7 +1944,7 @@ var setInverseTheme = (theme, variant, value) => {
1818
1944
  var setPseudo = (theme, key, variant, themeValue) => {
1819
1945
  const result = getTheme(variant);
1820
1946
  themeValue[`&:${key}`] = result;
1821
- if ((0, import_utils10.isObject)(variant) && !variant.value)
1947
+ if ((0, import_utils11.isObject)(variant) && !variant.value)
1822
1948
  variant.value = result;
1823
1949
  };
1824
1950
  var setSelectors = (theme, value) => {
@@ -1836,7 +1962,7 @@ var setSelectors = (theme, value) => {
1836
1962
  var setPrefersScheme = (theme, key, variant, themeValue) => {
1837
1963
  const result = getTheme(variant);
1838
1964
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
1839
- if ((0, import_utils10.isObject)(variant) && !variant.value)
1965
+ if ((0, import_utils11.isObject)(variant) && !variant.value)
1840
1966
  variant.value = result;
1841
1967
  };
1842
1968
  var setMedia = (theme, value) => {
@@ -1862,7 +1988,7 @@ var setHelpers = (theme, value) => {
1862
1988
  const keys = Object.keys(helpers);
1863
1989
  keys.map((key) => {
1864
1990
  const helper = helpers[key];
1865
- if ((0, import_utils10.isString)(helper))
1991
+ if ((0, import_utils11.isString)(helper))
1866
1992
  helpers[key] = CONFIG2.THEME[helper];
1867
1993
  else
1868
1994
  getThemeValue(helpers[key]);
@@ -1886,7 +2012,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
1886
2012
  const CONFIG2 = getActiveConfig();
1887
2013
  const { CSS_VARS: CSS_VARS2 } = CONFIG2;
1888
2014
  const theme = { value: val };
1889
- if ((0, import_utils10.isObjectLike)(val)) {
2015
+ if ((0, import_utils11.isObjectLike)(val)) {
1890
2016
  for (const param in val) {
1891
2017
  const symb = param.slice(0, 1);
1892
2018
  const value = val[param];
@@ -1914,7 +2040,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
1914
2040
  };
1915
2041
  }
1916
2042
  }
1917
- if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--") {
2043
+ if ((0, import_utils11.isString)(val) && val.slice(0, 2) === "--") {
1918
2044
  const { THEME: THEME2 } = CONFIG2;
1919
2045
  const value = THEME2[val.slice(2)];
1920
2046
  const getReferenced = getMediaTheme(value, prefers);
@@ -1927,7 +2053,7 @@ var recursiveTheme = (val) => {
1927
2053
  const obj = {};
1928
2054
  for (const param in val) {
1929
2055
  const symb = param.slice(0, 1);
1930
- if ((0, import_utils10.isObjectLike)(val[param])) {
2056
+ if ((0, import_utils11.isObjectLike)(val[param])) {
1931
2057
  if (symb === "@") {
1932
2058
  const query = CONFIG2.MEDIA[param.slice(1)];
1933
2059
  const media = `@media screen and ${query}`;
@@ -1947,23 +2073,23 @@ var findModifierFromArray = (val, modifierArray) => {
1947
2073
  return val;
1948
2074
  };
1949
2075
  var findModifier = (val, modifier) => {
1950
- if ((0, import_utils10.isArray)(modifier))
2076
+ if ((0, import_utils11.isArray)(modifier))
1951
2077
  return findModifierFromArray(val, modifier);
1952
- else if ((0, import_utils10.isString)(modifier) && val[modifier])
2078
+ else if ((0, import_utils11.isString)(modifier) && val[modifier])
1953
2079
  return val[modifier];
1954
2080
  else
1955
2081
  return val;
1956
2082
  };
1957
2083
  var getMediaTheme = (val, mod) => {
1958
2084
  const CONFIG2 = getActiveConfig();
1959
- if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--")
2085
+ if ((0, import_utils11.isString)(val) && val.slice(0, 2) === "--")
1960
2086
  val = getMediaTheme(val.slice(2));
1961
- if (!val || !(0, import_utils10.isString)(val)) {
2087
+ if (!val || !(0, import_utils11.isString)(val)) {
1962
2088
  if (CONFIG2.verbose)
1963
2089
  console.warn(val, "- theme is not string");
1964
2090
  return;
1965
2091
  }
1966
- const [name, ...modifier] = (0, import_utils10.isArray)(val) ? val : val.split(" ");
2092
+ const [name, ...modifier] = (0, import_utils11.isArray)(val) ? val : val.split(" ");
1967
2093
  let value = CONFIG2.THEME[name];
1968
2094
  if (value && (modifier || mod)) {
1969
2095
  value = findModifier(value, modifier.length ? modifier : mod);
@@ -1973,7 +2099,7 @@ var getMediaTheme = (val, mod) => {
1973
2099
  };
1974
2100
 
1975
2101
  // src/system/font.js
1976
- var import_utils11 = __toESM(require_cjs4(), 1);
2102
+ var import_utils12 = __toESM(require_cjs4(), 1);
1977
2103
  var setFont = (val, key) => {
1978
2104
  const CSSvar = `--font-${key}`;
1979
2105
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
@@ -1990,7 +2116,7 @@ var setFontFamily = (val, key) => {
1990
2116
  let { value, type } = val;
1991
2117
  if (val.isDefault)
1992
2118
  FONT_FAMILY2.default = key;
1993
- if ((0, import_utils11.isObject)(value))
2119
+ if ((0, import_utils12.isObject)(value))
1994
2120
  value = arrayzeValue(value);
1995
2121
  const CSSvar = `--font-family-${key}`;
1996
2122
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
@@ -1998,7 +2124,7 @@ var setFontFamily = (val, key) => {
1998
2124
  };
1999
2125
 
2000
2126
  // src/system/typography.js
2001
- var import_utils14 = __toESM(require_cjs4(), 1);
2127
+ var import_utils15 = __toESM(require_cjs4(), 1);
2002
2128
  var runThroughMedia = (props) => {
2003
2129
  const CONFIG2 = getActiveConfig();
2004
2130
  const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
@@ -2006,7 +2132,7 @@ var runThroughMedia = (props) => {
2006
2132
  const mediaProps = props[prop];
2007
2133
  if (prop.slice(0, 1) === "@") {
2008
2134
  const { type, base, ratio, range, subSequence, h1Matches, unit } = props;
2009
- (0, import_utils14.merge)(mediaProps, {
2135
+ (0, import_utils15.merge)(mediaProps, {
2010
2136
  type,
2011
2137
  base,
2012
2138
  ratio,
@@ -2067,13 +2193,13 @@ var getFontSizeByKey = (value) => {
2067
2193
  };
2068
2194
 
2069
2195
  // src/system/spacing.js
2070
- var import_utils17 = __toESM(require_cjs4(), 1);
2196
+ var import_utils18 = __toESM(require_cjs4(), 1);
2071
2197
  var runThroughMedia2 = (sequenceProps) => {
2072
2198
  for (const prop in sequenceProps) {
2073
2199
  const mediaProps = sequenceProps[prop];
2074
2200
  if (prop.slice(0, 1) === "@") {
2075
2201
  const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
2076
- (0, import_utils17.merge)(mediaProps, {
2202
+ (0, import_utils18.merge)(mediaProps, {
2077
2203
  type,
2078
2204
  base,
2079
2205
  ratio,
@@ -2112,7 +2238,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
2112
2238
  const stack = arrayzeValue(value);
2113
2239
  if (!stack)
2114
2240
  return;
2115
- if ((0, import_utils17.isString)(value) && value.includes("calc")) {
2241
+ if ((0, import_utils18.isString)(value) && value.includes("calc")) {
2116
2242
  return { [propertyName]: value };
2117
2243
  }
2118
2244
  if (stack.length > 1) {
@@ -2148,7 +2274,7 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
2148
2274
  let sequenceProps = SPACING2[spacingRatio];
2149
2275
  if (!sequenceProps) {
2150
2276
  const { type, base, range, subSequence } = SPACING2;
2151
- sequenceProps = SPACING2[spacingRatio] = (0, import_utils17.merge)({
2277
+ sequenceProps = SPACING2[spacingRatio] = (0, import_utils18.merge)({
2152
2278
  ratio: spacingRatio,
2153
2279
  type: type + "-" + spacingRatio,
2154
2280
  unit,
@@ -2193,11 +2319,11 @@ var getTimingByKey = (value, property = "timing") => {
2193
2319
  };
2194
2320
 
2195
2321
  // src/system/document.js
2196
- var import_utils21 = __toESM(require_cjs4(), 1);
2322
+ var import_utils22 = __toESM(require_cjs4(), 1);
2197
2323
  var applyDocument = () => {
2198
2324
  const CONFIG2 = getActiveConfig();
2199
2325
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
2200
- return (0, import_utils21.merge)(DOCUMENT2, {
2326
+ return (0, import_utils22.merge)(DOCUMENT2, {
2201
2327
  theme: THEME2.document,
2202
2328
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
2203
2329
  fontSize: TYPOGRAPHY2.base,
@@ -2281,7 +2407,7 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
2281
2407
  };
2282
2408
 
2283
2409
  // src/system/reset.js
2284
- var import_utils24 = __toESM(require_cjs4(), 1);
2410
+ var import_utils25 = __toESM(require_cjs4(), 1);
2285
2411
  var applyReset = (reset = {}) => {
2286
2412
  const CONFIG2 = getActiveConfig();
2287
2413
  const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
@@ -2301,7 +2427,10 @@ var applyReset = (reset = {}) => {
2301
2427
  configReset.h6 = configTemplates.h6;
2302
2428
  }
2303
2429
  const { body, ...templates } = TYPOGRAPHY2.templates;
2304
- return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
2430
+ const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
2431
+ if (RESET2.html)
2432
+ (0, import_utils25.overwriteDeep)(RESET2.html, globalTheme);
2433
+ return (0, import_utils25.deepMerge)((0, import_utils25.merge)(RESET2, reset), {
2305
2434
  html: {
2306
2435
  position: "absolute",
2307
2436
  // overflow: 'hidden',
@@ -2312,8 +2441,8 @@ var applyReset = (reset = {}) => {
2312
2441
  margin: "0",
2313
2442
  WebkitFontSmoothing: "subpixel-antialiased",
2314
2443
  scrollBehavior: "smooth",
2444
+ ...globalTheme,
2315
2445
  fontSize: TYPOGRAPHY2.browserDefault + "px",
2316
- ...CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {},
2317
2446
  fontFamily: DOCUMENT2.fontFamily,
2318
2447
  lineHeight: DOCUMENT2.lineHeight
2319
2448
  },