@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
package/dist/cjs/set.js
CHANGED
|
@@ -205,32 +205,32 @@ var require_types = __commonJS({
|
|
|
205
205
|
__export2(types_exports, {
|
|
206
206
|
TYPES: () => TYPES,
|
|
207
207
|
is: () => is,
|
|
208
|
-
isArray: () =>
|
|
208
|
+
isArray: () => isArray7,
|
|
209
209
|
isBoolean: () => isBoolean,
|
|
210
210
|
isDate: () => isDate,
|
|
211
211
|
isDefined: () => isDefined2,
|
|
212
212
|
isFunction: () => isFunction2,
|
|
213
213
|
isNot: () => isNot,
|
|
214
214
|
isNull: () => isNull,
|
|
215
|
-
isNumber: () =>
|
|
216
|
-
isObject: () =>
|
|
215
|
+
isNumber: () => isNumber2,
|
|
216
|
+
isObject: () => isObject6,
|
|
217
217
|
isObjectLike: () => isObjectLike3,
|
|
218
|
-
isString: () =>
|
|
218
|
+
isString: () => isString8,
|
|
219
219
|
isUndefined: () => isUndefined
|
|
220
220
|
});
|
|
221
221
|
module2.exports = __toCommonJS2(types_exports);
|
|
222
222
|
var import_node = require_node();
|
|
223
|
-
var
|
|
223
|
+
var isObject6 = (arg) => {
|
|
224
224
|
if (arg === null)
|
|
225
225
|
return false;
|
|
226
226
|
return typeof arg === "object" && arg.constructor === Object;
|
|
227
227
|
};
|
|
228
|
-
var
|
|
229
|
-
var
|
|
228
|
+
var isString8 = (arg) => typeof arg === "string";
|
|
229
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
230
230
|
var isFunction2 = (arg) => typeof arg === "function";
|
|
231
231
|
var isBoolean = (arg) => arg === true || arg === false;
|
|
232
232
|
var isNull = (arg) => arg === null;
|
|
233
|
-
var
|
|
233
|
+
var isArray7 = (arg) => Array.isArray(arg);
|
|
234
234
|
var isDate = (d) => d instanceof Date;
|
|
235
235
|
var isObjectLike3 = (arg) => {
|
|
236
236
|
if (arg === null)
|
|
@@ -238,18 +238,18 @@ var require_types = __commonJS({
|
|
|
238
238
|
return typeof arg === "object";
|
|
239
239
|
};
|
|
240
240
|
var isDefined2 = (arg) => {
|
|
241
|
-
return
|
|
241
|
+
return isObject6(arg) || isObjectLike3(arg) || isString8(arg) || isNumber2(arg) || isFunction2(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
242
242
|
};
|
|
243
243
|
var isUndefined = (arg) => {
|
|
244
244
|
return arg === void 0;
|
|
245
245
|
};
|
|
246
246
|
var TYPES = {
|
|
247
247
|
boolean: isBoolean,
|
|
248
|
-
array:
|
|
249
|
-
object:
|
|
250
|
-
string:
|
|
248
|
+
array: isArray7,
|
|
249
|
+
object: isObject6,
|
|
250
|
+
string: isString8,
|
|
251
251
|
date: isDate,
|
|
252
|
-
number:
|
|
252
|
+
number: isNumber2,
|
|
253
253
|
null: isNull,
|
|
254
254
|
function: isFunction2,
|
|
255
255
|
objectLike: isObjectLike3,
|
|
@@ -1379,6 +1379,1448 @@ var require_cjs2 = __commonJS({
|
|
|
1379
1379
|
}
|
|
1380
1380
|
});
|
|
1381
1381
|
|
|
1382
|
+
// ../utils/dist/cjs/index.js
|
|
1383
|
+
var require_cjs3 = __commonJS({
|
|
1384
|
+
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
1385
|
+
"use strict";
|
|
1386
|
+
var __create2 = Object.create;
|
|
1387
|
+
var __defProp2 = Object.defineProperty;
|
|
1388
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1389
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1390
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1391
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1392
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
1393
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1394
|
+
};
|
|
1395
|
+
var __export2 = (target, all) => {
|
|
1396
|
+
for (var name in all)
|
|
1397
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1398
|
+
};
|
|
1399
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1400
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1401
|
+
for (let key of __getOwnPropNames2(from))
|
|
1402
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1403
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1404
|
+
}
|
|
1405
|
+
return to;
|
|
1406
|
+
};
|
|
1407
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1408
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
1409
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
1410
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1411
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1412
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1413
|
+
mod
|
|
1414
|
+
));
|
|
1415
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1416
|
+
var require_key2 = __commonJS2({
|
|
1417
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1418
|
+
"use strict";
|
|
1419
|
+
var __defProp22 = Object.defineProperty;
|
|
1420
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1421
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1422
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1423
|
+
var __export22 = (target, all) => {
|
|
1424
|
+
for (var name in all)
|
|
1425
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1426
|
+
};
|
|
1427
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1428
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1429
|
+
for (let key of __getOwnPropNames22(from))
|
|
1430
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1431
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1432
|
+
}
|
|
1433
|
+
return to;
|
|
1434
|
+
};
|
|
1435
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1436
|
+
var key_exports = {};
|
|
1437
|
+
__export22(key_exports, {
|
|
1438
|
+
createSnapshotId: () => createSnapshotId,
|
|
1439
|
+
generateKey: () => generateKey
|
|
1440
|
+
});
|
|
1441
|
+
module22.exports = __toCommonJS22(key_exports);
|
|
1442
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
1443
|
+
let index = 0;
|
|
1444
|
+
function newId() {
|
|
1445
|
+
index++;
|
|
1446
|
+
return index;
|
|
1447
|
+
}
|
|
1448
|
+
return newId;
|
|
1449
|
+
}();
|
|
1450
|
+
var createSnapshotId = generateKey;
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
var require_env2 = __commonJS2({
|
|
1454
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
1455
|
+
"use strict";
|
|
1456
|
+
var __defProp22 = Object.defineProperty;
|
|
1457
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1458
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1459
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1460
|
+
var __export22 = (target, all) => {
|
|
1461
|
+
for (var name in all)
|
|
1462
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1463
|
+
};
|
|
1464
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1465
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1466
|
+
for (let key of __getOwnPropNames22(from))
|
|
1467
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1468
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1469
|
+
}
|
|
1470
|
+
return to;
|
|
1471
|
+
};
|
|
1472
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1473
|
+
var env_exports = {};
|
|
1474
|
+
__export22(env_exports, {
|
|
1475
|
+
NODE_ENV: () => NODE_ENV,
|
|
1476
|
+
getNev: () => getNev,
|
|
1477
|
+
isDevelopment: () => isDevelopment,
|
|
1478
|
+
isProduction: () => isProduction,
|
|
1479
|
+
isTest: () => isTest
|
|
1480
|
+
});
|
|
1481
|
+
module22.exports = __toCommonJS22(env_exports);
|
|
1482
|
+
var NODE_ENV = "development";
|
|
1483
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
1484
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
1485
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
1486
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
var require_globals2 = __commonJS2({
|
|
1490
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
1491
|
+
"use strict";
|
|
1492
|
+
var __defProp22 = Object.defineProperty;
|
|
1493
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1494
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1495
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1496
|
+
var __export22 = (target, all) => {
|
|
1497
|
+
for (var name in all)
|
|
1498
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1499
|
+
};
|
|
1500
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1501
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1502
|
+
for (let key of __getOwnPropNames22(from))
|
|
1503
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1504
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1505
|
+
}
|
|
1506
|
+
return to;
|
|
1507
|
+
};
|
|
1508
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1509
|
+
var globals_exports = {};
|
|
1510
|
+
__export22(globals_exports, {
|
|
1511
|
+
document: () => document22,
|
|
1512
|
+
global: () => global,
|
|
1513
|
+
self: () => self,
|
|
1514
|
+
window: () => window2
|
|
1515
|
+
});
|
|
1516
|
+
module22.exports = __toCommonJS22(globals_exports);
|
|
1517
|
+
var global = globalThis;
|
|
1518
|
+
var self = globalThis;
|
|
1519
|
+
var window2 = globalThis;
|
|
1520
|
+
var document22 = window2.document;
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
var require_node2 = __commonJS2({
|
|
1524
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
1525
|
+
"use strict";
|
|
1526
|
+
var __defProp22 = Object.defineProperty;
|
|
1527
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1528
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1529
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1530
|
+
var __export22 = (target, all) => {
|
|
1531
|
+
for (var name in all)
|
|
1532
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1533
|
+
};
|
|
1534
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1535
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1536
|
+
for (let key of __getOwnPropNames22(from))
|
|
1537
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1538
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1539
|
+
}
|
|
1540
|
+
return to;
|
|
1541
|
+
};
|
|
1542
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1543
|
+
var node_exports = {};
|
|
1544
|
+
__export22(node_exports, {
|
|
1545
|
+
isHtmlElement: () => isHtmlElement,
|
|
1546
|
+
isNode: () => isNode
|
|
1547
|
+
});
|
|
1548
|
+
module22.exports = __toCommonJS22(node_exports);
|
|
1549
|
+
var import_globals3 = require_globals2();
|
|
1550
|
+
var isNode = (obj) => {
|
|
1551
|
+
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
1552
|
+
};
|
|
1553
|
+
var isHtmlElement = (obj) => {
|
|
1554
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
});
|
|
1558
|
+
var require_types2 = __commonJS2({
|
|
1559
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
1560
|
+
"use strict";
|
|
1561
|
+
var __defProp22 = Object.defineProperty;
|
|
1562
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1563
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1564
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1565
|
+
var __export22 = (target, all) => {
|
|
1566
|
+
for (var name in all)
|
|
1567
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1568
|
+
};
|
|
1569
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1570
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1571
|
+
for (let key of __getOwnPropNames22(from))
|
|
1572
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1573
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1574
|
+
}
|
|
1575
|
+
return to;
|
|
1576
|
+
};
|
|
1577
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1578
|
+
var types_exports = {};
|
|
1579
|
+
__export22(types_exports, {
|
|
1580
|
+
TYPES: () => TYPES,
|
|
1581
|
+
is: () => is,
|
|
1582
|
+
isArray: () => isArray32,
|
|
1583
|
+
isBoolean: () => isBoolean,
|
|
1584
|
+
isDate: () => isDate,
|
|
1585
|
+
isDefined: () => isDefined2,
|
|
1586
|
+
isFunction: () => isFunction2,
|
|
1587
|
+
isNot: () => isNot,
|
|
1588
|
+
isNull: () => isNull,
|
|
1589
|
+
isNumber: () => isNumber2,
|
|
1590
|
+
isObject: () => isObject32,
|
|
1591
|
+
isObjectLike: () => isObjectLike3,
|
|
1592
|
+
isString: () => isString22,
|
|
1593
|
+
isUndefined: () => isUndefined
|
|
1594
|
+
});
|
|
1595
|
+
module22.exports = __toCommonJS22(types_exports);
|
|
1596
|
+
var import_node = require_node2();
|
|
1597
|
+
var isObject32 = (arg) => {
|
|
1598
|
+
if (arg === null)
|
|
1599
|
+
return false;
|
|
1600
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
1601
|
+
};
|
|
1602
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
1603
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
1604
|
+
var isFunction2 = (arg) => typeof arg === "function";
|
|
1605
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
1606
|
+
var isNull = (arg) => arg === null;
|
|
1607
|
+
var isArray32 = (arg) => Array.isArray(arg);
|
|
1608
|
+
var isDate = (d) => d instanceof Date;
|
|
1609
|
+
var isObjectLike3 = (arg) => {
|
|
1610
|
+
if (arg === null)
|
|
1611
|
+
return false;
|
|
1612
|
+
return typeof arg === "object";
|
|
1613
|
+
};
|
|
1614
|
+
var isDefined2 = (arg) => {
|
|
1615
|
+
return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction2(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
1616
|
+
};
|
|
1617
|
+
var isUndefined = (arg) => {
|
|
1618
|
+
return arg === void 0;
|
|
1619
|
+
};
|
|
1620
|
+
var TYPES = {
|
|
1621
|
+
boolean: isBoolean,
|
|
1622
|
+
array: isArray32,
|
|
1623
|
+
object: isObject32,
|
|
1624
|
+
string: isString22,
|
|
1625
|
+
date: isDate,
|
|
1626
|
+
number: isNumber2,
|
|
1627
|
+
null: isNull,
|
|
1628
|
+
function: isFunction2,
|
|
1629
|
+
objectLike: isObjectLike3,
|
|
1630
|
+
node: import_node.isNode,
|
|
1631
|
+
htmlElement: import_node.isHtmlElement,
|
|
1632
|
+
defined: isDefined2
|
|
1633
|
+
};
|
|
1634
|
+
var is = (arg) => {
|
|
1635
|
+
return (...args) => {
|
|
1636
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
var isNot = (arg) => {
|
|
1640
|
+
return (...args) => {
|
|
1641
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
1642
|
+
};
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
var require_array2 = __commonJS2({
|
|
1647
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
|
|
1648
|
+
"use strict";
|
|
1649
|
+
var __defProp22 = Object.defineProperty;
|
|
1650
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1651
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1652
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1653
|
+
var __export22 = (target, all) => {
|
|
1654
|
+
for (var name in all)
|
|
1655
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1656
|
+
};
|
|
1657
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1658
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1659
|
+
for (let key of __getOwnPropNames22(from))
|
|
1660
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1661
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1662
|
+
}
|
|
1663
|
+
return to;
|
|
1664
|
+
};
|
|
1665
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1666
|
+
var array_exports = {};
|
|
1667
|
+
__export22(array_exports, {
|
|
1668
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1669
|
+
createNestedObject: () => createNestedObject,
|
|
1670
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
1671
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
1672
|
+
joinArrays: () => joinArrays,
|
|
1673
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
1674
|
+
mergeArray: () => mergeArray,
|
|
1675
|
+
removeFromArray: () => removeFromArray,
|
|
1676
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
1677
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1678
|
+
swapItemsInArray: () => swapItemsInArray
|
|
1679
|
+
});
|
|
1680
|
+
module22.exports = __toCommonJS22(array_exports);
|
|
1681
|
+
var import_object = require_object2();
|
|
1682
|
+
var import_types = require_types2();
|
|
1683
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
1684
|
+
return arr2.every((val) => arr1.includes(val));
|
|
1685
|
+
};
|
|
1686
|
+
var removeFromArray = (arr, index) => {
|
|
1687
|
+
if ((0, import_types.isString)(index))
|
|
1688
|
+
index = parseInt(index);
|
|
1689
|
+
if ((0, import_types.isNumber)(index)) {
|
|
1690
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
1691
|
+
throw new Error("Invalid index");
|
|
1692
|
+
}
|
|
1693
|
+
arr.splice(index, 1);
|
|
1694
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
1695
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
1696
|
+
} else {
|
|
1697
|
+
throw new Error("Invalid index");
|
|
1698
|
+
}
|
|
1699
|
+
return arr;
|
|
1700
|
+
};
|
|
1701
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
1702
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1703
|
+
};
|
|
1704
|
+
var joinArrays = (...arrays) => {
|
|
1705
|
+
return [].concat(...arrays);
|
|
1706
|
+
};
|
|
1707
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
1708
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
1709
|
+
};
|
|
1710
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
1711
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
1712
|
+
};
|
|
1713
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
1714
|
+
const index = arr.indexOf(value);
|
|
1715
|
+
if (index !== -1) {
|
|
1716
|
+
return arr.slice(0, index);
|
|
1717
|
+
}
|
|
1718
|
+
return arr;
|
|
1719
|
+
};
|
|
1720
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
1721
|
+
if (!(0, import_types.isArray)(arr))
|
|
1722
|
+
return;
|
|
1723
|
+
const index = arr.indexOf(value);
|
|
1724
|
+
if (index !== -1) {
|
|
1725
|
+
return arr.slice(index + 1);
|
|
1726
|
+
}
|
|
1727
|
+
return arr;
|
|
1728
|
+
};
|
|
1729
|
+
var createNestedObject = (arr, lastValue) => {
|
|
1730
|
+
const nestedObject = {};
|
|
1731
|
+
if (arr.length === 0) {
|
|
1732
|
+
return lastValue;
|
|
1733
|
+
}
|
|
1734
|
+
arr.reduce((obj, value, index) => {
|
|
1735
|
+
if (!obj[value]) {
|
|
1736
|
+
obj[value] = {};
|
|
1737
|
+
}
|
|
1738
|
+
if (index === arr.length - 1 && lastValue) {
|
|
1739
|
+
obj[value] = lastValue;
|
|
1740
|
+
}
|
|
1741
|
+
return obj[value];
|
|
1742
|
+
}, nestedObject);
|
|
1743
|
+
return nestedObject;
|
|
1744
|
+
};
|
|
1745
|
+
var removeValueFromArray = (arr, value) => {
|
|
1746
|
+
const index = arr.indexOf(value);
|
|
1747
|
+
if (index > -1) {
|
|
1748
|
+
const newArray = [...arr];
|
|
1749
|
+
newArray.splice(index, 1);
|
|
1750
|
+
return newArray;
|
|
1751
|
+
}
|
|
1752
|
+
return arr.slice();
|
|
1753
|
+
};
|
|
1754
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
1755
|
+
return arr.filter((item) => item !== value);
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
var require_string2 = __commonJS2({
|
|
1760
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
1761
|
+
"use strict";
|
|
1762
|
+
var __defProp22 = Object.defineProperty;
|
|
1763
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1764
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1765
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1766
|
+
var __export22 = (target, all) => {
|
|
1767
|
+
for (var name in all)
|
|
1768
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1769
|
+
};
|
|
1770
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1771
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1772
|
+
for (let key of __getOwnPropNames22(from))
|
|
1773
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1774
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1775
|
+
}
|
|
1776
|
+
return to;
|
|
1777
|
+
};
|
|
1778
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1779
|
+
var string_exports = {};
|
|
1780
|
+
__export22(string_exports, {
|
|
1781
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
1782
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
1783
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
1784
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
1785
|
+
});
|
|
1786
|
+
module22.exports = __toCommonJS22(string_exports);
|
|
1787
|
+
var stringIncludesAny = (str, characters) => {
|
|
1788
|
+
for (const char of characters) {
|
|
1789
|
+
if (str.includes(char)) {
|
|
1790
|
+
return true;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
return false;
|
|
1794
|
+
};
|
|
1795
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
1796
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
1797
|
+
return str.replace(pattern, "");
|
|
1798
|
+
};
|
|
1799
|
+
var brackRegex = {
|
|
1800
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
1801
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
1802
|
+
};
|
|
1803
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
1804
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
1805
|
+
return str;
|
|
1806
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
1807
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
1808
|
+
if (parentPath) {
|
|
1809
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
1810
|
+
let parentState = state;
|
|
1811
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
1812
|
+
parentState = parentState.parent;
|
|
1813
|
+
if (!parentState) {
|
|
1814
|
+
return "";
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
const value = parentState[variable.trim()];
|
|
1818
|
+
return value !== void 0 ? `${value}` : "";
|
|
1819
|
+
} else {
|
|
1820
|
+
const value = state[variable.trim()];
|
|
1821
|
+
return value !== void 0 ? `${value}` : "";
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1824
|
+
};
|
|
1825
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
1826
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
var require_object2 = __commonJS2({
|
|
1831
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
1832
|
+
"use strict";
|
|
1833
|
+
var __defProp22 = Object.defineProperty;
|
|
1834
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1835
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1836
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1837
|
+
var __export22 = (target, all) => {
|
|
1838
|
+
for (var name in all)
|
|
1839
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1840
|
+
};
|
|
1841
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1842
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1843
|
+
for (let key of __getOwnPropNames22(from))
|
|
1844
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1845
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1846
|
+
}
|
|
1847
|
+
return to;
|
|
1848
|
+
};
|
|
1849
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1850
|
+
var object_exports = {};
|
|
1851
|
+
__export22(object_exports, {
|
|
1852
|
+
clone: () => clone,
|
|
1853
|
+
deepClone: () => deepClone2,
|
|
1854
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
1855
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
1856
|
+
deepContains: () => deepContains,
|
|
1857
|
+
deepDestringify: () => deepDestringify,
|
|
1858
|
+
deepDiff: () => deepDiff,
|
|
1859
|
+
deepMerge: () => deepMerge3,
|
|
1860
|
+
deepStringify: () => deepStringify,
|
|
1861
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
1862
|
+
diff: () => diff,
|
|
1863
|
+
diffArrays: () => diffArrays,
|
|
1864
|
+
diffObjects: () => diffObjects,
|
|
1865
|
+
exec: () => exec,
|
|
1866
|
+
flattenRecursive: () => flattenRecursive,
|
|
1867
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
1868
|
+
isEmpty: () => isEmpty,
|
|
1869
|
+
isEmptyObject: () => isEmptyObject,
|
|
1870
|
+
isEqualDeep: () => isEqualDeep,
|
|
1871
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
1872
|
+
map: () => map,
|
|
1873
|
+
merge: () => merge5,
|
|
1874
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
1875
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
1876
|
+
objectToString: () => objectToString,
|
|
1877
|
+
overwrite: () => overwrite,
|
|
1878
|
+
overwriteDeep: () => overwriteDeep2,
|
|
1879
|
+
overwriteShallow: () => overwriteShallow,
|
|
1880
|
+
removeFromObject: () => removeFromObject,
|
|
1881
|
+
stringToObject: () => stringToObject
|
|
1882
|
+
});
|
|
1883
|
+
module22.exports = __toCommonJS22(object_exports);
|
|
1884
|
+
var import_globals3 = require_globals2();
|
|
1885
|
+
var import_types = require_types2();
|
|
1886
|
+
var import_array = require_array2();
|
|
1887
|
+
var import_string = require_string2();
|
|
1888
|
+
var exec = (param, element, state, context) => {
|
|
1889
|
+
if ((0, import_types.isFunction)(param)) {
|
|
1890
|
+
return param(
|
|
1891
|
+
element,
|
|
1892
|
+
state || element.state,
|
|
1893
|
+
context || element.context
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1896
|
+
return param;
|
|
1897
|
+
};
|
|
1898
|
+
var map = (obj, extention, element) => {
|
|
1899
|
+
for (const e in extention) {
|
|
1900
|
+
obj[e] = exec(extention[e], element);
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
var merge5 = (element, obj, excludeFrom = []) => {
|
|
1904
|
+
for (const e in obj) {
|
|
1905
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
1906
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1907
|
+
continue;
|
|
1908
|
+
const elementProp = element[e];
|
|
1909
|
+
const objProp = obj[e];
|
|
1910
|
+
if (elementProp === void 0) {
|
|
1911
|
+
element[e] = objProp;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
return element;
|
|
1915
|
+
};
|
|
1916
|
+
var deepMerge3 = (element, extend, excludeFrom = []) => {
|
|
1917
|
+
for (const e in extend) {
|
|
1918
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
1919
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1920
|
+
continue;
|
|
1921
|
+
const elementProp = element[e];
|
|
1922
|
+
const extendProp = extend[e];
|
|
1923
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
1924
|
+
deepMerge3(elementProp, extendProp, excludeFrom);
|
|
1925
|
+
} else if (elementProp === void 0) {
|
|
1926
|
+
element[e] = extendProp;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
return element;
|
|
1930
|
+
};
|
|
1931
|
+
var clone = (obj, excludeFrom = []) => {
|
|
1932
|
+
const o = {};
|
|
1933
|
+
for (const prop in obj) {
|
|
1934
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1935
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1936
|
+
continue;
|
|
1937
|
+
o[prop] = obj[prop];
|
|
1938
|
+
}
|
|
1939
|
+
return o;
|
|
1940
|
+
};
|
|
1941
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
1942
|
+
if ((0, import_types.isArray)(obj)) {
|
|
1943
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
1944
|
+
}
|
|
1945
|
+
const o = {};
|
|
1946
|
+
for (const k in obj) {
|
|
1947
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
1948
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
1949
|
+
continue;
|
|
1950
|
+
let v = obj[k];
|
|
1951
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
1952
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
1953
|
+
}
|
|
1954
|
+
if ((0, import_types.isArray)(v)) {
|
|
1955
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
1956
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
1957
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
1958
|
+
} else
|
|
1959
|
+
o[k] = v;
|
|
1960
|
+
}
|
|
1961
|
+
return o;
|
|
1962
|
+
};
|
|
1963
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
1964
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
1965
|
+
};
|
|
1966
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
1967
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
1968
|
+
for (const prop in obj) {
|
|
1969
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1970
|
+
continue;
|
|
1971
|
+
if (prop === "__proto__")
|
|
1972
|
+
continue;
|
|
1973
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1974
|
+
continue;
|
|
1975
|
+
let objProp = obj[prop];
|
|
1976
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
1977
|
+
continue;
|
|
1978
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
1979
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
1980
|
+
}
|
|
1981
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
1982
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
1983
|
+
} else
|
|
1984
|
+
o[prop] = objProp;
|
|
1985
|
+
}
|
|
1986
|
+
return o;
|
|
1987
|
+
};
|
|
1988
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
1989
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
1990
|
+
for (const prop in obj) {
|
|
1991
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1992
|
+
continue;
|
|
1993
|
+
const objProp = obj[prop];
|
|
1994
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
1995
|
+
continue;
|
|
1996
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
1997
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
1998
|
+
} else
|
|
1999
|
+
o[prop] = objProp;
|
|
2000
|
+
}
|
|
2001
|
+
return o;
|
|
2002
|
+
};
|
|
2003
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
2004
|
+
for (const prop in obj) {
|
|
2005
|
+
const objProp = obj[prop];
|
|
2006
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
2007
|
+
stringified[prop] = objProp.toString();
|
|
2008
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2009
|
+
stringified[prop] = {};
|
|
2010
|
+
deepStringify(objProp, stringified[prop]);
|
|
2011
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2012
|
+
stringified[prop] = [];
|
|
2013
|
+
objProp.forEach((v, i) => {
|
|
2014
|
+
if ((0, import_types.isObject)(v)) {
|
|
2015
|
+
stringified[prop][i] = {};
|
|
2016
|
+
deepStringify(v, stringified[prop][i]);
|
|
2017
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
2018
|
+
stringified[prop][i] = v.toString();
|
|
2019
|
+
} else {
|
|
2020
|
+
stringified[prop][i] = v;
|
|
2021
|
+
}
|
|
2022
|
+
});
|
|
2023
|
+
} else {
|
|
2024
|
+
stringified[prop] = objProp;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
return stringified;
|
|
2028
|
+
};
|
|
2029
|
+
var objectToString = (obj, indent = 0) => {
|
|
2030
|
+
const spaces = " ".repeat(indent);
|
|
2031
|
+
let str = "{\n";
|
|
2032
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2033
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2034
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2035
|
+
str += `${spaces} ${stringedKey}: `;
|
|
2036
|
+
if ((0, import_types.isArray)(value)) {
|
|
2037
|
+
str += "[\n";
|
|
2038
|
+
for (const element of value) {
|
|
2039
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2040
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2041
|
+
`;
|
|
2042
|
+
} else if ((0, import_types.isString)(element)) {
|
|
2043
|
+
str += `${spaces} '${element}',
|
|
2044
|
+
`;
|
|
2045
|
+
} else {
|
|
2046
|
+
str += `${spaces} ${element},
|
|
2047
|
+
`;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
str += `${spaces} ]`;
|
|
2051
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2052
|
+
str += objectToString(value, indent + 1);
|
|
2053
|
+
} else if ((0, import_types.isString)(value)) {
|
|
2054
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2055
|
+
} else {
|
|
2056
|
+
str += value;
|
|
2057
|
+
}
|
|
2058
|
+
str += ",\n";
|
|
2059
|
+
}
|
|
2060
|
+
str += `${spaces}}`;
|
|
2061
|
+
return str;
|
|
2062
|
+
};
|
|
2063
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2064
|
+
for (const prop in obj) {
|
|
2065
|
+
const objProp = obj[prop];
|
|
2066
|
+
if ((0, import_types.isFunction)(objProp))
|
|
2067
|
+
continue;
|
|
2068
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
2069
|
+
detached[prop] = {};
|
|
2070
|
+
deepStringify(objProp, detached[prop]);
|
|
2071
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2072
|
+
detached[prop] = [];
|
|
2073
|
+
objProp.forEach((v, i) => {
|
|
2074
|
+
if ((0, import_types.isFunction)(v))
|
|
2075
|
+
return;
|
|
2076
|
+
if ((0, import_types.isObject)(v)) {
|
|
2077
|
+
detached[prop][i] = {};
|
|
2078
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2079
|
+
} else {
|
|
2080
|
+
detached[prop][i] = v;
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
} else {
|
|
2084
|
+
detached[prop] = objProp;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
return detached;
|
|
2088
|
+
};
|
|
2089
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
2090
|
+
for (const prop in obj) {
|
|
2091
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2092
|
+
if (!hasOwnProperty2)
|
|
2093
|
+
continue;
|
|
2094
|
+
const objProp = obj[prop];
|
|
2095
|
+
if ((0, import_types.isString)(objProp)) {
|
|
2096
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
|
|
2097
|
+
try {
|
|
2098
|
+
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2099
|
+
destringified[prop] = evalProp;
|
|
2100
|
+
} catch (e) {
|
|
2101
|
+
if (e)
|
|
2102
|
+
destringified[prop] = objProp;
|
|
2103
|
+
}
|
|
2104
|
+
} else {
|
|
2105
|
+
destringified[prop] = objProp;
|
|
2106
|
+
}
|
|
2107
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2108
|
+
destringified[prop] = [];
|
|
2109
|
+
objProp.forEach((arrProp) => {
|
|
2110
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
2111
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2112
|
+
try {
|
|
2113
|
+
const evalProp = import_globals3.window.eval(`(${arrProp})`);
|
|
2114
|
+
destringified[prop].push(evalProp);
|
|
2115
|
+
} catch (e) {
|
|
2116
|
+
if (e)
|
|
2117
|
+
destringified[prop].push(arrProp);
|
|
2118
|
+
}
|
|
2119
|
+
} else {
|
|
2120
|
+
destringified[prop].push(arrProp);
|
|
2121
|
+
}
|
|
2122
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2123
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
2124
|
+
} else {
|
|
2125
|
+
destringified[prop].push(arrProp);
|
|
2126
|
+
}
|
|
2127
|
+
});
|
|
2128
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2129
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2130
|
+
} else {
|
|
2131
|
+
destringified[prop] = objProp;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
return destringified;
|
|
2135
|
+
};
|
|
2136
|
+
var stringToObject = (str, verbose) => {
|
|
2137
|
+
try {
|
|
2138
|
+
return import_globals3.window.eval("(" + str + ")");
|
|
2139
|
+
} catch (e) {
|
|
2140
|
+
if (verbose)
|
|
2141
|
+
console.warn(e);
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
2145
|
+
for (const e in objToDiff) {
|
|
2146
|
+
if (e === "ref")
|
|
2147
|
+
continue;
|
|
2148
|
+
const originalProp = original[e];
|
|
2149
|
+
const objToDiffProp = objToDiff[e];
|
|
2150
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2151
|
+
cache[e] = {};
|
|
2152
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
2153
|
+
} else if (objToDiffProp !== void 0) {
|
|
2154
|
+
cache[e] = objToDiffProp;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
return cache;
|
|
2158
|
+
};
|
|
2159
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
2160
|
+
if (original.length !== objToDiff.length) {
|
|
2161
|
+
cache = objToDiff;
|
|
2162
|
+
} else {
|
|
2163
|
+
const diffArr = [];
|
|
2164
|
+
for (let i = 0; i < original.length; i++) {
|
|
2165
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
2166
|
+
if (Object.keys(diffObj).length > 0) {
|
|
2167
|
+
diffArr.push(diffObj);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
if (diffArr.length > 0) {
|
|
2171
|
+
cache = diffArr;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
return cache;
|
|
2175
|
+
};
|
|
2176
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
2177
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2178
|
+
cache = [];
|
|
2179
|
+
diffArrays(original, objToDiff, cache);
|
|
2180
|
+
} else {
|
|
2181
|
+
diffObjects(original, objToDiff, cache);
|
|
2182
|
+
}
|
|
2183
|
+
return cache;
|
|
2184
|
+
};
|
|
2185
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2186
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2187
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2188
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2189
|
+
var deepDiff = (lhs, rhs) => {
|
|
2190
|
+
if (lhs === rhs)
|
|
2191
|
+
return {};
|
|
2192
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2193
|
+
return rhs;
|
|
2194
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2195
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
2196
|
+
acc[key] = void 0;
|
|
2197
|
+
}
|
|
2198
|
+
return acc;
|
|
2199
|
+
}, makeObjectWithoutPrototype());
|
|
2200
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2201
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
2202
|
+
return {};
|
|
2203
|
+
return rhs;
|
|
2204
|
+
}
|
|
2205
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
2206
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
2207
|
+
acc[key] = rhs[key];
|
|
2208
|
+
return acc;
|
|
2209
|
+
}
|
|
2210
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
2211
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2212
|
+
return acc;
|
|
2213
|
+
}
|
|
2214
|
+
acc[key] = difference;
|
|
2215
|
+
return acc;
|
|
2216
|
+
}, deletedValues);
|
|
2217
|
+
};
|
|
2218
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
2219
|
+
const { ref } = element;
|
|
2220
|
+
const changes = {};
|
|
2221
|
+
for (const e in params) {
|
|
2222
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2223
|
+
continue;
|
|
2224
|
+
const elementProp = element[e];
|
|
2225
|
+
const paramsProp = params[e];
|
|
2226
|
+
if (paramsProp) {
|
|
2227
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
2228
|
+
ref[e] = paramsProp;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
return changes;
|
|
2232
|
+
};
|
|
2233
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2234
|
+
for (const e in params) {
|
|
2235
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2236
|
+
continue;
|
|
2237
|
+
obj[e] = params[e];
|
|
2238
|
+
}
|
|
2239
|
+
return obj;
|
|
2240
|
+
};
|
|
2241
|
+
var overwriteDeep2 = (obj, params, excludeFrom = []) => {
|
|
2242
|
+
for (const e in params) {
|
|
2243
|
+
if (e === "__proto__")
|
|
2244
|
+
continue;
|
|
2245
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2246
|
+
continue;
|
|
2247
|
+
const objProp = obj[e];
|
|
2248
|
+
const paramsProp = params[e];
|
|
2249
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2250
|
+
overwriteDeep2(objProp, paramsProp);
|
|
2251
|
+
} else if (paramsProp !== void 0) {
|
|
2252
|
+
obj[e] = paramsProp;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
return obj;
|
|
2256
|
+
};
|
|
2257
|
+
var mergeIfExisted = (a, b) => {
|
|
2258
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2259
|
+
return deepMerge3(a, b);
|
|
2260
|
+
return a || b;
|
|
2261
|
+
};
|
|
2262
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
2263
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2264
|
+
stack.push(objectized);
|
|
2265
|
+
const extendOfExtend = objectized[prop];
|
|
2266
|
+
if (extendOfExtend)
|
|
2267
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
2268
|
+
delete objectized[prop];
|
|
2269
|
+
return stack;
|
|
2270
|
+
};
|
|
2271
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2272
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2273
|
+
return param === element;
|
|
2274
|
+
}
|
|
2275
|
+
if (visited.has(param) || visited.has(element)) {
|
|
2276
|
+
return true;
|
|
2277
|
+
}
|
|
2278
|
+
visited.add(param);
|
|
2279
|
+
visited.add(element);
|
|
2280
|
+
const keysParam = Object.keys(param);
|
|
2281
|
+
const keysElement = Object.keys(element);
|
|
2282
|
+
if (keysParam.length !== keysElement.length) {
|
|
2283
|
+
return false;
|
|
2284
|
+
}
|
|
2285
|
+
for (const key of keysParam) {
|
|
2286
|
+
if (!keysElement.includes(key)) {
|
|
2287
|
+
return false;
|
|
2288
|
+
}
|
|
2289
|
+
const paramProp = param[key];
|
|
2290
|
+
const elementProp = element[key];
|
|
2291
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2292
|
+
return false;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
return true;
|
|
2296
|
+
};
|
|
2297
|
+
var deepContains = (obj1, obj2) => {
|
|
2298
|
+
if (typeof obj1 !== typeof obj2) {
|
|
2299
|
+
return false;
|
|
2300
|
+
}
|
|
2301
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2302
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2303
|
+
if (obj1.length !== obj2.length) {
|
|
2304
|
+
return false;
|
|
2305
|
+
}
|
|
2306
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
2307
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
2308
|
+
return false;
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2312
|
+
for (const key in obj1) {
|
|
2313
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2314
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2315
|
+
return false;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
} else {
|
|
2320
|
+
return obj2 === obj1;
|
|
2321
|
+
}
|
|
2322
|
+
return true;
|
|
2323
|
+
};
|
|
2324
|
+
var removeFromObject = (obj, props) => {
|
|
2325
|
+
if (props === void 0 || props === null)
|
|
2326
|
+
return obj;
|
|
2327
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
2328
|
+
delete obj[props];
|
|
2329
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
2330
|
+
props.forEach((prop) => delete obj[prop]);
|
|
2331
|
+
} else {
|
|
2332
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2333
|
+
}
|
|
2334
|
+
return obj;
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
var require_function2 = __commonJS2({
|
|
2339
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
2340
|
+
"use strict";
|
|
2341
|
+
var __defProp22 = Object.defineProperty;
|
|
2342
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2343
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2344
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2345
|
+
var __export22 = (target, all) => {
|
|
2346
|
+
for (var name in all)
|
|
2347
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2348
|
+
};
|
|
2349
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2350
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2351
|
+
for (let key of __getOwnPropNames22(from))
|
|
2352
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2353
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2354
|
+
}
|
|
2355
|
+
return to;
|
|
2356
|
+
};
|
|
2357
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2358
|
+
var function_exports = {};
|
|
2359
|
+
__export22(function_exports, {
|
|
2360
|
+
debounce: () => debounce,
|
|
2361
|
+
debounceOnContext: () => debounceOnContext,
|
|
2362
|
+
isStringFunction: () => isStringFunction,
|
|
2363
|
+
memoize: () => memoize
|
|
2364
|
+
});
|
|
2365
|
+
module22.exports = __toCommonJS22(function_exports);
|
|
2366
|
+
function debounce(func, wait, immediate) {
|
|
2367
|
+
let timeout;
|
|
2368
|
+
return function() {
|
|
2369
|
+
const context = this;
|
|
2370
|
+
const args = arguments;
|
|
2371
|
+
const later = function() {
|
|
2372
|
+
timeout = null;
|
|
2373
|
+
if (!immediate)
|
|
2374
|
+
func.apply(context, args);
|
|
2375
|
+
};
|
|
2376
|
+
const callNow = immediate && !timeout;
|
|
2377
|
+
clearTimeout(timeout);
|
|
2378
|
+
timeout = setTimeout(later, wait);
|
|
2379
|
+
if (callNow)
|
|
2380
|
+
func.apply(context, args);
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2384
|
+
let timer;
|
|
2385
|
+
return (...args) => {
|
|
2386
|
+
clearTimeout(timer);
|
|
2387
|
+
timer = setTimeout(() => {
|
|
2388
|
+
func.apply(element, args);
|
|
2389
|
+
}, timeout);
|
|
2390
|
+
};
|
|
2391
|
+
};
|
|
2392
|
+
var memoize = (fn) => {
|
|
2393
|
+
const cache = {};
|
|
2394
|
+
return (...args) => {
|
|
2395
|
+
const n = args[0];
|
|
2396
|
+
if (n in cache) {
|
|
2397
|
+
return cache[n];
|
|
2398
|
+
} else {
|
|
2399
|
+
const result = fn(n);
|
|
2400
|
+
cache[n] = result;
|
|
2401
|
+
return result;
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2405
|
+
var isStringFunction = (inputString) => {
|
|
2406
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
2407
|
+
return functionRegex.test(inputString);
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
});
|
|
2411
|
+
var require_log2 = __commonJS2({
|
|
2412
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
2413
|
+
"use strict";
|
|
2414
|
+
var __defProp22 = Object.defineProperty;
|
|
2415
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2416
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2417
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2418
|
+
var __export22 = (target, all) => {
|
|
2419
|
+
for (var name in all)
|
|
2420
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2421
|
+
};
|
|
2422
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2423
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2424
|
+
for (let key of __getOwnPropNames22(from))
|
|
2425
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2426
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2427
|
+
}
|
|
2428
|
+
return to;
|
|
2429
|
+
};
|
|
2430
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2431
|
+
var log_exports = {};
|
|
2432
|
+
__export22(log_exports, {
|
|
2433
|
+
logGroupIf: () => logGroupIf,
|
|
2434
|
+
logIf: () => logIf
|
|
2435
|
+
});
|
|
2436
|
+
module22.exports = __toCommonJS22(log_exports);
|
|
2437
|
+
var logIf = (bool, ...arg) => {
|
|
2438
|
+
if (bool)
|
|
2439
|
+
arg.map((v) => console.log(v));
|
|
2440
|
+
};
|
|
2441
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
2442
|
+
if (bool) {
|
|
2443
|
+
console.group(key);
|
|
2444
|
+
arg.map((v) => console.log(v));
|
|
2445
|
+
console.groupEnd(key);
|
|
2446
|
+
}
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
});
|
|
2450
|
+
var require_cookie2 = __commonJS2({
|
|
2451
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
2452
|
+
"use strict";
|
|
2453
|
+
var __defProp22 = Object.defineProperty;
|
|
2454
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2455
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2456
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2457
|
+
var __export22 = (target, all) => {
|
|
2458
|
+
for (var name in all)
|
|
2459
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2460
|
+
};
|
|
2461
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2462
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2463
|
+
for (let key of __getOwnPropNames22(from))
|
|
2464
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2465
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2466
|
+
}
|
|
2467
|
+
return to;
|
|
2468
|
+
};
|
|
2469
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2470
|
+
var cookie_exports = {};
|
|
2471
|
+
__export22(cookie_exports, {
|
|
2472
|
+
getCookie: () => getCookie,
|
|
2473
|
+
isMobile: () => isMobile,
|
|
2474
|
+
setCookie: () => setCookie
|
|
2475
|
+
});
|
|
2476
|
+
module22.exports = __toCommonJS22(cookie_exports);
|
|
2477
|
+
var import_types = require_types2();
|
|
2478
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2479
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2480
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2481
|
+
return;
|
|
2482
|
+
const d = /* @__PURE__ */ new Date();
|
|
2483
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2484
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
2485
|
+
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2486
|
+
};
|
|
2487
|
+
var getCookie = (cname) => {
|
|
2488
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2489
|
+
return;
|
|
2490
|
+
const name = `${cname}=`;
|
|
2491
|
+
const decodedCookie = decodeURIComponent(document.cookie);
|
|
2492
|
+
const ca = decodedCookie.split(";");
|
|
2493
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2494
|
+
let c = ca[i];
|
|
2495
|
+
while (c.charAt(0) === " ")
|
|
2496
|
+
c = c.substring(1);
|
|
2497
|
+
if (c.indexOf(name) === 0)
|
|
2498
|
+
return c.substring(name.length, c.length);
|
|
2499
|
+
}
|
|
2500
|
+
return "";
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
});
|
|
2504
|
+
var require_tags2 = __commonJS2({
|
|
2505
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
2506
|
+
"use strict";
|
|
2507
|
+
var __defProp22 = Object.defineProperty;
|
|
2508
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2509
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2510
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2511
|
+
var __export22 = (target, all) => {
|
|
2512
|
+
for (var name in all)
|
|
2513
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2514
|
+
};
|
|
2515
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2516
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2517
|
+
for (let key of __getOwnPropNames22(from))
|
|
2518
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2519
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2520
|
+
}
|
|
2521
|
+
return to;
|
|
2522
|
+
};
|
|
2523
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2524
|
+
var tags_exports = {};
|
|
2525
|
+
__export22(tags_exports, {
|
|
2526
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
2527
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
2528
|
+
});
|
|
2529
|
+
module22.exports = __toCommonJS22(tags_exports);
|
|
2530
|
+
var HTML_TAGS = {
|
|
2531
|
+
root: [
|
|
2532
|
+
"body",
|
|
2533
|
+
"html"
|
|
2534
|
+
],
|
|
2535
|
+
head: [
|
|
2536
|
+
"title",
|
|
2537
|
+
"base",
|
|
2538
|
+
"meta",
|
|
2539
|
+
"style"
|
|
2540
|
+
],
|
|
2541
|
+
body: [
|
|
2542
|
+
"string",
|
|
2543
|
+
"fragment",
|
|
2544
|
+
"a",
|
|
2545
|
+
"abbr",
|
|
2546
|
+
"acronym",
|
|
2547
|
+
"address",
|
|
2548
|
+
"applet",
|
|
2549
|
+
"area",
|
|
2550
|
+
"article",
|
|
2551
|
+
"aside",
|
|
2552
|
+
"audio",
|
|
2553
|
+
"b",
|
|
2554
|
+
"basefont",
|
|
2555
|
+
"bdi",
|
|
2556
|
+
"bdo",
|
|
2557
|
+
"big",
|
|
2558
|
+
"blockquote",
|
|
2559
|
+
"br",
|
|
2560
|
+
"button",
|
|
2561
|
+
"canvas",
|
|
2562
|
+
"caption",
|
|
2563
|
+
"center",
|
|
2564
|
+
"cite",
|
|
2565
|
+
"code",
|
|
2566
|
+
"search",
|
|
2567
|
+
"col",
|
|
2568
|
+
"colgroup",
|
|
2569
|
+
"data",
|
|
2570
|
+
"datalist",
|
|
2571
|
+
"dd",
|
|
2572
|
+
"del",
|
|
2573
|
+
"details",
|
|
2574
|
+
"dfn",
|
|
2575
|
+
"dialog",
|
|
2576
|
+
"dir",
|
|
2577
|
+
"div",
|
|
2578
|
+
"dl",
|
|
2579
|
+
"dt",
|
|
2580
|
+
"em",
|
|
2581
|
+
"embed",
|
|
2582
|
+
"fieldset",
|
|
2583
|
+
"figcaption",
|
|
2584
|
+
"figure",
|
|
2585
|
+
"font",
|
|
2586
|
+
"footer",
|
|
2587
|
+
"form",
|
|
2588
|
+
"frame",
|
|
2589
|
+
"frameset",
|
|
2590
|
+
"h1",
|
|
2591
|
+
"h2",
|
|
2592
|
+
"h3",
|
|
2593
|
+
"h4",
|
|
2594
|
+
"h5",
|
|
2595
|
+
"h6",
|
|
2596
|
+
"head",
|
|
2597
|
+
"header",
|
|
2598
|
+
"hr",
|
|
2599
|
+
"i",
|
|
2600
|
+
"iframe",
|
|
2601
|
+
"img",
|
|
2602
|
+
"input",
|
|
2603
|
+
"ins",
|
|
2604
|
+
"kbd",
|
|
2605
|
+
"label",
|
|
2606
|
+
"legend",
|
|
2607
|
+
"li",
|
|
2608
|
+
"link",
|
|
2609
|
+
"main",
|
|
2610
|
+
"map",
|
|
2611
|
+
"mark",
|
|
2612
|
+
"meter",
|
|
2613
|
+
"nav",
|
|
2614
|
+
"noframes",
|
|
2615
|
+
"noscript",
|
|
2616
|
+
"object",
|
|
2617
|
+
"ol",
|
|
2618
|
+
"optgroup",
|
|
2619
|
+
"option",
|
|
2620
|
+
"output",
|
|
2621
|
+
"p",
|
|
2622
|
+
"param",
|
|
2623
|
+
"picture",
|
|
2624
|
+
"pre",
|
|
2625
|
+
"progress",
|
|
2626
|
+
"hgroup",
|
|
2627
|
+
"q",
|
|
2628
|
+
"rp",
|
|
2629
|
+
"rt",
|
|
2630
|
+
"ruby",
|
|
2631
|
+
"s",
|
|
2632
|
+
"samp",
|
|
2633
|
+
"script",
|
|
2634
|
+
"section",
|
|
2635
|
+
"select",
|
|
2636
|
+
"small",
|
|
2637
|
+
"source",
|
|
2638
|
+
"span",
|
|
2639
|
+
"strike",
|
|
2640
|
+
"strong",
|
|
2641
|
+
"sub",
|
|
2642
|
+
"summary",
|
|
2643
|
+
"sup",
|
|
2644
|
+
"table",
|
|
2645
|
+
"tbody",
|
|
2646
|
+
"td",
|
|
2647
|
+
"template",
|
|
2648
|
+
"hgroup",
|
|
2649
|
+
"textarea",
|
|
2650
|
+
"tfoot",
|
|
2651
|
+
"th",
|
|
2652
|
+
"thead",
|
|
2653
|
+
"time",
|
|
2654
|
+
"tr",
|
|
2655
|
+
"track",
|
|
2656
|
+
"tt",
|
|
2657
|
+
"u",
|
|
2658
|
+
"ul",
|
|
2659
|
+
"var",
|
|
2660
|
+
"video",
|
|
2661
|
+
"wbr",
|
|
2662
|
+
// SVG
|
|
2663
|
+
"svg",
|
|
2664
|
+
"path"
|
|
2665
|
+
]
|
|
2666
|
+
};
|
|
2667
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
2668
|
+
}
|
|
2669
|
+
});
|
|
2670
|
+
var require_cjs4 = __commonJS2({
|
|
2671
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
2672
|
+
"use strict";
|
|
2673
|
+
var __defProp22 = Object.defineProperty;
|
|
2674
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2675
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2676
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2677
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2678
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2679
|
+
for (let key of __getOwnPropNames22(from))
|
|
2680
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2681
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2682
|
+
}
|
|
2683
|
+
return to;
|
|
2684
|
+
};
|
|
2685
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
2686
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2687
|
+
var utils_exports = {};
|
|
2688
|
+
module22.exports = __toCommonJS22(utils_exports);
|
|
2689
|
+
__reExport(utils_exports, require_key2(), module22.exports);
|
|
2690
|
+
__reExport(utils_exports, require_env2(), module22.exports);
|
|
2691
|
+
__reExport(utils_exports, require_types2(), module22.exports);
|
|
2692
|
+
__reExport(utils_exports, require_object2(), module22.exports);
|
|
2693
|
+
__reExport(utils_exports, require_function2(), module22.exports);
|
|
2694
|
+
__reExport(utils_exports, require_array2(), module22.exports);
|
|
2695
|
+
__reExport(utils_exports, require_node2(), module22.exports);
|
|
2696
|
+
__reExport(utils_exports, require_log2(), module22.exports);
|
|
2697
|
+
__reExport(utils_exports, require_string2(), module22.exports);
|
|
2698
|
+
__reExport(utils_exports, require_globals2(), module22.exports);
|
|
2699
|
+
__reExport(utils_exports, require_cookie2(), module22.exports);
|
|
2700
|
+
__reExport(utils_exports, require_tags2(), module22.exports);
|
|
2701
|
+
}
|
|
2702
|
+
});
|
|
2703
|
+
var src_exports = {};
|
|
2704
|
+
__export2(src_exports, {
|
|
2705
|
+
arrayzeValue: () => arrayzeValue3,
|
|
2706
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
2707
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
2708
|
+
findClosestNumber: () => findClosestNumber,
|
|
2709
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2710
|
+
formatDate: () => formatDate,
|
|
2711
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
2712
|
+
removeChars: () => removeChars,
|
|
2713
|
+
toCamelCase: () => toCamelCase2,
|
|
2714
|
+
toDashCase: () => toDashCase2,
|
|
2715
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
2716
|
+
toTitleCase: () => toTitleCase,
|
|
2717
|
+
toggleFullscreen: () => toggleFullscreen
|
|
2718
|
+
});
|
|
2719
|
+
module2.exports = __toCommonJS2(src_exports);
|
|
2720
|
+
var import_utils26 = __toESM2(require_cjs4(), 1);
|
|
2721
|
+
var toggleFullscreen = (el) => {
|
|
2722
|
+
if (!document.fullscreenElement) {
|
|
2723
|
+
el.node.requestFullscreen().catch((err) => {
|
|
2724
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
2725
|
+
});
|
|
2726
|
+
} else {
|
|
2727
|
+
document.exitFullscreen();
|
|
2728
|
+
}
|
|
2729
|
+
};
|
|
2730
|
+
var import_utils27 = __toESM2(require_cjs4(), 1);
|
|
2731
|
+
var findClosestNumber = (number, arr) => {
|
|
2732
|
+
return ((0, import_utils27.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
2733
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
2734
|
+
});
|
|
2735
|
+
};
|
|
2736
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
2737
|
+
val = parseFloat(val);
|
|
2738
|
+
if ((0, import_utils27.isObject)(factory))
|
|
2739
|
+
factory = Object.values(factory);
|
|
2740
|
+
return findClosestNumber(val, factory);
|
|
2741
|
+
};
|
|
2742
|
+
var formatDate = (timestamp) => {
|
|
2743
|
+
if (!timestamp)
|
|
2744
|
+
return "";
|
|
2745
|
+
const d = new Date(timestamp);
|
|
2746
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
2747
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
2748
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
2749
|
+
return `${da} ${mo}, ${ye}`;
|
|
2750
|
+
};
|
|
2751
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
2752
|
+
const fib = [0, 1];
|
|
2753
|
+
for (let i = 2; i <= n; i++) {
|
|
2754
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
2755
|
+
}
|
|
2756
|
+
return fib[n];
|
|
2757
|
+
};
|
|
2758
|
+
var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
|
|
2759
|
+
return new Promise((resolve, reject) => {
|
|
2760
|
+
try {
|
|
2761
|
+
const scriptEle = doc.createElement("script");
|
|
2762
|
+
scriptEle.type = type;
|
|
2763
|
+
scriptEle.async = async;
|
|
2764
|
+
scriptEle.src = FILE_URL;
|
|
2765
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
2766
|
+
resolve({
|
|
2767
|
+
status: true
|
|
2768
|
+
});
|
|
2769
|
+
});
|
|
2770
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
2771
|
+
reject({
|
|
2772
|
+
status: false,
|
|
2773
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
2774
|
+
});
|
|
2775
|
+
});
|
|
2776
|
+
doc.body.appendChild(scriptEle);
|
|
2777
|
+
} catch (error) {
|
|
2778
|
+
reject(error);
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
};
|
|
2782
|
+
var copyStringToClipboard = (str) => {
|
|
2783
|
+
const el = document.createElement("textarea");
|
|
2784
|
+
el.value = str;
|
|
2785
|
+
el.setAttribute("readonly", "");
|
|
2786
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
2787
|
+
document.body.appendChild(el);
|
|
2788
|
+
el.select();
|
|
2789
|
+
document.execCommand("copy");
|
|
2790
|
+
document.body.removeChild(el);
|
|
2791
|
+
};
|
|
2792
|
+
var removeChars = (str) => {
|
|
2793
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
2794
|
+
};
|
|
2795
|
+
var toCamelCase2 = (str) => {
|
|
2796
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
2797
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
2798
|
+
}).replaceAll(/\s+/g, "");
|
|
2799
|
+
};
|
|
2800
|
+
var toTitleCase = (str) => str && str.replace(
|
|
2801
|
+
/\w\S*/g,
|
|
2802
|
+
(txt) => {
|
|
2803
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
2804
|
+
}
|
|
2805
|
+
);
|
|
2806
|
+
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2807
|
+
var toDescriptionCase = (str = "") => {
|
|
2808
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
2809
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2810
|
+
};
|
|
2811
|
+
var arrayzeValue3 = (val) => {
|
|
2812
|
+
if ((0, import_utils26.isArray)(val))
|
|
2813
|
+
return val;
|
|
2814
|
+
if ((0, import_utils26.isString)(val))
|
|
2815
|
+
return val.split(" ");
|
|
2816
|
+
if ((0, import_utils26.isObject)(val))
|
|
2817
|
+
return Object.values(val);
|
|
2818
|
+
if ((0, import_utils26.isNumber)(val))
|
|
2819
|
+
return [val];
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
|
|
1382
2824
|
// src/set.js
|
|
1383
2825
|
var set_exports = {};
|
|
1384
2826
|
__export(set_exports, {
|
|
@@ -1612,7 +3054,7 @@ var setActiveConfig = (newConfig) => {
|
|
|
1612
3054
|
};
|
|
1613
3055
|
|
|
1614
3056
|
// src/system/color.js
|
|
1615
|
-
var
|
|
3057
|
+
var import_utils7 = __toESM(require_cjs(), 1);
|
|
1616
3058
|
|
|
1617
3059
|
// src/utils/unit.js
|
|
1618
3060
|
var isScalingUnit = (unit) => {
|
|
@@ -1748,28 +3190,8 @@ var getFontFaceEach = (name, weights) => {
|
|
|
1748
3190
|
};
|
|
1749
3191
|
|
|
1750
3192
|
// src/utils/sequence.js
|
|
1751
|
-
var
|
|
1752
|
-
|
|
1753
|
-
// ../../node_modules/@symbo.ls/utils/src/index.js
|
|
1754
|
-
var import_utils4 = __toESM(require_cjs());
|
|
1755
|
-
|
|
1756
|
-
// ../../node_modules/@symbo.ls/utils/src/scaling.js
|
|
1757
|
-
var import_utils3 = __toESM(require_cjs());
|
|
1758
|
-
|
|
1759
|
-
// ../../node_modules/@symbo.ls/utils/src/index.js
|
|
1760
|
-
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
1761
|
-
var arrayzeValue = (val) => {
|
|
1762
|
-
if ((0, import_utils4.isArray)(val))
|
|
1763
|
-
return val;
|
|
1764
|
-
if ((0, import_utils4.isString)(val))
|
|
1765
|
-
return val.split(" ");
|
|
1766
|
-
if ((0, import_utils4.isObject)(val))
|
|
1767
|
-
return Object.values(val);
|
|
1768
|
-
if ((0, import_utils4.isNumber)(val))
|
|
1769
|
-
return [val];
|
|
1770
|
-
};
|
|
1771
|
-
|
|
1772
|
-
// src/utils/sequence.js
|
|
3193
|
+
var import_utils3 = __toESM(require_cjs(), 1);
|
|
3194
|
+
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
1773
3195
|
var numToLetterMap = {
|
|
1774
3196
|
"-6": "U",
|
|
1775
3197
|
"-5": "V",
|
|
@@ -1911,9 +3333,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1911
3333
|
unit = UNIT2.default,
|
|
1912
3334
|
useVariable
|
|
1913
3335
|
} = sequenceProps;
|
|
1914
|
-
if ((0,
|
|
3336
|
+
if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
|
|
1915
3337
|
return `var(${value})`;
|
|
1916
|
-
const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
3338
|
+
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
1917
3339
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
1918
3340
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
1919
3341
|
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)
|
|
@@ -1976,7 +3398,7 @@ var findHeadings = (propertyNames) => {
|
|
|
1976
3398
|
};
|
|
1977
3399
|
|
|
1978
3400
|
// src/utils/var.js
|
|
1979
|
-
var
|
|
3401
|
+
var import_utils5 = __toESM(require_cjs(), 1);
|
|
1980
3402
|
var applySequenceGlobalVars = (vars, obj, options) => {
|
|
1981
3403
|
const CONFIG2 = getActiveConfig();
|
|
1982
3404
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
@@ -2047,9 +3469,9 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2047
3469
|
};
|
|
2048
3470
|
|
|
2049
3471
|
// src/utils/sprite.js
|
|
2050
|
-
var
|
|
3472
|
+
var import_utils6 = __toESM(require_cjs(), 1);
|
|
2051
3473
|
var parseRootAttributes = (htmlString) => {
|
|
2052
|
-
if (!(0,
|
|
3474
|
+
if (!(0, import_utils6.isString)(htmlString)) {
|
|
2053
3475
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
2054
3476
|
}
|
|
2055
3477
|
const match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -2069,7 +3491,7 @@ var replaceIdsAndUrls = (code, key) => {
|
|
|
2069
3491
|
const urlRegex = /url\(#([^)]*)\)/g;
|
|
2070
3492
|
const matches = code.match(/id="([^"]*)"/g);
|
|
2071
3493
|
let replacedCode = code;
|
|
2072
|
-
if ((0,
|
|
3494
|
+
if ((0, import_utils6.isArray)(matches)) {
|
|
2073
3495
|
matches.forEach(() => {
|
|
2074
3496
|
const randomKey = Math.floor(Math.random() * 1e5);
|
|
2075
3497
|
replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
|
|
@@ -2096,7 +3518,7 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
2096
3518
|
// src/system/color.js
|
|
2097
3519
|
var getColor = (value, key, config) => {
|
|
2098
3520
|
const CONFIG2 = config || getActiveConfig();
|
|
2099
|
-
if (!(0,
|
|
3521
|
+
if (!(0, import_utils7.isString)(value)) {
|
|
2100
3522
|
if (CONFIG2.verbose)
|
|
2101
3523
|
console.warn(value, "- type for color is not valid");
|
|
2102
3524
|
return;
|
|
@@ -2105,7 +3527,7 @@ var getColor = (value, key, config) => {
|
|
|
2105
3527
|
return `var(${value})`;
|
|
2106
3528
|
if (key && value[key])
|
|
2107
3529
|
value = value[key];
|
|
2108
|
-
const [name, alpha, tone] = (0,
|
|
3530
|
+
const [name, alpha, tone] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
|
|
2109
3531
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
2110
3532
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
2111
3533
|
if (!val) {
|
|
@@ -2135,7 +3557,7 @@ var getColor = (value, key, config) => {
|
|
|
2135
3557
|
};
|
|
2136
3558
|
var setColor = (val, key, suffix) => {
|
|
2137
3559
|
const CONFIG2 = getActiveConfig();
|
|
2138
|
-
if ((0,
|
|
3560
|
+
if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--") {
|
|
2139
3561
|
val = getColor(val.slice(2));
|
|
2140
3562
|
if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
|
|
2141
3563
|
if (CONFIG2.verbose)
|
|
@@ -2143,13 +3565,13 @@ var setColor = (val, key, suffix) => {
|
|
|
2143
3565
|
val = val.split(" ")[0];
|
|
2144
3566
|
}
|
|
2145
3567
|
}
|
|
2146
|
-
if ((0,
|
|
3568
|
+
if ((0, import_utils7.isArray)(val)) {
|
|
2147
3569
|
return {
|
|
2148
3570
|
"@light": setColor(val[0], key, "light"),
|
|
2149
3571
|
"@dark": setColor(val[1], key, "dark")
|
|
2150
3572
|
};
|
|
2151
3573
|
}
|
|
2152
|
-
if ((0,
|
|
3574
|
+
if ((0, import_utils7.isObject)(val)) {
|
|
2153
3575
|
const obj = {};
|
|
2154
3576
|
for (const variant in val) {
|
|
2155
3577
|
obj[variant] = setColor(
|
|
@@ -2178,15 +3600,15 @@ var setColor = (val, key, suffix) => {
|
|
|
2178
3600
|
};
|
|
2179
3601
|
var setGradient = (val, key, suffix) => {
|
|
2180
3602
|
const CONFIG2 = getActiveConfig();
|
|
2181
|
-
if ((0,
|
|
3603
|
+
if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--")
|
|
2182
3604
|
val = getColor(val.slice(2));
|
|
2183
|
-
if ((0,
|
|
3605
|
+
if ((0, import_utils7.isArray)(val)) {
|
|
2184
3606
|
return {
|
|
2185
3607
|
"@light": setGradient(val[0], key, "light"),
|
|
2186
3608
|
"@dark": setGradient(val[0], key, "dark")
|
|
2187
3609
|
};
|
|
2188
3610
|
}
|
|
2189
|
-
if ((0,
|
|
3611
|
+
if ((0, import_utils7.isObject)(val)) {
|
|
2190
3612
|
const obj = {};
|
|
2191
3613
|
for (const variant in val)
|
|
2192
3614
|
obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -2203,7 +3625,7 @@ var setGradient = (val, key, suffix) => {
|
|
|
2203
3625
|
};
|
|
2204
3626
|
|
|
2205
3627
|
// src/system/theme.js
|
|
2206
|
-
var
|
|
3628
|
+
var import_utils9 = __toESM(require_cjs(), 1);
|
|
2207
3629
|
var setThemeValue = (theme) => {
|
|
2208
3630
|
const value = {};
|
|
2209
3631
|
const { state, media, helpers, ...rest } = theme;
|
|
@@ -2226,7 +3648,7 @@ var getTheme = (value, modifier) => {
|
|
|
2226
3648
|
if (CONFIG2.useVariable)
|
|
2227
3649
|
return getMediaTheme(value, modifier);
|
|
2228
3650
|
const { THEME: THEME2 } = CONFIG2;
|
|
2229
|
-
if ((0,
|
|
3651
|
+
if ((0, import_utils9.isString)(value)) {
|
|
2230
3652
|
const [theme, subtheme] = value.split(" ");
|
|
2231
3653
|
const isOurTheme = THEME2[theme];
|
|
2232
3654
|
if (isOurTheme) {
|
|
@@ -2235,7 +3657,7 @@ var getTheme = (value, modifier) => {
|
|
|
2235
3657
|
value = [theme, subtheme || modifier];
|
|
2236
3658
|
}
|
|
2237
3659
|
}
|
|
2238
|
-
if ((0,
|
|
3660
|
+
if ((0, import_utils9.isObjectLike)(value) && value[1]) {
|
|
2239
3661
|
const themeName = value[0];
|
|
2240
3662
|
const subThemeName = value[1];
|
|
2241
3663
|
const { helpers, media, state } = THEME2[themeName];
|
|
@@ -2245,11 +3667,11 @@ var getTheme = (value, modifier) => {
|
|
|
2245
3667
|
return getThemeValue(helpers[subThemeName]);
|
|
2246
3668
|
if (state && state[subThemeName])
|
|
2247
3669
|
return getThemeValue(state[subThemeName]);
|
|
2248
|
-
} else if ((0,
|
|
3670
|
+
} else if ((0, import_utils9.isObject)(value))
|
|
2249
3671
|
return setThemeValue(value);
|
|
2250
3672
|
};
|
|
2251
3673
|
var setInverseTheme = (theme, variant, value) => {
|
|
2252
|
-
if ((0,
|
|
3674
|
+
if ((0, import_utils9.isObject)(variant)) {
|
|
2253
3675
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
2254
3676
|
} else if (variant === true) {
|
|
2255
3677
|
const { color, background } = value;
|
|
@@ -2264,7 +3686,7 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
2264
3686
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
2265
3687
|
const result = getTheme(variant);
|
|
2266
3688
|
themeValue[`&:${key}`] = result;
|
|
2267
|
-
if ((0,
|
|
3689
|
+
if ((0, import_utils9.isObject)(variant) && !variant.value)
|
|
2268
3690
|
variant.value = result;
|
|
2269
3691
|
};
|
|
2270
3692
|
var setSelectors = (theme, value) => {
|
|
@@ -2282,7 +3704,7 @@ var setSelectors = (theme, value) => {
|
|
|
2282
3704
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
2283
3705
|
const result = getTheme(variant);
|
|
2284
3706
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
2285
|
-
if ((0,
|
|
3707
|
+
if ((0, import_utils9.isObject)(variant) && !variant.value)
|
|
2286
3708
|
variant.value = result;
|
|
2287
3709
|
};
|
|
2288
3710
|
var setMedia = (theme, value) => {
|
|
@@ -2308,7 +3730,7 @@ var setHelpers = (theme, value) => {
|
|
|
2308
3730
|
const keys = Object.keys(helpers);
|
|
2309
3731
|
keys.map((key) => {
|
|
2310
3732
|
const helper = helpers[key];
|
|
2311
|
-
if ((0,
|
|
3733
|
+
if ((0, import_utils9.isString)(helper))
|
|
2312
3734
|
helpers[key] = CONFIG2.THEME[helper];
|
|
2313
3735
|
else
|
|
2314
3736
|
getThemeValue(helpers[key]);
|
|
@@ -2332,7 +3754,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
2332
3754
|
const CONFIG2 = getActiveConfig();
|
|
2333
3755
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
2334
3756
|
const theme = { value: val };
|
|
2335
|
-
if ((0,
|
|
3757
|
+
if ((0, import_utils9.isObjectLike)(val)) {
|
|
2336
3758
|
for (const param in val) {
|
|
2337
3759
|
const symb = param.slice(0, 1);
|
|
2338
3760
|
const value = val[param];
|
|
@@ -2360,7 +3782,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
2360
3782
|
};
|
|
2361
3783
|
}
|
|
2362
3784
|
}
|
|
2363
|
-
if ((0,
|
|
3785
|
+
if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--") {
|
|
2364
3786
|
const { THEME: THEME2 } = CONFIG2;
|
|
2365
3787
|
const value = THEME2[val.slice(2)];
|
|
2366
3788
|
const getReferenced = getMediaTheme(value, prefers);
|
|
@@ -2373,7 +3795,7 @@ var recursiveTheme = (val) => {
|
|
|
2373
3795
|
const obj = {};
|
|
2374
3796
|
for (const param in val) {
|
|
2375
3797
|
const symb = param.slice(0, 1);
|
|
2376
|
-
if ((0,
|
|
3798
|
+
if ((0, import_utils9.isObjectLike)(val[param])) {
|
|
2377
3799
|
if (symb === "@") {
|
|
2378
3800
|
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
2379
3801
|
const media = `@media screen and ${query}`;
|
|
@@ -2393,25 +3815,25 @@ var findModifierFromArray = (val, modifierArray) => {
|
|
|
2393
3815
|
return val;
|
|
2394
3816
|
};
|
|
2395
3817
|
var findModifier = (val, modifier) => {
|
|
2396
|
-
if ((0,
|
|
3818
|
+
if ((0, import_utils9.isArray)(modifier))
|
|
2397
3819
|
return findModifierFromArray(val, modifier);
|
|
2398
|
-
else if ((0,
|
|
3820
|
+
else if ((0, import_utils9.isString)(modifier) && val[modifier])
|
|
2399
3821
|
return val[modifier];
|
|
2400
3822
|
else
|
|
2401
3823
|
return val;
|
|
2402
3824
|
};
|
|
2403
3825
|
var getMediaTheme = (value, modifier) => {
|
|
2404
3826
|
const activeConfig = getActiveConfig();
|
|
2405
|
-
if ((0,
|
|
3827
|
+
if ((0, import_utils9.isString)(value) && value.slice(0, 2) === "--") {
|
|
2406
3828
|
value = getMediaTheme(value.slice(2));
|
|
2407
3829
|
}
|
|
2408
|
-
if (!value || !(0,
|
|
3830
|
+
if (!value || !(0, import_utils9.isString)(value)) {
|
|
2409
3831
|
if (activeConfig.verbose) {
|
|
2410
3832
|
console.warn(`${value} - Theme is not a string`);
|
|
2411
3833
|
}
|
|
2412
3834
|
return;
|
|
2413
3835
|
}
|
|
2414
|
-
const [themeName, ...themeModifiers] = (0,
|
|
3836
|
+
const [themeName, ...themeModifiers] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
|
|
2415
3837
|
let themeValue = activeConfig.THEME[themeName];
|
|
2416
3838
|
if (themeValue && (themeModifiers || modifier)) {
|
|
2417
3839
|
themeValue = findModifier(themeValue, themeModifiers.length ? themeModifiers : modifier);
|
|
@@ -2421,10 +3843,11 @@ var getMediaTheme = (value, modifier) => {
|
|
|
2421
3843
|
};
|
|
2422
3844
|
|
|
2423
3845
|
// src/system/font.js
|
|
2424
|
-
var
|
|
3846
|
+
var import_utils10 = __toESM(require_cjs(), 1);
|
|
3847
|
+
var import_utils11 = __toESM(require_cjs3(), 1);
|
|
2425
3848
|
var setFont = (val, key) => {
|
|
2426
3849
|
const CSSvar = `--font-${key}`;
|
|
2427
|
-
if (!val || (0,
|
|
3850
|
+
if (!val || (0, import_utils10.isArray)(val) && !val[0])
|
|
2428
3851
|
return;
|
|
2429
3852
|
const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
|
|
2430
3853
|
return { var: CSSvar, value: val, fontFace };
|
|
@@ -2435,15 +3858,15 @@ var setFontFamily = (val, key) => {
|
|
|
2435
3858
|
let { value, type } = val;
|
|
2436
3859
|
if (val.isDefault)
|
|
2437
3860
|
FONT_FAMILY2.default = key;
|
|
2438
|
-
if ((0,
|
|
2439
|
-
value = arrayzeValue(value);
|
|
3861
|
+
if ((0, import_utils10.isObject)(value))
|
|
3862
|
+
value = (0, import_utils11.arrayzeValue)(value);
|
|
2440
3863
|
const CSSvar = `--font-family-${key}`;
|
|
2441
3864
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
2442
3865
|
return { var: CSSvar, value: str, arr: value, type };
|
|
2443
3866
|
};
|
|
2444
3867
|
|
|
2445
3868
|
// src/system/typography.js
|
|
2446
|
-
var
|
|
3869
|
+
var import_utils13 = __toESM(require_cjs(), 1);
|
|
2447
3870
|
var runThroughMedia = (FACTORY2) => {
|
|
2448
3871
|
const CONFIG2 = getActiveConfig();
|
|
2449
3872
|
const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
|
|
@@ -2463,7 +3886,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
2463
3886
|
h1Matches,
|
|
2464
3887
|
unit
|
|
2465
3888
|
} = FACTORY2;
|
|
2466
|
-
(0,
|
|
3889
|
+
(0, import_utils13.merge)(mediaValue, {
|
|
2467
3890
|
type,
|
|
2468
3891
|
base,
|
|
2469
3892
|
ratio,
|
|
@@ -2480,7 +3903,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
2480
3903
|
applyMediaSequenceVars(FACTORY2, prop);
|
|
2481
3904
|
continue;
|
|
2482
3905
|
}
|
|
2483
|
-
(0,
|
|
3906
|
+
(0, import_utils13.merge)(mediaValue, {
|
|
2484
3907
|
sequence: {},
|
|
2485
3908
|
scales: {},
|
|
2486
3909
|
templates: {},
|
|
@@ -2519,7 +3942,8 @@ var applyTypographySequence = () => {
|
|
|
2519
3942
|
};
|
|
2520
3943
|
|
|
2521
3944
|
// src/system/spacing.js
|
|
2522
|
-
var
|
|
3945
|
+
var import_utils15 = __toESM(require_cjs3(), 1);
|
|
3946
|
+
var import_utils16 = __toESM(require_cjs(), 1);
|
|
2523
3947
|
var runThroughMedia2 = (FACTORY2) => {
|
|
2524
3948
|
for (const prop in FACTORY2) {
|
|
2525
3949
|
const mediaProps = FACTORY2[prop];
|
|
@@ -2535,7 +3959,7 @@ var runThroughMedia2 = (FACTORY2) => {
|
|
|
2535
3959
|
h1Matches,
|
|
2536
3960
|
unit
|
|
2537
3961
|
} = FACTORY2;
|
|
2538
|
-
(0,
|
|
3962
|
+
(0, import_utils16.merge)(mediaProps, {
|
|
2539
3963
|
type,
|
|
2540
3964
|
base,
|
|
2541
3965
|
ratio,
|
|
@@ -2569,11 +3993,11 @@ var getSequence = (sequenceProps) => {
|
|
|
2569
3993
|
};
|
|
2570
3994
|
var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
2571
3995
|
const sequence = getSequence(sequenceProps);
|
|
2572
|
-
if ((0,
|
|
3996
|
+
if ((0, import_utils16.isString)(value) && (value.includes("calc") || value.includes("var"))) {
|
|
2573
3997
|
return { [propertyName]: value };
|
|
2574
3998
|
}
|
|
2575
|
-
const stack = arrayzeValue(value);
|
|
2576
|
-
if (!(0,
|
|
3999
|
+
const stack = (0, import_utils15.arrayzeValue)(value);
|
|
4000
|
+
if (!(0, import_utils16.isArray)(stack))
|
|
2577
4001
|
return;
|
|
2578
4002
|
if (stack.length > 1) {
|
|
2579
4003
|
let suffix = "";
|
|
@@ -2601,16 +4025,16 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
|
2601
4025
|
};
|
|
2602
4026
|
|
|
2603
4027
|
// src/system/shadow.js
|
|
2604
|
-
var
|
|
4028
|
+
var import_utils18 = __toESM(require_cjs(), 1);
|
|
2605
4029
|
var setShadow = (value, key, suffix, prefers) => {
|
|
2606
4030
|
const CONFIG2 = getActiveConfig();
|
|
2607
|
-
if ((0,
|
|
4031
|
+
if ((0, import_utils18.isArray)(value)) {
|
|
2608
4032
|
return {
|
|
2609
4033
|
"@light": setShadow(value[0], key, "light"),
|
|
2610
4034
|
"@dark": setShadow(value[1], key, "dark")
|
|
2611
4035
|
};
|
|
2612
4036
|
}
|
|
2613
|
-
if ((0,
|
|
4037
|
+
if ((0, import_utils18.isObject)(value)) {
|
|
2614
4038
|
const obj = {};
|
|
2615
4039
|
for (const variant in value) {
|
|
2616
4040
|
obj[variant] = setShadow(
|
|
@@ -2621,7 +4045,7 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
2621
4045
|
}
|
|
2622
4046
|
return obj;
|
|
2623
4047
|
}
|
|
2624
|
-
if ((0,
|
|
4048
|
+
if ((0, import_utils18.isString)(value) && value.includes(",")) {
|
|
2625
4049
|
value = value.split(",").map((v) => {
|
|
2626
4050
|
v = v.trim();
|
|
2627
4051
|
if (v.startsWith("--"))
|
|
@@ -2647,6 +4071,7 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
2647
4071
|
};
|
|
2648
4072
|
|
|
2649
4073
|
// src/system/timing.js
|
|
4074
|
+
var import_utils19 = __toESM(require_cjs3(), 1);
|
|
2650
4075
|
var applyTimingSequence = () => {
|
|
2651
4076
|
const CONFIG2 = getActiveConfig();
|
|
2652
4077
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
@@ -2655,11 +4080,11 @@ var applyTimingSequence = () => {
|
|
|
2655
4080
|
};
|
|
2656
4081
|
|
|
2657
4082
|
// src/system/document.js
|
|
2658
|
-
var
|
|
4083
|
+
var import_utils21 = __toESM(require_cjs(), 1);
|
|
2659
4084
|
var applyDocument = () => {
|
|
2660
4085
|
const CONFIG2 = getActiveConfig();
|
|
2661
4086
|
const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
2662
|
-
return (0,
|
|
4087
|
+
return (0, import_utils21.merge)(DOCUMENT2, {
|
|
2663
4088
|
theme: THEME2.document,
|
|
2664
4089
|
fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
|
|
2665
4090
|
fontSize: TYPOGRAPHY2.base,
|
|
@@ -2690,7 +4115,7 @@ var setIcon = (val, key) => {
|
|
|
2690
4115
|
};
|
|
2691
4116
|
|
|
2692
4117
|
// src/system/reset.js
|
|
2693
|
-
var
|
|
4118
|
+
var import_utils24 = __toESM(require_cjs(), 1);
|
|
2694
4119
|
var applyReset = (reset = {}) => {
|
|
2695
4120
|
const CONFIG2 = getActiveConfig();
|
|
2696
4121
|
const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
|
|
@@ -2712,8 +4137,8 @@ var applyReset = (reset = {}) => {
|
|
|
2712
4137
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
2713
4138
|
const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
|
|
2714
4139
|
if (RESET2.html)
|
|
2715
|
-
(0,
|
|
2716
|
-
return (0,
|
|
4140
|
+
(0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
|
|
4141
|
+
return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
|
|
2717
4142
|
html: {
|
|
2718
4143
|
position: "absolute",
|
|
2719
4144
|
// overflow: 'hidden',
|
|
@@ -2752,9 +4177,9 @@ var applyReset = (reset = {}) => {
|
|
|
2752
4177
|
};
|
|
2753
4178
|
|
|
2754
4179
|
// src/set.js
|
|
2755
|
-
var
|
|
4180
|
+
var import_utils25 = __toESM(require_cjs(), 1);
|
|
2756
4181
|
var setCases = (val, key) => {
|
|
2757
|
-
if ((0,
|
|
4182
|
+
if ((0, import_utils25.isFunction)(val))
|
|
2758
4183
|
return val();
|
|
2759
4184
|
return val;
|
|
2760
4185
|
};
|