@luciodale/swipe-bar 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import dt, { createContext as ft, useState as re, useRef as W, useMemo as Ue, useCallback as Z, useEffect as z, useContext as gt } from "react";
1
+ import ft, { createContext as gt, useState as re, useRef as L, useMemo as Ze, useCallback as U, useEffect as q, useContext as ht } from "react";
2
2
  var we = { exports: {} }, de = {};
3
3
  /**
4
4
  * @license React
@@ -10,23 +10,23 @@ var we = { exports: {} }, de = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var Ce;
13
- function ht() {
13
+ function mt() {
14
14
  if (Ce) return de;
15
15
  Ce = 1;
16
16
  var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
17
- function r(n, a, i) {
17
+ function r(i, s, o) {
18
18
  var u = null;
19
- if (i !== void 0 && (u = "" + i), a.key !== void 0 && (u = "" + a.key), "key" in a) {
20
- i = {};
21
- for (var s in a)
22
- s !== "key" && (i[s] = a[s]);
23
- } else i = a;
24
- return a = i.ref, {
19
+ if (o !== void 0 && (u = "" + o), s.key !== void 0 && (u = "" + s.key), "key" in s) {
20
+ o = {};
21
+ for (var a in s)
22
+ a !== "key" && (o[a] = s[a]);
23
+ } else o = s;
24
+ return s = o.ref, {
25
25
  $$typeof: e,
26
- type: n,
26
+ type: i,
27
27
  key: u,
28
- ref: a !== void 0 ? a : null,
29
- props: i
28
+ ref: s !== void 0 ? s : null,
29
+ props: o
30
30
  };
31
31
  }
32
32
  return de.Fragment = t, de.jsx = r, de.jsxs = r, de;
@@ -42,584 +42,584 @@ var fe = {};
42
42
  * LICENSE file in the root directory of this source tree.
43
43
  */
44
44
  var De;
