@symbo.ls/scratch 2.11.500 → 2.11.512

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 CHANGED
@@ -34,3816 +34,59 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  var require_cjs = __commonJS({
35
35
  "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
36
36
  "use strict";
37
- var __defProp2 = Object.defineProperty;
37
+ var __defProp3 = Object.defineProperty;
38
38
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
39
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
40
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
41
41
  var __export2 = (target, all) => {
42
42
  for (var name in all)
43
- __defProp2(target, name, { get: all[name], enumerable: true });
43
+ __defProp3(target, name, { get: all[name], enumerable: true });
44
44
  };
45
45
  var __copyProps2 = (to, from, except, desc) => {
46
46
  if (from && typeof from === "object" || typeof from === "function") {
47
47
  for (let key of __getOwnPropNames2(from))
48
- if (!__hasOwnProp2.call(to, key) && key !== except)
49
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
48
+ if (!__hasOwnProp3.call(to, key) && key !== except)
49
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
50
50
  }
51
51
  return to;
52
52
  };
53
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
54
54
  var globals_exports = {};
55
55
  __export2(globals_exports, {
56
- document: () => document4,
56
+ document: () => document5,
57
57
  global: () => global,
58
58
  self: () => self,
59
- window: () => window3
59
+ window: () => window4
60
60
  });
61
61
  module2.exports = __toCommonJS2(globals_exports);
62
62
  var global = globalThis;
63
63
  var self = globalThis;
64
- var window3 = globalThis;
65
- var document4 = window3.document;
66
- }
67
- });
68
-
69
- // ../../../domql/packages/utils/dist/cjs/key.js
70
- var require_key = __commonJS({
71
- "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
72
- "use strict";
73
- var __defProp2 = Object.defineProperty;
74
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
75
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
76
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
77
- var __export2 = (target, all) => {
78
- for (var name in all)
79
- __defProp2(target, name, { get: all[name], enumerable: true });
80
- };
81
- var __copyProps2 = (to, from, except, desc) => {
82
- if (from && typeof from === "object" || typeof from === "function") {
83
- for (let key of __getOwnPropNames2(from))
84
- if (!__hasOwnProp2.call(to, key) && key !== except)
85
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
86
- }
87
- return to;
88
- };
89
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
90
- var key_exports = {};
91
- __export2(key_exports, {
92
- createSnapshotId: () => createSnapshotId,
93
- generateKey: () => generateKey
94
- });
95
- module2.exports = __toCommonJS2(key_exports);
96
- var generateKey = /* @__PURE__ */ function() {
97
- let index = 0;
98
- function newId() {
99
- index++;
100
- return index;
101
- }
102
- return newId;
103
- }();
104
- var createSnapshotId = generateKey;
105
- }
106
- });
107
-
108
- // ../../../domql/packages/utils/dist/cjs/env.js
109
- var require_env = __commonJS({
110
- "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
111
- "use strict";
112
- var __defProp2 = Object.defineProperty;
113
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
114
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
115
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
116
- var __export2 = (target, all) => {
117
- for (var name in all)
118
- __defProp2(target, name, { get: all[name], enumerable: true });
119
- };
120
- var __copyProps2 = (to, from, except, desc) => {
121
- if (from && typeof from === "object" || typeof from === "function") {
122
- for (let key of __getOwnPropNames2(from))
123
- if (!__hasOwnProp2.call(to, key) && key !== except)
124
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
125
- }
126
- return to;
127
- };
128
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
129
- var env_exports = {};
130
- __export2(env_exports, {
131
- NODE_ENV: () => NODE_ENV,
132
- getNev: () => getNev,
133
- isDevelopment: () => isDevelopment,
134
- isProduction: () => isProduction,
135
- isTest: () => isTest
136
- });
137
- module2.exports = __toCommonJS2(env_exports);
138
- var NODE_ENV = "development";
139
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
140
- var isTest = (env = NODE_ENV) => env === "test";
141
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
142
- var getNev = (key, env = NODE_ENV) => env[key];
143
- }
144
- });
145
-
146
- // ../../../domql/packages/utils/dist/cjs/globals.js
147
- var require_globals = __commonJS({
148
- "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
149
- "use strict";
150
- var __defProp2 = Object.defineProperty;
151
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
152
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
153
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
154
- var __export2 = (target, all) => {
155
- for (var name in all)
156
- __defProp2(target, name, { get: all[name], enumerable: true });
157
- };
158
- var __copyProps2 = (to, from, except, desc) => {
159
- if (from && typeof from === "object" || typeof from === "function") {
160
- for (let key of __getOwnPropNames2(from))
161
- if (!__hasOwnProp2.call(to, key) && key !== except)
162
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
163
- }
164
- return to;
165
- };
166
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
167
- var globals_exports = {};
168
- __export2(globals_exports, {
169
- document: () => document4,
170
- global: () => global,
171
- self: () => self,
172
- window: () => window3
173
- });
174
- module2.exports = __toCommonJS2(globals_exports);
175
- var global = globalThis;
176
- var self = globalThis;
177
- var window3 = globalThis;
178
- var document4 = window3.document;
179
- }
180
- });
181
-
182
- // ../../../domql/packages/utils/dist/cjs/node.js
183
- var require_node = __commonJS({
184
- "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
185
- "use strict";
186
- var __defProp2 = Object.defineProperty;
187
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
188
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
189
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
190
- var __export2 = (target, all) => {
191
- for (var name in all)
192
- __defProp2(target, name, { get: all[name], enumerable: true });
193
- };
194
- var __copyProps2 = (to, from, except, desc) => {
195
- if (from && typeof from === "object" || typeof from === "function") {
196
- for (let key of __getOwnPropNames2(from))
197
- if (!__hasOwnProp2.call(to, key) && key !== except)
198
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
199
- }
200
- return to;
201
- };
202
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
203
- var node_exports = {};
204
- __export2(node_exports, {
205
- isDOMNode: () => isDOMNode,
206
- isHtmlElement: () => isHtmlElement,
207
- isNode: () => isNode
208
- });
209
- module2.exports = __toCommonJS2(node_exports);
210
- var import_globals3 = require_globals();
211
- var isNode = (obj) => {
212
- return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
213
- };
214
- var isHtmlElement = (obj) => {
215
- return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
216
- };
217
- var isDOMNode = (obj) => {
218
- return typeof import_globals3.window !== "undefined" && (obj instanceof import_globals3.window.Node || obj instanceof import_globals3.window.Window || obj === import_globals3.window || obj === document);
219
- };
220
- }
221
- });
222
-
223
- // ../../../domql/packages/utils/dist/cjs/types.js
224
- var require_types = __commonJS({
225
- "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
226
- "use strict";
227
- var __defProp2 = Object.defineProperty;
228
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
229
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
230
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
231
- var __export2 = (target, all) => {
232
- for (var name in all)
233
- __defProp2(target, name, { get: all[name], enumerable: true });
234
- };
235
- var __copyProps2 = (to, from, except, desc) => {
236
- if (from && typeof from === "object" || typeof from === "function") {
237
- for (let key of __getOwnPropNames2(from))
238
- if (!__hasOwnProp2.call(to, key) && key !== except)
239
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
240
- }
241
- return to;
242
- };
243
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
244
- var types_exports = {};
245
- __export2(types_exports, {
246
- TYPES: () => TYPES,
247
- is: () => is,
248
- isArray: () => isArray7,
249
- isBoolean: () => isBoolean,
250
- isDate: () => isDate,
251
- isDefined: () => isDefined2,
252
- isFunction: () => isFunction2,
253
- isNot: () => isNot,
254
- isNull: () => isNull2,
255
- isNumber: () => isNumber2,
256
- isObject: () => isObject7,
257
- isObjectLike: () => isObjectLike3,
258
- isString: () => isString9,
259
- isUndefined: () => isUndefined2
260
- });
261
- module2.exports = __toCommonJS2(types_exports);
262
- var import_node = require_node();
263
- var isObject7 = (arg) => {
264
- if (arg === null)
265
- return false;
266
- return typeof arg === "object" && arg.constructor === Object;
267
- };
268
- var isString9 = (arg) => typeof arg === "string";
269
- var isNumber2 = (arg) => typeof arg === "number";
270
- var isFunction2 = (arg) => typeof arg === "function";
271
- var isBoolean = (arg) => arg === true || arg === false;
272
- var isNull2 = (arg) => arg === null;
273
- var isArray7 = (arg) => Array.isArray(arg);
274
- var isDate = (d) => d instanceof Date;
275
- var isObjectLike3 = (arg) => {
276
- if (arg === null)
277
- return false;
278
- return typeof arg === "object";
279
- };
280
- var isDefined2 = (arg) => {
281
- return isObject7(arg) || isObjectLike3(arg) || isString9(arg) || isNumber2(arg) || isFunction2(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
282
- };
283
- var isUndefined2 = (arg) => {
284
- return arg === void 0;
285
- };
286
- var TYPES = {
287
- boolean: isBoolean,
288
- array: isArray7,
289
- object: isObject7,
290
- string: isString9,
291
- date: isDate,
292
- number: isNumber2,
293
- null: isNull2,
294
- function: isFunction2,
295
- objectLike: isObjectLike3,
296
- node: import_node.isNode,
297
- htmlElement: import_node.isHtmlElement,
298
- defined: isDefined2
299
- };
300
- var is = (arg) => {
301
- return (...args) => {
302
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
303
- };
304
- };
305
- var isNot = (arg) => {
306
- return (...args) => {
307
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
308
- };
309
- };
310
- }
311
- });
312
-
313
- // ../../../domql/packages/utils/dist/cjs/array.js
314
- var require_array = __commonJS({
315
- "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
316
- "use strict";
317
- var __defProp2 = Object.defineProperty;
318
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
319
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
320
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
321
- var __export2 = (target, all) => {
322
- for (var name in all)
323
- __defProp2(target, name, { get: all[name], enumerable: true });
324
- };
325
- var __copyProps2 = (to, from, except, desc) => {
326
- if (from && typeof from === "object" || typeof from === "function") {
327
- for (let key of __getOwnPropNames2(from))
328
- if (!__hasOwnProp2.call(to, key) && key !== except)
329
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
330
- }
331
- return to;
332
- };
333
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
334
- var array_exports = {};
335
- __export2(array_exports, {
336
- addItemAfterEveryElement: () => addItemAfterEveryElement,
337
- arrayContainsOtherArray: () => arrayContainsOtherArray,
338
- arraysEqual: () => arraysEqual,
339
- checkIfStringIsInArray: () => checkIfStringIsInArray,
340
- cutArrayAfterValue: () => cutArrayAfterValue,
341
- cutArrayBeforeValue: () => cutArrayBeforeValue,
342
- filterArrays: () => filterArrays,
343
- filterArraysFast: () => filterArraysFast,
344
- getFrequencyInArray: () => getFrequencyInArray,
345
- joinArrays: () => joinArrays,
346
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
347
- mergeArray: () => mergeArray,
348
- removeFromArray: () => removeFromArray,
349
- removeValueFromArray: () => removeValueFromArray,
350
- removeValueFromArrayAll: () => removeValueFromArrayAll,
351
- reorderArrayByValues: () => reorderArrayByValues,
352
- swapItemsInArray: () => swapItemsInArray
353
- });
354
- module2.exports = __toCommonJS2(array_exports);
355
- var import_object = require_object();
356
- var import_types = require_types();
357
- var arrayContainsOtherArray = (arr1, arr2) => {
358
- return arr2.every((val) => arr1.includes(val));
359
- };
360
- var getFrequencyInArray = (arr, value) => {
361
- return arr.reduce((count, currentValue) => {
362
- return currentValue === value ? count + 1 : count;
363
- }, 0);
364
- };
365
- var removeFromArray = (arr, index) => {
366
- if ((0, import_types.isString)(index))
367
- index = parseInt(index);
368
- if ((0, import_types.isNumber)(index)) {
369
- if (index < 0 || index >= arr.length || isNaN(index)) {
370
- throw new Error("Invalid index");
371
- }
372
- arr.splice(index, 1);
373
- } else if ((0, import_types.isArray)(index)) {
374
- index.forEach((idx) => removeFromArray(arr, idx));
375
- } else {
376
- throw new Error("Invalid index");
377
- }
378
- return arr;
379
- };
380
- var swapItemsInArray = (arr, i, j) => {
381
- [arr[i], arr[j]] = [arr[j], arr[i]];
382
- };
383
- var joinArrays = (...arrays) => {
384
- return [].concat(...arrays);
385
- };
386
- var mergeArray = (arr, exclude = []) => {
387
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
388
- };
389
- var mergeAndCloneIfArray = (obj) => {
390
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
391
- };
392
- var cutArrayBeforeValue = (arr, value) => {
393
- const index = arr.indexOf(value);
394
- if (index !== -1) {
395
- return arr.slice(0, index);
396
- }
397
- return arr;
398
- };
399
- var cutArrayAfterValue = (arr, value) => {
400
- if (!(0, import_types.isArray)(arr))
401
- return;
402
- const index = arr.indexOf(value);
403
- if (index !== -1) {
404
- return arr.slice(index + 1);
405
- }
406
- return arr;
407
- };
408
- var removeValueFromArray = (arr, value) => {
409
- const index = arr.indexOf(value);
410
- if (index > -1) {
411
- const newArray = [...arr];
412
- newArray.splice(index, 1);
413
- return newArray;
414
- }
415
- return arr;
416
- };
417
- var removeValueFromArrayAll = (arr, value) => {
418
- return arr.filter((item) => item !== value);
419
- };
420
- var addItemAfterEveryElement = (array, item) => {
421
- const result = [];
422
- for (let i = 0; i < array.length; i++) {
423
- result.push(array[i]);
424
- if (i < array.length - 1) {
425
- result.push(item);
426
- }
427
- }
428
- return result;
429
- };
430
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
431
- const newArray = [...array];
432
- const indexToMove = newArray.indexOf(valueToMove);
433
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
434
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
435
- const removedItem = newArray.splice(indexToMove, 1)[0];
436
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
437
- newArray.splice(insertIndex, 0, removedItem);
438
- }
439
- return newArray;
440
- };
441
- var arraysEqual = (arr1, arr2) => {
442
- if (arr1.length !== arr2.length) {
443
- return false;
444
- }
445
- for (let i = 0; i < arr1.length; i++) {
446
- if (arr1[i] !== arr2[i]) {
447
- return false;
448
- }
449
- }
450
- return true;
451
- };
452
- var filterArrays = (sourceArr, excludeArr) => {
453
- return sourceArr.filter((item) => !excludeArr.includes(item));
454
- };
455
- var filterArraysFast = (sourceArr, excludeArr) => {
456
- const excludeSet = new Set(excludeArr);
457
- return sourceArr.filter((item) => !excludeSet.has(item));
458
- };
459
- var checkIfStringIsInArray = (string, arr) => {
460
- if (!string)
461
- return;
462
- return arr.filter((v) => string.includes(v)).length;
463
- };
464
- }
465
- });
466
-
467
- // ../../../domql/packages/utils/dist/cjs/string.js
468
- var require_string = __commonJS({
469
- "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
470
- "use strict";
471
- var __defProp2 = Object.defineProperty;
472
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
473
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
474
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
475
- var __export2 = (target, all) => {
476
- for (var name in all)
477
- __defProp2(target, name, { get: all[name], enumerable: true });
478
- };
479
- var __copyProps2 = (to, from, except, desc) => {
480
- if (from && typeof from === "object" || typeof from === "function") {
481
- for (let key of __getOwnPropNames2(from))
482
- if (!__hasOwnProp2.call(to, key) && key !== except)
483
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
484
- }
485
- return to;
486
- };
487
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
488
- var string_exports = {};
489
- __export2(string_exports, {
490
- customDecodeURIComponent: () => customDecodeURIComponent,
491
- customEncodeURIComponent: () => customEncodeURIComponent,
492
- decodeNewlines: () => decodeNewlines,
493
- encodeNewlines: () => encodeNewlines,
494
- findKeyPosition: () => findKeyPosition,
495
- lowercaseFirstLetter: () => lowercaseFirstLetter,
496
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
497
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
498
- stringIncludesAny: () => stringIncludesAny,
499
- trimStringFromSymbols: () => trimStringFromSymbols
500
- });
501
- module2.exports = __toCommonJS2(string_exports);
502
- var stringIncludesAny = (str, characters) => {
503
- for (const char of characters) {
504
- if (str.includes(char)) {
505
- return true;
506
- }
507
- }
508
- return false;
509
- };
510
- var trimStringFromSymbols = (str, characters) => {
511
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
512
- return str.replace(pattern, "");
513
- };
514
- var brackRegex = {
515
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
516
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
517
- };
518
- function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
519
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
520
- return str;
521
- const reg = brackRegex[options.bracketsLength || 2];
522
- const obj = forcedState || this.state || {};
523
- return str.replace(reg, (_, parentPath, variable) => {
524
- if (parentPath) {
525
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
526
- let parentState = obj;
527
- for (let i = 0; i < parentLevels; i++) {
528
- parentState = parentState.parent;
529
- if (!parentState) {
530
- return "";
531
- }
532
- }
533
- const value = parentState[variable.trim()];
534
- return value !== void 0 ? `${value}` : "";
535
- } else {
536
- const value = obj[variable.trim()];
537
- return value !== void 0 ? `${value}` : "";
538
- }
539
- });
540
- }
541
- var lowercaseFirstLetter = (inputString) => {
542
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
543
- };
544
- var findKeyPosition = (str, key) => {
545
- const lines = str.split("\n");
546
- let startLineNumber = -1;
547
- let endLineNumber = -1;
548
- let startColumn = -1;
549
- let endColumn = -1;
550
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
551
- let braceCount = 0;
552
- let foundKey = false;
553
- for (let i = 0; i < lines.length; i++) {
554
- if (keyPattern.test(lines[i]) && !foundKey) {
555
- foundKey = true;
556
- startLineNumber = i + 1;
557
- startColumn = lines[i].indexOf(key) + 1;
558
- if (lines[i].includes("{}")) {
559
- endLineNumber = startLineNumber;
560
- endColumn = lines[i].indexOf("{}") + 3;
561
- break;
562
- }
563
- const line = lines[i].slice(startColumn + key.length);
564
- if (line.includes("{") || line.includes("[")) {
565
- braceCount = 1;
566
- } else {
567
- endLineNumber = i + 1;
568
- endColumn = lines[i].length + 1;
569
- break;
570
- }
571
- } else if (foundKey) {
572
- braceCount += (lines[i].match(/{/g) || []).length;
573
- braceCount += (lines[i].match(/\[/g) || []).length;
574
- braceCount -= (lines[i].match(/}/g) || []).length;
575
- braceCount -= (lines[i].match(/]/g) || []).length;
576
- if (braceCount === 0) {
577
- endLineNumber = i + 1;
578
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
579
- break;
580
- }
581
- }
582
- }
583
- return {
584
- startColumn,
585
- endColumn,
586
- startLineNumber,
587
- endLineNumber
588
- };
589
- };
590
- var replaceOctalEscapeSequences = (str) => {
591
- const octalRegex = /\\([0-7]{1,3})/g;
592
- return str.replace(octalRegex, (match, p1) => {
593
- const octalValue = parseInt(p1, 8);
594
- const char = String.fromCharCode(octalValue);
595
- return char;
596
- });
597
- };
598
- var encodeNewlines = (str) => {
599
- return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
600
- };
601
- var decodeNewlines = (encodedStr) => {
602
- return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
603
- };
604
- var customEncodeURIComponent = (str) => {
605
- return str.split("").map((char) => {
606
- if (/[^a-zA-Z0-9\s]/.test(char)) {
607
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
608
- }
609
- return char;
610
- }).join("");
611
- };
612
- var customDecodeURIComponent = (encodedStr) => {
613
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
614
- };
615
- }
616
- });
617
-
618
- // ../../../domql/packages/utils/dist/cjs/object.js
619
- var require_object = __commonJS({
620
- "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
621
- "use strict";
622
- var __defProp2 = Object.defineProperty;
623
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
624
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
625
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
626
- var __export2 = (target, all) => {
627
- for (var name in all)
628
- __defProp2(target, name, { get: all[name], enumerable: true });
629
- };
630
- var __copyProps2 = (to, from, except, desc) => {
631
- if (from && typeof from === "object" || typeof from === "function") {
632
- for (let key of __getOwnPropNames2(from))
633
- if (!__hasOwnProp2.call(to, key) && key !== except)
634
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
635
- }
636
- return to;
637
- };
638
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
639
- var object_exports = {};
640
- __export2(object_exports, {
641
- clone: () => clone,
642
- createNestedObject: () => createNestedObject,
643
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
644
- deepClone: () => deepClone2,
645
- deepContains: () => deepContains,
646
- deepDestringify: () => deepDestringify,
647
- deepDiff: () => deepDiff,
648
- deepMerge: () => deepMerge3,
649
- deepStringify: () => deepStringify,
650
- deepStringifyWithMaxDepth: () => deepStringifyWithMaxDepth,
651
- detachFunctionsFromObject: () => detachFunctionsFromObject,
652
- detectInfiniteLoop: () => detectInfiniteLoop,
653
- diff: () => diff,
654
- diffArrays: () => diffArrays,
655
- diffObjects: () => diffObjects,
656
- excludeKeysFromObject: () => excludeKeysFromObject,
657
- exec: () => exec,
658
- flattenRecursive: () => flattenRecursive,
659
- hasOwnProperty: () => hasOwnProperty,
660
- isCyclic: () => isCyclic,
661
- isEmpty: () => isEmpty,
662
- isEmptyObject: () => isEmptyObject,
663
- isEqualDeep: () => isEqualDeep,
664
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
665
- map: () => map,
666
- merge: () => merge5,
667
- mergeArrayExclude: () => mergeArrayExclude,
668
- mergeIfExisted: () => mergeIfExisted,
669
- objectToString: () => objectToString,
670
- overwrite: () => overwrite,
671
- overwriteDeep: () => overwriteDeep2,
672
- overwriteShallow: () => overwriteShallow,
673
- removeFromObject: () => removeFromObject,
674
- removeNestedKeyByPath: () => removeNestedKeyByPath,
675
- stringToObject: () => stringToObject
676
- });
677
- module2.exports = __toCommonJS2(object_exports);
678
- var import_globals3 = require_globals();
679
- var import_types = require_types();
680
- var import_array = require_array();
681
- var import_string = require_string();
682
- var import_node = require_node();
683
- var ENV2 = "development";
684
- var exec = (param, element, state, context) => {
685
- if ((0, import_types.isFunction)(param)) {
686
- return param.call(
687
- element,
688
- element,
689
- state || element.state,
690
- context || element.context
691
- );
692
- }
693
- return param;
694
- };
695
- var map = (obj, extention, element) => {
696
- for (const e in extention) {
697
- obj[e] = exec(extention[e], element);
698
- }
699
- };
700
- var merge5 = (element, obj, excludeFrom = []) => {
701
- for (const e in obj) {
702
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
703
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
704
- continue;
705
- const elementProp = element[e];
706
- const objProp = obj[e];
707
- if (elementProp === void 0) {
708
- element[e] = objProp;
709
- }
710
- }
711
- return element;
712
- };
713
- var deepMerge3 = (element, extend, excludeFrom = []) => {
714
- for (const e in extend) {
715
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
716
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
717
- continue;
718
- const elementProp = element[e];
719
- const extendProp = extend[e];
720
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
721
- deepMerge3(elementProp, extendProp, excludeFrom);
722
- } else if (elementProp === void 0) {
723
- element[e] = extendProp;
724
- }
725
- }
726
- return element;
727
- };
728
- var clone = (obj, excludeFrom = []) => {
729
- const o = {};
730
- for (const prop in obj) {
731
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
732
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
733
- continue;
734
- o[prop] = obj[prop];
735
- }
736
- return o;
737
- };
738
- var mergeArrayExclude = (arr, exclude = []) => {
739
- return arr.reduce((acc, curr) => deepMerge3(acc, deepClone2(curr, { exclude })), {});
740
- };
741
- var deepClone2 = (obj, options = {}) => {
742
- const {
743
- exclude = [],
744
- cleanUndefined = false,
745
- cleanNull = false,
746
- window: targetWindow,
747
- visited = /* @__PURE__ */ new WeakMap(),
748
- handleExtend = false
749
- } = options;
750
- if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
751
- return obj;
752
- }
753
- if (visited.has(obj)) {
754
- return visited.get(obj);
755
- }
756
- const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
757
- visited.set(obj, clone2);
758
- for (const key in obj) {
759
- if (!Object.prototype.hasOwnProperty.call(obj, key))
760
- continue;
761
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
762
- continue;
763
- const value = obj[key];
764
- if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
765
- continue;
766
- if ((0, import_node.isDOMNode)(value)) {
767
- clone2[key] = value;
768
- continue;
769
- }
770
- if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
771
- clone2[key] = (0, import_array.mergeArray)(value, exclude);
772
- continue;
773
- }
774
- if ((0, import_types.isFunction)(value) && targetWindow) {
775
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
776
- continue;
777
- }
778
- if ((0, import_types.isObjectLike)(value)) {
779
- clone2[key] = deepClone2(value, {
780
- ...options,
781
- visited
782
- });
783
- } else {
784
- clone2[key] = value;
785
- }
786
- }
787
- return clone2;
788
- };
789
- var deepStringify = (obj, stringified = {}) => {
790
- var _a, _b;
791
- if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
792
- (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
793
- obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
794
- }
795
- for (const prop in obj) {
796
- const objProp = obj[prop];
797
- if ((0, import_types.isFunction)(objProp)) {
798
- stringified[prop] = objProp.toString();
799
- } else if ((0, import_types.isObject)(objProp)) {
800
- stringified[prop] = {};
801
- deepStringify(objProp, stringified[prop]);
802
- } else if ((0, import_types.isArray)(objProp)) {
803
- stringified[prop] = [];
804
- objProp.forEach((v, i) => {
805
- if ((0, import_types.isObject)(v)) {
806
- stringified[prop][i] = {};
807
- deepStringify(v, stringified[prop][i]);
808
- } else if ((0, import_types.isFunction)(v)) {
809
- stringified[prop][i] = v.toString();
810
- } else {
811
- stringified[prop][i] = v;
812
- }
813
- });
814
- } else {
815
- stringified[prop] = objProp;
816
- }
817
- }
818
- return stringified;
819
- };
820
- var MAX_DEPTH = 100;
821
- var deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "") => {
822
- if (depth > MAX_DEPTH) {
823
- console.warn(`Maximum depth exceeded at path: ${path}. Possible circular reference.`);
824
- return "[MAX_DEPTH_EXCEEDED]";
825
- }
826
- for (const prop in obj) {
827
- const currentPath = path ? `${path}.${prop}` : prop;
828
- const objProp = obj[prop];
829
- if ((0, import_types.isFunction)(objProp)) {
830
- stringified[prop] = objProp.toString();
831
- } else if ((0, import_types.isObject)(objProp)) {
832
- stringified[prop] = {};
833
- deepStringifyWithMaxDepth(objProp, stringified[prop], depth + 1, currentPath);
834
- } else if ((0, import_types.isArray)(objProp)) {
835
- stringified[prop] = [];
836
- objProp.forEach((v, i) => {
837
- const itemPath = `${currentPath}[${i}]`;
838
- if ((0, import_types.isObject)(v)) {
839
- stringified[prop][i] = {};
840
- deepStringifyWithMaxDepth(v, stringified[prop][i], depth + 1, itemPath);
841
- } else if ((0, import_types.isFunction)(v)) {
842
- stringified[prop][i] = v.toString();
843
- } else {
844
- stringified[prop][i] = v;
845
- }
846
- });
847
- } else {
848
- stringified[prop] = objProp;
849
- }
850
- }
851
- return stringified;
852
- };
853
- var objectToString = (obj = {}, indent = 0) => {
854
- const spaces = " ".repeat(indent);
855
- let str = "{\n";
856
- for (const [key, value] of Object.entries(obj)) {
857
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
858
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
859
- str += `${spaces} ${stringedKey}: `;
860
- if ((0, import_types.isArray)(value)) {
861
- str += "[\n";
862
- for (const element of value) {
863
- if ((0, import_types.isObjectLike)(element) && element !== null) {
864
- str += `${spaces} ${objectToString(element, indent + 2)},
865
- `;
866
- } else if ((0, import_types.isString)(element)) {
867
- str += `${spaces} '${element}',
868
- `;
869
- } else {
870
- str += `${spaces} ${element},
871
- `;
872
- }
873
- }
874
- str += `${spaces} ]`;
875
- } else if ((0, import_types.isObjectLike)(value)) {
876
- str += objectToString(value, indent + 1);
877
- } else if ((0, import_types.isString)(value)) {
878
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
879
- } else {
880
- str += value;
881
- }
882
- str += ",\n";
883
- }
884
- str += `${spaces}}`;
885
- return str;
886
- };
887
- var detachFunctionsFromObject = (obj, detached = {}) => {
888
- for (const prop in obj) {
889
- const objProp = obj[prop];
890
- if ((0, import_types.isFunction)(objProp))
891
- continue;
892
- else if ((0, import_types.isObject)(objProp)) {
893
- detached[prop] = {};
894
- deepStringify(objProp, detached[prop]);
895
- } else if ((0, import_types.isArray)(objProp)) {
896
- detached[prop] = [];
897
- objProp.forEach((v, i) => {
898
- if ((0, import_types.isFunction)(v))
899
- return;
900
- if ((0, import_types.isObject)(v)) {
901
- detached[prop][i] = {};
902
- detachFunctionsFromObject(v, detached[prop][i]);
903
- } else {
904
- detached[prop][i] = v;
905
- }
906
- });
907
- } else {
908
- detached[prop] = objProp;
909
- }
910
- }
911
- return detached;
912
- };
913
- var deepDestringify = (obj, destringified = {}) => {
914
- for (const prop in obj) {
915
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
916
- if (!hasOwnProperty2)
917
- continue;
918
- const objProp = obj[prop];
919
- if ((0, import_types.isString)(objProp)) {
920
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
921
- try {
922
- const evalProp = import_globals3.window.eval(`(${objProp})`);
923
- destringified[prop] = evalProp;
924
- } catch (e) {
925
- if (e)
926
- destringified[prop] = objProp;
927
- }
928
- } else {
929
- destringified[prop] = objProp;
930
- }
931
- } else if ((0, import_types.isArray)(objProp)) {
932
- destringified[prop] = [];
933
- objProp.forEach((arrProp) => {
934
- if ((0, import_types.isString)(arrProp)) {
935
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
936
- try {
937
- const evalProp = import_globals3.window.eval(`(${arrProp})`);
938
- destringified[prop].push(evalProp);
939
- } catch (e) {
940
- if (e)
941
- destringified[prop].push(arrProp);
942
- }
943
- } else {
944
- destringified[prop].push(arrProp);
945
- }
946
- } else if ((0, import_types.isObject)(arrProp)) {
947
- destringified[prop].push(deepDestringify(arrProp));
948
- } else {
949
- destringified[prop].push(arrProp);
950
- }
951
- });
952
- } else if ((0, import_types.isObject)(objProp)) {
953
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
954
- } else {
955
- destringified[prop] = objProp;
956
- }
957
- }
958
- return destringified;
959
- };
960
- var stringToObject = (str, opts = { verbose: true }) => {
961
- try {
962
- return str ? import_globals3.window.eval("(" + str + ")") : {};
963
- } catch (e) {
964
- if (opts.verbose)
965
- console.warn(e);
966
- }
967
- };
968
- var diffObjects = (original, objToDiff, cache) => {
969
- for (const e in objToDiff) {
970
- if (e === "ref")
971
- continue;
972
- const originalProp = original[e];
973
- const objToDiffProp = objToDiff[e];
974
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
975
- cache[e] = {};
976
- diff(originalProp, objToDiffProp, cache[e]);
977
- } else if (objToDiffProp !== void 0) {
978
- cache[e] = objToDiffProp;
979
- }
980
- }
981
- return cache;
982
- };
983
- var diffArrays = (original, objToDiff, cache) => {
984
- if (original.length !== objToDiff.length) {
985
- cache = objToDiff;
986
- } else {
987
- const diffArr = [];
988
- for (let i = 0; i < original.length; i++) {
989
- const diffObj = diff(original[i], objToDiff[i]);
990
- if (Object.keys(diffObj).length > 0) {
991
- diffArr.push(diffObj);
992
- }
993
- }
994
- if (diffArr.length > 0) {
995
- cache = diffArr;
996
- }
997
- }
998
- return cache;
999
- };
1000
- var diff = (original, objToDiff, cache = {}) => {
1001
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
1002
- cache = [];
1003
- diffArrays(original, objToDiff, cache);
1004
- } else {
1005
- diffObjects(original, objToDiff, cache);
1006
- }
1007
- return cache;
1008
- };
1009
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
1010
- var isEmpty = (o) => Object.keys(o).length === 0;
1011
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
1012
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
1013
- var deepDiff = (lhs, rhs) => {
1014
- if (lhs === rhs)
1015
- return {};
1016
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
1017
- return rhs;
1018
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
1019
- if (!hasOwnProperty(rhs, key)) {
1020
- acc[key] = void 0;
1021
- }
1022
- return acc;
1023
- }, makeObjectWithoutPrototype());
1024
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
1025
- if (lhs.valueOf() === rhs.valueOf())
1026
- return {};
1027
- return rhs;
1028
- }
1029
- return Object.keys(rhs).reduce((acc, key) => {
1030
- if (!hasOwnProperty(lhs, key)) {
1031
- acc[key] = rhs[key];
1032
- return acc;
1033
- }
1034
- const difference = diff(lhs[key], rhs[key]);
1035
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
1036
- return acc;
1037
- }
1038
- acc[key] = difference;
1039
- return acc;
1040
- }, deletedValues);
1041
- };
1042
- var overwrite = (element, params, opts = {}) => {
1043
- const { __ref: ref } = element;
1044
- const excl = opts.exclude || [];
1045
- const allowUnderscore = opts.preventUnderscore;
1046
- const preventCaching = opts.preventCaching;
1047
- for (const e in params) {
1048
- if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
1049
- continue;
1050
- const elementProp = element[e];
1051
- const paramsProp = params[e];
1052
- if (paramsProp !== void 0) {
1053
- element[e] = paramsProp;
1054
- if (ref && !preventCaching) {
1055
- ref.__cache[e] = elementProp;
1056
- }
1057
- if ((0, import_types.isObject)(opts.diff)) {
1058
- diff[e] = elementProp;
1059
- }
1060
- }
1061
- }
1062
- return element;
1063
- };
1064
- var overwriteShallow = (obj, params, excludeFrom = []) => {
1065
- for (const e in params) {
1066
- if (excludeFrom.includes(e) || e.startsWith("__"))
1067
- continue;
1068
- obj[e] = params[e];
1069
- }
1070
- return obj;
1071
- };
1072
- var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
1073
- const excl = opts.exclude || [];
1074
- const forcedExclude = opts.preventForce ? [] : ["node", "window"];
1075
- if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
1076
- return params;
1077
- }
1078
- if (visited.has(obj))
1079
- return visited.get(obj);
1080
- visited.set(obj, obj);
1081
- for (const e in params) {
1082
- if (!Object.hasOwnProperty.call(params, e))
1083
- continue;
1084
- if (excl.includes(e) || forcedExclude && e.startsWith("__"))
1085
- continue;
1086
- const objProp = obj[e];
1087
- const paramsProp = params[e];
1088
- if ((0, import_node.isDOMNode)(paramsProp)) {
1089
- obj[e] = paramsProp;
1090
- } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
1091
- obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
1092
- } else if (paramsProp !== void 0) {
1093
- obj[e] = paramsProp;
1094
- }
1095
- }
1096
- return obj;
1097
- };
1098
- var mergeIfExisted = (a, b) => {
1099
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
1100
- return deepMerge3(a, b);
1101
- return a || b;
1102
- };
1103
- var flattenRecursive = (param, prop, stack = []) => {
1104
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
1105
- stack.push(objectized);
1106
- const extendOfExtend = objectized[prop];
1107
- if (extendOfExtend)
1108
- flattenRecursive(extendOfExtend, prop, stack);
1109
- delete objectized[prop];
1110
- return stack;
1111
- };
1112
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
1113
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
1114
- return param === element;
1115
- }
1116
- if (visited.has(param) || visited.has(element)) {
1117
- return true;
1118
- }
1119
- visited.add(param);
1120
- visited.add(element);
1121
- const keysParam = Object.keys(param);
1122
- const keysElement = Object.keys(element);
1123
- if (keysParam.length !== keysElement.length) {
1124
- return false;
1125
- }
1126
- for (const key of keysParam) {
1127
- if (!keysElement.includes(key)) {
1128
- return false;
1129
- }
1130
- const paramProp = param[key];
1131
- const elementProp = element[key];
1132
- if (!isEqualDeep(paramProp, elementProp, visited)) {
1133
- return false;
1134
- }
1135
- }
1136
- return true;
1137
- };
1138
- var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
1139
- if (obj1 === obj2)
1140
- return true;
1141
- if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
1142
- return false;
1143
- if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
1144
- return obj1 === obj2;
1145
- const stack = [[obj1, obj2]];
1146
- const visited = /* @__PURE__ */ new WeakSet();
1147
- while (stack.length > 0) {
1148
- const [current1, current2] = stack.pop();
1149
- if (visited.has(current1))
1150
- continue;
1151
- visited.add(current1);
1152
- const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
1153
- const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
1154
- if (keys1.length !== keys2.length)
1155
- return false;
1156
- for (const key of keys1) {
1157
- if (!Object.prototype.hasOwnProperty.call(current2, key))
1158
- return false;
1159
- const value1 = current1[key];
1160
- const value2 = current2[key];
1161
- if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
1162
- if (value1 !== value2)
1163
- return false;
1164
- } else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
1165
- if (value1 !== value2) {
1166
- stack.push([value1, value2]);
1167
- }
1168
- } else if (value1 !== value2) {
1169
- return false;
1170
- }
1171
- }
1172
- }
1173
- return true;
1174
- };
1175
- var removeFromObject = (obj, props) => {
1176
- if (props === void 0 || props === null)
1177
- return obj;
1178
- if ((0, import_types.is)(props)("string", "number")) {
1179
- delete obj[props];
1180
- } else if ((0, import_types.isArray)(props)) {
1181
- props.forEach((prop) => delete obj[prop]);
1182
- } else {
1183
- throw new Error("Invalid input: props must be a string or an array of strings");
1184
- }
1185
- return obj;
1186
- };
1187
- var createObjectWithoutPrototype = (obj) => {
1188
- if (obj === null || typeof obj !== "object") {
1189
- return obj;
1190
- }
1191
- const newObj = /* @__PURE__ */ Object.create(null);
1192
- for (const key in obj) {
1193
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
1194
- newObj[key] = createObjectWithoutPrototype(obj[key]);
1195
- }
1196
- }
1197
- return newObj;
1198
- };
1199
- var createNestedObject = (arr, lastValue) => {
1200
- const nestedObject = {};
1201
- if (arr.length === 0) {
1202
- return lastValue;
1203
- }
1204
- arr.reduce((obj, value, index) => {
1205
- if (!obj[value]) {
1206
- obj[value] = {};
1207
- }
1208
- if (index === arr.length - 1 && lastValue) {
1209
- obj[value] = lastValue;
1210
- }
1211
- return obj[value];
1212
- }, nestedObject);
1213
- return nestedObject;
1214
- };
1215
- var removeNestedKeyByPath = (obj, path) => {
1216
- if (!Array.isArray(path)) {
1217
- throw new Error("Path must be an array.");
1218
- }
1219
- let current = obj;
1220
- for (let i = 0; i < path.length - 1; i++) {
1221
- if (current[path[i]] === void 0) {
1222
- return;
1223
- }
1224
- current = current[path[i]];
1225
- }
1226
- const lastKey = path[path.length - 1];
1227
- if (current && Object.hasOwnProperty.call(current, lastKey)) {
1228
- delete current[lastKey];
1229
- }
1230
- };
1231
- var detectInfiniteLoop = (arr) => {
1232
- const maxRepeats = 10;
1233
- let pattern = [];
1234
- let repeatCount = 0;
1235
- for (let i = 0; i < arr.length; i++) {
1236
- if (pattern.length < 2) {
1237
- pattern.push(arr[i]);
1238
- } else {
1239
- if (arr[i] === pattern[i % 2]) {
1240
- repeatCount++;
1241
- } else {
1242
- pattern = [arr[i - 1], arr[i]];
1243
- repeatCount = 1;
1244
- }
1245
- if (repeatCount >= maxRepeats * 2) {
1246
- if (ENV2 === "test" || ENV2 === "development") {
1247
- console.warn("Warning: Potential infinite loop detected due to repeated sequence:", pattern);
1248
- }
1249
- return true;
1250
- }
1251
- }
1252
- }
1253
- };
1254
- var isCyclic = (obj) => {
1255
- const seenObjects = [];
1256
- function detect(obj2) {
1257
- if (obj2 && typeof obj2 === "object") {
1258
- if (seenObjects.indexOf(obj2) !== -1) {
1259
- return true;
1260
- }
1261
- seenObjects.push(obj2);
1262
- for (const key in obj2) {
1263
- if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
1264
- console.log(obj2, "cycle at " + key);
1265
- return true;
1266
- }
1267
- }
1268
- }
1269
- return false;
1270
- }
1271
- return detect(obj);
1272
- };
1273
- var excludeKeysFromObject = (obj, excludedKeys) => {
1274
- const result = { ...obj };
1275
- excludedKeys.forEach((key) => delete result[key]);
1276
- return result;
1277
- };
1278
- }
1279
- });
1280
-
1281
- // ../../../domql/packages/utils/dist/cjs/function.js
1282
- var require_function = __commonJS({
1283
- "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
1284
- "use strict";
1285
- var __defProp2 = Object.defineProperty;
1286
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1287
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1288
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1289
- var __export2 = (target, all) => {
1290
- for (var name in all)
1291
- __defProp2(target, name, { get: all[name], enumerable: true });
1292
- };
1293
- var __copyProps2 = (to, from, except, desc) => {
1294
- if (from && typeof from === "object" || typeof from === "function") {
1295
- for (let key of __getOwnPropNames2(from))
1296
- if (!__hasOwnProp2.call(to, key) && key !== except)
1297
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1298
- }
1299
- return to;
1300
- };
1301
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1302
- var function_exports = {};
1303
- __export2(function_exports, {
1304
- cloneFunction: () => cloneFunction,
1305
- debounce: () => debounce,
1306
- debounceOnContext: () => debounceOnContext,
1307
- isStringFunction: () => isStringFunction,
1308
- memoize: () => memoize
1309
- });
1310
- module2.exports = __toCommonJS2(function_exports);
1311
- function debounce(func, wait, immediate) {
1312
- let timeout;
1313
- return function() {
1314
- const context = this;
1315
- const args = arguments;
1316
- const later = function() {
1317
- timeout = null;
1318
- if (!immediate)
1319
- func.apply(context, args);
1320
- };
1321
- const callNow = immediate && !timeout;
1322
- clearTimeout(timeout);
1323
- timeout = setTimeout(later, wait);
1324
- if (callNow)
1325
- func.apply(context, args);
1326
- };
1327
- }
1328
- var debounceOnContext = (element, func, timeout = 300) => {
1329
- let timer;
1330
- return (...args) => {
1331
- clearTimeout(timer);
1332
- timer = setTimeout(() => {
1333
- func.apply(element, args);
1334
- }, timeout);
1335
- };
1336
- };
1337
- var memoize = (fn) => {
1338
- const cache = {};
1339
- return (...args) => {
1340
- const n = args[0];
1341
- if (n in cache) {
1342
- return cache[n];
1343
- } else {
1344
- const result = fn(n);
1345
- cache[n] = result;
1346
- return result;
1347
- }
1348
- };
1349
- };
1350
- var isStringFunction = (inputString) => {
1351
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
1352
- return functionRegex.test(inputString);
1353
- };
1354
- function cloneFunction(fn, win = window) {
1355
- const temp = function() {
1356
- return fn.apply(win, arguments);
1357
- };
1358
- for (const key in fn) {
1359
- if (Object.hasOwnProperty.call(fn, key)) {
1360
- temp[key] = fn[key];
1361
- }
1362
- }
1363
- return temp;
1364
- }
1365
- }
1366
- });
1367
-
1368
- // ../../../domql/packages/utils/dist/cjs/log.js
1369
- var require_log = __commonJS({
1370
- "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
1371
- "use strict";
1372
- var __defProp2 = Object.defineProperty;
1373
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1374
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1375
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1376
- var __export2 = (target, all) => {
1377
- for (var name in all)
1378
- __defProp2(target, name, { get: all[name], enumerable: true });
1379
- };
1380
- var __copyProps2 = (to, from, except, desc) => {
1381
- if (from && typeof from === "object" || typeof from === "function") {
1382
- for (let key of __getOwnPropNames2(from))
1383
- if (!__hasOwnProp2.call(to, key) && key !== except)
1384
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1385
- }
1386
- return to;
1387
- };
1388
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1389
- var log_exports = {};
1390
- __export2(log_exports, {
1391
- logGroupIf: () => logGroupIf,
1392
- logIf: () => logIf
1393
- });
1394
- module2.exports = __toCommonJS2(log_exports);
1395
- var logIf = (bool, ...arg) => {
1396
- if (bool)
1397
- arg.map((v) => console.log(v));
1398
- };
1399
- var logGroupIf = (bool, key, ...arg) => {
1400
- if (bool) {
1401
- console.group(key);
1402
- arg.map((v) => console.log(v));
1403
- console.groupEnd(key);
1404
- }
1405
- };
1406
- }
1407
- });
1408
-
1409
- // ../../../domql/packages/utils/dist/cjs/cookie.js
1410
- var require_cookie = __commonJS({
1411
- "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1412
- "use strict";
1413
- var __defProp2 = Object.defineProperty;
1414
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1415
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1416
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1417
- var __export2 = (target, all) => {
1418
- for (var name in all)
1419
- __defProp2(target, name, { get: all[name], enumerable: true });
1420
- };
1421
- var __copyProps2 = (to, from, except, desc) => {
1422
- if (from && typeof from === "object" || typeof from === "function") {
1423
- for (let key of __getOwnPropNames2(from))
1424
- if (!__hasOwnProp2.call(to, key) && key !== except)
1425
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1426
- }
1427
- return to;
1428
- };
1429
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1430
- var cookie_exports = {};
1431
- __export2(cookie_exports, {
1432
- getCookie: () => getCookie,
1433
- getLocalStorage: () => getLocalStorage,
1434
- isMobile: () => isMobile,
1435
- removeCookie: () => removeCookie,
1436
- setCookie: () => setCookie,
1437
- setLocalStorage: () => setLocalStorage
1438
- });
1439
- module2.exports = __toCommonJS2(cookie_exports);
1440
- var import_types = require_types();
1441
- var import_utils27 = require_cjs2();
1442
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1443
- var setCookie = (cname, cvalue, exdays = 365) => {
1444
- if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
1445
- return;
1446
- const d = /* @__PURE__ */ new Date();
1447
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1448
- const expires = `expires=${d.toUTCString()}`;
1449
- import_utils27.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1450
- };
1451
- var getCookie = (cname) => {
1452
- if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
1453
- return;
1454
- const name = `${cname}=`;
1455
- const decodedCookie = decodeURIComponent(import_utils27.document.cookie);
1456
- const ca = decodedCookie.split(";");
1457
- for (let i = 0; i < ca.length; i++) {
1458
- let c = ca[i];
1459
- while (c.charAt(0) === " ")
1460
- c = c.substring(1);
1461
- if (c.indexOf(name) === 0)
1462
- return c.substring(name.length, c.length);
1463
- }
1464
- return "";
1465
- };
1466
- var removeCookie = (cname) => {
1467
- if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
1468
- return;
1469
- import_utils27.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1470
- };
1471
- function getLocalStorage(key) {
1472
- let savedJSON;
1473
- if (window.localStorage) {
1474
- try {
1475
- savedJSON = JSON.parse(window.localStorage.getItem(key));
1476
- } catch (e) {
1477
- }
1478
- }
1479
- if (typeof savedJSON !== "undefined") {
1480
- return savedJSON;
1481
- }
1482
- }
1483
- function setLocalStorage(key, data) {
1484
- if (data && window.localStorage) {
1485
- if (typeof data === "object") {
1486
- window.localStorage.setItem(key, JSON.stringify(data));
1487
- } else {
1488
- window.localStorage.setItem(key, data);
1489
- }
1490
- }
1491
- }
1492
- }
1493
- });
1494
-
1495
- // ../../../domql/packages/utils/dist/cjs/tags.js
1496
- var require_tags = __commonJS({
1497
- "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1498
- "use strict";
1499
- var __defProp2 = Object.defineProperty;
1500
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1501
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1502
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1503
- var __export2 = (target, all) => {
1504
- for (var name in all)
1505
- __defProp2(target, name, { get: all[name], enumerable: true });
1506
- };
1507
- var __copyProps2 = (to, from, except, desc) => {
1508
- if (from && typeof from === "object" || typeof from === "function") {
1509
- for (let key of __getOwnPropNames2(from))
1510
- if (!__hasOwnProp2.call(to, key) && key !== except)
1511
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1512
- }
1513
- return to;
1514
- };
1515
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1516
- var tags_exports = {};
1517
- __export2(tags_exports, {
1518
- HTML_TAGS: () => HTML_TAGS,
1519
- isValidHtmlTag: () => isValidHtmlTag
1520
- });
1521
- module2.exports = __toCommonJS2(tags_exports);
1522
- var HTML_TAGS = {
1523
- root: [
1524
- "body",
1525
- "html"
1526
- ],
1527
- head: [
1528
- "title",
1529
- "base",
1530
- "meta",
1531
- "style",
1532
- "noscript",
1533
- "script"
1534
- ],
1535
- body: [
1536
- "string",
1537
- "style",
1538
- "fragment",
1539
- "a",
1540
- "abbr",
1541
- "acronym",
1542
- "address",
1543
- "applet",
1544
- "area",
1545
- "article",
1546
- "aside",
1547
- "audio",
1548
- "b",
1549
- "basefont",
1550
- "bdi",
1551
- "bdo",
1552
- "big",
1553
- "blockquote",
1554
- "br",
1555
- "button",
1556
- "canvas",
1557
- "caption",
1558
- "center",
1559
- "cite",
1560
- "code",
1561
- "search",
1562
- "col",
1563
- "colgroup",
1564
- "data",
1565
- "datalist",
1566
- "dd",
1567
- "del",
1568
- "details",
1569
- "dfn",
1570
- "dialog",
1571
- "dir",
1572
- "div",
1573
- "dl",
1574
- "dt",
1575
- "em",
1576
- "embed",
1577
- "fieldset",
1578
- "figcaption",
1579
- "figure",
1580
- "font",
1581
- "footer",
1582
- "form",
1583
- "frame",
1584
- "frameset",
1585
- "h1",
1586
- "h2",
1587
- "h3",
1588
- "h4",
1589
- "h5",
1590
- "h6",
1591
- "head",
1592
- "header",
1593
- "hr",
1594
- "i",
1595
- "iframe",
1596
- "img",
1597
- "input",
1598
- "ins",
1599
- "kbd",
1600
- "label",
1601
- "legend",
1602
- "li",
1603
- "link",
1604
- "main",
1605
- "map",
1606
- "mark",
1607
- "meter",
1608
- "nav",
1609
- "noframes",
1610
- "noscript",
1611
- "object",
1612
- "ol",
1613
- "optgroup",
1614
- "option",
1615
- "output",
1616
- "p",
1617
- "param",
1618
- "picture",
1619
- "pre",
1620
- "progress",
1621
- "hgroup",
1622
- "q",
1623
- "rp",
1624
- "rt",
1625
- "ruby",
1626
- "s",
1627
- "samp",
1628
- "script",
1629
- "section",
1630
- "select",
1631
- "small",
1632
- "source",
1633
- "span",
1634
- "strike",
1635
- "strong",
1636
- "sub",
1637
- "summary",
1638
- "sup",
1639
- "table",
1640
- "tbody",
1641
- "td",
1642
- "template",
1643
- "hgroup",
1644
- "textarea",
1645
- "tfoot",
1646
- "th",
1647
- "thead",
1648
- "time",
1649
- "tr",
1650
- "track",
1651
- "tt",
1652
- "u",
1653
- "ul",
1654
- "var",
1655
- "video",
1656
- "wbr",
1657
- // SVG
1658
- "svg",
1659
- "path"
1660
- ]
1661
- };
1662
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
1663
- }
1664
- });
1665
-
1666
- // ../../../domql/packages/utils/dist/cjs/component.js
1667
- var require_component = __commonJS({
1668
- "../../../domql/packages/utils/dist/cjs/component.js"(exports, module2) {
1669
- "use strict";
1670
- var __defProp2 = Object.defineProperty;
1671
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1672
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1673
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1674
- var __export2 = (target, all) => {
1675
- for (var name in all)
1676
- __defProp2(target, name, { get: all[name], enumerable: true });
1677
- };
1678
- var __copyProps2 = (to, from, except, desc) => {
1679
- if (from && typeof from === "object" || typeof from === "function") {
1680
- for (let key of __getOwnPropNames2(from))
1681
- if (!__hasOwnProp2.call(to, key) && key !== except)
1682
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1683
- }
1684
- return to;
1685
- };
1686
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1687
- var component_exports = {};
1688
- __export2(component_exports, {
1689
- addAdditionalExtend: () => addAdditionalExtend,
1690
- addChildrenIfNotInOriginal: () => addChildrenIfNotInOriginal,
1691
- applyComponentFromContext: () => applyComponentFromContext,
1692
- applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1693
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1694
- checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1695
- checkIfSugar: () => checkIfSugar,
1696
- extendizeByKey: () => extendizeByKey,
1697
- extractComponentKeyFromKey: () => extractComponentKeyFromKey,
1698
- getCapitalCaseKeys: () => getCapitalCaseKeys,
1699
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1700
- getExtendsInElement: () => getExtendsInElement,
1701
- hasVariantProp: () => hasVariantProp,
1702
- isVariant: () => isVariant,
1703
- setContentKey: () => setContentKey
1704
- });
1705
- module2.exports = __toCommonJS2(component_exports);
1706
- var import__ = require_cjs2();
1707
- var ENV2 = "development";
1708
- var checkIfKeyIsComponent = (key) => {
1709
- const isFirstKeyString = (0, import__.isString)(key);
1710
- if (!isFirstKeyString)
1711
- return;
1712
- const firstCharKey = key.slice(0, 1);
1713
- return /^[A-Z]*$/.test(firstCharKey);
1714
- };
1715
- var checkIfKeyIsProperty = (key) => {
1716
- const isFirstKeyString = (0, import__.isString)(key);
1717
- if (!isFirstKeyString)
1718
- return;
1719
- const firstCharKey = key.slice(0, 1);
1720
- return /^[a-z]*$/.test(firstCharKey);
1721
- };
1722
- var addAdditionalExtend = (newExtend, element) => {
1723
- if (!newExtend)
1724
- return element;
1725
- const { extend: elementExtend } = element;
1726
- const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
1727
- const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
1728
- const extend = (0, import__.joinArrays)(receivedArray, originalArray);
1729
- return { ...element, extend };
1730
- };
1731
- var checkIfSugar = (element, parent, key) => {
1732
- var _a;
1733
- const {
1734
- extend,
1735
- props,
1736
- childExtend,
1737
- extends: extendProps,
1738
- childExtends,
1739
- childProps,
1740
- children,
1741
- on,
1742
- $collection,
1743
- $stateCollection,
1744
- $propsCollection
1745
- } = element;
1746
- const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1747
- if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1748
- const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1749
- if (logErr)
1750
- logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1751
- }
1752
- return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1753
- };
1754
- var extractComponentKeyFromKey = (key) => {
1755
- return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1756
- };
1757
- var extendizeByKey = (element, parent, key) => {
1758
- const { context } = parent;
1759
- const { tag, extend, childExtends } = element;
1760
- const isSugar = checkIfSugar(element, parent, key);
1761
- const extendFromKey = extractComponentKeyFromKey(key);
1762
- const isExtendKeyComponent = context && context.components[extendFromKey];
1763
- if (element === isExtendKeyComponent)
1764
- return element;
1765
- else if (isSugar) {
1766
- const newElem = addAdditionalExtend(element.extends, {
1767
- extend: extendFromKey,
1768
- tag,
1769
- props: { ...element }
1770
- });
1771
- if (newElem.props.data) {
1772
- newElem.data = newElem.props.data;
1773
- delete newElem.props.data;
1774
- }
1775
- if (newElem.props.state) {
1776
- newElem.state = newElem.props.state;
1777
- delete newElem.props.state;
1778
- }
1779
- if (newElem.props.attr) {
1780
- newElem.attr = newElem.props.attr;
1781
- delete newElem.props.attr;
1782
- }
1783
- if (newElem.props.if) {
1784
- newElem.if = newElem.props.if;
1785
- delete newElem.props.if;
1786
- }
1787
- if (childExtends)
1788
- newElem.childExtend = childExtends;
1789
- return newElem;
1790
- } else if (!extend || extend === true) {
1791
- return {
1792
- ...element,
1793
- tag,
1794
- extend: extendFromKey
1795
- };
1796
- } else if (extend) {
1797
- return addAdditionalExtend(extendFromKey, element);
1798
- } else if ((0, import__.isFunction)(element)) {
1799
- return {
1800
- extend: extendFromKey,
1801
- tag,
1802
- props: { ...(0, import__.exec)(element, parent) }
1803
- };
1804
- }
1805
- };
1806
- function getCapitalCaseKeys(obj) {
1807
- return Object.keys(obj).filter((key) => /^[A-Z]/.test(key));
1808
- }
1809
- var addChildrenIfNotInOriginal = (element, parent, key) => {
1810
- const childElems = getCapitalCaseKeys(element.props);
1811
- if (!childElems.length)
1812
- return element;
1813
- for (const i in childElems) {
1814
- const childKey = childElems[i];
1815
- const childElem = element[childKey];
1816
- const newChild = element.props[childKey];
1817
- const assignChild = (val) => {
1818
- element[childKey] = val;
1819
- delete element.props[childKey];
1820
- };
1821
- if (newChild == null ? void 0 : newChild.ignoreExtend)
1822
- continue;
1823
- if (newChild === null)
1824
- assignChild(null);
1825
- else if (!childElem)
1826
- assignChild((0, import__.deepClone)(newChild));
1827
- else {
1828
- const isSugarChildElem = checkIfSugar(childElem, parent, key);
1829
- if (isSugarChildElem)
1830
- continue;
1831
- assignChild({
1832
- extend: element[childKey],
1833
- props: newChild
1834
- });
1835
- }
1836
- }
1837
- };
1838
- var applyKeyComponentAsExtend = (element, parent, key) => {
1839
- return extendizeByKey(element, parent, key) || element;
1840
- };
1841
- var applyComponentFromContext = (element, parent, options) => {
1842
- const { context } = element;
1843
- if (!context || !context.components)
1844
- return;
1845
- const { components } = context;
1846
- const { extend } = element;
1847
- const execExtend = (0, import__.exec)(extend, element);
1848
- if ((0, import__.isString)(execExtend)) {
1849
- const componentExists = components[execExtend] || components["smbls." + execExtend];
1850
- if (componentExists)
1851
- element.extend = componentExists;
1852
- else {
1853
- if ((ENV2 === "test" || ENV2 === "development") && options.verbose) {
1854
- console.warn(execExtend, "is not in library", components, element);
1855
- console.warn("replacing with ", {});
1856
- }
1857
- element.extend = {};
1858
- }
1859
- }
1860
- };
1861
- var isVariant = (param) => {
1862
- if (!(0, import__.isString)(param))
1863
- return;
1864
- const firstCharKey = param.slice(0, 1);
1865
- return firstCharKey === ".";
1866
- };
1867
- var hasVariantProp = (element) => {
1868
- const { props } = element;
1869
- if ((0, import__.isObject)(props) && (0, import__.isString)(props.variant))
1870
- return true;
1871
- };
1872
- var getChildrenComponentsByKey = (key, el) => {
1873
- if (key === el.key || el.__ref.__componentKey === key) {
1874
- return el;
1875
- }
1876
- if (el.extend) {
1877
- const foundString = (0, import__.isString)(el.extend) && el.extend === key;
1878
- const foundInArray = (0, import__.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
1879
- if (foundString || foundInArray)
1880
- return el;
1881
- }
1882
- if (el.parent && el.parent.childExtend) {
1883
- const foundString = (0, import__.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1884
- const foundInArray = (0, import__.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1885
- if (foundString || foundInArray)
1886
- return el;
1887
- }
1888
- };
1889
- var getExtendsInElement = (obj) => {
1890
- let result = [];
1891
- function traverse(o) {
1892
- for (const key in o) {
1893
- if (Object.hasOwnProperty.call(o, key)) {
1894
- if (checkIfKeyIsComponent(key)) {
1895
- result.push(key);
1896
- }
1897
- if (key === "extend" || key === "extends") {
1898
- if (typeof o[key] === "string") {
1899
- result.push(o[key]);
1900
- } else if (Array.isArray(o[key])) {
1901
- result = result.concat(o[key]);
1902
- }
1903
- }
1904
- if (typeof o[key] === "object" && o[key] !== null) {
1905
- traverse(o[key]);
1906
- }
1907
- }
1908
- }
1909
- }
1910
- traverse(obj);
1911
- return result;
1912
- };
1913
- var setContentKey = (el, opts = {}) => {
1914
- const { __ref: ref } = el;
1915
- const contentElementKey = opts.contentElementKey;
1916
- if (contentElementKey !== "content" && contentElementKey !== ref.contentElementKey || !ref.contentElementKey) {
1917
- ref.contentElementKey = contentElementKey || "content";
1918
- } else
1919
- ref.contentElementKey = "content";
1920
- if (contentElementKey !== "content")
1921
- opts.contentElementKey = "content";
1922
- return ref.contentElementKey;
1923
- };
1924
- }
1925
- });
1926
-
1927
- // ../../../domql/packages/utils/dist/cjs/index.js
1928
- var require_cjs2 = __commonJS({
1929
- "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1930
- "use strict";
1931
- var __defProp2 = Object.defineProperty;
1932
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1933
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1934
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1935
- var __copyProps2 = (to, from, except, desc) => {
1936
- if (from && typeof from === "object" || typeof from === "function") {
1937
- for (let key of __getOwnPropNames2(from))
1938
- if (!__hasOwnProp2.call(to, key) && key !== except)
1939
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1940
- }
1941
- return to;
1942
- };
1943
- var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1944
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1945
- var utils_exports2 = {};
1946
- module2.exports = __toCommonJS2(utils_exports2);
1947
- __reExport(utils_exports2, require_key(), module2.exports);
1948
- __reExport(utils_exports2, require_env(), module2.exports);
1949
- __reExport(utils_exports2, require_types(), module2.exports);
1950
- __reExport(utils_exports2, require_object(), module2.exports);
1951
- __reExport(utils_exports2, require_function(), module2.exports);
1952
- __reExport(utils_exports2, require_array(), module2.exports);
1953
- __reExport(utils_exports2, require_node(), module2.exports);
1954
- __reExport(utils_exports2, require_log(), module2.exports);
1955
- __reExport(utils_exports2, require_string(), module2.exports);
1956
- __reExport(utils_exports2, require_globals(), module2.exports);
1957
- __reExport(utils_exports2, require_cookie(), module2.exports);
1958
- __reExport(utils_exports2, require_tags(), module2.exports);
1959
- __reExport(utils_exports2, require_component(), module2.exports);
64
+ var window4 = globalThis;
65
+ var document5 = window4.document;
1960
66
  }
1961
67
  });
1962
68
 
1963
69
  // ../utils/dist/cjs/index.js
1964
- var require_cjs3 = __commonJS({
70
+ var require_cjs2 = __commonJS({
1965
71
  "../utils/dist/cjs/index.js"(exports, module2) {
1966
72
  "use strict";
1967
- var __create2 = Object.create;
1968
- var __defProp2 = Object.defineProperty;
73
+ var __defProp3 = Object.defineProperty;
1969
74
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1970
75
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
1971
- var __getProtoOf2 = Object.getPrototypeOf;
1972
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1973
- var __commonJS2 = (cb, mod) => function __require() {
1974
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1975
- };
76
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1976
77
  var __export2 = (target, all) => {
1977
78
  for (var name in all)
1978
- __defProp2(target, name, { get: all[name], enumerable: true });
79
+ __defProp3(target, name, { get: all[name], enumerable: true });
1979
80
  };
1980
81
  var __copyProps2 = (to, from, except, desc) => {
1981
82
  if (from && typeof from === "object" || typeof from === "function") {
1982
83
  for (let key of __getOwnPropNames2(from))
1983
- if (!__hasOwnProp2.call(to, key) && key !== except)
1984
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
84
+ if (!__hasOwnProp3.call(to, key) && key !== except)
85
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1985
86
  }
1986
87
  return to;
1987
88
  };
1988
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1989
- // If the importer is in node compatibility mode or this is not an ESM
1990
- // file that has been converted to a CommonJS file using a Babel-
1991
- // compatible transform (i.e. "__esModule" has not been set), then set
1992
- // "default" to the CommonJS "module.exports" for node compatibility.
1993
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1994
- mod
1995
- ));
1996
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1997
- var require_key2 = __commonJS2({
1998
- "../../../domql/packages/utils/dist/cjs/key.js"(exports2, module22) {
1999
- "use strict";
2000
- var __defProp22 = Object.defineProperty;
2001
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2002
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2003
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2004
- var __export22 = (target, all) => {
2005
- for (var name in all)
2006
- __defProp22(target, name, { get: all[name], enumerable: true });
2007
- };
2008
- var __copyProps22 = (to, from, except, desc) => {
2009
- if (from && typeof from === "object" || typeof from === "function") {
2010
- for (let key of __getOwnPropNames22(from))
2011
- if (!__hasOwnProp22.call(to, key) && key !== except)
2012
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2013
- }
2014
- return to;
2015
- };
2016
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2017
- var key_exports = {};
2018
- __export22(key_exports, {
2019
- createSnapshotId: () => createSnapshotId,
2020
- generateKey: () => generateKey
2021
- });
2022
- module22.exports = __toCommonJS22(key_exports);
2023
- var generateKey = /* @__PURE__ */ function() {
2024
- let index = 0;
2025
- function newId() {
2026
- index++;
2027
- return index;
2028
- }
2029
- return newId;
2030
- }();
2031
- var createSnapshotId = generateKey;
2032
- }
2033
- });
2034
- var require_env2 = __commonJS2({
2035
- "../../../domql/packages/utils/dist/cjs/env.js"(exports2, module22) {
2036
- "use strict";
2037
- var __defProp22 = Object.defineProperty;
2038
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2039
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2040
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2041
- var __export22 = (target, all) => {
2042
- for (var name in all)
2043
- __defProp22(target, name, { get: all[name], enumerable: true });
2044
- };
2045
- var __copyProps22 = (to, from, except, desc) => {
2046
- if (from && typeof from === "object" || typeof from === "function") {
2047
- for (let key of __getOwnPropNames22(from))
2048
- if (!__hasOwnProp22.call(to, key) && key !== except)
2049
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2050
- }
2051
- return to;
2052
- };
2053
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2054
- var env_exports = {};
2055
- __export22(env_exports, {
2056
- NODE_ENV: () => NODE_ENV,
2057
- getNev: () => getNev,
2058
- isDevelopment: () => isDevelopment,
2059
- isProduction: () => isProduction,
2060
- isTest: () => isTest
2061
- });
2062
- module22.exports = __toCommonJS22(env_exports);
2063
- var NODE_ENV = "development";
2064
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
2065
- var isTest = (env = NODE_ENV) => env === "test";
2066
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
2067
- var getNev = (key, env = NODE_ENV) => env[key];
2068
- }
2069
- });
2070
- var require_globals2 = __commonJS2({
2071
- "../../../domql/packages/utils/dist/cjs/globals.js"(exports2, module22) {
2072
- "use strict";
2073
- var __defProp22 = Object.defineProperty;
2074
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2075
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2076
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2077
- var __export22 = (target, all) => {
2078
- for (var name in all)
2079
- __defProp22(target, name, { get: all[name], enumerable: true });
2080
- };
2081
- var __copyProps22 = (to, from, except, desc) => {
2082
- if (from && typeof from === "object" || typeof from === "function") {
2083
- for (let key of __getOwnPropNames22(from))
2084
- if (!__hasOwnProp22.call(to, key) && key !== except)
2085
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2086
- }
2087
- return to;
2088
- };
2089
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2090
- var globals_exports = {};
2091
- __export22(globals_exports, {
2092
- document: () => document22,
2093
- global: () => global,
2094
- self: () => self,
2095
- window: () => window22
2096
- });
2097
- module22.exports = __toCommonJS22(globals_exports);
2098
- var global = globalThis;
2099
- var self = globalThis;
2100
- var window22 = globalThis;
2101
- var document22 = window22.document;
2102
- }
2103
- });
2104
- var require_node2 = __commonJS2({
2105
- "../../../domql/packages/utils/dist/cjs/node.js"(exports2, module22) {
2106
- "use strict";
2107
- var __defProp22 = Object.defineProperty;
2108
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2109
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2110
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2111
- var __export22 = (target, all) => {
2112
- for (var name in all)
2113
- __defProp22(target, name, { get: all[name], enumerable: true });
2114
- };
2115
- var __copyProps22 = (to, from, except, desc) => {
2116
- if (from && typeof from === "object" || typeof from === "function") {
2117
- for (let key of __getOwnPropNames22(from))
2118
- if (!__hasOwnProp22.call(to, key) && key !== except)
2119
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2120
- }
2121
- return to;
2122
- };
2123
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2124
- var node_exports = {};
2125
- __export22(node_exports, {
2126
- isDOMNode: () => isDOMNode,
2127
- isHtmlElement: () => isHtmlElement,
2128
- isNode: () => isNode
2129
- });
2130
- module22.exports = __toCommonJS22(node_exports);
2131
- var import_globals3 = require_globals2();
2132
- var isNode = (obj) => {
2133
- return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
2134
- };
2135
- var isHtmlElement = (obj) => {
2136
- return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
2137
- };
2138
- var isDOMNode = (obj) => {
2139
- return typeof import_globals3.window !== "undefined" && (obj instanceof import_globals3.window.Node || obj instanceof import_globals3.window.Window || obj === import_globals3.window || obj === document);
2140
- };
2141
- }
2142
- });
2143
- var require_types2 = __commonJS2({
2144
- "../../../domql/packages/utils/dist/cjs/types.js"(exports2, module22) {
2145
- "use strict";
2146
- var __defProp22 = Object.defineProperty;
2147
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2148
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2149
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2150
- var __export22 = (target, all) => {
2151
- for (var name in all)
2152
- __defProp22(target, name, { get: all[name], enumerable: true });
2153
- };
2154
- var __copyProps22 = (to, from, except, desc) => {
2155
- if (from && typeof from === "object" || typeof from === "function") {
2156
- for (let key of __getOwnPropNames22(from))
2157
- if (!__hasOwnProp22.call(to, key) && key !== except)
2158
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2159
- }
2160
- return to;
2161
- };
2162
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2163
- var types_exports = {};
2164
- __export22(types_exports, {
2165
- TYPES: () => TYPES,
2166
- is: () => is,
2167
- isArray: () => isArray32,
2168
- isBoolean: () => isBoolean,
2169
- isDate: () => isDate,
2170
- isDefined: () => isDefined2,
2171
- isFunction: () => isFunction2,
2172
- isNot: () => isNot,
2173
- isNull: () => isNull2,
2174
- isNumber: () => isNumber2,
2175
- isObject: () => isObject32,
2176
- isObjectLike: () => isObjectLike3,
2177
- isString: () => isString22,
2178
- isUndefined: () => isUndefined2
2179
- });
2180
- module22.exports = __toCommonJS22(types_exports);
2181
- var import_node = require_node2();
2182
- var isObject32 = (arg) => {
2183
- if (arg === null)
2184
- return false;
2185
- return typeof arg === "object" && arg.constructor === Object;
2186
- };
2187
- var isString22 = (arg) => typeof arg === "string";
2188
- var isNumber2 = (arg) => typeof arg === "number";
2189
- var isFunction2 = (arg) => typeof arg === "function";
2190
- var isBoolean = (arg) => arg === true || arg === false;
2191
- var isNull2 = (arg) => arg === null;
2192
- var isArray32 = (arg) => Array.isArray(arg);
2193
- var isDate = (d) => d instanceof Date;
2194
- var isObjectLike3 = (arg) => {
2195
- if (arg === null)
2196
- return false;
2197
- return typeof arg === "object";
2198
- };
2199
- var isDefined2 = (arg) => {
2200
- return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction2(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
2201
- };
2202
- var isUndefined2 = (arg) => {
2203
- return arg === void 0;
2204
- };
2205
- var TYPES = {
2206
- boolean: isBoolean,
2207
- array: isArray32,
2208
- object: isObject32,
2209
- string: isString22,
2210
- date: isDate,
2211
- number: isNumber2,
2212
- null: isNull2,
2213
- function: isFunction2,
2214
- objectLike: isObjectLike3,
2215
- node: import_node.isNode,
2216
- htmlElement: import_node.isHtmlElement,
2217
- defined: isDefined2
2218
- };
2219
- var is = (arg) => {
2220
- return (...args) => {
2221
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
2222
- };
2223
- };
2224
- var isNot = (arg) => {
2225
- return (...args) => {
2226
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
2227
- };
2228
- };
2229
- }
2230
- });
2231
- var require_array2 = __commonJS2({
2232
- "../../../domql/packages/utils/dist/cjs/array.js"(exports2, module22) {
2233
- "use strict";
2234
- var __defProp22 = Object.defineProperty;
2235
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2236
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2237
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2238
- var __export22 = (target, all) => {
2239
- for (var name in all)
2240
- __defProp22(target, name, { get: all[name], enumerable: true });
2241
- };
2242
- var __copyProps22 = (to, from, except, desc) => {
2243
- if (from && typeof from === "object" || typeof from === "function") {
2244
- for (let key of __getOwnPropNames22(from))
2245
- if (!__hasOwnProp22.call(to, key) && key !== except)
2246
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2247
- }
2248
- return to;
2249
- };
2250
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2251
- var array_exports = {};
2252
- __export22(array_exports, {
2253
- addItemAfterEveryElement: () => addItemAfterEveryElement,
2254
- arrayContainsOtherArray: () => arrayContainsOtherArray,
2255
- arraysEqual: () => arraysEqual,
2256
- checkIfStringIsInArray: () => checkIfStringIsInArray,
2257
- cutArrayAfterValue: () => cutArrayAfterValue,
2258
- cutArrayBeforeValue: () => cutArrayBeforeValue,
2259
- filterArrays: () => filterArrays,
2260
- filterArraysFast: () => filterArraysFast,
2261
- getFrequencyInArray: () => getFrequencyInArray,
2262
- joinArrays: () => joinArrays,
2263
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
2264
- mergeArray: () => mergeArray,
2265
- removeFromArray: () => removeFromArray,
2266
- removeValueFromArray: () => removeValueFromArray,
2267
- removeValueFromArrayAll: () => removeValueFromArrayAll,
2268
- reorderArrayByValues: () => reorderArrayByValues,
2269
- swapItemsInArray: () => swapItemsInArray
2270
- });
2271
- module22.exports = __toCommonJS22(array_exports);
2272
- var import_object = require_object2();
2273
- var import_types = require_types2();
2274
- var arrayContainsOtherArray = (arr1, arr2) => {
2275
- return arr2.every((val) => arr1.includes(val));
2276
- };
2277
- var getFrequencyInArray = (arr, value) => {
2278
- return arr.reduce((count, currentValue) => {
2279
- return currentValue === value ? count + 1 : count;
2280
- }, 0);
2281
- };
2282
- var removeFromArray = (arr, index) => {
2283
- if ((0, import_types.isString)(index))
2284
- index = parseInt(index);
2285
- if ((0, import_types.isNumber)(index)) {
2286
- if (index < 0 || index >= arr.length || isNaN(index)) {
2287
- throw new Error("Invalid index");
2288
- }
2289
- arr.splice(index, 1);
2290
- } else if ((0, import_types.isArray)(index)) {
2291
- index.forEach((idx) => removeFromArray(arr, idx));
2292
- } else {
2293
- throw new Error("Invalid index");
2294
- }
2295
- return arr;
2296
- };
2297
- var swapItemsInArray = (arr, i, j) => {
2298
- [arr[i], arr[j]] = [arr[j], arr[i]];
2299
- };
2300
- var joinArrays = (...arrays) => {
2301
- return [].concat(...arrays);
2302
- };
2303
- var mergeArray = (arr, exclude = []) => {
2304
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
2305
- };
2306
- var mergeAndCloneIfArray = (obj) => {
2307
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
2308
- };
2309
- var cutArrayBeforeValue = (arr, value) => {
2310
- const index = arr.indexOf(value);
2311
- if (index !== -1) {
2312
- return arr.slice(0, index);
2313
- }
2314
- return arr;
2315
- };
2316
- var cutArrayAfterValue = (arr, value) => {
2317
- if (!(0, import_types.isArray)(arr))
2318
- return;
2319
- const index = arr.indexOf(value);
2320
- if (index !== -1) {
2321
- return arr.slice(index + 1);
2322
- }
2323
- return arr;
2324
- };
2325
- var removeValueFromArray = (arr, value) => {
2326
- const index = arr.indexOf(value);
2327
- if (index > -1) {
2328
- const newArray = [...arr];
2329
- newArray.splice(index, 1);
2330
- return newArray;
2331
- }
2332
- return arr;
2333
- };
2334
- var removeValueFromArrayAll = (arr, value) => {
2335
- return arr.filter((item) => item !== value);
2336
- };
2337
- var addItemAfterEveryElement = (array, item) => {
2338
- const result = [];
2339
- for (let i = 0; i < array.length; i++) {
2340
- result.push(array[i]);
2341
- if (i < array.length - 1) {
2342
- result.push(item);
2343
- }
2344
- }
2345
- return result;
2346
- };
2347
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
2348
- const newArray = [...array];
2349
- const indexToMove = newArray.indexOf(valueToMove);
2350
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
2351
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
2352
- const removedItem = newArray.splice(indexToMove, 1)[0];
2353
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
2354
- newArray.splice(insertIndex, 0, removedItem);
2355
- }
2356
- return newArray;
2357
- };
2358
- var arraysEqual = (arr1, arr2) => {
2359
- if (arr1.length !== arr2.length) {
2360
- return false;
2361
- }
2362
- for (let i = 0; i < arr1.length; i++) {
2363
- if (arr1[i] !== arr2[i]) {
2364
- return false;
2365
- }
2366
- }
2367
- return true;
2368
- };
2369
- var filterArrays = (sourceArr, excludeArr) => {
2370
- return sourceArr.filter((item) => !excludeArr.includes(item));
2371
- };
2372
- var filterArraysFast = (sourceArr, excludeArr) => {
2373
- const excludeSet = new Set(excludeArr);
2374
- return sourceArr.filter((item) => !excludeSet.has(item));
2375
- };
2376
- var checkIfStringIsInArray = (string, arr) => {
2377
- if (!string)
2378
- return;
2379
- return arr.filter((v) => string.includes(v)).length;
2380
- };
2381
- }
2382
- });
2383
- var require_string2 = __commonJS2({
2384
- "../../../domql/packages/utils/dist/cjs/string.js"(exports2, module22) {
2385
- "use strict";
2386
- var __defProp22 = Object.defineProperty;
2387
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2388
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2389
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2390
- var __export22 = (target, all) => {
2391
- for (var name in all)
2392
- __defProp22(target, name, { get: all[name], enumerable: true });
2393
- };
2394
- var __copyProps22 = (to, from, except, desc) => {
2395
- if (from && typeof from === "object" || typeof from === "function") {
2396
- for (let key of __getOwnPropNames22(from))
2397
- if (!__hasOwnProp22.call(to, key) && key !== except)
2398
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2399
- }
2400
- return to;
2401
- };
2402
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2403
- var string_exports = {};
2404
- __export22(string_exports, {
2405
- customDecodeURIComponent: () => customDecodeURIComponent,
2406
- customEncodeURIComponent: () => customEncodeURIComponent,
2407
- decodeNewlines: () => decodeNewlines,
2408
- encodeNewlines: () => encodeNewlines,
2409
- findKeyPosition: () => findKeyPosition,
2410
- lowercaseFirstLetter: () => lowercaseFirstLetter,
2411
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2412
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2413
- stringIncludesAny: () => stringIncludesAny,
2414
- trimStringFromSymbols: () => trimStringFromSymbols
2415
- });
2416
- module22.exports = __toCommonJS22(string_exports);
2417
- var stringIncludesAny = (str, characters) => {
2418
- for (const char of characters) {
2419
- if (str.includes(char)) {
2420
- return true;
2421
- }
2422
- }
2423
- return false;
2424
- };
2425
- var trimStringFromSymbols = (str, characters) => {
2426
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2427
- return str.replace(pattern, "");
2428
- };
2429
- var brackRegex = {
2430
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2431
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2432
- };
2433
- function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
2434
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2435
- return str;
2436
- const reg = brackRegex[options.bracketsLength || 2];
2437
- const obj = forcedState || this.state || {};
2438
- return str.replace(reg, (_, parentPath, variable) => {
2439
- if (parentPath) {
2440
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2441
- let parentState = obj;
2442
- for (let i = 0; i < parentLevels; i++) {
2443
- parentState = parentState.parent;
2444
- if (!parentState) {
2445
- return "";
2446
- }
2447
- }
2448
- const value = parentState[variable.trim()];
2449
- return value !== void 0 ? `${value}` : "";
2450
- } else {
2451
- const value = obj[variable.trim()];
2452
- return value !== void 0 ? `${value}` : "";
2453
- }
2454
- });
2455
- }
2456
- var lowercaseFirstLetter = (inputString) => {
2457
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2458
- };
2459
- var findKeyPosition = (str, key) => {
2460
- const lines = str.split("\n");
2461
- let startLineNumber = -1;
2462
- let endLineNumber = -1;
2463
- let startColumn = -1;
2464
- let endColumn = -1;
2465
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2466
- let braceCount = 0;
2467
- let foundKey = false;
2468
- for (let i = 0; i < lines.length; i++) {
2469
- if (keyPattern.test(lines[i]) && !foundKey) {
2470
- foundKey = true;
2471
- startLineNumber = i + 1;
2472
- startColumn = lines[i].indexOf(key) + 1;
2473
- if (lines[i].includes("{}")) {
2474
- endLineNumber = startLineNumber;
2475
- endColumn = lines[i].indexOf("{}") + 3;
2476
- break;
2477
- }
2478
- const line = lines[i].slice(startColumn + key.length);
2479
- if (line.includes("{") || line.includes("[")) {
2480
- braceCount = 1;
2481
- } else {
2482
- endLineNumber = i + 1;
2483
- endColumn = lines[i].length + 1;
2484
- break;
2485
- }
2486
- } else if (foundKey) {
2487
- braceCount += (lines[i].match(/{/g) || []).length;
2488
- braceCount += (lines[i].match(/\[/g) || []).length;
2489
- braceCount -= (lines[i].match(/}/g) || []).length;
2490
- braceCount -= (lines[i].match(/]/g) || []).length;
2491
- if (braceCount === 0) {
2492
- endLineNumber = i + 1;
2493
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2494
- break;
2495
- }
2496
- }
2497
- }
2498
- return {
2499
- startColumn,
2500
- endColumn,
2501
- startLineNumber,
2502
- endLineNumber
2503
- };
2504
- };
2505
- var replaceOctalEscapeSequences = (str) => {
2506
- const octalRegex = /\\([0-7]{1,3})/g;
2507
- return str.replace(octalRegex, (match, p1) => {
2508
- const octalValue = parseInt(p1, 8);
2509
- const char = String.fromCharCode(octalValue);
2510
- return char;
2511
- });
2512
- };
2513
- var encodeNewlines = (str) => {
2514
- return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
2515
- };
2516
- var decodeNewlines = (encodedStr) => {
2517
- return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
2518
- };
2519
- var customEncodeURIComponent = (str) => {
2520
- return str.split("").map((char) => {
2521
- if (/[^a-zA-Z0-9\s]/.test(char)) {
2522
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2523
- }
2524
- return char;
2525
- }).join("");
2526
- };
2527
- var customDecodeURIComponent = (encodedStr) => {
2528
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2529
- };
2530
- }
2531
- });
2532
- var require_object2 = __commonJS2({
2533
- "../../../domql/packages/utils/dist/cjs/object.js"(exports2, module22) {
2534
- "use strict";
2535
- var __defProp22 = Object.defineProperty;
2536
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2537
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2538
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2539
- var __export22 = (target, all) => {
2540
- for (var name in all)
2541
- __defProp22(target, name, { get: all[name], enumerable: true });
2542
- };
2543
- var __copyProps22 = (to, from, except, desc) => {
2544
- if (from && typeof from === "object" || typeof from === "function") {
2545
- for (let key of __getOwnPropNames22(from))
2546
- if (!__hasOwnProp22.call(to, key) && key !== except)
2547
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2548
- }
2549
- return to;
2550
- };
2551
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2552
- var object_exports = {};
2553
- __export22(object_exports, {
2554
- clone: () => clone,
2555
- createNestedObject: () => createNestedObject,
2556
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2557
- deepClone: () => deepClone2,
2558
- deepContains: () => deepContains,
2559
- deepDestringify: () => deepDestringify,
2560
- deepDiff: () => deepDiff,
2561
- deepMerge: () => deepMerge3,
2562
- deepStringify: () => deepStringify,
2563
- deepStringifyWithMaxDepth: () => deepStringifyWithMaxDepth,
2564
- detachFunctionsFromObject: () => detachFunctionsFromObject,
2565
- detectInfiniteLoop: () => detectInfiniteLoop,
2566
- diff: () => diff,
2567
- diffArrays: () => diffArrays,
2568
- diffObjects: () => diffObjects,
2569
- excludeKeysFromObject: () => excludeKeysFromObject,
2570
- exec: () => exec,
2571
- flattenRecursive: () => flattenRecursive,
2572
- hasOwnProperty: () => hasOwnProperty,
2573
- isCyclic: () => isCyclic,
2574
- isEmpty: () => isEmpty,
2575
- isEmptyObject: () => isEmptyObject,
2576
- isEqualDeep: () => isEqualDeep,
2577
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2578
- map: () => map,
2579
- merge: () => merge5,
2580
- mergeArrayExclude: () => mergeArrayExclude,
2581
- mergeIfExisted: () => mergeIfExisted,
2582
- objectToString: () => objectToString,
2583
- overwrite: () => overwrite,
2584
- overwriteDeep: () => overwriteDeep2,
2585
- overwriteShallow: () => overwriteShallow,
2586
- removeFromObject: () => removeFromObject,
2587
- removeNestedKeyByPath: () => removeNestedKeyByPath,
2588
- stringToObject: () => stringToObject
2589
- });
2590
- module22.exports = __toCommonJS22(object_exports);
2591
- var import_globals3 = require_globals2();
2592
- var import_types = require_types2();
2593
- var import_array = require_array2();
2594
- var import_string = require_string2();
2595
- var import_node = require_node2();
2596
- var ENV2 = "development";
2597
- var exec = (param, element, state, context) => {
2598
- if ((0, import_types.isFunction)(param)) {
2599
- return param.call(
2600
- element,
2601
- element,
2602
- state || element.state,
2603
- context || element.context
2604
- );
2605
- }
2606
- return param;
2607
- };
2608
- var map = (obj, extention, element) => {
2609
- for (const e in extention) {
2610
- obj[e] = exec(extention[e], element);
2611
- }
2612
- };
2613
- var merge5 = (element, obj, excludeFrom = []) => {
2614
- for (const e in obj) {
2615
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2616
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2617
- continue;
2618
- const elementProp = element[e];
2619
- const objProp = obj[e];
2620
- if (elementProp === void 0) {
2621
- element[e] = objProp;
2622
- }
2623
- }
2624
- return element;
2625
- };
2626
- var deepMerge3 = (element, extend, excludeFrom = []) => {
2627
- for (const e in extend) {
2628
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2629
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2630
- continue;
2631
- const elementProp = element[e];
2632
- const extendProp = extend[e];
2633
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2634
- deepMerge3(elementProp, extendProp, excludeFrom);
2635
- } else if (elementProp === void 0) {
2636
- element[e] = extendProp;
2637
- }
2638
- }
2639
- return element;
2640
- };
2641
- var clone = (obj, excludeFrom = []) => {
2642
- const o = {};
2643
- for (const prop in obj) {
2644
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2645
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2646
- continue;
2647
- o[prop] = obj[prop];
2648
- }
2649
- return o;
2650
- };
2651
- var mergeArrayExclude = (arr, exclude = []) => {
2652
- return arr.reduce((acc, curr) => deepMerge3(acc, deepClone2(curr, { exclude })), {});
2653
- };
2654
- var deepClone2 = (obj, options = {}) => {
2655
- const {
2656
- exclude = [],
2657
- cleanUndefined = false,
2658
- cleanNull = false,
2659
- window: targetWindow,
2660
- visited = /* @__PURE__ */ new WeakMap(),
2661
- handleExtend = false
2662
- } = options;
2663
- if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
2664
- return obj;
2665
- }
2666
- if (visited.has(obj)) {
2667
- return visited.get(obj);
2668
- }
2669
- const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
2670
- visited.set(obj, clone2);
2671
- for (const key in obj) {
2672
- if (!Object.prototype.hasOwnProperty.call(obj, key))
2673
- continue;
2674
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
2675
- continue;
2676
- const value = obj[key];
2677
- if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
2678
- continue;
2679
- if ((0, import_node.isDOMNode)(value)) {
2680
- clone2[key] = value;
2681
- continue;
2682
- }
2683
- if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
2684
- clone2[key] = (0, import_array.mergeArray)(value, exclude);
2685
- continue;
2686
- }
2687
- if ((0, import_types.isFunction)(value) && targetWindow) {
2688
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
2689
- continue;
2690
- }
2691
- if ((0, import_types.isObjectLike)(value)) {
2692
- clone2[key] = deepClone2(value, {
2693
- ...options,
2694
- visited
2695
- });
2696
- } else {
2697
- clone2[key] = value;
2698
- }
2699
- }
2700
- return clone2;
2701
- };
2702
- var deepStringify = (obj, stringified = {}) => {
2703
- var _a, _b;
2704
- if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2705
- (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2706
- obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2707
- }
2708
- for (const prop in obj) {
2709
- const objProp = obj[prop];
2710
- if ((0, import_types.isFunction)(objProp)) {
2711
- stringified[prop] = objProp.toString();
2712
- } else if ((0, import_types.isObject)(objProp)) {
2713
- stringified[prop] = {};
2714
- deepStringify(objProp, stringified[prop]);
2715
- } else if ((0, import_types.isArray)(objProp)) {
2716
- stringified[prop] = [];
2717
- objProp.forEach((v, i) => {
2718
- if ((0, import_types.isObject)(v)) {
2719
- stringified[prop][i] = {};
2720
- deepStringify(v, stringified[prop][i]);
2721
- } else if ((0, import_types.isFunction)(v)) {
2722
- stringified[prop][i] = v.toString();
2723
- } else {
2724
- stringified[prop][i] = v;
2725
- }
2726
- });
2727
- } else {
2728
- stringified[prop] = objProp;
2729
- }
2730
- }
2731
- return stringified;
2732
- };
2733
- var MAX_DEPTH = 100;
2734
- var deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "") => {
2735
- if (depth > MAX_DEPTH) {
2736
- console.warn(`Maximum depth exceeded at path: ${path}. Possible circular reference.`);
2737
- return "[MAX_DEPTH_EXCEEDED]";
2738
- }
2739
- for (const prop in obj) {
2740
- const currentPath = path ? `${path}.${prop}` : prop;
2741
- const objProp = obj[prop];
2742
- if ((0, import_types.isFunction)(objProp)) {
2743
- stringified[prop] = objProp.toString();
2744
- } else if ((0, import_types.isObject)(objProp)) {
2745
- stringified[prop] = {};
2746
- deepStringifyWithMaxDepth(objProp, stringified[prop], depth + 1, currentPath);
2747
- } else if ((0, import_types.isArray)(objProp)) {
2748
- stringified[prop] = [];
2749
- objProp.forEach((v, i) => {
2750
- const itemPath = `${currentPath}[${i}]`;
2751
- if ((0, import_types.isObject)(v)) {
2752
- stringified[prop][i] = {};
2753
- deepStringifyWithMaxDepth(v, stringified[prop][i], depth + 1, itemPath);
2754
- } else if ((0, import_types.isFunction)(v)) {
2755
- stringified[prop][i] = v.toString();
2756
- } else {
2757
- stringified[prop][i] = v;
2758
- }
2759
- });
2760
- } else {
2761
- stringified[prop] = objProp;
2762
- }
2763
- }
2764
- return stringified;
2765
- };
2766
- var objectToString = (obj = {}, indent = 0) => {
2767
- const spaces = " ".repeat(indent);
2768
- let str = "{\n";
2769
- for (const [key, value] of Object.entries(obj)) {
2770
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2771
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2772
- str += `${spaces} ${stringedKey}: `;
2773
- if ((0, import_types.isArray)(value)) {
2774
- str += "[\n";
2775
- for (const element of value) {
2776
- if ((0, import_types.isObjectLike)(element) && element !== null) {
2777
- str += `${spaces} ${objectToString(element, indent + 2)},
2778
- `;
2779
- } else if ((0, import_types.isString)(element)) {
2780
- str += `${spaces} '${element}',
2781
- `;
2782
- } else {
2783
- str += `${spaces} ${element},
2784
- `;
2785
- }
2786
- }
2787
- str += `${spaces} ]`;
2788
- } else if ((0, import_types.isObjectLike)(value)) {
2789
- str += objectToString(value, indent + 1);
2790
- } else if ((0, import_types.isString)(value)) {
2791
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2792
- } else {
2793
- str += value;
2794
- }
2795
- str += ",\n";
2796
- }
2797
- str += `${spaces}}`;
2798
- return str;
2799
- };
2800
- var detachFunctionsFromObject = (obj, detached = {}) => {
2801
- for (const prop in obj) {
2802
- const objProp = obj[prop];
2803
- if ((0, import_types.isFunction)(objProp))
2804
- continue;
2805
- else if ((0, import_types.isObject)(objProp)) {
2806
- detached[prop] = {};
2807
- deepStringify(objProp, detached[prop]);
2808
- } else if ((0, import_types.isArray)(objProp)) {
2809
- detached[prop] = [];
2810
- objProp.forEach((v, i) => {
2811
- if ((0, import_types.isFunction)(v))
2812
- return;
2813
- if ((0, import_types.isObject)(v)) {
2814
- detached[prop][i] = {};
2815
- detachFunctionsFromObject(v, detached[prop][i]);
2816
- } else {
2817
- detached[prop][i] = v;
2818
- }
2819
- });
2820
- } else {
2821
- detached[prop] = objProp;
2822
- }
2823
- }
2824
- return detached;
2825
- };
2826
- var deepDestringify = (obj, destringified = {}) => {
2827
- for (const prop in obj) {
2828
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2829
- if (!hasOwnProperty2)
2830
- continue;
2831
- const objProp = obj[prop];
2832
- if ((0, import_types.isString)(objProp)) {
2833
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2834
- try {
2835
- const evalProp = import_globals3.window.eval(`(${objProp})`);
2836
- destringified[prop] = evalProp;
2837
- } catch (e) {
2838
- if (e)
2839
- destringified[prop] = objProp;
2840
- }
2841
- } else {
2842
- destringified[prop] = objProp;
2843
- }
2844
- } else if ((0, import_types.isArray)(objProp)) {
2845
- destringified[prop] = [];
2846
- objProp.forEach((arrProp) => {
2847
- if ((0, import_types.isString)(arrProp)) {
2848
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
2849
- try {
2850
- const evalProp = import_globals3.window.eval(`(${arrProp})`);
2851
- destringified[prop].push(evalProp);
2852
- } catch (e) {
2853
- if (e)
2854
- destringified[prop].push(arrProp);
2855
- }
2856
- } else {
2857
- destringified[prop].push(arrProp);
2858
- }
2859
- } else if ((0, import_types.isObject)(arrProp)) {
2860
- destringified[prop].push(deepDestringify(arrProp));
2861
- } else {
2862
- destringified[prop].push(arrProp);
2863
- }
2864
- });
2865
- } else if ((0, import_types.isObject)(objProp)) {
2866
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
2867
- } else {
2868
- destringified[prop] = objProp;
2869
- }
2870
- }
2871
- return destringified;
2872
- };
2873
- var stringToObject = (str, opts = { verbose: true }) => {
2874
- try {
2875
- return str ? import_globals3.window.eval("(" + str + ")") : {};
2876
- } catch (e) {
2877
- if (opts.verbose)
2878
- console.warn(e);
2879
- }
2880
- };
2881
- var diffObjects = (original, objToDiff, cache) => {
2882
- for (const e in objToDiff) {
2883
- if (e === "ref")
2884
- continue;
2885
- const originalProp = original[e];
2886
- const objToDiffProp = objToDiff[e];
2887
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2888
- cache[e] = {};
2889
- diff(originalProp, objToDiffProp, cache[e]);
2890
- } else if (objToDiffProp !== void 0) {
2891
- cache[e] = objToDiffProp;
2892
- }
2893
- }
2894
- return cache;
2895
- };
2896
- var diffArrays = (original, objToDiff, cache) => {
2897
- if (original.length !== objToDiff.length) {
2898
- cache = objToDiff;
2899
- } else {
2900
- const diffArr = [];
2901
- for (let i = 0; i < original.length; i++) {
2902
- const diffObj = diff(original[i], objToDiff[i]);
2903
- if (Object.keys(diffObj).length > 0) {
2904
- diffArr.push(diffObj);
2905
- }
2906
- }
2907
- if (diffArr.length > 0) {
2908
- cache = diffArr;
2909
- }
2910
- }
2911
- return cache;
2912
- };
2913
- var diff = (original, objToDiff, cache = {}) => {
2914
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2915
- cache = [];
2916
- diffArrays(original, objToDiff, cache);
2917
- } else {
2918
- diffObjects(original, objToDiff, cache);
2919
- }
2920
- return cache;
2921
- };
2922
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2923
- var isEmpty = (o) => Object.keys(o).length === 0;
2924
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2925
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2926
- var deepDiff = (lhs, rhs) => {
2927
- if (lhs === rhs)
2928
- return {};
2929
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2930
- return rhs;
2931
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2932
- if (!hasOwnProperty(rhs, key)) {
2933
- acc[key] = void 0;
2934
- }
2935
- return acc;
2936
- }, makeObjectWithoutPrototype());
2937
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2938
- if (lhs.valueOf() === rhs.valueOf())
2939
- return {};
2940
- return rhs;
2941
- }
2942
- return Object.keys(rhs).reduce((acc, key) => {
2943
- if (!hasOwnProperty(lhs, key)) {
2944
- acc[key] = rhs[key];
2945
- return acc;
2946
- }
2947
- const difference = diff(lhs[key], rhs[key]);
2948
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2949
- return acc;
2950
- }
2951
- acc[key] = difference;
2952
- return acc;
2953
- }, deletedValues);
2954
- };
2955
- var overwrite = (element, params, opts = {}) => {
2956
- const { __ref: ref } = element;
2957
- const excl = opts.exclude || [];
2958
- const allowUnderscore = opts.preventUnderscore;
2959
- const preventCaching = opts.preventCaching;
2960
- for (const e in params) {
2961
- if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
2962
- continue;
2963
- const elementProp = element[e];
2964
- const paramsProp = params[e];
2965
- if (paramsProp !== void 0) {
2966
- element[e] = paramsProp;
2967
- if (ref && !preventCaching) {
2968
- ref.__cache[e] = elementProp;
2969
- }
2970
- if ((0, import_types.isObject)(opts.diff)) {
2971
- diff[e] = elementProp;
2972
- }
2973
- }
2974
- }
2975
- return element;
2976
- };
2977
- var overwriteShallow = (obj, params, excludeFrom = []) => {
2978
- for (const e in params) {
2979
- if (excludeFrom.includes(e) || e.startsWith("__"))
2980
- continue;
2981
- obj[e] = params[e];
2982
- }
2983
- return obj;
2984
- };
2985
- var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
2986
- const excl = opts.exclude || [];
2987
- const forcedExclude = opts.preventForce ? [] : ["node", "window"];
2988
- if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
2989
- return params;
2990
- }
2991
- if (visited.has(obj))
2992
- return visited.get(obj);
2993
- visited.set(obj, obj);
2994
- for (const e in params) {
2995
- if (!Object.hasOwnProperty.call(params, e))
2996
- continue;
2997
- if (excl.includes(e) || forcedExclude && e.startsWith("__"))
2998
- continue;
2999
- const objProp = obj[e];
3000
- const paramsProp = params[e];
3001
- if ((0, import_node.isDOMNode)(paramsProp)) {
3002
- obj[e] = paramsProp;
3003
- } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
3004
- obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
3005
- } else if (paramsProp !== void 0) {
3006
- obj[e] = paramsProp;
3007
- }
3008
- }
3009
- return obj;
3010
- };
3011
- var mergeIfExisted = (a, b) => {
3012
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
3013
- return deepMerge3(a, b);
3014
- return a || b;
3015
- };
3016
- var flattenRecursive = (param, prop, stack = []) => {
3017
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
3018
- stack.push(objectized);
3019
- const extendOfExtend = objectized[prop];
3020
- if (extendOfExtend)
3021
- flattenRecursive(extendOfExtend, prop, stack);
3022
- delete objectized[prop];
3023
- return stack;
3024
- };
3025
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
3026
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
3027
- return param === element;
3028
- }
3029
- if (visited.has(param) || visited.has(element)) {
3030
- return true;
3031
- }
3032
- visited.add(param);
3033
- visited.add(element);
3034
- const keysParam = Object.keys(param);
3035
- const keysElement = Object.keys(element);
3036
- if (keysParam.length !== keysElement.length) {
3037
- return false;
3038
- }
3039
- for (const key of keysParam) {
3040
- if (!keysElement.includes(key)) {
3041
- return false;
3042
- }
3043
- const paramProp = param[key];
3044
- const elementProp = element[key];
3045
- if (!isEqualDeep(paramProp, elementProp, visited)) {
3046
- return false;
3047
- }
3048
- }
3049
- return true;
3050
- };
3051
- var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
3052
- if (obj1 === obj2)
3053
- return true;
3054
- if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
3055
- return false;
3056
- if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
3057
- return obj1 === obj2;
3058
- const stack = [[obj1, obj2]];
3059
- const visited = /* @__PURE__ */ new WeakSet();
3060
- while (stack.length > 0) {
3061
- const [current1, current2] = stack.pop();
3062
- if (visited.has(current1))
3063
- continue;
3064
- visited.add(current1);
3065
- const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
3066
- const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
3067
- if (keys1.length !== keys2.length)
3068
- return false;
3069
- for (const key of keys1) {
3070
- if (!Object.prototype.hasOwnProperty.call(current2, key))
3071
- return false;
3072
- const value1 = current1[key];
3073
- const value2 = current2[key];
3074
- if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
3075
- if (value1 !== value2)
3076
- return false;
3077
- } else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
3078
- if (value1 !== value2) {
3079
- stack.push([value1, value2]);
3080
- }
3081
- } else if (value1 !== value2) {
3082
- return false;
3083
- }
3084
- }
3085
- }
3086
- return true;
3087
- };
3088
- var removeFromObject = (obj, props) => {
3089
- if (props === void 0 || props === null)
3090
- return obj;
3091
- if ((0, import_types.is)(props)("string", "number")) {
3092
- delete obj[props];
3093
- } else if ((0, import_types.isArray)(props)) {
3094
- props.forEach((prop) => delete obj[prop]);
3095
- } else {
3096
- throw new Error("Invalid input: props must be a string or an array of strings");
3097
- }
3098
- return obj;
3099
- };
3100
- var createObjectWithoutPrototype = (obj) => {
3101
- if (obj === null || typeof obj !== "object") {
3102
- return obj;
3103
- }
3104
- const newObj = /* @__PURE__ */ Object.create(null);
3105
- for (const key in obj) {
3106
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
3107
- newObj[key] = createObjectWithoutPrototype(obj[key]);
3108
- }
3109
- }
3110
- return newObj;
3111
- };
3112
- var createNestedObject = (arr, lastValue) => {
3113
- const nestedObject = {};
3114
- if (arr.length === 0) {
3115
- return lastValue;
3116
- }
3117
- arr.reduce((obj, value, index) => {
3118
- if (!obj[value]) {
3119
- obj[value] = {};
3120
- }
3121
- if (index === arr.length - 1 && lastValue) {
3122
- obj[value] = lastValue;
3123
- }
3124
- return obj[value];
3125
- }, nestedObject);
3126
- return nestedObject;
3127
- };
3128
- var removeNestedKeyByPath = (obj, path) => {
3129
- if (!Array.isArray(path)) {
3130
- throw new Error("Path must be an array.");
3131
- }
3132
- let current = obj;
3133
- for (let i = 0; i < path.length - 1; i++) {
3134
- if (current[path[i]] === void 0) {
3135
- return;
3136
- }
3137
- current = current[path[i]];
3138
- }
3139
- const lastKey = path[path.length - 1];
3140
- if (current && Object.hasOwnProperty.call(current, lastKey)) {
3141
- delete current[lastKey];
3142
- }
3143
- };
3144
- var detectInfiniteLoop = (arr) => {
3145
- const maxRepeats = 10;
3146
- let pattern = [];
3147
- let repeatCount = 0;
3148
- for (let i = 0; i < arr.length; i++) {
3149
- if (pattern.length < 2) {
3150
- pattern.push(arr[i]);
3151
- } else {
3152
- if (arr[i] === pattern[i % 2]) {
3153
- repeatCount++;
3154
- } else {
3155
- pattern = [arr[i - 1], arr[i]];
3156
- repeatCount = 1;
3157
- }
3158
- if (repeatCount >= maxRepeats * 2) {
3159
- if (ENV2 === "test" || ENV2 === "development") {
3160
- console.warn("Warning: Potential infinite loop detected due to repeated sequence:", pattern);
3161
- }
3162
- return true;
3163
- }
3164
- }
3165
- }
3166
- };
3167
- var isCyclic = (obj) => {
3168
- const seenObjects = [];
3169
- function detect(obj2) {
3170
- if (obj2 && typeof obj2 === "object") {
3171
- if (seenObjects.indexOf(obj2) !== -1) {
3172
- return true;
3173
- }
3174
- seenObjects.push(obj2);
3175
- for (const key in obj2) {
3176
- if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
3177
- console.log(obj2, "cycle at " + key);
3178
- return true;
3179
- }
3180
- }
3181
- }
3182
- return false;
3183
- }
3184
- return detect(obj);
3185
- };
3186
- var excludeKeysFromObject = (obj, excludedKeys) => {
3187
- const result = { ...obj };
3188
- excludedKeys.forEach((key) => delete result[key]);
3189
- return result;
3190
- };
3191
- }
3192
- });
3193
- var require_function2 = __commonJS2({
3194
- "../../../domql/packages/utils/dist/cjs/function.js"(exports2, module22) {
3195
- "use strict";
3196
- var __defProp22 = Object.defineProperty;
3197
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3198
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3199
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3200
- var __export22 = (target, all) => {
3201
- for (var name in all)
3202
- __defProp22(target, name, { get: all[name], enumerable: true });
3203
- };
3204
- var __copyProps22 = (to, from, except, desc) => {
3205
- if (from && typeof from === "object" || typeof from === "function") {
3206
- for (let key of __getOwnPropNames22(from))
3207
- if (!__hasOwnProp22.call(to, key) && key !== except)
3208
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3209
- }
3210
- return to;
3211
- };
3212
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3213
- var function_exports = {};
3214
- __export22(function_exports, {
3215
- cloneFunction: () => cloneFunction,
3216
- debounce: () => debounce,
3217
- debounceOnContext: () => debounceOnContext,
3218
- isStringFunction: () => isStringFunction,
3219
- memoize: () => memoize
3220
- });
3221
- module22.exports = __toCommonJS22(function_exports);
3222
- function debounce(func, wait, immediate) {
3223
- let timeout;
3224
- return function() {
3225
- const context = this;
3226
- const args = arguments;
3227
- const later = function() {
3228
- timeout = null;
3229
- if (!immediate)
3230
- func.apply(context, args);
3231
- };
3232
- const callNow = immediate && !timeout;
3233
- clearTimeout(timeout);
3234
- timeout = setTimeout(later, wait);
3235
- if (callNow)
3236
- func.apply(context, args);
3237
- };
3238
- }
3239
- var debounceOnContext = (element, func, timeout = 300) => {
3240
- let timer;
3241
- return (...args) => {
3242
- clearTimeout(timer);
3243
- timer = setTimeout(() => {
3244
- func.apply(element, args);
3245
- }, timeout);
3246
- };
3247
- };
3248
- var memoize = (fn) => {
3249
- const cache = {};
3250
- return (...args) => {
3251
- const n = args[0];
3252
- if (n in cache) {
3253
- return cache[n];
3254
- } else {
3255
- const result = fn(n);
3256
- cache[n] = result;
3257
- return result;
3258
- }
3259
- };
3260
- };
3261
- var isStringFunction = (inputString) => {
3262
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
3263
- return functionRegex.test(inputString);
3264
- };
3265
- function cloneFunction(fn, win = window) {
3266
- const temp = function() {
3267
- return fn.apply(win, arguments);
3268
- };
3269
- for (const key in fn) {
3270
- if (Object.hasOwnProperty.call(fn, key)) {
3271
- temp[key] = fn[key];
3272
- }
3273
- }
3274
- return temp;
3275
- }
3276
- }
3277
- });
3278
- var require_log2 = __commonJS2({
3279
- "../../../domql/packages/utils/dist/cjs/log.js"(exports2, module22) {
3280
- "use strict";
3281
- var __defProp22 = Object.defineProperty;
3282
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3283
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3284
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3285
- var __export22 = (target, all) => {
3286
- for (var name in all)
3287
- __defProp22(target, name, { get: all[name], enumerable: true });
3288
- };
3289
- var __copyProps22 = (to, from, except, desc) => {
3290
- if (from && typeof from === "object" || typeof from === "function") {
3291
- for (let key of __getOwnPropNames22(from))
3292
- if (!__hasOwnProp22.call(to, key) && key !== except)
3293
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3294
- }
3295
- return to;
3296
- };
3297
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3298
- var log_exports = {};
3299
- __export22(log_exports, {
3300
- logGroupIf: () => logGroupIf,
3301
- logIf: () => logIf
3302
- });
3303
- module22.exports = __toCommonJS22(log_exports);
3304
- var logIf = (bool, ...arg) => {
3305
- if (bool)
3306
- arg.map((v) => console.log(v));
3307
- };
3308
- var logGroupIf = (bool, key, ...arg) => {
3309
- if (bool) {
3310
- console.group(key);
3311
- arg.map((v) => console.log(v));
3312
- console.groupEnd(key);
3313
- }
3314
- };
3315
- }
3316
- });
3317
- var require_cookie2 = __commonJS2({
3318
- "../../../domql/packages/utils/dist/cjs/cookie.js"(exports2, module22) {
3319
- "use strict";
3320
- var __defProp22 = Object.defineProperty;
3321
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3322
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3323
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3324
- var __export22 = (target, all) => {
3325
- for (var name in all)
3326
- __defProp22(target, name, { get: all[name], enumerable: true });
3327
- };
3328
- var __copyProps22 = (to, from, except, desc) => {
3329
- if (from && typeof from === "object" || typeof from === "function") {
3330
- for (let key of __getOwnPropNames22(from))
3331
- if (!__hasOwnProp22.call(to, key) && key !== except)
3332
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3333
- }
3334
- return to;
3335
- };
3336
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3337
- var cookie_exports = {};
3338
- __export22(cookie_exports, {
3339
- getCookie: () => getCookie,
3340
- getLocalStorage: () => getLocalStorage,
3341
- isMobile: () => isMobile,
3342
- removeCookie: () => removeCookie,
3343
- setCookie: () => setCookie,
3344
- setLocalStorage: () => setLocalStorage
3345
- });
3346
- module22.exports = __toCommonJS22(cookie_exports);
3347
- var import_types = require_types2();
3348
- var import_utils32 = require_cjs4();
3349
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
3350
- var setCookie = (cname, cvalue, exdays = 365) => {
3351
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3352
- return;
3353
- const d = /* @__PURE__ */ new Date();
3354
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
3355
- const expires = `expires=${d.toUTCString()}`;
3356
- import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
3357
- };
3358
- var getCookie = (cname) => {
3359
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3360
- return;
3361
- const name = `${cname}=`;
3362
- const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
3363
- const ca = decodedCookie.split(";");
3364
- for (let i = 0; i < ca.length; i++) {
3365
- let c = ca[i];
3366
- while (c.charAt(0) === " ")
3367
- c = c.substring(1);
3368
- if (c.indexOf(name) === 0)
3369
- return c.substring(name.length, c.length);
3370
- }
3371
- return "";
3372
- };
3373
- var removeCookie = (cname) => {
3374
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3375
- return;
3376
- import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3377
- };
3378
- function getLocalStorage(key) {
3379
- let savedJSON;
3380
- if (window.localStorage) {
3381
- try {
3382
- savedJSON = JSON.parse(window.localStorage.getItem(key));
3383
- } catch (e) {
3384
- }
3385
- }
3386
- if (typeof savedJSON !== "undefined") {
3387
- return savedJSON;
3388
- }
3389
- }
3390
- function setLocalStorage(key, data) {
3391
- if (data && window.localStorage) {
3392
- if (typeof data === "object") {
3393
- window.localStorage.setItem(key, JSON.stringify(data));
3394
- } else {
3395
- window.localStorage.setItem(key, data);
3396
- }
3397
- }
3398
- }
3399
- }
3400
- });
3401
- var require_tags2 = __commonJS2({
3402
- "../../../domql/packages/utils/dist/cjs/tags.js"(exports2, module22) {
3403
- "use strict";
3404
- var __defProp22 = Object.defineProperty;
3405
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3406
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3407
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3408
- var __export22 = (target, all) => {
3409
- for (var name in all)
3410
- __defProp22(target, name, { get: all[name], enumerable: true });
3411
- };
3412
- var __copyProps22 = (to, from, except, desc) => {
3413
- if (from && typeof from === "object" || typeof from === "function") {
3414
- for (let key of __getOwnPropNames22(from))
3415
- if (!__hasOwnProp22.call(to, key) && key !== except)
3416
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3417
- }
3418
- return to;
3419
- };
3420
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3421
- var tags_exports = {};
3422
- __export22(tags_exports, {
3423
- HTML_TAGS: () => HTML_TAGS,
3424
- isValidHtmlTag: () => isValidHtmlTag
3425
- });
3426
- module22.exports = __toCommonJS22(tags_exports);
3427
- var HTML_TAGS = {
3428
- root: [
3429
- "body",
3430
- "html"
3431
- ],
3432
- head: [
3433
- "title",
3434
- "base",
3435
- "meta",
3436
- "style",
3437
- "noscript",
3438
- "script"
3439
- ],
3440
- body: [
3441
- "string",
3442
- "style",
3443
- "fragment",
3444
- "a",
3445
- "abbr",
3446
- "acronym",
3447
- "address",
3448
- "applet",
3449
- "area",
3450
- "article",
3451
- "aside",
3452
- "audio",
3453
- "b",
3454
- "basefont",
3455
- "bdi",
3456
- "bdo",
3457
- "big",
3458
- "blockquote",
3459
- "br",
3460
- "button",
3461
- "canvas",
3462
- "caption",
3463
- "center",
3464
- "cite",
3465
- "code",
3466
- "search",
3467
- "col",
3468
- "colgroup",
3469
- "data",
3470
- "datalist",
3471
- "dd",
3472
- "del",
3473
- "details",
3474
- "dfn",
3475
- "dialog",
3476
- "dir",
3477
- "div",
3478
- "dl",
3479
- "dt",
3480
- "em",
3481
- "embed",
3482
- "fieldset",
3483
- "figcaption",
3484
- "figure",
3485
- "font",
3486
- "footer",
3487
- "form",
3488
- "frame",
3489
- "frameset",
3490
- "h1",
3491
- "h2",
3492
- "h3",
3493
- "h4",
3494
- "h5",
3495
- "h6",
3496
- "head",
3497
- "header",
3498
- "hr",
3499
- "i",
3500
- "iframe",
3501
- "img",
3502
- "input",
3503
- "ins",
3504
- "kbd",
3505
- "label",
3506
- "legend",
3507
- "li",
3508
- "link",
3509
- "main",
3510
- "map",
3511
- "mark",
3512
- "meter",
3513
- "nav",
3514
- "noframes",
3515
- "noscript",
3516
- "object",
3517
- "ol",
3518
- "optgroup",
3519
- "option",
3520
- "output",
3521
- "p",
3522
- "param",
3523
- "picture",
3524
- "pre",
3525
- "progress",
3526
- "hgroup",
3527
- "q",
3528
- "rp",
3529
- "rt",
3530
- "ruby",
3531
- "s",
3532
- "samp",
3533
- "script",
3534
- "section",
3535
- "select",
3536
- "small",
3537
- "source",
3538
- "span",
3539
- "strike",
3540
- "strong",
3541
- "sub",
3542
- "summary",
3543
- "sup",
3544
- "table",
3545
- "tbody",
3546
- "td",
3547
- "template",
3548
- "hgroup",
3549
- "textarea",
3550
- "tfoot",
3551
- "th",
3552
- "thead",
3553
- "time",
3554
- "tr",
3555
- "track",
3556
- "tt",
3557
- "u",
3558
- "ul",
3559
- "var",
3560
- "video",
3561
- "wbr",
3562
- // SVG
3563
- "svg",
3564
- "path"
3565
- ]
3566
- };
3567
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
3568
- }
3569
- });
3570
- var require_component2 = __commonJS2({
3571
- "../../../domql/packages/utils/dist/cjs/component.js"(exports2, module22) {
3572
- "use strict";
3573
- var __defProp22 = Object.defineProperty;
3574
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3575
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3576
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3577
- var __export22 = (target, all) => {
3578
- for (var name in all)
3579
- __defProp22(target, name, { get: all[name], enumerable: true });
3580
- };
3581
- var __copyProps22 = (to, from, except, desc) => {
3582
- if (from && typeof from === "object" || typeof from === "function") {
3583
- for (let key of __getOwnPropNames22(from))
3584
- if (!__hasOwnProp22.call(to, key) && key !== except)
3585
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3586
- }
3587
- return to;
3588
- };
3589
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3590
- var component_exports = {};
3591
- __export22(component_exports, {
3592
- addAdditionalExtend: () => addAdditionalExtend,
3593
- addChildrenIfNotInOriginal: () => addChildrenIfNotInOriginal,
3594
- applyComponentFromContext: () => applyComponentFromContext,
3595
- applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3596
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3597
- checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3598
- checkIfSugar: () => checkIfSugar,
3599
- extendizeByKey: () => extendizeByKey,
3600
- extractComponentKeyFromKey: () => extractComponentKeyFromKey,
3601
- getCapitalCaseKeys: () => getCapitalCaseKeys,
3602
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3603
- getExtendsInElement: () => getExtendsInElement,
3604
- hasVariantProp: () => hasVariantProp,
3605
- isVariant: () => isVariant,
3606
- setContentKey: () => setContentKey
3607
- });
3608
- module22.exports = __toCommonJS22(component_exports);
3609
- var import__ = require_cjs4();
3610
- var ENV2 = "development";
3611
- var checkIfKeyIsComponent = (key) => {
3612
- const isFirstKeyString = (0, import__.isString)(key);
3613
- if (!isFirstKeyString)
3614
- return;
3615
- const firstCharKey = key.slice(0, 1);
3616
- return /^[A-Z]*$/.test(firstCharKey);
3617
- };
3618
- var checkIfKeyIsProperty = (key) => {
3619
- const isFirstKeyString = (0, import__.isString)(key);
3620
- if (!isFirstKeyString)
3621
- return;
3622
- const firstCharKey = key.slice(0, 1);
3623
- return /^[a-z]*$/.test(firstCharKey);
3624
- };
3625
- var addAdditionalExtend = (newExtend, element) => {
3626
- if (!newExtend)
3627
- return element;
3628
- const { extend: elementExtend } = element;
3629
- const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
3630
- const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
3631
- const extend = (0, import__.joinArrays)(receivedArray, originalArray);
3632
- return { ...element, extend };
3633
- };
3634
- var checkIfSugar = (element, parent, key) => {
3635
- var _a;
3636
- const {
3637
- extend,
3638
- props,
3639
- childExtend,
3640
- extends: extendProps,
3641
- childExtends,
3642
- childProps,
3643
- children,
3644
- on,
3645
- $collection,
3646
- $stateCollection,
3647
- $propsCollection
3648
- } = element;
3649
- const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3650
- if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3651
- const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3652
- if (logErr)
3653
- logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3654
- }
3655
- return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3656
- };
3657
- var extractComponentKeyFromKey = (key) => {
3658
- return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3659
- };
3660
- var extendizeByKey = (element, parent, key) => {
3661
- const { context } = parent;
3662
- const { tag, extend, childExtends } = element;
3663
- const isSugar = checkIfSugar(element, parent, key);
3664
- const extendFromKey = extractComponentKeyFromKey(key);
3665
- const isExtendKeyComponent = context && context.components[extendFromKey];
3666
- if (element === isExtendKeyComponent)
3667
- return element;
3668
- else if (isSugar) {
3669
- const newElem = addAdditionalExtend(element.extends, {
3670
- extend: extendFromKey,
3671
- tag,
3672
- props: { ...element }
3673
- });
3674
- if (childExtends)
3675
- newElem.childExtend = childExtends;
3676
- return newElem;
3677
- } else if (!extend || extend === true) {
3678
- return {
3679
- ...element,
3680
- tag,
3681
- extend: extendFromKey
3682
- };
3683
- } else if (extend) {
3684
- return addAdditionalExtend(extendFromKey, element);
3685
- } else if ((0, import__.isFunction)(element)) {
3686
- return {
3687
- extend: extendFromKey,
3688
- tag,
3689
- props: { ...(0, import__.exec)(element, parent) }
3690
- };
3691
- }
3692
- };
3693
- function getCapitalCaseKeys(obj) {
3694
- return Object.keys(obj).filter((key) => /^[A-Z]/.test(key));
3695
- }
3696
- var addChildrenIfNotInOriginal = (element, parent, key) => {
3697
- const childElems = getCapitalCaseKeys(element.props);
3698
- if (!childElems.length)
3699
- return element;
3700
- for (const i in childElems) {
3701
- const childKey = childElems[i];
3702
- const childElem = element[childKey];
3703
- const newChild = element.props[childKey];
3704
- const assignChild = (val) => {
3705
- element[childKey] = val;
3706
- delete element.props[childKey];
3707
- };
3708
- if (newChild == null ? void 0 : newChild.ignoreExtend)
3709
- continue;
3710
- if (newChild === null)
3711
- assignChild(null);
3712
- else if (!childElem)
3713
- assignChild((0, import__.deepClone)(newChild));
3714
- else {
3715
- const isSugarChildElem = checkIfSugar(childElem, parent, key);
3716
- if (isSugarChildElem)
3717
- continue;
3718
- assignChild({
3719
- extend: element[childKey],
3720
- props: newChild
3721
- });
3722
- }
3723
- }
3724
- };
3725
- var applyKeyComponentAsExtend = (element, parent, key) => {
3726
- return extendizeByKey(element, parent, key) || element;
3727
- };
3728
- var applyComponentFromContext = (element, parent, options) => {
3729
- const { context } = element;
3730
- if (!context || !context.components)
3731
- return;
3732
- const { components } = context;
3733
- const { extend } = element;
3734
- const execExtend = (0, import__.exec)(extend, element);
3735
- if ((0, import__.isString)(execExtend)) {
3736
- const componentExists = components[execExtend] || components["smbls." + execExtend];
3737
- if (componentExists)
3738
- element.extend = componentExists;
3739
- else {
3740
- if ((ENV2 === "test" || ENV2 === "development") && options.verbose) {
3741
- console.warn(execExtend, "is not in library", components, element);
3742
- console.warn("replacing with ", {});
3743
- }
3744
- element.extend = {};
3745
- }
3746
- }
3747
- };
3748
- var isVariant = (param) => {
3749
- if (!(0, import__.isString)(param))
3750
- return;
3751
- const firstCharKey = param.slice(0, 1);
3752
- return firstCharKey === ".";
3753
- };
3754
- var hasVariantProp = (element) => {
3755
- const { props } = element;
3756
- if ((0, import__.isObject)(props) && (0, import__.isString)(props.variant))
3757
- return true;
3758
- };
3759
- var getChildrenComponentsByKey = (key, el) => {
3760
- if (key === el.key || el.__ref.__componentKey === key) {
3761
- return el;
3762
- }
3763
- if (el.extend) {
3764
- const foundString = (0, import__.isString)(el.extend) && el.extend === key;
3765
- const foundInArray = (0, import__.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
3766
- if (foundString || foundInArray)
3767
- return el;
3768
- }
3769
- if (el.parent && el.parent.childExtend) {
3770
- const foundString = (0, import__.isString)(el.parent.childExtend) && el.parent.childExtend === key;
3771
- const foundInArray = (0, import__.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
3772
- if (foundString || foundInArray)
3773
- return el;
3774
- }
3775
- };
3776
- var getExtendsInElement = (obj) => {
3777
- let result = [];
3778
- function traverse(o) {
3779
- for (const key in o) {
3780
- if (Object.hasOwnProperty.call(o, key)) {
3781
- if (checkIfKeyIsComponent(key)) {
3782
- result.push(key);
3783
- }
3784
- if (key === "extend" || key === "extends") {
3785
- if (typeof o[key] === "string") {
3786
- result.push(o[key]);
3787
- } else if (Array.isArray(o[key])) {
3788
- result = result.concat(o[key]);
3789
- }
3790
- }
3791
- if (typeof o[key] === "object" && o[key] !== null) {
3792
- traverse(o[key]);
3793
- }
3794
- }
3795
- }
3796
- }
3797
- traverse(obj);
3798
- return result;
3799
- };
3800
- var setContentKey = (el, opts = {}) => {
3801
- const { __ref: ref } = el;
3802
- const contentElementKey = opts.contentElementKey;
3803
- if (contentElementKey !== "content" && contentElementKey !== ref.contentElementKey || !ref.contentElementKey) {
3804
- ref.contentElementKey = contentElementKey || "content";
3805
- } else
3806
- ref.contentElementKey = "content";
3807
- if (contentElementKey !== "content")
3808
- opts.contentElementKey = "content";
3809
- return ref.contentElementKey;
3810
- };
3811
- }
3812
- });
3813
- var require_cjs4 = __commonJS2({
3814
- "../../../domql/packages/utils/dist/cjs/index.js"(exports2, module22) {
3815
- "use strict";
3816
- var __defProp22 = Object.defineProperty;
3817
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3818
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3819
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3820
- var __copyProps22 = (to, from, except, desc) => {
3821
- if (from && typeof from === "object" || typeof from === "function") {
3822
- for (let key of __getOwnPropNames22(from))
3823
- if (!__hasOwnProp22.call(to, key) && key !== except)
3824
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3825
- }
3826
- return to;
3827
- };
3828
- var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3829
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3830
- var utils_exports2 = {};
3831
- module22.exports = __toCommonJS22(utils_exports2);
3832
- __reExport(utils_exports2, require_key2(), module22.exports);
3833
- __reExport(utils_exports2, require_env2(), module22.exports);
3834
- __reExport(utils_exports2, require_types2(), module22.exports);
3835
- __reExport(utils_exports2, require_object2(), module22.exports);
3836
- __reExport(utils_exports2, require_function2(), module22.exports);
3837
- __reExport(utils_exports2, require_array2(), module22.exports);
3838
- __reExport(utils_exports2, require_node2(), module22.exports);
3839
- __reExport(utils_exports2, require_log2(), module22.exports);
3840
- __reExport(utils_exports2, require_string2(), module22.exports);
3841
- __reExport(utils_exports2, require_globals2(), module22.exports);
3842
- __reExport(utils_exports2, require_cookie2(), module22.exports);
3843
- __reExport(utils_exports2, require_tags2(), module22.exports);
3844
- __reExport(utils_exports2, require_component2(), module22.exports);
3845
- }
3846
- });
89
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
3847
90
  var src_exports2 = {};
3848
91
  __export2(src_exports2, {
3849
92
  arrayzeValue: () => arrayzeValue3,
@@ -3859,7 +102,6 @@ var require_cjs3 = __commonJS({
3859
102
  loadJavascriptFile: () => loadJavascriptFile,
3860
103
  loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
3861
104
  loadJavascriptFileSync: () => loadJavascriptFileSync,
3862
- registerFrameListener: () => registerFrameListener,
3863
105
  removeChars: () => removeChars,
3864
106
  toCamelCase: () => toCamelCase2,
3865
107
  toDashCase: () => toDashCase2,
@@ -3868,27 +110,36 @@ var require_cjs3 = __commonJS({
3868
110
  toggleFullscreen: () => toggleFullscreen
3869
111
  });
3870
112
  module2.exports = __toCommonJS2(src_exports2);
3871
- var import_utils27 = __toESM2(require_cjs4(), 1);
3872
- var toggleFullscreen = async (el) => {
113
+ var window22 = globalThis;
114
+ var document22 = window22.document;
115
+ var isObject2 = (arg) => {
116
+ if (arg === null)
117
+ return false;
118
+ return typeof arg === "object" && arg.constructor === Object;
119
+ };
120
+ var isString2 = (arg) => typeof arg === "string";
121
+ var isNumber2 = (arg) => typeof arg === "number";
122
+ var isArray2 = (arg) => Array.isArray(arg);
123
+ var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
124
+ async function toggleFullscreen(opts) {
3873
125
  if (!document.fullscreenElement) {
3874
126
  try {
3875
- await (el.node || document).requestFullscreen();
127
+ await (this.node || document).requestFullscreen();
3876
128
  } catch (err) {
3877
129
  console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
3878
130
  }
3879
131
  } else {
3880
132
  await document.exitFullscreen();
3881
133
  }
3882
- };
3883
- var import_utils28 = __toESM2(require_cjs4(), 1);
134
+ }
3884
135
  var findClosestNumber = (number, arr) => {
3885
- return ((0, import_utils28.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
136
+ return (isArray2(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3886
137
  return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3887
138
  });
3888
139
  };
3889
140
  var findClosestNumberInFactory = (val, factory) => {
3890
141
  val = parseFloat(val);
3891
- if ((0, import_utils28.isObject)(factory))
142
+ if (isObject2(factory))
3892
143
  factory = Object.values(factory);
3893
144
  return findClosestNumber(val, factory);
3894
145
  };
@@ -3997,13 +248,6 @@ var require_cjs3 = __commonJS({
3997
248
  }
3998
249
  };
3999
250
  var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
4000
- var registerFrameListener = (el) => {
4001
- const { __ref: ref } = el;
4002
- const { frameListeners } = ref.root.data;
4003
- if (frameListeners && !frameListeners.has(el)) {
4004
- frameListeners.add(el);
4005
- }
4006
- };
4007
251
  var copyStringToClipboard = async (str) => {
4008
252
  try {
4009
253
  await navigator.clipboard.writeText(str);
@@ -4043,13 +287,13 @@ var require_cjs3 = __commonJS({
4043
287
  return result.charAt(0).toUpperCase() + result.slice(1);
4044
288
  };
4045
289
  var arrayzeValue3 = (val) => {
4046
- if ((0, import_utils27.isArray)(val))
290
+ if (isArray2(val))
4047
291
  return val;
4048
- if ((0, import_utils27.isString)(val))
292
+ if (isString2(val))
4049
293
  return val.split(" ");
4050
- if ((0, import_utils27.isObject)(val))
294
+ if (isObject2(val))
4051
295
  return Object.values(val);
4052
- if ((0, import_utils27.isNumber)(val))
296
+ if (isNumber2(val))
4053
297
  return [val];
4054
298
  };
4055
299
  }
@@ -4238,8 +482,173 @@ var isScalingUnit = (unit) => {
4238
482
  };
4239
483
 
4240
484
  // src/utils/color.js
4241
- var import_globals = __toESM(require_cjs(), 1);
4242
- var import_utils = __toESM(require_cjs2(), 1);
485
+ var import_globals4 = __toESM(require_cjs(), 1);
486
+
487
+ // ../../../domql/packages/utils/dist/esm/globals.js
488
+ var window2 = globalThis;
489
+ var document2 = window2.document;
490
+
491
+ // ../../../domql/packages/utils/dist/esm/node.js
492
+ var isDOMNode = (obj) => {
493
+ return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
494
+ };
495
+
496
+ // ../../../domql/packages/utils/dist/esm/types.js
497
+ var isObject = (arg) => {
498
+ if (arg === null)
499
+ return false;
500
+ return typeof arg === "object" && arg.constructor === Object;
501
+ };
502
+ var isString = (arg) => typeof arg === "string";
503
+ var isNumber = (arg) => typeof arg === "number";
504
+ var isFunction = (arg) => typeof arg === "function";
505
+ var isBoolean = (arg) => arg === true || arg === false;
506
+ var isNull = (arg) => arg === null;
507
+ var isArray = (arg) => Array.isArray(arg);
508
+ var isDate = (d) => d instanceof Date;
509
+ var isObjectLike = (arg) => {
510
+ if (arg === null)
511
+ return false;
512
+ return typeof arg === "object";
513
+ };
514
+ var isDefined = (arg) => {
515
+ return isObject(arg) || isObjectLike(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
516
+ };
517
+ var isUndefined = (arg) => {
518
+ return arg === void 0;
519
+ };
520
+
521
+ // ../../../domql/packages/utils/dist/esm/array.js
522
+ var mergeArray = (arr, exclude = []) => {
523
+ return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
524
+ };
525
+
526
+ // ../../../domql/packages/utils/dist/esm/object.js
527
+ var __defProp2 = Object.defineProperty;
528
+ var __defProps = Object.defineProperties;
529
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
530
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
531
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
532
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
533
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
534
+ var __spreadValues = (a, b) => {
535
+ for (var prop in b || (b = {}))
536
+ if (__hasOwnProp2.call(b, prop))
537
+ __defNormalProp(a, prop, b[prop]);
538
+ if (__getOwnPropSymbols)
539
+ for (var prop of __getOwnPropSymbols(b)) {
540
+ if (__propIsEnum.call(b, prop))
541
+ __defNormalProp(a, prop, b[prop]);
542
+ }
543
+ return a;
544
+ };
545
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
546
+ var merge = (element, obj, excludeFrom = []) => {
547
+ for (const e in obj) {
548
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
549
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
550
+ continue;
551
+ const elementProp = element[e];
552
+ const objProp = obj[e];
553
+ if (elementProp === void 0) {
554
+ element[e] = objProp;
555
+ }
556
+ }
557
+ return element;
558
+ };
559
+ var deepMerge = (element, extend, excludeFrom = []) => {
560
+ for (const e in extend) {
561
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
562
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
563
+ continue;
564
+ const elementProp = element[e];
565
+ const extendProp = extend[e];
566
+ if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
567
+ deepMerge(elementProp, extendProp, excludeFrom);
568
+ } else if (elementProp === void 0) {
569
+ element[e] = extendProp;
570
+ }
571
+ }
572
+ return element;
573
+ };
574
+ var deepClone = (obj, options = {}) => {
575
+ const {
576
+ exclude = [],
577
+ cleanUndefined = false,
578
+ cleanNull = false,
579
+ window: targetWindow,
580
+ visited = /* @__PURE__ */ new WeakMap(),
581
+ handleExtend = false
582
+ } = options;
583
+ if (!isObjectLike(obj) || isDOMNode(obj)) {
584
+ return obj;
585
+ }
586
+ if (visited.has(obj)) {
587
+ return visited.get(obj);
588
+ }
589
+ const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
590
+ visited.set(obj, clone2);
591
+ for (const key in obj) {
592
+ if (!Object.prototype.hasOwnProperty.call(obj, key))
593
+ continue;
594
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
595
+ continue;
596
+ const value = obj[key];
597
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
598
+ continue;
599
+ if (isDOMNode(value)) {
600
+ clone2[key] = value;
601
+ continue;
602
+ }
603
+ if (handleExtend && key === "extend" && isArray(value)) {
604
+ clone2[key] = mergeArray(value, exclude);
605
+ continue;
606
+ }
607
+ if (isFunction(value) && targetWindow) {
608
+ clone2[key] = targetWindow.eval("(" + value.toString() + ")");
609
+ continue;
610
+ }
611
+ if (isObjectLike(value)) {
612
+ clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
613
+ visited
614
+ }));
615
+ } else {
616
+ clone2[key] = value;
617
+ }
618
+ }
619
+ return clone2;
620
+ };
621
+ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
622
+ const excl = opts.exclude || [];
623
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
624
+ if (!isObjectLike(obj) || !isObjectLike(params) || isDOMNode(obj) || isDOMNode(params)) {
625
+ return params;
626
+ }
627
+ if (visited.has(obj))
628
+ return visited.get(obj);
629
+ visited.set(obj, obj);
630
+ for (const e in params) {
631
+ if (!Object.hasOwnProperty.call(params, e))
632
+ continue;
633
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
634
+ continue;
635
+ const objProp = obj[e];
636
+ const paramsProp = params[e];
637
+ if (isDOMNode(paramsProp)) {
638
+ obj[e] = paramsProp;
639
+ } else if (isObjectLike(objProp) && isObjectLike(paramsProp)) {
640
+ obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
641
+ } else if (paramsProp !== void 0) {
642
+ obj[e] = paramsProp;
643
+ }
644
+ }
645
+ return obj;
646
+ };
647
+
648
+ // ../../../domql/packages/utils/dist/esm/cookie.js
649
+ var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
650
+
651
+ // src/utils/color.js
4243
652
  var ENV = "development";
4244
653
  var colorStringToRgbaArray = (color) => {
4245
654
  if (color === "")
@@ -4258,21 +667,21 @@ var colorStringToRgbaArray = (color) => {
4258
667
  ];
4259
668
  }
4260
669
  if (color.indexOf("rgb") === -1) {
4261
- if (import_globals.document && import_globals.window) {
4262
- const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
670
+ if (import_globals4.document && import_globals4.window) {
671
+ const elem = import_globals4.document.body.appendChild(import_globals4.document.createElement("fictum"));
4263
672
  const flag = "rgb(1, 2, 3)";
4264
673
  elem.style.color = flag;
4265
674
  if (elem.style.color !== flag) {
4266
- import_globals.document.body.removeChild(elem);
675
+ import_globals4.document.body.removeChild(elem);
4267
676
  return;
4268
677
  }
4269
678
  elem.style.color = color;
4270
679
  if (elem.style.color === flag || elem.style.color === "") {
4271
- import_globals.document.body.removeChild(elem);
680
+ import_globals4.document.body.removeChild(elem);
4272
681
  return [0, 0, 0, 0];
4273
682
  }
4274
- color = import_globals.window.getComputedStyle(elem).color;
4275
- import_globals.document.body.removeChild(elem);
683
+ color = import_globals4.window.getComputedStyle(elem).color;
684
+ import_globals4.document.body.removeChild(elem);
4276
685
  }
4277
686
  }
4278
687
  if (color.indexOf("rgb") === 0) {
@@ -4371,11 +780,11 @@ var opacify = (color, opacity) => {
4371
780
  return `rgba(${arr})`;
4372
781
  };
4373
782
  var getRgbTone = (rgb, tone) => {
4374
- if ((0, import_utils.isString)(rgb) && rgb.includes("rgb"))
783
+ if (isString(rgb) && rgb.includes("rgb"))
4375
784
  rgb = colorStringToRgbaArray(rgb).join(", ");
4376
- if ((0, import_utils.isString)(rgb))
785
+ if (isString(rgb))
4377
786
  rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
4378
- if ((0, import_utils.isNumber)(tone))
787
+ if (isNumber(tone))
4379
788
  tone += "";
4380
789
  const toHex = rgbArrayToHex(rgb);
4381
790
  const abs = tone.slice(0, 1);
@@ -4444,11 +853,7 @@ var getFontFaceString = (LIBRARY) => {
4444
853
  };
4445
854
 
4446
855
  // src/utils/sequence.js
4447
- var import_utils3 = __toESM(require_cjs2(), 1);
4448
- var import_utils4 = __toESM(require_cjs3(), 1);
4449
-
4450
- // src/factory.js
4451
- var import_utils2 = __toESM(require_cjs2(), 1);
856
+ var import_utils4 = __toESM(require_cjs2(), 1);
4452
857
 
4453
858
  // src/defaultConfig/index.js
4454
859
  var defaultConfig_exports = {};
@@ -4662,13 +1067,13 @@ var CONFIG = {
4662
1067
  CSS_VARS,
4663
1068
  ...void 0 || defaultConfig_exports
4664
1069
  };
4665
- var cachedConfig = (0, import_utils2.deepClone)(CONFIG);
1070
+ var cachedConfig = deepClone(CONFIG);
4666
1071
  var FACTORY = {
4667
1072
  active: "0",
4668
1073
  0: CONFIG
4669
1074
  };
4670
1075
  var activateConfig = (def) => {
4671
- if ((0, import_utils2.isDefined)(def)) {
1076
+ if (isDefined(def)) {
4672
1077
  FACTORY.active = def;
4673
1078
  }
4674
1079
  return FACTORY[def || FACTORY.active];
@@ -4677,10 +1082,10 @@ var getActiveConfig = (def) => {
4677
1082
  return FACTORY[def || FACTORY.active] || CONFIG;
4678
1083
  };
4679
1084
  var setActiveConfig = (newConfig) => {
4680
- if (!(0, import_utils2.isObject)(newConfig))
1085
+ if (!isObject(newConfig))
4681
1086
  return;
4682
1087
  FACTORY.active = "1";
4683
- FACTORY["1"] = (0, import_utils2.deepMerge)(newConfig, (0, import_utils2.deepClone)(cachedConfig));
1088
+ FACTORY["1"] = deepMerge(newConfig, deepClone(cachedConfig));
4684
1089
  return newConfig;
4685
1090
  };
4686
1091
 
@@ -4826,7 +1231,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
4826
1231
  unit = UNIT2.default,
4827
1232
  useVariable
4828
1233
  } = sequenceProps;
4829
- if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
1234
+ if (isString(value) && value.slice(0, 2) === "--")
4830
1235
  return `var(${value})`;
4831
1236
  const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
4832
1237
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
@@ -4893,11 +1298,10 @@ var findHeadings = (propertyNames) => {
4893
1298
  };
4894
1299
 
4895
1300
  // src/utils/var.js
4896
- var import_utils5 = __toESM(require_cjs2(), 1);
4897
1301
  var setVariables = (result, key) => {
4898
1302
  const CONFIG2 = getActiveConfig();
4899
1303
  const { CSS_VARS: CSS_VARS2 } = CONFIG2;
4900
- if ((0, import_utils5.isObjectLike)(result.value)) {
1304
+ if (isObjectLike(result.value)) {
4901
1305
  } else {
4902
1306
  CSS_VARS2[result.var] = result.value;
4903
1307
  }
@@ -4972,7 +1376,6 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
4972
1376
  };
4973
1377
 
4974
1378
  // src/utils/sprite.js
4975
- var import_utils6 = __toESM(require_cjs2(), 1);
4976
1379
  var generateSprite = (icons) => {
4977
1380
  const CONFIG2 = getActiveConfig();
4978
1381
  let sprite = "";
@@ -4987,7 +1390,7 @@ var generateSprite = (icons) => {
4987
1390
  };
4988
1391
  var parseRootAttributes = (htmlString) => {
4989
1392
  const val = htmlString.default || htmlString;
4990
- if (!(0, import_utils6.isString)(val)) {
1393
+ if (!isString(val)) {
4991
1394
  return console.warn(`parseRootAttributes: ${val} is not a string`);
4992
1395
  }
4993
1396
  const match = val.match(/<svg\s+(.*?)>/);
@@ -5007,7 +1410,7 @@ var replaceIdsAndUrls = (code, key) => {
5007
1410
  const urlRegex = /url\(#([^)]*)\)/g;
5008
1411
  const matches = code.match(/id="([^"]*)"/g);
5009
1412
  let replacedCode = code;
5010
- if ((0, import_utils6.isArray)(matches)) {
1413
+ if (isArray(matches)) {
5011
1414
  matches.forEach(() => {
5012
1415
  const randomKey = Math.floor(Math.random() * 1e5);
5013
1416
  replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
@@ -5066,10 +1469,9 @@ __export(system_exports, {
5066
1469
  });
5067
1470
 
5068
1471
  // src/system/color.js
5069
- var import_utils7 = __toESM(require_cjs2(), 1);
5070
1472
  var getColor = (value, key, config) => {
5071
1473
  const CONFIG2 = config || getActiveConfig();
5072
- if (!(0, import_utils7.isString)(value)) {
1474
+ if (!isString(value)) {
5073
1475
  if (CONFIG2.verbose)
5074
1476
  console.warn(value, "- type for color is not valid");
5075
1477
  return;
@@ -5078,7 +1480,7 @@ var getColor = (value, key, config) => {
5078
1480
  return `var(${value})`;
5079
1481
  if (key && value[key])
5080
1482
  value = value[key];
5081
- const [name, alpha, tone] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
1483
+ const [name, alpha, tone] = isArray(value) ? value : value.split(" ");
5082
1484
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
5083
1485
  let val = COLOR2[name] || GRADIENT2[name];
5084
1486
  if (!val) {
@@ -5110,17 +1512,17 @@ var getMediaColor = (value, globalTheme, config) => {
5110
1512
  const CONFIG2 = config || getActiveConfig();
5111
1513
  if (!globalTheme)
5112
1514
  globalTheme = CONFIG2.globalTheme;
5113
- if (!(0, import_utils7.isString)(value)) {
1515
+ if (!isString(value)) {
5114
1516
  if (CONFIG2.verbose)
5115
1517
  console.warn(value, "- type for color is not valid");
5116
1518
  return;
5117
1519
  }
5118
1520
  if (value.slice(0, 2) === "--")
5119
1521
  return `var(${value})`;
5120
- const [name] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
1522
+ const [name] = isArray(value) ? value : value.split(" ");
5121
1523
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
5122
1524
  const val = COLOR2[name] || GRADIENT2[name];
5123
- const isObj = (0, import_utils7.isObject)(val);
1525
+ const isObj = isObject(val);
5124
1526
  if (isObj && val.value)
5125
1527
  return getColor(value, `@${globalTheme}`, config);
5126
1528
  else if (isObj) {
@@ -5143,7 +1545,7 @@ var getMediaColor = (value, globalTheme, config) => {
5143
1545
  };
5144
1546
  var setColor = (val, key, suffix) => {
5145
1547
  const CONFIG2 = getActiveConfig();
5146
- if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--") {
1548
+ if (isString(val) && val.slice(0, 2) === "--") {
5147
1549
  val = getColor(val.slice(2));
5148
1550
  if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
5149
1551
  if (CONFIG2.verbose)
@@ -5151,13 +1553,13 @@ var setColor = (val, key, suffix) => {
5151
1553
  val = val.split(" ")[0];
5152
1554
  }
5153
1555
  }
5154
- if ((0, import_utils7.isArray)(val)) {
1556
+ if (isArray(val)) {
5155
1557
  return {
5156
1558
  "@light": setColor(val[0], key, "light"),
5157
1559
  "@dark": setColor(val[1], key, "dark")
5158
1560
  };
5159
1561
  }
5160
- if ((0, import_utils7.isObject)(val)) {
1562
+ if (isObject(val)) {
5161
1563
  const obj = {};
5162
1564
  for (const variant in val) {
5163
1565
  obj[variant] = setColor(
@@ -5186,15 +1588,15 @@ var setColor = (val, key, suffix) => {
5186
1588
  };
5187
1589
  var setGradient = (val, key, suffix) => {
5188
1590
  const CONFIG2 = getActiveConfig();
5189
- if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--")
1591
+ if (isString(val) && val.slice(0, 2) === "--")
5190
1592
  val = getColor(val.slice(2));
5191
- if ((0, import_utils7.isArray)(val)) {
1593
+ if (isArray(val)) {
5192
1594
  return {
5193
1595
  "@light": setGradient(val[0], key, "light"),
5194
1596
  "@dark": setGradient(val[0], key, "dark")
5195
1597
  };
5196
1598
  }
5197
- if ((0, import_utils7.isObject)(val)) {
1599
+ if (isObject(val)) {
5198
1600
  const obj = {};
5199
1601
  for (const variant in val)
5200
1602
  obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -5211,7 +1613,6 @@ var setGradient = (val, key, suffix) => {
5211
1613
  };
5212
1614
 
5213
1615
  // src/system/theme.js
5214
- var import_utils9 = __toESM(require_cjs2(), 1);
5215
1616
  var setThemeValue = (theme) => {
5216
1617
  const value = {};
5217
1618
  const { state, media, helpers, ...rest } = theme;
@@ -5234,7 +1635,7 @@ var getTheme = (value, modifier) => {
5234
1635
  if (CONFIG2.useVariable)
5235
1636
  return getMediaTheme(value, modifier);
5236
1637
  const { THEME: THEME2 } = CONFIG2;
5237
- if ((0, import_utils9.isString)(value)) {
1638
+ if (isString(value)) {
5238
1639
  const [theme, subtheme] = value.split(" ");
5239
1640
  const isOurTheme = THEME2[theme];
5240
1641
  if (isOurTheme) {
@@ -5243,7 +1644,7 @@ var getTheme = (value, modifier) => {
5243
1644
  value = [theme, subtheme || modifier];
5244
1645
  }
5245
1646
  }
5246
- if ((0, import_utils9.isObjectLike)(value) && value[1]) {
1647
+ if (isObjectLike(value) && value[1]) {
5247
1648
  const themeName = value[0];
5248
1649
  const subThemeName = value[1];
5249
1650
  const { helpers, media, state } = THEME2[themeName];
@@ -5253,11 +1654,11 @@ var getTheme = (value, modifier) => {
5253
1654
  return getThemeValue(helpers[subThemeName]);
5254
1655
  if (state && state[subThemeName])
5255
1656
  return getThemeValue(state[subThemeName]);
5256
- } else if ((0, import_utils9.isObject)(value))
1657
+ } else if (isObject(value))
5257
1658
  return setThemeValue(value);
5258
1659
  };
5259
1660
  var setInverseTheme = (theme, variant, value) => {
5260
- if ((0, import_utils9.isObject)(variant)) {
1661
+ if (isObject(variant)) {
5261
1662
  theme.variants.inverse.value = setThemeValue(variant);
5262
1663
  } else if (variant === true) {
5263
1664
  const { color, background } = value;
@@ -5272,7 +1673,7 @@ var setInverseTheme = (theme, variant, value) => {
5272
1673
  var setPseudo = (theme, key, variant, themeValue) => {
5273
1674
  const result = getTheme(variant);
5274
1675
  themeValue[`&:${key}`] = result;
5275
- if ((0, import_utils9.isObject)(variant) && !variant.value)
1676
+ if (isObject(variant) && !variant.value)
5276
1677
  variant.value = result;
5277
1678
  };
5278
1679
  var setSelectors = (theme, value) => {
@@ -5290,7 +1691,7 @@ var setSelectors = (theme, value) => {
5290
1691
  var setPrefersScheme = (theme, key, variant, themeValue) => {
5291
1692
  const result = getTheme(variant);
5292
1693
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
5293
- if ((0, import_utils9.isObject)(variant) && !variant.value)
1694
+ if (isObject(variant) && !variant.value)
5294
1695
  variant.value = result;
5295
1696
  };
5296
1697
  var setMedia = (theme, value) => {
@@ -5316,7 +1717,7 @@ var setHelpers = (theme, value) => {
5316
1717
  const keys = Object.keys(helpers);
5317
1718
  keys.map((key) => {
5318
1719
  const helper = helpers[key];
5319
- if ((0, import_utils9.isString)(helper))
1720
+ if (isString(helper))
5320
1721
  helpers[key] = CONFIG2.THEME[helper];
5321
1722
  else
5322
1723
  getThemeValue(helpers[key]);
@@ -5340,7 +1741,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
5340
1741
  const CONFIG2 = getActiveConfig();
5341
1742
  const { CSS_VARS: CSS_VARS2 } = CONFIG2;
5342
1743
  const theme = { value: val };
5343
- if ((0, import_utils9.isObjectLike)(val)) {
1744
+ if (isObjectLike(val)) {
5344
1745
  for (const param in val) {
5345
1746
  const symb = param.slice(0, 1);
5346
1747
  const value = val[param];
@@ -5368,7 +1769,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
5368
1769
  };
5369
1770
  }
5370
1771
  }
5371
- if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--") {
1772
+ if (isString(val) && val.slice(0, 2) === "--") {
5372
1773
  const { THEME: THEME2 } = CONFIG2;
5373
1774
  const value = THEME2[val.slice(2)];
5374
1775
  const getReferenced = getMediaTheme(value, prefers);
@@ -5381,7 +1782,7 @@ var recursiveTheme = (val) => {
5381
1782
  const obj = {};
5382
1783
  for (const param in val) {
5383
1784
  const symb = param.slice(0, 1);
5384
- if ((0, import_utils9.isObjectLike)(val[param])) {
1785
+ if (isObjectLike(val[param])) {
5385
1786
  if (symb === "@") {
5386
1787
  const query = CONFIG2.MEDIA[param.slice(1)];
5387
1788
  const media = "@media " + (query === "print" ? `${query}` : `screen and ${query}`);
@@ -5401,25 +1802,25 @@ var findModifierFromArray = (val, modifierArray) => {
5401
1802
  return val;
5402
1803
  };
5403
1804
  var findModifier = (val, modifier) => {
5404
- if ((0, import_utils9.isArray)(modifier))
1805
+ if (isArray(modifier))
5405
1806
  return findModifierFromArray(val, modifier);
5406
- else if ((0, import_utils9.isString)(modifier) && val[modifier])
1807
+ else if (isString(modifier) && val[modifier])
5407
1808
  return val[modifier];
5408
1809
  else
5409
1810
  return val;
5410
1811
  };
5411
1812
  var getMediaTheme = (value, modifier) => {
5412
1813
  const activeConfig = getActiveConfig();
5413
- if ((0, import_utils9.isString)(value) && value.slice(0, 2) === "--") {
1814
+ if (isString(value) && value.slice(0, 2) === "--") {
5414
1815
  value = getMediaTheme(value.slice(2));
5415
1816
  }
5416
- if (!value || !(0, import_utils9.isString)(value)) {
1817
+ if (!value || !isString(value)) {
5417
1818
  if (activeConfig.verbose) {
5418
1819
  console.warn(`${value} - Theme is not a string`);
5419
1820
  }
5420
1821
  return;
5421
1822
  }
5422
- const [themeName, ...themeModifiers] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
1823
+ const [themeName, ...themeModifiers] = isArray(value) ? value : value.split(" ");
5423
1824
  let themeValue = activeConfig.THEME[themeName];
5424
1825
  if (themeValue && (themeModifiers || modifier)) {
5425
1826
  themeValue = findModifier(themeValue, themeModifiers.length ? themeModifiers : modifier);
@@ -5429,11 +1830,10 @@ var getMediaTheme = (value, modifier) => {
5429
1830
  };
5430
1831
 
5431
1832
  // src/system/font.js
5432
- var import_utils10 = __toESM(require_cjs2(), 1);
5433
- var import_utils11 = __toESM(require_cjs3(), 1);
1833
+ var import_utils11 = __toESM(require_cjs2(), 1);
5434
1834
  var setFont = (val, key) => {
5435
1835
  const CSSvar = `--font-${key}`;
5436
- if (!val || (0, import_utils10.isArray)(val) && !val[0])
1836
+ if (!val || isArray(val) && !val[0])
5437
1837
  return;
5438
1838
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
5439
1839
  return { var: CSSvar, value: val, fontFace };
@@ -5449,7 +1849,7 @@ var setFontFamily = (val, key) => {
5449
1849
  let { value, type } = val;
5450
1850
  if (val.isDefault)
5451
1851
  FONT_FAMILY2.default = key;
5452
- if ((0, import_utils10.isObject)(value))
1852
+ if (isObject(value))
5453
1853
  value = (0, import_utils11.arrayzeValue)(value);
5454
1854
  const CSSvar = `--font-family-${key}`;
5455
1855
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
@@ -5457,7 +1857,6 @@ var setFontFamily = (val, key) => {
5457
1857
  };
5458
1858
 
5459
1859
  // src/system/typography.js
5460
- var import_utils13 = __toESM(require_cjs2(), 1);
5461
1860
  var runThroughMedia = (FACTORY2) => {
5462
1861
  const CONFIG2 = getActiveConfig();
5463
1862
  const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
@@ -5477,7 +1876,7 @@ var runThroughMedia = (FACTORY2) => {
5477
1876
  h1Matches,
5478
1877
  unit
5479
1878
  } = FACTORY2;
5480
- (0, import_utils13.merge)(mediaValue, {
1879
+ merge(mediaValue, {
5481
1880
  type,
5482
1881
  base,
5483
1882
  ratio,
@@ -5495,7 +1894,7 @@ var runThroughMedia = (FACTORY2) => {
5495
1894
  applyMediaSequenceVars(FACTORY2, prop);
5496
1895
  continue;
5497
1896
  }
5498
- (0, import_utils13.merge)(mediaValue, {
1897
+ merge(mediaValue, {
5499
1898
  sequence: {},
5500
1899
  scales: {},
5501
1900
  templates: {},
@@ -5543,8 +1942,7 @@ var getFontSizeByKey = (value) => {
5543
1942
  };
5544
1943
 
5545
1944
  // src/system/spacing.js
5546
- var import_utils15 = __toESM(require_cjs3(), 1);
5547
- var import_utils16 = __toESM(require_cjs2(), 1);
1945
+ var import_utils15 = __toESM(require_cjs2(), 1);
5548
1946
  var runThroughMedia2 = (FACTORY2) => {
5549
1947
  for (const prop in FACTORY2) {
5550
1948
  const mediaProps = FACTORY2[prop];
@@ -5560,7 +1958,7 @@ var runThroughMedia2 = (FACTORY2) => {
5560
1958
  h1Matches,
5561
1959
  unit
5562
1960
  } = FACTORY2;
5563
- (0, import_utils16.merge)(mediaProps, {
1961
+ merge(mediaProps, {
5564
1962
  type,
5565
1963
  base,
5566
1964
  ratio,
@@ -5594,11 +1992,11 @@ var getSequence = (sequenceProps) => {
5594
1992
  };
5595
1993
  var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
5596
1994
  const sequence = getSequence(sequenceProps);
5597
- if ((0, import_utils16.isString)(value) && (value.includes("calc") || value.includes("var"))) {
1995
+ if (isString(value) && (value.includes("calc") || value.includes("var"))) {
5598
1996
  return { [propertyName]: value };
5599
1997
  }
5600
1998
  const stack = (0, import_utils15.arrayzeValue)(value);
5601
- if (!(0, import_utils16.isArray)(stack))
1999
+ if (!isArray(stack))
5602
2000
  return;
5603
2001
  if (stack.length > 1) {
5604
2002
  let suffix = "";
@@ -5633,7 +2031,7 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
5633
2031
  let sequenceProps = SPACING2[spacingRatio];
5634
2032
  if (!sequenceProps) {
5635
2033
  const { type, base, range, subSequence } = SPACING2;
5636
- sequenceProps = SPACING2[spacingRatio] = (0, import_utils16.merge)({
2034
+ sequenceProps = SPACING2[spacingRatio] = merge({
5637
2035
  ratio: spacingRatio,
5638
2036
  type: type + "-" + spacingRatio,
5639
2037
  unit,
@@ -5656,16 +2054,15 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
5656
2054
  };
5657
2055
 
5658
2056
  // src/system/shadow.js
5659
- var import_utils18 = __toESM(require_cjs2(), 1);
5660
2057
  var setShadow = (value, key, suffix, prefers) => {
5661
2058
  const CONFIG2 = getActiveConfig();
5662
- if ((0, import_utils18.isArray)(value)) {
2059
+ if (isArray(value)) {
5663
2060
  return {
5664
2061
  "@light": setShadow(value[0], key, "light"),
5665
2062
  "@dark": setShadow(value[1], key, "dark")
5666
2063
  };
5667
2064
  }
5668
- if ((0, import_utils18.isObject)(value)) {
2065
+ if (isObject(value)) {
5669
2066
  const obj = {};
5670
2067
  for (const variant in value) {
5671
2068
  obj[variant] = setShadow(
@@ -5676,7 +2073,7 @@ var setShadow = (value, key, suffix, prefers) => {
5676
2073
  }
5677
2074
  return obj;
5678
2075
  }
5679
- if ((0, import_utils18.isString)(value) && value.includes(",")) {
2076
+ if (isString(value) && value.includes(",")) {
5680
2077
  value = value.split(",").map((v) => {
5681
2078
  v = v.trim();
5682
2079
  if (v.startsWith("--"))
@@ -5704,17 +2101,17 @@ var getShadow = (value, globalTheme) => {
5704
2101
  const CONFIG2 = getActiveConfig();
5705
2102
  if (!globalTheme)
5706
2103
  globalTheme = CONFIG2.globalTheme;
5707
- if (!(0, import_utils18.isString)(value)) {
2104
+ if (!isString(value)) {
5708
2105
  if (CONFIG2.verbose)
5709
2106
  console.warn(value, "- type for color is not valid");
5710
2107
  return;
5711
2108
  }
5712
2109
  if (value.slice(0, 2) === "--")
5713
2110
  return `var(${value})`;
5714
- const [name] = (0, import_utils18.isArray)(value) ? value : value.split(" ");
2111
+ const [name] = isArray(value) ? value : value.split(" ");
5715
2112
  const { SHADOW: SHADOW2 } = CONFIG2;
5716
2113
  const val = SHADOW2[name];
5717
- const isObj = (0, import_utils18.isObject)(val);
2114
+ const isObj = isObject(val);
5718
2115
  if (!val) {
5719
2116
  if (CONFIG2.verbose)
5720
2117
  console.warn("Can't find color ", name);
@@ -5743,7 +2140,7 @@ var getShadow = (value, globalTheme) => {
5743
2140
  };
5744
2141
 
5745
2142
  // src/system/timing.js
5746
- var import_utils19 = __toESM(require_cjs3(), 1);
2143
+ var import_utils19 = __toESM(require_cjs2(), 1);
5747
2144
  var applyTimingSequence = () => {
5748
2145
  const CONFIG2 = getActiveConfig();
5749
2146
  const { TIMING: TIMING2 } = CONFIG2;
@@ -5766,11 +2163,10 @@ var getTimingByKey = (value, property = "timing") => {
5766
2163
  };
5767
2164
 
5768
2165
  // src/system/document.js
5769
- var import_utils21 = __toESM(require_cjs2(), 1);
5770
2166
  var applyDocument = () => {
5771
2167
  const CONFIG2 = getActiveConfig();
5772
2168
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
5773
- return (0, import_utils21.merge)(DOCUMENT2, {
2169
+ return merge(DOCUMENT2, {
5774
2170
  theme: THEME2.document,
5775
2171
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
5776
2172
  fontSize: TYPOGRAPHY2.base,
@@ -5779,9 +2175,9 @@ var applyDocument = () => {
5779
2175
  };
5780
2176
 
5781
2177
  // src/system/svg.js
5782
- var import_globals2 = __toESM(require_cjs(), 1);
2178
+ var import_globals5 = __toESM(require_cjs(), 1);
5783
2179
  var DEF_OPTIONS = {
5784
- document: import_globals2.document
2180
+ document: import_globals5.document
5785
2181
  };
5786
2182
  var setSVG = (val, key) => {
5787
2183
  const CONFIG2 = getActiveConfig();
@@ -5818,9 +2214,9 @@ var appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
5818
2214
  appendSVG(lib, options);
5819
2215
  };
5820
2216
  var createSVGSpriteElement = (options = { isRoot: true }) => {
5821
- if (!import_globals2.document || !import_globals2.document.createElementNS)
2217
+ if (!import_globals5.document || !import_globals5.document.createElementNS)
5822
2218
  return;
5823
- const svgElem = import_globals2.document.createElementNS("http://www.w3.org/2000/svg", "svg");
2219
+ const svgElem = import_globals5.document.createElementNS("http://www.w3.org/2000/svg", "svg");
5824
2220
  if (options.isRoot) {
5825
2221
  svgElem.setAttribute("aria-hidden", "true");
5826
2222
  svgElem.setAttribute("width", "0");
@@ -5832,7 +2228,7 @@ var createSVGSpriteElement = (options = { isRoot: true }) => {
5832
2228
  };
5833
2229
  var appendSVG = (lib, options = DEF_OPTIONS) => {
5834
2230
  const CONFIG2 = getActiveConfig();
5835
- const doc = options.document || import_globals2.document;
2231
+ const doc = options.document || import_globals5.document;
5836
2232
  if (!doc || !doc.documentElement) {
5837
2233
  if (CONFIG2.verbose) {
5838
2234
  console.warn("To append SVG sprites it should be run in browser environment");
@@ -5855,7 +2251,6 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
5855
2251
  };
5856
2252
 
5857
2253
  // src/system/reset.js
5858
- var import_utils24 = __toESM(require_cjs2(), 1);
5859
2254
  var applyReset = (reset = {}) => {
5860
2255
  const CONFIG2 = getActiveConfig();
5861
2256
  const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
@@ -5877,8 +2272,8 @@ var applyReset = (reset = {}) => {
5877
2272
  const { body, ...templates } = TYPOGRAPHY2.templates;
5878
2273
  const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
5879
2274
  if (RESET2.html)
5880
- (0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
5881
- return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
2275
+ overwriteDeep(RESET2.html, globalTheme);
2276
+ return deepMerge(merge(RESET2, reset), {
5882
2277
  html: {
5883
2278
  position: "absolute",
5884
2279
  // overflow: 'hidden',
@@ -5917,7 +2312,6 @@ var applyReset = (reset = {}) => {
5917
2312
  };
5918
2313
 
5919
2314
  // src/transforms/index.js
5920
- var import_utils25 = __toESM(require_cjs2(), 1);
5921
2315
  var isBorderStyle = (str) => [
5922
2316
  "none",
5923
2317
  "hidden",
@@ -5965,7 +2359,7 @@ var transformBoxShadow = (shadows, globalTheme) => shadows.split("|").map((shado
5965
2359
  return `var(${v})`;
5966
2360
  if (getColor(v).length > 2) {
5967
2361
  const color = getMediaColor(v, globalTheme);
5968
- if ((0, import_utils25.isObject)(color))
2362
+ if (isObject(color))
5969
2363
  return Object.values(color).filter((v2) => v2.includes(": " + globalTheme))[0];
5970
2364
  return color;
5971
2365
  }
@@ -5993,7 +2387,7 @@ var transformBackgroundImage = (backgroundImage, globalTheme) => {
5993
2387
  return v;
5994
2388
  }).join(" ");
5995
2389
  };
5996
- var transfromGap = (gap) => (0, import_utils25.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey(v, "gap").gap).join(" ");
2390
+ var transfromGap = (gap) => isString(gap) && gap.split(" ").map((v) => getSpacingByKey(v, "gap").gap).join(" ");
5997
2391
  var transformTransition = (transition) => {
5998
2392
  const arr = transition.split(" ");
5999
2393
  if (!arr.length)
@@ -6011,7 +2405,7 @@ var transformTransition = (transition) => {
6011
2405
  }).join(" ");
6012
2406
  };
6013
2407
  var transformDuration = (duration, props, propertyName) => {
6014
- if (!(0, import_utils25.isString)(duration))
2408
+ if (!isString(duration))
6015
2409
  return;
6016
2410
  return duration.split(",").map((v) => getTimingByKey(v).timing || v).join(",");
6017
2411
  };
@@ -6027,11 +2421,11 @@ var checkIfBoxSize = (propertyName) => {
6027
2421
  };
6028
2422
  var transformSize = (propertyName, val, props = {}, opts = {}) => {
6029
2423
  let value = val || props[propertyName];
6030
- if ((0, import_utils25.isUndefined)(value) && (0, import_utils25.isNull)(value))
2424
+ if (isUndefined(value) && isNull(value))
6031
2425
  return;
6032
2426
  const shouldScaleBoxSize = props.scaleBoxSize;
6033
2427
  const isBoxSize = checkIfBoxSize(propertyName);
6034
- if (!shouldScaleBoxSize && isBoxSize && (0, import_utils25.isString)(value)) {
2428
+ if (!shouldScaleBoxSize && isBoxSize && isString(value)) {
6035
2429
  value = value.split(" ").map((v) => {
6036
2430
  const isSingleLetter = v.length < 3 && /[A-Z]/.test(v);
6037
2431
  const hasUnits = ["%", "vw", "vh", "ch"].some((unit) => value.includes(unit));
@@ -6053,9 +2447,8 @@ var transformSizeRatio = (propertyName, props) => {
6053
2447
  };
6054
2448
 
6055
2449
  // src/set.js
6056
- var import_utils26 = __toESM(require_cjs2(), 1);
6057
2450
  var setCases = (val, key) => {
6058
- if ((0, import_utils26.isFunction)(val))
2451
+ if (isFunction(val))
6059
2452
  return val();
6060
2453
  return val;
6061
2454
  };