@symbo.ls/create 2.11.451 → 2.11.453

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.
@@ -303,6 +303,8 @@ var require_array = __commonJS({
303
303
  arraysEqual: () => arraysEqual,
304
304
  cutArrayAfterValue: () => cutArrayAfterValue,
305
305
  cutArrayBeforeValue: () => cutArrayBeforeValue,
306
+ filterArrays: () => filterArrays,
307
+ filterArraysFast: () => filterArraysFast,
306
308
  getFrequencyInArray: () => getFrequencyInArray,
307
309
  joinArrays: () => joinArrays,
308
310
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
@@ -411,6 +413,13 @@ var require_array = __commonJS({
411
413
  }
412
414
  return true;
413
415
  };
416
+ var filterArrays = (sourceArr, excludeArr) => {
417
+ return sourceArr.filter((item) => !excludeArr.includes(item));
418
+ };
419
+ var filterArraysFast = (sourceArr, excludeArr) => {
420
+ const excludeSet = new Set(excludeArr);
421
+ return sourceArr.filter((item) => !excludeSet.has(item));
422
+ };
414
423
  }
415
424
  });
416
425
 
@@ -604,6 +613,7 @@ var require_object = __commonJS({
604
613
  diff: () => diff,
605
614
  diffArrays: () => diffArrays,
606
615
  diffObjects: () => diffObjects,
616
+ excludeKeysFromObject: () => excludeKeysFromObject,
607
617
  exec: () => exec7,
608
618
  flattenRecursive: () => flattenRecursive,
609
619
  hasOwnProperty: () => hasOwnProperty,
@@ -931,7 +941,7 @@ var require_object = __commonJS({
931
941
  };
932
942
  var stringToObject = (str, opts = { verbose: true }) => {
933
943
  try {
934
- return import_globals2.window.eval("(" + str + ")");
944
+ return str ? import_globals2.window.eval("(" + str + ")") : {};
935
945
  } catch (e) {
936
946
  if (opts.verbose)
937
947
  console.warn(e);
@@ -1011,20 +1021,27 @@ var require_object = __commonJS({
1011
1021
  return acc;
1012
1022
  }, deletedValues);
1013
1023
  };
1014
- var overwrite = (element, params, excludeFrom = []) => {
1015
- const { ref } = element;
1016
- const changes = {};
1024
+ var overwrite = (element, params, opts = {}) => {
1025
+ const { __ref: ref } = element;
1026
+ const excl = opts.exclude || [];
1027
+ const allowUnderscore = opts.preventUnderscore;
1028
+ const preventCaching = opts.preventCaching;
1017
1029
  for (const e in params) {
1018
- if (excludeFrom.includes(e) || e.startsWith("__"))
1030
+ if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
1019
1031
  continue;
1020
1032
  const elementProp = element[e];
1021
1033
  const paramsProp = params[e];
1022
- if (paramsProp) {
1023
- ref.__cache[e] = changes[e] = elementProp;
1024
- ref[e] = paramsProp;
1034
+ if (paramsProp !== void 0) {
1035
+ element[e] = paramsProp;
1036
+ if (ref && !preventCaching) {
1037
+ ref.__cache[e] = elementProp;
1038
+ }
1039
+ if ((0, import_types.isObject)(opts.diff)) {
1040
+ diff[e] = elementProp;
1041
+ }
1025
1042
  }
1026
1043
  }
1027
- return changes;
1044
+ return element;
1028
1045
  };
1029
1046
  var overwriteShallow3 = (obj, params, excludeFrom = []) => {
1030
1047
  for (const e in params) {
@@ -1034,23 +1051,26 @@ var require_object = __commonJS({
1034
1051
  }
1035
1052
  return obj;
1036
1053
  };
1037
- var overwriteDeep2 = (obj, params, excludeFrom = [], visited = /* @__PURE__ */ new WeakMap()) => {
1054
+ var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
1055
+ const excl = opts.exclude || [];
1056
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
1038
1057
  if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
1039
1058
  return params;
1040
1059
  }
1041
- if (visited.has(obj)) {
1060
+ if (visited.has(obj))
1042
1061
  return visited.get(obj);
1043
- }
1044
1062
  visited.set(obj, obj);
1045
1063
  for (const e in params) {
1046
- if (e === "__ref" || excludeFrom.includes(e) || e.startsWith("__"))
1064
+ if (!Object.hasOwnProperty.call(params, e))
1065
+ continue;
1066
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
1047
1067
  continue;
1048
1068
  const objProp = obj[e];
1049
1069
  const paramsProp = params[e];
1050
1070
  if ((0, import_node.isDOMNode)(paramsProp)) {
1051
1071
  obj[e] = paramsProp;
1052
1072
  } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
1053
- obj[e] = overwriteDeep2(objProp, paramsProp, excludeFrom, visited);
1073
+ obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
1054
1074
  } else if (paramsProp !== void 0) {
1055
1075
  obj[e] = paramsProp;
1056
1076
  }
@@ -1232,6 +1252,11 @@ var require_object = __commonJS({
1232
1252
  }
1233
1253
  return detect(obj);
1234
1254
  };
1255
+ var excludeKeysFromObject = (obj, excludedKeys) => {
1256
+ const result = { ...obj };
1257
+ excludedKeys.forEach((key) => delete result[key]);
1258
+ return result;
1259
+ };
1235
1260
  }
1236
1261
  });
1237
1262
 
@@ -1651,6 +1676,8 @@ var require_component = __commonJS({
1651
1676
  return /^[a-z]*$/.test(firstCharKey);
1652
1677
  };
1653
1678
  var addAdditionalExtend2 = (newExtend, element) => {
1679
+ if (!newExtend)
1680
+ return element;
1654
1681
  const { extend: elementExtend } = element;
1655
1682
  const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
1656
1683
  const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
@@ -1658,8 +1685,23 @@ var require_component = __commonJS({
1658
1685
  return { ...element, extend };
1659
1686
  };
1660
1687
  var checkIfSugar = (element, parent, key) => {
1661
- const { extend, props: props2, childExtend, extends: extendProps, childrenExtends, childProps, children, on: on2, $collection, $stateCollection, $propsCollection } = element;
1688
+ const {
1689
+ extend,
1690
+ props: props2,
1691
+ childExtend,
1692
+ extends: extendProps,
1693
+ childrenExtends,
1694
+ childProps,
1695
+ children,
1696
+ on: on2,
1697
+ $collection,
1698
+ $stateCollection,
1699
+ $propsCollection
1700
+ } = element;
1662
1701
  const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
1702
+ if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
1703
+ element.error("Sugar component includes params for builtin components");
1704
+ }
1663
1705
  return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
1664
1706
  };
1665
1707
  var extendizeByKey = (element, parent, key) => {
@@ -1671,11 +1713,11 @@ var require_component = __commonJS({
1671
1713
  if (element === isExtendKeyComponent)
1672
1714
  return element;
1673
1715
  else if (isSugar) {
1674
- const newElem = {
1716
+ const newElem = addAdditionalExtend2(element.extends, {
1675
1717
  extend: extendFromKey,
1676
1718
  tag,
1677
1719
  props: { ...element }
1678
- };
1720
+ });
1679
1721
  if (childrenExtends)
1680
1722
  newElem.childExtend = childrenExtends;
1681
1723
  return newElem;
@@ -2180,6 +2222,8 @@ var require_cjs2 = __commonJS({
2180
2222
  arraysEqual: () => arraysEqual,
2181
2223
  cutArrayAfterValue: () => cutArrayAfterValue,
2182
2224
  cutArrayBeforeValue: () => cutArrayBeforeValue,
2225
+ filterArrays: () => filterArrays,
2226
+ filterArraysFast: () => filterArraysFast,
2183
2227
  getFrequencyInArray: () => getFrequencyInArray,
2184
2228
  joinArrays: () => joinArrays,
2185
2229
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
@@ -2288,6 +2332,13 @@ var require_cjs2 = __commonJS({
2288
2332
  }
2289
2333
  return true;
2290
2334
  };
2335
+ var filterArrays = (sourceArr, excludeArr) => {
2336
+ return sourceArr.filter((item) => !excludeArr.includes(item));
2337
+ };
2338
+ var filterArraysFast = (sourceArr, excludeArr) => {
2339
+ const excludeSet = new Set(excludeArr);
2340
+ return sourceArr.filter((item) => !excludeSet.has(item));
2341
+ };
2291
2342
  }
2292
2343
  });
2293
2344
  var require_string3 = __commonJS2({
@@ -2477,6 +2528,7 @@ var require_cjs2 = __commonJS({
2477
2528
  diff: () => diff,
2478
2529
  diffArrays: () => diffArrays,
2479
2530
  diffObjects: () => diffObjects,
2531
+ excludeKeysFromObject: () => excludeKeysFromObject,
2480
2532
  exec: () => exec7,
2481
2533
  flattenRecursive: () => flattenRecursive,
2482
2534
  hasOwnProperty: () => hasOwnProperty,
@@ -2804,7 +2856,7 @@ var require_cjs2 = __commonJS({
2804
2856
  };
2805
2857
  var stringToObject = (str, opts = { verbose: true }) => {
2806
2858
  try {
2807
- return import_globals3.window.eval("(" + str + ")");
2859
+ return str ? import_globals3.window.eval("(" + str + ")") : {};
2808
2860
  } catch (e) {
2809
2861
  if (opts.verbose)
2810
2862
  console.warn(e);
@@ -2884,20 +2936,27 @@ var require_cjs2 = __commonJS({
2884
2936
  return acc;
2885
2937
  }, deletedValues);
2886
2938
  };
2887
- var overwrite = (element, params, excludeFrom = []) => {
2888
- const { ref } = element;
2889
- const changes = {};
2939
+ var overwrite = (element, params, opts = {}) => {
2940
+ const { __ref: ref } = element;
2941
+ const excl = opts.exclude || [];
2942
+ const allowUnderscore = opts.preventUnderscore;
2943
+ const preventCaching = opts.preventCaching;
2890
2944
  for (const e in params) {
2891
- if (excludeFrom.includes(e) || e.startsWith("__"))
2945
+ if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
2892
2946
  continue;
2893
2947
  const elementProp = element[e];
2894
2948
  const paramsProp = params[e];
2895
- if (paramsProp) {
2896
- ref.__cache[e] = changes[e] = elementProp;
2897
- ref[e] = paramsProp;
2949
+ if (paramsProp !== void 0) {
2950
+ element[e] = paramsProp;
2951
+ if (ref && !preventCaching) {
2952
+ ref.__cache[e] = elementProp;
2953
+ }
2954
+ if ((0, import_types.isObject)(opts.diff)) {
2955
+ diff[e] = elementProp;
2956
+ }
2898
2957
  }
2899
2958
  }
2900
- return changes;
2959
+ return element;
2901
2960
  };
2902
2961
  var overwriteShallow3 = (obj, params, excludeFrom = []) => {
2903
2962
  for (const e in params) {
@@ -2907,23 +2966,26 @@ var require_cjs2 = __commonJS({
2907
2966
  }
2908
2967
  return obj;
2909
2968
  };
2910
- var overwriteDeep2 = (obj, params, excludeFrom = [], visited = /* @__PURE__ */ new WeakMap()) => {
2969
+ var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
2970
+ const excl = opts.exclude || [];
2971
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
2911
2972
  if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
2912
2973
  return params;
2913
2974
  }
2914
- if (visited.has(obj)) {
2975
+ if (visited.has(obj))
2915
2976
  return visited.get(obj);
2916
- }
2917
2977
  visited.set(obj, obj);
2918
2978
  for (const e in params) {
2919
- if (e === "__ref" || excludeFrom.includes(e) || e.startsWith("__"))
2979
+ if (!Object.hasOwnProperty.call(params, e))
2980
+ continue;
2981
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
2920
2982
  continue;
2921
2983
  const objProp = obj[e];
2922
2984
  const paramsProp = params[e];
2923
2985
  if ((0, import_node.isDOMNode)(paramsProp)) {
2924
2986
  obj[e] = paramsProp;
2925
2987
  } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2926
- obj[e] = overwriteDeep2(objProp, paramsProp, excludeFrom, visited);
2988
+ obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
2927
2989
  } else if (paramsProp !== void 0) {
2928
2990
  obj[e] = paramsProp;
2929
2991
  }
@@ -3105,6 +3167,11 @@ var require_cjs2 = __commonJS({
3105
3167
  }
3106
3168
  return detect(obj);
3107
3169
  };
3170
+ var excludeKeysFromObject = (obj, excludedKeys) => {
3171
+ const result = { ...obj };
3172
+ excludedKeys.forEach((key) => delete result[key]);
3173
+ return result;
3174
+ };
3108
3175
  }
3109
3176
  });
3110
3177
  var require_function3 = __commonJS2({
@@ -3514,6 +3581,8 @@ var require_cjs2 = __commonJS({
3514
3581
  return /^[a-z]*$/.test(firstCharKey);
3515
3582
  };
3516
3583
  var addAdditionalExtend2 = (newExtend, element) => {
3584
+ if (!newExtend)
3585
+ return element;
3517
3586
  const { extend: elementExtend } = element;
3518
3587
  const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
3519
3588
  const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
@@ -3521,8 +3590,23 @@ var require_cjs2 = __commonJS({
3521
3590
  return { ...element, extend };
3522
3591
  };
3523
3592
  var checkIfSugar = (element, parent, key) => {
3524
- const { extend, props: props2, childExtend, extends: extendProps, childrenExtends, childProps, children, on: on2, $collection, $stateCollection, $propsCollection } = element;
3593
+ const {
3594
+ extend,
3595
+ props: props2,
3596
+ childExtend,
3597
+ extends: extendProps,
3598
+ childrenExtends,
3599
+ childProps,
3600
+ children,
3601
+ on: on2,
3602
+ $collection,
3603
+ $stateCollection,
3604
+ $propsCollection
3605
+ } = element;
3525
3606
  const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
3607
+ if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
3608
+ element.error("Sugar component includes params for builtin components");
3609
+ }
3526
3610
  return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
3527
3611
  };
3528
3612
  var extendizeByKey = (element, parent, key) => {
@@ -3534,11 +3618,11 @@ var require_cjs2 = __commonJS({
3534
3618
  if (element === isExtendKeyComponent)
3535
3619
  return element;
3536
3620
  else if (isSugar) {
3537
- const newElem = {
3621
+ const newElem = addAdditionalExtend2(element.extends, {
3538
3622
  extend: extendFromKey,
3539
3623
  tag,
3540
3624
  props: { ...element }
3541
- };
3625
+ });
3542
3626
  if (childrenExtends)
3543
3627
  newElem.childExtend = childrenExtends;
3544
3628
  return newElem;
@@ -4005,6 +4089,8 @@ var require_cjs2 = __commonJS({
4005
4089
  arraysEqual: () => arraysEqual,
4006
4090
  cutArrayAfterValue: () => cutArrayAfterValue,
4007
4091
  cutArrayBeforeValue: () => cutArrayBeforeValue,
4092
+ filterArrays: () => filterArrays,
4093
+ filterArraysFast: () => filterArraysFast,
4008
4094
  getFrequencyInArray: () => getFrequencyInArray,
4009
4095
  joinArrays: () => joinArrays,
4010
4096
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
@@ -4113,6 +4199,13 @@ var require_cjs2 = __commonJS({
4113
4199
  }
4114
4200
  return true;
4115
4201
  };
4202
+ var filterArrays = (sourceArr, excludeArr) => {
4203
+ return sourceArr.filter((item) => !excludeArr.includes(item));
4204
+ };
4205
+ var filterArraysFast = (sourceArr, excludeArr) => {
4206
+ const excludeSet = new Set(excludeArr);
4207
+ return sourceArr.filter((item) => !excludeSet.has(item));
4208
+ };
4116
4209
  }
4117
4210
  });
4118
4211
  var require_string22 = __commonJS22({
@@ -4302,9 +4395,11 @@ var require_cjs2 = __commonJS({
4302
4395
  diff: () => diff,
4303
4396
  diffArrays: () => diffArrays,
4304
4397
  diffObjects: () => diffObjects,
4398
+ excludeKeysFromObject: () => excludeKeysFromObject,
4305
4399
  exec: () => exec7,
4306
4400
  flattenRecursive: () => flattenRecursive,
4307
4401
  hasOwnProperty: () => hasOwnProperty,
4402
+ isCyclic: () => isCyclic,
4308
4403
  isEmpty: () => isEmpty,
4309
4404
  isEmptyObject: () => isEmptyObject,
4310
4405
  isEqualDeep: () => isEqualDeep2,
@@ -4430,20 +4525,28 @@ var require_cjs2 = __commonJS({
4430
4525
  }
4431
4526
  return clone2;
4432
4527
  };
4433
- var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}) => {
4528
+ var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
4529
+ if ((0, import_types.isObjectLike)(obj)) {
4530
+ if (visited.has(obj)) {
4531
+ return obj;
4532
+ }
4533
+ visited.add(obj);
4534
+ }
4434
4535
  const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
4435
4536
  for (const prop in obj) {
4436
4537
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
4437
4538
  continue;
4438
4539
  const objProp = obj[prop];
4439
- if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
4540
+ if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp)) {
4440
4541
  continue;
4542
+ }
4441
4543
  if ((0, import_types.isObjectLike)(objProp)) {
4442
- o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options);
4544
+ o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options, visited);
4443
4545
  } else if ((0, import_types.isFunction)(objProp) && options.window) {
4444
4546
  o[prop] = (options.window || import_globals3.window).eval("(" + objProp.toString() + ")");
4445
- } else
4547
+ } else {
4446
4548
  o[prop] = objProp;
4549
+ }
4447
4550
  }
4448
4551
  return o;
4449
4552
  };
@@ -4620,7 +4723,7 @@ var require_cjs2 = __commonJS({
4620
4723
  };
4621
4724
  var stringToObject = (str, opts = { verbose: true }) => {
4622
4725
  try {
4623
- return import_globals3.window.eval("(" + str + ")");
4726
+ return str ? import_globals3.window.eval("(" + str + ")") : {};
4624
4727
  } catch (e) {
4625
4728
  if (opts.verbose)
4626
4729
  console.warn(e);
@@ -4700,20 +4803,27 @@ var require_cjs2 = __commonJS({
4700
4803
  return acc;
4701
4804
  }, deletedValues);
4702
4805
  };
4703
- var overwrite = (element, params, excludeFrom = []) => {
4704
- const { ref } = element;
4705
- const changes = {};
4806
+ var overwrite = (element, params, opts = {}) => {
4807
+ const { __ref: ref } = element;
4808
+ const excl = opts.exclude || [];
4809
+ const allowUnderscore = opts.preventUnderscore;
4810
+ const preventCaching = opts.preventCaching;
4706
4811
  for (const e in params) {
4707
- if (excludeFrom.includes(e) || e.startsWith("__"))
4812
+ if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
4708
4813
  continue;
4709
4814
  const elementProp = element[e];
4710
4815
  const paramsProp = params[e];
4711
- if (paramsProp) {
4712
- ref.__cache[e] = changes[e] = elementProp;
4713
- ref[e] = paramsProp;
4816
+ if (paramsProp !== void 0) {
4817
+ element[e] = paramsProp;
4818
+ if (ref && !preventCaching) {
4819
+ ref.__cache[e] = elementProp;
4820
+ }
4821
+ if ((0, import_types.isObject)(opts.diff)) {
4822
+ diff[e] = elementProp;
4823
+ }
4714
4824
  }
4715
4825
  }
4716
- return changes;
4826
+ return element;
4717
4827
  };
4718
4828
  var overwriteShallow3 = (obj, params, excludeFrom = []) => {
4719
4829
  for (const e in params) {
@@ -4723,23 +4833,26 @@ var require_cjs2 = __commonJS({
4723
4833
  }
4724
4834
  return obj;
4725
4835
  };
4726
- var overwriteDeep2 = (obj, params, excludeFrom = [], visited = /* @__PURE__ */ new WeakMap()) => {
4836
+ var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
4837
+ const excl = opts.exclude || [];
4838
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
4727
4839
  if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
4728
4840
  return params;
4729
4841
  }
4730
- if (visited.has(obj)) {
4842
+ if (visited.has(obj))
4731
4843
  return visited.get(obj);
4732
- }
4733
4844
  visited.set(obj, obj);
4734
4845
  for (const e in params) {
4735
- if (e === "__ref" || excludeFrom.includes(e) || e.startsWith("__"))
4846
+ if (!Object.hasOwnProperty.call(params, e))
4847
+ continue;
4848
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
4736
4849
  continue;
4737
4850
  const objProp = obj[e];
4738
4851
  const paramsProp = params[e];
4739
4852
  if ((0, import_node.isDOMNode)(paramsProp)) {
4740
4853
  obj[e] = paramsProp;
4741
4854
  } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
4742
- obj[e] = overwriteDeep2(objProp, paramsProp, excludeFrom, visited);
4855
+ obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
4743
4856
  } else if (paramsProp !== void 0) {
4744
4857
  obj[e] = paramsProp;
4745
4858
  }
@@ -4902,6 +5015,30 @@ var require_cjs2 = __commonJS({
4902
5015
  }
4903
5016
  }
4904
5017
  };
5018
+ var isCyclic = (obj) => {
5019
+ const seenObjects = [];
5020
+ function detect(obj2) {
5021
+ if (obj2 && typeof obj2 === "object") {
5022
+ if (seenObjects.indexOf(obj2) !== -1) {
5023
+ return true;
5024
+ }
5025
+ seenObjects.push(obj2);
5026
+ for (const key in obj2) {
5027
+ if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
5028
+ console.log(obj2, "cycle at " + key);
5029
+ return true;
5030
+ }
5031
+ }
5032
+ }
5033
+ return false;
5034
+ }
5035
+ return detect(obj);
5036
+ };
5037
+ var excludeKeysFromObject = (obj, excludedKeys) => {
5038
+ const result = { ...obj };
5039
+ excludedKeys.forEach((key) => delete result[key]);
5040
+ return result;
5041
+ };
4905
5042
  }
4906
5043
  });
4907
5044
  var require_function22 = __commonJS22({
@@ -5311,6 +5448,8 @@ var require_cjs2 = __commonJS({
5311
5448
  return /^[a-z]*$/.test(firstCharKey);
5312
5449
  };
5313
5450
  var addAdditionalExtend2 = (newExtend, element) => {
5451
+ if (!newExtend)
5452
+ return element;
5314
5453
  const { extend: elementExtend } = element;
5315
5454
  const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
5316
5455
  const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
@@ -5318,8 +5457,23 @@ var require_cjs2 = __commonJS({
5318
5457
  return { ...element, extend };
5319
5458
  };
5320
5459
  var checkIfSugar = (element, parent, key) => {
5321
- const { extend, props: props2, childExtend, extends: extendProps, childrenExtends, childProps, children, on: on2, $collection, $stateCollection, $propsCollection } = element;
5460
+ const {
5461
+ extend,
5462
+ props: props2,
5463
+ childExtend,
5464
+ extends: extendProps,
5465
+ childrenExtends,
5466
+ childProps,
5467
+ children,
5468
+ on: on2,
5469
+ $collection,
5470
+ $stateCollection,
5471
+ $propsCollection
5472
+ } = element;
5322
5473
  const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
5474
+ if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
5475
+ element.error("Sugar component includes params for builtin components");
5476
+ }
5323
5477
  return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
5324
5478
  };
5325
5479
  var extendizeByKey = (element, parent, key) => {
@@ -5331,11 +5485,11 @@ var require_cjs2 = __commonJS({
5331
5485
  if (element === isExtendKeyComponent)
5332
5486
  return element;
5333
5487
  else if (isSugar) {
5334
- const newElem = {
5488
+ const newElem = addAdditionalExtend2(element.extends, {
5335
5489
  extend: extendFromKey,
5336
5490
  tag,
5337
5491
  props: { ...element }
5338
- };
5492
+ });
5339
5493
  if (childrenExtends)
5340
5494
  newElem.childExtend = childrenExtends;
5341
5495
  return newElem;
@@ -8020,6 +8174,8 @@ var require_cjs3 = __commonJS({
8020
8174
  arraysEqual: () => arraysEqual,
8021
8175
  cutArrayAfterValue: () => cutArrayAfterValue,
8022
8176
  cutArrayBeforeValue: () => cutArrayBeforeValue,
8177
+ filterArrays: () => filterArrays,
8178
+ filterArraysFast: () => filterArraysFast,
8023
8179
  getFrequencyInArray: () => getFrequencyInArray,
8024
8180
  joinArrays: () => joinArrays,
8025
8181
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
@@ -8128,6 +8284,13 @@ var require_cjs3 = __commonJS({
8128
8284
  }
8129
8285
  return true;
8130
8286
  };
8287
+ var filterArrays = (sourceArr, excludeArr) => {
8288
+ return sourceArr.filter((item) => !excludeArr.includes(item));
8289
+ };
8290
+ var filterArraysFast = (sourceArr, excludeArr) => {
8291
+ const excludeSet = new Set(excludeArr);
8292
+ return sourceArr.filter((item) => !excludeSet.has(item));
8293
+ };
8131
8294
  }
8132
8295
  });
8133
8296
  var require_string3 = __commonJS2({
@@ -8317,9 +8480,11 @@ var require_cjs3 = __commonJS({
8317
8480
  diff: () => diff,
8318
8481
  diffArrays: () => diffArrays,
8319
8482
  diffObjects: () => diffObjects,
8483
+ excludeKeysFromObject: () => excludeKeysFromObject,
8320
8484
  exec: () => exec7,
8321
8485
  flattenRecursive: () => flattenRecursive,
8322
8486
  hasOwnProperty: () => hasOwnProperty,
8487
+ isCyclic: () => isCyclic,
8323
8488
  isEmpty: () => isEmpty,
8324
8489
  isEmptyObject: () => isEmptyObject,
8325
8490
  isEqualDeep: () => isEqualDeep2,
@@ -8445,20 +8610,28 @@ var require_cjs3 = __commonJS({
8445
8610
  }
8446
8611
  return clone2;
8447
8612
  };
8448
- var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}) => {
8613
+ var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
8614
+ if ((0, import_types.isObjectLike)(obj)) {
8615
+ if (visited.has(obj)) {
8616
+ return obj;
8617
+ }
8618
+ visited.add(obj);
8619
+ }
8449
8620
  const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
8450
8621
  for (const prop in obj) {
8451
8622
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
8452
8623
  continue;
8453
8624
  const objProp = obj[prop];
8454
- if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
8625
+ if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp)) {
8455
8626
  continue;
8627
+ }
8456
8628
  if ((0, import_types.isObjectLike)(objProp)) {
8457
- o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options);
8629
+ o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options, visited);
8458
8630
  } else if ((0, import_types.isFunction)(objProp) && options.window) {
8459
8631
  o[prop] = (options.window || import_globals2.window).eval("(" + objProp.toString() + ")");
8460
- } else
8632
+ } else {
8461
8633
  o[prop] = objProp;
8634
+ }
8462
8635
  }
8463
8636
  return o;
8464
8637
  };
@@ -8635,7 +8808,7 @@ var require_cjs3 = __commonJS({
8635
8808
  };
8636
8809
  var stringToObject = (str, opts = { verbose: true }) => {
8637
8810
  try {
8638
- return import_globals2.window.eval("(" + str + ")");
8811
+ return str ? import_globals2.window.eval("(" + str + ")") : {};
8639
8812
  } catch (e) {
8640
8813
  if (opts.verbose)
8641
8814
  console.warn(e);
@@ -8715,20 +8888,27 @@ var require_cjs3 = __commonJS({
8715
8888
  return acc;
8716
8889
  }, deletedValues);
8717
8890
  };
8718
- var overwrite = (element, params, excludeFrom = []) => {
8719
- const { ref } = element;
8720
- const changes = {};
8891
+ var overwrite = (element, params, opts = {}) => {
8892
+ const { __ref: ref } = element;
8893
+ const excl = opts.exclude || [];
8894
+ const allowUnderscore = opts.preventUnderscore;
8895
+ const preventCaching = opts.preventCaching;
8721
8896
  for (const e in params) {
8722
- if (excludeFrom.includes(e) || e.startsWith("__"))
8897
+ if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
8723
8898
  continue;
8724
8899
  const elementProp = element[e];
8725
8900
  const paramsProp = params[e];
8726
- if (paramsProp) {
8727
- ref.__cache[e] = changes[e] = elementProp;
8728
- ref[e] = paramsProp;
8901
+ if (paramsProp !== void 0) {
8902
+ element[e] = paramsProp;
8903
+ if (ref && !preventCaching) {
8904
+ ref.__cache[e] = elementProp;
8905
+ }
8906
+ if ((0, import_types.isObject)(opts.diff)) {
8907
+ diff[e] = elementProp;
8908
+ }
8729
8909
  }
8730
8910
  }
8731
- return changes;
8911
+ return element;
8732
8912
  };
8733
8913
  var overwriteShallow3 = (obj, params, excludeFrom = []) => {
8734
8914
  for (const e in params) {
@@ -8738,23 +8918,26 @@ var require_cjs3 = __commonJS({
8738
8918
  }
8739
8919
  return obj;
8740
8920
  };
8741
- var overwriteDeep2 = (obj, params, excludeFrom = [], visited = /* @__PURE__ */ new WeakMap()) => {
8921
+ var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
8922
+ const excl = opts.exclude || [];
8923
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
8742
8924
  if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
8743
8925
  return params;
8744
8926
  }
8745
- if (visited.has(obj)) {
8927
+ if (visited.has(obj))
8746
8928
  return visited.get(obj);
8747
- }
8748
8929
  visited.set(obj, obj);
8749
8930
  for (const e in params) {
8750
- if (e === "__ref" || excludeFrom.includes(e) || e.startsWith("__"))
8931
+ if (!Object.hasOwnProperty.call(params, e))
8932
+ continue;
8933
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
8751
8934
  continue;
8752
8935
  const objProp = obj[e];
8753
8936
  const paramsProp = params[e];
8754
8937
  if ((0, import_node.isDOMNode)(paramsProp)) {
8755
8938
  obj[e] = paramsProp;
8756
8939
  } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
8757
- obj[e] = overwriteDeep2(objProp, paramsProp, excludeFrom, visited);
8940
+ obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
8758
8941
  } else if (paramsProp !== void 0) {
8759
8942
  obj[e] = paramsProp;
8760
8943
  }
@@ -8917,6 +9100,30 @@ var require_cjs3 = __commonJS({
8917
9100
  }
8918
9101
  }
8919
9102
  };
9103
+ var isCyclic = (obj) => {
9104
+ const seenObjects = [];
9105
+ function detect(obj2) {
9106
+ if (obj2 && typeof obj2 === "object") {
9107
+ if (seenObjects.indexOf(obj2) !== -1) {
9108
+ return true;
9109
+ }
9110
+ seenObjects.push(obj2);
9111
+ for (const key in obj2) {
9112
+ if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
9113
+ console.log(obj2, "cycle at " + key);
9114
+ return true;
9115
+ }
9116
+ }
9117
+ }
9118
+ return false;
9119
+ }
9120
+ return detect(obj);
9121
+ };
9122
+ var excludeKeysFromObject = (obj, excludedKeys) => {
9123
+ const result = { ...obj };
9124
+ excludedKeys.forEach((key) => delete result[key]);
9125
+ return result;
9126
+ };
8920
9127
  }
8921
9128
  });
8922
9129
  var require_function3 = __commonJS2({
@@ -9326,6 +9533,8 @@ var require_cjs3 = __commonJS({
9326
9533
  return /^[a-z]*$/.test(firstCharKey);
9327
9534
  };
9328
9535
  var addAdditionalExtend2 = (newExtend, element) => {
9536
+ if (!newExtend)
9537
+ return element;
9329
9538
  const { extend: elementExtend } = element;
9330
9539
  const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
9331
9540
  const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
@@ -9333,8 +9542,23 @@ var require_cjs3 = __commonJS({
9333
9542
  return { ...element, extend };
9334
9543
  };
9335
9544
  var checkIfSugar = (element, parent, key) => {
9336
- const { extend, props: props2, childExtend, extends: extendProps, childrenExtends, childProps, children, on: on2, $collection, $stateCollection, $propsCollection } = element;
9545
+ const {
9546
+ extend,
9547
+ props: props2,
9548
+ childExtend,
9549
+ extends: extendProps,
9550
+ childrenExtends,
9551
+ childProps,
9552
+ children,
9553
+ on: on2,
9554
+ $collection,
9555
+ $stateCollection,
9556
+ $propsCollection
9557
+ } = element;
9337
9558
  const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
9559
+ if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
9560
+ element.error("Sugar component includes params for builtin components");
9561
+ }
9338
9562
  return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
9339
9563
  };
9340
9564
  var extendizeByKey = (element, parent, key) => {
@@ -9346,11 +9570,11 @@ var require_cjs3 = __commonJS({
9346
9570
  if (element === isExtendKeyComponent)
9347
9571
  return element;
9348
9572
  else if (isSugar) {
9349
- const newElem = {
9573
+ const newElem = addAdditionalExtend2(element.extends, {
9350
9574
  extend: extendFromKey,
9351
9575
  tag,
9352
9576
  props: { ...element }
9353
- };
9577
+ });
9354
9578
  if (childrenExtends)
9355
9579
  newElem.childExtend = childrenExtends;
9356
9580
  return newElem;
@@ -11404,30 +11628,35 @@ var require_create3 = __commonJS({
11404
11628
  var import_ignore = require_ignore2();
11405
11629
  var import_inherit = require_inherit2();
11406
11630
  var createPropsStack = (element, parent) => {
11407
- const { props: props2, __ref } = element;
11408
- const propsStack = __ref.__props = (0, import_inherit.inheritParentProps)(element, parent);
11631
+ const { props: props2, __ref: ref } = element;
11632
+ const propsStack = ref.__props = (0, import_inherit.inheritParentProps)(element, parent);
11409
11633
  if ((0, import_utils32.isObject)(props2))
11410
11634
  propsStack.push(props2);
11411
11635
  else if (props2 === "inherit" && parent.props)
11412
11636
  propsStack.push(parent.props);
11413
11637
  else if (props2)
11414
11638
  propsStack.push(props2);
11415
- if ((0, import_utils32.isArray)(__ref.__extend)) {
11416
- __ref.__extend.forEach((extend) => {
11639
+ if ((0, import_utils32.isArray)(ref.__extend)) {
11640
+ ref.__extend.forEach((extend) => {
11417
11641
  if (extend.props && extend.props !== props2)
11418
11642
  propsStack.push(extend.props);
11419
11643
  });
11420
11644
  }
11421
- __ref.__props = propsStack;
11645
+ ref.__props = propsStack;
11422
11646
  return propsStack;
11423
11647
  };
11424
- var syncProps = (props2, element) => {
11648
+ var syncProps = (props2, element, opts) => {
11425
11649
  element.props = {};
11426
11650
  const mergedProps = {};
11427
11651
  props2.forEach((v) => {
11428
11652
  if (import_ignore.IGNORE_PROPS_PARAMS.includes(v))
11429
11653
  return;
11430
- const execProps = (0, import_utils32.exec)(v, element);
11654
+ let execProps;
11655
+ try {
11656
+ execProps = (0, import_utils32.exec)(v, element);
11657
+ } catch (e) {
11658
+ element.error(e, opts);
11659
+ }
11431
11660
  element.props = (0, import_utils32.deepMerge)(
11432
11661
  mergedProps,
11433
11662
  (0, import_utils32.deepCloneWithExtend)(execProps, import_ignore.IGNORE_PROPS_PARAMS),
@@ -11439,15 +11668,15 @@ var require_create3 = __commonJS({
11439
11668
  Object.setPrototypeOf(element.props, methods);
11440
11669
  return element.props;
11441
11670
  };
11442
- var createProps = function(element, parent, cached) {
11671
+ var createProps = function(element, parent, options) {
11443
11672
  const { __ref: ref } = element;
11444
11673
  const applyProps = () => {
11445
- const propsStack = cached || createPropsStack(element, parent);
11674
+ const propsStack = options.cachedProps || createPropsStack(element, parent);
11446
11675
  if (propsStack.length) {
11447
11676
  ref.__props = propsStack;
11448
11677
  syncProps(propsStack, element);
11449
11678
  } else {
11450
- ref.__props = cached || [];
11679
+ ref.__props = options.cachedProps || [];
11451
11680
  element.props = {};
11452
11681
  }
11453
11682
  };
@@ -11458,7 +11687,7 @@ var require_create3 = __commonJS({
11458
11687
  applyProps();
11459
11688
  } catch {
11460
11689
  element.props = {};
11461
- ref.__props = cached || [];
11690
+ ref.__props = options.cachedProps || [];
11462
11691
  }
11463
11692
  }
11464
11693
  const methods = { update: update.bind(element.props), __element: element };
@@ -12488,8 +12717,8 @@ var require_data = __commonJS({
12488
12717
  var import_report = require_cjs5();
12489
12718
  var data_default = (params, element, node3) => {
12490
12719
  if (params) {
12491
- if (element.props.attr)
12492
- (0, import_utils32.deepMerge)(params, element.props.attr);
12720
+ if (element.props.data)
12721
+ (0, import_utils32.deepMerge)(params, element.props.data);
12493
12722
  if (params.showOnNode) {
12494
12723
  if (!(0, import_utils32.isObject)(params))
12495
12724
  (0, import_report.report)("HTMLInvalidData", params);
@@ -12922,6 +13151,7 @@ var require_methods2 = __commonJS({
12922
13151
  __export2(methods_exports, {
12923
13152
  METHODS: () => METHODS,
12924
13153
  defineSetter: () => defineSetter,
13154
+ error: () => error,
12925
13155
  get: () => get,
12926
13156
  isMethod: () => isMethod,
12927
13157
  keys: () => keys,
@@ -12937,13 +13167,16 @@ var require_methods2 = __commonJS({
12937
13167
  setNodeStyles: () => setNodeStyles,
12938
13168
  setProps: () => setProps,
12939
13169
  spotByPath: () => spotByPath,
12940
- variables: () => variables
13170
+ variables: () => variables,
13171
+ verbose: () => verbose,
13172
+ warn: () => warn
12941
13173
  });
12942
13174
  module2.exports = __toCommonJS2(methods_exports);
12943
13175
  var import_utils32 = require_cjs();
12944
13176
  var import_tree = require_tree();
12945
13177
  var import_mixins = require_mixins();
12946
- var spotByPath = function(path) {
13178
+ var ENV3 = "development";
13179
+ function spotByPath(path) {
12947
13180
  const element = this;
12948
13181
  const arr = [].concat(path);
12949
13182
  let active = import_tree.TREE[arr[0]];
@@ -12958,8 +13191,8 @@ var require_methods2 = __commonJS({
12958
13191
  return;
12959
13192
  }
12960
13193
  return active;
12961
- };
12962
- var lookup3 = function(param) {
13194
+ }
13195
+ function lookup3(param) {
12963
13196
  const el = this;
12964
13197
  let { parent } = el;
12965
13198
  if ((0, import_utils32.isFunction)(param)) {
@@ -12980,8 +13213,8 @@ var require_methods2 = __commonJS({
12980
13213
  return;
12981
13214
  }
12982
13215
  return parent;
12983
- };
12984
- var lookdown = function(param) {
13216
+ }
13217
+ function lookdown(param) {
12985
13218
  var _a;
12986
13219
  const el = this;
12987
13220
  const { __ref: ref } = el;
@@ -13001,9 +13234,8 @@ var require_methods2 = __commonJS({
13001
13234
  if (lookdown2)
13002
13235
  return lookdown2;
13003
13236
  }
13004
- return null;
13005
- };
13006
- var lookdownAll = function(param, results = []) {
13237
+ }
13238
+ function lookdownAll(param, results = []) {
13007
13239
  var _a;
13008
13240
  const el = this;
13009
13241
  const { __ref: ref } = el;
@@ -13020,9 +13252,9 @@ var require_methods2 = __commonJS({
13020
13252
  }
13021
13253
  (_a = childElem == null ? void 0 : childElem.lookdownAll) == null ? void 0 : _a.call(childElem, param, results);
13022
13254
  }
13023
- return results.length ? results : null;
13024
- };
13025
- var setNodeStyles = function(params = {}) {
13255
+ return results.length ? results : void 0;
13256
+ }
13257
+ function setNodeStyles(params = {}) {
13026
13258
  var _a;
13027
13259
  const el = this;
13028
13260
  if (!((_a = el.node) == null ? void 0 : _a.style))
@@ -13036,8 +13268,8 @@ var require_methods2 = __commonJS({
13036
13268
  el.node.style[param] = value2;
13037
13269
  }
13038
13270
  return el;
13039
- };
13040
- var remove = function() {
13271
+ }
13272
+ function remove() {
13041
13273
  const element = this;
13042
13274
  if ((0, import_utils32.isFunction)(element.node.remove))
13043
13275
  element.node.remove();
@@ -13048,31 +13280,31 @@ var require_methods2 = __commonJS({
13048
13280
  delete element.parent[element.key];
13049
13281
  if (element.parent.__ref)
13050
13282
  element.parent.__ref.__children = (0, import_utils32.removeValueFromArray)(element.parent.__ref.__children, element.key);
13051
- };
13052
- var get = function(param) {
13283
+ }
13284
+ function get(param) {
13053
13285
  const element = this;
13054
13286
  return element[param];
13055
- };
13056
- var setProps = function(param, options) {
13287
+ }
13288
+ function setProps(param, options) {
13057
13289
  const element = this;
13058
13290
  if (!param || !element.props)
13059
13291
  return;
13060
13292
  element.update({ props: param }, options);
13061
13293
  return element;
13062
- };
13294
+ }
13063
13295
  var defineSetter = (element, key, get2, set3) => Object.defineProperty(element, key, { get: get2, set: set3 });
13064
- var keys = function() {
13296
+ function keys() {
13065
13297
  const element = this;
13066
13298
  const keys2 = [];
13067
13299
  for (const param in element) {
13068
- if (import_mixins.registry[param] && !import_mixins.parseFilters.elementKeys.includes(param)) {
13300
+ if (import_mixins.registry[param] && !import_mixins.parseFilters.elementKeys.includes(param) || Object.hasOwnProperty.call(element, param)) {
13069
13301
  continue;
13070
13302
  }
13071
13303
  keys2.push(param);
13072
13304
  }
13073
13305
  return keys2;
13074
- };
13075
- var parse4 = function(excl = []) {
13306
+ }
13307
+ function parse4(excl = []) {
13076
13308
  const element = this;
13077
13309
  const obj = {};
13078
13310
  const keyList = keys.call(element);
@@ -13092,12 +13324,12 @@ var require_methods2 = __commonJS({
13092
13324
  } else if (v === "props") {
13093
13325
  const { __element, update, ...props2 } = element[v];
13094
13326
  obj[v] = props2;
13095
- } else if ((0, import_utils32.isDefined)(val))
13327
+ } else if ((0, import_utils32.isDefined)(val) && Object.hasOwnProperty.call(element, v))
13096
13328
  obj[v] = val;
13097
13329
  });
13098
13330
  return obj;
13099
- };
13100
- var parseDeep = function(excl = []) {
13331
+ }
13332
+ function parseDeep(excl = []) {
13101
13333
  const element = this;
13102
13334
  const obj = parse4.call(element, excl);
13103
13335
  for (const v in obj) {
@@ -13108,32 +13340,52 @@ var require_methods2 = __commonJS({
13108
13340
  }
13109
13341
  }
13110
13342
  return obj;
13111
- };
13112
- var log = function(...args) {
13343
+ }
13344
+ function verbose(...args) {
13345
+ if (ENV3 !== "test" && ENV3 !== "development")
13346
+ return;
13113
13347
  const element = this;
13114
- const { __ref } = element;
13115
- console.group(element.key);
13348
+ const { __ref: ref } = element;
13349
+ console.groupCollapsed(element.key);
13116
13350
  if (args.length) {
13117
13351
  args.forEach((v) => console.log(`%c${v}:
13118
13352
  `, "font-weight: bold", element[v]));
13119
13353
  } else {
13120
- console.log(__ref.path);
13354
+ console.log(ref.path);
13121
13355
  const keys2 = element.keys();
13122
13356
  keys2.forEach((v) => console.log(`%c${v}:
13123
13357
  `, "font-weight: bold", element[v]));
13124
13358
  }
13125
13359
  console.groupEnd(element.key);
13126
13360
  return element;
13127
- };
13128
- var nextElement = function() {
13361
+ }
13362
+ function log(...params) {
13363
+ if (ENV3 === "test" || ENV3 === "development") {
13364
+ console.log(...params);
13365
+ }
13366
+ }
13367
+ function warn(...params) {
13368
+ if (ENV3 === "test" || ENV3 === "development") {
13369
+ console.warn(...params);
13370
+ }
13371
+ }
13372
+ function error(...params) {
13373
+ var _a;
13374
+ if (ENV3 === "test" || ENV3 === "development") {
13375
+ if ((_a = params[params.length - 1]) == null ? void 0 : _a.debugger)
13376
+ debugger;
13377
+ console.error(...params);
13378
+ }
13379
+ }
13380
+ function nextElement() {
13129
13381
  const element = this;
13130
13382
  const { key, parent } = element;
13131
13383
  const { __children } = parent.__ref;
13132
13384
  const currentIndex = __children.indexOf(key);
13133
13385
  const nextChild = __children[currentIndex + 1];
13134
13386
  return parent[nextChild];
13135
- };
13136
- var previousElement = function(el) {
13387
+ }
13388
+ function previousElement(el) {
13137
13389
  const element = el || this;
13138
13390
  const { key, parent } = element;
13139
13391
  const { __children } = parent.__ref;
@@ -13141,8 +13393,8 @@ var require_methods2 = __commonJS({
13141
13393
  return;
13142
13394
  const currentIndex = __children.indexOf(key);
13143
13395
  return parent[__children[currentIndex - 1]];
13144
- };
13145
- var variables = function(obj = {}) {
13396
+ }
13397
+ function variables(obj = {}) {
13146
13398
  const element = this;
13147
13399
  if (!element.data)
13148
13400
  element.data = {};
@@ -13176,7 +13428,7 @@ var require_methods2 = __commonJS({
13176
13428
  }, timeout);
13177
13429
  }
13178
13430
  };
13179
- };
13431
+ }
13180
13432
  var METHODS = [
13181
13433
  "set",
13182
13434
  "reset",
@@ -13196,13 +13448,16 @@ var require_methods2 = __commonJS({
13196
13448
  "variables",
13197
13449
  "if",
13198
13450
  "log",
13451
+ "verbose",
13452
+ "warn",
13453
+ "error",
13199
13454
  "nextElement",
13200
13455
  "previousElement"
13201
13456
  ];
13202
- var isMethod = function(param, element) {
13457
+ function isMethod(param, element) {
13203
13458
  var _a, _b;
13204
13459
  return METHODS.includes(param) || ((_b = (_a = element == null ? void 0 : element.context) == null ? void 0 : _a.methods) == null ? void 0 : _b[param]);
13205
- };
13460
+ }
13206
13461
  }
13207
13462
  });
13208
13463
 
@@ -13632,7 +13887,7 @@ var require_update2 = __commonJS({
13632
13887
  if (beforeUpdateReturns === false)
13633
13888
  return element;
13634
13889
  }
13635
- (0, import_utils32.overwriteDeep)(element, params, import_utils210.METHODS_EXL);
13890
+ (0, import_utils32.overwriteDeep)(element, params, { exclude: import_utils210.METHODS_EXL });
13636
13891
  (0, import_iterate.throughExecProps)(element);
13637
13892
  (0, import_iterate.throughUpdatedExec)(element, { ignore: UPDATE_DEFAULT_OPTIONS });
13638
13893
  (0, import_iterate.throughUpdatedDefine)(element);
@@ -13851,7 +14106,7 @@ var require_set2 = __commonJS({
13851
14106
  var import_update = __toESM2(require_update2(), 1);
13852
14107
  var import__ = require_methods2();
13853
14108
  var import_content = require_content();
13854
- var addMethods = (element, parent, options) => {
14109
+ var addMethods = (element, parent, options = {}) => {
13855
14110
  const proto = {
13856
14111
  set: import_set.default,
13857
14112
  reset: import_set.reset,
@@ -13870,12 +14125,14 @@ var require_set2 = __commonJS({
13870
14125
  parseDeep: import__.parseDeep,
13871
14126
  keys: import__.keys,
13872
14127
  nextElement: import__.nextElement,
13873
- previousElement: import__.previousElement
14128
+ previousElement: import__.previousElement,
14129
+ log: import__.log,
14130
+ verbose: import__.verbose,
14131
+ warn: import__.warn,
14132
+ error: import__.error
13874
14133
  };
13875
14134
  if (element.context.methods)
13876
- (0, import_utils32.merge)(proto, element.context.methods);
13877
- if ((0, import_utils32.isDevelopment)())
13878
- proto.log = import__.log;
14135
+ (options.strict ? import_utils32.merge : import_utils32.overwrite)(proto, element.context.methods);
13879
14136
  Object.setPrototypeOf(element, proto);
13880
14137
  };
13881
14138
  }
@@ -13954,13 +14211,13 @@ var require_create4 = __commonJS({
13954
14211
  }
13955
14212
  switchDefaultOptions(element, parent, options);
13956
14213
  addCaching(element, parent);
13957
- (0, import_set.addMethods)(element, parent);
14214
+ (0, import_set.addMethods)(element, parent, options);
13958
14215
  createScope(element, parent);
13959
14216
  (0, import_state2.createState)(element, parent);
13960
14217
  if (element.scope === "state")
13961
14218
  element.scope = element.state;
13962
14219
  createIfConditionFlag(element, parent);
13963
- (0, import_props.createProps)(element, parent);
14220
+ (0, import_props.createProps)(element, parent, options);
13964
14221
  if (element.scope === "props" || element.scope === true)
13965
14222
  element.scope = element.props;
13966
14223
  createIfConditionFlag(element, parent);
@@ -14055,7 +14312,7 @@ var require_create4 = __commonJS({
14055
14312
  };
14056
14313
  var visitedElements = /* @__PURE__ */ new WeakMap();
14057
14314
  var renderElement = (element, parent, options, attachOptions) => {
14058
- var _a, _b;
14315
+ var _a, _b, _c, _d;
14059
14316
  if (visitedElements.has(element)) {
14060
14317
  if (ENV3 === "test" || ENV3 === "development")
14061
14318
  console.warn("Cyclic rendering detected:", element.__ref.path);
@@ -14076,9 +14333,13 @@ var require_create4 = __commonJS({
14076
14333
  if (path.includes("demoComponent"))
14077
14334
  path.splice(0, path.indexOf("demoComponent") + 1);
14078
14335
  const isDemoComponent = (_b = (_a = element.lookup((el) => el.state.key)) == null ? void 0 : _a.state) == null ? void 0 : _b.key;
14079
- console.warn("Error happened in:", isDemoComponent ? isDemoComponent + " " : "" + path.join("."));
14080
- console.warn(element);
14081
- console.error(e);
14336
+ element.warn("Error happened in:", isDemoComponent ? isDemoComponent + " " : "" + path.join("."));
14337
+ element.verbose();
14338
+ element.error(e, options);
14339
+ if ((_c = element.on) == null ? void 0 : _c.error)
14340
+ element.on.error(e, element, element.state, element.context, options);
14341
+ if ((_d = element.props) == null ? void 0 : _d.onError)
14342
+ element.props.onError(e, element, element.state, element.context, options);
14082
14343
  }
14083
14344
  }
14084
14345
  if (!ref.__if) {
@@ -14159,13 +14420,13 @@ var require_create4 = __commonJS({
14159
14420
  const { __ref: ref } = element;
14160
14421
  if (!ref.__skipCreate) {
14161
14422
  addCaching(element, parent);
14162
- (0, import_set.addMethods)(element, parent);
14423
+ (0, import_set.addMethods)(element, parent, options);
14163
14424
  createScope(element, parent);
14164
14425
  (0, import_state2.createState)(element, parent);
14165
14426
  if (element.scope === "state")
14166
14427
  element.scope = element.state;
14167
14428
  createIfConditionFlag(element, parent);
14168
- (0, import_props.createProps)(element, parent);
14429
+ (0, import_props.createProps)(element, parent, options);
14169
14430
  if (element.scope === "props" || element.scope === true)
14170
14431
  element.scope = element.props;
14171
14432
  if (element.node && ref.__if) {
@@ -15923,7 +16184,7 @@ var utilImports_exports = {};
15923
16184
  __export(utilImports_exports, {
15924
16185
  applyCSS: () => applyCSS,
15925
16186
  init: () => init,
15926
- reInit: () => reInit,
16187
+ reinit: () => reinit,
15927
16188
  scratchSystem: () => import_scratch2.scratchSystem,
15928
16189
  scratchUtils: () => import_scratch2.scratchUtils,
15929
16190
  set: () => import_scratch2.set
@@ -17110,8 +17371,8 @@ var dynamic_default = {};
17110
17371
 
17111
17372
  // ../init/index.js
17112
17373
  var CONFIG = (0, import_scratch.getActiveConfig)();
17113
- var mergeWithLocalFile = (config = CONFIG, RC_FILE) => {
17114
- const rcfile = (0, import_utils2.isObject)(RC_FILE) ? RC_FILE : dynamic_default || {};
17374
+ var mergeWithLocalFile = (config = CONFIG, options) => {
17375
+ const rcfile = (0, import_utils2.isObject)(options.localFile) ? options.localFile : dynamic_default || {};
17115
17376
  const clonedFile = (0, import_utils2.deepClone)(rcfile.designSystem || {});
17116
17377
  return (0, import_utils2.deepMerge)(config, clonedFile);
17117
17378
  };
@@ -17126,7 +17387,7 @@ var SET_OPTIONS = {
17126
17387
  };
17127
17388
  var init = (config, options = SET_OPTIONS) => {
17128
17389
  const emotion2 = options.emotion || emotion;
17129
- const resultConfig = mergeWithLocalFile(config || {});
17390
+ const resultConfig = mergeWithLocalFile(config || {}, options);
17130
17391
  const conf = (0, import_scratch.set)({
17131
17392
  verbose: options.verbose,
17132
17393
  useReset: options.useReset,
@@ -17165,15 +17426,20 @@ var init = (config, options = SET_OPTIONS) => {
17165
17426
  var UPDATE_OPTIONS = {
17166
17427
  emotion
17167
17428
  };
17168
- var reInit = (config, RC_FILE, options = UPDATE_OPTIONS) => {
17429
+ var reinit = (config, options = UPDATE_OPTIONS) => {
17169
17430
  const emotion2 = options.emotion || emotion;
17170
- const resultConfig = mergeWithLocalFile(config || {}, RC_FILE);
17431
+ const resultConfig = mergeWithLocalFile(config || {}, options);
17432
+ const prevStyles = document.querySelector('[data-emotion="smbls"]');
17433
+ console.log(prevStyles);
17171
17434
  const conf = (0, import_scratch.set)({
17172
17435
  verbose: false,
17173
17436
  ...resultConfig
17174
17437
  });
17175
- emotion2.injectGlobal({ ":root": conf.CSS_VARS });
17176
- emotion2.injectGlobal(conf.RESET);
17438
+ if (!options.preventInject) {
17439
+ emotion2.injectGlobal({ ":root": conf.CSS_VARS });
17440
+ emotion2.injectGlobal(conf.RESET);
17441
+ }
17442
+ return conf;
17177
17443
  };
17178
17444
  var applyCSS = (styles, options = UPDATE_OPTIONS) => {
17179
17445
  const emotion2 = options.emotion || emotion;
@@ -19004,9 +19270,14 @@ var Circle = {
19004
19270
 
19005
19271
  // ../uikit/Icon/index.js
19006
19272
  var import_utils15 = __toESM(require_cjs());
19273
+ var inheritFromIsActive = (el) => {
19274
+ const { props: props2 } = el;
19275
+ const propsActive = props2[".isActive"];
19276
+ return el.call("exec", propsActive.name || propsActive.icon);
19277
+ };
19007
19278
  var getIconName = (el, s) => {
19008
19279
  const { key, props: props2, deps } = el;
19009
- let iconName = (0, import_utils15.exec)(props2.name || props2.icon || key, el);
19280
+ let iconName = el.call("exec", props2.name || props2.icon || key, el);
19010
19281
  if ((0, import_utils15.isString)(iconName) && iconName.includes("{{")) {
19011
19282
  iconName = deps.replaceLiteralsWithObjectFields(iconName, s);
19012
19283
  }
@@ -19015,70 +19286,50 @@ var getIconName = (el, s) => {
19015
19286
  var Icon = {
19016
19287
  extend: "Svg",
19017
19288
  deps: { isString: import_utils15.isString, replaceLiteralsWithObjectFields: import_utils15.replaceLiteralsWithObjectFields },
19018
- props: (el, s) => {
19019
- const { props: props2, parent, context, deps, state } = el;
19020
- const { ICONS, SEMANTIC_ICONS, useIconSprite, verbose } = context && context.designSystem;
19021
- const { toCamelCase } = context && context.utils;
19022
- let iconName = getIconName(el, s);
19289
+ props: (el, s, ctx) => {
19290
+ const { props: props2, parent, deps } = el;
19291
+ const { ICONS, useIconSprite, verbose } = ctx && ctx.designSystem;
19292
+ const { toCamelCase } = ctx && ctx.utils;
19293
+ const iconName = getIconName(el, s);
19023
19294
  const camelCase = toCamelCase(iconName);
19024
19295
  const isArray5 = camelCase.split(/([a-z])([A-Z])/g);
19025
- const semanticIconRootName = isArray5[1] ? isArray5[0] : iconName.split(".")[0].split(" ")[0];
19026
- const semanticIcon = SEMANTIC_ICONS && SEMANTIC_ICONS[semanticIconRootName];
19027
- if (semanticIcon) {
19028
- const iconKey = iconName.includes(".") ? "sfsymbols." + iconName.split(".").slice(1).join(".") : "sfsymbols";
19029
- iconName = semanticIcon[iconKey] || semanticIcon[iconName.split(".")[0].split(" ")[0]];
19030
- return {
19031
- tag: "span",
19032
- semantic_symbols: true,
19033
- width: "A",
19034
- height: "A",
19035
- lineHeight: "1em",
19036
- ":after": {
19037
- fontSize: "Z",
19038
- fontWeight: "300",
19039
- content: `"${iconName}"`,
19040
- textAlign: "center",
19041
- display: "inline-block",
19042
- style: {
19043
- color: "currentColor",
19044
- fontFamily: "'SF Pro Icons', 'SF Pro', 'SF Symbols', 'Segoe UI'"
19045
- }
19046
- }
19047
- };
19048
- }
19296
+ const semanticIcon = getSemanticIcon(el, s, ctx);
19297
+ if (semanticIcon)
19298
+ return semanticIcon;
19049
19299
  let activeIconName;
19050
- if (props2.isActive) {
19051
- activeIconName = props2[".isActive"].name || props2[".isActive"].icon;
19052
- }
19053
- if (parent && parent.props && parent.props.isActive && parent.props[".isActive"] && parent.props[".isActive"].icon) {
19300
+ if (props2.isActive)
19301
+ activeIconName = inheritFromIsActive(el);
19302
+ const parentProps = parent.props;
19303
+ const parentPropsActive = parentProps[".isActive"];
19304
+ if (parent && parentProps && parentProps.isActive && parentPropsActive && parentPropsActive.icon) {
19054
19305
  activeIconName = (0, import_utils15.exec)(
19055
- parent.props[".isActive"].icon.name || parent.props[".isActive"].icon.icon || parent.props[".isActive"].icon,
19306
+ parentPropsActive.icon || parentPropsActive.Icon.name || parentPropsActive.Icon.icon,
19056
19307
  el
19057
19308
  );
19058
19309
  }
19059
19310
  if ((0, import_utils15.isString)(activeIconName) && activeIconName.includes("{{")) {
19060
- activeIconName = deps.replaceLiteralsWithObjectFields(activeIconName, state);
19311
+ activeIconName = deps.replaceLiteralsWithObjectFields(activeIconName, s);
19061
19312
  }
19062
- let validIconName;
19313
+ let iconInContext;
19063
19314
  if (ICONS[activeIconName])
19064
- validIconName = activeIconName;
19315
+ iconInContext = activeIconName;
19065
19316
  if (ICONS[camelCase])
19066
- validIconName = camelCase;
19317
+ iconInContext = camelCase;
19067
19318
  else if (ICONS[isArray5[0] + isArray5[1]])
19068
- validIconName = isArray5[0] + isArray5[1];
19319
+ iconInContext = isArray5[0] + isArray5[1];
19069
19320
  else if (ICONS[isArray5[0]])
19070
- validIconName = isArray5[0];
19321
+ iconInContext = isArray5[0];
19071
19322
  else {
19072
19323
  if (verbose)
19073
- console.warn("Can't find icon:", iconName, validIconName);
19324
+ el.warn("Can't find icon:", iconName, iconInContext);
19074
19325
  }
19075
- const iconFromLibrary = ICONS[validIconName];
19326
+ const iconFromLibrary = ICONS[iconInContext];
19076
19327
  const directSrc = parent && parent.props && parent.props.src || props2.src;
19077
19328
  return {
19078
19329
  width: "A",
19079
19330
  height: "A",
19080
19331
  display: "inline-block",
19081
- spriteId: useIconSprite && validIconName,
19332
+ spriteId: useIconSprite && iconInContext,
19082
19333
  src: iconFromLibrary || directSrc || ICONS.noIcon,
19083
19334
  style: { fill: "currentColor", "*": { fill: "currentColor" } }
19084
19335
  };
@@ -19092,7 +19343,7 @@ var IconText = {
19092
19343
  lineHeight: 1
19093
19344
  },
19094
19345
  Icon: {
19095
- props: ({ parent }) => ({ icon: parent.props.icon }),
19346
+ props: (el) => ({ icon: el.call("exec", el.parent.props.icon, el.parent) }),
19096
19347
  if: ({ parent, props: props2 }) => {
19097
19348
  return parent.props.icon || parent.props.Icon || props2.name || props2.icon || props2.sfSymbols || parent.props.sfSymbols;
19098
19349
  }
@@ -19119,6 +19370,37 @@ var FileIcon = {
19119
19370
  icon: "file"
19120
19371
  }
19121
19372
  };
19373
+ var getSemanticIcon = (el, s, ctx) => {
19374
+ const { SEMANTIC_ICONS } = ctx && ctx.designSystem;
19375
+ const { toCamelCase } = ctx && ctx.utils;
19376
+ let iconName = getIconName(el, s);
19377
+ const camelCase = toCamelCase(iconName);
19378
+ const isArray5 = camelCase.split(/([a-z])([A-Z])/g);
19379
+ const semanticIconRootName = isArray5[1] ? isArray5[0] : iconName.split(".")[0].split(" ")[0];
19380
+ const semanticIcon = SEMANTIC_ICONS && SEMANTIC_ICONS[semanticIconRootName];
19381
+ if (semanticIcon) {
19382
+ const iconKey = iconName.includes(".") ? "sfsymbols." + iconName.split(".").slice(1).join(".") : "sfsymbols";
19383
+ iconName = semanticIcon[iconKey] || semanticIcon[iconName.split(".")[0].split(" ")[0]];
19384
+ return {
19385
+ tag: "span",
19386
+ semantic_symbols: true,
19387
+ width: "A",
19388
+ height: "A",
19389
+ lineHeight: "1em",
19390
+ ":after": {
19391
+ fontSize: "Z",
19392
+ fontWeight: "300",
19393
+ content: `"${iconName}"`,
19394
+ textAlign: "center",
19395
+ display: "inline-block",
19396
+ style: {
19397
+ color: "currentColor",
19398
+ fontFamily: "'SF Pro Icons', 'SF Pro', 'SF Symbols', 'Segoe UI'"
19399
+ }
19400
+ }
19401
+ };
19402
+ }
19403
+ };
19122
19404
 
19123
19405
  // ../uikit/Indicator/StatusIndicator.js
19124
19406
  var StatusIndicator = {