jsf.js_next_gen 4.1.0-beta.18 → 4.1.0-beta.19

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.
@@ -91,7 +91,7 @@ function append(target, ...accessPath) {
91
91
  if (!Array.isArray(lastPathItem.target[lastPathItem.key])) {
92
92
  lastPathItem.target[lastPathItem.key] = [lastPathItem.target[lastPathItem.key]];
93
93
  }
94
- lastPathItem.target[lastPathItem.key].push(...value);
94
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(lastPathItem.target[lastPathItem.key], value);
95
95
  }
96
96
  }
97
97
  })();
@@ -165,7 +165,7 @@ function alloc(arr, length, defaultVal = {}) {
165
165
  let toAdd = [];
166
166
  toAdd.length = length;
167
167
  toAdd[length - 1] = defaultVal;
168
- arr.push(...toAdd);
168
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(arr, toAdd);
169
169
  }
170
170
  function flattenAccessPath(accessPath) {
171
171
  return new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...accessPath).flatMap((path) => path.split("["))
@@ -272,7 +272,7 @@ function _appendWithOverwrite(withAppend, target, key, arr, toAssign) {
272
272
  });
273
273
  target[key] = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...[]);
274
274
  target[key].push(oldVal);
275
- target[key].push(...newVals);
275
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], newVals);
276
276
  }
277
277
  else {
278
278
  let oldVal = target[key];
@@ -283,7 +283,7 @@ function _appendWithOverwrite(withAppend, target, key, arr, toAssign) {
283
283
  newVals.push(item);
284
284
  }
285
285
  });
286
- target[key].push(...newVals);
286
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], newVals);
287
287
  }
288
288
  }
289
289
  }
@@ -301,10 +301,10 @@ function _appendWithoutOverwrite(withAppend, target, key, arr, toAssign) {
301
301
  let oldVal = target[key];
302
302
  target[key] = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...[]);
303
303
  target[key].push(oldVal);
304
- target[key].push(...toAssign);
304
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], toAssign);
305
305
  }
306
306
  else {
307
- target[key].push(...toAssign);
307
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], toAssign);
308
308
  }
309
309
  }
310
310
  }
