@upstep/js 0.6.1 → 0.7.1

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