@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.
@@ -1,6 +1,6 @@
1
1
  import { useHost as e } from "../lib/host.js";
2
2
  import { useNavigate as t } from "../lib/router.js";
3
- import { docQuery as n, docsQuery as r, issueSearchQuery as i, knowledgeQuery as a, meQuery as o, teamsQuery as ee } from "../api/queries.js";
3
+ import { docQuery as n, docsQuery as r, issueSearchQuery as i, knowledgeQuery as a, meQuery as o, myTeamsQuery as ee } from "../api/queries.js";
4
4
  import { docPath as s, useDocActions as te } from "../lib/docs.js";
5
5
  import { AddIcon as c, AreaIcon as ne, CheckIcon as re, ChevronRightIcon as ie, CloseIcon as ae, CycleIcon as oe, FileTextIcon as l, InboxIcon as u, LibraryIcon as d, ListViewIcon as f, NotificationIcon as se, ProjectIcon as p, SearchIcon as ce, SettingsIcon as le, StatusIcon as ue, TriageIcon as de, UserIcon as m, UsersIcon as h } from "./icons.js";
6
6
  import { headingAnchor as fe, headings as pe } from "../lib/glossary.js";
@@ -1,163 +1,159 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { customerRequestsQuery as n, customersQuery as r } from "../api/queries.js";
3
- import { AddIcon as i, CloseIcon as a, LinkIcon as o, UsersIcon as s } from "./icons.js";
4
- import { useCan as c } from "../lib/roles.js";
5
- import { Button as l, Card as u, ErrorText as d, IconButton as f, Input as p, Textarea as m } from "@parallelworks/ui";
6
- import { useId as h, useState as g } from "react";
7
- import { useErrorMessage as _ } from "@parallelworks/problem/react";
8
- import { useTranslations as v } from "use-intl";
9
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
10
- import { useMutation as x, useQuery as S, useQueryClient as C } from "@tanstack/react-query";
3
+ import { invalidateIssueLists as i } from "../api/mutations.js";
4
+ import { AddIcon as a, CloseIcon as o, LinkIcon as s, UsersIcon as c } from "./icons.js";
5
+ import { useCan as l } from "../lib/roles.js";
6
+ import { Button as u, Card as d, ErrorText as f, IconButton as p, Input as m, Textarea as h } from "@parallelworks/ui";
7
+ import { useId as g, useState as _ } from "react";
8
+ import { useErrorMessage as v } from "@parallelworks/problem/react";
9
+ import { useTranslations as y } from "use-intl";
10
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
11
+ import { useMutation as S, useQuery as C, useQueryClient as w } from "@tanstack/react-query";
11
12
  // src/components/CustomerRequests.tsx
12
- function w({ workspace: w, identifier: T, enabled: E }) {
13
- let D = v("customerRequests"), O = _(), k = C(), A = c(w, "manage_customers"), j = A && E, { data: M = [] } = S(n(w, T)), { data: N = [] } = S({
14
- ...r(w),
15
- enabled: j
16
- }), [P, F] = g(!1), [I, L] = g(""), [R, z] = g(""), [B, V] = g(""), H = h(), U = () => {
17
- k.invalidateQueries({ queryKey: n(w, T).queryKey }), k.invalidateQueries({ queryKey: r(w).queryKey }), k.invalidateQueries({ queryKey: [
18
- "workspace",
19
- w,
20
- "issues",
21
- "list"
22
- ] });
23
- }, W = x({
13
+ function T({ workspace: T, identifier: E, enabled: D }) {
14
+ let O = y("customerRequests"), k = v(), A = w(), j = l(T, "manage_customers"), M = j && D, { data: N = [] } = C(n(T, E)), { data: P = [] } = C({
15
+ ...r(T),
16
+ enabled: M
17
+ }), [F, I] = _(!1), [L, R] = _(""), [z, B] = _(""), [V, H] = _(""), U = g(), W = () => {
18
+ A.invalidateQueries({ queryKey: n(T, E).queryKey }), A.invalidateQueries({ queryKey: r(T).queryKey }), i(A, T);
19
+ }, G = S({
24
20
  mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/requests", {
25
21
  params: { path: {
26
- workspace: w,
27
- identifier: T
22
+ workspace: T,
23
+ identifier: E
28
24
  } },
29
25
  body: {
30
- customerName: I.trim(),
31
- quote: R.trim(),
32
- url: B.trim()
26
+ customerName: L.trim(),
27
+ quote: z.trim(),
28
+ url: V.trim()
33
29
  }
34
30
  })),
35
31
  onSuccess: () => {
36
- F(!1), L(""), z(""), V("");
32
+ I(!1), R(""), B(""), H("");
37
33
  },
38
- onSettled: U
39
- }), G = x({
34
+ onSettled: W
35
+ }), K = S({
40
36
  mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/issues/{identifier}/requests/{requestId}", { params: { path: {
41
- workspace: w,
42
- identifier: T,
37
+ workspace: T,
38
+ identifier: E,
43
39
  requestId: n
44
40
  } } })),
