@symbo.ls/scratch 2.11.398 → 2.11.410
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory.js +165 -26
- package/dist/cjs/index.js +2413 -2123
- package/dist/cjs/set.js +2184 -1892
- package/dist/cjs/system/color.js +2009 -1716
- package/dist/cjs/system/document.js +1999 -1706
- package/dist/cjs/system/font.js +1954 -1662
- package/dist/cjs/system/index.js +2211 -1919
- package/dist/cjs/system/reset.js +2010 -1717
- package/dist/cjs/system/shadow.js +2163 -1869
- package/dist/cjs/system/spacing.js +2003 -1709
- package/dist/cjs/system/svg.js +1950 -1657
- package/dist/cjs/system/theme.js +2016 -1723
- package/dist/cjs/system/timing.js +2002 -1710
- package/dist/cjs/system/typography.js +2199 -1904
- package/dist/cjs/transforms/index.js +2189 -1897
- package/dist/cjs/utils/color.js +165 -26
- package/dist/cjs/utils/index.js +2200 -1907
- package/dist/cjs/utils/sequence.js +1935 -1642
- package/dist/cjs/utils/sprite.js +165 -26
- package/dist/cjs/utils/var.js +1981 -1688
- package/package.json +2 -2
package/dist/cjs/set.js
CHANGED
|
@@ -30,33 +30,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../../domql/packages/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
37
|
+
var __defProp3 = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
40
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
|
+
var __export3 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
43
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
44
|
};
|
|
45
|
-
var
|
|
45
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
46
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
-
for (let key of
|
|
48
|
-
if (!
|
|
49
|
-
|
|
47
|
+
for (let key of __getOwnPropNames3(from))
|
|
48
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
50
50
|
}
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
|
-
var
|
|
53
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var key_exports = {};
|
|
55
|
-
|
|
55
|
+
__export3(key_exports, {
|
|
56
56
|
createSnapshotId: () => createSnapshotId,
|
|
57
57
|
generateKey: () => generateKey
|
|
58
58
|
});
|
|
59
|
-
module2.exports =
|
|
59
|
+
module2.exports = __toCommonJS3(key_exports);
|
|
60
60
|
var generateKey = /* @__PURE__ */ function() {
|
|
61
61
|
let index = 0;
|
|
62
62
|
function newId() {
|
|
@@ -69,36 +69,36 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../../domql/packages/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
var
|
|
76
|
+
var __defProp3 = Object.defineProperty;
|
|
77
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
78
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
79
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
80
|
+
var __export3 = (target, all) => {
|
|
81
81
|
for (var name in all)
|
|
82
|
-
|
|
82
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
83
83
|
};
|
|
84
|
-
var
|
|
84
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
85
85
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
86
|
-
for (let key of
|
|
87
|
-
if (!
|
|
88
|
-
|
|
86
|
+
for (let key of __getOwnPropNames3(from))
|
|
87
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
88
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
89
89
|
}
|
|
90
90
|
return to;
|
|
91
91
|
};
|
|
92
|
-
var
|
|
92
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
93
93
|
var env_exports = {};
|
|
94
|
-
|
|
94
|
+
__export3(env_exports, {
|
|
95
95
|
NODE_ENV: () => NODE_ENV,
|
|
96
96
|
getNev: () => getNev,
|
|
97
97
|
isDevelopment: () => isDevelopment,
|
|
98
98
|
isProduction: () => isProduction,
|
|
99
99
|
isTest: () => isTest
|
|
100
100
|
});
|
|
101
|
-
module2.exports =
|
|
101
|
+
module2.exports = __toCommonJS3(env_exports);
|
|
102
102
|
var NODE_ENV = "development";
|
|
103
103
|
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
104
104
|
var isTest = (env = NODE_ENV) => env === "test";
|
|
@@ -107,35 +107,35 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../../domql/packages/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
var
|
|
114
|
+
var __defProp3 = Object.defineProperty;
|
|
115
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
116
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
117
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
118
|
+
var __export3 = (target, all) => {
|
|
119
119
|
for (var name in all)
|
|
120
|
-
|
|
120
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
121
121
|
};
|
|
122
|
-
var
|
|
122
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
123
123
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
124
|
-
for (let key of
|
|
125
|
-
if (!
|
|
126
|
-
|
|
124
|
+
for (let key of __getOwnPropNames3(from))
|
|
125
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
126
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
127
127
|
}
|
|
128
128
|
return to;
|
|
129
129
|
};
|
|
130
|
-
var
|
|
130
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
131
131
|
var globals_exports = {};
|
|
132
|
-
|
|
132
|
+
__export3(globals_exports, {
|
|
133
133
|
document: () => document4,
|
|
134
134
|
global: () => global,
|
|
135
135
|
self: () => self,
|
|
136
136
|
window: () => window2
|
|
137
137
|
});
|
|
138
|
-
module2.exports =
|
|
138
|
+
module2.exports = __toCommonJS3(globals_exports);
|
|
139
139
|
var global = globalThis;
|
|
140
140
|
var self = globalThis;
|
|
141
141
|
var window2 = globalThis;
|
|
@@ -143,33 +143,33 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../../domql/packages/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
var
|
|
154
|
-
var
|
|
150
|
+
var __defProp3 = Object.defineProperty;
|
|
151
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
152
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
153
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
154
|
+
var __export3 = (target, all) => {
|
|
155
155
|
for (var name in all)
|
|
156
|
-
|
|
156
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
157
157
|
};
|
|
158
|
-
var
|
|
158
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
159
159
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
160
|
-
for (let key of
|
|
161
|
-
if (!
|
|
162
|
-
|
|
160
|
+
for (let key of __getOwnPropNames3(from))
|
|
161
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
162
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
163
163
|
}
|
|
164
164
|
return to;
|
|
165
165
|
};
|
|
166
|
-
var
|
|
166
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
167
167
|
var node_exports = {};
|
|
168
|
-
|
|
168
|
+
__export3(node_exports, {
|
|
169
169
|
isHtmlElement: () => isHtmlElement,
|
|
170
170
|
isNode: () => isNode
|
|
171
171
|
});
|
|
172
|
-
module2.exports =
|
|
172
|
+
module2.exports = __toCommonJS3(node_exports);
|
|
173
173
|
var import_globals3 = require_globals();
|
|
174
174
|
var isNode = (obj) => {
|
|
175
175
|
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
@@ -180,29 +180,29 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../../domql/packages/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
|
-
var
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
var
|
|
187
|
+
var __defProp3 = Object.defineProperty;
|
|
188
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
189
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
190
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
191
|
+
var __export3 = (target, all) => {
|
|
192
192
|
for (var name in all)
|
|
193
|
-
|
|
193
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
194
194
|
};
|
|
195
|
-
var
|
|
195
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
196
196
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
197
|
-
for (let key of
|
|
198
|
-
if (!
|
|
199
|
-
|
|
197
|
+
for (let key of __getOwnPropNames3(from))
|
|
198
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
199
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
200
200
|
}
|
|
201
201
|
return to;
|
|
202
202
|
};
|
|
203
|
-
var
|
|
203
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
204
204
|
var types_exports = {};
|
|
205
|
-
|
|
205
|
+
__export3(types_exports, {
|
|
206
206
|
TYPES: () => TYPES,
|
|
207
207
|
is: () => is,
|
|
208
208
|
isArray: () => isArray7,
|
|
@@ -218,7 +218,7 @@ var require_types = __commonJS({
|
|
|
218
218
|
isString: () => isString8,
|
|
219
219
|
isUndefined: () => isUndefined
|
|
220
220
|
});
|
|
221
|
-
module2.exports =
|
|
221
|
+
module2.exports = __toCommonJS3(types_exports);
|
|
222
222
|
var import_node = require_node();
|
|
223
223
|
var isObject6 = (arg) => {
|
|
224
224
|
if (arg === null)
|
|
@@ -270,31 +270,32 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../../domql/packages/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
|
-
var
|
|
278
|
-
var
|
|
279
|
-
var
|
|
280
|
-
var
|
|
281
|
-
var
|
|
277
|
+
var __defProp3 = Object.defineProperty;
|
|
278
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
279
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
280
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
281
|
+
var __export3 = (target, all) => {
|
|
282
282
|
for (var name in all)
|
|
283
|
-
|
|
283
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
284
284
|
};
|
|
285
|
-
var
|
|
285
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
286
286
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
287
|
-
for (let key of
|
|
288
|
-
if (!
|
|
289
|
-
|
|
287
|
+
for (let key of __getOwnPropNames3(from))
|
|
288
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
289
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
290
290
|
}
|
|
291
291
|
return to;
|
|
292
292
|
};
|
|
293
|
-
var
|
|
293
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
294
294
|
var array_exports = {};
|
|
295
|
-
|
|
295
|
+
__export3(array_exports, {
|
|
296
296
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
297
297
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
298
|
+
arraysEqual: () => arraysEqual,
|
|
298
299
|
createNestedObject: () => createNestedObject,
|
|
299
300
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
300
301
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
@@ -308,7 +309,7 @@ var require_array = __commonJS({
|
|
|
308
309
|
reorderArrayByValues: () => reorderArrayByValues,
|
|
309
310
|
swapItemsInArray: () => swapItemsInArray
|
|
310
311
|
});
|
|
311
|
-
module2.exports =
|
|
312
|
+
module2.exports = __toCommonJS3(array_exports);
|
|
312
313
|
var import_object = require_object();
|
|
313
314
|
var import_types = require_types();
|
|
314
315
|
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
@@ -411,38 +412,53 @@ var require_array = __commonJS({
|
|
|
411
412
|
}
|
|
412
413
|
return newArray;
|
|
413
414
|
};
|
|
415
|
+
var arraysEqual = (arr1, arr2) => {
|
|
416
|
+
if (arr1.length !== arr2.length) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
420
|
+
if (arr1[i] !== arr2[i]) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return true;
|
|
425
|
+
};
|
|
414
426
|
}
|
|
415
427
|
});
|
|
416
428
|
|
|
417
|
-
//
|
|
429
|
+
// ../../../domql/packages/utils/dist/cjs/string.js
|
|
418
430
|
var require_string = __commonJS({
|
|
419
|
-
"
|
|
431
|
+
"../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
|
|
420
432
|
"use strict";
|
|
421
|
-
var
|
|
422
|
-
var
|
|
423
|
-
var
|
|
424
|
-
var
|
|
425
|
-
var
|
|
433
|
+
var __defProp3 = Object.defineProperty;
|
|
434
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
435
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
436
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
437
|
+
var __export3 = (target, all) => {
|
|
426
438
|
for (var name in all)
|
|
427
|
-
|
|
439
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
428
440
|
};
|
|
429
|
-
var
|
|
441
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
430
442
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
431
|
-
for (let key of
|
|
432
|
-
if (!
|
|
433
|
-
|
|
443
|
+
for (let key of __getOwnPropNames3(from))
|
|
444
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
445
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
434
446
|
}
|
|
435
447
|
return to;
|
|
436
448
|
};
|
|
437
|
-
var
|
|
449
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
438
450
|
var string_exports = {};
|
|
439
|
-
|
|
451
|
+
__export3(string_exports, {
|
|
452
|
+
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
453
|
+
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
454
|
+
findKeyPosition: () => findKeyPosition,
|
|
440
455
|
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
441
456
|
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
457
|
+
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
442
458
|
stringIncludesAny: () => stringIncludesAny,
|
|
443
459
|
trimStringFromSymbols: () => trimStringFromSymbols
|
|
444
460
|
});
|
|
445
|
-
module2.exports =
|
|
461
|
+
module2.exports = __toCommonJS3(string_exports);
|
|
446
462
|
var stringIncludesAny = (str, characters) => {
|
|
447
463
|
for (const char of characters) {
|
|
448
464
|
if (str.includes(char)) {
|
|
@@ -484,33 +500,100 @@ var require_string = __commonJS({
|
|
|
484
500
|
var lowercaseFirstLetter = (inputString) => {
|
|
485
501
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
486
502
|
};
|
|
503
|
+
var findKeyPosition = (str, key) => {
|
|
504
|
+
const lines = str.split("\n");
|
|
505
|
+
let startLineNumber = -1;
|
|
506
|
+
let endLineNumber = -1;
|
|
507
|
+
let startColumn = -1;
|
|
508
|
+
let endColumn = -1;
|
|
509
|
+
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
510
|
+
let braceCount = 0;
|
|
511
|
+
let foundKey = false;
|
|
512
|
+
for (let i = 0; i < lines.length; i++) {
|
|
513
|
+
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
514
|
+
foundKey = true;
|
|
515
|
+
startLineNumber = i + 1;
|
|
516
|
+
startColumn = lines[i].indexOf(key) + 1;
|
|
517
|
+
if (lines[i].includes("{}")) {
|
|
518
|
+
endLineNumber = startLineNumber;
|
|
519
|
+
endColumn = lines[i].indexOf("{}") + 3;
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
const line = lines[i].slice(startColumn + key.length);
|
|
523
|
+
if (line.includes("{") || line.includes("[")) {
|
|
524
|
+
braceCount = 1;
|
|
525
|
+
} else {
|
|
526
|
+
endLineNumber = i + 1;
|
|
527
|
+
endColumn = lines[i].length + 1;
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
} else if (foundKey) {
|
|
531
|
+
braceCount += (lines[i].match(/{/g) || []).length;
|
|
532
|
+
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
533
|
+
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
534
|
+
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
535
|
+
if (braceCount === 0) {
|
|
536
|
+
endLineNumber = i + 1;
|
|
537
|
+
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
startColumn,
|
|
544
|
+
endColumn,
|
|
545
|
+
startLineNumber,
|
|
546
|
+
endLineNumber
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
var replaceOctalEscapeSequences = (str) => {
|
|
550
|
+
const octalRegex = /\\([0-7]{1,3})/g;
|
|
551
|
+
return str.replace(octalRegex, (match, p1) => {
|
|
552
|
+
const octalValue = parseInt(p1, 8);
|
|
553
|
+
const char = String.fromCharCode(octalValue);
|
|
554
|
+
return char;
|
|
555
|
+
});
|
|
556
|
+
};
|
|
557
|
+
var customEncodeURIComponent = (str) => {
|
|
558
|
+
return str.split("").map((char) => {
|
|
559
|
+
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
560
|
+
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
561
|
+
}
|
|
562
|
+
return char;
|
|
563
|
+
}).join("");
|
|
564
|
+
};
|
|
565
|
+
var customDecodeURIComponent = (encodedStr) => {
|
|
566
|
+
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
567
|
+
};
|
|
487
568
|
}
|
|
488
569
|
});
|
|
489
570
|
|
|
490
|
-
//
|
|
571
|
+
// ../../../domql/packages/utils/dist/cjs/object.js
|
|
491
572
|
var require_object = __commonJS({
|
|
492
|
-
"
|
|
573
|
+
"../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
493
574
|
"use strict";
|
|
494
|
-
var
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
var
|
|
575
|
+
var __defProp3 = Object.defineProperty;
|
|
576
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
577
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
578
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
579
|
+
var __export3 = (target, all) => {
|
|
499
580
|
for (var name in all)
|
|
500
|
-
|
|
581
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
501
582
|
};
|
|
502
|
-
var
|
|
583
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
503
584
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
504
|
-
for (let key of
|
|
505
|
-
if (!
|
|
506
|
-
|
|
585
|
+
for (let key of __getOwnPropNames3(from))
|
|
586
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
587
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
507
588
|
}
|
|
508
589
|
return to;
|
|
509
590
|
};
|
|
510
|
-
var
|
|
591
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
511
592
|
var object_exports = {};
|
|
512
|
-
|
|
593
|
+
__export3(object_exports, {
|
|
594
|
+
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
513
595
|
clone: () => clone,
|
|
596
|
+
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
514
597
|
deepClone: () => deepClone2,
|
|
515
598
|
deepCloneExclude: () => deepCloneExclude,
|
|
516
599
|
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
@@ -525,6 +608,8 @@ var require_object = __commonJS({
|
|
|
525
608
|
diffObjects: () => diffObjects,
|
|
526
609
|
exec: () => exec,
|
|
527
610
|
flattenRecursive: () => flattenRecursive,
|
|
611
|
+
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
612
|
+
getExtendsInElement: () => getExtendsInElement,
|
|
528
613
|
hasOwnProperty: () => hasOwnProperty,
|
|
529
614
|
isEmpty: () => isEmpty,
|
|
530
615
|
isEmptyObject: () => isEmptyObject,
|
|
@@ -541,7 +626,7 @@ var require_object = __commonJS({
|
|
|
541
626
|
removeFromObject: () => removeFromObject,
|
|
542
627
|
stringToObject: () => stringToObject
|
|
543
628
|
});
|
|
544
|
-
module2.exports =
|
|
629
|
+
module2.exports = __toCommonJS3(object_exports);
|
|
545
630
|
var import_globals3 = require_globals();
|
|
546
631
|
var import_types = require_types();
|
|
547
632
|
var import_array = require_array();
|
|
@@ -994,38 +1079,92 @@ var require_object = __commonJS({
|
|
|
994
1079
|
}
|
|
995
1080
|
return obj;
|
|
996
1081
|
};
|
|
1082
|
+
var createObjectWithoutPrototype = (obj) => {
|
|
1083
|
+
if (obj === null || typeof obj !== "object") {
|
|
1084
|
+
return obj;
|
|
1085
|
+
}
|
|
1086
|
+
const newObj = /* @__PURE__ */ Object.create(null);
|
|
1087
|
+
for (const key in obj) {
|
|
1088
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1089
|
+
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return newObj;
|
|
1093
|
+
};
|
|
1094
|
+
var checkIfKeyIsComponent = (key) => {
|
|
1095
|
+
const isFirstKeyString = (0, import_types.isString)(key);
|
|
1096
|
+
if (!isFirstKeyString)
|
|
1097
|
+
return;
|
|
1098
|
+
const firstCharKey = key.slice(0, 1);
|
|
1099
|
+
return /^[A-Z]*$/.test(firstCharKey);
|
|
1100
|
+
};
|
|
1101
|
+
var getChildrenComponentsByKey = (key, el) => {
|
|
1102
|
+
if (key === el.key || el.__ref.__componentKey === key) {
|
|
1103
|
+
return el;
|
|
1104
|
+
}
|
|
1105
|
+
if (el.extend) {
|
|
1106
|
+
const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
|
|
1107
|
+
const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
1108
|
+
if (foundString || foundInArray)
|
|
1109
|
+
return el;
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
var getExtendsInElement = (obj) => {
|
|
1113
|
+
let result = [];
|
|
1114
|
+
function traverse(o) {
|
|
1115
|
+
for (const key in o) {
|
|
1116
|
+
if (Object.hasOwnProperty.call(o, key)) {
|
|
1117
|
+
if (checkIfKeyIsComponent(key)) {
|
|
1118
|
+
result.push(key);
|
|
1119
|
+
}
|
|
1120
|
+
if (key === "extend") {
|
|
1121
|
+
if (typeof o[key] === "string") {
|
|
1122
|
+
result.push(o[key]);
|
|
1123
|
+
} else if (Array.isArray(o[key])) {
|
|
1124
|
+
result = result.concat(o[key]);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
if (typeof o[key] === "object" && o[key] !== null) {
|
|
1128
|
+
traverse(o[key]);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
traverse(obj);
|
|
1134
|
+
return result;
|
|
1135
|
+
};
|
|
997
1136
|
}
|
|
998
1137
|
});
|
|
999
1138
|
|
|
1000
|
-
//
|
|
1139
|
+
// ../../../domql/packages/utils/dist/cjs/function.js
|
|
1001
1140
|
var require_function = __commonJS({
|
|
1002
|
-
"
|
|
1141
|
+
"../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
|
|
1003
1142
|
"use strict";
|
|
1004
|
-
var
|
|
1005
|
-
var
|
|
1006
|
-
var
|
|
1007
|
-
var
|
|
1008
|
-
var
|
|
1143
|
+
var __defProp3 = Object.defineProperty;
|
|
1144
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1145
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1146
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1147
|
+
var __export3 = (target, all) => {
|
|
1009
1148
|
for (var name in all)
|
|
1010
|
-
|
|
1149
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1011
1150
|
};
|
|
1012
|
-
var
|
|
1151
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1013
1152
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1014
|
-
for (let key of
|
|
1015
|
-
if (!
|
|
1016
|
-
|
|
1153
|
+
for (let key of __getOwnPropNames3(from))
|
|
1154
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1155
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1017
1156
|
}
|
|
1018
1157
|
return to;
|
|
1019
1158
|
};
|
|
1020
|
-
var
|
|
1159
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1021
1160
|
var function_exports = {};
|
|
1022
|
-
|
|
1161
|
+
__export3(function_exports, {
|
|
1023
1162
|
debounce: () => debounce,
|
|
1024
1163
|
debounceOnContext: () => debounceOnContext,
|
|
1025
1164
|
isStringFunction: () => isStringFunction,
|
|
1026
1165
|
memoize: () => memoize
|
|
1027
1166
|
});
|
|
1028
|
-
module2.exports =
|
|
1167
|
+
module2.exports = __toCommonJS3(function_exports);
|
|
1029
1168
|
function debounce(func, wait, immediate) {
|
|
1030
1169
|
let timeout;
|
|
1031
1170
|
return function() {
|
|
@@ -1072,33 +1211,33 @@ var require_function = __commonJS({
|
|
|
1072
1211
|
}
|
|
1073
1212
|
});
|
|
1074
1213
|
|
|
1075
|
-
//
|
|
1214
|
+
// ../../../domql/packages/utils/dist/cjs/log.js
|
|
1076
1215
|
var require_log = __commonJS({
|
|
1077
|
-
"
|
|
1216
|
+
"../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
1078
1217
|
"use strict";
|
|
1079
|
-
var
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1082
|
-
var
|
|
1083
|
-
var
|
|
1218
|
+
var __defProp3 = Object.defineProperty;
|
|
1219
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1220
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1221
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1222
|
+
var __export3 = (target, all) => {
|
|
1084
1223
|
for (var name in all)
|
|
1085
|
-
|
|
1224
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1086
1225
|
};
|
|
1087
|
-
var
|
|
1226
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1088
1227
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1089
|
-
for (let key of
|
|
1090
|
-
if (!
|
|
1091
|
-
|
|
1228
|
+
for (let key of __getOwnPropNames3(from))
|
|
1229
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1230
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1092
1231
|
}
|
|
1093
1232
|
return to;
|
|
1094
1233
|
};
|
|
1095
|
-
var
|
|
1234
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1096
1235
|
var log_exports = {};
|
|
1097
|
-
|
|
1236
|
+
__export3(log_exports, {
|
|
1098
1237
|
logGroupIf: () => logGroupIf,
|
|
1099
1238
|
logIf: () => logIf
|
|
1100
1239
|
});
|
|
1101
|
-
module2.exports =
|
|
1240
|
+
module2.exports = __toCommonJS3(log_exports);
|
|
1102
1241
|
var logIf = (bool, ...arg) => {
|
|
1103
1242
|
if (bool)
|
|
1104
1243
|
arg.map((v) => console.log(v));
|
|
@@ -1113,50 +1252,50 @@ var require_log = __commonJS({
|
|
|
1113
1252
|
}
|
|
1114
1253
|
});
|
|
1115
1254
|
|
|
1116
|
-
//
|
|
1255
|
+
// ../../../domql/packages/utils/dist/cjs/cookie.js
|
|
1117
1256
|
var require_cookie = __commonJS({
|
|
1118
|
-
"
|
|
1257
|
+
"../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1119
1258
|
"use strict";
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
var
|
|
1123
|
-
var
|
|
1124
|
-
var
|
|
1259
|
+
var __defProp3 = Object.defineProperty;
|
|
1260
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1261
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1262
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1263
|
+
var __export3 = (target, all) => {
|
|
1125
1264
|
for (var name in all)
|
|
1126
|
-
|
|
1265
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1127
1266
|
};
|
|
1128
|
-
var
|
|
1267
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1129
1268
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1130
|
-
for (let key of
|
|
1131
|
-
if (!
|
|
1132
|
-
|
|
1269
|
+
for (let key of __getOwnPropNames3(from))
|
|
1270
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1271
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1133
1272
|
}
|
|
1134
1273
|
return to;
|
|
1135
1274
|
};
|
|
1136
|
-
var
|
|
1275
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1137
1276
|
var cookie_exports = {};
|
|
1138
|
-
|
|
1277
|
+
__export3(cookie_exports, {
|
|
1139
1278
|
getCookie: () => getCookie,
|
|
1140
1279
|
isMobile: () => isMobile,
|
|
1141
1280
|
setCookie: () => setCookie
|
|
1142
1281
|
});
|
|
1143
|
-
module2.exports =
|
|
1282
|
+
module2.exports = __toCommonJS3(cookie_exports);
|
|
1144
1283
|
var import_types = require_types();
|
|
1145
|
-
var
|
|
1284
|
+
var import_utils28 = require_cjs();
|
|
1146
1285
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1147
1286
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1148
|
-
if ((0, import_types.isUndefined)(
|
|
1287
|
+
if ((0, import_types.isUndefined)(import_utils28.document) || (0, import_types.isUndefined)(import_utils28.document.cookie))
|
|
1149
1288
|
return;
|
|
1150
1289
|
const d = /* @__PURE__ */ new Date();
|
|
1151
1290
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1152
1291
|
const expires = `expires=${d.toUTCString()}`;
|
|
1153
|
-
|
|
1292
|
+
import_utils28.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1154
1293
|
};
|
|
1155
1294
|
var getCookie = (cname) => {
|
|
1156
|
-
if ((0, import_types.isUndefined)(
|
|
1295
|
+
if ((0, import_types.isUndefined)(import_utils28.document) || (0, import_types.isUndefined)(import_utils28.document.cookie))
|
|
1157
1296
|
return;
|
|
1158
1297
|
const name = `${cname}=`;
|
|
1159
|
-
const decodedCookie = decodeURIComponent(
|
|
1298
|
+
const decodedCookie = decodeURIComponent(import_utils28.document.cookie);
|
|
1160
1299
|
const ca = decodedCookie.split(";");
|
|
1161
1300
|
for (let i = 0; i < ca.length; i++) {
|
|
1162
1301
|
let c = ca[i];
|
|
@@ -1170,33 +1309,33 @@ var require_cookie = __commonJS({
|
|
|
1170
1309
|
}
|
|
1171
1310
|
});
|
|
1172
1311
|
|
|
1173
|
-
//
|
|
1312
|
+
// ../../../domql/packages/utils/dist/cjs/tags.js
|
|
1174
1313
|
var require_tags = __commonJS({
|
|
1175
|
-
"
|
|
1314
|
+
"../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1176
1315
|
"use strict";
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1181
|
-
var
|
|
1316
|
+
var __defProp3 = Object.defineProperty;
|
|
1317
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1318
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1319
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1320
|
+
var __export3 = (target, all) => {
|
|
1182
1321
|
for (var name in all)
|
|
1183
|
-
|
|
1322
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1184
1323
|
};
|
|
1185
|
-
var
|
|
1324
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1186
1325
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1187
|
-
for (let key of
|
|
1188
|
-
if (!
|
|
1189
|
-
|
|
1326
|
+
for (let key of __getOwnPropNames3(from))
|
|
1327
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1328
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1190
1329
|
}
|
|
1191
1330
|
return to;
|
|
1192
1331
|
};
|
|
1193
|
-
var
|
|
1332
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1194
1333
|
var tags_exports = {};
|
|
1195
|
-
|
|
1334
|
+
__export3(tags_exports, {
|
|
1196
1335
|
HTML_TAGS: () => HTML_TAGS,
|
|
1197
1336
|
isValidHtmlTag: () => isValidHtmlTag
|
|
1198
1337
|
});
|
|
1199
|
-
module2.exports =
|
|
1338
|
+
module2.exports = __toCommonJS3(tags_exports);
|
|
1200
1339
|
var HTML_TAGS = {
|
|
1201
1340
|
root: [
|
|
1202
1341
|
"body",
|
|
@@ -1338,26 +1477,26 @@ var require_tags = __commonJS({
|
|
|
1338
1477
|
}
|
|
1339
1478
|
});
|
|
1340
1479
|
|
|
1341
|
-
//
|
|
1480
|
+
// ../../../domql/packages/utils/dist/cjs/index.js
|
|
1342
1481
|
var require_cjs = __commonJS({
|
|
1343
|
-
"
|
|
1482
|
+
"../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
|
|
1344
1483
|
"use strict";
|
|
1345
|
-
var
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
1348
|
-
var
|
|
1349
|
-
var
|
|
1484
|
+
var __defProp3 = Object.defineProperty;
|
|
1485
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1486
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1487
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1488
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1350
1489
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1351
|
-
for (let key of
|
|
1352
|
-
if (!
|
|
1353
|
-
|
|
1490
|
+
for (let key of __getOwnPropNames3(from))
|
|
1491
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1492
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1354
1493
|
}
|
|
1355
1494
|
return to;
|
|
1356
1495
|
};
|
|
1357
|
-
var __reExport = (target, mod, secondTarget) => (
|
|
1358
|
-
var
|
|
1496
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps3(target, mod, "default"), secondTarget && __copyProps3(secondTarget, mod, "default"));
|
|
1497
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1359
1498
|
var utils_exports = {};
|
|
1360
|
-
module2.exports =
|
|
1499
|
+
module2.exports = __toCommonJS3(utils_exports);
|
|
1361
1500
|
__reExport(utils_exports, require_key(), module2.exports);
|
|
1362
1501
|
__reExport(utils_exports, require_env(), module2.exports);
|
|
1363
1502
|
__reExport(utils_exports, require_types(), module2.exports);
|
|
@@ -1377,31 +1516,31 @@ var require_cjs = __commonJS({
|
|
|
1377
1516
|
var require_cjs2 = __commonJS({
|
|
1378
1517
|
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
1379
1518
|
"use strict";
|
|
1380
|
-
var
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1384
|
-
var
|
|
1519
|
+
var __defProp3 = Object.defineProperty;
|
|
1520
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1521
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1522
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1523
|
+
var __export3 = (target, all) => {
|
|
1385
1524
|
for (var name in all)
|
|
1386
|
-
|
|
1525
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1387
1526
|
};
|
|
1388
|
-
var
|
|
1527
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1389
1528
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1390
|
-
for (let key of
|
|
1391
|
-
if (!
|
|
1392
|
-
|
|
1529
|
+
for (let key of __getOwnPropNames3(from))
|
|
1530
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1531
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1393
1532
|
}
|
|
1394
1533
|
return to;
|
|
1395
1534
|
};
|
|
1396
|
-
var
|
|
1535
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1397
1536
|
var globals_exports = {};
|
|
1398
|
-
|
|
1537
|
+
__export3(globals_exports, {
|
|
1399
1538
|
document: () => document4,
|
|
1400
1539
|
global: () => global,
|
|
1401
1540
|
self: () => self,
|
|
1402
1541
|
window: () => window2
|
|
1403
1542
|
});
|
|
1404
|
-
module2.exports =
|
|
1543
|
+
module2.exports = __toCommonJS3(globals_exports);
|
|
1405
1544
|
var global = globalThis;
|
|
1406
1545
|
var self = globalThis;
|
|
1407
1546
|
var window2 = globalThis;
|
|
@@ -1409,1492 +1548,6 @@ var require_cjs2 = __commonJS({
|
|
|
1409
1548
|
}
|
|
1410
1549
|
});
|
|
1411
1550
|
|
|
1412
|
-
// ../../node_modules/@symbo.ls/utils/dist/cjs/index.js
|
|
1413
|
-
var require_cjs3 = __commonJS({
|
|
1414
|
-
"../../node_modules/@symbo.ls/utils/dist/cjs/index.js"(exports, module2) {
|
|
1415
|
-
"use strict";
|
|
1416
|
-
var __create2 = Object.create;
|
|
1417
|
-
var __defProp2 = Object.defineProperty;
|
|
1418
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1419
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1420
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1421
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1422
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
1423
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1424
|
-
};
|
|
1425
|
-
var __export2 = (target, all) => {
|
|
1426
|
-
for (var name in all)
|
|
1427
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1428
|
-
};
|
|
1429
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1430
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1431
|
-
for (let key of __getOwnPropNames2(from))
|
|
1432
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1433
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1434
|
-
}
|
|
1435
|
-
return to;
|
|
1436
|
-
};
|
|
1437
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1438
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1439
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1440
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1441
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1442
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1443
|
-
mod
|
|
1444
|
-
));
|
|
1445
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1446
|
-
var require_key2 = __commonJS2({
|
|
1447
|
-
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1448
|
-
"use strict";
|
|
1449
|
-
var __defProp22 = Object.defineProperty;
|
|
1450
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1451
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1452
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1453
|
-
var __export22 = (target, all) => {
|
|
1454
|
-
for (var name in all)
|
|
1455
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1456
|
-
};
|
|
1457
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1458
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1459
|
-
for (let key of __getOwnPropNames22(from))
|
|
1460
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1461
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1462
|
-
}
|
|
1463
|
-
return to;
|
|
1464
|
-
};
|
|
1465
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1466
|
-
var key_exports = {};
|
|
1467
|
-
__export22(key_exports, {
|
|
1468
|
-
createSnapshotId: () => createSnapshotId,
|
|
1469
|
-
generateKey: () => generateKey
|
|
1470
|
-
});
|
|
1471
|
-
module22.exports = __toCommonJS22(key_exports);
|
|
1472
|
-
var generateKey = /* @__PURE__ */ function() {
|
|
1473
|
-
let index = 0;
|
|
1474
|
-
function newId() {
|
|
1475
|
-
index++;
|
|
1476
|
-
return index;
|
|
1477
|
-
}
|
|
1478
|
-
return newId;
|
|
1479
|
-
}();
|
|
1480
|
-
var createSnapshotId = generateKey;
|
|
1481
|
-
}
|
|
1482
|
-
});
|
|
1483
|
-
var require_env2 = __commonJS2({
|
|
1484
|
-
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
1485
|
-
"use strict";
|
|
1486
|
-
var __defProp22 = Object.defineProperty;
|
|
1487
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1488
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1489
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1490
|
-
var __export22 = (target, all) => {
|
|
1491
|
-
for (var name in all)
|
|
1492
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1493
|
-
};
|
|
1494
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1495
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1496
|
-
for (let key of __getOwnPropNames22(from))
|
|
1497
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1498
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1499
|
-
}
|
|
1500
|
-
return to;
|
|
1501
|
-
};
|
|
1502
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1503
|
-
var env_exports = {};
|
|
1504
|
-
__export22(env_exports, {
|
|
1505
|
-
NODE_ENV: () => NODE_ENV,
|
|
1506
|
-
getNev: () => getNev,
|
|
1507
|
-
isDevelopment: () => isDevelopment,
|
|
1508
|
-
isProduction: () => isProduction,
|
|
1509
|
-
isTest: () => isTest
|
|
1510
|
-
});
|
|
1511
|
-
module22.exports = __toCommonJS22(env_exports);
|
|
1512
|
-
var NODE_ENV = "development";
|
|
1513
|
-
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
1514
|
-
var isTest = (env = NODE_ENV) => env === "test";
|
|
1515
|
-
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
1516
|
-
var getNev = (key, env = NODE_ENV) => env[key];
|
|
1517
|
-
}
|
|
1518
|
-
});
|
|
1519
|
-
var require_globals2 = __commonJS2({
|
|
1520
|
-
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
1521
|
-
"use strict";
|
|
1522
|
-
var __defProp22 = Object.defineProperty;
|
|
1523
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1524
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1525
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1526
|
-
var __export22 = (target, all) => {
|
|
1527
|
-
for (var name in all)
|
|
1528
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1529
|
-
};
|
|
1530
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1531
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1532
|
-
for (let key of __getOwnPropNames22(from))
|
|
1533
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1534
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1535
|
-
}
|
|
1536
|
-
return to;
|
|
1537
|
-
};
|
|
1538
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1539
|
-
var globals_exports = {};
|
|
1540
|
-
__export22(globals_exports, {
|
|
1541
|
-
document: () => document22,
|
|
1542
|
-
global: () => global,
|
|
1543
|
-
self: () => self,
|
|
1544
|
-
window: () => window2
|
|
1545
|
-
});
|
|
1546
|
-
module22.exports = __toCommonJS22(globals_exports);
|
|
1547
|
-
var global = globalThis;
|
|
1548
|
-
var self = globalThis;
|
|
1549
|
-
var window2 = globalThis;
|
|
1550
|
-
var document22 = window2.document;
|
|
1551
|
-
}
|
|
1552
|
-
});
|
|
1553
|
-
var require_node2 = __commonJS2({
|
|
1554
|
-
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
1555
|
-
"use strict";
|
|
1556
|
-
var __defProp22 = Object.defineProperty;
|
|
1557
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1558
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1559
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1560
|
-
var __export22 = (target, all) => {
|
|
1561
|
-
for (var name in all)
|
|
1562
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1563
|
-
};
|
|
1564
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1565
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1566
|
-
for (let key of __getOwnPropNames22(from))
|
|
1567
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1568
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1569
|
-
}
|
|
1570
|
-
return to;
|
|
1571
|
-
};
|
|
1572
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1573
|
-
var node_exports = {};
|
|
1574
|
-
__export22(node_exports, {
|
|
1575
|
-
isHtmlElement: () => isHtmlElement,
|
|
1576
|
-
isNode: () => isNode
|
|
1577
|
-
});
|
|
1578
|
-
module22.exports = __toCommonJS22(node_exports);
|
|
1579
|
-
var import_globals3 = require_globals2();
|
|
1580
|
-
var isNode = (obj) => {
|
|
1581
|
-
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
1582
|
-
};
|
|
1583
|
-
var isHtmlElement = (obj) => {
|
|
1584
|
-
return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
1585
|
-
};
|
|
1586
|
-
}
|
|
1587
|
-
});
|
|
1588
|
-
var require_types2 = __commonJS2({
|
|
1589
|
-
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
1590
|
-
"use strict";
|
|
1591
|
-
var __defProp22 = Object.defineProperty;
|
|
1592
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1593
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1594
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1595
|
-
var __export22 = (target, all) => {
|
|
1596
|
-
for (var name in all)
|
|
1597
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1598
|
-
};
|
|
1599
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1600
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1601
|
-
for (let key of __getOwnPropNames22(from))
|
|
1602
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1603
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1604
|
-
}
|
|
1605
|
-
return to;
|
|
1606
|
-
};
|
|
1607
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1608
|
-
var types_exports = {};
|
|
1609
|
-
__export22(types_exports, {
|
|
1610
|
-
TYPES: () => TYPES,
|
|
1611
|
-
is: () => is,
|
|
1612
|
-
isArray: () => isArray32,
|
|
1613
|
-
isBoolean: () => isBoolean,
|
|
1614
|
-
isDate: () => isDate,
|
|
1615
|
-
isDefined: () => isDefined2,
|
|
1616
|
-
isFunction: () => isFunction2,
|
|
1617
|
-
isNot: () => isNot,
|
|
1618
|
-
isNull: () => isNull,
|
|
1619
|
-
isNumber: () => isNumber2,
|
|
1620
|
-
isObject: () => isObject32,
|
|
1621
|
-
isObjectLike: () => isObjectLike3,
|
|
1622
|
-
isString: () => isString22,
|
|
1623
|
-
isUndefined: () => isUndefined
|
|
1624
|
-
});
|
|
1625
|
-
module22.exports = __toCommonJS22(types_exports);
|
|
1626
|
-
var import_node = require_node2();
|
|
1627
|
-
var isObject32 = (arg) => {
|
|
1628
|
-
if (arg === null)
|
|
1629
|
-
return false;
|
|
1630
|
-
return typeof arg === "object" && arg.constructor === Object;
|
|
1631
|
-
};
|
|
1632
|
-
var isString22 = (arg) => typeof arg === "string";
|
|
1633
|
-
var isNumber2 = (arg) => typeof arg === "number";
|
|
1634
|
-
var isFunction2 = (arg) => typeof arg === "function";
|
|
1635
|
-
var isBoolean = (arg) => arg === true || arg === false;
|
|
1636
|
-
var isNull = (arg) => arg === null;
|
|
1637
|
-
var isArray32 = (arg) => Array.isArray(arg);
|
|
1638
|
-
var isDate = (d) => d instanceof Date;
|
|
1639
|
-
var isObjectLike3 = (arg) => {
|
|
1640
|
-
if (arg === null)
|
|
1641
|
-
return false;
|
|
1642
|
-
return typeof arg === "object";
|
|
1643
|
-
};
|
|
1644
|
-
var isDefined2 = (arg) => {
|
|
1645
|
-
return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction2(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
1646
|
-
};
|
|
1647
|
-
var isUndefined = (arg) => {
|
|
1648
|
-
return arg === void 0;
|
|
1649
|
-
};
|
|
1650
|
-
var TYPES = {
|
|
1651
|
-
boolean: isBoolean,
|
|
1652
|
-
array: isArray32,
|
|
1653
|
-
object: isObject32,
|
|
1654
|
-
string: isString22,
|
|
1655
|
-
date: isDate,
|
|
1656
|
-
number: isNumber2,
|
|
1657
|
-
null: isNull,
|
|
1658
|
-
function: isFunction2,
|
|
1659
|
-
objectLike: isObjectLike3,
|
|
1660
|
-
node: import_node.isNode,
|
|
1661
|
-
htmlElement: import_node.isHtmlElement,
|
|
1662
|
-
defined: isDefined2
|
|
1663
|
-
};
|
|
1664
|
-
var is = (arg) => {
|
|
1665
|
-
return (...args) => {
|
|
1666
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
1667
|
-
};
|
|
1668
|
-
};
|
|
1669
|
-
var isNot = (arg) => {
|
|
1670
|
-
return (...args) => {
|
|
1671
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
1672
|
-
};
|
|
1673
|
-
};
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
var require_array2 = __commonJS2({
|
|
1677
|
-
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
|
|
1678
|
-
"use strict";
|
|
1679
|
-
var __defProp22 = Object.defineProperty;
|
|
1680
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1681
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1682
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1683
|
-
var __export22 = (target, all) => {
|
|
1684
|
-
for (var name in all)
|
|
1685
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1686
|
-
};
|
|
1687
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1688
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1689
|
-
for (let key of __getOwnPropNames22(from))
|
|
1690
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1691
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1692
|
-
}
|
|
1693
|
-
return to;
|
|
1694
|
-
};
|
|
1695
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1696
|
-
var array_exports = {};
|
|
1697
|
-
__export22(array_exports, {
|
|
1698
|
-
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
1699
|
-
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1700
|
-
createNestedObject: () => createNestedObject,
|
|
1701
|
-
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
1702
|
-
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
1703
|
-
getFrequencyInArray: () => getFrequencyInArray,
|
|
1704
|
-
joinArrays: () => joinArrays,
|
|
1705
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
1706
|
-
mergeArray: () => mergeArray,
|
|
1707
|
-
removeFromArray: () => removeFromArray,
|
|
1708
|
-
removeValueFromArray: () => removeValueFromArray,
|
|
1709
|
-
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1710
|
-
reorderArrayByValues: () => reorderArrayByValues,
|
|
1711
|
-
swapItemsInArray: () => swapItemsInArray
|
|
1712
|
-
});
|
|
1713
|
-
module22.exports = __toCommonJS22(array_exports);
|
|
1714
|
-
var import_object = require_object2();
|
|
1715
|
-
var import_types = require_types2();
|
|
1716
|
-
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
1717
|
-
return arr2.every((val) => arr1.includes(val));
|
|
1718
|
-
};
|
|
1719
|
-
var getFrequencyInArray = (arr, value) => {
|
|
1720
|
-
return arr.reduce((count, currentValue) => {
|
|
1721
|
-
return currentValue === value ? count + 1 : count;
|
|
1722
|
-
}, 0);
|
|
1723
|
-
};
|
|
1724
|
-
var removeFromArray = (arr, index) => {
|
|
1725
|
-
if ((0, import_types.isString)(index))
|
|
1726
|
-
index = parseInt(index);
|
|
1727
|
-
if ((0, import_types.isNumber)(index)) {
|
|
1728
|
-
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
1729
|
-
throw new Error("Invalid index");
|
|
1730
|
-
}
|
|
1731
|
-
arr.splice(index, 1);
|
|
1732
|
-
} else if ((0, import_types.isArray)(index)) {
|
|
1733
|
-
index.forEach((idx) => removeFromArray(arr, idx));
|
|
1734
|
-
} else {
|
|
1735
|
-
throw new Error("Invalid index");
|
|
1736
|
-
}
|
|
1737
|
-
return arr;
|
|
1738
|
-
};
|
|
1739
|
-
var swapItemsInArray = (arr, i, j) => {
|
|
1740
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1741
|
-
};
|
|
1742
|
-
var joinArrays = (...arrays) => {
|
|
1743
|
-
return [].concat(...arrays);
|
|
1744
|
-
};
|
|
1745
|
-
var mergeArray = (arr, excludeFrom = []) => {
|
|
1746
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
1747
|
-
};
|
|
1748
|
-
var mergeAndCloneIfArray = (obj) => {
|
|
1749
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
1750
|
-
};
|
|
1751
|
-
var cutArrayBeforeValue = (arr, value) => {
|
|
1752
|
-
const index = arr.indexOf(value);
|
|
1753
|
-
if (index !== -1) {
|
|
1754
|
-
return arr.slice(0, index);
|
|
1755
|
-
}
|
|
1756
|
-
return arr;
|
|
1757
|
-
};
|
|
1758
|
-
var cutArrayAfterValue = (arr, value) => {
|
|
1759
|
-
if (!(0, import_types.isArray)(arr))
|
|
1760
|
-
return;
|
|
1761
|
-
const index = arr.indexOf(value);
|
|
1762
|
-
if (index !== -1) {
|
|
1763
|
-
return arr.slice(index + 1);
|
|
1764
|
-
}
|
|
1765
|
-
return arr;
|
|
1766
|
-
};
|
|
1767
|
-
var createNestedObject = (arr, lastValue) => {
|
|
1768
|
-
const nestedObject = {};
|
|
1769
|
-
if (arr.length === 0) {
|
|
1770
|
-
return lastValue;
|
|
1771
|
-
}
|
|
1772
|
-
arr.reduce((obj, value, index) => {
|
|
1773
|
-
if (!obj[value]) {
|
|
1774
|
-
obj[value] = {};
|
|
1775
|
-
}
|
|
1776
|
-
if (index === arr.length - 1 && lastValue) {
|
|
1777
|
-
obj[value] = lastValue;
|
|
1778
|
-
}
|
|
1779
|
-
return obj[value];
|
|
1780
|
-
}, nestedObject);
|
|
1781
|
-
return nestedObject;
|
|
1782
|
-
};
|
|
1783
|
-
var removeValueFromArray = (arr, value) => {
|
|
1784
|
-
const index = arr.indexOf(value);
|
|
1785
|
-
if (index > -1) {
|
|
1786
|
-
const newArray = [...arr];
|
|
1787
|
-
newArray.splice(index, 1);
|
|
1788
|
-
return newArray;
|
|
1789
|
-
}
|
|
1790
|
-
return arr;
|
|
1791
|
-
};
|
|
1792
|
-
var removeValueFromArrayAll = (arr, value) => {
|
|
1793
|
-
return arr.filter((item) => item !== value);
|
|
1794
|
-
};
|
|
1795
|
-
var addItemAfterEveryElement = (array, item) => {
|
|
1796
|
-
const result = [];
|
|
1797
|
-
for (let i = 0; i < array.length; i++) {
|
|
1798
|
-
result.push(array[i]);
|
|
1799
|
-
if (i < array.length - 1) {
|
|
1800
|
-
result.push(item);
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
return result;
|
|
1804
|
-
};
|
|
1805
|
-
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
1806
|
-
const newArray = [...array];
|
|
1807
|
-
const indexToMove = newArray.indexOf(valueToMove);
|
|
1808
|
-
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
1809
|
-
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
1810
|
-
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
1811
|
-
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
1812
|
-
newArray.splice(insertIndex, 0, removedItem);
|
|
1813
|
-
}
|
|
1814
|
-
return newArray;
|
|
1815
|
-
};
|
|
1816
|
-
}
|
|
1817
|
-
});
|
|
1818
|
-
var require_string2 = __commonJS2({
|
|
1819
|
-
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
1820
|
-
"use strict";
|
|
1821
|
-
var __defProp22 = Object.defineProperty;
|
|
1822
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1823
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1824
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1825
|
-
var __export22 = (target, all) => {
|
|
1826
|
-
for (var name in all)
|
|
1827
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1828
|
-
};
|
|
1829
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1830
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1831
|
-
for (let key of __getOwnPropNames22(from))
|
|
1832
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1833
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1834
|
-
}
|
|
1835
|
-
return to;
|
|
1836
|
-
};
|
|
1837
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1838
|
-
var string_exports = {};
|
|
1839
|
-
__export22(string_exports, {
|
|
1840
|
-
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
1841
|
-
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
1842
|
-
stringIncludesAny: () => stringIncludesAny,
|
|
1843
|
-
trimStringFromSymbols: () => trimStringFromSymbols
|
|
1844
|
-
});
|
|
1845
|
-
module22.exports = __toCommonJS22(string_exports);
|
|
1846
|
-
var stringIncludesAny = (str, characters) => {
|
|
1847
|
-
for (const char of characters) {
|
|
1848
|
-
if (str.includes(char)) {
|
|
1849
|
-
return true;
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
return false;
|
|
1853
|
-
};
|
|
1854
|
-
var trimStringFromSymbols = (str, characters) => {
|
|
1855
|
-
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
1856
|
-
return str.replace(pattern, "");
|
|
1857
|
-
};
|
|
1858
|
-
var brackRegex = {
|
|
1859
|
-
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
1860
|
-
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
1861
|
-
};
|
|
1862
|
-
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
1863
|
-
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
1864
|
-
return str;
|
|
1865
|
-
const reg = brackRegex[options.bracketsLength || 2];
|
|
1866
|
-
return str.replace(reg, (_, parentPath, variable) => {
|
|
1867
|
-
if (parentPath) {
|
|
1868
|
-
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
1869
|
-
let parentState = state;
|
|
1870
|
-
for (let i = 0; i < parentLevels; i++) {
|
|
1871
|
-
parentState = parentState.parent;
|
|
1872
|
-
if (!parentState) {
|
|
1873
|
-
return "";
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
const value = parentState[variable.trim()];
|
|
1877
|
-
return value !== void 0 ? `${value}` : "";
|
|
1878
|
-
} else {
|
|
1879
|
-
const value = state[variable.trim()];
|
|
1880
|
-
return value !== void 0 ? `${value}` : "";
|
|
1881
|
-
}
|
|
1882
|
-
});
|
|
1883
|
-
};
|
|
1884
|
-
var lowercaseFirstLetter = (inputString) => {
|
|
1885
|
-
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
1886
|
-
};
|
|
1887
|
-
}
|
|
1888
|
-
});
|
|
1889
|
-
var require_object2 = __commonJS2({
|
|
1890
|
-
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
1891
|
-
"use strict";
|
|
1892
|
-
var __defProp22 = Object.defineProperty;
|
|
1893
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1894
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1895
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1896
|
-
var __export22 = (target, all) => {
|
|
1897
|
-
for (var name in all)
|
|
1898
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1899
|
-
};
|
|
1900
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1901
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1902
|
-
for (let key of __getOwnPropNames22(from))
|
|
1903
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1904
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1905
|
-
}
|
|
1906
|
-
return to;
|
|
1907
|
-
};
|
|
1908
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1909
|
-
var object_exports = {};
|
|
1910
|
-
__export22(object_exports, {
|
|
1911
|
-
clone: () => clone,
|
|
1912
|
-
deepClone: () => deepClone2,
|
|
1913
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
1914
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
1915
|
-
deepContains: () => deepContains,
|
|
1916
|
-
deepDestringify: () => deepDestringify,
|
|
1917
|
-
deepDiff: () => deepDiff,
|
|
1918
|
-
deepMerge: () => deepMerge3,
|
|
1919
|
-
deepStringify: () => deepStringify,
|
|
1920
|
-
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
1921
|
-
diff: () => diff,
|
|
1922
|
-
diffArrays: () => diffArrays,
|
|
1923
|
-
diffObjects: () => diffObjects,
|
|
1924
|
-
exec: () => exec,
|
|
1925
|
-
flattenRecursive: () => flattenRecursive,
|
|
1926
|
-
hasOwnProperty: () => hasOwnProperty,
|
|
1927
|
-
isEmpty: () => isEmpty,
|
|
1928
|
-
isEmptyObject: () => isEmptyObject,
|
|
1929
|
-
isEqualDeep: () => isEqualDeep,
|
|
1930
|
-
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
1931
|
-
map: () => map,
|
|
1932
|
-
merge: () => merge5,
|
|
1933
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
1934
|
-
mergeIfExisted: () => mergeIfExisted,
|
|
1935
|
-
objectToString: () => objectToString,
|
|
1936
|
-
overwrite: () => overwrite,
|
|
1937
|
-
overwriteDeep: () => overwriteDeep2,
|
|
1938
|
-
overwriteShallow: () => overwriteShallow,
|
|
1939
|
-
removeFromObject: () => removeFromObject,
|
|
1940
|
-
stringToObject: () => stringToObject
|
|
1941
|
-
});
|
|
1942
|
-
module22.exports = __toCommonJS22(object_exports);
|
|
1943
|
-
var import_globals3 = require_globals2();
|
|
1944
|
-
var import_types = require_types2();
|
|
1945
|
-
var import_array = require_array2();
|
|
1946
|
-
var import_string = require_string2();
|
|
1947
|
-
var exec = (param, element, state, context) => {
|
|
1948
|
-
if ((0, import_types.isFunction)(param)) {
|
|
1949
|
-
return param(
|
|
1950
|
-
element,
|
|
1951
|
-
state || element.state,
|
|
1952
|
-
context || element.context
|
|
1953
|
-
);
|
|
1954
|
-
}
|
|
1955
|
-
return param;
|
|
1956
|
-
};
|
|
1957
|
-
var map = (obj, extention, element) => {
|
|
1958
|
-
for (const e in extention) {
|
|
1959
|
-
obj[e] = exec(extention[e], element);
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1962
|
-
var merge5 = (element, obj, excludeFrom = []) => {
|
|
1963
|
-
for (const e in obj) {
|
|
1964
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
1965
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1966
|
-
continue;
|
|
1967
|
-
const elementProp = element[e];
|
|
1968
|
-
const objProp = obj[e];
|
|
1969
|
-
if (elementProp === void 0) {
|
|
1970
|
-
element[e] = objProp;
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
return element;
|
|
1974
|
-
};
|
|
1975
|
-
var deepMerge3 = (element, extend, excludeFrom = []) => {
|
|
1976
|
-
for (const e in extend) {
|
|
1977
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
1978
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1979
|
-
continue;
|
|
1980
|
-
const elementProp = element[e];
|
|
1981
|
-
const extendProp = extend[e];
|
|
1982
|
-
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
1983
|
-
deepMerge3(elementProp, extendProp, excludeFrom);
|
|
1984
|
-
} else if (elementProp === void 0) {
|
|
1985
|
-
element[e] = extendProp;
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
return element;
|
|
1989
|
-
};
|
|
1990
|
-
var clone = (obj, excludeFrom = []) => {
|
|
1991
|
-
const o = {};
|
|
1992
|
-
for (const prop in obj) {
|
|
1993
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1994
|
-
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1995
|
-
continue;
|
|
1996
|
-
o[prop] = obj[prop];
|
|
1997
|
-
}
|
|
1998
|
-
return o;
|
|
1999
|
-
};
|
|
2000
|
-
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
2001
|
-
if ((0, import_types.isArray)(obj)) {
|
|
2002
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2003
|
-
}
|
|
2004
|
-
const o = {};
|
|
2005
|
-
for (const k in obj) {
|
|
2006
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2007
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2008
|
-
continue;
|
|
2009
|
-
let v = obj[k];
|
|
2010
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2011
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2012
|
-
}
|
|
2013
|
-
if ((0, import_types.isArray)(v)) {
|
|
2014
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2015
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2016
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2017
|
-
} else
|
|
2018
|
-
o[k] = v;
|
|
2019
|
-
}
|
|
2020
|
-
return o;
|
|
2021
|
-
};
|
|
2022
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2023
|
-
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
2024
|
-
};
|
|
2025
|
-
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
2026
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2027
|
-
for (const prop in obj) {
|
|
2028
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2029
|
-
continue;
|
|
2030
|
-
if (prop === "__proto__")
|
|
2031
|
-
continue;
|
|
2032
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2033
|
-
continue;
|
|
2034
|
-
let objProp = obj[prop];
|
|
2035
|
-
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
2036
|
-
continue;
|
|
2037
|
-
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
2038
|
-
objProp = (0, import_array.mergeArray)(objProp);
|
|
2039
|
-
}
|
|
2040
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2041
|
-
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
2042
|
-
} else
|
|
2043
|
-
o[prop] = objProp;
|
|
2044
|
-
}
|
|
2045
|
-
return o;
|
|
2046
|
-
};
|
|
2047
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2048
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2049
|
-
for (const prop in obj) {
|
|
2050
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2051
|
-
continue;
|
|
2052
|
-
const objProp = obj[prop];
|
|
2053
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2054
|
-
continue;
|
|
2055
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2056
|
-
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2057
|
-
} else
|
|
2058
|
-
o[prop] = objProp;
|
|
2059
|
-
}
|
|
2060
|
-
return o;
|
|
2061
|
-
};
|
|
2062
|
-
var deepStringify = (obj, stringified = {}) => {
|
|
2063
|
-
for (const prop in obj) {
|
|
2064
|
-
const objProp = obj[prop];
|
|
2065
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
2066
|
-
stringified[prop] = objProp.toString();
|
|
2067
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2068
|
-
stringified[prop] = {};
|
|
2069
|
-
deepStringify(objProp, stringified[prop]);
|
|
2070
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2071
|
-
stringified[prop] = [];
|
|
2072
|
-
objProp.forEach((v, i) => {
|
|
2073
|
-
if ((0, import_types.isObject)(v)) {
|
|
2074
|
-
stringified[prop][i] = {};
|
|
2075
|
-
deepStringify(v, stringified[prop][i]);
|
|
2076
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
2077
|
-
stringified[prop][i] = v.toString();
|
|
2078
|
-
} else {
|
|
2079
|
-
stringified[prop][i] = v;
|
|
2080
|
-
}
|
|
2081
|
-
});
|
|
2082
|
-
} else {
|
|
2083
|
-
stringified[prop] = objProp;
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
return stringified;
|
|
2087
|
-
};
|
|
2088
|
-
var objectToString = (obj = {}, indent = 0) => {
|
|
2089
|
-
const spaces = " ".repeat(indent);
|
|
2090
|
-
let str = "{\n";
|
|
2091
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2092
|
-
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2093
|
-
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2094
|
-
str += `${spaces} ${stringedKey}: `;
|
|
2095
|
-
if ((0, import_types.isArray)(value)) {
|
|
2096
|
-
str += "[\n";
|
|
2097
|
-
for (const element of value) {
|
|
2098
|
-
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2099
|
-
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2100
|
-
`;
|
|
2101
|
-
} else if ((0, import_types.isString)(element)) {
|
|
2102
|
-
str += `${spaces} '${element}',
|
|
2103
|
-
`;
|
|
2104
|
-
} else {
|
|
2105
|
-
str += `${spaces} ${element},
|
|
2106
|
-
`;
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
str += `${spaces} ]`;
|
|
2110
|
-
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2111
|
-
str += objectToString(value, indent + 1);
|
|
2112
|
-
} else if ((0, import_types.isString)(value)) {
|
|
2113
|
-
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2114
|
-
} else {
|
|
2115
|
-
str += value;
|
|
2116
|
-
}
|
|
2117
|
-
str += ",\n";
|
|
2118
|
-
}
|
|
2119
|
-
str += `${spaces}}`;
|
|
2120
|
-
return str;
|
|
2121
|
-
};
|
|
2122
|
-
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2123
|
-
for (const prop in obj) {
|
|
2124
|
-
const objProp = obj[prop];
|
|
2125
|
-
if ((0, import_types.isFunction)(objProp))
|
|
2126
|
-
continue;
|
|
2127
|
-
else if ((0, import_types.isObject)(objProp)) {
|
|
2128
|
-
detached[prop] = {};
|
|
2129
|
-
deepStringify(objProp, detached[prop]);
|
|
2130
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2131
|
-
detached[prop] = [];
|
|
2132
|
-
objProp.forEach((v, i) => {
|
|
2133
|
-
if ((0, import_types.isFunction)(v))
|
|
2134
|
-
return;
|
|
2135
|
-
if ((0, import_types.isObject)(v)) {
|
|
2136
|
-
detached[prop][i] = {};
|
|
2137
|
-
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2138
|
-
} else {
|
|
2139
|
-
detached[prop][i] = v;
|
|
2140
|
-
}
|
|
2141
|
-
});
|
|
2142
|
-
} else {
|
|
2143
|
-
detached[prop] = objProp;
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
return detached;
|
|
2147
|
-
};
|
|
2148
|
-
var deepDestringify = (obj, destringified = {}) => {
|
|
2149
|
-
for (const prop in obj) {
|
|
2150
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2151
|
-
if (!hasOwnProperty2)
|
|
2152
|
-
continue;
|
|
2153
|
-
const objProp = obj[prop];
|
|
2154
|
-
if ((0, import_types.isString)(objProp)) {
|
|
2155
|
-
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2156
|
-
try {
|
|
2157
|
-
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2158
|
-
destringified[prop] = evalProp;
|
|
2159
|
-
} catch (e) {
|
|
2160
|
-
if (e)
|
|
2161
|
-
destringified[prop] = objProp;
|
|
2162
|
-
}
|
|
2163
|
-
} else {
|
|
2164
|
-
destringified[prop] = objProp;
|
|
2165
|
-
}
|
|
2166
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2167
|
-
destringified[prop] = [];
|
|
2168
|
-
objProp.forEach((arrProp) => {
|
|
2169
|
-
if ((0, import_types.isString)(arrProp)) {
|
|
2170
|
-
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2171
|
-
try {
|
|
2172
|
-
const evalProp = import_globals3.window.eval(`(${arrProp})`);
|
|
2173
|
-
destringified[prop].push(evalProp);
|
|
2174
|
-
} catch (e) {
|
|
2175
|
-
if (e)
|
|
2176
|
-
destringified[prop].push(arrProp);
|
|
2177
|
-
}
|
|
2178
|
-
} else {
|
|
2179
|
-
destringified[prop].push(arrProp);
|
|
2180
|
-
}
|
|
2181
|
-
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2182
|
-
destringified[prop].push(deepDestringify(arrProp));
|
|
2183
|
-
} else {
|
|
2184
|
-
destringified[prop].push(arrProp);
|
|
2185
|
-
}
|
|
2186
|
-
});
|
|
2187
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2188
|
-
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2189
|
-
} else {
|
|
2190
|
-
destringified[prop] = objProp;
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
return destringified;
|
|
2194
|
-
};
|
|
2195
|
-
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2196
|
-
try {
|
|
2197
|
-
return import_globals3.window.eval("(" + str + ")");
|
|
2198
|
-
} catch (e) {
|
|
2199
|
-
if (opts.verbose)
|
|
2200
|
-
console.warn(e);
|
|
2201
|
-
}
|
|
2202
|
-
};
|
|
2203
|
-
var diffObjects = (original, objToDiff, cache) => {
|
|
2204
|
-
for (const e in objToDiff) {
|
|
2205
|
-
if (e === "ref")
|
|
2206
|
-
continue;
|
|
2207
|
-
const originalProp = original[e];
|
|
2208
|
-
const objToDiffProp = objToDiff[e];
|
|
2209
|
-
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2210
|
-
cache[e] = {};
|
|
2211
|
-
diff(originalProp, objToDiffProp, cache[e]);
|
|
2212
|
-
} else if (objToDiffProp !== void 0) {
|
|
2213
|
-
cache[e] = objToDiffProp;
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
return cache;
|
|
2217
|
-
};
|
|
2218
|
-
var diffArrays = (original, objToDiff, cache) => {
|
|
2219
|
-
if (original.length !== objToDiff.length) {
|
|
2220
|
-
cache = objToDiff;
|
|
2221
|
-
} else {
|
|
2222
|
-
const diffArr = [];
|
|
2223
|
-
for (let i = 0; i < original.length; i++) {
|
|
2224
|
-
const diffObj = diff(original[i], objToDiff[i]);
|
|
2225
|
-
if (Object.keys(diffObj).length > 0) {
|
|
2226
|
-
diffArr.push(diffObj);
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
if (diffArr.length > 0) {
|
|
2230
|
-
cache = diffArr;
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
return cache;
|
|
2234
|
-
};
|
|
2235
|
-
var diff = (original, objToDiff, cache = {}) => {
|
|
2236
|
-
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2237
|
-
cache = [];
|
|
2238
|
-
diffArrays(original, objToDiff, cache);
|
|
2239
|
-
} else {
|
|
2240
|
-
diffObjects(original, objToDiff, cache);
|
|
2241
|
-
}
|
|
2242
|
-
return cache;
|
|
2243
|
-
};
|
|
2244
|
-
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2245
|
-
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2246
|
-
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2247
|
-
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2248
|
-
var deepDiff = (lhs, rhs) => {
|
|
2249
|
-
if (lhs === rhs)
|
|
2250
|
-
return {};
|
|
2251
|
-
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2252
|
-
return rhs;
|
|
2253
|
-
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2254
|
-
if (!hasOwnProperty(rhs, key)) {
|
|
2255
|
-
acc[key] = void 0;
|
|
2256
|
-
}
|
|
2257
|
-
return acc;
|
|
2258
|
-
}, makeObjectWithoutPrototype());
|
|
2259
|
-
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2260
|
-
if (lhs.valueOf() === rhs.valueOf())
|
|
2261
|
-
return {};
|
|
2262
|
-
return rhs;
|
|
2263
|
-
}
|
|
2264
|
-
return Object.keys(rhs).reduce((acc, key) => {
|
|
2265
|
-
if (!hasOwnProperty(lhs, key)) {
|
|
2266
|
-
acc[key] = rhs[key];
|
|
2267
|
-
return acc;
|
|
2268
|
-
}
|
|
2269
|
-
const difference = diff(lhs[key], rhs[key]);
|
|
2270
|
-
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2271
|
-
return acc;
|
|
2272
|
-
}
|
|
2273
|
-
acc[key] = difference;
|
|
2274
|
-
return acc;
|
|
2275
|
-
}, deletedValues);
|
|
2276
|
-
};
|
|
2277
|
-
var overwrite = (element, params, excludeFrom = []) => {
|
|
2278
|
-
const { ref } = element;
|
|
2279
|
-
const changes = {};
|
|
2280
|
-
for (const e in params) {
|
|
2281
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2282
|
-
continue;
|
|
2283
|
-
const elementProp = element[e];
|
|
2284
|
-
const paramsProp = params[e];
|
|
2285
|
-
if (paramsProp) {
|
|
2286
|
-
ref.__cache[e] = changes[e] = elementProp;
|
|
2287
|
-
ref[e] = paramsProp;
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
return changes;
|
|
2291
|
-
};
|
|
2292
|
-
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2293
|
-
for (const e in params) {
|
|
2294
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2295
|
-
continue;
|
|
2296
|
-
obj[e] = params[e];
|
|
2297
|
-
}
|
|
2298
|
-
return obj;
|
|
2299
|
-
};
|
|
2300
|
-
var overwriteDeep2 = (obj, params, excludeFrom = []) => {
|
|
2301
|
-
for (const e in params) {
|
|
2302
|
-
if (e === "__proto__")
|
|
2303
|
-
continue;
|
|
2304
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2305
|
-
continue;
|
|
2306
|
-
const objProp = obj[e];
|
|
2307
|
-
const paramsProp = params[e];
|
|
2308
|
-
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2309
|
-
overwriteDeep2(objProp, paramsProp);
|
|
2310
|
-
} else if (paramsProp !== void 0) {
|
|
2311
|
-
obj[e] = paramsProp;
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
return obj;
|
|
2315
|
-
};
|
|
2316
|
-
var mergeIfExisted = (a, b) => {
|
|
2317
|
-
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2318
|
-
return deepMerge3(a, b);
|
|
2319
|
-
return a || b;
|
|
2320
|
-
};
|
|
2321
|
-
var flattenRecursive = (param, prop, stack = []) => {
|
|
2322
|
-
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2323
|
-
stack.push(objectized);
|
|
2324
|
-
const extendOfExtend = objectized[prop];
|
|
2325
|
-
if (extendOfExtend)
|
|
2326
|
-
flattenRecursive(extendOfExtend, prop, stack);
|
|
2327
|
-
delete objectized[prop];
|
|
2328
|
-
return stack;
|
|
2329
|
-
};
|
|
2330
|
-
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2331
|
-
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2332
|
-
return param === element;
|
|
2333
|
-
}
|
|
2334
|
-
if (visited.has(param) || visited.has(element)) {
|
|
2335
|
-
return true;
|
|
2336
|
-
}
|
|
2337
|
-
visited.add(param);
|
|
2338
|
-
visited.add(element);
|
|
2339
|
-
const keysParam = Object.keys(param);
|
|
2340
|
-
const keysElement = Object.keys(element);
|
|
2341
|
-
if (keysParam.length !== keysElement.length) {
|
|
2342
|
-
return false;
|
|
2343
|
-
}
|
|
2344
|
-
for (const key of keysParam) {
|
|
2345
|
-
if (!keysElement.includes(key)) {
|
|
2346
|
-
return false;
|
|
2347
|
-
}
|
|
2348
|
-
const paramProp = param[key];
|
|
2349
|
-
const elementProp = element[key];
|
|
2350
|
-
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2351
|
-
return false;
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
return true;
|
|
2355
|
-
};
|
|
2356
|
-
var deepContains = (obj1, obj2) => {
|
|
2357
|
-
if (typeof obj1 !== typeof obj2) {
|
|
2358
|
-
return false;
|
|
2359
|
-
}
|
|
2360
|
-
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2361
|
-
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2362
|
-
if (obj1.length !== obj2.length) {
|
|
2363
|
-
return false;
|
|
2364
|
-
}
|
|
2365
|
-
for (let i = 0; i < obj1.length; i++) {
|
|
2366
|
-
if (!deepContains(obj1[i], obj2[i])) {
|
|
2367
|
-
return false;
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2371
|
-
for (const key in obj1) {
|
|
2372
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2373
|
-
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2374
|
-
return false;
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
} else {
|
|
2379
|
-
return obj2 === obj1;
|
|
2380
|
-
}
|
|
2381
|
-
return true;
|
|
2382
|
-
};
|
|
2383
|
-
var removeFromObject = (obj, props) => {
|
|
2384
|
-
if (props === void 0 || props === null)
|
|
2385
|
-
return obj;
|
|
2386
|
-
if ((0, import_types.is)(props)("string", "number")) {
|
|
2387
|
-
delete obj[props];
|
|
2388
|
-
} else if ((0, import_types.isArray)(props)) {
|
|
2389
|
-
props.forEach((prop) => delete obj[prop]);
|
|
2390
|
-
} else {
|
|
2391
|
-
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2392
|
-
}
|
|
2393
|
-
return obj;
|
|
2394
|
-
};
|
|
2395
|
-
}
|
|
2396
|
-
});
|
|
2397
|
-
var require_function2 = __commonJS2({
|
|
2398
|
-
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
2399
|
-
"use strict";
|
|
2400
|
-
var __defProp22 = Object.defineProperty;
|
|
2401
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2402
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2403
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2404
|
-
var __export22 = (target, all) => {
|
|
2405
|
-
for (var name in all)
|
|
2406
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2407
|
-
};
|
|
2408
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2409
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2410
|
-
for (let key of __getOwnPropNames22(from))
|
|
2411
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2412
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2413
|
-
}
|
|
2414
|
-
return to;
|
|
2415
|
-
};
|
|
2416
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2417
|
-
var function_exports = {};
|
|
2418
|
-
__export22(function_exports, {
|
|
2419
|
-
debounce: () => debounce,
|
|
2420
|
-
debounceOnContext: () => debounceOnContext,
|
|
2421
|
-
isStringFunction: () => isStringFunction,
|
|
2422
|
-
memoize: () => memoize
|
|
2423
|
-
});
|
|
2424
|
-
module22.exports = __toCommonJS22(function_exports);
|
|
2425
|
-
function debounce(func, wait, immediate) {
|
|
2426
|
-
let timeout;
|
|
2427
|
-
return function() {
|
|
2428
|
-
const context = this;
|
|
2429
|
-
const args = arguments;
|
|
2430
|
-
const later = function() {
|
|
2431
|
-
timeout = null;
|
|
2432
|
-
if (!immediate)
|
|
2433
|
-
func.apply(context, args);
|
|
2434
|
-
};
|
|
2435
|
-
const callNow = immediate && !timeout;
|
|
2436
|
-
clearTimeout(timeout);
|
|
2437
|
-
timeout = setTimeout(later, wait);
|
|
2438
|
-
if (callNow)
|
|
2439
|
-
func.apply(context, args);
|
|
2440
|
-
};
|
|
2441
|
-
}
|
|
2442
|
-
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2443
|
-
let timer;
|
|
2444
|
-
return (...args) => {
|
|
2445
|
-
clearTimeout(timer);
|
|
2446
|
-
timer = setTimeout(() => {
|
|
2447
|
-
func.apply(element, args);
|
|
2448
|
-
}, timeout);
|
|
2449
|
-
};
|
|
2450
|
-
};
|
|
2451
|
-
var memoize = (fn) => {
|
|
2452
|
-
const cache = {};
|
|
2453
|
-
return (...args) => {
|
|
2454
|
-
const n = args[0];
|
|
2455
|
-
if (n in cache) {
|
|
2456
|
-
return cache[n];
|
|
2457
|
-
} else {
|
|
2458
|
-
const result = fn(n);
|
|
2459
|
-
cache[n] = result;
|
|
2460
|
-
return result;
|
|
2461
|
-
}
|
|
2462
|
-
};
|
|
2463
|
-
};
|
|
2464
|
-
var isStringFunction = (inputString) => {
|
|
2465
|
-
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
2466
|
-
return functionRegex.test(inputString);
|
|
2467
|
-
};
|
|
2468
|
-
}
|
|
2469
|
-
});
|
|
2470
|
-
var require_log2 = __commonJS2({
|
|
2471
|
-
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
2472
|
-
"use strict";
|
|
2473
|
-
var __defProp22 = Object.defineProperty;
|
|
2474
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2475
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2476
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2477
|
-
var __export22 = (target, all) => {
|
|
2478
|
-
for (var name in all)
|
|
2479
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2480
|
-
};
|
|
2481
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2482
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2483
|
-
for (let key of __getOwnPropNames22(from))
|
|
2484
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2485
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2486
|
-
}
|
|
2487
|
-
return to;
|
|
2488
|
-
};
|
|
2489
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2490
|
-
var log_exports = {};
|
|
2491
|
-
__export22(log_exports, {
|
|
2492
|
-
logGroupIf: () => logGroupIf,
|
|
2493
|
-
logIf: () => logIf
|
|
2494
|
-
});
|
|
2495
|
-
module22.exports = __toCommonJS22(log_exports);
|
|
2496
|
-
var logIf = (bool, ...arg) => {
|
|
2497
|
-
if (bool)
|
|
2498
|
-
arg.map((v) => console.log(v));
|
|
2499
|
-
};
|
|
2500
|
-
var logGroupIf = (bool, key, ...arg) => {
|
|
2501
|
-
if (bool) {
|
|
2502
|
-
console.group(key);
|
|
2503
|
-
arg.map((v) => console.log(v));
|
|
2504
|
-
console.groupEnd(key);
|
|
2505
|
-
}
|
|
2506
|
-
};
|
|
2507
|
-
}
|
|
2508
|
-
});
|
|
2509
|
-
var require_cookie2 = __commonJS2({
|
|
2510
|
-
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
2511
|
-
"use strict";
|
|
2512
|
-
var __defProp22 = Object.defineProperty;
|
|
2513
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2514
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2515
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2516
|
-
var __export22 = (target, all) => {
|
|
2517
|
-
for (var name in all)
|
|
2518
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2519
|
-
};
|
|
2520
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2521
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2522
|
-
for (let key of __getOwnPropNames22(from))
|
|
2523
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2524
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2525
|
-
}
|
|
2526
|
-
return to;
|
|
2527
|
-
};
|
|
2528
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2529
|
-
var cookie_exports = {};
|
|
2530
|
-
__export22(cookie_exports, {
|
|
2531
|
-
getCookie: () => getCookie,
|
|
2532
|
-
isMobile: () => isMobile,
|
|
2533
|
-
setCookie: () => setCookie
|
|
2534
|
-
});
|
|
2535
|
-
module22.exports = __toCommonJS22(cookie_exports);
|
|
2536
|
-
var import_types = require_types2();
|
|
2537
|
-
var import_utils32 = require_cjs4();
|
|
2538
|
-
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2539
|
-
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2540
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2541
|
-
return;
|
|
2542
|
-
const d = /* @__PURE__ */ new Date();
|
|
2543
|
-
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2544
|
-
const expires = `expires=${d.toUTCString()}`;
|
|
2545
|
-
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2546
|
-
};
|
|
2547
|
-
var getCookie = (cname) => {
|
|
2548
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2549
|
-
return;
|
|
2550
|
-
const name = `${cname}=`;
|
|
2551
|
-
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
2552
|
-
const ca = decodedCookie.split(";");
|
|
2553
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2554
|
-
let c = ca[i];
|
|
2555
|
-
while (c.charAt(0) === " ")
|
|
2556
|
-
c = c.substring(1);
|
|
2557
|
-
if (c.indexOf(name) === 0)
|
|
2558
|
-
return c.substring(name.length, c.length);
|
|
2559
|
-
}
|
|
2560
|
-
return "";
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
});
|
|
2564
|
-
var require_tags2 = __commonJS2({
|
|
2565
|
-
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
2566
|
-
"use strict";
|
|
2567
|
-
var __defProp22 = Object.defineProperty;
|
|
2568
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2569
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2570
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2571
|
-
var __export22 = (target, all) => {
|
|
2572
|
-
for (var name in all)
|
|
2573
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2574
|
-
};
|
|
2575
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2576
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2577
|
-
for (let key of __getOwnPropNames22(from))
|
|
2578
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2579
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2580
|
-
}
|
|
2581
|
-
return to;
|
|
2582
|
-
};
|
|
2583
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2584
|
-
var tags_exports = {};
|
|
2585
|
-
__export22(tags_exports, {
|
|
2586
|
-
HTML_TAGS: () => HTML_TAGS,
|
|
2587
|
-
isValidHtmlTag: () => isValidHtmlTag
|
|
2588
|
-
});
|
|
2589
|
-
module22.exports = __toCommonJS22(tags_exports);
|
|
2590
|
-
var HTML_TAGS = {
|
|
2591
|
-
root: [
|
|
2592
|
-
"body",
|
|
2593
|
-
"html"
|
|
2594
|
-
],
|
|
2595
|
-
head: [
|
|
2596
|
-
"title",
|
|
2597
|
-
"base",
|
|
2598
|
-
"meta",
|
|
2599
|
-
"style"
|
|
2600
|
-
],
|
|
2601
|
-
body: [
|
|
2602
|
-
"string",
|
|
2603
|
-
"fragment",
|
|
2604
|
-
"a",
|
|
2605
|
-
"abbr",
|
|
2606
|
-
"acronym",
|
|
2607
|
-
"address",
|
|
2608
|
-
"applet",
|
|
2609
|
-
"area",
|
|
2610
|
-
"article",
|
|
2611
|
-
"aside",
|
|
2612
|
-
"audio",
|
|
2613
|
-
"b",
|
|
2614
|
-
"basefont",
|
|
2615
|
-
"bdi",
|
|
2616
|
-
"bdo",
|
|
2617
|
-
"big",
|
|
2618
|
-
"blockquote",
|
|
2619
|
-
"br",
|
|
2620
|
-
"button",
|
|
2621
|
-
"canvas",
|
|
2622
|
-
"caption",
|
|
2623
|
-
"center",
|
|
2624
|
-
"cite",
|
|
2625
|
-
"code",
|
|
2626
|
-
"search",
|
|
2627
|
-
"col",
|
|
2628
|
-
"colgroup",
|
|
2629
|
-
"data",
|
|
2630
|
-
"datalist",
|
|
2631
|
-
"dd",
|
|
2632
|
-
"del",
|
|
2633
|
-
"details",
|
|
2634
|
-
"dfn",
|
|
2635
|
-
"dialog",
|
|
2636
|
-
"dir",
|
|
2637
|
-
"div",
|
|
2638
|
-
"dl",
|
|
2639
|
-
"dt",
|
|
2640
|
-
"em",
|
|
2641
|
-
"embed",
|
|
2642
|
-
"fieldset",
|
|
2643
|
-
"figcaption",
|
|
2644
|
-
"figure",
|
|
2645
|
-
"font",
|
|
2646
|
-
"footer",
|
|
2647
|
-
"form",
|
|
2648
|
-
"frame",
|
|
2649
|
-
"frameset",
|
|
2650
|
-
"h1",
|
|
2651
|
-
"h2",
|
|
2652
|
-
"h3",
|
|
2653
|
-
"h4",
|
|
2654
|
-
"h5",
|
|
2655
|
-
"h6",
|
|
2656
|
-
"head",
|
|
2657
|
-
"header",
|
|
2658
|
-
"hr",
|
|
2659
|
-
"i",
|
|
2660
|
-
"iframe",
|
|
2661
|
-
"img",
|
|
2662
|
-
"input",
|
|
2663
|
-
"ins",
|
|
2664
|
-
"kbd",
|
|
2665
|
-
"label",
|
|
2666
|
-
"legend",
|
|
2667
|
-
"li",
|
|
2668
|
-
"link",
|
|
2669
|
-
"main",
|
|
2670
|
-
"map",
|
|
2671
|
-
"mark",
|
|
2672
|
-
"meter",
|
|
2673
|
-
"nav",
|
|
2674
|
-
"noframes",
|
|
2675
|
-
"noscript",
|
|
2676
|
-
"object",
|
|
2677
|
-
"ol",
|
|
2678
|
-
"optgroup",
|
|
2679
|
-
"option",
|
|
2680
|
-
"output",
|
|
2681
|
-
"p",
|
|
2682
|
-
"param",
|
|
2683
|
-
"picture",
|
|
2684
|
-
"pre",
|
|
2685
|
-
"progress",
|
|
2686
|
-
"hgroup",
|
|
2687
|
-
"q",
|
|
2688
|
-
"rp",
|
|
2689
|
-
"rt",
|
|
2690
|
-
"ruby",
|
|
2691
|
-
"s",
|
|
2692
|
-
"samp",
|
|
2693
|
-
"script",
|
|
2694
|
-
"section",
|
|
2695
|
-
"select",
|
|
2696
|
-
"small",
|
|
2697
|
-
"source",
|
|
2698
|
-
"span",
|
|
2699
|
-
"strike",
|
|
2700
|
-
"strong",
|
|
2701
|
-
"sub",
|
|
2702
|
-
"summary",
|
|
2703
|
-
"sup",
|
|
2704
|
-
"table",
|
|
2705
|
-
"tbody",
|
|
2706
|
-
"td",
|
|
2707
|
-
"template",
|
|
2708
|
-
"hgroup",
|
|
2709
|
-
"textarea",
|
|
2710
|
-
"tfoot",
|
|
2711
|
-
"th",
|
|
2712
|
-
"thead",
|
|
2713
|
-
"time",
|
|
2714
|
-
"tr",
|
|
2715
|
-
"track",
|
|
2716
|
-
"tt",
|
|
2717
|
-
"u",
|
|
2718
|
-
"ul",
|
|
2719
|
-
"var",
|
|
2720
|
-
"video",
|
|
2721
|
-
"wbr",
|
|
2722
|
-
// SVG
|
|
2723
|
-
"svg",
|
|
2724
|
-
"path"
|
|
2725
|
-
]
|
|
2726
|
-
};
|
|
2727
|
-
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
2728
|
-
}
|
|
2729
|
-
});
|
|
2730
|
-
var require_cjs4 = __commonJS2({
|
|
2731
|
-
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
2732
|
-
"use strict";
|
|
2733
|
-
var __defProp22 = Object.defineProperty;
|
|
2734
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2735
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2736
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2737
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2738
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2739
|
-
for (let key of __getOwnPropNames22(from))
|
|
2740
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2741
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2742
|
-
}
|
|
2743
|
-
return to;
|
|
2744
|
-
};
|
|
2745
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
2746
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2747
|
-
var utils_exports = {};
|
|
2748
|
-
module22.exports = __toCommonJS22(utils_exports);
|
|
2749
|
-
__reExport(utils_exports, require_key2(), module22.exports);
|
|
2750
|
-
__reExport(utils_exports, require_env2(), module22.exports);
|
|
2751
|
-
__reExport(utils_exports, require_types2(), module22.exports);
|
|
2752
|
-
__reExport(utils_exports, require_object2(), module22.exports);
|
|
2753
|
-
__reExport(utils_exports, require_function2(), module22.exports);
|
|
2754
|
-
__reExport(utils_exports, require_array2(), module22.exports);
|
|
2755
|
-
__reExport(utils_exports, require_node2(), module22.exports);
|
|
2756
|
-
__reExport(utils_exports, require_log2(), module22.exports);
|
|
2757
|
-
__reExport(utils_exports, require_string2(), module22.exports);
|
|
2758
|
-
__reExport(utils_exports, require_globals2(), module22.exports);
|
|
2759
|
-
__reExport(utils_exports, require_cookie2(), module22.exports);
|
|
2760
|
-
__reExport(utils_exports, require_tags2(), module22.exports);
|
|
2761
|
-
}
|
|
2762
|
-
});
|
|
2763
|
-
var src_exports = {};
|
|
2764
|
-
__export2(src_exports, {
|
|
2765
|
-
arrayzeValue: () => arrayzeValue3,
|
|
2766
|
-
copyStringToClipboard: () => copyStringToClipboard,
|
|
2767
|
-
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
2768
|
-
findClosestNumber: () => findClosestNumber,
|
|
2769
|
-
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2770
|
-
formatDate: () => formatDate,
|
|
2771
|
-
loadJavascript: () => loadJavascript,
|
|
2772
|
-
loadJavascriptFile: () => loadJavascriptFile,
|
|
2773
|
-
removeChars: () => removeChars,
|
|
2774
|
-
toCamelCase: () => toCamelCase2,
|
|
2775
|
-
toDashCase: () => toDashCase2,
|
|
2776
|
-
toDescriptionCase: () => toDescriptionCase,
|
|
2777
|
-
toTitleCase: () => toTitleCase,
|
|
2778
|
-
toggleFullscreen: () => toggleFullscreen
|
|
2779
|
-
});
|
|
2780
|
-
module2.exports = __toCommonJS2(src_exports);
|
|
2781
|
-
var import_utils26 = __toESM2(require_cjs4(), 1);
|
|
2782
|
-
var toggleFullscreen = (el) => {
|
|
2783
|
-
if (!document.fullscreenElement) {
|
|
2784
|
-
el.node.requestFullscreen().catch((err) => {
|
|
2785
|
-
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
2786
|
-
});
|
|
2787
|
-
} else {
|
|
2788
|
-
document.exitFullscreen();
|
|
2789
|
-
}
|
|
2790
|
-
};
|
|
2791
|
-
var import_utils27 = __toESM2(require_cjs4(), 1);
|
|
2792
|
-
var findClosestNumber = (number, arr) => {
|
|
2793
|
-
return ((0, import_utils27.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
2794
|
-
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
2795
|
-
});
|
|
2796
|
-
};
|
|
2797
|
-
var findClosestNumberInFactory = (val, factory) => {
|
|
2798
|
-
val = parseFloat(val);
|
|
2799
|
-
if ((0, import_utils27.isObject)(factory))
|
|
2800
|
-
factory = Object.values(factory);
|
|
2801
|
-
return findClosestNumber(val, factory);
|
|
2802
|
-
};
|
|
2803
|
-
var formatDate = (timestamp) => {
|
|
2804
|
-
if (!timestamp)
|
|
2805
|
-
return "";
|
|
2806
|
-
const d = new Date(timestamp);
|
|
2807
|
-
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
2808
|
-
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
2809
|
-
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
2810
|
-
return `${da} ${mo}, ${ye}`;
|
|
2811
|
-
};
|
|
2812
|
-
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
2813
|
-
const fib = [0, 1];
|
|
2814
|
-
for (let i = 2; i <= n; i++) {
|
|
2815
|
-
fib[i] = fib[i - 1] + fib[i - 2];
|
|
2816
|
-
}
|
|
2817
|
-
return fib[n];
|
|
2818
|
-
};
|
|
2819
|
-
var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
|
|
2820
|
-
return new Promise((resolve, reject) => {
|
|
2821
|
-
try {
|
|
2822
|
-
const scriptEle = doc.createElement("script");
|
|
2823
|
-
scriptEle.type = type;
|
|
2824
|
-
scriptEle.async = async;
|
|
2825
|
-
scriptEle.src = FILE_URL;
|
|
2826
|
-
scriptEle.addEventListener("load", (ev) => {
|
|
2827
|
-
resolve({
|
|
2828
|
-
status: true
|
|
2829
|
-
});
|
|
2830
|
-
});
|
|
2831
|
-
scriptEle.addEventListener("error", (ev) => {
|
|
2832
|
-
reject({
|
|
2833
|
-
status: false,
|
|
2834
|
-
message: `Failed to load the script ${FILE_URL}`
|
|
2835
|
-
});
|
|
2836
|
-
});
|
|
2837
|
-
doc.body.appendChild(scriptEle);
|
|
2838
|
-
} catch (error) {
|
|
2839
|
-
reject(error);
|
|
2840
|
-
}
|
|
2841
|
-
});
|
|
2842
|
-
};
|
|
2843
|
-
var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
|
|
2844
|
-
try {
|
|
2845
|
-
const scriptEle = doc.createElement("script");
|
|
2846
|
-
scriptEle.type = type;
|
|
2847
|
-
scriptEle.async = async;
|
|
2848
|
-
scriptEle.innerHTML = body;
|
|
2849
|
-
doc.body.appendChild(scriptEle);
|
|
2850
|
-
} catch (error) {
|
|
2851
|
-
console.warn(error);
|
|
2852
|
-
}
|
|
2853
|
-
};
|
|
2854
|
-
var copyStringToClipboard = (str) => {
|
|
2855
|
-
const el = document.createElement("textarea");
|
|
2856
|
-
el.value = str;
|
|
2857
|
-
el.setAttribute("readonly", "");
|
|
2858
|
-
el.style = { position: "absolute", left: "-9999px" };
|
|
2859
|
-
document.body.appendChild(el);
|
|
2860
|
-
el.select();
|
|
2861
|
-
document.execCommand("copy");
|
|
2862
|
-
document.body.removeChild(el);
|
|
2863
|
-
};
|
|
2864
|
-
var removeChars = (str) => {
|
|
2865
|
-
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
2866
|
-
};
|
|
2867
|
-
var toCamelCase2 = (str) => {
|
|
2868
|
-
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
2869
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
2870
|
-
}).replaceAll(/\s+/g, "");
|
|
2871
|
-
};
|
|
2872
|
-
var toTitleCase = (str) => str && str.replace(
|
|
2873
|
-
/\w\S*/g,
|
|
2874
|
-
(txt) => {
|
|
2875
|
-
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
2876
|
-
}
|
|
2877
|
-
);
|
|
2878
|
-
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2879
|
-
var toDescriptionCase = (str = "") => {
|
|
2880
|
-
if (typeof str !== "string")
|
|
2881
|
-
return;
|
|
2882
|
-
const result = str.replace(/([A-Z])/g, " $1");
|
|
2883
|
-
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2884
|
-
};
|
|
2885
|
-
var arrayzeValue3 = (val) => {
|
|
2886
|
-
if ((0, import_utils26.isArray)(val))
|
|
2887
|
-
return val;
|
|
2888
|
-
if ((0, import_utils26.isString)(val))
|
|
2889
|
-
return val.split(" ");
|
|
2890
|
-
if ((0, import_utils26.isObject)(val))
|
|
2891
|
-
return Object.values(val);
|
|
2892
|
-
if ((0, import_utils26.isNumber)(val))
|
|
2893
|
-
return [val];
|
|
2894
|
-
};
|
|
2895
|
-
}
|
|
2896
|
-
});
|
|
2897
|
-
|
|
2898
1551
|
// src/set.js
|
|
2899
1552
|
var set_exports = {};
|
|
2900
1553
|
__export(set_exports, {
|
|
@@ -3113,161 +1766,1803 @@ var CONFIG = {
|
|
|
3113
1766
|
CSS_VARS,
|
|
3114
1767
|
...defaultConfig_exports
|
|
3115
1768
|
};
|
|
3116
|
-
var cachedConfig = (0, import_utils.deepClone)(CONFIG);
|
|
3117
|
-
var FACTORY = {
|
|
3118
|
-
active: "0",
|
|
3119
|
-
0: CONFIG
|
|
1769
|
+
var cachedConfig = (0, import_utils.deepClone)(CONFIG);
|
|
1770
|
+
var FACTORY = {
|
|
1771
|
+
active: "0",
|
|
1772
|
+
0: CONFIG
|
|
1773
|
+
};
|
|
1774
|
+
var getActiveConfig = (def) => {
|
|
1775
|
+
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
1776
|
+
};
|
|
1777
|
+
var setActiveConfig = (newConfig) => {
|
|
1778
|
+
if (!(0, import_utils.isObject)(newConfig))
|
|
1779
|
+
return;
|
|
1780
|
+
FACTORY.active = "1";
|
|
1781
|
+
FACTORY["1"] = (0, import_utils.deepMerge)(newConfig, (0, import_utils.deepClone)(cachedConfig));
|
|
1782
|
+
return newConfig;
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1785
|
+
// src/system/color.js
|
|
1786
|
+
var import_utils8 = __toESM(require_cjs(), 1);
|
|
1787
|
+
|
|
1788
|
+
// src/utils/unit.js
|
|
1789
|
+
var isScalingUnit = (unit) => {
|
|
1790
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
// src/utils/color.js
|
|
1794
|
+
var import_globals = __toESM(require_cjs2(), 1);
|
|
1795
|
+
var import_utils2 = __toESM(require_cjs(), 1);
|
|
1796
|
+
var colorStringToRgbaArray = (color) => {
|
|
1797
|
+
if (color === "")
|
|
1798
|
+
return [0, 0, 0, 0];
|
|
1799
|
+
if (color.toLowerCase() === "transparent")
|
|
1800
|
+
return [0, 0, 0, 0];
|
|
1801
|
+
if (color[0] === "#") {
|
|
1802
|
+
if (color.length < 7) {
|
|
1803
|
+
color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
|
|
1804
|
+
}
|
|
1805
|
+
return [
|
|
1806
|
+
parseInt(color.substr(1, 2), 16),
|
|
1807
|
+
parseInt(color.substr(3, 2), 16),
|
|
1808
|
+
parseInt(color.substr(5, 2), 16),
|
|
1809
|
+
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
1810
|
+
];
|
|
1811
|
+
}
|
|
1812
|
+
if (color.indexOf("rgb") === -1) {
|
|
1813
|
+
if (import_globals.document && import_globals.window) {
|
|
1814
|
+
const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
|
|
1815
|
+
const flag = "rgb(1, 2, 3)";
|
|
1816
|
+
elem.style.color = flag;
|
|
1817
|
+
if (elem.style.color !== flag) {
|
|
1818
|
+
import_globals.document.body.removeChild(elem);
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
elem.style.color = color;
|
|
1822
|
+
if (elem.style.color === flag || elem.style.color === "") {
|
|
1823
|
+
import_globals.document.body.removeChild(elem);
|
|
1824
|
+
return [0, 0, 0, 0];
|
|
1825
|
+
}
|
|
1826
|
+
color = import_globals.window.getComputedStyle(elem).color;
|
|
1827
|
+
import_globals.document.body.removeChild(elem);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
if (color.indexOf("rgb") === 0) {
|
|
1831
|
+
if (color.indexOf("rgba") === -1)
|
|
1832
|
+
color = `${color}, 1`;
|
|
1833
|
+
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
1834
|
+
}
|
|
1835
|
+
return [0, 0, 0, 0];
|
|
1836
|
+
};
|
|
1837
|
+
var hexToRgbArray = (hex, alpha = 1) => {
|
|
1838
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
1839
|
+
return [r, g, b];
|
|
1840
|
+
};
|
|
1841
|
+
var rgbArrayToHex = ([r, g, b]) => {
|
|
1842
|
+
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
1843
|
+
};
|
|
1844
|
+
var rgbToHSL = (r, g, b) => {
|
|
1845
|
+
const a = Math.max(r, g, b);
|
|
1846
|
+
const n = a - Math.min(r, g, b);
|
|
1847
|
+
const f = 1 - Math.abs(a + a - n - 1);
|
|
1848
|
+
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
1849
|
+
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
1850
|
+
};
|
|
1851
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
1852
|
+
Math.min(k - 3, 9 - k, 1),
|
|
1853
|
+
-1
|
|
1854
|
+
)) => [f(0), f(8), f(4)];
|
|
1855
|
+
var getColorShade = (col, amt) => {
|
|
1856
|
+
const num = parseInt(col, 16);
|
|
1857
|
+
let r = (num >> 16) + amt;
|
|
1858
|
+
if (r > 255)
|
|
1859
|
+
r = 255;
|
|
1860
|
+
else if (r < 0)
|
|
1861
|
+
r = 0;
|
|
1862
|
+
let b = (num >> 8 & 255) + amt;
|
|
1863
|
+
if (b > 255)
|
|
1864
|
+
b = 255;
|
|
1865
|
+
else if (b < 0)
|
|
1866
|
+
b = 0;
|
|
1867
|
+
let g = (num & 255) + amt;
|
|
1868
|
+
if (g > 255)
|
|
1869
|
+
g = 255;
|
|
1870
|
+
else if (g < 0)
|
|
1871
|
+
g = 0;
|
|
1872
|
+
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
1873
|
+
};
|
|
1874
|
+
var getRgbTone = (rgb, tone) => {
|
|
1875
|
+
if ((0, import_utils2.isString)(rgb) && rgb.includes("rgb"))
|
|
1876
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
1877
|
+
if ((0, import_utils2.isString)(rgb))
|
|
1878
|
+
rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
1879
|
+
if ((0, import_utils2.isNumber)(tone))
|
|
1880
|
+
tone += "";
|
|
1881
|
+
const toHex = rgbArrayToHex(rgb);
|
|
1882
|
+
const abs = tone.slice(0, 1);
|
|
1883
|
+
if (abs === "-" || abs === "+") {
|
|
1884
|
+
const colorShade = getColorShade(toHex, parseFloat(tone));
|
|
1885
|
+
return hexToRgbArray(colorShade).join(", ");
|
|
1886
|
+
} else {
|
|
1887
|
+
const [r, g, b] = rgb;
|
|
1888
|
+
const hsl = rgbToHSL(r, g, b);
|
|
1889
|
+
const [h, s, l] = hsl;
|
|
1890
|
+
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
1891
|
+
return newRgb;
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1895
|
+
// src/utils/font.js
|
|
1896
|
+
var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
1897
|
+
if (LIBRARY[key])
|
|
1898
|
+
return LIBRARY[key].value;
|
|
1899
|
+
if (LIBRARY.default)
|
|
1900
|
+
return LIBRARY[LIBRARY.default].value;
|
|
1901
|
+
const hasValue = Object.keys(LIBRARY)[0];
|
|
1902
|
+
return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
|
|
1903
|
+
};
|
|
1904
|
+
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
1905
|
+
var setCustomFont = (name, url, weight) => `
|
|
1906
|
+
font-family: '${name}';
|
|
1907
|
+
font-style: normal;
|
|
1908
|
+
${weight && `font-weight: ${weight};`}
|
|
1909
|
+
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
1910
|
+
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
1911
|
+
${setCustomFont(name, url, weight)}
|
|
1912
|
+
}`;
|
|
1913
|
+
var getFontFaceEach = (name, weights) => {
|
|
1914
|
+
const keys = Object.keys(weights);
|
|
1915
|
+
return keys.map((key) => {
|
|
1916
|
+
const { url, fontWeight } = weights[key];
|
|
1917
|
+
return setCustomFont(name, url, fontWeight);
|
|
1918
|
+
});
|
|
1919
|
+
};
|
|
1920
|
+
|
|
1921
|
+
// src/utils/sequence.js
|
|
1922
|
+
var import_utils4 = __toESM(require_cjs(), 1);
|
|
1923
|
+
|
|
1924
|
+
// ../utils/dist/cjs/index.js
|
|
1925
|
+
var __create2 = Object.create;
|
|
1926
|
+
var __defProp2 = Object.defineProperty;
|
|
1927
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1928
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1929
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1930
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1931
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
1932
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1933
|
+
};
|
|
1934
|
+
var __export2 = (target, all) => {
|
|
1935
|
+
for (var name in all)
|
|
1936
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1937
|
+
};
|
|
1938
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1939
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1940
|
+
for (let key of __getOwnPropNames2(from))
|
|
1941
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1942
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1943
|
+
}
|
|
1944
|
+
return to;
|
|
1945
|
+
};
|
|
1946
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1947
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
1948
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
1949
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1950
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1951
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1952
|
+
mod
|
|
1953
|
+
));
|
|
1954
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1955
|
+
var require_key2 = __commonJS2({
|
|
1956
|
+
"../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
|
|
1957
|
+
"use strict";
|
|
1958
|
+
var __defProp22 = Object.defineProperty;
|
|
1959
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1960
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1961
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1962
|
+
var __export22 = (target, all) => {
|
|
1963
|
+
for (var name in all)
|
|
1964
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1965
|
+
};
|
|
1966
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1967
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1968
|
+
for (let key of __getOwnPropNames22(from))
|
|
1969
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1970
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1971
|
+
}
|
|
1972
|
+
return to;
|
|
1973
|
+
};
|
|
1974
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1975
|
+
var key_exports = {};
|
|
1976
|
+
__export22(key_exports, {
|
|
1977
|
+
createSnapshotId: () => createSnapshotId,
|
|
1978
|
+
generateKey: () => generateKey
|
|
1979
|
+
});
|
|
1980
|
+
module2.exports = __toCommonJS22(key_exports);
|
|
1981
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
1982
|
+
let index = 0;
|
|
1983
|
+
function newId() {
|
|
1984
|
+
index++;
|
|
1985
|
+
return index;
|
|
1986
|
+
}
|
|
1987
|
+
return newId;
|
|
1988
|
+
}();
|
|
1989
|
+
var createSnapshotId = generateKey;
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
var require_env2 = __commonJS2({
|
|
1993
|
+
"../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
|
|
1994
|
+
"use strict";
|
|
1995
|
+
var __defProp22 = Object.defineProperty;
|
|
1996
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1997
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1998
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1999
|
+
var __export22 = (target, all) => {
|
|
2000
|
+
for (var name in all)
|
|
2001
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2002
|
+
};
|
|
2003
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2004
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2005
|
+
for (let key of __getOwnPropNames22(from))
|
|
2006
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2007
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2008
|
+
}
|
|
2009
|
+
return to;
|
|
2010
|
+
};
|
|
2011
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2012
|
+
var env_exports = {};
|
|
2013
|
+
__export22(env_exports, {
|
|
2014
|
+
NODE_ENV: () => NODE_ENV,
|
|
2015
|
+
getNev: () => getNev,
|
|
2016
|
+
isDevelopment: () => isDevelopment,
|
|
2017
|
+
isProduction: () => isProduction,
|
|
2018
|
+
isTest: () => isTest
|
|
2019
|
+
});
|
|
2020
|
+
module2.exports = __toCommonJS22(env_exports);
|
|
2021
|
+
var NODE_ENV = "development";
|
|
2022
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
2023
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
2024
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
2025
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
var require_globals2 = __commonJS2({
|
|
2029
|
+
"../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
|
|
2030
|
+
"use strict";
|
|
2031
|
+
var __defProp22 = Object.defineProperty;
|
|
2032
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2033
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2034
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2035
|
+
var __export22 = (target, all) => {
|
|
2036
|
+
for (var name in all)
|
|
2037
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2038
|
+
};
|
|
2039
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2040
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2041
|
+
for (let key of __getOwnPropNames22(from))
|
|
2042
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2043
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2044
|
+
}
|
|
2045
|
+
return to;
|
|
2046
|
+
};
|
|
2047
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2048
|
+
var globals_exports = {};
|
|
2049
|
+
__export22(globals_exports, {
|
|
2050
|
+
document: () => document22,
|
|
2051
|
+
global: () => global,
|
|
2052
|
+
self: () => self,
|
|
2053
|
+
window: () => window2
|
|
2054
|
+
});
|
|
2055
|
+
module2.exports = __toCommonJS22(globals_exports);
|
|
2056
|
+
var global = globalThis;
|
|
2057
|
+
var self = globalThis;
|
|
2058
|
+
var window2 = globalThis;
|
|
2059
|
+
var document22 = window2.document;
|
|
2060
|
+
}
|
|
2061
|
+
});
|
|
2062
|
+
var require_node2 = __commonJS2({
|
|
2063
|
+
"../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
|
|
2064
|
+
"use strict";
|
|
2065
|
+
var __defProp22 = Object.defineProperty;
|
|
2066
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2067
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2068
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2069
|
+
var __export22 = (target, all) => {
|
|
2070
|
+
for (var name in all)
|
|
2071
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2072
|
+
};
|
|
2073
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2074
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2075
|
+
for (let key of __getOwnPropNames22(from))
|
|
2076
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2077
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2078
|
+
}
|
|
2079
|
+
return to;
|
|
2080
|
+
};
|
|
2081
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2082
|
+
var node_exports = {};
|
|
2083
|
+
__export22(node_exports, {
|
|
2084
|
+
isHtmlElement: () => isHtmlElement,
|
|
2085
|
+
isNode: () => isNode
|
|
2086
|
+
});
|
|
2087
|
+
module2.exports = __toCommonJS22(node_exports);
|
|
2088
|
+
var import_globals3 = require_globals2();
|
|
2089
|
+
var isNode = (obj) => {
|
|
2090
|
+
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
2091
|
+
};
|
|
2092
|
+
var isHtmlElement = (obj) => {
|
|
2093
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2096
|
+
});
|
|
2097
|
+
var require_types2 = __commonJS2({
|
|
2098
|
+
"../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
|
|
2099
|
+
"use strict";
|
|
2100
|
+
var __defProp22 = Object.defineProperty;
|
|
2101
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2102
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2103
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2104
|
+
var __export22 = (target, all) => {
|
|
2105
|
+
for (var name in all)
|
|
2106
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2107
|
+
};
|
|
2108
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2109
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2110
|
+
for (let key of __getOwnPropNames22(from))
|
|
2111
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2112
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2113
|
+
}
|
|
2114
|
+
return to;
|
|
2115
|
+
};
|
|
2116
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2117
|
+
var types_exports = {};
|
|
2118
|
+
__export22(types_exports, {
|
|
2119
|
+
TYPES: () => TYPES,
|
|
2120
|
+
is: () => is,
|
|
2121
|
+
isArray: () => isArray32,
|
|
2122
|
+
isBoolean: () => isBoolean,
|
|
2123
|
+
isDate: () => isDate,
|
|
2124
|
+
isDefined: () => isDefined2,
|
|
2125
|
+
isFunction: () => isFunction2,
|
|
2126
|
+
isNot: () => isNot,
|
|
2127
|
+
isNull: () => isNull,
|
|
2128
|
+
isNumber: () => isNumber2,
|
|
2129
|
+
isObject: () => isObject32,
|
|
2130
|
+
isObjectLike: () => isObjectLike3,
|
|
2131
|
+
isString: () => isString22,
|
|
2132
|
+
isUndefined: () => isUndefined
|
|
2133
|
+
});
|
|
2134
|
+
module2.exports = __toCommonJS22(types_exports);
|
|
2135
|
+
var import_node = require_node2();
|
|
2136
|
+
var isObject32 = (arg) => {
|
|
2137
|
+
if (arg === null)
|
|
2138
|
+
return false;
|
|
2139
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
2140
|
+
};
|
|
2141
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
2142
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
2143
|
+
var isFunction2 = (arg) => typeof arg === "function";
|
|
2144
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
2145
|
+
var isNull = (arg) => arg === null;
|
|
2146
|
+
var isArray32 = (arg) => Array.isArray(arg);
|
|
2147
|
+
var isDate = (d) => d instanceof Date;
|
|
2148
|
+
var isObjectLike3 = (arg) => {
|
|
2149
|
+
if (arg === null)
|
|
2150
|
+
return false;
|
|
2151
|
+
return typeof arg === "object";
|
|
2152
|
+
};
|
|
2153
|
+
var isDefined2 = (arg) => {
|
|
2154
|
+
return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction2(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
2155
|
+
};
|
|
2156
|
+
var isUndefined = (arg) => {
|
|
2157
|
+
return arg === void 0;
|
|
2158
|
+
};
|
|
2159
|
+
var TYPES = {
|
|
2160
|
+
boolean: isBoolean,
|
|
2161
|
+
array: isArray32,
|
|
2162
|
+
object: isObject32,
|
|
2163
|
+
string: isString22,
|
|
2164
|
+
date: isDate,
|
|
2165
|
+
number: isNumber2,
|
|
2166
|
+
null: isNull,
|
|
2167
|
+
function: isFunction2,
|
|
2168
|
+
objectLike: isObjectLike3,
|
|
2169
|
+
node: import_node.isNode,
|
|
2170
|
+
htmlElement: import_node.isHtmlElement,
|
|
2171
|
+
defined: isDefined2
|
|
2172
|
+
};
|
|
2173
|
+
var is = (arg) => {
|
|
2174
|
+
return (...args) => {
|
|
2175
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
2176
|
+
};
|
|
2177
|
+
};
|
|
2178
|
+
var isNot = (arg) => {
|
|
2179
|
+
return (...args) => {
|
|
2180
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
2181
|
+
};
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
2185
|
+
var require_array2 = __commonJS2({
|
|
2186
|
+
"../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
|
|
2187
|
+
"use strict";
|
|
2188
|
+
var __defProp22 = Object.defineProperty;
|
|
2189
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2190
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2191
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2192
|
+
var __export22 = (target, all) => {
|
|
2193
|
+
for (var name in all)
|
|
2194
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2195
|
+
};
|
|
2196
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2197
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2198
|
+
for (let key of __getOwnPropNames22(from))
|
|
2199
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2200
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2201
|
+
}
|
|
2202
|
+
return to;
|
|
2203
|
+
};
|
|
2204
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2205
|
+
var array_exports = {};
|
|
2206
|
+
__export22(array_exports, {
|
|
2207
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2208
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2209
|
+
arraysEqual: () => arraysEqual,
|
|
2210
|
+
createNestedObject: () => createNestedObject,
|
|
2211
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2212
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2213
|
+
getFrequencyInArray: () => getFrequencyInArray,
|
|
2214
|
+
joinArrays: () => joinArrays,
|
|
2215
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
2216
|
+
mergeArray: () => mergeArray,
|
|
2217
|
+
removeFromArray: () => removeFromArray,
|
|
2218
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
2219
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
2220
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
2221
|
+
swapItemsInArray: () => swapItemsInArray
|
|
2222
|
+
});
|
|
2223
|
+
module2.exports = __toCommonJS22(array_exports);
|
|
2224
|
+
var import_object = require_object2();
|
|
2225
|
+
var import_types = require_types2();
|
|
2226
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
2227
|
+
return arr2.every((val) => arr1.includes(val));
|
|
2228
|
+
};
|
|
2229
|
+
var getFrequencyInArray = (arr, value) => {
|
|
2230
|
+
return arr.reduce((count, currentValue) => {
|
|
2231
|
+
return currentValue === value ? count + 1 : count;
|
|
2232
|
+
}, 0);
|
|
2233
|
+
};
|
|
2234
|
+
var removeFromArray = (arr, index) => {
|
|
2235
|
+
if ((0, import_types.isString)(index))
|
|
2236
|
+
index = parseInt(index);
|
|
2237
|
+
if ((0, import_types.isNumber)(index)) {
|
|
2238
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
2239
|
+
throw new Error("Invalid index");
|
|
2240
|
+
}
|
|
2241
|
+
arr.splice(index, 1);
|
|
2242
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
2243
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
2244
|
+
} else {
|
|
2245
|
+
throw new Error("Invalid index");
|
|
2246
|
+
}
|
|
2247
|
+
return arr;
|
|
2248
|
+
};
|
|
2249
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
2250
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
2251
|
+
};
|
|
2252
|
+
var joinArrays = (...arrays) => {
|
|
2253
|
+
return [].concat(...arrays);
|
|
2254
|
+
};
|
|
2255
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
2256
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
2257
|
+
};
|
|
2258
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
2259
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2260
|
+
};
|
|
2261
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
2262
|
+
const index = arr.indexOf(value);
|
|
2263
|
+
if (index !== -1) {
|
|
2264
|
+
return arr.slice(0, index);
|
|
2265
|
+
}
|
|
2266
|
+
return arr;
|
|
2267
|
+
};
|
|
2268
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
2269
|
+
if (!(0, import_types.isArray)(arr))
|
|
2270
|
+
return;
|
|
2271
|
+
const index = arr.indexOf(value);
|
|
2272
|
+
if (index !== -1) {
|
|
2273
|
+
return arr.slice(index + 1);
|
|
2274
|
+
}
|
|
2275
|
+
return arr;
|
|
2276
|
+
};
|
|
2277
|
+
var createNestedObject = (arr, lastValue) => {
|
|
2278
|
+
const nestedObject = {};
|
|
2279
|
+
if (arr.length === 0) {
|
|
2280
|
+
return lastValue;
|
|
2281
|
+
}
|
|
2282
|
+
arr.reduce((obj, value, index) => {
|
|
2283
|
+
if (!obj[value]) {
|
|
2284
|
+
obj[value] = {};
|
|
2285
|
+
}
|
|
2286
|
+
if (index === arr.length - 1 && lastValue) {
|
|
2287
|
+
obj[value] = lastValue;
|
|
2288
|
+
}
|
|
2289
|
+
return obj[value];
|
|
2290
|
+
}, nestedObject);
|
|
2291
|
+
return nestedObject;
|
|
2292
|
+
};
|
|
2293
|
+
var removeValueFromArray = (arr, value) => {
|
|
2294
|
+
const index = arr.indexOf(value);
|
|
2295
|
+
if (index > -1) {
|
|
2296
|
+
const newArray = [...arr];
|
|
2297
|
+
newArray.splice(index, 1);
|
|
2298
|
+
return newArray;
|
|
2299
|
+
}
|
|
2300
|
+
return arr;
|
|
2301
|
+
};
|
|
2302
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
2303
|
+
return arr.filter((item) => item !== value);
|
|
2304
|
+
};
|
|
2305
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
2306
|
+
const result = [];
|
|
2307
|
+
for (let i = 0; i < array.length; i++) {
|
|
2308
|
+
result.push(array[i]);
|
|
2309
|
+
if (i < array.length - 1) {
|
|
2310
|
+
result.push(item);
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
return result;
|
|
2314
|
+
};
|
|
2315
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
2316
|
+
const newArray = [...array];
|
|
2317
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
2318
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
2319
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
2320
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
2321
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
2322
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
2323
|
+
}
|
|
2324
|
+
return newArray;
|
|
2325
|
+
};
|
|
2326
|
+
var arraysEqual = (arr1, arr2) => {
|
|
2327
|
+
if (arr1.length !== arr2.length) {
|
|
2328
|
+
return false;
|
|
2329
|
+
}
|
|
2330
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
2331
|
+
if (arr1[i] !== arr2[i]) {
|
|
2332
|
+
return false;
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
return true;
|
|
2336
|
+
};
|
|
2337
|
+
}
|
|
2338
|
+
});
|
|
2339
|
+
var require_string2 = __commonJS2({
|
|
2340
|
+
"../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
|
|
2341
|
+
"use strict";
|
|
2342
|
+
var __defProp22 = Object.defineProperty;
|
|
2343
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2344
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2345
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2346
|
+
var __export22 = (target, all) => {
|
|
2347
|
+
for (var name in all)
|
|
2348
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2349
|
+
};
|
|
2350
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2351
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2352
|
+
for (let key of __getOwnPropNames22(from))
|
|
2353
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2354
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2355
|
+
}
|
|
2356
|
+
return to;
|
|
2357
|
+
};
|
|
2358
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2359
|
+
var string_exports = {};
|
|
2360
|
+
__export22(string_exports, {
|
|
2361
|
+
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
2362
|
+
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
2363
|
+
findKeyPosition: () => findKeyPosition,
|
|
2364
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
2365
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
2366
|
+
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
2367
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
2368
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
2369
|
+
});
|
|
2370
|
+
module2.exports = __toCommonJS22(string_exports);
|
|
2371
|
+
var stringIncludesAny = (str, characters) => {
|
|
2372
|
+
for (const char of characters) {
|
|
2373
|
+
if (str.includes(char)) {
|
|
2374
|
+
return true;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
return false;
|
|
2378
|
+
};
|
|
2379
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
2380
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
2381
|
+
return str.replace(pattern, "");
|
|
2382
|
+
};
|
|
2383
|
+
var brackRegex = {
|
|
2384
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2385
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2386
|
+
};
|
|
2387
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
2388
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2389
|
+
return str;
|
|
2390
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
2391
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
2392
|
+
if (parentPath) {
|
|
2393
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2394
|
+
let parentState = state;
|
|
2395
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
2396
|
+
parentState = parentState.parent;
|
|
2397
|
+
if (!parentState) {
|
|
2398
|
+
return "";
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
const value = parentState[variable.trim()];
|
|
2402
|
+
return value !== void 0 ? `${value}` : "";
|
|
2403
|
+
} else {
|
|
2404
|
+
const value = state[variable.trim()];
|
|
2405
|
+
return value !== void 0 ? `${value}` : "";
|
|
2406
|
+
}
|
|
2407
|
+
});
|
|
2408
|
+
};
|
|
2409
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
2410
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2411
|
+
};
|
|
2412
|
+
var findKeyPosition = (str, key) => {
|
|
2413
|
+
const lines = str.split("\n");
|
|
2414
|
+
let startLineNumber = -1;
|
|
2415
|
+
let endLineNumber = -1;
|
|
2416
|
+
let startColumn = -1;
|
|
2417
|
+
let endColumn = -1;
|
|
2418
|
+
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
2419
|
+
let braceCount = 0;
|
|
2420
|
+
let foundKey = false;
|
|
2421
|
+
for (let i = 0; i < lines.length; i++) {
|
|
2422
|
+
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
2423
|
+
foundKey = true;
|
|
2424
|
+
startLineNumber = i + 1;
|
|
2425
|
+
startColumn = lines[i].indexOf(key) + 1;
|
|
2426
|
+
if (lines[i].includes("{}")) {
|
|
2427
|
+
endLineNumber = startLineNumber;
|
|
2428
|
+
endColumn = lines[i].indexOf("{}") + 3;
|
|
2429
|
+
break;
|
|
2430
|
+
}
|
|
2431
|
+
const line = lines[i].slice(startColumn + key.length);
|
|
2432
|
+
if (line.includes("{") || line.includes("[")) {
|
|
2433
|
+
braceCount = 1;
|
|
2434
|
+
} else {
|
|
2435
|
+
endLineNumber = i + 1;
|
|
2436
|
+
endColumn = lines[i].length + 1;
|
|
2437
|
+
break;
|
|
2438
|
+
}
|
|
2439
|
+
} else if (foundKey) {
|
|
2440
|
+
braceCount += (lines[i].match(/{/g) || []).length;
|
|
2441
|
+
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
2442
|
+
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
2443
|
+
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
2444
|
+
if (braceCount === 0) {
|
|
2445
|
+
endLineNumber = i + 1;
|
|
2446
|
+
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
2447
|
+
break;
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
return {
|
|
2452
|
+
startColumn,
|
|
2453
|
+
endColumn,
|
|
2454
|
+
startLineNumber,
|
|
2455
|
+
endLineNumber
|
|
2456
|
+
};
|
|
2457
|
+
};
|
|
2458
|
+
var replaceOctalEscapeSequences = (str) => {
|
|
2459
|
+
const octalRegex = /\\([0-7]{1,3})/g;
|
|
2460
|
+
return str.replace(octalRegex, (match, p1) => {
|
|
2461
|
+
const octalValue = parseInt(p1, 8);
|
|
2462
|
+
const char = String.fromCharCode(octalValue);
|
|
2463
|
+
return char;
|
|
2464
|
+
});
|
|
2465
|
+
};
|
|
2466
|
+
var customEncodeURIComponent = (str) => {
|
|
2467
|
+
return str.split("").map((char) => {
|
|
2468
|
+
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
2469
|
+
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
2470
|
+
}
|
|
2471
|
+
return char;
|
|
2472
|
+
}).join("");
|
|
2473
|
+
};
|
|
2474
|
+
var customDecodeURIComponent = (encodedStr) => {
|
|
2475
|
+
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
2476
|
+
};
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
var require_object2 = __commonJS2({
|
|
2480
|
+
"../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
2481
|
+
"use strict";
|
|
2482
|
+
var __defProp22 = Object.defineProperty;
|
|
2483
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2484
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2485
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2486
|
+
var __export22 = (target, all) => {
|
|
2487
|
+
for (var name in all)
|
|
2488
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2489
|
+
};
|
|
2490
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2491
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2492
|
+
for (let key of __getOwnPropNames22(from))
|
|
2493
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2494
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2495
|
+
}
|
|
2496
|
+
return to;
|
|
2497
|
+
};
|
|
2498
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2499
|
+
var object_exports = {};
|
|
2500
|
+
__export22(object_exports, {
|
|
2501
|
+
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
2502
|
+
clone: () => clone,
|
|
2503
|
+
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2504
|
+
deepClone: () => deepClone2,
|
|
2505
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
2506
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2507
|
+
deepContains: () => deepContains,
|
|
2508
|
+
deepDestringify: () => deepDestringify,
|
|
2509
|
+
deepDiff: () => deepDiff,
|
|
2510
|
+
deepMerge: () => deepMerge3,
|
|
2511
|
+
deepStringify: () => deepStringify,
|
|
2512
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
2513
|
+
diff: () => diff,
|
|
2514
|
+
diffArrays: () => diffArrays,
|
|
2515
|
+
diffObjects: () => diffObjects,
|
|
2516
|
+
exec: () => exec,
|
|
2517
|
+
flattenRecursive: () => flattenRecursive,
|
|
2518
|
+
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
2519
|
+
getExtendsInElement: () => getExtendsInElement,
|
|
2520
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
2521
|
+
isEmpty: () => isEmpty,
|
|
2522
|
+
isEmptyObject: () => isEmptyObject,
|
|
2523
|
+
isEqualDeep: () => isEqualDeep,
|
|
2524
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
2525
|
+
map: () => map,
|
|
2526
|
+
merge: () => merge5,
|
|
2527
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
2528
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
2529
|
+
objectToString: () => objectToString,
|
|
2530
|
+
overwrite: () => overwrite,
|
|
2531
|
+
overwriteDeep: () => overwriteDeep2,
|
|
2532
|
+
overwriteShallow: () => overwriteShallow,
|
|
2533
|
+
removeFromObject: () => removeFromObject,
|
|
2534
|
+
stringToObject: () => stringToObject
|
|
2535
|
+
});
|
|
2536
|
+
module2.exports = __toCommonJS22(object_exports);
|
|
2537
|
+
var import_globals3 = require_globals2();
|
|
2538
|
+
var import_types = require_types2();
|
|
2539
|
+
var import_array = require_array2();
|
|
2540
|
+
var import_string = require_string2();
|
|
2541
|
+
var exec = (param, element, state, context) => {
|
|
2542
|
+
if ((0, import_types.isFunction)(param)) {
|
|
2543
|
+
return param(
|
|
2544
|
+
element,
|
|
2545
|
+
state || element.state,
|
|
2546
|
+
context || element.context
|
|
2547
|
+
);
|
|
2548
|
+
}
|
|
2549
|
+
return param;
|
|
2550
|
+
};
|
|
2551
|
+
var map = (obj, extention, element) => {
|
|
2552
|
+
for (const e in extention) {
|
|
2553
|
+
obj[e] = exec(extention[e], element);
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
var merge5 = (element, obj, excludeFrom = []) => {
|
|
2557
|
+
for (const e in obj) {
|
|
2558
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
2559
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2560
|
+
continue;
|
|
2561
|
+
const elementProp = element[e];
|
|
2562
|
+
const objProp = obj[e];
|
|
2563
|
+
if (elementProp === void 0) {
|
|
2564
|
+
element[e] = objProp;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
return element;
|
|
2568
|
+
};
|
|
2569
|
+
var deepMerge3 = (element, extend, excludeFrom = []) => {
|
|
2570
|
+
for (const e in extend) {
|
|
2571
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
2572
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2573
|
+
continue;
|
|
2574
|
+
const elementProp = element[e];
|
|
2575
|
+
const extendProp = extend[e];
|
|
2576
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
2577
|
+
deepMerge3(elementProp, extendProp, excludeFrom);
|
|
2578
|
+
} else if (elementProp === void 0) {
|
|
2579
|
+
element[e] = extendProp;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
return element;
|
|
2583
|
+
};
|
|
2584
|
+
var clone = (obj, excludeFrom = []) => {
|
|
2585
|
+
const o = {};
|
|
2586
|
+
for (const prop in obj) {
|
|
2587
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2588
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2589
|
+
continue;
|
|
2590
|
+
o[prop] = obj[prop];
|
|
2591
|
+
}
|
|
2592
|
+
return o;
|
|
2593
|
+
};
|
|
2594
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
2595
|
+
if ((0, import_types.isArray)(obj)) {
|
|
2596
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2597
|
+
}
|
|
2598
|
+
const o = {};
|
|
2599
|
+
for (const k in obj) {
|
|
2600
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2601
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2602
|
+
continue;
|
|
2603
|
+
let v = obj[k];
|
|
2604
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2605
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
2606
|
+
}
|
|
2607
|
+
if ((0, import_types.isArray)(v)) {
|
|
2608
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2609
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
2610
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2611
|
+
} else
|
|
2612
|
+
o[k] = v;
|
|
2613
|
+
}
|
|
2614
|
+
return o;
|
|
2615
|
+
};
|
|
2616
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
2617
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
2618
|
+
};
|
|
2619
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
2620
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2621
|
+
for (const prop in obj) {
|
|
2622
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2623
|
+
continue;
|
|
2624
|
+
if (prop === "__proto__")
|
|
2625
|
+
continue;
|
|
2626
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2627
|
+
continue;
|
|
2628
|
+
let objProp = obj[prop];
|
|
2629
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
2630
|
+
continue;
|
|
2631
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
2632
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
2633
|
+
}
|
|
2634
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2635
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
2636
|
+
} else
|
|
2637
|
+
o[prop] = objProp;
|
|
2638
|
+
}
|
|
2639
|
+
return o;
|
|
2640
|
+
};
|
|
2641
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2642
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2643
|
+
for (const prop in obj) {
|
|
2644
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2645
|
+
continue;
|
|
2646
|
+
const objProp = obj[prop];
|
|
2647
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2648
|
+
continue;
|
|
2649
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2650
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2651
|
+
} else
|
|
2652
|
+
o[prop] = objProp;
|
|
2653
|
+
}
|
|
2654
|
+
return o;
|
|
2655
|
+
};
|
|
2656
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
2657
|
+
for (const prop in obj) {
|
|
2658
|
+
const objProp = obj[prop];
|
|
2659
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
2660
|
+
stringified[prop] = objProp.toString();
|
|
2661
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2662
|
+
stringified[prop] = {};
|
|
2663
|
+
deepStringify(objProp, stringified[prop]);
|
|
2664
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2665
|
+
stringified[prop] = [];
|
|
2666
|
+
objProp.forEach((v, i) => {
|
|
2667
|
+
if ((0, import_types.isObject)(v)) {
|
|
2668
|
+
stringified[prop][i] = {};
|
|
2669
|
+
deepStringify(v, stringified[prop][i]);
|
|
2670
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
2671
|
+
stringified[prop][i] = v.toString();
|
|
2672
|
+
} else {
|
|
2673
|
+
stringified[prop][i] = v;
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2676
|
+
} else {
|
|
2677
|
+
stringified[prop] = objProp;
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
return stringified;
|
|
2681
|
+
};
|
|
2682
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
2683
|
+
const spaces = " ".repeat(indent);
|
|
2684
|
+
let str = "{\n";
|
|
2685
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2686
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2687
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2688
|
+
str += `${spaces} ${stringedKey}: `;
|
|
2689
|
+
if ((0, import_types.isArray)(value)) {
|
|
2690
|
+
str += "[\n";
|
|
2691
|
+
for (const element of value) {
|
|
2692
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2693
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2694
|
+
`;
|
|
2695
|
+
} else if ((0, import_types.isString)(element)) {
|
|
2696
|
+
str += `${spaces} '${element}',
|
|
2697
|
+
`;
|
|
2698
|
+
} else {
|
|
2699
|
+
str += `${spaces} ${element},
|
|
2700
|
+
`;
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
str += `${spaces} ]`;
|
|
2704
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2705
|
+
str += objectToString(value, indent + 1);
|
|
2706
|
+
} else if ((0, import_types.isString)(value)) {
|
|
2707
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2708
|
+
} else {
|
|
2709
|
+
str += value;
|
|
2710
|
+
}
|
|
2711
|
+
str += ",\n";
|
|
2712
|
+
}
|
|
2713
|
+
str += `${spaces}}`;
|
|
2714
|
+
return str;
|
|
2715
|
+
};
|
|
2716
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2717
|
+
for (const prop in obj) {
|
|
2718
|
+
const objProp = obj[prop];
|
|
2719
|
+
if ((0, import_types.isFunction)(objProp))
|
|
2720
|
+
continue;
|
|
2721
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
2722
|
+
detached[prop] = {};
|
|
2723
|
+
deepStringify(objProp, detached[prop]);
|
|
2724
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2725
|
+
detached[prop] = [];
|
|
2726
|
+
objProp.forEach((v, i) => {
|
|
2727
|
+
if ((0, import_types.isFunction)(v))
|
|
2728
|
+
return;
|
|
2729
|
+
if ((0, import_types.isObject)(v)) {
|
|
2730
|
+
detached[prop][i] = {};
|
|
2731
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2732
|
+
} else {
|
|
2733
|
+
detached[prop][i] = v;
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
} else {
|
|
2737
|
+
detached[prop] = objProp;
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
return detached;
|
|
2741
|
+
};
|
|
2742
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
2743
|
+
for (const prop in obj) {
|
|
2744
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2745
|
+
if (!hasOwnProperty2)
|
|
2746
|
+
continue;
|
|
2747
|
+
const objProp = obj[prop];
|
|
2748
|
+
if ((0, import_types.isString)(objProp)) {
|
|
2749
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2750
|
+
try {
|
|
2751
|
+
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2752
|
+
destringified[prop] = evalProp;
|
|
2753
|
+
} catch (e) {
|
|
2754
|
+
if (e)
|
|
2755
|
+
destringified[prop] = objProp;
|
|
2756
|
+
}
|
|
2757
|
+
} else {
|
|
2758
|
+
destringified[prop] = objProp;
|
|
2759
|
+
}
|
|
2760
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2761
|
+
destringified[prop] = [];
|
|
2762
|
+
objProp.forEach((arrProp) => {
|
|
2763
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
2764
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2765
|
+
try {
|
|
2766
|
+
const evalProp = import_globals3.window.eval(`(${arrProp})`);
|
|
2767
|
+
destringified[prop].push(evalProp);
|
|
2768
|
+
} catch (e) {
|
|
2769
|
+
if (e)
|
|
2770
|
+
destringified[prop].push(arrProp);
|
|
2771
|
+
}
|
|
2772
|
+
} else {
|
|
2773
|
+
destringified[prop].push(arrProp);
|
|
2774
|
+
}
|
|
2775
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2776
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
2777
|
+
} else {
|
|
2778
|
+
destringified[prop].push(arrProp);
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2782
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2783
|
+
} else {
|
|
2784
|
+
destringified[prop] = objProp;
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
return destringified;
|
|
2788
|
+
};
|
|
2789
|
+
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2790
|
+
try {
|
|
2791
|
+
return import_globals3.window.eval("(" + str + ")");
|
|
2792
|
+
} catch (e) {
|
|
2793
|
+
if (opts.verbose)
|
|
2794
|
+
console.warn(e);
|
|
2795
|
+
}
|
|
2796
|
+
};
|
|
2797
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
2798
|
+
for (const e in objToDiff) {
|
|
2799
|
+
if (e === "ref")
|
|
2800
|
+
continue;
|
|
2801
|
+
const originalProp = original[e];
|
|
2802
|
+
const objToDiffProp = objToDiff[e];
|
|
2803
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2804
|
+
cache[e] = {};
|
|
2805
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
2806
|
+
} else if (objToDiffProp !== void 0) {
|
|
2807
|
+
cache[e] = objToDiffProp;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
return cache;
|
|
2811
|
+
};
|
|
2812
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
2813
|
+
if (original.length !== objToDiff.length) {
|
|
2814
|
+
cache = objToDiff;
|
|
2815
|
+
} else {
|
|
2816
|
+
const diffArr = [];
|
|
2817
|
+
for (let i = 0; i < original.length; i++) {
|
|
2818
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
2819
|
+
if (Object.keys(diffObj).length > 0) {
|
|
2820
|
+
diffArr.push(diffObj);
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
if (diffArr.length > 0) {
|
|
2824
|
+
cache = diffArr;
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
return cache;
|
|
2828
|
+
};
|
|
2829
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
2830
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2831
|
+
cache = [];
|
|
2832
|
+
diffArrays(original, objToDiff, cache);
|
|
2833
|
+
} else {
|
|
2834
|
+
diffObjects(original, objToDiff, cache);
|
|
2835
|
+
}
|
|
2836
|
+
return cache;
|
|
2837
|
+
};
|
|
2838
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2839
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2840
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2841
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2842
|
+
var deepDiff = (lhs, rhs) => {
|
|
2843
|
+
if (lhs === rhs)
|
|
2844
|
+
return {};
|
|
2845
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2846
|
+
return rhs;
|
|
2847
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2848
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
2849
|
+
acc[key] = void 0;
|
|
2850
|
+
}
|
|
2851
|
+
return acc;
|
|
2852
|
+
}, makeObjectWithoutPrototype());
|
|
2853
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2854
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
2855
|
+
return {};
|
|
2856
|
+
return rhs;
|
|
2857
|
+
}
|
|
2858
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
2859
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
2860
|
+
acc[key] = rhs[key];
|
|
2861
|
+
return acc;
|
|
2862
|
+
}
|
|
2863
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
2864
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2865
|
+
return acc;
|
|
2866
|
+
}
|
|
2867
|
+
acc[key] = difference;
|
|
2868
|
+
return acc;
|
|
2869
|
+
}, deletedValues);
|
|
2870
|
+
};
|
|
2871
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
2872
|
+
const { ref } = element;
|
|
2873
|
+
const changes = {};
|
|
2874
|
+
for (const e in params) {
|
|
2875
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2876
|
+
continue;
|
|
2877
|
+
const elementProp = element[e];
|
|
2878
|
+
const paramsProp = params[e];
|
|
2879
|
+
if (paramsProp) {
|
|
2880
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
2881
|
+
ref[e] = paramsProp;
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
return changes;
|
|
2885
|
+
};
|
|
2886
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2887
|
+
for (const e in params) {
|
|
2888
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2889
|
+
continue;
|
|
2890
|
+
obj[e] = params[e];
|
|
2891
|
+
}
|
|
2892
|
+
return obj;
|
|
2893
|
+
};
|
|
2894
|
+
var overwriteDeep2 = (obj, params, excludeFrom = []) => {
|
|
2895
|
+
for (const e in params) {
|
|
2896
|
+
if (e === "__proto__")
|
|
2897
|
+
continue;
|
|
2898
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2899
|
+
continue;
|
|
2900
|
+
const objProp = obj[e];
|
|
2901
|
+
const paramsProp = params[e];
|
|
2902
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2903
|
+
overwriteDeep2(objProp, paramsProp);
|
|
2904
|
+
} else if (paramsProp !== void 0) {
|
|
2905
|
+
obj[e] = paramsProp;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
return obj;
|
|
2909
|
+
};
|
|
2910
|
+
var mergeIfExisted = (a, b) => {
|
|
2911
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2912
|
+
return deepMerge3(a, b);
|
|
2913
|
+
return a || b;
|
|
2914
|
+
};
|
|
2915
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
2916
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2917
|
+
stack.push(objectized);
|
|
2918
|
+
const extendOfExtend = objectized[prop];
|
|
2919
|
+
if (extendOfExtend)
|
|
2920
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
2921
|
+
delete objectized[prop];
|
|
2922
|
+
return stack;
|
|
2923
|
+
};
|
|
2924
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2925
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2926
|
+
return param === element;
|
|
2927
|
+
}
|
|
2928
|
+
if (visited.has(param) || visited.has(element)) {
|
|
2929
|
+
return true;
|
|
2930
|
+
}
|
|
2931
|
+
visited.add(param);
|
|
2932
|
+
visited.add(element);
|
|
2933
|
+
const keysParam = Object.keys(param);
|
|
2934
|
+
const keysElement = Object.keys(element);
|
|
2935
|
+
if (keysParam.length !== keysElement.length) {
|
|
2936
|
+
return false;
|
|
2937
|
+
}
|
|
2938
|
+
for (const key of keysParam) {
|
|
2939
|
+
if (!keysElement.includes(key)) {
|
|
2940
|
+
return false;
|
|
2941
|
+
}
|
|
2942
|
+
const paramProp = param[key];
|
|
2943
|
+
const elementProp = element[key];
|
|
2944
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2945
|
+
return false;
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
return true;
|
|
2949
|
+
};
|
|
2950
|
+
var deepContains = (obj1, obj2) => {
|
|
2951
|
+
if (typeof obj1 !== typeof obj2) {
|
|
2952
|
+
return false;
|
|
2953
|
+
}
|
|
2954
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2955
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2956
|
+
if (obj1.length !== obj2.length) {
|
|
2957
|
+
return false;
|
|
2958
|
+
}
|
|
2959
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
2960
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
2961
|
+
return false;
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2965
|
+
for (const key in obj1) {
|
|
2966
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2967
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2968
|
+
return false;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
} else {
|
|
2973
|
+
return obj2 === obj1;
|
|
2974
|
+
}
|
|
2975
|
+
return true;
|
|
2976
|
+
};
|
|
2977
|
+
var removeFromObject = (obj, props) => {
|
|
2978
|
+
if (props === void 0 || props === null)
|
|
2979
|
+
return obj;
|
|
2980
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
2981
|
+
delete obj[props];
|
|
2982
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
2983
|
+
props.forEach((prop) => delete obj[prop]);
|
|
2984
|
+
} else {
|
|
2985
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2986
|
+
}
|
|
2987
|
+
return obj;
|
|
2988
|
+
};
|
|
2989
|
+
var createObjectWithoutPrototype = (obj) => {
|
|
2990
|
+
if (obj === null || typeof obj !== "object") {
|
|
2991
|
+
return obj;
|
|
2992
|
+
}
|
|
2993
|
+
const newObj = /* @__PURE__ */ Object.create(null);
|
|
2994
|
+
for (const key in obj) {
|
|
2995
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2996
|
+
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
return newObj;
|
|
3000
|
+
};
|
|
3001
|
+
var checkIfKeyIsComponent = (key) => {
|
|
3002
|
+
const isFirstKeyString = (0, import_types.isString)(key);
|
|
3003
|
+
if (!isFirstKeyString)
|
|
3004
|
+
return;
|
|
3005
|
+
const firstCharKey = key.slice(0, 1);
|
|
3006
|
+
return /^[A-Z]*$/.test(firstCharKey);
|
|
3007
|
+
};
|
|
3008
|
+
var getChildrenComponentsByKey = (key, el) => {
|
|
3009
|
+
if (key === el.key || el.__ref.__componentKey === key) {
|
|
3010
|
+
return el;
|
|
3011
|
+
}
|
|
3012
|
+
if (el.extend) {
|
|
3013
|
+
const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
|
|
3014
|
+
const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
3015
|
+
if (foundString || foundInArray)
|
|
3016
|
+
return el;
|
|
3017
|
+
}
|
|
3018
|
+
};
|
|
3019
|
+
var getExtendsInElement = (obj) => {
|
|
3020
|
+
let result = [];
|
|
3021
|
+
function traverse(o) {
|
|
3022
|
+
for (const key in o) {
|
|
3023
|
+
if (Object.hasOwnProperty.call(o, key)) {
|
|
3024
|
+
if (checkIfKeyIsComponent(key)) {
|
|
3025
|
+
result.push(key);
|
|
3026
|
+
}
|
|
3027
|
+
if (key === "extend") {
|
|
3028
|
+
if (typeof o[key] === "string") {
|
|
3029
|
+
result.push(o[key]);
|
|
3030
|
+
} else if (Array.isArray(o[key])) {
|
|
3031
|
+
result = result.concat(o[key]);
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
if (typeof o[key] === "object" && o[key] !== null) {
|
|
3035
|
+
traverse(o[key]);
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
traverse(obj);
|
|
3041
|
+
return result;
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
});
|
|
3045
|
+
var require_function2 = __commonJS2({
|
|
3046
|
+
"../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
|
|
3047
|
+
"use strict";
|
|
3048
|
+
var __defProp22 = Object.defineProperty;
|
|
3049
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3050
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3051
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3052
|
+
var __export22 = (target, all) => {
|
|
3053
|
+
for (var name in all)
|
|
3054
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3055
|
+
};
|
|
3056
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3057
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3058
|
+
for (let key of __getOwnPropNames22(from))
|
|
3059
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3060
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3061
|
+
}
|
|
3062
|
+
return to;
|
|
3063
|
+
};
|
|
3064
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3065
|
+
var function_exports = {};
|
|
3066
|
+
__export22(function_exports, {
|
|
3067
|
+
debounce: () => debounce,
|
|
3068
|
+
debounceOnContext: () => debounceOnContext,
|
|
3069
|
+
isStringFunction: () => isStringFunction,
|
|
3070
|
+
memoize: () => memoize
|
|
3071
|
+
});
|
|
3072
|
+
module2.exports = __toCommonJS22(function_exports);
|
|
3073
|
+
function debounce(func, wait, immediate) {
|
|
3074
|
+
let timeout;
|
|
3075
|
+
return function() {
|
|
3076
|
+
const context = this;
|
|
3077
|
+
const args = arguments;
|
|
3078
|
+
const later = function() {
|
|
3079
|
+
timeout = null;
|
|
3080
|
+
if (!immediate)
|
|
3081
|
+
func.apply(context, args);
|
|
3082
|
+
};
|
|
3083
|
+
const callNow = immediate && !timeout;
|
|
3084
|
+
clearTimeout(timeout);
|
|
3085
|
+
timeout = setTimeout(later, wait);
|
|
3086
|
+
if (callNow)
|
|
3087
|
+
func.apply(context, args);
|
|
3088
|
+
};
|
|
3089
|
+
}
|
|
3090
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
3091
|
+
let timer;
|
|
3092
|
+
return (...args) => {
|
|
3093
|
+
clearTimeout(timer);
|
|
3094
|
+
timer = setTimeout(() => {
|
|
3095
|
+
func.apply(element, args);
|
|
3096
|
+
}, timeout);
|
|
3097
|
+
};
|
|
3098
|
+
};
|
|
3099
|
+
var memoize = (fn) => {
|
|
3100
|
+
const cache = {};
|
|
3101
|
+
return (...args) => {
|
|
3102
|
+
const n = args[0];
|
|
3103
|
+
if (n in cache) {
|
|
3104
|
+
return cache[n];
|
|
3105
|
+
} else {
|
|
3106
|
+
const result = fn(n);
|
|
3107
|
+
cache[n] = result;
|
|
3108
|
+
return result;
|
|
3109
|
+
}
|
|
3110
|
+
};
|
|
3111
|
+
};
|
|
3112
|
+
var isStringFunction = (inputString) => {
|
|
3113
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
3114
|
+
return functionRegex.test(inputString);
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
});
|
|
3118
|
+
var require_log2 = __commonJS2({
|
|
3119
|
+
"../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
3120
|
+
"use strict";
|
|
3121
|
+
var __defProp22 = Object.defineProperty;
|
|
3122
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3123
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3124
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3125
|
+
var __export22 = (target, all) => {
|
|
3126
|
+
for (var name in all)
|
|
3127
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3128
|
+
};
|
|
3129
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3130
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3131
|
+
for (let key of __getOwnPropNames22(from))
|
|
3132
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3133
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3134
|
+
}
|
|
3135
|
+
return to;
|
|
3136
|
+
};
|
|
3137
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3138
|
+
var log_exports = {};
|
|
3139
|
+
__export22(log_exports, {
|
|
3140
|
+
logGroupIf: () => logGroupIf,
|
|
3141
|
+
logIf: () => logIf
|
|
3142
|
+
});
|
|
3143
|
+
module2.exports = __toCommonJS22(log_exports);
|
|
3144
|
+
var logIf = (bool, ...arg) => {
|
|
3145
|
+
if (bool)
|
|
3146
|
+
arg.map((v) => console.log(v));
|
|
3147
|
+
};
|
|
3148
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
3149
|
+
if (bool) {
|
|
3150
|
+
console.group(key);
|
|
3151
|
+
arg.map((v) => console.log(v));
|
|
3152
|
+
console.groupEnd(key);
|
|
3153
|
+
}
|
|
3154
|
+
};
|
|
3155
|
+
}
|
|
3156
|
+
});
|
|
3157
|
+
var require_cookie2 = __commonJS2({
|
|
3158
|
+
"../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
3159
|
+
"use strict";
|
|
3160
|
+
var __defProp22 = Object.defineProperty;
|
|
3161
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3162
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3163
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3164
|
+
var __export22 = (target, all) => {
|
|
3165
|
+
for (var name in all)
|
|
3166
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3167
|
+
};
|
|
3168
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3169
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3170
|
+
for (let key of __getOwnPropNames22(from))
|
|
3171
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3172
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3173
|
+
}
|
|
3174
|
+
return to;
|
|
3175
|
+
};
|
|
3176
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3177
|
+
var cookie_exports = {};
|
|
3178
|
+
__export22(cookie_exports, {
|
|
3179
|
+
getCookie: () => getCookie,
|
|
3180
|
+
isMobile: () => isMobile,
|
|
3181
|
+
setCookie: () => setCookie
|
|
3182
|
+
});
|
|
3183
|
+
module2.exports = __toCommonJS22(cookie_exports);
|
|
3184
|
+
var import_types = require_types2();
|
|
3185
|
+
var import_utils32 = require_cjs3();
|
|
3186
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
3187
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
3188
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3189
|
+
return;
|
|
3190
|
+
const d = /* @__PURE__ */ new Date();
|
|
3191
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
3192
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
3193
|
+
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
3194
|
+
};
|
|
3195
|
+
var getCookie = (cname) => {
|
|
3196
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3197
|
+
return;
|
|
3198
|
+
const name = `${cname}=`;
|
|
3199
|
+
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
3200
|
+
const ca = decodedCookie.split(";");
|
|
3201
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3202
|
+
let c = ca[i];
|
|
3203
|
+
while (c.charAt(0) === " ")
|
|
3204
|
+
c = c.substring(1);
|
|
3205
|
+
if (c.indexOf(name) === 0)
|
|
3206
|
+
return c.substring(name.length, c.length);
|
|
3207
|
+
}
|
|
3208
|
+
return "";
|
|
3209
|
+
};
|
|
3210
|
+
}
|
|
3211
|
+
});
|
|
3212
|
+
var require_tags2 = __commonJS2({
|
|
3213
|
+
"../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
|
|
3214
|
+
"use strict";
|
|
3215
|
+
var __defProp22 = Object.defineProperty;
|
|
3216
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3217
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3218
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3219
|
+
var __export22 = (target, all) => {
|
|
3220
|
+
for (var name in all)
|
|
3221
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3222
|
+
};
|
|
3223
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3224
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3225
|
+
for (let key of __getOwnPropNames22(from))
|
|
3226
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3227
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3228
|
+
}
|
|
3229
|
+
return to;
|
|
3230
|
+
};
|
|
3231
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3232
|
+
var tags_exports = {};
|
|
3233
|
+
__export22(tags_exports, {
|
|
3234
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
3235
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
3236
|
+
});
|
|
3237
|
+
module2.exports = __toCommonJS22(tags_exports);
|
|
3238
|
+
var HTML_TAGS = {
|
|
3239
|
+
root: [
|
|
3240
|
+
"body",
|
|
3241
|
+
"html"
|
|
3242
|
+
],
|
|
3243
|
+
head: [
|
|
3244
|
+
"title",
|
|
3245
|
+
"base",
|
|
3246
|
+
"meta",
|
|
3247
|
+
"style"
|
|
3248
|
+
],
|
|
3249
|
+
body: [
|
|
3250
|
+
"string",
|
|
3251
|
+
"fragment",
|
|
3252
|
+
"a",
|
|
3253
|
+
"abbr",
|
|
3254
|
+
"acronym",
|
|
3255
|
+
"address",
|
|
3256
|
+
"applet",
|
|
3257
|
+
"area",
|
|
3258
|
+
"article",
|
|
3259
|
+
"aside",
|
|
3260
|
+
"audio",
|
|
3261
|
+
"b",
|
|
3262
|
+
"basefont",
|
|
3263
|
+
"bdi",
|
|
3264
|
+
"bdo",
|
|
3265
|
+
"big",
|
|
3266
|
+
"blockquote",
|
|
3267
|
+
"br",
|
|
3268
|
+
"button",
|
|
3269
|
+
"canvas",
|
|
3270
|
+
"caption",
|
|
3271
|
+
"center",
|
|
3272
|
+
"cite",
|
|
3273
|
+
"code",
|
|
3274
|
+
"search",
|
|
3275
|
+
"col",
|
|
3276
|
+
"colgroup",
|
|
3277
|
+
"data",
|
|
3278
|
+
"datalist",
|
|
3279
|
+
"dd",
|
|
3280
|
+
"del",
|
|
3281
|
+
"details",
|
|
3282
|
+
"dfn",
|
|
3283
|
+
"dialog",
|
|
3284
|
+
"dir",
|
|
3285
|
+
"div",
|
|
3286
|
+
"dl",
|
|
3287
|
+
"dt",
|
|
3288
|
+
"em",
|
|
3289
|
+
"embed",
|
|
3290
|
+
"fieldset",
|
|
3291
|
+
"figcaption",
|
|
3292
|
+
"figure",
|
|
3293
|
+
"font",
|
|
3294
|
+
"footer",
|
|
3295
|
+
"form",
|
|
3296
|
+
"frame",
|
|
3297
|
+
"frameset",
|
|
3298
|
+
"h1",
|
|
3299
|
+
"h2",
|
|
3300
|
+
"h3",
|
|
3301
|
+
"h4",
|
|
3302
|
+
"h5",
|
|
3303
|
+
"h6",
|
|
3304
|
+
"head",
|
|
3305
|
+
"header",
|
|
3306
|
+
"hr",
|
|
3307
|
+
"i",
|
|
3308
|
+
"iframe",
|
|
3309
|
+
"img",
|
|
3310
|
+
"input",
|
|
3311
|
+
"ins",
|
|
3312
|
+
"kbd",
|
|
3313
|
+
"label",
|
|
3314
|
+
"legend",
|
|
3315
|
+
"li",
|
|
3316
|
+
"link",
|
|
3317
|
+
"main",
|
|
3318
|
+
"map",
|
|
3319
|
+
"mark",
|
|
3320
|
+
"meter",
|
|
3321
|
+
"nav",
|
|
3322
|
+
"noframes",
|
|
3323
|
+
"noscript",
|
|
3324
|
+
"object",
|
|
3325
|
+
"ol",
|
|
3326
|
+
"optgroup",
|
|
3327
|
+
"option",
|
|
3328
|
+
"output",
|
|
3329
|
+
"p",
|
|
3330
|
+
"param",
|
|
3331
|
+
"picture",
|
|
3332
|
+
"pre",
|
|
3333
|
+
"progress",
|
|
3334
|
+
"hgroup",
|
|
3335
|
+
"q",
|
|
3336
|
+
"rp",
|
|
3337
|
+
"rt",
|
|
3338
|
+
"ruby",
|
|
3339
|
+
"s",
|
|
3340
|
+
"samp",
|
|
3341
|
+
"script",
|
|
3342
|
+
"section",
|
|
3343
|
+
"select",
|
|
3344
|
+
"small",
|
|
3345
|
+
"source",
|
|
3346
|
+
"span",
|
|
3347
|
+
"strike",
|
|
3348
|
+
"strong",
|
|
3349
|
+
"sub",
|
|
3350
|
+
"summary",
|
|
3351
|
+
"sup",
|
|
3352
|
+
"table",
|
|
3353
|
+
"tbody",
|
|
3354
|
+
"td",
|
|
3355
|
+
"template",
|
|
3356
|
+
"hgroup",
|
|
3357
|
+
"textarea",
|
|
3358
|
+
"tfoot",
|
|
3359
|
+
"th",
|
|
3360
|
+
"thead",
|
|
3361
|
+
"time",
|
|
3362
|
+
"tr",
|
|
3363
|
+
"track",
|
|
3364
|
+
"tt",
|
|
3365
|
+
"u",
|
|
3366
|
+
"ul",
|
|
3367
|
+
"var",
|
|
3368
|
+
"video",
|
|
3369
|
+
"wbr",
|
|
3370
|
+
// SVG
|
|
3371
|
+
"svg",
|
|
3372
|
+
"path"
|
|
3373
|
+
]
|
|
3374
|
+
};
|
|
3375
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
3376
|
+
}
|
|
3377
|
+
});
|
|
3378
|
+
var require_cjs3 = __commonJS2({
|
|
3379
|
+
"../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
|
|
3380
|
+
"use strict";
|
|
3381
|
+
var __defProp22 = Object.defineProperty;
|
|
3382
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3383
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3384
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3385
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3386
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3387
|
+
for (let key of __getOwnPropNames22(from))
|
|
3388
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3389
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3390
|
+
}
|
|
3391
|
+
return to;
|
|
3392
|
+
};
|
|
3393
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
3394
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3395
|
+
var utils_exports = {};
|
|
3396
|
+
module2.exports = __toCommonJS22(utils_exports);
|
|
3397
|
+
__reExport(utils_exports, require_key2(), module2.exports);
|
|
3398
|
+
__reExport(utils_exports, require_env2(), module2.exports);
|
|
3399
|
+
__reExport(utils_exports, require_types2(), module2.exports);
|
|
3400
|
+
__reExport(utils_exports, require_object2(), module2.exports);
|
|
3401
|
+
__reExport(utils_exports, require_function2(), module2.exports);
|
|
3402
|
+
__reExport(utils_exports, require_array2(), module2.exports);
|
|
3403
|
+
__reExport(utils_exports, require_node2(), module2.exports);
|
|
3404
|
+
__reExport(utils_exports, require_log2(), module2.exports);
|
|
3405
|
+
__reExport(utils_exports, require_string2(), module2.exports);
|
|
3406
|
+
__reExport(utils_exports, require_globals2(), module2.exports);
|
|
3407
|
+
__reExport(utils_exports, require_cookie2(), module2.exports);
|
|
3408
|
+
__reExport(utils_exports, require_tags2(), module2.exports);
|
|
3409
|
+
}
|
|
3410
|
+
});
|
|
3411
|
+
var src_exports = {};
|
|
3412
|
+
__export2(src_exports, {
|
|
3413
|
+
arrayzeValue: () => arrayzeValue,
|
|
3414
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
3415
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
3416
|
+
findClosestNumber: () => findClosestNumber,
|
|
3417
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
3418
|
+
formatDate: () => formatDate,
|
|
3419
|
+
isPhoto: () => isPhoto,
|
|
3420
|
+
loadCssFile: () => loadCssFile,
|
|
3421
|
+
loadJavascript: () => loadJavascript,
|
|
3422
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
3423
|
+
removeChars: () => removeChars,
|
|
3424
|
+
toCamelCase: () => toCamelCase,
|
|
3425
|
+
toDashCase: () => toDashCase,
|
|
3426
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
3427
|
+
toTitleCase: () => toTitleCase,
|
|
3428
|
+
toggleFullscreen: () => toggleFullscreen
|
|
3429
|
+
});
|
|
3430
|
+
module.exports = __toCommonJS2(src_exports);
|
|
3431
|
+
var import_utils22 = __toESM2(require_cjs3(), 1);
|
|
3432
|
+
var toggleFullscreen = (el) => {
|
|
3433
|
+
if (!document.fullscreenElement) {
|
|
3434
|
+
el.node.requestFullscreen().catch((err) => {
|
|
3435
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
3436
|
+
});
|
|
3437
|
+
} else {
|
|
3438
|
+
document.exitFullscreen();
|
|
3439
|
+
}
|
|
3440
|
+
};
|
|
3441
|
+
var import_utils3 = __toESM2(require_cjs3(), 1);
|
|
3442
|
+
var findClosestNumber = (number, arr) => {
|
|
3443
|
+
return ((0, import_utils3.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
3444
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
3445
|
+
});
|
|
3120
3446
|
};
|
|
3121
|
-
var
|
|
3122
|
-
|
|
3447
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
3448
|
+
val = parseFloat(val);
|
|
3449
|
+
if ((0, import_utils3.isObject)(factory))
|
|
3450
|
+
factory = Object.values(factory);
|
|
3451
|
+
return findClosestNumber(val, factory);
|
|
3123
3452
|
};
|
|
3124
|
-
var
|
|
3125
|
-
if (!
|
|
3126
|
-
return;
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3453
|
+
var formatDate = (timestamp) => {
|
|
3454
|
+
if (!timestamp)
|
|
3455
|
+
return "";
|
|
3456
|
+
const d = new Date(timestamp);
|
|
3457
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
3458
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
3459
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
3460
|
+
return `${da} ${mo}, ${ye}`;
|
|
3130
3461
|
};
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
3462
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
3463
|
+
const fib = [0, 1];
|
|
3464
|
+
for (let i = 2; i <= n; i++) {
|
|
3465
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
3466
|
+
}
|
|
3467
|
+
return fib[n];
|
|
3138
3468
|
};
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3469
|
+
var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
3470
|
+
return new Promise((resolve, reject) => {
|
|
3471
|
+
try {
|
|
3472
|
+
const scriptEle = doc.createElement("script");
|
|
3473
|
+
scriptEle.type = type;
|
|
3474
|
+
scriptEle.async = async;
|
|
3475
|
+
scriptEle.src = FILE_URL;
|
|
3476
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
3477
|
+
resolve({
|
|
3478
|
+
status: true
|
|
3479
|
+
});
|
|
3480
|
+
});
|
|
3481
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
3482
|
+
reject({
|
|
3483
|
+
status: false,
|
|
3484
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
3485
|
+
});
|
|
3486
|
+
});
|
|
3487
|
+
doc.body.appendChild(scriptEle);
|
|
3488
|
+
} catch (error) {
|
|
3489
|
+
reject(error);
|
|
3151
3490
|
}
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
elem.style.color = color;
|
|
3169
|
-
if (elem.style.color === flag || elem.style.color === "") {
|
|
3170
|
-
import_globals.document.body.removeChild(elem);
|
|
3171
|
-
return [0, 0, 0, 0];
|
|
3172
|
-
}
|
|
3173
|
-
color = import_globals.window.getComputedStyle(elem).color;
|
|
3174
|
-
import_globals.document.body.removeChild(elem);
|
|
3491
|
+
});
|
|
3492
|
+
};
|
|
3493
|
+
var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
3494
|
+
return new Promise((resolve, reject) => {
|
|
3495
|
+
try {
|
|
3496
|
+
const linkElem = doc.createElement("link");
|
|
3497
|
+
linkElem.rel = "stylesheet";
|
|
3498
|
+
linkElem.href = FILE_URL;
|
|
3499
|
+
linkElem.addEventListener("load", (ev) => {
|
|
3500
|
+
resolve({
|
|
3501
|
+
status: true
|
|
3502
|
+
});
|
|
3503
|
+
});
|
|
3504
|
+
doc.head.appendChild(linkElem);
|
|
3505
|
+
} catch (error) {
|
|
3506
|
+
reject(error);
|
|
3175
3507
|
}
|
|
3176
|
-
}
|
|
3177
|
-
if (color.indexOf("rgb") === 0) {
|
|
3178
|
-
if (color.indexOf("rgba") === -1)
|
|
3179
|
-
color = `${color}, 1`;
|
|
3180
|
-
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
3181
|
-
}
|
|
3182
|
-
return [0, 0, 0, 0];
|
|
3508
|
+
});
|
|
3183
3509
|
};
|
|
3184
|
-
var
|
|
3185
|
-
|
|
3186
|
-
|
|
3510
|
+
var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
|
|
3511
|
+
try {
|
|
3512
|
+
const scriptEle = doc.createElement("script");
|
|
3513
|
+
scriptEle.type = type;
|
|
3514
|
+
scriptEle.async = async;
|
|
3515
|
+
scriptEle.id = id;
|
|
3516
|
+
scriptEle.innerHTML = body;
|
|
3517
|
+
doc.body.appendChild(scriptEle);
|
|
3518
|
+
} catch (error) {
|
|
3519
|
+
console.warn(error);
|
|
3520
|
+
}
|
|
3187
3521
|
};
|
|
3188
|
-
var
|
|
3189
|
-
|
|
3522
|
+
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
3523
|
+
var copyStringToClipboard = (str) => {
|
|
3524
|
+
const el = document.createElement("textarea");
|
|
3525
|
+
el.value = str;
|
|
3526
|
+
el.setAttribute("readonly", "");
|
|
3527
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
3528
|
+
document.body.appendChild(el);
|
|
3529
|
+
el.select();
|
|
3530
|
+
document.execCommand("copy");
|
|
3531
|
+
document.body.removeChild(el);
|
|
3190
3532
|
};
|
|
3191
|
-
var
|
|
3192
|
-
|
|
3193
|
-
const n = a - Math.min(r, g, b);
|
|
3194
|
-
const f = 1 - Math.abs(a + a - n - 1);
|
|
3195
|
-
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
3196
|
-
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
3533
|
+
var removeChars = (str) => {
|
|
3534
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
3197
3535
|
};
|
|
3198
|
-
var
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
)
|
|
3202
|
-
var getColorShade = (col, amt) => {
|
|
3203
|
-
const num = parseInt(col, 16);
|
|
3204
|
-
let r = (num >> 16) + amt;
|
|
3205
|
-
if (r > 255)
|
|
3206
|
-
r = 255;
|
|
3207
|
-
else if (r < 0)
|
|
3208
|
-
r = 0;
|
|
3209
|
-
let b = (num >> 8 & 255) + amt;
|
|
3210
|
-
if (b > 255)
|
|
3211
|
-
b = 255;
|
|
3212
|
-
else if (b < 0)
|
|
3213
|
-
b = 0;
|
|
3214
|
-
let g = (num & 255) + amt;
|
|
3215
|
-
if (g > 255)
|
|
3216
|
-
g = 255;
|
|
3217
|
-
else if (g < 0)
|
|
3218
|
-
g = 0;
|
|
3219
|
-
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
3536
|
+
var toCamelCase = (str) => {
|
|
3537
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
3538
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
3539
|
+
}).replaceAll(/\s+/g, "");
|
|
3220
3540
|
};
|
|
3221
|
-
var
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
3226
|
-
if ((0, import_utils2.isNumber)(tone))
|
|
3227
|
-
tone += "";
|
|
3228
|
-
const toHex = rgbArrayToHex(rgb);
|
|
3229
|
-
const abs = tone.slice(0, 1);
|
|
3230
|
-
if (abs === "-" || abs === "+") {
|
|
3231
|
-
const colorShade = getColorShade(toHex, parseFloat(tone));
|
|
3232
|
-
return hexToRgbArray(colorShade).join(", ");
|
|
3233
|
-
} else {
|
|
3234
|
-
const [r, g, b] = rgb;
|
|
3235
|
-
const hsl = rgbToHSL(r, g, b);
|
|
3236
|
-
const [h, s, l] = hsl;
|
|
3237
|
-
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
3238
|
-
return newRgb;
|
|
3541
|
+
var toTitleCase = (str) => str && str.replace(
|
|
3542
|
+
/\w\S*/g,
|
|
3543
|
+
(txt) => {
|
|
3544
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
3239
3545
|
}
|
|
3546
|
+
);
|
|
3547
|
+
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
3548
|
+
var toDescriptionCase = (str = "") => {
|
|
3549
|
+
if (typeof str !== "string")
|
|
3550
|
+
return;
|
|
3551
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
3552
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
3240
3553
|
};
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
if (
|
|
3245
|
-
return
|
|
3246
|
-
if (
|
|
3247
|
-
return
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
};
|
|
3251
|
-
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
3252
|
-
var setCustomFont = (name, url, weight) => `
|
|
3253
|
-
font-family: '${name}';
|
|
3254
|
-
font-style: normal;
|
|
3255
|
-
${weight && `font-weight: ${weight};`}
|
|
3256
|
-
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
3257
|
-
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
3258
|
-
${setCustomFont(name, url, weight)}
|
|
3259
|
-
}`;
|
|
3260
|
-
var getFontFaceEach = (name, weights) => {
|
|
3261
|
-
const keys = Object.keys(weights);
|
|
3262
|
-
return keys.map((key) => {
|
|
3263
|
-
const { url, fontWeight } = weights[key];
|
|
3264
|
-
return setCustomFont(name, url, fontWeight);
|
|
3265
|
-
});
|
|
3554
|
+
var arrayzeValue = (val) => {
|
|
3555
|
+
if ((0, import_utils22.isArray)(val))
|
|
3556
|
+
return val;
|
|
3557
|
+
if ((0, import_utils22.isString)(val))
|
|
3558
|
+
return val.split(" ");
|
|
3559
|
+
if ((0, import_utils22.isObject)(val))
|
|
3560
|
+
return Object.values(val);
|
|
3561
|
+
if ((0, import_utils22.isNumber)(val))
|
|
3562
|
+
return [val];
|
|
3266
3563
|
};
|
|
3267
3564
|
|
|
3268
3565
|
// src/utils/sequence.js
|
|
3269
|
-
var import_utils3 = __toESM(require_cjs(), 1);
|
|
3270
|
-
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
3271
3566
|
var numToLetterMap = {
|
|
3272
3567
|
"-6": "U",
|
|
3273
3568
|
"-5": "V",
|
|
@@ -3409,9 +3704,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
3409
3704
|
unit = UNIT2.default,
|
|
3410
3705
|
useVariable
|
|
3411
3706
|
} = sequenceProps;
|
|
3412
|
-
if ((0,
|
|
3707
|
+
if ((0, import_utils4.isString)(value) && value.slice(0, 2) === "--")
|
|
3413
3708
|
return `var(${value})`;
|
|
3414
|
-
const prefix = `--${(0
|
|
3709
|
+
const prefix = `--${(void 0)(sequenceProps.type.replace(".", "-"))}-`;
|
|
3415
3710
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
3416
3711
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
3417
3712
|
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
@@ -3474,7 +3769,7 @@ var findHeadings = (propertyNames) => {
|
|
|
3474
3769
|
};
|
|
3475
3770
|
|
|
3476
3771
|
// src/utils/var.js
|
|
3477
|
-
var
|
|
3772
|
+
var import_utils6 = __toESM(require_cjs(), 1);
|
|
3478
3773
|
var applySequenceGlobalVars = (vars, obj, options) => {
|
|
3479
3774
|
const CONFIG2 = getActiveConfig();
|
|
3480
3775
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
@@ -3545,9 +3840,9 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
3545
3840
|
};
|
|
3546
3841
|
|
|
3547
3842
|
// src/utils/sprite.js
|
|
3548
|
-
var
|
|
3843
|
+
var import_utils7 = __toESM(require_cjs(), 1);
|
|
3549
3844
|
var parseRootAttributes = (htmlString) => {
|
|
3550
|
-
if (!(0,
|
|
3845
|
+
if (!(0, import_utils7.isString)(htmlString)) {
|
|
3551
3846
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
3552
3847
|
}
|
|
3553
3848
|
const match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -3567,7 +3862,7 @@ var replaceIdsAndUrls = (code, key) => {
|
|
|
3567
3862
|
const urlRegex = /url\(#([^)]*)\)/g;
|
|
3568
3863
|
const matches = code.match(/id="([^"]*)"/g);
|
|
3569
3864
|
let replacedCode = code;
|
|
3570
|
-
if ((0,
|
|
3865
|
+
if ((0, import_utils7.isArray)(matches)) {
|
|
3571
3866
|
matches.forEach(() => {
|
|
3572
3867
|
const randomKey = Math.floor(Math.random() * 1e5);
|
|
3573
3868
|
replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
|
|
@@ -3594,7 +3889,7 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
3594
3889
|
// src/system/color.js
|
|
3595
3890
|
var getColor = (value, key, config) => {
|
|
3596
3891
|
const CONFIG2 = config || getActiveConfig();
|
|
3597
|
-
if (!(0,
|
|
3892
|
+
if (!(0, import_utils8.isString)(value)) {
|
|
3598
3893
|
if (CONFIG2.verbose)
|
|
3599
3894
|
console.warn(value, "- type for color is not valid");
|
|
3600
3895
|
return;
|
|
@@ -3603,7 +3898,7 @@ var getColor = (value, key, config) => {
|
|
|
3603
3898
|
return `var(${value})`;
|
|
3604
3899
|
if (key && value[key])
|
|
3605
3900
|
value = value[key];
|
|
3606
|
-
const [name, alpha, tone] = (0,
|
|
3901
|
+
const [name, alpha, tone] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
|
|
3607
3902
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
3608
3903
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
3609
3904
|
if (!val) {
|
|
@@ -3633,7 +3928,7 @@ var getColor = (value, key, config) => {
|
|
|
3633
3928
|
};
|
|
3634
3929
|
var setColor = (val, key, suffix) => {
|
|
3635
3930
|
const CONFIG2 = getActiveConfig();
|
|
3636
|
-
if ((0,
|
|
3931
|
+
if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--") {
|
|
3637
3932
|
val = getColor(val.slice(2));
|
|
3638
3933
|
if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
|
|
3639
3934
|
if (CONFIG2.verbose)
|
|
@@ -3641,13 +3936,13 @@ var setColor = (val, key, suffix) => {
|
|
|
3641
3936
|
val = val.split(" ")[0];
|
|
3642
3937
|
}
|
|
3643
3938
|
}
|
|
3644
|
-
if ((0,
|
|
3939
|
+
if ((0, import_utils8.isArray)(val)) {
|
|
3645
3940
|
return {
|
|
3646
3941
|
"@light": setColor(val[0], key, "light"),
|
|
3647
3942
|
"@dark": setColor(val[1], key, "dark")
|
|
3648
3943
|
};
|
|
3649
3944
|
}
|
|
3650
|
-
if ((0,
|
|
3945
|
+
if ((0, import_utils8.isObject)(val)) {
|
|
3651
3946
|
const obj = {};
|
|
3652
3947
|
for (const variant in val) {
|
|
3653
3948
|
obj[variant] = setColor(
|
|
@@ -3676,15 +3971,15 @@ var setColor = (val, key, suffix) => {
|
|
|
3676
3971
|
};
|
|
3677
3972
|
var setGradient = (val, key, suffix) => {
|
|
3678
3973
|
const CONFIG2 = getActiveConfig();
|
|
3679
|
-
if ((0,
|
|
3974
|
+
if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
|
|
3680
3975
|
val = getColor(val.slice(2));
|
|
3681
|
-
if ((0,
|
|
3976
|
+
if ((0, import_utils8.isArray)(val)) {
|
|
3682
3977
|
return {
|
|
3683
3978
|
"@light": setGradient(val[0], key, "light"),
|
|
3684
3979
|
"@dark": setGradient(val[0], key, "dark")
|
|
3685
3980
|
};
|
|
3686
3981
|
}
|
|
3687
|
-
if ((0,
|
|
3982
|
+
if ((0, import_utils8.isObject)(val)) {
|
|
3688
3983
|
const obj = {};
|
|
3689
3984
|
for (const variant in val)
|
|
3690
3985
|
obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -3701,7 +3996,7 @@ var setGradient = (val, key, suffix) => {
|
|
|
3701
3996
|
};
|
|
3702
3997
|
|
|
3703
3998
|
// src/system/theme.js
|
|
3704
|
-
var
|
|
3999
|
+
var import_utils10 = __toESM(require_cjs(), 1);
|
|
3705
4000
|
var setThemeValue = (theme) => {
|
|
3706
4001
|
const value = {};
|
|
3707
4002
|
const { state, media, helpers, ...rest } = theme;
|
|
@@ -3724,7 +4019,7 @@ var getTheme = (value, modifier) => {
|
|
|
3724
4019
|
if (CONFIG2.useVariable)
|
|
3725
4020
|
return getMediaTheme(value, modifier);
|
|
3726
4021
|
const { THEME: THEME2 } = CONFIG2;
|
|
3727
|
-
if ((0,
|
|
4022
|
+
if ((0, import_utils10.isString)(value)) {
|
|
3728
4023
|
const [theme, subtheme] = value.split(" ");
|
|
3729
4024
|
const isOurTheme = THEME2[theme];
|
|
3730
4025
|
if (isOurTheme) {
|
|
@@ -3733,7 +4028,7 @@ var getTheme = (value, modifier) => {
|
|
|
3733
4028
|
value = [theme, subtheme || modifier];
|
|
3734
4029
|
}
|
|
3735
4030
|
}
|
|
3736
|
-
if ((0,
|
|
4031
|
+
if ((0, import_utils10.isObjectLike)(value) && value[1]) {
|
|
3737
4032
|
const themeName = value[0];
|
|
3738
4033
|
const subThemeName = value[1];
|
|
3739
4034
|
const { helpers, media, state } = THEME2[themeName];
|
|
@@ -3743,11 +4038,11 @@ var getTheme = (value, modifier) => {
|
|
|
3743
4038
|
return getThemeValue(helpers[subThemeName]);
|
|
3744
4039
|
if (state && state[subThemeName])
|
|
3745
4040
|
return getThemeValue(state[subThemeName]);
|
|
3746
|
-
} else if ((0,
|
|
4041
|
+
} else if ((0, import_utils10.isObject)(value))
|
|
3747
4042
|
return setThemeValue(value);
|
|
3748
4043
|
};
|
|
3749
4044
|
var setInverseTheme = (theme, variant, value) => {
|
|
3750
|
-
if ((0,
|
|
4045
|
+
if ((0, import_utils10.isObject)(variant)) {
|
|
3751
4046
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
3752
4047
|
} else if (variant === true) {
|
|
3753
4048
|
const { color, background } = value;
|
|
@@ -3762,7 +4057,7 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
3762
4057
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
3763
4058
|
const result = getTheme(variant);
|
|
3764
4059
|
themeValue[`&:${key}`] = result;
|
|
3765
|
-
if ((0,
|
|
4060
|
+
if ((0, import_utils10.isObject)(variant) && !variant.value)
|
|
3766
4061
|
variant.value = result;
|
|
3767
4062
|
};
|
|
3768
4063
|
var setSelectors = (theme, value) => {
|
|
@@ -3780,7 +4075,7 @@ var setSelectors = (theme, value) => {
|
|
|
3780
4075
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
3781
4076
|
const result = getTheme(variant);
|
|
3782
4077
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
3783
|
-
if ((0,
|
|
4078
|
+
if ((0, import_utils10.isObject)(variant) && !variant.value)
|
|
3784
4079
|
variant.value = result;
|
|
3785
4080
|
};
|
|
3786
4081
|
var setMedia = (theme, value) => {
|
|
@@ -3806,7 +4101,7 @@ var setHelpers = (theme, value) => {
|
|
|
3806
4101
|
const keys = Object.keys(helpers);
|
|
3807
4102
|
keys.map((key) => {
|
|
3808
4103
|
const helper = helpers[key];
|
|
3809
|
-
if ((0,
|
|
4104
|
+
if ((0, import_utils10.isString)(helper))
|
|
3810
4105
|
helpers[key] = CONFIG2.THEME[helper];
|
|
3811
4106
|
else
|
|
3812
4107
|
getThemeValue(helpers[key]);
|
|
@@ -3830,7 +4125,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
3830
4125
|
const CONFIG2 = getActiveConfig();
|
|
3831
4126
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
3832
4127
|
const theme = { value: val };
|
|
3833
|
-
if ((0,
|
|
4128
|
+
if ((0, import_utils10.isObjectLike)(val)) {
|
|
3834
4129
|
for (const param in val) {
|
|
3835
4130
|
const symb = param.slice(0, 1);
|
|
3836
4131
|
const value = val[param];
|
|
@@ -3858,7 +4153,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
3858
4153
|
};
|
|
3859
4154
|
}
|
|
3860
4155
|
}
|
|
3861
|
-
if ((0,
|
|
4156
|
+
if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--") {
|
|
3862
4157
|
const { THEME: THEME2 } = CONFIG2;
|
|
3863
4158
|
const value = THEME2[val.slice(2)];
|
|
3864
4159
|
const getReferenced = getMediaTheme(value, prefers);
|
|
@@ -3871,7 +4166,7 @@ var recursiveTheme = (val) => {
|
|
|
3871
4166
|
const obj = {};
|
|
3872
4167
|
for (const param in val) {
|
|
3873
4168
|
const symb = param.slice(0, 1);
|
|
3874
|
-
if ((0,
|
|
4169
|
+
if ((0, import_utils10.isObjectLike)(val[param])) {
|
|
3875
4170
|
if (symb === "@") {
|
|
3876
4171
|
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
3877
4172
|
const media = `@media screen and ${query}`;
|
|
@@ -3891,25 +4186,25 @@ var findModifierFromArray = (val, modifierArray) => {
|
|
|
3891
4186
|
return val;
|
|
3892
4187
|
};
|
|
3893
4188
|
var findModifier = (val, modifier) => {
|
|
3894
|
-
if ((0,
|
|
4189
|
+
if ((0, import_utils10.isArray)(modifier))
|
|
3895
4190
|
return findModifierFromArray(val, modifier);
|
|
3896
|
-
else if ((0,
|
|
4191
|
+
else if ((0, import_utils10.isString)(modifier) && val[modifier])
|
|
3897
4192
|
return val[modifier];
|
|
3898
4193
|
else
|
|
3899
4194
|
return val;
|
|
3900
4195
|
};
|
|
3901
4196
|
var getMediaTheme = (value, modifier) => {
|
|
3902
4197
|
const activeConfig = getActiveConfig();
|
|
3903
|
-
if ((0,
|
|
4198
|
+
if ((0, import_utils10.isString)(value) && value.slice(0, 2) === "--") {
|
|
3904
4199
|
value = getMediaTheme(value.slice(2));
|
|
3905
4200
|
}
|
|
3906
|
-
if (!value || !(0,
|
|
4201
|
+
if (!value || !(0, import_utils10.isString)(value)) {
|
|
3907
4202
|
if (activeConfig.verbose) {
|
|
3908
4203
|
console.warn(`${value} - Theme is not a string`);
|
|
3909
4204
|
}
|
|
3910
4205
|
return;
|
|
3911
4206
|
}
|
|
3912
|
-
const [themeName, ...themeModifiers] = (0,
|
|
4207
|
+
const [themeName, ...themeModifiers] = (0, import_utils10.isArray)(value) ? value : value.split(" ");
|
|
3913
4208
|
let themeValue = activeConfig.THEME[themeName];
|
|
3914
4209
|
if (themeValue && (themeModifiers || modifier)) {
|
|
3915
4210
|
themeValue = findModifier(themeValue, themeModifiers.length ? themeModifiers : modifier);
|
|
@@ -3919,11 +4214,10 @@ var getMediaTheme = (value, modifier) => {
|
|
|
3919
4214
|
};
|
|
3920
4215
|
|
|
3921
4216
|
// src/system/font.js
|
|
3922
|
-
var
|
|
3923
|
-
var import_utils11 = __toESM(require_cjs3(), 1);
|
|
4217
|
+
var import_utils11 = __toESM(require_cjs(), 1);
|
|
3924
4218
|
var setFont = (val, key) => {
|
|
3925
4219
|
const CSSvar = `--font-${key}`;
|
|
3926
|
-
if (!val || (0,
|
|
4220
|
+
if (!val || (0, import_utils11.isArray)(val) && !val[0])
|
|
3927
4221
|
return;
|
|
3928
4222
|
const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
|
|
3929
4223
|
return { var: CSSvar, value: val, fontFace };
|
|
@@ -3934,15 +4228,15 @@ var setFontFamily = (val, key) => {
|
|
|
3934
4228
|
let { value, type } = val;
|
|
3935
4229
|
if (val.isDefault)
|
|
3936
4230
|
FONT_FAMILY2.default = key;
|
|
3937
|
-
if ((0,
|
|
3938
|
-
value = (0
|
|
4231
|
+
if ((0, import_utils11.isObject)(value))
|
|
4232
|
+
value = (void 0)(value);
|
|
3939
4233
|
const CSSvar = `--font-family-${key}`;
|
|
3940
4234
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
3941
4235
|
return { var: CSSvar, value: str, arr: value, type };
|
|
3942
4236
|
};
|
|
3943
4237
|
|
|
3944
4238
|
// src/system/typography.js
|
|
3945
|
-
var
|
|
4239
|
+
var import_utils14 = __toESM(require_cjs(), 1);
|
|
3946
4240
|
var runThroughMedia = (FACTORY2) => {
|
|
3947
4241
|
const CONFIG2 = getActiveConfig();
|
|
3948
4242
|
const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
|
|
@@ -3962,7 +4256,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
3962
4256
|
h1Matches,
|
|
3963
4257
|
unit
|
|
3964
4258
|
} = FACTORY2;
|
|
3965
|
-
(0,
|
|
4259
|
+
(0, import_utils14.merge)(mediaValue, {
|
|
3966
4260
|
type,
|
|
3967
4261
|
base,
|
|
3968
4262
|
ratio,
|
|
@@ -3979,7 +4273,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
3979
4273
|
applyMediaSequenceVars(FACTORY2, prop);
|
|
3980
4274
|
continue;
|
|
3981
4275
|
}
|
|
3982
|
-
(0,
|
|
4276
|
+
(0, import_utils14.merge)(mediaValue, {
|
|
3983
4277
|
sequence: {},
|
|
3984
4278
|
scales: {},
|
|
3985
4279
|
templates: {},
|
|
@@ -4018,8 +4312,7 @@ var applyTypographySequence = () => {
|
|
|
4018
4312
|
};
|
|
4019
4313
|
|
|
4020
4314
|
// src/system/spacing.js
|
|
4021
|
-
var
|
|
4022
|
-
var import_utils16 = __toESM(require_cjs(), 1);
|
|
4315
|
+
var import_utils17 = __toESM(require_cjs(), 1);
|
|
4023
4316
|
var runThroughMedia2 = (FACTORY2) => {
|
|
4024
4317
|
for (const prop in FACTORY2) {
|
|
4025
4318
|
const mediaProps = FACTORY2[prop];
|
|
@@ -4035,7 +4328,7 @@ var runThroughMedia2 = (FACTORY2) => {
|
|
|
4035
4328
|
h1Matches,
|
|
4036
4329
|
unit
|
|
4037
4330
|
} = FACTORY2;
|
|
4038
|
-
(0,
|
|
4331
|
+
(0, import_utils17.merge)(mediaProps, {
|
|
4039
4332
|
type,
|
|
4040
4333
|
base,
|
|
4041
4334
|
ratio,
|
|
@@ -4069,11 +4362,11 @@ var getSequence = (sequenceProps) => {
|
|
|
4069
4362
|
};
|
|
4070
4363
|
var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
4071
4364
|
const sequence = getSequence(sequenceProps);
|
|
4072
|
-
if ((0,
|
|
4365
|
+
if ((0, import_utils17.isString)(value) && (value.includes("calc") || value.includes("var"))) {
|
|
4073
4366
|
return { [propertyName]: value };
|
|
4074
4367
|
}
|
|
4075
|
-
const stack = (0
|
|
4076
|
-
if (!(0,
|
|
4368
|
+
const stack = (void 0)(value);
|
|
4369
|
+
if (!(0, import_utils17.isArray)(stack))
|
|
4077
4370
|
return;
|
|
4078
4371
|
if (stack.length > 1) {
|
|
4079
4372
|
let suffix = "";
|
|
@@ -4101,16 +4394,16 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
|
4101
4394
|
};
|
|
4102
4395
|
|
|
4103
4396
|
// src/system/shadow.js
|
|
4104
|
-
var
|
|
4397
|
+
var import_utils19 = __toESM(require_cjs(), 1);
|
|
4105
4398
|
var setShadow = (value, key, suffix, prefers) => {
|
|
4106
4399
|
const CONFIG2 = getActiveConfig();
|
|
4107
|
-
if ((0,
|
|
4400
|
+
if ((0, import_utils19.isArray)(value)) {
|
|
4108
4401
|
return {
|
|
4109
4402
|
"@light": setShadow(value[0], key, "light"),
|
|
4110
4403
|
"@dark": setShadow(value[1], key, "dark")
|
|
4111
4404
|
};
|
|
4112
4405
|
}
|
|
4113
|
-
if ((0,
|
|
4406
|
+
if ((0, import_utils19.isObject)(value)) {
|
|
4114
4407
|
const obj = {};
|
|
4115
4408
|
for (const variant in value) {
|
|
4116
4409
|
obj[variant] = setShadow(
|
|
@@ -4121,7 +4414,7 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
4121
4414
|
}
|
|
4122
4415
|
return obj;
|
|
4123
4416
|
}
|
|
4124
|
-
if ((0,
|
|
4417
|
+
if ((0, import_utils19.isString)(value) && value.includes(",")) {
|
|
4125
4418
|
value = value.split(",").map((v) => {
|
|
4126
4419
|
v = v.trim();
|
|
4127
4420
|
if (v.startsWith("--"))
|
|
@@ -4147,7 +4440,6 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
4147
4440
|
};
|
|
4148
4441
|
|
|
4149
4442
|
// src/system/timing.js
|
|
4150
|
-
var import_utils19 = __toESM(require_cjs3(), 1);
|
|
4151
4443
|
var applyTimingSequence = () => {
|
|
4152
4444
|
const CONFIG2 = getActiveConfig();
|
|
4153
4445
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
@@ -4156,11 +4448,11 @@ var applyTimingSequence = () => {
|
|
|
4156
4448
|
};
|
|
4157
4449
|
|
|
4158
4450
|
// src/system/document.js
|
|
4159
|
-
var
|
|
4451
|
+
var import_utils23 = __toESM(require_cjs(), 1);
|
|
4160
4452
|
var applyDocument = () => {
|
|
4161
4453
|
const CONFIG2 = getActiveConfig();
|
|
4162
4454
|
const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
4163
|
-
return (0,
|
|
4455
|
+
return (0, import_utils23.merge)(DOCUMENT2, {
|
|
4164
4456
|
theme: THEME2.document,
|
|
4165
4457
|
fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
|
|
4166
4458
|
fontSize: TYPOGRAPHY2.base,
|
|
@@ -4192,7 +4484,7 @@ var setSvgIcon = (val, key) => {
|
|
|
4192
4484
|
};
|
|
4193
4485
|
|
|
4194
4486
|
// src/system/reset.js
|
|
4195
|
-
var
|
|
4487
|
+
var import_utils26 = __toESM(require_cjs(), 1);
|
|
4196
4488
|
var applyReset = (reset = {}) => {
|
|
4197
4489
|
const CONFIG2 = getActiveConfig();
|
|
4198
4490
|
const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
|
|
@@ -4214,8 +4506,8 @@ var applyReset = (reset = {}) => {
|
|
|
4214
4506
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
4215
4507
|
const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
|
|
4216
4508
|
if (RESET2.html)
|
|
4217
|
-
(0,
|
|
4218
|
-
return (0,
|
|
4509
|
+
(0, import_utils26.overwriteDeep)(RESET2.html, globalTheme);
|
|
4510
|
+
return (0, import_utils26.deepMerge)((0, import_utils26.merge)(RESET2, reset), {
|
|
4219
4511
|
html: {
|
|
4220
4512
|
position: "absolute",
|
|
4221
4513
|
// overflow: 'hidden',
|
|
@@ -4254,9 +4546,9 @@ var applyReset = (reset = {}) => {
|
|
|
4254
4546
|
};
|
|
4255
4547
|
|
|
4256
4548
|
// src/set.js
|
|
4257
|
-
var
|
|
4549
|
+
var import_utils27 = __toESM(require_cjs(), 1);
|
|
4258
4550
|
var setCases = (val, key) => {
|
|
4259
|
-
if ((0,
|
|
4551
|
+
if ((0, import_utils27.isFunction)(val))
|
|
4260
4552
|
return val();
|
|
4261
4553
|
return val;
|
|
4262
4554
|
};
|