@tspro/ts-utils-lib 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /* TsUtilsLib v1.17.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
1
+ /* TsUtilsLib v1.18.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __export = (target, all) => {
@@ -7,55 +7,51 @@ var __export = (target, all) => {
7
7
  };
8
8
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
9
 
10
- // src/utils/index.ts
11
- var utils_exports = {};
12
- __export(utils_exports, {
13
- Arr: () => arr_exports,
14
- Dom: () => dom_exports,
15
- Enum: () => enum_exports,
16
- Is: () => is_exports,
17
- Map: () => map_exports,
18
- Math: () => math_exports,
19
- Obj: () => obj_exports,
20
- Str: () => str_exports
21
- });
22
-
23
- // src/utils/arr/index.ts
24
- var arr_exports = {};
25
- __export(arr_exports, {
26
- arrayContains: () => arrayContains,
27
- chunckArray: () => chunckArray,
28
- duplicate: () => duplicate,
29
- fillArray: () => fillArray,
30
- getRangeArray: () => getRangeArray,
31
- getSequenceArray: () => getSequenceArray,
32
- isArray: () => isArray,
33
- mapRangeArray: () => mapRangeArray,
34
- mapSequenceArray: () => mapSequenceArray,
35
- removeDuplicates: () => removeDuplicates,
36
- removeDuplicatesCmp: () => removeDuplicatesCmp,
37
- toArray: () => toArray
38
- });
39
-
40
- // src/utils/is/index.ts
41
- var is_exports = {};
42
- __export(is_exports, {
10
+ // src/assert/index.ts
11
+ var assert_exports = {};
12
+ __export(assert_exports, {
13
+ array_elem: () => array_elem,
14
+ array_id: () => array_id,
15
+ assert: () => assert,
16
+ assertEnum: () => assertEnum,
17
+ eq: () => eq,
18
+ even: () => even,
19
+ fail: () => fail,
20
+ finite: () => finite,
21
+ in_group: () => in_group,
22
+ int: () => int,
23
+ int_between: () => int_between,
24
+ int_between_exclusive: () => int_between_exclusive,
25
+ int_eq: () => int_eq,
26
+ int_gt: () => int_gt,
27
+ int_gte: () => int_gte,
28
+ int_lt: () => int_lt,
29
+ int_lte: () => int_lte,
30
+ interrupt: () => interrupt,
43
31
  isArray: () => isArray,
32
+ isArrayIndex: () => isArrayIndex,
44
33
  isArrayOrUndefined: () => isArrayOrUndefined,
45
34
  isBoolean: () => isBoolean,
46
35
  isBooleanOrUndefined: () => isBooleanOrUndefined,
36
+ isDeepEqual: () => isDeepEqual,
47
37
  isEmptyArray: () => isEmptyArray,
48
38
  isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined,
49
39
  isEmptyString: () => isEmptyString,
50
40
  isEmptyStringOrUndefined: () => isEmptyStringOrUndefined,
51
41
  isEnumValue: () => isEnumValue,
52
42
  isEnumValueOrUndefined: () => isEnumValueOrUndefined,
43
+ isEqual: () => isEqual,
44
+ isEvenNumber: () => isEvenNumber,
45
+ isFalse: () => isFalse,
46
+ isFalseOrUndefined: () => isFalseOrUndefined,
53
47
  isFinite: () => isFinite2,
54
48
  isFunction: () => isFunction,
55
49
  isFunctionOrUndefined: () => isFunctionOrUndefined,
50
+ isIncluded: () => isIncluded,
56
51
  isInfinity: () => isInfinity,
57
52
  isInteger: () => isInteger,
58
53
  isIntegerBetween: () => isIntegerBetween,
54
+ isIntegerBetweenExclusive: () => isIntegerBetweenExclusive,
59
55
  isIntegerEq: () => isIntegerEq,
60
56
  isIntegerGt: () => isIntegerGt,
61
57
  isIntegerGte: () => isIntegerGte,
@@ -71,143 +67,936 @@ __export(is_exports, {
71
67
  isNull: () => isNull,
72
68
  isNullish: () => isNullish,
73
69
  isNumber: () => isNumber,
70
+ isNumberBetween: () => isNumberBetween,
71
+ isNumberBetweenExclusive: () => isNumberBetweenExclusive,
74
72
  isNumberOrUndefined: () => isNumberOrUndefined,
75
73
  isObject: () => isObject,
76
74
  isObjectOrUndefined: () => isObjectOrUndefined,
75
+ isOddNumber: () => isOddNumber,
77
76
  isPosInfinity: () => isPosInfinity,
78
77
  isString: () => isString,
79
78
  isStringOrUndefined: () => isStringOrUndefined,
80
- isUndefined: () => isUndefined
79
+ isThrowing: () => isThrowing,
80
+ isTrue: () => isTrue,
81
+ isTrueOrUndefined: () => isTrueOrUndefined,
82
+ isTypedObject: () => isTypedObject,
83
+ isUndefined: () => isUndefined,
84
+ odd: () => odd,
85
+ require: () => require2,
86
+ requireDefined: () => requireDefined,
87
+ setErrorClass: () => setErrorClass
88
+ });
89
+ var errorConstructor = Error;
90
+ function setErrorClass(errorClass) {
91
+ errorConstructor = errorClass ?? Error;
92
+ }
93
+ function _fail(...msgs) {
94
+ let msg = msgs.join(", ");
95
+ throw new errorConstructor("Assertion Failed!" + (msg === "" ? "" : " " + msg));
96
+ }
97
+ function interrupt(msg) {
98
+ _fail("Interrupted!");
99
+ }
100
+ function assertEnum(enumVal, enumObj, name = "value") {
101
+ if (!guard_exports.isEnumValue(enumVal, enumObj))
102
+ _fail(`Invalid enum value ${enumVal}.`);
103
+ }
104
+ function int(value, msg) {
105
+ if (!guard_exports.isInteger(value))
106
+ _fail(`Expected ${value} to be integer.`, msg);
107
+ return value;
108
+ }
109
+ function eq(value1, value2, msg) {
110
+ if (value1 !== value2)
111
+ _fail(`Expected ${value1} to equal ${value2}.`, msg);
112
+ return value1;
113
+ }
114
+ function int_eq(value, compareTo, msg) {
115
+ if (!guard_exports.isIntegerEq(value, compareTo))
116
+ _fail(`Expected ${value} to be integer equal to ${compareTo}.`, msg);
117
+ return value;
118
+ }
119
+ function int_lt(value, compareTo, msg) {
120
+ if (!guard_exports.isIntegerLt(value, compareTo))
121
+ _fail(`Expected ${value} to be integer less than ${compareTo}.`, msg);
122
+ return value;
123
+ }
124
+ function int_lte(value, compareTo, msg) {
125
+ if (!guard_exports.isIntegerLte(value, compareTo))
126
+ _fail(`Expected ${value} to be integer less than or equal to ${compareTo}.`, msg);
127
+ return value;
128
+ }
129
+ function int_gt(value, compareTo, msg) {
130
+ if (!guard_exports.isIntegerGt(value, compareTo))
131
+ _fail(`Expected ${value} to be integer greater than ${compareTo}.`, msg);
132
+ return value;
133
+ }
134
+ function int_gte(value, compareTo, msg) {
135
+ if (!guard_exports.isIntegerGte(value, compareTo))
136
+ _fail(`Expected ${value} to be integer greater than or equal to ${compareTo}.`, msg);
137
+ return value;
138
+ }
139
+ function int_between(value, min, max, msg) {
140
+ if (!guard_exports.isIntegerBetween(value, min, max))
141
+ _fail(`Expected integer between ${min} <= ${value} <= ${max}.`, msg);
142
+ return value;
143
+ }
144
+ function int_between_exclusive(value, min, max, msg) {
145
+ if (!guard_exports.isIntegerBetweenExclusive(value, min, max))
146
+ _fail(`Expected integer between ${min} < ${value} < ${max}.`, msg);
147
+ return value;
148
+ }
149
+ function odd(value, msg) {
150
+ if (!guard_exports.isOddNumber(value))
151
+ _fail(`Expected ${value} to be odd number.`, msg);
152
+ return value;
153
+ }
154
+ function even(value, msg) {
155
+ if (!guard_exports.isEvenNumber(value))
156
+ _fail(`Expected ${value} to be even number.`, msg);
157
+ return value;
158
+ }
159
+ function in_group(value, group, msg) {
160
+ if (!group.some((e) => e === value))
161
+ _fail(`Expected ${value} to be in group [${group.map((v) => String(v)).join(", ")}].`, msg);
162
+ return value;
163
+ }
164
+ function finite(value, msg) {
165
+ if (!guard_exports.isFinite(value))
166
+ _fail(`Expected ${value} to be finite number.`, msg);
167
+ return value;
168
+ }
169
+ function array_id(array, index, msg) {
170
+ if (!guard_exports.isInteger(index) || !guard_exports.isArray(array) || index < 0 || index >= array.length)
171
+ _fail(`Expected ${index} to be array index in bounds [0..${array.length - 1}].`, msg);
172
+ return index;
173
+ }
174
+ function array_elem(array, index, msg) {
175
+ return array[array_id(array, index, msg)];
176
+ }
177
+ function assert(condition, msg) {
178
+ if (!condition) {
179
+ _fail(msg);
180
+ }
181
+ }
182
+ function require2(value, msg) {
183
+ if (value == null) {
184
+ _fail(`Expected ${value} not to be nullish`, msg);
185
+ }
186
+ return value;
187
+ }
188
+ function requireDefined(value, msg) {
189
+ if (value === void 0) {
190
+ _fail(`Expected ${value} not to be undefined`, msg);
191
+ }
192
+ return value;
193
+ }
194
+ function fail(msg) {
195
+ _fail(msg);
196
+ }
197
+ function isEqual(value1, value2, msg) {
198
+ if (!guard_exports.isEqual(value1, value2))
199
+ _fail(`Expected ${value1} to equal with ${value2}`, msg);
200
+ return true;
201
+ }
202
+ function isDeepEqual(value1, value2, msg) {
203
+ if (!guard_exports.isDeepEqual(value1, value2))
204
+ _fail(`Expected ${value1} to deep equal with ${value2}`, msg);
205
+ return true;
206
+ }
207
+ function isUndefined(value, msg) {
208
+ if (!guard_exports.isUndefined(value))
209
+ _fail(`Expected ${value} to be undefined`, msg);
210
+ return true;
211
+ }
212
+ function isNull(value, msg) {
213
+ if (!guard_exports.isNull(value))
214
+ _fail(`Expected ${value} to be null`, msg);
215
+ return true;
216
+ }
217
+ function isNullish(value, msg) {
218
+ if (!guard_exports.isNullish(value))
219
+ _fail(`Expected ${value} to be null or undefined`, msg);
220
+ return true;
221
+ }
222
+ function isObject(value, msg) {
223
+ if (!guard_exports.isObject(value))
224
+ _fail(`Expected ${value} to be object`, msg);
225
+ return true;
226
+ }
227
+ function isObjectOrUndefined(value, msg) {
228
+ if (!guard_exports.isObjectOrUndefined(value))
229
+ _fail(`Expected ${value} to be object or undefined`, msg);
230
+ return true;
231
+ }
232
+ function isTypedObject(obj, keys, msg) {
233
+ if (!guard_exports.isTypedObject(obj, keys))
234
+ _fail(`Expected ${obj} to be object with keys [${keys.map((key) => `'${String(key)}'`).join(", ")}]`, msg);
235
+ return true;
236
+ }
237
+ function isArray(value, msg) {
238
+ if (!guard_exports.isArray(value))
239
+ _fail(`Expected ${value} to be array`, msg);
240
+ return true;
241
+ }
242
+ function isArrayOrUndefined(value, msg) {
243
+ if (!guard_exports.isArrayOrUndefined(value))
244
+ _fail(`Expected ${value} to be array or undefined`, msg);
245
+ return true;
246
+ }
247
+ function isEmptyArray(value, msg) {
248
+ if (!guard_exports.isEmptyArray(value))
249
+ _fail(`Expected ${value} to be empty array`, msg);
250
+ return true;
251
+ }
252
+ function isNonEmptyArray(value, msg) {
253
+ if (!guard_exports.isNonEmptyArray(value))
254
+ _fail(`Expected ${value} to be non-empty array`, msg);
255
+ return true;
256
+ }
257
+ function isEmptyArrayOrUndefined(value, msg) {
258
+ if (!guard_exports.isEmptyArrayOrUndefined(value))
259
+ _fail(`Expected ${value} to be empty array or undefined`, msg);
260
+ return true;
261
+ }
262
+ function isNonEmptyArrayOrUndefined(value, msg) {
263
+ if (!guard_exports.isNonEmptyArrayOrUndefined(value))
264
+ _fail(`Expected ${value} to be non-empty array or undefined`, msg);
265
+ return true;
266
+ }
267
+ function isString(value, msg) {
268
+ if (!guard_exports.isString(value))
269
+ _fail(`Expected ${value} to be string`, msg);
270
+ return true;
271
+ }
272
+ function isEmptyString(value, msg) {
273
+ if (!guard_exports.isEmptyString(value))
274
+ _fail(`Expected ${value} to be empty string`, msg);
275
+ return true;
276
+ }
277
+ function isNonEmptyString(value, msg) {
278
+ if (!guard_exports.isNonEmptyString(value))
279
+ _fail(`Expected ${value} to be non-empty string`, msg);
280
+ return true;
281
+ }
282
+ function isStringOrUndefined(value, msg) {
283
+ if (!guard_exports.isStringOrUndefined(value))
284
+ _fail(`Expected ${value} to be string or undefined`, msg);
285
+ return true;
286
+ }
287
+ function isEmptyStringOrUndefined(value, msg) {
288
+ if (!guard_exports.isEmptyStringOrUndefined(value))
289
+ _fail(`Expected ${value} to be empty string or undefined`, msg);
290
+ return true;
291
+ }
292
+ function isNonEmptyStringOrUndefined(value, msg) {
293
+ if (!guard_exports.isNonEmptyStringOrUndefined(value))
294
+ _fail(`Expected ${value} to be non-empty string or undefined`, msg);
295
+ return true;
296
+ }
297
+ function isBoolean(value, msg) {
298
+ if (!guard_exports.isBoolean(value))
299
+ _fail(`Expected ${value} to be boolean`, msg);
300
+ return true;
301
+ }
302
+ function isBooleanOrUndefined(value, msg) {
303
+ if (!guard_exports.isBooleanOrUndefined(value))
304
+ _fail(`Expected ${value} to be boolean or undefined`, msg);
305
+ return true;
306
+ }
307
+ function isTrue(value, msg) {
308
+ if (!guard_exports.isTrue(value))
309
+ _fail(`Expected ${value} to be true`, msg);
310
+ return true;
311
+ }
312
+ function isTrueOrUndefined(value, msg) {
313
+ if (!guard_exports.isTrueOrUndefined(value))
314
+ _fail(`Expected ${value} to be true or undefined`, msg);
315
+ return true;
316
+ }
317
+ function isFalse(value, msg) {
318
+ if (!guard_exports.isFalse(value))
319
+ _fail(`Expected ${value} to be false`, msg);
320
+ return true;
321
+ }
322
+ function isFalseOrUndefined(value, msg) {
323
+ if (!guard_exports.isFalseOrUndefined(value))
324
+ _fail(`Expected ${value} to be false or undefined`, msg);
325
+ return true;
326
+ }
327
+ function isFunction(value, msg) {
328
+ if (!guard_exports.isFunction(value))
329
+ _fail(`Expected ${value} to be function`, msg);
330
+ return true;
331
+ }
332
+ function isFunctionOrUndefined(value, msg) {
333
+ if (!guard_exports.isFunctionOrUndefined(value))
334
+ _fail(`Expected ${value} to be function or undefined`, msg);
335
+ return true;
336
+ }
337
+ function isEnumValue(enumValue, enumObject, msg) {
338
+ if (!guard_exports.isEnumValue(enumValue, enumObject))
339
+ _fail(`Expected ${enumValue} to be enum value`, msg);
340
+ return true;
341
+ }
342
+ function isEnumValueOrUndefined(enumValue, enumObject, msg) {
343
+ if (!guard_exports.isEnumValueOrUndefined(enumValue, enumObject))
344
+ _fail(`Expected ${enumValue} to be enum value or undefined`, msg);
345
+ return true;
346
+ }
347
+ function isNumber(value, msg) {
348
+ if (!guard_exports.isNumber(value))
349
+ _fail(`Expected ${value} to be number`, msg);
350
+ return true;
351
+ }
352
+ function isNumberOrUndefined(value, msg) {
353
+ if (!guard_exports.isNumberOrUndefined(value))
354
+ _fail(`Expected ${value} to be number or undefined`, msg);
355
+ return true;
356
+ }
357
+ function isFinite2(value, msg) {
358
+ if (!guard_exports.isFinite(value))
359
+ _fail(`Expected ${value} to be finite`, msg);
360
+ return true;
361
+ }
362
+ function isInteger(value, msg) {
363
+ if (!guard_exports.isInteger(value))
364
+ _fail(`Expected ${value} to be integer`, msg);
365
+ return true;
366
+ }
367
+ function isIntegerOrUndefined(value, msg) {
368
+ if (!guard_exports.isIntegerOrUndefined(value))
369
+ _fail(`Expected ${value} to be integer or undefined`, msg);
370
+ return true;
371
+ }
372
+ function isIntegerEq(value, compareTo, msg) {
373
+ if (!guard_exports.isIntegerEq(value, compareTo))
374
+ _fail(`Expected ${value} to be integer equal to ${compareTo}`, msg);
375
+ return true;
376
+ }
377
+ function isIntegerGt(value, compareTo, msg) {
378
+ if (!guard_exports.isIntegerGt(value, compareTo))
379
+ _fail(`Expected ${value} to be integer > ${compareTo}`, msg);
380
+ return true;
381
+ }
382
+ function isIntegerGte(value, compareTo, msg) {
383
+ if (!guard_exports.isIntegerGte(value, compareTo))
384
+ _fail(`Expected ${value} to be integer >= ${compareTo}`, msg);
385
+ return true;
386
+ }
387
+ function isIntegerLt(value, compareTo, msg) {
388
+ if (!guard_exports.isIntegerLt(value, compareTo))
389
+ _fail(`Expected ${value} to be integer < ${compareTo}`, msg);
390
+ return true;
391
+ }
392
+ function isIntegerLte(value, compareTo, msg) {
393
+ if (!guard_exports.isIntegerLte(value, compareTo))
394
+ _fail(`Expected ${value} to be integer <= ${compareTo}`, msg);
395
+ return true;
396
+ }
397
+ function isIntegerBetween(value, min, max, msg) {
398
+ if (!guard_exports.isIntegerBetween(value, min, max))
399
+ _fail(`Expected integer ${min} <= ${value} <= ${max}.`, msg);
400
+ return true;
401
+ }
402
+ function isIntegerBetweenExclusive(value, min, max, msg) {
403
+ if (!guard_exports.isIntegerBetweenExclusive(value, min, max))
404
+ _fail(`Expected integer ${min} < ${value} < ${max}.`, msg);
405
+ return true;
406
+ }
407
+ function isNumberBetween(value, min, max, msg) {
408
+ if (!guard_exports.isNumberBetween(value, min, max))
409
+ _fail(`Expected number ${min} <= ${value} <= ${max}.`, msg);
410
+ return true;
411
+ }
412
+ function isNumberBetweenExclusive(value, min, max, msg) {
413
+ if (!guard_exports.isNumberBetweenExclusive(value, min, max))
414
+ _fail(`Expected number ${min} < ${value} < ${max}.`, msg);
415
+ return true;
416
+ }
417
+ function isNaNValue(value, msg) {
418
+ if (!guard_exports.isNaNValue(value))
419
+ _fail(`Expected ${value} to be NaN.`, msg);
420
+ return true;
421
+ }
422
+ function isInfinity(value, msg) {
423
+ if (!guard_exports.isInfinity(value))
424
+ _fail(`Expected ${value} to be +-Infinity.`, msg);
425
+ return true;
426
+ }
427
+ function isPosInfinity(value, msg) {
428
+ if (!guard_exports.isPosInfinity(value))
429
+ _fail(`Expected ${value} to be +Infinity.`, msg);
430
+ return true;
431
+ }
432
+ function isNegInfinity(value, msg) {
433
+ if (!guard_exports.isNegInfinity(value))
434
+ _fail(`Expected ${value} to be -Infinity.`, msg);
435
+ return true;
436
+ }
437
+ function isOddNumber(value, msg) {
438
+ if (!guard_exports.isOddNumber(value))
439
+ _fail(`Expected ${value} to odd number.`, msg);
440
+ return true;
441
+ }
442
+ function isEvenNumber(value, msg) {
443
+ if (!guard_exports.isEvenNumber(value))
444
+ _fail(`Expected ${value} to even number.`, msg);
445
+ return true;
446
+ }
447
+ function isIncluded(value, array, msg) {
448
+ if (!guard_exports.isIncluded(value, array))
449
+ _fail(`Expected ${value} to be included in [${array.map((v) => String(v)).join(", ")}].`, msg);
450
+ return true;
451
+ }
452
+ function isArrayIndex(index, array, msg) {
453
+ if (!guard_exports.isArrayIndex(index, array))
454
+ _fail(`Expected ${index} to be index for array [${array.map((v) => String(v)).join(", ")}]`, msg);
455
+ return true;
456
+ }
457
+ function isThrowing(throwTestFn, msg) {
458
+ if (!guard_exports.isThrowing(throwTestFn))
459
+ _fail(`Expected to throw`, msg);
460
+ return true;
461
+ }
462
+
463
+ // src/web/cookies.ts
464
+ var cookies_exports = {};
465
+ __export(cookies_exports, {
466
+ accept: () => accept,
467
+ decline: () => decline,
468
+ erase: () => erase,
469
+ eraseAll: () => eraseAll,
470
+ isConsentPending: () => isConsentPending,
471
+ read: () => read,
472
+ readBool: () => readBool,
473
+ readInt: () => readInt,
474
+ save: () => save,
475
+ setExpireDays: () => setExpireDays
81
476
  });
477
+ var ConsentCookieName = "ConsentCookie";
478
+ var _consent;
479
+ var _expires;
480
+ var str = _read(ConsentCookieName);
481
+ _consent = str === "accept" /* Accept */ || str === "decline" /* Decline */ ? str : void 0;
482
+ function setExpireDays(days) {
483
+ _expires = /* @__PURE__ */ new Date();
484
+ _expires.setDate(_expires.getDate() + days);
485
+ }
486
+ function isConsentPending() {
487
+ return _consent === void 0;
488
+ }
489
+ function accept() {
490
+ _consent = "accept" /* Accept */;
491
+ _save(ConsentCookieName, _consent);
492
+ }
493
+ function decline() {
494
+ _consent = "decline" /* Decline */;
495
+ _save(ConsentCookieName, _consent);
496
+ }
497
+ function _getList() {
498
+ let s = document.cookie;
499
+ return s.split(";").map((c) => c.trim());
500
+ }
501
+ function _save(name, value) {
502
+ let cookie = name + "=" + value.toString() + ";sameSite=Lax;";
503
+ if (_expires) {
504
+ cookie += "expires=" + _expires.toUTCString() + ";";
505
+ }
506
+ document.cookie = cookie;
507
+ return value;
508
+ }
509
+ function _read(name, defaultValue) {
510
+ let str2 = _getList().find((c) => c.startsWith(name + "="));
511
+ return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
512
+ }
513
+ function _erase(name) {
514
+ document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
515
+ }
516
+ function save(name, value) {
517
+ if (_consent === "accept" /* Accept */) {
518
+ _save(name, value);
519
+ }
520
+ return value;
521
+ }
522
+ function read(name, defaultValue) {
523
+ if (_consent === "accept" /* Accept */) {
524
+ return _read(name, defaultValue) || defaultValue;
525
+ } else {
526
+ return defaultValue;
527
+ }
528
+ }
529
+ function readInt(name, defaultValue) {
530
+ if (_consent === "accept" /* Accept */) {
531
+ let str2 = _read(name);
532
+ return str2 === void 0 ? defaultValue : parseInt(str2);
533
+ } else {
534
+ return defaultValue;
535
+ }
536
+ }
537
+ function readBool(name, defaultValue) {
538
+ if (_consent === "accept" /* Accept */) {
539
+ let str2 = _read(name);
540
+ return str2 === void 0 ? defaultValue : /true|1/i.test(str2);
541
+ } else {
542
+ return defaultValue;
543
+ }
544
+ }
545
+ function erase(name) {
546
+ if (_consent === "accept" /* Accept */ || name === ConsentCookieName) {
547
+ _erase(name);
548
+ }
549
+ }
550
+ function eraseAll() {
551
+ document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
552
+ }
553
+
554
+ // src/web/device.ts
555
+ var device_exports = {};
556
+ __export(device_exports, {
557
+ DPI: () => DPI,
558
+ FontSize: () => FontSize,
559
+ HostAddress: () => HostAddress,
560
+ IsMobileDevice: () => IsMobileDevice,
561
+ IsTouchDevice: () => IsTouchDevice,
562
+ PxPerMm: () => PxPerMm,
563
+ ScrollbarWidth: () => ScrollbarWidth,
564
+ mmToPx: () => mmToPx,
565
+ pxToMm: () => pxToMm,
566
+ toPx: () => toPx
567
+ });
568
+ function getDPI() {
569
+ let el = document.createElement("div");
570
+ el.style.width = "1in";
571
+ document.body.appendChild(el);
572
+ let dpi = el.offsetWidth;
573
+ el.remove();
574
+ return dpi || 96;
575
+ }
576
+ function getScrollBarWidth() {
577
+ try {
578
+ let outer = document.createElement("div");
579
+ outer.style.visibility = "hidden";
580
+ outer.style.width = "100px";
581
+ document.body.appendChild(outer);
582
+ let widthNoScroll = outer.offsetWidth;
583
+ outer.style.overflow = "scroll";
584
+ let inner = document.createElement("div");
585
+ inner.style.width = "100%";
586
+ outer.appendChild(inner);
587
+ let widthWithScroll = inner.offsetWidth;
588
+ if (outer.parentNode) {
589
+ outer.parentNode.removeChild(outer);
590
+ }
591
+ return widthNoScroll - widthWithScroll;
592
+ } catch (e) {
593
+ return 0;
594
+ }
595
+ }
596
+ function getSystemFontSize() {
597
+ let tmpDiv = document.createElement("div");
598
+ tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
599
+ tmpDiv.appendChild(document.createTextNode("M"));
600
+ document.body.appendChild(tmpDiv);
601
+ let fontsize = tmpDiv.offsetHeight;
602
+ document.body.removeChild(tmpDiv);
603
+ return fontsize;
604
+ }
605
+ function getIsTouchDevice() {
606
+ if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document) {
607
+ return true;
608
+ }
609
+ var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
610
+ var mq = function(query2) {
611
+ return window.matchMedia(query2).matches;
612
+ };
613
+ var query = ["(", prefixes.join("touch-enabled),("), "heartz", ")"].join("");
614
+ return mq(query);
615
+ }
616
+ function getIsMobileDevice() {
617
+ let a = navigator.userAgent || navigator.vendor || window.opera;
618
+ 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(a) || /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(a.substr(0, 4));
619
+ }
620
+ function getHostAddress() {
621
+ return location.protocol + "//" + location.host;
622
+ }
623
+ var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
624
+ var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
625
+ var DPI = getDPI();
626
+ var PxPerMm = DPI / 25.4;
627
+ var ScrollbarWidth = getScrollBarWidth();
628
+ var FontSize = getSystemFontSize();
629
+ var IsTouchDevice = getIsTouchDevice();
630
+ var IsMobileDevice = getIsMobileDevice();
631
+ var HostAddress = getHostAddress();
632
+ function pxToMm(px) {
633
+ return px / PxPerMm;
634
+ }
635
+ function mmToPx(mm) {
636
+ return mm * PxPerMm;
637
+ }
638
+ function toPx(input) {
639
+ if (typeof input === "number") {
640
+ return input;
641
+ }
642
+ let value = NaN;
643
+ let unit = void 0;
644
+ let match = input.toString().match(ValueUnitRegExp);
645
+ if (match && match[1]) {
646
+ value = parseFloat(match[1]);
647
+ let unitStr = match[2] ? match[2].toLowerCase() : "undefined";
648
+ let unitStrOk = UnitRegExp.test(unitStr);
649
+ unit = unitStrOk ? unitStr : void 0;
650
+ if (!unit) {
651
+ console.log("Unknown unit '" + unitStr + "' => using 'px'.");
652
+ }
653
+ } else {
654
+ value = parseFloat(input);
655
+ }
656
+ assert_exports.finite(value, "value in function toPx");
657
+ switch (unit) {
658
+ case "mm":
659
+ return mmToPx(value);
660
+ case "cm":
661
+ return mmToPx(value) * 10;
662
+ case "in":
663
+ case "inch":
664
+ return mmToPx(value) * 25.4;
665
+ case "em":
666
+ return FontSize * value;
667
+ default:
668
+ case "px":
669
+ return value;
670
+ }
671
+ }
672
+
673
+ // src/guard/index.ts
674
+ var guard_exports = {};
675
+ __export(guard_exports, {
676
+ isArray: () => isArray2,
677
+ isArrayIndex: () => isArrayIndex2,
678
+ isArrayOrUndefined: () => isArrayOrUndefined2,
679
+ isBoolean: () => isBoolean2,
680
+ isBooleanOrUndefined: () => isBooleanOrUndefined2,
681
+ isDeepEqual: () => isDeepEqual2,
682
+ isEmptyArray: () => isEmptyArray2,
683
+ isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined2,
684
+ isEmptyString: () => isEmptyString2,
685
+ isEmptyStringOrUndefined: () => isEmptyStringOrUndefined2,
686
+ isEnumValue: () => isEnumValue3,
687
+ isEnumValueOrUndefined: () => isEnumValueOrUndefined2,
688
+ isEqual: () => isEqual2,
689
+ isEvenNumber: () => isEvenNumber2,
690
+ isFalse: () => isFalse2,
691
+ isFalseOrUndefined: () => isFalseOrUndefined2,
692
+ isFinite: () => isFinite3,
693
+ isFunction: () => isFunction2,
694
+ isFunctionOrUndefined: () => isFunctionOrUndefined2,
695
+ isIncluded: () => isIncluded2,
696
+ isInfinity: () => isInfinity2,
697
+ isInteger: () => isInteger2,
698
+ isIntegerBetween: () => isIntegerBetween2,
699
+ isIntegerBetweenExclusive: () => isIntegerBetweenExclusive2,
700
+ isIntegerEq: () => isIntegerEq2,
701
+ isIntegerGt: () => isIntegerGt2,
702
+ isIntegerGte: () => isIntegerGte2,
703
+ isIntegerLt: () => isIntegerLt2,
704
+ isIntegerLte: () => isIntegerLte2,
705
+ isIntegerOrUndefined: () => isIntegerOrUndefined2,
706
+ isNaNValue: () => isNaNValue2,
707
+ isNegInfinity: () => isNegInfinity2,
708
+ isNonEmptyArray: () => isNonEmptyArray2,
709
+ isNonEmptyArrayOrUndefined: () => isNonEmptyArrayOrUndefined2,
710
+ isNonEmptyString: () => isNonEmptyString2,
711
+ isNonEmptyStringOrUndefined: () => isNonEmptyStringOrUndefined2,
712
+ isNull: () => isNull2,
713
+ isNullish: () => isNullish2,
714
+ isNumber: () => isNumber2,
715
+ isNumberBetween: () => isNumberBetween2,
716
+ isNumberBetweenExclusive: () => isNumberBetweenExclusive2,
717
+ isNumberOrUndefined: () => isNumberOrUndefined2,
718
+ isObject: () => isObject2,
719
+ isObjectOrUndefined: () => isObjectOrUndefined2,
720
+ isOddNumber: () => isOddNumber2,
721
+ isPosInfinity: () => isPosInfinity2,
722
+ isString: () => isString2,
723
+ isStringOrUndefined: () => isStringOrUndefined2,
724
+ isThrowing: () => isThrowing2,
725
+ isTrue: () => isTrue2,
726
+ isTrueOrUndefined: () => isTrueOrUndefined2,
727
+ isTypedObject: () => isTypedObject2,
728
+ isUndefined: () => isUndefined2,
729
+ tryOr: () => tryOr
730
+ });
731
+
732
+ // src/utils/obj/index.ts
733
+ var obj_exports = {};
734
+ __export(obj_exports, {
735
+ deepEqual: () => deepEqual,
736
+ hasProperties: () => hasProperties,
737
+ isObject: () => isObject2
738
+ });
739
+ function hasProperties(obj, props) {
740
+ return isObject2(obj) && props.every((p) => p in obj);
741
+ }
742
+ function deepEqual(a, b) {
743
+ if (a === b) return true;
744
+ if (a === null || b === null) return false;
745
+ if (typeof a !== "object" || typeof b !== "object") return false;
746
+ if (Array.isArray(a) && Array.isArray(b)) {
747
+ if (a.length !== b.length) return false;
748
+ return a.every((val, i) => deepEqual(val, b[i]));
749
+ }
750
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
751
+ const keysA = Object.keys(a);
752
+ const keysB = Object.keys(b);
753
+ if (keysA.length !== keysB.length) return false;
754
+ for (const key of keysA) {
755
+ if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
756
+ if (!deepEqual(a[key], b[key])) return false;
757
+ }
758
+ return true;
759
+ }
82
760
 
