@symbo.ls/scratch 3.1.1 → 3.2.3

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.
@@ -29,16 +29,16 @@ __export(factory_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(factory_exports);
31
31
 
32
- // ../../../domql/packages/utils/globals.js
32
+ // ../../../domql/packages/utils/dist/esm/globals.js
33
33
  var window2 = globalThis;
34
34
  var document2 = window2.document;
35
35
 
36
- // ../../../domql/packages/utils/node.js
36
+ // ../../../domql/packages/utils/dist/esm/node.js
37
37
  var isDOMNode = (obj) => {
38
38
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
39
39
  };
40
40
 
41
- // ../../../domql/packages/utils/types.js
41
+ // ../../../domql/packages/utils/dist/esm/types.js
42
42
  var isObject = (arg) => {
43
43
  if (arg === null) return false;
44
44
  return typeof arg === "object" && arg.constructor === Object;
@@ -61,7 +61,7 @@ var isUndefined = (arg) => {
61
61
  return arg === void 0;
62
62
  };
63
63
 
64
- // ../../../domql/packages/utils/array.js
64
+ // ../../../domql/packages/utils/dist/esm/array.js
65
65
  var unstackArrayOfObjects = (arr, exclude = []) => {
66
66
  return arr.reduce(
67
67
  (a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
@@ -69,7 +69,7 @@ var unstackArrayOfObjects = (arr, exclude = []) => {
69
69
  );
70
70
  };
71
71
 
72
- // ../../../domql/packages/utils/keys.js
72
+ // ../../../domql/packages/utils/dist/esm/keys.js
73
73
  var STATE_METHODS = [
74
74
  "update",
75
75
  "parse",
@@ -140,11 +140,30 @@ var METHODS_EXL = [
140
140
  ...PROPS_METHODS
141
141
  ];
142
142
 
143
- // ../../../domql/packages/utils/object.js
143
+ // ../../../domql/packages/utils/dist/esm/object.js
144
+ var __defProp2 = Object.defineProperty;
145
+ var __defProps = Object.defineProperties;
146
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
147
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
148
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
149
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
150
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
151
+ var __spreadValues = (a, b) => {
152
+ for (var prop in b || (b = {}))
153
+ if (__hasOwnProp2.call(b, prop))
154
+ __defNormalProp(a, prop, b[prop]);
155
+ if (__getOwnPropSymbols)
156
+ for (var prop of __getOwnPropSymbols(b)) {
157
+ if (__propIsEnum.call(b, prop))
158
+ __defNormalProp(a, prop, b[prop]);
159
+ }
160
+ return a;
161
+ };
162
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
144
163
  var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
145
164
  for (const e in extend) {
146
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
147
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
165
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
166
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
148
167
  continue;
149
168
  }
150
169
  const elementProp = element[e];
@@ -166,14 +185,15 @@ var deepClone = (obj, options = {}) => {
166
185
  visited = /* @__PURE__ */ new WeakMap(),
167
186
  handleExtends = false
168
187
  } = options;
188
+ const contentWindow = targetWindow || window2 || globalThis;
169
189
  if (!isObjectLike(obj) || isDOMNode(obj)) {
170
190
  return obj;
171
191
  }
172
192
  if (visited.has(obj)) {
173
193
  return visited.get(obj);
174
194
  }
175
- const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
176
- visited.set(obj, clone);
195
+ const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
196
+ visited.set(obj, clone2);
177
197
  for (const key in obj) {
178
198
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
179
199
  if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
@@ -184,30 +204,29 @@ var deepClone = (obj, options = {}) => {
184
204
  continue;
185
205
  }
186
206
  if (isDOMNode(value)) {
187
- clone[key] = value;
207
+ clone2[key] = value;
188
208
  continue;
189
209
  }
190
210
  if (handleExtends && key === "extends" && isArray(value)) {
191
- clone[key] = unstackArrayOfObjects(value, exclude);
211
+ clone2[key] = unstackArrayOfObjects(value, exclude);
192
212
  continue;
193
213
  }
194
- if (isFunction(value) && targetWindow) {
195
- clone[key] = targetWindow.eval("(" + value.toString() + ")");
214
+ if (isFunction(value) && options.window) {
215
+ clone2[key] = contentWindow.eval("(" + value.toString() + ")");
196
216
  continue;
197
217
  }
198
218
  if (isObjectLike(value)) {
199
- clone[key] = deepClone(value, {
200
- ...options,
219
+ clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
201
220
  visited
202
- });
221
+ }));
203
222
  } else {
204
- clone[key] = value;
223
+ clone2[key] = value;
205
224
  }
206
225
  }
207
- return clone;
226
+ return clone2;
208
227
  };
209
228
 
210
- // ../../../domql/packages/utils/cookie.js
229
+ // ../../../domql/packages/utils/dist/esm/cookie.js
211
230
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
212
231
 
213
232
  // ../../../domql/packages/event/dist/esm/keys.js
@@ -517,3 +536,4 @@ var setActiveConfig = (newConfig) => {
517
536
  FACTORY["1"] = deepMerge(newConfig, deepClone(cachedConfig));
518
537
  return newConfig;
519
538
  };
539
+ // @preserve-env
package/dist/cjs/index.js CHANGED
@@ -34,23 +34,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  var require_cjs = __commonJS({
35
35
  "../utils/dist/cjs/index.js"(exports, module2) {
36
36
  "use strict";
37
- var __defProp2 = Object.defineProperty;
37
+ var __defProp3 = Object.defineProperty;
38
38
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
39
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
40
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
41
41
  var __export2 = (target, all) => {
42
42
  for (var name in all)
43
- __defProp2(target, name, { get: all[name], enumerable: true });
43
+ __defProp3(target, name, { get: all[name], enumerable: true });
44
44
  };
45
45
  var __copyProps2 = (to, from, except, desc) => {
46
46
  if (from && typeof from === "object" || typeof from === "function") {
47
47
  for (let key of __getOwnPropNames2(from))
48
- if (!__hasOwnProp2.call(to, key) && key !== except)
49
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
48
+ if (!__hasOwnProp3.call(to, key) && key !== except)
49
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
50
50
  }
51
51
  return to;
52
52
  };
53
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
54
54
  var index_exports2 = {};
55
55
  __export2(index_exports2, {
56
56
  arrayzeValue: () => arrayzeValue3,
@@ -66,6 +66,8 @@ var require_cjs = __commonJS({
66
66
  loadJavascriptFile: () => loadJavascriptFile,
67
67
  loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
68
68
  loadJavascriptFileSync: () => loadJavascriptFileSync,
69
+ loadRemoteCSS: () => loadRemoteCSS,
70
+ loadRemoteScript: () => loadRemoteScript,
69
71
  removeChars: () => removeChars,
70
72
  toCamelCase: () => toCamelCase2,
71
73
  toDashCase: () => toDashCase2,
@@ -273,10 +275,12 @@ var require_cjs = __commonJS({
273
275
  });
274
276
  });
275
277
  scriptEle.addEventListener("error", (ev) => {
276
- reject(new Error({
277
- status: false,
278
- message: `Failed to load the script ${FILE_URL}`
279
- }));
278
+ reject(
279
+ new Error({
280
+ status: false,
281
+ message: `Failed to load the script ${FILE_URL}`
282
+ })
283
+ );
280
284
  });
281
285
  doc.body.appendChild(scriptEle);
282
286
  } catch (error) {
@@ -347,6 +351,59 @@ var require_cjs = __commonJS({
347
351
  console.warn(error);
348
352
  }
349
353
  };
354
+ function loadRemoteScript(url, options = {}) {
355
+ const { window: window4 = globalThis } = options;
356
+ const { document: document4 = window4.document } = options;
357
+ return new Promise((resolve, reject) => {
358
+ const existingScript = document4.querySelector(`script[src="${url}"]`);
359
+ if (existingScript) {
360
+ return resolve(existingScript);
361
+ }
362
+ const script = document4.createElement("script");
363
+ script.src = url;
364
+ script.async = options.async === true;
365
+ script.type = options.type || "text/javascript";
366
+ if (options.id) script.id = options.id;
367
+ if (options.integrity) script.integrity = options.integrity;
368
+ if (options.crossOrigin) script.crossOrigin = options.crossOrigin;
369
+ script.onload = () => {
370
+ script.onerror = script.onload = null;
371
+ resolve(script);
372
+ };
373
+ script.onerror = () => {
374
+ script.onerror = script.onload = null;
375
+ reject(new Error(`Failed to load script: ${url}`));
376
+ };
377
+ document4.head.appendChild(script);
378
+ });
379
+ }
380
+ async function loadRemoteCSS(url, options = {}) {
381
+ const { window: window4 = globalThis } = options;
382
+ const { document: document4 = window4.document } = options;
383
+ return new Promise((resolve, reject) => {
384
+ const existingLink = document4.querySelector(`link[href="${url}"]`);
385
+ if (existingLink) {
386
+ return resolve(existingLink);
387
+ }
388
+ const link = document4.createElement("link");
389
+ link.href = url;
390
+ link.rel = options.rel || "stylesheet";
391
+ link.type = "text/css";
392
+ link.media = options.media || "all";
393
+ if (options.id) link.id = options.id;
394
+ if (options.integrity) link.integrity = options.integrity;
395
+ if (options.crossOrigin) link.crossOrigin = options.crossOrigin;
396
+ link.onload = () => {
397
+ link.onerror = link.onload = null;
398
+ resolve(link);
399
+ };
400
+ link.onerror = () => {
401
+ link.onerror = link.onload = null;
402
+ reject(new Error(`Failed to load stylesheet: ${url}`));
403
+ };
404
+ document4.head.appendChild(link);
405
+ });
406
+ }
350
407
  var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
351
408
  var copyStringToClipboard = async (str) => {
352
409
  try {
@@ -373,12 +430,9 @@ var require_cjs = __commonJS({
373
430
  return index === 0 ? word.toLowerCase() : word.toUpperCase();
374
431
  }).replaceAll(/\s+/g, "");
375
432
  };
376
- var toTitleCase = (str) => str && str.replace(
377
- /\w\S*/g,
378
- (txt) => {
379
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
380
- }
381
- );
433
+ var toTitleCase = (str) => str && str.replace(/\w\S*/g, (txt) => {
434
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
435
+ });
382
436
  var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
383
437
  var toDescriptionCase = (str = "") => {
384
438
  if (typeof str !== "string") return;
@@ -579,16 +633,16 @@ var isScalingUnit = (unit) => {
579
633
  return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
580
634
  };
581
635
 
582
- // ../../../domql/packages/utils/globals.js
636
+ // ../../../domql/packages/utils/dist/esm/globals.js
583
637
  var window2 = globalThis;
584
638
  var document2 = window2.document;
585
639
 
586
- // ../../../domql/packages/utils/node.js
640
+ // ../../../domql/packages/utils/dist/esm/node.js
587
641
  var isDOMNode = (obj) => {
588
642
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
589
643
  };
590
644
 
591
- // ../../../domql/packages/utils/types.js
645
+ // ../../../domql/packages/utils/dist/esm/types.js
592
646
  var isObject = (arg) => {
593
647
  if (arg === null) return false;
594
648
  return typeof arg === "object" && arg.constructor === Object;
@@ -611,7 +665,7 @@ var isUndefined = (arg) => {
611
665
  return arg === void 0;
612
666
  };
613
667
 
614
- // ../../../domql/packages/utils/array.js
668
+ // ../../../domql/packages/utils/dist/esm/array.js
615
669
  var unstackArrayOfObjects = (arr, exclude = []) => {
616
670
  return arr.reduce(
617
671
  (a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
@@ -619,7 +673,7 @@ var unstackArrayOfObjects = (arr, exclude = []) => {
619
673
  );
620
674
  };
621
675
 
622
- // ../../../domql/packages/utils/keys.js
676
+ // ../../../domql/packages/utils/dist/esm/keys.js
623
677
  var STATE_METHODS = [
624
678
  "update",
625
679
  "parse",
@@ -690,11 +744,30 @@ var METHODS_EXL = [
690
744
  ...PROPS_METHODS
691
745
  ];
692
746
 
693
- // ../../../domql/packages/utils/object.js
747
+ // ../../../domql/packages/utils/dist/esm/object.js
748
+ var __defProp2 = Object.defineProperty;
749
+ var __defProps = Object.defineProperties;
750
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
751
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
752
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
753
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
754
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
755
+ var __spreadValues = (a, b) => {
756
+ for (var prop in b || (b = {}))
757
+ if (__hasOwnProp2.call(b, prop))
758
+ __defNormalProp(a, prop, b[prop]);
759
+ if (__getOwnPropSymbols)
760
+ for (var prop of __getOwnPropSymbols(b)) {
761
+ if (__propIsEnum.call(b, prop))
762
+ __defNormalProp(a, prop, b[prop]);
763
+ }
764
+ return a;
765
+ };
766
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
694
767
  var merge = (element, obj, excludeFrom = []) => {
695
768
  for (const e in obj) {
696
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
697
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
769
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
770
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
698
771
  continue;
699
772
  }
700
773
  const elementProp = element[e];
@@ -707,8 +780,8 @@ var merge = (element, obj, excludeFrom = []) => {
707
780
  };
708
781
  var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
709
782
  for (const e in extend) {
710
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
711
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
783
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
784
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
712
785
  continue;
713
786
  }
714
787
  const elementProp = element[e];
@@ -730,14 +803,15 @@ var deepClone = (obj, options = {}) => {
730
803
  visited = /* @__PURE__ */ new WeakMap(),
731
804
  handleExtends = false
732
805
  } = options;
806
+ const contentWindow = targetWindow || window2 || globalThis;
733
807
  if (!isObjectLike(obj) || isDOMNode(obj)) {
734
808
  return obj;
735
809
  }
736
810
  if (visited.has(obj)) {
737
811
  return visited.get(obj);
738
812
  }
739
- const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
740
- visited.set(obj, clone);
813
+ const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
814
+ visited.set(obj, clone2);
741
815
  for (const key in obj) {
742
816
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
743
817
  if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
@@ -748,27 +822,26 @@ var deepClone = (obj, options = {}) => {
748
822
  continue;
749
823
  }
750
824
  if (isDOMNode(value)) {
751
- clone[key] = value;
825
+ clone2[key] = value;
752
826
  continue;
753
827
  }
754
828
  if (handleExtends && key === "extends" && isArray(value)) {
755
- clone[key] = unstackArrayOfObjects(value, exclude);
829
+ clone2[key] = unstackArrayOfObjects(value, exclude);
756
830
  continue;
757
831
  }
758
- if (isFunction(value) && targetWindow) {
759
- clone[key] = targetWindow.eval("(" + value.toString() + ")");
832
+ if (isFunction(value) && options.window) {
833
+ clone2[key] = contentWindow.eval("(" + value.toString() + ")");
760
834
  continue;
761
835
  }
762
836
  if (isObjectLike(value)) {
763
- clone[key] = deepClone(value, {
764
- ...options,
837
+ clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
765
838
  visited
766
- });
839
+ }));
767
840
  } else {
768
- clone[key] = value;
841
+ clone2[key] = value;
769
842
  }
770
843
  }
771
- return clone;
844
+ return clone2;
772
845
  };
773
846
  var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
774
847
  const excl = opts.exclude || [];
@@ -794,7 +867,12 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
794
867
  return obj;
795
868
  };
796
869
 
797
- // ../../../domql/packages/utils/cookie.js
870
+ // ../../../domql/packages/utils/dist/esm/env.js
871
+ var NODE_ENV = "development";
872
+ var isProduction = (env = NODE_ENV) => env === "production";
873
+ var isNotProduction = (env = NODE_ENV) => !isProduction(env);
874
+
875
+ // ../../../domql/packages/utils/dist/esm/cookie.js
798
876
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
799
877
 
800
878
  // ../../../domql/packages/event/dist/esm/keys.js
@@ -873,7 +951,6 @@ var window3 = globalThis;
873
951
  var document3 = window3.document;
874
952
 
875
953
  // src/utils/color.js
876
- var ENV = "development";
877
954
  var colorStringToRgbaArray = (color) => {
878
955
  if (color === "") return [0, 0, 0, 0];
879
956
  if (color.toLowerCase() === "transparent") return [0, 0, 0, 0];
@@ -944,10 +1021,7 @@ var mixTwoRgb = (colorA, colorB, range = 0.5) => {
944
1021
  };
945
1022
  var changeLightness = (delta, hsl) => {
946
1023
  const [hue, saturation, lightness] = hsl;
947
- const newLightness = Math.max(
948
- 0,
949
- Math.min(100, lightness + parseFloat(delta))
950
- );
1024
+ const newLightness = Math.max(0, Math.min(100, lightness + parseFloat(delta)));
951
1025
  return [hue, saturation, newLightness];
952
1026
  };
953
1027
  var rgbToHSL = (r, g, b) => {
@@ -957,10 +1031,7 @@ var rgbToHSL = (r, g, b) => {
957
1031
  const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
958
1032
  return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
959
1033
  };
960
- var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
961
- Math.min(k - 3, 9 - k, 1),
962
- -1
963
- )) => [f(0), f(8), f(4)];
1034
+ var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
964
1035
  var getColorShade = (col, amt) => {
965
1036
  const num = parseInt(col, 16);
966
1037
  let r = (num >> 16) + amt;
@@ -978,23 +1049,22 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
978
1049
  const arr = [];
979
1050
  for (let i = 0; i < 4; i++) {
980
1051
  const round = i === 3 ? (x) => x : Math.round;
981
- arr[i] = round(
982
- colorA[i] + (colorB[i] - colorA[i]) * range
983
- );
1052
+ arr[i] = round(colorA[i] + (colorB[i] - colorA[i]) * range);
984
1053
  }
985
1054
  return `rgba(${arr})`;
986
1055
  };
987
1056
  var opacify = (color, opacity) => {
988
1057
  const arr = colorStringToRgbaArray(color);
989
1058
  if (!arr) {
990
- if (ENV === "testing" || ENV === "development") console.warn(color + " color is not rgba");
1059
+ if (isNotProduction()) console.warn(color + " color is not rgba");
991
1060
  return;
992
1061
  }
993
1062
  arr[3] = opacity;
994
1063
  return `rgba(${arr})`;
995
1064
  };
996
1065
  var getRgbTone = (rgb, tone) => {
997
- if (isString(rgb) && rgb.includes("rgb")) rgb = colorStringToRgbaArray(rgb).join(", ");
1066
+ if (isString(rgb) && rgb.includes("rgb"))
1067
+ rgb = colorStringToRgbaArray(rgb).join(", ");
998
1068
  if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
999
1069
  if (isNumber(tone)) tone += "";
1000
1070
  const toHex = rgbArrayToHex(rgb);
@@ -1604,8 +1674,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1604
1674
  };
1605
1675
 
1606
1676
  // src/utils/sprite.js
1607
- var ENV2 = "development";
1608
- var isDev = ENV2 === "development" || ENV2 === "testing";
1677
+ var isDev = isNotProduction();
1609
1678
  var generateSprite = (icons) => {
1610
1679
  const CONFIG2 = getActiveConfig();
1611
1680
  let sprite = "";
@@ -1627,7 +1696,9 @@ var parseRootAttributes = (htmlString) => {
1627
1696
  return {};
1628
1697
  }
1629
1698
  const attrString = match[1];
1630
- const attrs = attrString.match(/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm);
1699
+ const attrs = attrString.match(
1700
+ /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
1701
+ );
1631
1702
  return attrs.reduce((acc, attr) => {
1632
1703
  const [key, value] = attr.split("=");
1633
1704
  acc[key] = value.replace(/['"]/g, "");
@@ -2053,15 +2124,7 @@ var runThroughMedia = (FACTORY2) => {
2053
2124
  if (!isPropMedia) continue;
2054
2125
  const { mediaRegenerate } = FACTORY2;
2055
2126
  const mediaName = prop.slice(1);
2056
- const {
2057
- type,
2058
- base,
2059
- ratio,
2060
- range,
2061
- subSequence,
2062
- h1Matches,
2063
- unit
2064
- } = FACTORY2;
2127
+ const { type, base, ratio, range, subSequence, h1Matches, unit } = FACTORY2;
2065
2128
  merge(mediaValue, {
2066
2129
  type,
2067
2130
  base,
@@ -2091,7 +2154,7 @@ var runThroughMedia = (FACTORY2) => {
2091
2154
  }
2092
2155
  };
2093
2156
  var applyHeadings = (props) => {
2094
- var _a;
2157
+ var _a, _b;
2095
2158
  const CONFIG2 = getActiveConfig();
2096
2159
  if (props.h1Matches) {
2097
2160
  const unit = props.unit;
@@ -2100,9 +2163,8 @@ var applyHeadings = (props) => {
2100
2163
  for (const k in HEADINGS) {
2101
2164
  const headerName = `h${parseInt(k) + 1}`;
2102
2165
  const headerStyle = templates[headerName];
2103
- if (!HEADINGS[k]) continue;
2104
2166
  templates[headerName] = {
2105
- fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
2167
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${(_b = HEADINGS[k]) == null ? void 0 : _b.scaling}${unit}`,
2106
2168
  margin: headerStyle ? headerStyle.margin : 0,
2107
2169
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
2108
2170
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -2122,11 +2184,7 @@ var applyTypographySequence = () => {
2122
2184
  var getFontSizeByKey = (value) => {
2123
2185
  const CONFIG2 = getActiveConfig();
2124
2186
  const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
2125
- return getSequenceValuePropertyPair(
2126
- value,
2127
- "fontSize",
2128
- TYPOGRAPHY2
2129
- );
2187
+ return getSequenceValuePropertyPair(value, "fontSize", TYPOGRAPHY2);
2130
2188
  };
2131
2189
 
2132
2190
  // src/system/spacing.js
@@ -2713,3 +2771,4 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
2713
2771
  applyReset();
2714
2772
  return CONFIG2;
2715
2773
  };
2774
+ // @preserve-env