@endge/utils 0.24.10 → 0.24.11
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.d.ts +24 -0
- package/dist/utils.js +393 -288
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -360,6 +360,9 @@ export declare function getDateOnlyDiffFactor(d1: Date, d2: Date): {
|
|
|
360
360
|
|
|
361
361
|
export declare function getDayOfWeek(date: any): string;
|
|
362
362
|
|
|
363
|
+
/** Returns the shared document-scoped keyboard snapshot, installing one tracker lazily. */
|
|
364
|
+
export declare function getKeyboardStateSnapshot(target: Document): KeyboardStateSnapshot;
|
|
365
|
+
|
|
363
366
|
export declare function getOnDeserializedMethod<T>(instance: T): (() => void) | null;
|
|
364
367
|
|
|
365
368
|
export declare function getTimezoneOffsetMs(timezone: string): number;
|
|
@@ -626,6 +629,24 @@ export declare function Json(): PropertyDecorator;
|
|
|
626
629
|
|
|
627
630
|
export declare function JsonString(): PropertyDecorator;
|
|
628
631
|
|
|
632
|
+
export declare type KeyboardStatePlatform = 'macos' | 'windows' | 'linux' | 'unknown';
|
|
633
|
+
|
|
634
|
+
export declare interface KeyboardStateSnapshot {
|
|
635
|
+
platform: KeyboardStatePlatform;
|
|
636
|
+
modifiers: {
|
|
637
|
+
ctrl: boolean;
|
|
638
|
+
shift: boolean;
|
|
639
|
+
alt: boolean;
|
|
640
|
+
meta: boolean;
|
|
641
|
+
mod: boolean;
|
|
642
|
+
altGraph: boolean;
|
|
643
|
+
};
|
|
644
|
+
held: {
|
|
645
|
+
key: string[];
|
|
646
|
+
code: string[];
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
|
|
629
650
|
export declare interface KeyCombo {
|
|
630
651
|
ctrl?: boolean;
|
|
631
652
|
alt?: boolean;
|
|
@@ -1037,6 +1058,9 @@ export declare class Subscribable {
|
|
|
1037
1058
|
notify(): void;
|
|
1038
1059
|
}
|
|
1039
1060
|
|
|
1061
|
+
/** Subscribes to the shared document-scoped keyboard state and immediately emits its snapshot. */
|
|
1062
|
+
export declare function subscribeKeyboardState(target: Document, listener: (snapshot: KeyboardStateSnapshot) => void): () => void;
|
|
1063
|
+
|
|
1040
1064
|
export declare const SystemClock: {
|
|
1041
1065
|
DateTime: typeof DateTime;
|
|
1042
1066
|
toDateTime(jsDate: Date): DateTime;
|
package/dist/utils.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (r, t, e) =>
|
|
4
|
-
import { ref as
|
|
5
|
-
import { parse as
|
|
6
|
-
import { destr as
|
|
7
|
-
import { plainToInstance as
|
|
8
|
-
import { IsOptional as
|
|
1
|
+
var V = Object.defineProperty;
|
|
2
|
+
var G = (r, t, e) => t in r ? V(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var o = (r, t, e) => G(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { ref as b, watch as z, triggerRef as R, onScopeDispose as Z, reactive as W } from "vue";
|
|
5
|
+
import { parse as Y, serialize as M } from "cookie-es";
|
|
6
|
+
import { destr as q } from "destr";
|
|
7
|
+
import { plainToInstance as w, instanceToPlain as x, Transform as f, TransformationType as m, Expose as Q } from "class-transformer";
|
|
8
|
+
import { IsOptional as X } from "class-validator";
|
|
9
9
|
import "reflect-metadata";
|
|
10
|
-
import
|
|
11
|
-
import { v4 as
|
|
12
|
-
import { DateTime as
|
|
13
|
-
import { differenceInSeconds as
|
|
14
|
-
import { utcToZonedTime as
|
|
15
|
-
import { fetchEventSource as
|
|
16
|
-
import { defineStore as
|
|
17
|
-
const
|
|
10
|
+
import v from "lodash/debounce.js";
|
|
11
|
+
import { v4 as tt } from "uuid";
|
|
12
|
+
import { DateTime as et } from "ts-luxon";
|
|
13
|
+
import { differenceInSeconds as H, format as S, differenceInCalendarDays as rt, isAfter as I, isEqual as nt, isBefore as U, startOfDay as g, endOfDay as it } from "date-fns";
|
|
14
|
+
import { utcToZonedTime as st, getTimezoneOffset as D } from "date-fns-tz";
|
|
15
|
+
import { fetchEventSource as ot, EventStreamContentType as at } from "@microsoft/fetch-event-source";
|
|
16
|
+
import { defineStore as ct } from "pinia";
|
|
17
|
+
const lt = {
|
|
18
18
|
path: "/",
|
|
19
19
|
watch: !0,
|
|
20
|
-
decode: (r) =>
|
|
20
|
+
decode: (r) => q(decodeURIComponent(r)),
|
|
21
21
|
encode: (r) => encodeURIComponent(typeof r == "string" ? r : JSON.stringify(r))
|
|
22
|
-
},
|
|
22
|
+
}, zt = (r, t) => {
|
|
23
23
|
var s;
|
|
24
|
-
const e = { ...
|
|
25
|
-
return
|
|
26
|
-
document.cookie =
|
|
24
|
+
const e = { ...lt, ...t || {} }, n = Y(document.cookie, e), i = b(n[r] ?? ((s = e.default) == null ? void 0 : s.call(e)));
|
|
25
|
+
return z(i, () => {
|
|
26
|
+
document.cookie = ut(r, i.value, e);
|
|
27
27
|
}), i;
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
return t == null ?
|
|
29
|
+
function ut(r, t, e = {}) {
|
|
30
|
+
return t == null ? M(r, t, { ...e, maxAge: -1 }) : M(r, t, e);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
33
|
-
class
|
|
32
|
+
var y = /* @__PURE__ */ ((r) => (r.Add = "add", r.Remove = "remove", r.Update = "update", r.IndexCreate = "indexCreate", r))(y || {});
|
|
33
|
+
class K {
|
|
34
34
|
/**
|
|
35
35
|
* Создает экземпляр EventBus и подготавливает базовое состояние.
|
|
36
36
|
*/
|
|
@@ -156,8 +156,8 @@ class N {
|
|
|
156
156
|
t ? (e = this.listeners.get(t)) == null || e.clear() : this.listeners.clear();
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
const
|
|
160
|
-
class
|
|
159
|
+
const Rt = new K(Object.keys({}));
|
|
160
|
+
class j {
|
|
161
161
|
constructor() {
|
|
162
162
|
o(this, "subscribers", /* @__PURE__ */ new Set());
|
|
163
163
|
}
|
|
@@ -178,18 +178,18 @@ class L {
|
|
|
178
178
|
this.subscribers.forEach((t) => t());
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
const
|
|
182
|
-
const t =
|
|
183
|
-
|
|
181
|
+
const Ht = (r) => {
|
|
182
|
+
const t = b(r), e = r.subscribe(() => {
|
|
183
|
+
R(t);
|
|
184
184
|
});
|
|
185
185
|
return { refObj: t, unsubscribe: e };
|
|
186
|
-
},
|
|
187
|
-
const t =
|
|
188
|
-
return
|
|
186
|
+
}, Ut = (r) => {
|
|
187
|
+
const t = b(r), e = r.subscribe(() => R(t));
|
|
188
|
+
return Z(() => {
|
|
189
189
|
e();
|
|
190
190
|
}), t;
|
|
191
191
|
};
|
|
192
|
-
class
|
|
192
|
+
class Kt extends j {
|
|
193
193
|
/**
|
|
194
194
|
* Создает экземпляр Collection и подготавливает базовое состояние.
|
|
195
195
|
*/
|
|
@@ -199,7 +199,7 @@ class Ct extends L {
|
|
|
199
199
|
o(this, "indices", /* @__PURE__ */ new Map());
|
|
200
200
|
o(this, "rootIds", /* @__PURE__ */ new Set());
|
|
201
201
|
o(this, "bus");
|
|
202
|
-
this.bus = new
|
|
202
|
+
this.bus = new K(Object.values(y)), e.length && this.add(e), this.createIndex("id");
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Выполняет действие add в рамках ответственности Collection.
|
|
@@ -210,7 +210,7 @@ class Ct extends L {
|
|
|
210
210
|
this.items.push(i), this.indices.forEach((s, a) => {
|
|
211
211
|
s.set(i[a], i);
|
|
212
212
|
}), i.parentId || this.rootIds.add(i.id);
|
|
213
|
-
}), n != null && n.length && (this.bus.emit(
|
|
213
|
+
}), n != null && n.length && (this.bus.emit(y.Add, n), this.notify());
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* Удаляет сущность из runtime-коллекции Collection.
|
|
@@ -218,14 +218,14 @@ class Ct extends L {
|
|
|
218
218
|
remove(e) {
|
|
219
219
|
const n = Array.isArray(e) ? e : [e], i = [];
|
|
220
220
|
n.forEach((s) => {
|
|
221
|
-
const a = typeof s == "string" ? s : s.id,
|
|
222
|
-
if (
|
|
223
|
-
const [
|
|
224
|
-
this.indices.forEach((
|
|
225
|
-
|
|
226
|
-
}),
|
|
221
|
+
const a = typeof s == "string" ? s : s.id, u = this.items.findIndex((l) => l.id === a);
|
|
222
|
+
if (u !== -1) {
|
|
223
|
+
const [l] = this.items.splice(u, 1);
|
|
224
|
+
this.indices.forEach((c, d) => {
|
|
225
|
+
c.delete(l[d]);
|
|
226
|
+
}), l.parentId || this.rootIds.delete(l.id), i.push(l);
|
|
227
227
|
}
|
|
228
|
-
}), i.length && (this.bus.emit(
|
|
228
|
+
}), i.length && (this.bus.emit(y.Remove, i), this.notify());
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Обновляет runtime-состояние Collection.
|
|
@@ -234,10 +234,10 @@ class Ct extends L {
|
|
|
234
234
|
const n = Array.isArray(e) ? e : [e];
|
|
235
235
|
n.forEach((i) => {
|
|
236
236
|
const s = this.get(i.id);
|
|
237
|
-
s && (Object.assign(s, i), this.indices.forEach((a,
|
|
238
|
-
a.set(i[
|
|
237
|
+
s && (Object.assign(s, i), this.indices.forEach((a, u) => {
|
|
238
|
+
a.set(i[u], s);
|
|
239
239
|
}));
|
|
240
|
-
}), n != null && n.length && (this.bus.emit(
|
|
240
|
+
}), n != null && n.length && (this.bus.emit(y.Update, n), this.notify());
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* Возвращает значение состояния Collection.
|
|
@@ -258,7 +258,7 @@ class Ct extends L {
|
|
|
258
258
|
const n = /* @__PURE__ */ new Map();
|
|
259
259
|
this.items.forEach((i) => {
|
|
260
260
|
n.set(i[e], i);
|
|
261
|
-
}), this.indices.set(e, n), this.bus.emit(
|
|
261
|
+
}), this.indices.set(e, n), this.bus.emit(y.IndexCreate, e);
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
* Возвращает реактивный массив всех элементов.
|
|
@@ -286,7 +286,7 @@ class Ct extends L {
|
|
|
286
286
|
this.bus.off(e, n);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class jt {
|
|
290
290
|
/**
|
|
291
291
|
* Создает экземпляр IndexedCollection и подготавливает базовое состояние.
|
|
292
292
|
*/
|
|
@@ -516,7 +516,7 @@ class $t {
|
|
|
516
516
|
this.list.pop(), this.indexById.delete(t);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
class
|
|
519
|
+
class Bt {
|
|
520
520
|
constructor(t) {
|
|
521
521
|
o(this, "_cap");
|
|
522
522
|
o(this, "_buf");
|
|
@@ -547,7 +547,7 @@ class Mt {
|
|
|
547
547
|
return t;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
class
|
|
550
|
+
class Jt {
|
|
551
551
|
constructor(t) {
|
|
552
552
|
o(this, "baseUrl");
|
|
553
553
|
this.baseUrl = t.baseUrl.replace(/\/+$/, "");
|
|
@@ -619,7 +619,7 @@ class Ft {
|
|
|
619
619
|
return await n.json().catch(() => ({}));
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
class
|
|
622
|
+
class Vt {
|
|
623
623
|
/**
|
|
624
624
|
* Создает экземпляр DelayedExecutor и подготавливает базовое состояние.
|
|
625
625
|
*/
|
|
@@ -659,14 +659,14 @@ class Nt {
|
|
|
659
659
|
this.delayTimer && clearTimeout(this.delayTimer), this.maxTimer && clearTimeout(this.maxTimer), this.delayTimer = null, this.maxTimer = null;
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function E(r) {
|
|
663
663
|
var t;
|
|
664
664
|
return r == null ? String(r) : typeof r == "string" ? `string(${r.length})` : typeof r != "object" ? `${typeof r}(${String(r)})` : Array.isArray(r) ? `Array(${r.length})` : r instanceof Map ? `Map(${r.size})` : r instanceof Set ? `Set(${r.size})` : ((t = r.constructor) == null ? void 0 : t.name) || "Object";
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return r instanceof Error ? `${r.name}: ${r.message}` :
|
|
666
|
+
function T(r) {
|
|
667
|
+
return r instanceof Error ? `${r.name}: ${r.message}` : E(r);
|
|
668
668
|
}
|
|
669
|
-
class
|
|
669
|
+
class Gt {
|
|
670
670
|
/**
|
|
671
671
|
* Создает экземпляр NamedExecutor и подготавливает базовое состояние.
|
|
672
672
|
*/
|
|
@@ -703,7 +703,7 @@ class Lt {
|
|
|
703
703
|
const e = this.callbacks.get(t);
|
|
704
704
|
e && e();
|
|
705
705
|
} catch (e) {
|
|
706
|
-
console.error(`[NamedExecutor] flush error: ${
|
|
706
|
+
console.error(`[NamedExecutor] flush error: ${T(e)}`);
|
|
707
707
|
}
|
|
708
708
|
this.clear(t);
|
|
709
709
|
}
|
|
@@ -727,73 +727,73 @@ class Lt {
|
|
|
727
727
|
clearTimeout(this.delayTimers.get(t)), clearTimeout(this.maxTimers.get(t)), this.delayTimers.delete(t), this.maxTimers.delete(t), this.callbacks.delete(t), this.firstCallTime.delete(t);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
return
|
|
730
|
+
function Zt(r, t) {
|
|
731
|
+
return w(r, t, {
|
|
732
732
|
exposeDefaultValues: !0,
|
|
733
733
|
excludeExtraneousValues: !0
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
return
|
|
736
|
+
function Wt(r) {
|
|
737
|
+
return x(r, {
|
|
738
738
|
exposeUnsetFields: !1
|
|
739
739
|
});
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function Yt(r) {
|
|
742
742
|
return function(t, e) {
|
|
743
|
-
|
|
743
|
+
Q(r)(t, e), Reflect.defineMetadata("genericExpose", r.name, t, e);
|
|
744
744
|
};
|
|
745
745
|
}
|
|
746
|
-
const
|
|
747
|
-
function
|
|
746
|
+
const ft = Symbol("beforeSerialize");
|
|
747
|
+
function qt() {
|
|
748
748
|
return function(r, t, e) {
|
|
749
|
-
Reflect.defineMetadata(
|
|
749
|
+
Reflect.defineMetadata(ft, t, r);
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Qt(r, t, e) {
|
|
753
753
|
r.__afterDeserializeMethods__ || (r.__afterDeserializeMethods__ = []), r.__afterDeserializeMethods__.push(t);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function Xt(r) {
|
|
756
756
|
return function(t, e) {
|
|
757
|
-
f(({ value: n }) => n === null ? void 0 : n, { toPlainOnly: !0 })(t, e),
|
|
757
|
+
f(({ value: n }) => n === null ? void 0 : n, { toPlainOnly: !0 })(t, e), X(r)(t, e);
|
|
758
758
|
};
|
|
759
759
|
}
|
|
760
|
-
function
|
|
761
|
-
return f(({ value: r, type: t }) => t ===
|
|
760
|
+
function vt() {
|
|
761
|
+
return f(({ value: r, type: t }) => t === m.PLAIN_TO_CLASS ? r == null ? void 0 : r.id : r);
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
return f(({ value: t, type: e }) => e ===
|
|
763
|
+
function te(r) {
|
|
764
|
+
return f(({ value: t, type: e }) => e === m.PLAIN_TO_CLASS ? t == null ? void 0 : t.map((n) => n == null ? void 0 : n[r]) : t);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
return f(({ value: r, type: t }) => t ===
|
|
766
|
+
function ee() {
|
|
767
|
+
return f(({ value: r, type: t }) => t === m.CLASS_TO_PLAIN && (r == null ? void 0 : r.id) || r);
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
return f(({ value: r, type: t }) => t ===
|
|
769
|
+
function re() {
|
|
770
|
+
return f(({ value: r, type: t }) => t === m.CLASS_TO_PLAIN ? r.map((e) => e.id) : r);
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function ne() {
|
|
773
773
|
return f(({ value: r, type: t }) => t === "classToPlain" ? void 0 : r, { toPlainOnly: !0 });
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function ie(r) {
|
|
776
776
|
return r == null;
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
778
|
+
const B = Symbol("onDeserialized");
|
|
779
|
+
function se() {
|
|
780
780
|
return function(r, t) {
|
|
781
|
-
Reflect.defineMetadata(
|
|
781
|
+
Reflect.defineMetadata(B, t, r);
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function dt(r) {
|
|
785
785
|
const t = Reflect.getMetadata(
|
|
786
|
-
|
|
786
|
+
B,
|
|
787
787
|
r
|
|
788
788
|
);
|
|
789
789
|
return t ? r[t].bind(r) : null;
|
|
790
790
|
}
|
|
791
|
-
class
|
|
791
|
+
class oe {
|
|
792
792
|
/**
|
|
793
793
|
* Выполняет действие toPlain в рамках ответственности Serialize.
|
|
794
794
|
*/
|
|
795
795
|
static toPlain(t) {
|
|
796
|
-
return
|
|
796
|
+
return x(t, {
|
|
797
797
|
exposeDefaultValues: !0,
|
|
798
798
|
excludeExtraneousValues: !0
|
|
799
799
|
});
|
|
@@ -802,14 +802,14 @@ class Wt {
|
|
|
802
802
|
* Выполняет действие fromJSON в рамках ответственности Serialize.
|
|
803
803
|
*/
|
|
804
804
|
static fromJSON(t, e) {
|
|
805
|
-
const n =
|
|
805
|
+
const n = w(t, e, {
|
|
806
806
|
exposeDefaultValues: !0,
|
|
807
807
|
excludeExtraneousValues: !0
|
|
808
|
-
}), i =
|
|
808
|
+
}), i = dt(n);
|
|
809
809
|
return i && i(), n;
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function ae() {
|
|
813
813
|
return function(r, t) {
|
|
814
814
|
f(
|
|
815
815
|
({ value: e }) => {
|
|
@@ -834,7 +834,7 @@ function Yt() {
|
|
|
834
834
|
)(r, t);
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function ce() {
|
|
838
838
|
return function(r, t) {
|
|
839
839
|
f(
|
|
840
840
|
({ value: e }) => {
|
|
@@ -865,7 +865,7 @@ function qt() {
|
|
|
865
865
|
)(r, t);
|
|
866
866
|
};
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function le() {
|
|
869
869
|
return function(r, t) {
|
|
870
870
|
f(
|
|
871
871
|
({ value: e }) => typeof e == "string" ? e.trim() : String(e ?? ""),
|
|
@@ -876,10 +876,10 @@ function Qt() {
|
|
|
876
876
|
)(r, t);
|
|
877
877
|
};
|
|
878
878
|
}
|
|
879
|
-
function
|
|
880
|
-
return f(({ value: e, type: n }) => e ? n ===
|
|
879
|
+
function ue(r, t) {
|
|
880
|
+
return f(({ value: e, type: n }) => e ? n === m.PLAIN_TO_CLASS ? Array.isArray(e) ? t ? new Map(
|
|
881
881
|
e.map((i) => {
|
|
882
|
-
const s =
|
|
882
|
+
const s = w(r, i);
|
|
883
883
|
return [s[t], s];
|
|
884
884
|
})
|
|
885
885
|
) : (console.warn(
|
|
@@ -889,70 +889,70 @@ function Xt(r, t) {
|
|
|
889
889
|
const a = new r();
|
|
890
890
|
return Object.assign(a, s), [i, a];
|
|
891
891
|
})
|
|
892
|
-
) : (console.warn(`[TypeMap] Expected object or array, got ${
|
|
892
|
+
) : (console.warn(`[TypeMap] Expected object or array, got ${E(e)}`), /* @__PURE__ */ new Map()) : n === m.CLASS_TO_PLAIN ? e instanceof Map ? Array.from(e.values()).map((i) => x(i)) : (console.warn(`[TypeMap] Expected Map, got ${E(e)}`), t ? [] : {}) : (console.warn(`[TypeMap] Unexpected transformation type: ${String(n)}`), e) : /* @__PURE__ */ new Map());
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function fe(r) {
|
|
895
895
|
return f(({ value: t, type: e }) => {
|
|
896
896
|
if (!t || typeof t != "object") return {};
|
|
897
|
-
if (e ===
|
|
897
|
+
if (e === m.PLAIN_TO_CLASS) {
|
|
898
898
|
const n = {};
|
|
899
899
|
for (const i of Object.keys(t))
|
|
900
|
-
n[i] =
|
|
900
|
+
n[i] = w(r, t[i]);
|
|
901
901
|
return n;
|
|
902
902
|
}
|
|
903
|
-
if (e ===
|
|
903
|
+
if (e === m.CLASS_TO_PLAIN) {
|
|
904
904
|
const n = {};
|
|
905
905
|
for (const i of Object.keys(t))
|
|
906
|
-
n[i] =
|
|
906
|
+
n[i] = x(t[i]);
|
|
907
907
|
return n;
|
|
908
908
|
}
|
|
909
909
|
return t;
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function de(r, t, e = (s) => s, n = (s) => s, i = 300) {
|
|
913
913
|
let s = t;
|
|
914
914
|
const a = localStorage.getItem(r);
|
|
915
915
|
if (a)
|
|
916
916
|
try {
|
|
917
|
-
const
|
|
918
|
-
s = e(
|
|
919
|
-
} catch (
|
|
920
|
-
console.error(`[useStorageDebounced] Failed to parse "${r}" (${a.length} chars): ${
|
|
917
|
+
const c = JSON.parse(a);
|
|
918
|
+
s = e(c);
|
|
919
|
+
} catch (c) {
|
|
920
|
+
console.error(`[useStorageDebounced] Failed to parse "${r}" (${a.length} chars): ${T(c)}`);
|
|
921
921
|
}
|
|
922
|
-
const
|
|
922
|
+
const u = b(s), l = v(() => {
|
|
923
923
|
try {
|
|
924
|
-
const
|
|
925
|
-
localStorage.setItem(r,
|
|
926
|
-
} catch (
|
|
927
|
-
console.error(`[useStorageDebounced] Failed to save "${r}": ${
|
|
924
|
+
const c = JSON.stringify(n(u.value));
|
|
925
|
+
localStorage.setItem(r, c);
|
|
926
|
+
} catch (c) {
|
|
927
|
+
console.error(`[useStorageDebounced] Failed to save "${r}": ${T(c)}`);
|
|
928
928
|
}
|
|
929
929
|
}, i);
|
|
930
|
-
return
|
|
931
|
-
() =>
|
|
930
|
+
return z(
|
|
931
|
+
() => u.value,
|
|
932
932
|
() => {
|
|
933
|
-
|
|
933
|
+
l();
|
|
934
934
|
},
|
|
935
935
|
{ deep: !0 }
|
|
936
|
-
),
|
|
936
|
+
), u;
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function he(r, t) {
|
|
939
939
|
return r < t ? -1 : r > t ? 1 : 0;
|
|
940
940
|
}
|
|
941
|
-
const
|
|
942
|
-
function
|
|
943
|
-
if (!
|
|
941
|
+
const ht = process.env.NODE_ENV !== "production";
|
|
942
|
+
function me(r, t) {
|
|
943
|
+
if (!ht) return t();
|
|
944
944
|
console.groupCollapsed(`⏳ ${r}`);
|
|
945
945
|
const e = performance.now(), n = t(), i = performance.now();
|
|
946
946
|
return console.log(`${r}: ${Math.round(i - e)} ms`), console.groupEnd(), n;
|
|
947
947
|
}
|
|
948
|
-
const
|
|
949
|
-
function
|
|
948
|
+
const ye = () => tt(), k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
949
|
+
function pe(r) {
|
|
950
950
|
let t = "";
|
|
951
951
|
for (let e = 0; e < r; ++e)
|
|
952
|
-
t +=
|
|
952
|
+
t += k[Math.floor(k.length * Math.random())];
|
|
953
953
|
return t;
|
|
954
954
|
}
|
|
955
|
-
class
|
|
955
|
+
class ge {
|
|
956
956
|
/**
|
|
957
957
|
* Создает экземпляр HotkeyManager и подготавливает базовое состояние.
|
|
958
958
|
*/
|
|
@@ -1033,14 +1033,117 @@ class se {
|
|
|
1033
1033
|
this.clear(), this.target.removeEventListener("keydown", this.handleBound);
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function be(r, t) {
|
|
1037
1037
|
return t != null && t.key ? r.some((e) => {
|
|
1038
|
-
var
|
|
1039
|
-
const n = e.ctrl === void 0 || t.ctrlKey === e.ctrl, i = e.alt === void 0 || t.altKey === e.alt, s = e.shift === void 0 || t.shiftKey === e.shift, a = e.meta === void 0 || t.metaKey === e.meta,
|
|
1040
|
-
return n && i && s && a &&
|
|
1038
|
+
var l, c;
|
|
1039
|
+
const n = e.ctrl === void 0 || t.ctrlKey === e.ctrl, i = e.alt === void 0 || t.altKey === e.alt, s = e.shift === void 0 || t.shiftKey === e.shift, a = e.meta === void 0 || t.metaKey === e.meta, u = t.key && e.key && ((l = t.key) == null ? void 0 : l.toLowerCase()) === ((c = e.key) == null ? void 0 : c.toLowerCase());
|
|
1040
|
+
return n && i && s && a && u;
|
|
1041
1041
|
}) : !1;
|
|
1042
1042
|
}
|
|
1043
|
-
|
|
1043
|
+
const F = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new Set([
|
|
1044
|
+
"Alt",
|
|
1045
|
+
"AltGraph",
|
|
1046
|
+
"CapsLock",
|
|
1047
|
+
"Control",
|
|
1048
|
+
"Fn",
|
|
1049
|
+
"FnLock",
|
|
1050
|
+
"Hyper",
|
|
1051
|
+
"Meta",
|
|
1052
|
+
"NumLock",
|
|
1053
|
+
"OS",
|
|
1054
|
+
"ScrollLock",
|
|
1055
|
+
"Shift",
|
|
1056
|
+
"Super",
|
|
1057
|
+
"Symbol",
|
|
1058
|
+
"SymbolLock"
|
|
1059
|
+
]);
|
|
1060
|
+
function Se(r) {
|
|
1061
|
+
return A(J(r).snapshot);
|
|
1062
|
+
}
|
|
1063
|
+
function Te(r, t) {
|
|
1064
|
+
const e = J(r);
|
|
1065
|
+
return e.subscribers.add(t), t(A(e.snapshot)), () => e.subscribers.delete(t);
|
|
1066
|
+
}
|
|
1067
|
+
function J(r) {
|
|
1068
|
+
var a, u, l;
|
|
1069
|
+
const t = F.get(r);
|
|
1070
|
+
if (t)
|
|
1071
|
+
return t;
|
|
1072
|
+
const e = yt((a = r.defaultView) == null ? void 0 : a.navigator), n = {
|
|
1073
|
+
snapshot: L(e),
|
|
1074
|
+
entries: /* @__PURE__ */ new Map(),
|
|
1075
|
+
subscribers: /* @__PURE__ */ new Set()
|
|
1076
|
+
}, i = (c) => {
|
|
1077
|
+
var $;
|
|
1078
|
+
const d = c ? {
|
|
1079
|
+
ctrl: c.ctrlKey,
|
|
1080
|
+
shift: c.shiftKey,
|
|
1081
|
+
alt: c.altKey,
|
|
1082
|
+
meta: c.metaKey,
|
|
1083
|
+
mod: e === "macos" ? c.metaKey : e === "windows" || e === "linux" ? c.ctrlKey : c.ctrlKey || c.metaKey,
|
|
1084
|
+
altGraph: (($ = c.getModifierState) == null ? void 0 : $.call(c, "AltGraph")) === !0
|
|
1085
|
+
} : L(e).modifiers, C = [...n.entries.values()], _ = {
|
|
1086
|
+
platform: e,
|
|
1087
|
+
modifiers: d,
|
|
1088
|
+
held: {
|
|
1089
|
+
key: [...new Set(C.map((p) => p.key))].sort(),
|
|
1090
|
+
code: [...new Set(C.map((p) => p.code).filter(Boolean))].sort()
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
if (!pt(n.snapshot, _)) {
|
|
1094
|
+
n.snapshot = _;
|
|
1095
|
+
for (const p of n.subscribers)
|
|
1096
|
+
p(A(_));
|
|
1097
|
+
}
|
|
1098
|
+
}, s = () => {
|
|
1099
|
+
n.entries.clear(), i();
|
|
1100
|
+
};
|
|
1101
|
+
return r.addEventListener("keydown", (c) => {
|
|
1102
|
+
if (!mt.has(c.key)) {
|
|
1103
|
+
const d = c.key.toLowerCase();
|
|
1104
|
+
n.entries.set(c.code || `key:${d}`, { key: d, code: c.code });
|
|
1105
|
+
}
|
|
1106
|
+
i(c);
|
|
1107
|
+
}, !0), r.addEventListener("keyup", (c) => {
|
|
1108
|
+
const d = c.key.toLowerCase();
|
|
1109
|
+
n.entries.delete(c.code || `key:${d}`), i(c);
|
|
1110
|
+
}, !0), r.addEventListener("visibilitychange", () => {
|
|
1111
|
+
r.visibilityState === "hidden" && s();
|
|
1112
|
+
}), (u = r.defaultView) == null || u.addEventListener("blur", s), (l = r.defaultView) == null || l.addEventListener("pagehide", s), F.set(r, n), n;
|
|
1113
|
+
}
|
|
1114
|
+
function L(r) {
|
|
1115
|
+
return {
|
|
1116
|
+
platform: r,
|
|
1117
|
+
modifiers: {
|
|
1118
|
+
ctrl: !1,
|
|
1119
|
+
shift: !1,
|
|
1120
|
+
alt: !1,
|
|
1121
|
+
meta: !1,
|
|
1122
|
+
mod: !1,
|
|
1123
|
+
altGraph: !1
|
|
1124
|
+
},
|
|
1125
|
+
held: { key: [], code: [] }
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
function yt(r) {
|
|
1129
|
+
var n;
|
|
1130
|
+
const t = r, e = String(((n = t == null ? void 0 : t.userAgentData) == null ? void 0 : n.platform) ?? (t == null ? void 0 : t.platform) ?? (t == null ? void 0 : t.userAgent) ?? "").toLowerCase();
|
|
1131
|
+
return e.includes("mac") || e.includes("darwin") || e.includes("iphone") || e.includes("ipad") ? "macos" : e.includes("win") ? "windows" : e.includes("linux") || e.includes("x11") || e.includes("cros") ? "linux" : "unknown";
|
|
1132
|
+
}
|
|
1133
|
+
function pt(r, t) {
|
|
1134
|
+
return r.platform === t.platform && r.modifiers.ctrl === t.modifiers.ctrl && r.modifiers.shift === t.modifiers.shift && r.modifiers.alt === t.modifiers.alt && r.modifiers.meta === t.modifiers.meta && r.modifiers.mod === t.modifiers.mod && r.modifiers.altGraph === t.modifiers.altGraph && N(r.held.key, t.held.key) && N(r.held.code, t.held.code);
|
|
1135
|
+
}
|
|
1136
|
+
function N(r, t) {
|
|
1137
|
+
return r.length === t.length && r.every((e, n) => e === t[n]);
|
|
1138
|
+
}
|
|
1139
|
+
function A(r) {
|
|
1140
|
+
return {
|
|
1141
|
+
platform: r.platform,
|
|
1142
|
+
modifiers: { ...r.modifiers },
|
|
1143
|
+
held: { key: [...r.held.key], code: [...r.held.code] }
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
class we extends j {
|
|
1044
1147
|
constructor() {
|
|
1045
1148
|
super(...arguments);
|
|
1046
1149
|
/** Массив всех логов */
|
|
@@ -1191,27 +1294,27 @@ class ae extends L {
|
|
|
1191
1294
|
this.logs = [], this.notify();
|
|
1192
1295
|
}
|
|
1193
1296
|
}
|
|
1194
|
-
function
|
|
1297
|
+
function gt(r) {
|
|
1195
1298
|
try {
|
|
1196
1299
|
return new new Proxy(r, { construct: () => ({}) })(), !0;
|
|
1197
1300
|
} catch {
|
|
1198
1301
|
return !1;
|
|
1199
1302
|
}
|
|
1200
1303
|
}
|
|
1201
|
-
function
|
|
1202
|
-
if (
|
|
1304
|
+
function xe(r, ...t) {
|
|
1305
|
+
if (gt(r)) {
|
|
1203
1306
|
const e = r;
|
|
1204
1307
|
return new e(...t);
|
|
1205
1308
|
} else
|
|
1206
1309
|
return r(...t);
|
|
1207
1310
|
}
|
|
1208
|
-
const
|
|
1209
|
-
function
|
|
1311
|
+
const bt = /* @__PURE__ */ new WeakMap();
|
|
1312
|
+
function _e(r) {
|
|
1210
1313
|
let t;
|
|
1211
|
-
return () => (t || (t = r(),
|
|
1314
|
+
return () => (t || (t = r(), bt.set(r, t)), t);
|
|
1212
1315
|
}
|
|
1213
|
-
const
|
|
1214
|
-
DateTime:
|
|
1316
|
+
const St = {
|
|
1317
|
+
DateTime: et,
|
|
1215
1318
|
toDateTime(r) {
|
|
1216
1319
|
return this.DateTime.fromJSDate(r);
|
|
1217
1320
|
},
|
|
@@ -1239,25 +1342,25 @@ const at = {
|
|
|
1239
1342
|
getZone() {
|
|
1240
1343
|
return this.DateTime.now().zone;
|
|
1241
1344
|
}
|
|
1242
|
-
},
|
|
1243
|
-
function
|
|
1345
|
+
}, De = (r) => St.toDateTime(r);
|
|
1346
|
+
function Ee(r) {
|
|
1244
1347
|
return String(r).charAt(0).toUpperCase() + String(r).slice(1);
|
|
1245
1348
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1349
|
+
function Ie(r, t) {
|
|
1350
|
+
return I(r, t) || nt(r, t);
|
|
1248
1351
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const i =
|
|
1251
|
-
return !
|
|
1352
|
+
function Ae(r, t, e, n) {
|
|
1353
|
+
const i = g(r), s = g(t), a = g(e), u = g(n);
|
|
1354
|
+
return !U(s, a) && !I(i, u);
|
|
1252
1355
|
}
|
|
1253
|
-
function
|
|
1254
|
-
return !
|
|
1356
|
+
function Oe(r, t, e) {
|
|
1357
|
+
return !U(r, g(t)) && !I(r, it(e));
|
|
1255
1358
|
}
|
|
1256
|
-
const
|
|
1257
|
-
function
|
|
1258
|
-
return r &&
|
|
1359
|
+
const Ce = (r) => r && new Date(r);
|
|
1360
|
+
function $e(r, t = "HH:mm dd.MM.yyyy", e = {}) {
|
|
1361
|
+
return r && S(r, t, e);
|
|
1259
1362
|
}
|
|
1260
|
-
function
|
|
1363
|
+
function Tt(r, t = "HH:mm dd.MM.yyyy", e = {}, n = !0) {
|
|
1261
1364
|
if (!r || !r || r === "")
|
|
1262
1365
|
return "";
|
|
1263
1366
|
if (typeof r == "string")
|
|
@@ -1267,39 +1370,39 @@ function ct(r, t = "HH:mm dd.MM.yyyy", e = {}, n = !0) {
|
|
|
1267
1370
|
return "";
|
|
1268
1371
|
} else
|
|
1269
1372
|
r = new Date(r.toString());
|
|
1270
|
-
return n ?
|
|
1373
|
+
return n ? S(r, t, e) : S(st(r, "utc"), t, e);
|
|
1271
1374
|
}
|
|
1272
|
-
function
|
|
1375
|
+
function Me(r) {
|
|
1273
1376
|
const t = { weekday: "short" }, e = new Intl.DateTimeFormat("ru-RU", t).format(r);
|
|
1274
1377
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1275
1378
|
}
|
|
1276
|
-
function
|
|
1379
|
+
function ke(r) {
|
|
1277
1380
|
const t = new Date(r), e = t.getTime() + t.getTimezoneOffset() * 6e3, n = new Date(e + 180 * 6e3), i = String(n.getDate()).padStart(2, "0"), s = String(n.getMonth() + 1).padStart(2, "0"), a = n.getFullYear();
|
|
1278
1381
|
return `${i}.${s}.${a}`;
|
|
1279
1382
|
}
|
|
1280
|
-
function
|
|
1281
|
-
return
|
|
1383
|
+
function Fe(r, t = !0) {
|
|
1384
|
+
return Tt(r, "HH:mm", {}, t);
|
|
1282
1385
|
}
|
|
1283
|
-
function
|
|
1386
|
+
function Le(r) {
|
|
1284
1387
|
const t = Array.from(r), e = Math.min(...t.map((i) => i.getTime())), n = Math.max(...t.map((i) => i.getTime()));
|
|
1285
1388
|
return {
|
|
1286
1389
|
minDate: new Date(e),
|
|
1287
1390
|
maxDate: new Date(n)
|
|
1288
1391
|
};
|
|
1289
1392
|
}
|
|
1290
|
-
function
|
|
1291
|
-
const e =
|
|
1393
|
+
function Ne(r, t) {
|
|
1394
|
+
const e = H(r, t), { hours: n, minutes: i } = O(e);
|
|
1292
1395
|
return n || i ? `${e > 0 ? "-" : "+"}${h(n)}:${h(i)}` : "";
|
|
1293
1396
|
}
|
|
1294
|
-
function
|
|
1295
|
-
const e =
|
|
1397
|
+
function Pe(r, t) {
|
|
1398
|
+
const e = H(r, t), { hours: n, minutes: i } = O(e);
|
|
1296
1399
|
return n || i ? `${e > 0 ? "-" : ""}${h(n)}:${h(i)}` : "";
|
|
1297
1400
|
}
|
|
1298
|
-
function
|
|
1401
|
+
function P(r = /* @__PURE__ */ new Date()) {
|
|
1299
1402
|
return new Date(r.getFullYear(), r.getMonth(), r.getDate());
|
|
1300
1403
|
}
|
|
1301
|
-
function
|
|
1302
|
-
const e =
|
|
1404
|
+
function ze(r, t) {
|
|
1405
|
+
const e = rt(P(r), P(t));
|
|
1303
1406
|
return e ? e > 7 ? {
|
|
1304
1407
|
variant: "red",
|
|
1305
1408
|
value: ">7"
|
|
@@ -1314,40 +1417,40 @@ function we(r, t) {
|
|
|
1314
1417
|
value: `${e}`
|
|
1315
1418
|
} : null;
|
|
1316
1419
|
}
|
|
1317
|
-
function
|
|
1420
|
+
function Re(r) {
|
|
1318
1421
|
const e = String(r ?? "").trim().match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
1319
1422
|
if (!e)
|
|
1320
1423
|
return null;
|
|
1321
1424
|
const n = Number(e[1]), i = Number(e[2]) - 1, s = Number(e[3]), a = new Date(Date.UTC(n, i, s, 0, 0, 0, 0));
|
|
1322
1425
|
return Number.isNaN(a.getTime()) ? null : a.toISOString();
|
|
1323
1426
|
}
|
|
1324
|
-
function
|
|
1427
|
+
function He(r) {
|
|
1325
1428
|
const t = String(r ?? "").trim();
|
|
1326
1429
|
if (!t)
|
|
1327
1430
|
return null;
|
|
1328
1431
|
const e = t.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/);
|
|
1329
1432
|
if (e) {
|
|
1330
|
-
const i = Number(e[1]), s = Number(e[2]) - 1, a = Number(e[3]),
|
|
1331
|
-
return Number.isNaN(
|
|
1433
|
+
const i = Number(e[1]), s = Number(e[2]) - 1, a = Number(e[3]), u = Number(e[4]), l = Number(e[5]), c = e[6] != null ? Number(e[6]) : 0, d = new Date(i, s, a, u, l, c, 0);
|
|
1434
|
+
return Number.isNaN(d.getTime()) ? null : d.toISOString();
|
|
1332
1435
|
}
|
|
1333
1436
|
const n = new Date(t);
|
|
1334
1437
|
return Number.isNaN(n.getTime()) ? null : n.toISOString();
|
|
1335
1438
|
}
|
|
1336
|
-
function
|
|
1439
|
+
function Ue(r) {
|
|
1337
1440
|
const t = String(r ?? "").trim();
|
|
1338
1441
|
return t ? t.slice(0, 10) : "";
|
|
1339
1442
|
}
|
|
1340
|
-
function
|
|
1443
|
+
function Ke(r) {
|
|
1341
1444
|
const t = String(r ?? "").trim();
|
|
1342
1445
|
if (!t)
|
|
1343
1446
|
return "";
|
|
1344
1447
|
const e = new Date(t);
|
|
1345
1448
|
if (Number.isNaN(e.getTime()))
|
|
1346
1449
|
return t.slice(0, 16);
|
|
1347
|
-
const n = e.getFullYear(), i = h(e.getMonth() + 1), s = h(e.getDate()), a = h(e.getHours()),
|
|
1348
|
-
return `${n}-${i}-${s}T${a}:${
|
|
1450
|
+
const n = e.getFullYear(), i = h(e.getMonth() + 1), s = h(e.getDate()), a = h(e.getHours()), u = h(e.getMinutes());
|
|
1451
|
+
return `${n}-${i}-${s}T${a}:${u}`;
|
|
1349
1452
|
}
|
|
1350
|
-
function
|
|
1453
|
+
function je(r) {
|
|
1351
1454
|
if (r == null)
|
|
1352
1455
|
return "";
|
|
1353
1456
|
const t = String(r).trim();
|
|
@@ -1359,7 +1462,7 @@ function Oe(r) {
|
|
|
1359
1462
|
const n = t.match(/^(\d{2}):(\d{2})$/);
|
|
1360
1463
|
return n ? `${n[1]}:${n[2]}` : "";
|
|
1361
1464
|
}
|
|
1362
|
-
function
|
|
1465
|
+
function Be(r) {
|
|
1363
1466
|
if (r == null)
|
|
1364
1467
|
return null;
|
|
1365
1468
|
const t = String(r).trim();
|
|
@@ -1371,31 +1474,31 @@ function Ce(r) {
|
|
|
1371
1474
|
const n = t.match(/^(\d{2}):(\d{2})$/);
|
|
1372
1475
|
return n ? `${n[1]}:${n[2]}:00` : null;
|
|
1373
1476
|
}
|
|
1374
|
-
function
|
|
1375
|
-
const t =
|
|
1477
|
+
function Je(r) {
|
|
1478
|
+
const t = xt(r), e = Math.sign(t) >= 0 ? "" : "-", { hours: n, minutes: i } = O(t);
|
|
1376
1479
|
return `${e}${h(n)}:${h(i)}`;
|
|
1377
1480
|
}
|
|
1378
|
-
function
|
|
1379
|
-
const n =
|
|
1481
|
+
function Ve(r = null, t = "dd", e = {}) {
|
|
1482
|
+
const n = wt(r);
|
|
1380
1483
|
if (!n)
|
|
1381
1484
|
return "";
|
|
1382
1485
|
const i = /* @__PURE__ */ new Date(), s = new Date(n);
|
|
1383
|
-
return i.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), s.toDateString() === i.toDateString() ? "" : `/${
|
|
1486
|
+
return i.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), s.toDateString() === i.toDateString() ? "" : `/${S(n, t, e)}`;
|
|
1384
1487
|
}
|
|
1385
|
-
function
|
|
1488
|
+
function wt(r) {
|
|
1386
1489
|
if (!r || r === "")
|
|
1387
1490
|
return null;
|
|
1388
1491
|
const t = typeof r == "string" ? new Date(r) : r instanceof Date ? r : new Date(r.toString());
|
|
1389
1492
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
1390
1493
|
}
|
|
1391
|
-
function
|
|
1494
|
+
function O(r) {
|
|
1392
1495
|
const t = Math.abs(r);
|
|
1393
1496
|
return {
|
|
1394
1497
|
hours: Math.floor(t / 3600) % 24,
|
|
1395
1498
|
minutes: Math.floor(t / 60) % 60
|
|
1396
1499
|
};
|
|
1397
1500
|
}
|
|
1398
|
-
function
|
|
1501
|
+
function xt(r) {
|
|
1399
1502
|
const t = String(r ?? "").trim();
|
|
1400
1503
|
if (!t)
|
|
1401
1504
|
return 0;
|
|
@@ -1404,30 +1507,30 @@ function ut(r) {
|
|
|
1404
1507
|
return (e[1] ? -1 : 1) * (Number(e[2]) * 3600 + Number(e[3]) * 60 + Number(e[4] ?? 0));
|
|
1405
1508
|
const n = t.match(/^(-)?P(?:(\d+(?:\.\d+)?)D)?(?:T(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/i);
|
|
1406
1509
|
if (n) {
|
|
1407
|
-
const i = n[1] ? -1 : 1, s = Number(n[2] ?? 0), a = Number(n[3] ?? 0),
|
|
1408
|
-
return i * (s * 86400 + a * 3600 +
|
|
1510
|
+
const i = n[1] ? -1 : 1, s = Number(n[2] ?? 0), a = Number(n[3] ?? 0), u = Number(n[4] ?? 0), l = Number(n[5] ?? 0);
|
|
1511
|
+
return i * (s * 86400 + a * 3600 + u * 60 + l);
|
|
1409
1512
|
}
|
|
1410
1513
|
return 0;
|
|
1411
1514
|
}
|
|
1412
1515
|
function h(r) {
|
|
1413
1516
|
return String(r).padStart(2, "0");
|
|
1414
1517
|
}
|
|
1415
|
-
function
|
|
1518
|
+
function Ge(r) {
|
|
1416
1519
|
const t = /* @__PURE__ */ new Date();
|
|
1417
1520
|
try {
|
|
1418
|
-
const e =
|
|
1521
|
+
const e = D(r, t), n = Intl.supportedValuesOf("timeZone");
|
|
1419
1522
|
for (const i of n)
|
|
1420
|
-
if (
|
|
1523
|
+
if (D(i, t) === e)
|
|
1421
1524
|
return i;
|
|
1422
1525
|
} catch {
|
|
1423
1526
|
return null;
|
|
1424
1527
|
}
|
|
1425
1528
|
return null;
|
|
1426
1529
|
}
|
|
1427
|
-
function
|
|
1428
|
-
return
|
|
1530
|
+
function Ze(r) {
|
|
1531
|
+
return D(r, /* @__PURE__ */ new Date());
|
|
1429
1532
|
}
|
|
1430
|
-
class
|
|
1533
|
+
class We {
|
|
1431
1534
|
constructor(t) {
|
|
1432
1535
|
o(this, "_url");
|
|
1433
1536
|
o(this, "_retryInterval");
|
|
@@ -1458,15 +1561,15 @@ class Le {
|
|
|
1458
1561
|
async _connect() {
|
|
1459
1562
|
var t, e, n;
|
|
1460
1563
|
try {
|
|
1461
|
-
await
|
|
1564
|
+
await ot(this._url, {
|
|
1462
1565
|
method: "GET",
|
|
1463
1566
|
headers: await this._buildHeaders(),
|
|
1464
1567
|
signal: (t = this._abortController) == null ? void 0 : t.signal,
|
|
1465
1568
|
openWhenHidden: !0,
|
|
1466
1569
|
onopen: (i) => {
|
|
1467
|
-
var a,
|
|
1468
|
-
if (i.ok && i.headers.get("content-type") ===
|
|
1469
|
-
this._isConnected = !0, (
|
|
1570
|
+
var a, u;
|
|
1571
|
+
if (i.ok && i.headers.get("content-type") === at) {
|
|
1572
|
+
this._isConnected = !0, (u = (a = this._options).onOpen) == null || u.call(a);
|
|
1470
1573
|
return;
|
|
1471
1574
|
}
|
|
1472
1575
|
throw new Error(`Unexpected response: ${i.status}`);
|
|
@@ -1475,7 +1578,7 @@ class Le {
|
|
|
1475
1578
|
try {
|
|
1476
1579
|
this._options.onEvent(JSON.parse(i.data));
|
|
1477
1580
|
} catch (s) {
|
|
1478
|
-
console.warn(`[SSEManager] Failed to parse message: ${
|
|
1581
|
+
console.warn(`[SSEManager] Failed to parse message: ${T(s)}`);
|
|
1479
1582
|
}
|
|
1480
1583
|
},
|
|
1481
1584
|
onclose: () => {
|
|
@@ -1496,7 +1599,7 @@ class Le {
|
|
|
1496
1599
|
return this._isConnected;
|
|
1497
1600
|
}
|
|
1498
1601
|
}
|
|
1499
|
-
class
|
|
1602
|
+
class Ye {
|
|
1500
1603
|
constructor() {
|
|
1501
1604
|
o(this, "_currentCount", 0);
|
|
1502
1605
|
o(this, "_lastResetTime", Date.now());
|
|
@@ -1513,27 +1616,27 @@ class ke {
|
|
|
1513
1616
|
this._currentCount = 0, this._lastEventsPerSecond = 0, this._lastResetTime = Date.now();
|
|
1514
1617
|
}
|
|
1515
1618
|
}
|
|
1516
|
-
const
|
|
1517
|
-
const r =
|
|
1518
|
-
function e(
|
|
1519
|
-
r[
|
|
1520
|
-
...
|
|
1619
|
+
const qe = ct("tooltip", () => {
|
|
1620
|
+
const r = W({}), t = b(null);
|
|
1621
|
+
function e(l) {
|
|
1622
|
+
r[l.id] = {
|
|
1623
|
+
...l,
|
|
1521
1624
|
visible: !1
|
|
1522
1625
|
};
|
|
1523
1626
|
}
|
|
1524
|
-
function n(
|
|
1525
|
-
delete r[
|
|
1627
|
+
function n(l) {
|
|
1628
|
+
delete r[l];
|
|
1526
1629
|
}
|
|
1527
|
-
function i(
|
|
1528
|
-
r[
|
|
1630
|
+
function i(l) {
|
|
1631
|
+
r[l] && (t.value = l, r[l].active = !0);
|
|
1529
1632
|
}
|
|
1530
|
-
function s(
|
|
1531
|
-
r[
|
|
1633
|
+
function s(l) {
|
|
1634
|
+
r[l] && (r[l].active = !1, t.value === l && (t.value = null));
|
|
1532
1635
|
}
|
|
1533
|
-
function a(
|
|
1534
|
-
i(
|
|
1636
|
+
function a(l) {
|
|
1637
|
+
i(l);
|
|
1535
1638
|
}
|
|
1536
|
-
function
|
|
1639
|
+
function u() {
|
|
1537
1640
|
t.value && s(t.value);
|
|
1538
1641
|
}
|
|
1539
1642
|
return {
|
|
@@ -1544,92 +1647,94 @@ const ze = v("tooltip", () => {
|
|
|
1544
1647
|
showTooltip: i,
|
|
1545
1648
|
hideTooltip: s,
|
|
1546
1649
|
setActiveTooltipId: a,
|
|
1547
|
-
clearActiveTooltipId:
|
|
1650
|
+
clearActiveTooltipId: u
|
|
1548
1651
|
};
|
|
1549
1652
|
});
|
|
1550
|
-
function
|
|
1653
|
+
function Qe(r, t) {
|
|
1551
1654
|
var e;
|
|
1552
1655
|
return r("div", {}, (e = t.slots) != null && e.default ? t.slots.default() : []);
|
|
1553
1656
|
}
|
|
1554
|
-
const
|
|
1657
|
+
const Xe = "x-collection-tooltip-id";
|
|
1555
1658
|
export {
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1659
|
+
Qt as AfterDeserialize,
|
|
1660
|
+
Rt as AppBus,
|
|
1661
|
+
qt as BeforeSerialize,
|
|
1662
|
+
Kt as Collection,
|
|
1663
|
+
Vt as DelayedExecutor,
|
|
1664
|
+
te as DeserializeArrayField,
|
|
1665
|
+
vt as DeserializeId,
|
|
1666
|
+
K as EventBus,
|
|
1667
|
+
y as Events,
|
|
1668
|
+
Yt as GenericExpose,
|
|
1669
|
+
ge as HotkeyManager,
|
|
1670
|
+
ht as IS_DEBUG,
|
|
1671
|
+
ne as IgnoreToPlain,
|
|
1672
|
+
jt as IndexedCollection,
|
|
1673
|
+
Xt as IsOptionalTransformed,
|
|
1674
|
+
ae as Json,
|
|
1675
|
+
ce as JsonString,
|
|
1676
|
+
Gt as NamedExecutor,
|
|
1677
|
+
Jt as PayloadHttpClient,
|
|
1678
|
+
Bt as RingBuffer,
|
|
1679
|
+
We as SSEManager,
|
|
1680
|
+
le as Script,
|
|
1681
|
+
oe as Serialize,
|
|
1682
|
+
ee as SerializeId,
|
|
1683
|
+
re as SerializeIds,
|
|
1684
|
+
we as StructuredLogger,
|
|
1685
|
+
j as Subscribable,
|
|
1686
|
+
St as SystemClock,
|
|
1687
|
+
Xe as TooltipAttribute,
|
|
1688
|
+
Qe as TooltipRegistrator,
|
|
1689
|
+
ue as TypeMap,
|
|
1690
|
+
fe as TypeRecord,
|
|
1691
|
+
Ye as UPSMeter_Service,
|
|
1692
|
+
Ee as capitalize,
|
|
1693
|
+
he as compareNumber,
|
|
1694
|
+
T as consoleErrorSummary,
|
|
1695
|
+
E as consoleValueSummary,
|
|
1696
|
+
xe as createInstance,
|
|
1697
|
+
Ne as diffDuration,
|
|
1698
|
+
Pe as diffDurationTable,
|
|
1699
|
+
De as dt,
|
|
1700
|
+
Fe as extractTime,
|
|
1701
|
+
Le as findMinMaxDates,
|
|
1702
|
+
ke as formatDateToMSK,
|
|
1703
|
+
$e as formatDatetime,
|
|
1704
|
+
Tt as formatDatetimeTZ,
|
|
1705
|
+
Ve as formatDatetimeTZSpecial,
|
|
1706
|
+
ye as generateUUID,
|
|
1707
|
+
ze as getDateOnlyDiffFactor,
|
|
1708
|
+
Me as getDayOfWeek,
|
|
1709
|
+
Se as getKeyboardStateSnapshot,
|
|
1710
|
+
dt as getOnDeserializedMethod,
|
|
1711
|
+
Ze as getTimezoneOffsetMs,
|
|
1712
|
+
_e as globalState,
|
|
1713
|
+
Ie as isAfterOrEqual,
|
|
1714
|
+
be as isAnyKeyComboActive,
|
|
1715
|
+
gt as isConstructor,
|
|
1716
|
+
Oe as isDateInRange,
|
|
1717
|
+
Ae as isDateRangeOverlap,
|
|
1718
|
+
ie as isNullOrUndefined,
|
|
1719
|
+
Ue as isoToDateInput,
|
|
1720
|
+
Ke as isoToDateTimeLocalInput,
|
|
1721
|
+
se as onDeserialized,
|
|
1722
|
+
Ce as parseDate,
|
|
1723
|
+
Je as parseDuration,
|
|
1724
|
+
Ge as parseOffsetToTimezone,
|
|
1725
|
+
me as profile,
|
|
1726
|
+
pe as randomString,
|
|
1727
|
+
P as removeTime,
|
|
1728
|
+
Te as subscribeKeyboardState,
|
|
1729
|
+
je as timeToTimeInput,
|
|
1730
|
+
Zt as toInstance,
|
|
1731
|
+
Re as toIsoZDate,
|
|
1732
|
+
He as toIsoZDateTime,
|
|
1733
|
+
Wt as toPlain,
|
|
1734
|
+
Be as toTimeHHMMSS,
|
|
1735
|
+
zt as useCookie,
|
|
1736
|
+
de as useStorageDebounced,
|
|
1737
|
+
Ht as useSubscribableRef,
|
|
1738
|
+
Ut as useSubscribableRefAuto,
|
|
1739
|
+
qe as useTooltipStore
|
|
1635
1740
|
};
|