@symbo.ls/scratch 2.10.224 → 2.10.230

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.
Files changed (41) hide show
  1. package/dist/cjs/defaultConfig/animation.js +3 -1
  2. package/dist/cjs/defaultConfig/cases.js +3 -1
  3. package/dist/cjs/defaultConfig/color.js +4 -8
  4. package/dist/cjs/defaultConfig/document.js +3 -1
  5. package/dist/cjs/defaultConfig/font-family.js +5 -9
  6. package/dist/cjs/defaultConfig/font.js +3 -10
  7. package/dist/cjs/defaultConfig/icons.js +3 -1
  8. package/dist/cjs/defaultConfig/index.js +184 -19
  9. package/dist/cjs/defaultConfig/media.js +3 -1
  10. package/dist/cjs/defaultConfig/responsive.js +4 -2
  11. package/dist/cjs/defaultConfig/sequence.js +3 -1
  12. package/dist/cjs/defaultConfig/spacing.js +53 -6
  13. package/dist/cjs/defaultConfig/svg.js +4 -2
  14. package/dist/cjs/defaultConfig/theme.js +3 -13
  15. package/dist/cjs/defaultConfig/timing.js +35 -4
  16. package/dist/cjs/defaultConfig/typography.js +35 -4
  17. package/dist/cjs/defaultConfig/unit.js +3 -1
  18. package/dist/cjs/factory.js +1016 -10
  19. package/dist/cjs/index.js +2479 -6
  20. package/dist/cjs/set.js +2189 -45
  21. package/dist/cjs/system/color.js +1179 -44
  22. package/dist/cjs/system/document.js +1079 -11
  23. package/dist/cjs/system/font.js +1110 -17
  24. package/dist/cjs/system/index.js +2153 -10
  25. package/dist/cjs/system/reset.js +1148 -20
  26. package/dist/cjs/system/spacing.js +1291 -33
  27. package/dist/cjs/system/svg.js +1121 -25
  28. package/dist/cjs/system/theme.js +1204 -68
  29. package/dist/cjs/system/timing.js +1272 -19
  30. package/dist/cjs/system/typography.js +1287 -28
  31. package/dist/cjs/tests/index.js +4 -2
  32. package/dist/cjs/utils/color.js +68 -16
  33. package/dist/cjs/utils/font.js +11 -9
  34. package/dist/cjs/utils/index.js +1525 -7
  35. package/dist/cjs/utils/sequence.js +1068 -19
  36. package/dist/cjs/utils/sprite.js +832 -4
  37. package/dist/cjs/utils/theme.js +3 -1
  38. package/dist/cjs/utils/var.js +1061 -21
  39. package/package.json +3 -3
  40. package/src/index.js +4 -0
  41. package/src/utils/color.js +3 -0
package/dist/cjs/set.js CHANGED
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
8
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,35 +20,2174 @@ var __copyProps = (to, from, except, desc) => {
15
20
  }
16
21
  return to;
17
22
  };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