@@ -472,7 +472,7 @@ class Config extends _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional {
472
472
  let newThis = (0,_AssocArray__WEBPACK_IMPORTED_MODULE_3__.shallowMerge)(overwrite, withAppend, this.value, other.value);
473
473
  if (Array.isArray(this._value)) {
474
474
  this._value.length = 0;
475
- this._value.push(...newThis);
475
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(this._value, newThis);
476
476
  }
477
477
  else {
478
478
  Object.getOwnPropertyNames(this._value).forEach(key => delete this._value[key]);
@@ -579,7 +579,7 @@ class Config extends _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional {
579
579
  if (this.isArray(arrPos)) {
580
580
  if (currKey != "") {
581
581
  currAccessPos = Array.isArray(currAccessPos.value) ?
582
- _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_b = (_a = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...currAccessPos.value)
582
+ _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_b = (_a = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019ArrayFrom)(currAccessPos.value)
583
583
  .find(item => {
584
584
  var _a;
585
585
  return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false);
@@ -594,7 +594,7 @@ class Config extends _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional {
594
594
  }
595
595
  else {
596
596
  //we now have an array and go further with a singular key
597
- currAccessPos = (Array.isArray(currAccessPos.value)) ? _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_g = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...currAccessPos.value)
597
+ currAccessPos = (Array.isArray(currAccessPos.value)) ? _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_g = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019ArrayFrom)(currAccessPos.value)
598
598
  .find(item => {
599
599
  var _a;
600
600
  return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false);
@@ -676,6 +676,21 @@ const isString = _Lang__WEBPACK_IMPORTED_MODULE_2__.Lang.isString;
676
676
  const eqi = _Lang__WEBPACK_IMPORTED_MODULE_2__.Lang.equalsIgnoreCase;
677
677
  const objToArray = _Lang__WEBPACK_IMPORTED_MODULE_2__.Lang.objToArray;
678
678
 
679
+ /**
680
+ * chunk-safe version of target.prepend(...elements)
681
+ * (spreading a large element list overflows the argument stack)
682
+ *
683
+ * the chunks are prepended in reverse order, so the resulting
684
+ * element order is the same as a single prepend call would produce,
685
+ * for less than MAX_ARG_LENGTH elements this boils down to exactly
686
+ * one native prepend call
687
+ */
688
+ function prependChunked(target, elements) {
689
+ for (let end = elements.length; end > 0; end -= _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.MAX_ARG_LENGTH) {
690
+ const start = Math.max(0, end - _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.MAX_ARG_LENGTH);
691
+ target.prepend(...elements.slice(start, end));
692
+ }
693
+ }
679
694
  class NonceValueEmbedder extends _Monad__WEBPACK_IMPORTED_MODULE_0__.ValueEmbedder {
680
695
  constructor(rootElems) {
681
696
  super(rootElems === null || rootElems === void 0 ? void 0 : rootElems[0], "nonce");
@@ -905,11 +920,16 @@ class DomQuery {
905
920
  else if (isString(rootNode[cnt])) {
906
921
  let foundElement = DomQuery.querySelectorAll(rootNode[cnt]);
907
922
  if (!foundElement.isAbsent()) {
908
- rootNode.push(...foundElement.values);
923
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(rootNode, foundElement.values);
909
924
  }
910
925
  }
911
926
  else if (rootNode[cnt] instanceof DomQuery) {
912
- this.rootNode.push(...rootNode[cnt].values);
927
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(this.rootNode, rootNode[cnt].values);
928
+ }
929
+ else if (Array.isArray(rootNode[cnt])) {
930
+ // flatten array arguments into the work list, so large element
931
+ // arrays can be passed without spreading them into the call
932
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(rootNode, rootNode[cnt]);
913
933
  }
914
934
  else {
915
935
  this.rootNode.push(rootNode[cnt]);
@@ -1011,7 +1031,7 @@ class DomQuery {
1011
1031
  this.id.value = value;
1012
1032
  }
1013
1033
  get checked() {
1014
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.values).every(el => !!el.checked);
1034
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.values).every(el => !!el.checked);
1015
1035
  }
1016
1036
  set checked(newChecked) {
1017
1037
  this.eachElem(el => el.checked = newChecked);
@@ -1042,7 +1062,7 @@ class DomQuery {
1042
1062
  found.push(shadowRes);
1043
1063
  }
1044
1064
  }
1045
- return new DomQuery(...found);
1065
+ return new DomQuery(found);
1046
1066
  }
1047
1067
  /**
1048
1068
  * disabled flag
@@ -1067,11 +1087,11 @@ class DomQuery {
1067
1087
  this.eachElem((item) => {
1068
1088
  childNodeArr = childNodeArr.concat(objToArray(item.childNodes));
1069
1089
  });
1070
- return new DomQuery(...childNodeArr);
1090
+ return new DomQuery(childNodeArr);
1071
1091
  }
1072
1092
  get asArray() {
1073
1093
  // filter not supported by IE11
1074
- let items = new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode).filter(item => {
1094
+ let items = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode).filter(item => {
1075
1095
  return item != null;
1076
1096
  }).map(item => {
1077
1097
  return DomQuery.byId(item);
@@ -1079,31 +1099,31 @@ class DomQuery {
1079
1099
  return items;
1080
1100
  }
1081
1101
  get offsetWidth() {
1082
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1102
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1083
1103
  .filter(item => item != null)
1084
1104
  .map(elem => elem.offsetWidth)
1085
1105
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1086
1106
  }
1087
1107
  get offsetHeight() {
1088
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1108
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1089
1109
  .filter(item => item != null)
1090
1110
  .map(elem => elem.offsetHeight)
1091
1111
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1092
1112
  }
1093
1113
  get offsetLeft() {
1094
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1114
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1095
1115
  .filter(item => item != null)
1096
1116
  .map(elem => elem.offsetLeft)
1097
1117
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1098
1118
  }
1099
1119
  get offsetTop() {
1100
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(this.rootNode)
1120
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1101
1121
  .filter(item => item != null)
1102
1122
  .map(elem => elem.offsetTop)
1103
1123
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1104
1124
  }
1105
1125
  get asNodeArray() {
1106
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode.filter(item => item != null));
1126
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode.filter(item => item != null));
1107
1127
  }
1108
1128
  get nonce() {
1109
1129
  return new NonceValueEmbedder(this.rootNode);
@@ -1302,7 +1322,7 @@ class DomQuery {
1302
1322
  byId(id, includeRoot) {
1303
1323
  let res = [];
1304
1324
  if (includeRoot) {
1305
- res = res.concat(...new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
1325
+ res = res.concat((0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((this === null || this === void 0 ? void 0 : this.rootNode) || [])
1306
1326
  .filter((item) => id == item.id)
1307
1327
  .map(item => new DomQuery(item)));
1308
1328
  }
@@ -1310,12 +1330,12 @@ class DomQuery {
1310
1330
  // on hidden elements we use the attributes match selector
1311
1331
  // that works
1312
1332
  res = res.concat(this.querySelectorAll(`[id="${id}"]`));
1313
- return new DomQuery(...res);
1333
+ return new DomQuery(res);
1314
1334
  }
1315
1335
  byIdDeep(id, includeRoot) {
1316
1336
  let res = [];
1317
1337
  if (includeRoot) {
1318
- res = res.concat(new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
1338
+ res = res.concat((0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((this === null || this === void 0 ? void 0 : this.rootNode) || [])
1319
1339
  .filter(item => id == item.id)
1320
1340
  .map(item => new DomQuery(item)));
1321
1341
  }
@@ -1323,7 +1343,7 @@ class DomQuery {
1323
1343
  if (subItems.length) {
1324
1344
  res.push(subItems);
1325
1345
  }
1326
- return new DomQuery(...res);
1346
+ return new DomQuery(res);
1327
1347
  }
1328
1348
  /**
1329
1349
  * same as byId just for the tag name
@@ -1335,12 +1355,12 @@ class DomQuery {
1335
1355
  var _a;
1336
1356
  let res = [];
1337
1357
  if (includeRoot) {
1338
- res = new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : []))
1358
+ res = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : [])
1339
1359
  .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName)
1340
1360
  .reduce((reduction, item) => reduction.concat([item]), res);
1341
1361
  }
1342
1362
  (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));
1343
- return new DomQuery(...res);
1363
+ return new DomQuery(res);
1344
1364
  }
1345
1365
  /**
1346
1366
  * attr accessor, usage myQuery.attr("class").value = "bla"
@@ -1461,7 +1481,7 @@ class DomQuery {
1461
1481
  matched.push(item);
1462
1482
  }
1463
1483
  });
1464
- return new DomQuery(...matched);
1484
+ return new DomQuery(matched);
1465
1485
  }
1466
1486
  /**
1467
1487
  * checks whether any item in this domQuery level matches the selector
@@ -1512,7 +1532,7 @@ class DomQuery {
1512
1532
  return this;
1513
1533
  }
1514
1534
  each(func) {
1515
- new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1535
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1516
1536
  .forEach((item, cnt) => {
1517
1537
  // we could use a filter, but for the best performance we don´t
1518
1538
  if (item == null) {
@@ -1581,7 +1601,7 @@ class DomQuery {
1581
1601
  this.each((item) => {
1582
1602
  func(item) ? reArr.push(item) : null;
1583
1603
  });
1584
- return new DomQuery(...reArr);
1604
+ return new DomQuery(reArr);
1585
1605
  }
1586
1606
  /**
1587
1607
  * global eval head appendix method
@@ -1696,7 +1716,7 @@ class DomQuery {
1696
1716
  let res = [];
1697
1717
  res.push(this);
1698
1718
  res = res.concat(toInsertParams);
1699
- return new DomQuery(...res);
1719
+ return new DomQuery(res);
1700
1720
  }
1701
1721
  insertBefore(...toInsertParams) {
1702
1722
  this.each(existingItem => {
@@ -1711,7 +1731,7 @@ class DomQuery {
1711
1731
  let res = [];
1712
1732
  res.push(this);
1713
1733
  res = res.concat(toInsertParams);
1714
- return new DomQuery(...res);
1734
+ return new DomQuery(res);
1715
1735
  }
1716
1736
  orElse(...elseValue) {
1717
1737
  if (this.isPresent()) {
@@ -1742,7 +1762,7 @@ class DomQuery {
1742
1762
  }
1743
1763
  parent = parent.parent();
1744
1764
  }
1745
- return new DomQuery(...ret);
1765
+ return new DomQuery(ret);
1746
1766
  }
1747
1767
  /**
1748
1768
  * finds the first parent in the hierarchy for which the selector matches
@@ -1769,7 +1789,7 @@ class DomQuery {
1769
1789
  retArr.push(parent);
1770
1790
  parent = parent.parent().filter(item => item.matchesSelector(selector));
1771
1791
  }
1772
- return new DomQuery(...retArr);
1792
+ return new DomQuery(retArr);
1773
1793
  }
1774
1794
  parent() {
1775
1795
  let ret = [];
@@ -1779,7 +1799,7 @@ class DomQuery {
1779
1799
  ret.push(parent);
1780
1800
  }
1781
1801
  });
1782
- return new DomQuery(...ret);
1802
+ return new DomQuery(ret);
1783
1803
  }
1784
1804
  copyAttrs(sourceItem) {
1785
1805
  sourceItem.eachElem((sourceNode) => {
@@ -1848,8 +1868,8 @@ class DomQuery {
1848
1868
  }
1849
1869
  let insertAdditionalItems = [];
1850
1870
  if (nodes.length > 1) {
1851
- insertAdditionalItems = insertAdditionalItems.concat(...nodes.values.slice(1));
1852
- res.push(DomQuery.byId(replaced).insertAfter(new DomQuery(...insertAdditionalItems)));
1871
+ insertAdditionalItems = insertAdditionalItems.concat(nodes.values.slice(1));
1872
+ res.push(DomQuery.byId(replaced).insertAfter(new DomQuery(insertAdditionalItems)));
1853
1873
  }
1854
1874
  if (runEmbeddedScripts) {
1855
1875
  this.runScripts();
@@ -1879,7 +1899,7 @@ class DomQuery {
1879
1899
  // scripts before we run the 'include' command
1880
1900
  // this.globalEval(finalScripts.join("\n"));
1881
1901
  let joinedScripts = [];
1882
- new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...scriptsToProcess).forEach(item => {
1902
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(scriptsToProcess).forEach(item => {
1883
1903
  if (!item.nonce) {
1884
1904
  joinedScripts.push(item.evalText);
1885
1905
  }
@@ -2234,7 +2254,7 @@ class DomQuery {
2234
2254
  if (_Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(to).isAbsent()) {
2235
2255
  to = this.length;
2236
2256
  }
2237
- return new DomQuery(...this.rootNode.slice(from, Math.min(to, this.length)));
2257
+ return new DomQuery(this.rootNode.slice(from, Math.min(to, this.length)));
2238
2258
  }
2239
2259
  limits(end) {
2240
2260
  this._limits = end;
@@ -2282,7 +2302,7 @@ class DomQuery {
2282
2302
  throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");
2283
2303
  }
2284
2304
  });
2285
- return new DomQuery(...shadowRoots);
2305
+ return new DomQuery(shadowRoots);
2286
2306
  }
2287
2307
  /**
2288
2308
  * helper to fix a common dom problem
@@ -2310,7 +2330,7 @@ class DomQuery {
2310
2330
  let mapped = (shadowElements.allElems() || [])
2311
2331
  .map(element => element.shadowRoot)
2312
2332
  .filter((root) => !!root);
2313
- return new DomQuery(...mapped);
2333
+ return new DomQuery(mapped);
2314
2334
  }
2315
2335
  get shadowRoot() {
2316
2336
  let shadowRoots = [];
@@ -2319,7 +2339,7 @@ class DomQuery {
2319
2339
  shadowRoots.push(this.rootNode[cnt].shadowRoot);
2320
2340
  }
2321
2341
  }
2322
- return new DomQuery(...shadowRoots);
2342
+ return new DomQuery(shadowRoots);
2323
2343
  }
2324
2344
  get hasShadow() {
2325
2345
  for (let cnt = 0; cnt < this.rootNode.length; cnt++) {
@@ -2380,13 +2400,13 @@ class DomQuery {
2380
2400
  */
2381
2401
  concat(toAttach, filterDoubles = true) {
2382
2402
  let domQueries = this.asArray;
2383
- const ret = new DomQuery(...domQueries.concat(toAttach.asArray));
2403
+ const ret = new DomQuery(domQueries.concat(toAttach.asArray));
2384
2404
  // we now filter the doubles out
2385
2405
  if (!filterDoubles) {
2386
2406
  return ret;
2387
2407
  }
2388
2408
  let idx = {}; // ie11 does not support sets, we have to fake it
2389
- return new DomQuery(...ret.asArray.filter(node => {
2409
+ return new DomQuery(ret.asArray.filter(node => {
2390
2410
  const notFound = !(idx === null || idx === void 0 ? void 0 : idx[node.value.value.outerHTML]);
2391
2411
  idx[node.value.value.outerHTML] = true;
2392
2412
  return notFound;
@@ -2398,13 +2418,13 @@ class DomQuery {
2398
2418
  }
2399
2419
  prependTo(elem) {
2400
2420
  elem.eachElem(item => {
2401
- item.prepend(...this.allElems());
2421
+ prependChunked(item, this.allElems());
2402
2422
  });
2403
2423
  return this;
2404
2424
  }
2405
2425
  prepend(elem) {
2406
2426
  this.eachElem(item => {
2407
- item.prepend(...elem.allElems());
2427
+ prependChunked(item, elem.allElems());
2408
2428
  });
2409
2429
  return this;
2410
2430
  }
@@ -2425,9 +2445,9 @@ class DomQuery {
2425
2445
  continue;
2426
2446
  }
2427
2447
  let res = this.rootNode[cnt].querySelectorAll(selector);
2428
- nodes = nodes.concat(...objToArray(res));
2448
+ nodes = nodes.concat(objToArray(res));
2429
2449
  }
2430
- return new DomQuery(...nodes);
2450
+ return new DomQuery(nodes);
2431
2451
  }
2432
2452
  /*deep with a selector and a pseudo /shadow/ marker to break into the next level*/
2433
2453
  _querySelectorAllDeep(selector) {
@@ -2435,7 +2455,7 @@ class DomQuery {
2435
2455
  if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {
2436
2456
  return this;
2437
2457
  }
2438
- let foundNodes = new DomQuery(...this.rootNode);
2458
+ let foundNodes = new DomQuery(this.rootNode);
2439
2459
  let selectors = selector.split(/\/shadow\//);
2440
2460
  for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {
2441
2461
  if (selectors[cnt2] == "") {
@@ -2466,9 +2486,9 @@ class DomQuery {
2466
2486
  continue;
2467
2487
  }
2468
2488
  let res = [this.rootNode[cnt].closest(selector)];
2469
- nodes = nodes.concat(...res);
2489
+ nodes = nodes.concat(res);
2470
2490
  }
2471
- return new DomQuery(...nodes);
2491
+ return new DomQuery(nodes);
2472
2492
  }
2473
2493
  /*deep with a selector and a pseudo /shadow/ marker to break into the next level*/
2474
2494
  _closestDeep(selector) {
@@ -2476,7 +2496,7 @@ class DomQuery {
2476
2496
  if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {
2477
2497
  return this;
2478
2498
  }
2479
- let foundNodes = new DomQuery(...this.rootNode);
2499
+ let foundNodes = new DomQuery(this.rootNode);
2480
2500
  let selectors = selector.split(/\/shadow\//);
2481
2501
  for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {
2482
2502
  if (selectors[cnt2] == "") {
@@ -2613,7 +2633,7 @@ class DomQueryCollector {
2613
2633
  this.data.push(element);
2614
2634
  }
2615
2635
  get finalValue() {
2616
- return new DomQuery(...this.data);
2636
+ return new DomQuery(this.data);
2617
2637
  }
2618
2638
  }
2619
2639
  /**
@@ -2638,25 +2658,54 @@ const DQ$ = DomQuery.querySelectorAll;
2638
2658
  __webpack_require__.r(__webpack_exports__);
2639
2659
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2640
2660
  /* harmony export */ Es2019Array: () => (/* binding */ Es2019Array),
2641
- /* harmony export */ _Es2019Array: () => (/* binding */ _Es2019Array)
2661
+ /* harmony export */ Es2019ArrayFrom: () => (/* binding */ Es2019ArrayFrom),
2662
+ /* harmony export */ MAX_ARG_LENGTH: () => (/* binding */ MAX_ARG_LENGTH),
2663
+ /* harmony export */ _Es2019Array: () => (/* binding */ _Es2019Array),
2664
+ /* harmony export */ _Es2019ArrayFromArr: () => (/* binding */ _Es2019ArrayFromArr),
2665
+ /* harmony export */ pushChunked: () => (/* binding */ pushChunked)
2642
2666
  /* harmony export */ });
2643
2667
  /**
2644
2668
  * Extended array
2645
2669
  */
2670
+ /**
2671
+ * Max number of elements passed per function call.
2672
+ * Spreading or applying a large array into a single call
2673
+ * ("fn(...data)") overflows the argument stack on most browsers
2674
+ * (Chrome throws "RangeError: Maximum call stack size exceeded"
2675
+ * at roughly 65k arguments), so bulk operations must be chunked.
2676
+ */
2677
+ const MAX_ARG_LENGTH = 30000;
2678
+ /**
2679
+ * Appends the contents of source to target in argument-stack-safe chunks,
2680
+ * the chunk-safe replacement for target.push(...source)
2681
+ *
2682
+ * @param target the array to append to
2683
+ * @param source the elements to append
2684
+ * @returns target for chaining
2685
+ */
2686
+ function pushChunked(target, source) {
2687
+ for (let start = 0, len = source.length; start < len; start += MAX_ARG_LENGTH) {
2688
+ Array.prototype.push.apply(target, Array.prototype.slice.call(source, start, start + MAX_ARG_LENGTH));
2689
+ }
2690
+ return target;
2691
+ }
2646
2692
  /**
2647
2693
  * Extended array which adds various es 2019 shim functions to the normal array
2648
2694
  * We must remap all array producing functions in order to keep
2649
2695
  * the delegation active, once we are in!
2650
2696
  */
2651
2697
  class Es2019Array_ extends Array {
2652
- constructor(...another) {
2653
- super(...another);
2698
+ constructor(another = []) {
2699
+ super();
2700
+ // species constructors and legacy code paths may pass a scalar
2701
+ another = Array.isArray(another) ? another : [another];
2654
2702
  if (another._another) {
2655
2703
  this._another = another._another;
2656
2704
  }
2657
2705
  else {
2658
2706
  this._another = another;
2659
2707
  }
2708
+ pushChunked(this, another);
2660
2709
  //for testing it definitely runs into this branch because we are on es5 level
2661
2710
  //if (!(Array.prototype).flatMap as any) {
2662
2711
  this.flatMap = (flatMapFun) => this._flatMap(flatMapFun);
@@ -2667,27 +2716,27 @@ class Es2019Array_ extends Array {
2667
2716
  }
2668
2717
  map(callbackfn, thisArg) {
2669
2718
  const ret = Array.prototype.map.call(this._another, callbackfn, thisArg);
2670
- return new _Es2019Array(...ret);
2719
+ return _Es2019ArrayFromArr(ret);
2671
2720
  }
2672
2721
  concat(...items) {
2673
- const ret = Array.prototype.concat.call(this._another, ...items);
2674
- return new _Es2019Array(...ret);
2722
+ const ret = Array.prototype.concat.apply(this._another, items);
2723
+ return _Es2019ArrayFromArr(ret);
2675
2724
  }
2676
2725
  reverse() {
2677
2726
  const ret = Array.prototype.reverse.call(this._another);
2678
- return new _Es2019Array(...ret);
2727
+ return _Es2019ArrayFromArr(ret);
2679
2728
  }
2680
2729
  slice(start, end) {
2681
2730
  const ret = Array.prototype.slice.call(this._another, start, end);
2682
- return new _Es2019Array(...ret);
2731
+ return _Es2019ArrayFromArr(ret);
2683
2732
  }
2684
2733
  splice(start, deleteCount) {
2685
2734
  const ret = Array.prototype.splice.call(this._another, start, deleteCount !== null && deleteCount !== void 0 ? deleteCount : 0);
2686
- return new _Es2019Array(...ret);
2735
+ return _Es2019ArrayFromArr(ret);
2687
2736
  }
2688
2737
  filter(predicate, thisArg) {
2689
2738
  const ret = Array.prototype.filter.call(this._another, predicate, thisArg);
2690
- return new _Es2019Array(...ret);
2739
+ return _Es2019ArrayFromArr(ret);
2691
2740
  }
2692
2741
  reduce(callbackfn, initialValue) {
2693
2742
  const ret = Array.prototype.reduce.call(this._another, callbackfn, initialValue);
@@ -2712,7 +2761,7 @@ class Es2019Array_ extends Array {
2712
2761
  res = res.concat(mapped);
2713
2762
  };
2714
2763
  arr.forEach(reFlat);
2715
- return new Es2019Array(...res);
2764
+ return Es2019ArrayFrom(res);
2716
2765
  }
2717
2766
  _flatMap(mapperFunction) {
2718
2767
  let res = this.map(item => mapperFunction(item));
@@ -2722,7 +2771,14 @@ class Es2019Array_ extends Array {
2722
2771
  //let _Es2019Array = function<T>(...data: T[]) {};
2723
2772
  //let oldProto = Es2019Array.prototype;
2724
2773
  function _Es2019Array(...data) {
2725
- let ret = new Es2019Array_(...data);
2774
+ return _Es2019ArrayFromArr(data);
2775
+ }
2776
+ /**
2777
+ * chunk-safe variant of _Es2019Array which takes the backing array
2778
+ * directly instead of spreading it into the call
2779
+ */
2780
+ function _Es2019ArrayFromArr(data) {
2781
+ let ret = new Es2019Array_(data);
2726
2782
  let proxied = new Proxy(ret, {
2727
2783
  get(target, p, receiver) {
2728
2784
  if ("symbol" == typeof p) {
@@ -2750,8 +2806,20 @@ var Es2019Array = ((Array.prototype.flatMap) ? function (...data) {
2750
2806
  // but has no flatMap function, could be a node issue also or Typescript!
2751
2807
  // we remap that (could be related to: https://github.com/microsoft/TypeScript/issues/31033
2752
2808
  // the check and remap fixes the issue which should not exist in the first place
2753
- return (data === null || data === void 0 ? void 0 : data.flatMap) ? data : _Es2019Array(...data);
2809
+ return (data === null || data === void 0 ? void 0 : data.flatMap) ? data : _Es2019ArrayFromArr(data);
2754
2810
  } : _Es2019Array);
2811
+ /**
2812
+ * chunk-safe variant of new Es2019Array(...source) -
2813
+ * spreading a large array into the constructor call overflows the
2814
+ * argument stack ("Maximum call stack size exceeded"), this builder
2815
+ * copies the data over in safe chunks instead
2816
+ *
2817
+ * @param source an array or array-like holding the initial data
2818
+ */
2819
+ function Es2019ArrayFrom(source) {
2820
+ const data = pushChunked([], source);
2821
+ return (Array.prototype.flatMap) ? data : _Es2019ArrayFromArr(data);
2822
+ }
2755
2823
 
2756
2824
 
2757
2825
  /***/ },
@@ -2926,7 +2994,7 @@ var Lang;
2926
2994
  //special condition array delivered no offset no pack
2927
2995
  if ((obj) instanceof Array && !offset && !pack)
2928
2996
  return obj;
2929
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_1__.Es2019Array(...pack.concat(Array.prototype.slice.call(obj, offset)));
2997
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_1__.Es2019ArrayFrom)(pack.concat(Array.prototype.slice.call(obj, offset)));
2930
2998
  }
2931
2999
  Lang.objToArray = objToArray;
2932
3000
  /**
@@ -3722,7 +3790,17 @@ class MultiStreamDatasource {
3722
3790
  constructor(first, ...strms) {
3723
3791
  this.first = first;
3724
3792
  this.selectedPos = 0;
3725
- this.strms = [first].concat(...strms);
3793
+ // callers may pass single data sources or entire arrays of them,
3794
+ // we flatten one level here (chunk-safe, no spread into a call)
3795
+ this.strms = [first];
3796
+ strms.forEach(strm => {
3797
+ if (Array.isArray(strm)) {
3798
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(this.strms, strm);
3799
+ }
3800
+ else {
3801
+ this.strms.push(strm);
3802
+ }
3803
+ });
3726
3804
  this.activeStrm = this.strms[this.selectedPos];
3727
3805
  }
3728
3806
  current() {
@@ -3824,6 +3902,18 @@ class ArrayStreamDataSource {
3824
3902
  this.dataPos = -1;
3825
3903
  this.value = value;
3826
3904
  }
3905
+ /**
3906
+ * chunk-safe factory, takes the backing array directly instead
3907
+ * of spreading it into the constructor call (spreading large arrays
3908
+ * overflows the argument stack)
3909
+ *
3910
+ * @param data the array to stream over
3911
+ */
3912
+ static ofArray(data) {
3913
+ const ret = new ArrayStreamDataSource();
3914
+ ret.value = data !== null && data !== void 0 ? data : [];
3915
+ return ret;
3916
+ }
3827
3917
  lookAhead(cnt = 1) {
3828
3918
  if ((this.dataPos + cnt) > this.value.length - 1) {
3829
3919
  return ITERATION_STATUS.EO_STRM;
@@ -4077,7 +4167,7 @@ class QueryFormStringCollector {
4077
4167
  }
4078
4168
  }
4079
4169
  get finalValue() {
4080
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...this.formData)
4170
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019ArrayFrom)(this.formData)
4081
4171
  .map((keyVal) => keyVal.join("="))
4082
4172
  .reduce((item1, item2) => [item1, item2].join("&"));
4083
4173
  }
@@ -4204,7 +4294,7 @@ class FlatMapStreamDataSource {
4204
4294
  }
4205
4295
  }
4206
4296
  toDatasource(mapped) {
4207
- let ds = Array.isArray(mapped) ? new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayStreamDataSource(...mapped) : mapped;
4297
+ let ds = Array.isArray(mapped) ? _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayStreamDataSource.ofArray(mapped) : mapped;
4208
4298
  this.walkedDataSources.push(ds);
4209
4299
  return ds;
4210
4300
  }
@@ -4254,23 +4344,35 @@ class Stream {
4254
4344
  this.value = value;
4255
4345
  }
4256
4346
  static of(...data) {
4257
- return new Stream(...data);
4347
+ return Stream.ofArr(data);
4348
+ }
4349
+ /**
4350
+ * chunk-safe factory, takes the backing array directly instead of
4351
+ * spreading it into the call (Stream.of(...largeArray) overflows the
4352
+ * argument stack on large arrays)
4353
+ *
4354
+ * @param data the array to stream over
4355
+ */
4356
+ static ofArr(data) {
4357
+ const ret = new Stream();
4358
+ ret.value = data !== null && data !== void 0 ? data : [];
4359
+ return ret;
4258
4360
  }
4259
4361
  static ofAssoc(data) {
4260
- return this.of(...Object.keys(data)).map(key => [key, data[key]]);
4362
+ return this.ofArr(Object.keys(data)).map(key => [key, data[key]]);
4261
4363
  }
4262
4364
  static ofDataSource(dataSource) {
4263
4365
  let value = [];
4264
4366
  while (dataSource.hasNext()) {
4265
4367
  value.push(dataSource.next());
4266
4368
  }
4267
- return new Stream(...value);
4369
+ return Stream.ofArr(value);
4268
4370
  }
4269
4371
  static ofDomQuery(value) {
4270
- return Stream.of(...value.asArray);
4372
+ return Stream.ofArr(value.asArray);
4271
4373
  }
4272
4374
  static ofConfig(value) {
4273
- return Stream.of(...Object.keys(value.value)).map(key => [key, value.value[key]]);
4375
+ return Stream.ofArr(Object.keys(value.value)).map(key => [key, value.value[key]]);
4274
4376
  }
4275
4377
  current() {
4276
4378
  if (this.pos == -1) {
@@ -4291,7 +4393,7 @@ class Stream {
4291
4393
  */
4292
4394
  concat(...toAppend) {
4293
4395
  let toConcat = [this].concat(toAppend);
4294
- return Stream.of(...toConcat).flatMap(item => item);
4396
+ return Stream.ofArr(toConcat).flatMap(item => item);
4295
4397
  }
4296
4398
  onElem(fn) {
4297
4399
  for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
@@ -4313,7 +4415,7 @@ class Stream {
4313
4415
  this.each((item) => {
4314
4416
  res.push(fn(item));
4315
4417
  });
4316
- return new Stream(...res);
4418
+ return Stream.ofArr(res);
4317
4419
  }
4318
4420
  /*
4319
4421
  * we need to implement it to fulfill the contract, although it is used only internally
@@ -4325,7 +4427,7 @@ class Stream {
4325
4427
  let strmR = fn(item);
4326
4428
  ret = Array.isArray(strmR) ? ret.concat(strmR) : ret.concat(strmR.value);
4327
4429
  });
4328
- return Stream.of(...ret);
4430
+ return Stream.ofArr(ret);
4329
4431
  }
4330
4432
  filter(fn) {
4331
4433
  let res = [];
@@ -4334,7 +4436,7 @@ class Stream {
4334
4436
  res.push(data);
4335
4437
  }
4336
4438
  });
4337
- return new Stream(...res);
4439
+ return Stream.ofArr(res);
4338
4440
  }
4339
4441
  reduce(fn, startVal = null) {
4340
4442
  let offset = startVal != null ? 0 : 1;
@@ -4389,7 +4491,7 @@ class Stream {
4389
4491
  }
4390
4492
  sort(comparator) {
4391
4493
  let newArr = this.value.slice().sort(comparator);
4392
- return Stream.of(...newArr);
4494
+ return Stream.ofArr(newArr);
4393
4495
  }
4394
4496
  collect(collector) {
4395
4497
  this.each(data => collector.collect(data));
@@ -4464,19 +4566,29 @@ class Stream {
4464
4566
  */
4465
4567
  class LazyStream {
4466
4568
  static of(...values) {
4467
- return new LazyStream(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayStreamDataSource(...values));
4569
+ return LazyStream.ofArr(values);
4570
+ }
4571
+ /**
4572
+ * chunk-safe factory, takes the backing array directly instead of
4573
+ * spreading it into the call (LazyStream.of(...largeArray) overflows
4574
+ * the argument stack on large arrays)
4575
+ *
4576
+ * @param data the array to stream over
4577
+ */
4578
+ static ofArr(data) {
4579
+ return new LazyStream(_SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayStreamDataSource.ofArray(data));
4468
4580
  }
4469
4581
  static ofAssoc(data) {
4470
- return this.of(...Object.keys(data)).map(key => [key, data[key]]);
4582
+ return this.ofArr(Object.keys(data)).map(key => [key, data[key]]);
4471
4583
  }
4472
4584
  static ofStreamDataSource(value) {
4473
4585
  return new LazyStream(value);
4474
4586
  }
4475
4587
  static ofDomQuery(value) {
4476
- return LazyStream.of(...value.asArray);
4588
+ return LazyStream.ofArr(value.asArray);
4477
4589
  }
4478
4590
  static ofConfig(value) {
4479
- return LazyStream.of(...Object.keys(value.value)).map(key => [key, value.value[key]]);
4591
+ return LazyStream.ofArr(Object.keys(value.value)).map(key => [key, value.value[key]]);
4480
4592
  }
4481
4593
  constructor(parent) {
4482
4594
  this._limits = -1;
@@ -4635,7 +4747,7 @@ class LazyStream {
4635
4747
  sort(comparator) {
4636
4748
  let arr = this.collect(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayCollector());
4637
4749
  arr = arr.sort(comparator);
4638
- return LazyStream.of(...arr);
4750
+ return LazyStream.ofArr(arr);
4639
4751
  }
4640
4752
  get value() {
4641
4753
  return this.collect(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayCollector());