hlp 3.7.7 → 3.7.8

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.
@@ -117,6 +117,9 @@ class hlp {
117
117
  return false;
118
118
  }
119
119
  static v() {
120
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
121
+ args[_key] = arguments[_key];
122
+ }
120
123
  if (this.nx(arguments)) {
121
124
  return '';
122
125
  }
@@ -142,7 +145,8 @@ class hlp {
142
145
  });
143
146
  }
144
147
  }
145
- static map(obj, fn, ctx) {
148
+ static map(obj, fn) {
149
+ let ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
146
150
  return Object.keys(obj).reduce((a, b) => {
147
151
  a[b] = fn.call(ctx || null, b, obj[b]);
148
152
  return a;
@@ -193,8 +197,8 @@ class hlp {
193
197
  return input[Math.floor(Math.random() * input.length)];
194
198
  }
195
199
  if (typeof input === 'object') {
196
- var input = Object.values(input);
197
- return input[Math.floor(Math.random() * input.length)];
200
+ var inputArr = Object.values(input);
201
+ return inputArr[Math.floor(Math.random() * inputArr.length)];
198
202
  }
199
203
  return null;
200
204
  }
@@ -435,10 +439,12 @@ class hlp {
435
439
  }
436
440
  return browser_name;
437
441
  }
438
- static isObject(a) {
442
+ static isObject() {
443
+ let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
439
444
  return !!a && a.constructor === Object;
440
445
  }
441
- static isArray(a) {
446
+ static isArray() {
447
+ let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
442
448
  return !!a && a.constructor === Array;
443
449
  }
444
450
  static isString(string) {
@@ -524,20 +530,19 @@ class hlp {
524
530
  prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
525
531
  sep = typeof thousands_sep === 'undefined' ? ',' : thousands_sep,
526
532
  dec = typeof dec_point === 'undefined' ? '.' : dec_point,
527
- s = '',
528
533
  toFixedFix = function (n, prec) {
529
534
  var k = Math.pow(10, prec);
530
535
  return '' + Math.round(n * k) / k;
531
536
  };
532
- s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
533
- if (s[0].length > 3) {
534
- s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
537
+ let sArr = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
538
+ if (sArr[0].length > 3) {
539
+ sArr[0] = sArr[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
535
540
  }
536
- if ((s[1] || '').length < prec) {
537
- s[1] = s[1] || '';
538
- s[1] += new Array(prec - s[1].length + 1).join('0');
541
+ if ((sArr[1] || '').length < prec) {
542
+ sArr[1] = sArr[1] || '';
543
+ sArr[1] += new Array(prec - sArr[1].length + 1).join('0');
539
544
  }
540
- return s.join(dec);
545
+ return sArr.join(dec);
541
546
  }
542
547
  static formatDate(format) {
543
548
  let date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -722,7 +727,8 @@ class hlp {
722
727
  let regExp = new RegExp(value, 'gi');
723
728
  return (str.match(regExp) || []).length;
724
729
  }
725
- static indexOfCaseInsensitive(searchStr, str, offset) {
730
+ static indexOfCaseInsensitive(searchStr, str) {
731
+ let offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
726
732
  return str.toLowerCase().indexOf(searchStr.toLowerCase(), offset);
727
733
  }
728
734
  static highlight(string, query) {
@@ -980,7 +986,7 @@ class hlp {
980
986
  year = new Date().getFullYear();
981
987
  }
982
988
  let date = new Date();
983
- date.setYear(year);
989
+ date.setFullYear(year);
984
990
  date.setDate(1);
985
991
  date.setMonth(0);
986
992
  date.setHours(0);
@@ -1190,8 +1196,8 @@ class hlp {
1190
1196
  let {
1191
1197
  style
1192
1198
  } = a;
1193
- style.top = pos < 2 ? 0 : `${dim}%`;
1194
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
1199
+ style.top = pos < 2 ? '0' : `${dim}%`;
1200
+ style.left = pos % 2 === 0 ? '0' : `${dim}%`;
1195
1201
  style.width = style.height = `${dim}%`;
1196
1202
  document.body.appendChild(a);
1197
1203
  return a;
@@ -1219,8 +1225,8 @@ class hlp {
1219
1225
  style
1220
1226
  } = _ref6;
1221
1227
  if (reset) {
1222
- style.top = pos < 2 ? 0 : `${dim}%`;
1223
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
1228
+ style.top = pos < 2 ? '0' : `${dim}%`;
1229
+ style.left = pos % 2 === 0 ? '0' : `${dim}%`;
1224
1230
  style.width = style.height = `${dim}%`;
1225
1231
  } else {
1226
1232
  style.top = pos < 2 ? `${top}%` : `${top + dim}%`;
@@ -1276,17 +1282,18 @@ class hlp {
1276
1282
  element = document.scrollingElement || document.documentElement;
1277
1283
  }
1278
1284
  if (!hlp.isNumeric(to)) {
1279
- if (element === (document.scrollingElement || documentElement)) {
1285
+ if (element === (document.scrollingElement || document.documentElement)) {
1280
1286
  to = this.offsetTopWithMargin(to);
1281
1287
  } else {
1282
1288
  to = to.getBoundingClientRect().top - parseInt(getComputedStyle(to).marginTop) - (element.getBoundingClientRect().top - element.scrollTop - parseInt(getComputedStyle(element).marginTop));
1283
1289
  }
1284
1290
  }
1285
1291
  let offset_calc = 0;
1286
- if (!Array.isArray(offset)) {
1287
- offset = [offset];
1292
+ let offsetArr = offset;
1293
+ if (!Array.isArray(offsetArr)) {
1294
+ offsetArr = [offsetArr];
1288
1295
  }
1289
- offset.forEach(offset__value => {
1296
+ offsetArr.forEach(offset__value => {
1290
1297
  if (hlp.isNumeric(offset__value)) {
1291
1298
  offset_calc += offset__value;
1292
1299
  } else {
@@ -1494,11 +1501,11 @@ class hlp {
1494
1501
  from.split(';').forEach(from__value => {
1495
1502
  properties.push(from__value.split(':')[0].trim());
1496
1503
  });
1497
- let transition = [];
1504
+ let transitionArr = [];
1498
1505
  properties.forEach(properties__value => {
1499
- transition.push(properties__value + ' ' + Math.round(duration / 1000 * 10) / 10 + 's ' + easing);
1506
+ transitionArr.push(properties__value + ' ' + Math.round(duration / 1000 * 10) / 10 + 's ' + easing);
1500
1507
  });
1501
- transition = 'transition: ' + transition.join(', ') + ' !important;';
1508
+ let transition = 'transition: ' + transitionArr.join(', ') + ' !important;';
1502
1509
  let els = null;
1503
1510
  if (NodeList.prototype.isPrototypeOf(el)) {
1504
1511
  els = Array.from(el);
@@ -1515,17 +1522,18 @@ class hlp {
1515
1522
  els__value.classList.add(random_class);
1516
1523
  window.requestAnimationFrame(() => {
1517
1524
  // set from style inline (don't fully remove previous style)
1518
- let new_style = [];
1525
+ let new_style_arr = [];
1526
+ let new_style = '';
1519
1527
  let prev_style = els__value.getAttribute('style');
1520
1528
  if (prev_style !== null) {
1521
1529
  prev_style.split(';').forEach(prev_style__value => {
1522
1530
  if (prev_style__value != '' && !properties.includes(prev_style__value.split(':')[0].trim())) {
1523
- new_style.push(prev_style__value);
1531
+ new_style_arr.push(prev_style__value);
1524
1532
  }
1525
1533
  });
1526
1534
  }
1527
- if (new_style.length > 0) {
1528
- new_style = new_style.join(';') + ';' + from + ';';
1535
+ if (new_style_arr.length > 0) {
1536
+ new_style = new_style_arr.join(';') + ';' + from + ';';
1529
1537
  } else {
1530
1538
  new_style = from + ';';
1531
1539
  }
@@ -1597,7 +1605,9 @@ class hlp {
1597
1605
  });
1598
1606
  });
1599
1607
  }
1600
- static addEventListenerOnce(target, type, listener, addOptions, removeOptions) {
1608
+ static addEventListenerOnce(target, type, listener) {
1609
+ let addOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
1610
+ let removeOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
1601
1611
  target.addEventListener(type, function fn(event) {
1602
1612
  let result = listener.apply(this, arguments, addOptions);
1603
1613
  if (result !== false) {
@@ -1877,7 +1887,7 @@ class hlp {
1877
1887
  }
1878
1888
  static querySelectorAllShadowDom(selector) {
1879
1889
  let traverse = function ($parent) {
1880
- $els = [];
1890
+ let $els = [];
1881
1891
  if ($parent.querySelector('*') !== null) {
1882
1892
  $parent.querySelectorAll('*').forEach($el => {
1883
1893
  $els.push($el);
@@ -1889,7 +1899,7 @@ class hlp {
1889
1899
  return $els;
1890
1900
  };
1891
1901
  let fragment = document.createDocumentFragment();
1892
- $els = traverse(document);
1902
+ let $els = traverse(document);
1893
1903
  $els.forEach($el => {
1894
1904
  if ($el.matches(selector)) {
1895
1905
  fragment.appendChild($el.cloneNode());
@@ -1909,19 +1919,19 @@ class hlp {
1909
1919
  let mask = document.createElement('div');
1910
1920
  mask.classList.add('hlp-focus-mask');
1911
1921
  mask.style.position = 'fixed';
1912
- mask.style.top = 0;
1913
- mask.style.bottom = 0;
1914
- mask.style.left = 0;
1915
- mask.style.right = 0;
1922
+ mask.style.top = '0';
1923
+ mask.style.bottom = '0';
1924
+ mask.style.left = '0';
1925
+ mask.style.right = '0';
1916
1926
  mask.style.backgroundColor = 'rgba(0,0,0,0.8)';
1917
- mask.style.zIndex = 2147483646;
1927
+ mask.style.zIndex = '2147483646';
1918
1928
  el.before(mask);
1919
- el.setAttribute('data-focussed', 1);
1929
+ el.setAttribute('data-focussed', '1');
1920
1930
  el.setAttribute('data-focussed-orig-z-index', el.style.zIndex);
1921
1931
  el.setAttribute('data-focussed-orig-position', el.style.position);
1922
1932
  el.setAttribute('data-focussed-orig-background-color', el.style.backgroundColor);
1923
1933
  el.setAttribute('data-focussed-orig-box-shadow', el.style.boxShadow);
1924
- el.style.zIndex = 2147483647;
1934
+ el.style.zIndex = '2147483647';
1925
1935
  el.style.position = 'relative';
1926
1936
  el.style.backgroundColor = '#ffffff';
1927
1937
  el.style.boxShadow = '0px 0px 0px 20px #fff';
@@ -2191,7 +2201,8 @@ class hlp {
2191
2201
  }[op];
2192
2202
  return Math.round(n * 10 * Math.pow(10, precision)) / (10 * Math.pow(10, precision));
2193
2203
  }
2194
- static trim(str, charlist) {
2204
+ static trim(str) {
2205
+ let charlist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2195
2206
  let whitespace = [' ', '\n', '\r', '\t', '\f', '\x0b', '\xa0', '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200a', '\u200b', '\u2028', '\u2029', '\u3000'].join('');
2196
2207
  let l = 0;
2197
2208
  let i = 0;
@@ -2215,12 +2226,14 @@ class hlp {
2215
2226
  }
2216
2227
  return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
2217
2228
  }
2218
- static ltrim(str, charlist) {
2229
+ static ltrim(str) {
2230
+ let charlist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2219
2231
  charlist = !charlist ? ' \\s\u00A0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1');
2220
2232
  const re = new RegExp('^[' + charlist + ']+', 'g');
2221
2233
  return (str + '').replace(re, '');
2222
2234
  }
2223
- static rtrim(str, charlist) {
2235
+ static rtrim(str) {
2236
+ let charlist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2224
2237
  charlist = !charlist ? ' \\s\u00A0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '\\$1');
2225
2238
  const re = new RegExp('[' + charlist + ']+$', 'g');
2226
2239
  return (str + '').replace(re, '');
@@ -2606,9 +2619,7 @@ class hlp {
2606
2619
  return this.blobtofile(this.base64toblob(base64, contentType), filename);
2607
2620
  }
2608
2621
  static blobtourl(blob) {
2609
- return URL.createObjectURL(blob, {
2610
- type: 'text/plain'
2611
- });
2622
+ return URL.createObjectURL(blob);
2612
2623
  }
2613
2624
  static stringtourl(string) {
2614
2625
  return this.blobtourl(this.stringtoblob(string));
package/hlp.esm.js CHANGED
@@ -55,7 +55,7 @@ var hlp = class hlp {
55
55
  if (input === "false") return true;
56
56
  return false;
57
57
  }
58
- static v() {
58
+ static v(...args) {
59
59
  if (this.nx(arguments)) return "";
60
60
  for (let i = 0; i < arguments.length; i++) if (this.x(arguments[i])) return arguments[i];
61
61
  return "";
@@ -69,7 +69,7 @@ var hlp = class hlp {
69
69
  fun(input__value, input__key);
70
70
  });
71
71
  }
72
- static map(obj, fn, ctx) {
72
+ static map(obj, fn, ctx = null) {
73
73
  return Object.keys(obj).reduce((a, b) => {
74
74
  a[b] = fn.call(ctx || null, b, obj[b]);
75
75
  return a;
@@ -112,8 +112,8 @@ var hlp = class hlp {
112
112
  static rand(input) {
113
113
  if (Array.isArray(input)) return input[Math.floor(Math.random() * input.length)];
114
114
  if (typeof input === "object") {
115
- var input = Object.values(input);
116
- return input[Math.floor(Math.random() * input.length)];
115
+ var inputArr = Object.values(input);
116
+ return inputArr[Math.floor(Math.random() * inputArr.length)];
117
117
  }
118
118
  return null;
119
119
  }
@@ -277,10 +277,10 @@ var hlp = class hlp {
277
277
  else browser_name = "unknown";
278
278
  return browser_name;
279
279
  }
280
- static isObject(a) {
280
+ static isObject(a = null) {
281
281
  return !!a && a.constructor === Object;
282
282
  }
283
- static isArray(a) {
283
+ static isArray(a = null) {
284
284
  return !!a && a.constructor === Array;
285
285
  }
286
286
  static isString(string) {
@@ -328,17 +328,17 @@ var hlp = class hlp {
328
328
  }
329
329
  static formatNumber(number, decimals = 0, dec_point = ".", thousands_sep = ",") {
330
330
  number = (number + "").replace(/[^0-9+\-Ee.]/g, "");
331
- var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = typeof thousands_sep === "undefined" ? "," : thousands_sep, dec = typeof dec_point === "undefined" ? "." : dec_point, s = "", toFixedFix = function(n, prec) {
331
+ var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = typeof thousands_sep === "undefined" ? "," : thousands_sep, dec = typeof dec_point === "undefined" ? "." : dec_point, toFixedFix = function(n, prec) {
332
332
  var k = Math.pow(10, prec);
333
333
  return "" + Math.round(n * k) / k;
334
334
  };
335
- s = (prec ? toFixedFix(n, prec) : "" + Math.round(n)).split(".");
336
- if (s[0].length > 3) s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
337
- if ((s[1] || "").length < prec) {
338
- s[1] = s[1] || "";
339
- s[1] += new Array(prec - s[1].length + 1).join("0");
335
+ let sArr = (prec ? toFixedFix(n, prec) : "" + Math.round(n)).split(".");
336
+ if (sArr[0].length > 3) sArr[0] = sArr[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
337
+ if ((sArr[1] || "").length < prec) {
338
+ sArr[1] = sArr[1] || "";
339
+ sArr[1] += new Array(prec - sArr[1].length + 1).join("0");
340
340
  }
341
- return s.join(dec);
341
+ return sArr.join(dec);
342
342
  }
343
343
  static formatDate(format, date = null) {
344
344
  if (date === false || date === true || date === null || date === "") date = /* @__PURE__ */ new Date();
@@ -488,7 +488,7 @@ var hlp = class hlp {
488
488
  let regExp = new RegExp(value, "gi");
489
489
  return (str.match(regExp) || []).length;
490
490
  }
491
- static indexOfCaseInsensitive(searchStr, str, offset) {
491
+ static indexOfCaseInsensitive(searchStr, str, offset = 0) {
492
492
  return str.toLowerCase().indexOf(searchStr.toLowerCase(), offset);
493
493
  }
494
494
  static highlight(string, query, strip = false, strip_length = 500) {
@@ -659,7 +659,7 @@ var hlp = class hlp {
659
659
  static weekToDate(week, year) {
660
660
  if (year == null) year = (/* @__PURE__ */ new Date()).getFullYear();
661
661
  let date = /* @__PURE__ */ new Date();
662
- date.setYear(year);
662
+ date.setFullYear(year);
663
663
  date.setDate(1);
664
664
  date.setMonth(0);
665
665
  date.setHours(0);
@@ -821,8 +821,8 @@ var hlp = class hlp {
821
821
  let a = document.createElement("a");
822
822
  a.classList.add("find-pointer-quad");
823
823
  let { style } = a;
824
- style.top = pos < 2 ? 0 : `${dim}%`;
825
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
824
+ style.top = pos < 2 ? "0" : `${dim}%`;
825
+ style.left = pos % 2 === 0 ? "0" : `${dim}%`;
826
826
  style.width = style.height = `${dim}%`;
827
827
  document.body.appendChild(a);
828
828
  return a;
@@ -851,8 +851,8 @@ var hlp = class hlp {
851
851
  let left = parseFloat(q1.style.left) - dim / 2;
852
852
  window.cursorPositionQuads.forEach(({ style }, pos) => {
853
853
  if (reset) {
854
- style.top = pos < 2 ? 0 : `${dim}%`;
855
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
854
+ style.top = pos < 2 ? "0" : `${dim}%`;
855
+ style.left = pos % 2 === 0 ? "0" : `${dim}%`;
856
856
  style.width = style.height = `${dim}%`;
857
857
  } else {
858
858
  style.top = pos < 2 ? `${top}%` : `${top + dim}%`;
@@ -890,11 +890,12 @@ var hlp = class hlp {
890
890
  static scrollTo(to, duration = 1e3, element = null, offset = 0, only_up = false) {
891
891
  return new Promise((resolve) => {
892
892
  if (element === null) element = document.scrollingElement || document.documentElement;
893
- if (!hlp.isNumeric(to)) if (element === (document.scrollingElement || documentElement)) to = this.offsetTopWithMargin(to);
893
+ if (!hlp.isNumeric(to)) if (element === (document.scrollingElement || document.documentElement)) to = this.offsetTopWithMargin(to);
894
894
  else to = to.getBoundingClientRect().top - parseInt(getComputedStyle(to).marginTop) - (element.getBoundingClientRect().top - element.scrollTop - parseInt(getComputedStyle(element).marginTop));
895
895
  let offset_calc = 0;
896
- if (!Array.isArray(offset)) offset = [offset];
897
- offset.forEach((offset__value) => {
896
+ let offsetArr = offset;
897
+ if (!Array.isArray(offsetArr)) offsetArr = [offsetArr];
898
+ offsetArr.forEach((offset__value) => {
898
899
  if (hlp.isNumeric(offset__value)) offset_calc += offset__value;
899
900
  else if (offset__value !== null) {
900
901
  if (window.getComputedStyle(offset__value).position === "fixed") offset_calc += -1 * offset__value.offsetHeight;
@@ -1050,11 +1051,11 @@ var hlp = class hlp {
1050
1051
  from.split(";").forEach((from__value) => {
1051
1052
  properties.push(from__value.split(":")[0].trim());
1052
1053
  });
1053
- let transition = [];
1054
+ let transitionArr = [];
1054
1055
  properties.forEach((properties__value) => {
1055
- transition.push(properties__value + " " + Math.round(duration / 1e3 * 10) / 10 + "s " + easing);
1056
+ transitionArr.push(properties__value + " " + Math.round(duration / 1e3 * 10) / 10 + "s " + easing);
1056
1057
  });
1057
- transition = "transition: " + transition.join(", ") + " !important;";
1058
+ let transition = "transition: " + transitionArr.join(", ") + " !important;";
1058
1059
  let els = null;
1059
1060
  if (NodeList.prototype.isPrototypeOf(el)) els = Array.from(el);
1060
1061
  else if (el === null) {
@@ -1066,12 +1067,13 @@ var hlp = class hlp {
1066
1067
  let random_class = hlp.random_string(10, "abcdefghijklmnopqrstuvwxyz");
1067
1068
  els__value.classList.add(random_class);
1068
1069
  window.requestAnimationFrame(() => {
1069
- let new_style = [];
1070
+ let new_style_arr = [];
1071
+ let new_style = "";
1070
1072
  let prev_style = els__value.getAttribute("style");
1071
1073
  if (prev_style !== null) prev_style.split(";").forEach((prev_style__value) => {
1072
- if (prev_style__value != "" && !properties.includes(prev_style__value.split(":")[0].trim())) new_style.push(prev_style__value);
1074
+ if (prev_style__value != "" && !properties.includes(prev_style__value.split(":")[0].trim())) new_style_arr.push(prev_style__value);
1073
1075
  });
1074
- if (new_style.length > 0) new_style = new_style.join(";") + ";" + from + ";";
1076
+ if (new_style_arr.length > 0) new_style = new_style_arr.join(";") + ";" + from + ";";
1075
1077
  else new_style = from + ";";
1076
1078
  els__value.setAttribute("style", new_style);
1077
1079
  window.requestAnimationFrame(() => {
@@ -1112,7 +1114,7 @@ var hlp = class hlp {
1112
1114
  });
1113
1115
  });
1114
1116
  }
1115
- static addEventListenerOnce(target, type, listener, addOptions, removeOptions) {
1117
+ static addEventListenerOnce(target, type, listener, addOptions = void 0, removeOptions = void 0) {
1116
1118
  target.addEventListener(type, function fn(event) {
1117
1119
  if (listener.apply(this, arguments, addOptions) !== false) target.removeEventListener(type, fn, removeOptions);
1118
1120
  });
@@ -1316,7 +1318,7 @@ var hlp = class hlp {
1316
1318
  }
1317
1319
  static querySelectorAllShadowDom(selector) {
1318
1320
  let traverse = function($parent) {
1319
- $els = [];
1321
+ let $els = [];
1320
1322
  if ($parent.querySelector("*") !== null) $parent.querySelectorAll("*").forEach(($el) => {
1321
1323
  $els.push($el);
1322
1324
  if ($el.shadowRoot !== void 0 && $el.shadowRoot !== null) $els = $els.concat(traverse($el.shadowRoot));
@@ -1324,8 +1326,7 @@ var hlp = class hlp {
1324
1326
  return $els;
1325
1327
  };
1326
1328
  let fragment = document.createDocumentFragment();
1327
- $els = traverse(document);
1328
- $els.forEach(($el) => {
1329
+ traverse(document).forEach(($el) => {
1329
1330
  if ($el.matches(selector)) fragment.appendChild($el.cloneNode());
1330
1331
  });
1331
1332
  return fragment.childNodes;
@@ -1339,19 +1340,19 @@ var hlp = class hlp {
1339
1340
  let mask = document.createElement("div");
1340
1341
  mask.classList.add("hlp-focus-mask");
1341
1342
  mask.style.position = "fixed";
1342
- mask.style.top = 0;
1343
- mask.style.bottom = 0;
1344
- mask.style.left = 0;
1345
- mask.style.right = 0;
1343
+ mask.style.top = "0";
1344
+ mask.style.bottom = "0";
1345
+ mask.style.left = "0";
1346
+ mask.style.right = "0";
1346
1347
  mask.style.backgroundColor = "rgba(0,0,0,0.8)";
1347
- mask.style.zIndex = 2147483646;
1348
+ mask.style.zIndex = "2147483646";
1348
1349
  el.before(mask);
1349
- el.setAttribute("data-focussed", 1);
1350
+ el.setAttribute("data-focussed", "1");
1350
1351
  el.setAttribute("data-focussed-orig-z-index", el.style.zIndex);
1351
1352
  el.setAttribute("data-focussed-orig-position", el.style.position);
1352
1353
  el.setAttribute("data-focussed-orig-background-color", el.style.backgroundColor);
1353
1354
  el.setAttribute("data-focussed-orig-box-shadow", el.style.boxShadow);
1354
- el.style.zIndex = 2147483647;
1355
+ el.style.zIndex = "2147483647";
1355
1356
  el.style.position = "relative";
1356
1357
  el.style.backgroundColor = "#ffffff";
1357
1358
  el.style.boxShadow = "0px 0px 0px 20px #fff";
@@ -1560,7 +1561,7 @@ var hlp = class hlp {
1560
1561
  }[op];
1561
1562
  return Math.round(n * 10 * Math.pow(10, precision)) / (10 * Math.pow(10, precision));
1562
1563
  }
1563
- static trim(str, charlist) {
1564
+ static trim(str, charlist = null) {
1564
1565
  let whitespace = [
1565
1566
  " ",
1566
1567
  "\n",
@@ -1601,12 +1602,12 @@ var hlp = class hlp {
1601
1602
  }
1602
1603
  return whitespace.indexOf(str.charAt(0)) === -1 ? str : "";
1603
1604
  }
1604
- static ltrim(str, charlist) {
1605
+ static ltrim(str, charlist = null) {
1605
1606
  charlist = !charlist ? " \\s\xA0" : (charlist + "").replace(/([[\]().?/*{}+$^:])/g, "$1");
1606
1607
  const re = new RegExp("^[" + charlist + "]+", "g");
1607
1608
  return (str + "").replace(re, "");
1608
1609
  }
1609
- static rtrim(str, charlist) {
1610
+ static rtrim(str, charlist = null) {
1610
1611
  charlist = !charlist ? " \\s\xA0" : (charlist + "").replace(/([[\]().?/*{}+$^:])/g, "\\$1");
1611
1612
  const re = new RegExp("[" + charlist + "]+$", "g");
1612
1613
  return (str + "").replace(re, "");
@@ -1910,7 +1911,7 @@ var hlp = class hlp {
1910
1911
  return this.blobtofile(this.base64toblob(base64, contentType), filename);
1911
1912
  }
1912
1913
  static blobtourl(blob) {
1913
- return URL.createObjectURL(blob, { type: "text/plain" });
1914
+ return URL.createObjectURL(blob);
1914
1915
  }
1915
1916
  static stringtourl(string) {
1916
1917
  return this.blobtourl(this.stringtoblob(string));
package/hlp.js CHANGED
@@ -1 +1 @@
1
- var hlp=function(){var t=class t{static x(t){if("function"==typeof t)try{return t=t(),this.x(t)}catch(t){return!1}return!(null===t||!1===t||"string"==typeof t&&""==t.trim()||"object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0===t||Array.isArray(t)&&0===t.length||Array.isArray(t)&&1===t.length&&""===t[0])}static nx(t){return!this.x(t)}static true(e){if("function"==typeof e)try{return e=e(),this.true(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1!==e&&((!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0!==e&&("0"!==e&&(""!==e&&(" "!==e&&("null"!==e&&"false"!==e))))))))))}static false(e){if("function"==typeof e)try{return e=e(),this.false(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1===e||(!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0===e||("0"===e||""!==e&&(" "!==e&&("null"!==e&&"false"===e))))))))}static v(){if(this.nx(arguments))return"";for(let t=0;t<arguments.length;t++)if(this.x(arguments[t]))return arguments[t];return""}static loop(t,e){if(this.nx(t))return null;Array.isArray(t)?t.forEach((t,r)=>{e(t,r)}):"object"==typeof t&&Object.entries(t).forEach(([t,r])=>{e(r,t)})}static map(t,e,r){return Object.keys(t).reduce((n,i)=>(n[i]=e.call(r||null,i,t[i]),n),{})}static first(t){if(Array.isArray(t)){var e=null;return t.forEach((t,r)=>{null===e&&(e=t)}),e}if("object"==typeof t){e=null;return Object.entries(t).forEach(([t,r])=>{null===e&&(e=r)}),e}return null}static last(t){if(Array.isArray(t)){let e=null;return t.forEach((t,r)=>{e=t}),e}if("object"==typeof t){let e=null;return Object.entries(t).forEach(([t,r])=>{e=r}),e}return null}static rand(t){return Array.isArray(t)?t[Math.floor(Math.random()*t.length)]:"object"==typeof t?(t=Object.values(t))[Math.floor(Math.random()*t.length)]:null}static random_string(t=8,e=null){null===e&&(e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");let r=e.length,n="";for(let i=0;i<t;i++)n+=e[0+~~(Math.random()*(r-1-0+1))];return n}static round(t=0,e=0){return Number(Math.round(t+"e"+e)+"e-"+e)}static isInteger(t){return!isNaN(t)&&parseInt(Number(t))==t&&!isNaN(parseInt(t,10))}static random_int(t=0,e=99999){return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(t=null){return null===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}static cookieExists(t){return void 0!==document.cookie&&null!==this.cookieGet(t)}static cookieGet(t){var e=document.cookie.match(new RegExp(t+"=([^;]+)"));return e?decodeURIComponent(e[1]):null}static cookieSet(t,e,r,n=!0){let i="";window.location.protocol.indexOf("https")>-1&&(i="; SameSite=None; Secure"),document.cookie=t+"="+encodeURIComponent(e)+"; expires="+new Date((new Date).getTime()+24*r*60*60*1e3).toUTCString()+"; path=/"+i+"; domain="+(!0===n?this.urlHostTopLevel():"")}static cookieDelete(t,e=!0){let r="";window.location.protocol.indexOf("https")>-1&&(r="; SameSite=None; Secure"),document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+"; domain="+(!0===e?this.urlHostTopLevel():"")}static localStorageSet(t,e,r=0){r*=864e5;let n={value:e,expiry:(new Date).getTime()+r};localStorage.setItem(t,JSON.stringify(n))}static localStorageGet(t){let e=localStorage.getItem(t);if(!e)return null;let r=JSON.parse(e);return(new Date).getTime()>r.expiry?(localStorage.removeItem(t),null):r.value}static localStorageDelete(t){localStorage.removeItem(t)}static localStorageExists(t){return null!==this.localStorageGet(t)}static getParam(t){let e=window.location.search;if(this.nx(e))return null;let r=e.substring(1).split("&");for(var n=0;n<r.length;n++){var i=r[n].split("=");if(i[0]==t&&this.x(i[1]))return i[1]}return null}static getDevice(){return this.isPhone()?"phone":this.isTablet()?"tablet":"desktop"}static isPhone(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isTablet(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isDesktop(){return!this.isPhone()&&!this.isTablet()}static isMobile(){return!!(window.innerWidth<750||this.isPhone())}static isTouch(){return"ontouchstart"in window||navigator.maxTouchPoints||!1}static isPageSpeed(){const t=navigator.userAgent||"";let e=0;if(/Lighthouse|HeadlessChrome|Chrome-Lighthouse|Speed Insights|PTST|PageSpeed/i.test(t))return!0;if(navigator.webdriver)return!0;if(navigator.languages&&0!==navigator.languages.length||(e+=3),/moto g power|Moto G4/i.test(t)&&(e+=2),/Chrome\/\d{3}\.0\.0\.0/i.test(t)&&(e+=1),"undefined"!=typeof window){const t=window.innerWidth,r=window.innerHeight;(1350===t&&940===r||412===t&&(823===r||915===r)||360===t&&640===r)&&(e+=2)}return navigator.plugins&&0===navigator.plugins.length&&(e+=1),navigator.connection||navigator.deviceMemory||navigator.hardwareConcurrency||(e+=1),void 0===navigator.permissions&&(e+=1),/Chrome/i.test(t)&&void 0===window.chrome&&(e+=2),e>=4}static isMac(){return"mac"===t.getOs()}static isLinux(){return"linux"===t.getOs()}static isWindows(){return"windows"===t.getOs()}static getOs(){let t=window.navigator.userAgent,e=window.navigator.platform,r="unknown";return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)||-1!==["iPhone","iPad","iPod"].indexOf(e)?r="mac":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?r="windows":(/Android/.test(t)||/Linux/.test(e))&&(r="linux"),r}static getBrowser(){let t="",e=!document.documentMode&&!!window.StyleMedia;return t=-1!=navigator.userAgent.indexOf("Opera")||-1!=navigator.userAgent.indexOf("OPR")?"opera":-1==navigator.userAgent.indexOf("Chrome")||e?-1==navigator.userAgent.indexOf("Safari")||e?-1!=navigator.userAgent.indexOf("Firefox")?"firefox":-1!=navigator.userAgent.indexOf("MSIE")||1==!!document.documentMode?"ie":e?"edge":"unknown":"safari":"chrome",t}static isObject(t){return!!t&&t.constructor===Object}static isArray(t){return!!t&&t.constructor===Array}static isString(t){return"string"==typeof t||t instanceof String}static isDate(t){if(this.nx(t))return!1;if("[object Date]"===Object.prototype.toString.call(t))return!0;if(!this.isString(t))return!1;if(3!==t.split("-").length)return!1;let e=parseInt(t.split("-")[2]),r=parseInt(t.split("-")[1]),n=parseInt(t.split("-")[0]),i=new Date;return i.setFullYear(n,r-1,e),i.getFullYear()==n&&i.getMonth()+1==r&&i.getDate()==e}static password_generate(t=20,e=["a-z","A-Z","0-9","$!?"],r="lI"){if(null===e||!e.length||t<e.length)return null;let n=[];for(let t of e){let e=[];if(e="a-z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(97+e)):"A-Z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(65+e)):"0-9"===t?Array.from({length:10},(t,e)=>String.fromCharCode(48+e)):t.split(""),r&&(e=e.filter(t=>!r.includes(t))),0===e.length)return null;n.push(e)}let i=n.map(t=>t[Math.floor(Math.random()*t.length)]),o=n.flat();for(;i.length<t;){let t=Math.floor(Math.random()*o.length);i.push(o[t])}for(let t=i.length-1;t>0;t--){let e=Math.floor(Math.random()*(t+1));[i[t],i[e]]=[i[e],i[t]]}return i.join("")}static formatNumber(t,e=0,r=".",n=","){t=(t+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+t)?+t:0,o=isFinite(+e)?Math.abs(e):0,a=void 0===n?",":n,s=void 0===r?".":r,l="";return l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split("."),l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(s)}static formatDate(t,e=null){!1===e||!0===e||null===e||""===e?e=new Date:"object"!=typeof e&&(e=new Date(e.replace(/-/g,"/").replace(/T|Z/g," ")));let r="",n=e.getMonth(),i=n+1,o=e.getDay(),a=e.getDate(),s=e.getFullYear(),l=e.getHours(),c=e.getMinutes(),u=e.getSeconds();for(let d=0,h=t.length;d<h;d++)switch(t[d]){case"j":r+=a;break;case"d":r+=a<10?"0"+a:a;break;case"l":let h=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=h[o];break;case"w":r+=o;break;case"D":h=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"),r+=h[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":let g=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=g[n];break;case"M":g=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),r+=g[n];break;case"Y":r+=s;break;case"y":r+=s.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":let p=0===l?12:l;r+=p>12?p-12:p;break;case"h":p=0===l?12:l,p=p>12?p-12:p,r+=p<10?"0"+p:p;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=c<10?"0"+c:c;break;case"s":r+=u<10?"0"+u:u;break;case"c":r+=e.toISOString();break;default:r+=t[d]}return r}static deepCopy(e,r=new WeakMap){if(Object(e)!==e)return e;if(r.has(e))return r.get(e);const n=e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e.source,e.flags):e.constructor?new e.constructor:Object.create(null);return r.set(e,n),e instanceof Map&&Array.from(e,([e,i])=>n.set(e,t.deepCopy(i,r))),Object.assign(n,...Object.keys(e).map(n=>({[n]:t.deepCopy(e[n],r)})))}static jsonStringToObject(t){if(this.nx(t)||!this.isString(t))return null;try{return JSON.parse(t)}catch(t){return null}}static isJsonString(t){if(this.nx(t)||!this.isString(t))return!1;try{return JSON.parse(t),!0}catch(t){return!1}}static jsonObjectToString(t){try{return JSON.stringify(t)}catch(t){return null}}static uuid(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}static guid(){return this.uuid()}static replaceAll(t,e,r){return t.split(e).join(r)}static replaceLast(t,e,r){let n=t.lastIndexOf(e);return t=t.slice(0,n)+t.slice(n).replace(e,r)}static replaceFirst(t,e,r){return t.replace(e,r)}static findAllPositions(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=e.indexOf(t,i))>-1;)o.push(r),i=r+n;return o}static findAllPositionsCaseInsensitive(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=this.indexOfCaseInsensitive(t,e,i))>-1;)o.push(r),i=r+n;return o}static countAllOccurences(t,e){let r=new RegExp(t,"g");return(e.match(r)||[]).length}static countAllOccurencesCaseInsensitive(t,e){let r=new RegExp(t,"gi");return(e.match(r)||[]).length}static indexOfCaseInsensitive(t,e,r){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e,r=!1,n=500){if(this.nx(t)||this.nx(e))return t;if(!0===r){let r="...",i=this.findAllPositionsCaseInsensitive(e,t),o=t.split(" "),a=0;for(o.forEach((t,s)=>{let l=!0;i.forEach(t=>{a>=t-n&&a<=t+e.length+n-1&&(l=!1)}),!0===l&&(o[s]=r),a+=t.length+1}),t=o.join(" ");t.indexOf(r+" ...")>-1;)t=this.replaceAll(t,r+" ...",r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t);for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+'<strong class="highlight">'+t.substring(i[r],i[r]+e.length)+"</strong>"+t.substring(i[r]+e.length);for(let t=r+1;t<i.length;t++)i[t]=i[t]+26+9}return t}static get(t,e=null){return this.call("GET",t,e)}static post(t,e=null){return this.call("POST",t,e)}static call(e,r,n=null){return null===n&&(n={}),"data"in n||(n.data={}),"headers"in n||(n.headers=null),"throttle"in n||(n.throttle=0),"allow_errors"in n||(n.allow_errors=!0),new Promise((i,o)=>{setTimeout(()=>{0!==r.indexOf("http")&&(r=t.baseUrl()+"/"+r);let a=new XMLHttpRequest;a.open(e,r,!0),"POST"===e&&(!("data"in n)||null===n.data||"object"!=typeof n.data||n.data instanceof FormData||(a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.data=JSON.stringify(n.data)),a.setRequestHeader("X-Requested-With","XMLHttpRequest")),this.x(n.headers)&&Object.entries(n.headers).forEach(([t,e])=>{a.setRequestHeader(t,e)}),a.onload=()=>{(4!=a.readyState||!0!==n.allow_errors&&200!=a.status&&304!=a.status)&&(this.isJsonString(a.responseText)?o(this.jsonStringToObject(a.responseText)):o(a.responseText)),this.isJsonString(a.responseText)?i(this.jsonStringToObject(a.responseText)):i(a.responseText)},a.onerror=()=>{o([a.readyState,a.status,a.statusText])},"GET"===e&&a.send(null),"POST"===e&&a.send(n.data)},n.throttle)})}static onResizeHorizontal(t){let e,r,n=window.innerWidth;window.addEventListener("resize",()=>{e=window.innerWidth,e!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static onResizeVertical(t){var e,r,n=window.innerHeight;window.addEventListener("resize",()=>{(e=window.innerHeight)!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static removeEmpty(t){return this.nx(t)||!Array.isArray(t)?t:t=t.filter(t=>this.x(t))}static uniqueArray(t){let e={},r=[];for(let n=0;n<t.length;n++)t[n]in e||(r.push(t[n]),e[t[n]]=!0);return r}static powerset(t){return Array.isArray(t)?t.reduce((t,e)=>t.concat(t.map(t=>[...t,e])),[[]]):t}static charToInt(t){let e,r,n=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)n+=Math.pow(26,r)*("ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(t[e])+1);return n}static intToChar(t){for(var e="",r=1,n=26;(t-=r)>=0;r=n,n*=26)e=String.fromCharCode(parseInt(t%n/r)+65)+e;return e}static slugify(t){return t.toString().toLowerCase().trim().split("ä").join("ae").split("ö").join("oe").split("ü").join("ue").split("ß").join("ss").replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}static incChar(t,e=1){return this.intToChar(this.charToInt(t)+e)}static decChar(t,e=1){return this.intToChar(this.charToInt(t)-e)}static range(t,e){let r=[],n=typeof t,i=typeof e,o=1;if("undefined"==n||"undefined"==i||n!=i)return null;if(e<t&&(o=-o),"number"==n)for(;o>0?e>=t:e<=t;)r.push(t),t+=o;else{if("string"!=n)return null;if(1!=t.length||1!=e.length)return null;for(t=t.charCodeAt(0),e=e.charCodeAt(0);o>0?e>=t:e<=t;)r.push(String.fromCharCode(t)),t+=o}return r}static dateToWeek(t=null){null===t&&(t=new Date),(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))).setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));let e=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-e)/864e5+1)/7)}static weekToDate(t,e){null==e&&(e=(new Date).getFullYear());let r=new Date;r.setYear(e),r.setDate(1),r.setMonth(0),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);let n=r.getDay();n=0===n?7:n;let i=1-n;7-n+1<4&&(i+=7),r=new Date(r.getTime()+24*i*60*60*1e3);let o=6048e5*(t-1),a=r.getTime()+o;return r.setTime(a),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r}static addDays(t,e){var r=new Date(t);return r.setDate(r.getDate()+e),r}static diffInMonths(t,e){let r=new Date(t),n=new Date(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())+(n.getDate()-r.getDate())/new Date(n.getFullYear(),n.getMonth()+1,0).getDate()}static objectsAreEqual(t,e){var r=this;if(null==t||null==e)return t===e;if(t.constructor!==e.constructor)return!1;if(t instanceof Function)return t===e;if(t instanceof RegExp)return t===e;if(t===e||t.valueOf()===e.valueOf())return!0;if(Array.isArray(t)&&t.length!==e.length)return!1;if(t instanceof Date)return!1;if(!(t instanceof Object))return!1;if(!(e instanceof Object))return!1;var n=Object.keys(t);return Object.keys(e).every(function(t){return-1!==n.indexOf(t)})&&n.every(function(n){return r.objectsAreEqual(t[n],e[n])})}static containsObject(t,e){var r;for(r in e)if(e.hasOwnProperty(r)&&this.objectsAreEqual(e[r],t))return!0;return!1}static fadeOut(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=1,function n(){(t.style.opacity-=25/e)<0?(t.style.display="none",r()):requestAnimationFrame(n)}()})}static fadeIn(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=0,t.style.display="block",function n(){var i=parseFloat(t.style.opacity);(i+=25/e)>1?r():(t.style.opacity=i,requestAnimationFrame(n))}()})}static scrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}static scrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}static closestScrollable(t){let e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY,r=e&&!(e.includes("hidden")||e.includes("visible"));return t?r&&t.scrollHeight>=t.clientHeight?t:this.closestScrollable(t.parentNode)||document.scrollingElement||document.body:null}static offsetTop(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop}static offsetLeft(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft}static offsetRight(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft+t.offsetWidth}static offsetBottom(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop+t.offsetHeight}static offsetTopWithMargin(t){return this.offsetTop(t)-parseInt(getComputedStyle(t).marginTop)}static offsetLeftWithMargin(t){return this.offsetLeft(t)-parseInt(getComputedStyle(t).marginLeft)}static offsetRightWithMargin(t){return this.offsetRight(t)+parseInt(getComputedStyle(t).marginRight)}static offsetBottomWithMargin(t){return this.offsetBottom(t)+parseInt(getComputedStyle(t).marginBottom)}static documentHeight(){return Math.max(document.body.offsetHeight,document.body.scrollHeight,document.documentElement.clientHeight,document.documentElement.offsetHeight,document.documentElement.scrollHeight)}static documentWidth(){return document.documentElement.clientWidth||document.body.clientWidth}static windowWidth(){return window.innerWidth}static windowHeight(){return window.innerHeight}static windowWidthWithoutScrollbar(){return document.documentElement.clientWidth||document.body.clientWidth}static windowHeightWithoutScrollbar(){return document.documentElement.clientHeight||document.body.clientHeight}static outerWidthWithMargin(t){return t.offsetWidth+parseInt(getComputedStyle(t).marginLeft)+parseInt(getComputedStyle(t).marginRight)}static outerHeightWithMargin(t){return t.offsetHeight+parseInt(getComputedStyle(t).marginTop)+parseInt(getComputedStyle(t).marginBottom)}static async cursorPosition(){document.head.insertAdjacentHTML("afterbegin",'\n <style type="text/css">\n .find-pointer-quad {\n --hit: 0;\n position: fixed;\n\t z-index:2147483647;\n transform: translateZ(0);\n &:hover { --hit: 1; }\n }\n </style>\n '),window.cursorPositionDelay=50,window.cursorPositionQuads=[];return window.cursorPositionQuads=[1,2,3,4].map((t,e)=>{let r=document.createElement("a");r.classList.add("find-pointer-quad");let{style:n}=r;return n.top=e<2?0:"10%",n.left=e%2==0?0:"10%",n.width=n.height="10%",document.body.appendChild(r),r}),this.cursorPositionBisect(10)}static cursorPositionBisect(t){let e;if(window.cursorPositionQuads.some(t=>{let r=getComputedStyle(t);if("1"===r.getPropertyValue("--hit"))return e={style:r,a:t}}),!e){let[e]=window.cursorPositionQuads,r=Math.abs(t)>1e4,n=parseFloat(e.style.top)-t/2,i=parseFloat(e.style.left)-t/2;return window.cursorPositionQuads.forEach(({style:e},o)=>{r?(e.top=o<2?0:`${t}%`,e.left=o%2==0?0:`${t}%`,e.width=e.height=`${t}%`):(e.top=o<2?`${n}%`:`${n+t}%`,e.left=o%2==0?`${i}%`:`${i+t}%`,e.width=`${t}%`,e.height=`${t}%`)}),new Promise(e=>{setTimeout(()=>e(this.cursorPositionBisect(r?t:2*t)),window.cursorPositionDelay)})}let{style:r,a:n}=e,{top:i,left:o,width:a,height:s}=n.getBoundingClientRect();if(a<3)return window.cursorPositionQuads.forEach(t=>t.remove()),{x:Math.round(o+a/2+window.scrollX),y:Math.round(i+s/2+window.scrollY)};let l=n.style.left,c=n.style.top,u=t/2;return window.cursorPositionQuads.forEach(({style:t},e)=>{t.top=e<2?c:`${u+parseFloat(c)}%`,t.left=e%2==0?l:`${u+parseFloat(l)}%`,t.width=`${u}%`,t.height=`${u}%`}),new Promise(t=>{setTimeout(()=>t(this.cursorPositionBisect(u)),window.cursorPositionDelay)})}static scrollTo(e,r=1e3,n=null,i=0,o=!1){return new Promise(a=>{null===n&&(n=document.scrollingElement||document.documentElement),t.isNumeric(e)||(e=n===(document.scrollingElement||documentElement)?this.offsetTopWithMargin(e):e.getBoundingClientRect().top-parseInt(getComputedStyle(e).marginTop)-(n.getBoundingClientRect().top-n.scrollTop-parseInt(getComputedStyle(n).marginTop)));let s=0;Array.isArray(i)||(i=[i]),i.forEach(e=>{t.isNumeric(e)?s+=e:null!==e&&"fixed"===window.getComputedStyle(e).position&&(s+=-1*e.offsetHeight)}),e+=s;const l=n.scrollTop,c=e-l,u=+new Date,d=function(){const t=+new Date-u;var i,o,s;n.scrollTop=parseInt((i=t,o=l,s=c,(i/=r/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+o:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+o))),t<r?requestAnimationFrame(d):(n.scrollTop=e,a())};!0===o&&c>0?a():d()})}static loadJs(e){t.isArray(e)||(e=[e]);let r=[];return t.loop(e,(t,e)=>{r.push(new Promise((e,r)=>{let n=document.createElement("script");n.src=t,n.onload=()=>{e()},document.head.appendChild(n)}))}),Promise.all(r)}static async loadJsSequentially(e){t.isArray(e)||(e=[e]);for(let r of e)await t.loadJs(r)}static triggerAfterAllImagesLoaded(t,e,r){window.addEventListener("load",n=>{null!==document.querySelector(t+" "+e)&&document.querySelectorAll(t+" "+e).forEach(n=>{this.triggerAfterAllImagesLoadedBindLoadEvent(n,t,e,r)})}),document.addEventListener("DOMContentLoaded",()=>{null!==document.querySelector(t)&&new MutationObserver(n=>{n.forEach(n=>{"childList"===n.type&&n.addedNodes.length>0?n.addedNodes.forEach(n=>{this.triggerAfterAllImagesLoadedHandleEl(n,t,e,r)}):"attributes"===n.type&&"src"===n.attributeName&&n.target.classList.contains(e.replace(".",""))&&n.oldValue!==n.target.getAttribute("src")&&this.triggerAfterAllImagesLoadedHandleEl(n.target,t,e,r)})}).observe(document.querySelector(t),{attributes:!0,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!0,characterDataOldValue:!1})})}static triggerAfterAllImagesLoadedHandleEl(t,e,r,n){t.nodeType===Node.ELEMENT_NODE&&(t.classList.remove("loaded-img"),t.closest(e).classList.remove("loaded-all"),t.classList.contains("binded-trigger")||(t.classList.add("binded-trigger"),t.addEventListener("load",()=>{this.triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n)})))}static triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n){t.classList.add("loaded-img"),t.closest(e).querySelectorAll(".loaded-img").length===t.closest(e).querySelectorAll(r).length&&(t.closest(e).classList.add("loaded-all"),n())}static isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}static isVisibleInViewport(t){if(!this.isVisible(t))return!1;let e=t.getBoundingClientRect();return!(e.bottom<0||e.right<0||e.left>window.innerWidth||e.top>window.innerHeight)}static textareaAutoHeight(t="textarea"){this.textareaSetHeights(t),this.onResizeHorizontal(()=>{this.textareaSetHeights(t)}),[].forEach.call(document.querySelectorAll(t),t=>{t.addEventListener("keyup",t=>{this.textareaSetHeight(t.target)})})}static textareaSetHeights(t="textarea"){[].forEach.call(document.querySelectorAll(t),t=>{this.isVisible(t)&&this.textareaSetHeight(t)})}static textareaSetHeight(t){t.style.height="5px",t.style.height=t.scrollHeight+"px"}static real100vh(t=null,e=100){if(null===t){let t=()=>{let t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${t}px`)};t(),window.addEventListener("resize",()=>{t()})}else{let r=()=>{console.log(t),null!==document.querySelector(t)&&document.querySelectorAll(t).forEach(t=>{t.style.height=window.innerHeight*(e/100)+"px"})};r(),window.addEventListener("resize",()=>{r()})}}static iOsRemoveHover(){"safari"===t.getBrowser()&&"desktop"!==t.getDevice()&&t.on("touchend","a",(t,e)=>{e.click()})}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(e,r,n,i,o){return new Promise(a=>{o<=50&&(o=50);let s=[];r.split(";").forEach(t=>{s.push(t.split(":")[0].trim())});let l=[];s.forEach(t=>{l.push(t+" "+Math.round(o/1e3*10)/10+"s "+i)}),l="transition: "+l.join(", ")+" !important;";let c=null;NodeList.prototype.isPrototypeOf(e)?c=Array.from(e):null===e?(console.log("cannot animate element from "+r+" to "+n+" because it does not exist"),a()):c=[e];let u=c.length;c.forEach((e,i)=>{let c=t.random_string(10,"abcdefghijklmnopqrstuvwxyz");e.classList.add(c),window.requestAnimationFrame(()=>{let i=[],d=e.getAttribute("style");null!==d&&d.split(";").forEach(t=>{""==t||s.includes(t.split(":")[0].trim())||i.push(t)}),i=i.length>0?i.join(";")+";"+r+";":r+";",e.setAttribute("style",i),window.requestAnimationFrame(()=>{let i=document.createElement("style");i.innerHTML="."+c+" { "+l+" }",document.head.appendChild(i),window.requestAnimationFrame(()=>{if(e.setAttribute("style",e.getAttribute("style").replace(r+";","")+n+";"),this.isVisible(e)){let r=!1;t.addEventListenerOnce(e,"transitionend",t=>{if(r=!0,t.target!==t.currentTarget)return!1;document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(c),u--,u<=0&&window.requestAnimationFrame(()=>{a()})}),setTimeout(()=>{!1===r&&(document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(c),u--,u<=0&&a())},1.5*o)}else document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(c),u--,u<=0&&a()})})})})})}static addEventListenerOnce(t,e,r,n,i){t.addEventListener(e,function o(a){!1!==r.apply(this,arguments,n)&&t.removeEventListener(e,o,i)})}static htmlDecode(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}static htmlEncode(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/`/g,"&#96;")}static nl2br(t){return null==t?"":(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){return null==t?"":t.replace(/<\s*\/?br\s*[\/]?>/gi,"\n")}static closest(t,e){if(!document.documentElement.contains(t))return null;do{if(this.matches(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}static matches(t,e){let r=t,n=(r.parentNode||r.document).querySelectorAll(e),i=-1;for(;n[++i]&&n[i]!=r;);return!!n[i]}static wrap(t,e){if(null===t)return;let r=(new DOMParser).parseFromString(e,"text/html").body.childNodes[0];t.parentNode.insertBefore(r,t.nextSibling),r.appendChild(t)}static wrapTextNodes(t,e){null!==t&&Array.from(t.childNodes).filter(t=>3===t.nodeType&&t.textContent.trim().length>1).forEach(t=>{const r=document.createElement(e);t.after(r),r.appendChild(t)})}static html2dom(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,void 0===e.content?this.html2domLegacy(t):e.content.firstChild}static html2domLegacy(t){var e,r,n,i={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]},o=document,a=o.createDocumentFragment();if(/<|&#?\w+;/.test(t)){for(e=a.appendChild(o.createElement("div")),r=i[(/<([\w:]+)/.exec(t)||["",""])[1].toLowerCase()]||i._default,e.innerHTML=r[1]+t.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>")+r[2],n=r[0];n--;)e=e.lastChild;for(a.removeChild(a.firstChild);e.firstChild;)a.appendChild(e.firstChild)}else a.appendChild(o.createTextNode(t));return a.querySelector("*")}static prev(t,e){let r=t.previousElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static next(t,e){let r=t.nextElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static prevAll(t,e){let r=[];for(;t=t.previousElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static nextAll(t,e){let r=[];for(;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static prevUntil(t,e){let r=[];for(;(t=t.previousElementSibling)&&!this.matches(t,e);)r.push(t);return r}static nextUntil(t,e){let r=[];for(;(t=t.nextElementSibling)&&!this.matches(t,e);)r.push(t);return r}static siblings(t,e){let r=[],n=t;for(t=t.parentNode.firstChild;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&n!==t&&r.push(t);return r}static parents(t,e){let r=[],n=void 0!==e;for(;null!==(t=t.parentElement);)t.nodeType===Node.ELEMENT_NODE&&(n&&!this.matches(t,e)||r.push(t));return r}static css(t){let e=document.styleSheets,r={};for(let n in e)try{let i=e[n].rules||e[n].cssRules;for(let e in i)this.matches(t,i[e].selectorText)&&(r=Object.assign(r,this.css2json(i[e].style),this.css2json(t.getAttribute("style"))))}catch(t){}return r}static css2json(t){let e={};if(!t)return e;if(t instanceof CSSStyleDeclaration)for(let r in t)t[r].toLowerCase&&void 0!==t[t[r]]&&(e[t[r].toLowerCase()]=t[t[r]]);else if("string"==typeof t){t=t.split(";");for(let r in t)if(t[r].indexOf(":")>-1){let n=t[r].split(":");e[n[0].toLowerCase().trim()]=n[1].trim()}}return e}static compareDates(t,e){return"string"==typeof t&&(t=t.split(" ").join("T")),"string"==typeof e&&(e=e.split(" ").join("T")),t=new Date(t),e=new Date(e),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()?0:t<e?-1:1}static spaceship(t,e){return null===t||null===e||typeof t!=typeof e?null:"string"==typeof t?t.localeCompare(e):t>e?1:t<e?-1:0}static querySelectorAllShadowDom(t){let e=function(t){return $els=[],null!==t.querySelector("*")&&t.querySelectorAll("*").forEach(t=>{$els.push(t),void 0!==t.shadowRoot&&null!==t.shadowRoot&&($els=$els.concat(e(t.shadowRoot)))}),$els},r=document.createDocumentFragment();return $els=e(document),$els.forEach(e=>{e.matches(t)&&r.appendChild(e.cloneNode())}),r.childNodes}static focus(e){t.unfocus();let r=null;if(r="string"==typeof e||e instanceof String?document.querySelector(e):e,null!==r){let t=document.createElement("div");t.classList.add("hlp-focus-mask"),t.style.position="fixed",t.style.top=0,t.style.bottom=0,t.style.left=0,t.style.right=0,t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.zIndex=2147483646,r.before(t),r.setAttribute("data-focussed",1),r.setAttribute("data-focussed-orig-z-index",r.style.zIndex),r.setAttribute("data-focussed-orig-position",r.style.position),r.setAttribute("data-focussed-orig-background-color",r.style.backgroundColor),r.setAttribute("data-focussed-orig-box-shadow",r.style.boxShadow),r.style.zIndex=2147483647,r.style.position="relative",r.style.backgroundColor="#ffffff",r.style.boxShadow="0px 0px 0px 20px #fff"}}static unfocus(){null!==document.querySelector(".hlp-focus-mask")&&document.querySelectorAll(".hlp-focus-mask").forEach(e=>{t.remove(e)}),null!==document.querySelector("[data-focussed]")&&document.querySelectorAll("[data-focussed]").forEach(t=>{t.style.zIndex=t.getAttribute("data-focussed-orig-z-index"),t.style.position=t.getAttribute("data-focussed-orig-position"),t.style.backgroundColor=t.getAttribute("data-focussed-orig-background-color"),t.style.boxShadow=t.getAttribute("data-focussed-orig-box-shadow"),t.removeAttribute("data-focussed"),t.removeAttribute("data-focussed-orig-z-index"),t.removeAttribute("data-focussed-orig-position"),t.removeAttribute("data-focussed-orig-background-color"),t.removeAttribute("data-focussed-orig-box-shadow")})}static remove(t){null!==t&&t.parentNode.removeChild(t)}static on(e,r,n,i=null){null===i?(i=n,n=document):n=document.querySelector(n),n.addEventListener(e,e=>{var n=t.closest(e.target,r);n&&i(e,n)},!1)}static url(){return window.location.protocol+"//"+window.location.host+window.location.pathname}static urlWithHash(){return window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.hash}static fullUrl(){return window.location.href}static urlWithArgs(){return window.location.href.split("#")[0]}static baseUrl(){return window.location.protocol+"//"+window.location.host}static urlProtocol(){return window.location.protocol+"//"}static urlHost(){return window.location.host}static urlHostTopLevel(){let t=window.location.host;if(t.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/))return t;for(t=t.split(".");t.length>2;)t.shift();return t=t.join("."),t}static urlPath(){return window.location.pathname}static urlHash(){return window.location.hash}static urlArgs(){return window.location.search}static urlOfScript(){if(document.currentScript)return document.currentScript.src;{let t=document.getElementsByTagName("script");return t[t.length-1].src}}static pathOfScript(){let t=this.urlOfScript();return t.substring(0,t.lastIndexOf("/"))}static waitUntil(t,e=null,r=null){return new Promise((n,i)=>{let o=setInterval(()=>{null!==document.querySelector(t)&&(null===e||null===r&&void 0!==window.getComputedStyle(document.querySelector(t))[e]&&""!=window.getComputedStyle(document.querySelector(t))[e]||null!==r&&window.getComputedStyle(document.querySelector(t))[e]===r)&&(window.clearInterval(o),n())},30)})}static waitUntilEach(t,e){new MutationObserver(()=>{let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}).observe(document.body,{childList:!0,subtree:!0});let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}static waitUntilVar(t=null,e=null,r=null){let n=null,i=null;return null===e?(n=t,i=window):(n=e,i=t),new Promise((t,e)=>{let o=setInterval(()=>{void 0!==i[n]&&null!==i[n]&&(null!==r&&i[n]!==r||(window.clearInterval(o),t()))},30)})}static ready(){return new Promise(t=>{if("loading"!==document.readyState)return t();document.addEventListener("DOMContentLoaded",()=>t())})}static load(){return new Promise(t=>{if("complete"===document.readyState)return t();window.addEventListener("load",()=>t())})}static runForEl(e,r){t.ready().then(()=>{let n=t.pushId();null!==document.querySelector(e)&&document.querySelectorAll(e).forEach(t=>{void 0===t.runForEl&&(t.runForEl=[]),t.runForEl.includes(n)||(t.runForEl.push(n),r(t))}),void 0===window.runForEl_queue&&(window.runForEl_queue=[]),void 0===window.runForEl_observer&&(window.runForEl_observer=new MutationObserver(t=>{t.forEach(t=>{if(t.addedNodes)for(let e=0;e<t.addedNodes.length;e++){let r=t.addedNodes[e];r.nodeType===Node.ELEMENT_NODE&&window.runForEl_queue.forEach(t=>{r.matches(t.selector)&&(void 0===r.runForEl&&(r.runForEl=[]),r.runForEl.includes(t.id)||(r.runForEl.push(t.id),t.callback(r))),null!==r.querySelector(t.selector)&&r.querySelectorAll(t.selector).forEach(e=>{void 0===e.runForEl&&(e.runForEl=[]),e.runForEl.includes(t.id)||(e.runForEl.push(t.id),t.callback(e))})})}})}).observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})),window.runForEl_queue.push({id:n,selector:e,callback:r})})}static fmath(t,e,r,n=8){let i={"*":e*r,"-":e-r,"+":e+r,"/":e/r}[t];return Math.round(10*i*Math.pow(10,n))/(10*Math.pow(10,n))}static trim(t,e){let r=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","​","\u2028","\u2029"," "].join(""),n=0,i=0;for(t+="",e&&(r=(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),n=t.length,i=0;i<n;i++)if(-1===r.indexOf(t.charAt(i))){t=t.substring(i);break}for(n=t.length,i=n-1;i>=0;i--)if(-1===r.indexOf(t.charAt(i))){t=t.substring(0,i+1);break}return-1===r.indexOf(t.charAt(0))?t:""}static ltrim(t,e){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(e,r=50,n="..."){if(this.nx(e)||!("string"==typeof e||e instanceof String))return e;if(-1===e.indexOf(" "))e.length>r&&(e=e.substring(0,r),e=t.rtrim(e),e+=" "+n);else if(e.length>r){for(e=t.rtrim(e);e.length>r&&e.lastIndexOf(" ")>-1&&" "!=e.substring(r-1,r);)e=e.substring(0,e.lastIndexOf(" ")),e=t.rtrim(e);e=e.substring(0,r),e=t.rtrim(e),e+=" "+n}return e}static emojiRegex(e=!0){return new RegExp(t.emojiRegexPattern(),(!0===e?"g":"")+"u")}static emojiRegexPattern(){return String.raw`\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u200D(\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?))*`}static emojiSplit(t){return"string"==typeof t||t instanceof String?[...(new Intl.Segmenter).segment(t)].map(t=>t.segment):t}static serialize(t){let e,r,n,i="",o="",a=0;const s=function(t){let e,r,n,i,o=typeof t;if("object"===o&&!t)return"null";if("object"===o){if(!t.constructor)return"object";for(r in n=t.constructor.toString(),e=n.match(/(\w+)\(/),e&&(n=e[1].toLowerCase()),i=["boolean","number","string","array"],i)if(n===i[r]){o=i[r];break}}return o},l=s(t);switch(l){case"function":e="";break;case"boolean":e="b:"+(t?"1":"0");break;case"number":e=(Math.round(t)===t?"i":"d")+":"+t;break;case"string":e="s:"+(~-encodeURI(t).split(/%..|./).length+':"')+t+'"';break;case"array":case"object":for(r in e="a",t)if(t.hasOwnProperty(r)){if(i=s(t[r]),"function"===i)continue;n=r.match(/^[0-9]+$/)?parseInt(r,10):r,o+=this.serialize(n)+this.serialize(t[r]),a++}e+=":"+a+":{"+o+"}";break;default:e="N"}return"object"!==l&&"array"!==l&&(e+=";"),e}static unserialize(t){try{if("string"!=typeof t)return!1;const e=[],r=t=>(e.push(t[0]),t);r.get=t=>{if(t>=e.length)throw RangeError(`Can't resolve reference ${t+1}`);return e[t]};const n=t=>{const e=(/^(?:N(?=;)|[bidsSaOCrR](?=:)|[^:]+(?=:))/g.exec(t)||[])[0];if(!e)throw SyntaxError("Invalid input: "+t);switch(e){case"N":return r([null,2]);case"b":return r(i(t));case"i":return r(o(t));case"d":return r(a(t));case"s":return r(s(t));case"S":return r(l(t));case"a":return u(t);case"O":return d(t);case"C":throw Error("Not yet implemented");case"r":case"R":return c(t);default:throw SyntaxError(`Invalid or unsupported data type: ${e}`)}},i=t=>{const[e,r]=/^b:([01]);/.exec(t)||[];if(!r)throw SyntaxError("Invalid bool value, expected 0 or 1");return["1"===r,e.length]},o=t=>{const[e,r]=/^i:([+-]?\d+);/.exec(t)||[];if(!r)throw SyntaxError("Expected an integer value");return[parseInt(r,10),e.length]},a=t=>{const[e,r]=/^d:(NAN|-?INF|(?:\d+\.\d*|\d*\.\d+|\d+)(?:[eE][+-]\d+)?);/.exec(t)||[];if(!r)throw SyntaxError("Expected a float value");return["NAN"===r?NaN:"-INF"===r?Number.NEGATIVE_INFINITY:"INF"===r?Number.POSITIVE_INFINITY:parseFloat(r),e.length]},s=t=>{const[e,r]=/^s:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected a string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},l=t=>{const[e,r]=/^S:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected an escaped string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},c=t=>{const[e,n]=/^[rR]:(\d+);/.exec(t)||[];if(!e)throw SyntaxError("Expected reference value");return[r.get(parseInt(n,10)-1),e.length]},u=t=>{const[e,i]=/^a:(\d+):\{/.exec(t)||[];if(!i)throw SyntaxError("Expected array length annotation");t=t.substr(e.length);const o={};r([o]);for(let e=0;e<parseInt(i,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),o[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[o,e.length+1]},d=t=>{const[e,,i,o]=/^O:(\d+):"([^\"]+)":(\d+):\{/.exec(t)||[];if(!e)throw SyntaxError("Invalid input");if("stdClass"!==i)throw SyntaxError(`Unsupported object type: ${i}`);let a={};r([a]),t=t.substr(e.length);for(let e=0;e<parseInt(o,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),a[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[a,e.length+1]};return n(t)[0]}catch(t){return console.error(t),!1}}static pushId(){let e=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),e=window.pushIdDataGlobal),"undefined"!=typeof global&&(void 0===global.pushIdDataGlobal&&(global.pushIdDataGlobal={}),e=global.pushIdDataGlobal),t.objectsAreEqual(e,{})&&(e.lastPushTime=0,e.lastRandChars=[],e.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let r=(new Date).getTime(),n=r===e.lastPushTime;e.lastPushTime=r;let i=new Array(8);for(var o=7;o>=0;o--)i[o]=e.PUSH_CHARS.charAt(r%64),r=Math.floor(r/64);if(0!==r)throw new Error;let a=i.join("");if(n){for(o=11;o>=0&&63===e.lastRandChars[o];o--)e.lastRandChars[o]=0;e.lastRandChars[o]++}else for(o=0;o<12;o++)e.lastRandChars[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)a+=e.PUSH_CHARS.charAt(e.lastRandChars[o]);if(20!=a.length)throw new Error;return a}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t,e=""){let r=atob(t),n=[];for(let t=0;t<r.length;t+=512){let e=r.slice(t,t+512),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let o=new Uint8Array(i);n.push(o)}return new Blob(n,{type:e})}static blobtobase64(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{var t=r.result.split(",")[1];e(t)},r.readAsDataURL(t)})}static stringtoblob(t,e=""){return new Blob([t],{type:e})}static blobtostring(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.readAsText(t)})}static filetobase64(t){return new Promise((e,r)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result.split(",")[1]),n.onerror=t=>r(t)})}static blobtofile(t,e="file.txt"){let r=null;try{r=new File([t],e)}catch{r=new Blob([t],e)}return r}static filetoblob(t){return new Blob([t])}static base64tofile(t,e="",r="file.txt"){return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t,{type:"text/plain"})}static stringtourl(t){return this.blobtourl(this.stringtoblob(t))}static base64tostring(t){return atob(t)}static stringtobase64(t){return btoa(t)}static base64tourl(t){return this.blobtourl(this.base64toblob(t))}static filetourl(t){return this.blobtourl(this.filetoblob(t))}static getImageOrientation(t){return new Promise((e,r)=>{t=t.replace("data:image/jpeg;base64,","");let n=this.base64tofile(t),i=new FileReader;i.onload=t=>{var r=new DataView(t.target.result);if(65496==r.getUint16(0,!1)){for(var n=r.byteLength,i=2;i<n;){if(r.getUint16(i+2,!1)<=8)return void e(-1);var o=r.getUint16(i,!1);if(i+=2,65505==o){if(1165519206!=r.getUint32(i+=2,!1))return void e(-1);var a=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,a);var s=r.getUint16(i,a);i+=2;for(var l=0;l<s;l++)if(274==r.getUint16(i+12*l,a))return void e(r.getUint16(i+12*l+8,a))}else{if(65280&~o)break;i+=r.getUint16(i,!1)}}e(-1)}else e(-2)},i.readAsArrayBuffer(n)})}static resetImageOrientation(t,e){return new Promise((r,n)=>{var i=new Image;i.onload=()=>{var t=i.width,n=i.height,o=document.createElement("canvas"),a=o.getContext("2d");switch(4<e&&e<9?(o.width=n,o.height=t):(o.width=t,o.height=n),e){case 2:a.transform(-1,0,0,1,t,0);break;case 3:a.transform(-1,0,0,-1,t,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,t);break;case 8:a.transform(0,-1,1,0,0,t)}a.drawImage(i,0,0);let s=o.toDataURL();s="data:image/jpeg;base64,"+s.split(",")[1],r(s)},i.src=t})}static fixImageOrientation(t){return new Promise((e,r)=>{-1!==t.indexOf("data:")?(0===t.indexOf("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,","")),this.getImageOrientation(t).then(r=>{t="data:image/jpeg;base64,"+t,r<=1?e(t):this.resetImageOrientation(t,r).then(t=>{e(t)})})):e(t)})}static debounce(t,e,r){var n;return function(){var i=this,o=arguments,a=r&&!n;clearTimeout(n),n=setTimeout(function(){n=null,r||t.apply(i,o)},e),a&&t.apply(i,o)}}static throttle(t,e,r){var n,i,o,a=null,s=0;r||(r={});var l=function(){s=!1===r.leading?0:Date.now(),a=null,o=t.apply(n,i),a||(n=i=null)};return function(){var c=Date.now();s||!1!==r.leading||(s=c);var u=e-(c-s);return n=this,i=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(l,u)),o}}static shuffle(t){let e,r,n=t.length;for(;0!==n;)r=Math.floor(Math.random()*n),n-=1,e=t[n],t[n]=t[r],t[r]=e;return t}static findRecursiveInObject(t,e=null,r=null,n="",i=[]){if(null!==t&&"object"==typeof t)for(const[o,a]of Object.entries(t))if(null!==a&&"object"==typeof a)this.findRecursiveInObject(a,e,r,(""===n?"":n+".")+o,i);else if(!(null!==e&&o!==e||null!==r&&a!==r)){i.push(n);break}return i}};return"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(t).forEach((e,r)=>{"length"!==e&&"name"!==e&&"prototype"!==e&&"caller"!==e&&"arguments"!==e&&(window.hlp[e]=t[e])})),t}();
1
+ var hlp=function(){var t=class t{static x(t){if("function"==typeof t)try{return t=t(),this.x(t)}catch(t){return!1}return!(null===t||!1===t||"string"==typeof t&&""==t.trim()||"object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0===t||Array.isArray(t)&&0===t.length||Array.isArray(t)&&1===t.length&&""===t[0])}static nx(t){return!this.x(t)}static true(e){if("function"==typeof e)try{return e=e(),this.true(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1!==e&&((!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0!==e&&("0"!==e&&(""!==e&&(" "!==e&&("null"!==e&&"false"!==e))))))))))}static false(e){if("function"==typeof e)try{return e=e(),this.false(e)}catch(t){return!1}return void 0!==e&&(null!==e&&(!1===e||(!Array.isArray(e)||0!==e.length)&&((!Array.isArray(e)||""!==t.first(e))&&(("object"!=typeof e||0!==Object.keys(e).length||e.constructor!==Object)&&(0===e||("0"===e||""!==e&&(" "!==e&&("null"!==e&&"false"===e))))))))}static v(...t){if(this.nx(arguments))return"";for(let t=0;t<arguments.length;t++)if(this.x(arguments[t]))return arguments[t];return""}static loop(t,e){if(this.nx(t))return null;Array.isArray(t)?t.forEach((t,r)=>{e(t,r)}):"object"==typeof t&&Object.entries(t).forEach(([t,r])=>{e(r,t)})}static map(t,e,r=null){return Object.keys(t).reduce((n,i)=>(n[i]=e.call(r||null,i,t[i]),n),{})}static first(t){if(Array.isArray(t)){var e=null;return t.forEach((t,r)=>{null===e&&(e=t)}),e}if("object"==typeof t){e=null;return Object.entries(t).forEach(([t,r])=>{null===e&&(e=r)}),e}return null}static last(t){if(Array.isArray(t)){let e=null;return t.forEach((t,r)=>{e=t}),e}if("object"==typeof t){let e=null;return Object.entries(t).forEach(([t,r])=>{e=r}),e}return null}static rand(t){if(Array.isArray(t))return t[Math.floor(Math.random()*t.length)];if("object"==typeof t){var e=Object.values(t);return e[Math.floor(Math.random()*e.length)]}return null}static random_string(t=8,e=null){null===e&&(e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");let r=e.length,n="";for(let i=0;i<t;i++)n+=e[0+~~(Math.random()*(r-1-0+1))];return n}static round(t=0,e=0){return Number(Math.round(t+"e"+e)+"e-"+e)}static isInteger(t){return!isNaN(t)&&parseInt(Number(t))==t&&!isNaN(parseInt(t,10))}static random_int(t=0,e=99999){return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(t=null){return null===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}static cookieExists(t){return void 0!==document.cookie&&null!==this.cookieGet(t)}static cookieGet(t){var e=document.cookie.match(new RegExp(t+"=([^;]+)"));return e?decodeURIComponent(e[1]):null}static cookieSet(t,e,r,n=!0){let i="";window.location.protocol.indexOf("https")>-1&&(i="; SameSite=None; Secure"),document.cookie=t+"="+encodeURIComponent(e)+"; expires="+new Date((new Date).getTime()+24*r*60*60*1e3).toUTCString()+"; path=/"+i+"; domain="+(!0===n?this.urlHostTopLevel():"")}static cookieDelete(t,e=!0){let r="";window.location.protocol.indexOf("https")>-1&&(r="; SameSite=None; Secure"),document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+"; domain="+(!0===e?this.urlHostTopLevel():"")}static localStorageSet(t,e,r=0){r*=864e5;let n={value:e,expiry:(new Date).getTime()+r};localStorage.setItem(t,JSON.stringify(n))}static localStorageGet(t){let e=localStorage.getItem(t);if(!e)return null;let r=JSON.parse(e);return(new Date).getTime()>r.expiry?(localStorage.removeItem(t),null):r.value}static localStorageDelete(t){localStorage.removeItem(t)}static localStorageExists(t){return null!==this.localStorageGet(t)}static getParam(t){let e=window.location.search;if(this.nx(e))return null;let r=e.substring(1).split("&");for(var n=0;n<r.length;n++){var i=r[n].split("=");if(i[0]==t&&this.x(i[1]))return i[1]}return null}static getDevice(){return this.isPhone()?"phone":this.isTablet()?"tablet":"desktop"}static isPhone(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isTablet(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isDesktop(){return!this.isPhone()&&!this.isTablet()}static isMobile(){return!!(window.innerWidth<750||this.isPhone())}static isTouch(){return"ontouchstart"in window||navigator.maxTouchPoints||!1}static isPageSpeed(){const t=navigator.userAgent||"";let e=0;if(/Lighthouse|HeadlessChrome|Chrome-Lighthouse|Speed Insights|PTST|PageSpeed/i.test(t))return!0;if(navigator.webdriver)return!0;if(navigator.languages&&0!==navigator.languages.length||(e+=3),/moto g power|Moto G4/i.test(t)&&(e+=2),/Chrome\/\d{3}\.0\.0\.0/i.test(t)&&(e+=1),"undefined"!=typeof window){const t=window.innerWidth,r=window.innerHeight;(1350===t&&940===r||412===t&&(823===r||915===r)||360===t&&640===r)&&(e+=2)}return navigator.plugins&&0===navigator.plugins.length&&(e+=1),navigator.connection||navigator.deviceMemory||navigator.hardwareConcurrency||(e+=1),void 0===navigator.permissions&&(e+=1),/Chrome/i.test(t)&&void 0===window.chrome&&(e+=2),e>=4}static isMac(){return"mac"===t.getOs()}static isLinux(){return"linux"===t.getOs()}static isWindows(){return"windows"===t.getOs()}static getOs(){let t=window.navigator.userAgent,e=window.navigator.platform,r="unknown";return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)||-1!==["iPhone","iPad","iPod"].indexOf(e)?r="mac":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?r="windows":(/Android/.test(t)||/Linux/.test(e))&&(r="linux"),r}static getBrowser(){let t="",e=!document.documentMode&&!!window.StyleMedia;return t=-1!=navigator.userAgent.indexOf("Opera")||-1!=navigator.userAgent.indexOf("OPR")?"opera":-1==navigator.userAgent.indexOf("Chrome")||e?-1==navigator.userAgent.indexOf("Safari")||e?-1!=navigator.userAgent.indexOf("Firefox")?"firefox":-1!=navigator.userAgent.indexOf("MSIE")||1==!!document.documentMode?"ie":e?"edge":"unknown":"safari":"chrome",t}static isObject(t=null){return!!t&&t.constructor===Object}static isArray(t=null){return!!t&&t.constructor===Array}static isString(t){return"string"==typeof t||t instanceof String}static isDate(t){if(this.nx(t))return!1;if("[object Date]"===Object.prototype.toString.call(t))return!0;if(!this.isString(t))return!1;if(3!==t.split("-").length)return!1;let e=parseInt(t.split("-")[2]),r=parseInt(t.split("-")[1]),n=parseInt(t.split("-")[0]),i=new Date;return i.setFullYear(n,r-1,e),i.getFullYear()==n&&i.getMonth()+1==r&&i.getDate()==e}static password_generate(t=20,e=["a-z","A-Z","0-9","$!?"],r="lI"){if(null===e||!e.length||t<e.length)return null;let n=[];for(let t of e){let e=[];if(e="a-z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(97+e)):"A-Z"===t?Array.from({length:26},(t,e)=>String.fromCharCode(65+e)):"0-9"===t?Array.from({length:10},(t,e)=>String.fromCharCode(48+e)):t.split(""),r&&(e=e.filter(t=>!r.includes(t))),0===e.length)return null;n.push(e)}let i=n.map(t=>t[Math.floor(Math.random()*t.length)]),o=n.flat();for(;i.length<t;){let t=Math.floor(Math.random()*o.length);i.push(o[t])}for(let t=i.length-1;t>0;t--){let e=Math.floor(Math.random()*(t+1));[i[t],i[e]]=[i[e],i[t]]}return i.join("")}static formatNumber(t,e=0,r=".",n=","){t=(t+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+t)?+t:0,o=isFinite(+e)?Math.abs(e):0,a=void 0===n?",":n,s=void 0===r?".":r;let l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split(".");return l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(s)}static formatDate(t,e=null){!1===e||!0===e||null===e||""===e?e=new Date:"object"!=typeof e&&(e=new Date(e.replace(/-/g,"/").replace(/T|Z/g," ")));let r="",n=e.getMonth(),i=n+1,o=e.getDay(),a=e.getDate(),s=e.getFullYear(),l=e.getHours(),c=e.getMinutes(),u=e.getSeconds();for(let d=0,h=t.length;d<h;d++)switch(t[d]){case"j":r+=a;break;case"d":r+=a<10?"0"+a:a;break;case"l":let h=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=h[o];break;case"w":r+=o;break;case"D":h=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"),r+=h[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":let g=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=g[n];break;case"M":g=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),r+=g[n];break;case"Y":r+=s;break;case"y":r+=s.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":let m=0===l?12:l;r+=m>12?m-12:m;break;case"h":m=0===l?12:l,m=m>12?m-12:m,r+=m<10?"0"+m:m;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=c<10?"0"+c:c;break;case"s":r+=u<10?"0"+u:u;break;case"c":r+=e.toISOString();break;default:r+=t[d]}return r}static deepCopy(e,r=new WeakMap){if(Object(e)!==e)return e;if(r.has(e))return r.get(e);const n=e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e.source,e.flags):e.constructor?new e.constructor:Object.create(null);return r.set(e,n),e instanceof Map&&Array.from(e,([e,i])=>n.set(e,t.deepCopy(i,r))),Object.assign(n,...Object.keys(e).map(n=>({[n]:t.deepCopy(e[n],r)})))}static jsonStringToObject(t){if(this.nx(t)||!this.isString(t))return null;try{return JSON.parse(t)}catch(t){return null}}static isJsonString(t){if(this.nx(t)||!this.isString(t))return!1;try{return JSON.parse(t),!0}catch(t){return!1}}static jsonObjectToString(t){try{return JSON.stringify(t)}catch(t){return null}}static uuid(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}static guid(){return this.uuid()}static replaceAll(t,e,r){return t.split(e).join(r)}static replaceLast(t,e,r){let n=t.lastIndexOf(e);return t=t.slice(0,n)+t.slice(n).replace(e,r)}static replaceFirst(t,e,r){return t.replace(e,r)}static findAllPositions(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=e.indexOf(t,i))>-1;)o.push(r),i=r+n;return o}static findAllPositionsCaseInsensitive(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=this.indexOfCaseInsensitive(t,e,i))>-1;)o.push(r),i=r+n;return o}static countAllOccurences(t,e){let r=new RegExp(t,"g");return(e.match(r)||[]).length}static countAllOccurencesCaseInsensitive(t,e){let r=new RegExp(t,"gi");return(e.match(r)||[]).length}static indexOfCaseInsensitive(t,e,r=0){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e,r=!1,n=500){if(this.nx(t)||this.nx(e))return t;if(!0===r){let r="...",i=this.findAllPositionsCaseInsensitive(e,t),o=t.split(" "),a=0;for(o.forEach((t,s)=>{let l=!0;i.forEach(t=>{a>=t-n&&a<=t+e.length+n-1&&(l=!1)}),!0===l&&(o[s]=r),a+=t.length+1}),t=o.join(" ");t.indexOf(r+" ...")>-1;)t=this.replaceAll(t,r+" ...",r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t);for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+'<strong class="highlight">'+t.substring(i[r],i[r]+e.length)+"</strong>"+t.substring(i[r]+e.length);for(let t=r+1;t<i.length;t++)i[t]=i[t]+26+9}return t}static get(t,e=null){return this.call("GET",t,e)}static post(t,e=null){return this.call("POST",t,e)}static call(e,r,n=null){return null===n&&(n={}),"data"in n||(n.data={}),"headers"in n||(n.headers=null),"throttle"in n||(n.throttle=0),"allow_errors"in n||(n.allow_errors=!0),new Promise((i,o)=>{setTimeout(()=>{0!==r.indexOf("http")&&(r=t.baseUrl()+"/"+r);let a=new XMLHttpRequest;a.open(e,r,!0),"POST"===e&&(!("data"in n)||null===n.data||"object"!=typeof n.data||n.data instanceof FormData||(a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.data=JSON.stringify(n.data)),a.setRequestHeader("X-Requested-With","XMLHttpRequest")),this.x(n.headers)&&Object.entries(n.headers).forEach(([t,e])=>{a.setRequestHeader(t,e)}),a.onload=()=>{(4!=a.readyState||!0!==n.allow_errors&&200!=a.status&&304!=a.status)&&(this.isJsonString(a.responseText)?o(this.jsonStringToObject(a.responseText)):o(a.responseText)),this.isJsonString(a.responseText)?i(this.jsonStringToObject(a.responseText)):i(a.responseText)},a.onerror=()=>{o([a.readyState,a.status,a.statusText])},"GET"===e&&a.send(null),"POST"===e&&a.send(n.data)},n.throttle)})}static onResizeHorizontal(t){let e,r,n=window.innerWidth;window.addEventListener("resize",()=>{e=window.innerWidth,e!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static onResizeVertical(t){var e,r,n=window.innerHeight;window.addEventListener("resize",()=>{(e=window.innerHeight)!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout(()=>{t()},50))}),t()}static removeEmpty(t){return this.nx(t)||!Array.isArray(t)?t:t=t.filter(t=>this.x(t))}static uniqueArray(t){let e={},r=[];for(let n=0;n<t.length;n++)t[n]in e||(r.push(t[n]),e[t[n]]=!0);return r}static powerset(t){return Array.isArray(t)?t.reduce((t,e)=>t.concat(t.map(t=>[...t,e])),[[]]):t}static charToInt(t){let e,r,n=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)n+=Math.pow(26,r)*("ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(t[e])+1);return n}static intToChar(t){for(var e="",r=1,n=26;(t-=r)>=0;r=n,n*=26)e=String.fromCharCode(parseInt(t%n/r)+65)+e;return e}static slugify(t){return t.toString().toLowerCase().trim().split("ä").join("ae").split("ö").join("oe").split("ü").join("ue").split("ß").join("ss").replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}static incChar(t,e=1){return this.intToChar(this.charToInt(t)+e)}static decChar(t,e=1){return this.intToChar(this.charToInt(t)-e)}static range(t,e){let r=[],n=typeof t,i=typeof e,o=1;if("undefined"==n||"undefined"==i||n!=i)return null;if(e<t&&(o=-o),"number"==n)for(;o>0?e>=t:e<=t;)r.push(t),t+=o;else{if("string"!=n)return null;if(1!=t.length||1!=e.length)return null;for(t=t.charCodeAt(0),e=e.charCodeAt(0);o>0?e>=t:e<=t;)r.push(String.fromCharCode(t)),t+=o}return r}static dateToWeek(t=null){null===t&&(t=new Date),(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))).setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));let e=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-e)/864e5+1)/7)}static weekToDate(t,e){null==e&&(e=(new Date).getFullYear());let r=new Date;r.setFullYear(e),r.setDate(1),r.setMonth(0),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);let n=r.getDay();n=0===n?7:n;let i=1-n;7-n+1<4&&(i+=7),r=new Date(r.getTime()+24*i*60*60*1e3);let o=6048e5*(t-1),a=r.getTime()+o;return r.setTime(a),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r}static addDays(t,e){var r=new Date(t);return r.setDate(r.getDate()+e),r}static diffInMonths(t,e){let r=new Date(t),n=new Date(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())+(n.getDate()-r.getDate())/new Date(n.getFullYear(),n.getMonth()+1,0).getDate()}static objectsAreEqual(t,e){var r=this;if(null==t||null==e)return t===e;if(t.constructor!==e.constructor)return!1;if(t instanceof Function)return t===e;if(t instanceof RegExp)return t===e;if(t===e||t.valueOf()===e.valueOf())return!0;if(Array.isArray(t)&&t.length!==e.length)return!1;if(t instanceof Date)return!1;if(!(t instanceof Object))return!1;if(!(e instanceof Object))return!1;var n=Object.keys(t);return Object.keys(e).every(function(t){return-1!==n.indexOf(t)})&&n.every(function(n){return r.objectsAreEqual(t[n],e[n])})}static containsObject(t,e){var r;for(r in e)if(e.hasOwnProperty(r)&&this.objectsAreEqual(e[r],t))return!0;return!1}static fadeOut(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=1,function n(){(t.style.opacity-=25/e)<0?(t.style.display="none",r()):requestAnimationFrame(n)}()})}static fadeIn(t,e=1e3){return e<=25&&(e=25),new Promise(r=>{t.style.opacity=0,t.style.display="block",function n(){var i=parseFloat(t.style.opacity);(i+=25/e)>1?r():(t.style.opacity=i,requestAnimationFrame(n))}()})}static scrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}static scrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}static closestScrollable(t){let e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY,r=e&&!(e.includes("hidden")||e.includes("visible"));return t?r&&t.scrollHeight>=t.clientHeight?t:this.closestScrollable(t.parentNode)||document.scrollingElement||document.body:null}static offsetTop(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop}static offsetLeft(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft}static offsetRight(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft+t.offsetWidth}static offsetBottom(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop+t.offsetHeight}static offsetTopWithMargin(t){return this.offsetTop(t)-parseInt(getComputedStyle(t).marginTop)}static offsetLeftWithMargin(t){return this.offsetLeft(t)-parseInt(getComputedStyle(t).marginLeft)}static offsetRightWithMargin(t){return this.offsetRight(t)+parseInt(getComputedStyle(t).marginRight)}static offsetBottomWithMargin(t){return this.offsetBottom(t)+parseInt(getComputedStyle(t).marginBottom)}static documentHeight(){return Math.max(document.body.offsetHeight,document.body.scrollHeight,document.documentElement.clientHeight,document.documentElement.offsetHeight,document.documentElement.scrollHeight)}static documentWidth(){return document.documentElement.clientWidth||document.body.clientWidth}static windowWidth(){return window.innerWidth}static windowHeight(){return window.innerHeight}static windowWidthWithoutScrollbar(){return document.documentElement.clientWidth||document.body.clientWidth}static windowHeightWithoutScrollbar(){return document.documentElement.clientHeight||document.body.clientHeight}static outerWidthWithMargin(t){return t.offsetWidth+parseInt(getComputedStyle(t).marginLeft)+parseInt(getComputedStyle(t).marginRight)}static outerHeightWithMargin(t){return t.offsetHeight+parseInt(getComputedStyle(t).marginTop)+parseInt(getComputedStyle(t).marginBottom)}static async cursorPosition(){document.head.insertAdjacentHTML("afterbegin",'\n <style type="text/css">\n .find-pointer-quad {\n --hit: 0;\n position: fixed;\n\t z-index:2147483647;\n transform: translateZ(0);\n &:hover { --hit: 1; }\n }\n </style>\n '),window.cursorPositionDelay=50,window.cursorPositionQuads=[];return window.cursorPositionQuads=[1,2,3,4].map((t,e)=>{let r=document.createElement("a");r.classList.add("find-pointer-quad");let{style:n}=r;return n.top=e<2?"0":"10%",n.left=e%2==0?"0":"10%",n.width=n.height="10%",document.body.appendChild(r),r}),this.cursorPositionBisect(10)}static cursorPositionBisect(t){let e;if(window.cursorPositionQuads.some(t=>{let r=getComputedStyle(t);if("1"===r.getPropertyValue("--hit"))return e={style:r,a:t}}),!e){let[e]=window.cursorPositionQuads,r=Math.abs(t)>1e4,n=parseFloat(e.style.top)-t/2,i=parseFloat(e.style.left)-t/2;return window.cursorPositionQuads.forEach(({style:e},o)=>{r?(e.top=o<2?"0":`${t}%`,e.left=o%2==0?"0":`${t}%`,e.width=e.height=`${t}%`):(e.top=o<2?`${n}%`:`${n+t}%`,e.left=o%2==0?`${i}%`:`${i+t}%`,e.width=`${t}%`,e.height=`${t}%`)}),new Promise(e=>{setTimeout(()=>e(this.cursorPositionBisect(r?t:2*t)),window.cursorPositionDelay)})}let{style:r,a:n}=e,{top:i,left:o,width:a,height:s}=n.getBoundingClientRect();if(a<3)return window.cursorPositionQuads.forEach(t=>t.remove()),{x:Math.round(o+a/2+window.scrollX),y:Math.round(i+s/2+window.scrollY)};let l=n.style.left,c=n.style.top,u=t/2;return window.cursorPositionQuads.forEach(({style:t},e)=>{t.top=e<2?c:`${u+parseFloat(c)}%`,t.left=e%2==0?l:`${u+parseFloat(l)}%`,t.width=`${u}%`,t.height=`${u}%`}),new Promise(t=>{setTimeout(()=>t(this.cursorPositionBisect(u)),window.cursorPositionDelay)})}static scrollTo(e,r=1e3,n=null,i=0,o=!1){return new Promise(a=>{null===n&&(n=document.scrollingElement||document.documentElement),t.isNumeric(e)||(e=n===(document.scrollingElement||document.documentElement)?this.offsetTopWithMargin(e):e.getBoundingClientRect().top-parseInt(getComputedStyle(e).marginTop)-(n.getBoundingClientRect().top-n.scrollTop-parseInt(getComputedStyle(n).marginTop)));let s=0,l=i;Array.isArray(l)||(l=[l]),l.forEach(e=>{t.isNumeric(e)?s+=e:null!==e&&"fixed"===window.getComputedStyle(e).position&&(s+=-1*e.offsetHeight)}),e+=s;const c=n.scrollTop,u=e-c,d=+new Date,h=function(){const t=+new Date-d;var i,o,s;n.scrollTop=parseInt((i=t,o=c,s=u,(i/=r/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+o:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+o))),t<r?requestAnimationFrame(h):(n.scrollTop=e,a())};!0===o&&u>0?a():h()})}static loadJs(e){t.isArray(e)||(e=[e]);let r=[];return t.loop(e,(t,e)=>{r.push(new Promise((e,r)=>{let n=document.createElement("script");n.src=t,n.onload=()=>{e()},document.head.appendChild(n)}))}),Promise.all(r)}static async loadJsSequentially(e){t.isArray(e)||(e=[e]);for(let r of e)await t.loadJs(r)}static triggerAfterAllImagesLoaded(t,e,r){window.addEventListener("load",n=>{null!==document.querySelector(t+" "+e)&&document.querySelectorAll(t+" "+e).forEach(n=>{this.triggerAfterAllImagesLoadedBindLoadEvent(n,t,e,r)})}),document.addEventListener("DOMContentLoaded",()=>{null!==document.querySelector(t)&&new MutationObserver(n=>{n.forEach(n=>{"childList"===n.type&&n.addedNodes.length>0?n.addedNodes.forEach(n=>{this.triggerAfterAllImagesLoadedHandleEl(n,t,e,r)}):"attributes"===n.type&&"src"===n.attributeName&&n.target.classList.contains(e.replace(".",""))&&n.oldValue!==n.target.getAttribute("src")&&this.triggerAfterAllImagesLoadedHandleEl(n.target,t,e,r)})}).observe(document.querySelector(t),{attributes:!0,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!0,characterDataOldValue:!1})})}static triggerAfterAllImagesLoadedHandleEl(t,e,r,n){t.nodeType===Node.ELEMENT_NODE&&(t.classList.remove("loaded-img"),t.closest(e).classList.remove("loaded-all"),t.classList.contains("binded-trigger")||(t.classList.add("binded-trigger"),t.addEventListener("load",()=>{this.triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n)})))}static triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n){t.classList.add("loaded-img"),t.closest(e).querySelectorAll(".loaded-img").length===t.closest(e).querySelectorAll(r).length&&(t.closest(e).classList.add("loaded-all"),n())}static isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}static isVisibleInViewport(t){if(!this.isVisible(t))return!1;let e=t.getBoundingClientRect();return!(e.bottom<0||e.right<0||e.left>window.innerWidth||e.top>window.innerHeight)}static textareaAutoHeight(t="textarea"){this.textareaSetHeights(t),this.onResizeHorizontal(()=>{this.textareaSetHeights(t)}),[].forEach.call(document.querySelectorAll(t),t=>{t.addEventListener("keyup",t=>{this.textareaSetHeight(t.target)})})}static textareaSetHeights(t="textarea"){[].forEach.call(document.querySelectorAll(t),t=>{this.isVisible(t)&&this.textareaSetHeight(t)})}static textareaSetHeight(t){t.style.height="5px",t.style.height=t.scrollHeight+"px"}static real100vh(t=null,e=100){if(null===t){let t=()=>{let t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${t}px`)};t(),window.addEventListener("resize",()=>{t()})}else{let r=()=>{console.log(t),null!==document.querySelector(t)&&document.querySelectorAll(t).forEach(t=>{t.style.height=window.innerHeight*(e/100)+"px"})};r(),window.addEventListener("resize",()=>{r()})}}static iOsRemoveHover(){"safari"===t.getBrowser()&&"desktop"!==t.getDevice()&&t.on("touchend","a",(t,e)=>{e.click()})}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(e,r,n,i,o){return new Promise(a=>{o<=50&&(o=50);let s=[];r.split(";").forEach(t=>{s.push(t.split(":")[0].trim())});let l=[];s.forEach(t=>{l.push(t+" "+Math.round(o/1e3*10)/10+"s "+i)});let c="transition: "+l.join(", ")+" !important;",u=null;NodeList.prototype.isPrototypeOf(e)?u=Array.from(e):null===e?(console.log("cannot animate element from "+r+" to "+n+" because it does not exist"),a()):u=[e];let d=u.length;u.forEach((e,i)=>{let l=t.random_string(10,"abcdefghijklmnopqrstuvwxyz");e.classList.add(l),window.requestAnimationFrame(()=>{let i=[],u="",h=e.getAttribute("style");null!==h&&h.split(";").forEach(t=>{""==t||s.includes(t.split(":")[0].trim())||i.push(t)}),u=i.length>0?i.join(";")+";"+r+";":r+";",e.setAttribute("style",u),window.requestAnimationFrame(()=>{let i=document.createElement("style");i.innerHTML="."+l+" { "+c+" }",document.head.appendChild(i),window.requestAnimationFrame(()=>{if(e.setAttribute("style",e.getAttribute("style").replace(r+";","")+n+";"),this.isVisible(e)){let r=!1;t.addEventListenerOnce(e,"transitionend",t=>{if(r=!0,t.target!==t.currentTarget)return!1;document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&window.requestAnimationFrame(()=>{a()})}),setTimeout(()=>{!1===r&&(document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&a())},1.5*o)}else document.head.contains(i)&&document.head.removeChild(i),e.classList.remove(l),d--,d<=0&&a()})})})})})}static addEventListenerOnce(t,e,r,n=void 0,i=void 0){t.addEventListener(e,function o(a){!1!==r.apply(this,arguments,n)&&t.removeEventListener(e,o,i)})}static htmlDecode(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}static htmlEncode(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/`/g,"&#96;")}static nl2br(t){return null==t?"":(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){return null==t?"":t.replace(/<\s*\/?br\s*[\/]?>/gi,"\n")}static closest(t,e){if(!document.documentElement.contains(t))return null;do{if(this.matches(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}static matches(t,e){let r=t,n=(r.parentNode||r.document).querySelectorAll(e),i=-1;for(;n[++i]&&n[i]!=r;);return!!n[i]}static wrap(t,e){if(null===t)return;let r=(new DOMParser).parseFromString(e,"text/html").body.childNodes[0];t.parentNode.insertBefore(r,t.nextSibling),r.appendChild(t)}static wrapTextNodes(t,e){null!==t&&Array.from(t.childNodes).filter(t=>3===t.nodeType&&t.textContent.trim().length>1).forEach(t=>{const r=document.createElement(e);t.after(r),r.appendChild(t)})}static html2dom(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,void 0===e.content?this.html2domLegacy(t):e.content.firstChild}static html2domLegacy(t){var e,r,n,i={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]},o=document,a=o.createDocumentFragment();if(/<|&#?\w+;/.test(t)){for(e=a.appendChild(o.createElement("div")),r=i[(/<([\w:]+)/.exec(t)||["",""])[1].toLowerCase()]||i._default,e.innerHTML=r[1]+t.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>")+r[2],n=r[0];n--;)e=e.lastChild;for(a.removeChild(a.firstChild);e.firstChild;)a.appendChild(e.firstChild)}else a.appendChild(o.createTextNode(t));return a.querySelector("*")}static prev(t,e){let r=t.previousElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static next(t,e){let r=t.nextElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static prevAll(t,e){let r=[];for(;t=t.previousElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static nextAll(t,e){let r=[];for(;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static prevUntil(t,e){let r=[];for(;(t=t.previousElementSibling)&&!this.matches(t,e);)r.push(t);return r}static nextUntil(t,e){let r=[];for(;(t=t.nextElementSibling)&&!this.matches(t,e);)r.push(t);return r}static siblings(t,e){let r=[],n=t;for(t=t.parentNode.firstChild;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&n!==t&&r.push(t);return r}static parents(t,e){let r=[],n=void 0!==e;for(;null!==(t=t.parentElement);)t.nodeType===Node.ELEMENT_NODE&&(n&&!this.matches(t,e)||r.push(t));return r}static css(t){let e=document.styleSheets,r={};for(let n in e)try{let i=e[n].rules||e[n].cssRules;for(let e in i)this.matches(t,i[e].selectorText)&&(r=Object.assign(r,this.css2json(i[e].style),this.css2json(t.getAttribute("style"))))}catch(t){}return r}static css2json(t){let e={};if(!t)return e;if(t instanceof CSSStyleDeclaration)for(let r in t)t[r].toLowerCase&&void 0!==t[t[r]]&&(e[t[r].toLowerCase()]=t[t[r]]);else if("string"==typeof t){t=t.split(";");for(let r in t)if(t[r].indexOf(":")>-1){let n=t[r].split(":");e[n[0].toLowerCase().trim()]=n[1].trim()}}return e}static compareDates(t,e){return"string"==typeof t&&(t=t.split(" ").join("T")),"string"==typeof e&&(e=e.split(" ").join("T")),t=new Date(t),e=new Date(e),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()?0:t<e?-1:1}static spaceship(t,e){return null===t||null===e||typeof t!=typeof e?null:"string"==typeof t?t.localeCompare(e):t>e?1:t<e?-1:0}static querySelectorAllShadowDom(t){let e=function(t){let r=[];return null!==t.querySelector("*")&&t.querySelectorAll("*").forEach(t=>{r.push(t),void 0!==t.shadowRoot&&null!==t.shadowRoot&&(r=r.concat(e(t.shadowRoot)))}),r},r=document.createDocumentFragment();return e(document).forEach(e=>{e.matches(t)&&r.appendChild(e.cloneNode())}),r.childNodes}static focus(e){t.unfocus();let r=null;if(r="string"==typeof e||e instanceof String?document.querySelector(e):e,null!==r){let t=document.createElement("div");t.classList.add("hlp-focus-mask"),t.style.position="fixed",t.style.top="0",t.style.bottom="0",t.style.left="0",t.style.right="0",t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.zIndex="2147483646",r.before(t),r.setAttribute("data-focussed","1"),r.setAttribute("data-focussed-orig-z-index",r.style.zIndex),r.setAttribute("data-focussed-orig-position",r.style.position),r.setAttribute("data-focussed-orig-background-color",r.style.backgroundColor),r.setAttribute("data-focussed-orig-box-shadow",r.style.boxShadow),r.style.zIndex="2147483647",r.style.position="relative",r.style.backgroundColor="#ffffff",r.style.boxShadow="0px 0px 0px 20px #fff"}}static unfocus(){null!==document.querySelector(".hlp-focus-mask")&&document.querySelectorAll(".hlp-focus-mask").forEach(e=>{t.remove(e)}),null!==document.querySelector("[data-focussed]")&&document.querySelectorAll("[data-focussed]").forEach(t=>{t.style.zIndex=t.getAttribute("data-focussed-orig-z-index"),t.style.position=t.getAttribute("data-focussed-orig-position"),t.style.backgroundColor=t.getAttribute("data-focussed-orig-background-color"),t.style.boxShadow=t.getAttribute("data-focussed-orig-box-shadow"),t.removeAttribute("data-focussed"),t.removeAttribute("data-focussed-orig-z-index"),t.removeAttribute("data-focussed-orig-position"),t.removeAttribute("data-focussed-orig-background-color"),t.removeAttribute("data-focussed-orig-box-shadow")})}static remove(t){null!==t&&t.parentNode.removeChild(t)}static on(e,r,n,i=null){null===i?(i=n,n=document):n=document.querySelector(n),n.addEventListener(e,e=>{var n=t.closest(e.target,r);n&&i(e,n)},!1)}static url(){return window.location.protocol+"//"+window.location.host+window.location.pathname}static urlWithHash(){return window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.hash}static fullUrl(){return window.location.href}static urlWithArgs(){return window.location.href.split("#")[0]}static baseUrl(){return window.location.protocol+"//"+window.location.host}static urlProtocol(){return window.location.protocol+"//"}static urlHost(){return window.location.host}static urlHostTopLevel(){let t=window.location.host;if(t.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/))return t;for(t=t.split(".");t.length>2;)t.shift();return t=t.join("."),t}static urlPath(){return window.location.pathname}static urlHash(){return window.location.hash}static urlArgs(){return window.location.search}static urlOfScript(){if(document.currentScript)return document.currentScript.src;{let t=document.getElementsByTagName("script");return t[t.length-1].src}}static pathOfScript(){let t=this.urlOfScript();return t.substring(0,t.lastIndexOf("/"))}static waitUntil(t,e=null,r=null){return new Promise((n,i)=>{let o=setInterval(()=>{null!==document.querySelector(t)&&(null===e||null===r&&void 0!==window.getComputedStyle(document.querySelector(t))[e]&&""!=window.getComputedStyle(document.querySelector(t))[e]||null!==r&&window.getComputedStyle(document.querySelector(t))[e]===r)&&(window.clearInterval(o),n())},30)})}static waitUntilEach(t,e){new MutationObserver(()=>{let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}).observe(document.body,{childList:!0,subtree:!0});let r=document.querySelectorAll(t);r.length>0&&r.forEach(t=>{t.__processed||(t.__processed=!0,e(t))})}static waitUntilVar(t=null,e=null,r=null){let n=null,i=null;return null===e?(n=t,i=window):(n=e,i=t),new Promise((t,e)=>{let o=setInterval(()=>{void 0!==i[n]&&null!==i[n]&&(null!==r&&i[n]!==r||(window.clearInterval(o),t()))},30)})}static ready(){return new Promise(t=>{if("loading"!==document.readyState)return t();document.addEventListener("DOMContentLoaded",()=>t())})}static load(){return new Promise(t=>{if("complete"===document.readyState)return t();window.addEventListener("load",()=>t())})}static runForEl(e,r){t.ready().then(()=>{let n=t.pushId();null!==document.querySelector(e)&&document.querySelectorAll(e).forEach(t=>{void 0===t.runForEl&&(t.runForEl=[]),t.runForEl.includes(n)||(t.runForEl.push(n),r(t))}),void 0===window.runForEl_queue&&(window.runForEl_queue=[]),void 0===window.runForEl_observer&&(window.runForEl_observer=new MutationObserver(t=>{t.forEach(t=>{if(t.addedNodes)for(let e=0;e<t.addedNodes.length;e++){let r=t.addedNodes[e];r.nodeType===Node.ELEMENT_NODE&&window.runForEl_queue.forEach(t=>{r.matches(t.selector)&&(void 0===r.runForEl&&(r.runForEl=[]),r.runForEl.includes(t.id)||(r.runForEl.push(t.id),t.callback(r))),null!==r.querySelector(t.selector)&&r.querySelectorAll(t.selector).forEach(e=>{void 0===e.runForEl&&(e.runForEl=[]),e.runForEl.includes(t.id)||(e.runForEl.push(t.id),t.callback(e))})})}})}).observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})),window.runForEl_queue.push({id:n,selector:e,callback:r})})}static fmath(t,e,r,n=8){let i={"*":e*r,"-":e-r,"+":e+r,"/":e/r}[t];return Math.round(10*i*Math.pow(10,n))/(10*Math.pow(10,n))}static trim(t,e=null){let r=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","​","\u2028","\u2029"," "].join(""),n=0,i=0;for(t+="",e&&(r=(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),n=t.length,i=0;i<n;i++)if(-1===r.indexOf(t.charAt(i))){t=t.substring(i);break}for(n=t.length,i=n-1;i>=0;i--)if(-1===r.indexOf(t.charAt(i))){t=t.substring(0,i+1);break}return-1===r.indexOf(t.charAt(0))?t:""}static ltrim(t,e=null){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e=null){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(e,r=50,n="..."){if(this.nx(e)||!("string"==typeof e||e instanceof String))return e;if(-1===e.indexOf(" "))e.length>r&&(e=e.substring(0,r),e=t.rtrim(e),e+=" "+n);else if(e.length>r){for(e=t.rtrim(e);e.length>r&&e.lastIndexOf(" ")>-1&&" "!=e.substring(r-1,r);)e=e.substring(0,e.lastIndexOf(" ")),e=t.rtrim(e);e=e.substring(0,r),e=t.rtrim(e),e+=" "+n}return e}static emojiRegex(e=!0){return new RegExp(t.emojiRegexPattern(),(!0===e?"g":"")+"u")}static emojiRegexPattern(){return String.raw`\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u200D(\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?))*`}static emojiSplit(t){return"string"==typeof t||t instanceof String?[...(new Intl.Segmenter).segment(t)].map(t=>t.segment):t}static serialize(t){let e,r,n,i="",o="",a=0;const s=function(t){let e,r,n,i,o=typeof t;if("object"===o&&!t)return"null";if("object"===o){if(!t.constructor)return"object";for(r in n=t.constructor.toString(),e=n.match(/(\w+)\(/),e&&(n=e[1].toLowerCase()),i=["boolean","number","string","array"],i)if(n===i[r]){o=i[r];break}}return o},l=s(t);switch(l){case"function":e="";break;case"boolean":e="b:"+(t?"1":"0");break;case"number":e=(Math.round(t)===t?"i":"d")+":"+t;break;case"string":e="s:"+(~-encodeURI(t).split(/%..|./).length+':"')+t+'"';break;case"array":case"object":for(r in e="a",t)if(t.hasOwnProperty(r)){if(i=s(t[r]),"function"===i)continue;n=r.match(/^[0-9]+$/)?parseInt(r,10):r,o+=this.serialize(n)+this.serialize(t[r]),a++}e+=":"+a+":{"+o+"}";break;default:e="N"}return"object"!==l&&"array"!==l&&(e+=";"),e}static unserialize(t){try{if("string"!=typeof t)return!1;const e=[],r=t=>(e.push(t[0]),t);r.get=t=>{if(t>=e.length)throw RangeError(`Can't resolve reference ${t+1}`);return e[t]};const n=t=>{const e=(/^(?:N(?=;)|[bidsSaOCrR](?=:)|[^:]+(?=:))/g.exec(t)||[])[0];if(!e)throw SyntaxError("Invalid input: "+t);switch(e){case"N":return r([null,2]);case"b":return r(i(t));case"i":return r(o(t));case"d":return r(a(t));case"s":return r(s(t));case"S":return r(l(t));case"a":return u(t);case"O":return d(t);case"C":throw Error("Not yet implemented");case"r":case"R":return c(t);default:throw SyntaxError(`Invalid or unsupported data type: ${e}`)}},i=t=>{const[e,r]=/^b:([01]);/.exec(t)||[];if(!r)throw SyntaxError("Invalid bool value, expected 0 or 1");return["1"===r,e.length]},o=t=>{const[e,r]=/^i:([+-]?\d+);/.exec(t)||[];if(!r)throw SyntaxError("Expected an integer value");return[parseInt(r,10),e.length]},a=t=>{const[e,r]=/^d:(NAN|-?INF|(?:\d+\.\d*|\d*\.\d+|\d+)(?:[eE][+-]\d+)?);/.exec(t)||[];if(!r)throw SyntaxError("Expected a float value");return["NAN"===r?NaN:"-INF"===r?Number.NEGATIVE_INFINITY:"INF"===r?Number.POSITIVE_INFINITY:parseFloat(r),e.length]},s=t=>{const[e,r]=/^s:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected a string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},l=t=>{const[e,r]=/^S:(\d+):"/g.exec(t)||[];if(!e)throw SyntaxError("Expected an escaped string value");const n=parseInt(r,10),i=(t=t.substr(e.length)).substr(0,n);if(!(t=t.substr(n)).startsWith('";'))throw SyntaxError('Expected ";');return[i,e.length+n+2]},c=t=>{const[e,n]=/^[rR]:(\d+);/.exec(t)||[];if(!e)throw SyntaxError("Expected reference value");return[r.get(parseInt(n,10)-1),e.length]},u=t=>{const[e,i]=/^a:(\d+):\{/.exec(t)||[];if(!i)throw SyntaxError("Expected array length annotation");t=t.substr(e.length);const o={};r([o]);for(let e=0;e<parseInt(i,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),o[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[o,e.length+1]},d=t=>{const[e,,i,o]=/^O:(\d+):"([^\"]+)":(\d+):\{/.exec(t)||[];if(!e)throw SyntaxError("Invalid input");if("stdClass"!==i)throw SyntaxError(`Unsupported object type: ${i}`);let a={};r([a]),t=t.substr(e.length);for(let e=0;e<parseInt(o,10);e++){const e=n(t);t=t.substr(e[1]);const r=n(t);t=t.substr(r[1]),a[e[0]]=r[0]}if("}"!==t.charAt(0))throw SyntaxError("Expected }");return[a,e.length+1]};return n(t)[0]}catch(t){return console.error(t),!1}}static pushId(){let e=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),e=window.pushIdDataGlobal),"undefined"!=typeof global&&(void 0===global.pushIdDataGlobal&&(global.pushIdDataGlobal={}),e=global.pushIdDataGlobal),t.objectsAreEqual(e,{})&&(e.lastPushTime=0,e.lastRandChars=[],e.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let r=(new Date).getTime(),n=r===e.lastPushTime;e.lastPushTime=r;let i=new Array(8);for(var o=7;o>=0;o--)i[o]=e.PUSH_CHARS.charAt(r%64),r=Math.floor(r/64);if(0!==r)throw new Error;let a=i.join("");if(n){for(o=11;o>=0&&63===e.lastRandChars[o];o--)e.lastRandChars[o]=0;e.lastRandChars[o]++}else for(o=0;o<12;o++)e.lastRandChars[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)a+=e.PUSH_CHARS.charAt(e.lastRandChars[o]);if(20!=a.length)throw new Error;return a}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t,e=""){let r=atob(t),n=[];for(let t=0;t<r.length;t+=512){let e=r.slice(t,t+512),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let o=new Uint8Array(i);n.push(o)}return new Blob(n,{type:e})}static blobtobase64(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{var t=r.result.split(",")[1];e(t)},r.readAsDataURL(t)})}static stringtoblob(t,e=""){return new Blob([t],{type:e})}static blobtostring(t){return new Promise(e=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.readAsText(t)})}static filetobase64(t){return new Promise((e,r)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result.split(",")[1]),n.onerror=t=>r(t)})}static blobtofile(t,e="file.txt"){let r=null;try{r=new File([t],e)}catch{r=new Blob([t],e)}return r}static filetoblob(t){return new Blob([t])}static base64tofile(t,e="",r="file.txt"){return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t)}static stringtourl(t){return this.blobtourl(this.stringtoblob(t))}static base64tostring(t){return atob(t)}static stringtobase64(t){return btoa(t)}static base64tourl(t){return this.blobtourl(this.base64toblob(t))}static filetourl(t){return this.blobtourl(this.filetoblob(t))}static getImageOrientation(t){return new Promise((e,r)=>{t=t.replace("data:image/jpeg;base64,","");let n=this.base64tofile(t),i=new FileReader;i.onload=t=>{var r=new DataView(t.target.result);if(65496==r.getUint16(0,!1)){for(var n=r.byteLength,i=2;i<n;){if(r.getUint16(i+2,!1)<=8)return void e(-1);var o=r.getUint16(i,!1);if(i+=2,65505==o){if(1165519206!=r.getUint32(i+=2,!1))return void e(-1);var a=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,a);var s=r.getUint16(i,a);i+=2;for(var l=0;l<s;l++)if(274==r.getUint16(i+12*l,a))return void e(r.getUint16(i+12*l+8,a))}else{if(65280&~o)break;i+=r.getUint16(i,!1)}}e(-1)}else e(-2)},i.readAsArrayBuffer(n)})}static resetImageOrientation(t,e){return new Promise((r,n)=>{var i=new Image;i.onload=()=>{var t=i.width,n=i.height,o=document.createElement("canvas"),a=o.getContext("2d");switch(4<e&&e<9?(o.width=n,o.height=t):(o.width=t,o.height=n),e){case 2:a.transform(-1,0,0,1,t,0);break;case 3:a.transform(-1,0,0,-1,t,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,t);break;case 8:a.transform(0,-1,1,0,0,t)}a.drawImage(i,0,0);let s=o.toDataURL();s="data:image/jpeg;base64,"+s.split(",")[1],r(s)},i.src=t})}static fixImageOrientation(t){return new Promise((e,r)=>{-1!==t.indexOf("data:")?(0===t.indexOf("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,","")),this.getImageOrientation(t).then(r=>{t="data:image/jpeg;base64,"+t,r<=1?e(t):this.resetImageOrientation(t,r).then(t=>{e(t)})})):e(t)})}static debounce(t,e,r){var n;return function(){var i=this,o=arguments,a=r&&!n;clearTimeout(n),n=setTimeout(function(){n=null,r||t.apply(i,o)},e),a&&t.apply(i,o)}}static throttle(t,e,r){var n,i,o,a=null,s=0;r||(r={});var l=function(){s=!1===r.leading?0:Date.now(),a=null,o=t.apply(n,i),a||(n=i=null)};return function(){var c=Date.now();s||!1!==r.leading||(s=c);var u=e-(c-s);return n=this,i=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(l,u)),o}}static shuffle(t){let e,r,n=t.length;for(;0!==n;)r=Math.floor(Math.random()*n),n-=1,e=t[n],t[n]=t[r],t[r]=e;return t}static findRecursiveInObject(t,e=null,r=null,n="",i=[]){if(null!==t&&"object"==typeof t)for(const[o,a]of Object.entries(t))if(null!==a&&"object"==typeof a)this.findRecursiveInObject(a,e,r,(""===n?"":n+".")+o,i);else if(!(null!==e&&o!==e||null!==r&&a!==r)){i.push(n);break}return i}};return"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(t).forEach((e,r)=>{"length"!==e&&"name"!==e&&"prototype"!==e&&"caller"!==e&&"arguments"!==e&&(window.hlp[e]=t[e])})),t}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hlp",
3
- "version": "3.7.7",
3
+ "version": "3.7.8",
4
4
  "main": "_js/_build/script.js",
5
5
  "module": "hlp.esm.js",
6
6
  "exports": {
@@ -32,7 +32,7 @@
32
32
  "author": "David Vielhuber <david@vielhuber.de>",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@babel/runtime": "^7.28.6"
35
+ "@babel/runtime": "^7.29.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@babel/cli": "^7.28.6",
@@ -43,28 +43,28 @@
43
43
  "@babel/plugin-proposal-private-methods": "^7.18.6",
44
44
  "@babel/plugin-transform-runtime": "^7.29.0",
45
45
  "@babel/polyfill": "^7.12.1",
46
- "@babel/preset-env": "^7.29.0",
46
+ "@babel/preset-env": "^7.29.2",
47
47
  "@babel/preset-react": "^7.28.5",
48
48
  "@babel/preset-typescript": "^7.28.5",
49
- "@prettier/plugin-php": "^0.24.0",
49
+ "@prettier/plugin-php": "^0.25.0",
50
50
  "@types/jest": "^30.0.0",
51
- "autoprefixer": "^10.4.27",
51
+ "autoprefixer": "^10.5.0",
52
52
  "babel-core": "^7.0.0-bridge.0",
53
53
  "babel-jest": "^30",
54
54
  "babel-plugin-array-includes": "^2.0.3",
55
55
  "babel-runtime": "^6.26.0",
56
56
  "babelify": "^10.0.0",
57
57
  "browser-sync": "^3.0.4",
58
- "caniuse-lite": "^1.0.30001778",
58
+ "caniuse-lite": "^1.0.30001790",
59
59
  "cli-error-notifier": "^3.0.2",
60
60
  "concat": "^1.0.3",
61
- "core-js": "^3.48.0",
61
+ "core-js": "^3.49.0",
62
62
  "cross-spawn": "^7.0.6",
63
63
  "del-cli": "^7.0.0",
64
- "dotenv": "^17.3.1",
64
+ "dotenv": "^17.4.2",
65
65
  "element-closest": "^3.0.2",
66
66
  "env-cmd": "^11.0.0",
67
- "eslint": "^10.0.3",
67
+ "eslint": "^10.2.1",
68
68
  "exit": "^0.1.2",
69
69
  "from-env": "^1.1.4",
70
70
  "highlight.js": "^11.11.1",
@@ -76,25 +76,25 @@
76
76
  "mdn-polyfills": "^5.20.0",
77
77
  "move-file-cli": "^3.0.0",
78
78
  "ncp": "^2.0.0",
79
- "npm-check-updates": "^19.6.3",
79
+ "npm-check-updates": "^21.0.3",
80
80
  "npm-run-all2": "^8.0.4",
81
81
  "onchange": "^7.1.0",
82
- "postcss": "^8.5.8",
82
+ "postcss": "^8.5.10",
83
83
  "postcss-cli": "^11.0.1",
84
84
  "postcss-tailwind-data-attr": "^1.0.7",
85
- "prettier": "^3.8.1",
86
- "puppeteer": "^24.39.1",
85
+ "prettier": "^3.8.3",
86
+ "puppeteer": "^24.42.0",
87
87
  "regenerator-runtime": "^0.14.1",
88
88
  "replace-in-file": "^8.4.0",
89
89
  "rimraf": "^6.1.3",
90
90
  "run-sequence": "^2.2.1",
91
- "sass": "^1.98.0",
92
- "tailwindcss": "^4.2.1",
93
- "terser": "^5.46.0",
94
- "typescript": "^5.9.3",
91
+ "sass": "^1.99.0",
92
+ "tailwindcss": "^4.2.4",
93
+ "terser": "^5.46.2",
94
+ "typescript": "^6.0.3",
95
95
  "vinyl-buffer": "^1.0.1",
96
96
  "vinyl-source-stream": "^2.0.0",
97
- "vite": "^8.0.0",
97
+ "vite": "^8.0.10",
98
98
  "whatwg-fetch": "^3.6.20"
99
99
  },
100
100
  "browserslist": [