@symbo.ls/scratch 2.11.221 → 2.11.224

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.
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // ../../node_modules/@domql/utils/dist/cjs/key.js
33
+ // ../../../domql/packages/utils/dist/cjs/key.js
34
34
  var require_key = __commonJS({
35
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
35
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
36
36
  "use strict";
37
37
  var __defProp2 = Object.defineProperty;
38
38
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -69,9 +69,9 @@ var require_key = __commonJS({
69
69
  }
70
70
  });
71
71
 
72
- // ../../node_modules/@domql/utils/dist/cjs/env.js
72
+ // ../../../domql/packages/utils/dist/cjs/env.js
73
73
  var require_env = __commonJS({
74
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
74
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
75
75
  "use strict";
76
76
  var __defProp2 = Object.defineProperty;
77
77
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -107,9 +107,9 @@ var require_env = __commonJS({
107
107
  }
108
108
  });
109
109
 
110
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
110
+ // ../../../domql/packages/utils/dist/cjs/globals.js
111
111
  var require_globals = __commonJS({
112
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
112
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
113
113
  "use strict";
114
114
  var __defProp2 = Object.defineProperty;
115
115
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -143,9 +143,9 @@ var require_globals = __commonJS({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/@domql/utils/dist/cjs/node.js
146
+ // ../../../domql/packages/utils/dist/cjs/node.js
147
147
  var require_node = __commonJS({
148
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
148
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
149
149
  "use strict";
150
150
  var __defProp2 = Object.defineProperty;
151
151
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -180,9 +180,9 @@ var require_node = __commonJS({
180
180
  }
181
181
  });
182
182
 
183
- // ../../node_modules/@domql/utils/dist/cjs/types.js
183
+ // ../../../domql/packages/utils/dist/cjs/types.js
184
184
  var require_types = __commonJS({
185
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
185
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
186
186
  "use strict";
187
187
  var __defProp2 = Object.defineProperty;
188
188
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -207,6 +207,7 @@ var require_types = __commonJS({
207
207
  is: () => is,
208
208
  isArray: () => isArray,
209
209
  isBoolean: () => isBoolean,
210
+ isDate: () => isDate,
210
211
  isDefined: () => isDefined2,
211
212
  isFunction: () => isFunction,
212
213
  isNot: () => isNot,
@@ -230,13 +231,14 @@ var require_types = __commonJS({
230
231
  var isBoolean = (arg) => arg === true || arg === false;
231
232
  var isNull = (arg) => arg === null;
232
233
  var isArray = (arg) => Array.isArray(arg);
234
+ var isDate = (d) => d instanceof Date;
233
235
  var isObjectLike = (arg) => {
234
236
  if (arg === null)
235
237
  return false;
236
238
  return typeof arg === "object";
237
239
  };
238
240
  var isDefined2 = (arg) => {
239
- return isObject2(arg) || isObjectLike(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike(arg) || isBoolean(arg) || isNull(arg);
241
+ return isObject2(arg) || isObjectLike(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
240
242
  };
241
243
  var isUndefined = (arg) => {
242
244
  return arg === void 0;
@@ -246,6 +248,7 @@ var require_types = __commonJS({
246
248
  array: isArray,
247
249
  object: isObject2,
248
250
  string: isString,
251
+ date: isDate,
249
252
  number: isNumber,
250
253
  null: isNull,
251
254
  function: isFunction,
@@ -267,9 +270,9 @@ var require_types = __commonJS({
267
270
  }
268
271
  });
269
272
 
270
- // ../../node_modules/@domql/utils/dist/cjs/array.js
273
+ // ../../../domql/packages/utils/dist/cjs/array.js
271
274
  var require_array = __commonJS({
272
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
275
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
273
276
  "use strict";
274
277
  var __defProp2 = Object.defineProperty;
275
278
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -298,6 +301,8 @@ var require_array = __commonJS({
298
301
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
299
302
  mergeArray: () => mergeArray,
300
303
  removeFromArray: () => removeFromArray,
304
+ removeValueFromArray: () => removeValueFromArray,
305
+ removeValueFromArrayAll: () => removeValueFromArrayAll,
301
306
  swapItemsInArray: () => swapItemsInArray
302
307
  });
303
308
  module2.exports = __toCommonJS2(array_exports);
@@ -363,12 +368,24 @@ var require_array = __commonJS({
363
368
  }, nestedObject);
364
369
  return nestedObject;
365
370
  };
371
+ var removeValueFromArray = (arr, value) => {
372
+ const index = arr.indexOf(value);
373
+ if (index > -1) {
374
+ const newArray = [...arr];
375
+ newArray.splice(index, 1);
376
+ return newArray;
377
+ }
378
+ return arr.slice();
379
+ };
380
+ var removeValueFromArrayAll = (arr, value) => {
381
+ return arr.filter((item) => item !== value);
382
+ };
366
383
  }
367
384
  });
368
385
 
369
- // ../../node_modules/@domql/utils/dist/cjs/string.js
386
+ // ../../../domql/packages/utils/dist/cjs/string.js
370
387
  var require_string = __commonJS({
371
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
388
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
372
389
  "use strict";
373
390
  var __defProp2 = Object.defineProperty;
374
391
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -426,9 +443,9 @@ var require_string = __commonJS({
426
443
  }
427
444
  });
428
445
 
429
- // ../../node_modules/@domql/utils/dist/cjs/object.js
446
+ // ../../../domql/packages/utils/dist/cjs/object.js
430
447
  var require_object = __commonJS({
431
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
448
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
432
449
  "use strict";
433
450
  var __defProp2 = Object.defineProperty;
434
451
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -454,6 +471,7 @@ var require_object = __commonJS({
454
471
  deepCloneExclude: () => deepCloneExclude,
455
472
  deepContains: () => deepContains,
456
473
  deepDestringify: () => deepDestringify,
474
+ deepDiff: () => deepDiff,
457
475
  deepMerge: () => deepMerge2,
458
476
  deepStringify: () => deepStringify,
459
477
  detachFunctionsFromObject: () => detachFunctionsFromObject,
@@ -462,7 +480,11 @@ var require_object = __commonJS({
462
480
  diffObjects: () => diffObjects,
463
481
  exec: () => exec,
464
482
  flattenRecursive: () => flattenRecursive,
483
+ hasOwnProperty: () => hasOwnProperty,
484
+ isEmpty: () => isEmpty,
485
+ isEmptyObject: () => isEmptyObject,
465
486
  isEqualDeep: () => isEqualDeep,
487
+ makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
466
488
  map: () => map,
467
489
  merge: () => merge,
468
490
  mergeArrayExclude: () => mergeArrayExclude,
@@ -496,8 +518,8 @@ var require_object = __commonJS({
496
518
  };
497
519
  var merge = (element, obj, excludeFrom = []) => {
498
520
  for (const e in obj) {
499
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
500
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
521
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
522
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
501
523
  continue;
502
524
  const elementProp = element[e];
503
525
  const objProp = obj[e];
@@ -509,8 +531,8 @@ var require_object = __commonJS({
509
531
  };
510
532
  var deepMerge2 = (element, extend, excludeFrom = []) => {
511
533
  for (const e in extend) {
512
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
513
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
534
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
535
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
514
536
  continue;
515
537
  const elementProp = element[e];
516
538
  const extendProp = extend[e];
@@ -525,8 +547,8 @@ var require_object = __commonJS({
525
547
  var clone = (obj, excludeFrom = []) => {
526
548
  const o = {};
527
549
  for (const prop in obj) {
528
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
529
- if (!hasOwnProperty || excludeFrom.includes(prop) || prop.startsWith("__"))
550
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
551
+ if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
530
552
  continue;
531
553
  o[prop] = obj[prop];
532
554
  }
@@ -538,8 +560,8 @@ var require_object = __commonJS({
538
560
  }
539
561
  const o = {};
540
562
  for (const k in obj) {
541
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, k);
542
- if (!hasOwnProperty || excludeFrom.includes(k) || k.startsWith("__"))
563
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
564
+ if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
543
565
  continue;
544
566
  let v = obj[k];
545
567
  if (k === "extend" && (0, import_types.isArray)(v)) {
@@ -557,7 +579,7 @@ var require_object = __commonJS({
557
579
  var mergeArrayExclude = (arr, excl = []) => {
558
580
  return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
559
581
  };
560
- var deepClone2 = (obj, excludeFrom = []) => {
582
+ var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
561
583
  const o = (0, import_types.isArray)(obj) ? [] : {};
562
584
  for (const prop in obj) {
563
585
  if (prop === "__proto__")
@@ -565,11 +587,13 @@ var require_object = __commonJS({
565
587
  if (excludeFrom.includes(prop) || prop.startsWith("__"))
566
588
  continue;
567
589
  let objProp = obj[prop];
590
+ if (cleanUndefined && (0, import_types.isUndefined)(objProp))
591
+ continue;
568
592
  if (prop === "extend" && (0, import_types.isArray)(objProp)) {
569
593
  objProp = (0, import_array.mergeArray)(objProp);
570
594
  }
571
595
  if ((0, import_types.isObjectLike)(objProp)) {
572
- o[prop] = deepClone2(objProp, excludeFrom);
596
+ o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
573
597
  } else
574
598
  o[prop] = objProp;
575
599
  }
@@ -623,7 +647,7 @@ var require_object = __commonJS({
623
647
  }
624
648
  }
625
649
  str += `${spaces} ]`;
626
- } else if ((0, import_types.isObject)(value)) {
650
+ } else if ((0, import_types.isObjectLike)(value)) {
627
651
  str += objectToString(value, indent + 1);
628
652
  } else if ((0, import_types.isString)(value)) {
629
653
  str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
@@ -663,8 +687,8 @@ var require_object = __commonJS({
663
687
  };
664
688
  var deepDestringify = (obj, destringified = {}) => {
665
689
  for (const prop in obj) {
666
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
667
- if (!hasOwnProperty)
690
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
691
+ if (!hasOwnProperty2)
668
692
  continue;
669
693
  const objProp = obj[prop];
670
694
  if ((0, import_types.isString)(objProp)) {
@@ -757,6 +781,39 @@ var require_object = __commonJS({
757
781
  }
758
782
  return cache;
759
783
  };
784
+ var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
785
+ var isEmpty = (o) => Object.keys(o).length === 0;
786
+ var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
787
+ var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
788
+ var deepDiff = (lhs, rhs) => {
789
+ if (lhs === rhs)
790
+ return {};
791
+ if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
792
+ return rhs;
793
+ const deletedValues = Object.keys(lhs).reduce((acc, key) => {
794
+ if (!hasOwnProperty(rhs, key)) {
795
+ acc[key] = void 0;
796
+ }
797
+ return acc;
798
+ }, makeObjectWithoutPrototype());
799
+ if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
800
+ if (lhs.valueOf() === rhs.valueOf())
801
+ return {};
802
+ return rhs;
803
+ }
804
+ return Object.keys(rhs).reduce((acc, key) => {
805
+ if (!hasOwnProperty(lhs, key)) {
806
+ acc[key] = rhs[key];
807
+ return acc;
808
+ }
809
+ const difference = diff(lhs[key], rhs[key]);
810
+ if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
811
+ return acc;
812
+ }
813
+ acc[key] = difference;
814
+ return acc;
815
+ }, deletedValues);
816
+ };
760
817
  var overwrite = (element, params, excludeFrom = []) => {
761
818
  const { ref } = element;
762
819
  const changes = {};
@@ -852,8 +909,8 @@ var require_object = __commonJS({
852
909
  }
853
910
  } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
854
911
  for (const key in obj1) {
855
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj2, key);
856
- if (!hasOwnProperty || !deepContains(obj1[key], obj2[key])) {
912
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
913
+ if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
857
914
  return false;
858
915
  }
859
916
  }
@@ -878,9 +935,9 @@ var require_object = __commonJS({
878
935
  }
879
936
  });
880
937
 
881
- // ../../node_modules/@domql/utils/dist/cjs/function.js
938
+ // ../../../domql/packages/utils/dist/cjs/function.js
882
939
  var require_function = __commonJS({
883
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
940
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
884
941
  "use strict";
885
942
  var __defProp2 = Object.defineProperty;
886
943
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -953,9 +1010,9 @@ var require_function = __commonJS({
953
1010
  }
954
1011
  });
955
1012
 
956
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1013
+ // ../../../domql/packages/utils/dist/cjs/log.js
957
1014
  var require_log = __commonJS({
958
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1015
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
959
1016
  "use strict";
960
1017
  var __defProp2 = Object.defineProperty;
961
1018
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -994,9 +1051,9 @@ var require_log = __commonJS({
994
1051
  }
995
1052
  });
996
1053
 
997
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1054
+ // ../../../domql/packages/utils/dist/cjs/cookie.js
998
1055
  var require_cookie = __commonJS({
999
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1056
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1000
1057
  "use strict";
1001
1058
  var __defProp2 = Object.defineProperty;
1002
1059
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1050,9 +1107,9 @@ var require_cookie = __commonJS({
1050
1107
  }
1051
1108
  });
1052
1109
 
1053
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1110
+ // ../../../domql/packages/utils/dist/cjs/tags.js
1054
1111
  var require_tags = __commonJS({
1055
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1112
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1056
1113
  "use strict";
1057
1114
  var __defProp2 = Object.defineProperty;
1058
1115
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1215,9 +1272,9 @@ var require_tags = __commonJS({
1215
1272
  }
1216
1273
  });
1217
1274
 
1218
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1275
+ // ../../../domql/packages/utils/dist/cjs/index.js
1219
1276
  var require_cjs = __commonJS({
1220
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1277
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1221
1278
  "use strict";
1222
1279
  var __defProp2 = Object.defineProperty;
1223
1280
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;