@flemo/core 1.21.1 → 1.22.1
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/core/TaskManger.d.ts +1 -1
- package/dist/core/engine/__tests__/invisibleAnimationHold.test.d.ts +1 -0
- package/dist/core/engine/__tests__/motionDriverKind.test.d.ts +1 -0
- package/dist/core/engine/__tests__/nativeStallAnchor.test.d.ts +1 -0
- package/dist/core/engine/driverPolicy.d.ts +1 -0
- package/dist/core/engine/invisibleAnimationHold.d.ts +2 -0
- package/dist/core/engine/motionDriverKind.d.ts +7 -0
- package/dist/core/engine/nativeStallAnchor.d.ts +2 -0
- package/dist/core/engine/perceptualSpan.d.ts +2 -1
- package/dist/core/engine/transitionPlayer.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +643 -492
- package/dist/screen/computeScreenFreeze.d.ts +2 -0
- package/dist/transition/typing.d.ts +2 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -163,19 +163,22 @@ var a = 1200, o = 2, s = new class {
|
|
|
163
163
|
rearms: t?.rearms ?? 0
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
anchorGate(e) {
|
|
167
|
-
let
|
|
168
|
-
if (
|
|
166
|
+
anchorGate(e, t) {
|
|
167
|
+
let n = this.gatePhases.get(e);
|
|
168
|
+
if (n?.phase === "anchored") return;
|
|
169
169
|
this.gatePhases.set(e, {
|
|
170
170
|
phase: "anchored",
|
|
171
|
-
rearms:
|
|
171
|
+
rearms: n?.rearms ?? 0,
|
|
172
|
+
minLifetimeMs: t ?? n?.minLifetimeMs
|
|
172
173
|
});
|
|
173
|
-
let
|
|
174
|
-
!
|
|
174
|
+
let r = this.tasks.get(e);
|
|
175
|
+
!r || r.status !== "MANUAL_PENDING" && r.status !== "SIGNAL_PENDING" || (r.backstopTimer && (clearTimeout(r.backstopTimer), delete r.backstopTimer), this.armBackstop(r));
|
|
175
176
|
}
|
|
176
177
|
armBackstop(e) {
|
|
177
178
|
let t = e.control?.maxLifetimeMs;
|
|
178
|
-
!t || t <= 0 || typeof setTimeout > "u"
|
|
179
|
+
if (!t || t <= 0 || typeof setTimeout > "u") return;
|
|
180
|
+
let n = Math.max(t, this.gatePhases.get(e.id)?.minLifetimeMs ?? 0);
|
|
181
|
+
e.backstopTimer = setTimeout(() => {
|
|
179
182
|
delete e.backstopTimer;
|
|
180
183
|
let t = this.gatePhases.get(e.id);
|
|
181
184
|
if (t?.phase === "held" && t.rearms < o) {
|
|
@@ -183,7 +186,7 @@ var a = 1200, o = 2, s = new class {
|
|
|
183
186
|
return;
|
|
184
187
|
}
|
|
185
188
|
this.resolveTask(e.id);
|
|
186
|
-
},
|
|
189
|
+
}, n);
|
|
187
190
|
}
|
|
188
191
|
async resolveTask(e) {
|
|
189
192
|
let t = this.tasks.get(e);
|
|
@@ -500,13 +503,13 @@ var S = [], C = !1, w = (e) => {
|
|
|
500
503
|
let n = window.history.state;
|
|
501
504
|
return n ? Object.values(n).some((e) => !!e && typeof e == "object" && e.id === t) : !1;
|
|
502
505
|
};
|
|
503
|
-
function
|
|
506
|
+
function D(e, t) {
|
|
504
507
|
for (let n = S.length - 1; n >= 0; --n) if (S[n].pathname === t) return S[n].raw?.[e] ?? null;
|
|
505
508
|
return null;
|
|
506
509
|
}
|
|
507
|
-
var
|
|
508
|
-
function
|
|
509
|
-
|
|
510
|
+
var O = /* @__PURE__ */ new WeakMap();
|
|
511
|
+
function k(e) {
|
|
512
|
+
O.has(e) || O.set(e, x({
|
|
510
513
|
stores: e,
|
|
511
514
|
driver: e.driver,
|
|
512
515
|
consume: e.consume,
|
|
@@ -515,12 +518,12 @@ function O(e) {
|
|
|
515
518
|
ownsPathname: e.ownsPathname
|
|
516
519
|
}));
|
|
517
520
|
}
|
|
518
|
-
function
|
|
519
|
-
e.persistent || (
|
|
521
|
+
function A(e) {
|
|
522
|
+
e.persistent || (O.get(e)?.(), O.delete(e));
|
|
520
523
|
}
|
|
521
524
|
//#endregion
|
|
522
525
|
//#region src/history/memoryHistoryDriver.ts
|
|
523
|
-
function
|
|
526
|
+
function ee(e) {
|
|
524
527
|
let t = [{
|
|
525
528
|
state: e?.state ?? null,
|
|
526
529
|
url: e?.url ?? "/"
|
|
@@ -562,7 +565,7 @@ function ne(e) {
|
|
|
562
565
|
}
|
|
563
566
|
//#endregion
|
|
564
567
|
//#region src/navigate/store.ts
|
|
565
|
-
function
|
|
568
|
+
function te() {
|
|
566
569
|
return e((e) => ({
|
|
567
570
|
status: "IDLE",
|
|
568
571
|
transitionTaskId: null,
|
|
@@ -572,11 +575,11 @@ function k() {
|
|
|
572
575
|
}
|
|
573
576
|
//#endregion
|
|
574
577
|
//#region src/navigate/createNavigationController.ts
|
|
575
|
-
var
|
|
578
|
+
var j = (e, t, n) => {
|
|
576
579
|
let { regexp: r } = i(e);
|
|
577
580
|
for (let e = t - 1; e >= 0; e--) if (r.test(n[e].pathname)) return t - e;
|
|
578
581
|
return -1;
|
|
579
|
-
},
|
|
582
|
+
}, M = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, N = async (e, t, n, r) => {
|
|
580
583
|
let i, a = new Promise((t) => {
|
|
581
584
|
i = e.subscribe(() => t(!0));
|
|
582
585
|
}), o = new Promise((e) => setTimeout(() => e(!1), 200));
|
|
@@ -584,7 +587,7 @@ var A = (e, t, n) => {
|
|
|
584
587
|
let s = await Promise.race([a, o]);
|
|
585
588
|
i(), s && r();
|
|
586
589
|
};
|
|
587
|
-
function
|
|
590
|
+
function ne(e) {
|
|
588
591
|
let { stores: t, buildPathname: n, driver: r = g(), markSelfInduced: i = y } = e, o = () => t.history.getState().bumpTruncationEpoch(), c = () => {
|
|
589
592
|
let e = r.readState();
|
|
590
593
|
if (!e?.id) return null;
|
|
@@ -610,10 +613,10 @@ function re(e) {
|
|
|
610
613
|
}
|
|
611
614
|
let s = c(), { index: d, histories: f, addHistory: g, popHistories: _ } = t.history.getState(), v = (() => {
|
|
612
615
|
if (u?.until != null) {
|
|
613
|
-
let e =
|
|
616
|
+
let e = j(u.until, d, f);
|
|
614
617
|
return e < 0 ? 0 : e;
|
|
615
618
|
}
|
|
616
|
-
return Math.min(
|
|
619
|
+
return Math.min(M(u?.skip, 0), Math.max(0, d));
|
|
617
620
|
})(), { setStatus: y, setTransitionTaskId: b } = t.navigate.getState();
|
|
618
621
|
y("PUSHING"), b(h);
|
|
619
622
|
let { pathname: x, toPathname: S } = n(e, l ?? {}), C = {
|
|
@@ -640,7 +643,7 @@ function re(e) {
|
|
|
640
643
|
return g({
|
|
641
644
|
...C,
|
|
642
645
|
frameIndex: T + 1
|
|
643
|
-
}), await
|
|
646
|
+
}), await N(r, i, v, () => {
|
|
644
647
|
o(), r.pushState({
|
|
645
648
|
id: h,
|
|
646
649
|
index: T + 1,
|
|
@@ -679,10 +682,10 @@ function re(e) {
|
|
|
679
682
|
}
|
|
680
683
|
let s = c(), { index: d, histories: f, addHistory: g, replaceHistory: _, popHistories: v } = t.history.getState(), y = (() => {
|
|
681
684
|
if (u?.until != null) {
|
|
682
|
-
let e =
|
|
685
|
+
let e = j(u.until, d, f);
|
|
683
686
|
return e < 0 ? 0 : e + 1;
|
|
684
687
|
}
|
|
685
|
-
return Math.min(
|
|
688
|
+
return Math.min(M(u?.skip, 0) + 1, d + 1);
|
|
686
689
|
})();
|
|
687
690
|
if (y <= 0) {
|
|
688
691
|
a.abort();
|
|
@@ -714,7 +717,7 @@ function re(e) {
|
|
|
714
717
|
return v(y - 1), g({
|
|
715
718
|
...w,
|
|
716
719
|
frameIndex: E
|
|
717
|
-
}), y <= d ? await
|
|
720
|
+
}), y <= d ? await N(r, i, y, () => {
|
|
718
721
|
o(), r.pushState({
|
|
719
722
|
id: h,
|
|
720
723
|
index: E,
|
|
@@ -723,7 +726,7 @@ function re(e) {
|
|
|
723
726
|
transitionName: p,
|
|
724
727
|
layoutId: m
|
|
725
728
|
}, S);
|
|
726
|
-
}) : await
|
|
729
|
+
}) : await N(r, i, d, () => {
|
|
727
730
|
o(), r.replaceState({
|
|
728
731
|
id: h,
|
|
729
732
|
index: E,
|
|
@@ -779,10 +782,10 @@ function re(e) {
|
|
|
779
782
|
pop: async (e) => {
|
|
780
783
|
await d((t, n) => {
|
|
781
784
|
if (e?.until != null) {
|
|
782
|
-
let r =
|
|
785
|
+
let r = j(e.until, t, n);
|
|
783
786
|
return r < 0 ? 0 : r;
|
|
784
787
|
}
|
|
785
|
-
let r =
|
|
788
|
+
let r = M(e?.skip, 1);
|
|
786
789
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
787
790
|
}, e?.transitionName);
|
|
788
791
|
}
|
|
@@ -790,14 +793,14 @@ function re(e) {
|
|
|
790
793
|
}
|
|
791
794
|
//#endregion
|
|
792
795
|
//#region src/navigate/createStepController.ts
|
|
793
|
-
var
|
|
796
|
+
var re = (e) => {
|
|
794
797
|
let t = e;
|
|
795
798
|
return t?.step ? t.params ?? {} : null;
|
|
796
|
-
},
|
|
799
|
+
}, ie = (e, t) => {
|
|
797
800
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
798
801
|
return n ? `${e}?${n}` : e;
|
|
799
802
|
};
|
|
800
|
-
function
|
|
803
|
+
function ae(e) {
|
|
801
804
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
802
805
|
return {
|
|
803
806
|
pushStep: async (e) => {
|
|
@@ -855,7 +858,7 @@ function oe(e) {
|
|
|
855
858
|
}
|
|
856
859
|
};
|
|
857
860
|
}
|
|
858
|
-
function
|
|
861
|
+
function oe(e, t) {
|
|
859
862
|
return e.subscribe((e) => {
|
|
860
863
|
let n = e.state;
|
|
861
864
|
n?.step && s.addTask(async () => {
|
|
@@ -865,7 +868,7 @@ function se(e, t) {
|
|
|
865
868
|
}
|
|
866
869
|
//#endregion
|
|
867
870
|
//#region src/transition/store.ts
|
|
868
|
-
function
|
|
871
|
+
function se(t = "cupertino") {
|
|
869
872
|
return e((e) => ({
|
|
870
873
|
defaultTransitionName: t,
|
|
871
874
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -873,12 +876,12 @@ function ce(t = "cupertino") {
|
|
|
873
876
|
}
|
|
874
877
|
//#endregion
|
|
875
878
|
//#region src/utils/matchesPathname.ts
|
|
876
|
-
function
|
|
879
|
+
function ce(e, t) {
|
|
877
880
|
return i(e).regexp.test(t);
|
|
878
881
|
}
|
|
879
882
|
//#endregion
|
|
880
883
|
//#region src/screen/store.ts
|
|
881
|
-
function
|
|
884
|
+
function P() {
|
|
882
885
|
return e((e) => ({
|
|
883
886
|
dragStatus: "IDLE",
|
|
884
887
|
replaceTransitionStatus: "IDLE",
|
|
@@ -909,21 +912,21 @@ function ue() {
|
|
|
909
912
|
}
|
|
910
913
|
//#endregion
|
|
911
914
|
//#region src/core/createRouterScope.ts
|
|
912
|
-
var
|
|
915
|
+
var le = {
|
|
913
916
|
mark: () => {},
|
|
914
917
|
consume: () => !1
|
|
915
|
-
},
|
|
916
|
-
function
|
|
918
|
+
}, F = /* @__PURE__ */ new Map();
|
|
919
|
+
function ue(e) {
|
|
917
920
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, s = f() ? void 0 : e.persistKey;
|
|
918
921
|
if (s) {
|
|
919
|
-
let e =
|
|
922
|
+
let e = F.get(s);
|
|
920
923
|
if (e) {
|
|
921
924
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
922
925
|
let t = e.history.getState();
|
|
923
926
|
return t.setPendingIndex(t.index), e;
|
|
924
927
|
}
|
|
925
928
|
}
|
|
926
|
-
let l = d(t, n, r, i), u = (e.routerKey && !f() ?
|
|
929
|
+
let l = d(t, n, r, i), u = (e.routerKey && !f() ? D(e.routerKey, n) : null) ?? (o && !f() ? o.readState() : null), p = u?.id ? {
|
|
927
930
|
...l,
|
|
928
931
|
id: u.id,
|
|
929
932
|
params: u.params ?? l.params,
|
|
@@ -936,7 +939,7 @@ function fe(e) {
|
|
|
936
939
|
index: 0,
|
|
937
940
|
histories: [p]
|
|
938
941
|
}), e.hostedScope;
|
|
939
|
-
let m = a ?
|
|
942
|
+
let m = a ? ee({
|
|
940
943
|
state: {
|
|
941
944
|
id: p.id,
|
|
942
945
|
index: 0,
|
|
@@ -946,25 +949,25 @@ function fe(e) {
|
|
|
946
949
|
layoutId: p.layoutId
|
|
947
950
|
},
|
|
948
951
|
url: p.pathname
|
|
949
|
-
}) : o, h = a ?
|
|
952
|
+
}) : o, h = a ? le : _(), g = {
|
|
950
953
|
history: c([p], 0),
|
|
951
|
-
navigate:
|
|
952
|
-
transition:
|
|
953
|
-
screen:
|
|
954
|
+
navigate: te(),
|
|
955
|
+
transition: se(i),
|
|
956
|
+
screen: P(),
|
|
954
957
|
driver: m,
|
|
955
958
|
markSelfInduced: h.mark,
|
|
956
959
|
consume: h.consume,
|
|
957
960
|
routerKey: e.routerKey,
|
|
958
961
|
zoneEntryId: e.zoneEntryId,
|
|
959
|
-
ownsPathname: (e) =>
|
|
962
|
+
ownsPathname: (e) => ce(t, e),
|
|
960
963
|
persistent: !!s,
|
|
961
964
|
life: { alive: !0 }
|
|
962
965
|
};
|
|
963
|
-
return s &&
|
|
966
|
+
return s && F.set(s, g), g;
|
|
964
967
|
}
|
|
965
968
|
//#endregion
|
|
966
969
|
//#region src/screen/createScreenSelector.ts
|
|
967
|
-
function
|
|
970
|
+
function de(e, t) {
|
|
968
971
|
return e.map((n, r) => ({
|
|
969
972
|
...n,
|
|
970
973
|
isActive: r === t,
|
|
@@ -977,13 +980,17 @@ function pe(e, t) {
|
|
|
977
980
|
}
|
|
978
981
|
//#endregion
|
|
979
982
|
//#region src/screen/computeScreenFreeze.ts
|
|
980
|
-
function
|
|
983
|
+
function fe(e) {
|
|
984
|
+
if (e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex) return "immediate";
|
|
981
985
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
982
|
-
return !e.isActive && t
|
|
986
|
+
return !e.isActive && t ? "deferred" : "live";
|
|
987
|
+
}
|
|
988
|
+
function pe(e) {
|
|
989
|
+
return fe(e) !== "live";
|
|
983
990
|
}
|
|
984
991
|
//#endregion
|
|
985
992
|
//#region src/transition/createTransition.ts
|
|
986
|
-
function
|
|
993
|
+
function I({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
987
994
|
return {
|
|
988
995
|
name: e,
|
|
989
996
|
initial: t,
|
|
@@ -1004,7 +1011,7 @@ function P({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
1004
1011
|
}
|
|
1005
1012
|
//#endregion
|
|
1006
1013
|
//#region src/transition/createRawTransition.ts
|
|
1007
|
-
function
|
|
1014
|
+
function me({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
1008
1015
|
return {
|
|
1009
1016
|
name: e,
|
|
1010
1017
|
initial: t,
|
|
@@ -1025,10 +1032,15 @@ function he({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1025
1032
|
}
|
|
1026
1033
|
//#endregion
|
|
1027
1034
|
//#region src/transition/cupertino.ts
|
|
1028
|
-
var
|
|
1035
|
+
var he = (e, t, n) => {
|
|
1029
1036
|
let [r, i] = t, [a, o] = n;
|
|
1030
1037
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1031
|
-
},
|
|
1038
|
+
}, ge = 30, L = .7, R = [
|
|
1039
|
+
.32,
|
|
1040
|
+
.72,
|
|
1041
|
+
0,
|
|
1042
|
+
1
|
|
1043
|
+
], z = I({
|
|
1032
1044
|
name: "cupertino",
|
|
1033
1045
|
initial: { x: "100%" },
|
|
1034
1046
|
idle: {
|
|
@@ -1038,49 +1050,29 @@ var ge = (e, t, n) => {
|
|
|
1038
1050
|
enter: {
|
|
1039
1051
|
value: { x: 0 },
|
|
1040
1052
|
options: {
|
|
1041
|
-
duration:
|
|
1042
|
-
ease:
|
|
1043
|
-
.32,
|
|
1044
|
-
.72,
|
|
1045
|
-
0,
|
|
1046
|
-
1
|
|
1047
|
-
]
|
|
1053
|
+
duration: L,
|
|
1054
|
+
ease: R
|
|
1048
1055
|
}
|
|
1049
1056
|
},
|
|
1050
1057
|
enterBack: {
|
|
1051
1058
|
value: { x: "100%" },
|
|
1052
1059
|
options: {
|
|
1053
|
-
duration:
|
|
1054
|
-
ease:
|
|
1055
|
-
.32,
|
|
1056
|
-
.72,
|
|
1057
|
-
0,
|
|
1058
|
-
1
|
|
1059
|
-
]
|
|
1060
|
+
duration: L,
|
|
1061
|
+
ease: R
|
|
1060
1062
|
}
|
|
1061
1063
|
},
|
|
1062
1064
|
exit: {
|
|
1063
|
-
value: { x:
|
|
1065
|
+
value: { x: `-${ge}%` },
|
|
1064
1066
|
options: {
|
|
1065
|
-
duration:
|
|
1066
|
-
ease:
|
|
1067
|
-
.32,
|
|
1068
|
-
.72,
|
|
1069
|
-
0,
|
|
1070
|
-
1
|
|
1071
|
-
]
|
|
1067
|
+
duration: L,
|
|
1068
|
+
ease: R
|
|
1072
1069
|
}
|
|
1073
1070
|
},
|
|
1074
1071
|
exitBack: {
|
|
1075
1072
|
value: { x: 0 },
|
|
1076
1073
|
options: {
|
|
1077
|
-
duration:
|
|
1078
|
-
ease:
|
|
1079
|
-
.32,
|
|
1080
|
-
.72,
|
|
1081
|
-
0,
|
|
1082
|
-
1
|
|
1083
|
-
]
|
|
1074
|
+
duration: L,
|
|
1075
|
+
ease: R
|
|
1084
1076
|
}
|
|
1085
1077
|
},
|
|
1086
1078
|
options: {
|
|
@@ -1088,34 +1080,24 @@ var ge = (e, t, n) => {
|
|
|
1088
1080
|
swipeDirection: "x",
|
|
1089
1081
|
onSwipeStart: async () => !0,
|
|
1090
1082
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1091
|
-
let { offset: o } = t, s = o.x, c =
|
|
1092
|
-
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-
|
|
1083
|
+
let { offset: o } = t, s = o.x, c = he(s, [0, window.innerWidth], [0, 100]);
|
|
1084
|
+
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + ge / 100 * c}%` }, { duration: 0 }), c;
|
|
1093
1085
|
},
|
|
1094
1086
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
1095
1087
|
let { offset: o, velocity: s } = t, c = o.x > 50 || s.x > 20;
|
|
1096
1088
|
return a?.(c), await Promise.all([n(r, { x: c ? "100%" : 0 }, {
|
|
1097
1089
|
duration: .3,
|
|
1098
|
-
ease:
|
|
1099
|
-
|
|
1100
|
-
.72,
|
|
1101
|
-
0,
|
|
1102
|
-
1
|
|
1103
|
-
]
|
|
1104
|
-
}), n(i, { x: c ? 0 : "-35%" }, {
|
|
1090
|
+
ease: R
|
|
1091
|
+
}), n(i, { x: c ? 0 : `-${ge}%` }, {
|
|
1105
1092
|
duration: .3,
|
|
1106
|
-
ease:
|
|
1107
|
-
.32,
|
|
1108
|
-
.72,
|
|
1109
|
-
0,
|
|
1110
|
-
1
|
|
1111
|
-
]
|
|
1093
|
+
ease: R
|
|
1112
1094
|
})]), c;
|
|
1113
1095
|
}
|
|
1114
1096
|
}
|
|
1115
|
-
}),
|
|
1097
|
+
}), _e = (e, t, n) => {
|
|
1116
1098
|
let [r, i] = t, [a, o] = n;
|
|
1117
1099
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1118
|
-
},
|
|
1100
|
+
}, ve = I({
|
|
1119
1101
|
name: "layout",
|
|
1120
1102
|
initial: { opacity: .97 },
|
|
1121
1103
|
idle: {
|
|
@@ -1143,7 +1125,7 @@ var ge = (e, t, n) => {
|
|
|
1143
1125
|
swipeDirection: "y",
|
|
1144
1126
|
onSwipeStart: async () => !0,
|
|
1145
1127
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1146
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1128
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = _e(s, [0, 56], [1, .96]), l = Math.max(0, o - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, s + d), p = Math.min(56, f);
|
|
1147
1129
|
return i?.(!0, 100), n(r, {
|
|
1148
1130
|
y: f,
|
|
1149
1131
|
opacity: c
|
|
@@ -1160,7 +1142,7 @@ var ge = (e, t, n) => {
|
|
|
1160
1142
|
}, { duration: .3 })]), c;
|
|
1161
1143
|
}
|
|
1162
1144
|
}
|
|
1163
|
-
}),
|
|
1145
|
+
}), B = I({
|
|
1164
1146
|
name: "material",
|
|
1165
1147
|
initial: { y: "100%" },
|
|
1166
1148
|
idle: {
|
|
@@ -1268,7 +1250,7 @@ var ge = (e, t, n) => {
|
|
|
1268
1250
|
})]), c;
|
|
1269
1251
|
}
|
|
1270
1252
|
}
|
|
1271
|
-
}),
|
|
1253
|
+
}), ye = I({
|
|
1272
1254
|
name: "none",
|
|
1273
1255
|
initial: {},
|
|
1274
1256
|
idle: {
|
|
@@ -1291,16 +1273,16 @@ var ge = (e, t, n) => {
|
|
|
1291
1273
|
value: {},
|
|
1292
1274
|
options: { duration: 0 }
|
|
1293
1275
|
}
|
|
1294
|
-
}),
|
|
1295
|
-
["none",
|
|
1296
|
-
["cupertino",
|
|
1297
|
-
["material",
|
|
1298
|
-
["layout",
|
|
1276
|
+
}), V = /* @__PURE__ */ new Map([
|
|
1277
|
+
["none", ye],
|
|
1278
|
+
["cupertino", z],
|
|
1279
|
+
["material", B],
|
|
1280
|
+
["layout", ve]
|
|
1299
1281
|
]);
|
|
1300
1282
|
//#endregion
|
|
1301
1283
|
//#region src/transition/resolveTransition.ts
|
|
1302
1284
|
function be(e) {
|
|
1303
|
-
return
|
|
1285
|
+
return V.get(e) ?? V.get("none");
|
|
1304
1286
|
}
|
|
1305
1287
|
//#endregion
|
|
1306
1288
|
//#region src/transition/decorator/createDecorator.ts
|
|
@@ -1346,7 +1328,7 @@ function Se({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1346
1328
|
}
|
|
1347
1329
|
//#endregion
|
|
1348
1330
|
//#region src/transition/decorator/overlay.ts
|
|
1349
|
-
var Ce = "rgba(0, 0, 0, 0.
|
|
1331
|
+
var Ce = "rgba(0, 0, 0, 0.1)", we = xe({
|
|
1350
1332
|
name: "overlay",
|
|
1351
1333
|
initial: {
|
|
1352
1334
|
opacity: 0,
|
|
@@ -1364,24 +1346,24 @@ var Ce = "rgba(0, 0, 0, 0.2)", we = xe({
|
|
|
1364
1346
|
opacity: 1,
|
|
1365
1347
|
backgroundColor: Ce
|
|
1366
1348
|
},
|
|
1367
|
-
options: { duration: .
|
|
1349
|
+
options: { duration: .7 }
|
|
1368
1350
|
},
|
|
1369
1351
|
exit: {
|
|
1370
1352
|
value: {
|
|
1371
1353
|
opacity: 0,
|
|
1372
1354
|
backgroundColor: Ce
|
|
1373
1355
|
},
|
|
1374
|
-
options: { duration: .
|
|
1356
|
+
options: { duration: .7 }
|
|
1375
1357
|
},
|
|
1376
1358
|
options: {
|
|
1377
1359
|
onSwipeStart: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!!e }, { duration: .3 }),
|
|
1378
1360
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1379
1361
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1380
1362
|
}
|
|
1381
|
-
}),
|
|
1363
|
+
}), Te = /* @__PURE__ */ new Map([["overlay", we]]);
|
|
1382
1364
|
//#endregion
|
|
1383
1365
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1384
|
-
function
|
|
1366
|
+
function Ee({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1385
1367
|
return {
|
|
1386
1368
|
name: e,
|
|
1387
1369
|
initial: t,
|
|
@@ -1402,7 +1384,7 @@ function Te({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1402
1384
|
}
|
|
1403
1385
|
//#endregion
|
|
1404
1386
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1405
|
-
function
|
|
1387
|
+
function De({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1406
1388
|
return {
|
|
1407
1389
|
name: e,
|
|
1408
1390
|
initial: t,
|
|
@@ -1423,7 +1405,7 @@ function Ee({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1423
1405
|
}
|
|
1424
1406
|
//#endregion
|
|
1425
1407
|
//#region src/transition/partTransition/partTransition.ts
|
|
1426
|
-
var
|
|
1408
|
+
var H = /* @__PURE__ */ new Map(), Oe = {
|
|
1427
1409
|
"IDLE-true": "self",
|
|
1428
1410
|
"IDLE-false": "self",
|
|
1429
1411
|
"PUSHING-true": "initial",
|
|
@@ -1434,17 +1416,17 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1434
1416
|
"POPPING-false": "PUSHING-false",
|
|
1435
1417
|
"COMPLETED-true": "self",
|
|
1436
1418
|
"COMPLETED-false": "self"
|
|
1437
|
-
},
|
|
1419
|
+
}, ke = Object.keys(Oe), Ae = (e) => {
|
|
1438
1420
|
if (!e) return 0;
|
|
1439
1421
|
let t = e.duration;
|
|
1440
1422
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1441
|
-
},
|
|
1442
|
-
let n =
|
|
1423
|
+
}, je = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
|
|
1424
|
+
let n = Oe[t];
|
|
1443
1425
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1444
|
-
},
|
|
1445
|
-
let n =
|
|
1426
|
+
}, U = (e, t) => {
|
|
1427
|
+
let n = Me(e, t);
|
|
1446
1428
|
if (n === null) return null;
|
|
1447
|
-
let r = e.variants[t], i =
|
|
1429
|
+
let r = e.variants[t], i = Ae(r.options), a = je(r.options);
|
|
1448
1430
|
return i <= 0 && a <= 0 ? null : {
|
|
1449
1431
|
from: n,
|
|
1450
1432
|
to: r.value,
|
|
@@ -1452,7 +1434,7 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1452
1434
|
delay: a,
|
|
1453
1435
|
ease: r.options?.ease
|
|
1454
1436
|
};
|
|
1455
|
-
},
|
|
1437
|
+
}, Ne = ke, Pe = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Fe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ie = /* @__PURE__ */ new Set(/* @__PURE__ */ "opacity.scale.scaleX.scaleY.scaleZ.aspectRatio.columnCount.columns.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineHeight.lineClamp.order.orphans.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeWidth".split(".")), Le = (e, t) => t.startsWith("--") || Ie.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Re = (e, t) => typeof t == "number" ? Le(t, e) : typeof t == "string" ? t : "", ze = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Be = /* @__PURE__ */ new Set([
|
|
1456
1438
|
"x",
|
|
1457
1439
|
"y",
|
|
1458
1440
|
"z",
|
|
@@ -1463,7 +1445,7 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1463
1445
|
"rotateX",
|
|
1464
1446
|
"rotateY",
|
|
1465
1447
|
"rotateZ"
|
|
1466
|
-
]),
|
|
1448
|
+
]), Ve = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, He = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Ue = /^1(\.0+)?$/, We = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 || typeof t == "string" && Ue.test(t.trim()) : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 || typeof t == "string" && He.test(t.trim()) : t === 0 || typeof t == "string" && Ve.test(t.trim()), Ge = (e, t) => {
|
|
1467
1449
|
switch (e) {
|
|
1468
1450
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1469
1451
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1477,16 +1459,16 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1477
1459
|
case "rotateY": return `rotateY(${t})`;
|
|
1478
1460
|
default: return "";
|
|
1479
1461
|
}
|
|
1480
|
-
},
|
|
1462
|
+
}, Ke = (e) => {
|
|
1481
1463
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1482
|
-
if (!
|
|
1464
|
+
if (!Fe(e)) return;
|
|
1483
1465
|
let n = [];
|
|
1484
1466
|
for (let r of Object.keys(e)) {
|
|
1485
|
-
let i = e[r], a =
|
|
1486
|
-
if (a !== "") if (
|
|
1467
|
+
let i = e[r], a = Re(r, i);
|
|
1468
|
+
if (a !== "") if (Be.has(r)) n.push(`${r}:${a}`);
|
|
1487
1469
|
else {
|
|
1488
|
-
let e = t.get(
|
|
1489
|
-
e.add(a), t.set(
|
|
1470
|
+
let e = t.get(ze(r)) ?? /* @__PURE__ */ new Set();
|
|
1471
|
+
e.add(a), t.set(ze(r), e);
|
|
1490
1472
|
}
|
|
1491
1473
|
}
|
|
1492
1474
|
r.add(n.sort().join("|"));
|
|
@@ -1496,13 +1478,13 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1496
1478
|
n = r.size > 1;
|
|
1497
1479
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1498
1480
|
return n && a.push("transform"), a;
|
|
1499
|
-
},
|
|
1500
|
-
if (!
|
|
1481
|
+
}, W = (e) => {
|
|
1482
|
+
if (!Fe(e)) return [];
|
|
1501
1483
|
let t = [], n = !0, r = [];
|
|
1502
1484
|
for (let i of Object.keys(e)) {
|
|
1503
|
-
let a = e[i], o =
|
|
1504
|
-
o !== "" && (
|
|
1505
|
-
property:
|
|
1485
|
+
let a = e[i], o = Re(i, a);
|
|
1486
|
+
o !== "" && (Be.has(i) ? (t.push(Ge(i, o)), We(i, a) || (n = !1)) : r.push({
|
|
1487
|
+
property: ze(i),
|
|
1506
1488
|
value: o
|
|
1507
1489
|
}));
|
|
1508
1490
|
}
|
|
@@ -1510,7 +1492,7 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1510
1492
|
property: "transform",
|
|
1511
1493
|
value: n ? "none" : t.join(" ")
|
|
1512
1494
|
}), r;
|
|
1513
|
-
},
|
|
1495
|
+
}, qe = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), Je = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1514
1496
|
linear: "linear",
|
|
1515
1497
|
easeIn: "ease-in",
|
|
1516
1498
|
easeOut: "ease-out",
|
|
@@ -1520,29 +1502,29 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1520
1502
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1521
1503
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1522
1504
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1523
|
-
}[e] ?? "ease" : "ease",
|
|
1505
|
+
}[e] ?? "ease" : "ease", Ye = (e, t) => {
|
|
1524
1506
|
let [n, r] = t.split("-");
|
|
1525
1507
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1526
|
-
},
|
|
1508
|
+
}, Xe = (e, t) => {
|
|
1527
1509
|
let [n, r] = t.split("-");
|
|
1528
1510
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1529
|
-
},
|
|
1511
|
+
}, Ze = (e, t) => {
|
|
1530
1512
|
let [n, r] = t.split("-");
|
|
1531
1513
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1532
|
-
},
|
|
1514
|
+
}, Qe = (e, t) => {
|
|
1533
1515
|
let [n, r] = t.split("-");
|
|
1534
1516
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1535
|
-
},
|
|
1536
|
-
let o =
|
|
1517
|
+
}, G = (e, t, n) => `flemo-${e}-${Pe(t)}-${n}`, $e = (e, t, n, r, i, a) => {
|
|
1518
|
+
let o = W(r), s = W(i.value), c = Ae(i.options), l = je(i.options), u = Je(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Ze(t, n)}` : d;
|
|
1537
1519
|
if (s.length === 0 && o.length === 0) return "";
|
|
1538
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1539
|
-
let p =
|
|
1520
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${qe(s)}\n animation: none;\n}`;
|
|
1521
|
+
let p = G(e, t, n), m = [
|
|
1540
1522
|
`@keyframes ${p} {`,
|
|
1541
1523
|
" from {",
|
|
1542
|
-
|
|
1524
|
+
qe(o).replace(/^/gm, " "),
|
|
1543
1525
|
" }",
|
|
1544
1526
|
" to {",
|
|
1545
|
-
|
|
1527
|
+
qe(s).replace(/^/gm, " "),
|
|
1546
1528
|
" }",
|
|
1547
1529
|
"}"
|
|
1548
1530
|
].join("\n"), h = [
|
|
@@ -1552,59 +1534,59 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1552
1534
|
l > 0 ? `${l}s` : null,
|
|
1553
1535
|
"both"
|
|
1554
1536
|
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(/* @__PURE__ */ new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1555
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") &&
|
|
1556
|
-
},
|
|
1537
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && et(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${qe(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && et(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${qe(s)}\n}` : ""}`;
|
|
1538
|
+
}, et = (e) => {
|
|
1557
1539
|
if (!e) return !1;
|
|
1558
1540
|
if (e.opacity === 0) return !0;
|
|
1559
1541
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1560
1542
|
return t(e.x) || t(e.y);
|
|
1561
|
-
},
|
|
1562
|
-
let i =
|
|
1563
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1564
|
-
},
|
|
1543
|
+
}, tt = (e, t, n, r) => {
|
|
1544
|
+
let i = W(r.value);
|
|
1545
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${qe(i)}\n}`;
|
|
1546
|
+
}, nt = (e, t, n = []) => {
|
|
1565
1547
|
let r = [];
|
|
1566
1548
|
for (let t of e) {
|
|
1567
1549
|
let e = t.name;
|
|
1568
|
-
for (let n of
|
|
1569
|
-
let i = t.variants[n], a =
|
|
1550
|
+
for (let n of ke) {
|
|
1551
|
+
let i = t.variants[n], a = Oe[n];
|
|
1570
1552
|
if (a === "self") {
|
|
1571
|
-
r.push(
|
|
1553
|
+
r.push(tt(Ye, e, n, i));
|
|
1572
1554
|
continue;
|
|
1573
1555
|
}
|
|
1574
1556
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1575
|
-
r.push(
|
|
1557
|
+
r.push($e("screen", e, n, o, i, Ye));
|
|
1576
1558
|
}
|
|
1577
1559
|
}
|
|
1578
1560
|
for (let e of t) {
|
|
1579
1561
|
let t = e.name;
|
|
1580
|
-
for (let n of
|
|
1581
|
-
let i = e.variants[n], a =
|
|
1562
|
+
for (let n of Ne) {
|
|
1563
|
+
let i = e.variants[n], a = Oe[n];
|
|
1582
1564
|
if (a === "self") {
|
|
1583
|
-
r.push(
|
|
1565
|
+
r.push(tt(Xe, t, n, i));
|
|
1584
1566
|
continue;
|
|
1585
1567
|
}
|
|
1586
1568
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1587
|
-
r.push(
|
|
1569
|
+
r.push($e("decorator", t, n, o, i, Xe));
|
|
1588
1570
|
}
|
|
1589
1571
|
}
|
|
1590
1572
|
for (let e of n) {
|
|
1591
1573
|
let t = e.name;
|
|
1592
|
-
for (let n of
|
|
1593
|
-
let i = e.variants[n], a =
|
|
1574
|
+
for (let n of Ne) {
|
|
1575
|
+
let i = e.variants[n], a = Oe[n];
|
|
1594
1576
|
if (a === "self") {
|
|
1595
|
-
r.push(Qe
|
|
1577
|
+
r.push(tt(Qe, t, n, i));
|
|
1596
1578
|
continue;
|
|
1597
1579
|
}
|
|
1598
1580
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1599
|
-
r.push(
|
|
1581
|
+
r.push($e("part", t, n, o, i, Qe));
|
|
1600
1582
|
}
|
|
1601
1583
|
}
|
|
1602
1584
|
return [
|
|
1603
1585
|
...r.filter((e) => e.length > 0),
|
|
1604
|
-
|
|
1605
|
-
|
|
1586
|
+
rt,
|
|
1587
|
+
it
|
|
1606
1588
|
].join("\n\n");
|
|
1607
|
-
},
|
|
1589
|
+
}, rt = [
|
|
1608
1590
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1609
1591
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1610
1592
|
"[data-flemo-anim-hold=\"park-under\"],",
|
|
@@ -1613,45 +1595,45 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1613
1595
|
"[data-flemo-anim-hold=\"park-under\"] [data-flemo-part-name] {",
|
|
1614
1596
|
" animation-play-state: paused !important;",
|
|
1615
1597
|
"}"
|
|
1616
|
-
].join("\n"),
|
|
1598
|
+
].join("\n"), it = [
|
|
1617
1599
|
"[data-flemo-held-arrival] {",
|
|
1618
1600
|
" display: none !important;",
|
|
1619
1601
|
"}"
|
|
1620
|
-
].join("\n"),
|
|
1621
|
-
let n =
|
|
1602
|
+
].join("\n"), K = (e, t) => {
|
|
1603
|
+
let n = Oe[t];
|
|
1622
1604
|
if (n === "self") return !1;
|
|
1623
|
-
let r = e.variants[t], i =
|
|
1605
|
+
let r = e.variants[t], i = Ae(r.options), a = je(r.options);
|
|
1624
1606
|
if (i <= 0 && a <= 0) return !1;
|
|
1625
|
-
let o =
|
|
1607
|
+
let o = W(n === "initial" ? e.initial : e.variants[n].value), s = W(r.value);
|
|
1626
1608
|
return o.length > 0 || s.length > 0;
|
|
1627
|
-
},
|
|
1628
|
-
function
|
|
1609
|
+
}, at = "data-flemo";
|
|
1610
|
+
function ot() {
|
|
1629
1611
|
if (f()) return;
|
|
1630
|
-
let e =
|
|
1631
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1612
|
+
let e = nt(V.values(), Te.values(), H.values()), t = document.head.querySelector(`style[${at}]`);
|
|
1613
|
+
t || (t = document.createElement("style"), t.setAttribute(at, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1632
1614
|
}
|
|
1633
1615
|
//#endregion
|
|
1634
1616
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1635
|
-
var
|
|
1617
|
+
var st = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Map(), ut = (e, t) => {
|
|
1636
1618
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1637
|
-
},
|
|
1619
|
+
}, dt = (e, t) => {
|
|
1638
1620
|
let n = (e.get(t) ?? 1) - 1;
|
|
1639
1621
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1640
1622
|
};
|
|
1641
|
-
function
|
|
1642
|
-
for (let t of e)
|
|
1643
|
-
for (let e of t)
|
|
1644
|
-
for (let e of n)
|
|
1645
|
-
return
|
|
1646
|
-
for (let t of e)
|
|
1647
|
-
for (let e of t) ct
|
|
1648
|
-
for (let e of n)
|
|
1649
|
-
|
|
1623
|
+
function ft(e, t, n = []) {
|
|
1624
|
+
for (let t of e) V.set(t.name, t), ut(st, t.name);
|
|
1625
|
+
for (let e of t) Te.set(e.name, e), ut(ct, e.name);
|
|
1626
|
+
for (let e of n) H.set(e.name, e), ut(lt, e.name);
|
|
1627
|
+
return ot(), () => {
|
|
1628
|
+
for (let t of e) dt(st, t.name) && V.delete(t.name);
|
|
1629
|
+
for (let e of t) dt(ct, e.name) && Te.delete(e.name);
|
|
1630
|
+
for (let e of n) dt(lt, e.name) && H.delete(e.name);
|
|
1631
|
+
ot();
|
|
1650
1632
|
};
|
|
1651
1633
|
}
|
|
1652
1634
|
//#endregion
|
|
1653
1635
|
//#region src/transition/enteringInitialStyle.ts
|
|
1654
|
-
function
|
|
1636
|
+
function pt(e) {
|
|
1655
1637
|
let { initial: t, isActive: n, status: r } = e;
|
|
1656
1638
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1657
1639
|
let i = {};
|
|
@@ -1659,10 +1641,10 @@ function ut(e) {
|
|
|
1659
1641
|
}
|
|
1660
1642
|
//#endregion
|
|
1661
1643
|
//#region src/transition/settleScrub.ts
|
|
1662
|
-
var
|
|
1644
|
+
var mt = () => ({
|
|
1663
1645
|
request: (e) => requestAnimationFrame(e),
|
|
1664
1646
|
cancel: (e) => cancelAnimationFrame(e)
|
|
1665
|
-
}),
|
|
1647
|
+
}), ht = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), gt = ((e = mt()) => {
|
|
1666
1648
|
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1667
1649
|
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1668
1650
|
}, i = (e, n) => {
|
|
@@ -1695,7 +1677,7 @@ var dt = () => ({
|
|
|
1695
1677
|
if (typeof r.animate != "function") return null;
|
|
1696
1678
|
i(r, "current");
|
|
1697
1679
|
let l = {};
|
|
1698
|
-
for (let e of o) l[
|
|
1680
|
+
for (let e of o) l[ht(e.property)] = e.value;
|
|
1699
1681
|
let u;
|
|
1700
1682
|
try {
|
|
1701
1683
|
u = r.animate([l], {
|
|
@@ -1725,55 +1707,56 @@ var dt = () => ({
|
|
|
1725
1707
|
takeover: (e) => i(e, "current"),
|
|
1726
1708
|
cancel: (e) => i(e, "drop")
|
|
1727
1709
|
};
|
|
1728
|
-
})(),
|
|
1710
|
+
})(), _t = "flemo:motion-driver", vt = "flemo:motion-driver-force", yt = !1, bt = () => {
|
|
1729
1711
|
try {
|
|
1730
1712
|
try {
|
|
1731
|
-
typeof localStorage < "u" && localStorage.removeItem(
|
|
1713
|
+
typeof localStorage < "u" && localStorage.removeItem(vt);
|
|
1732
1714
|
} catch {}
|
|
1733
1715
|
if (typeof sessionStorage > "u") return null;
|
|
1734
|
-
let e = sessionStorage.getItem(
|
|
1716
|
+
let e = sessionStorage.getItem(vt);
|
|
1735
1717
|
if (e === null) return null;
|
|
1736
1718
|
let [t, n] = e.split("@"), r = Number(n);
|
|
1737
|
-
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!
|
|
1719
|
+
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!yt && typeof console < "u" && (yt = !0, console.warn(`[flemo] motion driver pinned to "${t}" via sessionStorage ${vt}; remove the key to restore automatic selection (pins expire after 24h).`)), t) : (sessionStorage.removeItem(vt), null);
|
|
1738
1720
|
} catch {
|
|
1739
1721
|
return null;
|
|
1740
1722
|
}
|
|
1741
|
-
},
|
|
1723
|
+
}, xt = () => ({
|
|
1742
1724
|
read: () => {
|
|
1743
1725
|
try {
|
|
1744
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
1726
|
+
return typeof localStorage < "u" ? localStorage.getItem(_t) : null;
|
|
1745
1727
|
} catch {
|
|
1746
1728
|
return null;
|
|
1747
1729
|
}
|
|
1748
1730
|
},
|
|
1749
1731
|
write: (e) => {
|
|
1750
1732
|
try {
|
|
1751
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
1733
|
+
typeof localStorage < "u" && localStorage.setItem(_t, e);
|
|
1752
1734
|
} catch {}
|
|
1753
1735
|
}
|
|
1754
|
-
}),
|
|
1736
|
+
}), St = 30, Ct = 2, wt = 2, Tt = () => typeof navigator < "u" && !!navigator.userAgentData, Et = (e = xt(), t = !1, n = !0) => {
|
|
1755
1737
|
let r = n && e.read() === "css", i = r;
|
|
1756
1738
|
r &&= !1;
|
|
1757
1739
|
let a = 0, o = 0, s = [];
|
|
1758
1740
|
return {
|
|
1759
1741
|
playerAllowed: () => {
|
|
1760
|
-
let e =
|
|
1742
|
+
let e = bt();
|
|
1761
1743
|
return e ? e === "raf" : t && !r;
|
|
1762
1744
|
},
|
|
1745
|
+
pinnedDriver: bt,
|
|
1763
1746
|
beginRun: () => {
|
|
1764
1747
|
o = 0, s = [];
|
|
1765
1748
|
},
|
|
1766
1749
|
reportGap: (e) => {
|
|
1767
|
-
s.push(e), e >=
|
|
1750
|
+
s.push(e), e >= St && (o += 1);
|
|
1768
1751
|
},
|
|
1769
1752
|
endRun: () => {
|
|
1770
|
-
let t = o >=
|
|
1753
|
+
let t = o >= Ct;
|
|
1771
1754
|
if (t && (a += 1), n) {
|
|
1772
1755
|
if (i) {
|
|
1773
1756
|
i = !1, t ? r = !0 : e.write("raf");
|
|
1774
1757
|
return;
|
|
1775
1758
|
}
|
|
1776
|
-
t && a >=
|
|
1759
|
+
t && a >= wt && !r && (r = !0, e.write("css"));
|
|
1777
1760
|
}
|
|
1778
1761
|
},
|
|
1779
1762
|
stats: () => ({
|
|
@@ -1782,43 +1765,43 @@ var dt = () => ({
|
|
|
1782
1765
|
demoted: r
|
|
1783
1766
|
})
|
|
1784
1767
|
};
|
|
1785
|
-
},
|
|
1786
|
-
let n =
|
|
1787
|
-
n || (n = /* @__PURE__ */ new Set(),
|
|
1788
|
-
},
|
|
1789
|
-
if (
|
|
1790
|
-
let n =
|
|
1768
|
+
}, Dt = Tt() ? Et() : Et(xt(), !0, !1), Ot = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, kt = /* @__PURE__ */ new WeakMap(), q = (e, t) => {
|
|
1769
|
+
let n = kt.get(e);
|
|
1770
|
+
n || (n = /* @__PURE__ */ new Set(), kt.set(e, n)), n.add(t);
|
|
1771
|
+
}, J = (e, t) => {
|
|
1772
|
+
if (gt.cancel(e), e.style.transition = "", e.style.removeProperty("animation-delay"), t) {
|
|
1773
|
+
let n = kt.get(e);
|
|
1791
1774
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1792
1775
|
return;
|
|
1793
1776
|
}
|
|
1794
|
-
let n =
|
|
1777
|
+
let n = kt.get(e);
|
|
1795
1778
|
if (n && n.size > 0) {
|
|
1796
1779
|
for (let t of n) e.style.removeProperty(t);
|
|
1797
1780
|
n.clear();
|
|
1798
1781
|
return;
|
|
1799
1782
|
}
|
|
1800
1783
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1801
|
-
},
|
|
1802
|
-
if (!
|
|
1803
|
-
let r = e, i =
|
|
1784
|
+
}, Y = (e, t, n = {}) => {
|
|
1785
|
+
if (!Ot(e)) return Promise.resolve();
|
|
1786
|
+
let r = e, i = W(t);
|
|
1804
1787
|
if (i.length === 0) return Promise.resolve();
|
|
1805
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1788
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = Je(n.ease);
|
|
1806
1789
|
if (a <= 0 && o <= 0) {
|
|
1807
|
-
|
|
1808
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1790
|
+
gt.takeover(r), r.style.transition = "none";
|
|
1791
|
+
for (let e of i) r.style.setProperty(e.property, e.value), q(r, e.property);
|
|
1809
1792
|
return Promise.resolve();
|
|
1810
1793
|
}
|
|
1811
|
-
let c =
|
|
1794
|
+
let c = Dt.playerAllowed() ? gt.settle(r, i, {
|
|
1812
1795
|
durationMs: a * 1e3,
|
|
1813
1796
|
delayMs: o * 1e3,
|
|
1814
1797
|
easing: s
|
|
1815
1798
|
}, (e) => {
|
|
1816
|
-
r.style.setProperty(e.property, e.value),
|
|
1799
|
+
r.style.setProperty(e.property, e.value), q(r, e.property);
|
|
1817
1800
|
}) : null;
|
|
1818
1801
|
if (c) return c;
|
|
1819
1802
|
let l = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1820
1803
|
r.style.transition = l, r.offsetWidth;
|
|
1821
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1804
|
+
for (let e of i) r.style.setProperty(e.property, e.value), q(r, e.property);
|
|
1822
1805
|
return new Promise((e) => {
|
|
1823
1806
|
let t = !1, n = () => {
|
|
1824
1807
|
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
@@ -1827,12 +1810,12 @@ var dt = () => ({
|
|
|
1827
1810
|
};
|
|
1828
1811
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1829
1812
|
});
|
|
1830
|
-
},
|
|
1831
|
-
function
|
|
1813
|
+
}, At = "data-flemo-held-arrival";
|
|
1814
|
+
function jt(e) {
|
|
1832
1815
|
if (typeof MutationObserver > "u") return () => {};
|
|
1833
1816
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = (t) => {
|
|
1834
1817
|
let n = t instanceof Element ? t : t.parentElement;
|
|
1835
|
-
return !n || n === e || n.closest(`[data-flemo-part-name], [${
|
|
1818
|
+
return !n || n === e || n.closest(`[data-flemo-part-name], [${At}]`) !== null;
|
|
1836
1819
|
}, s = (e, t, n, r) => e ? n === e.glass ? (e.pendingEcho ? e.pendingEcho = !1 : e.latest = n, e) : (e.latest = n, r(e.glass), e.pendingEcho = !0, e) : n === t ? null : (r(t), {
|
|
1837
1820
|
glass: t,
|
|
1838
1821
|
latest: n,
|
|
@@ -1862,12 +1845,12 @@ function Ot(e) {
|
|
|
1862
1845
|
if (i.type === "childList") {
|
|
1863
1846
|
for (let e of Array.from(i.removedNodes)) if (!n.has(e)) {
|
|
1864
1847
|
if (e instanceof Element && t.delete(e)) {
|
|
1865
|
-
e.removeAttribute(
|
|
1848
|
+
e.removeAttribute(At);
|
|
1866
1849
|
continue;
|
|
1867
1850
|
}
|
|
1868
1851
|
(e instanceof Element || e.nodeType === Node.TEXT_NODE) && l(i.target).removed.push(e);
|
|
1869
1852
|
}
|
|
1870
|
-
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(
|
|
1853
|
+
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(At, ""), t.add(e), l(i.target).added.push(e));
|
|
1871
1854
|
}
|
|
1872
1855
|
}
|
|
1873
1856
|
for (let [e, t] of u) {
|
|
@@ -1902,7 +1885,7 @@ function Ot(e) {
|
|
|
1902
1885
|
c.disconnect();
|
|
1903
1886
|
for (let e of n) e.parentNode?.removeChild(e);
|
|
1904
1887
|
n.clear();
|
|
1905
|
-
for (let e of t) e.removeAttribute(
|
|
1888
|
+
for (let e of t) e.removeAttribute(At);
|
|
1906
1889
|
t.clear();
|
|
1907
1890
|
for (let [e, t] of i) e.isConnected && (e.nodeValue = t.latest);
|
|
1908
1891
|
i.clear();
|
|
@@ -1912,34 +1895,81 @@ function Ot(e) {
|
|
|
1912
1895
|
}
|
|
1913
1896
|
//#endregion
|
|
1914
1897
|
//#region src/core/engine/compositorWarmUp.ts
|
|
1915
|
-
var
|
|
1898
|
+
var Mt = "data-flemo-warm", Nt = 3e3, Pt = [{ transform: "translate3d(0, 0, 0)" }, { transform: "translate3d(1px, 0, 0)" }], Ft = {
|
|
1916
1899
|
duration: 500,
|
|
1917
1900
|
iterations: Infinity,
|
|
1918
1901
|
direction: "alternate",
|
|
1919
1902
|
easing: "linear"
|
|
1920
|
-
},
|
|
1921
|
-
|
|
1903
|
+
}, It = "position:fixed;top:0;left:0;width:1px;height:1px;pointer-events:none;opacity:0.02;background:#888;will-change:transform;", X = null, Lt = null, Rt = 0, zt = () => {
|
|
1904
|
+
Rt = 0, Lt?.cancel(), Lt = null, X?.remove(), X = null;
|
|
1922
1905
|
};
|
|
1923
|
-
function
|
|
1906
|
+
function Bt() {
|
|
1924
1907
|
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function") return () => {};
|
|
1925
|
-
if (
|
|
1926
|
-
|
|
1908
|
+
if (Rt += 1, !X) {
|
|
1909
|
+
X = document.createElement("div"), X.setAttribute(Mt, ""), X.setAttribute("aria-hidden", "true"), X.setAttribute("style", It), document.body.appendChild(X);
|
|
1927
1910
|
try {
|
|
1928
|
-
|
|
1911
|
+
Lt = X.animate(Pt, Ft);
|
|
1929
1912
|
} catch {
|
|
1930
|
-
|
|
1913
|
+
Lt = null;
|
|
1931
1914
|
}
|
|
1932
1915
|
}
|
|
1933
1916
|
let e = !1, t = setTimeout(() => {
|
|
1934
|
-
e || (e = !0, --
|
|
1935
|
-
},
|
|
1917
|
+
e || (e = !0, --Rt, Rt <= 0 && zt());
|
|
1918
|
+
}, Nt);
|
|
1936
1919
|
return () => {
|
|
1937
|
-
e || (e = !0, clearTimeout(t), --
|
|
1920
|
+
e || (e = !0, clearTimeout(t), --Rt, Rt <= 0 && zt());
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
//#endregion
|
|
1924
|
+
//#region src/core/engine/invisibleAnimationHold.ts
|
|
1925
|
+
var Vt = () => {}, Ht = .004, Ut = (e, t) => {
|
|
1926
|
+
let n = e.ownerDocument?.defaultView;
|
|
1927
|
+
if (!n) return !1;
|
|
1928
|
+
let r = e;
|
|
1929
|
+
for (; r;) {
|
|
1930
|
+
if (Number(n.getComputedStyle(r).opacity) <= Ht) return !0;
|
|
1931
|
+
if (r === t) break;
|
|
1932
|
+
r = r.parentElement;
|
|
1933
|
+
}
|
|
1934
|
+
return !1;
|
|
1935
|
+
};
|
|
1936
|
+
function Wt(e) {
|
|
1937
|
+
if (typeof e.getAnimations != "function") return Vt;
|
|
1938
|
+
let t = /* @__PURE__ */ new Set(), n = () => {
|
|
1939
|
+
for (let n of e.getAnimations({ subtree: !0 })) {
|
|
1940
|
+
if (t.size >= 128) return;
|
|
1941
|
+
if (t.has(n) || (n.animationName ?? "").startsWith("flemo-") || n.playState !== "running") continue;
|
|
1942
|
+
let r = n.effect?.target;
|
|
1943
|
+
if (r instanceof Element && Ut(r, e)) try {
|
|
1944
|
+
n.pause(), t.add(n);
|
|
1945
|
+
} catch {}
|
|
1946
|
+
}
|
|
1947
|
+
}, r = null, i = () => {
|
|
1948
|
+
if (typeof requestAnimationFrame != "function") {
|
|
1949
|
+
n();
|
|
1950
|
+
return;
|
|
1951
|
+
}
|
|
1952
|
+
r === null && (r = requestAnimationFrame(() => {
|
|
1953
|
+
r = null, n();
|
|
1954
|
+
}));
|
|
1955
|
+
};
|
|
1956
|
+
i();
|
|
1957
|
+
let a = typeof MutationObserver == "function" ? new MutationObserver(i) : null;
|
|
1958
|
+
return a?.observe(e, {
|
|
1959
|
+
subtree: !0,
|
|
1960
|
+
childList: !0,
|
|
1961
|
+
attributes: !0
|
|
1962
|
+
}), () => {
|
|
1963
|
+
a?.disconnect(), r !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(r), r = null);
|
|
1964
|
+
for (let e of t) try {
|
|
1965
|
+
e.play();
|
|
1966
|
+
} catch {}
|
|
1967
|
+
t.clear();
|
|
1938
1968
|
};
|
|
1939
1969
|
}
|
|
1940
1970
|
//#endregion
|
|
1941
1971
|
//#region src/transition/cubicBezier.ts
|
|
1942
|
-
var
|
|
1972
|
+
var Gt = (e, t, n, r) => {
|
|
1943
1973
|
let i = (t) => 3 * (1 - t) * (1 - t) * t * e + 3 * (1 - t) * t * t * n + t ** 3, a = (e) => 3 * (1 - e) * (1 - e) * e * t + 3 * (1 - e) * e * e * r + e ** 3;
|
|
1944
1974
|
return (e) => {
|
|
1945
1975
|
if (e <= 0) return 0;
|
|
@@ -1951,7 +1981,7 @@ var Lt = (e, t, n, r) => {
|
|
|
1951
1981
|
}
|
|
1952
1982
|
return a((t + n) / 2);
|
|
1953
1983
|
};
|
|
1954
|
-
},
|
|
1984
|
+
}, Kt = (e) => e, qt = {
|
|
1955
1985
|
ease: [
|
|
1956
1986
|
.25,
|
|
1957
1987
|
.1,
|
|
@@ -2006,20 +2036,20 @@ var Lt = (e, t, n, r) => {
|
|
|
2006
2036
|
.66,
|
|
2007
2037
|
-.56
|
|
2008
2038
|
]
|
|
2009
|
-
},
|
|
2039
|
+
}, Jt = (e) => {
|
|
2010
2040
|
if (Array.isArray(e)) {
|
|
2011
2041
|
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
2012
2042
|
let [t, n, r, i] = e;
|
|
2013
|
-
return
|
|
2043
|
+
return Gt(t, n, r, i);
|
|
2014
2044
|
}
|
|
2015
|
-
return
|
|
2045
|
+
return Kt;
|
|
2016
2046
|
}
|
|
2017
|
-
return typeof e == "string" ? e === "linear" ?
|
|
2018
|
-
},
|
|
2047
|
+
return typeof e == "string" ? e === "linear" ? Kt : Gt(...qt[e] ?? qt.ease) : Gt(...qt.ease);
|
|
2048
|
+
}, Yt = 1 / 255, Xt = 400, Zt = 24, Qt = /* @__PURE__ */ new Set([
|
|
2019
2049
|
"x",
|
|
2020
2050
|
"y",
|
|
2021
2051
|
"opacity"
|
|
2022
|
-
]),
|
|
2052
|
+
]), $t = (e, t, n) => {
|
|
2023
2053
|
if (!e || typeof e != "object") return;
|
|
2024
2054
|
let r = e[t];
|
|
2025
2055
|
if (r === void 0) return;
|
|
@@ -2037,31 +2067,33 @@ var Lt = (e, t, n, r) => {
|
|
|
2037
2067
|
return Number.isNaN(e) ? null : e;
|
|
2038
2068
|
}
|
|
2039
2069
|
return null;
|
|
2040
|
-
},
|
|
2070
|
+
}, en = (e, t, n) => {
|
|
2041
2071
|
let r = /* @__PURE__ */ new Set();
|
|
2042
2072
|
for (let t of [e.from, e.to]) if (!(!t || typeof t != "object")) for (let e of Object.keys(t)) r.add(e);
|
|
2043
2073
|
if (r.size === 0) return null;
|
|
2044
2074
|
let i = Infinity;
|
|
2045
2075
|
for (let a of r) {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
if (
|
|
2049
|
-
let s =
|
|
2050
|
-
if (s === 0)
|
|
2051
|
-
let
|
|
2052
|
-
|
|
2076
|
+
let r = e.from && typeof e.from == "object" ? e.from[a] : void 0, o = e.to && typeof e.to == "object" ? e.to[a] : void 0;
|
|
2077
|
+
if (r !== void 0 && r === o) continue;
|
|
2078
|
+
if (!Qt.has(a)) return null;
|
|
2079
|
+
let s = $t(e.from, a, t), c = $t(e.to, a, t);
|
|
2080
|
+
if (s === null || c === null || s === void 0 || c === void 0) return null;
|
|
2081
|
+
let l = Math.abs(c - s);
|
|
2082
|
+
if (l === 0) continue;
|
|
2083
|
+
let u = a === "opacity" ? Yt : 1 / Math.max(1, n);
|
|
2084
|
+
i = Math.min(i, u / l);
|
|
2053
2085
|
}
|
|
2054
2086
|
return !Number.isFinite(i) || i <= 0 || i >= 1 ? null : i;
|
|
2055
|
-
},
|
|
2087
|
+
}, tn = (e, t, n) => {
|
|
2056
2088
|
if (e.duration <= 0) return null;
|
|
2057
|
-
let r =
|
|
2089
|
+
let r = en(e, t, n);
|
|
2058
2090
|
if (r === null) return null;
|
|
2059
|
-
let i =
|
|
2060
|
-
for (let e =
|
|
2091
|
+
let i = Jt(e.ease), a = Xt;
|
|
2092
|
+
for (let e = Xt; e >= 0 && !(Math.abs(1 - i(e / Xt)) > r); --e) a = e;
|
|
2061
2093
|
if (a === 0) return null;
|
|
2062
|
-
let o = (e.delay + e.duration * (a /
|
|
2063
|
-
return (e.delay + e.duration) * 1e3 - o <
|
|
2064
|
-
},
|
|
2094
|
+
let o = (e.delay + e.duration * (a / Xt)) * 1e3;
|
|
2095
|
+
return (e.delay + e.duration) * 1e3 - o < Zt ? null : o;
|
|
2096
|
+
}, nn = [
|
|
2065
2097
|
"x",
|
|
2066
2098
|
"y",
|
|
2067
2099
|
"z",
|
|
@@ -2072,7 +2104,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2072
2104
|
"rotateX",
|
|
2073
2105
|
"rotateY",
|
|
2074
2106
|
"rotateZ"
|
|
2075
|
-
],
|
|
2107
|
+
], rn = new Set(nn), an = {
|
|
2076
2108
|
x: 0,
|
|
2077
2109
|
y: 0,
|
|
2078
2110
|
z: 0,
|
|
@@ -2083,7 +2115,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2083
2115
|
rotateX: 0,
|
|
2084
2116
|
rotateY: 0,
|
|
2085
2117
|
rotateZ: 0
|
|
2086
|
-
},
|
|
2118
|
+
}, on = (e, t) => {
|
|
2087
2119
|
if (typeof t == "number") return {
|
|
2088
2120
|
value: t,
|
|
2089
2121
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -2102,26 +2134,26 @@ var Lt = (e, t, n, r) => {
|
|
|
2102
2134
|
value: i,
|
|
2103
2135
|
unit: a === "" && i === 0 ? "px" : a
|
|
2104
2136
|
};
|
|
2105
|
-
},
|
|
2106
|
-
let n = e.match(
|
|
2107
|
-
if (n.length !== r.length || e.replace(
|
|
2137
|
+
}, sn = /-?\d*\.?\d+/g, cn = (e, t) => {
|
|
2138
|
+
let n = e.match(sn) ?? [], r = t.match(sn) ?? [];
|
|
2139
|
+
if (n.length !== r.length || e.replace(sn, " ") !== t.replace(sn, " ")) return null;
|
|
2108
2140
|
let i = n.map(Number), a = r.map(Number);
|
|
2109
2141
|
return (t) => {
|
|
2110
2142
|
let n = 0;
|
|
2111
|
-
return e.replace(
|
|
2143
|
+
return e.replace(sn, () => {
|
|
2112
2144
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
2113
2145
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
2114
2146
|
});
|
|
2115
2147
|
};
|
|
2116
|
-
},
|
|
2117
|
-
let n = /* @__PURE__ */ new Set([...
|
|
2148
|
+
}, ln = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), un = (e) => typeof e == "object" && !!e && !Array.isArray(e), dn = (e) => un(e) ? Object.keys(e) : [], fn = (e, t) => un(e) ? e[t] : void 0, pn = (e, t) => {
|
|
2149
|
+
let n = /* @__PURE__ */ new Set([...dn(e.from), ...dn(e.to)]), r = [], i = null, a = [], o = [];
|
|
2118
2150
|
for (let s of n) {
|
|
2119
|
-
let n =
|
|
2120
|
-
if (
|
|
2151
|
+
let n = fn(e.from, s), c = fn(e.to, s);
|
|
2152
|
+
if (rn.has(s)) {
|
|
2121
2153
|
let e = s, i = {
|
|
2122
|
-
value:
|
|
2154
|
+
value: an[e],
|
|
2123
2155
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
2124
|
-
}, a = n === void 0 ? i :
|
|
2156
|
+
}, a = n === void 0 ? i : on(e, n), o = c === void 0 ? i : on(e, c);
|
|
2125
2157
|
if (!a || !o || a.unit !== o.unit && a.value !== 0 && o.value !== 0) return null;
|
|
2126
2158
|
let l = a.value === 0 && a.unit !== o.unit ? o.unit : a.unit, u = l === "%", d = 0;
|
|
2127
2159
|
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), r.push({
|
|
@@ -2152,15 +2184,15 @@ var Lt = (e, t, n, r) => {
|
|
|
2152
2184
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
2153
2185
|
if (l === u) {
|
|
2154
2186
|
o.push({
|
|
2155
|
-
property:
|
|
2187
|
+
property: ln(s),
|
|
2156
2188
|
value: l
|
|
2157
2189
|
});
|
|
2158
2190
|
continue;
|
|
2159
2191
|
}
|
|
2160
|
-
let d =
|
|
2192
|
+
let d = cn(l, u);
|
|
2161
2193
|
if (!d) return null;
|
|
2162
2194
|
a.push({
|
|
2163
|
-
property:
|
|
2195
|
+
property: ln(s),
|
|
2164
2196
|
mix: d
|
|
2165
2197
|
});
|
|
2166
2198
|
}
|
|
@@ -2170,46 +2202,64 @@ var Lt = (e, t, n, r) => {
|
|
|
2170
2202
|
strings: a,
|
|
2171
2203
|
constants: o
|
|
2172
2204
|
};
|
|
2173
|
-
},
|
|
2205
|
+
}, mn = 1, hn, gn = () => {
|
|
2206
|
+
if (hn !== void 0) return hn;
|
|
2207
|
+
try {
|
|
2208
|
+
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:apply") : null;
|
|
2209
|
+
hn = e === "scrub" ? e : null;
|
|
2210
|
+
} catch {
|
|
2211
|
+
hn = null;
|
|
2212
|
+
}
|
|
2213
|
+
return hn;
|
|
2214
|
+
}, _n, vn = () => {
|
|
2215
|
+
if (_n !== void 0) return _n;
|
|
2216
|
+
try {
|
|
2217
|
+
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:snap") : null;
|
|
2218
|
+
_n = e === "always" || e === "off" ? e : null;
|
|
2219
|
+
} catch {
|
|
2220
|
+
_n = null;
|
|
2221
|
+
}
|
|
2222
|
+
return _n;
|
|
2223
|
+
}, yn = (e, t, n, r) => {
|
|
2174
2224
|
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
2175
|
-
for (let l of
|
|
2225
|
+
for (let l of nn) {
|
|
2176
2226
|
let u = e.find((e) => e.prop === l);
|
|
2177
2227
|
if (!u) continue;
|
|
2178
2228
|
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
2179
2229
|
if (u.from.unit === "%" && (d *= u.percentBase), l === "x" || l === "y") {
|
|
2180
|
-
let e = l === "x" ? r.x : r.y, t = (e === null || Math.abs(d - e) * n >=
|
|
2181
|
-
l === "x" ? (r.x = d, i =
|
|
2230
|
+
let e = l === "x" ? r.x : r.y, t = vn(), s = (t === "always" || t !== "off" && (e === null || Math.abs(d - e) * n >= mn)) && n > 0 ? Math.round(d * n) / n : Math.round(d * 1e3) / 1e3;
|
|
2231
|
+
l === "x" ? (r.x = d, i = s) : (r.y = d, a = s), o = !0, s !== 0 && (c = !1);
|
|
2182
2232
|
continue;
|
|
2183
2233
|
}
|
|
2184
|
-
let f =
|
|
2234
|
+
let f = an[l];
|
|
2185
2235
|
d !== f && (c = !1), l === "z" ? s.push(`translateZ(${d}px)`) : l === "scale" ? s.push(`scale(${d})`) : l === "scaleX" ? s.push(`scaleX(${d})`) : l === "scaleY" ? s.push(`scaleY(${d})`) : l === "rotate" || l === "rotateZ" ? s.push(`rotate(${d}deg)`) : l === "rotateX" ? s.push(`rotateX(${d}deg)`) : l === "rotateY" && s.push(`rotateY(${d}deg)`);
|
|
2186
2236
|
}
|
|
2187
2237
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
2188
|
-
},
|
|
2238
|
+
}, bn = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), xn = (e) => {
|
|
2189
2239
|
let t = {};
|
|
2190
|
-
for (let n of
|
|
2240
|
+
for (let n of W(e)) t[bn(n.property)] = n.value;
|
|
2191
2241
|
return t;
|
|
2192
|
-
},
|
|
2242
|
+
}, Sn = (e, t) => {
|
|
2193
2243
|
if (typeof e.animate != "function") return null;
|
|
2194
2244
|
try {
|
|
2195
|
-
let n = e.animate([
|
|
2245
|
+
let n = e.animate([xn(t.from), xn(t.to)], {
|
|
2196
2246
|
duration: Math.max(0, t.duration * 1e3),
|
|
2197
2247
|
delay: Math.max(0, t.delay * 1e3),
|
|
2198
|
-
easing:
|
|
2248
|
+
easing: Je(t.ease),
|
|
2199
2249
|
fill: "both"
|
|
2200
2250
|
});
|
|
2201
2251
|
return n.pause(), n.currentTime = 0, n;
|
|
2202
2252
|
} catch {
|
|
2203
2253
|
return null;
|
|
2204
2254
|
}
|
|
2205
|
-
},
|
|
2255
|
+
}, Cn = 1e3 / 60 * 2, wn = () => ({
|
|
2206
2256
|
request: (e) => requestAnimationFrame(e),
|
|
2207
2257
|
cancel: (e) => cancelAnimationFrame(e),
|
|
2208
2258
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
2209
|
-
}),
|
|
2259
|
+
}), Tn = ((e = wn()) => {
|
|
2210
2260
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
2211
2261
|
join: (n, r) => {
|
|
2212
|
-
let i =
|
|
2262
|
+
let i = gn() === "scrub" ? null : pn(r.motion, r.element), s = i ? null : Sn(r.element, r.motion);
|
|
2213
2263
|
if (!i && !s) return null;
|
|
2214
2264
|
let c = t.get(n);
|
|
2215
2265
|
c || (c = {
|
|
@@ -2230,14 +2280,14 @@ var Lt = (e, t, n, r) => {
|
|
|
2230
2280
|
y: null
|
|
2231
2281
|
}
|
|
2232
2282
|
};
|
|
2233
|
-
if (c.tracks.push(l), l.element.style.animation = "none",
|
|
2234
|
-
i.transforms.length > 0 &&
|
|
2235
|
-
for (let e of i.strings)
|
|
2236
|
-
for (let e of i.constants)
|
|
2283
|
+
if (c.tracks.push(l), l.element.style.animation = "none", q(l.element, "animation"), i) {
|
|
2284
|
+
i.transforms.length > 0 && q(l.element, "transform"), i.opacity && q(l.element, "opacity");
|
|
2285
|
+
for (let e of i.strings) q(l.element, e.property);
|
|
2286
|
+
for (let e of i.constants) q(l.element, e.property);
|
|
2237
2287
|
a(l, 0);
|
|
2238
2288
|
}
|
|
2239
|
-
return r.role === "active" && !c.started && (c.started = !0,
|
|
2240
|
-
l.detached = !0, l.scrub?.cancel(),
|
|
2289
|
+
return r.role === "active" && !c.started && (c.started = !0, Dt.beginRun(), o(n, c)), () => {
|
|
2290
|
+
l.detached = !0, l.scrub?.cancel(), J(l.element);
|
|
2241
2291
|
let r = t.get(n);
|
|
2242
2292
|
r && (r.tracks = r.tracks.filter((e) => e !== l), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
2243
2293
|
};
|
|
@@ -2252,13 +2302,13 @@ var Lt = (e, t, n, r) => {
|
|
|
2252
2302
|
}
|
|
2253
2303
|
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
2254
2304
|
let t = r.get(e);
|
|
2255
|
-
return t || (t =
|
|
2305
|
+
return t || (t = Jt(e.motion.ease), r.set(e, t)), t;
|
|
2256
2306
|
};
|
|
2257
2307
|
function a(t, n) {
|
|
2258
2308
|
let { element: r, parsed: i } = t;
|
|
2259
2309
|
if (!(!i || !r.isConnected)) {
|
|
2260
2310
|
if (i.transforms.length > 0) {
|
|
2261
|
-
let a =
|
|
2311
|
+
let a = yn(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
2262
2312
|
a !== "" && (r.style.transform = a);
|
|
2263
2313
|
}
|
|
2264
2314
|
if (i.opacity) {
|
|
@@ -2278,7 +2328,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2278
2328
|
let c = r.startTime ?? s;
|
|
2279
2329
|
if (r.lastTime !== null) {
|
|
2280
2330
|
let e = s - r.lastTime;
|
|
2281
|
-
|
|
2331
|
+
Dt.reportGap(e), n.onFrameGap?.(e), e > Cn && (c += e - Cn);
|
|
2282
2332
|
}
|
|
2283
2333
|
r.startTime = c, r.lastTime = s;
|
|
2284
2334
|
let l = !0;
|
|
@@ -2294,14 +2344,14 @@ var Lt = (e, t, n, r) => {
|
|
|
2294
2344
|
a(e, i(e)(o)), o >= 1 ? (e.completed = !0, e.onComplete?.()) : l = !1;
|
|
2295
2345
|
}
|
|
2296
2346
|
if (l) {
|
|
2297
|
-
|
|
2347
|
+
Dt.endRun(), t.delete(e);
|
|
2298
2348
|
return;
|
|
2299
2349
|
}
|
|
2300
2350
|
o(e, r);
|
|
2301
2351
|
}
|
|
2302
2352
|
return n;
|
|
2303
2353
|
})();
|
|
2304
|
-
|
|
2354
|
+
Tn.onFrameGap = (e) => {
|
|
2305
2355
|
if (typeof window < "u") {
|
|
2306
2356
|
let t = window.__flemoPlayerGaps ??= [];
|
|
2307
2357
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -2309,23 +2359,86 @@ mn.onFrameGap = (e) => {
|
|
|
2309
2359
|
};
|
|
2310
2360
|
//#endregion
|
|
2311
2361
|
//#region src/core/engine/types.ts
|
|
2312
|
-
var
|
|
2362
|
+
var En = "data-flemo-skip-animation", Dn = 1e3 / 60, On = (e, t) => {
|
|
2363
|
+
let n = 0, r = !1;
|
|
2364
|
+
for (let i of ["x", "y"]) {
|
|
2365
|
+
let a = $t(e.from, i, t), o = $t(e.to, i, t);
|
|
2366
|
+
if (!(a === void 0 && o === void 0)) {
|
|
2367
|
+
if (a === null || o === null || a === void 0 || o === void 0) return null;
|
|
2368
|
+
r = !0, n = Math.max(n, Math.abs(o - a));
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
if (!r || n === 0) return 0;
|
|
2372
|
+
let i = e.duration * 1e3;
|
|
2373
|
+
/* v8 ignore next 2 -- resolveVariantMotion never yields duration<=0 with a
|
|
2374
|
+
distance; kept so a hand-built motion cannot divide by zero. */
|
|
2375
|
+
if (i <= 0) return 0;
|
|
2376
|
+
let a = i / Dn, o = Jt(e.ease), s = Math.max(1, Math.min(240, Math.ceil(a))), c = 0, l = o(0);
|
|
2377
|
+
for (let e = 1; e <= s; e++) {
|
|
2378
|
+
let t = o(e / s);
|
|
2379
|
+
c = Math.max(c, Math.abs(t - l)), l = t;
|
|
2380
|
+
}
|
|
2381
|
+
return n * c * (s / a);
|
|
2382
|
+
}, kn = (e, t, n) => {
|
|
2383
|
+
let r = e.driver;
|
|
2384
|
+
if (r === "native" || r === "player") return r;
|
|
2385
|
+
let i = 0;
|
|
2386
|
+
for (let r of ["true", "false"]) {
|
|
2387
|
+
let a = U(e, `${t}-${r}`);
|
|
2388
|
+
if (!a) continue;
|
|
2389
|
+
let o = On(a, n);
|
|
2390
|
+
if (o === null) return "player";
|
|
2391
|
+
i = Math.max(i, o);
|
|
2392
|
+
}
|
|
2393
|
+
return i >= 6 ? "native" : "player";
|
|
2394
|
+
}, An = 1e3 / 60 * 2, jn = "flemo-", Mn = /* @__PURE__ */ new WeakMap(), Nn = (e, t, n) => {
|
|
2395
|
+
if (typeof e.getAnimations == "function") for (let r of e.getAnimations({ subtree: !0 })) {
|
|
2396
|
+
let e = r.animationName;
|
|
2397
|
+
if (typeof e != "string" || !e.startsWith(jn) || r.playState !== "running" || Mn.get(r) === n) continue;
|
|
2398
|
+
let i = r.startTime;
|
|
2399
|
+
typeof i == "number" && (r.startTime = i + t, Mn.set(r, n));
|
|
2400
|
+
}
|
|
2401
|
+
};
|
|
2402
|
+
function Pn(e, t) {
|
|
2403
|
+
/* v8 ignore next -- every runtime under test has rAF; the guard shields
|
|
2404
|
+
exotic embedders. */
|
|
2405
|
+
if (typeof requestAnimationFrame != "function") return () => {};
|
|
2406
|
+
let n = 0, r = null, i = !1, a = (o) => {
|
|
2407
|
+
if (!i) {
|
|
2408
|
+
if (r !== null) {
|
|
2409
|
+
let n = o - r;
|
|
2410
|
+
if (n > 33.333333333333336) {
|
|
2411
|
+
let r = n - An;
|
|
2412
|
+
for (let t of e()) t && Nn(t, r, o);
|
|
2413
|
+
t?.(r);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
r = o, n = requestAnimationFrame(a);
|
|
2417
|
+
}
|
|
2418
|
+
};
|
|
2419
|
+
return n = requestAnimationFrame(a), () => {
|
|
2420
|
+
i = !0, cancelAnimationFrame(n);
|
|
2421
|
+
};
|
|
2422
|
+
}
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region src/core/engine/createTransitionEngine.ts
|
|
2425
|
+
var Z = () => {}, Fn = 400, In = 4, Ln = 100, Rn = 1500, zn = "data-flemo-part-name", Bn = (e) => {
|
|
2313
2426
|
let t = e.parentElement ?? e;
|
|
2314
|
-
return Array.from(t.querySelectorAll(`[${
|
|
2427
|
+
return Array.from(t.querySelectorAll(`[${zn}]`)).filter((n) => {
|
|
2315
2428
|
let r = n.closest("[data-flemo-screen]");
|
|
2316
2429
|
return !r || r === e || !t.contains(r);
|
|
2317
2430
|
});
|
|
2318
|
-
},
|
|
2431
|
+
}, Vn = (e, t) => {
|
|
2319
2432
|
let [n, r] = t.split("-");
|
|
2320
|
-
return
|
|
2321
|
-
},
|
|
2433
|
+
return Bn(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2434
|
+
}, Hn = 4, Un = (e) => `${Math.round(e * 1e3) / 1e3}s`, Wn = (e) => {
|
|
2322
2435
|
let { element: t, expectedName: n, motion: r } = e, i = null, a = !1, o = (e) => {
|
|
2323
|
-
a = !0, t.style.animation = "none", t.offsetWidth, t.style.removeProperty("animation"), e.mode === "clear" ? t.style.removeProperty("animation-delay") : e.mode === "set" && (t.style.animationDelay =
|
|
2436
|
+
a = !0, t.style.animation = "none", t.offsetWidth, t.style.removeProperty("animation"), e.mode === "clear" ? t.style.removeProperty("animation-delay") : e.mode === "set" && (t.style.animationDelay = Un(e.seconds)), a = !1;
|
|
2324
2437
|
}, s = (e) => {
|
|
2325
2438
|
a || e.target !== t || e.animationName !== n || i === null && (i = performance.now());
|
|
2326
2439
|
}, c = (s) => {
|
|
2327
2440
|
if (a || s.target !== t || s.animationName !== n) return;
|
|
2328
|
-
if (!e.isLive() || e.budgetUsed() >=
|
|
2441
|
+
if (!e.isLive() || e.budgetUsed() >= Hn) {
|
|
2329
2442
|
e.onTerminal();
|
|
2330
2443
|
return;
|
|
2331
2444
|
}
|
|
@@ -2355,7 +2468,7 @@ var hn = "data-flemo-skip-animation", Z = () => {}, gn = 400, _n = 100, vn = "da
|
|
|
2355
2468
|
}
|
|
2356
2469
|
};
|
|
2357
2470
|
};
|
|
2358
|
-
function
|
|
2471
|
+
function Gn(e) {
|
|
2359
2472
|
let t = /* @__PURE__ */ new Map(), n = null, r = null, i = null, a = null, o = () => {
|
|
2360
2473
|
if (!a) return;
|
|
2361
2474
|
let { land: e, cancel: t } = a;
|
|
@@ -2378,9 +2491,9 @@ function wn(e) {
|
|
|
2378
2491
|
return {
|
|
2379
2492
|
driveScreenLifecycle: (a) => {
|
|
2380
2493
|
let { getElements: l, transitionName: u, prevTransitionName: d, status: f, isActive: p, animHoldReleased: m } = a, h = f === "PUSHING" || f === "POPPING" || f === "REPLACING";
|
|
2381
|
-
h && (i &&= (clearTimeout(i), null), r ||=
|
|
2494
|
+
h && (i &&= (clearTimeout(i), null), r ||= Bt()), !h && r && !i && (typeof setTimeout == "function" ? i = setTimeout(() => {
|
|
2382
2495
|
i = null, r?.(), r = null;
|
|
2383
|
-
},
|
|
2496
|
+
}, Fn) : (r(), r = null));
|
|
2384
2497
|
let g = h && m && (p ? f === "PUSHING" || f === "REPLACING" : f === "POPPING");
|
|
2385
2498
|
if (!g && n) {
|
|
2386
2499
|
let e = n;
|
|
@@ -2389,16 +2502,26 @@ function wn(e) {
|
|
|
2389
2502
|
if (g && !n) {
|
|
2390
2503
|
o();
|
|
2391
2504
|
let { scope: e } = l();
|
|
2392
|
-
|
|
2505
|
+
if (e) {
|
|
2506
|
+
let t = jt(e), r = Wt(e);
|
|
2507
|
+
n = () => {
|
|
2508
|
+
r(), t();
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2393
2511
|
}
|
|
2394
2512
|
let _ = (t, n, r) => {
|
|
2395
2513
|
let i = e.getTransitionTaskId();
|
|
2396
|
-
if (!i || s.pendingTaskIds.some((e) => e !== i) || !
|
|
2514
|
+
if (!i || s.pendingTaskIds.some((e) => e !== i) || !Dt.playerAllowed()) return null;
|
|
2397
2515
|
let { scope: a, decorator: o, bars: c } = l();
|
|
2398
2516
|
if (!a) return null;
|
|
2399
|
-
let d = be(u)
|
|
2517
|
+
let d = be(u);
|
|
2518
|
+
if (Dt.pinnedDriver() !== "raf") {
|
|
2519
|
+
let e = t.split("-")[0];
|
|
2520
|
+
if (kn(d, e, a) === "native") return null;
|
|
2521
|
+
}
|
|
2522
|
+
let f = U(d, t);
|
|
2400
2523
|
if (!f) return null;
|
|
2401
|
-
let p = [], m =
|
|
2524
|
+
let p = [], m = Tn.join(i, {
|
|
2402
2525
|
element: a,
|
|
2403
2526
|
motion: f,
|
|
2404
2527
|
role: n,
|
|
@@ -2408,7 +2531,7 @@ function wn(e) {
|
|
|
2408
2531
|
p.push(m);
|
|
2409
2532
|
for (let e of c ?? []) {
|
|
2410
2533
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2411
|
-
let t =
|
|
2534
|
+
let t = Tn.join(i, {
|
|
2412
2535
|
element: e,
|
|
2413
2536
|
motion: f,
|
|
2414
2537
|
role: "passive"
|
|
@@ -2416,9 +2539,9 @@ function wn(e) {
|
|
|
2416
2539
|
t && p.push(t);
|
|
2417
2540
|
}
|
|
2418
2541
|
if (o && d.decoratorName) {
|
|
2419
|
-
let e =
|
|
2542
|
+
let e = Te.get(d.decoratorName), n = e ? U(e, t) : null;
|
|
2420
2543
|
if (n) {
|
|
2421
|
-
let e =
|
|
2544
|
+
let e = Tn.join(i, {
|
|
2422
2545
|
element: o,
|
|
2423
2546
|
motion: n,
|
|
2424
2547
|
role: "passive"
|
|
@@ -2426,10 +2549,10 @@ function wn(e) {
|
|
|
2426
2549
|
e && p.push(e);
|
|
2427
2550
|
}
|
|
2428
2551
|
}
|
|
2429
|
-
for (let e of
|
|
2430
|
-
let n =
|
|
2552
|
+
for (let e of Vn(a, t)) {
|
|
2553
|
+
let n = H.get(e.getAttribute(zn)), r = n ? U(n, t) : null;
|
|
2431
2554
|
if (!r) continue;
|
|
2432
|
-
let a =
|
|
2555
|
+
let a = Tn.join(i, {
|
|
2433
2556
|
element: e,
|
|
2434
2557
|
motion: r,
|
|
2435
2558
|
role: "passive"
|
|
@@ -2439,7 +2562,7 @@ function wn(e) {
|
|
|
2439
2562
|
return () => p.forEach((e) => e());
|
|
2440
2563
|
}, v = (e, t) => {
|
|
2441
2564
|
let n = [], { decorator: r, bars: i } = l(), a = be(u), o = (e, t, r) => {
|
|
2442
|
-
let i = 0, a =
|
|
2565
|
+
let i = 0, a = Wn({
|
|
2443
2566
|
element: e,
|
|
2444
2567
|
expectedName: t,
|
|
2445
2568
|
motion: r,
|
|
@@ -2451,15 +2574,15 @@ function wn(e) {
|
|
|
2451
2574
|
onTerminal: Z
|
|
2452
2575
|
});
|
|
2453
2576
|
a.attach(), n.push(a.detach);
|
|
2454
|
-
}, s =
|
|
2577
|
+
}, s = G("screen", u, t), c = U(a, t);
|
|
2455
2578
|
if (c) for (let e of i ?? []) !e || e.getAttribute("data-flemo-bar-riding") !== "true" || o(e, s, c);
|
|
2456
2579
|
if (r && a.decoratorName) {
|
|
2457
|
-
let e =
|
|
2458
|
-
n && o(r,
|
|
2580
|
+
let e = Te.get(a.decoratorName), n = e ? U(e, t) : null;
|
|
2581
|
+
n && o(r, G("decorator", a.decoratorName, t), n);
|
|
2459
2582
|
}
|
|
2460
|
-
for (let n of
|
|
2461
|
-
let e = n.getAttribute(
|
|
2462
|
-
i && o(n,
|
|
2583
|
+
for (let n of Vn(e, t)) {
|
|
2584
|
+
let e = n.getAttribute(zn), r = H.get(e), i = r ? U(r, t) : null;
|
|
2585
|
+
i && o(n, G("part", e, t), i);
|
|
2463
2586
|
}
|
|
2464
2587
|
return n;
|
|
2465
2588
|
};
|
|
@@ -2467,11 +2590,11 @@ function wn(e) {
|
|
|
2467
2590
|
if (f === "COMPLETED") {
|
|
2468
2591
|
let { scope: e, decorator: t, bars: n } = l();
|
|
2469
2592
|
if (e) {
|
|
2470
|
-
|
|
2471
|
-
for (let t of
|
|
2593
|
+
J(e);
|
|
2594
|
+
for (let t of Bn(e)) J(t);
|
|
2472
2595
|
}
|
|
2473
|
-
t &&
|
|
2474
|
-
for (let e of n ?? []) e &&
|
|
2596
|
+
t && J(t);
|
|
2597
|
+
for (let e of n ?? []) e && J(e);
|
|
2475
2598
|
return Z;
|
|
2476
2599
|
}
|
|
2477
2600
|
if (f === "REPLACING" && d !== u && e.setReplaceTransitionStatus("PENDING"), h && m) {
|
|
@@ -2480,10 +2603,10 @@ function wn(e) {
|
|
|
2480
2603
|
let { scope: n } = l();
|
|
2481
2604
|
if (n) {
|
|
2482
2605
|
let t = be(u), r = [];
|
|
2483
|
-
if (
|
|
2484
|
-
let i =
|
|
2606
|
+
if (K(t, e)) {
|
|
2607
|
+
let i = U(t, e), a = 0, o = Wn({
|
|
2485
2608
|
element: n,
|
|
2486
|
-
expectedName:
|
|
2609
|
+
expectedName: G("screen", u, e),
|
|
2487
2610
|
motion: i,
|
|
2488
2611
|
isLive: () => n.isConnected && n.getAttribute("data-flemo-skip-animation") !== "true",
|
|
2489
2612
|
budgetUsed: () => a,
|
|
@@ -2503,11 +2626,11 @@ function wn(e) {
|
|
|
2503
2626
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2504
2627
|
let { scope: t, decorator: n, bars: r } = l();
|
|
2505
2628
|
if (t) {
|
|
2506
|
-
|
|
2507
|
-
for (let e of
|
|
2629
|
+
J(t), t.removeAttribute(En);
|
|
2630
|
+
for (let e of Bn(t)) J(e);
|
|
2508
2631
|
}
|
|
2509
|
-
n && (
|
|
2510
|
-
for (let e of r ?? []) e && (
|
|
2632
|
+
n && (J(n), n.removeAttribute(En));
|
|
2633
|
+
for (let e of r ?? []) e && (J(e), e.style.removeProperty("will-change"));
|
|
2511
2634
|
return Z;
|
|
2512
2635
|
}
|
|
2513
2636
|
if (f === "IDLE") return Z;
|
|
@@ -2516,88 +2639,96 @@ function wn(e) {
|
|
|
2516
2639
|
let b = e.getTransitionTaskId(), x = () => {
|
|
2517
2640
|
let n = e.getTransitionTaskId();
|
|
2518
2641
|
n && s.resolveTask(n), b && t.delete(b);
|
|
2519
|
-
}, S = be(u), C = `${f}-true`, w = y.getAttribute(
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2642
|
+
}, S = be(u), C = `${f}-true`, w = y.getAttribute(En) === "true", T = !w && K(S, C), E = `${f}-false`, D = K(S, E) ? U(S, E) : null, O = [];
|
|
2643
|
+
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${zn}][data-flemo-status="${f}"]`))) {
|
|
2644
|
+
let t = H.get(e.getAttribute(zn)), n = `${f}-${e.getAttribute("data-flemo-active")}`, r = t && K(t, n) ? U(t, n) : null;
|
|
2645
|
+
r && O.push({
|
|
2646
|
+
element: e,
|
|
2647
|
+
motion: r
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
let k = D ? (D.delay + D.duration) * 1e3 : 0;
|
|
2651
|
+
for (let { motion: e } of O) k = Math.max(k, (e.delay + e.duration) * 1e3);
|
|
2652
|
+
if (!T) {
|
|
2653
|
+
if (!w && K(S, E)) {
|
|
2654
|
+
if (!m) return b && s.markGateHeld(b), Z;
|
|
2655
|
+
let e = k + 50;
|
|
2656
|
+
b && s.anchorGate(b, e + Rn);
|
|
2657
|
+
let t = setTimeout(x, e);
|
|
2658
|
+
return () => clearTimeout(t);
|
|
2529
2659
|
}
|
|
2530
2660
|
return queueMicrotask(x), Z;
|
|
2531
2661
|
}
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2662
|
+
let A = U(S, C);
|
|
2663
|
+
if (b) if (m) {
|
|
2664
|
+
let e = (A.delay + A.duration) * 1e3;
|
|
2665
|
+
s.anchorGate(b, Math.max(e, k) + Rn);
|
|
2666
|
+
} else s.markGateHeld(b);
|
|
2667
|
+
let ee = !w && !!A, te = G("screen", u, C), j, M = () => {
|
|
2668
|
+
j !== void 0 && (clearTimeout(j), j = void 0);
|
|
2669
|
+
}, N = 0, ne, re = [], ie, ae = () => {
|
|
2670
|
+
re.forEach((e) => cancelAnimationFrame(e)), re = [], ie !== void 0 && clearTimeout(ie), ie = void 0;
|
|
2671
|
+
}, oe = () => {
|
|
2538
2672
|
/* v8 ignore next 4 -- every runtime under test has rAF; the guard
|
|
2539
2673
|
shields exotic embedders. */
|
|
2540
2674
|
if (typeof requestAnimationFrame != "function") {
|
|
2541
2675
|
x();
|
|
2542
2676
|
return;
|
|
2543
2677
|
}
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
},
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2678
|
+
ie = setTimeout(() => {
|
|
2679
|
+
ae(), x();
|
|
2680
|
+
}, Ln);
|
|
2681
|
+
let e = (t) => {
|
|
2682
|
+
if (t <= 0) {
|
|
2683
|
+
ae(), x();
|
|
2684
|
+
return;
|
|
2685
|
+
}
|
|
2686
|
+
re.push(requestAnimationFrame(() => e(t - 1)));
|
|
2687
|
+
};
|
|
2688
|
+
e(In);
|
|
2689
|
+
}, se = () => {
|
|
2690
|
+
if (N <= 0) {
|
|
2691
|
+
oe();
|
|
2554
2692
|
return;
|
|
2555
2693
|
}
|
|
2556
|
-
ne = setTimeout(
|
|
2557
|
-
},
|
|
2558
|
-
e.target === y && e.animationName ===
|
|
2694
|
+
ne = setTimeout(oe, N);
|
|
2695
|
+
}, ce = Z, P = Z, le = Z, F = (e) => {
|
|
2696
|
+
e.target === y && e.animationName === te && (y.removeEventListener("animationend", F), M(), ce(), se());
|
|
2559
2697
|
};
|
|
2560
|
-
y.addEventListener("animationend",
|
|
2561
|
-
let
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
r && fe.push({
|
|
2565
|
-
element: e,
|
|
2566
|
-
motion: r
|
|
2567
|
-
});
|
|
2568
|
-
}
|
|
2569
|
-
let pe = N ? (N.delay + N.duration) * 1e3 : 0;
|
|
2570
|
-
for (let { motion: e } of fe) pe = Math.max(pe, (e.delay + e.duration) * 1e3);
|
|
2571
|
-
te = Math.max(0, Math.min(1e3, pe - ce));
|
|
2572
|
-
let me = ce + 250, P = () => b !== null && e.getTransitionTaskId() === b && y.isConnected && y.getAttribute("data-flemo-skip-animation") !== "true" && G(S, C), he = Cn({
|
|
2698
|
+
y.addEventListener("animationend", F);
|
|
2699
|
+
let ue = ee && m ? _(C, "active", oe) : null, de = (A.delay + A.duration) * 1e3, fe = Math.max(de, k) + 1500, pe = b ? setTimeout(() => void s.resolveTask(b), fe) : void 0;
|
|
2700
|
+
N = Math.max(0, k - de);
|
|
2701
|
+
let I = de + 250, me = () => b !== null && e.getTransitionTaskId() === b && y.isConnected && y.getAttribute("data-flemo-skip-animation") !== "true" && K(S, C), he = Wn({
|
|
2573
2702
|
element: y,
|
|
2574
|
-
expectedName:
|
|
2575
|
-
motion:
|
|
2576
|
-
isLive:
|
|
2703
|
+
expectedName: te,
|
|
2704
|
+
motion: A,
|
|
2705
|
+
isLive: me,
|
|
2577
2706
|
budgetUsed: () => t.get(b) ?? 0,
|
|
2578
2707
|
spendBudget: () => {
|
|
2579
|
-
|
|
2708
|
+
P(), le(), t.set(b, (t.get(b) ?? 0) + 1);
|
|
2580
2709
|
},
|
|
2581
2710
|
onTerminal: x
|
|
2582
2711
|
});
|
|
2583
|
-
|
|
2584
|
-
let ge = !1,
|
|
2585
|
-
|
|
2586
|
-
},
|
|
2587
|
-
if (
|
|
2588
|
-
ge = !0,
|
|
2712
|
+
ce = he.detach;
|
|
2713
|
+
let ge = !1, L = () => {
|
|
2714
|
+
M(), j = setTimeout(R, I);
|
|
2715
|
+
}, R = () => {
|
|
2716
|
+
if (M(), me() && !ge) {
|
|
2717
|
+
ge = !0, P(), le(), he.fullRestart(), L();
|
|
2589
2718
|
return;
|
|
2590
2719
|
}
|
|
2591
2720
|
x();
|
|
2592
|
-
},
|
|
2593
|
-
|
|
2594
|
-
let
|
|
2595
|
-
|
|
2721
|
+
}, z = !ue && m, _e = z ? v(y, C) : [];
|
|
2722
|
+
z && (he.attach(), b && L());
|
|
2723
|
+
let ve = z && !Tt() ? Pn(() => [y.ownerDocument.documentElement], () => {
|
|
2724
|
+
P(), le(), b && j !== void 0 && L();
|
|
2725
|
+
}) : null, B, ye = () => {
|
|
2726
|
+
B !== void 0 && (clearTimeout(B), B = void 0);
|
|
2596
2727
|
};
|
|
2597
|
-
if (
|
|
2598
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1, t =
|
|
2599
|
-
for (let { element: t, motion: n } of
|
|
2600
|
-
let i =
|
|
2728
|
+
if (P = ye, z && b) {
|
|
2729
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1, t = tn(A, y, e), n = D ? tn(D, y, e) : 0, r = 0;
|
|
2730
|
+
for (let { element: t, motion: n } of O) {
|
|
2731
|
+
let i = tn(n, t, e);
|
|
2601
2732
|
if (i === null) {
|
|
2602
2733
|
r = null;
|
|
2603
2734
|
break;
|
|
@@ -2605,16 +2736,36 @@ function wn(e) {
|
|
|
2605
2736
|
r = Math.max(r, i);
|
|
2606
2737
|
}
|
|
2607
2738
|
let i = t !== null && n !== null && r !== null ? Math.max(t, n, r) : null;
|
|
2608
|
-
i !== null && i + 17 <
|
|
2609
|
-
|
|
2739
|
+
i !== null && i + 17 < de + N && (B = setTimeout(() => {
|
|
2740
|
+
B = void 0, me() && (y.removeEventListener("animationend", F), M(), ce(), oe());
|
|
2610
2741
|
}, i + 17));
|
|
2611
2742
|
}
|
|
2743
|
+
let V, xe = () => {
|
|
2744
|
+
V !== void 0 && (clearTimeout(V), V = void 0);
|
|
2745
|
+
};
|
|
2746
|
+
if (le = xe, z && n) {
|
|
2747
|
+
let e = tn(A, y, 1), t = D ? tn(D, y, 1) : 0, r = 0;
|
|
2748
|
+
for (let { element: e, motion: t } of O) {
|
|
2749
|
+
let n = tn(t, e, 1);
|
|
2750
|
+
if (n === null) {
|
|
2751
|
+
r = null;
|
|
2752
|
+
break;
|
|
2753
|
+
}
|
|
2754
|
+
r = Math.max(r, n);
|
|
2755
|
+
}
|
|
2756
|
+
let i = e !== null && t !== null && r !== null ? Math.max(e, t, r) : null;
|
|
2757
|
+
i !== null && (V = setTimeout(() => {
|
|
2758
|
+
V = void 0;
|
|
2759
|
+
let e = n;
|
|
2760
|
+
e && (n = null, e());
|
|
2761
|
+
}, i));
|
|
2762
|
+
}
|
|
2612
2763
|
return () => {
|
|
2613
|
-
if (
|
|
2764
|
+
if (pe !== void 0 && clearTimeout(pe), ne !== void 0 && clearTimeout(ne), ae(), ve?.(), ye(), xe(), y.removeEventListener("animationend", F), z) {
|
|
2614
2765
|
he.detach();
|
|
2615
|
-
for (let e of
|
|
2766
|
+
for (let e of _e) e();
|
|
2616
2767
|
}
|
|
2617
|
-
|
|
2768
|
+
M(), ue?.(), b && e.getTransitionTaskId() !== b && t.delete(b);
|
|
2618
2769
|
};
|
|
2619
2770
|
},
|
|
2620
2771
|
activeResumeEntryCount: () => t.size
|
|
@@ -2622,20 +2773,20 @@ function wn(e) {
|
|
|
2622
2773
|
}
|
|
2623
2774
|
//#endregion
|
|
2624
2775
|
//#region src/utils/findScrollable.ts
|
|
2625
|
-
function
|
|
2626
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2776
|
+
function Kn(e, t) {
|
|
2777
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = qn(e);
|
|
2627
2778
|
if (!o) return {
|
|
2628
2779
|
element: null,
|
|
2629
2780
|
hasMarker: !1
|
|
2630
2781
|
};
|
|
2631
2782
|
let s = o.closest?.(r);
|
|
2632
|
-
if (s instanceof HTMLElement &&
|
|
2783
|
+
if (s instanceof HTMLElement && Jn(s, n) && (!a || Yn(s, n))) return {
|
|
2633
2784
|
element: s,
|
|
2634
2785
|
hasMarker: !0
|
|
2635
2786
|
};
|
|
2636
2787
|
let c = o, l = 0;
|
|
2637
2788
|
for (; c && l < i;) {
|
|
2638
|
-
if (
|
|
2789
|
+
if (Jn(c, n) && (!a || Yn(c, n))) return {
|
|
2639
2790
|
element: c,
|
|
2640
2791
|
hasMarker: !1
|
|
2641
2792
|
};
|
|
@@ -2646,7 +2797,7 @@ function Tn(e, t) {
|
|
|
2646
2797
|
hasMarker: !1
|
|
2647
2798
|
};
|
|
2648
2799
|
}
|
|
2649
|
-
function
|
|
2800
|
+
function qn(e) {
|
|
2650
2801
|
if (!e) return null;
|
|
2651
2802
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2652
2803
|
if (n && n.length) {
|
|
@@ -2654,18 +2805,18 @@ function En(e) {
|
|
|
2654
2805
|
}
|
|
2655
2806
|
return e instanceof HTMLElement ? e : null;
|
|
2656
2807
|
}
|
|
2657
|
-
function
|
|
2808
|
+
function Jn(e, t) {
|
|
2658
2809
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2659
2810
|
}
|
|
2660
|
-
function
|
|
2661
|
-
if (!
|
|
2811
|
+
function Yn(e, t) {
|
|
2812
|
+
if (!Jn(e, t) || typeof window > "u") return !1;
|
|
2662
2813
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2663
2814
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2664
2815
|
}
|
|
2665
2816
|
//#endregion
|
|
2666
2817
|
//#region src/core/engine/createSwipeController.ts
|
|
2667
|
-
var
|
|
2668
|
-
function
|
|
2818
|
+
var Xn = "data-flemo-skip-animation";
|
|
2819
|
+
function Zn(e) {
|
|
2669
2820
|
let t = null, n = null, r = {
|
|
2670
2821
|
current: [],
|
|
2671
2822
|
prev: []
|
|
@@ -2711,9 +2862,9 @@ function An(e) {
|
|
|
2711
2862
|
y: e.clientY
|
|
2712
2863
|
}, u = t;
|
|
2713
2864
|
}, v = (n, i, a) => {
|
|
2714
|
-
let o =
|
|
2715
|
-
if (n === e.getElements().scope) for (let e of r.current)
|
|
2716
|
-
else if (n === t) for (let e of r.prev)
|
|
2865
|
+
let o = Y(n, i, a);
|
|
2866
|
+
if (n === e.getElements().scope) for (let e of r.current) Y(e, i, a);
|
|
2867
|
+
else if (n === t) for (let e of r.prev) Y(e, i, a);
|
|
2717
2868
|
return o;
|
|
2718
2869
|
}, y = (t) => {
|
|
2719
2870
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -2727,12 +2878,12 @@ function An(e) {
|
|
|
2727
2878
|
current: i,
|
|
2728
2879
|
prev: s
|
|
2729
2880
|
};
|
|
2730
|
-
let c =
|
|
2881
|
+
let c = Ke(e.getTransition()).join(", ");
|
|
2731
2882
|
for (let e of i) e.style.willChange = c;
|
|
2732
2883
|
for (let e of s) e.style.willChange = c;
|
|
2733
2884
|
}, b = () => {
|
|
2734
|
-
for (let e of r.current)
|
|
2735
|
-
for (let e of r.prev)
|
|
2885
|
+
for (let e of r.current) J(e), e.style.removeProperty("will-change");
|
|
2886
|
+
for (let e of r.prev) J(e), e.style.removeProperty("will-change");
|
|
2736
2887
|
r = {
|
|
2737
2888
|
current: [],
|
|
2738
2889
|
prev: []
|
|
@@ -2745,10 +2896,10 @@ function An(e) {
|
|
|
2745
2896
|
};
|
|
2746
2897
|
}, S = (e, t, n) => {
|
|
2747
2898
|
let r = (r, i) => {
|
|
2748
|
-
let a =
|
|
2899
|
+
let a = H.get(r.getAttribute("data-flemo-part-name"));
|
|
2749
2900
|
if (!a) return;
|
|
2750
2901
|
let o = {
|
|
2751
|
-
animate:
|
|
2902
|
+
animate: Y,
|
|
2752
2903
|
element: r,
|
|
2753
2904
|
active: i
|
|
2754
2905
|
};
|
|
@@ -2757,7 +2908,7 @@ function An(e) {
|
|
|
2757
2908
|
for (let e of i.current) r(e, !0);
|
|
2758
2909
|
for (let e of i.prev) r(e, !1);
|
|
2759
2910
|
}, C = () => {
|
|
2760
|
-
for (let e of [...i.current, ...i.prev])
|
|
2911
|
+
for (let e of [...i.current, ...i.prev]) J(e);
|
|
2761
2912
|
i = {
|
|
2762
2913
|
current: [],
|
|
2763
2914
|
prev: []
|
|
@@ -2786,7 +2937,7 @@ function An(e) {
|
|
|
2786
2937
|
prevScreen: t,
|
|
2787
2938
|
onStart: (e) => {
|
|
2788
2939
|
m?.onSwipeStart?.(e, {
|
|
2789
|
-
animate:
|
|
2940
|
+
animate: Y,
|
|
2790
2941
|
currentDecorator: f,
|
|
2791
2942
|
prevDecorator: n
|
|
2792
2943
|
}), S("start", e, 0);
|
|
@@ -2803,7 +2954,7 @@ function An(e) {
|
|
|
2803
2954
|
prevScreen: t,
|
|
2804
2955
|
onProgress: (e, t) => {
|
|
2805
2956
|
c?.onSwipe?.(e, t, {
|
|
2806
|
-
animate:
|
|
2957
|
+
animate: Y,
|
|
2807
2958
|
currentDecorator: o,
|
|
2808
2959
|
prevDecorator: n
|
|
2809
2960
|
}), S("swipe", e, t);
|
|
@@ -2822,15 +2973,15 @@ function An(e) {
|
|
|
2822
2973
|
prevScreen: t,
|
|
2823
2974
|
onStart: (e) => {
|
|
2824
2975
|
u?.onSwipeEnd?.(e, {
|
|
2825
|
-
animate:
|
|
2976
|
+
animate: Y,
|
|
2826
2977
|
currentDecorator: l,
|
|
2827
2978
|
prevDecorator: n
|
|
2828
2979
|
}), S("end", e, 0);
|
|
2829
2980
|
}
|
|
2830
2981
|
})) {
|
|
2831
|
-
c?.setAttribute(
|
|
2982
|
+
c?.setAttribute(Xn, "true"), l?.setAttribute(Xn, "true");
|
|
2832
2983
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
2833
|
-
for (let e of r.prev)
|
|
2984
|
+
for (let e of r.prev) J(e), e.style.removeProperty("will-change");
|
|
2834
2985
|
r = {
|
|
2835
2986
|
current: [],
|
|
2836
2987
|
prev: []
|
|
@@ -2838,14 +2989,14 @@ function An(e) {
|
|
|
2838
2989
|
current: [],
|
|
2839
2990
|
prev: []
|
|
2840
2991
|
}, e.back();
|
|
2841
|
-
} else c &&
|
|
2992
|
+
} else c && J(c), t && J(t), l && J(l), n && J(n), b(), C(), e.setDragStatus("IDLE");
|
|
2842
2993
|
};
|
|
2843
2994
|
return {
|
|
2844
2995
|
pointerDown: (t) => {
|
|
2845
|
-
e.isReadyForDrag() && (f =
|
|
2996
|
+
e.isReadyForDrag() && (f = Kn(t.target, {
|
|
2846
2997
|
direction: "x",
|
|
2847
2998
|
verifyByScroll: !0
|
|
2848
|
-
}), p =
|
|
2999
|
+
}), p = Kn(t.target, {
|
|
2849
3000
|
direction: "y",
|
|
2850
3001
|
verifyByScroll: !0
|
|
2851
3002
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2874,7 +3025,7 @@ function An(e) {
|
|
|
2874
3025
|
}
|
|
2875
3026
|
//#endregion
|
|
2876
3027
|
//#region src/screen/computeBarRiding.ts
|
|
2877
|
-
function
|
|
3028
|
+
function Qn(e) {
|
|
2878
3029
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
2879
3030
|
app: !1,
|
|
2880
3031
|
nav: !1
|
|
@@ -2885,31 +3036,31 @@ function jn(e) {
|
|
|
2885
3036
|
}
|
|
2886
3037
|
//#endregion
|
|
2887
3038
|
//#region src/screen/pendingNetwork.ts
|
|
2888
|
-
var
|
|
2889
|
-
|
|
2890
|
-
},
|
|
2891
|
-
if (!(
|
|
2892
|
-
if (
|
|
3039
|
+
var $n = 0, er = !1, tr = () => {
|
|
3040
|
+
$n = Math.max(0, $n - 1);
|
|
3041
|
+
}, nr = () => {
|
|
3042
|
+
if (!(er || typeof window > "u")) {
|
|
3043
|
+
if (er = !0, typeof window.fetch == "function") {
|
|
2893
3044
|
let e = window.fetch.bind(window);
|
|
2894
3045
|
window.fetch = (...t) => {
|
|
2895
|
-
|
|
3046
|
+
$n += 1;
|
|
2896
3047
|
let n;
|
|
2897
3048
|
try {
|
|
2898
3049
|
n = e(...t);
|
|
2899
3050
|
} catch (e) {
|
|
2900
|
-
throw
|
|
3051
|
+
throw tr(), e;
|
|
2901
3052
|
}
|
|
2902
|
-
return n.then((e) => (
|
|
2903
|
-
throw
|
|
3053
|
+
return n.then((e) => (tr(), e), (e) => {
|
|
3054
|
+
throw tr(), e;
|
|
2904
3055
|
});
|
|
2905
3056
|
};
|
|
2906
3057
|
}
|
|
2907
3058
|
if (typeof XMLHttpRequest == "function") {
|
|
2908
3059
|
let e = XMLHttpRequest.prototype.send;
|
|
2909
3060
|
XMLHttpRequest.prototype.send = function(...t) {
|
|
2910
|
-
|
|
3061
|
+
$n += 1;
|
|
2911
3062
|
let n = !1, r = () => {
|
|
2912
|
-
n || (n = !0,
|
|
3063
|
+
n || (n = !0, tr());
|
|
2913
3064
|
};
|
|
2914
3065
|
this.addEventListener("loadend", r);
|
|
2915
3066
|
try {
|
|
@@ -2920,28 +3071,28 @@ var Mn = 0, Nn = !1, Pn = () => {
|
|
|
2920
3071
|
};
|
|
2921
3072
|
}
|
|
2922
3073
|
}
|
|
2923
|
-
},
|
|
3074
|
+
}, rr = () => (nr(), $n > 0);
|
|
2924
3075
|
//#endregion
|
|
2925
3076
|
//#region src/screen/animStartAnchor.ts
|
|
2926
|
-
function
|
|
3077
|
+
function ir(e) {
|
|
2927
3078
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
2928
3079
|
}
|
|
2929
|
-
var
|
|
2930
|
-
function
|
|
2931
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
3080
|
+
var ar = 300, or = 20;
|
|
3081
|
+
function sr(e) {
|
|
3082
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, or);
|
|
2932
3083
|
}
|
|
2933
|
-
function
|
|
2934
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
3084
|
+
function cr(e) {
|
|
3085
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of sr(e)) t.decode().catch(() => {});
|
|
2935
3086
|
}
|
|
2936
|
-
var
|
|
3087
|
+
var lr = 3, ur = 40, dr = 24, fr = (e) => {
|
|
2937
3088
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
2938
3089
|
let t = e.querySelectorAll("*").length;
|
|
2939
3090
|
/* v8 ignore stop */
|
|
2940
|
-
return t <
|
|
2941
|
-
},
|
|
3091
|
+
return t < dr ? !1 : ((e.textContent ?? "").trim().length + e.querySelectorAll("img").length * ur) / t < lr;
|
|
3092
|
+
}, pr = (e) => typeof e.getAnimations == "function" && e.getAnimations({ subtree: !0 }).some((e) => {
|
|
2942
3093
|
let t = e.animationName;
|
|
2943
3094
|
return typeof t != "string" || !t.startsWith("flemo-");
|
|
2944
|
-
}),
|
|
3095
|
+
}), mr = (e) => {
|
|
2945
3096
|
/* v8 ignore next -- the settle gate only runs a scope past looksLikeShell,
|
|
2946
3097
|
which already requires querySelectorAll. */
|
|
2947
3098
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
@@ -2949,12 +3100,12 @@ var Hn = 3, Un = 40, Wn = 24, Gn = (e) => {
|
|
|
2949
3100
|
the guard shields exotic embedders. */
|
|
2950
3101
|
let t = typeof e.getBoundingClientRect == "function" ? e.getBoundingClientRect() : null, n = t && t.height > 0 ? t : null, r = 0;
|
|
2951
3102
|
for (let t of Array.from(e.querySelectorAll("img"))) {
|
|
2952
|
-
if (r >=
|
|
3103
|
+
if (r >= or) break;
|
|
2953
3104
|
if (!(t.loading === "lazy" && !t.currentSrc) && !(n && t.getBoundingClientRect().top - n.top >= n.height) && (r += 1, !t.complete)) return !0;
|
|
2954
3105
|
}
|
|
2955
3106
|
return !1;
|
|
2956
3107
|
};
|
|
2957
|
-
function
|
|
3108
|
+
function hr(e, t = {}) {
|
|
2958
3109
|
let n = !1, r = 0, i = [], a = [], o = () => {
|
|
2959
3110
|
if (n) return;
|
|
2960
3111
|
let r = t.scope;
|
|
@@ -2962,7 +3113,7 @@ function Jn(e, t = {}) {
|
|
|
2962
3113
|
e();
|
|
2963
3114
|
return;
|
|
2964
3115
|
}
|
|
2965
|
-
let i =
|
|
3116
|
+
let i = sr(r);
|
|
2966
3117
|
if (i.length === 0) {
|
|
2967
3118
|
e();
|
|
2968
3119
|
return;
|
|
@@ -2979,15 +3130,15 @@ function Jn(e, t = {}) {
|
|
|
2979
3130
|
e();
|
|
2980
3131
|
return;
|
|
2981
3132
|
}
|
|
2982
|
-
if (!
|
|
3133
|
+
if (!fr(r)) {
|
|
2983
3134
|
e();
|
|
2984
3135
|
return;
|
|
2985
3136
|
}
|
|
2986
3137
|
/* v8 ignore start -- performance exists in every runtime under test;
|
|
2987
3138
|
the fallback only shields exotic embedders. */
|
|
2988
|
-
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () =>
|
|
3139
|
+
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () => fr(r) && pr(r), d = () => rr() || mr(r), f = () => {
|
|
2989
3140
|
l || (l = !0, h.disconnect(), clearTimeout(g), clearTimeout(_), clearTimeout(v), s.forEach((e) => cancelAnimationFrame(e)), s = [], e());
|
|
2990
|
-
}, p = () => !
|
|
3141
|
+
}, p = () => !fr(r) && !d() ? 2 : 6, m = () => {
|
|
2991
3142
|
s.forEach((e) => cancelAnimationFrame(e)), s = [];
|
|
2992
3143
|
let e = (t) => {
|
|
2993
3144
|
if (t <= 0) {
|
|
@@ -3045,14 +3196,14 @@ function Jn(e, t = {}) {
|
|
|
3045
3196
|
n = !0, cancelAnimationFrame(l), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), a.forEach((e) => e());
|
|
3046
3197
|
};
|
|
3047
3198
|
}
|
|
3048
|
-
function
|
|
3049
|
-
let n =
|
|
3199
|
+
function gr(e, t = {}) {
|
|
3200
|
+
let n = hr(e, t), r = t.contentSettle?.capMs ?? 0, i = setTimeout(e, 300 + r);
|
|
3050
3201
|
return () => {
|
|
3051
3202
|
n(), clearTimeout(i);
|
|
3052
3203
|
};
|
|
3053
3204
|
}
|
|
3054
|
-
var
|
|
3055
|
-
function
|
|
3205
|
+
var _r = (e) => 300 + (e?.contentSettle?.capMs ?? 0);
|
|
3206
|
+
function vr() {
|
|
3056
3207
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
3057
3208
|
clearTimeout(n.backstop), e.delete(t);
|
|
3058
3209
|
let r = [...n.members];
|
|
@@ -3062,14 +3213,14 @@ function Zn() {
|
|
|
3062
3213
|
return { join: (r, i, a) => {
|
|
3063
3214
|
let o = e.get(r);
|
|
3064
3215
|
if (o) {
|
|
3065
|
-
let e =
|
|
3216
|
+
let e = _r(a);
|
|
3066
3217
|
if (e > o.backstopMs) {
|
|
3067
3218
|
clearTimeout(o.backstop);
|
|
3068
3219
|
let n = o;
|
|
3069
3220
|
n.backstopMs = e, n.backstop = setTimeout(() => t(r, n), e);
|
|
3070
3221
|
}
|
|
3071
3222
|
} else {
|
|
3072
|
-
let n =
|
|
3223
|
+
let n = _r(a), i = {
|
|
3073
3224
|
members: /* @__PURE__ */ new Set(),
|
|
3074
3225
|
backstop: setTimeout(() => t(r, i), n),
|
|
3075
3226
|
backstopMs: n
|
|
@@ -3079,7 +3230,7 @@ function Zn() {
|
|
|
3079
3230
|
let s = o, c = {
|
|
3080
3231
|
release: i,
|
|
3081
3232
|
ready: !1,
|
|
3082
|
-
cancelReadiness:
|
|
3233
|
+
cancelReadiness: hr(() => {
|
|
3083
3234
|
c.ready = !0, n(s) && t(r, s);
|
|
3084
3235
|
}, a)
|
|
3085
3236
|
};
|
|
@@ -3096,7 +3247,7 @@ function Zn() {
|
|
|
3096
3247
|
}
|
|
3097
3248
|
//#endregion
|
|
3098
3249
|
//#region src/screen/observeBarHeight.ts
|
|
3099
|
-
function
|
|
3250
|
+
function yr(e, t) {
|
|
3100
3251
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
3101
3252
|
let n = new ResizeObserver(([e]) => {
|
|
3102
3253
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -3107,14 +3258,14 @@ function Qn(e, t) {
|
|
|
3107
3258
|
}
|
|
3108
3259
|
//#endregion
|
|
3109
3260
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3261
|
+
var br = 0;
|
|
3262
|
+
function xr(e) {
|
|
3112
3263
|
let t = 0, n = () => {
|
|
3113
3264
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
3114
3265
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
3115
3266
|
t = t < 0 ? 0 : t;
|
|
3116
|
-
let n = t -
|
|
3117
|
-
n = n < 0 ? 0 : n,
|
|
3267
|
+
let n = t - br;
|
|
3268
|
+
n = n < 0 ? 0 : n, br ||= t, e(t, n);
|
|
3118
3269
|
});
|
|
3119
3270
|
};
|
|
3120
3271
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -3123,30 +3274,30 @@ function er(e) {
|
|
|
3123
3274
|
}
|
|
3124
3275
|
//#endregion
|
|
3125
3276
|
//#region src/core/engine/imageDecodeOffloader.ts
|
|
3126
|
-
var
|
|
3277
|
+
var Sr = 8, Cr = 2, Q = 96, wr = 15e3, Tr = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", Er = "data-flemo-image-src", Dr = "flemo-image-scale-v1", Or = (e) => {
|
|
3127
3278
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0 || e.boxWidth <= 0 || e.boxHeight <= 0) return !1;
|
|
3128
3279
|
let t = e.boxWidth * e.boxHeight * e.devicePixelRatio * e.devicePixelRatio;
|
|
3129
3280
|
return e.naturalWidth * e.naturalHeight > t * 8;
|
|
3130
|
-
},
|
|
3281
|
+
}, kr = "onmessage = async (e) => {\n const { url, targetWidth, neededArea, ratio } = e.data;\n try {\n const response = await fetch(url);\n if (!response.ok) throw new Error(\"http \" + response.status);\n const blob = await response.blob();\n const full = await createImageBitmap(blob);\n if (full.width * full.height <= neededArea * ratio) {\n full.close();\n postMessage({ url, skip: true });\n return;\n }\n const scale = targetWidth / full.width;\n const canvas = new OffscreenCanvas(targetWidth, Math.max(1, Math.round(full.height * scale)));\n const context = canvas.getContext(\"2d\");\n context.imageSmoothingQuality = \"high\";\n context.drawImage(full, 0, 0, canvas.width, canvas.height);\n full.close();\n const out = await canvas.convertToBlob({ type: \"image/jpeg\", quality: 0.85 });\n postMessage({ url, blob: out });\n } catch (error) {\n postMessage({ url, error: String(error) });\n }\n};", Ar = () => typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap == "function" && typeof MutationObserver < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function", jr = async (e, t) => {
|
|
3131
3282
|
try {
|
|
3132
3283
|
if (typeof caches > "u") return;
|
|
3133
|
-
await (await caches.open(
|
|
3284
|
+
await (await caches.open(Dr)).put(e, new Response(t, { headers: { "content-type": t.type } }));
|
|
3134
3285
|
} catch {}
|
|
3135
|
-
},
|
|
3286
|
+
}, Mr = async (e) => {
|
|
3136
3287
|
try {
|
|
3137
3288
|
if (typeof caches > "u") return null;
|
|
3138
|
-
let t = await (await caches.open(
|
|
3289
|
+
let t = await (await caches.open(Dr)).match(e);
|
|
3139
3290
|
return t ? await t.blob() : null;
|
|
3140
3291
|
} catch {
|
|
3141
3292
|
return null;
|
|
3142
3293
|
}
|
|
3143
3294
|
};
|
|
3144
|
-
function
|
|
3145
|
-
if (!
|
|
3295
|
+
function Nr(e) {
|
|
3296
|
+
if (!Ar()) return () => {};
|
|
3146
3297
|
let t = null, n = !1, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakSet(), s = /* @__PURE__ */ new Set(), c = () => typeof devicePixelRatio == "number" ? devicePixelRatio : 1, l = () => {
|
|
3147
3298
|
if (t) return t;
|
|
3148
3299
|
try {
|
|
3149
|
-
t = new Worker(URL.createObjectURL(new Blob([
|
|
3300
|
+
t = new Worker(URL.createObjectURL(new Blob([kr])));
|
|
3150
3301
|
} catch {
|
|
3151
3302
|
return null;
|
|
3152
3303
|
}
|
|
@@ -3157,7 +3308,7 @@ function fr(e) {
|
|
|
3157
3308
|
return;
|
|
3158
3309
|
}
|
|
3159
3310
|
let o = URL.createObjectURL(n);
|
|
3160
|
-
s.add(o),
|
|
3311
|
+
s.add(o), jr(t, n), u(t, o);
|
|
3161
3312
|
}, t;
|
|
3162
3313
|
}, u = (e, t) => {
|
|
3163
3314
|
r.has(e) || r.set(e, t);
|
|
@@ -3167,12 +3318,12 @@ function fr(e) {
|
|
|
3167
3318
|
if (n) {
|
|
3168
3319
|
if (a.delete(e), clearTimeout(n.timeout), n.detachListeners?.(), n.responsive) {
|
|
3169
3320
|
if (t && t !== "skip") {
|
|
3170
|
-
e.setAttribute(
|
|
3321
|
+
e.setAttribute(Er, n.url), e.removeAttribute("srcset"), e.removeAttribute("sizes");
|
|
3171
3322
|
let r = e.closest("picture");
|
|
3172
3323
|
if (r) for (let e of Array.from(r.querySelectorAll("source"))) e.removeAttribute("srcset");
|
|
3173
3324
|
e.src = t;
|
|
3174
3325
|
}
|
|
3175
|
-
} else e.getAttribute("src") ===
|
|
3326
|
+
} else e.getAttribute("src") === Tr && (t && t !== "skip" ? e.src = t : (e.removeAttribute(Er), e.src = n.url));
|
|
3176
3327
|
n.previousVisibility ? e.style.visibility = n.previousVisibility : e.style.removeProperty("visibility");
|
|
3177
3328
|
}
|
|
3178
3329
|
}, f = (e, t, n) => {
|
|
@@ -3180,7 +3331,7 @@ function fr(e) {
|
|
|
3180
3331
|
let a = l();
|
|
3181
3332
|
if (!a) return;
|
|
3182
3333
|
i.add(e);
|
|
3183
|
-
let o = Math.round(Math.max(Q, t * c()) *
|
|
3334
|
+
let o = Math.round(Math.max(Q, t * c()) * Cr), s = Math.max(t * n, Q * Q) * c() ** 2;
|
|
3184
3335
|
a.postMessage({
|
|
3185
3336
|
url: e,
|
|
3186
3337
|
targetWidth: o,
|
|
@@ -3192,13 +3343,13 @@ function fr(e) {
|
|
|
3192
3343
|
let t = {
|
|
3193
3344
|
url: "",
|
|
3194
3345
|
previousVisibility: e.style.visibility,
|
|
3195
|
-
timeout: setTimeout(() => d(e, null),
|
|
3346
|
+
timeout: setTimeout(() => d(e, null), wr),
|
|
3196
3347
|
responsive: !0
|
|
3197
3348
|
}, i = () => {
|
|
3198
3349
|
/* v8 ignore next -- consider() only routes elements with an https src
|
|
3199
3350
|
here, so the final fallback arm is unreachable. */
|
|
3200
3351
|
let i = e.currentSrc || e.getAttribute("src") || "", o = e.getBoundingClientRect();
|
|
3201
|
-
if (!(/^https?:/.test(i) &&
|
|
3352
|
+
if (!(/^https?:/.test(i) && Or({
|
|
3202
3353
|
naturalWidth: e.naturalWidth,
|
|
3203
3354
|
naturalHeight: e.naturalHeight,
|
|
3204
3355
|
boxWidth: o.width || Q,
|
|
@@ -3214,7 +3365,7 @@ function fr(e) {
|
|
|
3214
3365
|
d(e, l);
|
|
3215
3366
|
return;
|
|
3216
3367
|
}
|
|
3217
|
-
|
|
3368
|
+
Mr(i).then((t) => {
|
|
3218
3369
|
if (!(n || !a.has(e))) {
|
|
3219
3370
|
/* v8 ignore start -- a verdict can only appear via settle(), which
|
|
3220
3371
|
releases every held element of the url first, so a still-held
|
|
@@ -3253,14 +3404,14 @@ function fr(e) {
|
|
|
3253
3404
|
let i = r.get(t);
|
|
3254
3405
|
if (i !== "skip") {
|
|
3255
3406
|
if (i) {
|
|
3256
|
-
e.setAttribute(
|
|
3407
|
+
e.setAttribute(Er, t), e.src = i;
|
|
3257
3408
|
return;
|
|
3258
3409
|
}
|
|
3259
3410
|
a.set(e, {
|
|
3260
3411
|
url: t,
|
|
3261
3412
|
previousVisibility: e.style.visibility,
|
|
3262
|
-
timeout: setTimeout(() => d(e, null),
|
|
3263
|
-
}), e.style.visibility = "hidden", e.setAttribute(
|
|
3413
|
+
timeout: setTimeout(() => d(e, null), wr)
|
|
3414
|
+
}), e.style.visibility = "hidden", e.setAttribute(Er, t), e.src = Tr, Mr(t).then((i) => {
|
|
3264
3415
|
if (n || r.has(t)) return;
|
|
3265
3416
|
if (i) {
|
|
3266
3417
|
let e = URL.createObjectURL(i);
|
|
@@ -3292,9 +3443,9 @@ function fr(e) {
|
|
|
3292
3443
|
};
|
|
3293
3444
|
}
|
|
3294
3445
|
var $ = null;
|
|
3295
|
-
function
|
|
3446
|
+
function Pr() {
|
|
3296
3447
|
return typeof document > "u" || !document.body ? () => {} : ($ ? $.count += 1 : $ = {
|
|
3297
|
-
dispose:
|
|
3448
|
+
dispose: Nr(document.body),
|
|
3298
3449
|
count: 1
|
|
3299
3450
|
}, () => {
|
|
3300
3451
|
$ && (--$.count, $.count <= 0 && ($.dispose(), $ = null));
|
|
@@ -3302,7 +3453,7 @@ function pr() {
|
|
|
3302
3453
|
}
|
|
3303
3454
|
//#endregion
|
|
3304
3455
|
//#region src/utils/isOpaqueColor.ts
|
|
3305
|
-
function
|
|
3456
|
+
function Fr(e) {
|
|
3306
3457
|
let t = e.trim().toLowerCase();
|
|
3307
3458
|
if (t === "transparent" || t === "") return !1;
|
|
3308
3459
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -3313,7 +3464,7 @@ function mr(e) {
|
|
|
3313
3464
|
}
|
|
3314
3465
|
//#endregion
|
|
3315
3466
|
//#region src/utils/buildRoutePath.ts
|
|
3316
|
-
function
|
|
3467
|
+
function Ir(e, n) {
|
|
3317
3468
|
let i = n ?? {}, a = t(e)(Object.fromEntries(Object.entries(i).map(([e, t]) => [e, String(t)]))), o = (typeof e == "string" ? r(e) : e).tokens.filter((e) => e.type === "param").map((e) => e.name), s = Object.fromEntries(Object.entries(i).filter(([e]) => !o.includes(e))), c = new URLSearchParams(s).toString();
|
|
3318
3469
|
return {
|
|
3319
3470
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -3321,4 +3472,4 @@ function hr(e, n) {
|
|
|
3321
3472
|
};
|
|
3322
3473
|
}
|
|
3323
3474
|
//#endregion
|
|
3324
|
-
export {
|
|
3475
|
+
export { ar as ANIM_HOLD_RELEASE_BACKSTOP_MS, Er as OFFLOADED_SRC_ATTR, Sr as OVERSIZE_AREA_RATIO, En as SKIP_ANIMATION_ATTR, s as TaskManger, ir as animHoldKey, Y as animateInline, G as animationName, ie as appendParamsQuery, ot as applyTransitionStyles, Ir as buildRoutePath, Yn as canProgrammaticallyScroll, J as clearInlineAnimation, Ke as collectAnimatedProperties, nt as compileTransitionStyles, Qn as computeBarRiding, pe as computeScreenFreeze, fe as computeScreenFreezeMode, b as consumeSelfInducedPop, vr as createAnimHoldCoordinator, g as createBrowserHistoryDriver, xe as createDecorator, c as createHistoryStore, x as createHistorySync, Nr as createImageDecodeOffloader, ee as createMemoryHistoryDriver, te as createNavigateStore, ne as createNavigationController, Ee as createPartTransition, Se as createRawDecorator, De as createRawPartTransition, me as createRawTransition, ue as createRouterScope, de as createScreenSelector, P as createScreenStore, _ as createSelfPopGuard, ae as createStepController, Zn as createSwipeController, I as createTransition, Gn as createTransitionEngine, se as createTransitionStore, z as cupertino, Te as decoratorMap, cr as eagerlyDecodeImages, Je as easingToCss, Pr as ensureImageDecodeOffloader, k as ensureScopeHistorySync, p as ensureWindowHistoryState, pt as enteringInitialStyle, Kn as findScrollable, l as getMatchedPathPattern, u as getParams, Bt as holdCompositorWarm, Fr as isOpaqueColor, f as isServer, ve as layout, y as markSelfInducedPop, ce as matchesPathname, B as material, ye as none, yr as observeBarHeight, xr as observeViewportScrollHeight, Jn as overflowsAxis, we as overlay, H as partTransitionMap, re as readStepParams, ft as registerTransitionDefinitions, A as releaseScopeHistorySync, be as resolveTransition, gr as scheduleAnimHoldRelease, d as seedInitialHistory, m as seedRouterEntry, Or as shouldOffloadImage, oe as subscribeStepParamsRestore, W as targetToDecls, V as transitionMap, K as variantHasAnimation };
|