83
761
  // src/utils/enum/index.ts
84
762
  var enum_exports = {};
85
763
  __export(enum_exports, {
86
- getEnumValues: () => getEnumValues
764
+ assertEnumValue: () => assertEnumValue,
765
+ forEachEnum: () => forEachEnum,
766
+ getEnumEntries: () => getEnumEntries,
767
+ getEnumKey: () => getEnumKey,
768
+ getEnumKeys: () => getEnumKeys,
769
+ getEnumValues: () => getEnumValues,
770
+ isEnumValue: () => isEnumValue2
87
771
  });
772
+ function getEnumKeys(e) {
773
+ return Object.keys(e).filter((k) => isNaN(Number(k)));
774
+ }
88
775
  function getEnumValues(e) {
89
- return Object.keys(e).filter((key) => Number.isNaN(Number(key))).map((key) => e[key]);
776
+ return getEnumKeys(e).map((k) => e[k]);
777
+ }
778
+ function getEnumEntries(e) {
779
+ return getEnumKeys(e).map((k) => [k, e[k]]);
780
+ }
781
+ function getEnumKey(e, value) {
782
+ return getEnumKeys(e).find((k) => e[k] === value);
783
+ }
784
+ function forEachEnum(e, callback) {
785
+ for (const [k, v] of getEnumEntries(e)) callback(k, v);
786
+ }
787
+ function isEnumValue2(e, value) {
788
+ return getEnumValues(e).includes(value);
789
+ }
790
+ function assertEnumValue(e, value) {
791
+ if (!isEnumValue2(e, value)) {
792
+ throw new TypeError(`Invalid enum value: ${String(value)}`);
793
+ }
90
794
  }
