@burdenoff/microfe-comradecircle 2026.704.1 → 2026.704.3

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.
Files changed (54) hide show
  1. package/dist/comradecircle/components/Avatar.js +52 -17
  2. package/dist/comradecircle/components/Avatar.js.map +1 -1
  3. package/dist/comradecircle/components/AvatarUploadField.js +91 -0
  4. package/dist/comradecircle/components/AvatarUploadField.js.map +1 -0
  5. package/dist/comradecircle/components/CircleCard.js +55 -52
  6. package/dist/comradecircle/components/CircleCard.js.map +1 -1
  7. package/dist/comradecircle/components/CommentThread.js +80 -64
  8. package/dist/comradecircle/components/CommentThread.js.map +1 -1
  9. package/dist/comradecircle/components/CreateCircleDialog.js +74 -63
  10. package/dist/comradecircle/components/CreateCircleDialog.js.map +1 -1
  11. package/dist/comradecircle/components/EventCard.js +84 -58
  12. package/dist/comradecircle/components/EventCard.js.map +1 -1
  13. package/dist/comradecircle/components/FileImage.js +20 -0
  14. package/dist/comradecircle/components/FileImage.js.map +1 -0
  15. package/dist/comradecircle/components/ImageAttachments.js +97 -0
  16. package/dist/comradecircle/components/ImageAttachments.js.map +1 -0
  17. package/dist/comradecircle/components/MemberIdentity.js +4 -2
  18. package/dist/comradecircle/components/MemberIdentity.js.map +1 -1
  19. package/dist/comradecircle/components/PollCard.js +65 -44
  20. package/dist/comradecircle/components/PollCard.js.map +1 -1
  21. package/dist/comradecircle/components/PostCard.js +8 -15
  22. package/dist/comradecircle/components/PostCard.js.map +1 -1
  23. package/dist/comradecircle/components/PostComposer.js +45 -35
  24. package/dist/comradecircle/components/PostComposer.js.map +1 -1
  25. package/dist/comradecircle/components/ReactionBar.js +1 -1
  26. package/dist/comradecircle/components/ReactionBar.js.map +1 -1
  27. package/dist/comradecircle/components/StateViews.js +1 -16
  28. package/dist/comradecircle/components/StateViews.js.map +1 -1
  29. package/dist/comradecircle/components/StatusBadge.js +1 -1
  30. package/dist/comradecircle/components/StatusBadge.js.map +1 -1
  31. package/dist/comradecircle/hooks/index.js +1 -0
  32. package/dist/comradecircle/hooks/useComradeCircleApi.js +244 -241
  33. package/dist/comradecircle/hooks/useComradeCircleApi.js.map +1 -1
  34. package/dist/comradecircle/hooks/useFiles.js +78 -0
  35. package/dist/comradecircle/hooks/useFiles.js.map +1 -0
  36. package/dist/comradecircle/lib/graphql-cache.js +9 -0
  37. package/dist/comradecircle/lib/graphql-cache.js.map +1 -0
  38. package/dist/comradecircle/pages/FeedPage.js +79 -33
  39. package/dist/comradecircle/pages/FeedPage.js.map +1 -1
  40. package/dist/comradecircle/pages/circles/CircleDetailPage.js +354 -242
  41. package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -1
  42. package/dist/comradecircle/pages/circles/CirclesPage.js +97 -47
  43. package/dist/comradecircle/pages/circles/CirclesPage.js.map +1 -1
  44. package/dist/comradecircle/pages/events/EventDetailPage.js +193 -126
  45. package/dist/comradecircle/pages/events/EventDetailPage.js.map +1 -1
  46. package/dist/comradecircle/pages/events/EventsPage.js +74 -34
  47. package/dist/comradecircle/pages/events/EventsPage.js.map +1 -1
  48. package/dist/comradecircle/pages/members/MemberProfilePage.js +154 -81
  49. package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -1
  50. package/dist/comradecircle/pages/members/MembersPage.js +141 -71
  51. package/dist/comradecircle/pages/members/MembersPage.js.map +1 -1
  52. package/dist/comradecircle/pages/profile/MyProfilePage.js +298 -191
  53. package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -1
  54. package/package.json +1 -1
@@ -13,111 +13,119 @@ import { PostCard as b } from "../../components/PostCard.js";
13
13
  import { EmptyState as x } from "../../components/EmptyState.js";
14
14
  import { ErrorView as S, LoadingView as C } from "../../components/StateViews.js";
15
15
  import { Pagination as w } from "../../components/Pagination.js";
16
- import { slugify as T } from "../../utils/slug.js";
17
- import { StatusBadge as E } from "../../components/StatusBadge.js";
18
- import { Tabs as ee } from "../../components/Tabs.js";
19
- import { PostComposer as D } from "../../components/PostComposer.js";
20
- import { EventCard as te } from "../../components/EventCard.js";
21
- import { PollCard as ne } from "../../components/PollCard.js";
22
- import { CreateEventDialog as re } from "../../components/CreateEventDialog.js";
23
- import { useMemo as O, useState as k } from "react";
24
- import { ArrowLeft as ie, BarChart3 as A, CalendarDays as j, Hash as M, Info as ae, Megaphone as oe, MessageCircle as se, MessagesSquare as ce, Mic as le, Plus as N, Users as P } from "lucide-react";
16
+ import { slugify as ee } from "../../utils/slug.js";
17
+ import { StatusBadge as T } from "../../components/StatusBadge.js";
18
+ import { Tabs as te } from "../../components/Tabs.js";
19
+ import { PostComposer as E } from "../../components/PostComposer.js";
20
+ import { EventCard as ne } from "../../components/EventCard.js";
21
+ import { PollCard as re } from "../../components/PollCard.js";
22
+ import { CreateEventDialog as ie } from "../../components/CreateEventDialog.js";
23
+ import { useMemo as D, useState as O } from "react";
24
+ import { ArrowLeft as ae, BarChart3 as k, CalendarDays as A, Hash as j, Info as oe, Megaphone as M, MessageCircle as se, MessagesSquare as ce, Mic as N, Plus as P, Search as le, Users as F } from "lucide-react";
25
25
  import { useParams as ue } from "react-router-dom";
26
- import { Fragment as de, jsx as F, jsxs as I } from "react/jsx-runtime";
27
- import { Button as L, Input as R, Label as z, ResponsiveDialog as B, ResponsiveDialogContent as V, ResponsiveDialogDescription as H, ResponsiveDialogFooter as U, ResponsiveDialogHeader as W, ResponsiveDialogTitle as G, Select as K, SelectContent as q, SelectItem as J, SelectTrigger as Y, SelectValue as X, Textarea as fe } from "@burdenoff/fe-libs/ui";
26
+ import { Fragment as de, jsx as I, jsxs as L } from "react/jsx-runtime";
27
+ import { Button as R, GradientText as fe, Input as z, Label as B, ResponsiveDialog as V, ResponsiveDialogContent as H, ResponsiveDialogDescription as U, ResponsiveDialogFooter as W, ResponsiveDialogHeader as G, ResponsiveDialogTitle as K, Select as q, SelectContent as J, SelectItem as Y, SelectTrigger as X, SelectValue as Z, Switch as Q, Textarea as pe } from "@burdenoff/fe-libs/ui";
28
28
  //#region src/comradecircle/pages/circles/CircleDetailPage.tsx
