@parallelworks/tandem-web 0.191.0 → 0.192.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/pages/issues.js CHANGED
@@ -1,522 +1,573 @@
1
- import { cyclesQuery as e, issueCountsQuery as t, issueOrders as n, issuePagesQuery as r, labelsQuery as i, meQuery as ee, projectsQuery as te, statusesQuery as ne, teamsQuery as re } from "../api/queries.js";
2
- import { DisplayMenu as a } from "../components/DisplayMenu.js";
3
- import { FavoriteStar as ie } from "../components/FavoriteStar.js";
4
- import { IssueBoard as ae } from "../components/IssueBoard.js";
5
- import { BreakdownFilterBar as oe, IssueBreakdown as se, breakdownCount as ce, formatBreakdown as le, inBreakdown as ue, parseBreakdown as de } from "../components/IssueBreakdown.js";
6
- import { useIssueFilters as fe, withIssueFilters as pe } from "../components/IssueFilters.js";
7
- import { IssueGroupList as me } from "../components/IssueGroupList.js";
8
- import { IssueImport as he, pickCsv as ge } from "../components/IssueImport.js";
9
- import { IssueInsights as _e } from "../components/IssueInsights.js";
1
+ import { cyclesQuery as e, issueCountsQuery as t, issueOrders as n, issuePagesQuery as r, labelsQuery as i, meQuery as ee, projectsQuery as te, statusesQuery as ne, teamsQuery as re, viewsQuery as a } from "../api/queries.js";
2
+ import { DisplayMenu as ie } from "../components/DisplayMenu.js";
3
+ import { FavoriteStar as ae } from "../components/FavoriteStar.js";
4
+ import { IssueBoard as oe } from "../components/IssueBoard.js";
5
+ import { BreakdownFilterBar as se, IssueBreakdown as ce, breakdownCount as le, formatBreakdown as ue, inBreakdown as de, parseBreakdown as fe } from "../components/IssueBreakdown.js";
6
+ import { useIssueFilters as pe, withIssueFilters as me } from "../components/IssueFilters.js";
7
+ import { IssueGroupList as he } from "../components/IssueGroupList.js";
8
+ import { IssueImport as ge, pickCsv as _e } from "../components/IssueImport.js";
9
+ import { IssueInsights as ve } from "../components/IssueInsights.js";
10
10
  import { IssueRow as o } from "../components/IssueRow.js";
11
- import { BoardIcon as ve, ChartIcon as ye, CloseIcon as be, DownloadIcon as xe, ListViewIcon as Se, SidePanelIcon as Ce, UploadIcon as we, usePriorityNames as Te } from "../components/icons.js";
12
- import { ErrorMessage as Ee } from "../components/status.js";
13
- import { ViewDialog as De } from "../components/ViewDialog.js";
11
+ import { BoardIcon as ye, ChartIcon as be, CloseIcon as xe, DownloadIcon as Se, ListViewIcon as Ce, SidePanelIcon as we, UploadIcon as Te, usePriorityNames as Ee } from "../components/icons.js";
12
+ import { ErrorMessage as De } from "../components/status.js";
13
+ import { ViewDialog as Oe } from "../components/ViewDialog.js";
14
14
  import { basePath as s } from "../lib/base.js";