91
795
 
92
- // src/utils/is/index.ts
93
- function isUndefined(value) {
796
+ // src/guard/index.ts
797
+ function isEqual2(value1, value2) {
798
+ return value1 === value2;
799
+ }
800
+ function isDeepEqual2(value1, value2) {
801
+ return deepEqual(value1, value2);
802
+ }
803
+ function isUndefined2(value) {
94
804
  return value === void 0;
95
805
  }
96
- function isNull(value) {
806
+ function isNull2(value) {
97
807
  return value === null;
98
808
  }
99
- function isNullish(value) {
809
+ function isNullish2(value) {
100
810
  return value === void 0 || value === null;
101
811
  }
102
- function isObject(value) {
103
- return typeof value === "object" && value !== null && !isArray(value);
812
+ function isObject2(value) {
813
+ return typeof value === "object" && value !== null && !isArray2(value);
104
814
  }
105
- function isObjectOrUndefined(value) {
106
- return value === void 0 || isObject(value);
815
+ function isObjectOrUndefined2(value) {
816
+ return value === void 0 || isObject2(value);
107
817
  }
108
- function isArray(a) {
818
+ function isTypedObject2(obj, keys) {
819
+ return isObject2(obj) && keys.every((k) => k in obj);
820
+ }
821
+ function isArray2(a) {
109
822
  return !!a && Object.prototype.toString.call(a) === "[object Array]";
110
823
  }
111
- function isArrayOrUndefined(value) {
112
- return value === void 0 || isArray(value);
824
+ function isArrayOrUndefined2(value) {
825
+ return value === void 0 || isArray2(value);
113
826
  }
114
- function isEmptyArray(a) {
115
- return isArray(a) && a.length === 0;
827
+ function isEmptyArray2(a) {
828
+ return isArray2(a) && a.length === 0;
116
829
  }
117
- function isNonEmptyArray(a) {
118
- return isArray(a) && a.length > 0;
830
+ function isNonEmptyArray2(a) {
831
+ return isArray2(a) && a.length > 0;
119
832
  }
120
- function isEmptyArrayOrUndefined(a) {
121
- return isArray(a) && a.length === 0 || a === void 0;
833
+ function isEmptyArrayOrUndefined2(a) {
834
+ return isArray2(a) && a.length === 0 || a === void 0;
122
835
  }
123
- function isNonEmptyArrayOrUndefined(a) {
124
- return isArray(a) && a.length > 0 || a === void 0;
836
+ function isNonEmptyArrayOrUndefined2(a) {
837
+ return isArray2(a) && a.length > 0 || a === void 0;
125
838
  }
126
- function isString(value) {
839
+ function isString2(value) {
127
840
  return typeof value === "string";
128
841
  }
129
- function isEmptyString(value) {
842
+ function isEmptyString2(value) {
130
843
  return typeof value === "string" && value.length === 0;
131
844
  }
132
- function isNonEmptyString(value) {
845
+ function isNonEmptyString2(value) {
133
846
  return typeof value === "string" && value.length > 0;
134
847
  }
135
- function isStringOrUndefined(value) {
848
+ function isStringOrUndefined2(value) {
136
849
  return value === void 0 || typeof value === "string";
137
850
  }
138
- function isEmptyStringOrUndefined(value) {
851
+ function isEmptyStringOrUndefined2(value) {
139
852
  return typeof value === "string" && value.length === 0 || value === void 0;
140
853
  }
141
- function isNonEmptyStringOrUndefined(value) {
854
+ function isNonEmptyStringOrUndefined2(value) {
142
855
  return typeof value === "string" && value.length > 0 || value === void 0;
143
856
  }
144
- function isBoolean(value) {
857
+ function isBoolean2(value) {
145
858
  return typeof value === "boolean";
146
859
  }
147
- function isBooleanOrUndefined(value) {
860
+ function isBooleanOrUndefined2(value) {
148
861
  return value === void 0 || typeof value === "boolean";
149
862
  }
150
- function isFunction(value) {
863
+ function isTrue2(value) {
864
+ return value === true;
865
+ }
866
+ function isTrueOrUndefined2(value) {
867
+ return value === true || value === void 0;
868
+ }
869
+ function isFalse2(value) {
870
+ return value === false;
871
+ }
872
+ function isFalseOrUndefined2(value) {
873
+ return value === false || value === void 0;
874
+ }
875
+ function isFunction2(value) {
151
876
  return typeof value === "function";
152
877
  }
153
- function isFunctionOrUndefined(value) {
878
+ function isFunctionOrUndefined2(value) {
154
879
  return value === void 0 || typeof value === "function";
155
880
  }
156
- function isEnumValue(value, enumObj, name = "value") {
881
+ function isEnumValue3(value, enumObj, name = "value") {
157
882
  return getEnumValues(enumObj).some((v) => v === value);
158
883
  }
159
- function isEnumValueOrUndefined(value, enumObj, name = "value") {
884
+ function isEnumValueOrUndefined2(value, enumObj, name = "value") {
160
885
  return value === void 0 || getEnumValues(enumObj).some((v) => v === value);
161
886
  }
162
- function isNumber(value) {
887
+ function isNumber2(value) {
163
888
  return typeof value === "number";
164
889
  }
165
- function isNumberOrUndefined(value) {
890
+ function isNumberOrUndefined2(value) {
166
891
  return typeof value === "number" || value === void 0;
167
892
  }
168
- function isFinite2(value) {
893
+ function isFinite3(value) {
169
894
  return typeof value === "number" && Number.isFinite(value);
170
895
  }
171
- function isInteger(n) {
172
- return typeof n === "number" && isFinite2(n) && n === Math.trunc(n);
896
+ function isInteger2(n) {
897
+ return typeof n === "number" && isFinite3(n) && n === Math.trunc(n);
898
+ }
899
+ function isIntegerOrUndefined2(n) {
900
+ return typeof n === "number" && isFinite3(n) && n === Math.trunc(n) || n === void 0;
901
+ }
902
+ function isIntegerEq2(value, compareTo) {
903
+ return isInteger2(value) && value === compareTo;
904
+ }
905
+ function isIntegerGt2(value, compareTo) {
906
+ return isInteger2(value) && isNumber2(compareTo) && value > compareTo;
173
907
  }
174
- function isIntegerOrUndefined(n) {
175
- return typeof n === "number" && isFinite2(n) && n === Math.trunc(n) || n === void 0;
908
+ function isIntegerGte2(value, compareTo) {
909
+ return isInteger2(value) && isNumber2(compareTo) && value >= compareTo;
176
910
  }
177
- function isIntegerEq(value, compareTo) {
178
- return isInteger(value) && value === compareTo;
911
+ function isIntegerLt2(value, compareTo) {
912
+ return isInteger2(value) && isNumber2(compareTo) && value < compareTo;
179
913
  }
180
- function isIntegerGt(value, compareTo) {
181
- return isInteger(value) && value > compareTo;
914
+ function isIntegerLte2(value, compareTo) {
915
+ return isInteger2(value) && isNumber2(compareTo) && value <= compareTo;
182
916
  }
183
- function isIntegerGte(value, compareTo) {
184
- return isInteger(value) && value >= compareTo;
917
+ function isIntegerBetween2(value, min, max) {
918
+ return isInteger2(value) && isNumber2(min) && isNumber2(max) && value >= min && value <= max;
185
919
  }
186
- function isIntegerLt(value, compareTo) {
187
- return isInteger(value) && value < compareTo;
920
+ function isIntegerBetweenExclusive2(value, min, max) {
921
+ return isInteger2(value) && isNumber2(min) && isNumber2(max) && value > min && value < max;
188
922
  }
189
- function isIntegerLte(value, compareTo) {
190
- return isInteger(value) && value <= compareTo;
923
+ function isNumberBetween2(value, min, max) {
924
+ return isNumber2(value) && isNumber2(min) && isNumber2(max) && value >= min && value <= max;
191
925
  }
192
- function isIntegerBetween(value, min, max) {
193
- return isInteger(value) && value >= min && value <= max;
926
+ function isNumberBetweenExclusive2(value, min, max) {
927
+ return isNumber2(value) && isNumber2(min) && isNumber2(max) && value > min && value < max;
194
928
  }
195
- function isNaNValue(value) {
929
+ function isNaNValue2(value) {
196
930
  return typeof value === "number" && Number.isNaN(value);
197
931
  }
198
- function isInfinity(value) {
932
+ function isInfinity2(value) {
199
933
  return typeof value === "number" && Math.abs(value) === Infinity;
200
934
  }
201
- function isPosInfinity(value) {
935
+ function isPosInfinity2(value) {
202
936
  return typeof value === "number" && value === Infinity;
203
937
  }
204
- function isNegInfinity(value) {
938
+ function isNegInfinity2(value) {
205
939
  return typeof value === "number" && value === -Infinity;
206
940
  }
941
+ function isOddNumber2(value) {
942
+ return isInteger2(value) && value % 2 === 1;
943
+ }
944
+ function isEvenNumber2(value) {
945
+ return isInteger2(value) && value % 2 === 0;
946
+ }
947
+ function isIncluded2(value, array) {
948
+ return array.includes(value);
949
+ }
950
+ function isArrayIndex2(index, array) {
951
+ return isInteger2(index) && isArray2(array) && index >= 0 && index < array.length;
952
+ }
953
+ function isThrowing2(throwTestFn) {
954
+ try {
955
+ throwTestFn();
956
+ return false;
957
+ } catch (err) {
958
+ return true;
959
+ }
960
+ }
961
+ function tryOr(tryFn, orVal) {
962
+ try {
963
+ return tryFn();
964
+ } catch (err) {
965
+ return isFunction2(orVal) ? orVal() : orVal;
966
+ }
967
+ }
968
+
969
+ // src/utils/index.ts
970
+ var utils_exports = {};
971
+ __export(utils_exports, {
972
+ Arr: () => arr_exports,
973
+ Dom: () => dom_exports,
974
+ Enum: () => enum_exports,
975
+ Is: () => Is,
976
+ Map: () => map_exports,
977
+ Math: () => math_exports,
978
+ Obj: () => obj_exports,
979
+ Str: () => str_exports
980
+ });
207
981
 
208
982
  // src/utils/arr/index.ts
983
+ var arr_exports = {};
984
+ __export(arr_exports, {
985
+ arrayContains: () => arrayContains,
986
+ chunckArray: () => chunckArray,
987
+ duplicate: () => duplicate,
988
+ fillArray: () => fillArray,
989
+ getRangeArray: () => getRangeArray,
990
+ getSequenceArray: () => getSequenceArray,
991
+ isArray: () => isArray2,
992
+ mapRangeArray: () => mapRangeArray,
993
+ mapSequenceArray: () => mapSequenceArray,
994
+ removeDuplicates: () => removeDuplicates,
995
+ removeDuplicatesCmp: () => removeDuplicatesCmp,
996
+ toArray: () => toArray
997
+ });
209
998
  function toArray(a) {
210
- return isArray(a) ? a : [a];
999
+ return isArray2(a) ? a : [a];
211
1000
  }
212
1001
  function duplicate(a) {
213
1002
  return a === void 0 ? a : a.slice();
@@ -219,13 +1008,13 @@ function removeDuplicatesCmp(arr, cmp2) {
219
1008
  return arr.filter((t1, index, self) => index === self.findIndex((t2) => cmp2(t1, t2)));
220
1009
  }
221
1010
  function fillArray(fillValue, fillCount) {
222
- if (!isInteger(fillCount) || fillCount < 0) {
1011
+ if (!isInteger2(fillCount) || fillCount < 0) {
223
1012
  throw new Error("fillArray: Invalid fillCount = " + fillCount);
224
1013
  }
225
1014
  return new Array(fillCount).fill(fillValue);
226
1015
  }
227
1016
  function mapSequenceArray(len, fn) {
228
- if (!isInteger(len) || len < 0) {
1017
+ if (!isInteger2(len) || len < 0) {
229
1018
  throw new Error("mapSequenceArray: Invalid len = " + len);
230
1019
  }
231
1020
  let arr = new Array(len);
@@ -238,10 +1027,10 @@ function getSequenceArray(len) {
238
1027
  return mapSequenceArray(len, (i) => i);
239
1028
  }
240
1029
  function mapRangeArray(start, end, fn) {
241
- if (!isInteger(start)) {
1030
+ if (!isInteger2(start)) {
242
1031
  throw new Error("mapRangeArray: Invalid start = " + end);
243
1032
  }
244
- if (!isInteger(end)) {
1033
+ if (!isInteger2(end)) {
245
1034
  throw new Error("mapRangeArray: Invalid end = " + end);
246
1035
  }
247
1036
  let len = Math.abs(end - start) + 1;
@@ -258,7 +1047,7 @@ function arrayContains(arg, item) {
258
1047
  return arg.indexOf(item) >= 0;
259
1048
  }
260
1049
  function chunckArray(arr, chunckSize) {
261
- if (!isInteger(chunckSize) || chunckSize < 1) {
1050
+ if (!isInteger2(chunckSize) || chunckSize < 1) {
262
1051
  throw new Error("chunckArray: Invalid chunckSize = " + chunckSize);
263
1052
  }
264
1053
  let result = [];
@@ -291,261 +1080,8 @@ __export(dom_exports, {
291
1080
  setWidth: () => setWidth,
292
1081
  styleLayoutChanged: () => styleLayoutChanged
293
1082
  });
294
-
295
- // src/modules/assert.ts
296
- var Assert;
297
- ((Assert2) => {
298
- let errorConstructor = Error;
299
- function setErrorClass(ec) {
300
- errorConstructor = ec ?? Error;
301
- }
302
- Assert2.setErrorClass = setErrorClass;
303
- function throwError(errorMsg, userMsg) {
304
- throw new errorConstructor("Assertion Error: " + errorMsg + (userMsg ? " " + userMsg : ""));
305
- }
306
- function is_int(a) {
307
- return typeof a === "number" && isFinite(a) && a === Math.trunc(a);
308
- }
309
- function is_number(a) {
310
- return typeof a === "number";
311
- }
312
- function assert(a, userMsg) {
313
- if (!a) {
314
- throwError(userMsg ?? "Assertion failed!");
315
- }
316
- }
317
- Assert2.assert = assert;
318
- function assertEnum(value, enumObj, name = "value") {
319
- if (!getEnumValues(enumObj).some((v) => v === value)) {
320
- throw new TypeError(`Invalid ${name} enum value: ${value}`);
321
- }
322
- }
323
- Assert2.assertEnum = assertEnum;
324
- function interrupt(userMsg) {
325
- throwError(userMsg ?? "Interrupted!");
326
- }
327
- Assert2.interrupt = interrupt;
328
- function int(a, userMsg) {
329
- if (!is_int(a)) {
330
- throwError(`Expected ${a} to be integer.`, userMsg);
331
- }
332
- return a;
333
- }
334
- Assert2.int = int;
335
- function eq(a, b, userMsg) {
336
- if (a !== b) {
337
- throwError(`Expected ${a} to equal ${b}.`, userMsg);
338
- }
339
- return a;
340
- }
341
- Assert2.eq = eq;
342
- function int_eq(a, b, userMsg) {
343
- if (!(is_int(a) && is_number(b) && a === b)) {
344
- throwError(`Expected ${a} to be integer equal to ${b}.`, userMsg);
345
- }
346
- return a;
347
- }
348
- Assert2.int_eq = int_eq;
349
- function int_lt(a, b, userMsg) {
350
- if (!(is_int(a) && is_number(b) && a < b)) {
351
- throwError(`Expected ${a} to be integer less than ${b}.`, userMsg);
352
- }
353
- return a;
354
- }
355
- Assert2.int_lt = int_lt;
356
- function int_lte(a, b, userMsg) {
357
- if (!(is_int(a) && is_number(b) && a <= b)) {
358
- throwError(`Expected ${a} to be integer less than or equal to ${b}.`, userMsg);
359
- }
360
- return a;
361
- }
362
- Assert2.int_lte = int_lte;
363
- function int_gt(a, b, userMsg) {
364
- if (!(is_int(a) && is_number(b) && a > b)) {
365
- throwError(`Expected ${a} to be integer greater than ${b}.`, userMsg);
366
- }
367
- return a;
368
- }
369
- Assert2.int_gt = int_gt;
370
- function int_gte(a, b, userMsg) {
371
- if (!(is_int(a) && is_number(b) && a >= b)) {
372
- throwError(`Expected ${a} to be integer greater than or equal to ${b}.`, userMsg);
373
- }
374
- return a;
375
- }
376
- Assert2.int_gte = int_gte;
377
- function int_between(a, min, max, userMsg) {
378
- if (!(is_int(a) && is_number(min) && is_number(max) && a >= min && a <= max)) {
379
- throwError(`Expected ${a} to be integer between ${min} and ${max}.`, userMsg);
380
- }
381
- return a;
382
- }
383
- Assert2.int_between = int_between;
384
- function odd(a, userMsg) {
385
- if (!(is_int(a) && a % 2 === 1)) {
386
- throwError(`Expected ${a} to be odd number.`, userMsg);
387
- }
388
- return a;
389
- }
390
- Assert2.odd = odd;
391
- function even(a, userMsg) {
392
- if (!(is_int(a) && a % 2 === 0)) {
393
- throwError(`Expected ${a} to be even number.`, userMsg);
394
- }
395
- return a;
396
- }
397
- Assert2.even = even;
398
- function in_group(a, group, userMsg) {
399
- if (!group.some((e) => e === a)) {
400
- let strGroup = group.map((v) => String(v)).join(", ");
401
- throwError(`Expected ${a} to be in group [${strGroup}].`, userMsg);
402
- }
403
- return a;
404
- }
405
- Assert2.in_group = in_group;
406
- function finite(a, userMsg) {
407
- if (!(is_number(a) && isFinite(a))) {
408
- throwError(`Expected ${a} to be finite number.`, userMsg);
409
- }
410
- return a;
411
- }
412
- Assert2.finite = finite;
413
- function array_id(arr, id, userMsg) {
414
- if (!(is_int(id) && id >= 0 && id < arr.length)) {
415
- throwError(`Expected ${id} to be array index in bounds [0..${arr.length - 1}].`, userMsg);
416
- }
417
- return id;
418
- }
419
- Assert2.array_id = array_id;
420
- function array_elem(arr, id, userMsg) {
421
- return arr[array_id(arr, id, userMsg)];
422
- }
423
- Assert2.array_elem = array_elem;
424
- function require2(arg, userMsg) {
425
- if (arg === void 0) {
426
- throwError("Required value is undefined.", userMsg);
427
- } else {
428
- return arg;
429
- }
430
- }
431
- Assert2.require = require2;
432
- })(Assert || (Assert = {}));
433
-
434
- // src/modules/device.ts
435
- var Device;
436
- ((Device2) => {
437
- function getDPI() {
438
- let el = document.createElement("div");
439
- el.style.width = "1in";
440
- document.body.appendChild(el);
441
- let dpi = el.offsetWidth;
442
- el.remove();
443
- return dpi || 96;
444
- }
445
- function getScrollBarWidth() {
446
- try {
447
- let outer = document.createElement("div");
448
- outer.style.visibility = "hidden";
449
- outer.style.width = "100px";
450
- document.body.appendChild(outer);
451
- let widthNoScroll = outer.offsetWidth;
452
- outer.style.overflow = "scroll";
453
- let inner = document.createElement("div");
454
- inner.style.width = "100%";
455
- outer.appendChild(inner);
456
- let widthWithScroll = inner.offsetWidth;
457
- if (outer.parentNode) {
458
- outer.parentNode.removeChild(outer);
459
- }
460
- return widthNoScroll - widthWithScroll;
461
- } catch (e) {
462
- return 0;
463
- }
464
- }
465
- function getSystemFontSize() {
466
- let tmpDiv = document.createElement("div");
467
- tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
468
- tmpDiv.appendChild(document.createTextNode("M"));
469
- document.body.appendChild(tmpDiv);
470
- let fontsize = tmpDiv.offsetHeight;
471
- document.body.removeChild(tmpDiv);
472
- return fontsize;
473
- }
474
- function getIsTouchDevice() {
475
- if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document) {
476
- return true;
477
- }
478
- var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
479
- var mq = function(query2) {
480
- return window.matchMedia(query2).matches;
481
- };
482
- var query = ["(", prefixes.join("touch-enabled),("), "heartz", ")"].join("");
483
- return mq(query);
484
- }
485
- function getIsMobileDevice() {
486
- let a = navigator.userAgent || navigator.vendor || window.opera;
487
- 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(a) || /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(a.substr(0, 4));
488
- }
489
- function getHostAddress() {
490
- return location.protocol + "//" + location.host;
491
- }
492
- const UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
493
- const ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
494
- Device2.DPI = getDPI();
495
- Device2.PxPerMm = Device2.DPI / 25.4;
496
- Device2.ScrollbarWidth = getScrollBarWidth();
497
- Device2.FontSize = getSystemFontSize();
498
- Device2.IsTouchDevice = getIsTouchDevice();
499
- Device2.IsMobileDevice = getIsMobileDevice();
500
- Device2.HostAddress = getHostAddress();
501
- function pxToMm(px) {
502
- return px / Device2.PxPerMm;
503
- }
504
- Device2.pxToMm = pxToMm;
505
- function mmToPx(mm) {
506
- return mm * Device2.PxPerMm;
507
- }
508
- Device2.mmToPx = mmToPx;
509
- function toPx2(input) {
510
- if (typeof input === "number") {
511
- return input;
512
- }
513
- let value = NaN;
514
- let unit = void 0;
515
- let match = input.toString().match(ValueUnitRegExp);
516
- if (match && match[1]) {
517
- value = parseFloat(match[1]);
518
- let unitStr = match[2] ? match[2].toLowerCase() : "undefined";
519
- let unitStrOk = UnitRegExp.test(unitStr);
520
- unit = unitStrOk ? unitStr : void 0;
521
- if (!unit) {
522
- console.log("Unknown unit '" + unitStr + "' => using 'px'.");
523
- }
524
- } else {
525
- value = parseFloat(input);
526
- }
527
- Assert.finite(value, "value in function toPx");
528
- switch (unit) {
529
- case "mm":
530
- return mmToPx(value);
531
- case "cm":
532
- return mmToPx(value) * 10;
533
- case "in":
534
- case "inch":
535
- return mmToPx(value) * 25.4;
536
- case "em":
537
- return Device2.FontSize * value;
538
- default:
539
- case "px":
540
- return value;
541
- }
542
- }
543
- Device2.toPx = toPx2;
544
- })(Device || (Device = {}));
545
-
546
- // src/utils/dom/index.ts
547
- function toPx(value) {
548
- return value === void 0 ? void 0 : Device.toPx(value);
1083
+ function toPx2(value) {
1084
+ return value === void 0 ? void 0 : device_exports.toPx(value);
549
1085
  }
550
1086
  function hasClass(el, className) {
551
1087
  if (className.length === 0) {
@@ -636,38 +1172,38 @@ function getPadding(style) {
636
1172
  if (!style) {
637
1173
  return { top: 0, right: 0, bottom: 0, left: 0 };
638
1174
  }
639
- let top = toPx(style.paddingTop);
640
- let right = toPx(style.paddingRight);
641
- let bottom = toPx(style.paddingBottom);
642
- let left = toPx(style.paddingLeft);
1175
+ let top = toPx2(style.paddingTop);
1176
+ let right = toPx2(style.paddingRight);
1177
+ let bottom = toPx2(style.paddingBottom);
1178
+ let left = toPx2(style.paddingLeft);
643
1179
  let padding = (style.padding ?? "").toString().split(" ").filter((s) => s.length > 0);
644
1180
  switch (padding.length) {
645
1181
  case 0:
646
1182
  break;
647
1183
  case 1:
648
- top ?? (top = toPx(padding[0]));
649
- right ?? (right = toPx(padding[0]));
650
- bottom ?? (bottom = toPx(padding[0]));
651
- left ?? (left = toPx(padding[0]));
1184
+ top ?? (top = toPx2(padding[0]));
1185
+ right ?? (right = toPx2(padding[0]));
1186
+ bottom ?? (bottom = toPx2(padding[0]));
1187
+ left ?? (left = toPx2(padding[0]));
652
1188
  break;
653
1189
  case 2:
654
- top ?? (top = toPx(padding[0]));
655
- right ?? (right = toPx(padding[1]));
656
- bottom ?? (bottom = toPx(padding[0]));
657
- left ?? (left = toPx(padding[1]));
1190
+ top ?? (top = toPx2(padding[0]));
1191
+ right ?? (right = toPx2(padding[1]));
1192
+ bottom ?? (bottom = toPx2(padding[0]));
1193
+ left ?? (left = toPx2(padding[1]));
658
1194
  break;
659
1195
  case 3:
660
- top ?? (top = toPx(padding[0]));
661
- right ?? (right = toPx(padding[1]));
662
- bottom ?? (bottom = toPx(padding[2]));
663
- left ?? (left = toPx(padding[1]));
1196
+ top ?? (top = toPx2(padding[0]));
1197
+ right ?? (right = toPx2(padding[1]));
1198
+ bottom ?? (bottom = toPx2(padding[2]));
1199
+ left ?? (left = toPx2(padding[1]));
664
1200
  break;
665
1201
  case 4:
666
1202
  default:
667
- top ?? (top = toPx(padding[0]));
668
- right ?? (right = toPx(padding[1]));
669
- bottom ?? (bottom = toPx(padding[2]));
670
- left ?? (left = toPx(padding[3]));
1203
+ top ?? (top = toPx2(padding[0]));
1204
+ right ?? (right = toPx2(padding[1]));
1205
+ bottom ?? (bottom = toPx2(padding[2]));
1206
+ left ?? (left = toPx2(padding[3]));
671
1207
  break;
672
1208
  }
673
1209
  top ?? (top = 0);
@@ -677,12 +1213,12 @@ function getPadding(style) {
677
1213
  return { top, right, bottom, left };
678
1214
  }
679
1215
  function getDimension(style) {
680
- let left = toPx(style?.left);
681
- let right = toPx(style?.right);
682
- let top = toPx(style?.top);
683
- let bottom = toPx(style?.bottom);
684
- let width = toPx(style?.width);
685
- let height = toPx(style?.height);
1216
+ let left = toPx2(style?.left);
1217
+ let right = toPx2(style?.right);
1218
+ let top = toPx2(style?.top);
1219
+ let bottom = toPx2(style?.bottom);
1220
+ let width = toPx2(style?.width);
1221
+ let height = toPx2(style?.height);
686
1222
  if (width === void 0 && left !== void 0 && right !== void 0) {
687
1223
  width = right - left;
688
1224
  }
@@ -717,9 +1253,7 @@ __export(map_exports, {
717
1253
  getMapKeys: () => getMapKeys
718
1254
  });
719
1255
  function getMapKeys(map) {
720
- let keys = [];
721
- map.forEach((value, key) => keys.push(key));
722
- return keys;
1256
+ return [...map.keys()];
723
1257
  }
724
1258
 
725
1259
  // src/utils/math/index.ts
@@ -731,8 +1265,8 @@ __export(math_exports, {
731
1265
  cmp: () => cmp,
732
1266
  interpolateCoord: () => interpolateCoord,
733
1267
  interpolateY: () => interpolateY,
734
- isInteger: () => isInteger,
735
- isNumber: () => isNumber,
1268
+ isInteger: () => isInteger2,
1269
+ isNumber: () => isNumber2,
736
1270
  linearToDecibels: () => linearToDecibels,
737
1271
  mod: () => mod,
738
1272
  romanize: () => romanize,
@@ -752,7 +1286,7 @@ function mod(m, n) {
752
1286
  return (m % n + n) % n;
753
1287
  }
754
1288
  function romanize(n) {
755
- if (!isInteger(n) || n < 0) {
1289
+ if (!isInteger2(n) || n < 0) {
756
1290
  throw new Error("romanize: Invalid n = " + n);
757
1291
  }
758
1292
  var digits = String(+n).split("");
@@ -793,7 +1327,7 @@ function romanize(n) {
793
1327
  return Array(+digits.join("") + 1).join("M") + roman;
794
1328
  }
795
1329
  function toOrdinalNumber(n) {
796
- if (!isInteger(n)) {
1330
+ if (!isInteger2(n)) {
797
1331
  throw new Error("toOrdinalNumber: Invalid n = " + n);
798
1332
  }
799
1333
  const nStr = n.toString();
@@ -846,87 +1380,58 @@ function cmp(a, b) {
846
1380
  return a < b ? -1 : a > b ? 1 : 0;
847
1381
  }
848
1382
 
849
- // src/utils/obj/index.ts
850
- var obj_exports = {};
851
- __export(obj_exports, {
852
- deepEqual: () => deepEqual,
853
- hasProperties: () => hasProperties,
854
- isObject: () => isObject
855
- });
856
- function hasProperties(obj, props) {
857
- return isObject(obj) && props.every((p) => p in obj);
858
- }
859
- function deepEqual(a, b) {
860
- if (a === b) return true;
861
- if (a === null || b === null) return false;
862
- if (typeof a !== "object" || typeof b !== "object") return false;
863
- if (Array.isArray(a) && Array.isArray(b)) {
864
- if (a.length !== b.length) return false;
865
- return a.every((val, i) => deepEqual(val, b[i]));
866
- }
867
- if (Array.isArray(a) !== Array.isArray(b)) return false;
868
- const keysA = Object.keys(a);
869
- const keysB = Object.keys(b);
870
- if (keysA.length !== keysB.length) return false;
871
- for (const key of keysA) {
872
- if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
873
- if (!deepEqual(a[key], b[key])) return false;
874
- }
875
- return true;
876
- }
877
-
878
1383
  // src/utils/str/index.ts
879
1384
  var str_exports = {};
880
1385
  __export(str_exports, {
881
1386
  charCount: () => charCount,
882
1387
  chunkString: () => chunkString,
883
1388
  insertAt: () => insertAt,
884
- isString: () => isString,
1389
+ isString: () => isString2,
885
1390
  makeSentenceFromPascal: () => makeSentenceFromPascal,
886
1391
  removeAt: () => removeAt,
887
1392
  repeatString: () => repeatString,
888
1393
  replaceAt: () => replaceAt,
889
1394
  toCharArray: () => toCharArray
890
1395
  });
891
- function toCharArray(str) {
892
- return str.split("");
1396
+ function toCharArray(str2) {
1397
+ return str2.split("");
893
1398
  }
894
1399
  function repeatString(repeatString2, repeatCount) {
895
- if (!isInteger(repeatCount) || repeatCount < 0) {
1400
+ if (!isInteger2(repeatCount) || repeatCount < 0) {
896
1401
  throw new Error("repeatStr: Invalid repeatCount = " + repeatCount);
897
1402
  }
898
1403
  return new Array(repeatCount + 1).join(repeatString2);
899
1404
  }
900
- function chunkString(str, chunkSize) {
901
- if (!isInteger(chunkSize) || chunkSize < 1) {
1405
+ function chunkString(str2, chunkSize) {
1406
+ if (!isInteger2(chunkSize) || chunkSize < 1) {
902
1407
  throw new Error("chunckString: Invalid chuckSize = " + chunkSize);
903
1408
  }
904
1409
  let result = [];
905
- for (let i = 0; i < str.length; i += chunkSize) {
906
- result.push(str.slice(i, i + chunkSize));
1410
+ for (let i = 0; i < str2.length; i += chunkSize) {
1411
+ result.push(str2.slice(i, i + chunkSize));
907
1412
  }
908
1413
  return result;
909
1414
  }
910
- function replaceAt(str, pos, removeCount, insert) {
911
- if (!isInteger(removeCount) || removeCount < 0) {
1415
+ function replaceAt(str2, pos, removeCount, insert) {
1416
+ if (!isInteger2(removeCount) || removeCount < 0) {
912
1417
  throw new Error("replaceAt: Invalid removeCount = " + removeCount);
913
- } else if (!isInteger(pos) || pos < 0 || pos + removeCount > str.length) {
914
- throw new Error("replaceAt: Invalid pos = " + pos + ", removeCount = " + removeCount + ", str.length = " + str.length);
1418
+ } else if (!isInteger2(pos) || pos < 0 || pos + removeCount > str2.length) {
1419
+ throw new Error("replaceAt: Invalid pos = " + pos + ", removeCount = " + removeCount + ", str.length = " + str2.length);
915
1420
  } else {
916
- return str.substring(0, pos) + insert + str.substring(pos + removeCount);
1421
+ return str2.substring(0, pos) + insert + str2.substring(pos + removeCount);
917
1422
  }
918
1423
  }
919
- function insertAt(str, pos, insertStr) {
920
- return replaceAt(str, pos, 0, insertStr);
1424
+ function insertAt(str2, pos, insertStr) {
1425
+ return replaceAt(str2, pos, 0, insertStr);
921
1426
  }
922
- function removeAt(str, pos, removeCount) {
923
- return replaceAt(str, pos, removeCount, "");
1427
+ function removeAt(str2, pos, removeCount) {
1428
+ return replaceAt(str2, pos, removeCount, "");
924
1429
  }
925
- function charCount(str, ch) {
926
- if (ch.length !== 1 || str.length === 0) return 0;
1430
+ function charCount(str2, ch) {
1431
+ if (ch.length !== 1 || str2.length === 0) return 0;
927
1432
  let count = 0;
928
- for (let i = 0; i < str.length; i++) {
929
- if (str[i] === ch) count++;
1433
+ for (let i = 0; i < str2.length; i++) {
1434
+ if (str2[i] === ch) count++;
930
1435
  }
931
1436
  return count;
932
1437
  }
@@ -960,101 +1465,8 @@ function makeSentenceFromPascal(PascalString) {
960
1465
  return sentence;
961
1466
  }
962
1467
 
963
- // src/modules/cookies.ts
964
- var Cookies;
965
- ((Cookies2) => {
966
- const ConsentCookieName = "ConsentCookie";
967
- let ConsentState;
968
- ((ConsentState2) => {
969
- ConsentState2["Accept"] = "accept";
970
- ConsentState2["Decline"] = "decline";
971
- })(ConsentState || (ConsentState = {}));
972
- let _consent;
973
- let _expires;
974
- let str = _read(ConsentCookieName);
975
- _consent = str === "accept" /* Accept */ || str === "decline" /* Decline */ ? str : void 0;
976
- function setExpireDays(days) {
977
- _expires = /* @__PURE__ */ new Date();
978
- _expires.setDate(_expires.getDate() + days);
979
- }
980
- Cookies2.setExpireDays = setExpireDays;
981
- function isConsentPending() {
982
- return _consent === void 0;
983
- }
984
- Cookies2.isConsentPending = isConsentPending;
985
- function accept() {
986
- _consent = "accept" /* Accept */;
987
- _save(ConsentCookieName, _consent);
988
- }
989
- Cookies2.accept = accept;
990
- function decline() {
991
- _consent = "decline" /* Decline */;
992
- _save(ConsentCookieName, _consent);
993
- }
994
- Cookies2.decline = decline;
995
- function _getList() {
996
- let s = document.cookie;
997
- return s.split(";").map((c) => c.trim());
998
- }
999
- function _save(name, value) {
1000
- let cookie = name + "=" + value.toString() + ";sameSite=Lax;";
1001
- if (_expires) {
1002
- cookie += "expires=" + _expires.toUTCString() + ";";
1003
- }
1004
- document.cookie = cookie;
1005
- return value;
1006
- }
1007
- function _read(name, defaultValue) {
1008
- let str2 = _getList().find((c) => c.startsWith(name + "="));
1009
- return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
1010
- }
1011
- function _erase(name) {
1012
- document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
1013
- }
1014
- function save(name, value) {
1015
- if (_consent === "accept" /* Accept */) {
1016
- _save(name, value);
1017
- }
1018
- return value;
1019
- }
1020
- Cookies2.save = save;
1021
- function read(name, defaultValue) {
1022
- if (_consent === "accept" /* Accept */) {
1023
- return _read(name, defaultValue) || defaultValue;
1024
- } else {
1025
- return defaultValue;
1026
- }
1027
- }
1028
- Cookies2.read = read;
1029
- function readInt(name, defaultValue) {
1030
- if (_consent === "accept" /* Accept */) {
1031
- let str2 = _read(name);
1032
- return str2 === void 0 ? defaultValue : parseInt(str2);
1033
- } else {
1034
- return defaultValue;
1035
- }
1036
- }
1037
- Cookies2.readInt = readInt;
1038
- function readBool(name, defaultValue) {
1039
- if (_consent === "accept" /* Accept */) {
1040
- let str2 = _read(name);
1041
- return str2 === void 0 ? defaultValue : /true|1/i.test(str2);
1042
- } else {
1043
- return defaultValue;
1044
- }
1045
- }
1046
- Cookies2.readBool = readBool;
1047
- function erase(name) {
1048
- if (_consent === "accept" /* Accept */ || name === ConsentCookieName) {
1049
- _erase(name);
1050
- }
1051
- }
1052
- Cookies2.erase = erase;
1053
- function eraseAll() {
1054
- document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
1055
- }
1056
- Cookies2.eraseAll = eraseAll;
1057
- })(Cookies || (Cookies = {}));
1468
+ // src/utils/index.ts
1469
+ var Is = guard_exports;
1058
1470
 
1059
1471
  // src/core/stack.ts
1060
1472
  var Stack = class {
@@ -1066,11 +1478,11 @@ var Stack = class {
1066
1478
  return e;
1067
1479
  }
1068
1480
  pop() {
1069
- Assert.int_gt(this.list.length, 0);
1481
+ assert_exports.int_gt(this.list.length, 0);
1070
1482
  return this.list.pop();
1071
1483
  }
1072
1484
  top() {
1073
- return Assert.array_elem(this.list, this.list.length - 1, "Stack is empty!");
1485
+ return assert_exports.array_elem(this.list, this.list.length - 1, "Stack is empty!");
1074
1486
  }
1075
1487
  toArray() {
1076
1488
  return this.list;
@@ -1104,9 +1516,15 @@ var Vec = class _Vec {
1104
1516
  }
1105
1517
  return new _Vec(...Array(dim).fill(0));
1106
1518
  }
1519
+ get dim() {
1520
+ return this.coords.length;
1521
+ }
1107
1522
  get length() {
1108
1523
  return Math.hypot(...this.coords);
1109
1524
  }
1525
+ magnitude() {
1526
+ return this.length;
1527
+ }
1110
1528
  get x() {
1111
1529
  return this.coords[0];
1112
1530
  }
@@ -1158,6 +1576,38 @@ var Vec = class _Vec {
1158
1576
  }
1159
1577
  return this.div(len);
1160
1578
  }
1579
+ static lerp(a, b, t) {
1580
+ if (a.coords.length !== b.coords.length) {
1581
+ throw new TypeError("Coordinate length mismatch!");
1582
+ }
1583
+ if (!isFinite3(t)) {
1584
+ throw new TypeError("Lerp t is not finite!");
1585
+ }
1586
+ return a.add(b.sub(a).mul(t));
1587
+ }
1588
+ toLength(len) {
1589
+ const mag = this.length;
1590
+ return mag === 0 ? this : this.mul(len / mag);
1591
+ }
1592
+ clamp(minLength, maxLength, defaultDir) {
1593
+ const mag = this.length;
1594
+ if (mag === 0) {
1595
+ if (minLength !== void 0) {
1596
+ if (defaultDir && defaultDir.coords.length !== this.coords.length)
1597
+ throw new TypeError("Coordinate length mismatch!");
1598
+ const dir = defaultDir && defaultDir.length !== 0 ? defaultDir.normalize() : new _Vec(1, ...Array(this.coords.length - 1).fill(0));
1599
+ return dir.mul(minLength);
1600
+ }
1601
+ return this;
1602
+ }
1603
+ if (maxLength !== void 0 && mag > maxLength) {
1604
+ return this.normalize().mul(maxLength);
1605
+ }
1606
+ if (minLength !== void 0 && mag < minLength) {
1607
+ return this.normalize().mul(minLength);
1608
+ }
1609
+ return this;
1610
+ }
1161
1611
  equals(other) {
1162
1612
  return this.coords.length === other.coords.length && this.coords.every((v, i) => v === other.coords[i]);
1163
1613
  }
@@ -1179,28 +1629,28 @@ var Vec = class _Vec {
1179
1629
  var DivRect = class _DivRect {
1180
1630
  constructor(...args) {
1181
1631
  __publicField(this, "left");
1182
- __publicField(this, "centerX");
1632
+ __publicField(this, "anchorX");
1183
1633
  __publicField(this, "right");
1184
1634
  __publicField(this, "top");
1185
- __publicField(this, "centerY");
1635
+ __publicField(this, "anchorY");
1186
1636
  __publicField(this, "bottom");
1187
1637
  if (args.length === 6) {
1188
1638
  this.left = args[0];
1189
- this.centerX = args[1];
1639
+ this.anchorX = args[1];
1190
1640
  this.right = args[2];
1191
1641
  this.top = args[3];
1192
- this.centerY = args[4];
1642
+ this.anchorY = args[4];
1193
1643
  this.bottom = args[5];
1194
1644
  } else if (args.length === 4) {
1195
1645
  this.left = args[0];
1196
1646
  this.right = args[1];
1197
- this.centerX = (this.left + this.right) / 2;
1647
+ this.anchorX = (this.left + this.right) / 2;
1198
1648
  this.top = args[2];
1199
1649
  this.bottom = args[3];
1200
- this.centerY = (this.top + this.bottom) / 2;
1650
+ this.anchorY = (this.top + this.bottom) / 2;
1201
1651
  } else if (args.length === 0) {
1202
- this.left = this.centerX = this.right = 0;
1203
- this.top = this.centerY = this.bottom = 0;
1652
+ this.left = this.anchorX = this.right = 0;
1653
+ this.top = this.anchorY = this.bottom = 0;
1204
1654
  } else {
1205
1655
  throw new TypeError(`Invalid DivRect args: ${args}`);
1206
1656
  }
@@ -1218,7 +1668,7 @@ var DivRect = class _DivRect {
1218
1668
  return new _DivRect(left, left + width, top, top + height);
1219
1669
  }
1220
1670
  /**
1221
- * Create rect from centerX, centerY, width, height arguments.
1671
+ * Create rect from anchorX, anchorY, width, height arguments.
1222
1672
  *
1223
1673
  * @param centerX - Center x-coordinate.
1224
1674
  * @param centerY - Center y-coordinate.
@@ -1248,6 +1698,22 @@ var DivRect = class _DivRect {
1248
1698
  static createSections(leftw, rightw, toph, bottomh) {
1249
1699
  return new _DivRect(-leftw, 0, rightw, -toph, 0, bottomh);
1250
1700
  }
1701
+ /** @deprecated - Renamed to anchorX. */
1702
+ get centerX() {
1703
+ return this.anchorX;
1704
+ }
1705
+ /** @deprecated - Renamed to anchorX. */
1706
+ set centerX(x) {
1707
+ this.anchorX = x;
1708
+ }
1709
+ /** @deprecated - Renamed to anchorY. */
1710
+ get centerY() {
1711
+ return this.anchorY;
1712
+ }
1713
+ /** @deprecated - Renamed to anchorY. */
1714
+ set centerY(y) {
1715
+ this.anchorY = y;
1716
+ }
1251
1717
  /**
1252
1718
  * Width getter.
1253
1719
  */
@@ -1264,25 +1730,25 @@ var DivRect = class _DivRect {
1264
1730
  * Left section width getter.
1265
1731
  */
1266
1732
  get leftw() {
1267
- return this.centerX - this.left;
1733
+ return this.anchorX - this.left;
1268
1734
  }
1269
1735
  /**
1270
1736
  * Right section width getter.
1271
1737
  */
1272
1738
  get rightw() {
1273
- return this.right - this.centerX;
1739
+ return this.right - this.anchorX;
1274
1740
  }
1275
1741
  /**
1276
1742
  * Top section height getter.
1277
1743
  */
1278
1744
  get toph() {
1279
- return this.centerY - this.top;
1745
+ return this.anchorY - this.top;
1280
1746
  }
1281
1747
  /**
1282
1748
  * Bottom section height getter.
1283
1749
  */
1284
1750
  get bottomh() {
1285
- return this.bottom - this.centerY;
1751
+ return this.bottom - this.anchorY;
1286
1752
  }
1287
1753
  /**
1288
1754
  * Does this Rect contain given (x, y)-point?
@@ -1326,7 +1792,7 @@ var DivRect = class _DivRect {
1326
1792
  } else if (a == null || b == null) {
1327
1793
  return false;
1328
1794
  } else {
1329
- return a === b || a.left === b.left && a.centerX === b.centerX && a.right === b.right && a.top === b.top && a.centerY === b.centerY && a.bottom === b.bottom;
1795
+ return a === b || a.left === b.left && a.anchorX === b.anchorX && a.right === b.right && a.top === b.top && a.anchorY === b.anchorY && a.bottom === b.bottom;
1330
1796
  }
1331
1797
  }
1332
1798
  /**
@@ -1338,7 +1804,7 @@ var DivRect = class _DivRect {
1338
1804
  return _DivRect.equals(this, other);
1339
1805
  }
1340
1806
  /**
1341
- * Check if edges of given rects are equal, ignoring centerX and centerY.
1807
+ * Check if edges of given rects are equal, ignoring anchorX and anchorY.
1342
1808
  *
1343
1809
  * @param a - DivRect a.
1344
1810
  * @param b - DivRect b.
@@ -1354,7 +1820,7 @@ var DivRect = class _DivRect {
1354
1820
  }
1355
1821
  }
1356
1822
  /**
1357
- * Check if edges of this Rect equals with given Rect, ignoring centerX and centerY.
1823
+ * Check if edges of this Rect equals with given Rect, ignoring anchorX and anchorY.
1358
1824
  *
1359
1825
  * @param other - The other DivRect.
1360
1826
  * @returns - True/false.
@@ -1362,13 +1828,17 @@ var DivRect = class _DivRect {
1362
1828
  equalsEdges(other) {
1363
1829
  return _DivRect.equalsEdges(this, other);
1364
1830
  }
1831
+ /** @deprecated - Use `DivRect.equalsEdges()` instead. */
1832
+ static equalsFrame(a, b) {
1833
+ return _DivRect.equalsEdges(a, b);
1834
+ }
1365
1835
  /**
1366
1836
  * Created duplicate of this Rect.
1367
1837
  *
1368
1838
  * @returns - Duplicate.
1369
1839
  */
1370
1840
  copy() {
1371
- return new _DivRect(this.left, this.centerX, this.right, this.top, this.centerY, this.bottom);
1841
+ return new _DivRect(this.left, this.anchorX, this.right, this.top, this.anchorY, this.bottom);
1372
1842
  }
1373
1843
  /**
1374
1844
  * Move this rect by (dx, dy). Modifies this Rect.
@@ -1379,10 +1849,10 @@ var DivRect = class _DivRect {
1379
1849
  */
1380
1850
  offsetInPlace(dx, dy) {
1381
1851
  this.left += dx;
1382
- this.centerX += dx;
1852
+ this.anchorX += dx;
1383
1853
  this.right += dx;
1384
1854
  this.top += dy;
1385
- this.centerY += dy;
1855
+ this.anchorY += dy;
1386
1856
  this.bottom += dy;
1387
1857
  return this;
1388
1858
  }
@@ -1427,10 +1897,10 @@ var DivRect = class _DivRect {
1427
1897
  clipInPlace(clipRect) {
1428
1898
  this.left = Math.max(this.left, clipRect.left);
1429
1899
  this.right = Math.min(this.right, clipRect.right);
1430
- this.centerX = clamp(this.centerX, this.left, this.right);
1900
+ this.anchorX = clamp(this.anchorX, this.left, this.right);
1431
1901
  this.top = Math.max(this.top, clipRect.top);
1432
1902
  this.bottom = Math.min(this.bottom, clipRect.bottom);
1433
- this.centerY = clamp(this.centerY, this.top, this.bottom);
1903
+ this.anchorY = clamp(this.anchorY, this.top, this.bottom);
1434
1904
  return this;
1435
1905
  }
1436
1906
  /**
@@ -1443,7 +1913,7 @@ var DivRect = class _DivRect {
1443
1913
  return this.copy().clipInPlace(clipRect);
1444
1914
  }
1445
1915
  /**
1446
- * Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
1916
+ * Scale Rect. Anchor pos is (anchorX, anchorY). Modifies this Rect.
1447
1917
  *
1448
1918
  * @param scaleX - Scale x-amount.
1449
1919
  * @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
@@ -1451,14 +1921,14 @@ var DivRect = class _DivRect {
1451
1921
  */
1452
1922
  scaleInPlace(scaleX, scaleY) {
1453
1923
  scaleY = scaleY ?? scaleX;
1454
- this.left = this.centerX - this.leftw * scaleX;
1455
- this.right = this.centerX + this.rightw * scaleX;
1456
- this.top = this.centerY - this.toph * scaleY;
1457
- this.bottom = this.centerY + this.bottomh * scaleY;
1924
+ this.left = this.anchorX - this.leftw * scaleX;
1925
+ this.right = this.anchorX + this.rightw * scaleX;
1926
+ this.top = this.anchorY - this.toph * scaleY;
1927
+ this.bottom = this.anchorY + this.bottomh * scaleY;
1458
1928
  return this;
1459
1929
  }
1460
1930
  /**
1461
- * Scale Rect. Anchor pos is (centerX, centerY). Immutable, returns modified copy.
1931
+ * Scale Rect. Anchor pos is (anchorX, anchorY). Immutable, returns modified copy.
1462
1932
  *
1463
1933
  * @param scaleX - Scale x-amount.
1464
1934
  * @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
@@ -1596,7 +2066,7 @@ var IndexArray = class _IndexArray {
1596
2066
  }
1597
2067
  }
1598
2068
  static validateIndex(id) {
1599
- if (!isIntegerGte(id, 0)) throw new Error(`Invalid index ${id} - must be an integer >= 0!`);
2069
+ if (!isIntegerGte2(id, 0)) throw new Error(`Invalid index ${id} - must be an integer >= 0!`);
1600
2070
  return id;
1601
2071
  }
1602
2072
  get posLen() {
@@ -1627,7 +2097,7 @@ var IndexArray = class _IndexArray {
1627
2097
  }
1628
2098
  getOrCreate(id, creatorOrValue) {
1629
2099
  if (!this.has(id)) {
1630
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2100
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
1631
2101
  this.set(id, value);
1632
2102
  return value;
1633
2103
  }
@@ -1763,15 +2233,15 @@ var IndexArray = class _IndexArray {
1763
2233
  }
1764
2234
  return result;
1765
2235
  }
1766
- equals(other, eq) {
2236
+ equals(other, eq2) {
1767
2237
  if (this.size !== other.size) return false;
1768
- eq ?? (eq = (a, b) => a === b);
2238
+ eq2 ?? (eq2 = (a, b) => a === b);
1769
2239
  const posLen = Math.max(this.posLen, other.posLen);
1770
2240
  for (let i = 0; i < posLen; ++i) {
1771
2241
  const hasA = this.hasPos[i];
1772
2242
  const hasB = other.hasPos[i];
1773
2243
  if (hasA !== hasB) return false;
1774
- if (hasA && !eq(this.posVal[i], other.posVal[i])) return false;
2244
+ if (hasA && !eq2(this.posVal[i], other.posVal[i])) return false;
1775
2245
  }
1776
2246
  return true;
1777
2247
  }
@@ -1816,7 +2286,7 @@ var SignedIndexArray = class _SignedIndexArray {
1816
2286
  return -id - 1;
1817
2287
  }
1818
2288
  static validateIndex(id) {
1819
- if (!isInteger(id)) throw new Error(`Invalid index ${id} - must be an integer!`);
2289
+ if (!isInteger2(id)) throw new Error(`Invalid index ${id} - must be an integer!`);
1820
2290
  return id;
1821
2291
  }
1822
2292
  get size() {
@@ -1866,7 +2336,7 @@ var SignedIndexArray = class _SignedIndexArray {
1866
2336
  }
1867
2337
  getOrCreate(id, creatorOrValue) {
1868
2338
  if (!this.has(id)) {
1869
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2339
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
1870
2340
  this.set(id, value);
1871
2341
  return value;
1872
2342
  }
@@ -2017,22 +2487,22 @@ var SignedIndexArray = class _SignedIndexArray {
2017
2487
  }
2018
2488
  return result;
2019
2489
  }
2020
- equals(other, eq) {
2490
+ equals(other, eq2) {
2021
2491
  if (this.size !== other.size) return false;
2022
- eq ?? (eq = (a, b) => a === b);
2492
+ eq2 ?? (eq2 = (a, b) => a === b);
2023
2493
  const posLen = Math.max(this.posLen, other.posLen);
2024
2494
  for (let i = 0; i < posLen; ++i) {
2025
2495
  const hasA = this.hasPos[i];
2026
2496
  const hasB = other.hasPos[i];
2027
2497
  if (hasA !== hasB) return false;
2028
- if (hasA && !eq(this.posVal[i], other.posVal[i])) return false;
2498
+ if (hasA && !eq2(this.posVal[i], other.posVal[i])) return false;
2029
2499
  }
2030
2500
  const negLen = Math.max(this.negLen, other.negLen);
2031
2501
  for (let i = 0; i < negLen; ++i) {
2032
2502
  const hasA = this.hasNeg[i];
2033
2503
  const hasB = other.hasNeg[i];
2034
2504
  if (hasA !== hasB) return false;
2035
- if (hasA && !eq(this.negVal[i], other.negVal[i])) return false;
2505
+ if (hasA && !eq2(this.negVal[i], other.negVal[i])) return false;
2036
2506
  }
2037
2507
  return true;
2038
2508
  }
@@ -2064,7 +2534,7 @@ var Map1 = class _Map1 {
2064
2534
  }
2065
2535
  getOrCreate(key1, creatorOrValue) {
2066
2536
  if (!this.has(key1)) {
2067
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2537
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2068
2538
  this.set(key1, value);
2069
2539
  return value;
2070
2540
  }
@@ -2231,7 +2701,7 @@ var Map2 = class _Map2 {
2231
2701
  }
2232
2702
  getOrCreate(key1, key2, creatorOrValue) {
2233
2703
  if (!this.has(key1, key2)) {
2234
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2704
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2235
2705
  this.set(key1, key2, value);
2236
2706
  return value;
2237
2707
  }
@@ -2434,7 +2904,7 @@ var Map3 = class _Map3 {
2434
2904
  }
2435
2905
  getOrCreate(key1, key2, key3, creatorOrValue) {
2436
2906
  if (!this.has(key1, key2, key3)) {
2437
- const value = isFunction(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2907
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2438
2908
  this.set(key1, key2, key3, value);
2439
2909
  return value;
2440
2910
  }
@@ -2695,7 +3165,7 @@ function asMulti(base) {
2695
3165
  return new MultiContainer(base);
2696
3166
  }
2697
3167
 
2698
- // src/core/deprecated/vec2.ts
3168
+ // src/deprecated/vec2.ts
2699
3169
  var Vec2 = class _Vec2 {
2700
3170
  constructor(x, y) {
2701
3171
  __publicField(this, "x");
@@ -2720,7 +3190,7 @@ var Vec2 = class _Vec2 {
2720
3190
  }
2721
3191
  };
2722
3192
 
2723
- // src/core/deprecated/small-int-cache.ts
3193
+ // src/deprecated/small-int-cache.ts
2724
3194
  var SmallIntCache = class {
2725
3195
  // for keys < 0
2726
3196
  constructor() {
@@ -2731,7 +3201,7 @@ var SmallIntCache = class {
2731
3201
  this.neg = [];
2732
3202
  }
2733
3203
  set(key, value) {
2734
- if (!isInteger(key)) {
3204
+ if (!guard_exports.isInteger(key)) {
2735
3205
  throw new Error("Key must be an integer");
2736
3206
  } else if (key >= 0) {
2737
3207
  this.pos[key] = value;
@@ -2740,7 +3210,7 @@ var SmallIntCache = class {
2740
3210
  }
2741
3211
  }
2742
3212
  get(key) {
2743
- if (!isInteger(key)) {
3213
+ if (!guard_exports.isInteger(key)) {
2744
3214
  throw new Error("Key must be an integer");
2745
3215
  } else if (key >= 0) {
2746
3216
  return this.pos[key];
@@ -2749,7 +3219,7 @@ var SmallIntCache = class {
2749
3219
  }
2750
3220
  }
2751
3221
  has(key) {
2752
- if (!isInteger(key)) {
3222
+ if (!guard_exports.isInteger(key)) {
2753
3223
  return false;
2754
3224
  } else if (key >= 0) {
2755
3225
  return key in this.pos;
@@ -2758,7 +3228,7 @@ var SmallIntCache = class {
2758
3228
  }
2759
3229
  }
2760
3230
  delete(key) {
2761
- if (!isInteger(key)) {
3231
+ if (!guard_exports.isInteger(key)) {
2762
3232
  return;
2763
3233
  } else if (key >= 0) {
2764
3234
  delete this.pos[key];
@@ -2772,10 +3242,11 @@ var SmallIntCache = class {
2772
3242
  }
2773
3243
  };
2774
3244
  export {
2775
- Assert,
2776
- Cookies,
2777
- Device,
3245
+ assert_exports as Assert,
3246
+ cookies_exports as Cookies,
3247
+ device_exports as Device,
2778
3248
  DivRect,
3249
+ guard_exports as Guard,
2779
3250
  IndexArray,
2780
3251
  LRUCache,
2781
3252
  Map1,