hlp 3.7.7 → 3.7.9

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.
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _templateObject;
7
11
  class hlp {
8
12
  static x(input) {
9
13
  if (typeof input === 'function') {
@@ -117,6 +121,9 @@ class hlp {
117
121
  return false;
118
122
  }
119
123
  static v() {
124
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
125
+ args[_key] = arguments[_key];
126
+ }
120
127
  if (this.nx(arguments)) {
121
128
  return '';
122
129
  }
@@ -137,12 +144,15 @@ class hlp {
137
144
  });
138
145
  } else if (typeof input === 'object') {
139
146
  Object.entries(input).forEach(_ref => {
140
- let [input__key, input__value] = _ref;
147
+ let _ref2 = (0, _slicedToArray2.default)(_ref, 2),
148
+ input__key = _ref2[0],
149
+ input__value = _ref2[1];
141
150
  fun(input__value, input__key);
142
151
  });
143
152
  }
144
153
  }
145
- static map(obj, fn, ctx) {
154
+ static map(obj, fn) {
155
+ let ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
146
156
  return Object.keys(obj).reduce((a, b) => {
147
157
  a[b] = fn.call(ctx || null, b, obj[b]);
148
158
  return a;
@@ -160,8 +170,10 @@ class hlp {
160
170
  }
161
171
  if (typeof input === 'object') {
162
172
  var ret = null;
163
- Object.entries(input).forEach(_ref2 => {
164
- let [input__key, input__value] = _ref2;
173
+ Object.entries(input).forEach(_ref3 => {
174
+ let _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
175
+ input__key = _ref4[0],
176
+ input__value = _ref4[1];
165
177
  if (ret === null) {
166
178
  ret = input__value;
167
179
  }
@@ -180,8 +192,10 @@ class hlp {
180
192
  }
181
193
  if (typeof input === 'object') {
182
194
  let ret = null;
183
- Object.entries(input).forEach(_ref3 => {
184
- let [input__key, input__value] = _ref3;
195
+ Object.entries(input).forEach(_ref5 => {
196
+ let _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
197
+ input__key = _ref6[0],
198
+ input__value = _ref6[1];
185
199
  ret = input__value;
186
200
  });
187
201
  return ret;
@@ -193,8 +207,8 @@ class hlp {
193
207
  return input[Math.floor(Math.random() * input.length)];
194
208
  }
195
209
  if (typeof input === 'object') {
196
- var input = Object.values(input);
197
- return input[Math.floor(Math.random() * input.length)];
210
+ var inputArr = Object.values(input);
211
+ return inputArr[Math.floor(Math.random() * inputArr.length)];
198
212
  }
199
213
  return null;
200
214
  }
@@ -226,7 +240,9 @@ class hlp {
226
240
  return false;
227
241
  }
228
242
  if (min > max) {
229
- [min, max] = [max, min];
243
+ var _ref7 = [max, min];
244
+ min = _ref7[0];
245
+ max = _ref7[1];
230
246
  }
231
247
  return ~~(Math.random() * (max - min + 1)) + min;
232
248
  }
@@ -435,10 +451,12 @@ class hlp {
435
451
  }
436
452
  return browser_name;
437
453
  }
438
- static isObject(a) {
454
+ static isObject() {
455
+ let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
439
456
  return !!a && a.constructor === Object;
440
457
  }
441
- static isArray(a) {
458
+ static isArray() {
459
+ let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
442
460
  return !!a && a.constructor === Array;
443
461
  }
444
462
  static isString(string) {
@@ -511,7 +529,9 @@ class hlp {
511
529
  }
512
530
  for (let i = passwordChars.length - 1; i > 0; i--) {
513
531
  let j = Math.floor(Math.random() * (i + 1));
514
- [passwordChars[i], passwordChars[j]] = [passwordChars[j], passwordChars[i]];
532
+ var _ref8 = [passwordChars[j], passwordChars[i]];
533
+ passwordChars[i] = _ref8[0];
534
+ passwordChars[j] = _ref8[1];
515
535
  }
516
536
  return passwordChars.join('');
517
537
  }
@@ -524,20 +544,19 @@ class hlp {
524
544
  prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
525
545
  sep = typeof thousands_sep === 'undefined' ? ',' : thousands_sep,
526
546
  dec = typeof dec_point === 'undefined' ? '.' : dec_point,
527
- s = '',
528
547
  toFixedFix = function (n, prec) {
529
548
  var k = Math.pow(10, prec);
530
549
  return '' + Math.round(n * k) / k;
531
550
  };
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);
551
+ let sArr = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
552
+ if (sArr[0].length > 3) {
553
+ sArr[0] = sArr[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
535
554
  }
536
- if ((s[1] || '').length < prec) {
537
- s[1] = s[1] || '';
538
- s[1] += new Array(prec - s[1].length + 1).join('0');
555
+ if ((sArr[1] || '').length < prec) {
556
+ sArr[1] = sArr[1] || '';
557
+ sArr[1] += new Array(prec - sArr[1].length + 1).join('0');
539
558
  }
540
- return s.join(dec);
559
+ return sArr.join(dec);
541
560
  }
542
561
  static formatDate(format) {
543
562
  let date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -630,8 +649,10 @@ class hlp {
630
649
  if (hash.has(obj)) return hash.get(obj); // cyclic reference
631
650
  const result = obj instanceof Date ? new Date(obj) : obj instanceof RegExp ? new RegExp(obj.source, obj.flags) : obj.constructor ? new obj.constructor() : Object.create(null);
632
651
  hash.set(obj, result);
633
- if (obj instanceof Map) Array.from(obj, _ref4 => {
634
- let [key, val] = _ref4;
652
+ if (obj instanceof Map) Array.from(obj, _ref9 => {
653
+ let _ref0 = (0, _slicedToArray2.default)(_ref9, 2),
654
+ key = _ref0[0],
655
+ val = _ref0[1];
635
656
  return result.set(key, hlp.deepCopy(val, hash));
636
657
  });
637
658
  return Object.assign(result, ...Object.keys(obj).map(key => ({
@@ -722,7 +743,8 @@ class hlp {
722
743
  let regExp = new RegExp(value, 'gi');
723
744
  return (str.match(regExp) || []).length;
724
745
  }
725
- static indexOfCaseInsensitive(searchStr, str, offset) {
746
+ static indexOfCaseInsensitive(searchStr, str) {
747
+ let offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
726
748
  return str.toLowerCase().indexOf(searchStr.toLowerCase(), offset);
727
749
  }
728
750
  static highlight(string, query) {
@@ -810,8 +832,10 @@ class hlp {
810
832
  xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
811
833
  }
812
834
  if (this.x(args.headers)) {
813
- Object.entries(args.headers).forEach(_ref5 => {
814
- let [headers__key, headers__value] = _ref5;
835
+ Object.entries(args.headers).forEach(_ref1 => {
836
+ let _ref10 = (0, _slicedToArray2.default)(_ref1, 2),
837
+ headers__key = _ref10[0],
838
+ headers__value = _ref10[1];
815
839
  xhr.setRequestHeader(headers__key, headers__value);
816
840
  });
817
841
  }
@@ -980,7 +1004,7 @@ class hlp {
980
1004
  year = new Date().getFullYear();
981
1005
  }
982
1006
  let date = new Date();
983
- date.setYear(year);
1007
+ date.setFullYear(year);
984
1008
  date.setDate(1);
985
1009
  date.setMonth(0);
986
1010
  date.setHours(0);
@@ -1170,29 +1194,17 @@ class hlp {
1170
1194
  }
1171
1195
  static async cursorPosition() {
1172
1196
  // https://stackoverflow.com/a/43326327/2068362
1173
- document.head.insertAdjacentHTML('afterbegin', `
1174
- <style type="text/css">
1175
- .find-pointer-quad {
1176
- --hit: 0;
1177
- position: fixed;
1178
- z-index:2147483647;
1179
- transform: translateZ(0);
1180
- &:hover { --hit: 1; }
1181
- }
1182
- </style>
1183
- `);
1197
+ 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 ");
1184
1198
  window.cursorPositionDelay = 50;
1185
1199
  window.cursorPositionQuads = [];
1186
1200
  let dim = 10;
1187
1201
  let createQuad = (_, pos) => {
1188
1202
  let a = document.createElement('a');
1189
1203
  a.classList.add('find-pointer-quad');
1190
- let {
1191
- style
1192
- } = a;
1193
- style.top = pos < 2 ? 0 : `${dim}%`;
1194
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
1195
- style.width = style.height = `${dim}%`;
1204
+ let style = a.style;
1205
+ style.top = pos < 2 ? '0' : "".concat(dim, "%");
1206
+ style.left = pos % 2 === 0 ? '0' : "".concat(dim, "%");
1207
+ style.width = style.height = "".concat(dim, "%");
1196
1208
  document.body.appendChild(a);
1197
1209
  return a;
1198
1210
  };
@@ -1203,46 +1215,43 @@ class hlp {
1203
1215
  let hit;
1204
1216
  window.cursorPositionQuads.some(a => {
1205
1217
  let style = getComputedStyle(a);
1206
- let result = style.getPropertyValue(`--hit`);
1207
- if (result === `1`) return hit = {
1218
+ let result = style.getPropertyValue("--hit");
1219
+ if (result === "1") return hit = {
1208
1220
  style,
1209
1221
  a
1210
1222
  };
1211
1223
  });
1212
1224
  if (!hit) {
1213
- let [q1] = window.cursorPositionQuads;
1225
+ let _cursorPositionQuads = (0, _slicedToArray2.default)(window.cursorPositionQuads, 1),
1226
+ q1 = _cursorPositionQuads[0];
1214
1227
  let reset = Math.abs(dim) > 10000;
1215
1228
  let top = parseFloat(q1.style.top) - dim / 2;
1216
1229
  let left = parseFloat(q1.style.left) - dim / 2;
1217
- window.cursorPositionQuads.forEach((_ref6, pos) => {
1218
- let {
1219
- style
1220
- } = _ref6;
1230
+ window.cursorPositionQuads.forEach((_ref11, pos) => {
1231
+ let style = _ref11.style;
1221
1232
  if (reset) {
1222
- style.top = pos < 2 ? 0 : `${dim}%`;
1223
- style.left = pos % 2 === 0 ? 0 : `${dim}%`;
1224
- style.width = style.height = `${dim}%`;
1233
+ style.top = pos < 2 ? '0' : "".concat(dim, "%");
1234
+ style.left = pos % 2 === 0 ? '0' : "".concat(dim, "%");
1235
+ style.width = style.height = "".concat(dim, "%");
1225
1236
  } else {
1226
- style.top = pos < 2 ? `${top}%` : `${top + dim}%`;
1227
- style.left = pos % 2 === 0 ? `${left}%` : `${left + dim}%`;
1228
- style.width = `${dim}%`;
1229
- style.height = `${dim}%`;
1237
+ style.top = pos < 2 ? "".concat(top, "%") : "".concat(top + dim, "%");
1238
+ style.left = pos % 2 === 0 ? "".concat(left, "%") : "".concat(left + dim, "%");
1239
+ style.width = "".concat(dim, "%");
1240
+ style.height = "".concat(dim, "%");
1230
1241
  }
1231
1242
  });
1232
1243
  return new Promise(resolve => {
1233
1244
  setTimeout(() => resolve(this.cursorPositionBisect(!reset ? 2 * dim : dim)), window.cursorPositionDelay);
1234
1245
  });
1235
1246
  }
1236
- let {
1237
- style,
1238
- a
1239
- } = hit;
1240
- let {
1241
- top,
1242
- left,
1243
- width,
1244
- height
1245
- } = a.getBoundingClientRect();
1247
+ let _hit = hit,
1248
+ style = _hit.style,
1249
+ a = _hit.a;
1250
+ let _a$getBoundingClientR = a.getBoundingClientRect(),
1251
+ top = _a$getBoundingClientR.top,
1252
+ left = _a$getBoundingClientR.left,
1253
+ width = _a$getBoundingClientR.width,
1254
+ height = _a$getBoundingClientR.height;
1246
1255
  if (width < 3) {
1247
1256
  window.cursorPositionQuads.forEach(a => a.remove());
1248
1257
  return {
@@ -1253,14 +1262,12 @@ class hlp {
1253
1262
  let ox = a.style.left;
1254
1263
  let oy = a.style.top;
1255
1264
  let nextStep = dim / 2;
1256
- window.cursorPositionQuads.forEach((_ref7, pos) => {
1257
- let {
1258
- style
1259
- } = _ref7;
1260
- style.top = pos < 2 ? oy : `${nextStep + parseFloat(oy)}%`;
1261
- style.left = pos % 2 === 0 ? ox : `${nextStep + parseFloat(ox)}%`;
1262
- style.width = `${nextStep}%`;
1263
- style.height = `${nextStep}%`;
1265
+ window.cursorPositionQuads.forEach((_ref12, pos) => {
1266
+ let style = _ref12.style;
1267
+ style.top = pos < 2 ? oy : "".concat(nextStep + parseFloat(oy), "%");
1268
+ style.left = pos % 2 === 0 ? ox : "".concat(nextStep + parseFloat(ox), "%");
1269
+ style.width = "".concat(nextStep, "%");
1270
+ style.height = "".concat(nextStep, "%");
1264
1271
  });
1265
1272
  return new Promise(resolve => {
1266
1273
  setTimeout(() => resolve(this.cursorPositionBisect(nextStep)), window.cursorPositionDelay);
@@ -1276,17 +1283,18 @@ class hlp {
1276
1283
  element = document.scrollingElement || document.documentElement;
1277
1284
  }
1278
1285
  if (!hlp.isNumeric(to)) {
1279
- if (element === (document.scrollingElement || documentElement)) {
1286
+ if (element === (document.scrollingElement || document.documentElement)) {
1280
1287
  to = this.offsetTopWithMargin(to);
1281
1288
  } else {
1282
1289
  to = to.getBoundingClientRect().top - parseInt(getComputedStyle(to).marginTop) - (element.getBoundingClientRect().top - element.scrollTop - parseInt(getComputedStyle(element).marginTop));
1283
1290
  }
1284
1291
  }
1285
1292
  let offset_calc = 0;
1286
- if (!Array.isArray(offset)) {
1287
- offset = [offset];
1293
+ let offsetArr = offset;
1294
+ if (!Array.isArray(offsetArr)) {
1295
+ offsetArr = [offsetArr];
1288
1296
  }
1289
- offset.forEach(offset__value => {
1297
+ offsetArr.forEach(offset__value => {
1290
1298
  if (hlp.isNumeric(offset__value)) {
1291
1299
  offset_calc += offset__value;
1292
1300
  } else {
@@ -1453,7 +1461,7 @@ class hlp {
1453
1461
  // apply trick from https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
1454
1462
  let fn = () => {
1455
1463
  let vh = window.innerHeight * 0.01;
1456
- document.documentElement.style.setProperty('--vh', `${vh}px`);
1464
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
1457
1465
  };
1458
1466
  fn();
1459
1467
  window.addEventListener('resize', () => {
@@ -1494,11 +1502,11 @@ class hlp {
1494
1502
  from.split(';').forEach(from__value => {
1495
1503
  properties.push(from__value.split(':')[0].trim());
1496
1504
  });
1497
- let transition = [];
1505
+ let transitionArr = [];
1498
1506
  properties.forEach(properties__value => {
1499
- transition.push(properties__value + ' ' + Math.round(duration / 1000 * 10) / 10 + 's ' + easing);
1507
+ transitionArr.push(properties__value + ' ' + Math.round(duration / 1000 * 10) / 10 + 's ' + easing);
1500
1508
  });
1501
- transition = 'transition: ' + transition.join(', ') + ' !important;';
1509
+ let transition = 'transition: ' + transitionArr.join(', ') + ' !important;';
1502
1510
  let els = null;
1503
1511
  if (NodeList.prototype.isPrototypeOf(el)) {
1504
1512
  els = Array.from(el);
@@ -1515,17 +1523,18 @@ class hlp {
1515
1523
  els__value.classList.add(random_class);
1516
1524
  window.requestAnimationFrame(() => {
1517
1525
  // set from style inline (don't fully remove previous style)
1518
- let new_style = [];
1526
+ let new_style_arr = [];
1527
+ let new_style = '';
1519
1528
  let prev_style = els__value.getAttribute('style');
1520
1529
  if (prev_style !== null) {
1521
1530
  prev_style.split(';').forEach(prev_style__value => {
1522
1531
  if (prev_style__value != '' && !properties.includes(prev_style__value.split(':')[0].trim())) {
1523
- new_style.push(prev_style__value);
1532
+ new_style_arr.push(prev_style__value);
1524
1533
  }
1525
1534
  });
1526
1535
  }
1527
- if (new_style.length > 0) {
1528
- new_style = new_style.join(';') + ';' + from + ';';
1536
+ if (new_style_arr.length > 0) {
1537
+ new_style = new_style_arr.join(';') + ';' + from + ';';
1529
1538
  } else {
1530
1539
  new_style = from + ';';
1531
1540
  }
@@ -1597,7 +1606,9 @@ class hlp {
1597
1606
  });
1598
1607
  });
1599
1608
  }
1600
- static addEventListenerOnce(target, type, listener, addOptions, removeOptions) {
1609
+ static addEventListenerOnce(target, type, listener) {
1610
+ let addOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
1611
+ let removeOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
1601
1612
  target.addEventListener(type, function fn(event) {
1602
1613
  let result = listener.apply(this, arguments, addOptions);
1603
1614
  if (result !== false) {
@@ -1877,7 +1888,7 @@ class hlp {
1877
1888
  }
1878
1889
  static querySelectorAllShadowDom(selector) {
1879
1890
  let traverse = function ($parent) {
1880
- $els = [];
1891
+ let $els = [];
1881
1892
  if ($parent.querySelector('*') !== null) {
1882
1893
  $parent.querySelectorAll('*').forEach($el => {
1883
1894
  $els.push($el);
@@ -1889,7 +1900,7 @@ class hlp {
1889
1900
  return $els;
1890
1901
  };
1891
1902
  let fragment = document.createDocumentFragment();
1892
- $els = traverse(document);
1903
+ let $els = traverse(document);
1893
1904
  $els.forEach($el => {
1894
1905
  if ($el.matches(selector)) {
1895
1906
  fragment.appendChild($el.cloneNode());
@@ -1909,19 +1920,19 @@ class hlp {
1909
1920
  let mask = document.createElement('div');
1910
1921
  mask.classList.add('hlp-focus-mask');
1911
1922
  mask.style.position = 'fixed';
1912
- mask.style.top = 0;
1913
- mask.style.bottom = 0;
1914
- mask.style.left = 0;
1915
- mask.style.right = 0;
1923
+ mask.style.top = '0';
1924
+ mask.style.bottom = '0';
1925
+ mask.style.left = '0';
1926
+ mask.style.right = '0';
1916
1927
  mask.style.backgroundColor = 'rgba(0,0,0,0.8)';
1917
- mask.style.zIndex = 2147483646;
1928
+ mask.style.zIndex = '2147483646';
1918
1929
  el.before(mask);
1919
- el.setAttribute('data-focussed', 1);
1930
+ el.setAttribute('data-focussed', '1');
1920
1931
  el.setAttribute('data-focussed-orig-z-index', el.style.zIndex);
1921
1932
  el.setAttribute('data-focussed-orig-position', el.style.position);
1922
1933
  el.setAttribute('data-focussed-orig-background-color', el.style.backgroundColor);
1923
1934
  el.setAttribute('data-focussed-orig-box-shadow', el.style.boxShadow);
1924
- el.style.zIndex = 2147483647;
1935
+ el.style.zIndex = '2147483647';
1925
1936
  el.style.position = 'relative';
1926
1937
  el.style.backgroundColor = '#ffffff';
1927
1938
  el.style.boxShadow = '0px 0px 0px 20px #fff';
@@ -2191,7 +2202,8 @@ class hlp {
2191
2202
  }[op];
2192
2203
  return Math.round(n * 10 * Math.pow(10, precision)) / (10 * Math.pow(10, precision));
2193
2204
  }
2194
- static trim(str, charlist) {
2205
+ static trim(str) {
2206
+ let charlist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2195
2207
  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
2208
  let l = 0;
2197
2209
  let i = 0;
@@ -2215,12 +2227,14 @@ class hlp {
2215
2227
  }
2216
2228
  return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
2217
2229
  }
2218
- static ltrim(str, charlist) {
2230
+ static ltrim(str) {
2231
+ let charlist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2219
2232
  charlist = !charlist ? ' \\s\u00A0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1');
2220
2233
  const re = new RegExp('^[' + charlist + ']+', 'g');
2221
2234
  return (str + '').replace(re, '');
2222
2235
  }
2223
- static rtrim(str, charlist) {
2236
+ static rtrim(str) {
2237
+ let charlist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2224
2238
  charlist = !charlist ? ' \\s\u00A0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '\\$1');
2225
2239
  const re = new RegExp('[' + charlist + ']+$', 'g');
2226
2240
  return (str + '').replace(re, '');
@@ -2257,7 +2271,7 @@ class hlp {
2257
2271
  return new RegExp(hlp.emojiRegexPattern(), (global === true ? 'g' : '') + 'u');
2258
2272
  }
2259
2273
  static emojiRegexPattern() {
2260
- 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})?))*`;
2274
+ return String.raw(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["p{RI}p{RI}|p{Extended_Pictographic}(p{EMod}|\uFE0F\u20E3?|[\uDB40\uDC20-\uDB40\uDC7E]+\uDB40\uDC7F)?(\u200D(p{RI}p{RI}|p{Extended_Pictographic}(p{EMod}|\uFE0F\u20E3?|[\uDB40\uDC20-\uDB40\uDC7E]+\uDB40\uDC7F)?))*"], ["\\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})?))*"])));
2261
2275
  }
2262
2276
  static emojiSplit(str) {
2263
2277
  if (!(typeof str === 'string' || str instanceof String)) {
@@ -2353,7 +2367,7 @@ class hlp {
2353
2367
  };
2354
2368
  cache.get = index => {
2355
2369
  if (index >= store.length) {
2356
- throw RangeError(`Can't resolve reference ${index + 1}`);
2370
+ throw RangeError("Can't resolve reference ".concat(index + 1));
2357
2371
  }
2358
2372
  return store[index];
2359
2373
  };
@@ -2384,30 +2398,42 @@ class hlp {
2384
2398
  case 'R':
2385
2399
  return expectReference(s);
2386
2400
  default:
2387
- throw SyntaxError(`Invalid or unsupported data type: ${type}`);
2401
+ throw SyntaxError("Invalid or unsupported data type: ".concat(type));
2388
2402
  }
2389
2403
  };
2390
2404
  const expectBool = s => {
2391
2405
  const reBool = /^b:([01]);/;
2392
- const [match, boolMatch] = reBool.exec(s) || [];
2406
+ const _ref13 = reBool.exec(s) || [],
2407
+ _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
2408
+ match = _ref14[0],
2409
+ boolMatch = _ref14[1];
2393
2410
  if (!boolMatch) throw SyntaxError('Invalid bool value, expected 0 or 1');
2394
2411
  return [boolMatch === '1', match.length];
2395
2412
  };
2396
2413
  const expectInt = s => {
2397
2414
  const reInt = /^i:([+-]?\d+);/;
2398
- const [match, intMatch] = reInt.exec(s) || [];
2415
+ const _ref15 = reInt.exec(s) || [],
2416
+ _ref16 = (0, _slicedToArray2.default)(_ref15, 2),
2417
+ match = _ref16[0],
2418
+ intMatch = _ref16[1];
2399
2419
  if (!intMatch) throw SyntaxError('Expected an integer value');
2400
2420
  return [parseInt(intMatch, 10), match.length];
2401
2421
  };
2402
2422
  const expectFloat = s => {
2403
2423
  const reFloat = /^d:(NAN|-?INF|(?:\d+\.\d*|\d*\.\d+|\d+)(?:[eE][+-]\d+)?);/;
2404
- const [match, floatMatch] = reFloat.exec(s) || [];
2424
+ const _ref17 = reFloat.exec(s) || [],
2425
+ _ref18 = (0, _slicedToArray2.default)(_ref17, 2),
2426
+ match = _ref18[0],
2427
+ floatMatch = _ref18[1];
2405
2428
  if (!floatMatch) throw SyntaxError('Expected a float value');
2406
2429
  return [floatMatch === 'NAN' ? Number.NaN : floatMatch === '-INF' ? Number.NEGATIVE_INFINITY : floatMatch === 'INF' ? Number.POSITIVE_INFINITY : parseFloat(floatMatch), match.length];
2407
2430
  };
2408
2431
  const expectString = s => {
2409
2432
  const reStrLength = /^s:(\d+):"/g;
2410
- const [match, byteLenMatch] = reStrLength.exec(s) || [];
2433
+ const _ref19 = reStrLength.exec(s) || [],
2434
+ _ref20 = (0, _slicedToArray2.default)(_ref19, 2),
2435
+ match = _ref20[0],
2436
+ byteLenMatch = _ref20[1];
2411
2437
  if (!match) throw SyntaxError('Expected a string value');
2412
2438
  const len = parseInt(byteLenMatch, 10);
2413
2439
  s = s.substr(match.length);
@@ -2418,7 +2444,10 @@ class hlp {
2418
2444
  };
2419
2445
  const expectEscapedString = s => {
2420
2446
  const reStrLength = /^S:(\d+):"/g;
2421
- const [match, strLenMatch] = reStrLength.exec(s) || [];
2447
+ const _ref21 = reStrLength.exec(s) || [],
2448
+ _ref22 = (0, _slicedToArray2.default)(_ref21, 2),
2449
+ match = _ref22[0],
2450
+ strLenMatch = _ref22[1];
2422
2451
  if (!match) throw SyntaxError('Expected an escaped string value');
2423
2452
  const len = parseInt(strLenMatch, 10);
2424
2453
  s = s.substr(match.length);
@@ -2429,13 +2458,19 @@ class hlp {
2429
2458
  };
2430
2459
  const expectReference = s => {
2431
2460
  const reRef = /^[rR]:(\d+);/;
2432
- const [match, refIndex] = reRef.exec(s) || [];
2461
+ const _ref23 = reRef.exec(s) || [],
2462
+ _ref24 = (0, _slicedToArray2.default)(_ref23, 2),
2463
+ match = _ref24[0],
2464
+ refIndex = _ref24[1];
2433
2465
  if (!match) throw SyntaxError('Expected reference value');
2434
2466
  return [cache.get(parseInt(refIndex, 10) - 1), match.length];
2435
2467
  };
2436
2468
  const expectArray = s => {
2437
2469
  const reArrayLength = /^a:(\d+):\{/;
2438
- const [arrayLiteralBeginMatch, arrayLengthMatch] = reArrayLength.exec(s) || [];
2470
+ const _ref25 = reArrayLength.exec(s) || [],
2471
+ _ref26 = (0, _slicedToArray2.default)(_ref25, 2),
2472
+ arrayLiteralBeginMatch = _ref26[0],
2473
+ arrayLengthMatch = _ref26[1];
2439
2474
  if (!arrayLengthMatch) throw SyntaxError('Expected array length annotation');
2440
2475
  s = s.substr(arrayLiteralBeginMatch.length);
2441
2476
  const items = {};
@@ -2452,9 +2487,13 @@ class hlp {
2452
2487
  };
2453
2488
  const expectObject = s => {
2454
2489
  const reObjectLiteral = /^O:(\d+):"([^\"]+)":(\d+):\{/;
2455
- const [match,, className, propCountMatch] = reObjectLiteral.exec(s) || [];
2490
+ const _ref27 = reObjectLiteral.exec(s) || [],
2491
+ _ref28 = (0, _slicedToArray2.default)(_ref27, 4),
2492
+ match = _ref28[0],
2493
+ className = _ref28[2],
2494
+ propCountMatch = _ref28[3];
2456
2495
  if (!match) throw SyntaxError('Invalid input');
2457
- if (className !== 'stdClass') throw SyntaxError(`Unsupported object type: ${className}`);
2496
+ if (className !== 'stdClass') throw SyntaxError("Unsupported object type: ".concat(className));
2458
2497
  let obj = {};
2459
2498
  cache([obj]);
2460
2499
  s = s.substr(match.length);
@@ -2591,7 +2630,7 @@ class hlp {
2591
2630
  let file = null;
2592
2631
  try {
2593
2632
  file = new File([blob], filename);
2594
- } catch {
2633
+ } catch (_unused) {
2595
2634
  // ie 11
2596
2635
  file = new Blob([blob], filename);
2597
2636
  }
@@ -2606,9 +2645,7 @@ class hlp {
2606
2645
  return this.blobtofile(this.base64toblob(base64, contentType), filename);
2607
2646
  }
2608
2647
  static blobtourl(blob) {
2609
- return URL.createObjectURL(blob, {
2610
- type: 'text/plain'
2611
- });
2648
+ return URL.createObjectURL(blob);
2612
2649
  }
2613
2650
  static stringtourl(string) {
2614
2651
  return this.blobtourl(this.stringtoblob(string));
@@ -2809,7 +2846,10 @@ class hlp {
2809
2846
  let path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
2810
2847
  let paths = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
2811
2848
  if (object !== null && typeof object === 'object') {
2812
- for (const [object__key, object__value] of Object.entries(object)) {
2849
+ for (const _ref29 of Object.entries(object)) {
2850
+ var _ref30 = (0, _slicedToArray2.default)(_ref29, 2);
2851
+ const object__key = _ref30[0];
2852
+ const object__value = _ref30[1];
2813
2853
  if (object__value !== null && typeof object__value === 'object') {
2814
2854
  this.findRecursiveInObject(object__value, key, value, (path === '' ? '' : path + '.') + object__key, paths);
2815
2855
  } else if ((key === null || object__key === key) && (value === null || object__value === value)) {
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.9",
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.5",
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.30001792",
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.3.0",
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": "^22.1.0",
80
80
  "npm-run-all2": "^8.0.4",
81
81
  "onchange": "^7.1.0",
82
- "postcss": "^8.5.8",
82
+ "postcss": "^8.5.14",
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.43.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": [