@orioncactuscorp/ui 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/README.md +15 -15
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.js +9 -9
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/Badge.js +20 -20
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Button/Button.js +5 -5
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/CheckMark/CheckMark.js +6 -6
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +15 -15
- package/dist/components/Field/Field.css +1 -1
- package/dist/components/IconButton/IconButton.css +1 -1
- package/dist/components/IconButton/IconButton.js +9 -9
- package/dist/components/Interaction/Interaction.css +1 -1
- package/dist/components/Interaction/Interaction.js +19 -12
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/bottomSheetRelease.js +114 -0
- package/dist/components/Modal/modalScrollArbitration.js +49 -47
- package/dist/components/Modal/useModalDrag.js +928 -983
- package/dist/components/PositionSnap/PositionSnap.css +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.css +1 -1
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +262 -264
- package/dist/components/Skeleton/Skeleton.css +1 -1
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Switch/Switch.js +7 -7
- package/dist/components/Tabs/Tabs.css +1 -1
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextButton/TextButton.js +17 -17
- package/dist/foundations/touch.css +1 -0
- package/dist/foundations.css +1 -0
- package/dist/styles.css +22 -21
- package/dist/ui/src/components/Interaction/Interaction.d.ts.map +1 -1
- package/dist/ui/src/components/Interaction/types.d.ts +2 -0
- package/dist/ui/src/components/Interaction/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/bottomSheetRelease.d.ts +19 -0
- package/dist/ui/src/components/Modal/bottomSheetRelease.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/index.d.ts +1 -1
- package/dist/ui/src/components/ScrollArea/index.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/types.d.ts +2 -0
- package/dist/ui/src/components/ScrollArea/types.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +1 -1
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/vscode/oc-ui-vars.css +1 -0
- package/docs/responsive-foundation-profile.md +1 -0
- package/docs/scss-helpers.md +1 -3
- package/docs/selector-contract.md +27 -3
- package/docs/tokens.md +6 -0
- package/package.json +1 -1
- package/src/scss/foundations/touch.scss +3 -0
- package/src/scss/foundations/touch.test.ts +37 -0
- package/src/scss/foundations/typo.scss +1 -1
- package/src/scss/index.scss +1 -0
- package/src/scss/mixins/_fluid.test.ts +0 -16
- package/src/scss/mixins/_utils.scss +0 -6
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { useRef as
|
|
1
|
+
import { useRef as v, useLayoutEffect as j, useCallback as p, useEffect as Nt } from "react";
|
|
2
2
|
import { createSpringAnimator as Qt } from "../../utils/spring/animator.js";
|
|
3
3
|
import { resolveOcMotion as Zt } from "../../utils/motion.js";
|
|
4
|
-
import { resolveModalPopupSnapPositions as
|
|
5
|
-
import { setModalBodyTouchScrollLock as qt, shouldLockModalBodyTouchScroll as
|
|
6
|
-
import { resolveResizedBottomSheetTranslate as
|
|
7
|
-
import { getPositionSnapPointDistance as
|
|
8
|
-
import { POSITION_SNAP_DRAG_FOLLOWER_SPRING as
|
|
9
|
-
|
|
4
|
+
import { resolveModalPopupSnapPositions as ar } from "./snapPoints.js";
|
|
5
|
+
import { setModalBodyTouchScrollLock as qt, shouldLockModalBodyTouchScroll as or, shouldIgnoreDragTarget as te, getScrollableAncestor as sr, hasActiveTextSelection as ir, getBottomTouchDragDecision as lr, getPopupTouchDragDecision as cr } from "./modalScrollArbitration.js";
|
|
6
|
+
import { resolveResizedBottomSheetTranslate as ur, resolveBottomSheetRestState as dr, resolveUndimmedCollapseTranslate as pr } from "./bottomSheetGeometry.js";
|
|
7
|
+
import { getPositionSnapPointDistance as gt, getReleasePositionSnapTarget as fr } from "../PositionSnap/policy.js";
|
|
8
|
+
import { POSITION_SNAP_DRAG_FOLLOWER_SPRING as mr } from "../PositionSnap/gesture.js";
|
|
9
|
+
import { resolveBottomSheetRelease as gr } from "./bottomSheetRelease.js";
|
|
10
|
+
const R = {
|
|
10
11
|
dragStartThresholdPx: {
|
|
11
12
|
touch: 10,
|
|
12
13
|
mouse: 2
|
|
@@ -17,12 +18,7 @@ const F = {
|
|
|
17
18
|
selectionArbitrationThresholdPx: 12,
|
|
18
19
|
releaseVelocity: {
|
|
19
20
|
sampleWindowMs: 90,
|
|
20
|
-
maxPxPerSecond: 4e3
|
|
21
|
-
flickThresholdPxPerMs: 0.55
|
|
22
|
-
},
|
|
23
|
-
snapProjection: {
|
|
24
|
-
lookaheadSeconds: 0.16,
|
|
25
|
-
maxDistancePx: 24
|
|
21
|
+
maxPxPerSecond: 4e3
|
|
26
22
|
},
|
|
27
23
|
dismissal: {
|
|
28
24
|
minDistancePx: 24
|
|
@@ -36,126 +32,91 @@ const F = {
|
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
}, hr = [], yr = [];
|
|
39
|
-
function ke(r) {
|
|
40
|
-
r.cancelable !== !1 && r.preventDefault();
|
|
41
|
-
}
|
|
42
|
-
function N(r, o, l) {
|
|
43
|
-
return Math.min(Math.max(r, o), l);
|
|
44
|
-
}
|
|
45
35
|
function Oe(r) {
|
|
46
|
-
|
|
36
|
+
r.cancelable !== !1 && r.preventDefault();
|
|
47
37
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
(l, n) => Math.abs(n - o) < Math.abs(l - o) ? n : l
|
|
51
|
-
);
|
|
38
|
+
function N(r, s, c) {
|
|
39
|
+
return Math.min(Math.max(r, s), c);
|
|
52
40
|
}
|
|
53
|
-
function
|
|
41
|
+
function ke({
|
|
54
42
|
deltaX: r,
|
|
55
|
-
deltaY:
|
|
56
|
-
placement:
|
|
43
|
+
deltaY: s,
|
|
44
|
+
placement: c
|
|
57
45
|
}) {
|
|
58
|
-
return
|
|
46
|
+
return c === "bottom" ? Math.abs(s) : Math.hypot(r, s);
|
|
59
47
|
}
|
|
60
|
-
function
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const y = r[i];
|
|
65
|
-
if (y !== void 0 && y < o - 1)
|
|
66
|
-
return y;
|
|
67
|
-
}
|
|
68
|
-
return r[0] ?? 0;
|
|
69
|
-
}
|
|
70
|
-
function xr(r, o, l, n, i = l) {
|
|
71
|
-
const g = Pr(r, o, n), P = n === "down" ? Math.max(l, i) : Math.min(l, i);
|
|
72
|
-
if (n === "down") {
|
|
73
|
-
if (r.filter(
|
|
74
|
-
(V) => V > o + 1 && V <= l + 1
|
|
75
|
-
).length === 0) return g;
|
|
76
|
-
const nt = r.filter(
|
|
77
|
-
(V) => V > o + 1 && V <= P + 1
|
|
78
|
-
);
|
|
79
|
-
return nt[nt.length - 1] ?? g;
|
|
80
|
-
}
|
|
81
|
-
return r.filter(
|
|
82
|
-
(E) => E < o - 1 && E >= l - 1
|
|
83
|
-
).length === 0 ? g : r.filter(
|
|
84
|
-
(E) => E < o - 1 && E >= P - 1
|
|
85
|
-
)[0] ?? g;
|
|
86
|
-
}
|
|
87
|
-
function Fe(r, o) {
|
|
88
|
-
if (o <= 0) return 0;
|
|
89
|
-
const l = o, { resistance: n } = F.rubberBand;
|
|
90
|
-
return r * n * l / (l + n * r);
|
|
48
|
+
function Ne(r, s) {
|
|
49
|
+
if (s <= 0) return 0;
|
|
50
|
+
const c = s, { resistance: a } = R.rubberBand;
|
|
51
|
+
return r * a * c / (c + a * r);
|
|
91
52
|
}
|
|
92
53
|
function ee({
|
|
93
54
|
targetTranslate: r,
|
|
94
|
-
minTranslate:
|
|
95
|
-
maxTranslate:
|
|
96
|
-
minBoundaryLimit:
|
|
55
|
+
minTranslate: s,
|
|
56
|
+
maxTranslate: c,
|
|
57
|
+
minBoundaryLimit: a,
|
|
97
58
|
maxBoundaryLimit: i
|
|
98
59
|
}) {
|
|
99
|
-
return r <
|
|
60
|
+
return r < s ? s - Ne(s - r, a) : r > c ? c + Ne(r - c, i) : r;
|
|
100
61
|
}
|
|
101
|
-
function
|
|
62
|
+
function Fe(r) {
|
|
102
63
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest('[data-oc-part="handle"], [data-oc-part="header"]');
|
|
103
64
|
}
|
|
104
|
-
function
|
|
65
|
+
function Ve(r) {
|
|
105
66
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest(
|
|
106
67
|
'[data-oc-part="handle"], [data-oc-component="modal-navigation"]'
|
|
107
68
|
);
|
|
108
69
|
}
|
|
109
|
-
function
|
|
70
|
+
function Tr(r) {
|
|
110
71
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest('[data-oc-component="modal-navigation"]');
|
|
111
72
|
}
|
|
112
|
-
function
|
|
73
|
+
function xr(r) {
|
|
113
74
|
return typeof Element > "u" || !(r instanceof Element) ? null : r.closest('[data-oc-component="modal-navigation"]');
|
|
114
75
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
76
|
+
function Pr(r, s) {
|
|
77
|
+
return s ? !0 : r.pointerType ? r.pointerType === "touch" : typeof window > "u" ? !1 : window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
117
78
|
}
|
|
118
|
-
function
|
|
79
|
+
function ze(r, s) {
|
|
119
80
|
if (!r.length)
|
|
120
81
|
return {
|
|
121
82
|
minTranslate: 0,
|
|
122
83
|
maxTranslate: 0
|
|
123
84
|
};
|
|
124
|
-
const
|
|
125
|
-
if (Math.abs(i -
|
|
126
|
-
const
|
|
85
|
+
const c = r.map((T) => T[s]), a = Math.min(...c), i = Math.max(...c);
|
|
86
|
+
if (Math.abs(i - a) < 0.5) {
|
|
87
|
+
const T = (a + i) / 2;
|
|
127
88
|
return {
|
|
128
|
-
minTranslate:
|
|
129
|
-
maxTranslate:
|
|
89
|
+
minTranslate: T,
|
|
90
|
+
maxTranslate: T
|
|
130
91
|
};
|
|
131
92
|
}
|
|
132
93
|
return {
|
|
133
|
-
minTranslate:
|
|
94
|
+
minTranslate: a,
|
|
134
95
|
maxTranslate: i
|
|
135
96
|
};
|
|
136
97
|
}
|
|
137
|
-
function
|
|
138
|
-
for (let
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
98
|
+
function He(r, s) {
|
|
99
|
+
for (let c = 0; c < r.length; c += 1) {
|
|
100
|
+
const a = "item" in r && typeof r.item == "function" ? r.item(c) : r[c];
|
|
101
|
+
if (a?.identifier === s) return a;
|
|
141
102
|
}
|
|
142
103
|
return null;
|
|
143
104
|
}
|
|
144
|
-
function
|
|
105
|
+
function je(r) {
|
|
145
106
|
if (!r) return { x: 0, y: 0 };
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const i =
|
|
107
|
+
const s = window.getComputedStyle(r).transform;
|
|
108
|
+
if (!s || s === "none") return { x: 0, y: 0 };
|
|
109
|
+
const c = s.match(/^matrix\((.+)\)$/);
|
|
110
|
+
if (c) {
|
|
111
|
+
const i = c[1].split(",").map((T) => T.trim());
|
|
151
112
|
return {
|
|
152
113
|
x: Number.parseFloat(i[4] ?? "0") || 0,
|
|
153
114
|
y: Number.parseFloat(i[5] ?? "0") || 0
|
|
154
115
|
};
|
|
155
116
|
}
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
const i =
|
|
117
|
+
const a = s.match(/^matrix3d\((.+)\)$/);
|
|
118
|
+
if (a) {
|
|
119
|
+
const i = a[1].split(",").map((T) => T.trim());
|
|
159
120
|
return {
|
|
160
121
|
x: Number.parseFloat(i[12] ?? "0") || 0,
|
|
161
122
|
y: Number.parseFloat(i[13] ?? "0") || 0
|
|
@@ -164,81 +125,81 @@ function Ke(r) {
|
|
|
164
125
|
return { x: 0, y: 0 };
|
|
165
126
|
}
|
|
166
127
|
function re(r) {
|
|
167
|
-
return
|
|
128
|
+
return je(r).y;
|
|
168
129
|
}
|
|
169
|
-
function
|
|
170
|
-
return
|
|
130
|
+
function Re(r) {
|
|
131
|
+
return je(r);
|
|
171
132
|
}
|
|
172
|
-
function
|
|
133
|
+
function mt(r) {
|
|
173
134
|
if (!r || !/^-?\d*\.?\d+(?:px)?$/.test(r.trim())) return;
|
|
174
|
-
const
|
|
175
|
-
return Number.isFinite(
|
|
135
|
+
const s = Number.parseFloat(r);
|
|
136
|
+
return Number.isFinite(s) ? s : void 0;
|
|
176
137
|
}
|
|
177
|
-
function
|
|
138
|
+
function q() {
|
|
178
139
|
return Date.now();
|
|
179
140
|
}
|
|
180
|
-
function
|
|
181
|
-
const
|
|
182
|
-
for (; r.length > 2 && (r[1]?.time ??
|
|
141
|
+
function vr(r, s) {
|
|
142
|
+
const c = s - R.releaseVelocity.sampleWindowMs;
|
|
143
|
+
for (; r.length > 2 && (r[1]?.time ?? s) < c; )
|
|
183
144
|
r.shift();
|
|
184
145
|
}
|
|
185
|
-
function
|
|
186
|
-
const
|
|
146
|
+
function wt(r, s) {
|
|
147
|
+
const c = s.time ?? q();
|
|
187
148
|
r.samples.push({
|
|
188
|
-
time:
|
|
189
|
-
pageX:
|
|
190
|
-
pageY:
|
|
191
|
-
translateX:
|
|
192
|
-
translateY:
|
|
193
|
-
}),
|
|
149
|
+
time: c,
|
|
150
|
+
pageX: s.pageX,
|
|
151
|
+
pageY: s.pageY,
|
|
152
|
+
translateX: s.translateX,
|
|
153
|
+
translateY: s.translateY
|
|
154
|
+
}), vr(r.samples, c);
|
|
194
155
|
}
|
|
195
|
-
function
|
|
156
|
+
function Ft(r, s) {
|
|
196
157
|
return {
|
|
197
|
-
x: r.startTranslateX +
|
|
198
|
-
y: r.startTranslate +
|
|
158
|
+
x: r.startTranslateX + s.pageX - r.startX,
|
|
159
|
+
y: r.startTranslate + s.pageY - r.startY
|
|
199
160
|
};
|
|
200
161
|
}
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
pageX:
|
|
205
|
-
pageY:
|
|
206
|
-
translateX:
|
|
207
|
-
translateY:
|
|
162
|
+
function $e(r, s) {
|
|
163
|
+
const c = Ft(r, s);
|
|
164
|
+
wt(r, {
|
|
165
|
+
pageX: s.pageX,
|
|
166
|
+
pageY: s.pageY,
|
|
167
|
+
translateX: c.x,
|
|
168
|
+
translateY: c.y
|
|
208
169
|
});
|
|
209
170
|
}
|
|
210
|
-
function
|
|
171
|
+
function Ue({
|
|
211
172
|
session: r,
|
|
212
|
-
fallbackDeltaY:
|
|
213
|
-
fallbackElapsed:
|
|
173
|
+
fallbackDeltaY: s,
|
|
174
|
+
fallbackElapsed: c
|
|
214
175
|
}) {
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const w = Math.max(
|
|
176
|
+
const a = r.samples[r.samples.length - 1], { maxPxPerSecond: i, sampleWindowMs: T } = R.releaseVelocity;
|
|
177
|
+
if (a) {
|
|
178
|
+
const h = a.time - T, x = r.samples.find((w) => w.time >= h) ?? r.samples[0];
|
|
179
|
+
if (x && x !== a) {
|
|
180
|
+
const w = Math.max(a.time - x.time, 1), L = (a.translateY - x.translateY) / w * 1e3;
|
|
220
181
|
if (Number.isFinite(L))
|
|
221
182
|
return N(L, -i, i);
|
|
222
183
|
}
|
|
223
184
|
}
|
|
224
185
|
return N(
|
|
225
|
-
|
|
186
|
+
s / Math.max(c, 1) * 1e3,
|
|
226
187
|
-i,
|
|
227
188
|
i
|
|
228
189
|
);
|
|
229
190
|
}
|
|
230
|
-
function
|
|
191
|
+
function _e({
|
|
231
192
|
session: r,
|
|
232
|
-
fallbackDelta:
|
|
233
|
-
fallbackElapsed:
|
|
193
|
+
fallbackDelta: s,
|
|
194
|
+
fallbackElapsed: c
|
|
234
195
|
}) {
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
const w = Math.max(
|
|
240
|
-
x: (
|
|
241
|
-
y: (
|
|
196
|
+
const a = r.samples[r.samples.length - 1], { maxPxPerSecond: i, sampleWindowMs: T } = R.releaseVelocity;
|
|
197
|
+
if (a) {
|
|
198
|
+
const h = a.time - T, x = r.samples.find((w) => w.time >= h) ?? r.samples[0];
|
|
199
|
+
if (x && x !== a) {
|
|
200
|
+
const w = Math.max(a.time - x.time, 1), L = {
|
|
201
|
+
x: (a.translateX - x.translateX) / w * 1e3,
|
|
202
|
+
y: (a.translateY - x.translateY) / w * 1e3
|
|
242
203
|
};
|
|
243
204
|
if (Number.isFinite(L.x) && Number.isFinite(L.y))
|
|
244
205
|
return {
|
|
@@ -249,228 +210,218 @@ function je({
|
|
|
249
210
|
}
|
|
250
211
|
return {
|
|
251
212
|
x: N(
|
|
252
|
-
|
|
213
|
+
s.x / Math.max(c, 1) * 1e3,
|
|
253
214
|
-i,
|
|
254
215
|
i
|
|
255
216
|
),
|
|
256
217
|
y: N(
|
|
257
|
-
|
|
218
|
+
s.y / Math.max(c, 1) * 1e3,
|
|
258
219
|
-i,
|
|
259
220
|
i
|
|
260
221
|
)
|
|
261
222
|
};
|
|
262
223
|
}
|
|
263
|
-
function
|
|
264
|
-
currentTranslate: r,
|
|
265
|
-
releaseVelocity: o
|
|
266
|
-
}) {
|
|
267
|
-
const { lookaheadSeconds: l, maxDistancePx: n } = F.snapProjection;
|
|
268
|
-
return r + N(o * l, -n, n);
|
|
269
|
-
}
|
|
270
|
-
function Yr(r) {
|
|
271
|
-
return Math.abs(r) / 1e3 > F.releaseVelocity.flickThresholdPxPerMs;
|
|
272
|
-
}
|
|
273
|
-
function Je(r) {
|
|
224
|
+
function Ke(r) {
|
|
274
225
|
return r === "top" || r.startsWith("top-") ? "top" : r === "bottom" || r.startsWith("bottom-") ? "bottom" : "center";
|
|
275
226
|
}
|
|
276
|
-
function
|
|
227
|
+
function wr({
|
|
277
228
|
target: r,
|
|
278
|
-
targets:
|
|
229
|
+
targets: s
|
|
279
230
|
}) {
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
return
|
|
283
|
-
(
|
|
284
|
-
|
|
285
|
-
|
|
231
|
+
const c = s.filter((a) => a !== r);
|
|
232
|
+
if (c.length)
|
|
233
|
+
return c.reduce(
|
|
234
|
+
(a, i) => Math.min(
|
|
235
|
+
a,
|
|
236
|
+
gt(r, i)
|
|
286
237
|
),
|
|
287
238
|
Number.POSITIVE_INFINITY
|
|
288
239
|
);
|
|
289
240
|
}
|
|
290
|
-
function
|
|
241
|
+
function Sr({
|
|
291
242
|
closeThreshold: r,
|
|
292
|
-
currentTarget:
|
|
293
|
-
surfaceSize:
|
|
294
|
-
targets:
|
|
243
|
+
currentTarget: s,
|
|
244
|
+
surfaceSize: c,
|
|
245
|
+
targets: a
|
|
295
246
|
}) {
|
|
296
|
-
const i =
|
|
297
|
-
|
|
298
|
-
|
|
247
|
+
const i = Ke(s.key), T = i === "center" ? Math.min(c.width, c.height) : c.height, h = Math.max(
|
|
248
|
+
R.dismissal.minDistancePx,
|
|
249
|
+
T * r
|
|
299
250
|
);
|
|
300
|
-
if (i !== "center") return
|
|
301
|
-
const
|
|
302
|
-
target:
|
|
303
|
-
targets:
|
|
251
|
+
if (i !== "center") return h;
|
|
252
|
+
const x = wr({
|
|
253
|
+
target: s,
|
|
254
|
+
targets: a
|
|
304
255
|
});
|
|
305
|
-
return !
|
|
256
|
+
return !x || !Number.isFinite(x) ? h : Math.max(h, x * 0.75);
|
|
306
257
|
}
|
|
307
|
-
function
|
|
258
|
+
function Dr({
|
|
308
259
|
currentTarget: r,
|
|
309
|
-
currentTranslate:
|
|
260
|
+
currentTranslate: s
|
|
310
261
|
}) {
|
|
311
|
-
switch (
|
|
262
|
+
switch (Ke(r.key)) {
|
|
312
263
|
case "top":
|
|
313
|
-
return r.y -
|
|
264
|
+
return r.y - s.y;
|
|
314
265
|
case "bottom":
|
|
315
|
-
return
|
|
266
|
+
return s.y - r.y;
|
|
316
267
|
case "center":
|
|
317
|
-
return
|
|
268
|
+
return gt(r, s);
|
|
318
269
|
}
|
|
319
270
|
}
|
|
320
|
-
function
|
|
271
|
+
function Xr({
|
|
321
272
|
closeThreshold: r,
|
|
322
|
-
currentTarget:
|
|
323
|
-
currentTranslate:
|
|
324
|
-
releaseTarget:
|
|
273
|
+
currentTarget: s,
|
|
274
|
+
currentTranslate: c,
|
|
275
|
+
releaseTarget: a,
|
|
325
276
|
surfaceSize: i,
|
|
326
|
-
targets:
|
|
277
|
+
targets: T
|
|
327
278
|
}) {
|
|
328
|
-
if (
|
|
329
|
-
const
|
|
330
|
-
currentTarget:
|
|
331
|
-
currentTranslate:
|
|
279
|
+
if (a.key !== s.key) return !1;
|
|
280
|
+
const h = Dr({
|
|
281
|
+
currentTarget: s,
|
|
282
|
+
currentTranslate: c
|
|
332
283
|
});
|
|
333
|
-
return
|
|
284
|
+
return h <= 0 ? !1 : h >= Sr({
|
|
334
285
|
closeThreshold: r,
|
|
335
|
-
currentTarget:
|
|
286
|
+
currentTarget: s,
|
|
336
287
|
surfaceSize: i,
|
|
337
|
-
targets:
|
|
288
|
+
targets: T
|
|
338
289
|
});
|
|
339
290
|
}
|
|
340
|
-
function
|
|
291
|
+
function Yr({
|
|
341
292
|
presentationState: r,
|
|
342
|
-
releaseTranslate:
|
|
343
|
-
visibleTranslate:
|
|
293
|
+
releaseTranslate: s,
|
|
294
|
+
visibleTranslate: c
|
|
344
295
|
}) {
|
|
345
|
-
return r !== "visible" || Math.abs(
|
|
296
|
+
return r !== "visible" || Math.abs(s - c) > 1;
|
|
346
297
|
}
|
|
347
|
-
function
|
|
298
|
+
function Er({
|
|
348
299
|
drag: r,
|
|
349
|
-
placement:
|
|
350
|
-
snapPositionCount:
|
|
300
|
+
placement: s,
|
|
301
|
+
snapPositionCount: c
|
|
351
302
|
}) {
|
|
352
|
-
return
|
|
303
|
+
return s === "popup" && (r === "content" || r === "handle") && c > 0;
|
|
353
304
|
}
|
|
354
|
-
function
|
|
305
|
+
function Mr({
|
|
355
306
|
dismissible: r,
|
|
356
|
-
peekTranslate:
|
|
357
|
-
sheetHeight:
|
|
358
|
-
visibleTranslate:
|
|
307
|
+
peekTranslate: s,
|
|
308
|
+
sheetHeight: c,
|
|
309
|
+
visibleTranslate: a
|
|
359
310
|
}) {
|
|
360
311
|
return {
|
|
361
|
-
maxTranslate:
|
|
312
|
+
maxTranslate: s > 0 ? s : r ? c : a,
|
|
362
313
|
minTranslate: 0
|
|
363
314
|
};
|
|
364
315
|
}
|
|
365
|
-
function We(r,
|
|
366
|
-
const
|
|
367
|
-
return r && Math.abs(r.maxTranslate - r.minTranslate) ||
|
|
316
|
+
function We(r, s = 1) {
|
|
317
|
+
const c = Math.max(s, 1);
|
|
318
|
+
return r && Math.abs(r.maxTranslate - r.minTranslate) || c;
|
|
368
319
|
}
|
|
369
320
|
function Ge({
|
|
370
321
|
limit: r,
|
|
371
|
-
viewportSize:
|
|
372
|
-
viewportLimitRatio:
|
|
322
|
+
viewportSize: s,
|
|
323
|
+
viewportLimitRatio: c
|
|
373
324
|
}) {
|
|
374
|
-
const
|
|
375
|
-
return
|
|
325
|
+
const a = Math.max(r, 0);
|
|
326
|
+
return s <= 0 ? a : Math.min(a, s * c);
|
|
376
327
|
}
|
|
377
|
-
function
|
|
328
|
+
function br({
|
|
378
329
|
minTranslate: r,
|
|
379
|
-
sheetHeight:
|
|
380
|
-
surfaceMotion:
|
|
330
|
+
sheetHeight: s,
|
|
331
|
+
surfaceMotion: c
|
|
381
332
|
}) {
|
|
382
|
-
const
|
|
333
|
+
const a = c.parentElement?.getBoundingClientRect(), i = a?.top ?? 0, T = a && a.height > 0 ? a.height : window.innerHeight, h = c.getBoundingClientRect(), x = re(c), w = h.top - x + r, L = Math.max(w - i, 0), { observedViewportLimitRatio: k } = R.rubberBand;
|
|
383
334
|
return {
|
|
384
335
|
minBoundaryLimit: Ge({
|
|
385
336
|
limit: L,
|
|
386
|
-
viewportSize:
|
|
387
|
-
viewportLimitRatio:
|
|
337
|
+
viewportSize: T,
|
|
338
|
+
viewportLimitRatio: k.top
|
|
388
339
|
}),
|
|
389
340
|
maxBoundaryLimit: Ge({
|
|
390
|
-
limit:
|
|
391
|
-
viewportSize:
|
|
392
|
-
viewportLimitRatio:
|
|
341
|
+
limit: s,
|
|
342
|
+
viewportSize: T,
|
|
343
|
+
viewportLimitRatio: k.bottom
|
|
393
344
|
})
|
|
394
345
|
};
|
|
395
346
|
}
|
|
396
|
-
function
|
|
347
|
+
function Lr({
|
|
397
348
|
sheetHeight: r,
|
|
398
|
-
peekTranslate:
|
|
399
|
-
snapHeights:
|
|
400
|
-
backdropFromHeight:
|
|
349
|
+
peekTranslate: s,
|
|
350
|
+
snapHeights: c,
|
|
351
|
+
backdropFromHeight: a
|
|
401
352
|
}) {
|
|
402
|
-
const i =
|
|
403
|
-
if (
|
|
404
|
-
let
|
|
405
|
-
for (const
|
|
406
|
-
|
|
353
|
+
const i = s > 0 ? Math.max(0, r - s) : 0;
|
|
354
|
+
if (a !== void 0) {
|
|
355
|
+
let h = -1;
|
|
356
|
+
for (const x of c)
|
|
357
|
+
x < a - 0.5 && x > h && (h = x);
|
|
407
358
|
return {
|
|
408
|
-
dimmedHeight:
|
|
409
|
-
undimmedHeight:
|
|
359
|
+
dimmedHeight: a,
|
|
360
|
+
undimmedHeight: h >= 0 ? h : i
|
|
410
361
|
};
|
|
411
362
|
}
|
|
412
|
-
let
|
|
413
|
-
for (const
|
|
414
|
-
|
|
415
|
-
return { dimmedHeight:
|
|
363
|
+
let T = r;
|
|
364
|
+
for (const h of c)
|
|
365
|
+
h < T && (T = h);
|
|
366
|
+
return { dimmedHeight: T, undimmedHeight: i };
|
|
416
367
|
}
|
|
417
|
-
function
|
|
368
|
+
function Ar({
|
|
418
369
|
rubberBand: r,
|
|
419
|
-
targetTranslate:
|
|
420
|
-
sheetHeight:
|
|
421
|
-
bounds:
|
|
370
|
+
targetTranslate: s,
|
|
371
|
+
sheetHeight: c,
|
|
372
|
+
bounds: a,
|
|
422
373
|
rubberBandLimits: i,
|
|
423
|
-
backdropBoundaries:
|
|
374
|
+
backdropBoundaries: T
|
|
424
375
|
}) {
|
|
425
|
-
const
|
|
376
|
+
const h = N(
|
|
426
377
|
r ? ee({
|
|
427
|
-
targetTranslate:
|
|
378
|
+
targetTranslate: s,
|
|
428
379
|
...i,
|
|
429
|
-
...
|
|
430
|
-
}) :
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
),
|
|
434
|
-
|
|
380
|
+
...a
|
|
381
|
+
}) : s,
|
|
382
|
+
a.minTranslate - i.minBoundaryLimit,
|
|
383
|
+
a.maxTranslate + i.maxBoundaryLimit
|
|
384
|
+
), x = Math.max(-h, 0), w = Math.max(h, 0), k = (c - w - T.undimmedHeight) / Math.max(
|
|
385
|
+
T.dimmedHeight - T.undimmedHeight,
|
|
435
386
|
1
|
|
436
387
|
);
|
|
437
388
|
return {
|
|
438
|
-
translate:
|
|
439
|
-
overshootFillHeight:
|
|
440
|
-
backdropOpacity: N(
|
|
389
|
+
translate: h,
|
|
390
|
+
overshootFillHeight: x,
|
|
391
|
+
backdropOpacity: N(k, 0, 1)
|
|
441
392
|
};
|
|
442
393
|
}
|
|
443
|
-
function
|
|
394
|
+
function Hr({
|
|
444
395
|
enabled: r,
|
|
445
|
-
drag:
|
|
446
|
-
open:
|
|
447
|
-
placement:
|
|
396
|
+
drag: s,
|
|
397
|
+
open: c,
|
|
398
|
+
placement: a,
|
|
448
399
|
surfaceMotionRef: i,
|
|
449
|
-
surfaceMotionNode:
|
|
450
|
-
backdropRef:
|
|
451
|
-
bodyNode:
|
|
400
|
+
surfaceMotionNode: T,
|
|
401
|
+
backdropRef: h,
|
|
402
|
+
bodyNode: x,
|
|
452
403
|
snapHeights: w = hr,
|
|
453
404
|
sheetHeight: L,
|
|
454
|
-
backdropFromHeight:
|
|
455
|
-
onBackdropDimRestChange:
|
|
456
|
-
snapPositions:
|
|
457
|
-
defaultSnapPosition:
|
|
405
|
+
backdropFromHeight: k,
|
|
406
|
+
onBackdropDimRestChange: Vt,
|
|
407
|
+
snapPositions: ht = yr,
|
|
408
|
+
defaultSnapPosition: St,
|
|
458
409
|
peekHeight: zt,
|
|
459
410
|
peekFallback: ne,
|
|
460
|
-
presentationState:
|
|
411
|
+
presentationState: F,
|
|
461
412
|
setPresentationState: Ht,
|
|
462
|
-
requestClose:
|
|
413
|
+
requestClose: rt,
|
|
463
414
|
canCloseAttempt: ae,
|
|
464
|
-
dismissible:
|
|
415
|
+
dismissible: V = !0,
|
|
465
416
|
backdropHidden: Rt = !1,
|
|
466
417
|
visibleTranslate: D = 0,
|
|
467
418
|
shouldDeferBottomSettle: oe,
|
|
468
419
|
refreshScrollState: $t,
|
|
469
|
-
closeThreshold:
|
|
420
|
+
closeThreshold: Dt = 0.35,
|
|
470
421
|
scrollLockTimeout: se = 500,
|
|
471
422
|
popupSnapLayoutVersion: ie = 0
|
|
472
423
|
}) {
|
|
473
|
-
const
|
|
424
|
+
const Y = v({
|
|
474
425
|
dragging: !1,
|
|
475
426
|
allowed: !1,
|
|
476
427
|
chrome: !1,
|
|
@@ -490,196 +441,196 @@ function _r({
|
|
|
490
441
|
samples: [],
|
|
491
442
|
pointerId: null,
|
|
492
443
|
touchId: null
|
|
493
|
-
}),
|
|
444
|
+
}), $ = v(x), Ut = v(null), le = v(Rt), ce = v(!1), ue = v(!1), Je = v((t) => {
|
|
494
445
|
t.preventDefault();
|
|
495
|
-
}),
|
|
446
|
+
}), Xt = v(0), _t = v(!1), z = v(null), H = v(
|
|
496
447
|
null
|
|
497
|
-
),
|
|
448
|
+
), Yt = v(null), K = v(null), yt = v(0), U = v(null), Wt = v(!1), Gt = v(!1), de = v(F), Et = v({
|
|
498
449
|
kind: "default-snap"
|
|
499
|
-
}),
|
|
500
|
-
drag:
|
|
501
|
-
placement:
|
|
502
|
-
snapPositionCount:
|
|
503
|
-
}), ge = `${
|
|
504
|
-
|
|
505
|
-
he.current =
|
|
506
|
-
}, [
|
|
450
|
+
}), pe = v(L ?? null), fe = v(D), me = v(w), jt = v(!1), nt = v(!1), E = Er({
|
|
451
|
+
drag: s,
|
|
452
|
+
placement: a,
|
|
453
|
+
snapPositionCount: ht.length
|
|
454
|
+
}), ge = `${St ?? ""}:${ht.join("|")}`, he = v(ht), Mt = v(St);
|
|
455
|
+
j(() => {
|
|
456
|
+
he.current = ht, Mt.current = St;
|
|
457
|
+
}, [St, ge, ht]), j(() => {
|
|
507
458
|
le.current = Rt;
|
|
508
|
-
}, [Rt]),
|
|
509
|
-
|
|
510
|
-
}, [
|
|
511
|
-
const t =
|
|
512
|
-
t && t !==
|
|
513
|
-
}, [
|
|
514
|
-
const
|
|
515
|
-
ce.current = t, qt(
|
|
516
|
-
}, []),
|
|
459
|
+
}, [Rt]), j(() => {
|
|
460
|
+
c || (Ut.current = null);
|
|
461
|
+
}, [c]), j(() => {
|
|
462
|
+
const t = $.current;
|
|
463
|
+
t && t !== x && qt(t, !1), $.current = x, ce.current && qt(x, !0);
|
|
464
|
+
}, [x]);
|
|
465
|
+
const at = p((t) => {
|
|
466
|
+
ce.current = t, qt($.current, t);
|
|
467
|
+
}, []), J = p((t) => {
|
|
517
468
|
if (ue.current === t) return;
|
|
518
469
|
ue.current = t;
|
|
519
|
-
const e =
|
|
470
|
+
const e = Je.current;
|
|
520
471
|
if (t) {
|
|
521
472
|
document.addEventListener("selectstart", e, !0), document.addEventListener("dragstart", e, !0);
|
|
522
473
|
return;
|
|
523
474
|
}
|
|
524
475
|
document.removeEventListener("selectstart", e, !0), document.removeEventListener("dragstart", e, !0);
|
|
525
|
-
}, []),
|
|
476
|
+
}, []), bt = p(
|
|
526
477
|
({ chrome: t, target: e }) => {
|
|
527
|
-
const
|
|
478
|
+
const n = or({
|
|
528
479
|
target: e,
|
|
529
480
|
chrome: t,
|
|
530
|
-
bodyNode:
|
|
481
|
+
bodyNode: $.current
|
|
531
482
|
});
|
|
532
|
-
return
|
|
483
|
+
return at(n), n;
|
|
533
484
|
},
|
|
534
|
-
[
|
|
535
|
-
),
|
|
485
|
+
[at]
|
|
486
|
+
), I = p(() => i.current?.getBoundingClientRect().height ?? window.innerHeight, [i]), Lt = p(() => {
|
|
536
487
|
if (zt !== void 0) return zt;
|
|
537
488
|
if (ne === "header")
|
|
538
489
|
return i.current?.querySelector('[data-oc-part="header"]')?.getBoundingClientRect().height ?? void 0;
|
|
539
|
-
}, [ne, zt, i]),
|
|
490
|
+
}, [ne, zt, i]), Tt = p(
|
|
540
491
|
(t) => {
|
|
541
|
-
const e =
|
|
492
|
+
const e = Lt();
|
|
542
493
|
return e === void 0 || e <= 0 ? 0 : N(t - e, 0, t);
|
|
543
494
|
},
|
|
544
|
-
[
|
|
545
|
-
),
|
|
546
|
-
const t =
|
|
547
|
-
return t === void 0 || t <= 0 ? 0 :
|
|
548
|
-
}, [
|
|
549
|
-
() =>
|
|
550
|
-
[
|
|
551
|
-
),
|
|
495
|
+
[Lt]
|
|
496
|
+
), Q = p(() => {
|
|
497
|
+
const t = Lt();
|
|
498
|
+
return t === void 0 || t <= 0 ? 0 : Tt(I());
|
|
499
|
+
}, [Lt, Tt, I]), Kt = p(
|
|
500
|
+
() => F === "peeked" ? Q() : D,
|
|
501
|
+
[Q, F, D]
|
|
502
|
+
), _ = p(() => {
|
|
552
503
|
const t = i.current;
|
|
553
504
|
if (!t) return Kt();
|
|
554
|
-
const e =
|
|
505
|
+
const e = mt(
|
|
555
506
|
t.style.getPropertyValue("--oc-modal-translate-y")
|
|
556
507
|
);
|
|
557
508
|
if (e !== void 0) return e;
|
|
558
|
-
const
|
|
509
|
+
const n = mt(
|
|
559
510
|
window.getComputedStyle(t).getPropertyValue("--oc-modal-translate-y")
|
|
560
511
|
);
|
|
561
|
-
return
|
|
562
|
-
}, [Kt, i]),
|
|
512
|
+
return n !== void 0 ? n : Kt();
|
|
513
|
+
}, [Kt, i]), At = p(() => {
|
|
563
514
|
const t = i.current;
|
|
564
515
|
if (!t) return { x: 0, y: 0 };
|
|
565
|
-
const e =
|
|
516
|
+
const e = mt(
|
|
566
517
|
t.style.getPropertyValue("--oc-modal-translate-x")
|
|
567
|
-
),
|
|
518
|
+
), n = mt(
|
|
568
519
|
t.style.getPropertyValue("--oc-modal-translate-y")
|
|
569
520
|
);
|
|
570
|
-
if (e !== void 0 ||
|
|
521
|
+
if (e !== void 0 || n !== void 0)
|
|
571
522
|
return {
|
|
572
523
|
x: e ?? 0,
|
|
573
|
-
y:
|
|
524
|
+
y: n ?? 0
|
|
574
525
|
};
|
|
575
|
-
const
|
|
526
|
+
const l = window.getComputedStyle(t);
|
|
576
527
|
return {
|
|
577
|
-
x:
|
|
578
|
-
y:
|
|
528
|
+
x: mt(l.getPropertyValue("--oc-modal-translate-x")) ?? 0,
|
|
529
|
+
y: mt(l.getPropertyValue("--oc-modal-translate-y")) ?? 0
|
|
579
530
|
};
|
|
580
|
-
}, [i]),
|
|
581
|
-
const t =
|
|
531
|
+
}, [i]), ot = p(() => {
|
|
532
|
+
const t = _(), e = re(i.current);
|
|
582
533
|
return Math.abs(e - t) > 1 ? e : t;
|
|
583
|
-
}, [
|
|
584
|
-
(t, e,
|
|
534
|
+
}, [_, i]), xt = p(
|
|
535
|
+
(t, e, n = 1) => Math.abs(t - e) <= n,
|
|
585
536
|
[]
|
|
586
|
-
),
|
|
587
|
-
const t =
|
|
588
|
-
return
|
|
589
|
-
}, [
|
|
537
|
+
), st = p(() => {
|
|
538
|
+
const t = At(), e = Re(i.current);
|
|
539
|
+
return gt(e, t) > 1 ? e : t;
|
|
540
|
+
}, [At, i]), C = p(
|
|
590
541
|
(t, {
|
|
591
542
|
active: e,
|
|
592
|
-
nextDismissible:
|
|
593
|
-
rubberBand:
|
|
594
|
-
sheetHeightOverride:
|
|
543
|
+
nextDismissible: n = V,
|
|
544
|
+
rubberBand: l = !1,
|
|
545
|
+
sheetHeightOverride: o,
|
|
595
546
|
peekTranslateOverride: u,
|
|
596
547
|
settled: d
|
|
597
548
|
}) => {
|
|
598
|
-
const
|
|
599
|
-
if (!
|
|
600
|
-
const m =
|
|
601
|
-
dismissible:
|
|
602
|
-
peekTranslate:
|
|
549
|
+
const f = i.current;
|
|
550
|
+
if (!f) return;
|
|
551
|
+
const m = o ?? I(), g = f.parentElement, b = u ?? Q(), B = Mr({
|
|
552
|
+
dismissible: n,
|
|
553
|
+
peekTranslate: b,
|
|
603
554
|
sheetHeight: m,
|
|
604
555
|
visibleTranslate: D
|
|
605
|
-
}),
|
|
606
|
-
minTranslate:
|
|
556
|
+
}), y = br({
|
|
557
|
+
minTranslate: B.minTranslate,
|
|
607
558
|
sheetHeight: m,
|
|
608
|
-
surfaceMotion:
|
|
609
|
-
}),
|
|
610
|
-
rubberBand:
|
|
559
|
+
surfaceMotion: f
|
|
560
|
+
}), S = Ar({
|
|
561
|
+
rubberBand: l,
|
|
611
562
|
targetTranslate: t,
|
|
612
563
|
sheetHeight: m,
|
|
613
|
-
bounds:
|
|
614
|
-
rubberBandLimits:
|
|
615
|
-
backdropBoundaries:
|
|
564
|
+
bounds: B,
|
|
565
|
+
rubberBandLimits: y,
|
|
566
|
+
backdropBoundaries: Lr({
|
|
616
567
|
sheetHeight: m,
|
|
617
|
-
peekTranslate:
|
|
568
|
+
peekTranslate: b,
|
|
618
569
|
snapHeights: w,
|
|
619
|
-
backdropFromHeight:
|
|
570
|
+
backdropFromHeight: k
|
|
620
571
|
})
|
|
621
572
|
});
|
|
622
|
-
|
|
573
|
+
Y.current.lastTranslate = S.translate, f.style.setProperty(
|
|
623
574
|
"--oc-modal-translate-y",
|
|
624
|
-
`${
|
|
625
|
-
), d === "frame" || !e ?
|
|
575
|
+
`${S.translate}px`
|
|
576
|
+
), d === "frame" || !e ? f.style.setProperty(
|
|
626
577
|
"--oc-modal-settled-translate-y",
|
|
627
|
-
`${
|
|
628
|
-
) : typeof d == "number" &&
|
|
578
|
+
`${S.translate}px`
|
|
579
|
+
) : typeof d == "number" && f.style.setProperty(
|
|
629
580
|
"--oc-modal-settled-translate-y",
|
|
630
581
|
`${d}px`
|
|
631
582
|
);
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
583
|
+
const G = le.current ? 0 : S.backdropOpacity;
|
|
584
|
+
if (f.style.setProperty(
|
|
634
585
|
"--_-modal-elevation-shadow-opacity",
|
|
635
|
-
String(1 -
|
|
636
|
-
),
|
|
586
|
+
String(1 - G)
|
|
587
|
+
), f.dataset.ocModalDragging = e ? "true" : "false", g?.style.setProperty(
|
|
637
588
|
"--oc-modal-overshoot-fill-height",
|
|
638
|
-
`${
|
|
639
|
-
),
|
|
589
|
+
`${S.overshootFillHeight}px`
|
|
590
|
+
), g && (g.dataset.ocModalDragging = e ? "true" : "false"), e ? f.style.setProperty("transition", "none") : f.style.removeProperty("transition"), h.current && (h.current.style.setProperty(
|
|
640
591
|
"--oc-modal-backdrop-opacity",
|
|
641
|
-
String(
|
|
642
|
-
),
|
|
643
|
-
const
|
|
644
|
-
Ut.current !==
|
|
592
|
+
String(S.backdropOpacity)
|
|
593
|
+
), h.current.style.transition = e ? "none" : ""), !e && a === "bottom" && Vt) {
|
|
594
|
+
const A = k === void 0 || m - S.translate >= k - 0.5;
|
|
595
|
+
Ut.current !== A && (Ut.current = A, Vt(A));
|
|
645
596
|
}
|
|
646
597
|
},
|
|
647
598
|
[
|
|
648
|
-
E,
|
|
649
|
-
g,
|
|
650
|
-
R,
|
|
651
|
-
Z,
|
|
652
599
|
k,
|
|
653
|
-
|
|
654
|
-
|
|
600
|
+
h,
|
|
601
|
+
V,
|
|
602
|
+
Q,
|
|
603
|
+
I,
|
|
604
|
+
Vt,
|
|
605
|
+
a,
|
|
655
606
|
w,
|
|
656
607
|
i,
|
|
657
608
|
D
|
|
658
609
|
]
|
|
659
|
-
),
|
|
610
|
+
), it = p(() => {
|
|
660
611
|
const t = i.current, e = he.current;
|
|
661
612
|
if (!(!t || !e.length))
|
|
662
|
-
return
|
|
663
|
-
defaultSnapPosition:
|
|
613
|
+
return ar({
|
|
614
|
+
defaultSnapPosition: Mt.current,
|
|
664
615
|
snapPositions: e,
|
|
665
616
|
surfaceMotion: t
|
|
666
617
|
});
|
|
667
|
-
}, [i]),
|
|
618
|
+
}, [i]), W = p(
|
|
668
619
|
({ destroy: t = !0 } = {}) => {
|
|
669
|
-
t &&
|
|
620
|
+
t && H.current?.destroy(), H.current = null, Yt.current = null;
|
|
670
621
|
},
|
|
671
622
|
[]
|
|
672
|
-
),
|
|
623
|
+
), M = p(
|
|
673
624
|
(t, { active: e }) => {
|
|
674
|
-
const
|
|
675
|
-
if (!
|
|
676
|
-
const
|
|
625
|
+
const n = i.current;
|
|
626
|
+
if (!n) return;
|
|
627
|
+
const l = it(), o = l ? n.getBoundingClientRect() : void 0, u = l ? ze(l.targets, "x") : void 0, d = l ? ze(l.targets, "y") : void 0, f = We(u, o?.width), m = We(d, o?.height), g = l ? {
|
|
677
628
|
x: ee({
|
|
678
629
|
targetTranslate: t.x,
|
|
679
630
|
minTranslate: u?.minTranslate ?? 0,
|
|
680
631
|
maxTranslate: u?.maxTranslate ?? 0,
|
|
681
|
-
minBoundaryLimit:
|
|
682
|
-
maxBoundaryLimit:
|
|
632
|
+
minBoundaryLimit: f,
|
|
633
|
+
maxBoundaryLimit: f
|
|
683
634
|
}),
|
|
684
635
|
y: ee({
|
|
685
636
|
targetTranslate: t.y,
|
|
@@ -689,238 +640,238 @@ function _r({
|
|
|
689
640
|
maxBoundaryLimit: m
|
|
690
641
|
})
|
|
691
642
|
} : t;
|
|
692
|
-
|
|
693
|
-
const
|
|
694
|
-
|
|
643
|
+
Y.current.lastTranslateX = g.x, Y.current.lastTranslate = g.y;
|
|
644
|
+
const b = e ? void 0 : t.settledTranslate;
|
|
645
|
+
n.style.setProperty(
|
|
695
646
|
"--oc-modal-translate-x",
|
|
696
|
-
|
|
697
|
-
),
|
|
647
|
+
b?.x ?? `${g.x}px`
|
|
648
|
+
), n.style.setProperty(
|
|
698
649
|
"--oc-modal-translate-y",
|
|
699
|
-
|
|
700
|
-
),
|
|
650
|
+
b?.y ?? `${g.y}px`
|
|
651
|
+
), n.dataset.ocModalDragging = e ? "true" : "false", n.parentElement && (n.parentElement.dataset.ocModalDragging = e ? "true" : "false"), n.style.transition = e ? "none" : "";
|
|
701
652
|
},
|
|
702
|
-
[
|
|
703
|
-
), X =
|
|
704
|
-
|
|
653
|
+
[it, i]
|
|
654
|
+
), X = p(() => {
|
|
655
|
+
z.current?.destroy(), z.current = null, W();
|
|
705
656
|
const t = i.current;
|
|
706
657
|
t?.dataset.ocModalSheetResizing && (delete t.dataset.ocModalSheetResizing, t.style.removeProperty("--oc-modal-resize-rest-translate-y"), t.style.removeProperty(
|
|
707
658
|
"--oc-modal-resize-target-scrollport-height"
|
|
708
659
|
));
|
|
709
|
-
}, [
|
|
710
|
-
(t, e =
|
|
711
|
-
X(),
|
|
660
|
+
}, [W, i]), lt = p(
|
|
661
|
+
(t, e = V) => {
|
|
662
|
+
X(), C(t, {
|
|
712
663
|
active: !0,
|
|
713
664
|
nextDismissible: e,
|
|
714
665
|
rubberBand: !0,
|
|
715
666
|
settled: "frame"
|
|
716
667
|
});
|
|
717
668
|
},
|
|
718
|
-
[
|
|
719
|
-
), ye =
|
|
720
|
-
const t =
|
|
721
|
-
return
|
|
669
|
+
[C, X, V]
|
|
670
|
+
), ye = p(() => {
|
|
671
|
+
const t = ot(), e = st();
|
|
672
|
+
return z.current !== null || H.current !== null ? (X(), a === "popup" && gt(e, { x: 0, y: 0 }) > 0.5 ? M(e, { active: !1 }) : a === "bottom" && Math.abs(t) > 0.5 && C(t, { active: !1 }), { startTranslate: t, startTranslatePoint: e }) : { startTranslate: t, startTranslatePoint: e };
|
|
722
673
|
}, [
|
|
723
|
-
|
|
724
|
-
|
|
674
|
+
M,
|
|
675
|
+
C,
|
|
725
676
|
X,
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
]),
|
|
677
|
+
ot,
|
|
678
|
+
st,
|
|
679
|
+
a
|
|
680
|
+
]), P = p(() => {
|
|
730
681
|
const t = i.current;
|
|
731
|
-
t && (t.dataset.ocModalDragging = "false", t.style.removeProperty("transition"), t.parentElement && (t.parentElement.dataset.ocModalDragging = "false"),
|
|
732
|
-
}, [
|
|
682
|
+
t && (t.dataset.ocModalDragging = "false", t.style.removeProperty("transition"), t.parentElement && (t.parentElement.dataset.ocModalDragging = "false"), h.current?.style.removeProperty("transition"), k === void 0 && h.current?.style.removeProperty("--oc-modal-backdrop-opacity"));
|
|
683
|
+
}, [k, h, i]), Te = p(() => {
|
|
733
684
|
const t = i.current, e = t?.parentElement;
|
|
734
|
-
|
|
735
|
-
}, [
|
|
685
|
+
Y.current.lastTranslate = 0, t?.style.removeProperty("--oc-modal-translate-y"), t?.style.removeProperty("--oc-modal-settled-translate-y"), t?.style.removeProperty("--_-modal-elevation-shadow-opacity"), e?.style.removeProperty("--oc-modal-overshoot-fill-height"), h.current?.style.removeProperty("--oc-modal-backdrop-opacity"), P();
|
|
686
|
+
}, [h, P, i]), xe = p(
|
|
736
687
|
({
|
|
737
688
|
preserveSnapPosition: t = !1,
|
|
738
689
|
resetY: e = !0
|
|
739
690
|
} = {}) => {
|
|
740
|
-
const
|
|
741
|
-
|
|
691
|
+
const n = i.current;
|
|
692
|
+
n && (t || (K.current = null), Y.current.lastTranslateX = 0, n.style.removeProperty("--oc-modal-translate-x"), e && (Y.current.lastTranslate = 0, n.style.removeProperty("--oc-modal-translate-y")), P());
|
|
742
693
|
},
|
|
743
|
-
[
|
|
744
|
-
), O =
|
|
694
|
+
[P, i]
|
|
695
|
+
), O = p(
|
|
745
696
|
(t, {
|
|
746
697
|
initialVelocity: e = 0,
|
|
747
|
-
intent:
|
|
748
|
-
phase:
|
|
749
|
-
from:
|
|
698
|
+
intent: n = "sheet",
|
|
699
|
+
phase: l = "release",
|
|
700
|
+
from: o,
|
|
750
701
|
onComplete: u,
|
|
751
702
|
peekTranslateOverride: d,
|
|
752
|
-
sheetHeightOverride:
|
|
703
|
+
sheetHeightOverride: f
|
|
753
704
|
} = {}) => {
|
|
754
705
|
const m = i.current;
|
|
755
706
|
if (!m) return;
|
|
756
707
|
X();
|
|
757
|
-
const
|
|
758
|
-
if (Math.abs(
|
|
759
|
-
|
|
708
|
+
const g = o ?? re(m);
|
|
709
|
+
if (Math.abs(g - t) < 0.5) {
|
|
710
|
+
C(t, {
|
|
760
711
|
active: !1,
|
|
761
712
|
peekTranslateOverride: d,
|
|
762
|
-
sheetHeightOverride:
|
|
763
|
-
}),
|
|
713
|
+
sheetHeightOverride: f
|
|
714
|
+
}), P(), u?.();
|
|
764
715
|
return;
|
|
765
716
|
}
|
|
766
|
-
const
|
|
767
|
-
|
|
717
|
+
const b = l === "enter" ? t : "frame";
|
|
718
|
+
C(g, {
|
|
768
719
|
active: !0,
|
|
769
720
|
peekTranslateOverride: d,
|
|
770
|
-
settled:
|
|
771
|
-
sheetHeightOverride:
|
|
721
|
+
settled: b,
|
|
722
|
+
sheetHeightOverride: f
|
|
772
723
|
});
|
|
773
|
-
const
|
|
724
|
+
const B = Zt({
|
|
774
725
|
element: m,
|
|
775
|
-
intent:
|
|
776
|
-
phase:
|
|
726
|
+
intent: n,
|
|
727
|
+
phase: l,
|
|
777
728
|
reduced: "preserve",
|
|
778
729
|
reducedMotion: !1,
|
|
779
730
|
property: "transform"
|
|
780
731
|
});
|
|
781
|
-
if (!
|
|
782
|
-
|
|
732
|
+
if (!B.animate) {
|
|
733
|
+
C(t, {
|
|
783
734
|
active: !1,
|
|
784
735
|
peekTranslateOverride: d,
|
|
785
|
-
sheetHeightOverride:
|
|
786
|
-
}),
|
|
736
|
+
sheetHeightOverride: f
|
|
737
|
+
}), P(), u?.();
|
|
787
738
|
return;
|
|
788
739
|
}
|
|
789
|
-
const
|
|
790
|
-
value:
|
|
740
|
+
const y = Qt({
|
|
741
|
+
value: g,
|
|
791
742
|
target: t,
|
|
792
743
|
velocity: e,
|
|
793
|
-
spring:
|
|
744
|
+
spring: B.spring,
|
|
794
745
|
epsilon: 0.5,
|
|
795
746
|
velocityEpsilon: 50,
|
|
796
747
|
stabilityWindow: 0.02,
|
|
797
|
-
onUpdate: (
|
|
798
|
-
|
|
748
|
+
onUpdate: (S) => {
|
|
749
|
+
C(S, {
|
|
799
750
|
active: !0,
|
|
800
751
|
peekTranslateOverride: d,
|
|
801
|
-
settled:
|
|
802
|
-
sheetHeightOverride:
|
|
752
|
+
settled: b === "frame" ? "frame" : void 0,
|
|
753
|
+
sheetHeightOverride: f
|
|
803
754
|
});
|
|
804
755
|
},
|
|
805
756
|
onComplete: () => {
|
|
806
|
-
|
|
757
|
+
z.current === y && (z.current = null), C(t, {
|
|
807
758
|
active: !1,
|
|
808
759
|
peekTranslateOverride: d,
|
|
809
|
-
sheetHeightOverride:
|
|
810
|
-
}),
|
|
760
|
+
sheetHeightOverride: f
|
|
761
|
+
}), P(), u?.();
|
|
811
762
|
}
|
|
812
763
|
});
|
|
813
|
-
|
|
764
|
+
z.current = y;
|
|
814
765
|
},
|
|
815
|
-
[
|
|
816
|
-
),
|
|
766
|
+
[C, X, P, i]
|
|
767
|
+
), Z = p(
|
|
817
768
|
(t, {
|
|
818
769
|
from: e,
|
|
819
|
-
initialVelocity:
|
|
770
|
+
initialVelocity: n = { x: 0, y: 0 }
|
|
820
771
|
} = {}) => {
|
|
821
|
-
const
|
|
822
|
-
if (!
|
|
772
|
+
const l = i.current;
|
|
773
|
+
if (!l) return;
|
|
823
774
|
X();
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
|
|
775
|
+
const o = e ?? Re(l), u = { x: t.x, y: t.y };
|
|
776
|
+
if (gt(
|
|
777
|
+
o,
|
|
827
778
|
u
|
|
828
779
|
) < 0.5) {
|
|
829
|
-
|
|
780
|
+
M(t, { active: !1 }), P();
|
|
830
781
|
return;
|
|
831
782
|
}
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
element:
|
|
783
|
+
M(o, { active: !0 });
|
|
784
|
+
const f = Zt({
|
|
785
|
+
element: l,
|
|
835
786
|
intent: "gesture",
|
|
836
787
|
phase: "release",
|
|
837
788
|
reduced: "preserve",
|
|
838
789
|
reducedMotion: !1,
|
|
839
790
|
property: "transform"
|
|
840
791
|
});
|
|
841
|
-
if (!
|
|
842
|
-
|
|
792
|
+
if (!f.animate) {
|
|
793
|
+
M(t, { active: !1 }), P();
|
|
843
794
|
return;
|
|
844
795
|
}
|
|
845
796
|
const m = Qt({
|
|
846
|
-
value:
|
|
797
|
+
value: o,
|
|
847
798
|
target: u,
|
|
848
|
-
velocity:
|
|
849
|
-
spring:
|
|
799
|
+
velocity: n,
|
|
800
|
+
spring: f.spring,
|
|
850
801
|
epsilon: 0.5,
|
|
851
802
|
velocityEpsilon: 50,
|
|
852
803
|
stabilityWindow: 0.02,
|
|
853
|
-
onUpdate: (
|
|
854
|
-
|
|
804
|
+
onUpdate: (g) => {
|
|
805
|
+
M(g, { active: !0 });
|
|
855
806
|
},
|
|
856
807
|
onComplete: () => {
|
|
857
|
-
|
|
808
|
+
z.current === m && (z.current = null), M(t, { active: !1 }), P();
|
|
858
809
|
}
|
|
859
810
|
});
|
|
860
|
-
|
|
811
|
+
z.current = m;
|
|
861
812
|
},
|
|
862
813
|
[
|
|
863
|
-
|
|
814
|
+
M,
|
|
864
815
|
X,
|
|
865
|
-
|
|
816
|
+
P,
|
|
866
817
|
i
|
|
867
818
|
]
|
|
868
|
-
),
|
|
869
|
-
const t =
|
|
819
|
+
), ct = p(() => {
|
|
820
|
+
const t = H.current;
|
|
870
821
|
if (!t) return null;
|
|
871
822
|
const e = t.sample();
|
|
872
|
-
return
|
|
873
|
-
}, [
|
|
823
|
+
return M(e.value, { active: !0 }), e;
|
|
824
|
+
}, [M]), Pe = p(
|
|
874
825
|
(t) => {
|
|
875
826
|
if (!i.current) return null;
|
|
876
|
-
X(),
|
|
877
|
-
const
|
|
827
|
+
X(), M(t, { active: !0 });
|
|
828
|
+
const n = Qt({
|
|
878
829
|
value: t,
|
|
879
830
|
target: t,
|
|
880
|
-
spring:
|
|
831
|
+
spring: mr,
|
|
881
832
|
autoplay: !1,
|
|
882
833
|
epsilon: 0.5,
|
|
883
834
|
velocityEpsilon: 50,
|
|
884
835
|
stabilityWindow: 0.02,
|
|
885
|
-
onUpdate: (
|
|
886
|
-
|
|
836
|
+
onUpdate: (l) => {
|
|
837
|
+
M(l, { active: !0 });
|
|
887
838
|
},
|
|
888
839
|
onComplete: () => {
|
|
889
|
-
const
|
|
890
|
-
!
|
|
840
|
+
const l = Yt.current;
|
|
841
|
+
!l || H.current !== n || (W({ destroy: !1 }), M(l, { active: !1 }), P());
|
|
891
842
|
}
|
|
892
843
|
});
|
|
893
|
-
return
|
|
844
|
+
return H.current = n, n;
|
|
894
845
|
},
|
|
895
846
|
[
|
|
896
|
-
|
|
847
|
+
M,
|
|
897
848
|
X,
|
|
898
|
-
|
|
899
|
-
|
|
849
|
+
W,
|
|
850
|
+
P,
|
|
900
851
|
i
|
|
901
852
|
]
|
|
902
|
-
), ve =
|
|
853
|
+
), ve = p(
|
|
903
854
|
(t) => {
|
|
904
|
-
const e =
|
|
905
|
-
e && (
|
|
855
|
+
const e = H.current ?? Pe(st());
|
|
856
|
+
e && (Yt.current = null, e.setTarget(t));
|
|
906
857
|
},
|
|
907
|
-
[
|
|
908
|
-
),
|
|
858
|
+
[st, Pe]
|
|
859
|
+
), ut = p(
|
|
909
860
|
(t, e) => {
|
|
910
|
-
const
|
|
911
|
-
return ve(
|
|
861
|
+
const n = Ft(t, e);
|
|
862
|
+
return ve(n), ct(), n;
|
|
912
863
|
},
|
|
913
|
-
[
|
|
914
|
-
),
|
|
864
|
+
[ct, ve]
|
|
865
|
+
), Ct = p(
|
|
915
866
|
(t) => {
|
|
916
|
-
const e = i.current,
|
|
917
|
-
if (!e || !
|
|
918
|
-
|
|
867
|
+
const e = i.current, n = H.current;
|
|
868
|
+
if (!e || !n) {
|
|
869
|
+
Z(t);
|
|
919
870
|
return;
|
|
920
871
|
}
|
|
921
|
-
const
|
|
922
|
-
if (
|
|
923
|
-
|
|
872
|
+
const o = ct() ? At() : n.value, u = { x: t.x, y: t.y };
|
|
873
|
+
if (gt(o, u) < 0.5) {
|
|
874
|
+
W(), M(t, { active: !1 }), P();
|
|
924
875
|
return;
|
|
925
876
|
}
|
|
926
877
|
const d = Zt({
|
|
@@ -932,81 +883,81 @@ function _r({
|
|
|
932
883
|
property: "transform"
|
|
933
884
|
});
|
|
934
885
|
if (!d.animate) {
|
|
935
|
-
|
|
886
|
+
W(), M(t, { active: !1 }), P();
|
|
936
887
|
return;
|
|
937
888
|
}
|
|
938
|
-
|
|
889
|
+
Yt.current = t, n.setTarget(u, { spring: d.spring });
|
|
939
890
|
},
|
|
940
891
|
[
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
892
|
+
M,
|
|
893
|
+
W,
|
|
894
|
+
P,
|
|
895
|
+
At,
|
|
896
|
+
ct,
|
|
897
|
+
Z,
|
|
947
898
|
i
|
|
948
899
|
]
|
|
949
|
-
),
|
|
900
|
+
), dt = p(
|
|
950
901
|
({
|
|
951
902
|
key: t,
|
|
952
903
|
settle: e
|
|
953
904
|
}) => {
|
|
954
|
-
if (
|
|
955
|
-
const
|
|
956
|
-
if (!
|
|
957
|
-
const
|
|
958
|
-
return
|
|
905
|
+
if (Y.current.dragging) return !1;
|
|
906
|
+
const n = it();
|
|
907
|
+
if (!n) return !1;
|
|
908
|
+
const l = (t ? n.targets.find((o) => o.key === t) : void 0) ?? n.defaultTarget;
|
|
909
|
+
return K.current = l.key, e ? Z(l) : (X(), M(l, { active: !1 }), P()), !0;
|
|
959
910
|
},
|
|
960
911
|
[
|
|
961
|
-
|
|
912
|
+
M,
|
|
962
913
|
X,
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
914
|
+
P,
|
|
915
|
+
it,
|
|
916
|
+
Z
|
|
966
917
|
]
|
|
967
|
-
), we =
|
|
968
|
-
(t, { from: e, initialVelocity:
|
|
918
|
+
), we = p(
|
|
919
|
+
(t, { from: e, initialVelocity: n = 0 }) => {
|
|
969
920
|
O(t, {
|
|
970
921
|
from: e,
|
|
971
|
-
initialVelocity:
|
|
922
|
+
initialVelocity: n,
|
|
972
923
|
onComplete: () => {
|
|
973
|
-
|
|
924
|
+
rt({ reason: "drag-dismiss" }, { skipAttempt: !0 });
|
|
974
925
|
}
|
|
975
926
|
});
|
|
976
927
|
},
|
|
977
|
-
[
|
|
928
|
+
[rt, O]
|
|
978
929
|
);
|
|
979
|
-
|
|
930
|
+
Nt(
|
|
980
931
|
() => () => {
|
|
981
|
-
X(),
|
|
932
|
+
X(), J(!1), i.current && P();
|
|
982
933
|
},
|
|
983
934
|
[
|
|
984
935
|
X,
|
|
985
|
-
|
|
986
|
-
|
|
936
|
+
P,
|
|
937
|
+
J,
|
|
987
938
|
i
|
|
988
939
|
]
|
|
989
|
-
),
|
|
990
|
-
if (!
|
|
991
|
-
|
|
940
|
+
), j(() => {
|
|
941
|
+
if (!c || !r || a !== "bottom") {
|
|
942
|
+
Wt.current = c;
|
|
992
943
|
return;
|
|
993
944
|
}
|
|
994
945
|
if (!i.current || oe?.()) return;
|
|
946
|
+
Gt.current = !0;
|
|
947
|
+
const t = Wt.current;
|
|
995
948
|
Wt.current = !0;
|
|
996
|
-
const
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
}, p = !vt(
|
|
1001
|
-
a,
|
|
949
|
+
const e = L ?? I(), n = pe.current ?? e, l = de.current, o = me.current, u = fe.current, d = () => {
|
|
950
|
+
pe.current = e, de.current = F, fe.current = D, me.current = w;
|
|
951
|
+
}, f = !xt(
|
|
952
|
+
n,
|
|
1002
953
|
e
|
|
1003
|
-
), m =
|
|
954
|
+
), m = Tt(e), g = F === "peeked" ? m : D;
|
|
1004
955
|
if (!t) {
|
|
1005
|
-
Et.current = { kind: "default-snap" },
|
|
956
|
+
Et.current = { kind: "default-snap" }, C(e, {
|
|
1006
957
|
active: !0,
|
|
1007
958
|
peekTranslateOverride: m,
|
|
1008
959
|
sheetHeightOverride: e
|
|
1009
|
-
}), O(
|
|
960
|
+
}), O(g, {
|
|
1010
961
|
from: e,
|
|
1011
962
|
intent: "sheet",
|
|
1012
963
|
peekTranslateOverride: m,
|
|
@@ -1015,79 +966,79 @@ function _r({
|
|
|
1015
966
|
}), d();
|
|
1016
967
|
return;
|
|
1017
968
|
}
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
currentTranslate:
|
|
969
|
+
if (F === "visible" && f) {
|
|
970
|
+
const y = i.current, S = _(), G = l === "visible" && n > 0 ? ur({
|
|
971
|
+
currentTranslate: S,
|
|
1021
972
|
fallbackTranslate: D,
|
|
1022
973
|
restState: Et.current,
|
|
1023
974
|
previousDefaultTranslate: u,
|
|
1024
|
-
previousSheetHeight:
|
|
1025
|
-
previousSnapHeights:
|
|
975
|
+
previousSheetHeight: n,
|
|
976
|
+
previousSnapHeights: o,
|
|
1026
977
|
targetSheetHeight: e,
|
|
1027
978
|
targetDefaultTranslate: D,
|
|
1028
979
|
targetSnapHeights: w
|
|
1029
980
|
}) : D;
|
|
1030
981
|
X();
|
|
1031
|
-
const
|
|
1032
|
-
|
|
982
|
+
const A = Number.parseFloat(y.style.height), vt = Number.isFinite(A) && A > 0 ? A : n, Me = N(
|
|
983
|
+
vt - S,
|
|
1033
984
|
0,
|
|
1034
|
-
|
|
985
|
+
vt
|
|
1035
986
|
), be = N(
|
|
1036
|
-
e -
|
|
987
|
+
e - G,
|
|
1037
988
|
0,
|
|
1038
989
|
e
|
|
1039
|
-
),
|
|
990
|
+
), et = Math.max(vt, e), Jt = Math.max(
|
|
1040
991
|
0,
|
|
1041
|
-
|
|
992
|
+
et - Me
|
|
1042
993
|
), Le = Math.max(
|
|
1043
994
|
0,
|
|
1044
|
-
|
|
1045
|
-
), Ae =
|
|
1046
|
-
|
|
995
|
+
et - be
|
|
996
|
+
), Ae = Tt(et), Ce = () => {
|
|
997
|
+
C(G, {
|
|
1047
998
|
active: !1,
|
|
1048
999
|
peekTranslateOverride: m,
|
|
1049
1000
|
sheetHeightOverride: e
|
|
1050
|
-
}),
|
|
1001
|
+
}), y.style.setProperty("transition", "none"), y.style.removeProperty("height"), y.style.setProperty(
|
|
1051
1002
|
"--oc-modal-sheet-height",
|
|
1052
1003
|
`${e}px`
|
|
1053
|
-
), delete
|
|
1004
|
+
), delete y.dataset.ocModalSheetResizing, y.style.removeProperty(
|
|
1054
1005
|
"--oc-modal-resize-rest-translate-y"
|
|
1055
|
-
),
|
|
1006
|
+
), y.style.removeProperty(
|
|
1056
1007
|
"--oc-modal-resize-target-scrollport-height"
|
|
1057
|
-
),
|
|
1008
|
+
), y.getBoundingClientRect(), y.style.removeProperty("transition"), $t?.();
|
|
1058
1009
|
};
|
|
1059
|
-
if (
|
|
1010
|
+
if (xt(Jt, Le)) {
|
|
1060
1011
|
Ce(), d();
|
|
1061
1012
|
return;
|
|
1062
1013
|
}
|
|
1063
1014
|
const Be = () => {
|
|
1064
|
-
|
|
1015
|
+
y.dataset.ocModalSheetResizing = "true", y.style.setProperty(
|
|
1065
1016
|
"--oc-modal-resize-rest-translate-y",
|
|
1066
|
-
`${
|
|
1017
|
+
`${G}px`
|
|
1067
1018
|
);
|
|
1068
|
-
const Ie =
|
|
1069
|
-
Ie &&
|
|
1019
|
+
const Ie = $.current;
|
|
1020
|
+
Ie && y.style.setProperty(
|
|
1070
1021
|
"--oc-modal-resize-target-scrollport-height",
|
|
1071
|
-
`${Ie.clientHeight + (be -
|
|
1022
|
+
`${Ie.clientHeight + (be - Me)}px`
|
|
1072
1023
|
);
|
|
1073
1024
|
};
|
|
1074
|
-
Be(),
|
|
1025
|
+
Be(), y.style.setProperty("transition", "none"), y.style.setProperty("height", `${et}px`), y.style.setProperty(
|
|
1075
1026
|
"--oc-modal-sheet-height",
|
|
1076
|
-
`${
|
|
1077
|
-
),
|
|
1027
|
+
`${et}px`
|
|
1028
|
+
), C(Jt, {
|
|
1078
1029
|
active: !0,
|
|
1079
1030
|
peekTranslateOverride: Ae,
|
|
1080
|
-
sheetHeightOverride:
|
|
1081
|
-
}),
|
|
1031
|
+
sheetHeightOverride: et
|
|
1032
|
+
}), y.getBoundingClientRect(), y.style.removeProperty("transition"), O(Le, {
|
|
1082
1033
|
from: Jt,
|
|
1083
1034
|
intent: "sheet",
|
|
1084
1035
|
peekTranslateOverride: Ae,
|
|
1085
|
-
sheetHeightOverride:
|
|
1036
|
+
sheetHeightOverride: et,
|
|
1086
1037
|
onComplete: Ce
|
|
1087
1038
|
}), Be(), $t?.(), d();
|
|
1088
1039
|
return;
|
|
1089
1040
|
}
|
|
1090
|
-
if (
|
|
1041
|
+
if (F === "peeked") {
|
|
1091
1042
|
O(m, {
|
|
1092
1043
|
peekTranslateOverride: m,
|
|
1093
1044
|
sheetHeightOverride: e
|
|
@@ -1098,22 +1049,22 @@ function _r({
|
|
|
1098
1049
|
_t.current = !1, d();
|
|
1099
1050
|
return;
|
|
1100
1051
|
}
|
|
1101
|
-
const
|
|
1102
|
-
if (!
|
|
1052
|
+
const b = l !== F;
|
|
1053
|
+
if (!xt(
|
|
1103
1054
|
u,
|
|
1104
1055
|
D
|
|
1105
1056
|
)) {
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1108
|
-
X(),
|
|
1057
|
+
const y = _(), G = z.current !== null && (D > u && y < D || D < u && y > D);
|
|
1058
|
+
if (xt(y, u) || G) {
|
|
1059
|
+
X(), C(D, {
|
|
1109
1060
|
active: !1,
|
|
1110
1061
|
peekTranslateOverride: m,
|
|
1111
1062
|
sheetHeightOverride: e
|
|
1112
|
-
}),
|
|
1063
|
+
}), P(), d();
|
|
1113
1064
|
return;
|
|
1114
1065
|
}
|
|
1115
1066
|
}
|
|
1116
|
-
if (!
|
|
1067
|
+
if (!b) {
|
|
1117
1068
|
d();
|
|
1118
1069
|
return;
|
|
1119
1070
|
}
|
|
@@ -1123,46 +1074,46 @@ function _r({
|
|
|
1123
1074
|
}), Et.current = { kind: "default-snap" }, d();
|
|
1124
1075
|
}, [
|
|
1125
1076
|
r,
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1077
|
+
Tt,
|
|
1078
|
+
I,
|
|
1079
|
+
_,
|
|
1129
1080
|
L,
|
|
1130
1081
|
w,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1082
|
+
c,
|
|
1083
|
+
a,
|
|
1084
|
+
F,
|
|
1134
1085
|
$t,
|
|
1135
1086
|
oe,
|
|
1136
|
-
|
|
1087
|
+
C,
|
|
1137
1088
|
X,
|
|
1138
|
-
|
|
1139
|
-
|
|
1089
|
+
P,
|
|
1090
|
+
xt,
|
|
1140
1091
|
O,
|
|
1141
|
-
|
|
1092
|
+
T,
|
|
1142
1093
|
i,
|
|
1143
1094
|
D
|
|
1144
|
-
]),
|
|
1145
|
-
|
|
1146
|
-
}, [X,
|
|
1147
|
-
if (!
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
preserveSnapPosition:
|
|
1151
|
-
})),
|
|
1095
|
+
]), j(() => {
|
|
1096
|
+
a !== "bottom" && Gt.current && (Gt.current = !1, X(), Te());
|
|
1097
|
+
}, [X, a, Te]), j(() => {
|
|
1098
|
+
if (!c || !r || !E) {
|
|
1099
|
+
const l = !c && a === "popup" && nt.current, o = c && a !== "popup" && nt.current;
|
|
1100
|
+
nt.current && !l && (U.current !== null && (window.cancelAnimationFrame(U.current), U.current = null), X(), xe({
|
|
1101
|
+
preserveSnapPosition: o
|
|
1102
|
+
})), nt.current && l && (X(), P()), jt.current = c && a === "popup", nt.current = !1;
|
|
1152
1103
|
return;
|
|
1153
1104
|
}
|
|
1154
|
-
const t =
|
|
1155
|
-
|
|
1105
|
+
const t = jt.current;
|
|
1106
|
+
jt.current = !0, nt.current = !0;
|
|
1156
1107
|
let e = null;
|
|
1157
|
-
const
|
|
1158
|
-
key:
|
|
1108
|
+
const n = (l) => dt({
|
|
1109
|
+
key: l,
|
|
1159
1110
|
settle: t
|
|
1160
1111
|
});
|
|
1161
|
-
return
|
|
1162
|
-
|
|
1112
|
+
return n(
|
|
1113
|
+
K.current ?? Mt.current
|
|
1163
1114
|
) || (e = window.requestAnimationFrame(() => {
|
|
1164
|
-
e = null,
|
|
1165
|
-
|
|
1115
|
+
e = null, n(
|
|
1116
|
+
K.current ?? Mt.current
|
|
1166
1117
|
);
|
|
1167
1118
|
})), () => {
|
|
1168
1119
|
e !== null && window.cancelAnimationFrame(e);
|
|
@@ -1170,58 +1121,58 @@ function _r({
|
|
|
1170
1121
|
}, [
|
|
1171
1122
|
X,
|
|
1172
1123
|
r,
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1124
|
+
P,
|
|
1125
|
+
c,
|
|
1126
|
+
a,
|
|
1176
1127
|
ge,
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
]),
|
|
1181
|
-
if (!
|
|
1128
|
+
E,
|
|
1129
|
+
xe,
|
|
1130
|
+
dt
|
|
1131
|
+
]), j(() => {
|
|
1132
|
+
if (!c || !r || !E) return;
|
|
1182
1133
|
const t = () => {
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
key:
|
|
1134
|
+
Y.current.dragging || U.current === null && (U.current = window.requestAnimationFrame(() => {
|
|
1135
|
+
U.current = null, !Y.current.dragging && dt({
|
|
1136
|
+
key: K.current,
|
|
1186
1137
|
settle: !1
|
|
1187
1138
|
});
|
|
1188
1139
|
}));
|
|
1189
1140
|
};
|
|
1190
1141
|
window.addEventListener("resize", t), window.visualViewport?.addEventListener("resize", t);
|
|
1191
|
-
const e = i.current,
|
|
1142
|
+
const e = i.current, n = e?.parentElement, l = typeof ResizeObserver > "u" ? null : new ResizeObserver(t), o = (u) => {
|
|
1192
1143
|
e && u.target instanceof Element && e.contains(u.target) && t();
|
|
1193
1144
|
};
|
|
1194
|
-
return
|
|
1145
|
+
return l && (e && l.observe(e), n && l.observe(n)), e?.addEventListener(
|
|
1195
1146
|
"transitionend",
|
|
1196
|
-
|
|
1147
|
+
o,
|
|
1197
1148
|
!0
|
|
1198
1149
|
), e?.addEventListener(
|
|
1199
1150
|
"transitioncancel",
|
|
1200
|
-
|
|
1151
|
+
o,
|
|
1201
1152
|
!0
|
|
1202
1153
|
), () => {
|
|
1203
1154
|
window.removeEventListener("resize", t), window.visualViewport?.removeEventListener("resize", t), e?.removeEventListener(
|
|
1204
1155
|
"transitionend",
|
|
1205
|
-
|
|
1156
|
+
o,
|
|
1206
1157
|
!0
|
|
1207
1158
|
), e?.removeEventListener(
|
|
1208
1159
|
"transitioncancel",
|
|
1209
|
-
|
|
1160
|
+
o,
|
|
1210
1161
|
!0
|
|
1211
|
-
),
|
|
1162
|
+
), l?.disconnect(), U.current !== null && (window.cancelAnimationFrame(U.current), U.current = null);
|
|
1212
1163
|
};
|
|
1213
1164
|
}, [
|
|
1214
1165
|
r,
|
|
1215
|
-
|
|
1216
|
-
|
|
1166
|
+
c,
|
|
1167
|
+
E,
|
|
1217
1168
|
i,
|
|
1218
|
-
|
|
1219
|
-
]),
|
|
1220
|
-
if (ie <= 0 || !
|
|
1169
|
+
dt
|
|
1170
|
+
]), j(() => {
|
|
1171
|
+
if (ie <= 0 || !c || !r || !E)
|
|
1221
1172
|
return;
|
|
1222
1173
|
let t = window.requestAnimationFrame(() => {
|
|
1223
|
-
t = null,
|
|
1224
|
-
key:
|
|
1174
|
+
t = null, dt({
|
|
1175
|
+
key: K.current,
|
|
1225
1176
|
settle: !1
|
|
1226
1177
|
});
|
|
1227
1178
|
});
|
|
@@ -1230,53 +1181,53 @@ function _r({
|
|
|
1230
1181
|
};
|
|
1231
1182
|
}, [
|
|
1232
1183
|
r,
|
|
1233
|
-
|
|
1234
|
-
|
|
1184
|
+
c,
|
|
1185
|
+
E,
|
|
1235
1186
|
ie,
|
|
1236
|
-
|
|
1187
|
+
dt
|
|
1237
1188
|
]);
|
|
1238
|
-
const Se =
|
|
1239
|
-
(t, e,
|
|
1189
|
+
const Se = p(
|
|
1190
|
+
(t, e, n) => {
|
|
1240
1191
|
if (typeof Element > "u" || !(t instanceof Element) || te(t)) return !1;
|
|
1241
|
-
const
|
|
1242
|
-
return !
|
|
1192
|
+
const l = Date.now(), o = e > 0, u = sr(t, $.current);
|
|
1193
|
+
return !n && u && o && u.scrollTop > 0 || !n && Xt.current && l - Xt.current < se && Math.abs(_()) <= 1 ? (Xt.current = l, !1) : !0;
|
|
1243
1194
|
},
|
|
1244
|
-
[
|
|
1245
|
-
),
|
|
1195
|
+
[_, se]
|
|
1196
|
+
), Pt = p(
|
|
1246
1197
|
({
|
|
1247
1198
|
chrome: t,
|
|
1248
1199
|
pointerId: e = null,
|
|
1249
|
-
selectionArbitration:
|
|
1250
|
-
source:
|
|
1251
|
-
startX:
|
|
1200
|
+
selectionArbitration: n = !1,
|
|
1201
|
+
source: l,
|
|
1202
|
+
startX: o = 0,
|
|
1252
1203
|
startY: u,
|
|
1253
1204
|
touchId: d = null
|
|
1254
1205
|
}) => {
|
|
1255
|
-
const { startTranslate:
|
|
1256
|
-
|
|
1206
|
+
const { startTranslate: f, startTranslatePoint: m } = ye(), g = q();
|
|
1207
|
+
Y.current = {
|
|
1257
1208
|
dragging: !0,
|
|
1258
1209
|
allowed: !1,
|
|
1259
1210
|
chrome: t,
|
|
1260
|
-
selectionArbitration:
|
|
1211
|
+
selectionArbitration: n,
|
|
1261
1212
|
closeAllowed: null,
|
|
1262
1213
|
started: !1,
|
|
1263
|
-
source:
|
|
1264
|
-
startX:
|
|
1214
|
+
source: l,
|
|
1215
|
+
startX: o,
|
|
1265
1216
|
startY: u,
|
|
1266
|
-
lastX:
|
|
1217
|
+
lastX: o,
|
|
1267
1218
|
lastY: u,
|
|
1268
1219
|
startTranslateX: m.x,
|
|
1269
|
-
startTranslate:
|
|
1220
|
+
startTranslate: f,
|
|
1270
1221
|
lastTranslateX: m.x,
|
|
1271
|
-
lastTranslate:
|
|
1272
|
-
startTime:
|
|
1222
|
+
lastTranslate: f,
|
|
1223
|
+
startTime: g,
|
|
1273
1224
|
samples: [
|
|
1274
1225
|
{
|
|
1275
|
-
time:
|
|
1276
|
-
pageX:
|
|
1226
|
+
time: g,
|
|
1227
|
+
pageX: o,
|
|
1277
1228
|
pageY: u,
|
|
1278
1229
|
translateX: m.x,
|
|
1279
|
-
translateY:
|
|
1230
|
+
translateY: f
|
|
1280
1231
|
}
|
|
1281
1232
|
],
|
|
1282
1233
|
pointerId: e,
|
|
@@ -1284,98 +1235,92 @@ function _r({
|
|
|
1284
1235
|
};
|
|
1285
1236
|
},
|
|
1286
1237
|
[ye]
|
|
1287
|
-
),
|
|
1238
|
+
), pt = p(
|
|
1288
1239
|
(t) => {
|
|
1289
|
-
t.source === "touch" ?
|
|
1240
|
+
t.source === "touch" ? at(!1) : t.source === "pointer" && J(!1), t.dragging = !1, t.allowed = !1, t.closeAllowed = null, t.started = !1, t.source = null, t.startX = 0, t.startY = 0, t.lastX = 0, t.lastY = 0, t.startTranslateX = 0, t.startTranslate = 0, t.lastTranslateX = 0, t.lastTranslate = 0, t.pointerId = null, t.touchId = null;
|
|
1290
1241
|
},
|
|
1291
|
-
[
|
|
1292
|
-
), De =
|
|
1242
|
+
[J, at]
|
|
1243
|
+
), De = p(
|
|
1293
1244
|
(t, e) => {
|
|
1294
|
-
const
|
|
1295
|
-
t.startX = e.x, t.startY = e.y, t.lastX = e.x, t.lastY = e.y, t.startTranslateX =
|
|
1245
|
+
const n = ot(), l = st();
|
|
1246
|
+
t.startX = e.x, t.startY = e.y, t.lastX = e.x, t.lastY = e.y, t.startTranslateX = l.x, t.startTranslate = n, t.lastTranslateX = l.x, t.lastTranslate = n, t.startTime = q(), t.samples = [
|
|
1296
1247
|
{
|
|
1297
1248
|
time: t.startTime,
|
|
1298
1249
|
pageX: e.x,
|
|
1299
1250
|
pageY: e.y,
|
|
1300
|
-
translateX:
|
|
1301
|
-
translateY:
|
|
1251
|
+
translateX: l.x,
|
|
1252
|
+
translateY: n
|
|
1302
1253
|
}
|
|
1303
1254
|
];
|
|
1304
1255
|
},
|
|
1305
|
-
[
|
|
1306
|
-
), Xe =
|
|
1256
|
+
[ot, st]
|
|
1257
|
+
), Xe = p(
|
|
1307
1258
|
({
|
|
1308
1259
|
currentTranslate: t,
|
|
1309
1260
|
dismissible: e,
|
|
1310
|
-
releaseVelocity:
|
|
1311
|
-
deltaY:
|
|
1312
|
-
startTranslate:
|
|
1261
|
+
releaseVelocity: n,
|
|
1262
|
+
deltaY: l,
|
|
1263
|
+
startTranslate: o
|
|
1313
1264
|
}) => {
|
|
1314
|
-
const u =
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
), C = Oe(
|
|
1320
|
-
Y.length ? Y : [0]
|
|
1321
|
-
), T = Xr({
|
|
1265
|
+
const u = I(), d = Q(), f = w.map(
|
|
1266
|
+
(m) => N(u - m, 0, u)
|
|
1267
|
+
);
|
|
1268
|
+
return gr({
|
|
1269
|
+
closeThreshold: Dt,
|
|
1322
1270
|
currentTranslate: t,
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
c > 0 ? "down" : "up",
|
|
1332
|
-
T
|
|
1333
|
-
) : 0 : e && t > u * Tt && !p ? m : Tr(v, t);
|
|
1271
|
+
deltaY: l,
|
|
1272
|
+
dismissible: e,
|
|
1273
|
+
peekTranslate: d,
|
|
1274
|
+
releaseVelocity: n,
|
|
1275
|
+
restingTranslates: f,
|
|
1276
|
+
sheetHeight: u,
|
|
1277
|
+
startTranslate: o
|
|
1278
|
+
}).translate;
|
|
1334
1279
|
},
|
|
1335
|
-
[
|
|
1336
|
-
),
|
|
1280
|
+
[Dt, Q, I, w]
|
|
1281
|
+
), Bt = p(
|
|
1337
1282
|
(t) => {
|
|
1338
|
-
const e = L ??
|
|
1339
|
-
Et.current =
|
|
1283
|
+
const e = L ?? I();
|
|
1284
|
+
Et.current = dr({
|
|
1340
1285
|
defaultTranslate: D,
|
|
1341
1286
|
sheetHeight: e,
|
|
1342
1287
|
snapHeights: w,
|
|
1343
1288
|
translate: t
|
|
1344
1289
|
});
|
|
1345
1290
|
},
|
|
1346
|
-
[
|
|
1347
|
-
),
|
|
1348
|
-
if (
|
|
1291
|
+
[I, L, w, D]
|
|
1292
|
+
), Qe = p(() => {
|
|
1293
|
+
if (a !== "bottom") return !1;
|
|
1349
1294
|
const t = pr({
|
|
1350
|
-
backdropFromHeight:
|
|
1351
|
-
currentTranslate:
|
|
1352
|
-
sheetHeight: L ??
|
|
1295
|
+
backdropFromHeight: k,
|
|
1296
|
+
currentTranslate: _(),
|
|
1297
|
+
sheetHeight: L ?? I(),
|
|
1353
1298
|
snapHeights: w
|
|
1354
1299
|
});
|
|
1355
|
-
return t === null ? !1 : (O(t, { intent: "sheet" }),
|
|
1300
|
+
return t === null ? !1 : (O(t, { intent: "sheet" }), Bt(t), !0);
|
|
1356
1301
|
}, [
|
|
1357
|
-
E,
|
|
1358
|
-
It,
|
|
1359
1302
|
k,
|
|
1360
|
-
|
|
1361
|
-
|
|
1303
|
+
Bt,
|
|
1304
|
+
I,
|
|
1305
|
+
_,
|
|
1306
|
+
a,
|
|
1362
1307
|
O,
|
|
1363
1308
|
L,
|
|
1364
1309
|
w
|
|
1365
|
-
]),
|
|
1310
|
+
]), Ze = p(
|
|
1366
1311
|
(t) => {
|
|
1367
|
-
if (!r ||
|
|
1312
|
+
if (!r || a !== "bottom" && !E || s === !1 || t.pointerType === "touch") return;
|
|
1368
1313
|
let e = !1;
|
|
1369
|
-
if (
|
|
1314
|
+
if (s === "handle" && Ve(t.target))
|
|
1370
1315
|
e = !0;
|
|
1371
|
-
else if (
|
|
1316
|
+
else if (s === "handle")
|
|
1372
1317
|
return;
|
|
1373
1318
|
if (!e && te(t.target)) return;
|
|
1374
|
-
if (
|
|
1375
|
-
|
|
1319
|
+
if (s === "content" && (e = Fe(t.target), !Pr(t, e))) {
|
|
1320
|
+
a === "bottom" && !ir({
|
|
1376
1321
|
target: t.target,
|
|
1377
|
-
boundary:
|
|
1378
|
-
}) &&
|
|
1322
|
+
boundary: $.current
|
|
1323
|
+
}) && Pt({
|
|
1379
1324
|
chrome: !1,
|
|
1380
1325
|
pointerId: t.pointerId,
|
|
1381
1326
|
selectionArbitration: !0,
|
|
@@ -1385,161 +1330,161 @@ function _r({
|
|
|
1385
1330
|
});
|
|
1386
1331
|
return;
|
|
1387
1332
|
}
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1333
|
+
const n = xr(t.target);
|
|
1334
|
+
Pt({
|
|
1390
1335
|
chrome: e,
|
|
1391
1336
|
pointerId: t.pointerId,
|
|
1392
1337
|
source: "pointer",
|
|
1393
1338
|
startX: t.pageX,
|
|
1394
1339
|
startY: t.pageY
|
|
1395
|
-
}),
|
|
1340
|
+
}), Tr(t.target) || t.preventDefault(), J(!0), !n && typeof t.currentTarget.setPointerCapture == "function" && t.currentTarget.setPointerCapture(t.pointerId);
|
|
1396
1341
|
},
|
|
1397
1342
|
[
|
|
1398
|
-
|
|
1399
|
-
|
|
1343
|
+
Pt,
|
|
1344
|
+
s,
|
|
1400
1345
|
r,
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1346
|
+
a,
|
|
1347
|
+
E,
|
|
1348
|
+
J
|
|
1404
1349
|
]
|
|
1405
|
-
),
|
|
1350
|
+
), ft = p(
|
|
1406
1351
|
(t, e) => {
|
|
1407
|
-
if (!
|
|
1352
|
+
if (!V) return !1;
|
|
1408
1353
|
if (e <= 0) return !0;
|
|
1409
1354
|
if (t.closeAllowed !== null) return t.closeAllowed;
|
|
1410
|
-
const
|
|
1411
|
-
return t.closeAllowed =
|
|
1355
|
+
const n = ae({ reason: "drag-dismiss" });
|
|
1356
|
+
return t.closeAllowed = n, n;
|
|
1412
1357
|
},
|
|
1413
|
-
[ae,
|
|
1414
|
-
),
|
|
1358
|
+
[ae, V]
|
|
1359
|
+
), It = p(
|
|
1415
1360
|
({
|
|
1416
1361
|
closeAllowed: t,
|
|
1417
1362
|
currentTranslate: e,
|
|
1418
|
-
deltaY:
|
|
1419
|
-
releaseVelocity:
|
|
1420
|
-
startTranslate:
|
|
1363
|
+
deltaY: n,
|
|
1364
|
+
releaseVelocity: l,
|
|
1365
|
+
startTranslate: o
|
|
1421
1366
|
}) => {
|
|
1422
1367
|
const d = Xe({
|
|
1423
1368
|
currentTranslate: e,
|
|
1424
|
-
dismissible:
|
|
1425
|
-
releaseVelocity:
|
|
1426
|
-
deltaY:
|
|
1427
|
-
startTranslate:
|
|
1428
|
-
}),
|
|
1429
|
-
if (d >=
|
|
1430
|
-
|
|
1369
|
+
dismissible: V && t !== !1,
|
|
1370
|
+
releaseVelocity: l,
|
|
1371
|
+
deltaY: n,
|
|
1372
|
+
startTranslate: o
|
|
1373
|
+
}), f = I(), m = Q();
|
|
1374
|
+
if (d >= f - 1) {
|
|
1375
|
+
rt({ reason: "drag-dismiss" }, { commit: !1 }) ? we(d, {
|
|
1431
1376
|
from: e,
|
|
1432
|
-
initialVelocity:
|
|
1433
|
-
}) : O(
|
|
1377
|
+
initialVelocity: l
|
|
1378
|
+
}) : O(o, {
|
|
1434
1379
|
from: e,
|
|
1435
|
-
initialVelocity:
|
|
1380
|
+
initialVelocity: l
|
|
1436
1381
|
});
|
|
1437
1382
|
return;
|
|
1438
1383
|
}
|
|
1439
|
-
m > 0 && d >= m - 1 ? Ht("peeked") : (
|
|
1440
|
-
presentationState:
|
|
1384
|
+
m > 0 && d >= m - 1 ? Ht("peeked") : (Yr({
|
|
1385
|
+
presentationState: F,
|
|
1441
1386
|
releaseTranslate: d,
|
|
1442
1387
|
visibleTranslate: D
|
|
1443
|
-
}) && (_t.current = !0), Ht("visible"),
|
|
1388
|
+
}) && (_t.current = !0), Ht("visible"), Bt(d)), O(d, {
|
|
1444
1389
|
from: e,
|
|
1445
|
-
initialVelocity:
|
|
1390
|
+
initialVelocity: l
|
|
1446
1391
|
});
|
|
1447
1392
|
},
|
|
1448
1393
|
[
|
|
1449
1394
|
we,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1395
|
+
Bt,
|
|
1396
|
+
V,
|
|
1397
|
+
Q,
|
|
1453
1398
|
Xe,
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1399
|
+
I,
|
|
1400
|
+
F,
|
|
1401
|
+
rt,
|
|
1457
1402
|
Ht,
|
|
1458
1403
|
O,
|
|
1459
1404
|
D
|
|
1460
1405
|
]
|
|
1461
|
-
), Ot =
|
|
1406
|
+
), Ot = p(
|
|
1462
1407
|
({
|
|
1463
1408
|
currentTranslate: t,
|
|
1464
1409
|
releaseDelta: e,
|
|
1465
|
-
releaseTranslate:
|
|
1466
|
-
releaseVelocity:
|
|
1410
|
+
releaseTranslate: n,
|
|
1411
|
+
releaseVelocity: l
|
|
1467
1412
|
}) => {
|
|
1468
|
-
const
|
|
1469
|
-
if (!
|
|
1470
|
-
const u =
|
|
1471
|
-
currentPoint:
|
|
1472
|
-
velocity:
|
|
1473
|
-
targets:
|
|
1474
|
-
}), d =
|
|
1475
|
-
(
|
|
1476
|
-
) ??
|
|
1413
|
+
const o = it();
|
|
1414
|
+
if (!o) return;
|
|
1415
|
+
const u = fr({
|
|
1416
|
+
currentPoint: n,
|
|
1417
|
+
velocity: l,
|
|
1418
|
+
targets: o.targets
|
|
1419
|
+
}), d = o.targets.find(
|
|
1420
|
+
(b) => b.key === K.current
|
|
1421
|
+
) ?? o.defaultTarget, m = i.current?.getBoundingClientRect(), g = {
|
|
1477
1422
|
x: d.x + e.x,
|
|
1478
1423
|
y: d.y + e.y
|
|
1479
1424
|
};
|
|
1480
|
-
if (
|
|
1481
|
-
closeThreshold:
|
|
1425
|
+
if (V && m && Xr({
|
|
1426
|
+
closeThreshold: Dt,
|
|
1482
1427
|
currentTarget: d,
|
|
1483
|
-
currentTranslate:
|
|
1428
|
+
currentTranslate: g,
|
|
1484
1429
|
releaseTarget: u,
|
|
1485
1430
|
surfaceSize: {
|
|
1486
1431
|
height: m.height,
|
|
1487
1432
|
width: m.width
|
|
1488
1433
|
},
|
|
1489
|
-
targets:
|
|
1490
|
-
}) &&
|
|
1491
|
-
|
|
1434
|
+
targets: o.targets
|
|
1435
|
+
}) && rt({ reason: "drag-dismiss" })) {
|
|
1436
|
+
W(), P();
|
|
1492
1437
|
return;
|
|
1493
1438
|
}
|
|
1494
|
-
if (
|
|
1495
|
-
|
|
1439
|
+
if (K.current = u.key, H.current) {
|
|
1440
|
+
Ct(u);
|
|
1496
1441
|
return;
|
|
1497
1442
|
}
|
|
1498
|
-
|
|
1443
|
+
Z(u, {
|
|
1499
1444
|
from: t,
|
|
1500
|
-
initialVelocity:
|
|
1445
|
+
initialVelocity: l
|
|
1501
1446
|
});
|
|
1502
1447
|
},
|
|
1503
1448
|
[
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1449
|
+
W,
|
|
1450
|
+
Dt,
|
|
1451
|
+
V,
|
|
1452
|
+
P,
|
|
1453
|
+
it,
|
|
1454
|
+
rt,
|
|
1455
|
+
Ct,
|
|
1456
|
+
Z,
|
|
1512
1457
|
i
|
|
1513
1458
|
]
|
|
1514
|
-
),
|
|
1459
|
+
), qe = p(
|
|
1515
1460
|
(t) => {
|
|
1516
|
-
const e =
|
|
1517
|
-
if (!e.dragging || e.source !== "pointer" || !r ||
|
|
1461
|
+
const e = Y.current;
|
|
1462
|
+
if (!e.dragging || e.source !== "pointer" || !r || a !== "bottom" && !E)
|
|
1518
1463
|
return;
|
|
1519
|
-
const
|
|
1520
|
-
if (!(!e.started &&
|
|
1464
|
+
const n = t.pageX - e.startX, l = t.pageY - e.startY, o = t.pointerType === "touch" ? R.dragStartThresholdPx.touch : R.dragStartThresholdPx.mouse;
|
|
1465
|
+
if (!(!e.started && ke({ deltaX: n, deltaY: l, placement: a }) < o)) {
|
|
1521
1466
|
if (e.selectionArbitration && !e.allowed) {
|
|
1522
|
-
const u = Math.abs(
|
|
1523
|
-
if (u >=
|
|
1467
|
+
const u = Math.abs(n), d = Math.abs(l), f = R.selectionArbitrationThresholdPx;
|
|
1468
|
+
if (u >= f && u >= d) {
|
|
1524
1469
|
e.dragging = !1;
|
|
1525
1470
|
return;
|
|
1526
1471
|
}
|
|
1527
|
-
if (d <
|
|
1472
|
+
if (d < f || d <= u)
|
|
1528
1473
|
return;
|
|
1529
|
-
window.getSelection?.()?.removeAllRanges(),
|
|
1474
|
+
window.getSelection?.()?.removeAllRanges(), J(!0);
|
|
1530
1475
|
}
|
|
1531
1476
|
if (!e.allowed) {
|
|
1532
|
-
if (
|
|
1477
|
+
if (a === "bottom" && !Se(t.target, l, e.chrome))
|
|
1533
1478
|
return;
|
|
1534
1479
|
e.allowed = !0, e.started = !0;
|
|
1535
1480
|
const u = t.currentTarget;
|
|
1536
1481
|
e.pointerId !== null && typeof u.hasPointerCapture == "function" && typeof u.setPointerCapture == "function" && !u.hasPointerCapture(e.pointerId) && u.setPointerCapture(e.pointerId);
|
|
1537
1482
|
}
|
|
1538
|
-
if (t.preventDefault(), e.lastX = t.pageX, e.lastY = t.pageY,
|
|
1539
|
-
|
|
1483
|
+
if (t.preventDefault(), e.lastX = t.pageX, e.lastY = t.pageY, a === "popup")
|
|
1484
|
+
ut(e, t), $e(e, t);
|
|
1540
1485
|
else {
|
|
1541
|
-
const u = e.startTranslate +
|
|
1542
|
-
|
|
1486
|
+
const u = e.startTranslate + l, d = ft(e, l);
|
|
1487
|
+
lt(u, d), wt(e, {
|
|
1543
1488
|
pageX: t.pageX,
|
|
1544
1489
|
pageY: t.pageY,
|
|
1545
1490
|
translateX: e.lastTranslateX,
|
|
@@ -1550,154 +1495,154 @@ function _r({
|
|
|
1550
1495
|
},
|
|
1551
1496
|
[
|
|
1552
1497
|
r,
|
|
1553
|
-
ft,
|
|
1554
|
-
gt,
|
|
1555
|
-
n,
|
|
1556
|
-
b,
|
|
1557
|
-
Q,
|
|
1558
1498
|
ut,
|
|
1499
|
+
ft,
|
|
1500
|
+
a,
|
|
1501
|
+
E,
|
|
1502
|
+
J,
|
|
1503
|
+
lt,
|
|
1559
1504
|
Se
|
|
1560
1505
|
]
|
|
1561
|
-
),
|
|
1506
|
+
), tt = p(
|
|
1562
1507
|
({
|
|
1563
1508
|
currentTarget: t,
|
|
1564
1509
|
pageX: e,
|
|
1565
|
-
pageY:
|
|
1566
|
-
releaseCapture:
|
|
1510
|
+
pageY: n,
|
|
1511
|
+
releaseCapture: l = !0
|
|
1567
1512
|
}) => {
|
|
1568
|
-
const
|
|
1569
|
-
if (!
|
|
1513
|
+
const o = Y.current;
|
|
1514
|
+
if (!o.dragging || o.source !== "pointer" || !r || a !== "bottom" && !E)
|
|
1570
1515
|
return;
|
|
1571
|
-
const u =
|
|
1572
|
-
let
|
|
1573
|
-
x:
|
|
1574
|
-
y:
|
|
1575
|
-
},
|
|
1576
|
-
const
|
|
1516
|
+
const u = o.started, d = Number.isFinite(e) ? e : o.lastX, f = Number.isFinite(n) ? n : o.lastY, m = d - o.startX, g = f - o.startY, b = Math.max(q() - o.startTime, 1);
|
|
1517
|
+
let B = {
|
|
1518
|
+
x: o.lastTranslateX,
|
|
1519
|
+
y: o.lastTranslate
|
|
1520
|
+
}, y = B;
|
|
1521
|
+
const S = o.startTranslate;
|
|
1577
1522
|
if (u)
|
|
1578
|
-
if (
|
|
1579
|
-
|
|
1523
|
+
if (a === "popup")
|
|
1524
|
+
ut(o, {
|
|
1580
1525
|
pageX: d,
|
|
1581
|
-
pageY:
|
|
1582
|
-
}),
|
|
1583
|
-
x:
|
|
1584
|
-
y:
|
|
1585
|
-
},
|
|
1526
|
+
pageY: f
|
|
1527
|
+
}), B = {
|
|
1528
|
+
x: o.lastTranslateX,
|
|
1529
|
+
y: o.lastTranslate
|
|
1530
|
+
}, y = Ft(o, {
|
|
1586
1531
|
pageX: d,
|
|
1587
|
-
pageY:
|
|
1532
|
+
pageY: f
|
|
1588
1533
|
});
|
|
1589
1534
|
else {
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1592
|
-
x:
|
|
1593
|
-
y:
|
|
1535
|
+
const A = o.startTranslate + g, vt = ft(o, g);
|
|
1536
|
+
lt(A, vt), B = {
|
|
1537
|
+
x: o.lastTranslateX,
|
|
1538
|
+
y: o.lastTranslate
|
|
1594
1539
|
};
|
|
1595
1540
|
}
|
|
1596
|
-
const
|
|
1597
|
-
if (
|
|
1598
|
-
const
|
|
1599
|
-
x:
|
|
1600
|
-
y:
|
|
1541
|
+
const G = o.closeAllowed;
|
|
1542
|
+
if (l && t && o.pointerId !== null && t.hasPointerCapture(o.pointerId) && t.releasePointerCapture(o.pointerId), u) {
|
|
1543
|
+
const A = a === "popup" ? y : {
|
|
1544
|
+
x: o.lastTranslateX,
|
|
1545
|
+
y: o.lastTranslate
|
|
1601
1546
|
};
|
|
1602
|
-
|
|
1547
|
+
wt(o, {
|
|
1603
1548
|
pageX: d,
|
|
1604
|
-
pageY:
|
|
1605
|
-
translateX:
|
|
1606
|
-
translateY:
|
|
1549
|
+
pageY: f,
|
|
1550
|
+
translateX: A.x,
|
|
1551
|
+
translateY: A.y
|
|
1607
1552
|
});
|
|
1608
1553
|
}
|
|
1609
|
-
if (
|
|
1610
|
-
if (
|
|
1611
|
-
const
|
|
1612
|
-
session:
|
|
1613
|
-
fallbackDelta: { x: m, y:
|
|
1614
|
-
fallbackElapsed:
|
|
1554
|
+
if (pt(o), !!u)
|
|
1555
|
+
if (yt.current = q() + 500, a === "popup") {
|
|
1556
|
+
const A = _e({
|
|
1557
|
+
session: o,
|
|
1558
|
+
fallbackDelta: { x: m, y: g },
|
|
1559
|
+
fallbackElapsed: b
|
|
1615
1560
|
});
|
|
1616
1561
|
Ot({
|
|
1617
|
-
currentTranslate:
|
|
1618
|
-
releaseDelta: { x: m, y:
|
|
1619
|
-
releaseTranslate:
|
|
1620
|
-
releaseVelocity:
|
|
1562
|
+
currentTranslate: B,
|
|
1563
|
+
releaseDelta: { x: m, y: g },
|
|
1564
|
+
releaseTranslate: y,
|
|
1565
|
+
releaseVelocity: A
|
|
1621
1566
|
});
|
|
1622
1567
|
} else {
|
|
1623
|
-
const
|
|
1624
|
-
session:
|
|
1625
|
-
fallbackDeltaY:
|
|
1626
|
-
fallbackElapsed:
|
|
1568
|
+
const A = Ue({
|
|
1569
|
+
session: o,
|
|
1570
|
+
fallbackDeltaY: g,
|
|
1571
|
+
fallbackElapsed: b
|
|
1627
1572
|
});
|
|
1628
|
-
|
|
1629
|
-
closeAllowed:
|
|
1630
|
-
currentTranslate:
|
|
1631
|
-
deltaY:
|
|
1632
|
-
releaseVelocity:
|
|
1633
|
-
startTranslate:
|
|
1573
|
+
It({
|
|
1574
|
+
closeAllowed: G,
|
|
1575
|
+
currentTranslate: B.y,
|
|
1576
|
+
deltaY: g,
|
|
1577
|
+
releaseVelocity: A,
|
|
1578
|
+
startTranslate: S
|
|
1634
1579
|
});
|
|
1635
1580
|
}
|
|
1636
1581
|
},
|
|
1637
1582
|
[
|
|
1638
|
-
|
|
1583
|
+
It,
|
|
1639
1584
|
Ot,
|
|
1640
1585
|
r,
|
|
1586
|
+
ut,
|
|
1641
1587
|
ft,
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
ut
|
|
1588
|
+
a,
|
|
1589
|
+
E,
|
|
1590
|
+
pt,
|
|
1591
|
+
lt
|
|
1647
1592
|
]
|
|
1648
|
-
), Ye =
|
|
1593
|
+
), Ye = p(
|
|
1649
1594
|
(t) => {
|
|
1650
|
-
|
|
1595
|
+
tt({
|
|
1651
1596
|
currentTarget: t.currentTarget,
|
|
1652
1597
|
pageX: t.pageX,
|
|
1653
1598
|
pageY: t.pageY
|
|
1654
1599
|
});
|
|
1655
1600
|
},
|
|
1656
|
-
[
|
|
1657
|
-
),
|
|
1601
|
+
[tt]
|
|
1602
|
+
), tr = p(
|
|
1658
1603
|
(t) => {
|
|
1659
|
-
const e =
|
|
1660
|
-
e.pointerId !== null && t.pointerId !== e.pointerId ||
|
|
1604
|
+
const e = Y.current;
|
|
1605
|
+
e.pointerId !== null && t.pointerId !== e.pointerId || tt({
|
|
1661
1606
|
pageX: t.pageX,
|
|
1662
1607
|
pageY: t.pageY,
|
|
1663
1608
|
releaseCapture: !1
|
|
1664
1609
|
});
|
|
1665
1610
|
},
|
|
1666
|
-
[
|
|
1611
|
+
[tt]
|
|
1667
1612
|
);
|
|
1668
|
-
|
|
1613
|
+
Nt(() => {
|
|
1669
1614
|
if (!r) return;
|
|
1670
|
-
const t = (
|
|
1671
|
-
const u =
|
|
1672
|
-
!u.dragging || u.source !== "pointer" || "pointerId" in
|
|
1673
|
-
pageX:
|
|
1674
|
-
pageY:
|
|
1615
|
+
const t = (o) => {
|
|
1616
|
+
const u = Y.current;
|
|
1617
|
+
!u.dragging || u.source !== "pointer" || "pointerId" in o && u.pointerId !== null && o.pointerId !== u.pointerId || tt({
|
|
1618
|
+
pageX: o.pageX,
|
|
1619
|
+
pageY: o.pageY,
|
|
1675
1620
|
releaseCapture: !1
|
|
1676
1621
|
});
|
|
1677
1622
|
}, e = () => {
|
|
1678
|
-
const
|
|
1679
|
-
!
|
|
1680
|
-
pageX:
|
|
1681
|
-
pageY:
|
|
1623
|
+
const o = Y.current;
|
|
1624
|
+
!o.dragging || o.source !== "pointer" || tt({
|
|
1625
|
+
pageX: o.lastX,
|
|
1626
|
+
pageY: o.lastY,
|
|
1682
1627
|
releaseCapture: !1
|
|
1683
1628
|
});
|
|
1684
|
-
},
|
|
1685
|
-
const u =
|
|
1686
|
-
!u.dragging || u.source !== "pointer" ||
|
|
1687
|
-
},
|
|
1688
|
-
const u =
|
|
1689
|
-
!u.dragging || u.source !== "pointer" ||
|
|
1629
|
+
}, n = (o) => {
|
|
1630
|
+
const u = Y.current;
|
|
1631
|
+
!u.dragging || u.source !== "pointer" || o.relatedTarget === null && t(o);
|
|
1632
|
+
}, l = (o) => {
|
|
1633
|
+
const u = Y.current;
|
|
1634
|
+
!u.dragging || u.source !== "pointer" || o.relatedTarget === null && t(o);
|
|
1690
1635
|
};
|
|
1691
|
-
return document.addEventListener("pointerout",
|
|
1636
|
+
return document.addEventListener("pointerout", n, !0), document.addEventListener("mouseout", l, !0), window.addEventListener("pointerup", t, !0), window.addEventListener(
|
|
1692
1637
|
"pointercancel",
|
|
1693
1638
|
t,
|
|
1694
1639
|
!0
|
|
1695
1640
|
), window.addEventListener("blur", e), () => {
|
|
1696
1641
|
document.removeEventListener(
|
|
1697
1642
|
"pointerout",
|
|
1698
|
-
|
|
1643
|
+
n,
|
|
1699
1644
|
!0
|
|
1700
|
-
), document.removeEventListener("mouseout",
|
|
1645
|
+
), document.removeEventListener("mouseout", l, !0), window.removeEventListener(
|
|
1701
1646
|
"pointerup",
|
|
1702
1647
|
t,
|
|
1703
1648
|
!0
|
|
@@ -1707,95 +1652,95 @@ function _r({
|
|
|
1707
1652
|
!0
|
|
1708
1653
|
), window.removeEventListener("blur", e);
|
|
1709
1654
|
};
|
|
1710
|
-
}, [
|
|
1655
|
+
}, [tt, r]), Nt(() => {
|
|
1711
1656
|
if (!r) return;
|
|
1712
1657
|
const t = (e) => {
|
|
1713
|
-
const
|
|
1714
|
-
if (
|
|
1715
|
-
if (
|
|
1716
|
-
|
|
1658
|
+
const n = yt.current;
|
|
1659
|
+
if (n <= 0) return;
|
|
1660
|
+
if (q() > n) {
|
|
1661
|
+
yt.current = 0;
|
|
1717
1662
|
return;
|
|
1718
1663
|
}
|
|
1719
|
-
const
|
|
1720
|
-
|
|
1664
|
+
const l = i.current;
|
|
1665
|
+
l && e.target instanceof Node && l.contains(e.target) && (yt.current = 0, e.preventDefault(), e.stopPropagation());
|
|
1721
1666
|
};
|
|
1722
1667
|
return document.addEventListener("click", t, !0), () => {
|
|
1723
1668
|
document.removeEventListener("click", t, !0);
|
|
1724
1669
|
};
|
|
1725
1670
|
}, [r, i]);
|
|
1726
|
-
const
|
|
1727
|
-
const e =
|
|
1728
|
-
return e.touchId !== null ?
|
|
1729
|
-
}, []),
|
|
1671
|
+
const kt = p((t) => {
|
|
1672
|
+
const e = Y.current;
|
|
1673
|
+
return e.touchId !== null ? He(t.changedTouches, e.touchId) ?? He(t.touches, e.touchId) : t.touches[0] ?? t.changedTouches[0] ?? null;
|
|
1674
|
+
}, []), er = p(
|
|
1730
1675
|
(t) => {
|
|
1731
|
-
if (!r ||
|
|
1676
|
+
if (!r || a !== "bottom" && !E || s === !1 || t.touches.length !== 1) return;
|
|
1732
1677
|
let e = !1;
|
|
1733
|
-
if (
|
|
1678
|
+
if (s === "handle" && Ve(t.target))
|
|
1734
1679
|
e = !0;
|
|
1735
|
-
else if (
|
|
1680
|
+
else if (s === "handle")
|
|
1736
1681
|
return;
|
|
1737
1682
|
if (!e && te(t.target)) return;
|
|
1738
|
-
|
|
1739
|
-
const
|
|
1740
|
-
|
|
1683
|
+
s === "content" && (e = Fe(t.target));
|
|
1684
|
+
const n = t.touches[0];
|
|
1685
|
+
a === "bottom" && bt({
|
|
1741
1686
|
target: t.target,
|
|
1742
1687
|
chrome: e
|
|
1743
|
-
}),
|
|
1688
|
+
}), Pt({
|
|
1744
1689
|
chrome: e,
|
|
1745
1690
|
source: "touch",
|
|
1746
|
-
startX:
|
|
1747
|
-
startY:
|
|
1748
|
-
touchId:
|
|
1691
|
+
startX: n.pageX,
|
|
1692
|
+
startY: n.pageY,
|
|
1693
|
+
touchId: n.identifier
|
|
1749
1694
|
});
|
|
1750
1695
|
},
|
|
1751
1696
|
[
|
|
1752
|
-
|
|
1753
|
-
|
|
1697
|
+
Pt,
|
|
1698
|
+
s,
|
|
1754
1699
|
r,
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1700
|
+
a,
|
|
1701
|
+
E,
|
|
1702
|
+
bt
|
|
1758
1703
|
]
|
|
1759
|
-
),
|
|
1704
|
+
), Ee = p(
|
|
1760
1705
|
(t) => {
|
|
1761
|
-
const e =
|
|
1762
|
-
if (!e.dragging || e.source !== "touch" || !r ||
|
|
1706
|
+
const e = Y.current;
|
|
1707
|
+
if (!e.dragging || e.source !== "touch" || !r || a !== "bottom" && !E)
|
|
1763
1708
|
return;
|
|
1764
|
-
const
|
|
1765
|
-
if (!
|
|
1766
|
-
const
|
|
1767
|
-
deltaX:
|
|
1768
|
-
deltaY:
|
|
1769
|
-
placement:
|
|
1770
|
-
}), d =
|
|
1709
|
+
const n = kt(t);
|
|
1710
|
+
if (!n) return;
|
|
1711
|
+
const l = n.pageX - e.startX, o = n.pageY - e.startY, u = ke({
|
|
1712
|
+
deltaX: l,
|
|
1713
|
+
deltaY: o,
|
|
1714
|
+
placement: a
|
|
1715
|
+
}), d = R.dragStartThresholdPx.touch, f = a === "bottom" ? lr({
|
|
1771
1716
|
target: t.target,
|
|
1772
|
-
deltaY:
|
|
1717
|
+
deltaY: o,
|
|
1773
1718
|
chrome: e.chrome,
|
|
1774
|
-
bodyNode:
|
|
1775
|
-
canExpand:
|
|
1776
|
-
}) :
|
|
1719
|
+
bodyNode: $.current,
|
|
1720
|
+
canExpand: ot() > 1
|
|
1721
|
+
}) : cr({
|
|
1777
1722
|
target: t.target,
|
|
1778
|
-
bodyNode:
|
|
1723
|
+
bodyNode: $.current
|
|
1779
1724
|
});
|
|
1780
|
-
if (
|
|
1781
|
-
const
|
|
1782
|
-
!
|
|
1725
|
+
if (f.preventDefault) {
|
|
1726
|
+
const g = a === "bottom" && Math.abs(l) > Math.abs(o) && Math.abs(o) < d && !e.started && u < d;
|
|
1727
|
+
!g && a === "bottom" && bt({
|
|
1783
1728
|
target: t.target,
|
|
1784
1729
|
chrome: e.chrome
|
|
1785
|
-
}),
|
|
1730
|
+
}), g || Oe(t);
|
|
1786
1731
|
}
|
|
1787
|
-
if (
|
|
1788
|
-
|
|
1732
|
+
if (f.resetAnchor) {
|
|
1733
|
+
at(!1), De(e, { x: n.pageX, y: n.pageY });
|
|
1789
1734
|
return;
|
|
1790
1735
|
}
|
|
1791
|
-
if (
|
|
1792
|
-
if (e.allowed || (e.allowed = !0, e.started = !0),
|
|
1793
|
-
|
|
1736
|
+
if (f.allowDrag && !(!e.started && u < d))
|
|
1737
|
+
if (e.allowed || (e.allowed = !0, e.started = !0), f.preventDefault || Oe(t), e.lastX = n.pageX, e.lastY = n.pageY, a === "popup")
|
|
1738
|
+
ut(e, n), $e(e, n);
|
|
1794
1739
|
else {
|
|
1795
|
-
const m = e.startTranslate +
|
|
1796
|
-
|
|
1797
|
-
pageX:
|
|
1798
|
-
pageY:
|
|
1740
|
+
const m = e.startTranslate + o, g = ft(e, o);
|
|
1741
|
+
lt(m, g), wt(e, {
|
|
1742
|
+
pageX: n.pageX,
|
|
1743
|
+
pageY: n.pageY,
|
|
1799
1744
|
translateX: e.lastTranslateX,
|
|
1800
1745
|
translateY: e.lastTranslate
|
|
1801
1746
|
});
|
|
@@ -1803,22 +1748,22 @@ function _r({
|
|
|
1803
1748
|
},
|
|
1804
1749
|
[
|
|
1805
1750
|
r,
|
|
1751
|
+
ut,
|
|
1806
1752
|
ft,
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
b,
|
|
1753
|
+
ot,
|
|
1754
|
+
kt,
|
|
1755
|
+
a,
|
|
1756
|
+
E,
|
|
1812
1757
|
De,
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1758
|
+
at,
|
|
1759
|
+
lt,
|
|
1760
|
+
bt
|
|
1816
1761
|
]
|
|
1817
1762
|
);
|
|
1818
|
-
|
|
1819
|
-
if (!
|
|
1763
|
+
Nt(() => {
|
|
1764
|
+
if (!c || !r || a !== "bottom" && !E || s === !1 || typeof window > "u") return;
|
|
1820
1765
|
const t = (e) => {
|
|
1821
|
-
|
|
1766
|
+
Ee(e);
|
|
1822
1767
|
};
|
|
1823
1768
|
return window.addEventListener("touchmove", t, {
|
|
1824
1769
|
capture: !0,
|
|
@@ -1826,111 +1771,111 @@ function _r({
|
|
|
1826
1771
|
}), () => {
|
|
1827
1772
|
window.removeEventListener("touchmove", t, !0);
|
|
1828
1773
|
};
|
|
1829
|
-
}, [
|
|
1830
|
-
const
|
|
1774
|
+
}, [s, r, Ee, c, a, E]);
|
|
1775
|
+
const rr = p(
|
|
1831
1776
|
(t) => {
|
|
1832
|
-
const e =
|
|
1833
|
-
if (!e.dragging || e.source !== "touch" || !r ||
|
|
1777
|
+
const e = Y.current;
|
|
1778
|
+
if (!e.dragging || e.source !== "touch" || !r || a !== "bottom" && !E)
|
|
1834
1779
|
return;
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1837
|
-
const
|
|
1780
|
+
const n = kt(t), l = n?.pageX ?? e.lastX, o = n?.pageY ?? e.lastY, u = e.started, d = e.closeAllowed, f = l - e.startX, m = o - e.startY, g = Math.max(q() - e.startTime, 1);
|
|
1781
|
+
a === "popup" && ct();
|
|
1782
|
+
const b = {
|
|
1838
1783
|
x: e.lastTranslateX,
|
|
1839
1784
|
y: e.lastTranslate
|
|
1840
1785
|
};
|
|
1841
|
-
let
|
|
1842
|
-
const
|
|
1786
|
+
let B = b;
|
|
1787
|
+
const y = e.startTranslate;
|
|
1843
1788
|
if (u) {
|
|
1844
|
-
const
|
|
1845
|
-
pageX:
|
|
1846
|
-
pageY:
|
|
1789
|
+
const S = a === "popup" ? Ft(e, {
|
|
1790
|
+
pageX: l,
|
|
1791
|
+
pageY: o
|
|
1847
1792
|
}) : {
|
|
1848
1793
|
x: e.lastTranslateX,
|
|
1849
1794
|
y: e.lastTranslate
|
|
1850
1795
|
};
|
|
1851
|
-
|
|
1852
|
-
pageX:
|
|
1853
|
-
pageY:
|
|
1854
|
-
translateX:
|
|
1855
|
-
translateY:
|
|
1796
|
+
B = S, wt(e, {
|
|
1797
|
+
pageX: l,
|
|
1798
|
+
pageY: o,
|
|
1799
|
+
translateX: S.x,
|
|
1800
|
+
translateY: S.y
|
|
1856
1801
|
});
|
|
1857
1802
|
}
|
|
1858
|
-
if (
|
|
1859
|
-
if (
|
|
1860
|
-
const
|
|
1803
|
+
if (pt(e), !!u)
|
|
1804
|
+
if (yt.current = q() + 500, a === "popup") {
|
|
1805
|
+
const S = _e({
|
|
1861
1806
|
session: e,
|
|
1862
|
-
fallbackDelta: { x:
|
|
1863
|
-
fallbackElapsed:
|
|
1807
|
+
fallbackDelta: { x: f, y: m },
|
|
1808
|
+
fallbackElapsed: g
|
|
1864
1809
|
});
|
|
1865
1810
|
Ot({
|
|
1866
|
-
currentTranslate:
|
|
1867
|
-
releaseDelta: { x:
|
|
1868
|
-
releaseTranslate:
|
|
1869
|
-
releaseVelocity:
|
|
1811
|
+
currentTranslate: b,
|
|
1812
|
+
releaseDelta: { x: f, y: m },
|
|
1813
|
+
releaseTranslate: B,
|
|
1814
|
+
releaseVelocity: S
|
|
1870
1815
|
});
|
|
1871
1816
|
} else {
|
|
1872
|
-
const
|
|
1817
|
+
const S = Ue({
|
|
1873
1818
|
session: e,
|
|
1874
1819
|
fallbackDeltaY: m,
|
|
1875
|
-
fallbackElapsed:
|
|
1820
|
+
fallbackElapsed: g
|
|
1876
1821
|
});
|
|
1877
|
-
|
|
1822
|
+
It({
|
|
1878
1823
|
closeAllowed: d,
|
|
1879
|
-
currentTranslate:
|
|
1824
|
+
currentTranslate: b.y,
|
|
1880
1825
|
deltaY: m,
|
|
1881
|
-
releaseVelocity:
|
|
1882
|
-
startTranslate:
|
|
1826
|
+
releaseVelocity: S,
|
|
1827
|
+
startTranslate: y
|
|
1883
1828
|
});
|
|
1884
1829
|
}
|
|
1885
1830
|
},
|
|
1886
1831
|
[
|
|
1887
|
-
|
|
1832
|
+
It,
|
|
1888
1833
|
Ot,
|
|
1889
1834
|
r,
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1835
|
+
kt,
|
|
1836
|
+
a,
|
|
1837
|
+
E,
|
|
1838
|
+
pt,
|
|
1839
|
+
ct
|
|
1895
1840
|
]
|
|
1896
|
-
),
|
|
1897
|
-
const t =
|
|
1841
|
+
), nr = p(() => {
|
|
1842
|
+
const t = Y.current;
|
|
1898
1843
|
if (!t.dragging || t.source !== "touch") return;
|
|
1899
|
-
const e = t.started,
|
|
1844
|
+
const e = t.started, n = t.startTranslate, l = t.lastTranslate, o = {
|
|
1900
1845
|
x: t.startTranslateX,
|
|
1901
1846
|
y: t.startTranslate
|
|
1902
1847
|
}, u = {
|
|
1903
1848
|
x: t.lastTranslateX,
|
|
1904
1849
|
y: t.lastTranslate
|
|
1905
|
-
}, d =
|
|
1906
|
-
if (
|
|
1850
|
+
}, d = a;
|
|
1851
|
+
if (pt(t), !!e) {
|
|
1907
1852
|
if (d === "popup") {
|
|
1908
|
-
|
|
1853
|
+
H.current ? Ct(o) : Z(o, { from: u });
|
|
1909
1854
|
return;
|
|
1910
1855
|
}
|
|
1911
|
-
O(
|
|
1856
|
+
O(n, { from: l });
|
|
1912
1857
|
}
|
|
1913
1858
|
}, [
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1859
|
+
a,
|
|
1860
|
+
pt,
|
|
1861
|
+
Ct,
|
|
1862
|
+
Z,
|
|
1918
1863
|
O
|
|
1919
1864
|
]);
|
|
1920
1865
|
return {
|
|
1921
|
-
collapseBottomSheetToUndimmedSnap:
|
|
1866
|
+
collapseBottomSheetToUndimmedSnap: Qe,
|
|
1922
1867
|
handlers: {
|
|
1923
|
-
onPointerDown:
|
|
1924
|
-
onPointerMove:
|
|
1868
|
+
onPointerDown: Ze,
|
|
1869
|
+
onPointerMove: qe,
|
|
1925
1870
|
onPointerUp: Ye,
|
|
1926
1871
|
onPointerCancel: Ye,
|
|
1927
|
-
onLostPointerCapture:
|
|
1928
|
-
onTouchStart:
|
|
1929
|
-
onTouchEnd:
|
|
1930
|
-
onTouchCancel:
|
|
1872
|
+
onLostPointerCapture: tr,
|
|
1873
|
+
onTouchStart: er,
|
|
1874
|
+
onTouchEnd: rr,
|
|
1875
|
+
onTouchCancel: nr
|
|
1931
1876
|
}
|
|
1932
1877
|
};
|
|
1933
1878
|
}
|
|
1934
1879
|
export {
|
|
1935
|
-
|
|
1880
|
+
Hr as useModalDrag
|
|
1936
1881
|
};
|