29
- var Z = {
30
- TEXT: M,
29
+ var me = {
30
+ TEXT: j,
31
31
  FORUM: ce,
32
- ANNOUNCEMENT: oe,
33
- VOICE: le
34
- }, pe = ["OWNER", "ADMIN"], Q = [
32
+ ANNOUNCEMENT: M,
33
+ VOICE: N
34
+ }, he = ["OWNER", "ADMIN"], $ = [
35
35
  "OWNER",
36
36
  "ADMIN",
37
37
  "MODERATOR",
38
38
  "MEMBER"
39
- ], me = 15;
40
- function he() {
41
- let { id: t } = ue(), { currentUser: i, navigateTo: a } = e(), { data: o, isLoading: l, isError: u, refetch: d } = r(t), f = s(), m = c(), [_, v] = k("channels"), b = O(() => o?.memberships?.find((e) => e.memberId === i?.id && e.status === "ACTIVE"), [o, i]), x = !!b, w = b ? pe.includes(b.role) : !1;
42
- if (l) return /* @__PURE__ */ F(n, {
39
+ ], ge = 15;
40
+ function _e() {
41
+ let { id: t } = ue(), { currentUser: i, navigateTo: a } = e(), { data: o, isLoading: l, isError: u, refetch: d } = r(t), f = s(), m = c(), [_, v] = O("channels"), b = D(() => o?.memberships?.find((e) => e.memberId === i?.id && e.status === "ACTIVE"), [o, i]), x = !!b, w = b ? he.includes(b.role) : !1;
42
+ if (l) return /* @__PURE__ */ I(n, {
43
43
  title: "Circle",
44
- children: /* @__PURE__ */ F(C, { label: "Loading circle…" })
44
+ children: /* @__PURE__ */ I(C, { label: "Loading circle…" })
45
45
  });
46
- if (u || !o) return /* @__PURE__ */ F(n, {
46
+ if (u || !o) return /* @__PURE__ */ I(n, {
47
47
  title: "Circle",
48
- children: /* @__PURE__ */ F(S, {
48
+ children: /* @__PURE__ */ I(S, {
49
49
  title: "Circle not found",
50
50
  message: "This circle may have been archived or you may not have access.",
51
51
  onRetry: () => d()
52
52
  })
53
53
  });
54
- let T = o.memberships?.filter((e) => e.status === "ACTIVE") ?? [], D = [
54
+ let ee = o.memberships?.filter((e) => e.status === "ACTIVE") ?? [], E = [
55
55
  {
56
56
  value: "channels",
57
57
  label: "Channels",
58
- icon: /* @__PURE__ */ F(M, { className: "h-4 w-4" }),
58
+ icon: /* @__PURE__ */ I(j, { className: "h-4 w-4" }),
59
59
  count: o.channels?.length ?? 0
60
60
  },
61
61
  {
62
62
  value: "members",
63
63
  label: "Members",
64
- icon: /* @__PURE__ */ F(P, { className: "h-4 w-4" }),
65
- count: T.length
64
+ icon: /* @__PURE__ */ I(F, { className: "h-4 w-4" }),
65
+ count: ee.length
66
66
  },
67
67
  {
68
68
  value: "events",
69
69
  label: "Events",
70
- icon: /* @__PURE__ */ F(j, { className: "h-4 w-4" })
70
+ icon: /* @__PURE__ */ I(A, { className: "h-4 w-4" })
71
71
  },
72
72
  {
73
73
  value: "polls",
74
74
  label: "Polls",
75
- icon: /* @__PURE__ */ F(A, { className: "h-4 w-4" })
75
+ icon: /* @__PURE__ */ I(k, { className: "h-4 w-4" })
76
76
  },
77
77
  {
78
78
  value: "about",
79
79
  label: "About",
80
- icon: /* @__PURE__ */ F(ae, { className: "h-4 w-4" })
80
+ icon: /* @__PURE__ */ I(oe, { className: "h-4 w-4" })
81
81
  }
82
82
  ];
83
- return /* @__PURE__ */ I(n, {
84
- title: /* @__PURE__ */ I("span", {
83
+ return /* @__PURE__ */ L(n, {
84
+ title: /* @__PURE__ */ L("span", {
85
85
  className: "flex items-center gap-3",
86
- children: [/* @__PURE__ */ F(p, {
86
+ children: [/* @__PURE__ */ I(p, {
87
87
  name: o.name,
88
- size: "md"
89
- }), o.name]
88
+ size: "lg",
89
+ fileId: o.avatar?.id,
90
+ seed: o.id,
91
+ ring: !0
92
+ }), /* @__PURE__ */ I(fe, {
93
+ as: "span",
94
+ className: "text-2xl font-semibold tracking-tight",
95
+ children: o.name
96
+ })]
90
97
  }),
91
98
  description: o.topic ?? void 0,
92
- actions: /* @__PURE__ */ I("div", {
99
+ aurora: !0,
100
+ actions: /* @__PURE__ */ L("div", {
93
101
  className: "flex items-center gap-2",
94
- children: [/* @__PURE__ */ I(L, {
102
+ children: [/* @__PURE__ */ L(R, {
95
103
  variant: "ghost",
96
104
  size: "sm",
97
105
  onClick: () => a("circles"),
98
- children: [/* @__PURE__ */ F(ie, { className: "mr-1.5 h-4 w-4" }), " Back"]
99
- }), x ? /* @__PURE__ */ F(L, {
106
+ children: [/* @__PURE__ */ I(ae, { className: "mr-1.5 h-4 w-4" }), " Back"]
107
+ }), x ? /* @__PURE__ */ I(R, {
100
108
  variant: "outline",
101
109
  onClick: () => m.mutateAsync(o.id).then(() => g.success("Left circle")).catch((e) => g.error("Could not leave", h(e))),
102
110
  disabled: m.isPending,
103
111
  children: "Leave"
104
- }) : o.status === "ACTIVE" ? /* @__PURE__ */ F(L, {
112
+ }) : o.status === "ACTIVE" ? /* @__PURE__ */ I(R, {
105
113
  onClick: () => f.mutateAsync(o.id).then(() => g.success("Joined circle")).catch((e) => g.error("Could not join", h(e))),
106
114
  disabled: f.isPending,
107
115
  children: "Join circle"
108
116
  }) : null]
109
117
  }),
110
118
  children: [
111
- /* @__PURE__ */ I("div", {
119
+ /* @__PURE__ */ L("div", {
112
120
  className: "mb-4 flex flex-wrap items-center gap-2",
113
121
  children: [
114
- /* @__PURE__ */ F(E, { status: o.visibility }),
115
- o.status !== "ACTIVE" && /* @__PURE__ */ F(E, { status: o.status }),
116
- b && /* @__PURE__ */ F(E, { status: b.role }),
117
- /* @__PURE__ */ I("span", {
122
+ /* @__PURE__ */ I(T, { status: o.visibility }),
123
+ o.status !== "ACTIVE" && /* @__PURE__ */ I(T, { status: o.status }),
124
+ b && /* @__PURE__ */ I(T, { status: b.role }),
125
+ /* @__PURE__ */ L("span", {
118
126
  className: "inline-flex items-center gap-1 text-sm text-text-tertiary",
119
127
  children: [
120
- /* @__PURE__ */ F(P, { className: "h-4 w-4" }),
128
+ /* @__PURE__ */ I(F, { className: "h-4 w-4" }),
121
129
  " ",
122
130
  y(o.memberCount),
123
131
  " members"
@@ -125,75 +133,76 @@ function he() {
125
133
  })
126
134
  ]
127
135
  }),
128
- /* @__PURE__ */ F(ee, {
129
- items: D,
136
+ /* @__PURE__ */ I(te, {
137
+ items: E,
130
138
  value: _,
131
139
  onChange: v,
132
140
  className: "mb-5"
133
141
  }),
134
- _ === "channels" && /* @__PURE__ */ F(ge, {
142
+ _ === "channels" && /* @__PURE__ */ I(ve, {
135
143
  circle: o,
136
144
  isMember: x,
137
145
  canManage: w
138
146
  }),
139
- _ === "members" && /* @__PURE__ */ F(ve, {
147
+ _ === "members" && /* @__PURE__ */ I(be, {
140
148
  circle: o,
141
149
  canManage: w
142
150
  }),
143
- _ === "events" && /* @__PURE__ */ F(ye, {
151
+ _ === "events" && /* @__PURE__ */ I(xe, {
144
152
  circle: o,
145
153
  isMember: x
146
154
  }),
147
- _ === "polls" && /* @__PURE__ */ F(be, {
155
+ _ === "polls" && /* @__PURE__ */ I(Se, {
148
156
  circle: o,
149
157
  isMember: x,
150
158
  canManage: w
151
159
  }),
152
- _ === "about" && /* @__PURE__ */ F(xe, { circle: o })
160
+ _ === "about" && /* @__PURE__ */ I(Ce, { circle: o })
153
161
  ]
154
162
  });
155
163
  }
156
- function ge({ circle: e, isMember: n, canManage: r }) {
157
- let i = O(() => [...e.channels ?? []].sort((e, t) => e.position - t.position), [e.channels]), [a, o] = k(i[0]?.id), [s, c] = k(!1), l = i.find((e) => e.id === a) ?? i[0];
158
- return i.length === 0 ? /* @__PURE__ */ I(de, { children: [/* @__PURE__ */ F(x, {
159
- icon: /* @__PURE__ */ F(M, { className: "h-10 w-10" }),
164
+ function ve({ circle: e, isMember: n, canManage: r }) {
165
+ let i = D(() => [...e.channels ?? []].sort((e, t) => e.position - t.position), [e.channels]), [a, o] = O(i[0]?.id), [s, c] = O(!1), l = i.find((e) => e.id === a) ?? i[0];
166
+ return i.length === 0 ? /* @__PURE__ */ L(de, { children: [/* @__PURE__ */ I(x, {
167
+ icon: /* @__PURE__ */ I(j, { className: "h-10 w-10" }),
160
168
  title: "No channels yet",
161
169
  description: r ? "Create the first channel to start conversations in this circle." : "This circle has no channels yet. Check back soon.",
162
- action: r ? /* @__PURE__ */ I(L, {
170
+ action: r ? /* @__PURE__ */ L(R, {
163
171
  onClick: () => c(!0),
164
- children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New channel"]
172
+ children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New channel"]
165
173
  }) : void 0
166
- }), /* @__PURE__ */ F($, {
174
+ }), /* @__PURE__ */ I(Te, {
167
175
  circleId: e.id,
168
176
  open: s,
169
177
  onOpenChange: c,
170
178
  onCreated: (e) => o(e.id)
171
- })] }) : /* @__PURE__ */ I("div", {
179
+ })] }) : /* @__PURE__ */ L("div", {
172
180
  className: "grid gap-5 lg:grid-cols-[220px_1fr]",
173
181
  children: [
174
- /* @__PURE__ */ I("aside", {
182
+ /* @__PURE__ */ L("aside", {
175
183
  className: "hidden lg:block",
176
- children: [/* @__PURE__ */ I("div", {
184
+ children: [/* @__PURE__ */ L("div", {
177
185
  className: "mb-2 flex items-center justify-between",
178
- children: [/* @__PURE__ */ F("h3", {
186
+ children: [/* @__PURE__ */ I("h3", {
179
187
  className: "text-xs font-semibold uppercase tracking-wide text-text-tertiary",
180
188
  children: "Channels"
181
- }), r && /* @__PURE__ */ F("button", {
189
+ }), r && /* @__PURE__ */ I("button", {
182
190
  type: "button",
183
191
  onClick: () => c(!0),
184
192
  "aria-label": "New channel",
185
193
  className: "rounded-md p-1 text-text-tertiary hover:bg-bg-sunken hover:text-text-primary",
186
- children: /* @__PURE__ */ F(N, { className: "h-4 w-4" })
194
+ children: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
187
195
  })]
188
- }), /* @__PURE__ */ F("nav", {
196
+ }), /* @__PURE__ */ I("nav", {
189
197
  className: "flex flex-col gap-0.5",
190
198
  children: i.map((e) => {
191
- let n = Z[e.type];
192
- return /* @__PURE__ */ I("button", {
199
+ let n = me[e.type], r = e.id === l?.id;
200
+ return /* @__PURE__ */ L("button", {
193
201
  type: "button",
194
202
  onClick: () => o(e.id),
195
- className: t("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors", e.id === l?.id ? "bg-[var(--color-accent-soft)] font-medium text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
196
- children: [/* @__PURE__ */ F(n, { className: "h-4 w-4 shrink-0 text-text-tertiary" }), /* @__PURE__ */ F("span", {
203
+ "aria-current": r ? "true" : void 0,
204
+ className: t("flex items-center gap-2 rounded-lg border-l-2 px-2.5 py-1.5 text-left text-sm transition-all", r ? "border-[color:var(--color-accent)] bg-[var(--color-accent-soft)] font-medium text-text-primary shadow-sm" : "border-transparent text-text-secondary hover:bg-bg-sunken hover:text-text-primary motion-safe:hover:translate-x-0.5"),
205
+ children: [/* @__PURE__ */ I(n, { className: t("h-4 w-4 shrink-0", r ? "text-accent" : "text-text-tertiary") }), /* @__PURE__ */ I("span", {
197
206
  className: "truncate",
198
207
  children: e.name
199
208
  })]
@@ -201,34 +210,35 @@ function ge({ circle: e, isMember: n, canManage: r }) {
201
210
  })
202
211
  })]
203
212
  }),
204
- /* @__PURE__ */ F("div", {
213
+ /* @__PURE__ */ I("div", {
205
214
  className: "lg:hidden",
206
- children: /* @__PURE__ */ I("div", {
215
+ children: /* @__PURE__ */ L("div", {
207
216
  className: "flex items-center gap-2",
208
- children: [/* @__PURE__ */ I(K, {
217
+ children: [/* @__PURE__ */ L(q, {
209
218
  value: l?.id,
210
219
  onValueChange: o,
211
- children: [/* @__PURE__ */ F(Y, { children: /* @__PURE__ */ F(X, { placeholder: "Select a channel" }) }), /* @__PURE__ */ F(q, { children: i.map((e) => /* @__PURE__ */ I(J, {
220
+ children: [/* @__PURE__ */ I(X, { children: /* @__PURE__ */ I(Z, { placeholder: "Select a channel" }) }), /* @__PURE__ */ I(J, { children: i.map((e) => /* @__PURE__ */ L(Y, {
212
221
  value: e.id,
213
222
  children: ["#", e.name]
214
223
  }, e.id)) })]
215
- }), r && /* @__PURE__ */ F(L, {
224
+ }), r && /* @__PURE__ */ I(R, {
216
225
  variant: "outline",
217
226
  size: "icon",
218
227
  onClick: () => c(!0),
219
228
  "aria-label": "New channel",
220
- children: /* @__PURE__ */ F(N, { className: "h-4 w-4" })
229
+ children: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
221
230
  })]
222
231
  })
223
232
  }),
224
- /* @__PURE__ */ F("div", {
233
+ /* @__PURE__ */ I("div", {
225
234
  className: "min-w-0",
226
- children: l && /* @__PURE__ */ F(_e, {
235
+ children: l && /* @__PURE__ */ I(ye, {
227
236
  channel: l,
228
- canPost: n
237
+ canPost: n,
238
+ canManage: r
229
239
  })
230
240
  }),
231
- /* @__PURE__ */ F($, {
241
+ /* @__PURE__ */ I(Te, {
232
242
  circleId: e.id,
233
243
  open: s,
234
244
  onOpenChange: c,
@@ -237,216 +247,266 @@ function ge({ circle: e, isMember: n, canManage: r }) {
237
247
  ]
238
248
  });
239
249
  }
240
- function _e({ channel: e, canPost: t }) {
241
- let n = f(), { data: r, isLoading: i, isError: a, refetch: o } = u({
250
+ function ye({ channel: e, canPost: t, canManage: n }) {
251
+ let r = f(), { data: i, isLoading: a, isError: o, refetch: s } = u({
242
252
  channelId: e.id,
243
253
  status: "PUBLISHED",
244
254
  pagination: {
245
- limit: me,
246
- cursor: n.cursor
255
+ limit: ge,
256
+ cursor: r.cursor
247
257
  }
248
- }), s = r?.items ?? [], c = t && e.type !== "ANNOUNCEMENT" && e.type !== "VOICE";
249
- return /* @__PURE__ */ I("div", {
258
+ }), c = i?.items ?? [], l = e.type === "VOICE" ? !1 : e.type === "ANNOUNCEMENT" ? n : t;
259
+ return /* @__PURE__ */ L("div", {
250
260
  className: "flex flex-col gap-4",
251
261
  children: [
252
- /* @__PURE__ */ I("div", {
253
- className: "flex items-center gap-2",
262
+ /* @__PURE__ */ L("div", {
263
+ className: "flex items-center gap-3",
254
264
  children: [(() => {
255
- let t = Z[e.type];
256
- return /* @__PURE__ */ F(t, { className: "h-5 w-5 text-text-tertiary" });
257
- })(), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("h2", {
258
- className: "text-lg font-semibold text-text-primary",
259
- children: e.name
260
- }), e.description && /* @__PURE__ */ F("p", {
261
- className: "text-sm text-text-secondary",
262
- children: e.description
263
- })] })]
265
+ let t = me[e.type];
266
+ return /* @__PURE__ */ I("span", {
267
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-accent",
268
+ children: /* @__PURE__ */ I(t, { className: "h-5 w-5" })
269
+ });
270
+ })(), /* @__PURE__ */ L("div", {
271
+ className: "min-w-0",
272
+ children: [/* @__PURE__ */ I("h2", {
273
+ className: "text-lg font-semibold text-text-primary",
274
+ children: e.name
275
+ }), e.description && /* @__PURE__ */ I("p", {
276
+ className: "text-sm text-text-secondary",
277
+ children: e.description
278
+ })]
279
+ })]
264
280
  }),
265
- c && /* @__PURE__ */ F(D, {
281
+ l && /* @__PURE__ */ I(E, {
266
282
  channelId: e.id,
267
283
  channelName: e.name,
268
- onPosted: () => n.reset()
284
+ onPosted: () => r.reset()
285
+ }),
286
+ e.type === "ANNOUNCEMENT" && !l && /* @__PURE__ */ L("div", {
287
+ className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
288
+ children: [/* @__PURE__ */ I(M, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), "Only circle managers can post in announcement channels."]
269
289
  }),
270
- e.type === "VOICE" && /* @__PURE__ */ I("div", {
290
+ e.type === "VOICE" && /* @__PURE__ */ L("div", {
271
291
  className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
272
- children: [/* @__PURE__ */ F(le, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), "Voice channels are for live audio. Text posting is disabled here."]
292
+ children: [/* @__PURE__ */ I(N, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), "Voice channels are for live audio. Text posting is disabled here."]
273
293
  }),
274
- i ? /* @__PURE__ */ F(C, { label: "Loading posts…" }) : a ? /* @__PURE__ */ F(S, {
294
+ a ? /* @__PURE__ */ I(C, { label: "Loading posts…" }) : o ? /* @__PURE__ */ I(S, {
275
295
  message: "We couldn't load posts.",
276
- onRetry: () => o()
277
- }) : s.length === 0 ? /* @__PURE__ */ F(x, {
278
- icon: /* @__PURE__ */ F(se, { className: "h-9 w-9" }),
296
+ onRetry: () => s()
297
+ }) : c.length === 0 ? /* @__PURE__ */ I(x, {
298
+ icon: /* @__PURE__ */ I(se, { className: "h-9 w-9" }),
279
299
  title: "No posts yet",
280
- description: c ? "Be the first to post in this channel." : "Nothing has been posted here yet."
281
- }) : /* @__PURE__ */ I("div", {
300
+ description: l ? "Be the first to post in this channel." : "Nothing has been posted here yet."
301
+ }) : /* @__PURE__ */ L("div", {
282
302
  className: "flex flex-col gap-4",
283
- children: [s.map((e) => /* @__PURE__ */ F(b, { post: e }, e.id)), /* @__PURE__ */ F(w, {
284
- page: n.page,
285
- pageSize: me,
286
- itemCount: s.length,
287
- hasMore: r?.pageInfo.hasMore ?? !1,
288
- onPageChange: (e) => n.onPageChange(e, r?.pageInfo.cursor)
303
+ children: [c.map((e) => /* @__PURE__ */ I(b, { post: e }, e.id)), /* @__PURE__ */ I(w, {
304
+ page: r.page,
305
+ pageSize: ge,
306
+ itemCount: c.length,
307
+ hasMore: i?.pageInfo.hasMore ?? !1,
308
+ onPageChange: (e) => r.onPageChange(e, i?.pageInfo.cursor)
289
309
  })]
290
310
  })
291
311
  ]
292
312
  });
293
313
  }
294
- function ve({ circle: e, canManage: t }) {
295
- let n = d(), r = O(() => [...e.memberships ?? []].sort((e, t) => Q.indexOf(e.role) - Q.indexOf(t.role)), [e.memberships]);
296
- if (r.length === 0) return /* @__PURE__ */ F(x, {
297
- icon: /* @__PURE__ */ F(P, { className: "h-9 w-9" }),
314
+ function be({ circle: e, canManage: n }) {
315
+ let r = d(), [i, a] = O(""), o = D(() => [...e.memberships ?? []].sort((e, t) => $.indexOf(e.role) - $.indexOf(t.role)), [e.memberships]), s = D(() => {
316
+ let e = i.trim().toLowerCase();
317
+ return e ? o.filter((t) => v(t.role).toLowerCase().includes(e) || t.role.toLowerCase().includes(e) || v(t.status).toLowerCase().includes(e) || t.status.toLowerCase().includes(e)) : o;
318
+ }, [o, i]);
319
+ if (o.length === 0) return /* @__PURE__ */ I(x, {
320
+ icon: /* @__PURE__ */ I(F, { className: "h-9 w-9" }),
298
321
  title: "No members yet"
299
322
  });
300
- let i = async (t, r) => {
323
+ let c = async (t, n) => {
301
324
  try {
302
- await n.mutateAsync({
325
+ await r.mutateAsync({
303
326
  membershipId: t,
304
- role: r,
327
+ role: n,
305
328
  circleId: e.id
306
329
  }), g.success("Role updated");
307
330
  } catch (e) {
308
331
  g.error("Could not update role", h(e));
309
332
  }
310
- };
311
- return /* @__PURE__ */ F("div", {
312
- className: "flex flex-col gap-2",
313
- children: r.map((e) => /* @__PURE__ */ I("div", {
314
- className: "flex items-center justify-between gap-3 rounded-xl border border-border-seam bg-bg-surface px-4 py-2.5",
315
- children: [/* @__PURE__ */ F(m, {
316
- memberId: e.memberId,
317
- variant: "row",
318
- size: "md",
319
- showPresence: !0
320
- }), /* @__PURE__ */ I("div", {
321
- className: "flex items-center gap-2",
322
- children: [/* @__PURE__ */ F(E, { status: e.status }), t ? /* @__PURE__ */ I(K, {
323
- value: e.role,
324
- onValueChange: (t) => i(e.id, t),
325
- children: [/* @__PURE__ */ F(Y, {
326
- className: "h-8 w-32",
327
- children: /* @__PURE__ */ F(X, {})
328
- }), /* @__PURE__ */ F(q, { children: Q.map((e) => /* @__PURE__ */ F(J, {
329
- value: e,
330
- children: v(e)
331
- }, e)) })]
332
- }) : /* @__PURE__ */ F(E, { status: e.role })]
333
+ }, l = n ? "lg:grid-cols-[minmax(0,1fr)_120px_120px_190px]" : "lg:grid-cols-[minmax(0,1fr)_120px_120px]";
334
+ return /* @__PURE__ */ L("div", {
335
+ className: "flex flex-col gap-4",
336
+ children: [/* @__PURE__ */ L("div", {
337
+ className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
338
+ children: [/* @__PURE__ */ L("div", {
339
+ className: "relative w-full sm:max-w-xs",
340
+ children: [/* @__PURE__ */ I(le, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ I(z, {
341
+ value: i,
342
+ onChange: (e) => a(e.target.value),
343
+ placeholder: "Filter by role or status…",
344
+ className: "pl-9",
345
+ "aria-label": "Filter members by role or status"
346
+ })]
347
+ }), /* @__PURE__ */ I("span", {
348
+ className: "text-sm text-text-tertiary",
349
+ children: s.length === o.length ? `${y(o.length)} member${o.length === 1 ? "" : "s"}` : `${y(s.length)} of ${y(o.length)}`
333
350
  })]
334
- }, e.id))
351
+ }), /* @__PURE__ */ L("div", {
352
+ className: "overflow-hidden rounded-2xl border border-border-seam bg-bg-surface",
353
+ children: [/* @__PURE__ */ L("div", {
354
+ className: t("hidden border-b border-border-seam px-5 py-3 text-xs font-semibold uppercase tracking-wide text-text-tertiary lg:grid lg:items-center lg:gap-4", l),
355
+ children: [
356
+ /* @__PURE__ */ I("span", { children: "Member" }),
357
+ /* @__PURE__ */ I("span", { children: "Status" }),
358
+ /* @__PURE__ */ I("span", { children: "Role" }),
359
+ n && /* @__PURE__ */ I("span", { children: "Manage role" })
360
+ ]
361
+ }), s.length === 0 ? /* @__PURE__ */ L("div", {
362
+ className: "px-5 py-10 text-center text-sm text-text-secondary",
363
+ children: [
364
+ "No members match “",
365
+ i.trim(),
366
+ "”."
367
+ ]
368
+ }) : s.map((e) => /* @__PURE__ */ L("div", {
369
+ className: t("flex flex-col gap-3 border-b border-border-seam px-5 py-4 last:border-b-0 motion-safe:transition-colors hover:bg-bg-sunken/60 lg:grid lg:items-center lg:gap-4", l),
370
+ children: [/* @__PURE__ */ I(m, {
371
+ memberId: e.memberId,
372
+ variant: "row",
373
+ size: "md",
374
+ showPresence: !0
375
+ }), /* @__PURE__ */ L("div", {
376
+ className: "flex flex-wrap items-center gap-2 lg:contents",
377
+ children: [
378
+ /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I(T, { status: e.status }) }),
379
+ /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I(T, { status: e.role }) }),
380
+ n && /* @__PURE__ */ L(q, {
381
+ value: e.role,
382
+ onValueChange: (t) => c(e.id, t),
383
+ children: [/* @__PURE__ */ I(X, {
384
+ className: "h-9 w-40 lg:w-full",
385
+ children: /* @__PURE__ */ I(Z, {})
386
+ }), /* @__PURE__ */ I(J, { children: $.map((e) => /* @__PURE__ */ I(Y, {
387
+ value: e,
388
+ children: v(e)
389
+ }, e)) })]
390
+ })
391
+ ]
392
+ })]
393
+ }, e.id))]
394
+ })]
335
395
  });
336
396
  }
337
- function ye({ circle: t, isMember: n }) {
338
- let { navigateTo: r } = e(), { data: i, isLoading: a, isError: s, refetch: c } = o({ circleId: t.id }), [l, u] = k(!1), d = i?.items ?? [];
339
- return /* @__PURE__ */ I("div", { children: [
340
- /* @__PURE__ */ F("div", {
397
+ function xe({ circle: t, isMember: n }) {
398
+ let { navigateTo: r } = e(), { data: i, isLoading: a, isError: s, refetch: c } = o({ circleId: t.id }), [l, u] = O(!1), d = i?.items ?? [];
399
+ return /* @__PURE__ */ L("div", { children: [
400
+ /* @__PURE__ */ I("div", {
341
401
  className: "mb-4 flex items-center justify-end",
342
- children: n && /* @__PURE__ */ I(L, {
402
+ children: n && /* @__PURE__ */ L(R, {
343
403
  onClick: () => u(!0),
344
- children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New event"]
404
+ children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New event"]
345
405
  })
346
406
  }),
347
- a ? /* @__PURE__ */ F(C, { label: "Loading events…" }) : s ? /* @__PURE__ */ F(S, { onRetry: () => c() }) : d.length === 0 ? /* @__PURE__ */ F(x, {
348
- icon: /* @__PURE__ */ F(j, { className: "h-9 w-9" }),
407
+ a ? /* @__PURE__ */ I(C, { label: "Loading events…" }) : s ? /* @__PURE__ */ I(S, { onRetry: () => c() }) : d.length === 0 ? /* @__PURE__ */ I(x, {
408
+ icon: /* @__PURE__ */ I(A, { className: "h-9 w-9" }),
349
409
  title: "No events scheduled",
350
410
  description: n ? "Schedule the first event for this circle." : "No upcoming events.",
351
- action: n ? /* @__PURE__ */ I(L, {
411
+ action: n ? /* @__PURE__ */ L(R, {
352
412
  onClick: () => u(!0),
353
- children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New event"]
413
+ children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New event"]
354
414
  }) : void 0
355
- }) : /* @__PURE__ */ F("div", {
415
+ }) : /* @__PURE__ */ I("div", {
356
416
  className: "grid gap-4 md:grid-cols-2",
357
- children: d.map((e) => /* @__PURE__ */ F(te, {
417
+ children: d.map((e) => /* @__PURE__ */ I(ne, {
358
418
  event: e,
359
419
  onOpen: () => r(`events/${e.id}`)
360
420
  }, e.id))
361
421
  }),
362
- /* @__PURE__ */ F(re, {
422
+ /* @__PURE__ */ I(ie, {
363
423
  circleId: t.id,
364
424
  open: l,
365
425
  onOpenChange: u
366
426
  })
367
427
  ] });
368
428
  }
369
- function be({ circle: e, isMember: t, canManage: n }) {
370
- let { data: r, isLoading: i, isError: a, refetch: o } = l(e.id), [s, c] = k(!1);
371
- return /* @__PURE__ */ I("div", { children: [
372
- /* @__PURE__ */ F("div", {
429
+ function Se({ circle: e, isMember: t, canManage: n }) {
430
+ let { data: r, isLoading: i, isError: a, refetch: o } = l(e.id), [s, c] = O(!1);
431
+ return /* @__PURE__ */ L("div", { children: [
432
+ /* @__PURE__ */ I("div", {
373
433
  className: "mb-4 flex items-center justify-end",
374
- children: t && /* @__PURE__ */ I(L, {
434
+ children: t && /* @__PURE__ */ L(R, {
375
435
  onClick: () => c(!0),
376
- children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New poll"]
436
+ children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New poll"]
377
437
  })
378
438
  }),
379
- i ? /* @__PURE__ */ F(C, { label: "Loading polls…" }) : a ? /* @__PURE__ */ F(S, { onRetry: () => o() }) : (r ?? []).length === 0 ? /* @__PURE__ */ F(x, {
380
- icon: /* @__PURE__ */ F(A, { className: "h-9 w-9" }),
439
+ i ? /* @__PURE__ */ I(C, { label: "Loading polls…" }) : a ? /* @__PURE__ */ I(S, { onRetry: () => o() }) : (r ?? []).length === 0 ? /* @__PURE__ */ I(x, {
440
+ icon: /* @__PURE__ */ I(k, { className: "h-9 w-9" }),
381
441
  title: "No polls yet",
382
442
  description: t ? "Ask the circle a question with a poll." : "No polls have been created.",
383
- action: t ? /* @__PURE__ */ I(L, {
443
+ action: t ? /* @__PURE__ */ L(R, {
384
444
  onClick: () => c(!0),
385
- children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New poll"]
445
+ children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New poll"]
386
446
  }) : void 0
387
- }) : /* @__PURE__ */ F("div", {
447
+ }) : /* @__PURE__ */ I("div", {
388
448
  className: "mx-auto flex max-w-2xl flex-col gap-4",
389
- children: (r ?? []).map((e) => /* @__PURE__ */ F(ne, {
449
+ children: (r ?? []).map((e) => /* @__PURE__ */ I(re, {
390
450
  poll: e,
391
451
  canManage: n
392
452
  }, e.id))
393
453
  }),
394
- /* @__PURE__ */ F(Ce, {
454
+ /* @__PURE__ */ I(Ee, {
395
455
  circleId: e.id,
396
456
  open: s,
397
457
  onOpenChange: c
398
458
  })
399
459
  ] });
400
460
  }
401
- function xe({ circle: e }) {
402
- return /* @__PURE__ */ F("div", {
461
+ function Ce({ circle: e }) {
462
+ return /* @__PURE__ */ I("div", {
403
463
  className: "mx-auto max-w-2xl",
404
- children: /* @__PURE__ */ I("div", {
464
+ children: /* @__PURE__ */ L("div", {
405
465
  className: "rounded-2xl border border-border-seam bg-bg-surface p-6",
406
466
  children: [
407
- /* @__PURE__ */ F("h2", {
467
+ /* @__PURE__ */ I("h2", {
408
468
  className: "text-lg font-semibold text-text-primary",
409
469
  children: "About this circle"
410
470
  }),
411
- /* @__PURE__ */ F("p", {
471
+ /* @__PURE__ */ I("p", {
412
472
  className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
413
473
  children: e.description || "No description provided."
414
474
  }),
415
- e.tags.length > 0 && /* @__PURE__ */ F("div", {
475
+ e.tags.length > 0 && /* @__PURE__ */ I("div", {
416
476
  className: "mt-4 flex flex-wrap gap-1.5",
417
- children: e.tags.map((e) => /* @__PURE__ */ I("span", {
477
+ children: e.tags.map((e) => /* @__PURE__ */ L("span", {
418
478
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
419
479
  children: ["#", e]
420
480
  }, e))
421
481
  }),
422
- /* @__PURE__ */ I("dl", {
482
+ /* @__PURE__ */ L("dl", {
423
483
  className: "mt-6 grid grid-cols-2 gap-4 text-sm",
424
484
  children: [
425
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
485
+ /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
426
486
  className: "text-text-tertiary",
427
487
  children: "Visibility"
428
- }), /* @__PURE__ */ F("dd", {
488
+ }), /* @__PURE__ */ I("dd", {
429
489
  className: "mt-1 text-text-primary",
430
490
  children: v(e.visibility)
431
491
  })] }),
432
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
492
+ /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
433
493
  className: "text-text-tertiary",
434
494
  children: "Status"
435
- }), /* @__PURE__ */ F("dd", {
495
+ }), /* @__PURE__ */ I("dd", {
436
496
  className: "mt-1 text-text-primary",
437
497
  children: v(e.status)
438
498
  })] }),
439
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
499
+ /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
440
500
  className: "text-text-tertiary",
441
501
  children: "Members"
442
- }), /* @__PURE__ */ F("dd", {
502
+ }), /* @__PURE__ */ I("dd", {
443
503
  className: "mt-1 text-text-primary",
444
504
  children: y(e.memberCount)
445
505
  })] }),
446
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
506
+ /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
447
507
  className: "text-text-tertiary",
448
508
  children: "Created"
449
- }), /* @__PURE__ */ F("dd", {
509
+ }), /* @__PURE__ */ I("dd", {
450
510
  className: "mt-1 text-text-primary",
451
511
  children: _(e.createdAt)
452
512
  })] })
@@ -456,70 +516,70 @@ function xe({ circle: e }) {
456
516
  })
457
517
  });
458
518
  }
459
- var Se = [
519
+ var we = [
460
520
  "TEXT",
461
521
  "FORUM",
462
522
  "ANNOUNCEMENT",
463
523
  "VOICE"
464
524
  ];
465
- function $({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
466
- let a = i(), [o, s] = k(""), [c, l] = k(""), [u, d] = k("TEXT"), [f, p] = k(null);
467
- return /* @__PURE__ */ F(B, {
525
+ function Te({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
526
+ let a = i(), [o, s] = O(""), [c, l] = O(""), [u, d] = O("TEXT"), [f, p] = O(null);
527
+ return /* @__PURE__ */ I(V, {
468
528
  open: t,
469
529
  onOpenChange: n,
470
- children: /* @__PURE__ */ I(V, {
530
+ children: /* @__PURE__ */ L(H, {
471
531
  className: "sm:max-w-md",
472
532
  children: [
473
- /* @__PURE__ */ I(W, { children: [/* @__PURE__ */ F(G, { children: "Create a channel" }), /* @__PURE__ */ F(H, { children: "Channels organise conversations by topic or format." })] }),
474
- /* @__PURE__ */ I("div", {
533
+ /* @__PURE__ */ L(G, { children: [/* @__PURE__ */ I(K, { children: "Create a channel" }), /* @__PURE__ */ I(U, { children: "Channels organise conversations by topic or format." })] }),
534
+ /* @__PURE__ */ L("div", {
475
535
  className: "flex flex-col gap-4 py-2",
476
536
  children: [
477
- /* @__PURE__ */ I("div", {
537
+ /* @__PURE__ */ L("div", {
478
538
  className: "grid gap-1.5",
479
- children: [/* @__PURE__ */ F(z, {
539
+ children: [/* @__PURE__ */ I(B, {
480
540
  htmlFor: "channel-name",
481
541
  children: "Name"
482
- }), /* @__PURE__ */ F(R, {
542
+ }), /* @__PURE__ */ I(z, {
483
543
  id: "channel-name",
484
544
  value: o,
485
545
  onChange: (e) => s(e.target.value),
486
546
  placeholder: "general"
487
547
  })]
488
548
  }),
489
- /* @__PURE__ */ I("div", {
549
+ /* @__PURE__ */ L("div", {
490
550
  className: "grid gap-1.5",
491
- children: [/* @__PURE__ */ F(z, { children: "Type" }), /* @__PURE__ */ I(K, {
551
+ children: [/* @__PURE__ */ I(B, { children: "Type" }), /* @__PURE__ */ L(q, {
492
552
  value: u,
493
553
  onValueChange: (e) => d(e),
494
- children: [/* @__PURE__ */ F(Y, { children: /* @__PURE__ */ F(X, {}) }), /* @__PURE__ */ F(q, { children: Se.map((e) => /* @__PURE__ */ F(J, {
554
+ children: [/* @__PURE__ */ I(X, { children: /* @__PURE__ */ I(Z, {}) }), /* @__PURE__ */ I(J, { children: we.map((e) => /* @__PURE__ */ I(Y, {
495
555
  value: e,
496
556
  children: v(e)
497
557
  }, e)) })]
498
558
  })]
499
559
  }),
500
- /* @__PURE__ */ I("div", {
560
+ /* @__PURE__ */ L("div", {
501
561
  className: "grid gap-1.5",
502
- children: [/* @__PURE__ */ F(z, {
562
+ children: [/* @__PURE__ */ I(B, {
503
563
  htmlFor: "channel-desc",
504
564
  children: "Description"
505
- }), /* @__PURE__ */ F(fe, {
565
+ }), /* @__PURE__ */ I(pe, {
506
566
  id: "channel-desc",
507
567
  value: c,
508
568
  onChange: (e) => l(e.target.value),
509
569
  rows: 2
510
570
  })]
511
571
  }),
512
- f && /* @__PURE__ */ F("p", {
572
+ f && /* @__PURE__ */ I("p", {
513
573
  className: "text-sm text-status-error-text",
514
574
  children: f
515
575
  })
516
576
  ]
517
577
  }),
518
- /* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(L, {
578
+ /* @__PURE__ */ L(W, { children: [/* @__PURE__ */ I(R, {
519
579
  variant: "outline",
520
580
  onClick: () => n(!1),
521
581
  children: "Cancel"
522
- }), /* @__PURE__ */ F(L, {
582
+ }), /* @__PURE__ */ I(R, {
523
583
  onClick: async () => {
524
584
  if (!o.trim()) {
525
585
  p("Channel name is required.");
@@ -529,7 +589,7 @@ function $({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
529
589
  let t = await a.mutateAsync({
530
590
  circleId: e,
531
591
  name: o.trim(),
532
- slug: T(o),
592
+ slug: ee(o),
533
593
  description: c.trim() || null,
534
594
  type: u
535
595
  });
@@ -545,85 +605,135 @@ function $({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
545
605
  })
546
606
  });
547
607
  }
548
- function Ce({ circleId: e, open: t, onOpenChange: n }) {
549
- let r = a(), [i, o] = k(""), [s, c] = k(["", ""]), [l, u] = k(!1), [d, f] = k(null), p = () => {
550
- o(""), c(["", ""]), u(!1), f(null);
608
+ function Ee({ circleId: e, open: t, onOpenChange: n }) {
609
+ let r = a(), [i, o] = O(""), [s, c] = O(["", ""]), [l, u] = O(!1), [d, f] = O(!1), [p, m] = O(""), [_, v] = O(null), y = D(() => {
610
+ let e = /* @__PURE__ */ new Date();
611
+ return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 16);
612
+ }, []), b = () => {
613
+ o(""), c(["", ""]), u(!1), f(!1), m(""), v(null);
551
614
  };
552
- return /* @__PURE__ */ F(B, {
615
+ return /* @__PURE__ */ I(V, {
553
616
  open: t,
554
617
  onOpenChange: n,
555
- children: /* @__PURE__ */ I(V, {
618
+ children: /* @__PURE__ */ L(H, {
556
619
  className: "sm:max-w-md",
557
620
  children: [
558
- /* @__PURE__ */ I(W, { children: [/* @__PURE__ */ F(G, { children: "Create a poll" }), /* @__PURE__ */ F(H, { children: "Gather the circle's opinion." })] }),
559
- /* @__PURE__ */ I("div", {
621
+ /* @__PURE__ */ L(G, { children: [/* @__PURE__ */ I(K, { children: "Create a poll" }), /* @__PURE__ */ I(U, { children: "Gather the circle's opinion." })] }),
622
+ /* @__PURE__ */ L("div", {
560
623
  className: "flex flex-col gap-4 py-2",
561
624
  children: [
562
- /* @__PURE__ */ I("div", {
625
+ /* @__PURE__ */ L("div", {
563
626
  className: "grid gap-1.5",
564
- children: [/* @__PURE__ */ F(z, {
627
+ children: [/* @__PURE__ */ I(B, {
565
628
  htmlFor: "poll-q",
566
629
  children: "Question"
567
- }), /* @__PURE__ */ F(R, {
630
+ }), /* @__PURE__ */ I(z, {
568
631
  id: "poll-q",
569
632
  value: i,
570
633
  onChange: (e) => o(e.target.value),
571
634
  placeholder: "What should we build next?"
572
635
  })]
573
636
  }),
574
- /* @__PURE__ */ I("div", {
637
+ /* @__PURE__ */ L("div", {
575
638
  className: "grid gap-1.5",
576
- children: [/* @__PURE__ */ F(z, { children: "Options" }), /* @__PURE__ */ I("div", {
639
+ children: [/* @__PURE__ */ I(B, { children: "Options" }), /* @__PURE__ */ L("div", {
577
640
  className: "flex flex-col gap-2",
578
- children: [s.map((e, t) => /* @__PURE__ */ I("div", {
641
+ children: [s.map((e, t) => /* @__PURE__ */ L("div", {
579
642
  className: "flex items-center gap-2",
580
- children: [/* @__PURE__ */ F(R, {
643
+ children: [/* @__PURE__ */ I(z, {
581
644
  value: e,
582
645
  onChange: (e) => c((n) => n.map((n, r) => r === t ? e.target.value : n)),
583
646
  placeholder: `Option ${t + 1}`
584
- }), s.length > 2 && /* @__PURE__ */ F(L, {
647
+ }), s.length > 2 && /* @__PURE__ */ I(R, {
585
648
  variant: "ghost",
586
649
  size: "icon",
587
650
  onClick: () => c((e) => e.filter((e, n) => n !== t)),
588
651
  "aria-label": `Remove option ${t + 1}`,
589
652
  children: "✕"
590
653
  })]
591
- }, t)), s.length < 8 && /* @__PURE__ */ I(L, {
654
+ }, t)), s.length < 8 && /* @__PURE__ */ L(R, {
592
655
  variant: "outline",
593
656
  size: "sm",
594
657
  onClick: () => c((e) => [...e, ""]),
595
- children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " Add option"]
658
+ children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " Add option"]
596
659
  })]
597
660
  })]
598
661
  }),
599
- /* @__PURE__ */ I("label", {
600
- className: "flex items-center gap-2 text-sm text-text-secondary",
601
- children: [/* @__PURE__ */ F("input", {
602
- type: "checkbox",
603
- checked: l,
604
- onChange: (e) => u(e.target.checked),
605
- className: "h-4 w-4 rounded border-border-seam"
606
- }), "Allow selecting multiple options"]
662
+ /* @__PURE__ */ L("div", {
663
+ className: "grid gap-1.5",
664
+ children: [
665
+ /* @__PURE__ */ I(B, {
666
+ htmlFor: "poll-closes",
667
+ children: "Closes at"
668
+ }),
669
+ /* @__PURE__ */ I(z, {
670
+ id: "poll-closes",
671
+ type: "datetime-local",
672
+ min: y,
673
+ value: p,
674
+ onChange: (e) => m(e.target.value)
675
+ }),
676
+ /* @__PURE__ */ I("p", {
677
+ className: "text-xs text-text-tertiary",
678
+ children: "Optional — leave empty to keep voting open indefinitely."
679
+ })
680
+ ]
681
+ }),
682
+ /* @__PURE__ */ L("div", {
683
+ className: "flex flex-col divide-y divide-border-seam rounded-xl border border-border-seam",
684
+ children: [/* @__PURE__ */ L("div", {
685
+ className: "flex items-center justify-between gap-4 px-3 py-3",
686
+ children: [/* @__PURE__ */ L("div", {
687
+ className: "min-w-0",
688
+ children: [/* @__PURE__ */ I(B, {
689
+ htmlFor: "poll-multi",
690
+ children: "Allow multiple choices"
691
+ }), /* @__PURE__ */ I("p", {
692
+ className: "text-xs text-text-tertiary",
693
+ children: "Let voters pick more than one option."
694
+ })]
695
+ }), /* @__PURE__ */ I(Q, {
696
+ id: "poll-multi",
697
+ checked: l,
698
+ onCheckedChange: u
699
+ })]
700
+ }), /* @__PURE__ */ L("div", {
701
+ className: "flex items-center justify-between gap-4 px-3 py-3",
702
+ children: [/* @__PURE__ */ L("div", {
703
+ className: "min-w-0",
704
+ children: [/* @__PURE__ */ I(B, {
705
+ htmlFor: "poll-anon",
706
+ children: "Anonymous voting"
707
+ }), /* @__PURE__ */ I("p", {
708
+ className: "text-xs text-text-tertiary",
709
+ children: "Hide who voted for each option."
710
+ })]
711
+ }), /* @__PURE__ */ I(Q, {
712
+ id: "poll-anon",
713
+ checked: d,
714
+ onCheckedChange: f
715
+ })]
716
+ })]
607
717
  }),
608
- d && /* @__PURE__ */ F("p", {
718
+ _ && /* @__PURE__ */ I("p", {
609
719
  className: "text-sm text-status-error-text",
610
- children: d
720
+ children: _
611
721
  })
612
722
  ]
613
723
  }),
614
- /* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(L, {
724
+ /* @__PURE__ */ L(W, { children: [/* @__PURE__ */ I(R, {
615
725
  variant: "outline",
616
726
  onClick: () => n(!1),
617
727
  children: "Cancel"
618
- }), /* @__PURE__ */ F(L, {
728
+ }), /* @__PURE__ */ I(R, {
619
729
  onClick: async () => {
620
730
  let t = s.map((e) => e.trim()).filter(Boolean);
621
731
  if (!i.trim()) {
622
- f("A question is required.");
732
+ v("A question is required.");
623
733
  return;
624
734
  }
625
735
  if (t.length < 2) {
626
- f("Add at least two options.");
736
+ v("Add at least two options.");
627
737
  return;
628
738
  }
629
739
  try {
@@ -631,10 +741,12 @@ function Ce({ circleId: e, open: t, onOpenChange: n }) {
631
741
  circleId: e,
632
742
  question: i.trim(),
633
743
  options: t,
634
- allowMultiple: l
635
- }), g.success("Poll created"), n(!1), p();
744
+ allowMultiple: l,
745
+ isAnonymous: d,
746
+ closesAt: p ? new Date(p).toISOString() : null
747
+ }), g.success("Poll created"), n(!1), b();
636
748
  } catch (e) {
637
- f(h(e));
749
+ v(h(e));
638
750
  }
639
751
  },
640
752
  disabled: r.isPending,
@@ -645,6 +757,6 @@ function Ce({ circleId: e, open: t, onOpenChange: n }) {
645
757
  });
646
758
  }
647
759
  //#endregion
648
- export { he as CircleDetailPage };
760
+ export { _e as CircleDetailPage };
649
761
 
650
762
  //# sourceMappingURL=CircleDetailPage.js.map