@luciodale/swipe-bar 1.3.5 → 1.3.6

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