@aiquants/menu-bar 1.24.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,277 +1,277 @@
1
- import Ae, { forwardRef as we, createElement as oe, useCallback as _, useSyncExternalStore as Re, useMemo as ue, useState as X, useRef as L, useEffect as F, useLayoutEffect as ye } from "react";
2
- import { useLocation as Ie, Link as Ne } from "react-router-dom";
3
- var J = { exports: {} }, V = {};
4
- var de;
5
- function Oe() {
6
- if (de) return V;
7
- de = 1;
8
- var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
9
- function a(s, l, o) {
10
- var u = null;
11
- if (o !== void 0 && (u = "" + o), l.key !== void 0 && (u = "" + l.key), "key" in l) {
12
- o = {};
13
- for (var d in l)
14
- d !== "key" && (o[d] = l[d]);
15
- } else o = l;
16
- return l = o.ref, {
17
- $$typeof: t,
1
+ import We, { forwardRef as Oe, createElement as be, useCallback as _, useSyncExternalStore as xe, useMemo as U, useState as le, useRef as C, useEffect as ee, useLayoutEffect as Ie, useId as Ue } from "react";
2
+ import { useLocation as Ge, Link as ye } from "react-router-dom";
3
+ var oe = { exports: {} }, Q = {};
4
+ var ke;
5
+ function Je() {
6
+ if (ke) return Q;
7
+ ke = 1;
8
+ var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
9
+ function a(s, o, i) {
10
+ var c = null;
11
+ if (i !== void 0 && (c = "" + i), o.key !== void 0 && (c = "" + o.key), "key" in o) {
12
+ i = {};
13
+ for (var d in o)
14
+ d !== "key" && (i[d] = o[d]);
15
+ } else i = o;
16
+ return o = i.ref, {
17
+ $$typeof: e,
18
18
  type: s,
19
- key: u,
20
- ref: l !== void 0 ? l : null,
21
- props: o
19
+ key: c,
20
+ ref: o !== void 0 ? o : null,
21
+ props: i
22
22
  };
23
23
  }
24
- return V.Fragment = n, V.jsx = a, V.jsxs = a, V;
24
+ return Q.Fragment = t, Q.jsx = a, Q.jsxs = a, Q;
25
25
  }
26
- var W = {};
27
- var fe;
28
- function qe() {
29
- return fe || (fe = 1, process.env.NODE_ENV !== "production" && (function() {
30
- function t(e) {
31
- if (e == null) return null;
32
- if (typeof e == "function")
33
- return e.$$typeof === U ? null : e.displayName || e.name || null;
34
- if (typeof e == "string") return e;
35
- switch (e) {
36
- case c:
26
+ var K = {};
27
+ var Ne;
28
+ function Ze() {
29
+ return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && (function() {
30
+ function e(n) {
31
+ if (n == null) return null;
32
+ if (typeof n == "function")
33
+ return n.$$typeof === M ? null : n.displayName || n.name || null;
34
+ if (typeof n == "string") return n;
35
+ switch (n) {
36
+ case u:
37
37
  return "Fragment";
38
- case S:
38
+ case P:
39
39
  return "Profiler";
40
- case p:
40
+ case v:
41
41
  return "StrictMode";
42
- case D:
42
+ case z:
43
43
  return "Suspense";
44
- case Q:
44
+ case G:
45
45
  return "SuspenseList";
46
- case H:
46
+ case Z:
47
47
  return "Activity";
48
48
  }
49
- if (typeof e == "object")
50
- switch (typeof e.tag == "number" && console.error(
49
+ if (typeof n == "object")
50
+ switch (typeof n.tag == "number" && console.error(
51
51
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
52
- ), e.$$typeof) {
53
- case R:
52
+ ), n.$$typeof) {
53
+ case L:
54
54
  return "Portal";
55
- case T:
56
- return e.displayName || "Context";
57
- case k:
58
- return (e._context.displayName || "Context") + ".Consumer";
59
- case I:
60
- var i = e.render;
61
- return e = e.displayName, e || (e = i.displayName || i.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
62
- case K:
63
- return i = e.displayName || null, i !== null ? i : t(e.type) || "Memo";
64
- case z:
65
- i = e._payload, e = e._init;
55
+ case te:
56
+ return n.displayName || "Context";
57
+ case me:
58
+ return (n._context.displayName || "Context") + ".Consumer";
59
+ case R:
60
+ var l = n.render;
61
+ return n = n.displayName, n || (n = l.displayName || l.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
62
+ case J:
63
+ return l = n.displayName || null, l !== null ? l : e(n.type) || "Memo";
64
+ case D:
65
+ l = n._payload, n = n._init;
66
66
  try {
67
- return t(e(i));
67
+ return e(n(l));
68
68
  } catch {
69
69
  }
70
70
  }
71
71
  return null;
72
72
  }
73
- function n(e) {
74
- return "" + e;
73
+ function t(n) {
74
+ return "" + n;
75
75
  }
76
- function a(e) {
76
+ function a(n) {
77
77
  try {
78
- n(e);
79
- var i = !1;
78
+ t(n);
79
+ var l = !1;
80
80
  } catch {
81
- i = !0;
81
+ l = !0;
82
82
  }
83
- if (i) {
84
- i = console;
85
- var f = i.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
- return f.call(
87
- i,
83
+ if (l) {
84
+ l = console;
85
+ var m = l.error, f = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
86
+ return m.call(
87
+ l,
88
88
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
- b
90
- ), n(e);
89
+ f
90
+ ), t(n);
91
91
  }
92
92
  }
93
- function s(e) {
94
- if (e === c) return "<>";
95
- if (typeof e == "object" && e !== null && e.$$typeof === z)
93
+ function s(n) {
94
+ if (n === u) return "<>";
95
+ if (typeof n == "object" && n !== null && n.$$typeof === D)
96
96
  return "<...>";
97
97
  try {
98
- var i = t(e);
99
- return i ? "<" + i + ">" : "<...>";
98
+ var l = e(n);
99
+ return l ? "<" + l + ">" : "<...>";
100
100
  } catch {
101
101
  return "<...>";
102
102
  }
103
103
  }
104
- function l() {
105
- var e = O.A;
106
- return e === null ? null : e.getOwner();
107
- }
108
104
  function o() {
105
+ var n = N.A;
106
+ return n === null ? null : n.getOwner();
107
+ }
108
+ function i() {
109
109
  return Error("react-stack-top-frame");
110
110
  }
111
- function u(e) {
112
- if (P.call(e, "key")) {
113
- var i = Object.getOwnPropertyDescriptor(e, "key").get;
114
- if (i && i.isReactWarning) return !1;
111
+ function c(n) {
112
+ if (S.call(n, "key")) {
113
+ var l = Object.getOwnPropertyDescriptor(n, "key").get;
114
+ if (l && l.isReactWarning) return !1;
115
115
  }
116
- return e.key !== void 0;
116
+ return n.key !== void 0;
117
117
  }
118
- function d(e, i) {
119
- function f() {
120
- G || (G = !0, console.error(
118
+ function d(n, l) {
119
+ function m() {
120
+ ne || (ne = !0, console.error(
121
121
  "%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)",
122
- i
122
+ l
123
123
  ));
124
124
  }
125
- f.isReactWarning = !0, Object.defineProperty(e, "key", {
126
- get: f,
125
+ m.isReactWarning = !0, Object.defineProperty(n, "key", {
126
+ get: m,
127
127
  configurable: !0
128
128
  });
129
129
  }
130
- function m() {
131
- var e = t(this.type);
132
- return B[e] || (B[e] = !0, console.error(
130
+ function x() {
131
+ var n = e(this.type);
132
+ return re[n] || (re[n] = !0, console.error(
133
133
  "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."
134
- )), e = this.props.ref, e !== void 0 ? e : null;
134
+ )), n = this.props.ref, n !== void 0 ? n : null;
135
135
  }
136
- function x(e, i, f, b, Z, te) {
137
- var v = f.ref;
138
- return e = {
139
- $$typeof: C,
140
- type: e,
141
- key: i,
142
- props: f,
143
- _owner: b
144
- }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(e, "ref", {
136
+ function b(n, l, m, f, I, B) {
137
+ var h = m.ref;
138
+ return n = {
139
+ $$typeof: T,
140
+ type: n,
141
+ key: l,
142
+ props: m,
143
+ _owner: f
144
+ }, (h !== void 0 ? h : null) !== null ? Object.defineProperty(n, "ref", {
145
145
  enumerable: !1,
146
- get: m
147
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
146
+ get: x
147
+ }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
148
148
  configurable: !1,
149
149
  enumerable: !1,
150
150
  writable: !0,
151
151
  value: 0
152
- }), Object.defineProperty(e, "_debugInfo", {
152
+ }), Object.defineProperty(n, "_debugInfo", {
153
153
  configurable: !1,
154
154
  enumerable: !1,
155
155
  writable: !0,
156
156
  value: null
157
- }), Object.defineProperty(e, "_debugStack", {
157
+ }), Object.defineProperty(n, "_debugStack", {
158
158
  configurable: !1,
159
159
  enumerable: !1,
160
160
  writable: !0,
161
- value: Z
162
- }), Object.defineProperty(e, "_debugTask", {
161
+ value: I
162
+ }), Object.defineProperty(n, "_debugTask", {
163
163
  configurable: !1,
164
164
  enumerable: !1,
165
165
  writable: !0,
166
- value: te
167
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
166
+ value: B
167
+ }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
168
168
  }
169
- function y(e, i, f, b, Z, te) {
170
- var v = i.children;
171
- if (v !== void 0)
172
- if (b)
173
- if (ee(v)) {
174
- for (b = 0; b < v.length; b++)
175
- N(v[b]);
176
- Object.freeze && Object.freeze(v);
169
+ function w(n, l, m, f, I, B) {
170
+ var h = l.children;
171
+ if (h !== void 0)
172
+ if (f)
173
+ if (q(h)) {
174
+ for (f = 0; f < h.length; f++)
175
+ y(h[f]);
176
+ Object.freeze && Object.freeze(h);
177
177
  } else
178
178
  console.error(
179
179
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
180
  );
181
- else N(v);
182
- if (P.call(i, "key")) {
183
- v = t(e);
184
- var q = Object.keys(i).filter(function(Pe) {
185
- return Pe !== "key";
181
+ else y(h);
182
+ if (S.call(l, "key")) {
183
+ h = e(n);
184
+ var A = Object.keys(l).filter(function(V) {
185
+ return V !== "key";
186
186
  });
187
- b = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", h[v + b] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ f = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", X[h + f] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
188
188
  `A props object containing a "key" prop is being spread into JSX:
189
189
  let props = %s;
190
190
  <%s {...props} />
191
191
  React keys must be passed directly to JSX without using spread:
192
192
  let props = %s;
193
193
  <%s key={someKey} {...props} />`,
194
- b,
195
- v,
196
- q,
197
- v
198
- ), h[v + b] = !0);
194
+ f,
195
+ h,
196
+ A,
197
+ h
198
+ ), X[h + f] = !0);
199
199
  }
200
- if (v = null, f !== void 0 && (a(f), v = "" + f), u(i) && (a(i.key), v = "" + i.key), "key" in i) {
201
- f = {};
202
- for (var ne in i)
203
- ne !== "key" && (f[ne] = i[ne]);
204
- } else f = i;
205
- return v && d(
206
- f,
207
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
208
- ), x(
209
- e,
210
- v,
211
- f,
212
- l(),
213
- Z,
214
- te
200
+ if (h = null, m !== void 0 && (a(m), h = "" + m), c(l) && (a(l.key), h = "" + l.key), "key" in l) {
201
+ m = {};
202
+ for (var Y in l)
203
+ Y !== "key" && (m[Y] = l[Y]);
204
+ } else m = l;
205
+ return h && d(
206
+ m,
207
+ typeof n == "function" ? n.displayName || n.name || "Unknown" : n
208
+ ), b(
209
+ n,
210
+ h,
211
+ m,
212
+ o(),
213
+ I,
214
+ B
215
215
  );
216
216
  }
217
- function N(e) {
218
- w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === z && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
217
+ function y(n) {
218
+ k(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === D && (n._payload.status === "fulfilled" ? k(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
219
219
  }
220
- function w(e) {
221
- return typeof e == "object" && e !== null && e.$$typeof === C;
220
+ function k(n) {
221
+ return typeof n == "object" && n !== null && n.$$typeof === T;
222
222
  }
223
- var j = Ae, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), R = /* @__PURE__ */ Symbol.for("react.portal"), c = /* @__PURE__ */ Symbol.for("react.fragment"), p = /* @__PURE__ */ Symbol.for("react.strict_mode"), S = /* @__PURE__ */ Symbol.for("react.profiler"), k = /* @__PURE__ */ Symbol.for("react.consumer"), T = /* @__PURE__ */ Symbol.for("react.context"), I = /* @__PURE__ */ Symbol.for("react.forward_ref"), D = /* @__PURE__ */ Symbol.for("react.suspense"), Q = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), z = /* @__PURE__ */ Symbol.for("react.lazy"), H = /* @__PURE__ */ Symbol.for("react.activity"), U = /* @__PURE__ */ Symbol.for("react.client.reference"), O = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, ee = Array.isArray, M = console.createTask ? console.createTask : function() {
223
+ var E = We, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), L = /* @__PURE__ */ Symbol.for("react.portal"), u = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), me = /* @__PURE__ */ Symbol.for("react.consumer"), te = /* @__PURE__ */ Symbol.for("react.context"), R = /* @__PURE__ */ Symbol.for("react.forward_ref"), z = /* @__PURE__ */ Symbol.for("react.suspense"), G = /* @__PURE__ */ Symbol.for("react.suspense_list"), J = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), M = /* @__PURE__ */ Symbol.for("react.client.reference"), N = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, q = Array.isArray, O = console.createTask ? console.createTask : function() {
224
224
  return null;
225
225
  };
226
- j = {
227
- react_stack_bottom_frame: function(e) {
228
- return e();
226
+ E = {
227
+ react_stack_bottom_frame: function(n) {
228
+ return n();
229
229
  }
230
230
  };
231
- var G, B = {}, A = j.react_stack_bottom_frame.bind(
232
- j,
233
- o
234
- )(), Y = M(s(o)), h = {};
235
- W.Fragment = c, W.jsx = function(e, i, f) {
236
- var b = 1e4 > O.recentlyCreatedOwnerStacks++;
237
- return y(
238
- e,
239
- i,
240
- f,
231
+ var ne, re = {}, ae = E.react_stack_bottom_frame.bind(
232
+ E,
233
+ i
234
+ )(), H = O(s(i)), X = {};
235
+ K.Fragment = u, K.jsx = function(n, l, m) {
236
+ var f = 1e4 > N.recentlyCreatedOwnerStacks++;
237
+ return w(
238
+ n,
239
+ l,
240
+ m,
241
241
  !1,
242
- b ? Error("react-stack-top-frame") : A,
243
- b ? M(s(e)) : Y
242
+ f ? Error("react-stack-top-frame") : ae,
243
+ f ? O(s(n)) : H
244
244
  );
245
- }, W.jsxs = function(e, i, f) {
246
- var b = 1e4 > O.recentlyCreatedOwnerStacks++;
247
- return y(
248
- e,
249
- i,
250
- f,
245
+ }, K.jsxs = function(n, l, m) {
246
+ var f = 1e4 > N.recentlyCreatedOwnerStacks++;
247
+ return w(
248
+ n,
249
+ l,
250
+ m,
251
251
  !0,
252
- b ? Error("react-stack-top-frame") : A,
253
- b ? M(s(e)) : Y
252
+ f ? Error("react-stack-top-frame") : ae,
253
+ f ? O(s(n)) : H
254
254
  );
255
255
  };
256
- })()), W;
256
+ })()), K;
257
257
  }
258
- var me;
259
- function Le() {
260
- return me || (me = 1, process.env.NODE_ENV === "production" ? J.exports = Oe() : J.exports = qe()), J.exports;
258
+ var _e;
259
+ function Xe() {
260
+ return _e || (_e = 1, process.env.NODE_ENV === "production" ? oe.exports = Je() : oe.exports = Ze()), oe.exports;
261
261
  }
262
- var r = Le();
263
- const $e = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), De = (t) => t.replace(
262
+ var r = Xe();
263
+ const Qe = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ke = (e) => e.replace(
264
264
  /^([A-Z])|[\s-_]+(\w)/g,
265
- (n, a, s) => s ? s.toUpperCase() : a.toLowerCase()
266
- ), he = (t) => {
267
- const n = De(t);
268
- return n.charAt(0).toUpperCase() + n.slice(1);
269
- }, _e = (...t) => t.filter((n, a, s) => !!n && n.trim() !== "" && s.indexOf(n) === a).join(" ").trim(), ze = (t) => {
270
- for (const n in t)
271
- if (n.startsWith("aria-") || n === "role" || n === "title")
265
+ (t, a, s) => s ? s.toUpperCase() : a.toLowerCase()
266
+ ), Ee = (e) => {
267
+ const t = Ke(e);
268
+ return t.charAt(0).toUpperCase() + t.slice(1);
269
+ }, $e = (...e) => e.filter((t, a, s) => !!t && t.trim() !== "" && s.indexOf(t) === a).join(" ").trim(), et = (e) => {
270
+ for (const t in e)
271
+ if (t.startsWith("aria-") || t === "role" || t === "title")
272
272
  return !0;
273
273
  };
274
- var He = {
274
+ var tt = {
275
275
  xmlns: "http://www.w3.org/2000/svg",
276
276
  width: 24,
277
277
  height: 24,
@@ -282,155 +282,182 @@ var He = {
282
282
  strokeLinecap: "round",
283
283
  strokeLinejoin: "round"
284
284
  };
285
- const Ye = we(
285
+ const nt = Oe(
286
286
  ({
287
- color: t = "currentColor",
288
- size: n = 24,
287
+ color: e = "currentColor",
288
+ size: t = 24,
289
289
  strokeWidth: a = 2,
290
290
  absoluteStrokeWidth: s,
291
- className: l = "",
292
- children: o,
293
- iconNode: u,
291
+ className: o = "",
292
+ children: i,
293
+ iconNode: c,
294
294
  ...d
295
- }, m) => oe(
295
+ }, x) => be(
296
296
  "svg",
297
297
  {
298
- ref: m,
299
- ...He,
300
- width: n,
301
- height: n,
302
- stroke: t,
303
- strokeWidth: s ? Number(a) * 24 / Number(n) : a,
304
- className: _e("lucide", l),
305
- ...!o && !ze(d) && { "aria-hidden": "true" },
298
+ ref: x,
299
+ ...tt,
300
+ width: t,
301
+ height: t,
302
+ stroke: e,
303
+ strokeWidth: s ? Number(a) * 24 / Number(t) : a,
304
+ className: $e("lucide", o),
305
+ ...!i && !et(d) && { "aria-hidden": "true" },
306
306
  ...d
307
307
  },
308
308
  [
309
- ...u.map(([x, y]) => oe(x, y)),
310
- ...Array.isArray(o) ? o : [o]
309
+ ...c.map(([b, w]) => be(b, w)),
310
+ ...Array.isArray(i) ? i : [i]
311
311
  ]
312
312
  )
313
313
  );
314
- const E = (t, n) => {
315
- const a = we(
316
- ({ className: s, ...l }, o) => oe(Ye, {
317
- ref: o,
318
- iconNode: n,
319
- className: _e(
320
- `lucide-${$e(he(t))}`,
321
- `lucide-${t}`,
314
+ const j = (e, t) => {
315
+ const a = Oe(
316
+ ({ className: s, ...o }, i) => be(nt, {
317
+ ref: i,
318
+ iconNode: t,
319
+ className: $e(
320
+ `lucide-${Qe(Ee(e))}`,
321
+ `lucide-${e}`,
322
322
  s
323
323
  ),
324
- ...l
324
+ ...o
325
325
  })
326
326
  );
327
- return a.displayName = he(t), a;
327
+ return a.displayName = Ee(e), a;
328
328
  };
329
- const Ve = [
329
+ const rt = [
330
330
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
331
331
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
332
332
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
333
- ], We = E("external-link", Ve);
334
- const Fe = [
333
+ ], at = j("external-link", rt);
334
+ const st = [
335
335
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
336
336
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
337
- ], Ue = E("user", Fe), $ = "text-[length:var(--aqmb-font-size-body,0.8125rem)] leading-[var(--aqmb-line-height-body,1.25rem)]", je = "text-[length:var(--aqmb-font-size-caption,0.6875rem)] leading-[var(--aqmb-line-height-caption,1.25rem)]", Ge = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==", Be = ({ to: t, className: n, children: a }) => /* @__PURE__ */ r.jsx("a", { href: t, className: n, children: a }), pe = `flex min-h-11 items-center justify-center gap-1 rounded-md border border-white/15 bg-white/10 px-1 py-1 font-medium ${je} text-white transition duration-150 hover:bg-white/25 active:scale-95 dark:border-slate-600/50 dark:bg-slate-700/50 dark:text-slate-200 dark:hover:bg-slate-600/80`, _t = (t) => {
338
- const { user: n, LinkComponent: a = Be } = t;
339
- return /* @__PURE__ */ r.jsx("div", { className: "w-full", children: n ? /* @__PURE__ */ r.jsxs(
337
+ ], ot = j("user", st), F = "text-[length:var(--aqmb-font-size-body,0.8125rem)] leading-[var(--aqmb-line-height-body,1.25rem)]", fe = "text-[length:var(--aqmb-font-size-caption,0.6875rem)] leading-[var(--aqmb-line-height-caption,1.25rem)]", it = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==", ct = ({ to: e, className: t, children: a }) => /* @__PURE__ */ r.jsx("a", { href: e, className: t, children: a }), je = `flex min-h-11 items-center justify-center gap-1 rounded-md border border-white/15 bg-sky-800 px-1 py-1 font-medium ${fe} text-white transition duration-150 hover:bg-sky-950 active:scale-95 dark:border-slate-600/50 dark:bg-slate-700/50 dark:text-slate-100 dark:hover:bg-slate-600/80`, rn = (e) => {
338
+ const { user: t, LinkComponent: a = ct } = e;
339
+ return /* @__PURE__ */ r.jsx("div", { className: "w-full", children: t ? /* @__PURE__ */ r.jsxs(
340
340
  "div",
341
341
  {
342
342
  "data-aqmb-session-card": !0,
343
- className: "aiquants-session-card group relative flex flex-col gap-2 rounded-xl border border-white/20 bg-white/10 p-2.5 shadow-sm backdrop-blur-md transition-colors duration-200 hover:border-white/30 hover:bg-white/15 dark:border-slate-700/60 dark:bg-slate-800/60 dark:hover:border-slate-600/80 dark:hover:bg-slate-800/90",
343
+ className: "aiquants-session-card group relative flex flex-col gap-2 rounded-xl border border-white/20 bg-sky-900 p-2.5 shadow-sm backdrop-blur-md transition-colors duration-200 hover:border-white/30 hover:bg-sky-950 dark:border-slate-700/60 dark:bg-slate-800/60 dark:hover:border-slate-600/80 dark:hover:bg-slate-800/90",
344
344
  children: [
345
345
  /* @__PURE__ */ r.jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [
346
346
  /* @__PURE__ */ r.jsxs("div", { className: "relative shrink-0", children: [
347
- /* @__PURE__ */ r.jsx("div", { className: "h-8 w-8 overflow-hidden rounded-full border border-white/40 shadow-xs dark:border-slate-500", children: /* @__PURE__ */ r.jsx("img", { className: "h-full w-full rounded-full object-cover", src: n.photo || Ge, alt: n.displayName || "user profile" }) }),
347
+ /* @__PURE__ */ r.jsx("div", { className: "h-8 w-8 overflow-hidden rounded-full border border-white/40 shadow-xs dark:border-slate-500", children: /* @__PURE__ */ r.jsx("img", { className: "h-full w-full rounded-full object-cover", src: t.photo || it, alt: t.displayName || "user profile" }) }),
348
348
  /* @__PURE__ */ r.jsx("span", { className: "absolute -right-0.5 -bottom-0.5 h-2.5 w-2.5 rounded-full border-2 border-slate-900 bg-emerald-400", title: "Online" })
349
349
  ] }),
350
350
  /* @__PURE__ */ r.jsxs("div", { className: "min-w-0 flex-1 leading-tight", children: [
351
- /* @__PURE__ */ r.jsx("div", { className: "font-semibold text-white text-xs tracking-tight dark:text-slate-100", children: n.displayName }),
352
- /* @__PURE__ */ r.jsx("div", { className: `mt-0.5 font-medium ${je} text-white/75 tracking-tight dark:text-slate-400`, children: "Google Account" })
351
+ /* @__PURE__ */ r.jsx("div", { className: "font-semibold text-white text-xs tracking-tight dark:text-slate-100", children: t.displayName }),
352
+ /* @__PURE__ */ r.jsx("div", { className: `mt-0.5 font-medium ${fe} text-sky-100 tracking-tight dark:text-slate-300`, children: "Google Account" })
353
353
  ] })
354
354
  ] }),
355
355
  /* @__PURE__ */ r.jsxs("div", { className: "grid grid-cols-2 gap-1.5 border-white/15 border-t pt-1.5 dark:border-slate-700/50", children: [
356
- /* @__PURE__ */ r.jsxs(a, { className: pe, to: "/", children: [
357
- /* @__PURE__ */ r.jsx(Ue, { size: 11, className: "shrink-0 opacity-80" }),
356
+ /* @__PURE__ */ r.jsxs(a, { className: je, to: "/", children: [
357
+ /* @__PURE__ */ r.jsx(ot, { size: 11, className: "shrink-0 opacity-80" }),
358
358
  /* @__PURE__ */ r.jsx("span", { className: "min-w-0 text-center", children: "プロフィール" })
359
359
  ] }),
360
- /* @__PURE__ */ r.jsxs(a, { className: pe, to: "https://myaccount.google.com/", children: [
361
- /* @__PURE__ */ r.jsx(We, { size: 11, className: "shrink-0 opacity-80" }),
360
+ /* @__PURE__ */ r.jsxs(a, { className: je, to: "https://myaccount.google.com/", children: [
361
+ /* @__PURE__ */ r.jsx(at, { size: 11, className: "shrink-0 opacity-80" }),
362
362
  /* @__PURE__ */ r.jsx("span", { className: "min-w-0 text-center", children: "Google" })
363
363
  ] })
364
364
  ] })
365
365
  ]
366
366
  }
367
- ) : /* @__PURE__ */ r.jsx("div", { "data-aqmb-session-card": !0, className: "aiquants-session-card flex items-center justify-between rounded-xl border border-white/20 bg-white/10 p-2.5 shadow-xs dark:border-slate-700/60 dark:bg-slate-800/60", children: /* @__PURE__ */ r.jsx("span", { className: "font-medium text-white/90 text-xs dark:text-slate-200", children: "ログインしてください" }) }) });
368
- }, ie = "aiquants-menu-pin-change";
367
+ ) : /* @__PURE__ */ r.jsx("div", { "data-aqmb-session-card": !0, className: "aiquants-session-card flex items-center justify-between rounded-xl border border-white/20 bg-sky-900 p-2.5 shadow-xs dark:border-slate-700/60 dark:bg-slate-800/60", children: /* @__PURE__ */ r.jsx("span", { className: "font-medium text-white text-xs dark:text-slate-200", children: "ログインしてください" }) }) });
368
+ }, ue = "aiquants-menu-pinned", lt = () => {
369
+ try {
370
+ return localStorage.getItem(ue) === "true";
371
+ } catch {
372
+ return !1;
373
+ }
374
+ }, Se = (e) => {
375
+ try {
376
+ e ? localStorage.setItem(ue, "true") : localStorage.removeItem(ue);
377
+ } catch {
378
+ }
379
+ }, Le = "aiquants-submenu-pinned", ut = () => {
380
+ try {
381
+ const e = localStorage.getItem(Le);
382
+ if (e) {
383
+ const t = JSON.parse(e);
384
+ if (Array.isArray(t))
385
+ return t.filter((a) => typeof a == "number");
386
+ }
387
+ } catch {
388
+ }
389
+ return [];
390
+ }, dt = (e) => {
391
+ try {
392
+ localStorage.setItem(Le, JSON.stringify(e));
393
+ } catch {
394
+ }
395
+ }, pe = "aiquants-menu-pin-change";
369
396
  let g = { pinned: !1, width: 0, active: !1 };
370
- const Ee = (t = 240) => {
397
+ const ze = (e = 240) => {
371
398
  if (typeof window > "u" || typeof document > "u")
372
399
  return { pinned: !1, width: 0, active: !1 };
373
400
  try {
374
- const n = getComputedStyle(document.documentElement).getPropertyValue("--aiquants-menu-pinned-width").trim();
375
- if (n) {
376
- const u = Number.parseInt(n, 10);
377
- if (!Number.isNaN(u)) {
378
- const d = u > 0, m = d ? u || t : 0, x = g.active ?? d;
379
- return g.pinned === d && g.width === m && g.active === x || (g = { pinned: d, width: m, active: x }), g;
401
+ const t = getComputedStyle(document.documentElement).getPropertyValue("--aiquants-menu-pinned-width").trim();
402
+ if (t) {
403
+ const c = Number.parseInt(t, 10);
404
+ if (!Number.isNaN(c)) {
405
+ const d = c > 0, x = d ? c || e : 0, b = g.active ?? d;
406
+ return g.pinned === d && g.width === x && g.active === b || (g = { pinned: d, width: x, active: b }), g;
380
407
  }
381
408
  }
382
- const s = localStorage.getItem("aiquants-menu-pinned") === "true", l = s ? t : 0, o = g.active ?? s;
383
- return g.pinned === s && g.width === l && g.active === o || (g = { pinned: s, width: l, active: o }), g;
409
+ const s = localStorage.getItem(ue) === "true", o = s ? e : 0, i = g.active ?? s;
410
+ return g.pinned === s && g.width === o && g.active === i || (g = { pinned: s, width: o, active: i }), g;
384
411
  } catch {
385
412
  return { pinned: !1, width: 0, active: !1 };
386
413
  }
387
- }, be = (t, n, a) => {
414
+ }, Te = (e, t, a) => {
388
415
  if (typeof window > "u") return;
389
- const s = a ?? t, l = { pinned: t, width: n, active: s };
390
- (g.pinned !== t || g.width !== n || g.active !== s) && (g = l);
391
- const o = new CustomEvent(ie, {
392
- detail: l,
416
+ const s = a ?? e, o = { pinned: e, width: t, active: s };
417
+ (g.pinned !== e || g.width !== t || g.active !== s) && (g = o);
418
+ const i = new CustomEvent(pe, {
419
+ detail: o,
393
420
  bubbles: !0,
394
421
  cancelable: !1
395
422
  });
396
- window.dispatchEvent(o);
397
- }, Ze = (t, n) => {
423
+ window.dispatchEvent(i);
424
+ }, ft = (e, t) => {
398
425
  if (typeof window > "u")
399
426
  return () => {
400
427
  };
401
- const { immediate: a = !0, defaultPinnedWidth: s = 240 } = n ?? {};
428
+ const { immediate: a = !0, defaultPinnedWidth: s = 240 } = t ?? {};
402
429
  if (a) {
403
- const o = Ee(s);
404
- t(o);
430
+ const i = ze(s);
431
+ e(i);
405
432
  }
406
- const l = (o) => {
407
- const u = o;
408
- u.detail && t(u.detail);
433
+ const o = (i) => {
434
+ const c = i;
435
+ c.detail && e(c.detail);
409
436
  };
410
- return window.addEventListener(ie, l, { passive: !0 }), () => {
411
- window.removeEventListener(ie, l);
437
+ return window.addEventListener(pe, o, { passive: !0 }), () => {
438
+ window.removeEventListener(pe, o);
412
439
  };
413
- }, jt = (t) => {
414
- const n = t?.defaultPinnedWidth ?? 240, a = t?.initialPinned ?? !1, s = _(
415
- (u) => Ze(
440
+ }, an = (e) => {
441
+ const t = e?.defaultPinnedWidth ?? 240, a = e?.initialPinned ?? !1, s = _(
442
+ (c) => ft(
416
443
  () => {
417
- u();
444
+ c();
418
445
  },
419
- { immediate: !1, defaultPinnedWidth: n }
446
+ { immediate: !1, defaultPinnedWidth: t }
420
447
  ),
421
- [n]
422
- ), l = _(() => Ee(n), [n]), o = _(() => ({
448
+ [t]
449
+ ), o = _(() => ze(t), [t]), i = _(() => ({
423
450
  pinned: a,
424
- width: a ? n : 0
425
- }), [a, n]);
426
- return Re(s, l, o);
451
+ width: a ? t : 0
452
+ }), [a, t]);
453
+ return xe(s, o, i);
427
454
  };
428
- const Je = [
455
+ const mt = [
429
456
  ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
430
457
  ["path", { d: "M21 12H9", key: "dn1m92" }],
431
458
  ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
432
- ], Xe = E("log-out", Je);
433
- const Qe = [
459
+ ], ht = j("log-out", mt);
460
+ const bt = [
434
461
  ["path", { d: "M12 17v5", key: "bb1du9" }],
435
462
  [
436
463
  "path",
@@ -439,8 +466,8 @@ const Qe = [
439
466
  key: "1nkz8b"
440
467
  }
441
468
  ]
442
- ], Se = E("pin", Qe);
443
- const Ke = [
469
+ ], De = j("pin", bt);
470
+ const pt = [
444
471
  ["path", { d: "M12 17v5", key: "bb1du9" }],
445
472
  ["path", { d: "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89", key: "znwnzq" }],
446
473
  ["path", { d: "m2 2 20 20", key: "1ooewy" }],
@@ -451,18 +478,18 @@ const Ke = [
451
478
  key: "c9qhm2"
452
479
  }
453
480
  ]
454
- ], Te = E("pin-off", Ke);
455
- const et = [
481
+ ], He = j("pin-off", pt);
482
+ const vt = [
456
483
  ["path", { d: "M5 21v-6", key: "1hz6c0" }],
457
484
  ["path", { d: "M12 21V9", key: "uvy0l4" }],
458
485
  ["path", { d: "M19 21V3", key: "11j9sm" }]
459
- ], tt = E("chart-no-axes-column-increasing", et);
460
- const nt = [
486
+ ], xt = j("chart-no-axes-column-increasing", vt);
487
+ const yt = [
461
488
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
462
489
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
463
490
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
464
- ], rt = E("download", nt);
465
- const at = [
491
+ ], gt = j("download", yt);
492
+ const wt = [
466
493
  [
467
494
  "path",
468
495
  {
@@ -474,205 +501,219 @@ const at = [
474
501
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
475
502
  ["path", { d: "M16 13H8", key: "t4e002" }],
476
503
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
477
- ], ve = E("file-text", at);
478
- const st = [
504
+ ], Me = j("file-text", wt);
505
+ const kt = [
479
506
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
480
507
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
481
- ], ot = E("link", st);
482
- const it = [
508
+ ], Nt = j("link", kt);
509
+ const _t = [
483
510
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
484
511
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
485
- ], lt = E("lock", it);
486
- const ct = [
512
+ ], Et = j("lock", _t);
513
+ const jt = [
487
514
  ["path", { d: "M12 3v18", key: "108xh3" }],
488
515
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
489
516
  ["path", { d: "M3 9h18", key: "1pudct" }],
490
517
  ["path", { d: "M3 15h18", key: "5xshup" }]
491
- ], ut = E("table", ct), le = "flex min-h-9 flex-1 items-center", dt = "min-h-9 min-w-9", ft = typeof window < "u" ? ye : F, xe = "aiquants-menu-scroll", Ce = new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/), mt = {
492
- report: ve,
493
- slip: ve,
494
- table: ut,
495
- chart: tt,
496
- download: rt,
497
- lock: lt,
498
- href: ot
499
- }, ht = ({ mark: t, children: n }) => {
500
- const a = t ? mt[t] : void 0;
501
- return a ? /* @__PURE__ */ r.jsxs("div", { className: "flex flex-nowrap items-center", children: [
502
- /* @__PURE__ */ r.jsx(a, { className: "h-3.5 w-3.5 shrink-0" }),
503
- /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-link mx-1 hover:underline", children: n })
504
- ] }) : /* @__PURE__ */ r.jsx("span", { className: "mx-1 text-sky-600 hover:underline dark:text-sky-400", children: n });
505
- }, ce = (t, n) => n ? {
518
+ ], St = j("table", jt), Be = "separator", Tt = /(^https?:\/\/)|(\.(html|htm)?$)/, ge = (e) => Tt.test(e), W = (e) => e ? e.split(/[?#]/)[0].replace(/(?!^\/)\/$/, "") : "", Pe = (e, t, a) => {
519
+ const s = W(e);
520
+ return s === "" ? -1 : s === a || t === "prefix" && s !== "/" && a.startsWith(`${s}/`) ? s.length : -1;
521
+ }, Ye = (e, t) => {
522
+ const a = W(t);
523
+ let s = null, o = -1;
524
+ for (const i of e) {
525
+ const c = Pe(i.href, i.match, a);
526
+ if (c > o && (s = { menuId: i.id, subid: null }, o = c), i.submenu)
527
+ for (const d of i.submenu) {
528
+ const x = Pe(d.href, d.match, a);
529
+ x > o && (s = { menuId: i.id, subid: d.subid }, o = x);
530
+ }
531
+ }
532
+ return s;
533
+ }, Mt = (e, t) => {
534
+ const a = W(t);
535
+ if (a === "")
536
+ return null;
537
+ for (const s of e) {
538
+ if (s.href !== void 0 && W(s.href) === a)
539
+ return { menu: s, submenu: null, href: s.href };
540
+ if (s.submenu) {
541
+ for (const o of s.submenu)
542
+ if (o.href !== Be && W(o.href) === a)
543
+ return { menu: s, submenu: o, href: o.href };
544
+ }
545
+ }
546
+ return null;
547
+ }, ce = (e, t, a) => e !== null && e.menuId === t && e.subid === a, de = (e, t) => t ? {
506
548
  menu: {
507
- id: t.id,
508
- title: t.title,
509
- href: t.href
549
+ id: e.id,
550
+ title: e.title,
551
+ href: e.href
510
552
  },
511
553
  submenu: {
512
- subid: n.subid,
513
- title: n.title,
514
- href: n.href,
515
- mark: n.mark,
516
- new: n.new
554
+ subid: t.subid,
555
+ title: t.title,
556
+ href: t.href,
557
+ mark: t.mark,
558
+ new: t.new
517
559
  }
518
560
  } : {
519
561
  menu: {
520
- id: t.id,
521
- title: t.title,
522
- href: t.href
562
+ id: e.id,
563
+ title: e.title,
564
+ href: e.href
565
+ }
566
+ }, Ve = () => {
567
+ try {
568
+ return Ge().pathname;
569
+ } catch {
570
+ return typeof window > "u" ? "" : window.location.pathname;
523
571
  }
524
- }, pt = ({ item: t, parentMenu: n, isCurrent: a, onMenuSelected: s }) => {
525
- if (t.href === "separator")
572
+ }, ve = "flex min-h-9 flex-1 items-center", Pt = "min-h-9 min-w-9", At = typeof window < "u" ? Ie : ee, Ae = "aiquants-menu-scroll", Ct = {
573
+ report: Me,
574
+ slip: Me,
575
+ table: St,
576
+ chart: xt,
577
+ download: gt,
578
+ lock: Et,
579
+ href: Nt
580
+ }, Rt = ({ mark: e, children: t }) => {
581
+ const a = e ? Ct[e] : void 0;
582
+ return a ? /* @__PURE__ */ r.jsxs("div", { className: "aiquants-menu-link flex flex-nowrap items-center", children: [
583
+ /* @__PURE__ */ r.jsx(a, { className: "h-3.5 w-3.5 shrink-0" }),
584
+ /* @__PURE__ */ r.jsx("div", { className: "mx-1 hover:underline", children: t })
585
+ ] }) : /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link mx-1 hover:underline", children: t });
586
+ }, qt = ({ item: e, parentMenu: t, isCurrent: a, onMenuSelected: s }) => {
587
+ if (e.href === Be)
526
588
  return /* @__PURE__ */ r.jsx("hr", { className: "aiquants-menu-separator mx-2 my-1 h-px" });
527
- const l = /* @__PURE__ */ r.jsx(ht, { mark: t.mark, children: t.title }), o = {
528
- className: le,
589
+ const o = /* @__PURE__ */ r.jsx(Rt, { mark: e.mark, children: e.title }), i = {
590
+ className: ve,
529
591
  "aria-current": a ? "page" : void 0,
530
592
  onClick: () => {
531
- s && s(ce(n, t));
593
+ s && s(de(t, e));
532
594
  }
533
595
  };
534
- return t.new ? /* @__PURE__ */ r.jsx("a", { href: t.href, rel: "noopener noreferrer", target: "_blank", ...o, children: l }) : Ce.test(t.href) ? /* @__PURE__ */ r.jsx("a", { href: t.href, ...o, children: l }) : /* @__PURE__ */ r.jsx(Ne, { to: t.href, ...o, children: l });
535
- }, Me = (t) => t ? t.split(/[?#]/)[0].replace(/(?!^\/)\/$/, "") : "", ge = (t, n, a) => {
536
- const s = Me(t);
537
- return s === "" ? -1 : s === a || n === "prefix" && s !== "/" && a.startsWith(`${s}/`) ? s.length : -1;
538
- }, bt = (t, n) => {
539
- const a = Me(n);
540
- let s = null, l = -1;
541
- for (const o of t) {
542
- const u = ge(o.href, o.match, a);
543
- if (u > l && (s = { menuId: o.id, subid: null }, l = u), o.submenu)
544
- for (const d of o.submenu) {
545
- const m = ge(d.href, d.match, a);
546
- m > l && (s = { menuId: o.id, subid: d.subid }, l = m);
547
- }
548
- }
549
- return s;
550
- }, re = (t, n, a) => t !== null && t.menuId === n && t.subid === a, vt = (t) => {
551
- const { menuList: n, onMenuSelected: a, pinnedSubmenuIds: s = [], onToggleSubmenuPin: l } = t;
552
- let o = "";
553
- try {
554
- o = Ie().pathname;
555
- } catch {
556
- typeof window < "u" && (o = window.location.pathname);
557
- }
558
- const u = ue(() => bt(n, o), [n, o]), d = u === null ? null : u.menuId, [m, x] = X(d), y = L(o), N = L(d !== null);
559
- F(() => {
560
- y.current !== o && (y.current = o, N.current = !1), !N.current && d !== null && (x(d), N.current = !0);
561
- }, [o, d]);
562
- const w = _(
563
- (c) => {
564
- s.includes(c) || x((S) => S === c ? null : c);
596
+ return e.new ? /* @__PURE__ */ r.jsx("a", { href: e.href, rel: "noopener noreferrer", target: "_blank", ...i, children: o }) : ge(e.href) ? /* @__PURE__ */ r.jsx("a", { href: e.href, ...i, children: o }) : /* @__PURE__ */ r.jsx(ye, { to: e.href, ...i, children: o });
597
+ }, Ot = (e) => {
598
+ const { menuList: t, onMenuSelected: a, pinnedSubmenuIds: s = [], onToggleSubmenuPin: o } = e, i = Ve(), c = U(() => Ye(t, i), [t, i]), d = c === null ? null : c.menuId, [x, b] = le(d), w = C(i), y = C(d !== null);
599
+ ee(() => {
600
+ w.current !== i && (w.current = i, y.current = !1), !y.current && d !== null && (b(d), y.current = !0);
601
+ }, [i, d]);
602
+ const k = _(
603
+ (u) => {
604
+ s.includes(u) || b((P) => P === u ? null : u);
565
605
  },
566
606
  [s]
567
- ), j = L(null);
568
- ft(() => {
569
- const c = j.current;
570
- if (c)
607
+ ), E = C(null);
608
+ At(() => {
609
+ const u = E.current;
610
+ if (u)
571
611
  try {
572
- const p = sessionStorage.getItem(xe);
573
- if (p !== null) {
574
- const S = Number.parseFloat(p);
575
- Number.isNaN(S) || (c.scrollTop = S);
612
+ const v = sessionStorage.getItem(Ae);
613
+ if (v !== null) {
614
+ const P = Number.parseFloat(v);
615
+ Number.isNaN(P) || (u.scrollTop = P);
576
616
  }
577
617
  } catch {
578
618
  }
579
619
  }, []);
580
- const C = _(() => {
581
- const c = j.current;
582
- if (c)
620
+ const T = _(() => {
621
+ const u = E.current;
622
+ if (u)
583
623
  try {
584
- sessionStorage.setItem(xe, String(c.scrollTop));
624
+ sessionStorage.setItem(Ae, String(u.scrollTop));
585
625
  } catch {
586
626
  }
587
- }, []), R = ue(() => /* @__PURE__ */ r.jsx(r.Fragment, { children: n.map((c) => /* @__PURE__ */ r.jsx("div", { children: c.href ? /* @__PURE__ */ r.jsx("div", { className: `aiquants-menu-list-item relative mb-0.5 ml-1 flex items-center rounded-l-xl px-2.5 ${$} before:mr-2 before:inline-block before:h-2 before:w-2 before:shrink-0 before:rounded-full before:content-[''] sm:text-sm`, children: Ce.test(c.href) ? /* @__PURE__ */ r.jsx(
627
+ }, []), L = U(() => /* @__PURE__ */ r.jsx(r.Fragment, { children: t.map((u) => /* @__PURE__ */ r.jsx("div", { children: u.href ? /* @__PURE__ */ r.jsx("div", { className: `aiquants-menu-list-item relative mb-0.5 ml-1 flex items-center rounded-l-xl px-2.5 ${F} before:mr-2 before:inline-block before:h-2 before:w-2 before:shrink-0 before:rounded-full before:content-[''] sm:text-sm`, children: ge(u.href) ? /* @__PURE__ */ r.jsx(
588
628
  "a",
589
629
  {
590
- href: c.href,
591
- className: le,
592
- "aria-current": re(u, c.id, null) ? "page" : void 0,
630
+ href: u.href,
631
+ className: ve,
632
+ "aria-current": ce(c, u.id, null) ? "page" : void 0,
593
633
  onClick: () => {
594
- a && a(ce(c));
634
+ a && a(de(u));
595
635
  },
596
- children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: c.title })
636
+ children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: u.title })
597
637
  }
598
638
  ) : /* @__PURE__ */ r.jsx(
599
- Ne,
639
+ ye,
600
640
  {
601
- to: c.href,
602
- className: le,
603
- "aria-current": re(u, c.id, null) ? "page" : void 0,
641
+ to: u.href,
642
+ className: ve,
643
+ "aria-current": ce(c, u.id, null) ? "page" : void 0,
604
644
  onClick: () => {
605
- a && a(ce(c));
645
+ a && a(de(u));
606
646
  },
607
- children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: c.title })
647
+ children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: u.title })
608
648
  }
609
- ) }) : /* @__PURE__ */ r.jsxs("details", { className: "aiquants-menu-accordion-details", open: c.id === m || s.includes(c.id), children: [
649
+ ) }) : /* @__PURE__ */ r.jsxs("details", { className: "aiquants-menu-accordion-details", open: u.id === x || s.includes(u.id), children: [
610
650
  /* @__PURE__ */ r.jsxs(
611
651
  "summary",
612
652
  {
613
- className: `aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-0.5 ml-1 min-h-9 list-none rounded-l-xl px-2.5 ${$} before:mr-2 before:inline-block before:h-2 before:w-2 before:shrink-0 before:rounded-full before:content-[''] focus-visible:outline-2 focus-visible:outline-current focus-visible:-outline-offset-2 sm:text-sm`,
614
- onClick: (p) => {
615
- p.preventDefault(), w(c.id);
653
+ className: `aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-0.5 ml-1 min-h-9 list-none rounded-l-xl px-2.5 ${F} before:mr-2 before:inline-block before:h-2 before:w-2 before:shrink-0 before:rounded-full before:content-[''] focus-visible:outline-2 focus-visible:outline-current focus-visible:-outline-offset-2 sm:text-sm`,
654
+ onClick: (v) => {
655
+ v.preventDefault(), k(u.id);
616
656
  },
617
- onKeyDown: (p) => {
618
- (p.key === "Enter" || p.key === " ") && (p.preventDefault(), w(c.id));
657
+ onKeyDown: (v) => {
658
+ (v.key === "Enter" || v.key === " ") && (v.preventDefault(), k(u.id));
619
659
  },
620
660
  children: [
621
- /* @__PURE__ */ r.jsx("span", { children: c.title }),
661
+ /* @__PURE__ */ r.jsx("span", { children: u.title }),
622
662
  /* @__PURE__ */ r.jsx(
623
663
  "button",
624
664
  {
625
665
  type: "button",
626
666
  "data-aqmb-submenu-pin-button": !0,
627
- onClick: (p) => {
628
- p.stopPropagation(), p.preventDefault(), l && l(c.id);
667
+ onClick: (v) => {
668
+ v.stopPropagation(), v.preventDefault(), o && o(u.id);
629
669
  },
630
- className: `aiquants-submenu-pin-button ${dt} ${s.includes(c.id) ? "pinned" : ""}`,
631
- title: s.includes(c.id) ? "ピン留め解除" : "ピン留め",
632
- children: s.includes(c.id) ? /* @__PURE__ */ r.jsx(Se, { size: 13 }) : /* @__PURE__ */ r.jsx(Te, { size: 13 })
670
+ className: `aiquants-submenu-pin-button ${Pt} ${s.includes(u.id) ? "pinned" : ""}`,
671
+ title: s.includes(u.id) ? "ピン留め解除" : "ピン留め",
672
+ children: s.includes(u.id) ? /* @__PURE__ */ r.jsx(De, { size: 13 }) : /* @__PURE__ */ r.jsx(He, { size: 13 })
633
673
  }
634
674
  )
635
675
  ]
636
676
  }
637
677
  ),
638
- /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-0.5 mr-1 ml-3.5 rounded-lg px-2 py-1 shadow-sm", children: c.submenu.map((p) => /* @__PURE__ */ r.jsx("div", { className: `aiquants-menu-accordion-container block w-full ${$}`, children: /* @__PURE__ */ r.jsx(pt, { item: p, parentMenu: c, isCurrent: re(u, c.id, p.subid), onMenuSelected: a }) }, p.subid)) })
639
- ] }) }, c.id)) }), [n, a, m, w, s, u]);
640
- return /* @__PURE__ */ r.jsx("div", { ref: j, onScroll: C, "data-aqmb-menu-list": !0, className: "aiquants-menu-list-scroller hidden-scrollbar", children: R });
641
- }, ae = "min-h-11", ke = "min-w-11", xt = (t) => {
642
- const { menuList: n, menuHeader: a, open: s, onMenuSelected: l, onClickSignout: o, theme: u, toggleTheme: d, isPinned: m, onTogglePin: x, pinnedSubmenuIds: y, onToggleSubmenuPin: N, ref: w } = t;
678
+ /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-0.5 mr-1 ml-3.5 rounded-lg px-2 py-1 shadow-sm", children: u.submenu.map((v) => /* @__PURE__ */ r.jsx("div", { className: `aiquants-menu-accordion-container block w-full ${F}`, children: /* @__PURE__ */ r.jsx(qt, { item: v, parentMenu: u, isCurrent: ce(c, u.id, v.subid), onMenuSelected: a }) }, v.subid)) })
679
+ ] }) }, u.id)) }), [t, a, x, k, s, c]);
680
+ return /* @__PURE__ */ r.jsx("div", { ref: E, onScroll: T, "data-aqmb-menu-list": !0, className: "aiquants-menu-list-scroller hidden-scrollbar", children: L });
681
+ }, he = "min-h-11", Ce = "min-w-11", It = (e) => {
682
+ const { menuList: t, menuHeader: a, open: s, onMenuSelected: o, onClickSignout: i, theme: c, toggleTheme: d, canPin: x, isPinned: b, onTogglePin: w, pinnedSubmenuIds: y, onToggleSubmenuPin: k, id: E, ref: T } = e;
643
683
  return /* @__PURE__ */ r.jsxs(
644
684
  "div",
645
685
  {
646
- ref: w,
686
+ ref: T,
687
+ id: E,
647
688
  "data-aqmb-menu-content": !0,
648
689
  inert: !s,
649
- className: `aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[240px] select-none flex-col motion-safe:transition-transform motion-safe:duration-500 ${s ? "aiquants-menu-translate-x-0" : "aiquants-menu-translate-x-250"}`,
690
+ className: `aiquants-menu-content fixed top-0 right-0 z-2147483642 flex w-[240px] select-none flex-col motion-safe:transition-transform motion-safe:duration-500 ${s ? "aiquants-menu-translate-x-0" : "aiquants-menu-translate-x-250"}`,
650
691
  children: [
651
692
  /* @__PURE__ */ r.jsx("div", { className: "flex shrink-0 flex-col justify-center border-white/15 border-b px-2.5 py-2 dark:border-slate-700/60", children: a }),
652
- /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-list-region", children: /* @__PURE__ */ r.jsx(vt, { menuList: n, onMenuSelected: l, pinnedSubmenuIds: y, onToggleSubmenuPin: N }) }),
693
+ /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-list-region", children: /* @__PURE__ */ r.jsx(Ot, { menuList: t, onMenuSelected: o, pinnedSubmenuIds: y, onToggleSubmenuPin: k }) }),
653
694
  /* @__PURE__ */ r.jsx("div", { className: "border-white/15 border-t px-2.5 py-1.5 dark:border-slate-700/60", children: /* @__PURE__ */ r.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-1.5", children: [
654
- /* @__PURE__ */ r.jsx(
695
+ x ? /* @__PURE__ */ r.jsx(
655
696
  "button",
656
697
  {
657
698
  type: "button",
658
- onClick: x,
699
+ onClick: w,
659
700
  "data-aqmb-pin-button": !0,
660
- className: `flex ${ae} ${ke} items-center justify-center rounded-md px-2 ${$} text-white shadow-2xs transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${m ? "bg-amber-500 hover:bg-amber-600 dark:bg-amber-600 dark:hover:bg-amber-500" : "border border-white/20 bg-white/10 hover:bg-white/20 dark:border-slate-600/60 dark:bg-slate-700/60 dark:hover:bg-slate-600"}`,
661
- title: m ? "ピン留め解除" : "ピン留め",
662
- "aria-label": m ? "ピン留め解除" : "ピン留め",
663
- children: m ? /* @__PURE__ */ r.jsx(Se, { size: 12 }) : /* @__PURE__ */ r.jsx(Te, { size: 12 })
701
+ className: `flex ${he} ${Ce} items-center justify-center rounded-md px-2 ${F} text-white shadow-2xs transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-current focus-visible:outline-offset-2 ${b ? "bg-amber-700 hover:bg-amber-800" : "border border-white/20 bg-white/10 hover:bg-white/20 dark:border-slate-600/60 dark:bg-slate-700/60 dark:hover:bg-slate-600"}`,
702
+ title: b ? "ピン留め解除" : "ピン留め",
703
+ "aria-label": b ? "ピン留め解除" : "ピン留め",
704
+ children: b ? /* @__PURE__ */ r.jsx(De, { size: 12 }) : /* @__PURE__ */ r.jsx(He, { size: 12 })
664
705
  }
665
- ),
706
+ ) : null,
666
707
  /* @__PURE__ */ r.jsx(
667
708
  "button",
668
709
  {
669
710
  type: "button",
670
711
  onClick: d,
671
712
  "data-aqmb-theme-button": !0,
672
- className: `group relative flex ${ae} ${ke} items-center justify-center rounded-md border border-white/20 bg-white/10 px-2 ${$} text-white shadow-2xs backdrop-blur-xs transition-colors duration-200 hover:bg-white/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 dark:border-slate-600/60 dark:bg-slate-700/60 dark:hover:bg-slate-600`,
673
- title: u === "dark" ? "ライトモードに切り替え" : "ダークモードに切り替え",
674
- "aria-label": u === "dark" ? "ライトモードに切り替え" : "ダークモードに切り替え",
675
- children: /* @__PURE__ */ r.jsx("span", { className: "transition-transform duration-200 group-hover:scale-110", children: u === "dark" ? "🌞" : "🌙" })
713
+ className: `group relative flex ${he} ${Ce} items-center justify-center rounded-md border border-white/20 bg-white/10 px-2 ${F} text-white shadow-2xs backdrop-blur-xs transition-colors duration-200 hover:bg-white/20 focus-visible:outline-2 focus-visible:outline-current focus-visible:outline-offset-2 dark:border-slate-600/60 dark:bg-slate-700/60 dark:hover:bg-slate-600`,
714
+ title: c === "dark" ? "ライトモードに切り替え" : "ダークモードに切り替え",
715
+ "aria-label": c === "dark" ? "ライトモードに切り替え" : "ダークモードに切り替え",
716
+ children: /* @__PURE__ */ r.jsx("span", { className: "transition-transform duration-200 group-hover:scale-110", children: c === "dark" ? "🌞" : "🌙" })
676
717
  }
677
718
  ),
678
719
  /* @__PURE__ */ r.jsxs(
@@ -680,10 +721,10 @@ const ct = [
680
721
  {
681
722
  type: "button",
682
723
  "data-aqmb-signout-button": !0,
683
- className: `aiquants-signout-button flex ${ae} flex-1 items-center justify-center gap-1.5 rounded-md bg-red-500/90 px-2.5 font-medium ${$} text-white shadow-2xs transition-colors duration-200 hover:bg-red-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300/60 dark:bg-red-600/90 dark:hover:bg-red-500`,
684
- onClick: o,
724
+ className: `aiquants-signout-button flex ${he} flex-1 items-center justify-center gap-1.5 rounded-md bg-red-800 px-2.5 font-medium ${F} text-white shadow-2xs transition-colors duration-200 hover:bg-red-900 focus-visible:outline-2 focus-visible:outline-current focus-visible:outline-offset-2`,
725
+ onClick: i,
685
726
  children: [
686
- /* @__PURE__ */ r.jsx(Xe, { size: 11, className: "shrink-0" }),
727
+ /* @__PURE__ */ r.jsx(ht, { size: 11, className: "shrink-0" }),
687
728
  /* @__PURE__ */ r.jsx("span", { className: "text-center", children: "サインアウト" })
688
729
  ]
689
730
  }
@@ -692,156 +733,215 @@ const ct = [
692
733
  ]
693
734
  }
694
735
  );
695
- }, gt = (t) => {
696
- t.preventDefault();
697
- }, kt = (t) => {
698
- const { isOverlay: n, onOverlayClick: a } = t;
736
+ }, $t = (e) => {
737
+ e.preventDefault();
738
+ }, Lt = (e) => {
739
+ const { isOverlay: t, onOverlayClick: a } = e;
699
740
  return /* @__PURE__ */ r.jsx(
700
741
  "div",
701
742
  {
702
743
  "aria-hidden": "true",
703
744
  "data-aqmb-menu-overlay": !0,
704
- inert: !n,
705
- className: `fixed inset-0 z-2147483640 overflow-hidden overscroll-contain bg-black/50 motion-safe:transition-opacity motion-safe:duration-500 ${n ? "opacity-100" : "pointer-events-none opacity-0"}`,
706
- onMouseDown: gt,
745
+ inert: !t,
746
+ className: `fixed inset-0 z-2147483640 overflow-hidden overscroll-contain bg-black/50 motion-safe:transition-opacity motion-safe:duration-500 ${t ? "opacity-100" : "pointer-events-none opacity-0"}`,
747
+ onMouseDown: $t,
707
748
  onClick: a
708
749
  }
709
750
  );
710
- }, wt = ({ isMenuOpen: t, onMenuOpen: n, onMenuClose: a, ref: s }) => /* @__PURE__ */ r.jsxs("button", { ref: s, type: "button", "data-aqmb-menu-switch": "true", "aria-label": t ? "Close menu" : "Open menu", "aria-expanded": t, className: "aiquants-menu-switch", onClick: t ? a : n, children: [
751
+ };
752
+ const zt = [
753
+ ["path", { d: "M4 5h16", key: "1tepv9" }],
754
+ ["path", { d: "M4 12h16", key: "1lakjw" }],
755
+ ["path", { d: "M4 19h16", key: "1djgab" }]
756
+ ], Dt = j("menu", zt);
757
+ const Ht = [
758
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
759
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
760
+ ], Bt = j("x", Ht), Re = 4, Yt = /^[A-Za-z0-9\s(),:.+\-*/<>=_]+$/, Vt = (e, t) => {
761
+ if (t.length < 1 || t.length > Re)
762
+ throw new Error(`@aiquants/menu-bar: tabBar.tabs must hold 1 to ${Re} tabs; got ${t.length}`);
763
+ const a = [];
764
+ for (const s of t) {
765
+ if (s.label.trim() === "")
766
+ throw new Error(`@aiquants/menu-bar: the tab for ${JSON.stringify(s.href)} needs a label`);
767
+ const o = Mt(e, s.href);
768
+ if (o === null)
769
+ throw new Error(`@aiquants/menu-bar: the tab href ${JSON.stringify(s.href)} names no entry of the menu`);
770
+ const i = a.find((c) => c.entry.menu === o.menu && c.entry.submenu === o.submenu);
771
+ if (i !== void 0)
772
+ throw new Error(`@aiquants/menu-bar: the tab hrefs ${JSON.stringify(i.tab.href)} and ${JSON.stringify(s.href)} name the same entry`);
773
+ a.push({ tab: s, entry: o });
774
+ }
775
+ return a;
776
+ }, Ft = (e) => {
777
+ if (e.trim() === "" || !Yt.test(e) || e.includes("/*") || e.includes("*/") || e.includes("</"))
778
+ throw new Error(`@aiquants/menu-bar: tabBar.media must be a media query of letters, digits, white space and ( ) , : . + - * / < > = _ without a comment or </; got ${JSON.stringify(e)}`);
779
+ return [
780
+ `@media ${e}{`,
781
+ ":root{--_aqmb-tab-bar-display:flex;--_aqmb-switch-display:none;--aqmb-tab-bar-block-size:var(--_aqmb-tab-bar-drawn-block-size);--aqmb-switch-clearance-inline-end:0px;--aqmb-switch-clearance-block-start:0px}",
782
+ ":root:has(:read-write:focus){--_aqmb-tab-bar-display:none;--aqmb-tab-bar-block-size:0px}",
783
+ ".aiquants-menu-content{block-size:calc(100dvh - var(--aqmb-tab-bar-block-size))}",
784
+ "}"
785
+ ].join("");
786
+ }, Wt = ({ resolved: e, current: t, onTabSelected: a }) => {
787
+ const { tab: s, entry: o } = e, i = /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
788
+ /* @__PURE__ */ r.jsx("span", { className: "aiquants-tab-bar-icon", "aria-hidden": "true", children: s.icon }),
789
+ /* @__PURE__ */ r.jsx("span", { className: `aiquants-tab-bar-label ${fe}`, children: s.label })
790
+ ] }), c = {
791
+ className: "aiquants-tab-bar-tab",
792
+ "data-aqmb-tab": !0,
793
+ "data-aqmb-current": t ? !0 : void 0,
794
+ "aria-current": t ? "page" : void 0,
795
+ onClick: () => a(de(o.menu, o.submenu === null ? void 0 : o.submenu))
796
+ };
797
+ return o.submenu?.new ? /* @__PURE__ */ r.jsx("a", { href: o.href, rel: "noopener noreferrer", target: "_blank", ...c, children: i }) : ge(o.href) ? /* @__PURE__ */ r.jsx("a", { href: o.href, ...c, children: i }) : /* @__PURE__ */ r.jsx(ye, { to: o.href, ...c, children: i });
798
+ }, Ut = ({ tabs: e, menuList: t, menuOpen: a, drawerId: s, onMenuOpen: o, onMenuClose: i, onTabSelected: c, menuTabRef: d }) => {
799
+ const x = Ve(), b = U(() => Ye(t, x), [t, x]), w = e.findIndex(({ entry: y }) => ce(b, y.menu.id, y.submenu === null ? null : y.submenu.subid));
800
+ return /* @__PURE__ */ r.jsxs("nav", { "data-aqmb-tab-bar": !0, "aria-label": "Tab bar", className: "aiquants-tab-bar", children: [
801
+ e.map((y, k) => /* @__PURE__ */ r.jsx(Wt, { resolved: y, current: k === w, onTabSelected: c }, W(y.tab.href))),
802
+ /* @__PURE__ */ r.jsxs(
803
+ "button",
804
+ {
805
+ ref: d,
806
+ type: "button",
807
+ "data-aqmb-tab-menu": !0,
808
+ "data-aqmb-current": w === -1 ? !0 : void 0,
809
+ "aria-label": a ? "Close menu" : "Open menu",
810
+ "aria-expanded": a,
811
+ "aria-controls": s,
812
+ className: "aiquants-tab-bar-tab aiquants-tab-bar-menu",
813
+ onClick: a ? i : o,
814
+ children: [
815
+ /* @__PURE__ */ r.jsx("span", { className: "aiquants-tab-bar-icon", "aria-hidden": "true", children: a ? /* @__PURE__ */ r.jsx(Bt, {}) : /* @__PURE__ */ r.jsx(Dt, {}) }),
816
+ /* @__PURE__ */ r.jsx("span", { className: `aiquants-tab-bar-label ${fe}`, "aria-hidden": "true", children: a ? "close" : "menu" })
817
+ ]
818
+ }
819
+ )
820
+ ] });
821
+ }, Gt = ({ isMenuOpen: e, onMenuOpen: t, onMenuClose: a, ref: s }) => /* @__PURE__ */ r.jsxs("button", { ref: s, type: "button", "data-aqmb-menu-switch": "true", "aria-label": e ? "Close menu" : "Open menu", "aria-expanded": e, className: "aiquants-menu-switch", onClick: e ? a : t, children: [
711
822
  /* @__PURE__ */ r.jsxs("span", { className: "aiquants-menu-switch-bars", children: [
712
823
  /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-switch-bar" }),
713
824
  /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-switch-bar" }),
714
825
  /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-switch-bar" }),
715
826
  /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-switch-bar" })
716
827
  ] }),
717
- /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-switch-caption", "aria-hidden": "true", children: t ? "close" : "menu" })
718
- ] }), se = typeof window < "u" ? ye : F, Et = (t) => {
828
+ /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-switch-caption", "aria-hidden": "true", children: e ? "close" : "menu" })
829
+ ] }), Jt = () => () => {
830
+ }, Zt = () => !0, Xt = () => !1, Qt = () => xe(Jt, Zt, Xt), qe = (e, t) => {
831
+ const a = Qt(), [s, o] = le(() => a ? e() : t), [i, c] = le(a);
832
+ return a && !i && (c(!0), o(e())), [s, o];
833
+ }, Kt = () => !1, en = (e) => {
834
+ const t = U(() => e === void 0 || typeof window > "u" ? null : window.matchMedia(e), [e]), a = _(
835
+ (o) => t === null ? () => {
836
+ } : (t.addEventListener("change", o), () => t.removeEventListener("change", o)),
837
+ [t]
838
+ ), s = _(() => t === null ? !1 : t.matches, [t]);
839
+ return xe(a, s, Kt);
840
+ }, ie = typeof window < "u" ? Ie : ee, sn = (e) => {
719
841
  const {
720
- menuList: n,
842
+ menuList: t,
721
843
  menuHeader: a,
722
844
  onClickSignout: s,
723
- isMenuhide: l,
724
- isMenuHide: o,
725
- theme: u,
845
+ isMenuhide: o,
846
+ isMenuHide: i,
847
+ theme: c,
726
848
  toggleTheme: d,
727
- onMenuNavigate: m,
728
- isPinned: x,
729
- pinnedWidth: y = 240,
730
- onPinChange: N,
731
- pinnedSubmenuIds: w,
732
- initialPinnedSubmenuIds: j,
733
- onSubmenuPinChange: C,
734
- closeOnEscape: R = "auto"
735
- } = t, c = o ?? l ?? !1, [p, S] = X(() => {
736
- try {
737
- return localStorage.getItem("aiquants-menu-pinned") === "true";
738
- } catch {
739
- return !1;
740
- }
741
- }), k = x !== void 0 ? x : p, [T, I] = X(k);
742
- F(() => {
743
- k && I(!0);
744
- }, [k]);
745
- const [D, Q] = X(() => {
746
- if (j)
747
- return j;
748
- try {
749
- const h = localStorage.getItem("aiquants-submenu-pinned");
750
- if (h) {
751
- const e = JSON.parse(h);
752
- if (Array.isArray(e))
753
- return e.filter((i) => typeof i == "number");
754
- }
755
- } catch {
756
- }
757
- return [];
758
- }), K = w !== void 0 ? w : D, z = _(
759
- (h) => {
760
- const e = w !== void 0 ? w : D, i = e.includes(h) ? e.filter((f) => f !== h) : [...e, h];
761
- if (w === void 0) {
762
- Q(i);
763
- try {
764
- localStorage.setItem("aiquants-submenu-pinned", JSON.stringify(i));
765
- } catch {
766
- }
767
- }
768
- C && C(i);
849
+ onMenuNavigate: x,
850
+ isPinned: b,
851
+ pinnedWidth: w = 240,
852
+ onPinChange: y,
853
+ pinnedSubmenuIds: k,
854
+ initialPinnedSubmenuIds: E,
855
+ onSubmenuPinChange: T,
856
+ closeOnEscape: L = "auto",
857
+ pinnable: u = !0,
858
+ tabBar: v
859
+ } = e, P = i ?? o ?? !1, [me, te] = qe(lt, !1), R = b !== void 0 ? b : me, z = v?.media, G = v?.tabs, J = U(() => G === void 0 ? null : Vt(t, G), [t, G]), D = U(() => z === void 0 ? null : Ft(z), [z]), Z = en(z), M = u && !Z, N = M && R, [S, q] = le(N);
860
+ ee(() => {
861
+ N && q(!0);
862
+ }, [N]);
863
+ const [O, ne] = qe(() => E ?? ut(), E ?? []), re = k !== void 0 ? k : O, ae = _(
864
+ (p) => {
865
+ const $ = k !== void 0 ? k : O, se = $.includes(p) ? $.filter((Fe) => Fe !== p) : [...$, p];
866
+ k === void 0 && (ne(se), dt(se)), T && T(se);
769
867
  },
770
- [w, D, C]
771
- ), H = L(N);
772
- se(() => {
773
- H.current = N;
774
- }, [N]), se(() => {
775
- const h = k ? y : 0, e = `${h}px`;
776
- document.documentElement.style.setProperty("--aiquants-menu-pinned-width", e), be(k, h, T || k);
777
- }, [k, y, T]), se(() => () => {
778
- document.documentElement.style.setProperty("--aiquants-menu-pinned-width", "0px"), be(!1, 0);
868
+ [k, O, T]
869
+ ), H = C(y);
870
+ ie(() => {
871
+ H.current = y;
872
+ }, [y]), ie(() => {
873
+ const p = N ? w : 0, $ = `${p}px`;
874
+ document.documentElement.style.setProperty("--aiquants-menu-pinned-width", $), Te(N, p, S || N);
875
+ }, [N, w, S]), ie(() => () => {
876
+ document.documentElement.style.setProperty("--aiquants-menu-pinned-width", "0px"), Te(!1, 0);
779
877
  }, []);
780
- const U = L(null), O = L(null), P = _(() => {
781
- O.current?.contains(document.activeElement) && U.current?.focus();
782
- }, []), ee = _(() => {
783
- I(!0);
784
- }, []), M = _(() => {
785
- if (P(), I(!1), x === void 0) {
786
- S(!1);
787
- try {
788
- localStorage.removeItem("aiquants-menu-pinned");
789
- } catch {
790
- }
791
- }
792
- H.current?.(!1, 0);
793
- }, [x, P]), G = _(() => {
794
- const h = !k, e = h ? y : 0;
795
- if (x === void 0) {
796
- S(h);
797
- try {
798
- h ? localStorage.setItem("aiquants-menu-pinned", "true") : localStorage.removeItem("aiquants-menu-pinned");
799
- } catch {
878
+ const X = C(null), n = C(null), l = C(null), m = Ue(), f = _(() => {
879
+ const p = document.activeElement;
880
+ if (!(p === null || !l.current?.contains(p))) {
881
+ if (!Z) {
882
+ X.current?.focus();
883
+ return;
800
884
  }
885
+ (p instanceof HTMLElement || p instanceof SVGElement) && p.blur(), n.current?.focus();
801
886
  }
802
- H.current?.(h, e);
803
- }, [k, x, y]), B = _(
804
- (h) => {
805
- m && m(h), k || (P(), I(!1));
887
+ }, [Z]), I = C(M);
888
+ ie(() => {
889
+ const p = I.current;
890
+ I.current = M, p && !M && R && (f(), q(!1));
891
+ }, [M, R, f]);
892
+ const B = _(() => {
893
+ q(!0);
894
+ }, []), h = _(() => {
895
+ f(), q(!1), M && (b === void 0 && (te(!1), Se(!1)), H.current?.(!1, 0));
896
+ }, [M, b, f]), A = _(() => {
897
+ const p = !R, $ = p ? w : 0;
898
+ b === void 0 && (te(p), Se(p)), H.current?.(p, $);
899
+ }, [R, b, w]), Y = _(
900
+ (p) => {
901
+ x && x(p), N || (f(), q(!1));
806
902
  },
807
- [m, k, P]
808
- ), A = _(
809
- (h) => {
810
- h.key === "Escape" && M();
903
+ [x, N, f]
904
+ ), V = _(
905
+ (p) => {
906
+ p.key === "Escape" && h();
811
907
  },
812
- [M]
813
- ), Y = R === !0 || R === "auto" && !k;
814
- return F(() => (T && Y ? window.addEventListener("keydown", A) : window.removeEventListener("keydown", A), () => {
815
- window.removeEventListener("keydown", A);
816
- }), [T, Y, A]), c ? null : /* @__PURE__ */ r.jsxs("div", { className: `aiquants-menu-bar ${u}`, children: [
817
- /* @__PURE__ */ r.jsx(wt, { ref: U, isMenuOpen: T, onMenuOpen: ee, onMenuClose: M }),
908
+ [h]
909
+ ), we = L === !0 || L === "auto" && !N;
910
+ return ee(() => (S && we ? window.addEventListener("keydown", V) : window.removeEventListener("keydown", V), () => {
911
+ window.removeEventListener("keydown", V);
912
+ }), [S, we, V]), P ? null : /* @__PURE__ */ r.jsxs("div", { className: `aiquants-menu-bar ${c}`, children: [
913
+ D === null ? null : /* @__PURE__ */ r.jsx("style", { nonce: v?.nonce, suppressHydrationWarning: !0, children: D }),
914
+ /* @__PURE__ */ r.jsx(Gt, { ref: X, isMenuOpen: S, onMenuOpen: B, onMenuClose: h }),
915
+ J === null ? null : /* @__PURE__ */ r.jsx(Ut, { tabs: J, menuList: t, menuOpen: S, drawerId: m, onMenuOpen: B, onMenuClose: h, onTabSelected: Y, menuTabRef: n }),
818
916
  /* @__PURE__ */ r.jsx(
819
- xt,
917
+ It,
820
918
  {
821
- ref: O,
822
- menuList: n,
919
+ ref: l,
920
+ id: J === null ? void 0 : m,
921
+ menuList: t,
823
922
  menuHeader: a,
824
923
  onClickSignout: s,
825
- onMenuSelected: B,
826
- open: T,
827
- theme: u,
924
+ onMenuSelected: Y,
925
+ open: S,
926
+ theme: c,
828
927
  toggleTheme: d,
829
- isPinned: k,
830
- onTogglePin: G,
831
- pinnedSubmenuIds: K,
832
- onToggleSubmenuPin: z
928
+ canPin: M,
929
+ isPinned: N,
930
+ onTogglePin: A,
931
+ pinnedSubmenuIds: re,
932
+ onToggleSubmenuPin: ae
833
933
  }
834
934
  ),
835
- /* @__PURE__ */ r.jsx(kt, { isOverlay: T && !k, onOverlayClick: M })
935
+ /* @__PURE__ */ r.jsx(Lt, { isOverlay: S && !N, onOverlayClick: h })
836
936
  ] });
837
937
  };
838
938
  export {
839
- Be as DefaultLink,
840
- ie as MENU_PIN_CHANGE_EVENT,
841
- Et as MenuBar,
842
- _t as SessionInfo,
843
- be as dispatchMenuPinChange,
844
- Ee as getInitialPinState,
845
- Ze as subscribeMenuPinChange,
846
- jt as useMenuPinState
939
+ ct as DefaultLink,
940
+ pe as MENU_PIN_CHANGE_EVENT,
941
+ sn as MenuBar,
942
+ rn as SessionInfo,
943
+ Te as dispatchMenuPinChange,
944
+ ze as getInitialPinState,
945
+ ft as subscribeMenuPinChange,
946
+ an as useMenuPinState
847
947
  };