@upstep/js 0.9.0 → 0.11.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/dist/react.js CHANGED
@@ -1,204 +1,206 @@
1
- import { jsxs as a, Fragment as R, jsx as t } from "react/jsx-runtime";
2
- import J, { createContext as K, useState as m, useEffect as v, useCallback as C, useContext as Q, useRef as X } from "react";
3
- import { U as Z } from "./api-CROQwfAo.mjs";
4
- import { scaleRadius as b, DEFAULT_ACCENT as ee, buildWidgetPalette as te, withAlpha as ne } from "./theme.js";
5
- const oe = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
6
- function N(o, e) {
7
- return ne(o, e) ?? `color-mix(in srgb, ${o} ${Math.round(e * 100)}%, transparent)`;
1
+ import { jsxs as s, Fragment as R, jsx as t } from "react/jsx-runtime";
2
+ import X, { createContext as Z, useState as x, useEffect as w, useCallback as z, useContext as ee, useRef as te } from "react";
3
+ import { U as oe } from "./api-CROQwfAo.mjs";
4
+ import { scaleRadius as b, DEFAULT_ACCENT as ne, buildWidgetPalette as re, withAlpha as ie } from "./theme.js";
5
+ const le = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
6
+ function j(n, e) {
7
+ return ie(n, e) ?? `color-mix(in srgb, ${n} ${Math.round(e * 100)}%, transparent)`;
8
8
  }
9
- function P() {
9
+ function H() {
10
10
  if (typeof document > "u") return !1;
11
- const o = document.documentElement;
12
- return o.classList.contains("dark") || o.getAttribute("data-theme") === "dark";
11
+ const n = document.documentElement;
12
+ return n.classList.contains("dark") || n.getAttribute("data-theme") === "dark";
13
13
  }
14
- function re(o, e) {
15
- const [n, c] = m(() => o === "dark");
16
- v(() => {
17
- if (o !== "auto") {
18
- c(o === "dark");
14
+ function se(n, e) {
15
+ const [o, p] = x(() => n === "dark");
16
+ w(() => {
17
+ if (n !== "auto") {
18
+ p(n === "dark");
19
19
  return;
20
20
  }
21
- if (c(P()), typeof MutationObserver > "u") return;
22
- const d = new MutationObserver(() => c(P()));
23
- return d.observe(document.documentElement, {
21
+ if (p(H()), typeof MutationObserver > "u") return;
22
+ const a = new MutationObserver(() => p(H()));
23
+ return a.observe(document.documentElement, {
24
24
  attributes: !0,
25
25
  attributeFilter: ["class", "data-theme"]
26
- }), () => d.disconnect();
27
- }, [o]);
28
- const { accentColor: g, colors: p, radius: i } = e;
29
- return J.useMemo(
30
- () => te({
31
- mode: n ? "dark" : "light",
32
- accentColor: g,
33
- colors: p,
34
- radius: i
26
+ }), () => a.disconnect();
27
+ }, [n]);
28
+ const { accentColor: c, colors: y, radius: r } = e;
29
+ return X.useMemo(
30
+ () => re({
31
+ mode: o ? "dark" : "light",
32
+ accentColor: c,
33
+ colors: y,
34
+ radius: r
35
35
  }),
36
36
  // `colors` is usually an inline object literal, so compare it by value.
37
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
38
- [n, g, JSON.stringify(p ?? null), i]
38
+ [o, c, JSON.stringify(y ?? null), r]
39
39
  );
40
40
  }
41
- const O = K(null);
42
- function be({
43
- children: o,
41
+ const G = Z(null);
42
+ function ke({
43
+ children: n,
44
44
  ...e
45
45
  }) {
46
- const [n] = m(() => new Z(e)), [c, g] = m([]), [p, i] = m(!1), [d, l] = m(!0);
47
- v(() => {
48
- n.setUserId(e.userId);
49
- }, [n, e.userId]), v(() => {
50
- n.supportIdentityToken = e.supportIdentityToken, document.querySelectorAll("iframe[data-upstep-support]").forEach(
51
- (s) => {
52
- var u;
53
- return (u = s.contentWindow) == null ? void 0 : u.postMessage(
46
+ const [o] = x(() => new oe(e)), [p, c] = x([]), [y, r] = x(!1), [a, k] = x(!0);
47
+ w(() => {
48
+ o.setUserId(e.userId);
49
+ }, [o, e.userId]), w(() => {
50
+ o.supportIdentityToken = e.supportIdentityToken, document.querySelectorAll("iframe[data-upstep-support]").forEach(
51
+ (h) => {
52
+ var v;
53
+ return (v = h.contentWindow) == null ? void 0 : v.postMessage(
54
54
  {
55
55
  type: "upstep:support:identity",
56
56
  token: e.supportIdentityToken
57
57
  },
58
- new URL(n.baseUrl).origin
58
+ new URL(o.baseUrl).origin
59
59
  );
60
60
  }
61
61
  );
62
- }, [n, e.supportIdentityToken]);
63
- const r = C(async () => {
62
+ }, [o, e.supportIdentityToken]);
63
+ const i = z(async () => {
64
64
  try {
65
- const s = await n.listFeedback({ sort: "votes", limit: 20 });
66
- g(s.items), l(s.showBranding ?? !0);
65
+ const h = await o.listFeedback({ sort: "votes", limit: 20 });
66
+ c(h.items), k(h.showBranding ?? !0);
67
67
  } catch {
68
68
  }
69
- }, [n]);
70
- v(() => {
71
- r();
72
- }, [r]);
73
- const y = C(
74
- async (s, u, S) => {
75
- const h = { content: u };
76
- s.trim() && (h.title = s.trim()), S !== void 0 && (h.type = S), await n.submitFeedback(h), await r();
69
+ }, [o]);
70
+ w(() => {
71
+ i();
72
+ }, [i]);
73
+ const S = z(
74
+ async (h, v, u) => {
75
+ const m = { content: v };
76
+ h.trim() && (m.title = h.trim()), u !== void 0 && (m.type = u), await o.submitFeedback(m), await i();
77
77
  },
78
- [n, r]
79
- ), k = C(
80
- async (s, u) => {
78
+ [o, i]
79
+ ), l = z(
80
+ async (h, v) => {
81
81
  try {
82
- await n.vote(s, u), await r();
82
+ await o.vote(h, v), await i();
83
83
  } catch {
84
84
  }
85
85
  },
86
- [n, r]
87
- ), x = C(
88
- (s) => n.getItem(s),
89
- [n]
90
- ), w = C(() => i(!0), []), T = C(() => i(!1), []), F = C(
91
- (s) => n.setUserId(s),
92
- [n]
86
+ [o, i]
87
+ ), d = z(
88
+ (h) => o.getItem(h),
89
+ [o]
90
+ ), C = z(() => r(!0), []), F = z(() => r(!1), []), T = z(
91
+ (h) => o.setUserId(h),
92
+ [o]
93
93
  );
94
94
  return /* @__PURE__ */ t(
95
- O.Provider,
95
+ G.Provider,
96
96
  {
97
97
  value: {
98
- client: n,
99
- feedItems: c,
100
- loadFeed: r,
101
- submit: y,
102
- vote: k,
103
- getItem: x,
104
- isOpen: p,
105
- open: w,
106
- close: T,
107
- identify: F,
108
- accentColor: e.accentColor ?? ee,
98
+ client: o,
99
+ feedItems: p,
100
+ loadFeed: i,
101
+ submit: S,
102
+ vote: l,
103
+ getItem: d,
104
+ isOpen: y,
105
+ open: C,
106
+ close: F,
107
+ identify: T,
108
+ accentColor: e.accentColor ?? ne,
109
109
  customAccentColor: e.accentColor,
110
110
  theme: e.theme ?? "auto",
111
111
  colors: e.colors,
112
112
  radius: e.radius,
113
113
  fontFamily: e.fontFamily,
114
- showBranding: d,
115
- chat: e.chat !== !1
114
+ showBranding: a,
115
+ chat: e.chat !== !1,
116
+ feedback: e.feedback !== !1
116
117
  },
117
- children: o
118
+ children: n
118
119
  }
119
120
  );
120
121
  }
121
- function I() {
122
- const o = Q(O);
123
- if (!o) throw new Error("useUpstep must be used inside <UpstepProvider>");
124
- return o;
122
+ function U() {
123
+ const n = ee(G);
124
+ if (!n) throw new Error("useUpstep must be used inside <UpstepProvider>");
125
+ return n;
125
126
  }
126
- function ye({
127
- position: o = "bottom-right",
127
+ function ve({
128
+ position: n = "bottom-right",
128
129
  accentColor: e,
129
- theme: n,
130
- colors: c,
131
- radius: g,
132
- fontFamily: p,
133
- hideLauncher: i = !1,
134
- chat: d = !0
130
+ theme: o,
131
+ colors: p,
132
+ radius: c,
133
+ fontFamily: y,
134
+ hideLauncher: r = !1,
135
+ chat: a = !0,
136
+ feedback: k
135
137
  }) {
136
- var A;
137
- const l = I(), r = re(n ?? l.theme, {
138
- accentColor: e ?? l.customAccentColor,
139
- colors: c ?? l.colors,
140
- radius: g ?? l.radius
141
- }), y = r.accent, k = {
142
- colors: c ?? l.colors,
143
- radius: g ?? l.radius,
144
- fontFamily: p ?? l.fontFamily
138
+ var N;
139
+ const i = U(), S = (k ?? !0) && i.feedback, l = se(o ?? i.theme, {
140
+ accentColor: e ?? i.customAccentColor,
141
+ colors: p ?? i.colors,
142
+ radius: c ?? i.radius
143
+ }), d = l.accent, C = {
144
+ colors: p ?? i.colors,
145
+ radius: c ?? i.radius,
146
+ fontFamily: y ?? i.fontFamily
145
147
  }, {
146
- isOpen: x,
147
- open: w,
148
- close: T,
149
- showBranding: F
150
- } = l, [s, u] = m("list"), [S, h] = m(!1);
151
- v(() => {
152
- let f = !0;
153
- if (l.client.chat = l.chat, !l.chat || !d) {
154
- h(!1);
148
+ isOpen: F,
149
+ open: T,
150
+ close: h,
151
+ showBranding: v
152
+ } = i, [u, m] = x("list"), [f, M] = x(!1), W = f && a && i.chat;
153
+ w(() => {
154
+ let g = !0;
155
+ if (i.client.chat = i.chat, !i.chat || !a) {
156
+ M(!1);
155
157
  return;
156
158
  }
157
- return l.client.supportEnabled().then((z) => {
158
- f && h(z);
159
+ return i.client.supportEnabled().then((I) => {
160
+ g && M(I);
159
161
  }), () => {
160
- f = !1;
162
+ g = !1;
161
163
  };
162
- }, [l.client, l.chat, d]), v(() => {
163
- (!l.chat || !d) && s === "support" && u("list");
164
- }, [l.chat, d, s]), v(() => {
165
- x && u(S && d && l.chat ? "support" : "list");
166
- }, [x, S, d, l.chat]);
167
- const [U, L] = m(null), [W, M] = m(!1);
168
- v(() => {
169
- const f = window.matchMedia("(max-width: 639px)");
170
- M(f.matches);
171
- const z = (q) => M(q.matches);
172
- return f.addEventListener("change", z), () => f.removeEventListener("change", z);
164
+ }, [i.client, i.chat, a]), w(() => {
165
+ (!i.chat || !a) && u === "support" && m("list");
166
+ }, [i.chat, a, u]), w(() => {
167
+ F && m(f && a && i.chat ? "support" : "list");
168
+ }, [F, f, a, i.chat]);
169
+ const [A, P] = x(null), [L, D] = x(!1);
170
+ w(() => {
171
+ const g = window.matchMedia("(max-width: 639px)");
172
+ D(g.matches);
173
+ const I = (Q) => D(Q.matches);
174
+ return g.addEventListener("change", I), () => g.removeEventListener("change", I);
173
175
  }, []);
174
- const _ = {
176
+ const J = {
175
177
  position: "fixed",
176
178
  bottom: 24,
177
179
  right: 24
178
- }, B = ((A = k.fontFamily) == null ? void 0 : A.trim()) || oe;
180
+ }, B = ((N = C.fontFamily) == null ? void 0 : N.trim()) || le;
179
181
  function E() {
180
- T(), L(null);
182
+ h(), P(null);
181
183
  }
182
- function Y(f) {
183
- L(f), u("detail");
184
+ function K(g) {
185
+ P(g), m("detail");
184
186
  }
185
- return /* @__PURE__ */ a(R, { children: [
186
- !i && /* @__PURE__ */ a(
187
+ return /* @__PURE__ */ s(R, { children: [
188
+ !r && (S || W) && /* @__PURE__ */ s(
187
189
  "button",
188
190
  {
189
- "aria-label": "Open help and feedback",
190
- onClick: w,
191
+ "aria-label": S ? "Open help and feedback" : "Open support chat",
192
+ onClick: T,
191
193
  style: {
192
- ..._,
194
+ ...J,
193
195
  zIndex: 9998,
194
196
  display: "inline-flex",
195
197
  alignItems: "center",
196
198
  gap: 7,
197
- background: y,
198
- color: r.accentText,
199
+ background: d,
200
+ color: l.accentText,
199
201
  border: "none",
200
- borderRadius: b(9999, r.radius),
201
- padding: W ? "12px" : "12px 18px",
202
+ borderRadius: b(9999, l.radius),
203
+ padding: L ? "12px" : "12px 18px",
202
204
  fontSize: 14,
203
205
  fontWeight: 600,
204
206
  cursor: "pointer",
@@ -206,15 +208,15 @@ function ye({
206
208
  boxShadow: "0 6px 20px rgba(26,25,21,.18)"
207
209
  },
208
210
  children: [
209
- /* @__PURE__ */ t(he, { size: 16 }),
210
- !W && (S && d && l.chat ? "Help & feedback" : "Feedback")
211
+ /* @__PURE__ */ t(xe, { size: 16 }),
212
+ !L && (W ? S ? "Help & feedback" : "Help" : "Feedback")
211
213
  ]
212
214
  }
213
215
  ),
214
- x && /* @__PURE__ */ t(
216
+ F && (S || W) && /* @__PURE__ */ t(
215
217
  "div",
216
218
  {
217
- onClick: (f) => f.target === f.currentTarget && E(),
219
+ onClick: (g) => g.target === g.currentTarget && E(),
218
220
  style: {
219
221
  position: "fixed",
220
222
  inset: 0,
@@ -223,18 +225,18 @@ function ye({
223
225
  display: "flex",
224
226
  alignItems: "flex-end",
225
227
  justifyContent: "flex-end",
226
- padding: W ? "0 12px 80px" : "0 24px 88px",
228
+ padding: L ? "0 12px 80px" : "0 24px 88px",
227
229
  fontFamily: B
228
230
  },
229
- children: /* @__PURE__ */ a(
231
+ children: /* @__PURE__ */ s(
230
232
  "div",
231
233
  {
232
234
  style: {
233
- background: r.bg,
234
- border: `1px solid ${r.border}`,
235
- borderRadius: b(20, r.radius),
235
+ background: l.bg,
236
+ border: `1px solid ${l.border}`,
237
+ borderRadius: b(20, l.radius),
236
238
  width: "100%",
237
- maxWidth: S && d && l.chat ? 460 : 440,
239
+ maxWidth: f && a && i.chat ? 460 : 440,
238
240
  maxHeight: "calc(100dvh - 112px)",
239
241
  display: "flex",
240
242
  flexDirection: "column",
@@ -242,7 +244,44 @@ function ye({
242
244
  boxShadow: "0 24px 64px rgba(0,0,0,.28)"
243
245
  },
244
246
  children: [
245
- S && d && l.chat ? /* @__PURE__ */ a(
247
+ W && !S ? /* @__PURE__ */ s(
248
+ "div",
249
+ {
250
+ style: {
251
+ display: "flex",
252
+ alignItems: "center",
253
+ gap: 14,
254
+ padding: "14px 16px 14px 20px",
255
+ borderBottom: `1px solid ${l.border}`,
256
+ flexShrink: 0
257
+ },
258
+ children: [
259
+ /* @__PURE__ */ t(
260
+ "span",
261
+ {
262
+ style: { flex: 1, fontSize: 16, fontWeight: 600, color: l.text },
263
+ children: "Support"
264
+ }
265
+ ),
266
+ /* @__PURE__ */ t(
267
+ "button",
268
+ {
269
+ "aria-label": "Close",
270
+ onClick: E,
271
+ style: {
272
+ border: 0,
273
+ background: "transparent",
274
+ color: l.textSoft,
275
+ padding: 6,
276
+ cursor: "pointer",
277
+ fontSize: 14
278
+ },
279
+ children: "✕"
280
+ }
281
+ )
282
+ ]
283
+ }
284
+ ) : W ? /* @__PURE__ */ s(
246
285
  "div",
247
286
  {
248
287
  style: {
@@ -250,31 +289,31 @@ function ye({
250
289
  alignItems: "center",
251
290
  gap: 14,
252
291
  padding: "10px 14px",
253
- borderBottom: `1px solid ${r.border}`,
292
+ borderBottom: `1px solid ${l.border}`,
254
293
  flexShrink: 0
255
294
  },
256
295
  children: [
257
296
  /* @__PURE__ */ t("div", { style: { display: "flex", flex: 1, gap: 4 }, children: [
258
297
  ["support", "Support"],
259
- ["list", "Feedback"]
260
- ].map(([f, z]) => /* @__PURE__ */ t(
298
+ ["list", "Ideas"]
299
+ ].map(([g, I]) => /* @__PURE__ */ t(
261
300
  "button",
262
301
  {
263
- onClick: () => u(f),
302
+ onClick: () => m(g),
264
303
  style: {
265
304
  flex: 1,
266
305
  border: 0,
267
- borderRadius: b(8, r.radius),
306
+ borderRadius: b(8, l.radius),
268
307
  padding: "9px 12px",
269
- background: (s === "support" ? f === "support" : f === "list") ? r.bgSoft : "transparent",
270
- color: (s === "support" ? f === "support" : f === "list") ? r.text : r.textSoft,
308
+ background: (u === "support" ? g === "support" : g === "list") ? l.bgSoft : "transparent",
309
+ color: (u === "support" ? g === "support" : g === "list") ? l.text : l.textSoft,
271
310
  fontSize: 14,
272
311
  fontWeight: 600,
273
312
  cursor: "pointer"
274
313
  },
275
- children: z
314
+ children: I
276
315
  },
277
- f
316
+ g
278
317
  )) }),
279
318
  /* @__PURE__ */ t(
280
319
  "button",
@@ -284,7 +323,7 @@ function ye({
284
323
  style: {
285
324
  border: 0,
286
325
  background: "transparent",
287
- color: r.textSoft,
326
+ color: l.textSoft,
288
327
  padding: 6,
289
328
  cursor: "pointer",
290
329
  fontSize: 14
@@ -294,7 +333,7 @@ function ye({
294
333
  )
295
334
  ]
296
335
  }
297
- ) : /* @__PURE__ */ a(
336
+ ) : /* @__PURE__ */ s(
298
337
  "div",
299
338
  {
300
339
  style: {
@@ -302,20 +341,20 @@ function ye({
302
341
  alignItems: "center",
303
342
  justifyContent: "space-between",
304
343
  padding: "16px 20px",
305
- borderBottom: `1px solid ${r.border}`,
344
+ borderBottom: `1px solid ${l.border}`,
306
345
  flexShrink: 0
307
346
  },
308
347
  children: [
309
- /* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
310
- s !== "list" && /* @__PURE__ */ t(
348
+ /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
349
+ u !== "list" && /* @__PURE__ */ t(
311
350
  "button",
312
351
  {
313
- onClick: () => u("list"),
352
+ onClick: () => m("list"),
314
353
  style: {
315
354
  background: "none",
316
355
  border: "none",
317
356
  cursor: "pointer",
318
- color: y,
357
+ color: d,
319
358
  fontSize: 14,
320
359
  fontWeight: 600,
321
360
  padding: 0
@@ -323,41 +362,41 @@ function ye({
323
362
  children: "← Back"
324
363
  }
325
364
  ),
326
- s === "list" && /* @__PURE__ */ t(
365
+ u === "list" && /* @__PURE__ */ t(
327
366
  "span",
328
367
  {
329
368
  style: {
330
369
  fontWeight: 700,
331
370
  fontSize: 16,
332
- color: r.text,
371
+ color: l.text,
333
372
  letterSpacing: "-.01em"
334
373
  },
335
374
  children: "Feedback"
336
375
  }
337
376
  ),
338
- s === "create" && /* @__PURE__ */ t(
377
+ u === "create" && /* @__PURE__ */ t(
339
378
  "span",
340
379
  {
341
380
  style: {
342
381
  fontWeight: 700,
343
382
  fontSize: 16,
344
- color: r.text,
383
+ color: l.text,
345
384
  letterSpacing: "-.01em"
346
385
  },
347
386
  children: "New feedback"
348
387
  }
349
388
  )
350
389
  ] }),
351
- /* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
352
- s === "list" && /* @__PURE__ */ t(
390
+ /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
391
+ u === "list" && /* @__PURE__ */ t(
353
392
  "button",
354
393
  {
355
- onClick: () => u("create"),
394
+ onClick: () => m("create"),
356
395
  style: {
357
- background: y,
358
- color: r.accentText,
396
+ background: d,
397
+ color: l.accentText,
359
398
  border: "none",
360
- borderRadius: b(20, r.radius),
399
+ borderRadius: b(20, l.radius),
361
400
  padding: "6px 14px",
362
401
  fontSize: 14,
363
402
  fontWeight: 700,
@@ -371,14 +410,14 @@ function ye({
371
410
  {
372
411
  onClick: E,
373
412
  style: {
374
- background: r.bgSoft,
413
+ background: l.bgSoft,
375
414
  border: "none",
376
415
  width: 28,
377
416
  height: 28,
378
- borderRadius: b(8, r.radius),
417
+ borderRadius: b(8, l.radius),
379
418
  fontSize: 14,
380
419
  cursor: "pointer",
381
- color: r.textSoft,
420
+ color: l.textSoft,
382
421
  display: "flex",
383
422
  alignItems: "center",
384
423
  justifyContent: "center"
@@ -390,25 +429,25 @@ function ye({
390
429
  ]
391
430
  }
392
431
  ),
393
- /* @__PURE__ */ a(
432
+ /* @__PURE__ */ s(
394
433
  "div",
395
434
  {
396
435
  style: {
397
436
  flex: 1,
398
437
  overflowY: "auto",
399
- padding: s === "support" ? 0 : "16px 20px 24px"
438
+ padding: u === "support" ? 0 : "16px 20px 24px"
400
439
  },
401
440
  children: [
402
- s === "support" && d && l.chat && /* @__PURE__ */ t(
403
- ie,
441
+ u === "support" && a && i.chat && /* @__PURE__ */ t(
442
+ ae,
404
443
  {
405
- client: l.client,
406
- accentColor: y,
407
- theme: r.dark ? "dark" : "light",
408
- appearance: k
444
+ client: i.client,
445
+ accentColor: d,
446
+ theme: l.dark ? "dark" : "light",
447
+ appearance: C
409
448
  }
410
449
  ),
411
- S && d && l.chat && s !== "support" && /* @__PURE__ */ t(
450
+ f && a && i.chat && u !== "support" && /* @__PURE__ */ t(
412
451
  "div",
413
452
  {
414
453
  style: {
@@ -417,70 +456,71 @@ function ye({
417
456
  justifyContent: "space-between",
418
457
  marginBottom: 16
419
458
  },
420
- children: s === "list" ? /* @__PURE__ */ a(R, { children: [
459
+ children: u === "list" ? /* @__PURE__ */ s(R, { children: [
421
460
  /* @__PURE__ */ t(
422
461
  "span",
423
462
  {
424
- style: { fontSize: 14, fontWeight: 600, color: r.text },
425
- children: "Feedback & ideas"
463
+ style: { fontSize: 14, fontWeight: 600, color: l.text },
464
+ children: "Ideas"
426
465
  }
427
466
  ),
428
467
  /* @__PURE__ */ t(
429
468
  "button",
430
469
  {
431
- onClick: () => u("create"),
470
+ onClick: () => m("create"),
432
471
  style: {
433
472
  border: 0,
434
- borderRadius: b(8, r.radius),
435
- background: y,
436
- color: r.accentText,
473
+ borderRadius: b(8, l.radius),
474
+ background: d,
475
+ color: l.accentText,
437
476
  fontSize: 14,
438
477
  padding: "7px 10px",
439
478
  cursor: "pointer"
440
479
  },
441
- children: "+ New"
480
+ children: "+ Suggest an idea"
442
481
  }
443
482
  )
444
483
  ] }) : /* @__PURE__ */ t(
445
484
  "button",
446
485
  {
447
- onClick: () => u("list"),
486
+ onClick: () => m("list"),
448
487
  style: {
449
488
  border: 0,
450
489
  background: "none",
451
490
  padding: 0,
452
- color: r.textSoft,
491
+ color: l.textSoft,
453
492
  fontSize: 14,
454
493
  cursor: "pointer"
455
494
  },
456
- children: "← Back to feedback"
495
+ children: "← Back to ideas"
457
496
  }
458
497
  )
459
498
  }
460
499
  ),
461
- s === "list" && /* @__PURE__ */ t(le, { onSelect: Y, accent: y, p: r }),
462
- s === "detail" && U && /* @__PURE__ */ t(
463
- se,
500
+ u === "list" && /* @__PURE__ */ t(de, { onSelect: K, accent: d, p: l }),
501
+ u === "detail" && A && /* @__PURE__ */ t(
502
+ ce,
464
503
  {
465
- feedbackId: U,
466
- accent: y,
467
- p: r,
504
+ feedbackId: A,
505
+ accent: d,
506
+ p: l,
468
507
  font: B
469
508
  }
470
509
  ),
471
- s === "create" && /* @__PURE__ */ t(
472
- de,
510
+ u === "create" && /* @__PURE__ */ t(
511
+ ue,
473
512
  {
474
- accent: y,
475
- p: r,
513
+ accent: d,
514
+ p: l,
476
515
  font: B,
477
- onDone: () => u("list")
516
+ ideasOnly: !!(f && a && i.chat),
517
+ onDone: () => m("list")
478
518
  }
479
519
  )
480
520
  ]
481
521
  }
482
522
  ),
483
- F && s !== "support" && /* @__PURE__ */ a(
523
+ v && u !== "support" && /* @__PURE__ */ s(
484
524
  "a",
485
525
  {
486
526
  href: "https://upstep.dev",
@@ -490,9 +530,9 @@ function ye({
490
530
  display: "block",
491
531
  textAlign: "center",
492
532
  padding: "8px 0",
493
- borderTop: `1px solid ${r.border}`,
533
+ borderTop: `1px solid ${l.border}`,
494
534
  fontSize: 11,
495
- color: r.textFaint,
535
+ color: l.textFaint,
496
536
  textDecoration: "none",
497
537
  flexShrink: 0
498
538
  },
@@ -510,24 +550,24 @@ function ye({
510
550
  )
511
551
  ] });
512
552
  }
513
- function ie({
514
- client: o,
553
+ function ae({
554
+ client: n,
515
555
  theme: e,
516
- accentColor: n,
517
- appearance: c
556
+ accentColor: o,
557
+ appearance: p
518
558
  }) {
519
- const g = X(null);
520
- return v(() => {
521
- if (g.current) return o.connectSupportFrame(g.current);
522
- }, [o]), /* @__PURE__ */ t(
559
+ const c = te(null);
560
+ return w(() => {
561
+ if (c.current) return n.connectSupportFrame(c.current);
562
+ }, [n]), /* @__PURE__ */ t(
523
563
  "iframe",
524
564
  {
525
- ref: g,
565
+ ref: c,
526
566
  "data-upstep-support": !0,
527
567
  title: "Customer support",
528
- src: o.supportFrameUrl(e, n, c),
568
+ src: n.supportFrameUrl(e, o, p),
529
569
  style: {
530
- color: n,
570
+ color: o,
531
571
  width: "100%",
532
572
  height: "min(560px, calc(100dvh - 168px))",
533
573
  minHeight: 300,
@@ -537,34 +577,34 @@ function ie({
537
577
  }
538
578
  );
539
579
  }
540
- function le({
541
- onSelect: o,
580
+ function de({
581
+ onSelect: n,
542
582
  accent: e,
543
- p: n
583
+ p: o
544
584
  }) {
545
- const { feedItems: c, vote: g } = I(), p = c.filter((i) => i.status !== "CLOSED");
546
- return p.length ? /* @__PURE__ */ t(R, { children: p.map((i) => {
547
- const d = i.userVote === "UP", l = i.title ?? i.content;
548
- return /* @__PURE__ */ a(
585
+ const { feedItems: p, vote: c } = U(), y = p.filter((r) => r.status !== "CLOSED");
586
+ return y.length ? /* @__PURE__ */ t(R, { children: y.map((r) => {
587
+ const a = r.userVote === "UP", k = r.title ?? r.content;
588
+ return /* @__PURE__ */ s(
549
589
  "div",
550
590
  {
551
- onClick: () => o(i.id),
591
+ onClick: () => n(r.id),
552
592
  style: {
553
593
  display: "flex",
554
594
  gap: 12,
555
595
  padding: 14,
556
- border: `1px solid ${n.border}`,
557
- borderRadius: b(14, n.radius),
596
+ border: `1px solid ${o.border}`,
597
+ borderRadius: b(14, o.radius),
558
598
  marginBottom: 10,
559
- background: n.bg,
599
+ background: o.bg,
560
600
  cursor: "pointer"
561
601
  },
562
602
  children: [
563
- /* @__PURE__ */ a(
603
+ /* @__PURE__ */ s(
564
604
  "button",
565
605
  {
566
- onClick: (r) => {
567
- r.stopPropagation(), g(i.id, "UP");
606
+ onClick: (i) => {
607
+ i.stopPropagation(), c(r.id, "UP");
568
608
  },
569
609
  style: {
570
610
  display: "flex",
@@ -574,30 +614,30 @@ function le({
574
614
  gap: 2,
575
615
  minWidth: 46,
576
616
  padding: "7px 0",
577
- borderRadius: b(11, n.radius),
617
+ borderRadius: b(11, o.radius),
578
618
  cursor: "pointer",
579
619
  flexShrink: 0,
580
- border: `1px solid ${d ? e : n.border}`,
581
- background: d ? n.accentTint : n.bgSoft
620
+ border: `1px solid ${a ? e : o.border}`,
621
+ background: a ? o.accentTint : o.bgSoft
582
622
  },
583
623
  children: [
584
- /* @__PURE__ */ t(G, { color: e }),
624
+ /* @__PURE__ */ t(Y, { color: e }),
585
625
  /* @__PURE__ */ t(
586
626
  "span",
587
627
  {
588
628
  style: {
589
629
  fontSize: 14,
590
630
  fontWeight: 700,
591
- color: n.text,
631
+ color: o.text,
592
632
  lineHeight: 1.1
593
633
  },
594
- children: i.upvotes
634
+ children: r.upvotes
595
635
  }
596
636
  )
597
637
  ]
598
638
  }
599
639
  ),
600
- /* @__PURE__ */ a("div", { style: { flex: 1, minWidth: 0 }, children: [
640
+ /* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: [
601
641
  /* @__PURE__ */ t(
602
642
  "p",
603
643
  {
@@ -605,17 +645,17 @@ function le({
605
645
  fontSize: 14,
606
646
  fontWeight: 600,
607
647
  lineHeight: 1.4,
608
- color: n.text,
648
+ color: o.text,
609
649
  margin: "0 0 6px",
610
650
  overflow: "hidden",
611
651
  display: "-webkit-box",
612
652
  WebkitLineClamp: 2,
613
653
  WebkitBoxOrient: "vertical"
614
654
  },
615
- children: l
655
+ children: k
616
656
  }
617
657
  ),
618
- /* @__PURE__ */ a(
658
+ /* @__PURE__ */ s(
619
659
  "div",
620
660
  {
621
661
  style: {
@@ -625,16 +665,16 @@ function le({
625
665
  flexWrap: "wrap"
626
666
  },
627
667
  children: [
628
- /* @__PURE__ */ t(H, { type: i.type, p: n }),
629
- i.status === "PENDING" ? /* @__PURE__ */ t($, {}) : /* @__PURE__ */ t(
630
- j,
668
+ /* @__PURE__ */ t(O, { type: r.type, p: o }),
669
+ r.status === "PENDING" ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ t(
670
+ _,
631
671
  {
632
- status: i.status,
633
- boardStatus: i.boardStatus,
634
- p: n
672
+ status: r.status,
673
+ boardStatus: r.boardStatus,
674
+ p: o
635
675
  }
636
676
  ),
637
- /* @__PURE__ */ t("span", { style: { fontSize: 11, color: n.textFaint }, children: V(i.createdAt) })
677
+ /* @__PURE__ */ t("span", { style: { fontSize: 11, color: o.textFaint }, children: q(r.createdAt) })
638
678
  ]
639
679
  }
640
680
  )
@@ -643,7 +683,7 @@ function le({
643
683
  "span",
644
684
  {
645
685
  style: {
646
- color: n.textFaint,
686
+ color: o.textFaint,
647
687
  fontSize: 18,
648
688
  alignSelf: "center",
649
689
  flexShrink: 0
@@ -653,14 +693,14 @@ function le({
653
693
  )
654
694
  ]
655
695
  },
656
- i.id
696
+ r.id
657
697
  );
658
- }) }) : /* @__PURE__ */ a("div", { style: { textAlign: "center", padding: "40px 0" }, children: [
698
+ }) }) : /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "40px 0" }, children: [
659
699
  /* @__PURE__ */ t(
660
700
  "div",
661
701
  {
662
702
  style: {
663
- color: n.textSoft,
703
+ color: o.textSoft,
664
704
  fontSize: 15,
665
705
  fontWeight: 600,
666
706
  marginBottom: 4
@@ -668,79 +708,79 @@ function le({
668
708
  children: "No open feedback yet"
669
709
  }
670
710
  ),
671
- /* @__PURE__ */ t("div", { style: { color: n.textFaint, fontSize: 14 }, children: "Be the first to share one." })
711
+ /* @__PURE__ */ t("div", { style: { color: o.textFaint, fontSize: 14 }, children: "Be the first to share one." })
672
712
  ] });
673
713
  }
674
- function se({
675
- feedbackId: o,
714
+ function ce({
715
+ feedbackId: n,
676
716
  accent: e,
677
- p: n,
678
- font: c
717
+ p: o,
718
+ font: p
679
719
  }) {
680
- const { vote: g, getItem: p } = I(), [i, d] = m(null), [l, r] = m(!1);
681
- v(() => {
682
- let x = !1;
683
- return p(o).then((w) => {
684
- x || d(w);
720
+ const { vote: c, getItem: y } = U(), [r, a] = x(null), [k, i] = x(!1);
721
+ w(() => {
722
+ let d = !1;
723
+ return y(n).then((C) => {
724
+ d || a(C);
685
725
  }).catch(() => {
686
726
  }), () => {
687
- x = !0;
727
+ d = !0;
688
728
  };
689
- }, [o, p]);
690
- async function y() {
691
- if (!(!i || l)) {
692
- r(!0);
729
+ }, [n, y]);
730
+ async function S() {
731
+ if (!(!r || k)) {
732
+ i(!0);
693
733
  try {
694
- await g(i.id, "UP");
695
- const x = await p(o);
696
- d(x);
734
+ await c(r.id, "UP");
735
+ const d = await y(n);
736
+ a(d);
697
737
  } catch {
698
738
  } finally {
699
- r(!1);
739
+ i(!1);
700
740
  }
701
741
  }
702
742
  }
703
- if (!i)
743
+ if (!r)
704
744
  return /* @__PURE__ */ t(
705
745
  "div",
706
746
  {
707
747
  style: {
708
748
  textAlign: "center",
709
749
  padding: "40px 0",
710
- color: n.textFaint,
750
+ color: o.textFaint,
711
751
  fontSize: 14
712
752
  },
713
753
  children: "Loading…"
714
754
  }
715
755
  );
716
- const k = i.title;
717
- return /* @__PURE__ */ a("div", { children: [
718
- k && /* @__PURE__ */ t(
756
+ const l = r.title;
757
+ return /* @__PURE__ */ s("div", { children: [
758
+ l && /* @__PURE__ */ t(
719
759
  "div",
720
760
  {
721
761
  style: {
722
762
  fontSize: 20,
723
763
  fontWeight: 700,
724
- color: n.text,
764
+ color: o.text,
725
765
  letterSpacing: "-.02em",
726
766
  marginBottom: 10,
727
767
  lineHeight: 1.3
728
768
  },
729
- children: k
769
+ children: l
730
770
  }
731
771
  ),
732
- /* @__PURE__ */ a(
772
+ /* @__PURE__ */ s(
733
773
  "div",
734
774
  {
735
775
  style: { display: "flex", gap: 6, marginBottom: 14, flexWrap: "wrap" },
736
776
  children: [
737
- /* @__PURE__ */ t(H, { type: i.type, p: n }),
738
- i.status === "PENDING" ? /* @__PURE__ */ t($, {}) : /* @__PURE__ */ t(
739
- j,
777
+ /* @__PURE__ */ t(O, { type: r.type, p: o }),
778
+ r.status === "PENDING" ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ t(
779
+ _,
740
780
  {
741
- status: i.status,
742
- boardStatus: i.boardStatus,
743
- p: n
781
+ status: r.status,
782
+ boardStatus: r.boardStatus,
783
+ p: o
744
784
  }
745
785
  )
746
786
  ]
@@ -752,41 +792,41 @@ function se({
752
792
  style: {
753
793
  fontSize: 15,
754
794
  lineHeight: 1.6,
755
- color: n.textSoft,
795
+ color: o.textSoft,
756
796
  marginBottom: 20
757
797
  },
758
- children: i.content
798
+ children: r.content
759
799
  }
760
800
  ),
761
- /* @__PURE__ */ a(
801
+ /* @__PURE__ */ s(
762
802
  "button",
763
803
  {
764
- onClick: y,
765
- disabled: l,
804
+ onClick: S,
805
+ disabled: k,
766
806
  style: {
767
807
  display: "inline-flex",
768
808
  alignItems: "center",
769
809
  gap: 8,
770
- border: `1px solid ${i.userVote === "UP" ? e : n.border}`,
771
- background: i.userVote === "UP" ? N(e, 0.08) : n.bgSoft,
772
- borderRadius: b(12, n.radius),
810
+ border: `1px solid ${r.userVote === "UP" ? e : o.border}`,
811
+ background: r.userVote === "UP" ? j(e, 0.08) : o.bgSoft,
812
+ borderRadius: b(12, o.radius),
773
813
  padding: "10px 16px",
774
814
  cursor: "pointer",
775
- fontFamily: c
815
+ fontFamily: p
776
816
  },
777
817
  children: [
778
- /* @__PURE__ */ t(G, { color: e, size: 13 }),
779
- /* @__PURE__ */ t("span", { style: { fontSize: 18, fontWeight: 700, color: n.text }, children: i.upvotes }),
780
- /* @__PURE__ */ t("span", { style: { fontSize: 14, color: n.textFaint }, children: i.userVote === "UP" ? "Upvoted" : "Upvote" })
818
+ /* @__PURE__ */ t(Y, { color: e, size: 13 }),
819
+ /* @__PURE__ */ t("span", { style: { fontSize: 18, fontWeight: 700, color: o.text }, children: r.upvotes }),
820
+ /* @__PURE__ */ t("span", { style: { fontSize: 14, color: o.textFaint }, children: r.userVote === "UP" ? "Upvoted" : "Upvote" })
781
821
  ]
782
822
  }
783
823
  ),
784
- i.comments.length > 0 && /* @__PURE__ */ a(
824
+ r.comments.length > 0 && /* @__PURE__ */ s(
785
825
  "div",
786
826
  {
787
827
  style: {
788
828
  marginTop: 28,
789
- borderTop: `1px solid ${n.border}`,
829
+ borderTop: `1px solid ${o.border}`,
790
830
  paddingTop: 20
791
831
  },
792
832
  children: [
@@ -797,26 +837,26 @@ function se({
797
837
  fontSize: 10,
798
838
  fontWeight: 700,
799
839
  letterSpacing: ".08em",
800
- color: n.textFaint,
840
+ color: o.textFaint,
801
841
  marginBottom: 12,
802
842
  textTransform: "uppercase"
803
843
  },
804
844
  children: "Comments"
805
845
  }
806
846
  ),
807
- i.comments.map((x) => /* @__PURE__ */ t(ae, { comment: x, p: n, accent: e }, x.id))
847
+ r.comments.map((d) => /* @__PURE__ */ t(pe, { comment: d, p: o, accent: e }, d.id))
808
848
  ]
809
849
  }
810
850
  )
811
851
  ] });
812
852
  }
813
- function ae({
814
- comment: o,
853
+ function pe({
854
+ comment: n,
815
855
  p: e,
816
- accent: n
856
+ accent: o
817
857
  }) {
818
- var c;
819
- return /* @__PURE__ */ a(
858
+ var p;
859
+ return /* @__PURE__ */ s(
820
860
  "div",
821
861
  {
822
862
  style: {
@@ -827,7 +867,7 @@ function ae({
827
867
  marginBottom: 10
828
868
  },
829
869
  children: [
830
- /* @__PURE__ */ a(
870
+ /* @__PURE__ */ s(
831
871
  "div",
832
872
  {
833
873
  style: {
@@ -841,17 +881,17 @@ function ae({
841
881
  "span",
842
882
  {
843
883
  style: {
844
- background: N(n, 0.125),
845
- color: n,
884
+ background: j(o, 0.125),
885
+ color: o,
846
886
  fontSize: 11,
847
887
  fontWeight: 700,
848
888
  borderRadius: b(20, e.radius),
849
889
  padding: "2px 8px"
850
890
  },
851
- children: ((c = o.authorName) == null ? void 0 : c.trim()) || "UpStep Team"
891
+ children: ((p = n.authorName) == null ? void 0 : p.trim()) || "UpStep Team"
852
892
  }
853
893
  ),
854
- /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children: V(o.createdAt) })
894
+ /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children: q(n.createdAt) })
855
895
  ]
856
896
  }
857
897
  ),
@@ -859,34 +899,37 @@ function ae({
859
899
  "p",
860
900
  {
861
901
  style: { fontSize: 16, lineHeight: 1.6, color: e.textSoft, margin: 0 },
862
- children: o.content
902
+ children: n.content
863
903
  }
864
904
  )
865
905
  ]
866
906
  }
867
907
  );
868
908
  }
869
- function de({
870
- accent: o,
909
+ function ue({
910
+ accent: n,
871
911
  p: e,
872
- font: n,
873
- onDone: c
912
+ font: o,
913
+ onDone: p,
914
+ ideasOnly: c = !1
874
915
  }) {
875
- const { submit: g } = I(), [p, i] = m(""), [d, l] = m(""), [r, y] = m("GENERAL"), [k, x] = m(!1), [w, T] = m(!1), [F, s] = m("");
916
+ const { submit: y } = U(), [r, a] = x(""), [k, i] = x(""), [S, l] = x(
917
+ c ? "FEATURE" : "GENERAL"
918
+ ), [d, C] = x(!1), [F, T] = x(!1), [h, v] = x("");
876
919
  async function u() {
877
- if (!(!p.trim() || k)) {
878
- x(!0), s("");
920
+ if (!(!r.trim() || d)) {
921
+ C(!0), v("");
879
922
  try {
880
- await g(p.trim(), d.trim() || p.trim(), r), T(!0), setTimeout(c, 1200);
923
+ await y(r.trim(), k.trim() || r.trim(), S), T(!0), setTimeout(p, 1200);
881
924
  } catch {
882
- s("Something went wrong. Please try again.");
925
+ v("Something went wrong. Please try again.");
883
926
  } finally {
884
- x(!1);
927
+ C(!1);
885
928
  }
886
929
  }
887
930
  }
888
- if (w)
889
- return /* @__PURE__ */ a("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
931
+ if (F)
932
+ return /* @__PURE__ */ s("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
890
933
  /* @__PURE__ */ t(
891
934
  "div",
892
935
  {
@@ -899,9 +942,9 @@ function de({
899
942
  children: "Submitted"
900
943
  }
901
944
  ),
902
- /* @__PURE__ */ t("div", { style: { fontSize: 14, color: e.textFaint }, children: "Feedback received. Thank you." })
945
+ /* @__PURE__ */ t("div", { style: { fontSize: 14, color: e.textFaint }, children: c ? "Idea received. Thank you." : "Feedback received. Thank you." })
903
946
  ] });
904
- const S = {
947
+ const m = {
905
948
  width: "100%",
906
949
  border: `1px solid ${e.border}`,
907
950
  borderRadius: b(12, e.radius),
@@ -911,51 +954,53 @@ function de({
911
954
  outline: "none",
912
955
  background: e.bgSoft,
913
956
  color: e.text,
914
- fontFamily: n,
957
+ fontFamily: o,
915
958
  boxSizing: "border-box"
916
959
  };
917
- return /* @__PURE__ */ a("div", { children: [
918
- /* @__PURE__ */ t(
919
- "div",
920
- {
921
- style: {
922
- fontSize: 10,
923
- fontWeight: 700,
924
- letterSpacing: ".08em",
925
- color: e.textFaint,
926
- marginBottom: 8,
927
- textTransform: "uppercase"
928
- },
929
- children: "Type"
930
- }
931
- ),
932
- /* @__PURE__ */ t("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((h) => /* @__PURE__ */ a(
933
- "button",
934
- {
935
- onClick: () => y(h),
936
- style: {
937
- flex: 1,
938
- display: "flex",
939
- alignItems: "center",
940
- justifyContent: "center",
941
- gap: 5,
942
- padding: "8px 10px",
943
- borderRadius: b(9, e.radius),
944
- fontSize: 14,
945
- fontWeight: 600,
946
- cursor: "pointer",
947
- background: r === h ? o : e.bg,
948
- color: r === h ? e.accentText : e.textSoft,
949
- border: `1px solid ${r === h ? o : e.border}`,
950
- fontFamily: n
960
+ return /* @__PURE__ */ s("div", { children: [
961
+ !c && /* @__PURE__ */ s(R, { children: [
962
+ /* @__PURE__ */ t(
963
+ "div",
964
+ {
965
+ style: {
966
+ fontSize: 10,
967
+ fontWeight: 700,
968
+ letterSpacing: ".08em",
969
+ color: e.textFaint,
970
+ marginBottom: 8,
971
+ textTransform: "uppercase"
972
+ },
973
+ children: "Type"
974
+ }
975
+ ),
976
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((f) => /* @__PURE__ */ s(
977
+ "button",
978
+ {
979
+ onClick: () => l(f),
980
+ style: {
981
+ flex: 1,
982
+ display: "flex",
983
+ alignItems: "center",
984
+ justifyContent: "center",
985
+ gap: 5,
986
+ padding: "8px 10px",
987
+ borderRadius: b(9, e.radius),
988
+ fontSize: 14,
989
+ fontWeight: 600,
990
+ cursor: "pointer",
991
+ background: S === f ? n : e.bg,
992
+ color: S === f ? e.accentText : e.textSoft,
993
+ border: `1px solid ${S === f ? n : e.border}`,
994
+ fontFamily: o
995
+ },
996
+ children: [
997
+ $[f].icon,
998
+ $[f].label
999
+ ]
951
1000
  },
952
- children: [
953
- D[h].icon,
954
- D[h].label
955
- ]
956
- },
957
- h
958
- )) }),
1001
+ f
1002
+ )) })
1003
+ ] }),
959
1004
  /* @__PURE__ */ t(
960
1005
  "div",
961
1006
  {
@@ -973,14 +1018,14 @@ function de({
973
1018
  /* @__PURE__ */ t(
974
1019
  "input",
975
1020
  {
976
- value: p,
977
- onChange: (h) => i(h.target.value),
978
- placeholder: "Short summary of the issue or idea",
1021
+ value: r,
1022
+ onChange: (f) => a(f.target.value),
1023
+ placeholder: c ? "What would you like us to build?" : "Short summary of the issue or idea",
979
1024
  maxLength: 200,
980
- style: { ...S, marginBottom: 16, display: "block" }
1025
+ style: { ...m, marginBottom: 16, display: "block" }
981
1026
  }
982
1027
  ),
983
- /* @__PURE__ */ a(
1028
+ /* @__PURE__ */ s(
984
1029
  "div",
985
1030
  {
986
1031
  style: {
@@ -1007,42 +1052,42 @@ function de({
1007
1052
  /* @__PURE__ */ t(
1008
1053
  "textarea",
1009
1054
  {
1010
- value: d,
1011
- onChange: (h) => l(h.target.value),
1012
- placeholder: "Steps to reproduce, expected behaviour, or more context",
1055
+ value: k,
1056
+ onChange: (f) => i(f.target.value),
1057
+ placeholder: c ? "Why would it help? (optional)" : "Steps to reproduce, expected behaviour, or more context",
1013
1058
  maxLength: 2e3,
1014
1059
  rows: 4,
1015
- style: { ...S, resize: "vertical", marginBottom: 16 }
1060
+ style: { ...m, resize: "vertical", marginBottom: 16 }
1016
1061
  }
1017
1062
  ),
1018
- F && /* @__PURE__ */ t("p", { style: { fontSize: 14, color: "#d6453d", marginBottom: 12 }, children: F }),
1063
+ h && /* @__PURE__ */ t("p", { style: { fontSize: 14, color: "#d6453d", marginBottom: 12 }, children: h }),
1019
1064
  /* @__PURE__ */ t(
1020
1065
  "button",
1021
1066
  {
1022
1067
  onClick: u,
1023
- disabled: k || !p.trim(),
1068
+ disabled: d || !r.trim(),
1024
1069
  style: {
1025
1070
  width: "100%",
1026
1071
  padding: 12,
1027
- background: o,
1072
+ background: n,
1028
1073
  color: e.accentText,
1029
1074
  border: "none",
1030
1075
  borderRadius: b(11, e.radius),
1031
1076
  fontSize: 14,
1032
1077
  fontWeight: 600,
1033
1078
  cursor: "pointer",
1034
- opacity: k || !p.trim() ? 0.5 : 1,
1035
- fontFamily: n
1079
+ opacity: d || !r.trim() ? 0.5 : 1,
1080
+ fontFamily: o
1036
1081
  },
1037
- children: k ? "Submitting…" : "Submit feedback"
1082
+ children: d ? "Submitting…" : c ? "Suggest idea" : "Submit feedback"
1038
1083
  }
1039
1084
  )
1040
1085
  ] });
1041
1086
  }
1042
- const D = {
1087
+ const $ = {
1043
1088
  BUG: {
1044
1089
  label: "Bug",
1045
- icon: /* @__PURE__ */ a(
1090
+ icon: /* @__PURE__ */ s(
1046
1091
  "svg",
1047
1092
  {
1048
1093
  width: 12,
@@ -1062,7 +1107,7 @@ const D = {
1062
1107
  },
1063
1108
  FEATURE: {
1064
1109
  label: "Feature",
1065
- icon: /* @__PURE__ */ a(
1110
+ icon: /* @__PURE__ */ s(
1066
1111
  "svg",
1067
1112
  {
1068
1113
  width: 12,
@@ -1097,8 +1142,8 @@ const D = {
1097
1142
  }
1098
1143
  )
1099
1144
  }
1100
- }, ce = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, pe = { BUG: "#d6453d", FEATURE: "#3b76d6" };
1101
- function H({ type: o, p: e }) {
1145
+ }, he = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, fe = { BUG: "#d6453d", FEATURE: "#3b76d6" };
1146
+ function O({ type: n, p: e }) {
1102
1147
  return /* @__PURE__ */ t(
1103
1148
  "span",
1104
1149
  {
@@ -1108,21 +1153,21 @@ function H({ type: o, p: e }) {
1108
1153
  fontSize: 10.5,
1109
1154
  fontWeight: 700,
1110
1155
  letterSpacing: ".02em",
1111
- background: ce[o] ?? e.bgSoft,
1112
- color: pe[o] ?? e.textSoft
1156
+ background: he[n] ?? e.bgSoft,
1157
+ color: fe[n] ?? e.textSoft
1113
1158
  },
1114
- children: o
1159
+ children: n
1115
1160
  }
1116
1161
  );
1117
1162
  }
1118
- const ue = {
1163
+ const ge = {
1119
1164
  OPEN: "#b45309",
1120
1165
  IN_PROGRESS: "#1d4ed8",
1121
1166
  DONE: "#15803d",
1122
1167
  CLOSED: "#6b7280"
1123
1168
  };
1124
- function $() {
1125
- return /* @__PURE__ */ a(
1169
+ function V() {
1170
+ return /* @__PURE__ */ s(
1126
1171
  "span",
1127
1172
  {
1128
1173
  style: {
@@ -1155,26 +1200,26 @@ function $() {
1155
1200
  }
1156
1201
  );
1157
1202
  }
1158
- function j({
1159
- status: o,
1203
+ function _({
1204
+ status: n,
1160
1205
  boardStatus: e,
1161
- p: n
1206
+ p: o
1162
1207
  }) {
1163
- const c = (e == null ? void 0 : e.color) ?? ue[o] ?? "#9ca3af";
1164
- return /* @__PURE__ */ a(
1208
+ const p = (e == null ? void 0 : e.color) ?? ge[n] ?? "#9ca3af";
1209
+ return /* @__PURE__ */ s(
1165
1210
  "span",
1166
1211
  {
1167
1212
  style: {
1168
1213
  display: "inline-flex",
1169
1214
  alignItems: "center",
1170
1215
  gap: 5,
1171
- background: n.bgSoft,
1172
- border: `1px solid ${n.border}`,
1173
- borderRadius: b(6, n.radius),
1216
+ background: o.bgSoft,
1217
+ border: `1px solid ${o.border}`,
1218
+ borderRadius: b(6, o.radius),
1174
1219
  padding: "2px 8px",
1175
1220
  fontSize: 10,
1176
1221
  fontWeight: 600,
1177
- color: n.textSoft
1222
+ color: o.textSoft
1178
1223
  },
1179
1224
  children: [
1180
1225
  /* @__PURE__ */ t(
@@ -1184,26 +1229,26 @@ function j({
1184
1229
  width: 6,
1185
1230
  height: 6,
1186
1231
  borderRadius: "50%",
1187
- background: c,
1232
+ background: p,
1188
1233
  display: "inline-block",
1189
1234
  flexShrink: 0
1190
1235
  }
1191
1236
  }
1192
1237
  ),
1193
- (e == null ? void 0 : e.name) ?? o.replace("_", " ")
1238
+ (e == null ? void 0 : e.name) ?? n.replace("_", " ")
1194
1239
  ]
1195
1240
  }
1196
1241
  );
1197
1242
  }
1198
- function he({
1199
- size: o = 16,
1243
+ function xe({
1244
+ size: n = 16,
1200
1245
  color: e = "currentColor"
1201
1246
  }) {
1202
1247
  return /* @__PURE__ */ t(
1203
1248
  "svg",
1204
1249
  {
1205
- width: o,
1206
- height: o,
1250
+ width: n,
1251
+ height: n,
1207
1252
  viewBox: "0 0 24 24",
1208
1253
  fill: "none",
1209
1254
  stroke: e,
@@ -1214,8 +1259,8 @@ function he({
1214
1259
  }
1215
1260
  );
1216
1261
  }
1217
- function G({
1218
- color: o = "currentColor",
1262
+ function Y({
1263
+ color: n = "currentColor",
1219
1264
  size: e = 11
1220
1265
  }) {
1221
1266
  return /* @__PURE__ */ t(
@@ -1225,7 +1270,7 @@ function G({
1225
1270
  height: e,
1226
1271
  viewBox: "0 0 16 16",
1227
1272
  fill: "none",
1228
- stroke: o,
1273
+ stroke: n,
1229
1274
  strokeWidth: 2.2,
1230
1275
  strokeLinecap: "round",
1231
1276
  strokeLinejoin: "round",
@@ -1233,14 +1278,14 @@ function G({
1233
1278
  }
1234
1279
  );
1235
1280
  }
1236
- function V(o) {
1237
- return new Date(o).toLocaleDateString(void 0, {
1281
+ function q(n) {
1282
+ return new Date(n).toLocaleDateString(void 0, {
1238
1283
  month: "short",
1239
1284
  day: "numeric"
1240
1285
  });
1241
1286
  }
1242
1287
  export {
1243
- ye as FeedbackWidget,
1244
- be as UpstepProvider,
1245
- I as useUpstep
1288
+ ve as FeedbackWidget,
1289
+ ke as UpstepProvider,
1290
+ U as useUpstep
1246
1291
  };