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