@ichaingo/header 1.3.85 → 1.3.87

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.
@@ -5,7 +5,7 @@ import t from "@ichaingo/link";
5
5
  import { twMerge as e } from "tailwind-merge";
6
6
  function p() {
7
7
  return /* @__PURE__ */ r(t, { suppressHydrationWarning: !0, href: "/", baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL, className: e(
8
- "w-auto shrink-0 block"
8
+ "w-auto shrink-0 block cursor-pointer"
9
9
  ), children: /* @__PURE__ */ r(
10
10
  o,
11
11
  {
@@ -1,103 +1,103 @@
1
1
  'use client';
2
- import { jsx as e, jsxs as n, Fragment as C } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as a, Fragment as T } from "react/jsx-runtime";
3
3
  import h from "@ichaingo/link";
4
- import { DropdownMenu as z, DropdownMenuTrigger as M, DropdownMenuContent as X, DropdownMenuGroup as K, DropdownMenuItem as $ } from "@ichaingo/ui/dropdown-menu";
4
+ import { DropdownMenu as M, DropdownMenuTrigger as X, DropdownMenuContent as $, DropdownMenuGroup as O, DropdownMenuItem as G } from "@ichaingo/ui/dropdown-menu";
5
5
  import d from "@ichaingo/translation";
6
- import { useState as b, useMemo as O, useEffect as w, useCallback as N } from "react";
7
- import y from "@ichaingo/better-link";
8
- import { useLocale as v, useTranslations as k } from "next-intl";
9
- import U from "@ichaingo/avatar";
10
- import { logout as G, fetchUserProfile as F } from "@ichaingo/auth";
6
+ import { useState as f, useMemo as F, useEffect as N, useCallback as y } from "react";
7
+ import U from "@ichaingo/better-link";
8
+ import { useLocale as w, useTranslations as _ } from "next-intl";
9
+ import k from "@ichaingo/avatar";
10
+ import { logout as q, fetchUserProfile as Q } from "@ichaingo/auth";
11
11
  import { twMerge as m } from "tailwind-merge";
12
- import { Accordion as E, AccordionItem as T, AccordionTrigger as P, AccordionContent as j } from "@ichaingo/ui/accordion";
13
- import q from "@ichaingo/iconfont";
14
- import { Popover as Q, PopoverTrigger as V, PopoverContent as W } from "@ichaingo/ui/popover";
15
- import { PopoverArrow as J } from "@radix-ui/react-popover";
16
- import { useSearchParams as Y, usePathname as R } from "next/navigation";
17
- import Z from "@ichaingo/theme-toggle";
18
- import { o as I, c as ee, U as L } from "./index-Y29nbZMy.js";
19
- import le from "rc-drawer";
20
- import { Menu as re, X as te } from "lucide-react";
21
- function ae({
22
- userInfo: r
12
+ import { Accordion as P, AccordionItem as j, AccordionTrigger as S, AccordionContent as R } from "@ichaingo/ui/accordion";
13
+ import V from "@ichaingo/iconfont";
14
+ import { Popover as W, PopoverTrigger as J, PopoverContent as Y } from "@ichaingo/ui/popover";
15
+ import { PopoverArrow as Z } from "@radix-ui/react-popover";
16
+ import { useSearchParams as I, usePathname as B } from "next/navigation";
17
+ import ee from "@ichaingo/theme-toggle";
18
+ import { o as re, c as le, U as A } from "./index-Bja6uGMm.js";
19
+ import te from "rc-drawer";
20
+ import { Menu as ne, X as ae } from "lucide-react";
21
+ function se({
22
+ userInfo: l
23
23
  }) {
24
- const { gotoLogin: l } = y(), [a, t] = b(""), i = v(), o = O(() => r == null ? void 0 : r.id, [r]);
25
- return w(() => {
26
- t(l({
24
+ const { gotoLogin: r } = U(), [n, t] = f(""), i = w(), o = F(() => l == null ? void 0 : l.id, [l]);
25
+ return N(() => {
26
+ t(r({
27
27
  locale: i,
28
28
  redirect: window.location.href
29
29
  }));
30
- }, [i, l]), o ? (
30
+ }, [i, r]), o ? (
31
31
  // userInfo?.profileUrl
32
32
  // https://images.ichaingo.com/user-profile/100000201.png
33
- /* @__PURE__ */ e(U, { userInfo: r, className: "w-8 h-8" })
33
+ /* @__PURE__ */ e(k, { userInfo: l, className: "w-8 h-8" })
34
34
  ) : /* @__PURE__ */ e(
35
35
  h,
36
36
  {
37
- href: a,
37
+ href: n,
38
38
  className: "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
39
39
  replace: !0,
40
40
  children: /* @__PURE__ */ e(d, { value: "signIn", parentKey: "account" })
41
41
  }
42
42
  );
43
43
  }
44
- function S({ className: r }) {
45
- const l = N(async () => {
46
- await G();
44
+ function H({ className: l }) {
45
+ const r = y(async () => {
46
+ await q();
47
47
  }, []);
48
48
  return /* @__PURE__ */ e(
49
49
  "button",
50
50
  {
51
- onClick: l,
52
- className: m("cursor-pointer relative", r),
51
+ onClick: r,
52
+ className: m("cursor-pointer relative", l),
53
53
  children: /* @__PURE__ */ e(d, { value: "logout", parentKey: "account" })
54
54
  }
55
55
  );
56
56
  }
57
- function ne({
58
- list: r,
59
- userInfo: l,
60
- onClick: a
57
+ function ie({
58
+ list: l,
59
+ userInfo: r,
60
+ onClick: n
61
61
  }) {
62
- return /* @__PURE__ */ n(z, { children: [
63
- /* @__PURE__ */ e(M, { className: "outline-none cursor-pointer", children: /* @__PURE__ */ e(ae, { userInfo: l }) }),
64
- /* @__PURE__ */ e(X, { align: "end", className: "z-2000 w-75 p-0 border-transparent outline-none border border-stroke", children: /* @__PURE__ */ n(K, { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
65
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
66
- /* @__PURE__ */ e(U, { userInfo: l, className: "w-8 h-8" }),
67
- /* @__PURE__ */ n("div", { className: "flex flex-col overflow-hidden", children: [
68
- /* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (l == null ? void 0 : l.username) || "--" }),
69
- /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (l == null ? void 0 : l.email) || (l == null ? void 0 : l.walletAddress) })
62
+ return /* @__PURE__ */ a(M, { children: [
63
+ /* @__PURE__ */ e(X, { className: "outline-none cursor-pointer", children: /* @__PURE__ */ e(se, { userInfo: r }) }),
64
+ /* @__PURE__ */ e($, { align: "end", className: "z-2000 w-75 p-0 border-transparent outline-none border border-stroke", children: /* @__PURE__ */ a(O, { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
65
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
66
+ /* @__PURE__ */ e(k, { userInfo: r, className: "w-8 h-8" }),
67
+ /* @__PURE__ */ a("div", { className: "flex flex-col overflow-hidden", children: [
68
+ /* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (r == null ? void 0 : r.username) || "--" }),
69
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (r == null ? void 0 : r.email) || (r == null ? void 0 : r.walletAddress) })
70
70
  ] })
71
71
  ] }) }),
72
- r.map((t) => /* @__PURE__ */ e($, { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full", children: t.name === "logout" ? /* @__PURE__ */ e(S, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(h, { href: `/${t.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background rounded-lg ", onClick: a, children: /* @__PURE__ */ e(d, { value: t.name, parentKey: "account" }) }) }) }, t.name))
72
+ l.map((t) => /* @__PURE__ */ e(G, { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full", children: t.name === "logout" ? /* @__PURE__ */ e(H, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(h, { href: `/${t.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background rounded-lg ", onClick: n, children: /* @__PURE__ */ e(d, { value: t.name, parentKey: "account" }) }) }) }, t.name))
73
73
  ] }) })
74
74
  ] });
75
75
  }
76
- function se({
77
- list: r,
78
- userInfo: l,
79
- onClick: a
76
+ function oe({
77
+ list: l,
78
+ userInfo: r,
79
+ onClick: n
80
80
  }) {
81
81
  return /* @__PURE__ */ e(
82
- E,
82
+ P,
83
83
  {
84
84
  type: "single",
85
85
  collapsible: !0,
86
86
  className: "w-full",
87
87
  defaultValue: "",
88
- children: /* @__PURE__ */ n(T, { value: "item-1", className: "p-0 w-full border border-none", children: [
89
- /* @__PURE__ */ e(P, { className: "w-full bg-background p-3 flex items-center justify-between", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
90
- /* @__PURE__ */ e(U, { userInfo: l, className: "w-8 h-8 shrink-0" }),
91
- /* @__PURE__ */ n("div", { className: "flex flex-col overflow-hidden", children: [
92
- /* @__PURE__ */ e("div", { className: "text-sm font-medium", children: l == null ? void 0 : l.username }),
93
- /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (l == null ? void 0 : l.email) || (l == null ? void 0 : l.walletAddress) })
88
+ children: /* @__PURE__ */ a(j, { value: "item-1", className: "p-0 w-full border border-none", children: [
89
+ /* @__PURE__ */ e(S, { className: "w-full bg-background p-3 flex items-center justify-between", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full overflow-hidden", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
90
+ /* @__PURE__ */ e(k, { userInfo: r, className: "w-8 h-8 shrink-0" }),
91
+ /* @__PURE__ */ a("div", { className: "flex flex-col overflow-hidden", children: [
92
+ /* @__PURE__ */ e("div", { className: "text-sm font-medium", children: r == null ? void 0 : r.username }),
93
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (r == null ? void 0 : r.email) || (r == null ? void 0 : r.walletAddress) })
94
94
  ] })
95
95
  ] }) }) }),
96
- /* @__PURE__ */ e(j, { className: "flex text-sm flex-col text-balance bg-background rounded-lg p-3 gap-3 mt-[10px]", children: /* @__PURE__ */ e("dl", { children: r.map((t) => /* @__PURE__ */ e(
96
+ /* @__PURE__ */ e(R, { className: "flex text-sm flex-col text-balance bg-background rounded-lg p-3 gap-3 mt-[10px]", children: /* @__PURE__ */ e("dl", { children: l.map((t) => /* @__PURE__ */ e(
97
97
  "dd",
98
98
  {
99
99
  className: "flex justify-start items-center gap-2 py-2",
100
- children: /* @__PURE__ */ e(h, { href: `/${t.href}`, className: "flex-1 py-2", onClick: a, suppressHydrationWarning: !0, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, children: /* @__PURE__ */ e(d, { value: t.name, parentKey: "account" }) })
100
+ children: /* @__PURE__ */ e(h, { href: `/${t.href}`, className: "flex-1 py-2", onClick: n, suppressHydrationWarning: !0, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, children: /* @__PURE__ */ e(d, { value: t.name, parentKey: "account" }) })
101
101
  },
102
102
  t.name
103
103
  )) }) })
@@ -105,30 +105,30 @@ function se({
105
105
  }
106
106
  );
107
107
  }
108
- function B({ onClick: r = () => {
109
- }, className: l }) {
110
- const a = v(), { gotoLogin: t } = y(), [i, o] = b("");
111
- return w(() => {
108
+ function D({ onClick: l = () => {
109
+ }, className: r }) {
110
+ const n = w(), { gotoLogin: t } = U(), [i, o] = f("");
111
+ return N(() => {
112
112
  o(t({
113
- locale: a,
113
+ locale: n,
114
114
  redirect: window.location.href
115
115
  }));
116
- }, [a, t]), /* @__PURE__ */ e(
116
+ }, [n, t]), /* @__PURE__ */ e(
117
117
  h,
118
118
  {
119
119
  href: i,
120
- onClick: r,
120
+ onClick: l,
121
121
  baseUrl: process.env.NEXT_PUBLIC_AUTH_URL,
122
122
  replace: !0,
123
123
  className: m(
124
124
  "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
125
- l
125
+ r
126
126
  ),
127
127
  children: /* @__PURE__ */ e(d, { value: "signIn", parentKey: "account" })
128
128
  }
129
129
  );
130
130
  }
131
- const _ = [
131
+ const C = [
132
132
  {
133
133
  name: "overview",
134
134
  href: "user-center"
@@ -150,83 +150,83 @@ const _ = [
150
150
  href: void 0
151
151
  }
152
152
  ];
153
- function ie({ onClick: r = (t) => {
154
- }, className: l, userInfo: a }) {
155
- return a != null && a.id ? /* @__PURE__ */ n(C, { children: [
156
- /* @__PURE__ */ e("div", { className: m("hidden md:flex items-center", l), children: /* @__PURE__ */ e(ne, { list: _, userInfo: a, onClick: r }) }),
157
- /* @__PURE__ */ e("div", { className: m("block md:hidden w-full", l), children: /* @__PURE__ */ e(se, { list: _.filter((t) => t.href), userInfo: a, onClick: r }) })
158
- ] }) : /* @__PURE__ */ e(B, { onClick: r, className: m(
153
+ function ce({ onClick: l = (t) => {
154
+ }, className: r, userInfo: n }) {
155
+ return n != null && n.id ? /* @__PURE__ */ a(T, { children: [
156
+ /* @__PURE__ */ e("div", { className: m("hidden md:flex items-center", r), children: /* @__PURE__ */ e(ie, { list: C, userInfo: n, onClick: l }) }),
157
+ /* @__PURE__ */ e("div", { className: m("block md:hidden w-full", r), children: /* @__PURE__ */ e(oe, { list: C.filter((t) => t.href), userInfo: n, onClick: l }) })
158
+ ] }) : /* @__PURE__ */ e(D, { onClick: l, className: m(
159
159
  "hidden md:flex cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
160
160
  "order-3"
161
161
  ) });
162
162
  }
163
- function A({ onClick: r = () => {
163
+ function E({ onClick: l = () => {
164
164
  } }) {
165
- var u;
166
- const l = v(), a = Y(), t = k("lang"), i = k("setting"), o = [
165
+ var x;
166
+ const r = w(), n = I(), t = _("lang"), i = _("setting"), o = [
167
167
  { name: t("en"), lang: "en" },
168
168
  { name: t("zh-hant"), lang: "zh-hant" },
169
169
  { name: t("zh-hans"), lang: "zh-hans" },
170
170
  { name: t("ja"), lang: "ja" },
171
171
  { name: t("ko"), lang: "ko" }
172
- ], s = R(), g = N(
172
+ ], s = B(), g = y(
173
173
  (c) => {
174
- const x = s.replace(new RegExp(`/${l}(/|$)`), `/${c}$1`), f = a.toString();
175
- return f ? `${x}?${f}` : x;
174
+ const u = s.replace(new RegExp(`/${r}(/|$)`), `/${c}$1`), b = n.toString();
175
+ return b ? `${u}?${b}` : u;
176
176
  },
177
- [s, l, a]
177
+ [s, r, n]
178
178
  );
179
- return /* @__PURE__ */ n("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
180
- /* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(E, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ n(T, { value: l, className: "border-0", children: [
181
- /* @__PURE__ */ e(P, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ n("div", { className: "flex w-full justify-between items-center", children: [
179
+ return /* @__PURE__ */ a("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
180
+ /* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(P, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ a(j, { value: r, className: "border-0", children: [
181
+ /* @__PURE__ */ e(S, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ a("div", { className: "flex w-full justify-between items-center", children: [
182
182
  /* @__PURE__ */ e("span", { className: "text-title", children: i("language") }),
183
- /* @__PURE__ */ e("span", { className: "text-title", children: (u = o.find((c) => c.lang === l)) == null ? void 0 : u.name })
183
+ /* @__PURE__ */ e("span", { className: "text-title", children: (x = o.find((c) => c.lang === r)) == null ? void 0 : x.name })
184
184
  ] }) }),
185
- /* @__PURE__ */ e(j, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((c) => /* @__PURE__ */ e(
185
+ /* @__PURE__ */ e(R, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((c) => /* @__PURE__ */ e(
186
186
  h,
187
187
  {
188
188
  prefetch: !1,
189
189
  withLocale: !1,
190
190
  className: m(
191
191
  "p-2 rounded-lg flex w-full justify-between items-center",
192
- l === c.lang ? "text-primary" : ""
192
+ r === c.lang ? "text-primary" : ""
193
193
  ),
194
194
  href: g(c.lang),
195
- onClick: r,
195
+ onClick: l,
196
196
  children: c.name
197
197
  },
198
198
  c.lang
199
199
  )) })
200
200
  ] }) }) }),
201
- /* @__PURE__ */ n("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
201
+ /* @__PURE__ */ a("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
202
202
  /* @__PURE__ */ e("div", { children: i("theme") }),
203
- /* @__PURE__ */ e(Z, {})
203
+ /* @__PURE__ */ e(ee, {})
204
204
  ] })
205
205
  ] });
206
206
  }
207
- function oe({ onClick: r = () => {
207
+ function de({ onClick: l = () => {
208
208
  } }) {
209
- return /* @__PURE__ */ n("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
210
- /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ n(Q, { children: [
211
- /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ e(q, { type: "icon-setting", className: "text-2xl" }) }),
212
- /* @__PURE__ */ n(
213
- W,
209
+ return /* @__PURE__ */ a("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
210
+ /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ a(W, { children: [
211
+ /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(V, { type: "icon-setting", className: "text-2xl" }) }),
212
+ /* @__PURE__ */ a(
213
+ Y,
214
214
  {
215
215
  side: "bottom",
216
216
  className: "relative top-[10px] rounded-xl border border-stroke bg-module p-2 w-72 z-1000",
217
217
  children: [
218
- /* @__PURE__ */ e(J, { className: "fill-module" }),
219
- /* @__PURE__ */ e(A, { onClick: r })
218
+ /* @__PURE__ */ e(Z, { className: "fill-module" }),
219
+ /* @__PURE__ */ e(E, { onClick: l })
220
220
  ]
221
221
  }
222
222
  )
223
223
  ] }) }),
224
- /* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(A, {}) })
224
+ /* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(E, {}) })
225
225
  ] });
226
226
  }
227
- function H({ onClick: r = () => {
228
- }, hideNews: l = !1, hideLogin: a = !1, user: t }) {
229
- const { gotoAISQL: i, gotoChat: o } = y(), s = v(), g = R(), [u, c] = b(t), x = [
227
+ function z({ onClick: l = () => {
228
+ }, hideNews: r = !1, hideLogin: n = !1, user: t }) {
229
+ const { gotoAISQL: i, gotoChat: o } = U(), s = w(), g = B(), [x, c] = f(""), [u, b] = f(t), K = [
230
230
  {
231
231
  baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
232
232
  href: "/explorer",
@@ -237,7 +237,7 @@ function H({ onClick: r = () => {
237
237
  baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
238
238
  href: o({ locale: s }),
239
239
  key: "/chat",
240
- label: /* @__PURE__ */ n("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: [
240
+ label: /* @__PURE__ */ a("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: [
241
241
  /* @__PURE__ */ e("span", { role: "img", "aria-label": "hot", children: "🔥" }),
242
242
  /* @__PURE__ */ e("span", { children: "iGoChat" })
243
243
  ] })
@@ -266,14 +266,14 @@ function H({ onClick: r = () => {
266
266
  key: "/ranking",
267
267
  label: /* @__PURE__ */ e(d, { value: "ranking", parentKey: "menu" })
268
268
  }
269
- ].filter((p) => l ? !["/explorer", "/chat", "/sql"].includes(p.key) : !0), f = N(() => {
270
- F().then((p) => {
271
- c(p);
269
+ ].filter((p) => r ? !["/explorer", "/chat", "/sql"].includes(p.key) : !0), L = y(() => new Promise((p) => {
270
+ Q().then((v) => {
271
+ b(v), c((/* @__PURE__ */ new Date()).getTime().toString()), p(v);
272
272
  });
273
- }, []);
274
- return w(() => (I(L.PROFILE_UPDATED, f), () => {
275
- ee(L.PROFILE_UPDATED, f);
276
- }), []), /* @__PURE__ */ n(
273
+ }), []);
274
+ return N(() => (re(A.PROFILE_UPDATED, L), () => {
275
+ le(A.PROFILE_UPDATED, L);
276
+ }), []), /* @__PURE__ */ a(
277
277
  "nav",
278
278
  {
279
279
  className: m(
@@ -290,36 +290,36 @@ function H({ onClick: r = () => {
290
290
  "md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
291
291
  "order-2 md:order-0"
292
292
  ),
293
- children: x.map((p, D) => /* @__PURE__ */ e("li", { className: m("w-full md:w-auto h-11 md:h-auto cursor-pointer", g.includes(p.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(h, { href: p.href, onClick: r, className: "h-full flex items-center justify-start", baseUrl: p.baseUrl, suppressHydrationWarning: !0, children: p.label }) }, D))
293
+ children: K.map((p, v) => /* @__PURE__ */ e("li", { className: m("w-full md:w-auto h-11 md:h-auto cursor-pointer", g.includes(p.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(h, { href: p.href, onClick: l, className: "h-full flex items-center justify-start", baseUrl: p.baseUrl, suppressHydrationWarning: !0, children: p.label }) }, v))
294
294
  }
295
295
  ),
296
- /* @__PURE__ */ e(oe, { onClick: r }),
297
- !g.includes("/login") && !a ? /* @__PURE__ */ n(C, { children: [
298
- /* @__PURE__ */ e(ie, { onClick: r, userInfo: u }),
299
- u != null && u.id ? /* @__PURE__ */ e("div", { className: "flex md:hidden h-11 md:h-auto cursor-pointer whitespace-nowrap order-3 bg-background rounded-lg p-2 mt-3 w-full items-center justify-center text-subtitle", children: /* @__PURE__ */ e(S, {}) }) : /* @__PURE__ */ e(B, { onClick: r, className: "flex md:hidden h-11 cursor-pointer whitespace-nowrap order-3 bg-primary text-white rounded-lg p-2 mt-3 w-full items-center justify-center" })
296
+ /* @__PURE__ */ e(de, { onClick: l }),
297
+ !g.includes("/login") && !n ? /* @__PURE__ */ a(T, { children: [
298
+ /* @__PURE__ */ e(ce, { onClick: l, userInfo: u }, x),
299
+ u != null && u.id ? /* @__PURE__ */ e("div", { className: "flex md:hidden h-11 md:h-auto cursor-pointer whitespace-nowrap order-3 bg-background rounded-lg p-2 mt-3 w-full items-center justify-center text-subtitle", children: /* @__PURE__ */ e(H, {}) }) : /* @__PURE__ */ e(D, { onClick: l, className: "flex md:hidden h-11 cursor-pointer whitespace-nowrap order-3 bg-primary text-white rounded-lg p-2 mt-3 w-full items-center justify-center" })
300
300
  ] }) : null
301
301
  ]
302
302
  }
303
303
  );
304
304
  }
305
- function ce({ hideLogin: r, hideNews: l, user: a }) {
306
- const [t, i] = b(!1);
305
+ function me({ hideLogin: l, hideNews: r, user: n }) {
306
+ const [t, i] = f(!1);
307
307
  if (!t)
308
- return /* @__PURE__ */ e(re, { onClick: () => i(!0), size: 32, style: { color: "var(--title)" }, className: "md:hidden ml-2.5 bg-module rounded-lg p-[4px] " });
308
+ return /* @__PURE__ */ e(ne, { onClick: () => i(!0), size: 32, style: { color: "var(--title)" }, className: "md:hidden ml-2.5 bg-module rounded-lg p-[4px] " });
309
309
  const o = (s) => {
310
310
  s == null || s.preventDefault(), s == null || s.stopPropagation(), i(!1);
311
311
  };
312
- return /* @__PURE__ */ e(le, { open: t, placement: "right", className: "block md:hidden fixed top-0 bottom-0 left-0 right-0 z-1001 bg-background p-2", children: /* @__PURE__ */ n("div", { className: "w-full max-h-full overflow-y-auto p-3 bg-module rounded-lg", children: [
313
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(te, { size: 24, style: { color: "var(--title)" }, onClick: (s) => o(s) }) }),
314
- /* @__PURE__ */ e(H, { onClick: (s) => o(s), hideLogin: r, hideNews: l, user: a })
312
+ return /* @__PURE__ */ e(te, { open: t, placement: "right", className: "block md:hidden fixed top-0 bottom-0 left-0 right-0 z-1001 bg-background p-2", children: /* @__PURE__ */ a("div", { className: "w-full max-h-full overflow-y-auto p-3 bg-module rounded-lg", children: [
313
+ /* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(ae, { size: 24, style: { color: "var(--title)" }, onClick: (s) => o(s) }) }),
314
+ /* @__PURE__ */ e(z, { onClick: (s) => o(s), hideLogin: l, hideNews: r, user: n })
315
315
  ] }) });
316
316
  }
317
- function Ee({ hideNews: r, hideLogin: l, user: a }) {
318
- return /* @__PURE__ */ n("div", { className: "flex justify-end items-center md:gap-10 z-1001 ", children: [
319
- /* @__PURE__ */ e(ce, { hideLogin: l, hideNews: r, user: a }),
320
- /* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(H, { hideNews: r, hideLogin: l, user: a }) })
317
+ function Pe({ hideNews: l, hideLogin: r, user: n }) {
318
+ return /* @__PURE__ */ a("div", { className: "flex justify-end items-center md:gap-10 z-1001 ", children: [
319
+ /* @__PURE__ */ e(me, { hideLogin: r, hideNews: l, user: n }),
320
+ /* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(z, { hideNews: l, hideLogin: r, user: n }) })
321
321
  ] });
322
322
  }
323
323
  export {
324
- Ee as default
324
+ Pe as default
325
325
  };
@@ -20,7 +20,7 @@ function h(e, t) {
20
20
  function U(e, t) {
21
21
  window.removeEventListener(e, t);
22
22
  }
23
- const m = c(() => import("./Right-DMWuFMki.js"), { ssr: !1 }), u = c(() => import("./Logo-BwpYr4IY.js"), { ssr: !1 });
23
+ const m = c(() => import("./Right-BbiUUbV1.js"), { ssr: !1 }), u = c(() => import("./Logo-BxSWGm8n.js"), { ssr: !1 });
24
24
  async function x({ extra: e, children: t, className: s, hideNews: r, hideLogin: i }) {
25
25
  let n = {
26
26
  data: {}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "tailwind-merge";
3
3
  import "@ichaingo/request";
4
4
  import "next/dynamic";
5
- import { U as a, H as i, e as p, o as E } from "./index-Y29nbZMy.js";
5
+ import { U as a, H as i, e as p, o as E } from "./index-Bja6uGMm.js";
6
6
  export {
7
7
  a as USER_EVENTS,
8
8
  i as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/header",
3
- "version": "1.3.85",
3
+ "version": "1.3.87",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -29,18 +29,18 @@
29
29
  "rollup-plugin-preserve-use-client": "^1.0.0",
30
30
  "tailwind-merge": "^2.5.5",
31
31
  "next": "15.1.6",
32
- "@ichaingo/image": "1.3.85",
33
- "@ichaingo/better-link": "1.3.85",
34
- "@ichaingo/auth": "1.3.85",
35
- "@ichaingo/link": "1.3.85",
36
- "@ichaingo/avatar": "1.3.85",
37
- "@ichaingo/translation": "1.3.85",
38
- "@ichaingo/theme-toggle": "1.3.85",
39
- "@ichaingo/providers": "1.3.85",
40
- "@ichaingo/request": "1.3.85",
41
- "@ichaingo/ui": "1.3.85",
42
- "@ichaingo/i18n": "1.3.85",
43
- "@ichaingo/iconfont": "1.3.85"
32
+ "@ichaingo/image": "1.3.87",
33
+ "@ichaingo/better-link": "1.3.87",
34
+ "@ichaingo/auth": "1.3.87",
35
+ "@ichaingo/translation": "1.3.87",
36
+ "@ichaingo/ui": "1.3.87",
37
+ "@ichaingo/avatar": "1.3.87",
38
+ "@ichaingo/link": "1.3.87",
39
+ "@ichaingo/providers": "1.3.87",
40
+ "@ichaingo/request": "1.3.87",
41
+ "@ichaingo/i18n": "1.3.87",
42
+ "@ichaingo/iconfont": "1.3.87",
43
+ "@ichaingo/theme-toggle": "1.3.87"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/js-cookie": "^3.0.6"