@lowentry/utils 1.22.2 → 1.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -696,43 +696,42 @@ var LeUtils = {
696
696
  if (elements instanceof Set) {
697
697
  return index;
698
698
  }
699
- if (ArrayBuffer.isView(elements) && !(elements instanceof DataView)) {
700
- return elements[index];
701
- }
702
- if (typeof elements === 'string') {
703
- return elements.charAt(index);
704
- }
705
- if (typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function') {
706
- var i = 0;
707
- var _iterator = _createForOfIteratorHelper$1(elements),
708
- _step;
709
- try {
710
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
711
- var value = _step.value;
712
- if (i === index) {
713
- return value;
699
+ if (typeof elements !== 'string') {
700
+ if (ArrayBuffer.isView(elements) && !(elements instanceof DataView)) {
701
+ return elements[index];
702
+ }
703
+ if (typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function') {
704
+ var i = 0;
705
+ var _iterator = _createForOfIteratorHelper$1(elements),
706
+ _step;
707
+ try {
708
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
709
+ var value = _step.value;
710
+ if (i === index) {
711
+ return value;
712
+ }
713
+ i++;
714
714
  }
715
- i++;
715
+ } catch (err) {
716
+ _iterator.e(err);
717
+ } finally {
718
+ _iterator.f();
716
719
  }
717
- } catch (err) {
718
- _iterator.e(err);
719
- } finally {
720
- _iterator.f();
720
+ return undefined;
721
721
  }
722
- return undefined;
723
- }
724
- if (typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function') {
725
- var result = undefined;
726
- var shouldContinue = true;
727
- elements.forEach(function (value, i) {
728
- if (shouldContinue) {
729
- if (i === index) {
730
- result = value;
731
- shouldContinue = false;
722
+ if (typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function') {
723
+ var result = undefined;
724
+ var shouldContinue = true;
725
+ elements.forEach(function (value, i) {
726
+ if (shouldContinue) {
727
+ if (i === index) {
728
+ result = value;
729
+ shouldContinue = false;
730
+ }
732
731
  }
733
- }
734
- });
735
- return result;
732
+ });
733
+ return result;
734
+ }
736
735
  }
737
736
  if (_typeof(elements) === 'object' || typeof elements === 'function') {
738
737
  if (optionalSkipHasOwnPropertyCheck === true || Object.prototype.hasOwnProperty.call(elements, index)) {
@@ -749,10 +748,10 @@ var LeUtils = {
749
748
  * @returns {boolean}
750
749
  */
751
750
  supportsEach: function supportsEach(elements) {
752
- if (elements === null || typeof elements === 'undefined') {
751
+ if (elements === null || typeof elements === 'undefined' || typeof elements === 'string') {
753
752
  return false;
754
753
  }
755
- return !!(Array.isArray(elements) || _typeof(elements) === 'object' && (elements === null || elements === void 0 ? void 0 : elements.constructor) === Object || typeof elements === 'string' || typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function' || typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function' || _typeof(elements) === 'object' || typeof elements === 'function');
754
+ return !!(Array.isArray(elements) || _typeof(elements) === 'object' && (elements === null || elements === void 0 ? void 0 : elements.constructor) === Object || typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function' || typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function' || _typeof(elements) === 'object' || typeof elements === 'function');
756
755
  },
757
756
  /**
758
757
  * Returns an iterator that iterates over each element in the given array or object, yielding an array with the value and the index/key.
@@ -764,7 +763,7 @@ var LeUtils = {
764
763
  eachIterator: function eachIterator(elements) {
765
764
  var optionalSkipHasOwnPropertyCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
766
765
  return /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
767
- var i, _i, _iterator2, _step2, _step2$value, _i2, value, _iterator3, _step3, _value, _i3, _i4, _iterator4, _step4, _value2, buffer, _i5, _buffer, entry, _i6, _t, _t2, _t3, _t4, _t5, _t6, _t7;
766
+ var i, _i, _iterator2, _step2, _step2$value, _i2, value, _iterator3, _step3, _value, _i3, _iterator4, _step4, _value2, buffer, _i4, _buffer, entry, _i5, _t, _t2, _t3, _t4, _t5, _t6, _t7;
768
767
  return _regeneratorRuntime.wrap(function (_context) {
769
768
  while (1) switch (_context.prev = _context.next) {
770
769
  case 0:
@@ -880,113 +879,98 @@ var LeUtils = {
880
879
  case 24:
881
880
  return _context.abrupt("return");
882
881
  case 25:
883
- if (!(typeof elements === 'string')) {
884
- _context.next = 29;
885
- break;
886
- }
887
- _i3 = 0;
888
- case 26:
889
- if (!(_i3 < elements.length)) {
890
- _context.next = 28;
882
+ if (!(typeof elements !== 'string')) {
883
+ _context.next = 38;
891
884
  break;
892
885
  }
893
- _context.next = 27;
894
- return [elements.charAt(_i3), _i3];
895
- case 27:
896
- _i3++;
897
- _context.next = 26;
898
- break;
899
- case 28:
900
- return _context.abrupt("return");
901
- case 29:
902
886
  if (!(typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function')) {
903
- _context.next = 38;
887
+ _context.next = 34;
904
888
  break;
905
889
  }
906
- _i4 = 0;
890
+ _i3 = 0;
907
891
  _iterator4 = _createForOfIteratorHelper$1(elements);
908
- _context.prev = 30;
892
+ _context.prev = 26;
909
893
  _iterator4.s();
910
- case 31:
894
+ case 27:
911
895
  if ((_step4 = _iterator4.n()).done) {
912
- _context.next = 34;
896
+ _context.next = 30;
913
897
  break;
914
898
  }
915
899
  _value2 = _step4.value;
916
- _context.next = 32;
917
- return [_value2, _i4];
918
- case 32:
919
- _i4++;
920
- case 33:
921
- _context.next = 31;
900
+ _context.next = 28;
901
+ return [_value2, _i3];
902
+ case 28:
903
+ _i3++;
904
+ case 29:
905
+ _context.next = 27;
922
906
  break;
923
- case 34:
924
- _context.next = 36;
907
+ case 30:
908
+ _context.next = 32;
925
909
  break;
926
- case 35:
927
- _context.prev = 35;
928
- _t5 = _context["catch"](30);
910
+ case 31:
911
+ _context.prev = 31;
912
+ _t5 = _context["catch"](26);
929
913
  _iterator4.e(_t5);
930
- case 36:
931
- _context.prev = 36;
914
+ case 32:
915
+ _context.prev = 32;
932
916
  _iterator4.f();
933
- return _context.finish(36);
934
- case 37:
917
+ return _context.finish(32);
918
+ case 33:
935
919
  return _context.abrupt("return");
936
- case 38:
920
+ case 34:
937
921
  if (!(typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function')) {
938
- _context.next = 42;
922
+ _context.next = 38;
939
923
  break;
940
924
  }
941
925
  buffer = [];
942
926
  elements.forEach(function (value, i) {
943
927
  buffer.push([value, i]);
944
928
  });
945
- _i5 = 0, _buffer = buffer;
946
- case 39:
947
- if (!(_i5 < _buffer.length)) {
948
- _context.next = 41;
929
+ _i4 = 0, _buffer = buffer;
930
+ case 35:
931
+ if (!(_i4 < _buffer.length)) {
932
+ _context.next = 37;
949
933
  break;
950
934
  }
951
- entry = _buffer[_i5];
952
- _context.next = 40;
935
+ entry = _buffer[_i4];
936
+ _context.next = 36;
953
937
  return entry;
954
- case 40:
955
- _i5++;
956
- _context.next = 39;
938
+ case 36:
939
+ _i4++;
940
+ _context.next = 35;
957
941
  break;
958
- case 41:
942
+ case 37:
959
943
  return _context.abrupt("return");
960
- case 42:
944
+ case 38:
961
945
  if (!(_typeof(elements) === 'object' || typeof elements === 'function')) {
962
- _context.next = 46;
946
+ _context.next = 42;
963
947
  break;
964
948
  }
965
949
  _t6 = _regeneratorRuntime.keys(elements);
966
- case 43:
950
+ case 39:
967
951
  if ((_t7 = _t6()).done) {
968
- _context.next = 45;
952
+ _context.next = 41;
969
953
  break;
970
954
  }
971
- _i6 = _t7.value;
972
- if (!(optionalSkipHasOwnPropertyCheck === true || Object.prototype.hasOwnProperty.call(elements, _i6))) {
973
- _context.next = 44;
955
+ _i5 = _t7.value;
956
+ if (!(optionalSkipHasOwnPropertyCheck === true || Object.prototype.hasOwnProperty.call(elements, _i5))) {
957
+ _context.next = 40;
974
958
  break;
975
959
  }
976
- _context.next = 44;
977
- return [elements[_i6], _i6];
978
- case 44:
979
- _context.next = 43;
960
+ _context.next = 40;
961
+ return [elements[_i5], _i5];
962
+ case 40:
963
+ _context.next = 39;
980
964
  break;
981
- case 45:
965
+ case 41:
982
966
  return _context.abrupt("return");
983
- case 46:
967
+ case 42:
984
968
  console.warn('Executed LeUtils.eachIterator() on an invalid type: [' + _typeof(elements) + ']', elements);
985
- case 47:
969
+ case 43:
986
970
  case "end":
987
971
  return _context.stop();
988
972
  }
989
- }, _callee, null, [[10, 14, 15, 16], [18, 22, 23, 24], [30, 35, 36, 37]]);
973
+ }, _callee, null, [[10, 14, 15, 16], [18, 22, 23, 24], [26, 31, 32, 33]]);
990
974
  })();
991
975
  },
992
976
  /**
@@ -1227,7 +1211,7 @@ var LeUtils = {
1227
1211
  add = function add(value, index) {
1228
1212
  collection.set(index, value);
1229
1213
  };
1230
- } else if (typeof elements === 'string' || typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function' || typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function') {
1214
+ } else if (typeof elements !== 'string' && (typeof (elements === null || elements === void 0 ? void 0 : elements[Symbol.iterator]) === 'function' || typeof (elements === null || elements === void 0 ? void 0 : elements.forEach) === 'function')) {
1231
1215
  collection = [];
1232
1216
  add = function add(value, index) {
1233
1217
  collection.push(value);
@@ -1411,7 +1395,7 @@ var LeUtils = {
1411
1395
  */
1412
1396
  flattenToArray: function () {
1413
1397
  var _flattenToArrayRecursive = function flattenToArrayRecursive(result, elements, optionalSkipHasOwnPropertyCheck) {
1414
- if (!LeUtils.supportsEach(elements) || typeof elements === 'string') {
1398
+ if (!LeUtils.supportsEach(elements)) {
1415
1399
  result.push(elements);
1416
1400
  return;
1417
1401
  }
@@ -1421,7 +1405,7 @@ var LeUtils = {
1421
1405
  };
1422
1406
  return function (elements) {
1423
1407
  var optionalSkipHasOwnPropertyCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1424
- if (!LeUtils.supportsEach(elements) || typeof elements === 'string') {
1408
+ if (!LeUtils.supportsEach(elements)) {
1425
1409
  return [elements];
1426
1410
  }
1427
1411
  var result = [];
@@ -1606,7 +1590,7 @@ var LeUtils = {
1606
1590
  * @returns {{remove:Function}}
1607
1591
  */
1608
1592
  setTimeout: function setTimeout(callback, ms) {
1609
- var _performance$now, _performance, _performance$now2;
1593
+ var _globalThis$performan, _globalThis$performan2, _globalThis$performan3;
1610
1594
  if (!(globalThis !== null && globalThis !== void 0 && globalThis.setTimeout) || !(globalThis !== null && globalThis !== void 0 && globalThis.clearTimeout)) {
1611
1595
  console.warn('LeUtils.setTimeout() called in an environment without globalThis.setTimeout, returning a no-op handler.');
1612
1596
  return {
@@ -1614,11 +1598,11 @@ var LeUtils = {
1614
1598
  };
1615
1599
  }
1616
1600
  ms = FLOAT_LAX(ms);
1617
- var lastTime = (_performance$now = (_performance = performance) === null || _performance === void 0 || (_performance$now2 = _performance.now) === null || _performance$now2 === void 0 ? void 0 : _performance$now2.call(_performance)) !== null && _performance$now !== void 0 ? _performance$now : 0;
1601
+ var lastTime = (_globalThis$performan = globalThis === null || globalThis === void 0 || (_globalThis$performan2 = globalThis.performance) === null || _globalThis$performan2 === void 0 || (_globalThis$performan3 = _globalThis$performan2.now) === null || _globalThis$performan3 === void 0 ? void 0 : _globalThis$performan3.call(_globalThis$performan2)) !== null && _globalThis$performan !== void 0 ? _globalThis$performan : 0;
1618
1602
  /** @type {number|null} */
1619
1603
  var handler = globalThis.setTimeout(function () {
1620
- var _performance$now3, _performance2, _performance2$now;
1621
- var currentTime = (_performance$now3 = (_performance2 = performance) === null || _performance2 === void 0 || (_performance2$now = _performance2.now) === null || _performance2$now === void 0 ? void 0 : _performance2$now.call(_performance2)) !== null && _performance$now3 !== void 0 ? _performance$now3 : 0;
1604
+ var _globalThis$performan4, _globalThis$performan5, _globalThis$performan6;
1605
+ var currentTime = (_globalThis$performan4 = globalThis === null || globalThis === void 0 || (_globalThis$performan5 = globalThis.performance) === null || _globalThis$performan5 === void 0 || (_globalThis$performan6 = _globalThis$performan5.now) === null || _globalThis$performan6 === void 0 ? void 0 : _globalThis$performan6.call(_globalThis$performan5)) !== null && _globalThis$performan4 !== void 0 ? _globalThis$performan4 : 0;
1622
1606
  try {
1623
1607
  callback((currentTime - lastTime) / 1000);
1624
1608
  } catch (e) {
@@ -1646,7 +1630,7 @@ var LeUtils = {
1646
1630
  * @returns {{remove:Function}}
1647
1631
  */
1648
1632
  setInterval: function setInterval(callback) {
1649
- var _performance$now4, _performance3, _performance3$now;
1633
+ var _globalThis$performan7, _globalThis$performan8, _globalThis$performan9;
1650
1634
  var intervalMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
1651
1635
  var fireImmediately = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1652
1636
  intervalMs = FLOAT_LAX_ANY(intervalMs, 1000);
@@ -1663,11 +1647,11 @@ var LeUtils = {
1663
1647
  remove: function remove() {}
1664
1648
  };
1665
1649
  }
1666
- var lastTime = (_performance$now4 = (_performance3 = performance) === null || _performance3 === void 0 || (_performance3$now = _performance3.now) === null || _performance3$now === void 0 ? void 0 : _performance3$now.call(_performance3)) !== null && _performance$now4 !== void 0 ? _performance$now4 : 0;
1650
+ var lastTime = (_globalThis$performan7 = globalThis === null || globalThis === void 0 || (_globalThis$performan8 = globalThis.performance) === null || _globalThis$performan8 === void 0 || (_globalThis$performan9 = _globalThis$performan8.now) === null || _globalThis$performan9 === void 0 ? void 0 : _globalThis$performan9.call(_globalThis$performan8)) !== null && _globalThis$performan7 !== void 0 ? _globalThis$performan7 : 0;
1667
1651
  /** @type {number|null} */
1668
1652
  var handler = globalThis.setInterval(function () {
1669
- var _performance$now5, _performance4, _performance4$now;
1670
- var currentTime = (_performance$now5 = (_performance4 = performance) === null || _performance4 === void 0 || (_performance4$now = _performance4.now) === null || _performance4$now === void 0 ? void 0 : _performance4$now.call(_performance4)) !== null && _performance$now5 !== void 0 ? _performance$now5 : 0;
1653
+ var _globalThis$performan0, _globalThis$performan1, _globalThis$performan10;
1654
+ var currentTime = (_globalThis$performan0 = globalThis === null || globalThis === void 0 || (_globalThis$performan1 = globalThis.performance) === null || _globalThis$performan1 === void 0 || (_globalThis$performan10 = _globalThis$performan1.now) === null || _globalThis$performan10 === void 0 ? void 0 : _globalThis$performan10.call(_globalThis$performan1)) !== null && _globalThis$performan0 !== void 0 ? _globalThis$performan0 : 0;
1671
1655
  try {
1672
1656
  callback((currentTime - lastTime) / 1000);
1673
1657
  } catch (e) {
@@ -1694,7 +1678,7 @@ var LeUtils = {
1694
1678
  * @returns {{remove:Function}}
1695
1679
  */
1696
1680
  setAnimationFrameTimeout: function setAnimationFrameTimeout(callback) {
1697
- var _performance$now6, _performance5, _performance5$now;
1681
+ var _globalThis$performan11, _globalThis$performan12, _globalThis$performan13;
1698
1682
  var frames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1699
1683
  if (!(globalThis !== null && globalThis !== void 0 && globalThis.requestAnimationFrame) || !(globalThis !== null && globalThis !== void 0 && globalThis.cancelAnimationFrame)) {
1700
1684
  console.warn('LeUtils.setAnimationFrameTimeout() called in an environment without globalThis.requestAnimationFrame, returning a no-op handler.');
@@ -1705,14 +1689,14 @@ var LeUtils = {
1705
1689
  frames = INT_LAX_ANY(frames, 1);
1706
1690
  var run = true;
1707
1691
  var requestAnimationFrameId = null;
1708
- var lastTime = (_performance$now6 = (_performance5 = performance) === null || _performance5 === void 0 || (_performance5$now = _performance5.now) === null || _performance5$now === void 0 ? void 0 : _performance5$now.call(_performance5)) !== null && _performance$now6 !== void 0 ? _performance$now6 : 0;
1692
+ var lastTime = (_globalThis$performan11 = globalThis === null || globalThis === void 0 || (_globalThis$performan12 = globalThis.performance) === null || _globalThis$performan12 === void 0 || (_globalThis$performan13 = _globalThis$performan12.now) === null || _globalThis$performan13 === void 0 ? void 0 : _globalThis$performan13.call(_globalThis$performan12)) !== null && _globalThis$performan11 !== void 0 ? _globalThis$performan11 : 0;
1709
1693
  var _tick = function tick() {
1710
1694
  if (run) {
1711
1695
  if (frames <= 0) {
1712
- var _performance$now7, _performance6, _performance6$now;
1696
+ var _globalThis$performan14, _globalThis$performan15, _globalThis$performan16;
1713
1697
  run = false;
1714
1698
  requestAnimationFrameId = null;
1715
- var currentTime = (_performance$now7 = (_performance6 = performance) === null || _performance6 === void 0 || (_performance6$now = _performance6.now) === null || _performance6$now === void 0 ? void 0 : _performance6$now.call(_performance6)) !== null && _performance$now7 !== void 0 ? _performance$now7 : 0;
1699
+ var currentTime = (_globalThis$performan14 = globalThis === null || globalThis === void 0 || (_globalThis$performan15 = globalThis.performance) === null || _globalThis$performan15 === void 0 || (_globalThis$performan16 = _globalThis$performan15.now) === null || _globalThis$performan16 === void 0 ? void 0 : _globalThis$performan16.call(_globalThis$performan15)) !== null && _globalThis$performan14 !== void 0 ? _globalThis$performan14 : 0;
1716
1700
  try {
1717
1701
  callback((currentTime - lastTime) / 1000);
1718
1702
  } catch (e) {
@@ -1747,7 +1731,7 @@ var LeUtils = {
1747
1731
  * @returns {{remove:Function}}
1748
1732
  */
1749
1733
  setAnimationFrameInterval: function setAnimationFrameInterval(callback) {
1750
- var _performance$now8, _performance7, _performance7$now;
1734
+ var _globalThis$performan17, _globalThis$performan18, _globalThis$performan19;
1751
1735
  var intervalFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1752
1736
  var fireImmediately = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1753
1737
  intervalFrames = INT_LAX_ANY(intervalFrames, 1);
@@ -1766,13 +1750,13 @@ var LeUtils = {
1766
1750
  }
1767
1751
  var run = true;
1768
1752
  var requestAnimationFrameId = null;
1769
- var lastTime = (_performance$now8 = (_performance7 = performance) === null || _performance7 === void 0 || (_performance7$now = _performance7.now) === null || _performance7$now === void 0 ? void 0 : _performance7$now.call(_performance7)) !== null && _performance$now8 !== void 0 ? _performance$now8 : 0;
1753
+ var lastTime = (_globalThis$performan17 = globalThis === null || globalThis === void 0 || (_globalThis$performan18 = globalThis.performance) === null || _globalThis$performan18 === void 0 || (_globalThis$performan19 = _globalThis$performan18.now) === null || _globalThis$performan19 === void 0 ? void 0 : _globalThis$performan19.call(_globalThis$performan18)) !== null && _globalThis$performan17 !== void 0 ? _globalThis$performan17 : 0;
1770
1754
  var frames = intervalFrames;
1771
1755
  var _tick2 = function tick() {
1772
1756
  if (run) {
1773
1757
  if (frames <= 0) {
1774
- var _performance$now9, _performance8, _performance8$now;
1775
- var currentTime = (_performance$now9 = (_performance8 = performance) === null || _performance8 === void 0 || (_performance8$now = _performance8.now) === null || _performance8$now === void 0 ? void 0 : _performance8$now.call(_performance8)) !== null && _performance$now9 !== void 0 ? _performance$now9 : 0;
1758
+ var _globalThis$performan20, _globalThis$performan21, _globalThis$performan22;
1759
+ var currentTime = (_globalThis$performan20 = globalThis === null || globalThis === void 0 || (_globalThis$performan21 = globalThis.performance) === null || _globalThis$performan21 === void 0 || (_globalThis$performan22 = _globalThis$performan21.now) === null || _globalThis$performan22 === void 0 ? void 0 : _globalThis$performan22.call(_globalThis$performan21)) !== null && _globalThis$performan20 !== void 0 ? _globalThis$performan20 : 0;
1776
1760
  try {
1777
1761
  callback((currentTime - lastTime) / 1000);
1778
1762
  } catch (e) {
@@ -2283,7 +2267,7 @@ var LeUtils = {
2283
2267
  for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) {
2284
2268
  names[_key] = arguments[_key];
2285
2269
  }
2286
- names = LeUtils.flattenArray(names).map(function (name) {
2270
+ names = LeUtils.flattenToArray(names).map(function (name) {
2287
2271
  return STRING(name).trim().toLowerCase();
2288
2272
  }).filter(function (name) {
2289
2273
  return name.length > 0;
@@ -2319,17 +2303,17 @@ var LeUtils = {
2319
2303
  if (string === '') {
2320
2304
  return '1';
2321
2305
  }
2322
- for (var _i7 = string.length - 1; _i7 >= 0; _i7--) {
2323
- var _c = string.charAt(_i7);
2306
+ for (var _i6 = string.length - 1; _i6 >= 0; _i6--) {
2307
+ var _c = string.charAt(_i6);
2324
2308
  if (_c < '0' || _c > '9') {
2325
2309
  return '1';
2326
2310
  }
2327
2311
  if (_c < '9') {
2328
2312
  _c = String.fromCharCode(_c.charCodeAt(0) + 1);
2329
- string = string.substring(0, _i7) + _c + string.substring(_i7 + 1); // string[i] = (char + 1);
2313
+ string = string.substring(0, _i6) + _c + string.substring(_i6 + 1); // string[i] = (char + 1);
2330
2314
  break;
2331
2315
  }
2332
- string = string.substring(0, _i7) + '0' + string.substring(_i7 + 1); // string[i] = '0';
2316
+ string = string.substring(0, _i6) + '0' + string.substring(_i6 + 1); // string[i] = '0';
2333
2317
  }
2334
2318
  if (string.charAt(0) === '0') {
2335
2319
  string = '1' + string;
@@ -2358,9 +2342,9 @@ var LeUtils = {
2358
2342
  var generateUniqueId = function generateUniqueId() {
2359
2343
  var now;
2360
2344
  try {
2361
- var _performance9, _performance0, _performance$now0, _performance1, _performance1$now;
2345
+ var _globalThis$performan23, _globalThis$performan24, _globalThis$performan25, _globalThis$performan26, _globalThis$performan27;
2362
2346
  // noinspection JSDeprecatedSymbols
2363
- now = (((_performance9 = performance) === null || _performance9 === void 0 ? void 0 : _performance9.timeOrigin) || ((_performance0 = performance) === null || _performance0 === void 0 || (_performance0 = _performance0.timing) === null || _performance0 === void 0 ? void 0 : _performance0.navigationStart) || 0) + ((_performance$now0 = (_performance1 = performance) === null || _performance1 === void 0 || (_performance1$now = _performance1.now) === null || _performance1$now === void 0 ? void 0 : _performance1$now.call(_performance1)) !== null && _performance$now0 !== void 0 ? _performance$now0 : 0);
2347
+ now = ((globalThis === null || globalThis === void 0 || (_globalThis$performan23 = globalThis.performance) === null || _globalThis$performan23 === void 0 ? void 0 : _globalThis$performan23.timeOrigin) || (globalThis === null || globalThis === void 0 || (_globalThis$performan24 = globalThis.performance) === null || _globalThis$performan24 === void 0 || (_globalThis$performan24 = _globalThis$performan24.timing) === null || _globalThis$performan24 === void 0 ? void 0 : _globalThis$performan24.navigationStart) || 0) + ((_globalThis$performan25 = globalThis === null || globalThis === void 0 || (_globalThis$performan26 = globalThis.performance) === null || _globalThis$performan26 === void 0 || (_globalThis$performan27 = _globalThis$performan26.now) === null || _globalThis$performan27 === void 0 ? void 0 : _globalThis$performan27.call(_globalThis$performan26)) !== null && _globalThis$performan25 !== void 0 ? _globalThis$performan25 : 0);
2364
2348
  } catch (e) {}
2365
2349
  now = now || (Date.now ? Date.now() : new Date().getTime());
2366
2350
  now = Math.round(now);
@@ -2431,9 +2415,9 @@ var LeUtils = {
2431
2415
  now = FLOAT_LAX(now);
2432
2416
  } else {
2433
2417
  try {
2434
- var _performance10, _performance11, _performance$now1, _performance12, _performance12$now;
2418
+ var _performance, _performance2, _performance$now, _performance3, _performance3$now;
2435
2419
  // noinspection JSDeprecatedSymbols
2436
- now = (((_performance10 = performance) === null || _performance10 === void 0 ? void 0 : _performance10.timeOrigin) || ((_performance11 = performance) === null || _performance11 === void 0 || (_performance11 = _performance11.timing) === null || _performance11 === void 0 ? void 0 : _performance11.navigationStart) || 0) + ((_performance$now1 = (_performance12 = performance) === null || _performance12 === void 0 || (_performance12$now = _performance12.now) === null || _performance12$now === void 0 ? void 0 : _performance12$now.call(_performance12)) !== null && _performance$now1 !== void 0 ? _performance$now1 : 0);
2420
+ now = (((_performance = performance) === null || _performance === void 0 ? void 0 : _performance.timeOrigin) || ((_performance2 = performance) === null || _performance2 === void 0 || (_performance2 = _performance2.timing) === null || _performance2 === void 0 ? void 0 : _performance2.navigationStart) || 0) + ((_performance$now = (_performance3 = performance) === null || _performance3 === void 0 || (_performance3$now = _performance3.now) === null || _performance3$now === void 0 ? void 0 : _performance3$now.call(_performance3)) !== null && _performance$now !== void 0 ? _performance$now : 0);
2437
2421
  } catch (e) {}
2438
2422
  now = now || (Date.now ? Date.now() : new Date().getTime());
2439
2423
  }