45
- onSettled: U
41
+ onSettled: W
46
42
  });
47
- return M.length === 0 && !j ? null : /* @__PURE__ */ b("section", {
43
+ return N.length === 0 && !M ? null : /* @__PURE__ */ x("section", {
48
44
  className: "mt-6",
49
- "aria-label": D("label"),
45
+ "aria-label": O("label"),
50
46
  children: [
51
- /* @__PURE__ */ b("h2", {
47
+ /* @__PURE__ */ x("h2", {
52
48
  className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
53
- children: [D("label"), M.length > 0 && /* @__PURE__ */ y("span", {
49
+ children: [O("label"), N.length > 0 && /* @__PURE__ */ b("span", {
54
50
  className: "tabular-nums",
55
- children: M.length
51
+ children: N.length
56
52
  })]
57
53
  }),
58
- M.length > 0 && /* @__PURE__ */ y(u, {
54
+ N.length > 0 && /* @__PURE__ */ b(d, {
59
55
  size: "fill",
60
56
  padding: "none",
61
57
  divided: !0,
62
58
  interactive: !1,
63
- render: /* @__PURE__ */ y("ul", {}),
59
+ render: /* @__PURE__ */ b("ul", {}),
64
60
  className: "mt-1",
65
- children: M.map((e) => /* @__PURE__ */ b("li", {
61
+ children: N.map((e) => /* @__PURE__ */ x("li", {
66
62
  className: "flex items-start gap-2 px-3 py-2 text-sm",
67
63
  children: [
68
- /* @__PURE__ */ y(s, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground" }),
69
- /* @__PURE__ */ b("div", {
64
+ /* @__PURE__ */ b(c, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground" }),
65
+ /* @__PURE__ */ x("div", {
70
66
  className: "min-w-0 flex-1",
71
- children: [/* @__PURE__ */ y("span", {
67
+ children: [/* @__PURE__ */ b("span", {
72
68
  className: "font-medium",
73
69
  children: e.customer.name
74
- }), e.quote && /* @__PURE__ */ y("p", {
70
+ }), e.quote && /* @__PURE__ */ b("p", {
75
71
  className: "mt-0.5 whitespace-pre-wrap text-muted-foreground",
76
- children: D("quoted", { quote: e.quote })
72
+ children: O("quoted", { quote: e.quote })
77
73
  })]
78
74
  }),
79
- e.url && /* @__PURE__ */ b("a", {
75
+ e.url && /* @__PURE__ */ x("a", {
80
76
  href: e.url,
81
77
  target: "_blank",
82
78
  rel: "noreferrer",
83
79
  className: "inline-flex shrink-0 items-center gap-1 text-xs text-primary hover:underline",
84
- children: [/* @__PURE__ */ y(o, { className: "size-3" }), D("source")]
80
+ children: [/* @__PURE__ */ b(s, { className: "size-3" }), O("source")]
85
81
  }),
86
- A && /* @__PURE__ */ y(f, {
82
+ j && /* @__PURE__ */ b(p, {
87
83
  variant: "ghost",
88
84
  size: "sm",
89
- icon: /* @__PURE__ */ y(a, {}),
90
- label: D("remove", { name: e.customer.name }),
91
- onClick: () => G.mutate(e.id),
85
+ icon: /* @__PURE__ */ b(o, {}),
86
+ label: O("remove", { name: e.customer.name }),
87
+ onClick: () => K.mutate(e.id),
92
88
  className: "-my-1"
93
89
  })
94
90
  ]
95
91
  }, e.id))
96
92
  }),
97
- j && (P ? /* @__PURE__ */ b("form", {
93
+ M && (F ? /* @__PURE__ */ x("form", {
98
94
  className: "mt-2 grid gap-2",
99
95
  onSubmit: (e) => {
100
- e.preventDefault(), I.trim() && W.mutate();
96
+ e.preventDefault(), L.trim() && G.mutate();
101
97
  },
102
98
  children: [
103
- /* @__PURE__ */ y(p, {
99
+ /* @__PURE__ */ b(m, {
104
100
  autoFocus: !0,
105
101
  required: !0,
106
- list: H,
107
- value: I,
108
- onChange: (e) => L(e.target.value),
109
- placeholder: D("customer"),
110
- "aria-label": D("customer"),
102
+ list: U,
103
+ value: L,
104
+ onChange: (e) => R(e.target.value),
105
+ placeholder: O("customer"),
106
+ "aria-label": O("customer"),
111
107
  maxLength: 200
112
108
  }),
113
- /* @__PURE__ */ y("datalist", {
114
- id: H,
115
- children: N.map((e) => /* @__PURE__ */ y("option", { value: e.name }, e.id))
109
+ /* @__PURE__ */ b("datalist", {
110
+ id: U,
111
+ children: P.map((e) => /* @__PURE__ */ b("option", { value: e.name }, e.id))
116
112
  }),
117
- /* @__PURE__ */ y(m, {
118
- value: R,
119
- onChange: (e) => z(e.target.value),
120
- placeholder: D("quote"),
121
- "aria-label": D("quote"),
113
+ /* @__PURE__ */ b(h, {
114
+ value: z,
115
+ onChange: (e) => B(e.target.value),
116
+ placeholder: O("quote"),
117
+ "aria-label": O("quote"),
122
118
  maxLength: 4e3,
123
119
  rows: 2
124
120
  }),
125
- /* @__PURE__ */ y(p, {
121
+ /* @__PURE__ */ b(m, {
126
122
  type: "url",
127
- value: B,
128
- onChange: (e) => V(e.target.value),
129
- placeholder: D("url"),
130
- "aria-label": D("url"),
123
+ value: V,
124
+ onChange: (e) => H(e.target.value),
125
+ placeholder: O("url"),
126
+ "aria-label": O("url"),
131
127
  maxLength: 2e3
132
128
  }),
133
- W.isError && /* @__PURE__ */ y(d, {
129
+ G.isError && /* @__PURE__ */ b(f, {
134
130
  size: "md",
135
- children: O(W.error)
131
+ children: k(G.error)
136
132
  }),
137
- /* @__PURE__ */ b("div", {
133
+ /* @__PURE__ */ x("div", {
138
134
  className: "flex justify-end gap-2",
139
- children: [/* @__PURE__ */ y(l, {
135
+ children: [/* @__PURE__ */ b(u, {
140
136
  type: "button",
141
137
  size: "sm",
142
- onClick: () => F(!1),
143
- children: D("cancel")
144
- }), /* @__PURE__ */ y(l, {
138
+ onClick: () => I(!1),
139
+ children: O("cancel")
140
+ }), /* @__PURE__ */ b(u, {
145
141
  type: "submit",
146
142
  size: "sm",
147
143
  variant: "primary",
148
- loading: W.isPending,
149
- disabled: !I.trim(),
150
- children: D("add")
144
+ loading: G.isPending,
145
+ disabled: !L.trim(),
146
+ children: O("add")
151
147
  })]
152
148
  })
153
149
  ]
154
- }) : /* @__PURE__ */ b("button", {
150
+ }) : /* @__PURE__ */ x("button", {
155
151
  type: "button",
156
- onClick: () => F(!0),
152
+ onClick: () => I(!0),
157
153
  className: "mt-1.5 flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",
158
- children: [/* @__PURE__ */ y(i, { className: "size-3.5" }), D("addRequest")]
154
+ children: [/* @__PURE__ */ b(a, { className: "size-3.5" }), O("addRequest")]
159
155
  }))
160
156
  ]
161
157
  });
162
158
  }
163
- export { w as CustomerRequests };
159
+ export { T as CustomerRequests };
@@ -1,20 +1,20 @@
1
- import { customersQuery as e, cyclesQuery as t, labelsQuery as n, projectsQuery as r, statusesQuery as i, teamsQuery as ee } from "../api/queries.js";
2
- import { CalendarIcon as te, CycleIcon as a, FolderIcon as ne, PriorityIcon as o, ProjectIcon as s, StatusIcon as c, TagIcon as l, UserIcon as u, UsersIcon as d, usePriorityNames as f } from "./icons.js";
3
- import { usePeople as p } from "../lib/people.js";
4
- import { ProjectStatusIcon as m } from "./Planning.js";
5
- import { projectRef as h } from "../lib/projects.js";
6
- import { customFieldsQuery as g, fieldsFor as _, filterableKinds as re, formatFieldFilters as v, parseFieldFilters as y } from "../lib/customFields.js";
1
+ import { customersQuery as e, cyclesQuery as t, labelsQuery as n, myTeamsQuery as r, projectsQuery as i, statusesQuery as ee, teamsQuery as te } from "../api/queries.js";
2
+ import { CalendarIcon as a, CycleIcon as ne, FolderIcon as o, PriorityIcon as s, ProjectIcon as c, StatusIcon as l, TagIcon as u, UserIcon as d, UsersIcon as f, usePriorityNames as p } from "./icons.js";
3
+ import { usePeople as m } from "../lib/people.js";
4
+ import { ProjectStatusIcon as h } from "./Planning.js";
5
+ import { projectRef as g } from "../lib/projects.js";
6
+ import { customFieldsQuery as re, fieldsFor as ie, filterableKinds as _, formatFieldFilters as v, parseFieldFilters as y } from "../lib/customFields.js";
7
7
  import { issueTypesQuery as b } from "../lib/issueTypes.js";
8
8
  import { TypeIcon as x } from "./IssueTypes.js";
9
9
  import { statusRef as S } from "../lib/refs.js";
10
10
  import { Avatar as C } from "@parallelworks/ui";
11
- import { useMemo as w } from "react";
12
- import { useTranslations as T } from "use-intl";
13
- import { jsx as E } from "react/jsx-runtime";
14
- import { useQuery as D } from "@tanstack/react-query";
15
- import { useListFilters as O } from "@parallelworks/ui/list";
11
+ import { useMemo as ae } from "react";
12
+ import { useTranslations as w } from "use-intl";
13
+ import { jsx as T } from "react/jsx-runtime";
14
+ import { useQuery as E } from "@tanstack/react-query";
15
+ import { useListFilters as D } from "@parallelworks/ui/list";
16
16
  // src/components/IssueFilters.tsx
17
- var k = (e) => `field:${e}`, A = [
17
+ var O = (e) => `field:${e}`, k = [
18
18
  "team",
19
19
  "assignee",
20
20
  "assigneeKind",
@@ -28,8 +28,8 @@ var k = (e) => `field:${e}`, A = [
28
28
  "type",
29
29
  "fields",
30
30
  "overdue"
31
- ], j = (e) => `agent:${e}`;
32
- function M(e) {
31
+ ], A = (e) => `agent:${e}`;
32
+ function oe(e) {
33
33
  let t = [], n = (e, n) => {
34
34
  n && t.push({
35
35
  field: e,
@@ -37,7 +37,7 @@ function M(e) {
37
37
  values: [n]
38
38
  });
39
39
  };
40
- n("team", e.team), n("assignee", e.assignee && (e.assigneeKind === "agent" ? j(e.assignee) : e.assignee)), n("creator", e.creator);
40
+ n("team", e.team), n("assignee", e.assignee && (e.assigneeKind === "agent" ? A(e.assignee) : e.assignee)), n("creator", e.creator);
41
41
  for (let n of ["status", "priority"]) {
42
42
  let r = e[n]?.split(",").filter(Boolean) ?? [];
43
43
  r.length > 0 && t.push({
@@ -56,13 +56,13 @@ function M(e) {
56
56
  let i = /* @__PURE__ */ new Map();
57
57
  for (let t of y(e.fields)) i.set(t.field, [...i.get(t.field) ?? [], t.value]);
58
58
  for (let [e, n] of i) t.push({
59
- field: k(e),
59
+ field: O(e),
60
60
  op: "is",
61
61
  values: n
62
62
  });
63
63
  return n("overdue", e.overdue), t;
64
64
  }
65
- function ie(e) {
65
+ function se(e) {
66
66
  let t = {}, n = [];
67
67
  for (let r of e) {
68
68
  let e = r.values[0];
@@ -94,36 +94,36 @@ function ie(e) {
94
94
  }
95
95
  return n.length > 0 && (t.fields = v(n)), t;
96
96
  }
97
- function N(e, t) {
97
+ function j(e, t) {
98
98
  let n = { ...e };
99
- for (let e of A) delete n[e];
99
+ for (let e of k) delete n[e];
100
100
  return {
101
101
  ...n,
102
102
  ...t
103
103
  };
104
104
  }
105
- function P(v, A, N, P = !1) {
106
- let F = T("issueFilters"), I = T("planning"), { data: L = [] } = D(ee(v)), { data: R = [] } = D(n(v)), { data: z = [] } = D(r(v)), { data: B = [] } = D(e(v)), V = L.find((e) => e.key === A.team), { data: H = [] } = D({
105
+ function M(v, k, j, M = !1) {
106
+ let N = w("issueFilters"), P = w("planning"), { data: F = [] } = E(te(v)), { data: I = [] } = E(r(v)), L = I.some((e) => e.key === k.team) ? I : [...I, ...F.filter((e) => e.key === k.team)], { data: R = [] } = E(n(v)), { data: z = [] } = E(i(v)), { data: B = [] } = E(e(v)), V = L.find((e) => e.key === k.team), { data: H = [] } = E({
107
107
  ...t(v, V?.key ?? ""),
108
108
  enabled: !!V?.cyclesEnabled
109
- }), { data: U = [] } = D({
110
- ...i(v, V?.key ?? ""),
109
+ }), { data: U = [] } = E({
110
+ ...ee(v, V?.key ?? ""),
111
111
  enabled: !!V
112
- }), W = f(), { members: G, agents: K, person: q, agentName: J } = p(v), { data: Y } = D(g(v)), { data: X } = D(b(v)), Z = T("issueTypes"), Q = T("customFields"), ae = w(() => {
112
+ }), W = p(), { members: G, agents: K, person: q, agentName: J } = m(v), { data: Y } = E(re(v)), { data: X } = E(b(v)), Z = w("issueTypes"), Q = w("customFields"), ce = ae(() => {
113
113
  let e = {
114
114
  multiple: !1,
115
115
  operators: ["is"]
116
- }, t = (e) => e.name ? I("cycleNamed", {
116
+ }, t = (e) => e.name ? P("cycleNamed", {
117
117
  number: e.number,
118
118
  name: e.name
119
- }) : I("cycle", { number: e.number }), n = [
119
+ }) : P("cycle", { number: e.number }), n = [
120
120
  {
121
121
  key: "team",
122
- label: F("team"),
123
- icon: /* @__PURE__ */ E(ne, {}),
122
+ label: N("team"),
123
+ icon: /* @__PURE__ */ T(o, {}),
124
124
  kind: "enum",
125
125
  ...e,
126
- required: P,
126
+ required: M,
127
127
  options: L.filter((e) => !e.archivedAt).map((e) => ({
128
128
  value: e.key,
129
129
  label: e.name,
@@ -132,25 +132,25 @@ function P(v, A, N, P = !1) {
132
132
  },
133
133
  {
134
134
  key: "assignee",
135
- label: F("assignee"),
136
- icon: /* @__PURE__ */ E(u, {}),
135
+ label: N("assignee"),
136
+ icon: /* @__PURE__ */ T(d, {}),
137
137
  kind: "people",
138
138
  ...e,
139
139
  options: [...G.map((e) => ({
140
140
  value: e.user.username,
141
141
  label: e.user.name,
142
- group: F("people"),
143
- icon: /* @__PURE__ */ E(C, {
142
+ group: N("people"),
143
+ icon: /* @__PURE__ */ T(C, {
144
144
  name: e.user.name,
145
145
  src: e.user.avatarUrl,
146
146
  size: "xs",
147
147
  decorative: !0
148
148
  })
149
149
  })), ...K.map((e) => ({
150
- value: j(e.slug),
150
+ value: A(e.slug),
151
151
  label: e.name,
152
- group: F("agents"),
153
- icon: /* @__PURE__ */ E(C, {
152
+ group: N("agents"),
153
+ icon: /* @__PURE__ */ T(C, {
154
154
  name: e.name,
155
155
  kind: "agent",
156
156
  size: "xs",
@@ -161,14 +161,14 @@ function P(v, A, N, P = !1) {
161
161
  },
162
162
  {
163
163
  key: "creator",
164
- label: F("creator"),
165
- icon: /* @__PURE__ */ E(u, {}),
164
+ label: N("creator"),
165
+ icon: /* @__PURE__ */ T(d, {}),
166
166
  kind: "people",
167
167
  ...e,
168
168
  options: G.map((e) => ({
169
169
  value: e.user.username,
170
170
  label: e.user.name,
171
- icon: /* @__PURE__ */ E(C, {
171
+ icon: /* @__PURE__ */ T(C, {
172
172
  name: e.user.name,
173
173
  src: e.user.avatarUrl,
174
174
  size: "xs",
@@ -179,8 +179,8 @@ function P(v, A, N, P = !1) {
179
179
  },
180
180
  {
181
181
  key: "priority",
182
- label: F("priority"),
183
- icon: /* @__PURE__ */ E(o, { priority: 2 }),
182
+ label: N("priority"),
183
+ icon: /* @__PURE__ */ T(s, { priority: 2 }),
184
184
  kind: "enum",
185
185
  operators: ["is"],
186
186
  options: [
@@ -192,83 +192,83 @@ function P(v, A, N, P = !1) {
192
192
  ].map((e) => ({
193
193
  value: String(e),
194
194
  label: W[e] ?? "",
195
- icon: /* @__PURE__ */ E(o, { priority: e })
195
+ icon: /* @__PURE__ */ T(s, { priority: e })
196
196
  }))
197
197
  },
198
198
  {
199
199
  key: "label",
200
- label: F("label"),
201
- icon: /* @__PURE__ */ E(l, {}),
200
+ label: N("label"),
201
+ icon: /* @__PURE__ */ T(u, {}),
202
202
  kind: "enum",
203
203
  ...e,
204
204
  options: R.map((e) => ({
205
205
  value: e.name,
206
206
  label: e.name,
207
- icon: /* @__PURE__ */ E("span", {
207
+ icon: /* @__PURE__ */ T("span", {
208
208
  className: "size-2 rounded-full",
209
209
  style: { background: e.color }
210
210
  })
211
211
  })),
212
- valueLabel: () => F("deletedLabel")
212
+ valueLabel: () => N("deletedLabel")
213
213
  },
214
214
  {
215
215
  key: "project",
216
- label: F("project"),
217
- icon: /* @__PURE__ */ E(s, {}),
216
+ label: N("project"),
217
+ icon: /* @__PURE__ */ T(c, {}),
218
218
  kind: "enum",
219
219
  ...e,
220
220
  options: z.map((e) => ({
221
- value: h(e),
221
+ value: g(e),
222
222
  label: e.name,
223
- icon: /* @__PURE__ */ E(m, { status: e.status })
223
+ icon: /* @__PURE__ */ T(h, { status: e.status })
224
224
  }))
225
225
  }
226
226
  ];
227
- (B.length > 0 || A.customer) && n.push({
227
+ (B.length > 0 || k.customer) && n.push({
228
228
  key: "customer",
229
- label: F("customer"),
230
- icon: /* @__PURE__ */ E(d, {}),
229
+ label: N("customer"),
230
+ icon: /* @__PURE__ */ T(f, {}),
231
231
  kind: "enum",
232
232
  ...e,
233
233
  options: B.map((e) => ({
234
234
  value: e.id,
235
235
  label: e.name
236
236
  }))
237
- }), (V || A.status) && n.splice(3, 0, {
237
+ }), (V || k.status) && n.splice(3, 0, {
238
238
  key: "status",
239
- label: F("status"),
240
- icon: /* @__PURE__ */ E(c, { category: "started" }),
239
+ label: N("status"),
240
+ icon: /* @__PURE__ */ T(l, { category: "started" }),
241
241
  kind: "enum",
242
242
  operators: ["is"],
243
243
  options: U.map((e) => ({
244
244
  value: S(e),
245
245
  label: e.name,
246
- icon: /* @__PURE__ */ E(c, { category: e.category })
246
+ icon: /* @__PURE__ */ T(l, { category: e.category })
247
247
  }))
248
- }), (V?.cyclesEnabled || A.cycle) && n.push({
248
+ }), (V?.cyclesEnabled || k.cycle) && n.push({
249
249
  key: "cycle",
250
- label: F("cycle"),
251
- icon: /* @__PURE__ */ E(a, {}),
250
+ label: N("cycle"),
251
+ icon: /* @__PURE__ */ T(ne, {}),
252
252
  kind: "enum",
253
253
  ...e,
254
254
  options: H.map((e) => ({
255
255
  value: String(e.number),
256
256
  label: t(e),
257
- description: I(`states.${e.state}`)
257
+ description: P(`states.${e.state}`)
258
258
  }))
259
259
  });
260
260
  let r = (X ?? []).filter((e) => !e.archivedAt && (!V || e.teamIds.length === 0 || e.teamIds.includes(V.id)));
261
- (r.length > 0 || A.type) && n.push({
261
+ (r.length > 0 || k.type) && n.push({
262
262
  key: "type",
263
263
  label: Z("type"),
264
- icon: /* @__PURE__ */ E(l, {}),
264
+ icon: /* @__PURE__ */ T(u, {}),
265
265
  kind: "enum",
266
266
  multiple: !0,
267
267
  operators: ["is"],
268
268
  options: [...r.map((e) => ({
269
269
  value: e.id,
270
270
  label: e.name,
271
- icon: /* @__PURE__ */ E(x, {
271
+ icon: /* @__PURE__ */ T(x, {
272
272
  type: e,
273
273
  className: "size-3.5"
274
274
  })
@@ -277,23 +277,23 @@ function P(v, A, N, P = !1) {
277
277
  label: Z("noType")
278
278
  }]
279
279
  });
280
- let i = new Set(y(A.fields).map((e) => e.field));
281
- for (let e of (Y ?? []).filter((e) => e.target === "issue" && re.includes(e.kind) && (_([e], "issue", V?.id).length > 0 || i.has(e.id)))) {
280
+ let i = new Set(y(k.fields).map((e) => e.field));
281
+ for (let e of (Y ?? []).filter((e) => e.target === "issue" && _.includes(e.kind) && (ie([e], "issue", V?.id).length > 0 || i.has(e.id)))) {
282
282
  let t = {
283
283
  value: "none",
284
284
  label: Q("noValue")
285
285
  };
286
286
  n.push({
287
- key: k(e.id),
287
+ key: O(e.id),
288
288
  label: e.name,
289
- icon: /* @__PURE__ */ E(l, {}),
289
+ icon: /* @__PURE__ */ T(u, {}),
290
290
  kind: "enum",
291
291
  multiple: !0,
292
292
  operators: ["is"],
293
293
  options: e.kind === "person" ? [...G.map((e) => ({
294
294
  value: e.user.username,
295
295
  label: e.user.name,
296
- icon: /* @__PURE__ */ E(C, {
296
+ icon: /* @__PURE__ */ T(C, {
297
297
  name: e.user.name,
298
298
  src: e.user.avatarUrl,
299
299
  size: "xs",
@@ -305,7 +305,7 @@ function P(v, A, N, P = !1) {
305
305
  }, t] : [...e.options.map((e) => ({
306
306
  value: e.id ?? "",
307
307
  label: e.name,
308
- ...e.color && { icon: /* @__PURE__ */ E("span", {
308
+ ...e.color && { icon: /* @__PURE__ */ T("span", {
309
309
  className: "size-2 rounded-full",
310
310
  style: { background: e.color }
311
311
  }) }
@@ -314,47 +314,47 @@ function P(v, A, N, P = !1) {
314
314
  }
315
315
  return n.push({
316
316
  key: "overdue",
317
- label: F("overdue"),
318
- icon: /* @__PURE__ */ E(te, {}),
317
+ label: N("overdue"),
318
+ icon: /* @__PURE__ */ T(a, {}),
319
319
  kind: "boolean"
320
320
  }), n;
321
321
  }, [
322
322
  X,
323
323
  Z,
324
- A.type,
324
+ k.type,
325
325
  Y,
326
326
  Q,
327
- A.fields,
328
- F,
329
- I,
327
+ k.fields,
328
+ N,
329
+ P,
330
330
  L,
331
331
  G,
332
332
  K,
333
333
  R,
334
334
  z,
335
335
  B,
336
- A.customer,
336
+ k.customer,
337
337
  H,
338
338
  U,
339
339
  W,
340
340
  V,
341
- A.cycle,
342
- A.status,
341
+ k.cycle,
342
+ k.status,
343
343
  q,
344
344
  J,
345
- P
346
- ]), $ = M(A), oe = {
345
+ M
346
+ ]), $ = oe(k), le = {
347
347
  value: $.length > 0 ? $ : null,
348
348
  onChange: (e) => {
349
- let t = ie(e);
350
- t.team !== A.team && delete t.status, N(t);
349
+ let t = se(e);
350
+ t.team !== k.team && delete t.status, j(t);
351
351
  }
352
352
  };
353
- return O({
353
+ return D({
354
354
  storageKey: `issues:${v}`,
355
- fields: ae,
356
- store: oe,
355
+ fields: ce,
356
+ store: le,
357
357
  remember: !1
358
358
  });
359
359
  }
360
- export { P as useIssueFilters, N as withIssueFilters };
360
+ export { M as useIssueFilters, j as withIssueFilters };