@symbo.ls/scratch 2.11.125 → 2.11.131

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 (43) hide show
  1. package/package.json +2 -2
  2. package/LICENSE +0 -21
  3. package/dist/cjs/defaultConfig/animation.js +0 -26
  4. package/dist/cjs/defaultConfig/cases.js +0 -26
  5. package/dist/cjs/defaultConfig/color.js +0 -28
  6. package/dist/cjs/defaultConfig/document.js +0 -26
  7. package/dist/cjs/defaultConfig/font-family.js +0 -34
  8. package/dist/cjs/defaultConfig/font.js +0 -26
  9. package/dist/cjs/defaultConfig/icons.js +0 -26
  10. package/dist/cjs/defaultConfig/index.js +0 -221
  11. package/dist/cjs/defaultConfig/media.js +0 -51
  12. package/dist/cjs/defaultConfig/responsive.js +0 -50
  13. package/dist/cjs/defaultConfig/sequence.js +0 -51
  14. package/dist/cjs/defaultConfig/spacing.js +0 -85
  15. package/dist/cjs/defaultConfig/svg.js +0 -28
  16. package/dist/cjs/defaultConfig/templates.js +0 -26
  17. package/dist/cjs/defaultConfig/theme.js +0 -26
  18. package/dist/cjs/defaultConfig/timing.js +0 -67
  19. package/dist/cjs/defaultConfig/typography.js +0 -71
  20. package/dist/cjs/defaultConfig/unit.js +0 -28
  21. package/dist/cjs/factory.js +0 -1502
  22. package/dist/cjs/index.js +0 -3083
  23. package/dist/cjs/package.json +0 -4
  24. package/dist/cjs/set.js +0 -2452
  25. package/dist/cjs/system/color.js +0 -1735
  26. package/dist/cjs/system/document.js +0 -1528
  27. package/dist/cjs/system/font.js +0 -1568
  28. package/dist/cjs/system/index.js +0 -2640
  29. package/dist/cjs/system/reset.js +0 -1637
  30. package/dist/cjs/system/spacing.js +0 -1812
  31. package/dist/cjs/system/svg.js +0 -1639
  32. package/dist/cjs/system/theme.js +0 -1823
  33. package/dist/cjs/system/timing.js +0 -1725
  34. package/dist/cjs/system/typography.js +0 -1778
  35. package/dist/cjs/tests/index.js +0 -30
  36. package/dist/cjs/transforms/index.js +0 -2001
  37. package/dist/cjs/utils/color.js +0 -1423
  38. package/dist/cjs/utils/font.js +0 -72
  39. package/dist/cjs/utils/index.js +0 -2001
  40. package/dist/cjs/utils/sequence.js +0 -1671
  41. package/dist/cjs/utils/sprite.js +0 -1546
  42. package/dist/cjs/utils/theme.js +0 -34
  43. package/dist/cjs/utils/var.js +0 -1527