19
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // ../../node_modules/@domql/globals/dist/cjs/index.js
34
+ var require_cjs = __commonJS({
35
+ "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
36
+ "use strict";
37
+ var __defProp2 = Object.defineProperty;
38
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
41
+ var __export2 = (target, all) => {
42
+ for (var name in all)
43
+ __defProp2(target, name, { get: all[name], enumerable: true });
44
+ };
45
+ var __copyProps2 = (to, from, except, desc) => {
46
+ if (from && typeof from === "object" || typeof from === "function") {
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 });
50
+ }
51
+ return to;
52
+ };
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
54
+ var globals_exports = {};
55
+ __export2(globals_exports, {
56
+ document: () => document4,
57
+ global: () => global,
58
+ self: () => self,
59
+ window: () => window3
60
+ });
61
+ module2.exports = __toCommonJS2(globals_exports);
62
+ var global = globalThis;
63
+ var self = globalThis;
64
+ var window3 = globalThis;
65
+ var document4 = window3.document;
66
+ }
67
+ });
68
+
69
+ // ../../node_modules/@domql/tags/dist/cjs/htmlTags.js
70
+ var require_htmlTags = __commonJS({
71
+ "../../node_modules/@domql/tags/dist/cjs/htmlTags.js"(exports, module2) {
72
+ "use strict";
73
+ var __defProp2 = Object.defineProperty;
74
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
75
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
76
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
77
+ var __export2 = (target, all) => {
78
+ for (var name in all)
79
+ __defProp2(target, name, { get: all[name], enumerable: true });
80
+ };
81
+ var __copyProps2 = (to, from, except, desc) => {
82
+ if (from && typeof from === "object" || typeof from === "function") {
83
+ for (let key of __getOwnPropNames2(from))
84
+ if (!__hasOwnProp2.call(to, key) && key !== except)
85
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
86
+ }
87
+ return to;
88
+ };
89
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
90
+ var htmlTags_exports = {};
91
+ __export2(htmlTags_exports, {
92
+ HTML_TAGS: () => HTML_TAGS
93
+ });
94
+ module2.exports = __toCommonJS2(htmlTags_exports);
95
+ var HTML_TAGS = {
96
+ root: [
97
+ "body",
98
+ "html"
99
+ ],
100
+ head: [
101
+ "title",
102
+ "base",
103
+ "meta",
104
+ "style"
105
+ ],
106
+ body: [
107
+ "string",
108
+ "fragment",
109
+ "a",
110
+ "abbr",
111
+ "acronym",
112
+ "address",
113
+ "applet",
114
+ "area",
115
+ "article",
116
+ "aside",
117
+ "audio",
118
+ "b",
119
+ "basefont",
120
+ "bdi",
121
+ "bdo",
122
+ "big",
123
+ "blockquote",
124
+ "br",
125
+ "button",
126
+ "canvas",
127
+ "caption",
128
+ "center",
129
+ "cite",
130
+ "code",
131
+ "col",
132
+ "colgroup",
133
+ "data",
134
+ "datalist",
135
+ "dd",
136
+ "del",
137
+ "details",
138
+ "dfn",
139
+ "dialog",
140
+ "dir",
141
+ "div",
142
+ "dl",
143
+ "dt",
144
+ "em",
145
+ "embed",
146
+ "fieldset",
147
+ "figcaption",
148
+ "figure",
149
+ "font",
150
+ "footer",
151
+ "form",
152
+ "frame",
153
+ "frameset",
154
+ "h1",
155
+ "h2",
156
+ "h3",
157
+ "h4",
158
+ "h5",
159
+ "h6",
160
+ "head",
161
+ "header",
162
+ "hr",
163
+ "i",
164
+ "iframe",
165
+ "img",
166
+ "input",
167
+ "ins",
168
+ "kbd",
169
+ "label",
170
+ "legend",
171
+ "li",
172
+ "link",
173
+ "main",
174
+ "map",
175
+ "mark",
176
+ "meter",
177
+ "nav",
178
+ "noframes",
179
+ "noscript",
180
+ "object",
181
+ "ol",
182
+ "optgroup",
183
+ "option",
184
+ "output",
185
+ "p",
186
+ "param",
187
+ "picture",
188
+ "pre",
189
+ "progress",
190
+ "q",
191
+ "rp",
192
+ "rt",
193
+ "ruby",
194
+ "s",
195
+ "samp",
196
+ "script",
197
+ "section",
198
+ "select",
199
+ "small",
200
+ "source",
201
+ "span",
202
+ "strike",
203
+ "strong",
204
+ "sub",
205
+ "summary",
206
+ "sup",
207
+ "table",
208
+ "tbody",
209
+ "td",
210
+ "template",
211
+ "textarea",
212
+ "tfoot",
213
+ "th",
214
+ "thead",
215
+ "time",
216
+ "tr",
217
+ "track",
218
+ "tt",
219
+ "u",
220
+ "ul",
221
+ "var",
222
+ "video",
223
+ "wbr",
224
+ // SVG
225
+ "svg",
226
+ "path"
227
+ ]
228
+ };
229
+ }
230
+ });
231
+
232
+ // ../../node_modules/@domql/tags/dist/cjs/index.js
233
+ var require_cjs2 = __commonJS({
234
+ "../../node_modules/@domql/tags/dist/cjs/index.js"(exports, module2) {
235
+ "use strict";
236
+ var __defProp2 = Object.defineProperty;
237
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
238
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
239
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
240
+ var __copyProps2 = (to, from, except, desc) => {
241
+ if (from && typeof from === "object" || typeof from === "function") {
242
+ for (let key of __getOwnPropNames2(from))
243
+ if (!__hasOwnProp2.call(to, key) && key !== except)
244
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
245
+ }
246
+ return to;
247
+ };
248
+ var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
249
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
250
+ var tags_exports = {};
251
+ module2.exports = __toCommonJS2(tags_exports);
252
+ __reExport(tags_exports, require_htmlTags(), module2.exports);
253
+ }
254
+ });
255
+
256
+ // ../../node_modules/@domql/utils/dist/cjs/types.js
257
+ var require_types = __commonJS({
258
+ "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
259
+ "use strict";
260
+ var __defProp2 = Object.defineProperty;
261
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
262
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
263
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
264
+ var __export2 = (target, all) => {
265
+ for (var name in all)
266
+ __defProp2(target, name, { get: all[name], enumerable: true });
267
+ };
268
+ var __copyProps2 = (to, from, except, desc) => {
269
+ if (from && typeof from === "object" || typeof from === "function") {
270
+ for (let key of __getOwnPropNames2(from))
271
+ if (!__hasOwnProp2.call(to, key) && key !== except)
272
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
273
+ }
274
+ return to;
275
+ };
276
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
277
+ var types_exports = {};
278
+ __export2(types_exports, {
279
+ TYPES: () => TYPES,
280
+ is: () => is,
281
+ isArray: () => isArray5,
282
+ isBoolean: () => isBoolean,
283
+ isDefined: () => isDefined2,
284
+ isFunction: () => isFunction2,
285
+ isHtmlElement: () => isHtmlElement,
286
+ isNode: () => isNode,
287
+ isNot: () => isNot,
288
+ isNull: () => isNull,
289
+ isNumber: () => isNumber,
290
+ isObject: () => isObject6,
291
+ isObjectLike: () => isObjectLike3,
292
+ isString: () => isString7,
293
+ isUndefined: () => isUndefined,
294
+ isValidHtmlTag: () => isValidHtmlTag
295
+ });
296
+ module2.exports = __toCommonJS2(types_exports);
297
+ var import_globals3 = require_cjs();
298
+ var import_tags = require_cjs2();
299
+ var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.indexOf(arg);
300
+ var isObject6 = (arg) => {
301
+ if (arg === null)
302
+ return false;
303
+ return typeof arg === "object" && arg.constructor === Object;
304
+ };
305
+ var isString7 = (arg) => typeof arg === "string";
306
+ var isNumber = (arg) => typeof arg === "number";
307
+ var isFunction2 = (arg) => typeof arg === "function";
308
+ var isBoolean = (arg) => arg === true || arg === false;
309
+ var isNull = (arg) => arg === null;
310
+ var isArray5 = (arg) => Array.isArray(arg);
311
+ var isObjectLike3 = (arg) => {
312
+ if (arg === null)
313
+ return false;
314
+ return typeof arg === "object";
315
+ };
316
+ var isNode = (obj) => {
317
+ return typeof import_globals3.window.Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string";
318
+ };
319
+ var isHtmlElement = (obj) => {
320
+ return typeof import_globals3.window.HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string";
321
+ };
322
+ var isDefined2 = (arg) => {
323
+ return isObject6(arg) || isObjectLike3(arg) || isString7(arg) || isNumber(arg) || isFunction2(arg) || isArray5(arg) || isObjectLike3(arg) || isBoolean(arg) || isNull(arg);
324
+ };
325
+ var isUndefined = (arg) => {
326
+ return arg === void 0;
327
+ };
328
+ var TYPES = {
329
+ boolean: isBoolean,
330
+ array: isArray5,
331
+ object: isObject6,
332
+ string: isString7,
333
+ number: isNumber,
334
+ null: isNull,
335
+ function: isFunction2,
336
+ objectLike: isObjectLike3,
337
+ node: isNode,
338
+ htmlElement: isHtmlElement,
339
+ defined: isDefined2
340
+ };
341
+ var is = (arg) => {
342
+ return (...args) => {
343
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
344
+ };
345
+ };
346
+ var isNot = (arg) => {
347
+ return (...args) => {
348
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
349
+ };
350
+ };
351
+ }
352
+ });
353
+
354
+ // ../../node_modules/@domql/utils/dist/cjs/object.js
355
+ var require_object = __commonJS({
356
+ "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
357
+ "use strict";
358
+ var __defProp2 = Object.defineProperty;
359
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
360
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
361
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
362
+ var __export2 = (target, all) => {
363
+ for (var name in all)
364
+ __defProp2(target, name, { get: all[name], enumerable: true });
365
+ };
366
+ var __copyProps2 = (to, from, except, desc) => {
367
+ if (from && typeof from === "object" || typeof from === "function") {
368
+ for (let key of __getOwnPropNames2(from))
369
+ if (!__hasOwnProp2.call(to, key) && key !== except)
370
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
371
+ }
372
+ return to;
373
+ };
374
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
375
+ var object_exports = {};
376
+ __export2(object_exports, {
377
+ clone: () => clone,
378
+ deepClone: () => deepClone2,
379
+ deepCloneExclude: () => deepCloneExclude,
380
+ deepDestringify: () => deepDestringify,
381
+ deepMerge: () => deepMerge2,
382
+ deepStringify: () => deepStringify,
383
+ detachFunctionsFromObject: () => detachFunctionsFromObject,
384
+ diff: () => diff,
385
+ exec: () => exec,
386
+ flattenRecursive: () => flattenRecursive,
387
+ isEqualDeep: () => isEqualDeep,
388
+ map: () => map,
389
+ merge: () => merge5,
390
+ mergeAndCloneIfArray: () => mergeAndCloneIfArray,
391
+ mergeArray: () => mergeArray,
392
+ mergeArrayExclude: () => mergeArrayExclude,
393
+ mergeIfExisted: () => mergeIfExisted,
394
+ overwrite: () => overwrite,
395
+ overwriteDeep: () => overwriteDeep,
396
+ overwriteObj: () => overwriteObj
397
+ });
398
+ module2.exports = __toCommonJS2(object_exports);
399
+ var import_globals3 = require_cjs();
400
+ var import_types = require_types();
401
+ var exec = (param, element, state, context) => {
402
+ if ((0, import_types.isFunction)(param)) {
403
+ return param(
404
+ element,
405
+ state || element.state,
406
+ context || element.context
407
+ );
408
+ }
409
+ return param;
410
+ };
411
+ var map = (obj, extention, element) => {
412
+ for (const e in extention) {
413
+ obj[e] = exec(extention[e], element);
414
+ }
415
+ };
416
+ var merge5 = (element, obj) => {
417
+ for (const e in obj) {
418
+ const elementProp = element[e];
419
+ const objProp = obj[e];
420
+ if (elementProp === void 0) {
421
+ element[e] = objProp;
422
+ }
423
+ }
424
+ return element;
425
+ };
426
+ var deepMerge2 = (element, extend) => {
427
+ for (const e in extend) {
428
+ const extendProp = extend[e];
429
+ if (e === "parent" || e === "props")
430
+ continue;
431
+ if (element[e] === void 0) {
432
+ element[e] = extendProp;
433
+ } else if ((0, import_types.isObjectLike)(element[e]) && (0, import_types.isObjectLike)(extendProp)) {
434
+ deepMerge2(element[e], extendProp);
435
+ } else {
436
+ element[e] = extendProp;
437
+ }
438
+ }
439
+ return element;
440
+ };
441
+ var clone = (obj) => {
442
+ const o = {};
443
+ for (const prop in obj) {
444
+ if (prop === "node")
445
+ continue;
446
+ o[prop] = obj[prop];
447
+ }
448
+ return o;
449
+ };
450
+ var deepCloneExclude = (obj, exclude = []) => {
451
+ if ((0, import_types.isArray)(obj)) {
452
+ return obj.map((x) => deepCloneExclude(x, exclude));
453
+ }
454
+ const o = {};
455
+ for (const k in obj) {
456
+ if (exclude.indexOf(k) > -1)
457
+ continue;
458
+ let v = obj[k];
459
+ if (k === "extend" && (0, import_types.isArray)(v)) {
460
+ v = mergeArrayExclude(v, exclude);
461
+ }
462
+ if ((0, import_types.isArray)(v)) {
463
+ o[k] = v.map((x) => deepCloneExclude(x, exclude));
464
+ } else if ((0, import_types.isObject)(v)) {
465
+ o[k] = deepCloneExclude(v, exclude);
466
+ } else
467
+ o[k] = v;
468
+ }
469
+ return o;
470
+ };
471
+ var mergeArrayExclude = (arr, excl = []) => {
472
+ return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
473
+ };
474
+ var deepClone2 = (obj) => {
475
+ if ((0, import_types.isArray)(obj)) {
476
+ return obj.map(deepClone2);
477
+ }
478
+ const o = {};
479
+ for (const prop in obj) {
480
+ let objProp = obj[prop];
481
+ if (prop === "extend" && (0, import_types.isArray)(objProp)) {
482
+ objProp = mergeArray(objProp);
483
+ }
484
+ if ((0, import_types.isArray)(objProp)) {
485
+ o[prop] = objProp.map((v) => (0, import_types.isObject)(v) ? deepClone2(v) : v);
486
+ } else if ((0, import_types.isObject)(objProp)) {
487
+ o[prop] = deepClone2(objProp);
488
+ } else
489
+ o[prop] = objProp;
490
+ }
491
+ return o;
492
+ };
493
+ var deepStringify = (obj, stringified = {}) => {
494
+ for (const prop in obj) {
495
+ const objProp = obj[prop];
496
+ if ((0, import_types.isFunction)(objProp)) {
497
+ stringified[prop] = objProp.toString();
498
+ } else if ((0, import_types.isObject)(objProp)) {
499
+ stringified[prop] = {};
500
+ deepStringify(objProp, stringified[prop]);
501
+ } else if ((0, import_types.isArray)(objProp)) {
502
+ stringified[prop] = [];
503
+ objProp.forEach((v, i) => {
504
+ if ((0, import_types.isObject)(v)) {
505
+ stringified[prop][i] = {};
506
+ deepStringify(v, stringified[prop][i]);
507
+ } else if ((0, import_types.isFunction)(v)) {
508
+ stringified[prop][i] = v.toString();
509
+ } else {
510
+ stringified[prop][i] = v;
511
+ }
512
+ });
513
+ } else {
514
+ stringified[prop] = objProp;
515
+ }
516
+ }
517
+ return stringified;
518
+ };
519
+ var detachFunctionsFromObject = (obj, detached = {}) => {
520
+ for (const prop in obj) {
521
+ const objProp = obj[prop];
522
+ if ((0, import_types.isFunction)(objProp))
523
+ continue;
524
+ else if ((0, import_types.isObject)(objProp)) {
525
+ detached[prop] = {};
526
+ deepStringify(objProp[prop], detached[prop]);
527
+ } else if ((0, import_types.isArray)(objProp)) {
528
+ detached[prop] = [];
529
+ objProp.map((v, i) => deepStringify(v, detached[prop][i]));
530
+ } else
531
+ detached[prop] = objProp;
532
+ }
533
+ return detached;
534
+ };
535
+ var deepDestringify = (obj, stringified = {}) => {
536
+ for (const prop in obj) {
537
+ const objProp = obj[prop];
538
+ if ((0, import_types.isString)(objProp)) {
539
+ if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
540
+ try {
541
+ const evalProp = import_globals3.window.eval(`(${objProp})`);
542
+ stringified[prop] = evalProp;
543
+ } catch (e) {
544
+ if (e)
545
+ stringified[prop] = objProp;
546
+ }
547
+ } else {
548
+ stringified[prop] = objProp;
549
+ }
550
+ } else if ((0, import_types.isArray)(objProp)) {
551
+ stringified[prop] = [];
552
+ objProp.forEach((arrProp) => {
553
+ if ((0, import_types.isString)(arrProp)) {
554
+ if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
555
+ try {
556
+ const evalProp = import_globals3.window.eval(`(${arrProp})`);
557
+ stringified[prop].push(evalProp);
558
+ } catch (e) {
559
+ if (e)
560
+ stringified[prop].push(arrProp);
561
+ }
562
+ } else {
563
+ stringified[prop].push(arrProp);
564
+ }
565
+ } else if ((0, import_types.isObject)(arrProp)) {
566
+ stringified[prop].push(deepDestringify(arrProp));
567
+ } else {
568
+ stringified[prop].push(arrProp);
569
+ }
570
+ });
571
+ } else if ((0, import_types.isObject)(objProp)) {
572
+ stringified[prop] = deepDestringify(objProp, stringified[prop]);
573
+ } else {
574
+ stringified[prop] = objProp;
575
+ }
576
+ }
577
+ return stringified;
578
+ };
579
+ var overwrite = (element, params, options) => {
580
+ const { ref } = element;
581
+ const changes = {};
582
+ for (const e in params) {
583
+ if (e === "props")
584
+ continue;
585
+ const elementProp = element[e];
586
+ const paramsProp = params[e];
587
+ if (paramsProp) {
588
+ ref.__cache[e] = changes[e] = elementProp;
589
+ ref[e] = paramsProp;
590
+ }
591
+ }
592
+ return changes;
593
+ };
594
+ var diff = (obj, original, cache) => {
595
+ const changes = cache || {};
596
+ for (const e in obj) {
597
+ if (e === "ref")
598
+ continue;
599
+ const originalProp = original[e];
600
+ const objProp = obj[e];
601
+ if ((0, import_types.isObjectLike)(originalProp) && (0, import_types.isObjectLike)(objProp)) {
602
+ changes[e] = {};
603
+ diff(originalProp, objProp, changes[e]);
604
+ } else if (objProp !== void 0) {
605
+ changes[e] = objProp;
606
+ }
607
+ }
608
+ return changes;
609
+ };
610
+ var overwriteObj = (params, obj) => {
611
+ const changes = {};
612
+ for (const e in params) {
613
+ const objProp = obj[e];
614
+ const paramsProp = params[e];
615
+ if (paramsProp) {
616
+ obj[e] = changes[e] = objProp;
617
+ }
618
+ }
619
+ return changes;
620
+ };
621
+ var overwriteDeep = (params, obj) => {
622
+ for (const e in params) {
623
+ const objProp = obj[e];
624
+ const paramsProp = params[e];
625
+ if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
626
+ overwriteDeep(paramsProp, objProp);
627
+ } else if (paramsProp !== void 0) {
628
+ obj[e] = paramsProp;
629
+ }
630
+ }
631
+ return obj;
632
+ };
633
+ var mergeIfExisted = (a, b) => {
634
+ if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
635
+ return deepMerge2(a, b);
636
+ return a || b;
637
+ };
638
+ var mergeArray = (arr) => {
639
+ return arr.reduce((a, c) => deepMerge2(a, deepClone2(c)), {});
640
+ };
641
+ var mergeAndCloneIfArray = (obj) => {
642
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : deepClone2(obj);
643
+ };
644
+ var flattenRecursive = (param, prop, stack = []) => {
645
+ const objectized = mergeAndCloneIfArray(param);
646
+ stack.push(objectized);
647
+ const extendOfExtend = objectized[prop];
648
+ if (extendOfExtend)
649
+ flattenRecursive(extendOfExtend, prop, stack);
650
+ delete objectized[prop];
651
+ return stack;
652
+ };
653
+ var isEqualDeep = (param, element) => {
654
+ if (param === element)
655
+ return true;
656
+ if (!param || !element)
657
+ return false;
658
+ for (const prop in param) {
659
+ const paramProp = param[prop];
660
+ const elementProp = element[prop];
661
+ if ((0, import_types.isObjectLike)(paramProp)) {
662
+ const isEqual = isEqualDeep(paramProp, elementProp);
663
+ if (!isEqual)
664
+ return false;
665
+ } else {
666
+ const isEqual = paramProp === elementProp;
667
+ if (!isEqual)
668
+ return false;
669
+ }
670
+ }
671
+ return true;
672
+ };
673
+ }
674
+ });
675
+
676
+ // ../../node_modules/@domql/utils/dist/cjs/function.js
677
+ var require_function = __commonJS({
678
+ "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
679
+ "use strict";
680
+ var __defProp2 = Object.defineProperty;
681
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
682
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
683
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
684
+ var __export2 = (target, all) => {
685
+ for (var name in all)
686
+ __defProp2(target, name, { get: all[name], enumerable: true });
687
+ };
688
+ var __copyProps2 = (to, from, except, desc) => {
689
+ if (from && typeof from === "object" || typeof from === "function") {
690
+ for (let key of __getOwnPropNames2(from))
691
+ if (!__hasOwnProp2.call(to, key) && key !== except)
692
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
693
+ }
694
+ return to;
695
+ };
696
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
697
+ var function_exports = {};
698
+ __export2(function_exports, {
699
+ debounce: () => debounce,
700
+ memoize: () => memoize
701
+ });
702
+ module2.exports = __toCommonJS2(function_exports);
703
+ var debounce = (element, func, timeout = 300) => {
704
+ let timer;
705
+ return (...args) => {
706
+ clearTimeout(timer);
707
+ timer = setTimeout(() => {
708
+ func.apply(element, args);
709
+ }, timeout);
710
+ };
711
+ };
712
+ var memoize = (fn) => {
713
+ const cache = {};
714
+ return (...args) => {
715
+ const n = args[0];
716
+ if (n in cache) {
717
+ return cache[n];
718
+ } else {
719
+ const result = fn(n);
720
+ cache[n] = result;
721
+ return result;
722
+ }
723
+ };
724
+ };
725
+ }
726
+ });
727
+
728
+ // ../../node_modules/@domql/utils/dist/cjs/array.js
729
+ var require_array = __commonJS({
730
+ "../../node_modules/@domql/utils/dist/cjs/array.js"() {
731
+ "use strict";
732
+ }
733
+ });
734
+
735
+ // ../../node_modules/@domql/utils/dist/cjs/node.js
736
+ var require_node = __commonJS({
737
+ "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
738
+ "use strict";
739
+ var __defProp2 = Object.defineProperty;
740
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
741
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
742
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
743
+ var __export2 = (target, all) => {
744
+ for (var name in all)
745
+ __defProp2(target, name, { get: all[name], enumerable: true });
746
+ };
747
+ var __copyProps2 = (to, from, except, desc) => {
748
+ if (from && typeof from === "object" || typeof from === "function") {
749
+ for (let key of __getOwnPropNames2(from))
750
+ if (!__hasOwnProp2.call(to, key) && key !== except)
751
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
752
+ }
753
+ return to;
754
+ };
755
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
756
+ var node_exports = {};
757
+ __export2(node_exports, {
758
+ cleanWithNode: () => cleanWithNode,
759
+ createID: () => createID,
760
+ createSnapshotId: () => createSnapshotId
761
+ });
762
+ module2.exports = __toCommonJS2(node_exports);
763
+ var cleanWithNode = (extend) => delete extend.node && extend;
764
+ var createID = function() {
765
+ let index = 0;
766
+ function newId() {
767
+ index++;
768
+ return index;
769
+ }
770
+ return newId;
771
+ }();
772
+ var createSnapshotId = createID;
773
+ }
774
+ });
775
+
776
+ // ../../node_modules/@domql/utils/dist/cjs/log.js
777
+ var require_log = __commonJS({
778
+ "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
779
+ "use strict";
780
+ var __defProp2 = Object.defineProperty;
781
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
782
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
783
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
784
+ var __export2 = (target, all) => {
785
+ for (var name in all)
786
+ __defProp2(target, name, { get: all[name], enumerable: true });
787
+ };
788
+ var __copyProps2 = (to, from, except, desc) => {
789
+ if (from && typeof from === "object" || typeof from === "function") {
790
+ for (let key of __getOwnPropNames2(from))
791
+ if (!__hasOwnProp2.call(to, key) && key !== except)
792
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
793
+ }
794
+ return to;
795
+ };
796
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
797
+ var log_exports = {};
798
+ __export2(log_exports, {
799
+ logGroupIf: () => logGroupIf,
800
+ logIf: () => logIf
801
+ });
802
+ module2.exports = __toCommonJS2(log_exports);
803
+ var logIf = (bool, ...arg) => {
804
+ if (bool)
805
+ arg.map((v) => console.log(v));
806
+ };
807
+ var logGroupIf = (bool, key, ...arg) => {
808
+ if (bool) {
809
+ console.group(key);
810
+ arg.map((v) => console.log(v));
811
+ console.groupEnd(key);
812
+ }
813
+ };
814
+ }
815
+ });
816
+
817
+ // ../../node_modules/@domql/utils/dist/cjs/index.js
818
+ var require_cjs3 = __commonJS({
819
+ "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
820
+ "use strict";
821
+ var __defProp2 = Object.defineProperty;
822
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
823
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
824
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
825
+ var __copyProps2 = (to, from, except, desc) => {
826
+ if (from && typeof from === "object" || typeof from === "function") {
827
+ for (let key of __getOwnPropNames2(from))
828
+ if (!__hasOwnProp2.call(to, key) && key !== except)
829
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
830
+ }
831
+ return to;
832
+ };
833
+ var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
834
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
835
+ var utils_exports = {};
836
+ module2.exports = __toCommonJS2(utils_exports);
837
+ __reExport(utils_exports, require_types(), module2.exports);
838
+ __reExport(utils_exports, require_object(), module2.exports);
839
+ __reExport(utils_exports, require_function(), module2.exports);
840
+ __reExport(utils_exports, require_array(), module2.exports);
841
+ __reExport(utils_exports, require_node(), module2.exports);
842
+ __reExport(utils_exports, require_log(), module2.exports);
843
+ }
844
+ });
845
+
846
+ // src/set.js
20
847
  var set_exports = {};
