@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/index.js
CHANGED
|
@@ -241,32 +241,32 @@ var require_types = __commonJS({
|
|
|
241
241
|
__export2(types_exports, {
|
|
242
242
|
TYPES: () => TYPES,
|
|
243
243
|
is: () => is,
|
|
244
|
-
isArray: () =>
|
|
244
|
+
isArray: () => isArray7,
|
|
245
245
|
isBoolean: () => isBoolean,
|
|
246
246
|
isDate: () => isDate,
|
|
247
247
|
isDefined: () => isDefined2,
|
|
248
248
|
isFunction: () => isFunction2,
|
|
249
249
|
isNot: () => isNot,
|
|
250
250
|
isNull: () => isNull2,
|
|
251
|
-
isNumber: () =>
|
|
252
|
-
isObject: () =>
|
|
251
|
+
isNumber: () => isNumber2,
|
|
252
|
+
isObject: () => isObject6,
|
|
253
253
|
isObjectLike: () => isObjectLike3,
|
|
254
|
-
isString: () =>
|
|
254
|
+
isString: () => isString9,
|
|
255
255
|
isUndefined: () => isUndefined2
|
|
256
256
|
});
|
|
257
257
|
module2.exports = __toCommonJS2(types_exports);
|
|
258
258
|
var import_node = require_node();
|
|
259
|
-
var
|
|
259
|
+
var isObject6 = (arg) => {
|
|
260
260
|
if (arg === null)
|
|
261
261
|
return false;
|
|
262
262
|
return typeof arg === "object" && arg.constructor === Object;
|
|
263
263
|
};
|
|
264
|
-
var
|
|
265
|
-
var
|
|
264
|
+
var isString9 = (arg) => typeof arg === "string";
|
|
265
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
266
266
|
var isFunction2 = (arg) => typeof arg === "function";
|
|
267
267
|
var isBoolean = (arg) => arg === true || arg === false;
|
|
268
268
|
var isNull2 = (arg) => arg === null;
|
|
269
|
-
var
|
|
269
|
+
var isArray7 = (arg) => Array.isArray(arg);
|
|
270
270
|
var isDate = (d) => d instanceof Date;
|
|
271
271
|
var isObjectLike3 = (arg) => {
|
|
272
272
|
if (arg === null)
|
|
@@ -274,18 +274,18 @@ var require_types = __commonJS({
|
|
|
274
274
|
return typeof arg === "object";
|
|
275
275
|
};
|
|
276
276
|
var isDefined2 = (arg) => {
|
|
277
|
-
return
|
|
277
|
+
return isObject6(arg) || isObjectLike3(arg) || isString9(arg) || isNumber2(arg) || isFunction2(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
|
|
278
278
|
};
|
|
279
279
|
var isUndefined2 = (arg) => {
|
|
280
280
|
return arg === void 0;
|
|
281
281
|
};
|
|
282
282
|
var TYPES = {
|
|
283
283
|
boolean: isBoolean,
|
|
284
|
-
array:
|
|
285
|
-
object:
|
|
286
|
-
string:
|
|
284
|
+
array: isArray7,
|
|
285
|
+
object: isObject6,
|
|
286
|
+
string: isString9,
|
|
287
287
|
date: isDate,
|
|
288
|
-
number:
|
|
288
|
+
number: isNumber2,
|
|
289
289
|
null: isNull2,
|
|
290
290
|
function: isFunction2,
|
|
291
291
|
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: () => isNull2,
|
|
1589
|
+
isNumber: () => isNumber2,
|
|
1590
|
+
isObject: () => isObject32,
|
|
1591
|
+
isObjectLike: () => isObjectLike3,
|
|
1592
|
+
isString: () => isString22,
|
|
1593
|
+
isUndefined: () => isUndefined2
|
|
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 isNull2 = (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) || isNull2(arg);
|
|
1616
|
+
};
|
|
1617
|
+
var isUndefined2 = (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: isNull2,
|
|
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_exports2 = {};
|
|
2688
|
+
module22.exports = __toCommonJS22(utils_exports2);
|
|
2689
|
+
__reExport(utils_exports2, require_key2(), module22.exports);
|
|
2690
|
+
__reExport(utils_exports2, require_env2(), module22.exports);
|
|
2691
|
+
__reExport(utils_exports2, require_types2(), module22.exports);
|
|
2692
|
+
__reExport(utils_exports2, require_object2(), module22.exports);
|
|
2693
|
+
__reExport(utils_exports2, require_function2(), module22.exports);
|
|
2694
|
+
__reExport(utils_exports2, require_array2(), module22.exports);
|
|
2695
|
+
__reExport(utils_exports2, require_node2(), module22.exports);
|
|
2696
|
+
__reExport(utils_exports2, require_log2(), module22.exports);
|
|
2697
|
+
__reExport(utils_exports2, require_string2(), module22.exports);
|
|
2698
|
+
__reExport(utils_exports2, require_globals2(), module22.exports);
|
|
2699
|
+
__reExport(utils_exports2, require_cookie2(), module22.exports);
|
|
2700
|
+
__reExport(utils_exports2, require_tags2(), module22.exports);
|
|
2701
|
+
}
|
|
2702
|
+
});
|
|
2703
|
+
var src_exports2 = {};
|
|
2704
|
+
__export2(src_exports2, {
|
|
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_exports2);
|
|
2720
|
+
var import_utils27 = __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_utils28 = __toESM2(require_cjs4(), 1);
|
|
2731
|
+
var findClosestNumber = (number, arr) => {
|
|
2732
|
+
return ((0, import_utils28.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_utils28.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_utils27.isArray)(val))
|
|
2813
|
+
return val;
|
|
2814
|
+
if ((0, import_utils27.isString)(val))
|
|
2815
|
+
return val.split(" ");
|
|
2816
|
+
if ((0, import_utils27.isObject)(val))
|
|
2817
|
+
return Object.values(val);
|
|
2818
|
+
if ((0, import_utils27.isNumber)(val))
|
|
2819
|
+
return [val];
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
|
|
1382
2824
|
// src/index.js
|
|
1383
2825
|
var src_exports = {};
|
|
1384
2826
|
__export(src_exports, {
|
|
@@ -1766,34 +3208,11 @@ var getFontFaceString = (LIBRARY) => {
|
|
|
1766
3208
|
};
|
|
1767
3209
|
|
|
1768
3210
|
// src/utils/sequence.js
|
|
1769
|
-
var
|
|
1770
|
-
|
|
1771
|
-
// ../../node_modules/@symbo.ls/utils/src/index.js
|
|
1772
|
-
var import_utils3 = __toESM(require_cjs2());
|
|
1773
|
-
|
|
1774
|
-
// ../../node_modules/@symbo.ls/utils/src/scaling.js
|
|
1775
|
-
var import_utils2 = __toESM(require_cjs2());
|
|
1776
|
-
|
|
1777
|
-
// ../../node_modules/@symbo.ls/utils/src/index.js
|
|
1778
|
-
var toCamelCase = (str) => {
|
|
1779
|
-
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
1780
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
1781
|
-
}).replaceAll(/\s+/g, "");
|
|
1782
|
-
};
|
|
1783
|
-
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
1784
|
-
var arrayzeValue = (val) => {
|
|
1785
|
-
if ((0, import_utils3.isArray)(val))
|
|
1786
|
-
return val;
|
|
1787
|
-
if ((0, import_utils3.isString)(val))
|
|
1788
|
-
return val.split(" ");
|
|
1789
|
-
if ((0, import_utils3.isObject)(val))
|
|
1790
|
-
return Object.values(val);
|
|
1791
|
-
if ((0, import_utils3.isNumber)(val))
|
|
1792
|
-
return [val];
|
|
1793
|
-
};
|
|
3211
|
+
var import_utils3 = __toESM(require_cjs2(), 1);
|
|
3212
|
+
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
1794
3213
|
|
|
1795
3214
|
// src/factory.js
|
|
1796
|
-
var
|
|
3215
|
+
var import_utils2 = __toESM(require_cjs2(), 1);
|
|
1797
3216
|
|
|
1798
3217
|
// src/defaultConfig/index.js
|
|
1799
3218
|
var defaultConfig_exports = {};
|
|
@@ -1998,13 +3417,13 @@ var CONFIG = {
|
|
|
1998
3417
|
CSS_VARS,
|
|
1999
3418
|
...defaultConfig_exports
|
|
2000
3419
|
};
|
|
2001
|
-
var cachedConfig = (0,
|
|
3420
|
+
var cachedConfig = (0, import_utils2.deepClone)(CONFIG);
|
|
2002
3421
|
var FACTORY = {
|
|
2003
3422
|
active: "0",
|
|
2004
3423
|
0: CONFIG
|
|
2005
3424
|
};
|
|
2006
3425
|
var activateConfig = (def) => {
|
|
2007
|
-
if ((0,
|
|
3426
|
+
if ((0, import_utils2.isDefined)(def)) {
|
|
2008
3427
|
FACTORY.active = def;
|
|
2009
3428
|
}
|
|
2010
3429
|
return FACTORY[def || FACTORY.active];
|
|
@@ -2013,10 +3432,10 @@ var getActiveConfig = (def) => {
|
|
|
2013
3432
|
return FACTORY[def || FACTORY.active];
|
|
2014
3433
|
};
|
|
2015
3434
|
var setActiveConfig = (newConfig) => {
|
|
2016
|
-
if (!(0,
|
|
3435
|
+
if (!(0, import_utils2.isObject)(newConfig))
|
|
2017
3436
|
return;
|
|
2018
3437
|
FACTORY.active = "1";
|
|
2019
|
-
FACTORY["1"] = (0,
|
|
3438
|
+
FACTORY["1"] = (0, import_utils2.deepMerge)(newConfig, (0, import_utils2.deepClone)(cachedConfig));
|
|
2020
3439
|
return newConfig;
|
|
2021
3440
|
};
|
|
2022
3441
|
|
|
@@ -2162,9 +3581,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
2162
3581
|
unit = UNIT2.default,
|
|
2163
3582
|
useVariable
|
|
2164
3583
|
} = sequenceProps;
|
|
2165
|
-
if ((0,
|
|
3584
|
+
if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
|
|
2166
3585
|
return `var(${value})`;
|
|
2167
|
-
const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
3586
|
+
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
2168
3587
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
2169
3588
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
2170
3589
|
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)
|
|
@@ -2227,11 +3646,11 @@ var findHeadings = (propertyNames) => {
|
|
|
2227
3646
|
};
|
|
2228
3647
|
|
|
2229
3648
|
// src/utils/var.js
|
|
2230
|
-
var
|
|
3649
|
+
var import_utils5 = __toESM(require_cjs2(), 1);
|
|
2231
3650
|
var setVariables = (result, key) => {
|
|
2232
3651
|
const CONFIG2 = getActiveConfig();
|
|
2233
3652
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
2234
|
-
if ((0,
|
|
3653
|
+
if ((0, import_utils5.isObjectLike)(result.value)) {
|
|
2235
3654
|
} else {
|
|
2236
3655
|
CSS_VARS2[result.var] = result.value;
|
|
2237
3656
|
}
|
|
@@ -2306,7 +3725,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2306
3725
|
};
|
|
2307
3726
|
|
|
2308
3727
|
// src/utils/sprite.js
|
|
2309
|
-
var
|
|
3728
|
+
var import_utils6 = __toESM(require_cjs2(), 1);
|
|
2310
3729
|
var generateSprite = (icons) => {
|
|
2311
3730
|
const CONFIG2 = getActiveConfig();
|
|
2312
3731
|
let sprite = "";
|
|
@@ -2320,7 +3739,7 @@ var generateSprite = (icons) => {
|
|
|
2320
3739
|
return sprite;
|
|
2321
3740
|
};
|
|
2322
3741
|
var parseRootAttributes = (htmlString) => {
|
|
2323
|
-
if (!(0,
|
|
3742
|
+
if (!(0, import_utils6.isString)(htmlString)) {
|
|
2324
3743
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
2325
3744
|
}
|
|
2326
3745
|
const match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -2340,7 +3759,7 @@ var replaceIdsAndUrls = (code, key) => {
|
|
|
2340
3759
|
const urlRegex = /url\(#([^)]*)\)/g;
|
|
2341
3760
|
const matches = code.match(/id="([^"]*)"/g);
|
|
2342
3761
|
let replacedCode = code;
|
|
2343
|
-
if ((0,
|
|
3762
|
+
if ((0, import_utils6.isArray)(matches)) {
|
|
2344
3763
|
matches.forEach(() => {
|
|
2345
3764
|
const randomKey = Math.floor(Math.random() * 1e5);
|
|
2346
3765
|
replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
|
|
@@ -2399,10 +3818,10 @@ __export(system_exports, {
|
|
|
2399
3818
|
});
|
|
2400
3819
|
|
|
2401
3820
|
// src/system/color.js
|
|
2402
|
-
var
|
|
3821
|
+
var import_utils7 = __toESM(require_cjs2(), 1);
|
|
2403
3822
|
var getColor = (value, key, config) => {
|
|
2404
3823
|
const CONFIG2 = config || getActiveConfig();
|
|
2405
|
-
if (!(0,
|
|
3824
|
+
if (!(0, import_utils7.isString)(value)) {
|
|
2406
3825
|
if (CONFIG2.verbose)
|
|
2407
3826
|
console.warn(value, "- type for color is not valid");
|
|
2408
3827
|
return;
|
|
@@ -2411,7 +3830,7 @@ var getColor = (value, key, config) => {
|
|
|
2411
3830
|
return `var(${value})`;
|
|
2412
3831
|
if (key && value[key])
|
|
2413
3832
|
value = value[key];
|
|
2414
|
-
const [name, alpha, tone] = (0,
|
|
3833
|
+
const [name, alpha, tone] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
|
|
2415
3834
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
2416
3835
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
2417
3836
|
if (!val) {
|
|
@@ -2443,17 +3862,17 @@ var getMediaColor = (value, globalTheme, config) => {
|
|
|
2443
3862
|
const CONFIG2 = config || getActiveConfig();
|
|
2444
3863
|
if (!globalTheme)
|
|
2445
3864
|
globalTheme = CONFIG2.globalTheme;
|
|
2446
|
-
if (!(0,
|
|
3865
|
+
if (!(0, import_utils7.isString)(value)) {
|
|
2447
3866
|
if (CONFIG2.verbose)
|
|
2448
3867
|
console.warn(value, "- type for color is not valid");
|
|
2449
3868
|
return;
|
|
2450
3869
|
}
|
|
2451
3870
|
if (value.slice(0, 2) === "--")
|
|
2452
3871
|
return `var(${value})`;
|
|
2453
|
-
const [name] = (0,
|
|
3872
|
+
const [name] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
|
|
2454
3873
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
2455
3874
|
const val = COLOR2[name] || GRADIENT2[name];
|
|
2456
|
-
const isObj = (0,
|
|
3875
|
+
const isObj = (0, import_utils7.isObject)(val);
|
|
2457
3876
|
if (isObj && val.value)
|
|
2458
3877
|
return getColor(value, `@${globalTheme}`, config);
|
|
2459
3878
|
else if (isObj) {
|
|
@@ -2476,7 +3895,7 @@ var getMediaColor = (value, globalTheme, config) => {
|
|
|
2476
3895
|
};
|
|
2477
3896
|
var setColor = (val, key, suffix) => {
|
|
2478
3897
|
const CONFIG2 = getActiveConfig();
|
|
2479
|
-
if ((0,
|
|
3898
|
+
if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--") {
|
|
2480
3899
|
val = getColor(val.slice(2));
|
|
2481
3900
|
if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
|
|
2482
3901
|
if (CONFIG2.verbose)
|
|
@@ -2484,13 +3903,13 @@ var setColor = (val, key, suffix) => {
|
|
|
2484
3903
|
val = val.split(" ")[0];
|
|
2485
3904
|
}
|
|
2486
3905
|
}
|
|
2487
|
-
if ((0,
|
|
3906
|
+
if ((0, import_utils7.isArray)(val)) {
|
|
2488
3907
|
return {
|
|
2489
3908
|
"@light": setColor(val[0], key, "light"),
|
|
2490
3909
|
"@dark": setColor(val[1], key, "dark")
|
|
2491
3910
|
};
|
|
2492
3911
|
}
|
|
2493
|
-
if ((0,
|
|
3912
|
+
if ((0, import_utils7.isObject)(val)) {
|
|
2494
3913
|
const obj = {};
|
|
2495
3914
|
for (const variant in val) {
|
|
2496
3915
|
obj[variant] = setColor(
|
|
@@ -2519,15 +3938,15 @@ var setColor = (val, key, suffix) => {
|
|
|
2519
3938
|
};
|
|
2520
3939
|
var setGradient = (val, key, suffix) => {
|
|
2521
3940
|
const CONFIG2 = getActiveConfig();
|
|
2522
|
-
if ((0,
|
|
3941
|
+
if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--")
|
|
2523
3942
|
val = getColor(val.slice(2));
|
|
2524
|
-
if ((0,
|
|
3943
|
+
if ((0, import_utils7.isArray)(val)) {
|
|
2525
3944
|
return {
|
|
2526
3945
|
"@light": setGradient(val[0], key, "light"),
|
|
2527
3946
|
"@dark": setGradient(val[0], key, "dark")
|
|
2528
3947
|
};
|
|
2529
3948
|
}
|
|
2530
|
-
if ((0,
|
|
3949
|
+
if ((0, import_utils7.isObject)(val)) {
|
|
2531
3950
|
const obj = {};
|
|
2532
3951
|
for (const variant in val)
|
|
2533
3952
|
obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -2544,7 +3963,7 @@ var setGradient = (val, key, suffix) => {
|
|
|
2544
3963
|
};
|
|
2545
3964
|
|
|
2546
3965
|
// src/system/theme.js
|
|
2547
|
-
var
|
|
3966
|
+
var import_utils9 = __toESM(require_cjs2(), 1);
|
|
2548
3967
|
var setThemeValue = (theme) => {
|
|
2549
3968
|
const value = {};
|
|
2550
3969
|
const { state, media, helpers, ...rest } = theme;
|
|
@@ -2567,7 +3986,7 @@ var getTheme = (value, modifier) => {
|
|
|
2567
3986
|
if (CONFIG2.useVariable)
|
|
2568
3987
|
return getMediaTheme(value, modifier);
|
|
2569
3988
|
const { THEME: THEME2 } = CONFIG2;
|
|
2570
|
-
if ((0,
|
|
3989
|
+
if ((0, import_utils9.isString)(value)) {
|
|
2571
3990
|
const [theme, subtheme] = value.split(" ");
|
|
2572
3991
|
const isOurTheme = THEME2[theme];
|
|
2573
3992
|
if (isOurTheme) {
|
|
@@ -2576,7 +3995,7 @@ var getTheme = (value, modifier) => {
|
|
|
2576
3995
|
value = [theme, subtheme || modifier];
|
|
2577
3996
|
}
|
|
2578
3997
|
}
|
|
2579
|
-
if ((0,
|
|
3998
|
+
if ((0, import_utils9.isObjectLike)(value) && value[1]) {
|
|
2580
3999
|
const themeName = value[0];
|
|
2581
4000
|
const subThemeName = value[1];
|
|
2582
4001
|
const { helpers, media, state } = THEME2[themeName];
|
|
@@ -2586,11 +4005,11 @@ var getTheme = (value, modifier) => {
|
|
|
2586
4005
|
return getThemeValue(helpers[subThemeName]);
|
|
2587
4006
|
if (state && state[subThemeName])
|
|
2588
4007
|
return getThemeValue(state[subThemeName]);
|
|
2589
|
-
} else if ((0,
|
|
4008
|
+
} else if ((0, import_utils9.isObject)(value))
|
|
2590
4009
|
return setThemeValue(value);
|
|
2591
4010
|
};
|
|
2592
4011
|
var setInverseTheme = (theme, variant, value) => {
|
|
2593
|
-
if ((0,
|
|
4012
|
+
if ((0, import_utils9.isObject)(variant)) {
|
|
2594
4013
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
2595
4014
|
} else if (variant === true) {
|
|
2596
4015
|
const { color, background } = value;
|
|
@@ -2605,7 +4024,7 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
2605
4024
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
2606
4025
|
const result = getTheme(variant);
|
|
2607
4026
|
themeValue[`&:${key}`] = result;
|
|
2608
|
-
if ((0,
|
|
4027
|
+
if ((0, import_utils9.isObject)(variant) && !variant.value)
|
|
2609
4028
|
variant.value = result;
|
|
2610
4029
|
};
|
|
2611
4030
|
var setSelectors = (theme, value) => {
|
|
@@ -2623,7 +4042,7 @@ var setSelectors = (theme, value) => {
|
|
|
2623
4042
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
2624
4043
|
const result = getTheme(variant);
|
|
2625
4044
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
2626
|
-
if ((0,
|
|
4045
|
+
if ((0, import_utils9.isObject)(variant) && !variant.value)
|
|
2627
4046
|
variant.value = result;
|
|
2628
4047
|
};
|
|
2629
4048
|
var setMedia = (theme, value) => {
|
|
@@ -2649,7 +4068,7 @@ var setHelpers = (theme, value) => {
|
|
|
2649
4068
|
const keys = Object.keys(helpers);
|
|
2650
4069
|
keys.map((key) => {
|
|
2651
4070
|
const helper = helpers[key];
|
|
2652
|
-
if ((0,
|
|
4071
|
+
if ((0, import_utils9.isString)(helper))
|
|
2653
4072
|
helpers[key] = CONFIG2.THEME[helper];
|
|
2654
4073
|
else
|
|
2655
4074
|
getThemeValue(helpers[key]);
|
|
@@ -2673,7 +4092,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
2673
4092
|
const CONFIG2 = getActiveConfig();
|
|
2674
4093
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
2675
4094
|
const theme = { value: val };
|
|
2676
|
-
if ((0,
|
|
4095
|
+
if ((0, import_utils9.isObjectLike)(val)) {
|
|
2677
4096
|
for (const param in val) {
|
|
2678
4097
|
const symb = param.slice(0, 1);
|
|
2679
4098
|
const value = val[param];
|
|
@@ -2701,7 +4120,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
2701
4120
|
};
|
|
2702
4121
|
}
|
|
2703
4122
|
}
|
|
2704
|
-
if ((0,
|
|
4123
|
+
if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--") {
|
|
2705
4124
|
const { THEME: THEME2 } = CONFIG2;
|
|
2706
4125
|
const value = THEME2[val.slice(2)];
|
|
2707
4126
|
const getReferenced = getMediaTheme(value, prefers);
|
|
@@ -2714,7 +4133,7 @@ var recursiveTheme = (val) => {
|
|
|
2714
4133
|
const obj = {};
|
|
2715
4134
|
for (const param in val) {
|
|
2716
4135
|
const symb = param.slice(0, 1);
|
|
2717
|
-
if ((0,
|
|
4136
|
+
if ((0, import_utils9.isObjectLike)(val[param])) {
|
|
2718
4137
|
if (symb === "@") {
|
|
2719
4138
|
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
2720
4139
|
const media = `@media screen and ${query}`;
|
|
@@ -2734,25 +4153,25 @@ var findModifierFromArray = (val, modifierArray) => {
|
|
|
2734
4153
|
return val;
|
|
2735
4154
|
};
|
|
2736
4155
|
var findModifier = (val, modifier) => {
|
|
2737
|
-
if ((0,
|
|
4156
|
+
if ((0, import_utils9.isArray)(modifier))
|
|
2738
4157
|
return findModifierFromArray(val, modifier);
|
|
2739
|
-
else if ((0,
|
|
4158
|
+
else if ((0, import_utils9.isString)(modifier) && val[modifier])
|
|
2740
4159
|
return val[modifier];
|
|
2741
4160
|
else
|
|
2742
4161
|
return val;
|
|
2743
4162
|
};
|
|
2744
4163
|
var getMediaTheme = (value, modifier) => {
|
|
2745
4164
|
const activeConfig = getActiveConfig();
|
|
2746
|
-
if ((0,
|
|
4165
|
+
if ((0, import_utils9.isString)(value) && value.slice(0, 2) === "--") {
|
|
2747
4166
|
value = getMediaTheme(value.slice(2));
|
|
2748
4167
|
}
|
|
2749
|
-
if (!value || !(0,
|
|
4168
|
+
if (!value || !(0, import_utils9.isString)(value)) {
|
|
2750
4169
|
if (activeConfig.verbose) {
|
|
2751
4170
|
console.warn(`${value} - Theme is not a string`);
|
|
2752
4171
|
}
|
|
2753
4172
|
return;
|
|
2754
4173
|
}
|
|
2755
|
-
const [themeName, ...themeModifiers] = (0,
|
|
4174
|
+
const [themeName, ...themeModifiers] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
|
|
2756
4175
|
let themeValue = activeConfig.THEME[themeName];
|
|
2757
4176
|
if (themeValue && (themeModifiers || modifier)) {
|
|
2758
4177
|
themeValue = findModifier(themeValue, themeModifiers.length ? themeModifiers : modifier);
|
|
@@ -2762,10 +4181,11 @@ var getMediaTheme = (value, modifier) => {
|
|
|
2762
4181
|
};
|
|
2763
4182
|
|
|
2764
4183
|
// src/system/font.js
|
|
2765
|
-
var
|
|
4184
|
+
var import_utils10 = __toESM(require_cjs2(), 1);
|
|
4185
|
+
var import_utils11 = __toESM(require_cjs3(), 1);
|
|
2766
4186
|
var setFont = (val, key) => {
|
|
2767
4187
|
const CSSvar = `--font-${key}`;
|
|
2768
|
-
if (!val || (0,
|
|
4188
|
+
if (!val || (0, import_utils10.isArray)(val) && !val[0])
|
|
2769
4189
|
return;
|
|
2770
4190
|
const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
|
|
2771
4191
|
return { var: CSSvar, value: val, fontFace };
|
|
@@ -2781,15 +4201,15 @@ var setFontFamily = (val, key) => {
|
|
|
2781
4201
|
let { value, type } = val;
|
|
2782
4202
|
if (val.isDefault)
|
|
2783
4203
|
FONT_FAMILY2.default = key;
|
|
2784
|
-
if ((0,
|
|
2785
|
-
value = arrayzeValue(value);
|
|
4204
|
+
if ((0, import_utils10.isObject)(value))
|
|
4205
|
+
value = (0, import_utils11.arrayzeValue)(value);
|
|
2786
4206
|
const CSSvar = `--font-family-${key}`;
|
|
2787
4207
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
2788
4208
|
return { var: CSSvar, value: str, arr: value, type };
|
|
2789
4209
|
};
|
|
2790
4210
|
|
|
2791
4211
|
// src/system/typography.js
|
|
2792
|
-
var
|
|
4212
|
+
var import_utils13 = __toESM(require_cjs2(), 1);
|
|
2793
4213
|
var runThroughMedia = (FACTORY2) => {
|
|
2794
4214
|
const CONFIG2 = getActiveConfig();
|
|
2795
4215
|
const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
|
|
@@ -2809,7 +4229,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
2809
4229
|
h1Matches,
|
|
2810
4230
|
unit
|
|
2811
4231
|
} = FACTORY2;
|
|
2812
|
-
(0,
|
|
4232
|
+
(0, import_utils13.merge)(mediaValue, {
|
|
2813
4233
|
type,
|
|
2814
4234
|
base,
|
|
2815
4235
|
ratio,
|
|
@@ -2826,7 +4246,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
2826
4246
|
applyMediaSequenceVars(FACTORY2, prop);
|
|
2827
4247
|
continue;
|
|
2828
4248
|
}
|
|
2829
|
-
(0,
|
|
4249
|
+
(0, import_utils13.merge)(mediaValue, {
|
|
2830
4250
|
sequence: {},
|
|
2831
4251
|
scales: {},
|
|
2832
4252
|
templates: {},
|
|
@@ -2874,7 +4294,8 @@ var getFontSizeByKey = (value) => {
|
|
|
2874
4294
|
};
|
|
2875
4295
|
|
|
2876
4296
|
// src/system/spacing.js
|
|
2877
|
-
var
|
|
4297
|
+
var import_utils15 = __toESM(require_cjs3(), 1);
|
|
4298
|
+
var import_utils16 = __toESM(require_cjs2(), 1);
|
|
2878
4299
|
var runThroughMedia2 = (FACTORY2) => {
|
|
2879
4300
|
for (const prop in FACTORY2) {
|
|
2880
4301
|
const mediaProps = FACTORY2[prop];
|
|
@@ -2890,7 +4311,7 @@ var runThroughMedia2 = (FACTORY2) => {
|
|
|
2890
4311
|
h1Matches,
|
|
2891
4312
|
unit
|
|
2892
4313
|
} = FACTORY2;
|
|
2893
|
-
(0,
|
|
4314
|
+
(0, import_utils16.merge)(mediaProps, {
|
|
2894
4315
|
type,
|
|
2895
4316
|
base,
|
|
2896
4317
|
ratio,
|
|
@@ -2924,11 +4345,11 @@ var getSequence = (sequenceProps) => {
|
|
|
2924
4345
|
};
|
|
2925
4346
|
var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
2926
4347
|
const sequence = getSequence(sequenceProps);
|
|
2927
|
-
if ((0,
|
|
4348
|
+
if ((0, import_utils16.isString)(value) && (value.includes("calc") || value.includes("var"))) {
|
|
2928
4349
|
return { [propertyName]: value };
|
|
2929
4350
|
}
|
|
2930
|
-
const stack = arrayzeValue(value);
|
|
2931
|
-
if (!(0,
|
|
4351
|
+
const stack = (0, import_utils15.arrayzeValue)(value);
|
|
4352
|
+
if (!(0, import_utils16.isArray)(stack))
|
|
2932
4353
|
return;
|
|
2933
4354
|
if (stack.length > 1) {
|
|
2934
4355
|
let suffix = "";
|
|
@@ -2963,7 +4384,7 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
2963
4384
|
let sequenceProps = SPACING2[spacingRatio];
|
|
2964
4385
|
if (!sequenceProps) {
|
|
2965
4386
|
const { type, base, range, subSequence } = SPACING2;
|
|
2966
|
-
sequenceProps = SPACING2[spacingRatio] = (0,
|
|
4387
|
+
sequenceProps = SPACING2[spacingRatio] = (0, import_utils16.merge)({
|
|
2967
4388
|
ratio: spacingRatio,
|
|
2968
4389
|
type: type + "-" + spacingRatio,
|
|
2969
4390
|
unit,
|
|
@@ -2986,16 +4407,16 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
2986
4407
|
};
|
|
2987
4408
|
|
|
2988
4409
|
// src/system/shadow.js
|
|
2989
|
-
var
|
|
4410
|
+
var import_utils18 = __toESM(require_cjs2(), 1);
|
|
2990
4411
|
var setShadow = (value, key, suffix, prefers) => {
|
|
2991
4412
|
const CONFIG2 = getActiveConfig();
|
|
2992
|
-
if ((0,
|
|
4413
|
+
if ((0, import_utils18.isArray)(value)) {
|
|
2993
4414
|
return {
|
|
2994
4415
|
"@light": setShadow(value[0], key, "light"),
|
|
2995
4416
|
"@dark": setShadow(value[1], key, "dark")
|
|
2996
4417
|
};
|
|
2997
4418
|
}
|
|
2998
|
-
if ((0,
|
|
4419
|
+
if ((0, import_utils18.isObject)(value)) {
|
|
2999
4420
|
const obj = {};
|
|
3000
4421
|
for (const variant in value) {
|
|
3001
4422
|
obj[variant] = setShadow(
|
|
@@ -3006,7 +4427,7 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
3006
4427
|
}
|
|
3007
4428
|
return obj;
|
|
3008
4429
|
}
|
|
3009
|
-
if ((0,
|
|
4430
|
+
if ((0, import_utils18.isString)(value) && value.includes(",")) {
|
|
3010
4431
|
value = value.split(",").map((v) => {
|
|
3011
4432
|
v = v.trim();
|
|
3012
4433
|
if (v.startsWith("--"))
|
|
@@ -3034,17 +4455,17 @@ var getShadow = (value, globalTheme) => {
|
|
|
3034
4455
|
const CONFIG2 = getActiveConfig();
|
|
3035
4456
|
if (!globalTheme)
|
|
3036
4457
|
globalTheme = CONFIG2.globalTheme;
|
|
3037
|
-
if (!(0,
|
|
4458
|
+
if (!(0, import_utils18.isString)(value)) {
|
|
3038
4459
|
if (CONFIG2.verbose)
|
|
3039
4460
|
console.warn(value, "- type for color is not valid");
|
|
3040
4461
|
return;
|
|
3041
4462
|
}
|
|
3042
4463
|
if (value.slice(0, 2) === "--")
|
|
3043
4464
|
return `var(${value})`;
|
|
3044
|
-
const [name] = (0,
|
|
4465
|
+
const [name] = (0, import_utils18.isArray)(value) ? value : value.split(" ");
|
|
3045
4466
|
const { SHADOW: SHADOW2 } = CONFIG2;
|
|
3046
4467
|
const val = SHADOW2[name];
|
|
3047
|
-
const isObj = (0,
|
|
4468
|
+
const isObj = (0, import_utils18.isObject)(val);
|
|
3048
4469
|
if (!val) {
|
|
3049
4470
|
if (CONFIG2.verbose)
|
|
3050
4471
|
console.warn("Can't find color ", name);
|
|
@@ -3073,6 +4494,7 @@ var getShadow = (value, globalTheme) => {
|
|
|
3073
4494
|
};
|
|
3074
4495
|
|
|
3075
4496
|
// src/system/timing.js
|
|
4497
|
+
var import_utils19 = __toESM(require_cjs3(), 1);
|
|
3076
4498
|
var applyTimingSequence = () => {
|
|
3077
4499
|
const CONFIG2 = getActiveConfig();
|
|
3078
4500
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
@@ -3082,7 +4504,7 @@ var applyTimingSequence = () => {
|
|
|
3082
4504
|
var getTimingFunction = (value) => {
|
|
3083
4505
|
const CONFIG2 = getActiveConfig();
|
|
3084
4506
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
3085
|
-
return TIMING2[value] || TIMING2[toCamelCase(value)] || value;
|
|
4507
|
+
return TIMING2[value] || TIMING2[(0, import_utils19.toCamelCase)(value)] || value;
|
|
3086
4508
|
};
|
|
3087
4509
|
var getTimingByKey = (value, property = "timing") => {
|
|
3088
4510
|
const CONFIG2 = getActiveConfig();
|
|
@@ -3095,11 +4517,11 @@ var getTimingByKey = (value, property = "timing") => {
|
|
|
3095
4517
|
};
|
|
3096
4518
|
|
|
3097
4519
|
// src/system/document.js
|
|
3098
|
-
var
|
|
4520
|
+
var import_utils21 = __toESM(require_cjs2(), 1);
|
|
3099
4521
|
var applyDocument = () => {
|
|
3100
4522
|
const CONFIG2 = getActiveConfig();
|
|
3101
4523
|
const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
3102
|
-
return (0,
|
|
4524
|
+
return (0, import_utils21.merge)(DOCUMENT2, {
|
|
3103
4525
|
theme: THEME2.document,
|
|
3104
4526
|
fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
|
|
3105
4527
|
fontSize: TYPOGRAPHY2.base,
|
|
@@ -3183,7 +4605,7 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
|
|
|
3183
4605
|
};
|
|
3184
4606
|
|
|
3185
4607
|
// src/system/reset.js
|
|
3186
|
-
var
|
|
4608
|
+
var import_utils24 = __toESM(require_cjs2(), 1);
|
|
3187
4609
|
var applyReset = (reset = {}) => {
|
|
3188
4610
|
const CONFIG2 = getActiveConfig();
|
|
3189
4611
|
const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
|
|
@@ -3205,8 +4627,8 @@ var applyReset = (reset = {}) => {
|
|
|
3205
4627
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
3206
4628
|
const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
|
|
3207
4629
|
if (RESET2.html)
|
|
3208
|
-
(0,
|
|
3209
|
-
return (0,
|
|
4630
|
+
(0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
|
|
4631
|
+
return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
|
|
3210
4632
|
html: {
|
|
3211
4633
|
position: "absolute",
|
|
3212
4634
|
// overflow: 'hidden',
|
|
@@ -3245,7 +4667,7 @@ var applyReset = (reset = {}) => {
|
|
|
3245
4667
|
};
|
|
3246
4668
|
|
|
3247
4669
|
// src/transforms/index.js
|
|
3248
|
-
var
|
|
4670
|
+
var import_utils25 = __toESM(require_cjs2(), 1);
|
|
3249
4671
|
var isBorderStyle = (str) => [
|
|
3250
4672
|
"none",
|
|
3251
4673
|
"hidden",
|
|
@@ -3317,7 +4739,7 @@ var transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
3317
4739
|
return v;
|
|
3318
4740
|
}).join(" ");
|
|
3319
4741
|
};
|
|
3320
|
-
var transfromGap = (gap) => (0,
|
|
4742
|
+
var transfromGap = (gap) => (0, import_utils25.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey(v, "gap").gap).join(" ");
|
|
3321
4743
|
var transformTransition = (transition) => {
|
|
3322
4744
|
const arr = transition.split(" ");
|
|
3323
4745
|
if (!arr.length)
|
|
@@ -3335,7 +4757,7 @@ var transformTransition = (transition) => {
|
|
|
3335
4757
|
}).join(" ");
|
|
3336
4758
|
};
|
|
3337
4759
|
var transformDuration = (duration, props, propertyName) => {
|
|
3338
|
-
if (!(0,
|
|
4760
|
+
if (!(0, import_utils25.isString)(duration))
|
|
3339
4761
|
return;
|
|
3340
4762
|
return duration.split(",").map((v) => getTimingByKey(v).timing || v).join(",");
|
|
3341
4763
|
};
|
|
@@ -3351,11 +4773,11 @@ var checkIfBoxSize = (propertyName) => {
|
|
|
3351
4773
|
};
|
|
3352
4774
|
var transformSize = (propertyName, val, props = {}, opts = {}) => {
|
|
3353
4775
|
let value = val || props[propertyName];
|
|
3354
|
-
if ((0,
|
|
4776
|
+
if ((0, import_utils25.isUndefined)(value) && (0, import_utils25.isNull)(value))
|
|
3355
4777
|
return;
|
|
3356
4778
|
const shouldScaleBoxSize = props.scaleBoxSize;
|
|
3357
4779
|
const isBoxSize = checkIfBoxSize(propertyName);
|
|
3358
|
-
if (!shouldScaleBoxSize && isBoxSize && (0,
|
|
4780
|
+
if (!shouldScaleBoxSize && isBoxSize && (0, import_utils25.isString)(value)) {
|
|
3359
4781
|
value = value.split(" ").map((v) => {
|
|
3360
4782
|
const isSingleLetter = v.length < 3 && /[A-Z]/.test(v);
|
|
3361
4783
|
const hasUnits = ["%", "vw", "vh", "ch"].some((unit) => value.includes(unit));
|
|
@@ -3377,9 +4799,9 @@ var transformSizeRatio = (propertyName, props) => {
|
|
|
3377
4799
|
};
|
|
3378
4800
|
|
|
3379
4801
|
// src/set.js
|
|
3380
|
-
var
|
|
4802
|
+
var import_utils26 = __toESM(require_cjs2(), 1);
|
|
3381
4803
|
var setCases = (val, key) => {
|
|
3382
|
-
if ((0,
|
|
4804
|
+
if ((0, import_utils26.isFunction)(val))
|
|
3383
4805
|
return val();
|
|
3384
4806
|
return val;
|
|
3385
4807
|
};
|