@parallelworks/tandem-web 0.189.9 → 0.189.11

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