21
848
  __export(set_exports, {
22
849
  VALUE_TRANSFORMERS: () => VALUE_TRANSFORMERS,
850
+ appendIconsSprite: () => appendIconsSprite,
851
+ appendSVGSprite: () => appendSVGSprite,
852
+ applyDocument: () => applyDocument,
853
+ applyHeadings: () => applyHeadings,
854
+ applyReset: () => applyReset,
855
+ applySpacingSequence: () => applySpacingSequence,
856
+ applyTimingSequence: () => applyTimingSequence,
857
+ applyTypographySequence: () => applyTypographySequence,
858
+ getColor: () => getColor,
859
+ getFontFamily: () => getFontFamily,
860
+ getFontSizeByKey: () => getFontSizeByKey,
861
+ getMediaColor: () => getMediaColor,
862
+ getMediaTheme: () => getMediaTheme,
863
+ getSpacingBasedOnRatio: () => getSpacingBasedOnRatio,
864
+ getSpacingByKey: () => getSpacingByKey,
865
+ getTheme: () => getTheme,
866
+ getTimingByKey: () => getTimingByKey,
867
+ getTimingFunction: () => getTimingFunction,
868
+ runThroughMedia: () => runThroughMedia,
23
869
  set: () => set,
870
+ setColor: () => setColor,
24
871
  setEach: () => setEach,
872
+ setFont: () => setFont,
873
+ setFontFamily: () => setFontFamily,
874
+ setGradient: () => setGradient,
875
+ setIcon: () => setIcon,
876
+ setMediaTheme: () => setMediaTheme,
877
+ setSVG: () => setSVG,
878
+ setTheme: () => setTheme,
25
879
  setValue: () => setValue
26
880
  });
27
881
  module.exports = __toCommonJS(set_exports);
