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