@symbo.ls/scratch 2.11.352 → 2.11.365
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/index.js +1533 -111
- package/dist/cjs/set.js +1514 -89
- package/dist/cjs/system/color.js +1471 -34
- package/dist/cjs/system/document.js +1461 -24
- package/dist/cjs/system/font.js +1469 -43
- package/dist/cjs/system/index.js +1520 -100
- package/dist/cjs/system/reset.js +1470 -33
- package/dist/cjs/system/shadow.js +1476 -53
- package/dist/cjs/system/spacing.js +1474 -51
- package/dist/cjs/system/svg.js +1463 -26
- package/dist/cjs/system/theme.js +1478 -41
- package/dist/cjs/system/timing.js +1469 -39
- package/dist/cjs/system/typography.js +1464 -32
- package/dist/cjs/transforms/index.js +1490 -70
- package/dist/cjs/utils/index.js +1466 -32
- package/dist/cjs/utils/sequence.js +1461 -27
- package/dist/cjs/utils/var.js +1459 -22
- package/package.json +3 -3
|
@@ -30,6 +30,1448 @@ 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
|
+
// ../utils/dist/cjs/index.js
|
|
34
|
+
var require_cjs = __commonJS({
|
|
35
|
+
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var __create2 = Object.create;
|
|
38
|
+
var __defProp2 = Object.defineProperty;
|
|
39
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
40
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
41
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
42
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
43
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
44
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
45
|
+
};
|
|
46
|
+
var __export2 = (target, all) => {
|
|
47
|
+
for (var name in all)
|
|
48
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
49
|
+
};
|
|
50
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
51
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
52
|
+
for (let key of __getOwnPropNames2(from))
|
|
53
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
54
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
55
|
+
}
|
|
56
|
+
return to;
|
|
57
|
+
};
|
|
58
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
59
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
60
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
61
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
62
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
63
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
64
|
+
mod
|
|
65
|
+
));
|
|
66
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
67
|
+
var require_key2 = __commonJS2({
|
|
68
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
69
|
+
"use strict";
|
|
70
|
+
var __defProp22 = Object.defineProperty;
|
|
71
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
72
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
73
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
74
|
+
var __export22 = (target, all) => {
|
|
75
|
+
for (var name in all)
|
|
76
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
77
|
+
};
|
|
78
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
79
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
80
|
+
for (let key of __getOwnPropNames22(from))
|
|
81
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
82
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
83
|
+
}
|
|
84
|
+
return to;
|
|
85
|
+
};
|
|
86
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
87
|
+
var key_exports = {};
|
|
88
|
+
__export22(key_exports, {
|
|
89
|
+
createSnapshotId: () => createSnapshotId,
|
|
90
|
+
generateKey: () => generateKey
|
|
91
|
+
});
|
|
92
|
+
module22.exports = __toCommonJS22(key_exports);
|
|
93
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
94
|
+
let index = 0;
|
|
95
|
+
function newId() {
|
|
96
|
+
index++;
|
|
97
|
+
return index;
|
|
98
|
+
}
|
|
99
|
+
return newId;
|
|
100
|
+
}();
|
|
101
|
+
var createSnapshotId = generateKey;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var require_env2 = __commonJS2({
|
|
105
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
106
|
+
"use strict";
|
|
107
|
+
var __defProp22 = Object.defineProperty;
|
|
108
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
109
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
110
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
111
|
+
var __export22 = (target, all) => {
|
|
112
|
+
for (var name in all)
|
|
113
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
114
|
+
};
|
|
115
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
116
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
117
|
+
for (let key of __getOwnPropNames22(from))
|
|
118
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
119
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
120
|
+
}
|
|
121
|
+
return to;
|
|
122
|
+
};
|
|
123
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
124
|
+
var env_exports = {};
|
|
125
|
+
__export22(env_exports, {
|
|
126
|
+
NODE_ENV: () => NODE_ENV,
|
|
127
|
+
getNev: () => getNev,
|
|
128
|
+
isDevelopment: () => isDevelopment,
|
|
129
|
+
isProduction: () => isProduction,
|
|
130
|
+
isTest: () => isTest
|
|
131
|
+
});
|
|
132
|
+
module22.exports = __toCommonJS22(env_exports);
|
|
133
|
+
var NODE_ENV = "development";
|
|
134
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
135
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
136
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
137
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
var require_globals2 = __commonJS2({
|
|
141
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
142
|
+
"use strict";
|
|
143
|
+
var __defProp22 = Object.defineProperty;
|
|
144
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
145
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
146
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
147
|
+
var __export22 = (target, all) => {
|
|
148
|
+
for (var name in all)
|
|
149
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
150
|
+
};
|
|
151
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
152
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
153
|
+
for (let key of __getOwnPropNames22(from))
|
|
154
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
155
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
156
|
+
}
|
|
157
|
+
return to;
|
|
158
|
+
};
|
|
159
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
160
|
+
var globals_exports = {};
|
|
161
|
+
__export22(globals_exports, {
|
|
162
|
+
document: () => document22,
|
|
163
|
+
global: () => global,
|
|
164
|
+
self: () => self,
|
|
165
|
+
window: () => window2
|
|
166
|
+
});
|
|
167
|
+
module22.exports = __toCommonJS22(globals_exports);
|
|
168
|
+
var global = globalThis;
|
|
169
|
+
var self = globalThis;
|
|
170
|
+
var window2 = globalThis;
|
|
171
|
+
var document22 = window2.document;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
var require_node2 = __commonJS2({
|
|
175
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
176
|
+
"use strict";
|
|
177
|
+
var __defProp22 = Object.defineProperty;
|
|
178
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
179
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
180
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
181
|
+
var __export22 = (target, all) => {
|
|
182
|
+
for (var name in all)
|
|
183
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
184
|
+
};
|
|
185
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
186
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
187
|
+
for (let key of __getOwnPropNames22(from))
|
|
188
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
189
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
190
|
+
}
|
|
191
|
+
return to;
|
|
192
|
+
};
|
|
193
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
194
|
+
var node_exports = {};
|
|
195
|
+
__export22(node_exports, {
|
|
196
|
+
isHtmlElement: () => isHtmlElement,
|
|
197
|
+
isNode: () => isNode
|
|
198
|
+
});
|
|
199
|
+
module22.exports = __toCommonJS22(node_exports);
|
|
200
|
+
var import_globals2 = require_globals2();
|
|
201
|
+
var isNode = (obj) => {
|
|
202
|
+
return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
203
|
+
};
|
|
204
|
+
var isHtmlElement = (obj) => {
|
|
205
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
var require_types2 = __commonJS2({
|
|
210
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
211
|
+
"use strict";
|
|
212
|
+
var __defProp22 = Object.defineProperty;
|
|
213
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
214
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
215
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
216
|
+
var __export22 = (target, all) => {
|
|
217
|
+
for (var name in all)
|
|
218
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
219
|
+
};
|
|
220
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
221
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
222
|
+
for (let key of __getOwnPropNames22(from))
|
|
223
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
224
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
225
|
+
}
|
|
226
|
+
return to;
|
|
227
|
+
};
|
|
228
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
229
|
+
var types_exports = {};
|
|
230
|
+
__export22(types_exports, {
|
|
231
|
+
TYPES: () => TYPES,
|
|
232
|
+
is: () => is,
|
|
233
|
+
isArray: () => isArray3,
|
|
234
|
+
isBoolean: () => isBoolean,
|
|
235
|
+
isDate: () => isDate,
|
|
236
|
+
isDefined: () => isDefined2,
|
|
237
|
+
isFunction: () => isFunction,
|
|
238
|
+
isNot: () => isNot,
|
|
239
|
+
isNull: () => isNull,
|
|
240
|
+
isNumber: () => isNumber2,
|
|
241
|
+
isObject: () => isObject3,
|
|
242
|
+
isObjectLike: () => isObjectLike2,
|
|
243
|
+
isString: () => isString22,
|
|
244
|
+
isUndefined: () => isUndefined
|
|
245
|
+
});
|
|
246
|
+
module22.exports = __toCommonJS22(types_exports);
|
|
247
|
+
var import_node = require_node2();
|
|
248
|
+
var isObject3 = (arg) => {
|
|
249
|
+
if (arg === null)
|
|
250
|
+
return false;
|
|
251
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
252
|
+
};
|
|
253
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
254
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
255
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
256
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
257
|
+
var isNull = (arg) => arg === null;
|
|
258
|
+
var isArray3 = (arg) => Array.isArray(arg);
|
|
259
|
+
var isDate = (d) => d instanceof Date;
|
|
260
|
+
var isObjectLike2 = (arg) => {
|
|
261
|
+
if (arg === null)
|
|
262
|
+
return false;
|
|
263
|
+
return typeof arg === "object";
|
|
264
|
+
};
|
|
265
|
+
var isDefined2 = (arg) => {
|
|
266
|
+
return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
267
|
+
};
|
|
268
|
+
var isUndefined = (arg) => {
|
|
269
|
+
return arg === void 0;
|
|
270
|
+
};
|
|
271
|
+
var TYPES = {
|
|
272
|
+
boolean: isBoolean,
|
|
273
|
+
array: isArray3,
|
|
274
|
+
object: isObject3,
|
|
275
|
+
string: isString22,
|
|
276
|
+
date: isDate,
|
|
277
|
+
number: isNumber2,
|
|
278
|
+
null: isNull,
|
|
279
|
+
function: isFunction,
|
|
280
|
+
objectLike: isObjectLike2,
|
|
281
|
+
node: import_node.isNode,
|
|
282
|
+
htmlElement: import_node.isHtmlElement,
|
|
283
|
+
defined: isDefined2
|
|
284
|
+
};
|
|
285
|
+
var is = (arg) => {
|
|
286
|
+
return (...args) => {
|
|
287
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
var isNot = (arg) => {
|
|
291
|
+
return (...args) => {
|
|
292
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
var require_array2 = __commonJS2({
|
|
298
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
|
|
299
|
+
"use strict";
|
|
300
|
+
var __defProp22 = Object.defineProperty;
|
|
301
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
302
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
303
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
304
|
+
var __export22 = (target, all) => {
|
|
305
|
+
for (var name in all)
|
|
306
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
307
|
+
};
|
|
308
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
309
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
310
|
+
for (let key of __getOwnPropNames22(from))
|
|
311
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
312
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
313
|
+
}
|
|
314
|
+
return to;
|
|
315
|
+
};
|
|
316
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
317
|
+
var array_exports = {};
|
|
318
|
+
__export22(array_exports, {
|
|
319
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
320
|
+
createNestedObject: () => createNestedObject,
|
|
321
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
322
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
323
|
+
joinArrays: () => joinArrays,
|
|
324
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
325
|
+
mergeArray: () => mergeArray,
|
|
326
|
+
removeFromArray: () => removeFromArray,
|
|
327
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
328
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
329
|
+
swapItemsInArray: () => swapItemsInArray
|
|
330
|
+
});
|
|
331
|
+
module22.exports = __toCommonJS22(array_exports);
|
|
332
|
+
var import_object = require_object2();
|
|
333
|
+
var import_types = require_types2();
|
|
334
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
335
|
+
return arr2.every((val) => arr1.includes(val));
|
|
336
|
+
};
|
|
337
|
+
var removeFromArray = (arr, index) => {
|
|
338
|
+
if ((0, import_types.isString)(index))
|
|
339
|
+
index = parseInt(index);
|
|
340
|
+
if ((0, import_types.isNumber)(index)) {
|
|
341
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
342
|
+
throw new Error("Invalid index");
|
|
343
|
+
}
|
|
344
|
+
arr.splice(index, 1);
|
|
345
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
346
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
347
|
+
} else {
|
|
348
|
+
throw new Error("Invalid index");
|
|
349
|
+
}
|
|
350
|
+
return arr;
|
|
351
|
+
};
|
|
352
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
353
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
354
|
+
};
|
|
355
|
+
var joinArrays = (...arrays) => {
|
|
356
|
+
return [].concat(...arrays);
|
|
357
|
+
};
|
|
358
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
359
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
360
|
+
};
|
|
361
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
362
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
363
|
+
};
|
|
364
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
365
|
+
const index = arr.indexOf(value);
|
|
366
|
+
if (index !== -1) {
|
|
367
|
+
return arr.slice(0, index);
|
|
368
|
+
}
|
|
369
|
+
return arr;
|
|
370
|
+
};
|
|
371
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
372
|
+
if (!(0, import_types.isArray)(arr))
|
|
373
|
+
return;
|
|
374
|
+
const index = arr.indexOf(value);
|
|
375
|
+
if (index !== -1) {
|
|
376
|
+
return arr.slice(index + 1);
|
|
377
|
+
}
|
|
378
|
+
return arr;
|
|
379
|
+
};
|
|
380
|
+
var createNestedObject = (arr, lastValue) => {
|
|
381
|
+
const nestedObject = {};
|
|
382
|
+
if (arr.length === 0) {
|
|
383
|
+
return lastValue;
|
|
384
|
+
}
|
|
385
|
+
arr.reduce((obj, value, index) => {
|
|
386
|
+
if (!obj[value]) {
|
|
387
|
+
obj[value] = {};
|
|
388
|
+
}
|
|
389
|
+
if (index === arr.length - 1 && lastValue) {
|
|
390
|
+
obj[value] = lastValue;
|
|
391
|
+
}
|
|
392
|
+
return obj[value];
|
|
393
|
+
}, nestedObject);
|
|
394
|
+
return nestedObject;
|
|
395
|
+
};
|
|
396
|
+
var removeValueFromArray = (arr, value) => {
|
|
397
|
+
const index = arr.indexOf(value);
|
|
398
|
+
if (index > -1) {
|
|
399
|
+
const newArray = [...arr];
|
|
400
|
+
newArray.splice(index, 1);
|
|
401
|
+
return newArray;
|
|
402
|
+
}
|
|
403
|
+
return arr.slice();
|
|
404
|
+
};
|
|
405
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
406
|
+
return arr.filter((item) => item !== value);
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
var require_string2 = __commonJS2({
|
|
411
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
412
|
+
"use strict";
|
|
413
|
+
var __defProp22 = Object.defineProperty;
|
|
414
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
415
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
416
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
417
|
+
var __export22 = (target, all) => {
|
|
418
|
+
for (var name in all)
|
|
419
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
420
|
+
};
|
|
421
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
422
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
423
|
+
for (let key of __getOwnPropNames22(from))
|
|
424
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
425
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
426
|
+
}
|
|
427
|
+
return to;
|
|
428
|
+
};
|
|
429
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
430
|
+
var string_exports = {};
|
|
431
|
+
__export22(string_exports, {
|
|
432
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
433
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
434
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
435
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
436
|
+
});
|
|
437
|
+
module22.exports = __toCommonJS22(string_exports);
|
|
438
|
+
var stringIncludesAny = (str, characters) => {
|
|
439
|
+
for (const char of characters) {
|
|
440
|
+
if (str.includes(char)) {
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return false;
|
|
445
|
+
};
|
|
446
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
447
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
448
|
+
return str.replace(pattern, "");
|
|
449
|
+
};
|
|
450
|
+
var brackRegex = {
|
|
451
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
452
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
453
|
+
};
|
|
454
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
455
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
456
|
+
return str;
|
|
457
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
458
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
459
|
+
if (parentPath) {
|
|
460
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
461
|
+
let parentState = state;
|
|
462
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
463
|
+
parentState = parentState.parent;
|
|
464
|
+
if (!parentState) {
|
|
465
|
+
return "";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
const value = parentState[variable.trim()];
|
|
469
|
+
return value !== void 0 ? `${value}` : "";
|
|
470
|
+
} else {
|
|
471
|
+
const value = state[variable.trim()];
|
|
472
|
+
return value !== void 0 ? `${value}` : "";
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
};
|
|
476
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
477
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
var require_object2 = __commonJS2({
|
|
482
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
483
|
+
"use strict";
|
|
484
|
+
var __defProp22 = Object.defineProperty;
|
|
485
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
486
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
487
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
488
|
+
var __export22 = (target, all) => {
|
|
489
|
+
for (var name in all)
|
|
490
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
491
|
+
};
|
|
492
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
493
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
494
|
+
for (let key of __getOwnPropNames22(from))
|
|
495
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
496
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
497
|
+
}
|
|
498
|
+
return to;
|
|
499
|
+
};
|
|
500
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
501
|
+
var object_exports = {};
|
|
502
|
+
__export22(object_exports, {
|
|
503
|
+
clone: () => clone,
|
|
504
|
+
deepClone: () => deepClone2,
|
|
505
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
506
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
507
|
+
deepContains: () => deepContains,
|
|
508
|
+
deepDestringify: () => deepDestringify,
|
|
509
|
+
deepDiff: () => deepDiff,
|
|
510
|
+
deepMerge: () => deepMerge2,
|
|
511
|
+
deepStringify: () => deepStringify,
|
|
512
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
513
|
+
diff: () => diff,
|
|
514
|
+
diffArrays: () => diffArrays,
|
|
515
|
+
diffObjects: () => diffObjects,
|
|
516
|
+
exec: () => exec,
|
|
517
|
+
flattenRecursive: () => flattenRecursive,
|
|
518
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
519
|
+
isEmpty: () => isEmpty,
|
|
520
|
+
isEmptyObject: () => isEmptyObject,
|
|
521
|
+
isEqualDeep: () => isEqualDeep,
|
|
522
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
523
|
+
map: () => map,
|
|
524
|
+
merge: () => merge,
|
|
525
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
526
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
527
|
+
objectToString: () => objectToString,
|
|
528
|
+
overwrite: () => overwrite,
|
|
529
|
+
overwriteDeep: () => overwriteDeep,
|
|
530
|
+
overwriteShallow: () => overwriteShallow,
|
|
531
|
+
removeFromObject: () => removeFromObject,
|
|
532
|
+
stringToObject: () => stringToObject
|
|
533
|
+
});
|
|
534
|
+
module22.exports = __toCommonJS22(object_exports);
|
|
535
|
+
var import_globals2 = require_globals2();
|
|
536
|
+
var import_types = require_types2();
|
|
537
|
+
var import_array = require_array2();
|
|
538
|
+
var import_string = require_string2();
|
|
539
|
+
var exec = (param, element, state, context) => {
|
|
540
|
+
if ((0, import_types.isFunction)(param)) {
|
|
541
|
+
return param(
|
|
542
|
+
element,
|
|
543
|
+
state || element.state,
|
|
544
|
+
context || element.context
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
return param;
|
|
548
|
+
};
|
|
549
|
+
var map = (obj, extention, element) => {
|
|
550
|
+
for (const e in extention) {
|
|
551
|
+
obj[e] = exec(extention[e], element);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
var merge = (element, obj, excludeFrom = []) => {
|
|
555
|
+
for (const e in obj) {
|
|
556
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
557
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
558
|
+
continue;
|
|
559
|
+
const elementProp = element[e];
|
|
560
|
+
const objProp = obj[e];
|
|
561
|
+
if (elementProp === void 0) {
|
|
562
|
+
element[e] = objProp;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return element;
|
|
566
|
+
};
|
|
567
|
+
var deepMerge2 = (element, extend, excludeFrom = []) => {
|
|
568
|
+
for (const e in extend) {
|
|
569
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
570
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
571
|
+
continue;
|
|
572
|
+
const elementProp = element[e];
|
|
573
|
+
const extendProp = extend[e];
|
|
574
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
575
|
+
deepMerge2(elementProp, extendProp, excludeFrom);
|
|
576
|
+
} else if (elementProp === void 0) {
|
|
577
|
+
element[e] = extendProp;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return element;
|
|
581
|
+
};
|
|
582
|
+
var clone = (obj, excludeFrom = []) => {
|
|
583
|
+
const o = {};
|
|
584
|
+
for (const prop in obj) {
|
|
585
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
586
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
587
|
+
continue;
|
|
588
|
+
o[prop] = obj[prop];
|
|
589
|
+
}
|
|
590
|
+
return o;
|
|
591
|
+
};
|
|
592
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
593
|
+
if ((0, import_types.isArray)(obj)) {
|
|
594
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
595
|
+
}
|
|
596
|
+
const o = {};
|
|
597
|
+
for (const k in obj) {
|
|
598
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
599
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
600
|
+
continue;
|
|
601
|
+
let v = obj[k];
|
|
602
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
603
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
604
|
+
}
|
|
605
|
+
if ((0, import_types.isArray)(v)) {
|
|
606
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
607
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
608
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
609
|
+
} else
|
|
610
|
+
o[k] = v;
|
|
611
|
+
}
|
|
612
|
+
return o;
|
|
613
|
+
};
|
|
614
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
615
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
616
|
+
};
|
|
617
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
618
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
619
|
+
for (const prop in obj) {
|
|
620
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
621
|
+
continue;
|
|
622
|
+
if (prop === "__proto__")
|
|
623
|
+
continue;
|
|
624
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
625
|
+
continue;
|
|
626
|
+
let objProp = obj[prop];
|
|
627
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
628
|
+
continue;
|
|
629
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
630
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
631
|
+
}
|
|
632
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
633
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
634
|
+
} else
|
|
635
|
+
o[prop] = objProp;
|
|
636
|
+
}
|
|
637
|
+
return o;
|
|
638
|
+
};
|
|
639
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
640
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
641
|
+
for (const prop in obj) {
|
|
642
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
643
|
+
continue;
|
|
644
|
+
const objProp = obj[prop];
|
|
645
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
646
|
+
continue;
|
|
647
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
648
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
649
|
+
} else
|
|
650
|
+
o[prop] = objProp;
|
|
651
|
+
}
|
|
652
|
+
return o;
|
|
653
|
+
};
|
|
654
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
655
|
+
for (const prop in obj) {
|
|
656
|
+
const objProp = obj[prop];
|
|
657
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
658
|
+
stringified[prop] = objProp.toString();
|
|
659
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
660
|
+
stringified[prop] = {};
|
|
661
|
+
deepStringify(objProp, stringified[prop]);
|
|
662
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
663
|
+
stringified[prop] = [];
|
|
664
|
+
objProp.forEach((v, i) => {
|
|
665
|
+
if ((0, import_types.isObject)(v)) {
|
|
666
|
+
stringified[prop][i] = {};
|
|
667
|
+
deepStringify(v, stringified[prop][i]);
|
|
668
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
669
|
+
stringified[prop][i] = v.toString();
|
|
670
|
+
} else {
|
|
671
|
+
stringified[prop][i] = v;
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
} else {
|
|
675
|
+
stringified[prop] = objProp;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
return stringified;
|
|
679
|
+
};
|
|
680
|
+
var objectToString = (obj, indent = 0) => {
|
|
681
|
+
const spaces = " ".repeat(indent);
|
|
682
|
+
let str = "{\n";
|
|
683
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
684
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
685
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
686
|
+
str += `${spaces} ${stringedKey}: `;
|
|
687
|
+
if ((0, import_types.isArray)(value)) {
|
|
688
|
+
str += "[\n";
|
|
689
|
+
for (const element of value) {
|
|
690
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
691
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
692
|
+
`;
|
|
693
|
+
} else if ((0, import_types.isString)(element)) {
|
|
694
|
+
str += `${spaces} '${element}',
|
|
695
|
+
`;
|
|
696
|
+
} else {
|
|
697
|
+
str += `${spaces} ${element},
|
|
698
|
+
`;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
str += `${spaces} ]`;
|
|
702
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
703
|
+
str += objectToString(value, indent + 1);
|
|
704
|
+
} else if ((0, import_types.isString)(value)) {
|
|
705
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
706
|
+
} else {
|
|
707
|
+
str += value;
|
|
708
|
+
}
|
|
709
|
+
str += ",\n";
|
|
710
|
+
}
|
|
711
|
+
str += `${spaces}}`;
|
|
712
|
+
return str;
|
|
713
|
+
};
|
|
714
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
715
|
+
for (const prop in obj) {
|
|
716
|
+
const objProp = obj[prop];
|
|
717
|
+
if ((0, import_types.isFunction)(objProp))
|
|
718
|
+
continue;
|
|
719
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
720
|
+
detached[prop] = {};
|
|
721
|
+
deepStringify(objProp, detached[prop]);
|
|
722
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
723
|
+
detached[prop] = [];
|
|
724
|
+
objProp.forEach((v, i) => {
|
|
725
|
+
if ((0, import_types.isFunction)(v))
|
|
726
|
+
return;
|
|
727
|
+
if ((0, import_types.isObject)(v)) {
|
|
728
|
+
detached[prop][i] = {};
|
|
729
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
730
|
+
} else {
|
|
731
|
+
detached[prop][i] = v;
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
} else {
|
|
735
|
+
detached[prop] = objProp;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return detached;
|
|
739
|
+
};
|
|
740
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
741
|
+
for (const prop in obj) {
|
|
742
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
743
|
+
if (!hasOwnProperty2)
|
|
744
|
+
continue;
|
|
745
|
+
const objProp = obj[prop];
|
|
746
|
+
if ((0, import_types.isString)(objProp)) {
|
|
747
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
|
|
748
|
+
try {
|
|
749
|
+
const evalProp = import_globals2.window.eval(`(${objProp})`);
|
|
750
|
+
destringified[prop] = evalProp;
|
|
751
|
+
} catch (e) {
|
|
752
|
+
if (e)
|
|
753
|
+
destringified[prop] = objProp;
|
|
754
|
+
}
|
|
755
|
+
} else {
|
|
756
|
+
destringified[prop] = objProp;
|
|
757
|
+
}
|
|
758
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
759
|
+
destringified[prop] = [];
|
|
760
|
+
objProp.forEach((arrProp) => {
|
|
761
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
762
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
763
|
+
try {
|
|
764
|
+
const evalProp = import_globals2.window.eval(`(${arrProp})`);
|
|
765
|
+
destringified[prop].push(evalProp);
|
|
766
|
+
} catch (e) {
|
|
767
|
+
if (e)
|
|
768
|
+
destringified[prop].push(arrProp);
|
|
769
|
+
}
|
|
770
|
+
} else {
|
|
771
|
+
destringified[prop].push(arrProp);
|
|
772
|
+
}
|
|
773
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
774
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
775
|
+
} else {
|
|
776
|
+
destringified[prop].push(arrProp);
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
780
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
781
|
+
} else {
|
|
782
|
+
destringified[prop] = objProp;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return destringified;
|
|
786
|
+
};
|
|
787
|
+
var stringToObject = (str, verbose) => {
|
|
788
|
+
try {
|
|
789
|
+
return import_globals2.window.eval("(" + str + ")");
|
|
790
|
+
} catch (e) {
|
|
791
|
+
if (verbose)
|
|
792
|
+
console.warn(e);
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
796
|
+
for (const e in objToDiff) {
|
|
797
|
+
if (e === "ref")
|
|
798
|
+
continue;
|
|
799
|
+
const originalProp = original[e];
|
|
800
|
+
const objToDiffProp = objToDiff[e];
|
|
801
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
802
|
+
cache[e] = {};
|
|
803
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
804
|
+
} else if (objToDiffProp !== void 0) {
|
|
805
|
+
cache[e] = objToDiffProp;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return cache;
|
|
809
|
+
};
|
|
810
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
811
|
+
if (original.length !== objToDiff.length) {
|
|
812
|
+
cache = objToDiff;
|
|
813
|
+
} else {
|
|
814
|
+
const diffArr = [];
|
|
815
|
+
for (let i = 0; i < original.length; i++) {
|
|
816
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
817
|
+
if (Object.keys(diffObj).length > 0) {
|
|
818
|
+
diffArr.push(diffObj);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
if (diffArr.length > 0) {
|
|
822
|
+
cache = diffArr;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return cache;
|
|
826
|
+
};
|
|
827
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
828
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
829
|
+
cache = [];
|
|
830
|
+
diffArrays(original, objToDiff, cache);
|
|
831
|
+
} else {
|
|
832
|
+
diffObjects(original, objToDiff, cache);
|
|
833
|
+
}
|
|
834
|
+
return cache;
|
|
835
|
+
};
|
|
836
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
837
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
838
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
839
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
840
|
+
var deepDiff = (lhs, rhs) => {
|
|
841
|
+
if (lhs === rhs)
|
|
842
|
+
return {};
|
|
843
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
844
|
+
return rhs;
|
|
845
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
846
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
847
|
+
acc[key] = void 0;
|
|
848
|
+
}
|
|
849
|
+
return acc;
|
|
850
|
+
}, makeObjectWithoutPrototype());
|
|
851
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
852
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
853
|
+
return {};
|
|
854
|
+
return rhs;
|
|
855
|
+
}
|
|
856
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
857
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
858
|
+
acc[key] = rhs[key];
|
|
859
|
+
return acc;
|
|
860
|
+
}
|
|
861
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
862
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
863
|
+
return acc;
|
|
864
|
+
}
|
|
865
|
+
acc[key] = difference;
|
|
866
|
+
return acc;
|
|
867
|
+
}, deletedValues);
|
|
868
|
+
};
|
|
869
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
870
|
+
const { ref } = element;
|
|
871
|
+
const changes = {};
|
|
872
|
+
for (const e in params) {
|
|
873
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
874
|
+
continue;
|
|
875
|
+
const elementProp = element[e];
|
|
876
|
+
const paramsProp = params[e];
|
|
877
|
+
if (paramsProp) {
|
|
878
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
879
|
+
ref[e] = paramsProp;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return changes;
|
|
883
|
+
};
|
|
884
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
885
|
+
for (const e in params) {
|
|
886
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
887
|
+
continue;
|
|
888
|
+
obj[e] = params[e];
|
|
889
|
+
}
|
|
890
|
+
return obj;
|
|
891
|
+
};
|
|
892
|
+
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
893
|
+
for (const e in params) {
|
|
894
|
+
if (e === "__proto__")
|
|
895
|
+
continue;
|
|
896
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
897
|
+
continue;
|
|
898
|
+
const objProp = obj[e];
|
|
899
|
+
const paramsProp = params[e];
|
|
900
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
901
|
+
overwriteDeep(objProp, paramsProp);
|
|
902
|
+
} else if (paramsProp !== void 0) {
|
|
903
|
+
obj[e] = paramsProp;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return obj;
|
|
907
|
+
};
|
|
908
|
+
var mergeIfExisted = (a, b) => {
|
|
909
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
910
|
+
return deepMerge2(a, b);
|
|
911
|
+
return a || b;
|
|
912
|
+
};
|
|
913
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
914
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
915
|
+
stack.push(objectized);
|
|
916
|
+
const extendOfExtend = objectized[prop];
|
|
917
|
+
if (extendOfExtend)
|
|
918
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
919
|
+
delete objectized[prop];
|
|
920
|
+
return stack;
|
|
921
|
+
};
|
|
922
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
923
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
924
|
+
return param === element;
|
|
925
|
+
}
|
|
926
|
+
if (visited.has(param) || visited.has(element)) {
|
|
927
|
+
return true;
|
|
928
|
+
}
|
|
929
|
+
visited.add(param);
|
|
930
|
+
visited.add(element);
|
|
931
|
+
const keysParam = Object.keys(param);
|
|
932
|
+
const keysElement = Object.keys(element);
|
|
933
|
+
if (keysParam.length !== keysElement.length) {
|
|
934
|
+
return false;
|
|
935
|
+
}
|
|
936
|
+
for (const key of keysParam) {
|
|
937
|
+
if (!keysElement.includes(key)) {
|
|
938
|
+
return false;
|
|
939
|
+
}
|
|
940
|
+
const paramProp = param[key];
|
|
941
|
+
const elementProp = element[key];
|
|
942
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
943
|
+
return false;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
return true;
|
|
947
|
+
};
|
|
948
|
+
var deepContains = (obj1, obj2) => {
|
|
949
|
+
if (typeof obj1 !== typeof obj2) {
|
|
950
|
+
return false;
|
|
951
|
+
}
|
|
952
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
953
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
954
|
+
if (obj1.length !== obj2.length) {
|
|
955
|
+
return false;
|
|
956
|
+
}
|
|
957
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
958
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
959
|
+
return false;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
963
|
+
for (const key in obj1) {
|
|
964
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
965
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
966
|
+
return false;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
} else {
|
|
971
|
+
return obj2 === obj1;
|
|
972
|
+
}
|
|
973
|
+
return true;
|
|
974
|
+
};
|
|
975
|
+
var removeFromObject = (obj, props) => {
|
|
976
|
+
if (props === void 0 || props === null)
|
|
977
|
+
return obj;
|
|
978
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
979
|
+
delete obj[props];
|
|
980
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
981
|
+
props.forEach((prop) => delete obj[prop]);
|
|
982
|
+
} else {
|
|
983
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
984
|
+
}
|
|
985
|
+
return obj;
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
var require_function2 = __commonJS2({
|
|
990
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
991
|
+
"use strict";
|
|
992
|
+
var __defProp22 = Object.defineProperty;
|
|
993
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
994
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
995
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
996
|
+
var __export22 = (target, all) => {
|
|
997
|
+
for (var name in all)
|
|
998
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
999
|
+
};
|
|
1000
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1001
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1002
|
+
for (let key of __getOwnPropNames22(from))
|
|
1003
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1004
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1005
|
+
}
|
|
1006
|
+
return to;
|
|
1007
|
+
};
|
|
1008
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1009
|
+
var function_exports = {};
|
|
1010
|
+
__export22(function_exports, {
|
|
1011
|
+
debounce: () => debounce,
|
|
1012
|
+
debounceOnContext: () => debounceOnContext,
|
|
1013
|
+
isStringFunction: () => isStringFunction,
|
|
1014
|
+
memoize: () => memoize
|
|
1015
|
+
});
|
|
1016
|
+
module22.exports = __toCommonJS22(function_exports);
|
|
1017
|
+
function debounce(func, wait, immediate) {
|
|
1018
|
+
let timeout;
|
|
1019
|
+
return function() {
|
|
1020
|
+
const context = this;
|
|
1021
|
+
const args = arguments;
|
|
1022
|
+
const later = function() {
|
|
1023
|
+
timeout = null;
|
|
1024
|
+
if (!immediate)
|
|
1025
|
+
func.apply(context, args);
|
|
1026
|
+
};
|
|
1027
|
+
const callNow = immediate && !timeout;
|
|
1028
|
+
clearTimeout(timeout);
|
|
1029
|
+
timeout = setTimeout(later, wait);
|
|
1030
|
+
if (callNow)
|
|
1031
|
+
func.apply(context, args);
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
1035
|
+
let timer;
|
|
1036
|
+
return (...args) => {
|
|
1037
|
+
clearTimeout(timer);
|
|
1038
|
+
timer = setTimeout(() => {
|
|
1039
|
+
func.apply(element, args);
|
|
1040
|
+
}, timeout);
|
|
1041
|
+
};
|
|
1042
|
+
};
|
|
1043
|
+
var memoize = (fn) => {
|
|
1044
|
+
const cache = {};
|
|
1045
|
+
return (...args) => {
|
|
1046
|
+
const n = args[0];
|
|
1047
|
+
if (n in cache) {
|
|
1048
|
+
return cache[n];
|
|
1049
|
+
} else {
|
|
1050
|
+
const result = fn(n);
|
|
1051
|
+
cache[n] = result;
|
|
1052
|
+
return result;
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
};
|
|
1056
|
+
var isStringFunction = (inputString) => {
|
|
1057
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
1058
|
+
return functionRegex.test(inputString);
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
var require_log2 = __commonJS2({
|
|
1063
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
1064
|
+
"use strict";
|
|
1065
|
+
var __defProp22 = Object.defineProperty;
|
|
1066
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1067
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1068
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1069
|
+
var __export22 = (target, all) => {
|
|
1070
|
+
for (var name in all)
|
|
1071
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1072
|
+
};
|
|
1073
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1074
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1075
|
+
for (let key of __getOwnPropNames22(from))
|
|
1076
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1077
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1078
|
+
}
|
|
1079
|
+
return to;
|
|
1080
|
+
};
|
|
1081
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1082
|
+
var log_exports = {};
|
|
1083
|
+
__export22(log_exports, {
|
|
1084
|
+
logGroupIf: () => logGroupIf,
|
|
1085
|
+
logIf: () => logIf
|
|
1086
|
+
});
|
|
1087
|
+
module22.exports = __toCommonJS22(log_exports);
|
|
1088
|
+
var logIf = (bool, ...arg) => {
|
|
1089
|
+
if (bool)
|
|
1090
|
+
arg.map((v) => console.log(v));
|
|
1091
|
+
};
|
|
1092
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
1093
|
+
if (bool) {
|
|
1094
|
+
console.group(key);
|
|
1095
|
+
arg.map((v) => console.log(v));
|
|
1096
|
+
console.groupEnd(key);
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
});
|
|
1101
|
+
var require_cookie2 = __commonJS2({
|
|
1102
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
1103
|
+
"use strict";
|
|
1104
|
+
var __defProp22 = Object.defineProperty;
|
|
1105
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1106
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1107
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1108
|
+
var __export22 = (target, all) => {
|
|
1109
|
+
for (var name in all)
|
|
1110
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1111
|
+
};
|
|
1112
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1113
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1114
|
+
for (let key of __getOwnPropNames22(from))
|
|
1115
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1116
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1117
|
+
}
|
|
1118
|
+
return to;
|
|
1119
|
+
};
|
|
1120
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1121
|
+
var cookie_exports = {};
|
|
1122
|
+
__export22(cookie_exports, {
|
|
1123
|
+
getCookie: () => getCookie,
|
|
1124
|
+
isMobile: () => isMobile,
|
|
1125
|
+
setCookie: () => setCookie
|
|
1126
|
+
});
|
|
1127
|
+
module22.exports = __toCommonJS22(cookie_exports);
|
|
1128
|
+
var import_types = require_types2();
|
|
1129
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1130
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1131
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1132
|
+
return;
|
|
1133
|
+
const d = /* @__PURE__ */ new Date();
|
|
1134
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1135
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
1136
|
+
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1137
|
+
};
|
|
1138
|
+
var getCookie = (cname) => {
|
|
1139
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
1140
|
+
return;
|
|
1141
|
+
const name = `${cname}=`;
|
|
1142
|
+
const decodedCookie = decodeURIComponent(document.cookie);
|
|
1143
|
+
const ca = decodedCookie.split(";");
|
|
1144
|
+
for (let i = 0; i < ca.length; i++) {
|
|
1145
|
+
let c = ca[i];
|
|
1146
|
+
while (c.charAt(0) === " ")
|
|
1147
|
+
c = c.substring(1);
|
|
1148
|
+
if (c.indexOf(name) === 0)
|
|
1149
|
+
return c.substring(name.length, c.length);
|
|
1150
|
+
}
|
|
1151
|
+
return "";
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
var require_tags2 = __commonJS2({
|
|
1156
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
1157
|
+
"use strict";
|
|
1158
|
+
var __defProp22 = Object.defineProperty;
|
|
1159
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1160
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1161
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1162
|
+
var __export22 = (target, all) => {
|
|
1163
|
+
for (var name in all)
|
|
1164
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1165
|
+
};
|
|
1166
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1167
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1168
|
+
for (let key of __getOwnPropNames22(from))
|
|
1169
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1170
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1171
|
+
}
|
|
1172
|
+
return to;
|
|
1173
|
+
};
|
|
1174
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1175
|
+
var tags_exports = {};
|
|
1176
|
+
__export22(tags_exports, {
|
|
1177
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
1178
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
1179
|
+
});
|
|
1180
|
+
module22.exports = __toCommonJS22(tags_exports);
|
|
1181
|
+
var HTML_TAGS = {
|
|
1182
|
+
root: [
|
|
1183
|
+
"body",
|
|
1184
|
+
"html"
|
|
1185
|
+
],
|
|
1186
|
+
head: [
|
|
1187
|
+
"title",
|
|
1188
|
+
"base",
|
|
1189
|
+
"meta",
|
|
1190
|
+
"style"
|
|
1191
|
+
],
|
|
1192
|
+
body: [
|
|
1193
|
+
"string",
|
|
1194
|
+
"fragment",
|
|
1195
|
+
"a",
|
|
1196
|
+
"abbr",
|
|
1197
|
+
"acronym",
|
|
1198
|
+
"address",
|
|
1199
|
+
"applet",
|
|
1200
|
+
"area",
|
|
1201
|
+
"article",
|
|
1202
|
+
"aside",
|
|
1203
|
+
"audio",
|
|
1204
|
+
"b",
|
|
1205
|
+
"basefont",
|
|
1206
|
+
"bdi",
|
|
1207
|
+
"bdo",
|
|
1208
|
+
"big",
|
|
1209
|
+
"blockquote",
|
|
1210
|
+
"br",
|
|
1211
|
+
"button",
|
|
1212
|
+
"canvas",
|
|
1213
|
+
"caption",
|
|
1214
|
+
"center",
|
|
1215
|
+
"cite",
|
|
1216
|
+
"code",
|
|
1217
|
+
"search",
|
|
1218
|
+
"col",
|
|
1219
|
+
"colgroup",
|
|
1220
|
+
"data",
|
|
1221
|
+
"datalist",
|
|
1222
|
+
"dd",
|
|
1223
|
+
"del",
|
|
1224
|
+
"details",
|
|
1225
|
+
"dfn",
|
|
1226
|
+
"dialog",
|
|
1227
|
+
"dir",
|
|
1228
|
+
"div",
|
|
1229
|
+
"dl",
|
|
1230
|
+
"dt",
|
|
1231
|
+
"em",
|
|
1232
|
+
"embed",
|
|
1233
|
+
"fieldset",
|
|
1234
|
+
"figcaption",
|
|
1235
|
+
"figure",
|
|
1236
|
+
"font",
|
|
1237
|
+
"footer",
|
|
1238
|
+
"form",
|
|
1239
|
+
"frame",
|
|
1240
|
+
"frameset",
|
|
1241
|
+
"h1",
|
|
1242
|
+
"h2",
|
|
1243
|
+
"h3",
|
|
1244
|
+
"h4",
|
|
1245
|
+
"h5",
|
|
1246
|
+
"h6",
|
|
1247
|
+
"head",
|
|
1248
|
+
"header",
|
|
1249
|
+
"hr",
|
|
1250
|
+
"i",
|
|
1251
|
+
"iframe",
|
|
1252
|
+
"img",
|
|
1253
|
+
"input",
|
|
1254
|
+
"ins",
|
|
1255
|
+
"kbd",
|
|
1256
|
+
"label",
|
|
1257
|
+
"legend",
|
|
1258
|
+
"li",
|
|
1259
|
+
"link",
|
|
1260
|
+
"main",
|
|
1261
|
+
"map",
|
|
1262
|
+
"mark",
|
|
1263
|
+
"meter",
|
|
1264
|
+
"nav",
|
|
1265
|
+
"noframes",
|
|
1266
|
+
"noscript",
|
|
1267
|
+
"object",
|
|
1268
|
+
"ol",
|
|
1269
|
+
"optgroup",
|
|
1270
|
+
"option",
|
|
1271
|
+
"output",
|
|
1272
|
+
"p",
|
|
1273
|
+
"param",
|
|
1274
|
+
"picture",
|
|
1275
|
+
"pre",
|
|
1276
|
+
"progress",
|
|
1277
|
+
"hgroup",
|
|
1278
|
+
"q",
|
|
1279
|
+
"rp",
|
|
1280
|
+
"rt",
|
|
1281
|
+
"ruby",
|
|
1282
|
+
"s",
|
|
1283
|
+
"samp",
|
|
1284
|
+
"script",
|
|
1285
|
+
"section",
|
|
1286
|
+
"select",
|
|
1287
|
+
"small",
|
|
1288
|
+
"source",
|
|
1289
|
+
"span",
|
|
1290
|
+
"strike",
|
|
1291
|
+
"strong",
|
|
1292
|
+
"sub",
|
|
1293
|
+
"summary",
|
|
1294
|
+
"sup",
|
|
1295
|
+
"table",
|
|
1296
|
+
"tbody",
|
|
1297
|
+
"td",
|
|
1298
|
+
"template",
|
|
1299
|
+
"hgroup",
|
|
1300
|
+
"textarea",
|
|
1301
|
+
"tfoot",
|
|
1302
|
+
"th",
|
|
1303
|
+
"thead",
|
|
1304
|
+
"time",
|
|
1305
|
+
"tr",
|
|
1306
|
+
"track",
|
|
1307
|
+
"tt",
|
|
1308
|
+
"u",
|
|
1309
|
+
"ul",
|
|
1310
|
+
"var",
|
|
1311
|
+
"video",
|
|
1312
|
+
"wbr",
|
|
1313
|
+
// SVG
|
|
1314
|
+
"svg",
|
|
1315
|
+
"path"
|
|
1316
|
+
]
|
|
1317
|
+
};
|
|
1318
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
var require_cjs4 = __commonJS2({
|
|
1322
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
1323
|
+
"use strict";
|
|
1324
|
+
var __defProp22 = Object.defineProperty;
|
|
1325
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1326
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1327
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1328
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1329
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1330
|
+
for (let key of __getOwnPropNames22(from))
|
|
1331
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1332
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1333
|
+
}
|
|
1334
|
+
return to;
|
|
1335
|
+
};
|
|
1336
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
1337
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1338
|
+
var utils_exports = {};
|
|
1339
|
+
module22.exports = __toCommonJS22(utils_exports);
|
|
1340
|
+
__reExport(utils_exports, require_key2(), module22.exports);
|
|
1341
|
+
__reExport(utils_exports, require_env2(), module22.exports);
|
|
1342
|
+
__reExport(utils_exports, require_types2(), module22.exports);
|
|
1343
|
+
__reExport(utils_exports, require_object2(), module22.exports);
|
|
1344
|
+
__reExport(utils_exports, require_function2(), module22.exports);
|
|
1345
|
+
__reExport(utils_exports, require_array2(), module22.exports);
|
|
1346
|
+
__reExport(utils_exports, require_node2(), module22.exports);
|
|
1347
|
+
__reExport(utils_exports, require_log2(), module22.exports);
|
|
1348
|
+
__reExport(utils_exports, require_string2(), module22.exports);
|
|
1349
|
+
__reExport(utils_exports, require_globals2(), module22.exports);
|
|
1350
|
+
__reExport(utils_exports, require_cookie2(), module22.exports);
|
|
1351
|
+
__reExport(utils_exports, require_tags2(), module22.exports);
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
var src_exports = {};
|
|
1355
|
+
__export2(src_exports, {
|
|
1356
|
+
arrayzeValue: () => arrayzeValue,
|
|
1357
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
1358
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
1359
|
+
findClosestNumber: () => findClosestNumber,
|
|
1360
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
1361
|
+
formatDate: () => formatDate,
|
|
1362
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
1363
|
+
removeChars: () => removeChars,
|
|
1364
|
+
toCamelCase: () => toCamelCase2,
|
|
1365
|
+
toDashCase: () => toDashCase2,
|
|
1366
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
1367
|
+
toTitleCase: () => toTitleCase,
|
|
1368
|
+
toggleFullscreen: () => toggleFullscreen
|
|
1369
|
+
});
|
|
1370
|
+
module2.exports = __toCommonJS2(src_exports);
|
|
1371
|
+
var import_utils22 = __toESM2(require_cjs4(), 1);
|
|
1372
|
+
var toggleFullscreen = (el) => {
|
|
1373
|
+
if (!document.fullscreenElement) {
|
|
1374
|
+
el.node.requestFullscreen().catch((err) => {
|
|
1375
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
1376
|
+
});
|
|
1377
|
+
} else {
|
|
1378
|
+
document.exitFullscreen();
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
var import_utils9 = __toESM2(require_cjs4(), 1);
|
|
1382
|
+
var findClosestNumber = (number, arr) => {
|
|
1383
|
+
return ((0, import_utils9.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
1384
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
1385
|
+
});
|
|
1386
|
+
};
|
|
1387
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
1388
|
+
val = parseFloat(val);
|
|
1389
|
+
if ((0, import_utils9.isObject)(factory))
|
|
1390
|
+
factory = Object.values(factory);
|
|
1391
|
+
return findClosestNumber(val, factory);
|
|
1392
|
+
};
|
|
1393
|
+
var formatDate = (timestamp) => {
|
|
1394
|
+
if (!timestamp)
|
|
1395
|
+
return "";
|
|
1396
|
+
const d = new Date(timestamp);
|
|
1397
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
1398
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
1399
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
1400
|
+
return `${da} ${mo}, ${ye}`;
|
|
1401
|
+
};
|
|
1402
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
1403
|
+
const fib = [0, 1];
|
|
1404
|
+
for (let i = 2; i <= n; i++) {
|
|
1405
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
1406
|
+
}
|
|
1407
|
+
return fib[n];
|
|
1408
|
+
};
|
|
1409
|
+
var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
|
|
1410
|
+
return new Promise((resolve, reject) => {
|
|
1411
|
+
try {
|
|
1412
|
+
const scriptEle = doc.createElement("script");
|
|
1413
|
+
scriptEle.type = type;
|
|
1414
|
+
scriptEle.async = async;
|
|
1415
|
+
scriptEle.src = FILE_URL;
|
|
1416
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
1417
|
+
resolve({
|
|
1418
|
+
status: true
|
|
1419
|
+
});
|
|
1420
|
+
});
|
|
1421
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
1422
|
+
reject({
|
|
1423
|
+
status: false,
|
|
1424
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
1425
|
+
});
|
|
1426
|
+
});
|
|
1427
|
+
doc.body.appendChild(scriptEle);
|
|
1428
|
+
} catch (error) {
|
|
1429
|
+
reject(error);
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
};
|
|
1433
|
+
var copyStringToClipboard = (str) => {
|
|
1434
|
+
const el = document.createElement("textarea");
|
|
1435
|
+
el.value = str;
|
|
1436
|
+
el.setAttribute("readonly", "");
|
|
1437
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
1438
|
+
document.body.appendChild(el);
|
|
1439
|
+
el.select();
|
|
1440
|
+
document.execCommand("copy");
|
|
1441
|
+
document.body.removeChild(el);
|
|
1442
|
+
};
|
|
1443
|
+
var removeChars = (str) => {
|
|
1444
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
1445
|
+
};
|
|
1446
|
+
var toCamelCase2 = (str) => {
|
|
1447
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
1448
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
1449
|
+
}).replaceAll(/\s+/g, "");
|
|
1450
|
+
};
|
|
1451
|
+
var toTitleCase = (str) => str && str.replace(
|
|
1452
|
+
/\w\S*/g,
|
|
1453
|
+
(txt) => {
|
|
1454
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
1455
|
+
}
|
|
1456
|
+
);
|
|
1457
|
+
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
1458
|
+
var toDescriptionCase = (str = "") => {
|
|
1459
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
1460
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
1461
|
+
};
|
|
1462
|
+
var arrayzeValue = (val) => {
|
|
1463
|
+
if ((0, import_utils22.isArray)(val))
|
|
1464
|
+
return val;
|
|
1465
|
+
if ((0, import_utils22.isString)(val))
|
|
1466
|
+
return val.split(" ");
|
|
1467
|
+
if ((0, import_utils22.isObject)(val))
|
|
1468
|
+
return Object.values(val);
|
|
1469
|
+
if ((0, import_utils22.isNumber)(val))
|
|
1470
|
+
return [val];
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
});
|
|
1474
|
+
|
|
33
1475
|
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
1476
|
var require_key = __commonJS({
|
|
35
1477
|
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
@@ -205,32 +1647,32 @@ var require_types = __commonJS({
|
|
|
205
1647
|
__export2(types_exports, {
|
|
206
1648
|
TYPES: () => TYPES,
|
|
207
1649
|
is: () => is,
|
|
208
|
-
isArray: () =>
|
|
1650
|
+
isArray: () => isArray2,
|
|
209
1651
|
isBoolean: () => isBoolean,
|
|
210
1652
|
isDate: () => isDate,
|
|
211
1653
|
isDefined: () => isDefined2,
|
|
212
1654
|
isFunction: () => isFunction,
|
|
213
1655
|
isNot: () => isNot,
|
|
214
1656
|
isNull: () => isNull,
|
|
215
|
-
isNumber: () =>
|
|
216
|
-
isObject: () =>
|
|
1657
|
+
isNumber: () => isNumber2,
|
|
1658
|
+
isObject: () => isObject2,
|
|
217
1659
|
isObjectLike: () => isObjectLike2,
|
|
218
|
-
isString: () =>
|
|
1660
|
+
isString: () => isString4,
|
|
219
1661
|
isUndefined: () => isUndefined
|
|
220
1662
|
});
|
|
221
1663
|
module2.exports = __toCommonJS2(types_exports);
|
|
222
1664
|
var import_node = require_node();
|
|
223
|
-
var
|
|
1665
|
+
var isObject2 = (arg) => {
|
|
224
1666
|
if (arg === null)
|
|
225
1667
|
return false;
|
|
226
1668
|
return typeof arg === "object" && arg.constructor === Object;
|
|
227
1669
|
};
|
|
228
|
-
var
|
|
229
|
-
var
|
|
1670
|
+
var isString4 = (arg) => typeof arg === "string";
|
|
1671
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
230
1672
|
var isFunction = (arg) => typeof arg === "function";
|
|
231
1673
|
var isBoolean = (arg) => arg === true || arg === false;
|
|
232
1674
|
var isNull = (arg) => arg === null;
|
|
233
|
-
var
|
|
1675
|
+
var isArray2 = (arg) => Array.isArray(arg);
|
|
234
1676
|
var isDate = (d) => d instanceof Date;
|
|
235
1677
|
var isObjectLike2 = (arg) => {
|
|
236
1678
|
if (arg === null)
|
|
@@ -238,18 +1680,18 @@ var require_types = __commonJS({
|
|
|
238
1680
|
return typeof arg === "object";
|
|
239
1681
|
};
|
|
240
1682
|
var isDefined2 = (arg) => {
|
|
241
|
-
return
|
|
1683
|
+
return isObject2(arg) || isObjectLike2(arg) || isString4(arg) || isNumber2(arg) || isFunction(arg) || isArray2(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
242
1684
|
};
|
|
243
1685
|
var isUndefined = (arg) => {
|
|
244
1686
|
return arg === void 0;
|
|
245
1687
|
};
|
|
246
1688
|
var TYPES = {
|
|
247
1689
|
boolean: isBoolean,
|
|
248
|
-
array:
|
|
249
|
-
object:
|
|
250
|
-
string:
|
|
1690
|
+
array: isArray2,
|
|
1691
|
+
object: isObject2,
|
|
1692
|
+
string: isString4,
|
|
251
1693
|
date: isDate,
|
|
252
|
-
number:
|
|
1694
|
+
number: isNumber2,
|
|
253
1695
|
null: isNull,
|
|
254
1696
|
function: isFunction,
|
|
255
1697
|
objectLike: isObjectLike2,
|
|
@@ -1309,7 +2751,7 @@ var require_tags = __commonJS({
|
|
|
1309
2751
|
});
|
|
1310
2752
|
|
|
1311
2753
|
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1312
|
-
var
|
|
2754
|
+
var require_cjs2 = __commonJS({
|
|
1313
2755
|
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1314
2756
|
"use strict";
|
|
1315
2757
|
var __defProp2 = Object.defineProperty;
|
|
@@ -1344,7 +2786,7 @@ var require_cjs = __commonJS({
|
|
|
1344
2786
|
});
|
|
1345
2787
|
|
|
1346
2788
|
// ../../node_modules/@domql/globals/dist/cjs/index.js
|
|
1347
|
-
var
|
|
2789
|
+
var require_cjs3 = __commonJS({
|
|
1348
2790
|
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
1349
2791
|
"use strict";
|
|
1350
2792
|
var __defProp2 = Object.defineProperty;
|
|
@@ -1387,23 +2829,10 @@ __export(timing_exports, {
|
|
|
1387
2829
|
getTimingFunction: () => getTimingFunction
|
|
1388
2830
|
});
|
|
1389
2831
|
module.exports = __toCommonJS(timing_exports);
|
|
1390
|
-
|
|
1391
|
-
// ../../node_modules/@symbo.ls/utils/src/index.js
|
|
1392
|
-
var import_utils2 = __toESM(require_cjs());
|
|
1393
|
-
|
|
1394
|
-
// ../../node_modules/@symbo.ls/utils/src/scaling.js
|
|
1395
|
-
var import_utils = __toESM(require_cjs());
|
|
1396
|
-
|
|
1397
|
-
// ../../node_modules/@symbo.ls/utils/src/index.js
|
|
1398
|
-
var toCamelCase = (str) => {
|
|
1399
|
-
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
1400
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
1401
|
-
}).replaceAll(/\s+/g, "");
|
|
1402
|
-
};
|
|
1403
|
-
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2832
|
+
var import_utils7 = __toESM(require_cjs(), 1);
|
|
1404
2833
|
|
|
1405
2834
|
// src/factory.js
|
|
1406
|
-
var
|
|
2835
|
+
var import_utils = __toESM(require_cjs2(), 1);
|
|
1407
2836
|
|
|
1408
2837
|
// src/defaultConfig/index.js
|
|
1409
2838
|
var defaultConfig_exports = {};
|
|
@@ -1608,7 +3037,7 @@ var CONFIG = {
|
|
|
1608
3037
|
CSS_VARS,
|
|
1609
3038
|
...defaultConfig_exports
|
|
1610
3039
|
};
|
|
1611
|
-
var cachedConfig = (0,
|
|
3040
|
+
var cachedConfig = (0, import_utils.deepClone)(CONFIG);
|
|
1612
3041
|
var FACTORY = {
|
|
1613
3042
|
active: "0",
|
|
1614
3043
|
0: CONFIG
|
|
@@ -1623,11 +3052,12 @@ var isScalingUnit = (unit) => {
|
|
|
1623
3052
|
};
|
|
1624
3053
|
|
|
1625
3054
|
// src/utils/color.js
|
|
1626
|
-
var import_globals = __toESM(
|
|
1627
|
-
var
|
|
3055
|
+
var import_globals = __toESM(require_cjs3(), 1);
|
|
3056
|
+
var import_utils2 = __toESM(require_cjs2(), 1);
|
|
1628
3057
|
|
|
1629
3058
|
// src/utils/sequence.js
|
|
1630
|
-
var
|
|
3059
|
+
var import_utils3 = __toESM(require_cjs2(), 1);
|
|
3060
|
+
var import_utils4 = __toESM(require_cjs(), 1);
|
|
1631
3061
|
var numToLetterMap = {
|
|
1632
3062
|
"-6": "U",
|
|
1633
3063
|
"-5": "V",
|
|
@@ -1769,9 +3199,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1769
3199
|
unit = UNIT2.default,
|
|
1770
3200
|
useVariable
|
|
1771
3201
|
} = sequenceProps;
|
|
1772
|
-
if ((0,
|
|
3202
|
+
if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
|
|
1773
3203
|
return `var(${value})`;
|
|
1774
|
-
const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
3204
|
+
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
1775
3205
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
1776
3206
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
1777
3207
|
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)
|
|
@@ -1826,7 +3256,7 @@ var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
|
1826
3256
|
};
|
|
1827
3257
|
|
|
1828
3258
|
// src/utils/var.js
|
|
1829
|
-
var
|
|
3259
|
+
var import_utils5 = __toESM(require_cjs2(), 1);
|
|
1830
3260
|
var applySequenceGlobalVars = (vars, obj, options) => {
|
|
1831
3261
|
const CONFIG2 = getActiveConfig();
|
|
1832
3262
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
@@ -1868,7 +3298,7 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
1868
3298
|
};
|
|
1869
3299
|
|
|
1870
3300
|
// src/utils/sprite.js
|
|
1871
|
-
var
|
|
3301
|
+
var import_utils6 = __toESM(require_cjs2(), 1);
|
|
1872
3302
|
|
|
1873
3303
|
// src/system/timing.js
|
|
1874
3304
|
var applyTimingSequence = () => {
|
|
@@ -1880,7 +3310,7 @@ var applyTimingSequence = () => {
|
|
|
1880
3310
|
var getTimingFunction = (value) => {
|
|
1881
3311
|
const CONFIG2 = getActiveConfig();
|
|
1882
3312
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
1883
|
-
return TIMING2[value] || TIMING2[toCamelCase(value)] || value;
|
|
3313
|
+
return TIMING2[value] || TIMING2[(0, import_utils7.toCamelCase)(value)] || value;
|
|
1884
3314
|
};
|
|
1885
3315
|
var getTimingByKey = (value, property = "timing") => {
|
|
1886
3316
|
const CONFIG2 = getActiveConfig();
|