28
- var import_factory = require("./factory.js");
29
- var import_system = require("./system");
30
- var import_utils = require("@domql/utils");
31
- __reExport(set_exports, require("./system"), module.exports);
32
- const ENV = "development";
33
- const setCases = (val, key) => {
34
- if ((0, import_utils.isFunction)(val))
882
+
883
+ // src/factory.js
884
+ var import_utils = __toESM(require_cjs3(), 1);
885
+
886
+ // src/defaultConfig/index.js
887
+ var defaultConfig_exports = {};
888
+ __export(defaultConfig_exports, {
889
+ ANIMATION: () => ANIMATION,
890
+ BREAKPOINTS: () => BREAKPOINTS,
891
+ CASES: () => CASES,
892
+ COLOR: () => COLOR,
893
+ DEVICES: () => DEVICES,
894
+ DOCUMENT: () => DOCUMENT,
895
+ FONT: () => FONT,
896
+ FONT_FACE: () => FONT_FACE,
897
+ FONT_FAMILY: () => FONT_FAMILY,
898
+ FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
899
+ GRADIENT: () => GRADIENT,
900
+ ICONS: () => ICONS,
901
+ MEDIA: () => MEDIA,
902
+ RESET: () => RESET,
903
+ SEQUENCE: () => SEQUENCE,
904
+ SPACING: () => SPACING,
905
+ SVG: () => SVG,
906
+ SVG_DATA: () => SVG_DATA,
907
+ THEME: () => THEME,
908
+ TIMING: () => TIMING,
909
+ TYPOGRAPHY: () => TYPOGRAPHY,
910
+ UNIT: () => UNIT
911
+ });
912
+
913
+ // src/defaultConfig/sequence.js
914
+ var SEQUENCE = {
915
+ "minor-second": 1.067,
916
+ "major-second": 1.125,
917
+ "minor-third": 1.2,
918
+ "major-third": 1.25,
919
+ "perfect-fourth": 1.333,
920
+ "augmented-fourth": 1.414,
921
+ "perfect-fifth": 1.5,
922
+ "minor-sixth": 1.6,
923
+ phi: 1.618,
924
+ // golden-ratio
925
+ "major-sixth": 1.667,
926
+ "square-root-3": 1.732,
927
+ // theodorus
928
+ "minor-seventh": 1.778,
929
+ "major-seventh": 1.875,
930
+ octave: 2,
931
+ "square-root-5": 2.23,
932
+ // pythagoras
933
+ "major-tenth": 2.5,
934
+ "major-eleventh": 2.667,
935
+ "major-twelfth": 3,
936
+ pi: 3.14,
937
+ // archimedes
938
+ "double-octave": 4
939
+ };
940
+
941
+ // src/defaultConfig/unit.js
942
+ var UNIT = {
943
+ default: "em"
944
+ };
945
+
946
+ // src/defaultConfig/typography.js
947
+ var defaultProps = {
948
+ browserDefault: 16,
949
+ base: 16,
950
+ type: "font-size",
951
+ ratio: SEQUENCE["minor-third"],
952
+ range: [-3, 12],
953
+ h1Matches: 6,
954
+ lineHeight: 1.5,
955
+ unit: "em",
956
+ templates: {},
957
+ sequence: {},
958
+ scales: {},
959
+ vars: {}
960
+ };
961
+ var TYPOGRAPHY = defaultProps;
962
+
963
+ // src/defaultConfig/font.js
964
+ var FONT = {};
965
+
966
+ // src/defaultConfig/font-family.js
967
+ var FONT_FAMILY = {};
968
+ var FONT_FAMILY_TYPES = {
969
+ "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
970
+ serif: "Times New Roman, Georgia, serif, --system-default",
971
+ monospace: "Courier New, monospace, --system-default"
972
+ };
973
+ var FONT_FACE = {};
974
+
975
+ // src/defaultConfig/media.js
976
+ var MEDIA = {
977
+ tv: "(min-width: 2780px)",
978
+ screenL: "(max-width: 1920px)",
979
+ screenM: "(max-width: 1680px)",
980
+ screenS: "(max-width: 1440px)",
981
+ tabletL: "(max-width: 1366px)",
982
+ tabletM: "(max-width: 1280px)",
983
+ tabletS: "(max-width: 1024px)",
984
+ mobileL: "(max-width: 768px)",
985
+ mobileM: "(max-width: 560px)",
986
+ mobileS: "(max-width: 480px)",
987
+ mobileXS: "(max-width: 375px)",
988
+ light: "(prefers-color-scheme: light)",
989
+ dark: "(prefers-color-scheme: dark)",
990
+ print: "print"
991
+ };
992
+
993
+ // src/defaultConfig/spacing.js
994
+ var defaultProps2 = {
995
+ base: TYPOGRAPHY.base,
996
+ type: "spacing",
997
+ ratio: SEQUENCE.phi,
998
+ range: [-5, 15],
999
+ subSequence: true,
1000
+ unit: "em",
1001
+ sequence: {},
1002
+ scales: {},
1003
+ vars: {}
1004
+ };
1005
+ var SPACING = defaultProps2;
1006
+
1007
+ // src/defaultConfig/color.js
1008
+ var COLOR = {};
1009
+ var GRADIENT = {};
1010
+
1011
+ // src/defaultConfig/theme.js
1012
+ var THEME = {};
1013
+
1014
+ // src/defaultConfig/icons.js
1015
+ var ICONS = {};
1016
+
1017
+ // src/defaultConfig/timing.js
1018
+ var defaultProps3 = {
1019
+ default: 150,
1020
+ base: 150,
1021
+ type: "timing",
1022
+ ratio: SEQUENCE["perfect-fourth"],
1023
+ range: [-3, 12],
1024
+ unit: "ms",
1025
+ sequence: {},
1026
+ scales: {},
1027
+ vars: {}
1028
+ };
1029
+ var TIMING = defaultProps3;
1030
+
1031
+ // src/defaultConfig/document.js
1032
+ var DOCUMENT = {};
1033
+
1034
+ // src/defaultConfig/responsive.js
1035
+ var BREAKPOINTS = {
1036
+ screenL: 1920,
1037
+ screenM: 1680,
1038
+ screenS: 1440,
1039
+ tabletL: 1366,
1040
+ tabletM: 1280,
1041
+ tabletS: 1024,
1042
+ mobileL: 768,
1043
+ mobileM: 560,
1044
+ mobileS: 480,
1045
+ mobileXS: 375
1046
+ };
1047
+ var DEVICES = {
1048
+ screenL: [1920, 1024],
1049
+ screenM: [1680, 1024],
1050
+ screenS: [1440, 978],
1051
+ tabletL: [1366, 926],
1052
+ tabletM: [1280, 768],
1053
+ tabletS: [1024, 768],
1054
+ mobileL: [768, 375],
1055
+ mobileM: [560, 768],
1056
+ mobileS: [480, 768],
1057
+ mobileXS: [375, 768]
1058
+ };
1059
+
1060
+ // src/defaultConfig/cases.js
1061
+ var CASES = {};
1062
+
1063
+ // src/defaultConfig/animation.js
1064
+ var ANIMATION = {};
1065
+
1066
+ // src/defaultConfig/svg.js
1067
+ var SVG = {};
1068
+ var SVG_DATA = {};
1069
+
1070
+ // src/defaultConfig/index.js
1071
+ var RESET = {};
1072
+
1073
+ // src/factory.js
1074
+ var CSS_VARS = {};
1075
+ var CONFIG = {
1076
+ verbose: false,
1077
+ useVariable: true,
1078
+ useReset: true,
1079
+ CSS_VARS,
1080
+ ...defaultConfig_exports
1081
+ };
1082
+ var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1083
+ var FACTORY = {
1084
+ active: "0",
1085
+ 0: CONFIG
1086
+ };
1087
+ var getActiveConfig = (def) => {
1088
+ if ((0, import_utils.isDefined)(def) && !FACTORY[def]) {
1089
+ FACTORY[def] = (0, import_utils.deepClone)(cachedConfig);
1090
+ return FACTORY[def];
1091
+ }
1092
+ return FACTORY[def || FACTORY.active];
1093
+ };
1094
+
1095
+ // src/system/color.js
1096
+ var import_utils8 = __toESM(require_cjs3(), 1);
1097
+
1098
+ // src/utils/color.js
1099
+ var import_globals = __toESM(require_cjs(), 1);
1100
+ var colorStringToRgbaArray = (color) => {
1101
+ if (color === "")
1102
+ return;
1103
+ if (color.toLowerCase() === "transparent")
1104
+ return [0, 0, 0, 0];
1105
+ if (color[0] === "#") {
1106
+ if (color.length < 7) {
1107
+ color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
1108
+ }
1109
+ return [
1110
+ parseInt(color.substr(1, 2), 16),
1111
+ parseInt(color.substr(3, 2), 16),
1112
+ parseInt(color.substr(5, 2), 16),
1113
+ color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
1114
+ ];
1115
+ }
1116
+ if (color.indexOf("rgb") === -1) {
1117
+ if (import_globals.document && import_globals.window) {
1118
+ const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
1119
+ const flag = "rgb(1, 2, 3)";
1120
+ elem.style.color = flag;
1121
+ if (elem.style.color !== flag)
1122
+ return;
1123
+ elem.style.color = color;
1124
+ if (elem.style.color === flag || elem.style.color === "")
1125
+ return;
1126
+ color = import_globals.window.getComputedStyle(elem).color;
1127
+ import_globals.document.body.removeChild(elem);
1128
+ } else
1129
+ console.warn("Color conversion failed, no document or window object found");
1130
+ }
1131
+ if (color.indexOf("rgb") === 0) {
1132
+ if (color.indexOf("rgba") === -1)
1133
+ color = `${color}, 1`;
1134
+ return color.match(/[\.\d]+/g).map((a) => +a);
1135
+ }
1136
+ return [];
1137
+ };
1138
+ var hexToRgbArray = (hex, alpha = 1) => {
1139
+ const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
1140
+ return [r, g, b];
1141
+ };
1142
+ var rgbArrayToHex = ([r, g, b]) => {
1143
+ return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
1144
+ };
1145
+ var rgbToHSL = (r, g, b) => {
1146
+ const a = Math.max(r, g, b);
1147
+ const n = a - Math.min(r, g, b);
1148
+ const f = 1 - Math.abs(a + a - n - 1);
1149
+ const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
1150
+ return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
1151
+ };
1152
+ var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
1153
+ Math.min(k - 3, 9 - k, 1),
1154
+ -1
1155
+ )) => [f(0), f(8), f(4)];
1156
+ var getColorShade = (col, amt) => {
1157
+ const num = parseInt(col, 16);
1158
+ let r = (num >> 16) + amt;
1159
+ if (r > 255)
1160
+ r = 255;
1161
+ else if (r < 0)
1162
+ r = 0;
1163
+ let b = (num >> 8 & 255) + amt;
1164
+ if (b > 255)
1165
+ b = 255;
1166
+ else if (b < 0)
1167
+ b = 0;
1168
+ let g = (num & 255) + amt;
1169
+ if (g > 255)
1170
+ g = 255;
1171
+ else if (g < 0)
1172
+ g = 0;
1173
+ return (g | b << 8 | r << 16).toString(16);
1174
+ };
1175
+
1176
+ // src/utils/font.js
1177
+ var getDefaultOrFirstKey = (LIBRARY, key) => {
1178
+ if (LIBRARY[key])
1179
+ return LIBRARY[key].value;
1180
+ if (LIBRARY.default)
1181
+ return LIBRARY[LIBRARY.default].value;
1182
+ const hasValue = Object.keys(LIBRARY)[0];
1183
+ return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
1184
+ };
1185
+ var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
1186
+ var setCustomFont = (name, url, weight) => `
1187
+ font-family: '${name}';
1188
+ font-style: normal;
1189
+ ${weight && `font-weight: ${weight};`}
1190
+ src: url('${url}') format('${getFontFormat(url)}');`;
1191
+ var setCustomFontMedia = (name, url, weight) => `@font-face {
1192
+ ${setCustomFont(name, url, weight)}
1193
+ }`;
1194
+ var getFontFaceEach = (name, weights) => {
1195
+ const keys = Object.keys(weights);
1196
+ return keys.map((key) => {
1197
+ const { url, fontWeight } = weights[key];
1198
+ return setCustomFont(name, url, fontWeight);
1199
+ });
1200
+ };
1201
+
1202
+ // src/utils/sequence.js
1203
+ var import_utils4 = __toESM(require_cjs3(), 1);
1204
+
1205
+ // ../utils/src/index.js
1206
+ var import_utils3 = __toESM(require_cjs3());
1207
+
1208
+ // ../utils/src/scaling.js
1209
+ var import_utils2 = __toESM(require_cjs3());
1210
+
1211
+ // ../utils/src/index.js
1212
+ var toCamelCase = (str) => {
1213
+ return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
1214
+ return index === 0 ? word.toLowerCase() : word.toUpperCase();
1215
+ }).replaceAll(/\s+/g, "");
1216
+ };
1217
+ var toDashCase = (val) => val.replace(/[A-Z]/g, (match, offset) => (offset > 0 ? "-" : "") + match.toLowerCase()).replace(".", "-");
1218
+ var arrayzeValue = (val) => {
1219
+ if ((0, import_utils3.isString)(val))
1220
+ return val.split(" ");
1221
+ if ((0, import_utils3.isObject)(val))
1222
+ return Object.keys(val).map((v) => val[v]);
1223
+ if ((0, import_utils3.isArray)(val))
1224
+ return val;
1225
+ };
1226
+
1227
+ // src/utils/sequence.js
1228
+ var numToLetterMap = {
1229
+ "-6": "U",
1230
+ "-5": "V",
1231
+ "-4": "W",
1232
+ "-3": "X",
1233
+ "-2": "Y",
1234
+ "-1": "Z",
1235
+ 0: "A",
1236
+ 1: "B",
1237
+ 2: "C",
1238
+ 3: "D",
1239
+ 4: "E",
1240
+ 5: "F",
1241
+ 6: "G",
1242
+ 7: "H",
1243
+ 8: "I",
1244
+ 9: "J",
1245
+ 10: "K",
1246
+ 11: "L",
1247
+ 12: "M",
1248
+ 13: "N",
1249
+ 14: "O",
1250
+ 15: "P",
1251
+ 16: "Q",
1252
+ 17: "R",
1253
+ 18: "S",
1254
+ 19: "T"
1255
+ };
1256
+ var setSequenceValue = (props, sequenceProps) => {
1257
+ const { key, variable, value, scaling, index } = props;
1258
+ sequenceProps.sequence[key] = {
1259
+ key,
1260
+ decimal: ~~(value * 100) / 100,
1261
+ val: ~~value,
1262
+ scaling,
1263
+ index,
1264
+ variable
1265
+ };
1266
+ sequenceProps.scales[key] = scaling;
1267
+ sequenceProps.vars[variable] = scaling + sequenceProps.unit;
1268
+ };
1269
+ var generateSubSequence = (props, sequenceProps) => {
1270
+ const { key, base, value, ratio, variable, index } = props;
1271
+ const next = value * ratio;
1272
+ const diff = next - value;
1273
+ const smallscale = diff / 1.618;
1274
+ const valueRounded = ~~value;
1275
+ const nextRounded = ~~next;
1276
+ const diffRounded = nextRounded - valueRounded;
1277
+ let arr = [];
1278
+ const first = next - smallscale;
1279
+ const second = value + smallscale;
1280
+ const middle = (first + second) / 2;
1281
+ if (diffRounded > 16)
1282
+ arr = [first, middle, second];
1283
+ else
1284
+ arr = [first, second];
1285
+ arr.map((v, k) => {
1286
+ const scaling = ~~(v / base * 1e3) / 1e3;
1287
+ const newVar = variable + (k + 1);
1288
+ const props2 = {
1289
+ key: key + (k + 1),
1290
+ variable: newVar,
1291
+ value: v,
1292
+ scaling,
1293
+ index: index + (k + 1) / 10
1294
+ };
1295
+ return setSequenceValue(props2, sequenceProps);
1296
+ });
1297
+ };
1298
+ var switchSequenceOnNegative = (key, base, ratio) => {
1299
+ return base * Math.pow(ratio, key);
1300
+ };
1301
+ var generateSequence = (sequenceProps) => {
1302
+ const { type, base, ratio, range, subSequence } = sequenceProps;
1303
+ const n = Math.abs(range[0]) + Math.abs(range[1]);
1304
+ const prefix = "--" + (type && type.replace(".", "-")) + "-";
1305
+ for (let i = 0; i <= n; i++) {
1306
+ const key = range[1] - i;
1307
+ const letterKey = numToLetterMap[key];
1308
+ const value = switchSequenceOnNegative(key, base, ratio);
1309
+ const scaling = ~~(value / base * 100) / 100;
1310
+ const variable = prefix + letterKey;
1311
+ const props = {
1312
+ key: letterKey,
1313
+ variable,
1314
+ value,
1315
+ base,
1316
+ scaling,
1317
+ ratio,
1318
+ index: key
1319
+ };
1320
+ setSequenceValue(props, sequenceProps);
1321
+ if (subSequence)
1322
+ generateSubSequence(props, sequenceProps);
1323
+ }
1324
+ return sequenceProps;
1325
+ };
1326
+ var getSequenceValue = (value = "A", sequenceProps) => {
1327
+ const CONFIG2 = getActiveConfig();
1328
+ const { UNIT: UNIT2 } = CONFIG2;
1329
+ const {
1330
+ sequence,
1331
+ unit = UNIT2.default,
1332
+ useVariable
1333
+ } = sequenceProps;
1334
+ if ((0, import_utils4.isString)(value) && value.slice(0, 2) === "--")
1335
+ return `var(${value})`;
1336
+ const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
1337
+ const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
1338
+ const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
1339
+ if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || !startsWithDashOrLetter)
1340
+ return value;
1341
+ const letterVal = value.toUpperCase();
1342
+ const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
1343
+ let absValue = isNegative ? letterVal.slice(1) : letterVal;
1344
+ let mediaName = "";
1345
+ if (absValue.includes("-")) {
1346
+ mediaName = "-" + absValue.split("-")[1].toLowerCase();
1347
+ absValue = absValue.split("-")[0];
1348
+ }
1349
+ const varValue = (v) => `var(${prefix}${v}${mediaName})`;
1350
+ if (absValue.includes("+")) {
1351
+ const args = absValue.split("+");
1352
+ const [first, second] = args;
1353
+ const joint = `${varValue(first)} + ${varValue(second)}`;
1354
+ return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1355
+ } else if (absValue.includes("-")) {
1356
+ const args = absValue.split("-");
1357
+ const [first, second] = args;
1358
+ const joint = `${varValue(first)} - ${varValue(second)}`;
1359
+ return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1360
+ }
1361
+ if (!sequence[absValue] && absValue.length === 2) {
1362
+ if (CONFIG2.verbose)
1363
+ console.warn(absValue, "- value is not found because `subSequence` is set to false");
1364
+ absValue = absValue.slice(0, 1);
1365
+ }
1366
+ if (useVariable || CONFIG2.useVariable) {
1367
+ const varValue2 = `var(${prefix}${absValue}${mediaName})`;
1368
+ return isNegative ? `calc(${varValue2} * -1)` : varValue2;
1369
+ }
1370
+ const sequenceItem = sequence ? sequence[absValue] : null;
1371
+ if (!sequenceItem)
1372
+ return console.warn("can't find", sequence, absValue);
1373
+ if (unit === "ms" || unit === "s") {
1374
+ return isNegative + sequenceItem.val + unit;
1375
+ }
1376
+ return isNegative + sequenceItem.scaling + unit;
1377
+ };
1378
+ var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
1379
+ if (typeof value !== "string") {
1380
+ console.warn(propertyName, value, "is not a string");
1381
+ return {};
1382
+ }
1383
+ if (value === "-" || value === "")
1384
+ return {};
1385
+ return { [propertyName]: getSequenceValue(value, sequenceProps) };
1386
+ };
1387
+ var findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index];
1388
+ var findHeadings = (propertyNames) => {
1389
+ const { h1Matches, sequence } = propertyNames;
1390
+ return new Array(6).fill(null).map((_, i) => {
1391
+ const findLetter = findHeadingLetter(h1Matches, i);
1392
+ return sequence[findLetter];
1393
+ });
1394
+ };
1395
+
1396
+ // src/utils/var.js
1397
+ var import_utils6 = __toESM(require_cjs3(), 1);
1398
+ var applySequenceVars = (props, mediaName, options = {}) => {
1399
+ const CONFIG2 = getActiveConfig();
1400
+ const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1401
+ const unit = props.unit || UNIT2.default;
1402
+ const { sequence, scales } = props;
1403
+ for (const key in sequence) {
1404
+ const item = sequence[key];
1405
+ const value = (props.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1406
+ if (mediaName) {
1407
+ const query = MEDIA2[mediaName];
1408
+ if (!query) {
1409
+ if (CONFIG2.verbose)
1410
+ console.warn("Can't find query ", query);
1411
+ }
1412
+ let underMediaQuery = CSS_VARS2[`@media ${query}`];
1413
+ if (!underMediaQuery)
1414
+ underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1415
+ underMediaQuery[item.variable] = `var(${item.variable + "-" + mediaName})`;
1416
+ CSS_VARS2[item.variable + "-" + mediaName] = value;
1417
+ } else {
1418
+ if (options.useDefault === false) {
1419
+ CSS_VARS2[item.variable] = value;
1420
+ } else {
1421
+ CSS_VARS2[item.variable + "-default"] = value;
1422
+ CSS_VARS2[item.variable] = `var(${item.variable + "-default"})`;
1423
+ }
1424
+ }
1425
+ }
1426
+ };
1427
+
1428
+ // src/utils/sprite.js
1429
+ var import_utils7 = __toESM(require_cjs3(), 1);
1430
+ var generateSprite = (icons) => {
1431
+ let sprite = '<svg aria-hidden="true" width="0" height="0" style="position:absolute">';
1432
+ for (let key in icons) {
1433
+ sprite += icons[key];
1434
+ }
1435
+ sprite += "</svg>";
1436
+ return sprite;
1437
+ };
1438
+ var parseRootAttributes = (htmlString) => {
1439
+ if (!(0, import_utils7.isString)(htmlString)) {
1440
+ return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
1441
+ }
1442
+ let match = htmlString.match(/<svg\s+(.*?)>/);
1443
+ if (!match || !match[1]) {
1444
+ return {};
1445
+ }
1446
+ let attrString = match[1];
1447
+ let attrs = attrString.match(/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm);
1448
+ return attrs.reduce((acc, attr) => {
1449
+ let [key, value] = attr.split("=");
1450
+ acc[key] = value.replace(/['"]/g, "");
1451
+ return acc;
1452
+ }, {});
1453
+ };
1454
+ var convertSvgToSymbol = (key, code) => {
1455
+ const extractAttrs = parseRootAttributes(code);
1456
+ const { width, height } = extractAttrs;
1457
+ const viewBox = extractAttrs.viewBox || `0 0 ${width || 24} ${height || 24}`;
1458
+ const xmlns = "http://www.w3.org/2000/svg";
1459
+ let symbol = code.replace(
1460
+ "<svg",
1461
+ `<symbol id="${key}" xmlns="${xmlns}" viewBox="${viewBox}"`
1462
+ );
1463
+ symbol = symbol.replace(/width="[^\"]*/, "");
1464
+ symbol = symbol.replace(/height="[^\"]*/, "");
1465
+ symbol = symbol.replace("</svg", "</symbol");
1466
+ return symbol;
1467
+ };
1468
+
1469
+ // src/system/color.js
1470
+ var getColor = (value, key) => {
1471
+ const CONFIG2 = getActiveConfig();
1472
+ if (!(0, import_utils8.isString)(value)) {
1473
+ if (CONFIG2.verbose)
1474
+ console.warn(value, "- type for color is not valid");
1475
+ return;
1476
+ }
1477
+ if (value.slice(0, 2) === "--")
1478
+ return `var(${value})`;
1479
+ if (key && value[key])
1480
+ value = value[key];
1481
+ const [name, alpha, tone] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
1482
+ const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1483
+ let val = COLOR2[name] || GRADIENT2[name];
1484
+ if (!val) {
1485
+ if (CONFIG2.verbose)
1486
+ console.warn("Can't find color ", name);
1487
+ return value;
1488
+ }
1489
+ if (key) {
1490
+ if (val[key])
1491
+ val = val[key];
1492
+ else if (CONFIG2.verbose)
1493
+ console.warn(value, " - does not have ", key);
1494
+ }
1495
+ let rgb = val.rgb;
1496
+ if (rgb) {
1497
+ if (tone) {
1498
+ if (!val[tone]) {
1499
+ const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
1500
+ if (tone.slice(0, 1) === "-" || tone.slice(0, 1) === "+") {
1501
+ rgb = hexToRgbArray(getColorShade(toHex, parseFloat(tone))).join(", ");
1502
+ } else {
1503
+ const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
1504
+ const hsl = rgbToHSL(r, g, b);
1505
+ const [h, s, l] = hsl;
1506
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1507
+ rgb = newRgb;
1508
+ }
1509
+ val[tone] = { rgb, var: `${val.var}-${tone}` };
1510
+ } else
1511
+ rgb = val[tone].rgb;
1512
+ }
1513
+ if (alpha)
1514
+ return `rgba(${rgb}, ${alpha})`;
1515
+ return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
1516
+ } else
1517
+ return CONFIG2.useVariable ? `var(${val.var})` : val.value;
1518
+ };
1519
+ var getMediaColor = (value, property, globalTheme) => {
1520
+ const CONFIG2 = getActiveConfig();
1521
+ if (!globalTheme)
1522
+ globalTheme = CONFIG2.globalTheme;
1523
+ if (!(0, import_utils8.isString)(value)) {
1524
+ if (CONFIG2.verbose)
1525
+ console.warn(value, "- type for color is not valid");
1526
+ return;
1527
+ }
1528
+ if (value.slice(0, 2) === "--")
1529
+ return { [property]: `var(${value})` };
1530
+ const [name] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
1531
+ const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1532
+ const val = COLOR2[name] || GRADIENT2[name];
1533
+ const isObj = (0, import_utils8.isObject)(val);
1534
+ if (isObj && val.value)
1535
+ return { [property]: getColor(value, globalTheme) };
1536
+ else if (isObj) {
1537
+ if (globalTheme)
1538
+ return { [property]: getColor(value, `@${globalTheme}`) };
1539
+ else {
1540
+ const obj = {};
1541
+ for (const mediaName in val) {
1542
+ const query = CONFIG2.MEDIA[mediaName.slice(1)];
1543
+ const media = `@media screen and ${query}`;
1544
+ obj[media] = { [property]: getColor(value, mediaName) };
1545
+ }
1546
+ return obj;
1547
+ }
1548
+ } else {
1549
+ if (CONFIG2.verbose)
1550
+ console.warn("Can't find color", value);
1551
+ return { [property]: value };
1552
+ }
1553
+ };
1554
+ var setColor = (val, key, suffix) => {
1555
+ const CONFIG2 = getActiveConfig();
1556
+ if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
1557
+ val = getColor(val.slice(2));
1558
+ if ((0, import_utils8.isArray)(val)) {
1559
+ return {
1560
+ "@light": setColor(val[0], key, "light"),
1561
+ "@dark": setColor(val[1], key, "dark")
1562
+ };
1563
+ }
1564
+ if ((0, import_utils8.isObject)(val)) {
1565
+ const obj = {};
1566
+ for (const variant in val)
1567
+ obj[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1568
+ return obj;
1569
+ }
1570
+ const CSSVar = `--color-${key}` + (suffix ? `-${suffix}` : "");
1571
+ const [r, g, b, a = 1] = colorStringToRgbaArray(val.value || val);
1572
+ const alpha = parseFloat(a.toFixed(2));
1573
+ const rgb = `${r}, ${g}, ${b}`;
1574
+ const value = `rgba(${rgb}, ${alpha})`;
1575
+ if (CONFIG2.useVariable) {
1576
+ CONFIG2.CSS_VARS[CSSVar] = value;
1577
+ }
1578
+ return {
1579
+ var: CSSVar,
1580
+ rgb,
1581
+ alpha,
1582
+ value
1583
+ };
1584
+ };
1585
+ var setGradient = (val, key, suffix) => {
1586
+ const CONFIG2 = getActiveConfig();
1587
+ if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
1588
+ val = getColor(val.slice(2));
1589
+ if ((0, import_utils8.isArray)(val)) {
1590
+ return {
1591
+ "@light": setGradient(val[0], key, "light"),
1592
+ "@dark": setGradient(val[0], key, "dark")
1593
+ };
1594
+ }
1595
+ if ((0, import_utils8.isObject)(val)) {
1596
+ const obj = {};
1597
+ for (const variant in val)
1598
+ obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1599
+ return obj;
1600
+ }
1601
+ const CSSVar = `--gradient-${key}` + (suffix ? `-${suffix}` : "");
1602
+ if (CONFIG2.useVariable) {
1603
+ CONFIG2.CSS_VARS[CSSVar] = val.value || val;
1604
+ }
1605
+ return {
1606
+ var: CSSVar,
1607
+ value: val.value || val
1608
+ };
1609
+ };
1610
+
1611
+ // src/system/theme.js
1612
+ var import_utils10 = __toESM(require_cjs3(), 1);
1613
+ var setThemeValue = (theme) => {
1614
+ const value = {};
1615
+ const { state, media, helpers, ...rest } = theme;
1616
+ const keys = Object.keys(rest);
1617
+ keys.map((key) => {
1618
+ const conditions = ["color", "Color", "background", "border"];
1619
+ const isColor = conditions.some((k) => key.includes(k));
1620
+ return value[key] = isColor ? getColor(theme[key]) : theme[key];
1621
+ });
1622
+ return value;
1623
+ };
1624
+ var getThemeValue = (theme) => {
1625
+ if (theme.value)
1626
+ return theme.value;
1627
+ theme.value = setThemeValue(theme);
1628
+ return theme.value;
1629
+ };
1630
+ var getTheme = (value, modifier) => {
1631
+ const CONFIG2 = getActiveConfig();
1632
+ if (CONFIG2.useVariable)
1633
+ return getMediaTheme(value, modifier);
1634
+ const { THEME: THEME2 } = CONFIG2;
1635
+ if ((0, import_utils10.isString)(value)) {
1636
+ const [theme, subtheme] = value.split(" ");
1637
+ const isOurTheme = THEME2[theme];
1638
+ if (isOurTheme) {
1639
+ if (!subtheme && !modifier)
1640
+ return getThemeValue(isOurTheme);
1641
+ value = [theme, subtheme || modifier];
1642
+ }
1643
+ }
1644
+ if ((0, import_utils10.isObjectLike)(value) && value[1]) {
1645
+ const themeName = value[0];
1646
+ const subThemeName = value[1];
1647
+ const { helpers, media, state } = THEME2[themeName];
1648
+ if (media && media[subThemeName])
1649
+ return getThemeValue(media[subThemeName]);
1650
+ if (helpers && helpers[subThemeName])
1651
+ return getThemeValue(helpers[subThemeName]);
1652
+ if (state && state[subThemeName])
1653
+ return getThemeValue(state[subThemeName]);
1654
+ } else if ((0, import_utils10.isObject)(value))
1655
+ return setThemeValue(value);
1656
+ };
1657
+ var setInverseTheme = (theme, variant, value) => {
1658
+ if ((0, import_utils10.isObject)(variant)) {
1659
+ theme.variants.inverse.value = setThemeValue(variant);
1660
+ } else if (variant === true) {
1661
+ const { color, background } = value;
1662
+ theme.variants.inverse = {
1663
+ value: {
1664
+ color: background,
1665
+ background: color
1666
+ }
1667
+ };
1668
+ }
1669
+ };
1670
+ var setPseudo = (theme, key, variant, themeValue) => {
1671
+ const result = getTheme(variant);
1672
+ themeValue[`&:${key}`] = result;
1673
+ if ((0, import_utils10.isObject)(variant) && !variant.value)
1674
+ variant.value = result;
1675
+ };
1676
+ var setSelectors = (theme, value) => {
1677
+ const { state } = theme;
1678
+ if (!state)
1679
+ return;
1680
+ const keys = Object.keys(state);
1681
+ keys.map((key) => {
1682
+ const variant = state[key];
1683
+ setPseudo(theme, key, variant, value);
1684
+ return theme;
1685
+ });
1686
+ return theme;
1687
+ };
1688
+ var setPrefersScheme = (theme, key, variant, themeValue) => {
1689
+ const result = getTheme(variant);
1690
+ themeValue[`@media (prefers-color-scheme: ${key})`] = result;
1691
+ if ((0, import_utils10.isObject)(variant) && !variant.value)
1692
+ variant.value = result;
1693
+ };
1694
+ var setMedia = (theme, value) => {
1695
+ const { media } = theme;
1696
+ if (!media)
1697
+ return;
1698
+ const keys = Object.keys(media);
1699
+ keys.map((key) => {
1700
+ const variant = media[key];
1701
+ if (key === "dark" || key === "light")
1702
+ setPrefersScheme(theme, key, variant, value);
1703
+ if (key === "inverse")
1704
+ setInverseTheme(theme, variant, value);
1705
+ return theme;
1706
+ });
1707
+ return theme;
1708
+ };
1709
+ var setHelpers = (theme, value) => {
1710
+ const CONFIG2 = getActiveConfig();
1711
+ const { helpers } = theme;
1712
+ if (!helpers)
1713
+ return;
1714
+ const keys = Object.keys(helpers);
1715
+ keys.map((key) => {
1716
+ const helper = helpers[key];
1717
+ if ((0, import_utils10.isString)(helper))
1718
+ helpers[key] = CONFIG2.THEME[helper];
1719
+ else
1720
+ getThemeValue(helpers[key]);
1721
+ return theme;
1722
+ });
1723
+ return theme;
1724
+ };
1725
+ var setTheme = (val, key) => {
1726
+ const CONFIG2 = getActiveConfig();
1727
+ if (CONFIG2.useVariable)
1728
+ return setMediaTheme(val, key);
1729
+ const { state, media, helpers } = val;
1730
+ const value = setThemeValue(val, key);
1731
+ const CSSvar = `--theme-${key}`;
1732
+ setSelectors(val, value);
1733
+ setMedia(val, value);
1734
+ setHelpers(val, value);
1735
+ return { var: CSSvar, value, state, media, helpers };
1736
+ };
1737
+ var setMediaTheme = (val, key, suffix, prefers) => {
1738
+ const CONFIG2 = getActiveConfig();
1739
+ const { CSS_VARS: CSS_VARS2 } = CONFIG2;
1740
+ const theme = { value: val };
1741
+ if ((0, import_utils10.isObjectLike)(val)) {
1742
+ for (const param in val) {
1743
+ const symb = param.slice(0, 1);
1744
+ const value = val[param];
1745
+ if (symb === "@" || symb === ":" || symb === ".") {
1746
+ const hasPrefers = symb === "@" && param;
1747
+ theme[param] = setMediaTheme(value, key, param, prefers || hasPrefers);
1748
+ } else {
1749
+ const color = getColor(value, prefers);
1750
+ const metaSuffixes = [...new Set([prefers, suffix].filter((v) => v).map((v) => v.slice(1)))];
1751
+ const varmetaSuffixName = metaSuffixes.length ? "-" + metaSuffixes.join("-") : "";
1752
+ const CSSVar = `--theme-${key}${varmetaSuffixName}-${param}`;
1753
+ if (CONFIG2.useVariable) {
1754
+ CSS_VARS2[CSSVar] = color;
1755
+ theme[param] = `var(${CSSVar})`;
1756
+ } else {
1757
+ theme[param] = color;
1758
+ }
1759
+ theme[`.${param}`] = { [param]: theme[param] };
1760
+ }
1761
+ }
1762
+ if (theme["background"] || theme["color"] || theme["backgroundColor"]) {
1763
+ theme[".inversed"] = {
1764
+ color: theme["background"] || theme["backgroundColor"],
1765
+ background: theme["color"]
1766
+ };
1767
+ }
1768
+ }
1769
+ if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--") {
1770
+ const { THEME: THEME2 } = CONFIG2;
1771
+ const value = THEME2[val.slice(2)];
1772
+ const getReferenced = getMediaTheme(value, prefers);
1773
+ return getReferenced;
1774
+ }
1775
+ return theme;
1776
+ };
1777
+ var recursiveTheme = (val) => {
1778
+ const CONFIG2 = getActiveConfig();
1779
+ const obj = {};
1780
+ for (const param in val) {
1781
+ const symb = param.slice(0, 1);
1782
+ if ((0, import_utils10.isObjectLike)(val[param])) {
1783
+ if (symb === "@") {
1784
+ const query = CONFIG2.MEDIA[param.slice(1)];
1785
+ const media = `@media screen and ${query}`;
1786
+ obj[media] = recursiveTheme(val[param]);
1787
+ } else if (symb === ":") {
1788
+ obj[`&${param}`] = recursiveTheme(val[param]);
1789
+ }
1790
+ } else
1791
+ obj[param] = val[param];
1792
+ }
1793
+ return obj;
1794
+ };
1795
+ var findModifierFromArray = (val, modifierArray) => {
1796
+ const currentMod = modifierArray.shift();
1797
+ if (val[currentMod])
1798
+ return findModifierFromArray(val[currentMod], modifierArray);
1799
+ return val;
1800
+ };
1801
+ var findModifier = (val, modifier) => {
1802
+ if ((0, import_utils10.isArray)(modifier))
1803
+ return findModifierFromArray(val, modifier);
1804
+ else if ((0, import_utils10.isString)(modifier) && val[modifier])
1805
+ return val[modifier];
1806
+ else
1807
+ return val;
1808
+ };
1809
+ var getMediaTheme = (val, mod) => {
1810
+ const CONFIG2 = getActiveConfig();
1811
+ if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--")
1812
+ val = getMediaTheme(val.slice(2));
1813
+ if (!val || !(0, import_utils10.isString)(val)) {
1814
+ if (CONFIG2.verbose)
1815
+ console.warn(val, "- theme is not string");
1816
+ return;
1817
+ }
1818
+ const [name, ...modifier] = (0, import_utils10.isArray)(val) ? val : val.split(" ");
1819
+ let value = CONFIG2.THEME[name];
1820
+ if (value && (modifier || mod)) {
1821
+ value = findModifier(value, modifier.length ? modifier : mod);
1822
+ }
1823
+ const r = recursiveTheme(value);
1824
+ return r;
1825
+ };
1826
+
1827
+ // src/system/font.js
1828
+ var import_utils11 = __toESM(require_cjs3(), 1);
1829
+ var setFont = (val, key) => {
1830
+ const CSSvar = `--font-${key}`;
1831
+ const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
1832
+ return { var: CSSvar, value: val, fontFace };
1833
+ };
1834
+ var getFontFamily = (key, factory) => {
1835
+ const CONFIG2 = getActiveConfig();
1836
+ const { FONT_FAMILY: FONT_FAMILY2 } = CONFIG2;
1837
+ return getDefaultOrFirstKey(factory || FONT_FAMILY2, key);
1838
+ };
1839
+ var setFontFamily = (val, key) => {
1840
+ const CONFIG2 = getActiveConfig();
1841
+ const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
1842
+ let { value, type } = val;
1843
+ if (val.isDefault)
1844
+ FONT_FAMILY2.default = key;
1845
+ if ((0, import_utils11.isObject)(value))
1846
+ value = arrayzeValue(value);
1847
+ const CSSvar = `--font-family-${key}`;
1848
+ const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
1849
+ return { var: CSSvar, value: str, arr: value, type };
1850
+ };
1851
+
1852
+ // src/system/typography.js
1853
+ var import_utils14 = __toESM(require_cjs3(), 1);
1854
+ var runThroughMedia = (props) => {
1855
+ const CONFIG2 = getActiveConfig();
1856
+ const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
1857
+ for (const prop in props) {
1858
+ const mediaProps = props[prop];
1859
+ if (prop.slice(0, 1) === "@") {
1860
+ const { type, base, ratio, range, subSequence, h1Matches, unit } = props;
1861
+ (0, import_utils14.merge)(mediaProps, {
1862
+ type,
1863
+ base,
1864
+ ratio,
1865
+ range,
1866
+ subSequence,
1867
+ h1Matches,
1868
+ unit,
1869
+ sequence: {},
1870
+ scales: {},
1871
+ templates: {},
1872
+ vars: {}
1873
+ });
1874
+ generateSequence(mediaProps);
1875
+ const mediaName = prop.slice(1);
1876
+ applySequenceVars(mediaProps, mediaName);
1877
+ const query = MEDIA2[mediaName];
1878
+ TYPOGRAPHY2.templates[`@media screen and ${query}`] = {
1879
+ fontSize: mediaProps.base / TYPOGRAPHY2.browserDefault + unit
1880
+ };
1881
+ }
1882
+ }
1883
+ };
1884
+ var applyHeadings = (props) => {
1885
+ const CONFIG2 = getActiveConfig();
1886
+ if (props.h1Matches) {
1887
+ const unit = props.unit;
1888
+ const HEADINGS = findHeadings(props);
1889
+ const { templates } = props;
1890
+ for (const k in HEADINGS) {
1891
+ const headerName = `h${parseInt(k) + 1}`;
1892
+ const headerStyle = templates[headerName];
1893
+ templates[headerName] = {
1894
+ fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
1895
+ margin: headerStyle ? headerStyle.margin : 0,
1896
+ lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1897
+ letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
1898
+ fontWeight: headerStyle ? headerStyle.fontWeight : 900 - k * 100
1899
+ };
1900
+ }
1901
+ }
1902
+ };
1903
+ var applyTypographySequence = () => {
1904
+ const CONFIG2 = getActiveConfig();
1905
+ const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
1906
+ generateSequence(TYPOGRAPHY2);
1907
+ applyHeadings(TYPOGRAPHY2);
1908
+ applySequenceVars(TYPOGRAPHY2);
1909
+ runThroughMedia(TYPOGRAPHY2);
1910
+ };
1911
+ var getFontSizeByKey = (value) => {
1912
+ const CONFIG2 = getActiveConfig();
1913
+ const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
1914
+ return getSequenceValuePropertyPair(
1915
+ value,
1916
+ "fontSize",
1917
+ TYPOGRAPHY2
1918
+ );
1919
+ };
1920
+
1921
+ // src/system/spacing.js
1922
+ var import_utils17 = __toESM(require_cjs3(), 1);
1923
+ var runThroughMedia2 = (sequenceProps) => {
1924
+ for (const prop in sequenceProps) {
1925
+ const mediaProps = sequenceProps[prop];
1926
+ if (prop.slice(0, 1) === "@") {
1927
+ const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
1928
+ (0, import_utils17.merge)(mediaProps, {
1929
+ type,
1930
+ base,
1931
+ ratio,
1932
+ range,
1933
+ subSequence,
1934
+ h1Matches,
1935
+ unit,
1936
+ sequence: {},
1937
+ scales: {},
1938
+ templates: {},
1939
+ vars: {}
1940
+ });
1941
+ generateSequence(mediaProps);
1942
+ const mediaName = prop.slice(1);
1943
+ applySequenceVars(mediaProps, mediaName);
1944
+ }
1945
+ }
1946
+ };
1947
+ var applySpacingSequence = () => {
1948
+ const CONFIG2 = getActiveConfig();
1949
+ const { SPACING: SPACING2 } = CONFIG2;
1950
+ generateSequence(SPACING2);
1951
+ applySequenceVars(SPACING2);
1952
+ runThroughMedia2(SPACING2);
1953
+ };
1954
+ var getSequence = (sequenceProps) => {
1955
+ const CONFIG2 = getActiveConfig();
1956
+ const { SPACING: SPACING2 } = CONFIG2;
1957
+ if (!sequenceProps)
1958
+ return SPACING2;
1959
+ const hasGenerated = Object.keys(sequenceProps.sequence).length > 0;
1960
+ return hasGenerated ? sequenceProps : generateSequence(sequenceProps);
1961
+ };
1962
+ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
1963
+ const sequence = getSequence(sequenceProps);
1964
+ const stack = arrayzeValue(value);
1965
+ if (!stack)
1966
+ return;
1967
+ if ((0, import_utils17.isString)(value) && value.includes("calc")) {
1968
+ return { [propertyName]: value };
1969
+ }
1970
+ if (stack.length > 1) {
1971
+ let suffix = "";
1972
+ if (propertyName === "borderWidth") {
1973
+ propertyName = "border";
1974
+ suffix = "Width";
1975
+ }
1976
+ const directions = {
1977
+ 2: ["Block", "Inline"],
1978
+ 3: ["BlockStart", "Inline", "BlockEnd"],
1979
+ 4: ["BlockStart", "InlineEnd", "BlockEnd", "InlineStart"]
1980
+ };
1981
+ const wrapSequenceValueByDirection = (direction, i) => getSequenceValuePropertyPair(
1982
+ stack[i],
1983
+ propertyName + direction + suffix,
1984
+ sequence
1985
+ );
1986
+ return directions[stack.length].map((dir, key) => wrapSequenceValueByDirection(dir, key));
1987
+ }
1988
+ return getSequenceValuePropertyPair(
1989
+ value,
1990
+ propertyName,
1991
+ sequence
1992
+ );
1993
+ };
1994
+ var getSpacingBasedOnRatio = (props, propertyName, val) => {
1995
+ const CONFIG2 = getActiveConfig();
1996
+ const { SPACING: SPACING2 } = CONFIG2;
1997
+ const { spacingRatio, unit } = props;
1998
+ const value = val || props[propertyName];
1999
+ if (spacingRatio) {
2000
+ let sequenceProps = SPACING2[spacingRatio];
2001
+ if (!sequenceProps) {
2002
+ const { type, base, range, subSequence } = SPACING2;
2003
+ sequenceProps = SPACING2[spacingRatio] = (0, import_utils17.merge)({
2004
+ ratio: spacingRatio,
2005
+ type: type + "-" + spacingRatio,
2006
+ unit,
2007
+ sequence: {},
2008
+ scales: {},
2009
+ templates: {},
2010
+ vars: {}
2011
+ }, {
2012
+ base,
2013
+ range,
2014
+ subSequence,
2015
+ ratio: SPACING2.ratio,
2016
+ unit: SPACING2.unit
2017
+ });
2018
+ }
2019
+ applySequenceVars(sequenceProps, null, { useDefault: false });
2020
+ return getSpacingByKey(value, propertyName, sequenceProps);
2021
+ }
2022
+ return getSpacingByKey(value, propertyName);
2023
+ };
2024
+
2025
+ // src/system/timing.js
2026
+ var applyTimingSequence = () => {
2027
+ const CONFIG2 = getActiveConfig();
2028
+ const { TIMING: TIMING2 } = CONFIG2;
2029
+ generateSequence(TIMING2);
2030
+ applySequenceVars(TIMING2);
2031
+ };
2032
+ var getTimingFunction = (value) => {
2033
+ const CONFIG2 = getActiveConfig();
2034
+ const { TIMING: TIMING2 } = CONFIG2;
2035
+ return TIMING2[value] || TIMING2[toCamelCase(value)] || value;
2036
+ };
2037
+ var getTimingByKey = (value, property = "timing") => {
2038
+ const CONFIG2 = getActiveConfig();
2039
+ const { TIMING: TIMING2 } = CONFIG2;
2040
+ return getSequenceValuePropertyPair(
2041
+ value,
2042
+ property,
2043
+ TIMING2
2044
+ );
2045
+ };
2046
+
2047
+ // src/system/document.js
2048
+ var import_utils21 = __toESM(require_cjs3(), 1);
2049
+ var applyDocument = () => {
2050
+ const CONFIG2 = getActiveConfig();
2051
+ const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
2052
+ return (0, import_utils21.merge)(DOCUMENT2, {
2053
+ theme: THEME2.document,
2054
+ fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
2055
+ fontSize: TYPOGRAPHY2.base,
2056
+ lineHeight: TYPOGRAPHY2.lineHeight
2057
+ });
2058
+ };
2059
+
2060
+ // src/system/svg.js
2061
+ var import_globals2 = __toESM(require_cjs(), 1);
2062
+ var DEF_OPTIONS = {
2063
+ document: import_globals2.document
2064
+ };
2065
+ var setSVG = (val, key) => {
2066
+ if (!val) {
2067
+ if (CONFIG2.verbose)
2068
+ console.warn("setSVG: val is not defined", key);
2069
+ return;
2070
+ }
2071
+ const CONFIG2 = getActiveConfig();
2072
+ if (CONFIG2.useSvgSprite) {
2073
+ return convertSvgToSymbol(key, val);
2074
+ }
2075
+ return val;
2076
+ };
2077
+ var appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
2078
+ const CONFIG2 = getActiveConfig();
2079
+ const doc = options.document || import_globals2.document;
2080
+ const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.SVG;
2081
+ for (let key in LIBRARY)
2082
+ lib[key] = CONFIG2.SVG[key];
2083
+ const SVGsprite = generateSprite(lib);
2084
+ if (!doc) {
2085
+ console.warn("To append SVG sprites it should be run in browser environment");
2086
+ return SVGsprite;
2087
+ }
2088
+ const svgSpriteDOM = doc.createElement("template");
2089
+ svgSpriteDOM.innerHTML = SVGsprite;
2090
+ doc.body.appendChild(svgSpriteDOM.content);
2091
+ };
2092
+ var setIcon = (val, key) => {
2093
+ const CONFIG2 = getActiveConfig();
2094
+ if (CONFIG2.useIconSprite) {
2095
+ return setSVG(val, key);
2096
+ }
2097
+ return val;
2098
+ };
2099
+ var appendIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
2100
+ const CONFIG2 = getActiveConfig();
2101
+ const doc = options.document || import_globals2.document;
2102
+ const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.ICONS;
2103
+ for (let key in LIBRARY)
2104
+ lib[key] = CONFIG2.ICONS[key];
2105
+ const SVGsprite = generateSprite(lib);
2106
+ if (!doc) {
2107
+ console.warn("To append SVG Icon sprites it should be run in browser environment");
2108
+ return SVGsprite;
2109
+ }
2110
+ const iconsSpriteDOM = doc.createElement("template");
2111
+ iconsSpriteDOM.innerHTML = SVGsprite;
2112
+ doc.body.appendChild(iconsSpriteDOM.content);
2113
+ };
2114
+
2115
+ // src/system/reset.js
2116
+ var import_utils24 = __toESM(require_cjs3(), 1);
2117
+ var applyReset = (reset = {}) => {
2118
+ const CONFIG2 = getActiveConfig();
2119
+ const { CSS_VARS: CSS_VARS2, RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
2120
+ if (RESET2) {
2121
+ if (RESET2[":root"]) {
2122
+ const configReset = RESET2;
2123
+ const configTemplates = TYPOGRAPHY2.templates;
2124
+ configReset.body = {
2125
+ ...getMediaTheme("document", `@${CONFIG2.globalTheme}`),
2126
+ ...configTemplates.body
2127
+ };
2128
+ configReset.h1 = configTemplates.h1;
2129
+ configReset.h2 = configTemplates.h2;
2130
+ configReset.h3 = configTemplates.h3;
2131
+ configReset.h4 = configTemplates.h4;
2132
+ configReset.h5 = configTemplates.h5;
2133
+ configReset.h6 = configTemplates.h6;
2134
+ }
2135
+ const { body, ...templates } = TYPOGRAPHY2.templates;
2136
+ return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
2137
+ html: {
2138
+ position: "absolute",
2139
+ // overflow: 'hidden',
2140
+ width: "100%",
2141
+ height: "100%",
2142
+ top: "0",
2143
+ left: "0",
2144
+ margin: "0",
2145
+ WebkitFontSmoothing: "antialiased",
2146
+ transform: "translate3d(0, 0, 1px)",
2147
+ scrollBehavior: "smooth",
2148
+ fontSize: TYPOGRAPHY2.browserDefault + "px",
2149
+ ...CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {},
2150
+ fontFamily: DOCUMENT2.fontFamily,
2151
+ lineHeight: DOCUMENT2.lineHeight
2152
+ },
2153
+ body: {
2154
+ boxSizing: "border-box",
2155
+ height: "100%",
2156
+ margin: 0,
2157
+ fontFamily: DOCUMENT2.fontFamily,
2158
+ fontSize: TYPOGRAPHY2.base / TYPOGRAPHY2.browserDefault + CONFIG2.UNIT.default,
2159
+ ...templates,
2160
+ ...body
2161
+ },
2162
+ // form elements
2163
+ fieldset: {
2164
+ border: 0,
2165
+ padding: 0,
2166
+ margin: 0
2167
+ },
2168
+ "select, input": {
2169
+ fontFamily: DOCUMENT2.fontFamily
2170
+ }
2171
+ });
2172
+ }
2173
+ };
2174
+
2175
+ // src/set.js
2176
+ var import_utils25 = __toESM(require_cjs3(), 1);
2177
+ var setCases = (val, key) => {
2178
+ if ((0, import_utils25.isFunction)(val))
35
2179
  return val();
36
2180
  return val;
37
2181
  };
38
- const setSameValue = (val, key) => val;
39
- const VALUE_TRANSFORMERS = {
40
- color: import_system.setColor,
41
- gradient: import_system.setGradient,
42
- font: import_system.setFont,
43
- font_family: import_system.setFontFamily,
44
- theme: import_system.setTheme,
45
- icons: import_system.setIcon,
46
- svg: import_system.setSVG,
2182
+ var setSameValue = (val, key) => val;
2183
+ var VALUE_TRANSFORMERS = {
2184
+ color: setColor,
2185
+ gradient: setGradient,
2186
+ font: setFont,
2187
+ font_family: setFontFamily,
2188
+ theme: setTheme,
2189
+ icons: setIcon,
2190
+ svg: setSVG,
47
2191
  svg_data: setSameValue,
48
2192
  typography: setSameValue,
49
2193
  cases: setCases,
@@ -54,28 +2198,28 @@ const VALUE_TRANSFORMERS = {
54
2198
  unit: setSameValue,
55
2199
  animation: setSameValue
56
2200
  };
57
- const setValue = (FACTORY_NAME, value, key) => {
58
- const CONFIG = (0, import_factory.getActiveConfig)();
2201
+ var setValue = (FACTORY_NAME, value, key) => {
2202
+ const CONFIG2 = getActiveConfig();
59
2203
  const factoryName = FACTORY_NAME.toLowerCase();
60
- const FACTORY2 = CONFIG[FACTORY_NAME];
2204
+ const FACTORY2 = CONFIG2[FACTORY_NAME];
61
2205
  if (VALUE_TRANSFORMERS[factoryName]) {
62
2206
  const result = VALUE_TRANSFORMERS[factoryName](value, key);
63
2207
  FACTORY2[key] = result;
64
2208
  return FACTORY2;
65
2209
  }
66
- if (CONFIG.verbose)
2210
+ if (CONFIG2.verbose)
67
2211
  console.warn("Can not find", factoryName, "method in scratch");
68
2212
  };
69
- const setEach = (factoryName, props) => {
70
- const CONFIG = (0, import_factory.getActiveConfig)();
2213
+ var setEach = (factoryName, props) => {
2214
+ const CONFIG2 = getActiveConfig();
71
2215
  const FACTORY_NAME = factoryName.toUpperCase();
72
2216
  const keys = Object.keys(props);
73
2217
  keys.map((key) => setValue(FACTORY_NAME, props[key], key));
74
- return CONFIG[FACTORY_NAME];
2218
+ return CONFIG2[FACTORY_NAME];
75
2219
  };
76
- const SET_OPTIONS = {};
77
- const set = (recivedConfig, options = SET_OPTIONS) => {
78
- let CONFIG = (0, import_factory.getActiveConfig)();
2220
+ var SET_OPTIONS = {};
2221
+ var set = (recivedConfig, options = SET_OPTIONS) => {
2222
+ let CONFIG2 = getActiveConfig();
79
2223
  const {
80
2224
  version,
81
2225
  verbose,
@@ -89,33 +2233,33 @@ const set = (recivedConfig, options = SET_OPTIONS) => {
89
2233
  ...config
90
2234
  } = recivedConfig;
91
2235
  if (options.newConfig) {
92
- import_factory.FACTORY["active"] = options.newConfig;
93
- CONFIG = (0, import_factory.getActiveConfig)(options.newConfig);
2236
+ FACTORY["active"] = options.newConfig;
2237
+ CONFIG2 = getActiveConfig(options.newConfig);
94
2238
  }
95
2239
  if (verbose !== void 0)
96
- CONFIG.verbose = verbose;
2240
+ CONFIG2.verbose = verbose;
97
2241
  if (useVariable !== void 0)
98
- CONFIG.useVariable = useVariable;
2242
+ CONFIG2.useVariable = useVariable;
99
2243
  if (useReset !== void 0)
100
- CONFIG.useReset = useReset;
2244
+ CONFIG2.useReset = useReset;
101
2245
  if (useFontImport !== void 0)
102
- CONFIG.useFontImport = useFontImport;
2246
+ CONFIG2.useFontImport = useFontImport;
103
2247
  if (useSvgSprite !== void 0)
104
- CONFIG.useSvgSprite = useSvgSprite;
2248
+ CONFIG2.useSvgSprite = useSvgSprite;
105
2249
  if (useIconSprite !== void 0)
106
- CONFIG.useIconSprite = useIconSprite;
2250
+ CONFIG2.useIconSprite = useIconSprite;
107
2251
  if (useDocumentTheme !== void 0)
108
- CONFIG.useDocumentTheme = useDocumentTheme;
2252
+ CONFIG2.useDocumentTheme = useDocumentTheme;
109
2253
  if (globalTheme !== void 0)
110
- CONFIG.globalTheme = globalTheme;
111
- if (CONFIG.verbose)
112
- console.log(CONFIG);
2254
+ CONFIG2.globalTheme = globalTheme;
2255
+ if (CONFIG2.verbose)
2256
+ console.log(CONFIG2);
113
2257
  const keys = Object.keys(config);
114
2258
  keys.map((key) => setEach(key, config[key]));
115
- (0, import_system.applyTypographySequence)();
116
- (0, import_system.applySpacingSequence)();
117
- (0, import_system.applyTimingSequence)();
118
- (0, import_system.applyDocument)();
119
- (0, import_system.applyReset)();
120
- return CONFIG;
2259
+ applyTypographySequence();
2260
+ applySpacingSequence();
2261
+ applyTimingSequence();
2262
+ applyDocument();
2263
+ applyReset();
2264
+ return CONFIG2;
121
2265
  };