15
- import { useBoardMove as Oe } from "../lib/boardMove.js";
16
- import { customFieldsQuery as ke, fieldRef as Ae, fieldsForTeams as je, groupableKinds as Me, sortableKinds as Ne } from "../lib/customFields.js";
17
- import { insightsKey as Pe, listTabs as Fe, panelKey as Ie, shownFields as Le, storeDisplay as Re, storeShownFields as ze, storedDisplay as Be, withParam as c } from "../lib/issueDisplay.js";
18
- import { groupIssues as Ve, groupings as He, isGrouping as Ue, isOrder as We, issueFilterOf as Ge, orders as Ke, sortIssues as qe, views as Je } from "../lib/issueList.js";
19
- import { useIssueMenu as Ye } from "../lib/issueMenu.js";
20
- import { issueTypesQuery as Xe } from "../lib/issueTypes.js";
21
- import { useLive as Ze } from "../lib/live.js";
22
- import { useNewIssue as Qe } from "../lib/newIssue.js";
23
- import { pagedGroupings as $e, usePagedGroups as et } from "../lib/pagedGroups.js";
24
- import { usePageTitle as tt } from "../lib/pageTitle.js";
25
- import { usePaletteSelection as nt } from "../lib/palette.js";
26
- import { usePeople as rt } from "../lib/people.js";
27
- import { projectRef as it } from "../lib/projects.js";
28
- import { isViewAt as at, viewRef as ot } from "../lib/refs.js";
29
- import { useCan as st } from "../lib/roles.js";
30
- import { useNavigate as ct } from "../lib/router.js";
31
- import { useShortcuts as lt } from "../lib/shortcuts.js";
32
- import { issuesHref as ut } from "../lib/teamPaths.js";
33
- import { filtersOf as dt, sameFilters as ft, useSavedViews as pt, viewSearch as mt } from "../lib/views.js";
34
- import { ActionMenu as ht, Button as l, ConfirmModal as gt, Field as _t, IconButton as u, SearchInput as vt, Select as yt, Tabs as bt, useOpenMenu as xt } from "@parallelworks/ui";
35
- import { useParams as St, useSearch as Ct } from "@tanstack/react-router";
36
- import { memo as wt, useCallback as Tt, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
37
- import { useTranslations as h } from "use-intl";
38
- import { Fragment as Et, jsx as g, jsxs as _ } from "react/jsx-runtime";
39
- import { keepPreviousData as Dt, useInfiniteQuery as Ot, useQuery as v, useSuspenseQuery as kt } from "@tanstack/react-query";
40
- import { ListFilterBar as At, ListFilterMenu as jt, ListSkeleton as Mt } from "@parallelworks/ui/list";
15
+ import { useBoardMove as ke } from "../lib/boardMove.js";
16
+ import { customFieldsQuery as Ae, fieldRef as je, fieldsForTeams as Me, groupableKinds as Ne, sortableKinds as Pe } from "../lib/customFields.js";
17
+ import { insightsKey as Fe, listTabs as Ie, panelKey as Le, shownFields as Re, storeDisplay as ze, storeShownFields as Be, storedDisplay as Ve, withParam as c } from "../lib/issueDisplay.js";
18
+ import { groupIssues as He, groupings as Ue, isGrouping as We, isOrder as Ge, issueFilterOf as Ke, orders as qe, sortIssues as Je, views as Ye } from "../lib/issueList.js";
19
+ import { useIssueMenu as Xe } from "../lib/issueMenu.js";
20
+ import { issueTypesQuery as Ze } from "../lib/issueTypes.js";
21
+ import { useLive as Qe } from "../lib/live.js";
22
+ import { useNewIssue as $e } from "../lib/newIssue.js";
23
+ import { pagedGroupings as et, usePagedGroups as tt } from "../lib/pagedGroups.js";
24
+ import { usePageTitle as nt } from "../lib/pageTitle.js";
25
+ import { usePaletteSelection as rt } from "../lib/palette.js";
26
+ import { usePeople as it } from "../lib/people.js";
27
+ import { projectRef as at } from "../lib/projects.js";
28
+ import { isViewAt as ot, viewRef as st } from "../lib/refs.js";
29
+ import { useCan as ct } from "../lib/roles.js";
30
+ import { useNavigate as lt } from "../lib/router.js";
31
+ import { useShortcuts as ut } from "../lib/shortcuts.js";
32
+ import { issuesHref as l } from "../lib/teamPaths.js";
33
+ import { filtersOf as dt, sameFilters as ft, useSavedViews as pt, useViewMenu as mt, viewSearch as ht } from "../lib/views.js";
34
+ import { ActionMenu as gt, Button as u, ConfirmModal as _t, Field as vt, IconButton as d, SearchInput as yt, Select as bt, Tabs as xt, useOpenMenu as St } from "@parallelworks/ui";
35
+ import { useParams as Ct, useSearch as wt } from "@tanstack/react-router";
36
+ import { memo as Tt, useCallback as Et, useEffect as f, useMemo as p, useRef as m, useState as h, useSyncExternalStore as Dt } from "react";
37
+ import { useTranslations as g } from "use-intl";
38
+ import { Fragment as Ot, jsx as _, jsxs as v } from "react/jsx-runtime";
39
+ import { keepPreviousData as kt, useInfiniteQuery as At, useQuery as y, useSuspenseQuery as jt } from "@tanstack/react-query";
40
+ import { ListFilterBar as Mt, ListFilterMenu as Nt, ListSkeleton as Pt, MoreButton as Ft } from "@parallelworks/ui/list";
41
41
  // src/pages/issues.tsx
42
- var Nt = {
42
+ var It = {
43
43
  status: "status",
44
44
  priority: "priority",
45
45
  project: "project",
46
46
  type: "type"
47
- }, Pt = [];
48
- function Ft(e) {
47
+ }, Lt = [];
48
+ function Rt({ team: e, ...t }) {
49
+ return t;
50
+ }
51
+ var zt = 3, Bt = "(max-width: 639px)", Vt = () => globalThis.matchMedia?.(Bt).matches ?? !1, Ht = (e) => {
52
+ let t = globalThis.matchMedia?.(Bt);
53
+ return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
54
+ }, Ut = (e) => `saved:${st(e)}`;
55
+ function Wt(e, t, n) {
56
+ let r = t && !e.some((e) => e.id === t.id) ? [...e, t] : e, i = r.slice(0, n);
57
+ return t && !i.some((e) => e.id === t.id) && (i = [...i.slice(0, n - 1), t]), {
58
+ shown: i,
59
+ more: r.filter((e) => !i.some((t) => t.id === e.id))
60
+ };
61
+ }
62
+ function Gt(e) {
49
63
  let { assignee: t, creator: n, ...r } = e;
50
64
  return n ? {
51
65
  ...r,
52
66
  creator: n
53
67
  } : r;
54
68
  }
55
- function It({ person: o } = {}) {
56
- let s = h("issues"), wt = h("planning"), It = h("common"), { workspace: y, key: Bt } = St({ strict: !1 }), b = Ct({ strict: !1 }), x = Bt ? {
57
- ...b,
58
- team: Bt
59
- } : o ? b.creator ? {
60
- ...Ft(b),
69
+ function b({ person: o } = {}) {
70
+ let s = g("issues"), Tt = g("planning"), Bt = g("common"), { workspace: b, key: x } = Ct({ strict: !1 }), Yt = wt({ strict: !1 }), S = x ? {
71
+ ...Yt,
72
+ team: x
73
+ } : o ? Yt.creator ? {
74
+ ...Gt(Yt),
61
75
  creator: o
62
76
  } : {
63
- ...b,
77
+ ...Yt,
64
78
  assignee: o
65
- } : b, Vt = ct(), Ht = (e) => o ? ut(y, { ...Ft(e) }).replace(`/${y}/issues`, `/${y}/people/${encodeURIComponent(o)}`) : ut(y, { ...e }), S = (e, t) => {
79
+ } : Yt, Xt = lt(), Zt = (e) => o ? l(b, { ...Gt(e) }).replace(`/${b}/issues`, `/${b}/people/${encodeURIComponent(o)}`) : l(b, { ...e }), C = (e, t) => {
66
80
  let { team: n, ...r } = e;
67
- return Vt(o ? {
81
+ return Xt(o ? {
68
82
  to: "/$workspace/people/$username",
69
83
  params: {
70
- workspace: y,
84
+ workspace: b,
71
85
  username: o
72
86
  },
73
- search: Ft(r),
87
+ search: Gt(r),
74
88
  ...t && { replace: t }
75
89
  } : n ? {
76
90
  to: "/$workspace/teams/$key/issues",
77
91
  params: {
78
- workspace: y,
92
+ workspace: b,
79
93
  key: n
80
94
  },
81
95
  search: r,
82
96
  ...t && { replace: t }
83
97
  } : {
84
98
  to: "/$workspace/issues",
85
- params: { workspace: y },
99
+ params: { workspace: b },
86
100
  search: r,
87
101
  ...t && { replace: t }
88
102
  });
89
- }, Ut = p((e) => S(e, !0));
90
- Ut.current = (e) => S(e, !0);
91
- let Wt = p((e) => S(c(x, "q", e), !0));
92
- Wt.current = (e) => S(c(x, "q", e), !0);
93
- let { data: Gt } = kt(ee), { data: C } = kt(re(y)), Kt = Qe(), w = x.view ?? "active", [T, qt] = m(x.q ?? ""), Jt = p(null);
94
- d(() => {
103
+ }, Qt = m((e) => C(e, !0));
104
+ Qt.current = (e) => C(e, !0);
105
+ let $t = m((e) => C(c(S, "q", e), !0));
106
+ $t.current = (e) => C(c(S, "q", e), !0);
107
+ let { data: en } = jt(ee), { data: w } = jt(re(b)), tn = $e(), T = S.view ?? "active", [E, nn] = h(S.q ?? ""), rn = m(null);
108
+ f(() => {
95
109
  let e = setTimeout(() => {
96
- (x.q ?? "") !== T && Wt.current(T);
110
+ (S.q ?? "") !== E && $t.current(E);
97
111
  }, 250);
98
112
  return () => clearTimeout(e);
99
- }, [T, x.q]);
100
- let { data: Yt } = v({
101
- ...ne(y, x.team ?? ""),
102
- enabled: !!x.status && !!x.team
103
- }), Xt = Ge(x, Yt), Zt = !x.status || !x.team || !!Yt, Qt = Te(), { nameOf: $t, avatarOf: en } = rt(y), E = x.saved ? {} : Be(), { data: tn } = v(ke(y)), D = C.find((e) => e.key === x.team), O = f(() => je(tn, D ? [D.id] : C.map((e) => e.id)), [
104
- tn,
105
- D,
106
- C
107
- ]), k = h("customFields"), nn = h("issueTypes"), { data: rn } = v(Xe(y)), an = f(() => (rn ?? []).filter((e) => !e.archivedAt && (!D || e.teamIds.length === 0 || e.teamIds.includes(D.id))), [rn, D]), A = We(x.order, O) ? x.order : We(E.order, O) ? E.order : "updated", j = Ue(x.group, O) ? x.group : Ue(E.group, O) ? E.group : "status", on = O.find((e) => e.id === Ae(j)), [sn, cn] = m(() => Le(y)), ln = f(() => O.filter((e) => sn.includes(e.id)), [O, sn]), M = x.layout === "board" || !x.layout && E.layout === "board", [N, un] = m(() => {
113
+ }, [E, S.q]);
114
+ let { data: an } = y({
115
+ ...ne(b, S.team ?? ""),
116
+ enabled: !!S.status && !!S.team
117
+ }), on = Ke(S, an), sn = !S.status || !S.team || !!an, cn = Ee(), { nameOf: ln, avatarOf: un } = it(b), D = S.saved ? {} : Ve(), { data: dn } = y(Ae(b)), O = w.find((e) => e.key === S.team), k = p(() => Me(dn, O ? [O.id] : w.map((e) => e.id)), [
118
+ dn,
119
+ O,
120
+ w
121
+ ]), A = g("customFields"), fn = g("issueTypes"), { data: pn } = y(Ze(b)), mn = p(() => (pn ?? []).filter((e) => !e.archivedAt && (!O || e.teamIds.length === 0 || e.teamIds.includes(O.id))), [pn, O]), j = Ge(S.order, k) ? S.order : Ge(D.order, k) ? D.order : "updated", M = We(S.group, k) ? S.group : We(D.group, k) ? D.group : "status", hn = k.find((e) => e.id === je(M)), [gn, _n] = h(() => Re(b)), vn = p(() => k.filter((e) => gn.includes(e.id)), [k, gn]), N = S.layout === "board" || !S.layout && D.layout === "board", [P, yn] = h(() => {
108
122
  try {
109
- return localStorage.getItem(Ie) !== "hidden";
123
+ return localStorage.getItem(Le) !== "hidden";
110
124
  } catch {
111
125
  return !0;
112
126
  }
113
- }), dn = () => un((e) => {
127
+ }), bn = () => yn((e) => {
114
128
  try {
115
- localStorage.setItem(Ie, e ? "hidden" : "shown");
129
+ localStorage.setItem(Le, e ? "hidden" : "shown");
116
130
  } catch {}
117
131
  return !e;
118
- }), [fn, pn] = m(() => {
132
+ }), [xn, Sn] = h(() => {
119
133
  try {
120
- return localStorage.getItem(Pe) === "shown";
134
+ return localStorage.getItem(Fe) === "shown";
121
135
  } catch {
122
136
  return !1;
123
137
  }
124
- }), mn = () => pn((e) => {
138
+ }), Cn = () => Sn((e) => {
125
139
  try {
126
- localStorage.setItem(Pe, e ? "hidden" : "shown");
140
+ localStorage.setItem(Fe, e ? "hidden" : "shown");
127
141
  } catch {}
128
142
  return !e;
129
- }), [hn, gn] = m("assignees"), _n = f(() => de(x.breakdown), [x.breakdown]), vn = (e) => S(c(x, "breakdown", le(e) ?? ""), !0), yn = ce(_n) > 0, P = !M && !yn && !x.status && $e.includes(j) && n.includes(A) ? j : void 0, F = Ot({
130
- ...r(y, Xt),
131
- placeholderData: Dt,
132
- enabled: Zt && (!P || N)
133
- }), { hasNextPage: bn, isFetchingNextPage: xn, fetchNextPage: Sn } = F, Cn = !P || N;
134
- d(() => {
135
- Cn && bn && !xn && !F.error && Sn();
143
+ }), [wn, Tn] = h("assignees"), En = p(() => fe(S.breakdown), [S.breakdown]), Dn = (e) => C(c(S, "breakdown", ue(e) ?? ""), !0), On = le(En) > 0, F = !N && !On && !S.status && et.includes(M) && n.includes(j) ? M : void 0, I = At({
144
+ ...r(b, on),
145
+ placeholderData: kt,
146
+ enabled: sn && (!F || P)
147
+ }), { hasNextPage: kn, isFetchingNextPage: An, fetchNextPage: jn } = I, Mn = !F || P;
148
+ f(() => {
149
+ Mn && kn && !An && !I.error && jn();
136
150
  }, [
137
- Cn,
138
- bn,
139
- xn,
140
- F.error,
141
- Sn
151
+ Mn,
152
+ kn,
153
+ An,
154
+ I.error,
155
+ jn
142
156
  ]);
143
- let I = v({
144
- ...t(y, dt(x), P ?? "status"),
145
- placeholderData: Dt,
146
- enabled: Zt && !!P
147
- }), L = et(y, Xt, P ?? "status", A, I.data?.byKey, Zt && !!P), R = P ? I.data : F.data, wn = P ? I.error ?? L.error : F.error, Tn = P ? I.isFetching : F.isFetching, z = P ? L.fetching : !!bn, B = P ? L.complete : !bn, En = f(() => F.data?.pages.flatMap((e) => e.issues) ?? [], [F.data]), V = f(() => P ? [...L.issues.values()].flat() : En, [
148
- P,
149
- L.issues,
150
- En
151
- ]), { data: Dn } = v({
152
- ...te(y),
153
- enabled: P === "project"
154
- }), On = yn ? V.filter((e) => ue(e, _n)) : V, kn = f(() => Ve(qe(On, A, O), j, {
157
+ let L = y({
158
+ ...t(b, dt(S), F ?? "status"),
159
+ placeholderData: kt,
160
+ enabled: sn && !!F
161
+ }), R = tt(b, on, F ?? "status", j, L.data?.byKey, sn && !!F), z = F ? L.data : I.data, Nn = F ? L.error ?? R.error : I.error, Pn = F ? L.isFetching : I.isFetching, B = F ? R.fetching : !!kn, V = F ? R.complete : !kn, Fn = p(() => I.data?.pages.flatMap((e) => e.issues) ?? [], [I.data]), In = p(() => F ? [...R.issues.values()].flat() : Fn, [
162
+ F,
163
+ R.issues,
164
+ Fn
165
+ ]), { data: Ln } = y({
166
+ ...te(b),
167
+ enabled: F === "project"
168
+ }), Rn = On ? In.filter((e) => de(e, En)) : In, zn = p(() => He(Je(Rn, j, k), M, {
155
169
  status: (e) => s(`groups.${e}`),
156
- priority: (e) => Qt[e] ?? "",
157
- person: $t,
158
- avatar: en,
170
+ priority: (e) => cn[e] ?? "",
171
+ person: ln,
172
+ avatar: un,
159
173
  none: {
160
174
  assignee: s("noAssignee"),
161
175
  project: s("noProject"),
162
176
  label: s("noLabel"),
163
177
  all: s("all")
164
178
  },
165
- noField: (e) => k("noField", { name: e }),
166
- yes: k("yes"),
167
- noType: nn("noType")
168
- }, M || !!P, O, an), [
169
- P,
170
- On,
171
- A,
179
+ noField: (e) => A("noField", { name: e }),
180
+ yes: A("yes"),
181
+ noType: fn("noType")
182
+ }, N || !!F, k, mn), [
183
+ F,
184
+ Rn,
172
185
  j,
186
+ M,
173
187
  s,
188
+ A,
189
+ fn,
190
+ cn,
191
+ ln,
192
+ un,
193
+ N,
174
194
  k,
175
- nn,
176
- Qt,
177
- $t,
178
- en,
179
- M,
180
- O,
181
- an
182
- ]), H = f(() => {
183
- if (!P) return kn;
184
- let e = I.data?.byKey, t = kn;
185
- if (P === "project") {
195
+ mn
196
+ ]), H = p(() => {
197
+ if (!F) return zn;
198
+ let e = L.data?.byKey, t = zn;
199
+ if (F === "project") {
186
200
  let n = new Set(t.map((e) => e.key));
187
201
  t = [...[...t.filter((e) => e.key !== "none"), ...[...e?.keys() ?? []].filter((e) => e !== "none" && !n.has(e)).map((e) => ({
188
202
  key: e,
189
- label: Dn?.find((t) => t.id === e)?.name ?? "",
203
+ label: Ln?.find((t) => t.id === e)?.name ?? "",
190
204
  issues: []
191
205
  }))].sort((e, t) => e.label.localeCompare(t.label)), ...t.filter((e) => e.key === "none")];
192
206
  }
193
207
  return t.filter((t) => (e?.get(t.key) ?? 0) > 0).map((e) => ({
194
208
  ...e,
195
- more: L.more(e.key)
209
+ more: R.more(e.key)
196
210
  }));
197
211
  }, [
198
- P,
199
- kn,
200
- I.data,
201
- Dn,
202
- L.more
203
- ]), U = f(() => H.flatMap((e) => e.issues), [H]), An = f(() => new Map(U.map((e, t) => [e.id, t])), [U]), jn = !yn && !x.status ? Nt[j] : void 0, { data: Mn } = v({
204
- ...t(y, dt(x), jn ?? "status"),
205
- enabled: z && !!jn
206
- }), Nn = Tt((e) => P ? I.data?.byKey.get(e.key) ?? e.issues.length : z && Mn?.byKey.get(e.key) || e.issues.length, [
207
- P,
208
- I.data,
209
- z,
210
- Mn
211
- ]), Pn = f(() => new Map(C.map((e) => [e.id, e])), [C]), [Fn, In] = m(0), W = U[Math.min(Fn, U.length - 1)], [G, K] = m(/* @__PURE__ */ new Set()), Ln = p(null), Rn = Ye(y), zn = Oe(y, C), { people: Bn } = Ze(), Vn = f(() => {
212
+ F,
213
+ zn,
214
+ L.data,
215
+ Ln,
216
+ R.more
217
+ ]), U = p(() => H.flatMap((e) => e.issues), [H]), Bn = p(() => new Map(U.map((e, t) => [e.id, t])), [U]), Vn = !On && !S.status ? It[M] : void 0, { data: Hn } = y({
218
+ ...t(b, dt(S), Vn ?? "status"),
219
+ enabled: B && !!Vn
220
+ }), Un = Et((e) => F ? L.data?.byKey.get(e.key) ?? e.issues.length : B && Hn?.byKey.get(e.key) || e.issues.length, [
221
+ F,
222
+ L.data,
223
+ B,
224
+ Hn
225
+ ]), Wn = p(() => new Map(w.map((e) => [e.id, e])), [w]), [Gn, Kn] = h(0), W = U[Math.min(Gn, U.length - 1)], [G, K] = h(/* @__PURE__ */ new Set()), qn = m(null), Jn = Xe(b), Yn = ke(b, w), { people: Xn } = Qe(), Zn = p(() => {
212
226
  let e = /* @__PURE__ */ new Map();
213
- for (let t of Bn) {
214
- if (!t.identifier || t.username === Gt?.user.username) continue;
227
+ for (let t of Xn) {
228
+ if (!t.identifier || t.username === en?.user.username) continue;
215
229
  let n = e.get(t.identifier) ?? /* @__PURE__ */ new Set();
216
230
  n.add(t.username), e.set(t.identifier, n);
217
231
  }
218
232
  return new Map([...e].map(([e, t]) => [e, [...t]]));
219
- }, [Bn, Gt?.user.username]), Hn = xt(), Un = f(() => U.filter((e) => G.has(e.id)), [U, G]);
220
- nt(Un);
221
- let Wn = (e) => K((t) => {
233
+ }, [Xn, en?.user.username]), Qn = St(), $n = p(() => U.filter((e) => G.has(e.id)), [U, G]);
234
+ rt($n);
235
+ let er = (e) => K((t) => {
222
236
  let n = new Set(t);
223
237
  return n.has(e) ? n.delete(e) : n.add(e), n;
224
- }), Gn = (e) => {
225
- (Ln.current === null || G.size === 0) && (Ln.current = Math.max(Fn, 0));
226
- let t = Ln.current, [n, r] = t < e ? [t, e] : [e, t];
238
+ }), tr = (e) => {
239
+ (qn.current === null || G.size === 0) && (qn.current = Math.max(Gn, 0));
240
+ let t = qn.current, [n, r] = t < e ? [t, e] : [e, t];
227
241
  K(new Set(U.slice(n, r + 1).map((e) => e.id)));
228
- }, q = (e, t) => {
242
+ }, nr = (e, t) => {
229
243
  let n = U[e];
230
244
  if (n) {
231
- if (t) return Gn(e);
232
- Wn(n.id), Ln.current = e;
245
+ if (t) return tr(e);
246
+ er(n.id), qn.current = e;
233
247
  }
234
- }, Kn = (e, t) => {
235
- (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), q(t, e.shiftKey));
236
- }, J = (e, t) => {
237
- let n = Math.min(Math.max(Fn + e, 0), U.length - 1);
238
- t && Gn(n), In(n);
239
- }, qn = (e, t) => {
248
+ }, rr = (e, t) => {
249
+ (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), nr(t, e.shiftKey));
250
+ }, q = (e, t) => {
251
+ let n = Math.min(Math.max(Gn + e, 0), U.length - 1);
252
+ t && tr(n), Kn(n);
253
+ }, ir = (e, t) => {
240
254
  let n = G.has(t.id) ? U.filter((e) => G.has(e.id)) : [t];
241
- G.has(t.id) || K(/* @__PURE__ */ new Set()), Hn(e, Rn(n));
242
- }, Jn = p({
243
- pick: q,
244
- select: In,
245
- click: Kn,
246
- menu: qn
255
+ G.has(t.id) || K(/* @__PURE__ */ new Set()), Qn(e, Jn(n));
256
+ }, ar = m({
257
+ pick: nr,
258
+ select: Kn,
259
+ click: rr,
260
+ menu: ir
247
261
  });
248
- Jn.current = {
249
- pick: q,
250
- select: In,
251
- click: Kn,
252
- menu: qn
262
+ ar.current = {
263
+ pick: nr,
264
+ select: Kn,
265
+ click: rr,
266
+ menu: ir
253
267
  };
254
- let [Y, Yn] = m(!1);
255
- d(() => {
256
- Y && (B || wn) && (K(new Set(U.map((e) => e.id))), Yn(!1));
268
+ let [J, or] = h(!1);
269
+ f(() => {
270
+ J && (V || Nn) && (K(new Set(U.map((e) => e.id))), or(!1));
257
271
  }, [
258
- Y,
259
- B,
260
- wn,
272
+ J,
273
+ V,
274
+ Nn,
261
275
  U
262
276
  ]);
263
- let { data: Xn } = v({
264
- ...t(y, dt(x), "status"),
265
- enabled: Y
266
- }), Zn = () => {
267
- K(new Set(U.map((e) => e.id))), P && L.loadAll(), Yn(!B);
268
- }, Qn = () => {
269
- K(/* @__PURE__ */ new Set()), Yn(!1);
270
- }, $n = p(null), er = (e) => {
271
- if (Y) return;
272
- let t = G.size > 0 ? Un : W ? [W] : [];
277
+ let { data: sr } = y({
278
+ ...t(b, dt(S), "status"),
279
+ enabled: J
280
+ }), cr = () => {
281
+ K(new Set(U.map((e) => e.id))), F && R.loadAll(), or(!V);
282
+ }, lr = () => {
283
+ K(/* @__PURE__ */ new Set()), or(!1);
284
+ }, ur = m(null), dr = (e) => {
285
+ if (J) return;
286
+ let t = G.size > 0 ? $n : W ? [W] : [];
273
287
  if (t.length === 0) return;
274
- let n = Rn(t).find((t) => "shortcut" in t && t.shortcut === e);
288
+ let n = Jn(t).find((t) => "shortcut" in t && t.shortcut === e);
275
289
  return n && "label" in n && !n.disabled ? n : void 0;
276
- }, X = (e) => () => {
277
- let t = er(e), n = G.size > 0 && $n.current || W && document.getElementById(`row-${W.id}`);
278
- t && "items" in t && t.items && n && Hn(n, t.items);
279
- }, [tr, nr] = m(null), rr = () => {
280
- let e = er("⌫");
281
- e && "onClick" in e && nr(() => e.onClick);
290
+ }, Y = (e) => () => {
291
+ let t = dr(e), n = G.size > 0 && ur.current || W && document.getElementById(`row-${W.id}`);
292
+ t && "items" in t && t.items && n && Qn(n, t.items);
293
+ }, [fr, pr] = h(null), mr = () => {
294
+ let e = dr("⌫");
295
+ e && "onClick" in e && pr(() => e.onClick);
282
296
  };
283
- lt({
284
- ...!M && {
285
- j: () => J(1, !1),
286
- k: () => J(-1, !1),
287
- J: () => J(1, !0),
288
- K: () => J(-1, !0),
289
- ArrowDown: (e) => J(1, e.shiftKey),
290
- ArrowUp: (e) => J(-1, e.shiftKey),
291
- x: () => W && q(U.indexOf(W), !1),
292
- X: () => W && q(U.indexOf(W), !0),
293
- "Mod+a": Zn,
294
- "Shift+Mod+a": Qn,
295
- s: X("S"),
296
- p: X("P"),
297
- a: X("A"),
298
- l: X("L"),
299
- m: X("M"),
300
- d: X("D"),
301
- Backspace: rr,
302
- Delete: rr,
303
- Enter: () => W && Vt({
297
+ ut({
298
+ ...!N && {
299
+ j: () => q(1, !1),
300
+ k: () => q(-1, !1),
301
+ J: () => q(1, !0),
302
+ K: () => q(-1, !0),
303
+ ArrowDown: (e) => q(1, e.shiftKey),
304
+ ArrowUp: (e) => q(-1, e.shiftKey),
305
+ x: () => W && nr(U.indexOf(W), !1),
306
+ X: () => W && nr(U.indexOf(W), !0),
307
+ "Mod+a": cr,
308
+ "Shift+Mod+a": lr,
309
+ s: Y("S"),
310
+ p: Y("P"),
311
+ a: Y("A"),
312
+ l: Y("L"),
313
+ m: Y("M"),
314
+ d: Y("D"),
315
+ Backspace: mr,
316
+ Delete: mr,
317
+ Enter: () => W && Xt({
304
318
  to: "/$workspace/issues/$identifier",
305
319
  params: {
306
- workspace: y,
320
+ workspace: b,
307
321
  identifier: W.identifier
308
322
  }
309
323
  })
310
324
  },
311
- Escape: Qn,
312
- "/": () => Jt.current?.focus()
313
- }), d(() => {
325
+ Escape: lr,
326
+ "/": () => rn.current?.focus()
327
+ }), f(() => {
314
328
  let e = (e) => {
315
- (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), Jt.current?.focus(), Jt.current?.select());
329
+ (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), rn.current?.focus(), rn.current?.select());
316
330
  };
317
331
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
318
332
  }, []);
319
- let ir = p(null), Z = C.find((e) => e.key === x.team), ar = fe(y, x, (e) => S(pe(x, e), !0), !!Bt && !x.assignee && !x.creator && !x.saved && !x.scope), or = ut(y, { ...c(x, "q", void 0) }), { views: sr, create: cr, update: lr } = pt(y), Q = sr.find((e) => at(e, x.saved)), { data: ur } = v(i(y)), { data: dr } = v(te(y)), { data: fr } = v({
320
- ...e(y, Z?.key ?? ""),
321
- enabled: !!Z
333
+ let hr = m(null), X = w.find((e) => e.key === S.team), gr = pe(b, S, (e) => C(me(S, e), !0), !!x && !S.assignee && !S.creator && !S.saved && !S.scope), _r = l(b, { ...c(S, "q", void 0) }), { views: vr, create: yr, update: br } = pt(b), Z = vr.find((e) => ot(e, S.saved)), { data: xr = [] } = y({
334
+ ...a(b, S.team ?? ""),
335
+ enabled: !!x && !o
336
+ }), Sr = mt(b), { data: Cr } = y(i(b)), { data: wr } = y(te(b)), { data: Tr } = y({
337
+ ...e(b, X?.key ?? ""),
338
+ enabled: !!X
322
339
  });
323
- d(() => {
324
- let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...x }, n = ur?.find((e) => e.id === x.label);
325
- x.label && e.test(x.label) && n && (t.label = n.name);
326
- let r = dr?.find((e) => e.id === x.project);
327
- x.project && e.test(x.project) && r && (t.project = it(r));
328
- let i = fr?.find((e) => String(e.number) === x.cycle);
329
- i && (t.cycle = i.id), x.saved && e.test(x.saved) && Q && (t.saved = ot(Q)), JSON.stringify(t) !== JSON.stringify(x) && Ut.current(t);
340
+ f(() => {
341
+ let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...S }, n = Cr?.find((e) => e.id === S.label);
342
+ S.label && e.test(S.label) && n && (t.label = n.name);
343
+ let r = wr?.find((e) => e.id === S.project);
344
+ S.project && e.test(S.project) && r && (t.project = at(r));
345
+ let i = Tr?.find((e) => String(e.number) === S.cycle);
346
+ i && (t.cycle = i.id), S.saved && e.test(S.saved) && Z && (t.saved = st(Z)), JSON.stringify(t) !== JSON.stringify(S) && Qt.current(t);
330
347
  }, [
331
- x,
332
- ur,
333
- dr,
334
- fr,
335
- Q
348
+ S,
349
+ Cr,
350
+ wr,
351
+ Tr,
352
+ Z
336
353
  ]);
337
- let pr = dt({
338
- ...x,
339
- ...A !== "updated" && { order: A },
340
- ...j !== "status" && { group: j },
341
- ...M && { layout: "board" }
342
- }), mr = Q ? !ft(Q.filters, pr) : Object.keys(pr).length > 0, hr = st(y, "create_issues", x.team ? { team: x.team } : void 0), gr = st(y, "save_views"), [_r, vr] = m(!1), [yr, br] = m(null), xr = h("savedViews"), $ = Gt?.user.username, Sr = !Q && !Z && (!x.assigneeKind && x.assignee === $ && !x.creator || x.creator === $ && !x.assignee), Cr = o ?? (Sr ? $ : void 0), wr = Q?.name ?? Z?.name ?? (o && o !== $ ? s("personIssues", { name: $t("user", o) }) : !x.assigneeKind && x.assignee === $ || x.creator === $ ? s("mine") : s("all")), Tr = h("workspace");
343
- tt(...Z && !Q ? [Tr("issues"), Z.name] : [wr]);
344
- let Er = mr && /* @__PURE__ */ _(Et, { children: [Q?.canEdit && /* @__PURE__ */ g(l, {
354
+ let Er = dt({
355
+ ...S,
356
+ ...j !== "updated" && { order: j },
357
+ ...M !== "status" && { group: M },
358
+ ...N && { layout: "board" }
359
+ }), Dr = Z && {
360
+ ...S.team && { team: S.team },
361
+ ...Z.filters
362
+ }, Or = Dr ? !ft(Dr, Er) : Object.keys(Er).length > 0, kr = ct(b, "create_issues", S.team ? { team: S.team } : void 0), Ar = ct(b, "save_views"), [jr, Mr] = h(!1), [Nr, Pr] = h(null), Q = g("savedViews"), $ = en?.user.username, Fr = !Z && !X && (!S.assigneeKind && S.assignee === $ && !S.creator || S.creator === $ && !S.assignee), Ir = o ?? (Fr ? $ : void 0), Lr = Z?.name ?? X?.name ?? (o && o !== $ ? s("personIssues", { name: ln("user", o) }) : !S.assigneeKind && S.assignee === $ || S.creator === $ ? s("mine") : s("all")), Rr = g("workspace");
363
+ nt(...X && !Z ? [Rr("issues"), X.name] : [Lr]);
364
+ let zr = Dt(Ht, Vt), Br = Wt(x && !o ? xr : [], Z, zr ? +!!Z : zt), Vr = Or && /* @__PURE__ */ v(Ot, { children: [Z?.canEdit && /* @__PURE__ */ _(u, {
345
365
  type: "button",
346
366
  size: "sm",
347
- loading: lr.isPending,
348
- onClick: () => lr.mutate({
349
- id: Q.id,
350
- filters: pr
367
+ loading: br.isPending,
368
+ onClick: () => br.mutate({
369
+ id: Z.id,
370
+ filters: Z.filters.team ? Er : Rt(Er)
351
371
  }),
352
- children: xr("update")
353
- }), /* @__PURE__ */ g(l, {
372
+ children: Q("update")
373
+ }), /* @__PURE__ */ _(u, {
354
374
  type: "button",
355
375
  size: "sm",
356
- onClick: () => vr(!0),
357
- children: xr(Q ? "saveAsNew" : "save")
376
+ onClick: () => Mr(!0),
377
+ children: Q(Z ? "saveAsNew" : "save")
358
378
  })] });
359
- return /* @__PURE__ */ _("div", {
379
+ return /* @__PURE__ */ v("div", {
360
380
  className: "flex h-full flex-col",
361
381
  children: [
362
- /* @__PURE__ */ _("header", {
382
+ /* @__PURE__ */ v("header", {
363
383
  className: "flex min-h-12 shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-2 md:px-5",
364
384
  children: [
365
- /* @__PURE__ */ g("h1", {
385
+ /* @__PURE__ */ _("h1", {
366
386
  className: "text-sm font-semibold whitespace-nowrap",
367
- children: wr
387
+ children: Lr
368
388
  }),
369
- /* @__PURE__ */ g(ie, {
370
- workspace: y,
389
+ /* @__PURE__ */ _(ae, {
390
+ workspace: b,
371
391
  kind: "view",
372
- target: or,
373
- label: w === "active" ? wr : s("favoriteLabel", {
374
- title: wr,
375
- view: s(`views.${w}`)
392
+ target: _r,
393
+ label: T === "active" ? Lr : s("favoriteLabel", {
394
+ title: Lr,
395
+ view: s(`views.${T}`)
376
396
  })
377
397
  }),
378
- Cr && /* @__PURE__ */ g(bt, {
398
+ Ir && /* @__PURE__ */ _(xt, {
379
399
  variant: "segmented",
380
400
  size: "sm",
381
401
  label: s("mineScope"),
382
402
  items: ["assigned", "created"].map((e) => ({
383
403
  value: e,
384
404
  label: s(`mineScopes.${e}`),
385
- href: Ht({
386
- ...x.view && { view: x.view },
387
- ...e === "assigned" ? { assignee: Cr } : { creator: Cr }
405
+ href: Zt({
406
+ ...S.view && { view: S.view },
407
+ ...e === "assigned" ? { assignee: Ir } : { creator: Ir }
388
408
  })
389
409
  })),
390
- value: x.creator ? "created" : "assigned"
410
+ value: S.creator ? "created" : "assigned"
411
+ }),
412
+ Z && /* @__PURE__ */ _(Ft, {
413
+ visible: !0,
414
+ items: () => Sr.menu(Z),
415
+ label: Bt("moreActionsFor", { name: Z.name })
391
416
  }),
392
- /* @__PURE__ */ g(bt, {
417
+ /* @__PURE__ */ _(xt, {
393
418
  variant: "segmented",
394
419
  size: "sm",
395
420
  label: s("view"),
396
- items: Object.keys(Je).map((e) => ({
421
+ items: [...Object.keys(Ye).map((e) => ({
397
422
  value: e,
398
423
  label: s(`views.${e}`),
399
- href: Ht(c(x, "view", e === "active" ? void 0 : e))
400
- })),
401
- value: w
424
+ href: Zt(Z ? {
425
+ ...S.team && { team: S.team },
426
+ ...e !== "active" && { view: e }
427
+ } : c(S, "view", e === "active" ? void 0 : e))
428
+ })), ...Br.shown.map((e) => ({
429
+ value: Ut(e),
430
+ label: e.name,
431
+ href: l(b, {
432
+ ...ht(e),
433
+ team: e.filters.team ?? S.team
434
+ })
435
+ }))],
436
+ value: Z ? Ut(Z) : T,
437
+ className: "max-w-full flex-wrap",
438
+ end: Br.more.length > 0 && /* @__PURE__ */ _(gt, {
439
+ label: Q("title"),
440
+ items: Br.more.map((e) => ({
441
+ label: e.name,
442
+ href: l(b, {
443
+ ...ht(e),
444
+ team: e.filters.team ?? S.team
445
+ })
446
+ })),
447
+ trigger: /* @__PURE__ */ _(u, {
448
+ size: "sm",
449
+ variant: "ghost",
450
+ children: Q("more", { count: Br.more.length })
451
+ })
452
+ })
402
453
  }),
403
- /* @__PURE__ */ _("div", {
454
+ /* @__PURE__ */ v("div", {
404
455
  className: "flex w-full min-w-0 flex-wrap items-center gap-2 md:ml-auto md:w-auto md:flex-nowrap",
405
456
  children: [
406
- ar.count === 0 && Er,
407
- /* @__PURE__ */ g(vt, {
408
- ref: Jt,
409
- value: T,
410
- onValueChange: qt,
411
- onKeyDown: (e) => e.key === "Escape" && !T && e.currentTarget.blur(),
457
+ gr.count === 0 && Vr,
458
+ /* @__PURE__ */ _(yt, {
459
+ ref: rn,
460
+ value: E,
461
+ onValueChange: nn,
462
+ onKeyDown: (e) => e.key === "Escape" && !E && e.currentTarget.blur(),
412
463
  placeholder: s("search"),
413
464
  label: s("search"),
414
465
  "aria-keyshortcuts": "/ Meta+F Control+F",
415
466
  size: "sm",
416
467
  className: "min-w-0 flex-1 max-md:order-first max-md:basis-full md:w-56 md:flex-initial"
417
468
  }),
418
- /* @__PURE__ */ g(jt, { filters: ar }),
419
- /* @__PURE__ */ _(a, {
469
+ /* @__PURE__ */ _(Nt, { filters: gr }),
470
+ /* @__PURE__ */ v(ie, {
420
471
  layouts: [{
421
472
  value: "list",
422
473
  label: s("layouts.list"),
423
- icon: /* @__PURE__ */ g(Se, {})
474
+ icon: /* @__PURE__ */ _(Ce, {})
424
475
  }, {
425
476
  value: "board",
426
477
  label: s("layouts.board"),
427
- icon: /* @__PURE__ */ g(ve, {})
478
+ icon: /* @__PURE__ */ _(ye, {})
428
479
  }],
429
- layout: M ? "board" : "list",
480
+ layout: N ? "board" : "list",
430
481
  onLayoutChange: (e) => {
431
- Re({ layout: e }), S(c(x, "layout", e === "board" ? "board" : void 0));
482
+ ze({ layout: e }), C(c(S, "layout", e === "board" ? "board" : void 0));
432
483
  },
433
- changed: A !== "updated" || j !== "status" || M,
484
+ changed: j !== "updated" || M !== "status" || N,
434
485
  children: [
435
- /* @__PURE__ */ g(_t, {
486
+ /* @__PURE__ */ _(vt, {
436
487
  label: s("orderBy"),
437
- children: /* @__PURE__ */ g(yt, {
438
- value: A,
439
- items: [...Ke.map((e) => ({
488
+ children: /* @__PURE__ */ _(bt, {
489
+ value: j,
490
+ items: [...qe.map((e) => ({
440
491
  value: e,
441
492
  label: s(`order.${e}`)
442
- })), ...O.filter((e) => Ne.includes(e.kind)).map((e) => ({
493
+ })), ...k.filter((e) => Pe.includes(e.kind)).map((e) => ({
443
494
  value: `field:${e.id}`,
444
495
  label: e.name
445
496
  }))],
446
497
  onValueChange: (e) => {
447
- Re({ order: e }), S(c(x, "order", e === "updated" ? void 0 : e));
498
+ ze({ order: e }), C(c(S, "order", e === "updated" ? void 0 : e));
448
499
  },
449
500
  "aria-label": s("orderBy"),
450
501
  size: "sm"
451
502
  })
452
503
  }),
453
- /* @__PURE__ */ g(_t, {
504
+ /* @__PURE__ */ _(vt, {
454
505
  label: s("groupBy"),
455
- children: /* @__PURE__ */ g(yt, {
456
- value: j,
457
- items: [...He.map((e) => ({
506
+ children: /* @__PURE__ */ _(bt, {
507
+ value: M,
508
+ items: [...Ue.map((e) => ({
458
509
  value: e,
459
510
  label: s(`grouping.${e}`)
460
- })), ...O.filter((e) => Me.includes(e.kind)).map((e) => ({
511
+ })), ...k.filter((e) => Ne.includes(e.kind)).map((e) => ({
461
512
  value: `field:${e.id}`,
462
513
  label: e.name
463
514
  }))],
464
515
  onValueChange: (e) => {
465
- Re({ group: e }), S(c(x, "group", e === "status" ? void 0 : e));
516
+ ze({ group: e }), C(c(S, "group", e === "status" ? void 0 : e));
466
517
  },
467
518
  "aria-label": s("groupBy"),
468
519
  size: "sm"
469
520
  })
470
521
  }),
471
- O.length > 0 && /* @__PURE__ */ g(_t, {
472
- label: k("onRows"),
473
- children: /* @__PURE__ */ g(yt, {
522
+ k.length > 0 && /* @__PURE__ */ _(vt, {
523
+ label: A("onRows"),
524
+ children: /* @__PURE__ */ _(bt, {
474
525
  multiple: !0,
475
- value: sn.filter((e) => O.some((t) => t.id === e)),
476
- items: O.map((e) => ({
526
+ value: gn.filter((e) => k.some((t) => t.id === e)),
527
+ items: k.map((e) => ({
477
528
  value: e.id,
478
529
  label: e.name
479
530
  })),
480
531
  onValueChange: (e) => {
481
- ze(y, e), cn(e);
532
+ Be(b, e), _n(e);
482
533
  },
483
- placeholder: k("noneOnRows"),
484
- "aria-label": k("onRows"),
534
+ placeholder: A("noneOnRows"),
535
+ "aria-label": A("onRows"),
485
536
  size: "sm"
486
537
  })
487
538
  })
488
539
  ]
489
540
  }),
490
- /* @__PURE__ */ g(u, {
541
+ /* @__PURE__ */ _(d, {
491
542
  variant: "secondary",
492
543
  size: "sm",
493
- icon: /* @__PURE__ */ g(Ce, { className: "size-3.5" }),
494
- label: s(N ? "hidePanel" : "showPanel"),
495
- "aria-pressed": N,
496
- onClick: dn,
544
+ icon: /* @__PURE__ */ _(we, { className: "size-3.5" }),
545
+ label: s(P ? "hidePanel" : "showPanel"),
546
+ "aria-pressed": P,
547
+ onClick: bn,
497
548
  className: "max-xl:hidden"
498
549
  }),
499
- /* @__PURE__ */ g(u, {
550
+ /* @__PURE__ */ _(d, {
500
551
  variant: "secondary",
501
552
  size: "sm",
502
- icon: /* @__PURE__ */ g(ye, { className: "size-3.5" }),
503
- label: s(fn ? "hideInsights" : "showInsights"),
504
- "aria-pressed": fn,
505
- onClick: mn
553
+ icon: /* @__PURE__ */ _(be, { className: "size-3.5" }),
554
+ label: s(xn ? "hideInsights" : "showInsights"),
555
+ "aria-pressed": xn,
556
+ onClick: Cn
506
557
  }),
507
- /* @__PURE__ */ g(u, {
558
+ /* @__PURE__ */ _(d, {
508
559
  variant: "secondary",
509
560
  size: "sm",
510
- icon: /* @__PURE__ */ g(xe, { className: "size-3.5" }),
561
+ icon: /* @__PURE__ */ _(Se, { className: "size-3.5" }),
511
562
  label: s("exportCsv"),
512
- onClick: () => zt(y, Xt)
563
+ onClick: () => Jt(b, on)
513
564
  }),
514
- x.team && hr && /* @__PURE__ */ g(u, {
565
+ S.team && kr && /* @__PURE__ */ _(d, {
515
566
  variant: "secondary",
516
567
  size: "sm",
517
- icon: /* @__PURE__ */ g(we, { className: "size-3.5" }),
568
+ icon: /* @__PURE__ */ _(Te, { className: "size-3.5" }),
518
569
  label: s("importCsv"),
519
- onClick: () => ge((e, t) => br({
570
+ onClick: () => _e((e, t) => Pr({
520
571
  name: e,
521
572
  text: t
522
573
  }))
@@ -525,160 +576,161 @@ function It({ person: o } = {}) {
525
576
  })
526
577
  ]
527
578
  }),
528
- /* @__PURE__ */ g(At, {
529
- filters: ar,
530
- trailing: Er,
579
+ /* @__PURE__ */ _(Mt, {
580
+ filters: gr,
581
+ trailing: Vr,
531
582
  className: "shrink-0 border-b border-border px-4 py-2 md:px-5"
532
583
  }),
533
- fn && /* @__PURE__ */ g(_e, {
534
- workspace: y,
535
- issues: On
584
+ xn && /* @__PURE__ */ _(ve, {
585
+ workspace: b,
586
+ issues: Rn
536
587
  }),
537
- yr && x.team && /* @__PURE__ */ g(he, {
538
- workspace: y,
539
- team: x.team,
540
- file: yr,
541
- onClose: () => br(null)
588
+ Nr && S.team && /* @__PURE__ */ _(ge, {
589
+ workspace: b,
590
+ team: S.team,
591
+ file: Nr,
592
+ onClose: () => Pr(null)
542
593
  }),
543
- _r && /* @__PURE__ */ g(De, {
544
- title: xr("saveTitle"),
545
- submitLabel: xr("save"),
546
- share: { allowed: gr },
547
- onClose: () => vr(!1),
594
+ jr && /* @__PURE__ */ _(Oe, {
595
+ title: Q("saveTitle"),
596
+ submitLabel: Q("save"),
597
+ share: { allowed: Ar },
598
+ onClose: () => Mr(!1),
548
599
  onSubmit: async ({ name: e, shared: t }) => {
549
- let n = await cr.mutateAsync({
600
+ let n = await yr.mutateAsync({
550
601
  name: e,
551
602
  shared: t,
552
- filters: pr
603
+ filters: Er
553
604
  });
554
- S(mt(n), !0);
605
+ C(ht(n), !0);
555
606
  }
556
607
  }),
557
- /* @__PURE__ */ g(gt, {
558
- open: !!tr,
559
- onClose: () => nr(null),
608
+ /* @__PURE__ */ _(_t, {
609
+ open: !!fr,
610
+ onClose: () => pr(null),
560
611
  onConfirm: () => {
561
- tr?.(), nr(null), Qn();
612
+ fr?.(), pr(null), lr();
562
613
  },
563
614
  title: s("archiveTitle", { count: G.size || 1 }),
564
615
  description: s("archiveDescription"),
565
616
  confirmLabel: s("archiveConfirm"),
566
617
  destructive: !0
567
618
  }),
568
- /* @__PURE__ */ _("div", {
619
+ /* @__PURE__ */ v("div", {
569
620
  className: "relative flex min-h-0 flex-1",
570
621
  children: [
571
- G.size > 0 && /* @__PURE__ */ _("div", {
572
- ref: $n,
622
+ G.size > 0 && /* @__PURE__ */ v("div", {
623
+ ref: ur,
573
624
  role: "toolbar",
574
625
  "aria-label": s("selected", { count: G.size }),
575
626
  className: "absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-1 rounded-xl border border-border bg-popover py-1 pr-1 pl-3 text-sm shadow-md",
576
627
  children: [
577
- /* @__PURE__ */ g("span", {
628
+ /* @__PURE__ */ _("span", {
578
629
  className: "whitespace-nowrap tabular-nums",
579
- children: Y ? Xn ? s("selectingAll", { count: Xn.total }) : s("selectingAllUncounted") : s("selected", { count: G.size })
630
+ children: J ? sr ? s("selectingAll", { count: sr.total }) : s("selectingAllUncounted") : s("selected", { count: G.size })
580
631
  }),
581
- !Y && (G.size < U.length || !B) && /* @__PURE__ */ g(l, {
632
+ !J && (G.size < U.length || !V) && /* @__PURE__ */ _(u, {
582
633
  size: "sm",
583
634
  variant: "ghost",
584
635
  className: "shrink-0",
585
- onClick: Zn,
586
- children: B ? s("selectAll", { count: U.length }) : s("selectAllMatching")
636
+ onClick: cr,
637
+ children: V ? s("selectAll", { count: U.length }) : s("selectAllMatching")
587
638
  }),
588
- /* @__PURE__ */ g(ht, {
639
+ /* @__PURE__ */ _(gt, {
589
640
  label: s("actions"),
590
- items: Rn(Un),
641
+ items: Jn($n),
591
642
  side: "top",
592
- trigger: /* @__PURE__ */ g(l, {
643
+ trigger: /* @__PURE__ */ _(u, {
593
644
  size: "sm",
594
645
  variant: "outline",
595
646
  className: "shrink-0",
596
647
  children: s("actions")
597
648
  })
598
649
  }),
599
- /* @__PURE__ */ g(u, {
650
+ /* @__PURE__ */ _(d, {
600
651
  size: "sm",
601
652
  variant: "ghost",
602
- icon: /* @__PURE__ */ g(be, {}),
653
+ icon: /* @__PURE__ */ _(xe, {}),
603
654
  label: s("clear"),
604
- onClick: Qn
655
+ onClick: lr
605
656
  })
606
657
  ]
607
658
  }),
608
- /* @__PURE__ */ _("div", {
609
- ref: ir,
610
- className: `min-h-0 min-w-0 flex-1 ${M ? "overflow-hidden" : "overflow-y-auto"} ${G.size > 0 ? "pb-16" : ""} transition-opacity ${Tn && !R ? "opacity-50" : ""}`,
659
+ /* @__PURE__ */ v("div", {
660
+ ref: hr,
661
+ className: `min-h-0 min-w-0 flex-1 ${N ? "overflow-hidden" : "overflow-y-auto"} ${G.size > 0 ? "pb-16" : ""} transition-opacity ${Pn && !z ? "opacity-50" : ""}`,
611
662
  children: [
612
- /* @__PURE__ */ g(oe, {
613
- workspace: y,
614
- issues: En,
615
- tabs: Fe,
616
- focus: _n,
617
- onFocus: vn,
663
+ /* @__PURE__ */ _(se, {
664
+ workspace: b,
665
+ issues: Fn,
666
+ tabs: Ie,
667
+ focus: En,
668
+ onFocus: Dn,
618
669
  className: "border-b border-border px-5 py-1.5"
619
670
  }),
620
- M && R && /* @__PURE__ */ g(ae, {
621
- workspace: y,
622
- columns: j === "status" && Je[w].categories.length > 0 ? H.filter((e) => e.issues.length > 0 || e.key === "completed" || Je[w].categories.includes(e.key)) : H,
623
- onMove: j === "none" ? void 0 : (e, t, n) => zn(e, j, t, n, H.find((e) => e.key === n)?.issues[0], on),
624
- onContextMenu: qn
671
+ N && z && /* @__PURE__ */ _(oe, {
672
+ workspace: b,
673
+ columns: M === "status" && Ye[T].categories.length > 0 ? H.filter((e) => e.issues.length > 0 || e.key === "completed" || Ye[T].categories.includes(e.key)) : H,
674
+ onMove: M === "none" ? void 0 : (e, t, n) => Yn(e, M, t, n, H.find((e) => e.key === n)?.issues[0], hn),
675
+ onContextMenu: ir
625
676
  }),
626
- !M && /* @__PURE__ */ g(me, {
677
+ !N && /* @__PURE__ */ _(he, {
627
678
  groups: H,
628
- count: Nn,
629
- scrollRef: ir,
679
+ count: Un,
680
+ scrollRef: hr,
630
681
  keepInView: W?.id,
631
- onMore: L.loadMore,
632
- moreLabel: It("loading"),
633
- renderRow: (e, t) => /* @__PURE__ */ g(Lt, {
682
+ onMore: R.loadMore,
683
+ moreLabel: Bt("loading"),
684
+ renderRow: (e, t) => /* @__PURE__ */ _(Kt, {
634
685
  issue: e,
635
- index: An.get(e.id) ?? -1,
686
+ index: Bn.get(e.id) ?? -1,
636
687
  place: t,
637
- team: Pn.get(e.teamId),
638
- workspace: y,
688
+ team: Wn.get(e.teamId),
689
+ workspace: b,
639
690
  selected: e.id === W?.id,
640
691
  picked: G.has(e.id),
641
- viewers: Vn.get(e.identifier) ?? Pt,
642
- fields: ln,
643
- actions: Jn
692
+ viewers: Zn.get(e.identifier) ?? Lt,
693
+ fields: vn,
694
+ actions: ar
644
695
  }, e.id)
645
696
  }),
646
- R && z && /* @__PURE__ */ g("p", {
697
+ z && B && /* @__PURE__ */ _("p", {
647
698
  className: "flex h-10 items-center gap-2 px-5 text-xs text-muted-foreground",
648
699
  role: "status",
649
- children: Mn ? s("loadingCount", {
650
- loaded: V.length,
651
- total: Mn.total
652
- }) : s("loadingMore", { loaded: V.length })
700
+ children: Hn ? s("loadingCount", {
701
+ loaded: In.length,
702
+ total: Hn.total
703
+ }) : s("loadingMore", { loaded: In.length })
653
704
  }),
654
- !R && (wn ? /* @__PURE__ */ g(Ee, { error: wn }) : /* @__PURE__ */ g(Mt, { rows: 8 })),
655
- R && !z && V.length === 0 && /* @__PURE__ */ g(Rt, {
656
- workspace: y,
657
- filtered: !!x.q || w !== "active" || ar.count > +!!Bt,
658
- onCreate: () => Kt(x.team ? { team: x.team } : void 0)
705
+ !z && (Nn ? /* @__PURE__ */ _(De, { error: Nn }) : /* @__PURE__ */ _(Pt, { rows: 8 })),
706
+ z && !B && In.length === 0 && /* @__PURE__ */ _(qt, {
707
+ workspace: b,
708
+ filtered: !!S.q || T !== "active" || gr.count > +!!x,
709
+ onCreate: () => tn(S.team ? { team: S.team } : void 0)
659
710
  })
660
711
  ]
661
712
  }),
662
- N && F.data && /* @__PURE__ */ g("aside", {
663
- "aria-label": wt("issueBreakdown.label"),
713
+ P && I.data && /* @__PURE__ */ _("aside", {
714
+ "aria-label": Tt("issueBreakdown.label"),
664
715
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-4 xl:block",
665
- children: /* @__PURE__ */ g(se, {
666
- workspace: y,
667
- issues: En,
668
- tabs: Fe,
669
- tab: hn,
670
- onTabChange: gn,
671
- focus: _n,
672
- onFocus: vn
716
+ children: /* @__PURE__ */ _(ce, {
717
+ workspace: b,
718
+ issues: Fn,
719
+ tabs: Ie,
720
+ tab: wn,
721
+ onTabChange: Tn,
722
+ focus: En,
723
+ onFocus: Dn
673
724
  })
674
725
  })
675
726
  ]
676
- })
727
+ }),
728
+ Sr.dialogs
677
729
  ]
678
730
  });
679
731
  }
680
- var Lt = wt(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: ee, picked: te, viewers: ne, fields: re, actions: a }) {
681
- return /* @__PURE__ */ g(o, {
732
+ var Kt = Tt(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: ee, picked: te, viewers: ne, fields: re, actions: a }) {
733
+ return /* @__PURE__ */ _(o, {
682
734
  ref: n.ref,
683
735
  style: n.style,
684
736
  index: n.index,
@@ -695,20 +747,20 @@ var Lt = wt(function({ issue: e, index: t, place: n, team: r, workspace: i, sele
695
747
  onContextMenu: (t) => a.current.menu(t, e)
696
748
  });
697
749
  });
698
- function Rt({ workspace: e, filtered: t, onCreate: n }) {
699
- let r = h("issues.empty"), { data: i = [] } = v(re(e)), ee = st(e, "manage_teams");
700
- return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ _("div", {
750
+ function qt({ workspace: e, filtered: t, onCreate: n }) {
751
+ let r = g("issues.empty"), { data: i = [] } = y(re(e)), ee = ct(e, "manage_teams");
752
+ return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ v("div", {
701
753
  className: "mx-auto max-w-sm px-4 py-24 text-center",
702
754
  children: [
703
- /* @__PURE__ */ g("p", {
755
+ /* @__PURE__ */ _("p", {
704
756
  className: "text-sm font-medium",
705
757
  children: r(t ? "noMatch" : "nothingInProgress")
706
758
  }),
707
- /* @__PURE__ */ g("p", {
759
+ /* @__PURE__ */ _("p", {
708
760
  className: "mt-1 text-sm text-muted-foreground",
709
761
  children: r(t ? "tryAnother" : "pressC")
710
762
  }),
711
- !t && /* @__PURE__ */ g(l, {
763
+ !t && /* @__PURE__ */ _(u, {
712
764
  type: "button",
713
765
  variant: "primary",
714
766
  onClick: n,
@@ -716,18 +768,18 @@ function Rt({ workspace: e, filtered: t, onCreate: n }) {
716
768
  children: r("create")
717
769
  })
718
770
  ]
719
- }) : /* @__PURE__ */ _("div", {
771
+ }) : /* @__PURE__ */ v("div", {
720
772
  className: "mx-auto max-w-sm px-4 py-24 text-center",
721
773
  children: [
722
- /* @__PURE__ */ g("p", {
774
+ /* @__PURE__ */ _("p", {
723
775
  className: "text-sm font-medium",
724
776
  children: r("noTeamsTitle")
725
777
  }),
726
- /* @__PURE__ */ g("p", {
778
+ /* @__PURE__ */ _("p", {
727
779
  className: "mt-1 text-sm text-muted-foreground",
728
780
  children: r(ee ? "noTeamsDescription" : "noTeamsAskAdmin")
729
781
  }),
730
- ee && /* @__PURE__ */ g(l, {
782
+ ee && /* @__PURE__ */ _(u, {
731
783
  type: "button",
732
784
  variant: "primary",
733
785
  onClick: n,
@@ -737,7 +789,7 @@ function Rt({ workspace: e, filtered: t, onCreate: n }) {
737
789
  ]
738
790
  });
739
791
  }
740
- function zt(e, t) {
792
+ function Jt(e, t) {
741
793
  let n = new URLSearchParams({
742
794
  triage: "exclude",
743
795
  archived: "exclude"
@@ -746,4 +798,4 @@ function zt(e, t) {
746
798
  let r = document.createElement("a");
747
799
  r.href = `${s}/api/v1/workspaces/${encodeURIComponent(e)}/exports/issues.csv?${n}`, r.download = "", r.click();
748
800
  }
749
- export { It as IssueList };
801
+ export { b as IssueList };