45
- function mt() {
45
+ function pt() {
46
46
  return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
47
- function e(o) {
48
- if (o == null) return null;
49
- if (typeof o == "function")
50
- return o.$$typeof === q ? null : o.displayName || o.name || null;
51
- if (typeof o == "string") return o;
52
- switch (o) {
53
- case Y:
47
+ function e(n) {
48
+ if (n == null) return null;
49
+ if (typeof n == "function")
50
+ return n.$$typeof === V ? null : n.displayName || n.name || null;
51
+ if (typeof n == "string") return n;
52
+ switch (n) {
53
+ case P:
54
54
  return "Fragment";
55
- case j:
55
+ case _:
56
56
  return "Profiler";
57
- case $:
57
+ case D:
58
58
  return "StrictMode";
59
- case M:
59
+ case B:
60
60
  return "Suspense";
61
- case f:
61
+ case m:
62
62
  return "SuspenseList";
63
- case P:
63
+ case O:
64
64
  return "Activity";
65
65
  }
66
- if (typeof o == "object")
67
- switch (typeof o.tag == "number" && console.error(
66
+ if (typeof n == "object")
67
+ switch (typeof n.tag == "number" && console.error(
68
68
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
- ), o.$$typeof) {
70
- case T:
69
+ ), n.$$typeof) {
70
+ case y:
71
71
  return "Portal";
72
- case N:
73
- return o.displayName || "Context";
72
+ case $:
73
+ return n.displayName || "Context";
74
74
  case C:
75
- return (o._context.displayName || "Context") + ".Consumer";
76
- case D:
77
- var v = o.render;
78
- return o = o.displayName, o || (o = v.displayName || v.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
79
- case w:
80
- return v = o.displayName || null, v !== null ? v : e(o.type) || "Memo";
81
- case O:
82
- v = o._payload, o = o._init;
75
+ return (n._context.displayName || "Context") + ".Consumer";
76
+ case j:
77
+ var f = n.render;
78
+ return n = n.displayName, n || (n = f.displayName || f.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
79
+ case p:
80
+ return f = n.displayName || null, f !== null ? f : e(n.type) || "Memo";
81
+ case T:
82
+ f = n._payload, n = n._init;
83
83
  try {
84
- return e(o(v));
84
+ return e(n(f));
85
85
  } catch {
86
86
  }
87
87
  }
88
88
  return null;
89
89
  }
90
- function t(o) {
91
- return "" + o;
90
+ function t(n) {
91
+ return "" + n;
92
92
  }
93
- function r(o) {
93
+ function r(n) {
94
94
  try {
95
- t(o);
96
- var v = !1;
95
+ t(n);
96
+ var f = !1;
97
97
  } catch {
98
- v = !0;
98
+ f = !0;
99
99
  }
100
- if (v) {
101
- v = console;
102
- var I = v.error, L = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
103
- return I.call(
104
- v,
100
+ if (f) {
101
+ f = console;
102
+ var E = f.error, I = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
103
+ return E.call(
104
+ f,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- L
107
- ), t(o);
106
+ I
107
+ ), t(n);
108
108
  }
109
109
  }
110
- function n(o) {
111
- if (o === Y) return "<>";
112
- if (typeof o == "object" && o !== null && o.$$typeof === O)
110
+ function i(n) {
111
+ if (n === P) return "<>";
112
+ if (typeof n == "object" && n !== null && n.$$typeof === T)
113
113
  return "<...>";
114
114
  try {
115
- var v = e(o);
116
- return v ? "<" + v + ">" : "<...>";
115
+ var f = e(n);
116
+ return f ? "<" + f + ">" : "<...>";
117
117
  } catch {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function a() {
122
- var o = k.A;
123
- return o === null ? null : o.getOwner();
121
+ function s() {
122
+ var n = F.A;
123
+ return n === null ? null : n.getOwner();
124
124
  }
125
- function i() {
125
+ function o() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function u(o) {
129
- if (G.call(o, "key")) {
130
- var v = Object.getOwnPropertyDescriptor(o, "key").get;
131
- if (v && v.isReactWarning) return !1;
128
+ function u(n) {
129
+ if (k.call(n, "key")) {
130
+ var f = Object.getOwnPropertyDescriptor(n, "key").get;
131
+ if (f && f.isReactWarning) return !1;
132
132
  }
133
- return o.key !== void 0;
133
+ return n.key !== void 0;
134
134
  }
135
- function s(o, v) {
136
- function I() {
137
- V || (V = !0, console.error(
135
+ function a(n, f) {
136
+ function E() {
137
+ Q || (Q = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- v
139
+ f
140
140
  ));
141
141
  }
142
- I.isReactWarning = !0, Object.defineProperty(o, "key", {
143
- get: I,
142
+ E.isReactWarning = !0, Object.defineProperty(n, "key", {
143
+ get: E,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function d() {
148
- var o = e(this.type);
149
- return Q[o] || (Q[o] = !0, console.error(
147
+ function l() {
148
+ var n = e(this.type);
149
+ return J[n] || (J[n] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
- )), o = this.props.ref, o !== void 0 ? o : null;
151
+ )), n = this.props.ref, n !== void 0 ? n : null;
152
152
  }
153
- function c(o, v, I, L, oe, J) {
154
- var X = I.ref;
155
- return o = {
156
- $$typeof: A,
157
- type: o,
158
- key: v,
159
- props: I,
160
- _owner: L
161
- }, (X !== void 0 ? X : null) !== null ? Object.defineProperty(o, "ref", {
153
+ function c(n, f, E, I, z, Z) {
154
+ var X = E.ref;
155
+ return n = {
156
+ $$typeof: M,
157
+ type: n,
158
+ key: f,
159
+ props: E,
160
+ _owner: I
161
+ }, (X !== void 0 ? X : null) !== null ? Object.defineProperty(n, "ref", {
162
162
  enumerable: !1,
163
- get: d
164
- }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
163
+ get: l
164
+ }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
167
167
  writable: !0,
168
168
  value: 0
169
- }), Object.defineProperty(o, "_debugInfo", {
169
+ }), Object.defineProperty(n, "_debugInfo", {
170
170
  configurable: !1,
171
171
  enumerable: !1,
172
172
  writable: !0,
173
173
  value: null
174
- }), Object.defineProperty(o, "_debugStack", {
174
+ }), Object.defineProperty(n, "_debugStack", {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: oe
179
- }), Object.defineProperty(o, "_debugTask", {
178
+ value: z
179
+ }), Object.defineProperty(n, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: J
184
- }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
183
+ value: Z
184
+ }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
185
185
  }
186
- function p(o, v, I, L, oe, J) {
187
- var X = v.children;
186
+ function x(n, f, E, I, z, Z) {
187
+ var X = f.children;
188
188
  if (X !== void 0)
189
- if (L)
189
+ if (I)
190
190
  if (H(X)) {
191
- for (L = 0; L < X.length; L++)
192
- b(X[L]);
191
+ for (I = 0; I < X.length; I++)
192
+ w(X[I]);
193
193
  Object.freeze && Object.freeze(X);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else b(X);
199
- if (G.call(v, "key")) {
200
- X = e(o);
201
- var ne = Object.keys(v).filter(function(me) {
198
+ else w(X);
199
+ if (k.call(f, "key")) {
200
+ X = e(n);
201
+ var ie = Object.keys(f).filter(function(me) {
202
202
  return me !== "key";
203
203
  });
204
- L = 0 < ne.length ? "{key: someKey, " + ne.join(": ..., ") + ": ...}" : "{key: someKey}", _[X + L] || (ne = 0 < ne.length ? "{" + ne.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ I = 0 < ie.length ? "{key: someKey, " + ie.join(": ..., ") + ": ...}" : "{key: someKey}", N[X + I] || (ie = 0 < ie.length ? "{" + ie.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
- L,
211
+ I,
212
212
  X,
213
- ne,
213
+ ie,
214
214
  X
215
- ), _[X + L] = !0);
215
+ ), N[X + I] = !0);
216
216
  }
217
- if (X = null, I !== void 0 && (r(I), X = "" + I), u(v) && (r(v.key), X = "" + v.key), "key" in v) {
218
- I = {};
219
- for (var le in v)
220
- le !== "key" && (I[le] = v[le]);
221
- } else I = v;
222
- return X && s(
223
- I,
224
- typeof o == "function" ? o.displayName || o.name || "Unknown" : o
217
+ if (X = null, E !== void 0 && (r(E), X = "" + E), u(f) && (r(f.key), X = "" + f.key), "key" in f) {
218
+ E = {};
219
+ for (var ue in f)
220
+ ue !== "key" && (E[ue] = f[ue]);
221
+ } else E = f;
222
+ return X && a(
223
+ E,
224
+ typeof n == "function" ? n.displayName || n.name || "Unknown" : n
225
225
  ), c(
226
- o,
226
+ n,
227
227
  X,
228
- I,
229
- a(),
230
- oe,
231
- J
228
+ E,
229
+ s(),
230
+ z,
231
+ Z
232
232
  );
233
233
  }
234
- function b(o) {
235
- x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === O && (o._payload.status === "fulfilled" ? x(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
234
+ function w(n) {
235
+ v(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === T && (n._payload.status === "fulfilled" ? v(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
236
236
  }
237
- function x(o) {
238
- return typeof o == "object" && o !== null && o.$$typeof === A;
237
+ function v(n) {
238
+ return typeof n == "object" && n !== null && n.$$typeof === M;
239
239
  }
240
- var m = dt, A = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), Y = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), N = Symbol.for("react.context"), D = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), q = Symbol.for("react.client.reference"), k = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, H = Array.isArray, U = console.createTask ? console.createTask : function() {
240
+ var b = ft, M = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), D = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), F = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, H = Array.isArray, G = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
- m = {
244
- react_stack_bottom_frame: function(o) {
245
- return o();
243
+ b = {
244
+ react_stack_bottom_frame: function(n) {
245
+ return n();
246
246
  }
247
247
  };
248
- var V, Q = {}, y = m.react_stack_bottom_frame.bind(
249
- m,
250
- i
251
- )(), F = U(n(i)), _ = {};
252
- fe.Fragment = Y, fe.jsx = function(o, v, I) {
253
- var L = 1e4 > k.recentlyCreatedOwnerStacks++;
254
- return p(
255
- o,
256
- v,
257
- I,
248
+ var Q, J = {}, Y = b.react_stack_bottom_frame.bind(
249
+ b,
250
+ o
251
+ )(), ne = G(i(o)), N = {};
252
+ fe.Fragment = P, fe.jsx = function(n, f, E) {
253
+ var I = 1e4 > F.recentlyCreatedOwnerStacks++;
254
+ return x(
255
+ n,
256
+ f,
257
+ E,
258
258
  !1,
259
- L ? Error("react-stack-top-frame") : y,
260
- L ? U(n(o)) : F
259
+ I ? Error("react-stack-top-frame") : Y,
260
+ I ? G(i(n)) : ne
261
261
  );
262
- }, fe.jsxs = function(o, v, I) {
263
- var L = 1e4 > k.recentlyCreatedOwnerStacks++;
264
- return p(
265
- o,
266
- v,
267
- I,
262
+ }, fe.jsxs = function(n, f, E) {
263
+ var I = 1e4 > F.recentlyCreatedOwnerStacks++;
264
+ return x(
265
+ n,
266
+ f,
267
+ E,
268
268
  !0,
269
- L ? Error("react-stack-top-frame") : y,
270
- L ? U(n(o)) : F
269
+ I ? Error("react-stack-top-frame") : Y,
270
+ I ? G(i(n)) : ne
271
271
  );
272
272
  };
273
273
  }()), fe;
274
274
  }
275
- process.env.NODE_ENV === "production" ? we.exports = ht() : we.exports = mt();
275
+ process.env.NODE_ENV === "production" ? we.exports = mt() : we.exports = pt();
276
276
  var R = we.exports;
277
- const Ze = ft(null), pe = (e) => {
277
+ const ze = gt(null), pe = (e) => {
278
278
  throw new Error(`Unhandled sidebar side: ${e}`);
279
- }, ve = { isOpen: !1, anchorState: "closed" }, rr = ({
279
+ }, ve = { isOpen: !1, anchorState: "closed" }, nr = ({
280
280
  children: e,
281
281
  sidebarWidthPx: t,
282
282
  transitionMs: r,
283
- edgeActivationWidthPx: n,
284
- dragActivationDeltaPx: a,
285
- showOverlay: i,
283
+ edgeActivationWidthPx: i,
284
+ dragActivationDeltaPx: s,
285
+ showOverlay: o,
286
286
  isAbsolute: u,
287
- overlayBackgroundColor: s,
288
- toggleIconColor: d,
287
+ overlayBackgroundColor: a,
288
+ toggleIconColor: l,
289
289
  toggleIconSizePx: c,
290
- toggleIconEdgeDistancePx: p,
291
- showToggle: b,
292
- mediaQueryWidth: x,
293
- swipeBarZIndex: m,
294
- toggleZIndex: A,
295
- overlayZIndex: T,
296
- fadeContent: Y,
297
- fadeContentTransitionMs: $
290
+ toggleIconEdgeDistancePx: x,
291
+ showToggle: w,
292
+ mediaQueryWidth: v,
293
+ swipeBarZIndex: b,
294
+ toggleZIndex: M,
295
+ overlayZIndex: y,
296
+ fadeContent: P,
297
+ fadeContentTransitionMs: D
298
298
  }) => {
299
299
  var Ie, Me;
300
- const [j, C] = re(null), [N, D] = re(!1), [M, f] = re(!1), [w, O] = re({}), [P, q] = re({}), k = W(null), G = W(null), H = W(null), U = W(null), [V, Q] = re({}), [y, F] = re({}), _ = W(/* @__PURE__ */ new Map()), o = W(null), v = W([]), I = ((Ie = V.primary) == null ? void 0 : Ie.isOpen) ?? !1, L = ((Me = V.primary) == null ? void 0 : Me.anchorState) ?? "closed", oe = Ue(
301
- () => Object.values(V).some((l) => l.isOpen),
302
- [V]
303
- ), J = _.current.get("primary"), X = (J == null ? void 0 : J.sidebarRef) ?? { current: null }, ne = (J == null ? void 0 : J.toggleRef) ?? { current: null }, le = y.primary ?? {}, [me, Je] = re({
304
- sidebarWidthPx: t ?? wt,
300
+ const [_, C] = re(null), [$, j] = re(!1), [B, m] = re(!1), [p, T] = re({}), [O, V] = re({}), F = L(null), k = L(null), H = L(null), G = L(null), [Q, J] = re({}), [Y, ne] = re({}), N = L(/* @__PURE__ */ new Map()), n = L(null), f = L([]), E = ((Ie = Q.primary) == null ? void 0 : Ie.isOpen) ?? !1, I = ((Me = Q.primary) == null ? void 0 : Me.anchorState) ?? "closed", z = Ze(
301
+ () => Object.values(Q).some((d) => d.isOpen),
302
+ [Q]
303
+ ), Z = N.current.get("primary"), X = (Z == null ? void 0 : Z.sidebarRef) ?? { current: null }, ie = (Z == null ? void 0 : Z.toggleRef) ?? { current: null }, ue = Y.primary ?? {}, [me, Ke] = re({
304
+ sidebarWidthPx: t ?? St,
305
305
  sidebarHeightPx: Le,
306
- transitionMs: r ?? pt,
307
- edgeActivationWidthPx: n ?? vt,
308
- dragActivationDeltaPx: a ?? bt,
309
- showOverlay: i ?? St,
310
- isAbsolute: u ?? yt,
311
- overlayBackgroundColor: s ?? ze,
312
- toggleIconColor: d ?? xt,
313
- toggleIconSizePx: c ?? Rt,
314
- toggleIconEdgeDistancePx: p ?? Tt,
315
- showToggle: b ?? Et,
316
- mediaQueryWidth: x ?? Se,
317
- swipeBarZIndex: m ?? At,
318
- toggleZIndex: A ?? Ot,
319
- overlayZIndex: T ?? Pt,
320
- fadeContent: Y ?? _t,
321
- fadeContentTransitionMs: $ ?? Mt,
322
- swipeToOpen: Ct,
323
- swipeToClose: Dt,
324
- midAnchorPoint: Lt,
306
+ transitionMs: r ?? vt,
307
+ edgeActivationWidthPx: i ?? bt,
308
+ dragActivationDeltaPx: s ?? wt,
309
+ showOverlay: o ?? yt,
310
+ isAbsolute: u ?? xt,
311
+ overlayBackgroundColor: a ?? qe,
312
+ toggleIconColor: l ?? Rt,
313
+ toggleIconSizePx: c ?? Tt,
314
+ toggleIconEdgeDistancePx: x ?? Et,
315
+ showToggle: w ?? At,
316
+ mediaQueryWidth: v ?? Se,
317
+ swipeBarZIndex: b ?? Ot,
318
+ toggleZIndex: M ?? Pt,
319
+ overlayZIndex: y ?? It,
320
+ fadeContent: P ?? Ct,
321
+ fadeContentTransitionMs: D ?? _t,
322
+ swipeToOpen: Dt,
323
+ swipeToClose: Lt,
324
+ midAnchorPoint: Xt,
325
325
  midAnchorPointPx: Le / 3,
326
326
  disabled: !1
327
- }), Ke = Z((l, g) => {
328
- _.current.set(l, g), Q((h) => h[l] ? h : { ...h, [l]: { ...ve } });
329
- }, []), et = Z((l) => {
330
- _.current.delete(l), Q((g) => {
327
+ }), et = U((d, g) => {
328
+ N.current.set(d, g), J((h) => h[d] ? h : { ...h, [d]: { ...ve } });
329
+ }, []), tt = U((d) => {
330
+ N.current.delete(d), J((g) => {
331
331
  const h = { ...g };
332
- return delete h[l], h;
333
- }), F((g) => {
332
+ return delete h[d], h;
333
+ }), ne((g) => {
334
334
  const h = { ...g };
335
- return delete h[l], h;
335
+ return delete h[d], h;
336
336
  });
337
- }, []), tt = Z((l) => _.current.get(l), []), rt = Z((l, g) => {
338
- F((h) => h[l] === g ? h : { ...h, [l]: g });
339
- }, []), ee = Z((l, g) => {
340
- Q((h) => {
341
- const S = h[l] ?? ve;
342
- return S.isOpen === g ? h : { ...h, [l]: { ...S, isOpen: g } };
337
+ }, []), rt = U((d) => N.current.get(d), []), nt = U((d, g) => {
338
+ ne((h) => h[d] === g ? h : { ...h, [d]: g });
339
+ }, []), ee = U((d, g) => {
340
+ J((h) => {
341
+ const S = h[d] ?? ve;
342
+ return S.isOpen === g ? h : { ...h, [d]: { ...S, isOpen: g } };
343
343
  });
344
- }, []), te = Z((l, g) => {
345
- Q((h) => {
346
- const S = h[l] ?? ve;
347
- return S.anchorState === g ? h : { ...h, [l]: { ...S, anchorState: g } };
344
+ }, []), te = U((d, g) => {
345
+ J((h) => {
346
+ const S = h[d] ?? ve;
347
+ return S.anchorState === g ? h : { ...h, [d]: { ...S, anchorState: g } };
348
348
  });
349
349
  }, []);
350
- z(() => (N || M || oe ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
350
+ q(() => ($ || B || z ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
351
351
  document.body.style.overflow = "";
352
- }), [N, M, oe]), z(() => {
353
- var l;
354
- if (w.fadeContent === !1) {
355
- const g = (l = k.current) == null ? void 0 : l.firstElementChild;
352
+ }), [$, B, z]), q(() => {
353
+ var d;
354
+ if (p.fadeContent === !1) {
355
+ const g = (d = F.current) == null ? void 0 : d.firstElementChild;
356
356
  g && (g.style.opacity = "1");
357
357
  }
358
- }, [w.fadeContent]), z(() => {
359
- var l;
360
- if (P.fadeContent === !1) {
361
- const g = (l = G.current) == null ? void 0 : l.firstElementChild;
358
+ }, [p.fadeContent]), q(() => {
359
+ var d;
360
+ if (O.fadeContent === !1) {
361
+ const g = (d = k.current) == null ? void 0 : d.firstElementChild;
362
362
  g && (g.style.opacity = "1");
363
363
  }
364
- }, [P.fadeContent]), z(() => {
365
- var l;
366
- for (const [g, h] of Object.entries(y))
364
+ }, [O.fadeContent]), q(() => {
365
+ var d;
366
+ for (const [g, h] of Object.entries(Y))
367
367
  if (h.fadeContent === !1) {
368
- const S = _.current.get(g), E = (l = S == null ? void 0 : S.sidebarRef.current) == null ? void 0 : l.firstElementChild;
369
- E && (E.style.opacity = "1");
368
+ const S = N.current.get(g), A = (d = S == null ? void 0 : S.sidebarRef.current) == null ? void 0 : d.firstElementChild;
369
+ A && (A.style.opacity = "1");
370
370
  }
371
- }, [y]);
372
- const nt = Z((l) => {
373
- Je((g) => ({ ...g, ...l }));
374
- }, []), ae = Z((l) => {
375
- const g = v.current, h = g.indexOf(l);
376
- h !== -1 && g.splice(h, 1), g.push(l), C("bottom");
377
- }, []), Pe = Z((l) => {
378
- const g = v.current, h = g.indexOf(l);
379
- h !== -1 && g.splice(h, 1), Q((S) => (Object.entries(S).some(
380
- ([B, ie]) => B !== l && ie.isOpen
371
+ }, [Y]);
372
+ const it = U((d) => {
373
+ Ke((g) => ({ ...g, ...d }));
374
+ }, []), se = U((d) => {
375
+ const g = f.current, h = g.indexOf(d);
376
+ h !== -1 && g.splice(h, 1), g.push(d), C("bottom");
377
+ }, []), Pe = U((d) => {
378
+ const g = f.current, h = g.indexOf(d);
379
+ h !== -1 && g.splice(h, 1), J((S) => (Object.entries(S).some(
380
+ ([W, oe]) => W !== d && oe.isOpen
381
381
  ) || C(null), S));
382
- }, []), it = Z(
383
- (l, g) => {
384
- const h = (S, E, B, ie) => {
382
+ }, []), ot = U(
383
+ (d, g) => {
384
+ const h = (S, A, W, oe) => {
385
385
  be({
386
- side: l,
386
+ side: d,
387
387
  ref: S,
388
- options: E,
389
- toggleRef: B,
388
+ options: A,
389
+ toggleRef: W,
390
390
  afterApply: () => {
391
- ie(!0), C(l);
391
+ oe(!0), C(d);
392
392
  }
393
393
  });
394
394
  };
395
- if (l === "left") {
396
- if (w.disabled) return;
397
- h(k, w, H, D);
398
- } else if (l === "right") {
399
- if (P.disabled) return;
400
- h(G, P, U, f);
401
- } else if (l === "bottom") {
402
- const S = (g == null ? void 0 : g.id) ?? "primary", E = y[S], B = _.current.get(S);
403
- if (!E || !B || E.disabled) return;
404
- const ie = E.sidebarHeightPx ?? 0, ut = E.mediaQueryWidth ?? 640, _e = window.innerWidth < ut, lt = _e ? E.midAnchorPointPx ?? 0 : ie;
405
- _e && E.midAnchorPoint && !E.swipeToOpen && lt < ie ? $e({
406
- ref: B.sidebarRef,
407
- options: E,
408
- toggleRef: B.toggleRef,
395
+ if (d === "left") {
396
+ if (p.disabled) return;
397
+ h(F, p, H, j);
398
+ } else if (d === "right") {
399
+ if (O.disabled) return;
400
+ h(k, O, G, m);
401
+ } else if (d === "bottom") {
402
+ const S = (g == null ? void 0 : g.id) ?? "primary", A = Y[S], W = N.current.get(S);
403
+ if (!A || !W || A.disabled) return;
404
+ const oe = A.sidebarHeightPx ?? 0, ut = A.mediaQueryWidth ?? 640, _e = window.innerWidth < ut, dt = _e ? A.midAnchorPointPx ?? 0 : oe;
405
+ _e && A.midAnchorPoint && !A.swipeToOpen && dt < oe ? $e({
406
+ ref: W.sidebarRef,
407
+ options: A,
408
+ toggleRef: W.toggleRef,
409
409
  afterApply: () => {
410
- ee(S, !0), te(S, "midAnchor"), ae(S);
410
+ ee(S, !0), te(S, "midAnchor"), se(S);
411
411
  }
412
412
  }) : be({
413
- side: l,
414
- ref: B.sidebarRef,
415
- options: E,
416
- toggleRef: B.toggleRef,
413
+ side: d,
414
+ ref: W.sidebarRef,
415
+ options: A,
416
+ toggleRef: W.toggleRef,
417
417
  afterApply: () => {
418
- ee(S, !0), te(S, "open"), ae(S);
418
+ ee(S, !0), te(S, "open"), se(S);
419
419
  }
420
420
  });
421
421
  } else
422
- pe(l);
422
+ pe(d);
423
423
  },
424
- [w, P, y, ee, te, ae]
425
- ), ot = Z(
426
- (l, g) => {
427
- if (l !== "bottom") return;
428
- const h = (g == null ? void 0 : g.id) ?? "primary", S = y[h], E = _.current.get(h);
429
- !S || !E || S.disabled || $e({
430
- ref: E.sidebarRef,
424
+ [p, O, Y, ee, te, se]
425
+ ), st = U(
426
+ (d, g) => {
427
+ if (d !== "bottom") return;
428
+ const h = (g == null ? void 0 : g.id) ?? "primary", S = Y[h], A = N.current.get(h);
429
+ !S || !A || S.disabled || $e({
430
+ ref: A.sidebarRef,
431
431
  options: S,
432
- toggleRef: E.toggleRef,
432
+ toggleRef: A.toggleRef,
433
433
  afterApply: () => {
434
- ee(h, !0), te(h, "midAnchor"), ae(h);
434
+ ee(h, !0), te(h, "midAnchor"), se(h);
435
435
  }
436
436
  });
437
437
  },
438
- [y, ee, te, ae]
439
- ), at = Z(
440
- (l, g) => {
441
- if (l !== "bottom") return;
442
- const h = (g == null ? void 0 : g.id) ?? "primary", S = y[h], E = _.current.get(h);
443
- !S || !E || S.disabled || be({
444
- side: l,
445
- ref: E.sidebarRef,
438
+ [Y, ee, te, se]
439
+ ), at = U(
440
+ (d, g) => {
441
+ if (d !== "bottom") return;
442
+ const h = (g == null ? void 0 : g.id) ?? "primary", S = Y[h], A = N.current.get(h);
443
+ !S || !A || S.disabled || be({
444
+ side: d,
445
+ ref: A.sidebarRef,
446
446
  options: S,
447
- toggleRef: E.toggleRef,
447
+ toggleRef: A.toggleRef,
448
448
  afterApply: () => {
449
- ee(h, !0), te(h, "open"), ae(h);
449
+ ee(h, !0), te(h, "open"), se(h);
450
450
  }
451
451
  });
452
452
  },
453
- [y, ee, te, ae]
454
- ), st = Z(
455
- (l, g) => {
456
- const h = (S, E, B, ie) => {
453
+ [Y, ee, te, se]
454
+ ), ct = U(
455
+ (d, g) => {
456
+ const h = (S, A, W, oe) => {
457
457
  Ye({
458
458
  ref: S,
459
- options: E,
460
- toggleRef: B,
461
- side: l,
459
+ options: A,
460
+ toggleRef: W,
461
+ side: d,
462
462
  afterApply: () => {
463
- ie(!1), C(null);
463
+ oe(!1), C(null);
464
464
  }
465
465
  });
466
466
  };
467
- if (l === "left") {
468
- if (w.disabled) return;
469
- h(k, w, H, D);
470
- } else if (l === "right") {
471
- if (P.disabled) return;
472
- h(G, P, U, f);
473
- } else if (l === "bottom") {
474
- const S = (g == null ? void 0 : g.id) ?? "primary", E = y[S], B = _.current.get(S);
475
- if (!E || !B || E.disabled) return;
467
+ if (d === "left") {
468
+ if (p.disabled) return;
469
+ h(F, p, H, j);
470
+ } else if (d === "right") {
471
+ if (O.disabled) return;
472
+ h(k, O, G, m);
473
+ } else if (d === "bottom") {
474
+ const S = (g == null ? void 0 : g.id) ?? "primary", A = Y[S], W = N.current.get(S);
475
+ if (!A || !W || A.disabled) return;
476
476
  Ye({
477
- ref: B.sidebarRef,
478
- options: E,
479
- toggleRef: B.toggleRef,
480
- side: l,
477
+ ref: W.sidebarRef,
478
+ options: A,
479
+ toggleRef: W.toggleRef,
480
+ side: d,
481
481
  afterApply: () => {
482
482
  ee(S, !1), te(S, "closed"), Pe(S);
483
483
  }
484
484
  });
485
485
  } else
486
- pe(l);
486
+ pe(d);
487
487
  },
488
- [w, P, y, ee, te, Pe]
489
- ), ct = Z(
490
- (l, g, h) => {
491
- if (l === "left")
488
+ [p, O, Y, ee, te, Pe]
489
+ ), lt = U(
490
+ (d, g, h) => {
491
+ if (d === "left")
492
492
  We({
493
- ref: k,
493
+ ref: F,
494
494
  toggleRef: H,
495
- options: w,
495
+ options: p,
496
496
  translateX: g
497
497
  });
498
- else if (l === "right")
498
+ else if (d === "right")
499
499
  We({
500
- ref: G,
501
- toggleRef: U,
502
- options: P,
500
+ ref: k,
501
+ toggleRef: G,
502
+ options: O,
503
503
  translateX: g
504
504
  });
505
- else if (l === "bottom") {
506
- const S = (h == null ? void 0 : h.id) ?? "primary", E = y[S], B = _.current.get(S);
507
- if (!E || !B) return;
508
- Ut({
509
- ref: B.sidebarRef,
510
- toggleRef: B.toggleRef,
511
- options: E,
505
+ else if (d === "bottom") {
506
+ const S = (h == null ? void 0 : h.id) ?? "primary", A = Y[S], W = N.current.get(S);
507
+ if (!A || !W) return;
508
+ Zt({
509
+ ref: W.sidebarRef,
510
+ toggleRef: W.toggleRef,
511
+ options: A,
512
512
  translateY: g
513
513
  });
514
514
  } else
515
- pe(l);
515
+ pe(d);
516
516
  },
517
- [w, P, y]
517
+ [p, O, Y]
518
518
  );
519
519
  return /* @__PURE__ */ R.jsx(
520
- Ze.Provider,
520
+ ze.Provider,
521
521
  {
522
522
  value: {
523
- lockedSidebar: j,
523
+ lockedSidebar: _,
524
524
  setLockedSidebar: C,
525
- leftSidebarRef: k,
526
- rightSidebarRef: G,
527
- isLeftOpen: N,
528
- isRightOpen: M,
525
+ leftSidebarRef: F,
526
+ rightSidebarRef: k,
527
+ isLeftOpen: $,
528
+ isRightOpen: B,
529
529
  // Backwards-compat aliases for primary bottom sidebar
530
- isBottomOpen: I,
531
- bottomAnchorState: L,
530
+ isBottomOpen: E,
531
+ bottomAnchorState: I,
532
532
  bottomSidebarRef: X,
533
- bottomToggleRef: ne,
534
- bottomSidebarOptions: le,
533
+ bottomToggleRef: ie,
534
+ bottomSidebarOptions: ue,
535
535
  // Multi-instance bottom sidebar
536
- bottomSidebars: V,
537
- bottomSidebarOptionsMap: y,
538
- registerBottomSidebar: Ke,
539
- unregisterBottomSidebar: et,
540
- getBottomSidebarRefs: tt,
541
- activeBottomDragIdRef: o,
542
- bottomFocusStackRef: v,
536
+ bottomSidebars: Q,
537
+ bottomSidebarOptionsMap: Y,
538
+ registerBottomSidebar: et,
539
+ unregisterBottomSidebar: tt,
540
+ getBottomSidebarRefs: rt,
541
+ activeBottomDragIdRef: n,
542
+ bottomFocusStackRef: f,
543
543
  // Functions
544
- openSidebar: it,
544
+ openSidebar: ot,
545
545
  openSidebarFully: at,
546
- openSidebarToMidAnchor: ot,
547
- closeSidebar: st,
548
- dragSidebar: ct,
546
+ openSidebarToMidAnchor: st,
547
+ closeSidebar: ct,
548
+ dragSidebar: lt,
549
549
  globalOptions: me,
550
- setGlobalOptions: nt,
551
- leftSidebarOptions: w,
552
- rightSidebarOptions: P,
553
- setLeftSidebarOptions: O,
554
- setRightSidebarOptions: q,
555
- setBottomSidebarOptionsById: rt,
550
+ setGlobalOptions: it,
551
+ leftSidebarOptions: p,
552
+ rightSidebarOptions: O,
553
+ setLeftSidebarOptions: T,
554
+ setRightSidebarOptions: V,
555
+ setBottomSidebarOptionsById: nt,
556
556
  leftToggleRef: H,
557
- rightToggleRef: U
557
+ rightToggleRef: G
558
558
  },
559
559
  children: e
560
560
  }
561
561
  );
562
562
  }, K = () => {
563
- const e = gt(Ze);
563
+ const e = ht(ze);
564
564
  if (!e)
565
565
  throw new Error("useSwipeBarContext must be used within SwipeBarProvider");
566
566
  return e;
567
- }, pt = 300, vt = 40, bt = 20, wt = 320, Le = window.innerHeight, St = !0, yt = !1, ze = "rgba(0, 0, 0, 0.5)", ye = "rgb(36,36,36)", xt = "white", Rt = 40, Tt = 40, Et = !0, Se = 640, At = 30, Ot = 15, Pt = 20, Xe = 0.6, It = 200, Mt = 100, _t = !1, Ct = !0, Dt = !0, Lt = !1, se = "cubic-bezier(0.22, 1, 0.36, 1)", qe = {
567
+ }, vt = 300, bt = 40, wt = 20, St = 320, Le = window.innerHeight, yt = !0, xt = !1, qe = "rgba(0, 0, 0, 0.5)", ye = "rgb(36,36,36)", Rt = "white", Tt = 40, Et = 40, At = !0, Se = 640, Ot = 30, Pt = 15, It = 20, Xe = 0.6, Mt = 200, _t = 100, Ct = !1, Dt = !0, Lt = !0, Xt = !1, ae = "cubic-bezier(0.22, 1, 0.36, 1)", Ve = {
568
568
  width: 0,
569
569
  top: 0,
570
570
  bottom: 0,
571
571
  flexShrink: 0,
572
572
  overflowX: "hidden",
573
573
  willChange: "transform"
574
- }, Xt = {
575
- transform: "translateX(-100%)"
576
574
  }, Yt = {
577
- transform: "translateX(100%)"
575
+ transform: "translateX(-100%)"
578
576
  }, $t = {
577
+ transform: "translateX(100%)"
578
+ }, Wt = {
579
579
  position: "fixed",
580
580
  left: 0,
581
581
  top: 0,
582
582
  bottom: 0
583
- }, Wt = {
583
+ }, Bt = {
584
584
  position: "fixed",
585
585
  right: 0,
586
586
  top: 0,
587
587
  bottom: 0
588
- }, Bt = {
588
+ }, jt = {
589
589
  height: 0,
590
590
  left: 0,
591
591
  right: 0,
592
592
  flexShrink: 0,
593
593
  overflowY: "hidden",
594
594
  willChange: "transform"
595
- }, jt = {
596
- transform: "translateY(100%)"
597
595
  }, Nt = {
596
+ transform: "translateY(100%)"
597
+ }, Ft = {
598
598
  position: "fixed",
599
599
  bottom: 0,
600
600
  left: 0,
601
601
  right: 0
602
- }, Ft = {
602
+ }, kt = {
603
603
  position: "fixed",
604
604
  top: 0,
605
605
  left: 0,
606
606
  width: "100%",
607
607
  height: "100%",
608
- backgroundColor: ze,
608
+ backgroundColor: qe,
609
609
  transitionProperty: "opacity",
610
610
  pointerEvents: "none",
611
611
  opacity: 0
612
- }, kt = {
612
+ }, Ht = {
613
613
  opacity: 1,
614
614
  pointerEvents: "auto"
615
- }, Ve = {
615
+ }, Qe = {
616
616
  position: "fixed",
617
617
  top: "50%",
618
618
  transform: "translateY(-50%)",
619
619
  width: "1px",
620
620
  display: "flex",
621
621
  justifyContent: "center"
622
- }, Ht = {
622
+ }, Gt = {
623
623
  position: "fixed",
624
624
  bottom: 0,
625
625
  left: "50%",
@@ -627,7 +627,7 @@ const Ze = ft(null), pe = (e) => {
627
627
  height: "1px",
628
628
  display: "flex",
629
629
  alignItems: "center"
630
- }, Gt = {
630
+ }, Ut = {
631
631
  position: "relative",
632
632
  cursor: "pointer",
633
633
  display: "flex",
@@ -643,26 +643,26 @@ const Ze = ft(null), pe = (e) => {
643
643
  ref: e,
644
644
  side: t,
645
645
  options: r,
646
- toggleRef: n,
647
- afterApply: a
646
+ toggleRef: i,
647
+ afterApply: s
648
648
  }) => {
649
- const i = ge(e), u = r.transitionMs ? r.transitionMs / 2 : 0;
650
- i && r.fadeContent && (i.style.opacity = "0");
651
- let s, d;
652
- t === "left" || t === "right" ? (s = "width", d = r.sidebarWidthPx, i && d && (i.style.minWidth = `${d}px`)) : t === "bottom" ? (s = "height", d = r.sidebarHeightPx, i && d && (i.style.minHeight = `${d}px`)) : xe(t), requestAnimationFrame(() => {
649
+ const o = ge(e), u = r.transitionMs ? r.transitionMs / 2 : 0;
650
+ o && r.fadeContent && (o.style.opacity = "0");
651
+ let a, l;
652
+ t === "left" || t === "right" ? (a = "width", l = r.sidebarWidthPx, o && l && (o.style.minWidth = `${l}px`)) : t === "bottom" ? (a = "height", l = r.sidebarHeightPx, o && l && (o.style.minHeight = `${l}px`)) : xe(t), requestAnimationFrame(() => {
653
653
  if (!e.current) return;
654
- const c = `transform ${r.transitionMs}ms ${se}`, p = r.isAbsolute ? "" : `, ${s} ${r.transitionMs}ms ${se}`;
655
- e.current.style.transition = `${c}${p}`, i && r.fadeContent && (i.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
654
+ const c = `transform ${r.transitionMs}ms ${ae}`, x = r.isAbsolute ? "" : `, ${a} ${r.transitionMs}ms ${ae}`;
655
+ e.current.style.transition = `${c}${x}`, o && r.fadeContent && (o.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
656
656
  if (e.current) {
657
657
  if (e.current.style.transform = t === "bottom" ? "translateY(0px)" : "translateX(0px)", !r.isAbsolute)
658
- e.current.style[s] = `${d}px`;
659
- else if (e.current.style[s] !== `${d}px`) {
660
- const b = e.current.style.transition;
661
- e.current.style.transition = c, e.current.style[s] = `${d}px`, e.current.style.transition = b;
658
+ e.current.style[a] = `${l}px`;
659
+ else if (e.current.style[a] !== `${l}px`) {
660
+ const w = e.current.style.transition;
661
+ e.current.style.transition = c, e.current.style[a] = `${l}px`, e.current.style.transition = w;
662
662
  }
663
- n.current && d && (n.current.style.opacity = "1", t === "left" ? n.current.style.transform = `translateY(-50%) translateX(${d}px)` : t === "right" ? n.current.style.transform = `translateY(-50%) translateX(-${d}px)` : t === "bottom" && (n.current.style.transform = `translateX(-50%) translateY(-${d}px)`)), i && r.fadeContent && setTimeout(() => {
664
- i.style.opacity = "1";
665
- }, u), a();
663
+ i.current && l && (i.current.style.opacity = "1", t === "left" ? i.current.style.transform = `translateY(-50%) translateX(${l}px)` : t === "right" ? i.current.style.transform = `translateY(-50%) translateX(-${l}px)` : t === "bottom" && (i.current.style.transform = `translateX(-50%) translateY(-${l}px)`)), o && r.fadeContent && setTimeout(() => {
664
+ o.style.opacity = "1";
665
+ }, u), s();
666
666
  }
667
667
  });
668
668
  }), setTimeout(() => {
@@ -671,40 +671,40 @@ const Ze = ft(null), pe = (e) => {
671
671
  ref: e,
672
672
  options: t,
673
673
  side: r,
674
- toggleRef: n,
675
- afterApply: a
674
+ toggleRef: i,
675
+ afterApply: s
676
676
  }) => {
677
- const i = ge(e);
677
+ const o = ge(e);
678
678
  let u;
679
- r === "left" || r === "right" ? (u = "width", i && t.sidebarWidthPx && (i.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (u = "height", i && t.sidebarHeightPx && (i.style.minHeight = `${t.sidebarHeightPx}px`)) : xe(r), requestAnimationFrame(() => {
679
+ r === "left" || r === "right" ? (u = "width", o && t.sidebarWidthPx && (o.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (u = "height", o && t.sidebarHeightPx && (o.style.minHeight = `${t.sidebarHeightPx}px`)) : xe(r), requestAnimationFrame(() => {
680
680
  if (!e.current) return;
681
- const s = `transform ${t.transitionMs}ms ${se}`, d = t.isAbsolute ? "" : `, ${u} ${t.transitionMs}ms ${se}`;
682
- e.current.style.transition = `${s}${d}`, i && t.fadeContent && (i.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
683
- e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), n.current && (n.current.style.opacity = "1", r === "left" || r === "right" ? n.current.style.transform = "translateY(-50%)" : r === "bottom" && (n.current.style.transform = "translateX(-50%)")), i && t.fadeContent && (i.style.opacity = "0"), a());
681
+ const a = `transform ${t.transitionMs}ms ${ae}`, l = t.isAbsolute ? "" : `, ${u} ${t.transitionMs}ms ${ae}`;
682
+ e.current.style.transition = `${a}${l}`, o && t.fadeContent && (o.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
683
+ e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"), s());
684
684
  });
685
685
  });
686
686
  }, $e = ({
687
687
  ref: e,
688
688
  options: t,
689
689
  toggleRef: r,
690
- afterApply: n
690
+ afterApply: i
691
691
  }) => {
692
- const a = ge(e), i = t.transitionMs ? t.transitionMs / 2 : 0;
693
- a && t.fadeContent && (a.style.opacity = "0"), a && t.midAnchorPointPx && (a.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
692
+ const s = ge(e), o = t.transitionMs ? t.transitionMs / 2 : 0;
693
+ s && t.fadeContent && (s.style.opacity = "0"), s && t.midAnchorPointPx && (s.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
694
694
  if (!e.current) return;
695
- const u = `transform ${t.transitionMs}ms ${se}`, s = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${se}`;
696
- e.current.style.transition = `${u}${s}`, a && t.fadeContent && (a.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
695
+ const u = `transform ${t.transitionMs}ms ${ae}`, a = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${ae}`;
696
+ e.current.style.transition = `${u}${a}`, s && t.fadeContent && (s.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
697
697
  if (!e.current) return;
698
- const d = t.midAnchorPointPx ?? 0, c = t.sidebarHeightPx ?? 0, p = c - d;
699
- if (e.current.style.transform = `translateY(${p}px)`, !t.isAbsolute)
698
+ const l = t.midAnchorPointPx ?? 0, c = t.sidebarHeightPx ?? 0, x = c - l;
699
+ if (e.current.style.transform = `translateY(${x}px)`, !t.isAbsolute)
700
700
  e.current.style.height = `${c}px`;
701
701
  else if (e.current.style.height !== `${c}px`) {
702
- const b = e.current.style.transition;
703
- e.current.style.transition = u, e.current.style.height = `${c}px`, e.current.style.transition = b;
702
+ const w = e.current.style.transition;
703
+ e.current.style.transition = u, e.current.style.height = `${c}px`, e.current.style.transition = w;
704
704
  }
705
- r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${d}px)`), a && t.fadeContent && setTimeout(() => {
706
- a.style.opacity = "1";
707
- }, i), n();
705
+ r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${l}px)`), s && t.fadeContent && setTimeout(() => {
706
+ s.style.opacity = "1";
707
+ }, o), i();
708
708
  });
709
709
  }), setTimeout(() => {
710
710
  }, 0);
@@ -712,65 +712,76 @@ const Ze = ft(null), pe = (e) => {
712
712
  ref: e,
713
713
  toggleRef: t,
714
714
  options: r,
715
- translateX: n
715
+ translateX: i
716
716
  }) => {
717
- !e.current || n === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
718
- const a = ge(e);
717
+ !e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
718
+ const s = ge(e);
719
719
  if (e.current) {
720
- if (a && r.fadeContent && (a.style.opacity = "0"), a && r.sidebarWidthPx && (a.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
721
- const i = `${r.sidebarWidthPx}px`;
722
- e.current.style.width !== i && (e.current.style.width = i);
720
+ if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarWidthPx && (s.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
721
+ const o = `${r.sidebarWidthPx}px`;
722
+ e.current.style.width !== o && (e.current.style.width = o);
723
723
  }
724
- e.current.style.transform = `translateX(${n}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${n}px)`);
724
+ e.current.style.transform = `translateX(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${i}px)`);
725
725
  }
726
726
  }));
727
- }, Ut = ({
727
+ }, Zt = ({
728
728
  ref: e,
729
729
  toggleRef: t,
730
730
  options: r,
731
- translateY: n
731
+ translateY: i
732
732
  }) => {
733
- !e.current || n === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
734
- const a = ge(e);
733
+ !e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
734
+ const s = ge(e);
735
735
  if (e.current) {
736
- if (a && r.fadeContent && (a.style.opacity = "0"), a && r.sidebarHeightPx && (a.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
737
- const i = `${r.sidebarHeightPx}px`;
738
- e.current.style.height !== i && (e.current.style.height = i);
736
+ if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarHeightPx && (s.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
737
+ const o = `${r.sidebarHeightPx}px`;
738
+ e.current.style.height !== o && (e.current.style.height = o);
739
739
  }
740
- e.current.style.transform = `translateY(${n}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${n}px)`);
740
+ e.current.style.transform = `translateY(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${i}px)`);
741
741
  }
742
742
  }));
743
- }, he = ({ refs: e, clientX: t, clientY: r, touchId: n, isMouse: a }) => {
743
+ }, he = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse: s }) => {
744
744
  e.draggingRef.current = {
745
745
  startX: t,
746
746
  startY: r,
747
- activeTouchId: n,
748
- isMouse: a,
747
+ activeTouchId: i,
748
+ isMouse: s,
749
749
  isActivated: !1
750
750
  }, e.currentXRef.current = t, e.prevXRef.current = t;
751
751
  }, Be = ({
752
752
  refs: e,
753
753
  clientX: t,
754
754
  clientY: r,
755
- touchId: n,
756
- isMouse: a
755
+ touchId: i,
756
+ isMouse: s
757
757
  }) => {
758
758
  e.draggingRef.current = {
759
759
  startX: t,
760
760
  startY: r,
761
- activeTouchId: n,
762
- isMouse: a,
761
+ activeTouchId: i,
762
+ isMouse: s,
763
763
  isActivated: !1
764
764
  }, e.currentYRef.current = r, e.prevYRef.current = r;
765
- }, Qe = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
765
+ }, Je = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
766
766
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null, t(null), r();
767
- }, Zt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
767
+ }, zt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
768
768
  e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, t(null);
769
- }, ce = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1, Re = (e, t) => {
769
+ }, ce = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1;
770
+ function je(e) {
771
+ let t = e instanceof HTMLElement ? e : null;
772
+ for (; t; ) {
773
+ const r = getComputedStyle(t);
774
+ if ((r.overflowY === "auto" || r.overflowY === "scroll") && t.scrollHeight > t.clientHeight)
775
+ return t;
776
+ t = t.parentElement;
777
+ }
778
+ return null;
779
+ }
780
+ const Re = (e, t) => {
770
781
  for (let r = 0; r < e.length; r++) {
771
- const n = e[r];
772
- if (t == null || n.identifier === t)
773
- return n;
782
+ const i = e[r];
783
+ if (t == null || i.identifier === t)
784
+ return i;
774
785
  }
775
786
  return null;
776
787
  }, Te = (e, t) => {
@@ -780,108 +791,108 @@ const Ze = ft(null), pe = (e) => {
780
791
  return !1;
781
792
  }, Ee = (e, t, r) => {
782
793
  const {
783
- globalOptions: n,
784
- setLeftSidebarOptions: a,
785
- setRightSidebarOptions: i,
794
+ globalOptions: i,
795
+ setLeftSidebarOptions: s,
796
+ setRightSidebarOptions: o,
786
797
  setBottomSidebarOptionsById: u
787
798
  } = K(), {
788
- sidebarWidthPx: s,
789
- sidebarHeightPx: d,
799
+ sidebarWidthPx: a,
800
+ sidebarHeightPx: l,
790
801
  transitionMs: c,
791
- edgeActivationWidthPx: p,
792
- dragActivationDeltaPx: b,
793
- showOverlay: x,
794
- isAbsolute: m,
795
- overlayBackgroundColor: A,
796
- toggleIconColor: T,
797
- toggleIconSizePx: Y,
798
- toggleIconEdgeDistancePx: $,
799
- showToggle: j,
802
+ edgeActivationWidthPx: x,
803
+ dragActivationDeltaPx: w,
804
+ showOverlay: v,
805
+ isAbsolute: b,
806
+ overlayBackgroundColor: M,
807
+ toggleIconColor: y,
808
+ toggleIconSizePx: P,
809
+ toggleIconEdgeDistancePx: D,
810
+ showToggle: _,
800
811
  mediaQueryWidth: C,
801
- swipeBarZIndex: N,
802
- toggleZIndex: D,
803
- overlayZIndex: M,
804
- fadeContent: f,
805
- fadeContentTransitionMs: w,
806
- swipeToOpen: O,
807
- swipeToClose: P,
808
- midAnchorPoint: q,
809
- midAnchorPointPx: k,
810
- disabled: G
811
- } = t, H = Ue(() => {
812
- const U = d ?? n.sidebarHeightPx;
812
+ swipeBarZIndex: $,
813
+ toggleZIndex: j,
814
+ overlayZIndex: B,
815
+ fadeContent: m,
816
+ fadeContentTransitionMs: p,
817
+ swipeToOpen: T,
818
+ swipeToClose: O,
819
+ midAnchorPoint: V,
820
+ midAnchorPointPx: F,
821
+ disabled: k
822
+ } = t, H = Ze(() => {
823
+ const G = l ?? i.sidebarHeightPx;
813
824
  return {
814
- sidebarWidthPx: s ?? n.sidebarWidthPx,
815
- sidebarHeightPx: U,
816
- transitionMs: c ?? n.transitionMs,
817
- edgeActivationWidthPx: p ?? n.edgeActivationWidthPx,
818
- dragActivationDeltaPx: b ?? n.dragActivationDeltaPx,
819
- showOverlay: x ?? n.showOverlay,
820
- isAbsolute: m ?? n.isAbsolute,
821
- overlayBackgroundColor: A ?? n.overlayBackgroundColor,
822
- toggleIconColor: T ?? n.toggleIconColor,
823
- toggleIconSizePx: Y ?? n.toggleIconSizePx,
824
- toggleIconEdgeDistancePx: $ ?? n.toggleIconEdgeDistancePx,
825
- showToggle: j ?? n.showToggle,
826
- mediaQueryWidth: C ?? n.mediaQueryWidth,
827
- swipeBarZIndex: N ?? n.swipeBarZIndex,
828
- toggleZIndex: D ?? n.toggleZIndex,
829
- overlayZIndex: M ?? n.overlayZIndex,
830
- fadeContent: f ?? n.fadeContent,
831
- fadeContentTransitionMs: w ?? n.fadeContentTransitionMs,
832
- swipeToOpen: O ?? n.swipeToOpen,
833
- swipeToClose: P ?? n.swipeToClose,
834
- midAnchorPoint: q ?? n.midAnchorPoint,
835
- midAnchorPointPx: k ?? n.midAnchorPointPx ?? Math.floor(U / 3),
836
- disabled: G ?? n.disabled
825
+ sidebarWidthPx: a ?? i.sidebarWidthPx,
826
+ sidebarHeightPx: G,
827
+ transitionMs: c ?? i.transitionMs,
828
+ edgeActivationWidthPx: x ?? i.edgeActivationWidthPx,
829
+ dragActivationDeltaPx: w ?? i.dragActivationDeltaPx,
830
+ showOverlay: v ?? i.showOverlay,
831
+ isAbsolute: b ?? i.isAbsolute,
832
+ overlayBackgroundColor: M ?? i.overlayBackgroundColor,
833
+ toggleIconColor: y ?? i.toggleIconColor,
834
+ toggleIconSizePx: P ?? i.toggleIconSizePx,
835
+ toggleIconEdgeDistancePx: D ?? i.toggleIconEdgeDistancePx,
836
+ showToggle: _ ?? i.showToggle,
837
+ mediaQueryWidth: C ?? i.mediaQueryWidth,
838
+ swipeBarZIndex: $ ?? i.swipeBarZIndex,
839
+ toggleZIndex: j ?? i.toggleZIndex,
840
+ overlayZIndex: B ?? i.overlayZIndex,
841
+ fadeContent: m ?? i.fadeContent,
842
+ fadeContentTransitionMs: p ?? i.fadeContentTransitionMs,
843
+ swipeToOpen: T ?? i.swipeToOpen,
844
+ swipeToClose: O ?? i.swipeToClose,
845
+ midAnchorPoint: V ?? i.midAnchorPoint,
846
+ midAnchorPointPx: F ?? i.midAnchorPointPx ?? Math.floor(G / 3),
847
+ disabled: k ?? i.disabled
837
848
  };
838
849
  }, [
839
- s,
840
- d,
850
+ a,
851
+ l,
841
852
  c,
842
- p,
843
- b,
844
853
  x,
845
- m,
846
- A,
847
- T,
848
- Y,
854
+ w,
855
+ v,
856
+ b,
857
+ M,
858
+ y,
859
+ P,
860
+ D,
861
+ _,
862
+ i,
863
+ C,
849
864
  $,
850
865
  j,
851
- n,
852
- C,
853
- N,
854
- D,
855
- M,
856
- f,
857
- w,
866
+ B,
867
+ m,
868
+ p,
869
+ T,
858
870
  O,
859
- P,
860
- q,
861
- k,
862
- G
871
+ V,
872
+ F,
873
+ k
863
874
  ]);
864
- return z(() => {
865
- e === "left" ? a(H) : e === "right" ? i(H) : e === "bottom" ? u(r ?? "primary", H) : xe(e);
866
- }, [e, r, H, a, i, u]), H;
875
+ return q(() => {
876
+ e === "left" ? s(H) : e === "right" ? o(H) : e === "bottom" ? u(r ?? "primary", H) : xe(e);
877
+ }, [e, r, H, s, o, u]), H;
867
878
  };
868
879
  function Ae({
869
880
  isCollapsed: e,
870
881
  setCollapsed: t,
871
882
  closeSidebarOnClick: r = !0,
872
- transitionMs: n,
873
- overlayBackgroundColor: a,
874
- overlayZIndex: i
883
+ transitionMs: i,
884
+ overlayBackgroundColor: s,
885
+ overlayZIndex: o
875
886
  }) {
876
887
  return /* @__PURE__ */ R.jsx(
877
888
  "div",
878
889
  {
879
890
  style: {
880
- transitionDuration: `${n}ms`,
881
- ...Ft,
882
- ...e ? {} : kt,
883
- ...a ? { backgroundColor: a } : {},
884
- zIndex: i
891
+ transitionDuration: `${i}ms`,
892
+ ...kt,
893
+ ...e ? {} : Ht,
894
+ ...s ? { backgroundColor: s } : {},
895
+ zIndex: o
885
896
  },
886
897
  onMouseDown: (u) => {
887
898
  r && (u.stopPropagation(), t());
@@ -890,25 +901,25 @@ function Ae({
890
901
  );
891
902
  }
892
903
  function Oe({ size: e, color: t }) {
893
- const r = W(null);
894
- return z(() => {
895
- const n = () => {
904
+ const r = L(null);
905
+ return q(() => {
906
+ const i = () => {
896
907
  r.current && (r.current.style.opacity = "1");
897
- }, a = () => {
908
+ }, s = () => {
898
909
  r.current && (r.current.style.opacity = `${Xe}`);
899
910
  };
900
- r.current && (r.current.addEventListener("mouseenter", n), r.current.addEventListener("mouseleave", a));
911
+ r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave", s));
901
912
  }, []), /* @__PURE__ */ R.jsx(
902
913
  "div",
903
914
  {
904
915
  style: {
905
- ...Gt
916
+ ...Ut
906
917
  },
907
918
  children: /* @__PURE__ */ R.jsxs(
908
919
  "svg",
909
920
  {
910
921
  style: {
911
- transition: `opacity ${It}ms ease`,
922
+ transition: `opacity ${Mt}ms ease`,
912
923
  opacity: `${Xe}`
913
924
  },
914
925
  ref: r,
@@ -934,325 +945,351 @@ function Oe({ size: e, color: t }) {
934
945
  }
935
946
  );
936
947
  }
937
- function zt({ id: e, toggleRef: t, options: r, showToggle: n = !0, ToggleComponent: a }) {
948
+ function qt({ id: e, toggleRef: t, options: r, showToggle: i = !0, ToggleComponent: s }) {
938
949
  var c;
939
- const { openSidebar: i, closeSidebar: u, bottomSidebars: s } = K(), d = ((c = s[e]) == null ? void 0 : c.isOpen) ?? !1;
940
- return n ? /* @__PURE__ */ R.jsx(
950
+ const { openSidebar: o, closeSidebar: u, bottomSidebars: a } = K(), l = ((c = a[e]) == null ? void 0 : c.isOpen) ?? !1;
951
+ return i ? /* @__PURE__ */ R.jsx(
941
952
  "div",
942
953
  {
943
954
  ref: t,
944
955
  style: {
945
- ...Ht,
956
+ ...Gt,
946
957
  transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
947
958
  zIndex: r.toggleZIndex
948
959
  },
949
- children: (!d || d && !r.showOverlay) && /* @__PURE__ */ R.jsx(
960
+ children: (!l || l && !r.showOverlay) && /* @__PURE__ */ R.jsx(
950
961
  "button",
951
962
  {
952
963
  type: "button",
953
964
  onClick: () => {
954
- r.disabled || (d ? u("bottom", { id: e }) : i("bottom", { id: e }));
965
+ r.disabled || (l ? u("bottom", { id: e }) : o("bottom", { id: e }));
955
966
  },
956
967
  disabled: r.disabled,
957
968
  style: {
958
969
  marginBottom: `${r.toggleIconEdgeDistancePx}px`,
959
970
  // Rotate icon: -90deg points up when closed, 90deg points down when open
960
- transform: d ? "rotate(90deg)" : "rotate(-90deg)"
971
+ transform: l ? "rotate(90deg)" : "rotate(-90deg)"
961
972
  },
962
- children: a ?? /* @__PURE__ */ R.jsx(Oe, { size: r.toggleIconSizePx, color: r.toggleIconColor })
973
+ children: s ?? /* @__PURE__ */ R.jsx(Oe, { size: r.toggleIconSizePx, color: r.toggleIconColor })
963
974
  }
964
975
  )
965
976
  }
966
977
  ) : null;
967
978
  }
968
- function ue(e = Se) {
969
- const t = `(max-width: ${Math.min(e, Se)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [n, a] = re(r);
970
- return z(() => {
979
+ function le(e = Se) {
980
+ const t = `(max-width: ${Math.min(e, Se)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i, s] = re(r);
981
+ return q(() => {
971
982
  if (typeof window > "u" || typeof window.matchMedia > "u")
972
983
  return;
973
- const i = window.matchMedia(t), u = () => a(i.matches);
974
- return u(), i.addEventListener("change", u), () => i.removeEventListener("change", u);
975
- }, [t]), n;
984
+ const o = window.matchMedia(t), u = () => s(o.matches);
985
+ return u(), o.addEventListener("change", u), () => o.removeEventListener("change", u);
986
+ }, [t]), i;
976
987
  }
977
- const je = ({
988
+ const Ne = ({
978
989
  refs: e,
979
990
  callbacks: t,
980
991
  currentY: r,
981
- preventDefault: n,
982
- lockPane: a,
983
- options: i
992
+ preventDefault: i,
993
+ lockPane: s,
994
+ options: o,
995
+ scrollableAncestor: u,
996
+ initialScrollTop: a
984
997
  }) => {
985
998
  if (!e.draggingRef.current) return;
986
- const u = r - e.draggingRef.current.startY;
987
- if (!e.draggingRef.current.isActivated && Math.abs(u) >= i.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, a()), !e.draggingRef.current.isActivated) return;
999
+ const l = r - e.draggingRef.current.startY;
1000
+ if (!e.draggingRef.current.isActivated && Math.abs(l) >= o.dragActivationDeltaPx) {
1001
+ if (u && t.getIsOpen()) {
1002
+ if (u.scrollTop !== a) {
1003
+ e.draggingRef.current = null, t.dragSidebar(null);
1004
+ return;
1005
+ }
1006
+ const { scrollTop: y, scrollHeight: P, clientHeight: D } = u, _ = y > 1, C = y + D < P - 1;
1007
+ if (l > 0 && _ || l < 0 && C) {
1008
+ e.draggingRef.current = null, t.dragSidebar(null);
1009
+ return;
1010
+ }
1011
+ }
1012
+ e.draggingRef.current.isActivated = !0, s();
1013
+ }
1014
+ if (!e.draggingRef.current.isActivated) return;
988
1015
  e.prevYRef.current = e.currentYRef.current, e.currentYRef.current = r;
989
- const s = t.getIsOpen(), d = window.innerHeight;
990
- let c = !1;
991
- if ((s || e.draggingRef.current.startY >= d - i.edgeActivationWidthPx) && (c = !0), !c) {
1016
+ const c = t.getIsOpen(), x = window.innerHeight;
1017
+ let w = !1;
1018
+ if ((c || e.draggingRef.current.startY >= x - o.edgeActivationWidthPx) && (w = !0), !w) {
992
1019
  e.draggingRef.current = null, t.dragSidebar(null);
993
1020
  return;
994
1021
  }
995
- n();
996
- const p = i.sidebarHeightPx, b = i.midAnchorPointPx, x = i.midAnchorPoint && !i.swipeToOpen && b < p;
997
- if (s)
998
- if (x) {
999
- const m = t.getBottomAnchorState();
1000
- if (m === "open") {
1001
- const A = Math.max(
1022
+ i();
1023
+ const v = o.sidebarHeightPx, b = o.midAnchorPointPx, M = o.midAnchorPoint && !o.swipeToOpen && b < v;
1024
+ if (c)
1025
+ if (M) {
1026
+ const y = t.getBottomAnchorState();
1027
+ if (y === "open") {
1028
+ const P = Math.max(
1002
1029
  0,
1003
- Math.min(p, u - i.dragActivationDeltaPx)
1030
+ Math.min(v, l - o.dragActivationDeltaPx)
1004
1031
  );
1005
- t.dragSidebar(A);
1006
- } else if (m === "midAnchor") {
1007
- const A = p - b, T = Math.max(
1032
+ t.dragSidebar(P);
1033
+ } else if (y === "midAnchor") {
1034
+ const P = v - b, D = Math.max(
1008
1035
  0,
1009
1036
  Math.min(
1010
- p,
1011
- A + u - i.dragActivationDeltaPx
1037
+ v,
1038
+ P + l - o.dragActivationDeltaPx
1012
1039
  )
1013
1040
  );
1014
- t.dragSidebar(T);
1041
+ t.dragSidebar(D);
1015
1042
  }
1016
1043
  } else {
1017
- const m = Math.max(
1044
+ const y = Math.max(
1018
1045
  0,
1019
- Math.min(p, u - i.dragActivationDeltaPx)
1046
+ Math.min(v, l - o.dragActivationDeltaPx)
1020
1047
  );
1021
- t.dragSidebar(m);
1048
+ t.dragSidebar(y);
1022
1049
  }
1023
- else if (e.draggingRef.current.startY >= d - i.edgeActivationWidthPx)
1024
- if (x) {
1025
- const m = p - b, A = Math.max(
1026
- m,
1050
+ else if (e.draggingRef.current.startY >= x - o.edgeActivationWidthPx)
1051
+ if (M) {
1052
+ const y = v - b, P = Math.max(
1053
+ y,
1027
1054
  Math.min(
1028
- p,
1029
- p + u + i.dragActivationDeltaPx
1055
+ v,
1056
+ v + l + o.dragActivationDeltaPx
1030
1057
  )
1031
1058
  );
1032
- t.dragSidebar(A);
1059
+ t.dragSidebar(P);
1033
1060
  } else {
1034
- const m = Math.max(
1061
+ const y = Math.max(
1035
1062
  0,
1036
1063
  Math.min(
1037
- p,
1038
- p + u + i.dragActivationDeltaPx
1064
+ v,
1065
+ v + l + o.dragActivationDeltaPx
1039
1066
  )
1040
1067
  );
1041
- t.dragSidebar(m);
1068
+ t.dragSidebar(y);
1042
1069
  }
1043
- }, Ne = ({ refs: e, callbacks: t, options: r, onDragEnd: n }) => {
1070
+ }, Fe = ({ refs: e, callbacks: t, options: r, onDragEnd: i }) => {
1044
1071
  if (!e.draggingRef.current) return;
1045
1072
  if (!e.draggingRef.current.isActivated) {
1046
1073
  e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null;
1047
1074
  return;
1048
1075
  }
1049
- const a = e.currentYRef.current ?? e.draggingRef.current.startY, i = e.prevYRef.current ?? e.draggingRef.current.startY, u = e.draggingRef.current.startY, s = t.getIsOpen(), d = window.innerHeight;
1050
- e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, n();
1051
- const c = a < i, p = a >= i, b = u >= d - r.edgeActivationWidthPx, x = r.midAnchorPointPx, m = r.sidebarHeightPx, A = r.midAnchorPoint && !r.swipeToOpen && x < m;
1052
- if (s)
1053
- if (A) {
1054
- const T = t.getBottomAnchorState(), Y = m - x;
1055
- if (T === "open") {
1056
- const $ = Math.max(0, a - u);
1057
- p ? $ > Y ? t.closeSidebar() : t.openToMidAnchor() : $ < Y ? t.openSidebarFully() : t.openToMidAnchor(), t.dragSidebar(null);
1058
- } else if (T === "midAnchor") {
1059
- const $ = m - x, j = Math.max(
1076
+ const s = e.currentYRef.current ?? e.draggingRef.current.startY, o = e.prevYRef.current ?? e.draggingRef.current.startY, u = e.draggingRef.current.startY, a = t.getIsOpen(), l = window.innerHeight;
1077
+ e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, i();
1078
+ const c = s < o, x = s >= o, w = u >= l - r.edgeActivationWidthPx, v = r.midAnchorPointPx, b = r.sidebarHeightPx, M = r.midAnchorPoint && !r.swipeToOpen && v < b;
1079
+ if (a)
1080
+ if (M) {
1081
+ const y = t.getBottomAnchorState(), P = b - v;
1082
+ if (y === "open") {
1083
+ const D = Math.max(0, s - u);
1084
+ x ? D > P ? t.closeSidebar() : t.openToMidAnchor() : D < P ? t.openSidebarFully() : t.openToMidAnchor(), t.dragSidebar(null);
1085
+ } else if (y === "midAnchor") {
1086
+ const D = b - v, _ = Math.max(
1060
1087
  0,
1061
- Math.min(m, $ + (a - u))
1088
+ Math.min(b, D + (s - u))
1062
1089
  );
1063
1090
  if (c)
1064
- j < Y ? t.openSidebarFully() : t.openToMidAnchor();
1091
+ _ < P ? t.openSidebarFully() : t.openToMidAnchor();
1065
1092
  else {
1066
- const C = (m + $) / 2;
1067
- j > C ? t.closeSidebar() : t.openToMidAnchor();
1093
+ const C = (b + D) / 2;
1094
+ _ > C ? t.closeSidebar() : t.openToMidAnchor();
1068
1095
  }
1069
1096
  t.dragSidebar(null);
1070
1097
  }
1071
1098
  } else
1072
- p ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
1073
- else b && c ? (A ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1099
+ x ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
1100
+ else w && c ? (M ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1074
1101
  };
1075
- function qt(e, t) {
1076
- var C, N;
1077
- const r = ue(e.mediaQueryWidth), {
1078
- lockedSidebar: n,
1079
- setLockedSidebar: a,
1080
- bottomSidebars: i,
1102
+ function Vt(e, t) {
1103
+ var B, m;
1104
+ const r = le(e.mediaQueryWidth), {
1105
+ lockedSidebar: i,
1106
+ setLockedSidebar: s,
1107
+ bottomSidebars: o,
1081
1108
  openSidebar: u,
1082
- openSidebarFully: s,
1083
- closeSidebar: d,
1109
+ openSidebarFully: a,
1110
+ closeSidebar: l,
1084
1111
  dragSidebar: c,
1085
- openSidebarToMidAnchor: p,
1086
- activeBottomDragIdRef: b,
1087
- bottomFocusStackRef: x
1088
- } = K(), m = ((C = i[t]) == null ? void 0 : C.isOpen) ?? !1, A = ((N = i[t]) == null ? void 0 : N.anchorState) ?? "closed", T = W(null), Y = W(null), $ = W(null), j = W(A);
1089
- z(() => {
1090
- j.current = A;
1091
- }, [A]), z(() => {
1092
- if (!r || n === "left" || n === "right" || e.disabled) return;
1093
- const D = {
1094
- getIsOpen: () => m,
1112
+ openSidebarToMidAnchor: x,
1113
+ activeBottomDragIdRef: w,
1114
+ bottomFocusStackRef: v
1115
+ } = K(), b = ((B = o[t]) == null ? void 0 : B.isOpen) ?? !1, M = ((m = o[t]) == null ? void 0 : m.anchorState) ?? "closed", y = L(null), P = L(null), D = L(null), _ = L(null), C = L(0), $ = L(null), j = L(M);
1116
+ q(() => {
1117
+ j.current = M;
1118
+ }, [M]), q(() => {
1119
+ if (!r || i && i !== "bottom" || e.disabled) return;
1120
+ const p = {
1121
+ getIsOpen: () => b,
1095
1122
  openSidebar: () => u("bottom", { id: t }),
1096
- openSidebarFully: () => s("bottom", { id: t }),
1097
- closeSidebar: () => d("bottom", { id: t }),
1098
- dragSidebar: (y) => c("bottom", y, { id: t }),
1123
+ openSidebarFully: () => a("bottom", { id: t }),
1124
+ closeSidebar: () => l("bottom", { id: t }),
1125
+ dragSidebar: (n) => c("bottom", n, { id: t }),
1099
1126
  getBottomAnchorState: () => j.current,
1100
- openToMidAnchor: () => p("bottom", { id: t })
1101
- }, M = {
1102
- draggingRef: T,
1103
- currentYRef: Y,
1104
- prevYRef: $
1105
- }, f = () => b.current !== null && b.current !== t, w = () => {
1106
- const y = x.current;
1107
- return y.length === 0 ? !0 : y[y.length - 1] === t;
1108
- }, O = () => {
1109
- if (f()) {
1110
- T.current = null;
1127
+ openToMidAnchor: () => x("bottom", { id: t })
1128
+ }, T = {
1129
+ draggingRef: y,
1130
+ currentYRef: P,
1131
+ prevYRef: D
1132
+ }, O = () => w.current !== null && w.current !== t, V = () => {
1133
+ const n = v.current;
1134
+ return n.length === 0 ? !0 : n[n.length - 1] === t;
1135
+ }, F = () => {
1136
+ if (O()) {
1137
+ y.current = null;
1111
1138
  return;
1112
1139
  }
1113
- b.current = t, a("bottom");
1114
- }, P = () => {
1115
- b.current === t && (b.current = null);
1140
+ w.current = t, s("bottom");
1141
+ const n = _.current;
1142
+ n && ($.current = n.style.overflowY, n.style.overflowY = "hidden");
1143
+ }, k = () => {
1144
+ w.current === t && (w.current = null);
1145
+ const n = _.current;
1146
+ n && $.current !== null && (n.style.overflowY = $.current, $.current = null);
1116
1147
  };
1117
- function q(y) {
1118
- if (n === "left" || n === "right" || f() || !w() || ce(y.target) || y.changedTouches.length === 0) return;
1119
- const F = y.changedTouches[0], _ = window.innerHeight, o = D.getIsOpen(), v = F.clientY >= _ - e.edgeActivationWidthPx;
1120
- o && !e.swipeToClose || !o && !e.swipeToOpen || (o || v) && Be({
1121
- refs: M,
1122
- clientX: F.clientX,
1123
- clientY: F.clientY,
1124
- touchId: F.identifier,
1148
+ function H(n) {
1149
+ var Z;
1150
+ if (i && i !== "bottom" || O() || !V() || ce(n.target) || n.changedTouches.length === 0) return;
1151
+ const f = n.changedTouches[0], E = window.innerHeight, I = p.getIsOpen(), z = f.clientY >= E - e.edgeActivationWidthPx;
1152
+ I && !e.swipeToClose || !I && !e.swipeToOpen || (I || z) && (_.current = je(n.target), C.current = ((Z = _.current) == null ? void 0 : Z.scrollTop) ?? 0, Be({
1153
+ refs: T,
1154
+ clientX: f.clientX,
1155
+ clientY: f.clientY,
1156
+ touchId: f.identifier,
1125
1157
  isMouse: !1
1126
- });
1158
+ }));
1127
1159
  }
1128
- function k(y) {
1129
- if (n === "left" || n === "right") return;
1130
- if (f()) {
1131
- T.current = null;
1160
+ function G(n) {
1161
+ if (i && i !== "bottom") return;
1162
+ if (O()) {
1163
+ y.current = null;
1132
1164
  return;
1133
1165
  }
1134
- if (!T.current || T.current.isMouse) return;
1135
- const F = T.current.activeTouchId, _ = Re(y.changedTouches, F);
1136
- _ && je({
1137
- refs: M,
1138
- callbacks: D,
1139
- currentY: _.clientY,
1140
- preventDefault: () => y.preventDefault(),
1141
- lockPane: O,
1142
- options: e
1166
+ if (!y.current || y.current.isMouse) return;
1167
+ const f = y.current.activeTouchId, E = Re(n.changedTouches, f);
1168
+ E && Ne({
1169
+ refs: T,
1170
+ callbacks: p,
1171
+ currentY: E.clientY,
1172
+ preventDefault: () => n.preventDefault(),
1173
+ lockPane: F,
1174
+ options: e,
1175
+ scrollableAncestor: _.current,
1176
+ initialScrollTop: C.current
1143
1177
  });
1144
1178
  }
1145
- function G(y) {
1146
- if (n === "left" || n === "right" || !T.current || T.current.isMouse) return;
1147
- const F = T.current.activeTouchId;
1148
- Te(y.changedTouches, F) && Ne({
1149
- refs: M,
1150
- callbacks: D,
1179
+ function Q(n) {
1180
+ if (i && i !== "bottom" || !y.current || y.current.isMouse) return;
1181
+ const f = y.current.activeTouchId;
1182
+ Te(n.changedTouches, f) && Fe({
1183
+ refs: T,
1184
+ callbacks: p,
1151
1185
  options: e,
1152
- onDragEnd: P
1186
+ onDragEnd: k
1153
1187
  });
1154
1188
  }
1155
- function H() {
1156
- n === "left" || n === "right" || !T.current || T.current.isMouse || (P(), Zt({
1157
- refs: M,
1158
- dragSidebar: D.dragSidebar,
1189
+ function J() {
1190
+ i && i !== "bottom" || !y.current || y.current.isMouse || (k(), zt({
1191
+ refs: T,
1192
+ dragSidebar: p.dragSidebar,
1159
1193
  onDeactivate: () => {
1160
1194
  }
1161
1195
  }));
1162
1196
  }
1163
- function U(y) {
1164
- if (n === "left" || n === "right" || f() || !w() || ce(y.target) || y.button !== 0) return;
1165
- const F = window.innerHeight, _ = D.getIsOpen(), o = y.clientY >= F - e.edgeActivationWidthPx;
1166
- _ && !e.swipeToClose || !_ && !e.swipeToOpen || (_ || o) && Be({
1167
- refs: M,
1168
- clientX: y.clientX,
1169
- clientY: y.clientY,
1197
+ function Y(n) {
1198
+ var z;
1199
+ if (i && i !== "bottom" || O() || !V() || ce(n.target) || n.button !== 0) return;
1200
+ const f = window.innerHeight, E = p.getIsOpen(), I = n.clientY >= f - e.edgeActivationWidthPx;
1201
+ E && !e.swipeToClose || !E && !e.swipeToOpen || (E || I) && (_.current = je(n.target), C.current = ((z = _.current) == null ? void 0 : z.scrollTop) ?? 0, Be({
1202
+ refs: T,
1203
+ clientX: n.clientX,
1204
+ clientY: n.clientY,
1170
1205
  touchId: null,
1171
1206
  isMouse: !0
1172
- });
1207
+ }));
1173
1208
  }
1174
- function V(y) {
1175
- if (!(n === "left" || n === "right")) {
1176
- if (f()) {
1177
- T.current = null;
1209
+ function ne(n) {
1210
+ if (!(i && i !== "bottom")) {
1211
+ if (O()) {
1212
+ y.current = null;
1178
1213
  return;
1179
1214
  }
1180
- !T.current || !T.current.isMouse || je({
1181
- refs: M,
1182
- callbacks: D,
1183
- currentY: y.clientY,
1184
- preventDefault: () => y.preventDefault(),
1185
- lockPane: O,
1186
- options: e
1215
+ !y.current || !y.current.isMouse || Ne({
1216
+ refs: T,
1217
+ callbacks: p,
1218
+ currentY: n.clientY,
1219
+ preventDefault: () => n.preventDefault(),
1220
+ lockPane: F,
1221
+ options: e,
1222
+ scrollableAncestor: _.current,
1223
+ initialScrollTop: C.current
1187
1224
  });
1188
1225
  }
1189
1226
  }
1190
- function Q() {
1191
- n === "left" || n === "right" || !T.current || !T.current.isMouse || Ne({
1192
- refs: M,
1193
- callbacks: D,
1227
+ function N() {
1228
+ i && i !== "bottom" || !y.current || !y.current.isMouse || Fe({
1229
+ refs: T,
1230
+ callbacks: p,
1194
1231
  options: e,
1195
- onDragEnd: P
1232
+ onDragEnd: k
1196
1233
  });
1197
1234
  }
1198
- return window.addEventListener("touchstart", q, { passive: !0 }), window.addEventListener("touchmove", k, { passive: !1 }), window.addEventListener("touchend", G, { passive: !0 }), window.addEventListener("touchcancel", H, { passive: !0 }), window.addEventListener("mousedown", U, { passive: !0 }), window.addEventListener("mousemove", V, { passive: !1 }), window.addEventListener("mouseup", Q, { passive: !0 }), () => {
1199
- window.removeEventListener("touchstart", q), window.removeEventListener("touchmove", k), window.removeEventListener("touchend", G), window.removeEventListener("touchcancel", H), window.removeEventListener("mousedown", U), window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", Q);
1235
+ return window.addEventListener("touchstart", H, { passive: !0 }), window.addEventListener("touchmove", G, { passive: !1 }), window.addEventListener("touchend", Q, { passive: !0 }), window.addEventListener("touchcancel", J, { passive: !0 }), window.addEventListener("mousedown", Y, { passive: !0 }), window.addEventListener("mousemove", ne, { passive: !1 }), window.addEventListener("mouseup", N, { passive: !0 }), () => {
1236
+ window.removeEventListener("touchstart", H), window.removeEventListener("touchmove", G), window.removeEventListener("touchend", Q), window.removeEventListener("touchcancel", J), window.removeEventListener("mousedown", Y), window.removeEventListener("mousemove", ne), window.removeEventListener("mouseup", N);
1200
1237
  };
1201
1238
  }, [
1202
1239
  t,
1203
1240
  r,
1204
- m,
1241
+ b,
1205
1242
  u,
1206
- s,
1207
- d,
1208
- c,
1209
- n,
1210
1243
  a,
1244
+ l,
1245
+ c,
1246
+ i,
1247
+ s,
1211
1248
  e,
1212
- p,
1213
- b,
1214
- x
1249
+ x,
1250
+ w,
1251
+ v
1215
1252
  ]);
1216
1253
  }
1217
- function nr({
1254
+ function ir({
1218
1255
  id: e = "primary",
1219
1256
  className: t,
1220
1257
  children: r,
1221
- ToggleComponent: n,
1222
- ...a
1258
+ ToggleComponent: i,
1259
+ ...s
1223
1260
  }) {
1224
- var A;
1261
+ var M;
1225
1262
  if ((r == null ? void 0 : r.type) === R.Fragment)
1226
1263
  throw new Error("Fragments is not allowed in SwipeBarBottom");
1227
1264
  const {
1228
- bottomSidebars: i,
1265
+ bottomSidebars: o,
1229
1266
  closeSidebar: u,
1230
- registerBottomSidebar: s,
1231
- unregisterBottomSidebar: d
1232
- } = K(), c = W(null), p = W(null);
1233
- z(() => (s(e, { sidebarRef: c, toggleRef: p }), () => d(e)), [e, s, d]);
1234
- const b = Ee("bottom", a, e), x = ue(b.mediaQueryWidth);
1235
- qt(b, e);
1236
- const m = ((A = i[e]) == null ? void 0 : A.isOpen) ?? !1;
1267
+ registerBottomSidebar: a,
1268
+ unregisterBottomSidebar: l
1269
+ } = K(), c = L(null), x = L(null);
1270
+ q(() => (a(e, { sidebarRef: c, toggleRef: x }), () => l(e)), [e, a, l]);
1271
+ const w = Ee("bottom", s, e), v = le(w.mediaQueryWidth);
1272
+ Vt(w, e);
1273
+ const b = ((M = o[e]) == null ? void 0 : M.isOpen) ?? !1;
1237
1274
  return /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
1238
- b.showOverlay && /* @__PURE__ */ R.jsx(
1275
+ w.showOverlay && /* @__PURE__ */ R.jsx(
1239
1276
  Ae,
1240
1277
  {
1241
- isCollapsed: !m,
1278
+ isCollapsed: !b,
1242
1279
  setCollapsed: () => u("bottom", { id: e }),
1243
- transitionMs: b.transitionMs,
1244
- overlayBackgroundColor: b.overlayBackgroundColor,
1245
- overlayZIndex: b.overlayZIndex
1280
+ transitionMs: w.transitionMs,
1281
+ overlayBackgroundColor: w.overlayBackgroundColor,
1282
+ overlayZIndex: w.overlayZIndex
1246
1283
  }
1247
1284
  ),
1248
1285
  /* @__PURE__ */ R.jsx(
1249
- zt,
1286
+ qt,
1250
1287
  {
1251
1288
  id: e,
1252
- toggleRef: p,
1253
- options: b,
1254
- showToggle: b.showToggle,
1255
- ToggleComponent: n
1289
+ toggleRef: x,
1290
+ options: w,
1291
+ showToggle: w.showToggle,
1292
+ ToggleComponent: i
1256
1293
  }
1257
1294
  ),
1258
1295
  /* @__PURE__ */ R.jsx(
@@ -1260,11 +1297,11 @@ function nr({
1260
1297
  {
1261
1298
  ref: c,
1262
1299
  style: {
1263
- ...Bt,
1264
1300
  ...jt,
1265
- ...b.isAbsolute || x ? Nt : {},
1301
+ ...Nt,
1302
+ ...w.isAbsolute || v ? Ft : {},
1266
1303
  ...t ? {} : { backgroundColor: ye },
1267
- zIndex: b.swipeBarZIndex
1304
+ zIndex: w.swipeBarZIndex
1268
1305
  },
1269
1306
  className: t,
1270
1307
  children: r
@@ -1272,29 +1309,29 @@ function nr({
1272
1309
  )
1273
1310
  ] });
1274
1311
  }
1275
- function Vt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1276
- const { openSidebar: n, leftToggleRef: a, isLeftOpen: i, closeSidebar: u } = K();
1312
+ function Qt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1313
+ const { openSidebar: i, leftToggleRef: s, isLeftOpen: o, closeSidebar: u } = K();
1277
1314
  return t ? /* @__PURE__ */ R.jsx(
1278
1315
  "div",
1279
1316
  {
1280
- ref: a,
1317
+ ref: s,
1281
1318
  style: {
1282
- ...Ve,
1319
+ ...Qe,
1283
1320
  transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
1284
1321
  left: 0,
1285
1322
  zIndex: e.toggleZIndex
1286
1323
  },
1287
- children: (!i || i && !e.showOverlay) && /* @__PURE__ */ R.jsx(
1324
+ children: (!o || o && !e.showOverlay) && /* @__PURE__ */ R.jsx(
1288
1325
  "button",
1289
1326
  {
1290
1327
  type: "button",
1291
1328
  onClick: () => {
1292
- e.disabled || (i ? u("left") : n("left"));
1329
+ e.disabled || (o ? u("left") : i("left"));
1293
1330
  },
1294
1331
  disabled: e.disabled,
1295
1332
  style: {
1296
1333
  marginLeft: `${e.toggleIconEdgeDistancePx}px`,
1297
- ...i ? { transform: "rotate(180deg)" } : {}
1334
+ ...o ? { transform: "rotate(180deg)" } : {}
1298
1335
  },
1299
1336
  children: r ?? /* @__PURE__ */ R.jsx(Oe, { size: e.toggleIconSizePx, color: e.toggleIconColor })
1300
1337
  }
@@ -1302,46 +1339,46 @@ function Vt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1302
1339
  }
1303
1340
  ) : null;
1304
1341
  }
1305
- const Fe = ({
1342
+ const ke = ({
1306
1343
  refs: e,
1307
1344
  callbacks: t,
1308
1345
  currentX: r,
1309
- preventDefault: n,
1310
- lockPane: a,
1311
- options: i
1346
+ preventDefault: i,
1347
+ lockPane: s,
1348
+ options: o
1312
1349
  }) => {
1313
1350
  if (!e.draggingRef.current) return;
1314
1351
  const u = r - e.draggingRef.current.startX;
1315
- if (!e.draggingRef.current.isActivated && Math.abs(u) >= i.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, a()), !e.draggingRef.current.isActivated) return;
1352
+ if (!e.draggingRef.current.isActivated && Math.abs(u) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !e.draggingRef.current.isActivated) return;
1316
1353
  e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
1317
- const s = t.getIsOpen();
1318
- let d = !1;
1319
- if ((s || e.draggingRef.current.startX <= i.edgeActivationWidthPx) && (d = !0), !d) {
1354
+ const a = t.getIsOpen();
1355
+ let l = !1;
1356
+ if ((a || e.draggingRef.current.startX <= o.edgeActivationWidthPx) && (l = !0), !l) {
1320
1357
  e.draggingRef.current = null, t.dragSidebar(null);
1321
1358
  return;
1322
1359
  }
1323
- n();
1324
- const c = i.sidebarWidthPx;
1325
- if (s) {
1326
- const p = Math.min(
1360
+ i();
1361
+ const c = o.sidebarWidthPx;
1362
+ if (a) {
1363
+ const x = Math.min(
1327
1364
  0,
1328
1365
  Math.max(
1329
1366
  -c,
1330
- u + i.dragActivationDeltaPx
1367
+ u + o.dragActivationDeltaPx
1331
1368
  )
1332
1369
  );
1333
- t.dragSidebar(p);
1334
- } else if (e.draggingRef.current.startX <= i.edgeActivationWidthPx) {
1335
- const p = Math.min(
1370
+ t.dragSidebar(x);
1371
+ } else if (e.draggingRef.current.startX <= o.edgeActivationWidthPx) {
1372
+ const x = Math.min(
1336
1373
  0,
1337
1374
  Math.max(
1338
1375
  -c,
1339
- -c + u - i.dragActivationDeltaPx
1376
+ -c + u - o.dragActivationDeltaPx
1340
1377
  )
1341
1378
  );
1342
- t.dragSidebar(p);
1379
+ t.dragSidebar(x);
1343
1380
  }
1344
- }, ke = ({
1381
+ }, He = ({
1345
1382
  refs: e,
1346
1383
  callbacks: t,
1347
1384
  options: r
@@ -1351,140 +1388,140 @@ const Fe = ({
1351
1388
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1352
1389
  return;
1353
1390
  }
1354
- const n = e.currentXRef.current ?? e.draggingRef.current.startX, a = e.prevXRef.current ?? e.draggingRef.current.startX, i = e.draggingRef.current.startX, u = t.getIsOpen();
1391
+ const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, u = t.getIsOpen();
1355
1392
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1356
- const s = n >= a, d = n < a, c = i <= r.edgeActivationWidthPx;
1357
- u ? (d ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : c && s ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1393
+ const a = i >= s, l = i < s, c = o <= r.edgeActivationWidthPx;
1394
+ u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : c && a ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1358
1395
  };
1359
- function Qt(e) {
1360
- const t = ue(e.mediaQueryWidth), {
1396
+ function Jt(e) {
1397
+ const t = le(e.mediaQueryWidth), {
1361
1398
  lockedSidebar: r,
1362
- setLockedSidebar: n,
1363
- isLeftOpen: a,
1364
- openSidebar: i,
1399
+ setLockedSidebar: i,
1400
+ isLeftOpen: s,
1401
+ openSidebar: o,
1365
1402
  closeSidebar: u,
1366
- dragSidebar: s,
1367
- leftSidebarRef: d
1368
- } = K(), c = W(null), p = W(null), b = W(null);
1369
- z(() => {
1370
- if (!t || r === "right" || e.disabled) return;
1371
- const x = {
1372
- getIsOpen: () => a,
1373
- openSidebar: () => i("left"),
1403
+ dragSidebar: a,
1404
+ leftSidebarRef: l
1405
+ } = K(), c = L(null), x = L(null), w = L(null);
1406
+ q(() => {
1407
+ if (!t || r && r !== "left" || e.disabled) return;
1408
+ const v = {
1409
+ getIsOpen: () => s,
1410
+ openSidebar: () => o("left"),
1374
1411
  closeSidebar: () => u("left"),
1375
- dragSidebar: (f) => s("left", f)
1376
- }, m = {
1412
+ dragSidebar: (m) => a("left", m)
1413
+ }, b = {
1377
1414
  draggingRef: c,
1378
- currentXRef: p,
1379
- prevXRef: b
1380
- }, A = () => n("left"), T = () => n(null);
1381
- function Y(f) {
1382
- if (r === "right" || ce(f.target) || f.changedTouches.length === 0) return;
1383
- const w = f.changedTouches[0], O = x.getIsOpen(), P = w.clientX <= e.edgeActivationWidthPx;
1384
- O && !e.swipeToClose || !O && !e.swipeToOpen || (O || P) && he({
1385
- refs: m,
1386
- clientX: w.clientX,
1387
- clientY: w.clientY,
1388
- touchId: w.identifier,
1415
+ currentXRef: x,
1416
+ prevXRef: w
1417
+ }, M = () => i("left"), y = () => i(null);
1418
+ function P(m) {
1419
+ if (r && r !== "left" || ce(m.target) || m.changedTouches.length === 0) return;
1420
+ const p = m.changedTouches[0], T = v.getIsOpen(), O = p.clientX <= e.edgeActivationWidthPx;
1421
+ T && !e.swipeToClose || !T && !e.swipeToOpen || (T || O) && he({
1422
+ refs: b,
1423
+ clientX: p.clientX,
1424
+ clientY: p.clientY,
1425
+ touchId: p.identifier,
1389
1426
  isMouse: !1
1390
1427
  });
1391
1428
  }
1392
- function $(f) {
1393
- if (r === "right" || !c.current || c.current.isMouse) return;
1394
- const w = c.current.activeTouchId, O = Re(f.changedTouches, w);
1395
- O && Fe({
1396
- refs: m,
1397
- callbacks: x,
1398
- currentX: O.clientX,
1399
- preventDefault: () => f.preventDefault(),
1400
- lockPane: A,
1429
+ function D(m) {
1430
+ if (r && r !== "left" || !c.current || c.current.isMouse) return;
1431
+ const p = c.current.activeTouchId, T = Re(m.changedTouches, p);
1432
+ T && ke({
1433
+ refs: b,
1434
+ callbacks: v,
1435
+ currentX: T.clientX,
1436
+ preventDefault: () => m.preventDefault(),
1437
+ lockPane: M,
1401
1438
  options: e
1402
1439
  });
1403
1440
  }
1404
- function j(f) {
1405
- if (r === "right" || !c.current || c.current.isMouse) return;
1406
- const w = c.current.activeTouchId;
1407
- Te(f.changedTouches, w) && ke({
1408
- refs: m,
1409
- callbacks: x,
1441
+ function _(m) {
1442
+ if (r && r !== "left" || !c.current || c.current.isMouse) return;
1443
+ const p = c.current.activeTouchId;
1444
+ Te(m.changedTouches, p) && He({
1445
+ refs: b,
1446
+ callbacks: v,
1410
1447
  options: e
1411
1448
  });
1412
1449
  }
1413
1450
  function C() {
1414
- r !== "right" && (!c.current || c.current.isMouse || Qe({
1415
- refs: m,
1416
- dragSidebar: x.dragSidebar,
1417
- onDeactivate: T
1418
- }));
1451
+ r && r !== "left" || !c.current || c.current.isMouse || Je({
1452
+ refs: b,
1453
+ dragSidebar: v.dragSidebar,
1454
+ onDeactivate: y
1455
+ });
1419
1456
  }
1420
- function N(f) {
1421
- if (r === "right" || ce(f.target) || f.button !== 0) return;
1422
- const w = x.getIsOpen(), O = f.clientX <= e.edgeActivationWidthPx;
1423
- w && !e.swipeToClose || !w && !e.swipeToOpen || (w || O) && he({
1424
- refs: m,
1425
- clientX: f.clientX,
1426
- clientY: f.clientY,
1457
+ function $(m) {
1458
+ if (r && r !== "left" || ce(m.target) || m.button !== 0) return;
1459
+ const p = v.getIsOpen(), T = m.clientX <= e.edgeActivationWidthPx;
1460
+ p && !e.swipeToClose || !p && !e.swipeToOpen || (p || T) && he({
1461
+ refs: b,
1462
+ clientX: m.clientX,
1463
+ clientY: m.clientY,
1427
1464
  touchId: null,
1428
1465
  isMouse: !0
1429
1466
  });
1430
1467
  }
1431
- function D(f) {
1432
- r !== "right" && (!c.current || !c.current.isMouse || Fe({
1433
- refs: m,
1434
- callbacks: x,
1435
- currentX: f.clientX,
1436
- preventDefault: () => f.preventDefault(),
1437
- lockPane: A,
1468
+ function j(m) {
1469
+ r && r !== "left" || !c.current || !c.current.isMouse || ke({
1470
+ refs: b,
1471
+ callbacks: v,
1472
+ currentX: m.clientX,
1473
+ preventDefault: () => m.preventDefault(),
1474
+ lockPane: M,
1438
1475
  options: e
1439
- }));
1476
+ });
1440
1477
  }
1441
- function M() {
1442
- r !== "right" && (!c.current || !c.current.isMouse || ke({
1443
- refs: m,
1444
- callbacks: x,
1478
+ function B() {
1479
+ r && r !== "left" || !c.current || !c.current.isMouse || He({
1480
+ refs: b,
1481
+ callbacks: v,
1445
1482
  options: e
1446
- }));
1483
+ });
1447
1484
  }
1448
- return window.addEventListener("touchstart", Y, { passive: !0 }), window.addEventListener("touchmove", $, { passive: !1 }), window.addEventListener("touchend", j, { passive: !0 }), window.addEventListener("touchcancel", C, { passive: !0 }), window.addEventListener("mousedown", N, { passive: !0 }), window.addEventListener("mousemove", D, { passive: !1 }), window.addEventListener("mouseup", M, { passive: !0 }), () => {
1449
- window.removeEventListener("touchstart", Y), window.removeEventListener("touchmove", $), window.removeEventListener("touchend", j), window.removeEventListener("touchcancel", C), window.removeEventListener("mousedown", N), window.removeEventListener("mousemove", D), window.removeEventListener("mouseup", M);
1485
+ return window.addEventListener("touchstart", P, { passive: !0 }), window.addEventListener("touchmove", D, { passive: !1 }), window.addEventListener("touchend", _, { passive: !0 }), window.addEventListener("touchcancel", C, { passive: !0 }), window.addEventListener("mousedown", $, { passive: !0 }), window.addEventListener("mousemove", j, { passive: !1 }), window.addEventListener("mouseup", B, { passive: !0 }), () => {
1486
+ window.removeEventListener("touchstart", P), window.removeEventListener("touchmove", D), window.removeEventListener("touchend", _), window.removeEventListener("touchcancel", C), window.removeEventListener("mousedown", $), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", B);
1450
1487
  };
1451
1488
  }, [
1452
1489
  t,
1453
- a,
1454
- i,
1455
- u,
1456
1490
  s,
1491
+ o,
1492
+ u,
1493
+ a,
1457
1494
  r,
1458
- n,
1459
- d,
1495
+ i,
1496
+ l,
1460
1497
  e
1461
1498
  ]);
1462
1499
  }
1463
- function ir({
1500
+ function or({
1464
1501
  className: e,
1465
1502
  children: t,
1466
1503
  ToggleComponent: r,
1467
- ...n
1504
+ ...i
1468
1505
  }) {
1469
1506
  if ((t == null ? void 0 : t.type) === R.Fragment)
1470
1507
  throw new Error("Fragments is not allowed in SwipeBarLeft");
1471
- const { isLeftOpen: a, closeSidebar: i, leftSidebarRef: u } = K(), s = Ee("left", n), d = ue(s.mediaQueryWidth);
1472
- return Qt(s), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
1473
- s.showOverlay && /* @__PURE__ */ R.jsx(
1508
+ const { isLeftOpen: s, closeSidebar: o, leftSidebarRef: u } = K(), a = Ee("left", i), l = le(a.mediaQueryWidth);
1509
+ return Jt(a), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
1510
+ a.showOverlay && /* @__PURE__ */ R.jsx(
1474
1511
  Ae,
1475
1512
  {
1476
- isCollapsed: !a,
1477
- setCollapsed: () => i("left"),
1478
- transitionMs: s.transitionMs,
1479
- overlayBackgroundColor: s.overlayBackgroundColor,
1480
- overlayZIndex: s.overlayZIndex
1513
+ isCollapsed: !s,
1514
+ setCollapsed: () => o("left"),
1515
+ transitionMs: a.transitionMs,
1516
+ overlayBackgroundColor: a.overlayBackgroundColor,
1517
+ overlayZIndex: a.overlayZIndex
1481
1518
  }
1482
1519
  ),
1483
1520
  /* @__PURE__ */ R.jsx(
1484
- Vt,
1521
+ Qt,
1485
1522
  {
1486
- options: s,
1487
- showToggle: s.showToggle,
1523
+ options: a,
1524
+ showToggle: a.showToggle,
1488
1525
  ToggleComponent: r
1489
1526
  }
1490
1527
  ),
@@ -1493,11 +1530,11 @@ function ir({
1493
1530
  {
1494
1531
  ref: u,
1495
1532
  style: {
1496
- ...qe,
1497
- ...Xt,
1498
- ...s.isAbsolute || d ? $t : {},
1533
+ ...Ve,
1534
+ ...Yt,
1535
+ ...a.isAbsolute || l ? Wt : {},
1499
1536
  ...e ? {} : { backgroundColor: ye },
1500
- zIndex: s.swipeBarZIndex
1537
+ zIndex: a.swipeBarZIndex
1501
1538
  },
1502
1539
  className: e,
1503
1540
  children: t
@@ -1505,32 +1542,32 @@ function ir({
1505
1542
  )
1506
1543
  ] });
1507
1544
  }
1508
- function Jt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1509
- const { openSidebar: n, rightToggleRef: a, isRightOpen: i, closeSidebar: u } = K();
1545
+ function Kt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1546
+ const { openSidebar: i, rightToggleRef: s, isRightOpen: o, closeSidebar: u } = K();
1510
1547
  return t ? (
1511
1548
  // 1px wide container
1512
1549
  /* @__PURE__ */ R.jsx(
1513
1550
  "div",
1514
1551
  {
1515
- ref: a,
1552
+ ref: s,
1516
1553
  style: {
1517
- ...Ve,
1554
+ ...Qe,
1518
1555
  transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
1519
1556
  right: 0,
1520
1557
  zIndex: e.toggleZIndex
1521
1558
  },
1522
- children: (!i || i && !e.showOverlay) && /* @__PURE__ */ R.jsx(
1559
+ children: (!o || o && !e.showOverlay) && /* @__PURE__ */ R.jsx(
1523
1560
  "button",
1524
1561
  {
1525
1562
  type: "button",
1526
1563
  onClick: () => {
1527
- e.disabled || (i ? u("right") : n("right"));
1564
+ e.disabled || (o ? u("right") : i("right"));
1528
1565
  },
1529
1566
  disabled: e.disabled,
1530
1567
  style: {
1531
1568
  marginRight: `${e.toggleIconEdgeDistancePx}px`,
1532
1569
  // reverse because we are using the same icon for both left and right
1533
- ...i ? {} : { transform: "rotate(180deg)" }
1570
+ ...o ? {} : { transform: "rotate(180deg)" }
1534
1571
  },
1535
1572
  children: r ?? /* @__PURE__ */ R.jsx(Oe, { size: e.toggleIconSizePx, color: e.toggleIconColor })
1536
1573
  }
@@ -1539,182 +1576,182 @@ function Jt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
1539
1576
  )
1540
1577
  ) : null;
1541
1578
  }
1542
- const He = ({
1579
+ const Ge = ({
1543
1580
  refs: e,
1544
1581
  callbacks: t,
1545
1582
  currentX: r,
1546
- preventDefault: n,
1547
- lockPane: a,
1548
- options: i
1583
+ preventDefault: i,
1584
+ lockPane: s,
1585
+ options: o
1549
1586
  }) => {
1550
1587
  if (!e.draggingRef.current) return;
1551
- const u = window.innerWidth, s = r - e.draggingRef.current.startX, d = e.draggingRef.current.startX >= u - i.edgeActivationWidthPx, c = e.draggingRef.current.isActivated;
1552
- if (!c && Math.abs(s) >= i.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, a()), !c) return;
1588
+ const u = window.innerWidth, a = r - e.draggingRef.current.startX, l = e.draggingRef.current.startX >= u - o.edgeActivationWidthPx, c = e.draggingRef.current.isActivated;
1589
+ if (!c && Math.abs(a) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !c) return;
1553
1590
  e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
1554
- const p = t.getIsOpen();
1555
- let b = !1;
1556
- if ((p || d) && (b = !0), !b) {
1591
+ const x = t.getIsOpen();
1592
+ let w = !1;
1593
+ if ((x || l) && (w = !0), !w) {
1557
1594
  e.draggingRef.current = null, t.dragSidebar(null);
1558
1595
  return;
1559
1596
  }
1560
- n();
1561
- const x = i.sidebarWidthPx;
1562
- if (p) {
1563
- const m = Math.max(
1597
+ i();
1598
+ const v = o.sidebarWidthPx;
1599
+ if (x) {
1600
+ const b = Math.max(
1564
1601
  0,
1565
- Math.min(x, s - i.dragActivationDeltaPx)
1602
+ Math.min(v, a - o.dragActivationDeltaPx)
1566
1603
  );
1567
- t.dragSidebar(m);
1604
+ t.dragSidebar(b);
1568
1605
  } else {
1569
- const m = Math.max(
1606
+ const b = Math.max(
1570
1607
  0,
1571
1608
  Math.min(
1572
- x,
1573
- x + s + i.dragActivationDeltaPx
1609
+ v,
1610
+ v + a + o.dragActivationDeltaPx
1574
1611
  )
1575
1612
  );
1576
- t.dragSidebar(m);
1613
+ t.dragSidebar(b);
1577
1614
  }
1578
- }, Ge = ({ refs: e, callbacks: t, options: r }) => {
1615
+ }, Ue = ({ refs: e, callbacks: t, options: r }) => {
1579
1616
  if (!e.draggingRef.current) return;
1580
1617
  if (!e.draggingRef.current.isActivated) {
1581
1618
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1582
1619
  return;
1583
1620
  }
1584
- const n = e.currentXRef.current ?? e.draggingRef.current.startX, a = e.prevXRef.current ?? e.draggingRef.current.startX, i = e.draggingRef.current.startX, u = t.getIsOpen(), s = window.innerWidth;
1621
+ const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, u = t.getIsOpen(), a = window.innerWidth;
1585
1622
  e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
1586
- const d = n > a, c = n < a, p = i >= s - r.edgeActivationWidthPx;
1587
- u ? (d ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : p && c ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1623
+ const l = i > s, c = i < s, x = o >= a - r.edgeActivationWidthPx;
1624
+ u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : x && c ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
1588
1625
  };
1589
- function Kt(e) {
1590
- const t = ue(e.mediaQueryWidth), {
1626
+ function er(e) {
1627
+ const t = le(e.mediaQueryWidth), {
1591
1628
  lockedSidebar: r,
1592
- setLockedSidebar: n,
1593
- isRightOpen: a,
1594
- openSidebar: i,
1629
+ setLockedSidebar: i,
1630
+ isRightOpen: s,
1631
+ openSidebar: o,
1595
1632
  closeSidebar: u,
1596
- dragSidebar: s,
1597
- rightSidebarRef: d
1598
- } = K(), c = W(null), p = W(null), b = W(null);
1599
- z(() => {
1600
- if (!t || r === "left" || e.disabled) return;
1601
- const x = {
1602
- getIsOpen: () => a,
1603
- openSidebar: () => i("right"),
1633
+ dragSidebar: a,
1634
+ rightSidebarRef: l
1635
+ } = K(), c = L(null), x = L(null), w = L(null);
1636
+ q(() => {
1637
+ if (!t || r && r !== "right" || e.disabled) return;
1638
+ const v = {
1639
+ getIsOpen: () => s,
1640
+ openSidebar: () => o("right"),
1604
1641
  closeSidebar: () => u("right"),
1605
- dragSidebar: (f) => s("right", f)
1606
- }, m = {
1642
+ dragSidebar: (m) => a("right", m)
1643
+ }, b = {
1607
1644
  draggingRef: c,
1608
- currentXRef: p,
1609
- prevXRef: b
1610
- }, A = () => n("right"), T = () => n(null);
1611
- function Y(f) {
1612
- if (r === "left" || ce(f.target) || f.changedTouches.length === 0) return;
1613
- const w = f.changedTouches[0], O = window.innerWidth, P = x.getIsOpen(), q = w.clientX >= O - e.edgeActivationWidthPx;
1614
- P && !e.swipeToClose || !P && !e.swipeToOpen || (P || q) && he({
1615
- refs: m,
1616
- clientX: w.clientX,
1617
- clientY: w.clientY,
1618
- touchId: w.identifier,
1645
+ currentXRef: x,
1646
+ prevXRef: w
1647
+ }, M = () => i("right"), y = () => i(null);
1648
+ function P(m) {
1649
+ if (r && r !== "right" || ce(m.target) || m.changedTouches.length === 0) return;
1650
+ const p = m.changedTouches[0], T = window.innerWidth, O = v.getIsOpen(), V = p.clientX >= T - e.edgeActivationWidthPx;
1651
+ O && !e.swipeToClose || !O && !e.swipeToOpen || (O || V) && he({
1652
+ refs: b,
1653
+ clientX: p.clientX,
1654
+ clientY: p.clientY,
1655
+ touchId: p.identifier,
1619
1656
  isMouse: !1
1620
1657
  });
1621
1658
  }
1622
- function $(f) {
1623
- if (r === "left" || !c.current || c.current.isMouse) return;
1624
- const w = c.current.activeTouchId, O = Re(f.changedTouches, w);
1625
- O && He({
1626
- refs: m,
1627
- callbacks: x,
1628
- currentX: O.clientX,
1629
- preventDefault: () => f.preventDefault(),
1630
- lockPane: A,
1659
+ function D(m) {
1660
+ if (r && r !== "right" || !c.current || c.current.isMouse) return;
1661
+ const p = c.current.activeTouchId, T = Re(m.changedTouches, p);
1662
+ T && Ge({
1663
+ refs: b,
1664
+ callbacks: v,
1665
+ currentX: T.clientX,
1666
+ preventDefault: () => m.preventDefault(),
1667
+ lockPane: M,
1631
1668
  options: e
1632
1669
  });
1633
1670
  }
1634
- function j(f) {
1635
- if (r === "left" || !c.current || c.current.isMouse) return;
1636
- const w = c.current.activeTouchId;
1637
- Te(f.changedTouches, w) && Ge({
1638
- refs: m,
1639
- callbacks: x,
1671
+ function _(m) {
1672
+ if (r && r !== "right" || !c.current || c.current.isMouse) return;
1673
+ const p = c.current.activeTouchId;
1674
+ Te(m.changedTouches, p) && Ue({
1675
+ refs: b,
1676
+ callbacks: v,
1640
1677
  options: e
1641
1678
  });
1642
1679
  }
1643
1680
  function C() {
1644
- r !== "left" && (!c.current || c.current.isMouse || Qe({
1645
- refs: m,
1646
- dragSidebar: x.dragSidebar,
1647
- onDeactivate: T
1648
- }));
1681
+ r && r !== "right" || !c.current || c.current.isMouse || Je({
1682
+ refs: b,
1683
+ dragSidebar: v.dragSidebar,
1684
+ onDeactivate: y
1685
+ });
1649
1686
  }
1650
- function N(f) {
1651
- if (r === "left" || ce(f.target) || f.button !== 0) return;
1652
- const w = window.innerWidth, O = x.getIsOpen(), P = f.clientX >= w - e.edgeActivationWidthPx;
1653
- O && !e.swipeToClose || !O && !e.swipeToOpen || (O || P) && he({
1654
- refs: m,
1655
- clientX: f.clientX,
1656
- clientY: f.clientY,
1687
+ function $(m) {
1688
+ if (r && r !== "right" || ce(m.target) || m.button !== 0) return;
1689
+ const p = window.innerWidth, T = v.getIsOpen(), O = m.clientX >= p - e.edgeActivationWidthPx;
1690
+ T && !e.swipeToClose || !T && !e.swipeToOpen || (T || O) && he({
1691
+ refs: b,
1692
+ clientX: m.clientX,
1693
+ clientY: m.clientY,
1657
1694
  touchId: null,
1658
1695
  isMouse: !0
1659
1696
  });
1660
1697
  }
1661
- function D(f) {
1662
- r !== "left" && (!c.current || !c.current.isMouse || He({
1663
- refs: m,
1664
- callbacks: x,
1665
- currentX: f.clientX,
1666
- preventDefault: () => f.preventDefault(),
1667
- lockPane: A,
1698
+ function j(m) {
1699
+ r && r !== "right" || !c.current || !c.current.isMouse || Ge({
1700
+ refs: b,
1701
+ callbacks: v,
1702
+ currentX: m.clientX,
1703
+ preventDefault: () => m.preventDefault(),
1704
+ lockPane: M,
1668
1705
  options: e
1669
- }));
1706
+ });
1670
1707
  }
1671
- function M() {
1672
- r !== "left" && (!c.current || !c.current.isMouse || Ge({
1673
- refs: m,
1674
- callbacks: x,
1708
+ function B() {
1709
+ r && r !== "right" || !c.current || !c.current.isMouse || Ue({
1710
+ refs: b,
1711
+ callbacks: v,
1675
1712
  options: e
1676
- }));
1713
+ });
1677
1714
  }
1678
- return window.addEventListener("touchstart", Y, { passive: !0 }), window.addEventListener("touchmove", $, { passive: !1 }), window.addEventListener("touchend", j, { passive: !0 }), window.addEventListener("touchcancel", C, { passive: !0 }), window.addEventListener("mousedown", N, { passive: !0 }), window.addEventListener("mousemove", D, { passive: !1 }), window.addEventListener("mouseup", M, { passive: !0 }), () => {
1679
- window.removeEventListener("touchstart", Y), window.removeEventListener("touchmove", $), window.removeEventListener("touchend", j), window.removeEventListener("touchcancel", C), window.removeEventListener("mousedown", N), window.removeEventListener("mousemove", D), window.removeEventListener("mouseup", M);
1715
+ return window.addEventListener("touchstart", P, { passive: !0 }), window.addEventListener("touchmove", D, { passive: !1 }), window.addEventListener("touchend", _, { passive: !0 }), window.addEventListener("touchcancel", C, { passive: !0 }), window.addEventListener("mousedown", $, { passive: !0 }), window.addEventListener("mousemove", j, { passive: !1 }), window.addEventListener("mouseup", B, { passive: !0 }), () => {
1716
+ window.removeEventListener("touchstart", P), window.removeEventListener("touchmove", D), window.removeEventListener("touchend", _), window.removeEventListener("touchcancel", C), window.removeEventListener("mousedown", $), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", B);
1680
1717
  };
1681
1718
  }, [
1682
1719
  t,
1683
- a,
1684
- i,
1685
- u,
1686
1720
  s,
1721
+ o,
1722
+ u,
1723
+ a,
1687
1724
  r,
1688
- n,
1689
- d,
1725
+ i,
1726
+ l,
1690
1727
  e
1691
1728
  ]);
1692
1729
  }
1693
- function or({
1730
+ function sr({
1694
1731
  className: e,
1695
1732
  children: t,
1696
1733
  ToggleComponent: r,
1697
- ...n
1734
+ ...i
1698
1735
  }) {
1699
1736
  if ((t == null ? void 0 : t.type) === R.Fragment)
1700
1737
  throw new Error("Fragments is not allowed in SwipeBarRight");
1701
- const { isRightOpen: a, closeSidebar: i, rightSidebarRef: u } = K(), s = Ee("right", n), d = ue(s.mediaQueryWidth);
1702
- return Kt(s), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
1703
- s.showOverlay && /* @__PURE__ */ R.jsx(
1738
+ const { isRightOpen: s, closeSidebar: o, rightSidebarRef: u } = K(), a = Ee("right", i), l = le(a.mediaQueryWidth);
1739
+ return er(a), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
1740
+ a.showOverlay && /* @__PURE__ */ R.jsx(
1704
1741
  Ae,
1705
1742
  {
1706
- isCollapsed: !a,
1707
- setCollapsed: () => i("right"),
1708
- transitionMs: s.transitionMs,
1709
- overlayBackgroundColor: s.overlayBackgroundColor,
1710
- overlayZIndex: s.overlayZIndex
1743
+ isCollapsed: !s,
1744
+ setCollapsed: () => o("right"),
1745
+ transitionMs: a.transitionMs,
1746
+ overlayBackgroundColor: a.overlayBackgroundColor,
1747
+ overlayZIndex: a.overlayZIndex
1711
1748
  }
1712
1749
  ),
1713
1750
  /* @__PURE__ */ R.jsx(
1714
- Jt,
1751
+ Kt,
1715
1752
  {
1716
- options: s,
1717
- showToggle: s.showToggle,
1753
+ options: a,
1754
+ showToggle: a.showToggle,
1718
1755
  ToggleComponent: r
1719
1756
  }
1720
1757
  ),
@@ -1723,11 +1760,11 @@ function or({
1723
1760
  {
1724
1761
  ref: u,
1725
1762
  style: {
1726
- ...qe,
1727
- ...Yt,
1728
- ...s.isAbsolute || d ? Wt : {},
1763
+ ...Ve,
1764
+ ...$t,
1765
+ ...a.isAbsolute || l ? Bt : {},
1729
1766
  ...e ? {} : { backgroundColor: ye },
1730
- zIndex: s.swipeBarZIndex
1767
+ zIndex: a.swipeBarZIndex
1731
1768
  },
1732
1769
  className: e,
1733
1770
  children: t
@@ -1737,13 +1774,13 @@ function or({
1737
1774
  }
1738
1775
  export {
1739
1776
  Ae as Overlay,
1740
- nr as SwipeBarBottom,
1741
- ir as SwipeBarLeft,
1742
- rr as SwipeBarProvider,
1743
- or as SwipeBarRight,
1744
- zt as ToggleBottom,
1745
- Vt as ToggleLeft,
1746
- Jt as ToggleRight,
1747
- ue as useMediaQuery,
1777
+ ir as SwipeBarBottom,
1778
+ or as SwipeBarLeft,
1779
+ nr as SwipeBarProvider,
1780
+ sr as SwipeBarRight,
1781
+ qt as ToggleBottom,
1782
+ Qt as ToggleLeft,
1783
+ Kt as ToggleRight,
1784
+ le as useMediaQuery,
1748
1785
  K as useSwipeBarContext
1749
1786
  };