@@ -1,1778 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
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
- };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
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
- ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
-
33
- // ../../node_modules/@domql/utils/dist/cjs/key.js
34
- var require_key = __commonJS({
35
- "../../node_modules/@domql/utils/dist/cjs/key.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 key_exports = {};
55
- __export2(key_exports, {
56
- createKey: () => createKey,
57
- createSnapshotId: () => createSnapshotId
58
- });
59
- module2.exports = __toCommonJS2(key_exports);
60
- var createKey = function() {
61
- let index = 0;
62
- function newId() {
63
- index++;
64
- return index;
65
- }
66
- return newId;
67
- }();
68
- var createSnapshotId = createKey;
69
- }
70
- });
71
-
72
- // ../../node_modules/@domql/utils/dist/cjs/env.js
73
- var require_env = __commonJS({
74
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
75
- "use strict";
76
- var __defProp2 = Object.defineProperty;
77
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
78
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
79
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
80
- var __export2 = (target, all) => {
81
- for (var name in all)
82
- __defProp2(target, name, { get: all[name], enumerable: true });
83
- };
84
- var __copyProps2 = (to, from, except, desc) => {
85
- if (from && typeof from === "object" || typeof from === "function") {
86
- for (let key of __getOwnPropNames2(from))
87
- if (!__hasOwnProp2.call(to, key) && key !== except)
88
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
89
- }
90
- return to;
91
- };
92
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
93
- var env_exports = {};
94
- __export2(env_exports, {
95
- NODE_ENV: () => NODE_ENV,
96
- getNev: () => getNev,
97
- isDevelopment: () => isDevelopment,
98
- isProduction: () => isProduction,
99
- isTest: () => isTest
100
- });
101
- module2.exports = __toCommonJS2(env_exports);
102
- var NODE_ENV = "development";
103
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
104
- var isTest = (env = NODE_ENV) => env === "test";
105
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
106
- var getNev = (key, env = NODE_ENV) => env[key];
107
- }
108
- });
109
-
110
- // ../../node_modules/@domql/tags/dist/cjs/htmlTags.js
111
- var require_htmlTags = __commonJS({
112
- "../../node_modules/@domql/tags/dist/cjs/htmlTags.js"(exports, module2) {
113
- "use strict";
114
- var __defProp2 = Object.defineProperty;
115
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
116
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
117
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
118
- var __export2 = (target, all) => {
119
- for (var name in all)
120
- __defProp2(target, name, { get: all[name], enumerable: true });
121
- };
122
- var __copyProps2 = (to, from, except, desc) => {
123
- if (from && typeof from === "object" || typeof from === "function") {
124
- for (let key of __getOwnPropNames2(from))
125
- if (!__hasOwnProp2.call(to, key) && key !== except)
126
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
127
- }
128
- return to;
129
- };
130
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
131
- var htmlTags_exports = {};
132
- __export2(htmlTags_exports, {
133
- HTML_TAGS: () => HTML_TAGS
134
- });
135
- module2.exports = __toCommonJS2(htmlTags_exports);
136
- var HTML_TAGS = {
137
- root: [
138
- "body",
139
- "html"
140
- ],
141
- head: [
142
- "title",
143
- "base",
144
- "meta",
145
- "style"
146
- ],
147
- body: [
148
- "string",
149
- "fragment",
150
- "a",
151
- "abbr",
152
- "acronym",
153
- "address",
154
- "applet",
155
- "area",
156
- "article",
157
- "aside",
158
- "audio",
159
- "b",
160
- "basefont",
161
- "bdi",
162
- "bdo",
163
- "big",
164
- "blockquote",
165
- "br",
166
- "button",
167
- "canvas",
168
- "caption",
169
- "center",
170
- "cite",
171
- "code",
172
- "col",
173
- "colgroup",
174
- "data",
175
- "datalist",
176
- "dd",
177
- "del",
178
- "details",
179
- "dfn",
180
- "dialog",
181
- "dir",
182
- "div",
183
- "dl",
184
- "dt",
185
- "em",
186
- "embed",
187
- "fieldset",
188
- "figcaption",
189
- "figure",
190
- "font",
191
- "footer",
192
- "form",
193
- "frame",
194
- "frameset",
195
- "h1",
196
- "h2",
197
- "h3",
198
- "h4",
199
- "h5",
200
- "h6",
201
- "head",
202
- "header",
203
- "hr",
204
- "i",
205
- "iframe",
206
- "img",
207
- "input",
208
- "ins",
209
- "kbd",
210
- "label",
211
- "legend",
212
- "li",
213
- "link",
214
- "main",
215
- "map",
216
- "mark",
217
- "meter",
218
- "nav",
219
- "noframes",
220
- "noscript",
221
- "object",
222
- "ol",
223
- "optgroup",
224
- "option",
225
- "output",
226
- "p",
227
- "param",
228
- "picture",
229
- "pre",
230
- "progress",
231
- "q",
232
- "rp",
233
- "rt",
234
- "ruby",
235
- "s",
236
- "samp",
237
- "script",
238
- "section",
239
- "select",
240
- "small",
241
- "source",
242
- "span",
243
- "strike",
244
- "strong",
245
- "sub",
246
- "summary",
247
- "sup",
248
- "table",
249
- "tbody",
250
- "td",
251
- "template",
252
- "textarea",
253
- "tfoot",
254
- "th",
255
- "thead",
256
- "time",
257
- "tr",
258
- "track",
259
- "tt",
260
- "u",
261
- "ul",
262
- "var",
263
- "video",
264
- "wbr",
265
- // SVG
266
- "svg",
267
- "path"
268
- ]
269
- };
270
- }
271
- });
272
-
273
- // ../../node_modules/@domql/tags/dist/cjs/index.js
274
- var require_cjs = __commonJS({
275
- "../../node_modules/@domql/tags/dist/cjs/index.js"(exports, module2) {
276
- "use strict";
277
- var __defProp2 = Object.defineProperty;
278
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
279
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
280
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
281
- var __copyProps2 = (to, from, except, desc) => {
282
- if (from && typeof from === "object" || typeof from === "function") {
283
- for (let key of __getOwnPropNames2(from))
284
- if (!__hasOwnProp2.call(to, key) && key !== except)
285
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
286
- }
287
- return to;
288
- };
289
- var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
290
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
291
- var tags_exports = {};
292
- module2.exports = __toCommonJS2(tags_exports);
293
- __reExport(tags_exports, require_htmlTags(), module2.exports);
294
- }
295
- });
296
-
297
- // ../../node_modules/@domql/globals/dist/cjs/index.js
298
- var require_cjs2 = __commonJS({
299
- "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
300
- "use strict";
301
- var __defProp2 = Object.defineProperty;
302
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
303
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
304
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
305
- var __export2 = (target, all) => {
306
- for (var name in all)
307
- __defProp2(target, name, { get: all[name], enumerable: true });
308
- };
309
- var __copyProps2 = (to, from, except, desc) => {
310
- if (from && typeof from === "object" || typeof from === "function") {
311
- for (let key of __getOwnPropNames2(from))
312
- if (!__hasOwnProp2.call(to, key) && key !== except)
313
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
314
- }
315
- return to;
316
- };
317
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
318
- var globals_exports = {};
319
- __export2(globals_exports, {
320
- document: () => document3,
321
- global: () => global,
322
- self: () => self,
323
- window: () => window2
324
- });
325
- module2.exports = __toCommonJS2(globals_exports);
326
- var global = globalThis;
327
- var self = globalThis;
328
- var window2 = globalThis;
329
- var document3 = window2.document;
330
- }
331
- });
332
-
333
- // ../../node_modules/@domql/utils/dist/cjs/node.js
334
- var require_node = __commonJS({
335
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
336
- "use strict";
337
- var __defProp2 = Object.defineProperty;
338
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
339
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
340
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
341
- var __export2 = (target, all) => {
342
- for (var name in all)
343
- __defProp2(target, name, { get: all[name], enumerable: true });
344
- };
345
- var __copyProps2 = (to, from, except, desc) => {
346
- if (from && typeof from === "object" || typeof from === "function") {
347
- for (let key of __getOwnPropNames2(from))
348
- if (!__hasOwnProp2.call(to, key) && key !== except)
349
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
350
- }
351
- return to;
352
- };
353
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
354
- var node_exports = {};
355
- __export2(node_exports, {
356
- isHtmlElement: () => isHtmlElement,
357
- isNode: () => isNode
358
- });
359
- module2.exports = __toCommonJS2(node_exports);
360
- var import_globals2 = require_cjs2();
361
- var isNode = (obj) => {
362
- return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
363
- };
364
- var isHtmlElement = (obj) => {
365
- return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
366
- };
367
- }
368
- });
369
-
370
- // ../../node_modules/@domql/utils/dist/cjs/types.js
371
- var require_types = __commonJS({
372
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
373
- "use strict";
374
- var __defProp2 = Object.defineProperty;
375
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
376
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
377
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
378
- var __export2 = (target, all) => {
379
- for (var name in all)
380
- __defProp2(target, name, { get: all[name], enumerable: true });
381
- };
382
- var __copyProps2 = (to, from, except, desc) => {
383
- if (from && typeof from === "object" || typeof from === "function") {
384
- for (let key of __getOwnPropNames2(from))
385
- if (!__hasOwnProp2.call(to, key) && key !== except)
386
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
387
- }
388
- return to;
389
- };
390
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
391
- var types_exports = {};
392
- __export2(types_exports, {
393
- TYPES: () => TYPES,
394
- is: () => is,
395
- isArray: () => isArray4,
396
- isBoolean: () => isBoolean,
397
- isDefined: () => isDefined2,
398
- isFunction: () => isFunction,
399
- isNot: () => isNot,
400
- isNull: () => isNull,
401
- isNumber: () => isNumber2,
402
- isObject: () => isObject4,
403
- isObjectLike: () => isObjectLike2,
404
- isString: () => isString5,
405
- isUndefined: () => isUndefined,
406
- isValidHtmlTag: () => isValidHtmlTag
407
- });
408
- module2.exports = __toCommonJS2(types_exports);
409
- var import_tags = require_cjs();
410
- var import_node = require_node();
411
- var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.includes(arg);
412
- var isObject4 = (arg) => {
413
- if (arg === null)
414
- return false;
415
- return typeof arg === "object" && arg.constructor === Object;
416
- };
417
- var isString5 = (arg) => typeof arg === "string";
418
- var isNumber2 = (arg) => typeof arg === "number";
419
- var isFunction = (arg) => typeof arg === "function";
420
- var isBoolean = (arg) => arg === true || arg === false;
421
- var isNull = (arg) => arg === null;
422
- var isArray4 = (arg) => Array.isArray(arg);
423
- var isObjectLike2 = (arg) => {
424
- if (arg === null)
425
- return false;
426
- return typeof arg === "object";
427
- };
428
- var isDefined2 = (arg) => {
429
- return isObject4(arg) || isObjectLike2(arg) || isString5(arg) || isNumber2(arg) || isFunction(arg) || isArray4(arg) || isObjectLike2(arg) || isBoolean(arg) || isNull(arg);
430
- };
431
- var isUndefined = (arg) => {
432
- return arg === void 0;
433
- };
434
- var TYPES = {
435
- boolean: isBoolean,
436
- array: isArray4,
437
- object: isObject4,
438
- string: isString5,
439
- number: isNumber2,
440
- null: isNull,
441
- function: isFunction,
442
- objectLike: isObjectLike2,
443
- node: import_node.isNode,
444
- htmlElement: import_node.isHtmlElement,
445
- defined: isDefined2
446
- };
447
- var is = (arg) => {
448
- return (...args) => {
449
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
450
- };
451
- };
452
- var isNot = (arg) => {
453
- return (...args) => {
454
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
455
- };
456
- };
457
- }
458
- });
459
-
460
- // ../../node_modules/@domql/utils/dist/cjs/array.js
461
- var require_array = __commonJS({
462
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
463
- "use strict";
464
- var __defProp2 = Object.defineProperty;
465
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
466
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
467
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
468
- var __export2 = (target, all) => {
469
- for (var name in all)
470
- __defProp2(target, name, { get: all[name], enumerable: true });
471
- };
472
- var __copyProps2 = (to, from, except, desc) => {
473
- if (from && typeof from === "object" || typeof from === "function") {
474
- for (let key of __getOwnPropNames2(from))
475
- if (!__hasOwnProp2.call(to, key) && key !== except)
476
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
477
- }
478
- return to;
479
- };
480
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
481
- var array_exports = {};
482
- __export2(array_exports, {
483
- arrayContainsOtherArray: () => arrayContainsOtherArray,
484
- createNestedObject: () => createNestedObject,
485
- cutArrayAfterValue: () => cutArrayAfterValue,
486
- cutArrayBeforeValue: () => cutArrayBeforeValue,
487
- joinArrays: () => joinArrays,
488
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
489
- mergeArray: () => mergeArray,
490
- removeFromArray: () => removeFromArray,
491
- swapItemsInArray: () => swapItemsInArray
492
- });
493
- module2.exports = __toCommonJS2(array_exports);
494
- var import_object = require_object();
495
- var import_types = require_types();
496
- var arrayContainsOtherArray = (arr1, arr2) => {
497
- return arr2.every((val) => arr1.includes(val));
498
- };
499
- var removeFromArray = (arr, index) => {
500
- if ((0, import_types.isString)(index))
501
- index = parseInt(index);
502
- if ((0, import_types.isNumber)(index)) {
503
- if (index < 0 || index >= arr.length || isNaN(index)) {
504
- throw new Error("Invalid index");
505
- }
506
- arr.splice(index, 1);
507
- } else if ((0, import_types.isArray)(index)) {
508
- index.forEach((idx) => removeFromArray(arr, idx));
509
- } else {
510
- throw new Error("Invalid index");
511
- }
512
- return arr;
513
- };
514
- var swapItemsInArray = (arr, i, j) => {
515
- [arr[i], arr[j]] = [arr[j], arr[i]];
516
- };
517
- var joinArrays = (...arrays) => {
518
- return [].concat(...arrays);
519
- };
520
- var mergeArray = (arr, excludeFrom = []) => {
521
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
522
- };
523
- var mergeAndCloneIfArray = (obj) => {
524
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
525
- };
526
- var cutArrayBeforeValue = (arr, value) => {
527
- const index = arr.indexOf(value);
528
- if (index !== -1) {
529
- return arr.slice(0, index);
530
- }
531
- return arr;
532
- };
533
- var cutArrayAfterValue = (arr, value) => {
534
- const index = arr.indexOf(value);
535
- if (index !== -1) {
536
- return arr.slice(index + 1);
537
- }
538
- return arr;
539
- };
540
- var createNestedObject = (arr, lastValue) => {
541
- const nestedObject = {};
542
- if (arr.length === 0) {
543
- return lastValue;
544
- }
545
- arr.reduce((obj, value, index) => {
546
- if (!obj[value]) {
547
- obj[value] = {};
548
- }
549
- if (index === arr.length - 1 && lastValue) {
550
- obj[value] = lastValue;
551
- }
552
- return obj[value];
553
- }, nestedObject);
554
- return nestedObject;
555
- };
556
- }
557
- });
558
-
559
- // ../../node_modules/@domql/utils/dist/cjs/string.js
560
- var require_string = __commonJS({
561
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
562
- "use strict";
563
- var __defProp2 = Object.defineProperty;
564
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
565
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
566
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
567
- var __export2 = (target, all) => {
568
- for (var name in all)
569
- __defProp2(target, name, { get: all[name], enumerable: true });
570
- };
571
- var __copyProps2 = (to, from, except, desc) => {
572
- if (from && typeof from === "object" || typeof from === "function") {
573
- for (let key of __getOwnPropNames2(from))
574
- if (!__hasOwnProp2.call(to, key) && key !== except)
575
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
576
- }
577
- return to;
578
- };
579
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
580
- var string_exports = {};
581
- __export2(string_exports, {
582
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
583
- stringIncludesAny: () => stringIncludesAny
584
- });
585
- module2.exports = __toCommonJS2(string_exports);
586
- var stringIncludesAny = (str, characters) => {
587
- for (const char of characters) {
588
- if (str.includes(char)) {
589
- return true;
590
- }
591
- }
592
- return false;
593
- };
594
- var brackRegex = /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g;
595
- var replaceLiteralsWithObjectFields = (str, state) => {
596
- if (!str.includes("{{"))
597
- return str;
598
- return str.replace(brackRegex, (_, parentPath, variable) => {
599
- if (parentPath) {
600
- const parentLevels = parentPath.match(/\.\.\//g).length;
601
- let parentState = state;
602
- for (let i = 0; i < parentLevels; i++) {
603
- parentState = parentState.parent;
604
- if (!parentState) {
605
- return "";
606
- }
607
- }
608
- const value = parentState[variable.trim()];
609
- return value !== void 0 ? `${value}` : "";
610
- } else {
611
- const value = state[variable.trim()];
612
- return value !== void 0 ? `${value}` : "";
613
- }
614
- });
615
- };
616
- }
617
- });
618
-
619
- // ../../node_modules/@domql/utils/dist/cjs/object.js
620
- var require_object = __commonJS({
621
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
622
- "use strict";
623
- var __defProp2 = Object.defineProperty;
624
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
625
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
626
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
627
- var __export2 = (target, all) => {
628
- for (var name in all)
629
- __defProp2(target, name, { get: all[name], enumerable: true });
630
- };
631
- var __copyProps2 = (to, from, except, desc) => {
632
- if (from && typeof from === "object" || typeof from === "function") {
633
- for (let key of __getOwnPropNames2(from))
634
- if (!__hasOwnProp2.call(to, key) && key !== except)
635
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
636
- }
637
- return to;
638
- };
639
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
640
- var object_exports = {};
641
- __export2(object_exports, {
642
- clone: () => clone,
643
- deepClone: () => deepClone2,
644
- deepCloneExclude: () => deepCloneExclude,
645
- deepDestringify: () => deepDestringify,
646
- deepMerge: () => deepMerge2,
647
- deepStringify: () => deepStringify,
648
- detachFunctionsFromObject: () => detachFunctionsFromObject,
649
- diff: () => diff,
650
- diffArrays: () => diffArrays,
651
- diffObjects: () => diffObjects,
652
- exec: () => exec,
653
- flattenRecursive: () => flattenRecursive,
654
- isEqualDeep: () => isEqualDeep,
655
- map: () => map,
656
- merge: () => merge2,
657
- mergeArrayExclude: () => mergeArrayExclude,
658
- mergeIfExisted: () => mergeIfExisted,
659
- objectToString: () => objectToString,
660
- overwrite: () => overwrite,
661
- overwriteDeep: () => overwriteDeep,
662
- overwriteShallow: () => overwriteShallow,
663
- removeFromObject: () => removeFromObject,
664
- stringToObject: () => stringToObject
665
- });
666
- module2.exports = __toCommonJS2(object_exports);
667
- var import_globals2 = require_cjs2();
668
- var import_types = require_types();
669
- var import_array = require_array();
670
- var import_string = require_string();
671
- var exec = (param, element, state, context) => {
672
- if ((0, import_types.isFunction)(param)) {
673
- return param(
674
- element,
675
- state || element.state,
676
- context || element.context
677
- );
678
- }
679
- return param;
680
- };
681
- var map = (obj, extention, element) => {
682
- for (const e in extention) {
683
- obj[e] = exec(extention[e], element);
684
- }
685
- };
686
- var merge2 = (element, obj, excludeFrom = []) => {
687
- for (const e in obj) {
688
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
689
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
690
- continue;
691
- const elementProp = element[e];
692
- const objProp = obj[e];
693
- if (elementProp === void 0) {
694
- element[e] = objProp;
695
- }
696
- }
697
- return element;
698
- };
699
- var deepMerge2 = (element, extend, excludeFrom = []) => {
700
- for (const e in extend) {
701
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
702
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
703
- continue;
704
- const elementProp = element[e];
705
- const extendProp = extend[e];
706
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
707
- deepMerge2(elementProp, extendProp);
708
- } else if (elementProp === void 0) {
709
- element[e] = extendProp;
710
- }
711
- }
712
- return element;
713
- };
714
- var clone = (obj, excludeFrom = []) => {
715
- const o = {};
716
- for (const prop in obj) {
717
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
718
- if (!hasOwnProperty || excludeFrom.includes(prop) || prop.startsWith("__"))
719
- continue;
720
- o[prop] = obj[prop];
721
- }
722
- return o;
723
- };
724
- var deepCloneExclude = (obj, excludeFrom = []) => {
725
- if ((0, import_types.isArray)(obj)) {
726
- return obj.map((x) => deepCloneExclude(x, excludeFrom));
727
- }
728
- const o = {};
729
- for (const k in obj) {
730
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, k);
731
- if (!hasOwnProperty || excludeFrom.includes(k) || k.startsWith("__"))
732
- continue;
733
- let v = obj[k];
734
- if (k === "extend" && (0, import_types.isArray)(v)) {
735
- v = mergeArrayExclude(v, excludeFrom);
736
- }
737
- if ((0, import_types.isArray)(v)) {
738
- o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
739
- } else if ((0, import_types.isObject)(v)) {
740
- o[k] = deepCloneExclude(v, excludeFrom);
741
- } else
742
- o[k] = v;
743
- }
744
- return o;
745
- };
746
- var mergeArrayExclude = (arr, excl = []) => {
747
- return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
748
- };
749
- var deepClone2 = (obj, excludeFrom = []) => {
750
- const o = (0, import_types.isArray)(obj) ? [] : {};
751
- for (const prop in obj) {
752
- if (prop === "__proto__")
753
- continue;
754
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
755
- continue;
756
- let objProp = obj[prop];
757
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
758
- objProp = (0, import_array.mergeArray)(objProp);
759
- }
760
- if ((0, import_types.isObjectLike)(objProp)) {
761
- o[prop] = deepClone2(objProp, excludeFrom);
762
- } else
763
- o[prop] = objProp;
764
- }
765
- return o;
766
- };
767
- var deepStringify = (obj, stringified = {}) => {
768
- for (const prop in obj) {
769
- const objProp = obj[prop];
770
- if ((0, import_types.isFunction)(objProp)) {
771
- stringified[prop] = objProp.toString();
772
- } else if ((0, import_types.isObject)(objProp)) {
773
- stringified[prop] = {};
774
- deepStringify(objProp, stringified[prop]);
775
- } else if ((0, import_types.isArray)(objProp)) {
776
- stringified[prop] = [];
777
- objProp.forEach((v, i) => {
778
- if ((0, import_types.isObject)(v)) {
779
- stringified[prop][i] = {};
780
- deepStringify(v, stringified[prop][i]);
781
- } else if ((0, import_types.isFunction)(v)) {
782
- stringified[prop][i] = v.toString();
783
- } else {
784
- stringified[prop][i] = v;
785
- }
786
- });
787
- } else {
788
- stringified[prop] = objProp;
789
- }
790
- }
791
- return stringified;
792
- };
793
- var objectToString = (obj, indent = 0) => {
794
- const spaces = " ".repeat(indent);
795
- let str = "{\n";
796
- for (const [key, value] of Object.entries(obj)) {
797
- const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
798
- const stringedKey = keyAllowdChars ? `'${key}'` : key;
799
- str += `${spaces} ${stringedKey}: `;
800
- if ((0, import_types.isArray)(value)) {
801
- str += "[\n";
802
- for (const element of value) {
803
- if ((0, import_types.isObject)(element) && element !== null) {
804
- str += `${spaces} ${objectToString(element, indent + 2)},
805
- `;
806
- } else if ((0, import_types.isString)(element)) {
807
- str += `${spaces} '${element}',
808
- `;
809
- } else {
810
- str += `${spaces} ${element},
811
- `;
812
- }
813
- }
814
- str += `${spaces} ]`;
815
- } else if ((0, import_types.isObject)(value)) {
816
- str += objectToString(value, indent + 1);
817
- } else if ((0, import_types.isString)(value)) {
818
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
819
- } else {
820
- str += value;
821
- }
822
- str += ",\n";
823
- }
824
- str += `${spaces}}`;
825
- return str;
826
- };
827
- var detachFunctionsFromObject = (obj, detached = {}) => {
828
- for (const prop in obj) {
829
- const objProp = obj[prop];
830
- if ((0, import_types.isFunction)(objProp))
831
- continue;
832
- else if ((0, import_types.isObject)(objProp)) {
833
- detached[prop] = {};
834
- deepStringify(objProp, detached[prop]);
835
- } else if ((0, import_types.isArray)(objProp)) {
836
- detached[prop] = [];
837
- objProp.forEach((v, i) => {
838
- if ((0, import_types.isFunction)(v))
839
- return;
840
- if ((0, import_types.isObject)(v)) {
841
- detached[prop][i] = {};
842
- detachFunctionsFromObject(v, detached[prop][i]);
843
- } else {
844
- detached[prop][i] = v;
845
- }
846
- });
847
- } else {
848
- detached[prop] = objProp;
849
- }
850
- }
851
- return detached;
852
- };
853
- var deepDestringify = (obj, stringified = {}) => {
854
- for (const prop in obj) {
855
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
856
- if (!hasOwnProperty)
857
- continue;
858
- const objProp = obj[prop];
859
- if ((0, import_types.isString)(objProp)) {
860
- if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
861
- try {
862
- const evalProp = import_globals2.window.eval(`(${objProp})`);
863
- stringified[prop] = evalProp;
864
- } catch (e) {
865
- if (e)
866
- stringified[prop] = objProp;
867
- }
868
- } else {
869
- stringified[prop] = objProp;
870
- }
871
- } else if ((0, import_types.isArray)(objProp)) {
872
- stringified[prop] = [];
873
- objProp.forEach((arrProp) => {
874
- if ((0, import_types.isString)(arrProp)) {
875
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
876
- try {
877
- const evalProp = import_globals2.window.eval(`(${arrProp})`);
878
- stringified[prop].push(evalProp);
879
- } catch (e) {
880
- if (e)
881
- stringified[prop].push(arrProp);
882
- }
883
- } else {
884
- stringified[prop].push(arrProp);
885
- }
886
- } else if ((0, import_types.isObject)(arrProp)) {
887
- stringified[prop].push(deepDestringify(arrProp));
888
- } else {
889
- stringified[prop].push(arrProp);
890
- }
891
- });
892
- } else if ((0, import_types.isObject)(objProp)) {
893
- stringified[prop] = deepDestringify(objProp, stringified[prop]);
894
- } else {
895
- stringified[prop] = objProp;
896
- }
897
- }
898
- return stringified;
899
- };
900
- var stringToObject = (str) => {
901
- let obj;
902
- try {
903
- obj = import_globals2.window.eval("(" + str + ")");
904
- } catch (e) {
905
- console.warn(e);
906
- }
907
- if (obj)
908
- return obj;
909
- };
910
- var diffObjects = (original, objToDiff, cache) => {
911
- for (const e in objToDiff) {
912
- if (e === "ref")
913
- continue;
914
- const originalProp = original[e];
915
- const objToDiffProp = objToDiff[e];
916
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
917
- cache[e] = {};
918
- diff(originalProp, objToDiffProp, cache[e]);
919
- } else if (objToDiffProp !== void 0) {
920
- cache[e] = objToDiffProp;
921
- }
922
- }
923
- return cache;
924
- };
925
- var diffArrays = (original, objToDiff, cache) => {
926
- if (original.length !== objToDiff.length) {
927
- cache = objToDiff;
928
- } else {
929
- const diffArr = [];
930
- for (let i = 0; i < original.length; i++) {
931
- const diffObj = diff(original[i], objToDiff[i]);
932
- if (Object.keys(diffObj).length > 0) {
933
- diffArr.push(diffObj);
934
- }
935
- }
936
- if (diffArr.length > 0) {
937
- cache = diffArr;
938
- }
939
- }
940
- return cache;
941
- };
942
- var diff = (original, objToDiff, cache = {}) => {
943
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
944
- cache = [];
945
- diffArrays(original, objToDiff, cache);
946
- } else {
947
- diffObjects(original, objToDiff, cache);
948
- }
949
- return cache;
950
- };
951
- var overwrite = (element, params, excludeFrom = []) => {
952
- const { ref } = element;
953
- const changes = {};
954
- for (const e in params) {
955
- if (excludeFrom.includes(e) || e.startsWith("__"))
956
- continue;
957
- const elementProp = element[e];
958
- const paramsProp = params[e];
959
- if (paramsProp) {
960
- ref.__cache[e] = changes[e] = elementProp;
961
- ref[e] = paramsProp;
962
- }
963
- }
964
- return changes;
965
- };
966
- var overwriteShallow = (obj, params, excludeFrom = []) => {
967
- for (const e in params) {
968
- if (excludeFrom.includes(e) || e.startsWith("__"))
969
- continue;
970
- obj[e] = params[e];
971
- }
972
- return obj;
973
- };
974
- var overwriteDeep = (obj, params, excludeFrom = []) => {
975
- for (const e in params) {
976
- if (e === "__proto__")
977
- continue;
978
- if (excludeFrom.includes(e) || e.startsWith("__"))
979
- continue;
980
- const objProp = obj[e];
981
- const paramsProp = params[e];
982
- if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
983
- overwriteDeep(objProp, paramsProp);
984
- } else if (paramsProp !== void 0) {
985
- obj[e] = paramsProp;
986
- }
987
- }
988
- return obj;
989
- };
990
- var mergeIfExisted = (a, b) => {
991
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
992
- return deepMerge2(a, b);
993
- return a || b;
994
- };
995
- var flattenRecursive = (param, prop, stack = []) => {
996
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
997
- stack.push(objectized);
998
- const extendOfExtend = objectized[prop];
999
- if (extendOfExtend)
1000
- flattenRecursive(extendOfExtend, prop, stack);
1001
- delete objectized[prop];
1002
- return stack;
1003
- };
1004
- var isEqualDeep = (param, element) => {
1005
- if (param === element)
1006
- return true;
1007
- if (!param || !element)
1008
- return false;
1009
- for (const prop in param) {
1010
- const paramProp = param[prop];
1011
- const elementProp = element[prop];
1012
- if ((0, import_types.isObjectLike)(paramProp)) {
1013
- const isEqual = isEqualDeep(paramProp, elementProp);
1014
- if (!isEqual)
1015
- return false;
1016
- } else {
1017
- const isEqual = paramProp === elementProp;
1018
- if (!isEqual)
1019
- return false;
1020
- }
1021
- }
1022
- return true;
1023
- };
1024
- var removeFromObject = (obj, props) => {
1025
- if (props === void 0 || props === null)
1026
- return obj;
1027
- if ((0, import_types.is)(props)("string", "number")) {
1028
- delete obj[props];
1029
- } else if ((0, import_types.isArray)(props)) {
1030
- props.forEach((prop) => delete obj[prop]);
1031
- } else {
1032
- throw new Error("Invalid input: props must be a string or an array of strings");
1033
- }
1034
- return obj;
1035
- };
1036
- }
1037
- });
1038
-
1039
- // ../../node_modules/@domql/utils/dist/cjs/function.js
1040
- var require_function = __commonJS({
1041
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
1042
- "use strict";
1043
- var __defProp2 = Object.defineProperty;
1044
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1045
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1046
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1047
- var __export2 = (target, all) => {
1048
- for (var name in all)
1049
- __defProp2(target, name, { get: all[name], enumerable: true });
1050
- };
1051
- var __copyProps2 = (to, from, except, desc) => {
1052
- if (from && typeof from === "object" || typeof from === "function") {
1053
- for (let key of __getOwnPropNames2(from))
1054
- if (!__hasOwnProp2.call(to, key) && key !== except)
1055
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1056
- }
1057
- return to;
1058
- };
1059
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1060
- var function_exports = {};
1061
- __export2(function_exports, {
1062
- debounce: () => debounce,
1063
- memoize: () => memoize
1064
- });
1065
- module2.exports = __toCommonJS2(function_exports);
1066
- var debounce = (element, func, timeout = 300) => {
1067
- let timer;
1068
- return (...args) => {
1069
- clearTimeout(timer);
1070
- timer = setTimeout(() => {
1071
- func.apply(element, args);
1072
- }, timeout);
1073
- };
1074
- };
1075
- var memoize = (fn) => {
1076
- const cache = {};
1077
- return (...args) => {
1078
- const n = args[0];
1079
- if (n in cache) {
1080
- return cache[n];
1081
- } else {
1082
- const result = fn(n);
1083
- cache[n] = result;
1084
- return result;
1085
- }
1086
- };
1087
- };
1088
- }
1089
- });
1090
-
1091
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1092
- var require_log = __commonJS({
1093
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1094
- "use strict";
1095
- var __defProp2 = Object.defineProperty;
1096
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1097
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1098
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1099
- var __export2 = (target, all) => {
1100
- for (var name in all)
1101
- __defProp2(target, name, { get: all[name], enumerable: true });
1102
- };
1103
- var __copyProps2 = (to, from, except, desc) => {
1104
- if (from && typeof from === "object" || typeof from === "function") {
1105
- for (let key of __getOwnPropNames2(from))
1106
- if (!__hasOwnProp2.call(to, key) && key !== except)
1107
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1108
- }
1109
- return to;
1110
- };
1111
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1112
- var log_exports = {};
1113
- __export2(log_exports, {
1114
- logGroupIf: () => logGroupIf,
1115
- logIf: () => logIf
1116
- });
1117
- module2.exports = __toCommonJS2(log_exports);
1118
- var logIf = (bool, ...arg) => {
1119
- if (bool)
1120
- arg.map((v) => console.log(v));
1121
- };
1122
- var logGroupIf = (bool, key, ...arg) => {
1123
- if (bool) {
1124
- console.group(key);
1125
- arg.map((v) => console.log(v));
1126
- console.groupEnd(key);
1127
- }
1128
- };
1129
- }
1130
- });
1131
-
1132
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
1133
- var require_globals = __commonJS({
1134
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
1135
- "use strict";
1136
- var __defProp2 = Object.defineProperty;
1137
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1138
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1139
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1140
- var __export2 = (target, all) => {
1141
- for (var name in all)
1142
- __defProp2(target, name, { get: all[name], enumerable: true });
1143
- };
1144
- var __copyProps2 = (to, from, except, desc) => {
1145
- if (from && typeof from === "object" || typeof from === "function") {
1146
- for (let key of __getOwnPropNames2(from))
1147
- if (!__hasOwnProp2.call(to, key) && key !== except)
1148
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1149
- }
1150
- return to;
1151
- };
1152
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1153
- var globals_exports = {};
1154
- __export2(globals_exports, {
1155
- document: () => document3,
1156
- global: () => global,
1157
- self: () => self,
1158
- window: () => window2
1159
- });
1160
- module2.exports = __toCommonJS2(globals_exports);
1161
- var global = globalThis;
1162
- var self = globalThis;
1163
- var window2 = globalThis;
1164
- var document3 = window2.document;
1165
- }
1166
- });
1167
-
1168
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1169
- var require_cookie = __commonJS({
1170
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1171
- "use strict";
1172
- var __defProp2 = Object.defineProperty;
1173
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1174
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1175
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1176
- var __export2 = (target, all) => {
1177
- for (var name in all)
1178
- __defProp2(target, name, { get: all[name], enumerable: true });
1179
- };
1180
- var __copyProps2 = (to, from, except, desc) => {
1181
- if (from && typeof from === "object" || typeof from === "function") {
1182
- for (let key of __getOwnPropNames2(from))
1183
- if (!__hasOwnProp2.call(to, key) && key !== except)
1184
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1185
- }
1186
- return to;
1187
- };
1188
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1189
- var cookie_exports = {};
1190
- __export2(cookie_exports, {
1191
- getCookie: () => getCookie,
1192
- isMobile: () => isMobile,
1193
- setCookie: () => setCookie
1194
- });
1195
- module2.exports = __toCommonJS2(cookie_exports);
1196
- var import_types = require_types();
1197
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1198
- var setCookie = (cname, cvalue, exdays = 365) => {
1199
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1200
- return;
1201
- const d = /* @__PURE__ */ new Date();
1202
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1203
- const expires = `expires=${d.toUTCString()}`;
1204
- document.cookie = `${cname}=${cvalue};${expires};path=/`;
1205
- };
1206
- var getCookie = (cname) => {
1207
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1208
- return;
1209
- const name = `${cname}=`;
1210
- const decodedCookie = decodeURIComponent(document.cookie);
1211
- const ca = decodedCookie.split(";");
1212
- for (let i = 0; i < ca.length; i++) {
1213
- let c = ca[i];
1214
- while (c.charAt(0) === " ")
1215
- c = c.substring(1);
1216
- if (c.indexOf(name) === 0)
1217
- return c.substring(name.length, c.length);
1218
- }
1219
- return "";
1220
- };
1221
- }
1222
- });
1223
-
1224
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1225
- var require_cjs3 = __commonJS({
1226
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1227
- "use strict";
1228
- var __defProp2 = Object.defineProperty;
1229
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1230
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1231
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1232
- var __copyProps2 = (to, from, except, desc) => {
1233
- if (from && typeof from === "object" || typeof from === "function") {
1234
- for (let key of __getOwnPropNames2(from))
1235
- if (!__hasOwnProp2.call(to, key) && key !== except)
1236
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1237
- }
1238
- return to;
1239
- };
1240
- var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1241
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1242
- var utils_exports = {};
1243
- module2.exports = __toCommonJS2(utils_exports);
1244
- __reExport(utils_exports, require_key(), module2.exports);
1245
- __reExport(utils_exports, require_env(), module2.exports);
1246
- __reExport(utils_exports, require_types(), module2.exports);
1247
- __reExport(utils_exports, require_object(), module2.exports);
1248
- __reExport(utils_exports, require_function(), module2.exports);
1249
- __reExport(utils_exports, require_array(), module2.exports);
1250
- __reExport(utils_exports, require_node(), module2.exports);
1251
- __reExport(utils_exports, require_log(), module2.exports);
1252
- __reExport(utils_exports, require_string(), module2.exports);
1253
- __reExport(utils_exports, require_globals(), module2.exports);
1254
- __reExport(utils_exports, require_cookie(), module2.exports);
1255
- }
1256
- });
1257
-
1258
- // src/system/typography.js
1259
- var typography_exports = {};
1260
- __export(typography_exports, {
1261
- applyHeadings: () => applyHeadings,
1262
- applyTypographySequence: () => applyTypographySequence,
1263
- getFontSizeByKey: () => getFontSizeByKey,
1264
- runThroughMedia: () => runThroughMedia
1265
- });
1266
- module.exports = __toCommonJS(typography_exports);
1267
- var import_utils9 = __toESM(require_cjs3(), 1);
1268
-
1269
- // src/factory.js
1270
- var import_utils = __toESM(require_cjs3(), 1);
1271
-
1272
- // src/defaultConfig/index.js
1273
- var defaultConfig_exports = {};
1274
- __export(defaultConfig_exports, {
1275
- ANIMATION: () => ANIMATION,
1276
- BREAKPOINTS: () => BREAKPOINTS,
1277
- CASES: () => CASES,
1278
- COLOR: () => COLOR,
1279
- DEVICES: () => DEVICES,
1280
- DOCUMENT: () => DOCUMENT,
1281
- FONT: () => FONT,
1282
- FONT_FACE: () => FONT_FACE,
1283
- FONT_FAMILY: () => FONT_FAMILY,
1284
- FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
1285
- GRADIENT: () => GRADIENT,
1286
- ICONS: () => ICONS,
1287
- MEDIA: () => MEDIA,
1288
- RESET: () => RESET,
1289
- SEQUENCE: () => SEQUENCE,
1290
- SPACING: () => SPACING,
1291
- SVG: () => SVG,
1292
- SVG_DATA: () => SVG_DATA,
1293
- TEMPLATES: () => TEMPLATES,
1294
- THEME: () => THEME,
1295
- TIMING: () => TIMING,
1296
- TYPOGRAPHY: () => TYPOGRAPHY,
1297
- UNIT: () => UNIT
1298
- });
1299
-
1300
- // src/defaultConfig/sequence.js
1301
- var SEQUENCE = {
1302
- "minor-second": 1.067,
1303
- "major-second": 1.125,
1304
- "minor-third": 1.2,
1305
- "major-third": 1.25,
1306
- "perfect-fourth": 1.333,
1307
- "augmented-fourth": 1.414,
1308
- "perfect-fifth": 1.5,
1309
- "minor-sixth": 1.6,
1310
- phi: 1.618,
1311
- // golden-ratio
1312
- "major-sixth": 1.667,
1313
- "square-root-3": 1.732,
1314
- // theodorus
1315
- "minor-seventh": 1.778,
1316
- "major-seventh": 1.875,
1317
- octave: 2,
1318
- "square-root-5": 2.23,
1319
- // pythagoras
1320
- "major-tenth": 2.5,
1321
- "major-eleventh": 2.667,
1322
- "major-twelfth": 3,
1323
- pi: 3.14,
1324
- // archimedes
1325
- "double-octave": 4
1326
- };
1327
-
1328
- // src/defaultConfig/unit.js
1329
- var UNIT = {
1330
- default: "em"
1331
- };
1332
-
1333
- // src/defaultConfig/typography.js
1334
- var defaultProps = {
1335
- browserDefault: 16,
1336
- base: 16,
1337
- type: "font-size",
1338
- ratio: SEQUENCE["minor-third"],
1339
- range: [-3, 12],
1340
- h1Matches: 6,
1341
- lineHeight: 1.5,
1342
- subSequence: true,
1343
- unit: "em",
1344
- templates: {},
1345
- sequence: {},
1346
- scales: {},
1347
- vars: {}
1348
- };
1349
- var TYPOGRAPHY = defaultProps;
1350
-
1351
- // src/defaultConfig/font.js
1352
- var FONT = {};
1353
-
1354
- // src/defaultConfig/font-family.js
1355
- var FONT_FAMILY = {};
1356
- var FONT_FAMILY_TYPES = {
1357
- "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
1358
- serif: "Times New Roman, Georgia, serif, --system-default",
1359
- monospace: "Courier New, monospace, --system-default"
1360
- };
1361
- var FONT_FACE = {};
1362
-
1363
- // src/defaultConfig/media.js
1364
- var MEDIA = {
1365
- tv: "(min-width: 2780px)",
1366
- screenL: "(max-width: 1920px)",
1367
- "screenL<": "(min-width: 1920px)",
1368
- screenM: "(max-width: 1680px)",
1369
- "screenM<": "(min-width: 1680px)",
1370
- screenS: "(max-width: 1440px)",
1371
- "screenS<": "(min-width: 1440px)",
1372
- tabletL: "(max-width: 1366px)",
1373
- "tabletL<": "(min-width: 1366px)",
1374
- tabletM: "(max-width: 1280px)",
1375
- "tabletM<": "(min-width: 1280px)",
1376
- tabletS: "(max-width: 1024px)",
1377
- "tabletS<": "(min-width: 1024px)",
1378
- mobileL: "(max-width: 768px)",
1379
- "mobileL<": "(min-width: 768px)",
1380
- mobileM: "(max-width: 560px)",
1381
- "mobileM<": "(min-width: 560px)",
1382
- mobileS: "(max-width: 480px)",
1383
- "mobileS<": "(min-width: 480px)",
1384
- mobileXS: "(max-width: 375px)",
1385
- "mobileXS<": "(min-width: 375px)",
1386
- light: "(prefers-color-scheme: light)",
1387
- dark: "(prefers-color-scheme: dark)",
1388
- print: "print"
1389
- };
1390
-
1391
- // src/defaultConfig/spacing.js
1392
- var defaultProps2 = {
1393
- base: TYPOGRAPHY.base,
1394
- type: "spacing",
1395
- ratio: SEQUENCE.phi,
1396
- range: [-5, 15],
1397
- subSequence: true,
1398
- unit: "em",
1399
- sequence: {},
1400
- scales: {},
1401
- vars: {}
1402
- };
1403
- var SPACING = defaultProps2;
1404
-
1405
- // src/defaultConfig/color.js
1406
- var COLOR = {};
1407
- var GRADIENT = {};
1408
-
1409
- // src/defaultConfig/theme.js
1410
- var THEME = {};
1411
-
1412
- // src/defaultConfig/icons.js
1413
- var ICONS = {};
1414
-
1415
- // src/defaultConfig/timing.js
1416
- var defaultProps3 = {
1417
- default: 150,
1418
- base: 150,
1419
- type: "timing",
1420
- ratio: SEQUENCE["perfect-fourth"],
1421
- range: [-3, 12],
1422
- unit: "ms",
1423
- sequence: {},
1424
- scales: {},
1425
- vars: {}
1426
- };
1427
- var TIMING = defaultProps3;
1428
-
1429
- // src/defaultConfig/document.js
1430
- var DOCUMENT = {};
1431
-
1432
- // src/defaultConfig/responsive.js
1433
- var BREAKPOINTS = {
1434
- screenL: 1920,
1435
- screenM: 1680,
1436
- screenS: 1440,
1437
- tabletL: 1366,
1438
- tabletM: 1280,
1439
- tabletS: 1024,
1440
- mobileL: 768,
1441
- mobileM: 560,
1442
- mobileS: 480,
1443
- mobileXS: 375
1444
- };
1445
- var DEVICES = {
1446
- screenL: [1920, 1024],
1447
- screenM: [1680, 1024],
1448
- screenS: [1440, 978],
1449
- tabletL: [1366, 926],
1450
- tabletM: [1280, 768],
1451
- tabletS: [1024, 768],
1452
- mobileL: [768, 375],
1453
- mobileM: [560, 768],
1454
- mobileS: [480, 768],
1455
- mobileXS: [375, 768]
1456
- };
1457
-
1458
- // src/defaultConfig/cases.js
1459
- var CASES = {};
1460
-
1461
- // src/defaultConfig/animation.js
1462
- var ANIMATION = {};
1463
-
1464
- // src/defaultConfig/svg.js
1465
- var SVG = {};
1466
- var SVG_DATA = {};
1467
-
1468
- // src/defaultConfig/templates.js
1469
- var TEMPLATES = {};
1470
-
1471
- // src/defaultConfig/index.js
1472
- var RESET = {};
1473
-
1474
- // src/factory.js
1475
- var CSS_VARS = {};
1476
- var CONFIG = {
1477
- verbose: false,
1478
- useVariable: true,
1479
- useReset: true,
1480
- CSS_VARS,
1481
- ...defaultConfig_exports
1482
- };
1483
- var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1484
- var FACTORY = {
1485
- active: "0",
1486
- 0: CONFIG
1487
- };
1488
- var getActiveConfig = (def) => {
1489
- return FACTORY[def || FACTORY.active];
1490
- };
1491
-
1492
- // src/utils/color.js
1493
- var import_globals = __toESM(require_cjs2(), 1);
1494
- var import_utils2 = __toESM(require_cjs3(), 1);
1495
-
1496
- // src/utils/sequence.js
1497
- var import_utils5 = __toESM(require_cjs3(), 1);
1498
-
1499
- // ../utils/src/index.js
1500
- var import_utils4 = __toESM(require_cjs3());
1501
-
1502
- // ../utils/src/scaling.js
1503
- var import_utils3 = __toESM(require_cjs3());
1504
-
1505
- // ../utils/src/index.js
1506
- var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
1507
-
1508
- // src/utils/sequence.js
1509
- var numToLetterMap = {
1510
- "-6": "U",
1511
- "-5": "V",
1512
- "-4": "W",
1513
- "-3": "X",
1514
- "-2": "Y",
1515
- "-1": "Z",
1516
- 0: "A",
1517
- 1: "B",
1518
- 2: "C",
1519
- 3: "D",
1520
- 4: "E",
1521
- 5: "F",
1522
- 6: "G",
1523
- 7: "H",
1524
- 8: "I",
1525
- 9: "J",
1526
- 10: "K",
1527
- 11: "L",
1528
- 12: "M",
1529
- 13: "N",
1530
- 14: "O",
1531
- 15: "P",
1532
- 16: "Q",
1533
- 17: "R",
1534
- 18: "S",
1535
- 19: "T"
1536
- };
1537
- var setSequenceValue = (props, sequenceProps) => {
1538
- const { key, variable, value, scaling, index } = props;
1539
- sequenceProps.sequence[key] = {
1540
- key,
1541
- decimal: ~~(value * 100) / 100,
1542
- val: ~~value,
1543
- scaling,
1544
- index,
1545
- variable
1546
- };
1547
- sequenceProps.scales[key] = scaling;
1548
- sequenceProps.vars[variable] = scaling + sequenceProps.unit;
1549
- };
1550
- var generateSubSequence = (props, sequenceProps) => {
1551
- const { key, base, value, ratio, variable, index } = props;
1552
- const next = value * ratio;
1553
- const diff = next - value;
1554
- const smallscale = diff / 1.618;
1555
- const valueRounded = ~~value;
1556
- const nextRounded = ~~next;
1557
- const diffRounded = nextRounded - valueRounded;
1558
- let arr = [];
1559
- const first = next - smallscale;
1560
- const second = value + smallscale;
1561
- const middle = (first + second) / 2;
1562
- if (diffRounded > 16)
1563
- arr = [first, middle, second];
1564
- else
1565
- arr = [first, second];
1566
- arr.map((v, k) => {
1567
- const scaling = ~~(v / base * 1e3) / 1e3;
1568
- const newVar = variable + (k + 1);
1569
- const props2 = {
1570
- key: key + (k + 1),
1571
- variable: newVar,
1572
- value: v,
1573
- scaling,
1574
- index: index + (k + 1) / 10
1575
- };
1576
- return setSequenceValue(props2, sequenceProps);
1577
- });
1578
- };
1579
- var switchSequenceOnNegative = (key, base, ratio) => {
1580
- return base * Math.pow(ratio, key);
1581
- };
1582
- var generateSequence = (sequenceProps) => {
1583
- const { type, base, ratio, range, subSequence } = sequenceProps;
1584
- const n = Math.abs(range[0]) + Math.abs(range[1]);
1585
- const prefix = "--" + (type && type.replace(".", "-")) + "-";
1586
- for (let i = 0; i <= n; i++) {
1587
- const key = range[1] - i;
1588
- const letterKey = numToLetterMap[key];
1589
- const value = switchSequenceOnNegative(key, base, ratio);
1590
- const scaling = ~~(value / base * 100) / 100;
1591
- const variable = prefix + letterKey;
1592
- const props = {
1593
- key: letterKey,
1594
- variable,
1595
- value,
1596
- base,
1597
- scaling,
1598
- ratio,
1599
- index: key
1600
- };
1601
- setSequenceValue(props, sequenceProps);
1602
- if (subSequence)
1603
- generateSubSequence(props, sequenceProps);
1604
- }
1605
- return sequenceProps;
1606
- };
1607
- var getSequenceValue = (value = "A", sequenceProps) => {
1608
- const CONFIG2 = getActiveConfig();
1609
- const { UNIT: UNIT2 } = CONFIG2;
1610
- const {
1611
- sequence,
1612
- unit = UNIT2.default,
1613
- useVariable
1614
- } = sequenceProps;
1615
- if ((0, import_utils5.isString)(value) && value.slice(0, 2) === "--")
1616
- return `var(${value})`;
1617
- const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
1618
- const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
1619
- const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
1620
- if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || !startsWithDashOrLetter)
1621
- return value;
1622
- const letterVal = value.toUpperCase();
1623
- const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
1624
- let absValue = isNegative ? letterVal.slice(1) : letterVal;
1625
- let mediaName = "";
1626
- if (absValue.includes("-")) {
1627
- mediaName = "-" + absValue.split("-")[1].toLowerCase();
1628
- absValue = absValue.split("-")[0];
1629
- }
1630
- const varValue = (v) => `var(${prefix}${v}${mediaName})`;
1631
- if (absValue.includes("+")) {
1632
- const args = absValue.split("+");
1633
- const [first, second] = args;
1634
- const joint = `${varValue(first)} + ${varValue(second)}`;
1635
- return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1636
- } else if (absValue.includes("-")) {
1637
- const args = absValue.split("-");
1638
- const [first, second] = args;
1639
- const joint = `${varValue(first)} - ${varValue(second)}`;
1640
- return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1641
- }
1642
- if (!sequence[absValue] && absValue.length === 2) {
1643
- if (CONFIG2.verbose)
1644
- console.warn(absValue, "- value is not found because `subSequence` is set to false");
1645
- absValue = absValue.slice(0, 1);
1646
- }
1647
- if (useVariable || CONFIG2.useVariable) {
1648
- const varValue2 = `var(${prefix}${absValue}${mediaName})`;
1649
- return isNegative ? `calc(${varValue2} * -1)` : varValue2;
1650
- }
1651
- const sequenceItem = sequence ? sequence[absValue] : null;
1652
- if (!sequenceItem)
1653
- return console.warn("can't find", sequence, absValue);
1654
- if (unit === "ms" || unit === "s") {
1655
- return isNegative + sequenceItem.val + unit;
1656
- }
1657
- return isNegative + sequenceItem.scaling + unit;
1658
- };
1659
- var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
1660
- if (typeof value !== "string") {
1661
- console.warn(propertyName, value, "is not a string");
1662
- return {};
1663
- }
1664
- if (value === "-" || value === "")
1665
- return {};
1666
- return { [propertyName]: getSequenceValue(value, sequenceProps) };
1667
- };
1668
- var findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index];
1669
- var findHeadings = (propertyNames) => {
1670
- const { h1Matches, sequence } = propertyNames;
1671
- return new Array(6).fill(null).map((_, i) => {
1672
- const findLetter = findHeadingLetter(h1Matches, i);
1673
- return sequence[findLetter];
1674
- });
1675
- };
1676
-
1677
- // src/utils/var.js
1678
- var import_utils7 = __toESM(require_cjs3(), 1);
1679
- var applySequenceVars = (props, mediaName, options = {}) => {
1680
- const CONFIG2 = getActiveConfig();
1681
- const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1682
- const unit = props.unit || UNIT2.default;
1683
- const { sequence, scales } = props;
1684
- for (const key in sequence) {
1685
- const item = sequence[key];
1686
- const value = (props.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1687
- if (mediaName) {
1688
- const query = MEDIA2[mediaName];
1689
- if (!query) {
1690
- if (CONFIG2.verbose)
1691
- console.warn("Can't find query ", query);
1692
- }
1693
- let underMediaQuery = CSS_VARS2[`@media ${query}`];
1694
- if (!underMediaQuery)
1695
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1696
- underMediaQuery[item.variable] = `var(${item.variable + "-" + mediaName})`;
1697
- CSS_VARS2[item.variable + "-" + mediaName] = value;
1698
- } else {
1699
- if (options.useDefault === false) {
1700
- CSS_VARS2[item.variable] = value;
1701
- } else {
1702
- CSS_VARS2[item.variable + "-default"] = value;
1703
- CSS_VARS2[item.variable] = `var(${item.variable + "-default"})`;
1704
- }
1705
- }
1706
- }
1707
- };
1708
-
1709
- // src/utils/sprite.js
1710
- var import_utils8 = __toESM(require_cjs3(), 1);
1711
-
1712
- // src/system/typography.js
1713
- var runThroughMedia = (props) => {
1714
- const CONFIG2 = getActiveConfig();
1715
- const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
1716
- for (const prop in props) {
1717
- const mediaProps = props[prop];
1718
- if (prop.slice(0, 1) === "@") {
1719
- const { type, base, ratio, range, subSequence, h1Matches, unit } = props;
1720
- (0, import_utils9.merge)(mediaProps, {
1721
- type,
1722
- base,
1723
- ratio,
1724
- range,
1725
- subSequence,
1726
- h1Matches,
1727
- unit,
1728
- sequence: {},
1729
- scales: {},
1730
- templates: {},
1731
- vars: {}
1732
- });
1733
- generateSequence(mediaProps);
1734
- const mediaName = prop.slice(1);
1735
- applySequenceVars(mediaProps, mediaName);
1736
- const query = MEDIA2[mediaName];
1737
- TYPOGRAPHY2.templates[`@media screen and ${query}`] = {
1738
- fontSize: mediaProps.base / TYPOGRAPHY2.browserDefault + unit
1739
- };
1740
- }
1741
- }
1742
- };
1743
- var applyHeadings = (props) => {
1744
- const CONFIG2 = getActiveConfig();
1745
- if (props.h1Matches) {
1746
- const unit = props.unit;
1747
- const HEADINGS = findHeadings(props);
1748
- const { templates } = props;
1749
- for (const k in HEADINGS) {
1750
- const headerName = `h${parseInt(k) + 1}`;
1751
- const headerStyle = templates[headerName];
1752
- templates[headerName] = {
1753
- fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
1754
- margin: headerStyle ? headerStyle.margin : 0,
1755
- lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1756
- letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
1757
- fontWeight: headerStyle ? headerStyle.fontWeight : 900 - k * 100
1758
- };
1759
- }
1760
- }
1761
- };
1762
- var applyTypographySequence = () => {
1763
- const CONFIG2 = getActiveConfig();
1764
- const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
1765
- generateSequence(TYPOGRAPHY2);
1766
- applyHeadings(TYPOGRAPHY2);
1767
- applySequenceVars(TYPOGRAPHY2);
1768
- runThroughMedia(TYPOGRAPHY2);
1769
- };
1770
- var getFontSizeByKey = (value) => {
1771
- const CONFIG2 = getActiveConfig();
1772
- const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
1773
- return getSequenceValuePropertyPair(
1774
- value,
1775
- "fontSize",
1776
- TYPOGRAPHY2
1777
- );
1778
- };