@parallelworks/tandem-web 0.194.1 → 0.194.3

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