@commentkit/comment-kit 1.6.0 → 2.0.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.
Files changed (136) hide show
  1. package/CHANGELOG.md +281 -597
  2. package/README.md +334 -154
  3. package/SECURITY.md +47 -46
  4. package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
  5. package/dist/node/browser.js +17 -0
  6. package/dist/node/cli/api.js +226 -0
  7. package/dist/node/cli/bin.js +18 -0
  8. package/dist/node/cli/credentials.js +268 -0
  9. package/dist/node/cli/doctor.js +725 -0
  10. package/dist/node/cli/format.js +54 -0
  11. package/dist/node/cli/init.js +372 -0
  12. package/dist/node/cli/main.js +519 -0
  13. package/dist/node/cli/mcp.js +114 -0
  14. package/dist/node/cli/open.js +20 -0
  15. package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
  16. package/dist/node/plugins/astro.js +26 -0
  17. package/dist/node/plugins/git-BIXLbL3f.js +92 -0
  18. package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
  19. package/dist/node/plugins/next.js +48 -0
  20. package/dist/node/plugins/options-THop1K92.js +71 -0
  21. package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
  22. package/dist/node/plugins/vite-BdAYUW10.js +74 -0
  23. package/dist/node/plugins/vite.js +1 -0
  24. package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
  25. package/dist/node/plugins/webpack-loader.cjs +21 -0
  26. package/dist/node/plugins/webpack-loader.js +18 -0
  27. package/dist/node/plugins/webpack.js +1 -0
  28. package/dist/node/shared/endpoint.js +26 -0
  29. package/dist/node/shared/format.js +63 -0
  30. package/dist/node/types/astro.d.ts +11 -0
  31. package/dist/node/types/next.d.ts +34 -0
  32. package/dist/node/types/options.d.ts +59 -0
  33. package/dist/node/types/vite.d.ts +11 -0
  34. package/dist/node/types/webpack-loader.d.ts +22 -0
  35. package/dist/node/types/webpack.d.ts +27 -0
  36. package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
  37. package/dist/npm/chunks/AgentSend-DxRJIYiz.js +68 -0
  38. package/dist/npm/chunks/Checklist-CnlfeSbc.js +282 -0
  39. package/dist/npm/chunks/Composer-B1bBVszY.js +725 -0
  40. package/dist/npm/chunks/Guest-vvNPz8h-.js +267 -0
  41. package/dist/npm/chunks/MarkupEditor-VCOXh9d2.js +338 -0
  42. package/dist/npm/chunks/Panel-F37vIL1K.js +1206 -0
  43. package/dist/npm/chunks/Settings-BGoZS2iV.js +231 -0
  44. package/dist/npm/chunks/Shortcuts-B2OMvczr.js +62 -0
  45. package/dist/npm/chunks/StyleEditor-CJ_d8Huf.js +46 -0
  46. package/dist/npm/chunks/StylePanel-yQzHHlY7.js +199 -0
  47. package/dist/npm/chunks/TaskFields-fmy6_HtK.js +289 -0
  48. package/dist/npm/chunks/ThreadCard-D51slKST.js +1113 -0
  49. package/dist/npm/chunks/Viewer-BOBadqmC.js +111 -0
  50. package/dist/npm/chunks/{agent-BDMQtOzH.js → agent-C1OQzBAm.js} +9 -9
  51. package/dist/npm/chunks/{anchor-BsradQhn.js → anchor-BsQNVkHj.js} +108 -85
  52. package/dist/npm/chunks/{ar-8tPch6W4.js → ar-CAJ3XT8e.js} +69 -19
  53. package/dist/npm/chunks/card-bits-CAnzrqx3.js +53 -0
  54. package/dist/npm/chunks/{client-EFTWxHbJ.js → client-kNAo2TTG.js} +282 -290
  55. package/dist/npm/chunks/confetti-CkBdSu19.js +49 -0
  56. package/dist/npm/chunks/context-B8UAzve0.js +20 -0
  57. package/dist/npm/chunks/context-BuMl7A07.js +48 -0
  58. package/dist/npm/chunks/{de-C63897uD.js → de-Dl18G48t.js} +60 -18
  59. package/dist/npm/chunks/dialog-GO04oC3D.js +3 -0
  60. package/dist/npm/chunks/dpop-U48QIQd7.js +96 -0
  61. package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
  62. package/dist/npm/chunks/{es-CI2bSpvB.js → es-Dxk79lS9.js} +60 -18
  63. package/dist/npm/chunks/extension-CKFpPWmi.js +62 -0
  64. package/dist/npm/chunks/{extension-BST6LH1q.js → extension-E81hWyiT.js} +20 -12
  65. package/dist/npm/chunks/files-DyD5BZgp.js +114 -0
  66. package/dist/npm/chunks/{fr-rsVe-Lqk.js → fr-8BebGKYD.js} +118 -76
  67. package/dist/npm/chunks/{hi-cvwbSaWP.js → hi-BIN6Yy_p.js} +61 -19
  68. package/dist/npm/chunks/{i18n-C4v0M-6z.js → i18n-DOBt8e9U.js} +91 -56
  69. package/dist/npm/chunks/identify-CN-3xzqL.js +106 -0
  70. package/dist/npm/chunks/{it-C8tnV0BF.js → it-Cr6EwpPQ.js} +79 -37
  71. package/dist/npm/chunks/{ja-BWxDfC2f.js → ja-Iy3s5aur.js} +58 -16
  72. package/dist/npm/chunks/late-words-B2bmZceJ.js +12 -0
  73. package/dist/npm/chunks/live-CelVeZfP.js +85 -0
  74. package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
  75. package/dist/npm/chunks/{nl-DNQ6eCht.js → nl-B84WHqqe.js} +61 -19
  76. package/dist/npm/chunks/page-key-DepmJzC1.js +62 -0
  77. package/dist/npm/chunks/{pick-CLyOdjnD.js → pick-yTyqtxN0.js} +45 -44
  78. package/dist/npm/chunks/pkce-ChKGSW_4.js +8 -0
  79. package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
  80. package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
  81. package/dist/npm/chunks/{pt-BR-CkG7vpU2.js → pt-BR-DOkdlfoe.js} +60 -18
  82. package/dist/npm/chunks/{realtime-DIo-Wth4.js → realtime-C79zF50C.js} +14 -12
  83. package/dist/npm/chunks/report-CrIqQZDI.js +44 -0
  84. package/dist/npm/chunks/show-BgVC8gWY.js +97 -0
  85. package/dist/npm/chunks/signin-Dd1rb2BP.js +75 -0
  86. package/dist/npm/chunks/{source-CS7C6wJA.js → source-pXVve2Cx.js} +1 -1
  87. package/dist/npm/chunks/src-BTMy4Gyc.js +208 -0
  88. package/dist/npm/chunks/start-DtVlpt7p.js +1878 -0
  89. package/dist/npm/chunks/states-sfTbjZz8.js +3 -0
  90. package/dist/npm/chunks/upload-MgPYqPyE.js +42 -0
  91. package/dist/npm/chunks/uploads-D49mywwz.js +1146 -0
  92. package/dist/npm/chunks/wrap-Bl0gbnFa.js +69 -0
  93. package/dist/npm/chunks/{zh-CN-BKuZOLBE.js → zh-CN-Z5fQCb7G.js} +59 -17
  94. package/dist/npm/element.js +58 -21
  95. package/dist/npm/headless.js +7 -3
  96. package/dist/npm/index.js +3 -3
  97. package/dist/npm/react.js +18 -11
  98. package/dist/npm/svelte.js +28 -12
  99. package/dist/npm/types/adapters/react.d.ts +4 -1
  100. package/dist/npm/types/adapters/svelte.d.ts +4 -1
  101. package/dist/npm/types/adapters/vue.d.ts +35 -2
  102. package/dist/npm/types/anchor/index.d.ts +19 -0
  103. package/dist/npm/types/capture/privacy.d.ts +14 -0
  104. package/dist/npm/types/core/api.d.ts +20 -1
  105. package/dist/npm/types/core/auth.d.ts +40 -21
  106. package/dist/npm/types/core/client.d.ts +60 -4
  107. package/dist/npm/types/core/page-key.d.ts +42 -0
  108. package/dist/npm/types/core/types.d.ts +87 -4
  109. package/dist/npm/types/element.d.ts +17 -7
  110. package/dist/npm/types/headless.d.ts +2 -1
  111. package/dist/npm/types/index.d.ts +16 -6
  112. package/dist/npm/vue.js +44 -9
  113. package/package.json +88 -14
  114. package/dist/npm/chunks/AgentSend-2JPDseOo.js +0 -63
  115. package/dist/npm/chunks/Checklist-BpDXQebo.js +0 -257
  116. package/dist/npm/chunks/Composer-CAyj-c8e.js +0 -677
  117. package/dist/npm/chunks/Guest-ZdFmTcXI.js +0 -187
  118. package/dist/npm/chunks/MarkupEditor-BFplZwFy.js +0 -332
  119. package/dist/npm/chunks/Panel-BhZ4XRDR.js +0 -861
  120. package/dist/npm/chunks/Settings-SPG9EHUZ.js +0 -204
  121. package/dist/npm/chunks/Shortcuts-C28HVDw6.js +0 -58
  122. package/dist/npm/chunks/StyleEditor-ByZMtq10.js +0 -43
  123. package/dist/npm/chunks/StylePanel-Iwhce2tE.js +0 -197
  124. package/dist/npm/chunks/TaskFields-BsP_fVJg.js +0 -273
  125. package/dist/npm/chunks/ThreadCard-BzVZdDCb.js +0 -1030
  126. package/dist/npm/chunks/Viewer-CqtGrdD8.js +0 -108
  127. package/dist/npm/chunks/card-bits-Bna-g3Py.js +0 -124
  128. package/dist/npm/chunks/confetti-DTKpwF3O.js +0 -40
  129. package/dist/npm/chunks/drafts-akdBsOd0.js +0 -50
  130. package/dist/npm/chunks/extension-D-V3utTm.js +0 -53
  131. package/dist/npm/chunks/live-BCpJVBeN.js +0 -33
  132. package/dist/npm/chunks/report-BBrT3r89.js +0 -27
  133. package/dist/npm/chunks/src-C4FsVoUp.js +0 -148
  134. package/dist/npm/chunks/start-i9M-r3aH.js +0 -1800
  135. package/dist/npm/chunks/upload-DSv7EyBD.js +0 -41
  136. package/dist/npm/chunks/uploads-I01kdqQF.js +0 -1103
@@ -1,1030 +0,0 @@
1
- import { p as e } from "./client-EFTWxHbJ.js";
2
- import { a as t } from "./anchor-BsradQhn.js";
3
- import { _ as n, a as r, d as i, f as a, h as o, i as ee, l as s, m as c, r as l, s as u, u as d } from "./i18n-C4v0M-6z.js";
4
- import { r as f } from "./agent-BDMQtOzH.js";
5
- import { i as p, n as te, o as ne, r as m, s as h, t as re } from "./card-bits-Bna-g3Py.js";
6
- import { i as ie, n as g, r as ae, t as oe } from "./drafts-akdBsOd0.js";
7
- import { a as _, c as v, i as y, l as se, n as ce, t as le, u as ue } from "./uploads-I01kdqQF.js";
8
- import { r as de, t as fe } from "./Checklist-BpDXQebo.js";
9
- import { TaskFields as pe } from "./TaskFields-BsP_fVJg.js";
10
- import { C as b, S as me, a as he, b as ge, c as _e, f as x, g as ve, h as ye, i as be, l as xe, n as S, r as Se, u as Ce, w as we, x as Te, y as Ee } from "./start-i9M-r3aH.js";
11
- // src/ui/StyleChanges.tsx
12
- function De({ thread: e, element: t, editable: n, client: r, onChange: ee, onError: l = () => void 0 }) {
13
- let f = o(() => _(e.style_changes), [e.style_changes]), [p, te] = c(!1), [ne, m] = c(!1), [h, re] = c(null), ie = a(null), g = t instanceof HTMLElement || t instanceof SVGElement ? t : null;
14
- return i(() => {
15
- if (!p || !g) return;
16
- let e = ie.current = new y(g);
17
- return e.apply(f), () => e.revert();
18
- }, [
19
- p,
20
- g,
21
- f
22
- ]), d(() => {
23
- te(!1), m(!1);
24
- }, [e.id]), ne && g && r && h ? /* @__PURE__ */ s(h, {
25
- client: r,
26
- thread: e,
27
- element: g,
28
- onSaved: (e) => ee?.(e),
29
- onClose: () => m(!1),
30
- onError: l
31
- }) : f.length ? /* @__PURE__ */ s("section", {
32
- class: "ck-style-card",
33
- "aria-label": u("styleSuggested"),
34
- children: [/* @__PURE__ */ s("div", {
35
- class: "ck-style-card-head",
36
- children: [/* @__PURE__ */ s("span", { children: u("styleSuggested") }), g ? /* @__PURE__ */ s("span", { children: [n && r ? /* @__PURE__ */ s("button", {
37
- class: "ck-ghost ck-ghost-sm",
38
- "aria-label": u("styleEdit"),
39
- disabled: ne,
40
- onClick: () => {
41
- ie.current?.revert(), te(!1), m(!0), h || import("./StyleEditor-ByZMtq10.js").then((e) => re(() => e.StyleEditor), l);
42
- },
43
- children: u("edit")
44
- }) : null, /* @__PURE__ */ s("button", {
45
- class: "ck-chip",
46
- "aria-pressed": p,
47
- onClick: () => te(!p),
48
- children: u("stylePreview")
49
- })] }) : null]
50
- }), /* @__PURE__ */ s("ul", { children: f.map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s("code", { children: v(e) }) })) })]
51
- }) : null;
52
- }
53
- // src/ui/ThreadCard.tsx
54
- S(".ck-msg{gap:10px;padding:6px 0;display:flex}.ck-msg+.ck-msg{border-top:1px solid var(--ck-hairline);padding-top:10px}.ck-msg-main{flex:1;min-width:0}.ck-msg-meta{color:var(--ck-text-muted);align-items:baseline;gap:6px;font-size:12px;display:flex}.ck-msg-body{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:2px;line-height:1.5}.ck-msg-body a{color:color-mix(in srgb, var(--ck-accent) 80%, var(--ck-text));text-underline-offset:2px}.ck-msg-body code{font-family:var(--ck-mono);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);border-radius:5px;padding:1px 5px;font-size:12px}.ck-reactions{flex-wrap:wrap;gap:4px;margin-top:6px;display:flex}.ck-reaction{border:1px solid var(--ck-border);background:var(--ck-bg);font-variant-numeric:tabular-nums;border-radius:999px;height:24px;padding:0 8px;font-size:12px;transition:background-color .12s,border-color .12s}.ck-reaction[aria-pressed=true]{border-color:color-mix(in srgb, var(--ck-accent) 60%, var(--ck-border));background:var(--ck-accent-soft)}.ck-review-ask{border-radius:var(--ck-radius-md);background:color-mix(in srgb, var(--ck-review) 14%, var(--ck-bg));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ck-review) 30%, transparent);margin-bottom:10px;padding:12px}.ck-build{overflow-wrap:anywhere}.ck-msg-skeleton{gap:10px;display:flex}.ck-msg-skeleton>div{flex:1}.ck-skeleton-avatar{border-radius:50%;flex:none;width:28px;height:28px;margin:0;display:block}@media (pointer:coarse){.ck-reaction{min-width:36px;min-height:36px}}@media (hover:hover){.ck-reaction:hover{background:var(--ck-bg-muted)}}.ck-msg-body,.ck-review-ask{text-wrap:pretty}.ck-quoting{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);border-inline-start:3px solid var(--ck-accent);color:var(--ck-text-muted);align-items:center;gap:8px;margin-bottom:6px;padding:6px 6px 6px 10px;font-size:12.5px;display:flex}.ck-quoting>span{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.ck-quoting strong{color:var(--ck-text);font-weight:650}.ck-msg-meta{flex-wrap:wrap}.ck-msg-meta time{cursor:default}.ck-msg-actions{opacity:0;gap:2px;margin-inline-start:auto;transition:opacity .12s;display:inline-flex}.ck-msg:hover .ck-msg-actions,.ck-msg:focus-within .ck-msg-actions{opacity:1}.ck-msg-body s{color:var(--ck-text-muted)}.ck-quote-msg{border-top:0;border-bottom:0;text-align:start;text-overflow:ellipsis;white-space:nowrap;border-inline-end:0;width:100%;margin:4px 0 6px;overflow:hidden}.ck-quote-msg strong{color:var(--ck-text);font-weight:650}.ck-reaction-add{opacity:.55}.ck-no-replies{margin:8px 0 0;font-size:12.5px}.ck-jump{box-shadow:var(--ck-shadow-sm);animation:ck-pop .14s var(--ck-ease);z-index:1;position:absolute;top:-38px;left:50%;transform:translate(-50%)}.ck-details{margin:0 0 8px;font-size:12.5px}.ck-details-toggle{color:var(--ck-text-muted);background:0 0;border:0;border-radius:6px;align-items:center;gap:6px;padding:2px 0;font-size:12.5px;font-weight:600;display:inline-flex}.ck-details-toggle:after{content:\"\";border-inline-end:1.5px solid;width:5px;height:5px;transition:transform .15s var(--ck-ease);border-bottom:1.5px solid;transform:rotate(45deg)translateY(-2px)}.ck-details-toggle[aria-expanded=true]:after{transform:rotate(225deg)translate(-1px,-1px)}.ck-details dl{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);gap:4px;margin:6px 0 0;padding:8px 10px;display:grid}.ck-details dl>div{grid-template-columns:72px 1fr;gap:8px;display:grid}.ck-details dt{color:var(--ck-text-muted)}.ck-details dd{overflow-wrap:anywhere;font-variant-numeric:tabular-nums;min-width:0;margin:0}.ck-details a{color:inherit;text-underline-offset:2px}@media (hover:hover){.ck-quote-msg:hover{color:var(--ck-text)}}@media (hover:none){.ck-msg-actions{opacity:1}}button.ck-shot{cursor:zoom-in;text-align:start;background:0 0;border:0;width:100%;padding:0;display:block}.ck-grid{border-radius:var(--ck-radius-md);grid-template-columns:repeat(2,1fr);gap:4px;margin-top:8px;display:grid;overflow:hidden}.ck-grid[data-count=\"3\"] .ck-grid-item:first-child{grid-row:span 2}.ck-grid-item{aspect-ratio:4/3;background:var(--ck-bg-muted);cursor:zoom-in;border:0;padding:0;position:relative;overflow:hidden}.ck-grid[data-count=\"3\"] .ck-grid-item:first-child{aspect-ratio:auto}.ck-grid-item img{object-fit:cover;outline:1px solid var(--ck-img-outline);outline-offset:-1px;width:100%;height:100%;transition:scale .2s var(--ck-ease);display:block}.ck-grid-more{color:#fff;font-variant-numeric:tabular-nums;background:#1213168c;place-items:center;font-size:18px;font-weight:700;display:grid;position:absolute;top:0;bottom:0;left:0;right:0}@media (hover:hover){.ck-grid-item:hover img,button.ck-shot:hover img{scale:1.02}}.ck-picker-wrap{display:inline-flex;position:relative}.ck-reaction-more{width:30px;color:var(--ck-text-muted);place-items:center;padding:0;display:inline-grid}.ck-picker{z-index:4;bottom:calc(100% + 6px);background:var(--ck-bg);box-shadow:var(--ck-shadow);animation:ck-pop .14s var(--ck-ease);border:1px solid #0000;border-radius:12px;grid-template-columns:repeat(8,32px);gap:2px;padding:6px;display:grid;position:absolute}.ck-picker:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-picker:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-picker:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-picker:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-picker button{background:0 0;border:0;border-radius:8px;place-items:center;width:32px;height:32px;padding:0;font-size:18px;transition:background-color .12s,scale .15s ease-out;display:grid}.ck-picker button[aria-pressed=true]{background:var(--ck-accent-soft)}.ck-picker button:active{scale:.92}.ck-picker .ck-emoji{width:20px;height:20px}@media (hover:hover){.ck-picker button:hover{background:var(--ck-bg-hover)}.ck-reaction-more:hover{color:var(--ck-text)}}@media (max-width:520px){.ck-picker{grid-template-columns:repeat(6,36px)}.ck-picker button{width:36px;height:36px}}.ck-extra{gap:8px;margin:0 0 10px;display:grid}.ck-description{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);margin:0 0 8px;padding:8px 10px;font-size:13px}.ck-description summary{cursor:pointer;color:var(--ck-text-muted);font-size:12.5px;font-weight:600}.ck-description p{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;margin:6px 0 0;overflow:auto}.ck-extra-add{gap:8px;display:flex}.ck-extra-add .ck-ghost{padding:2px 6px}.ck-checklist{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);padding:8px 10px}.ck-checklist-head{font-variant-numeric:tabular-nums;align-items:center;gap:10px;font-size:12px;display:flex}.ck-checklist-bar{background:var(--ck-border);border-radius:2px;flex:1;height:4px;overflow:hidden}.ck-checklist-bar>span{background:var(--ck-success);height:100%;transition:width .2s var(--ck-ease);display:block}.ck-checklist ul{gap:2px;margin:6px 0 0;padding:0;list-style:none;display:grid}.ck-checklist li{align-items:center;gap:4px;display:flex}.ck-checklist li .ck-check{flex:1;min-width:0;margin:0;font-size:13px}.ck-checklist li[data-done] bdi{color:var(--ck-text-muted);text-decoration:line-through}.ck-checklist li .ck-ghost{opacity:0;flex:none;place-items:center;width:24px;height:24px;min-height:0;padding:0;transition:opacity .12s;display:grid}.ck-checklist li:hover .ck-ghost,.ck-checklist li:focus-within .ck-ghost{opacity:1}@media (hover:none){.ck-checklist li .ck-ghost{opacity:1}}.ck-checklist-add .ck-input{height:30px;font-size:13px}.ck-previews{gap:6px;margin-top:6px;display:grid}.ck-preview{border-inline-start:3px solid var(--ck-border);border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);color:var(--ck-text);gap:1px;padding:8px 10px;font-size:12.5px;text-decoration:none;transition:background-color .12s;display:grid}.ck-preview strong{text-overflow:ellipsis;white-space:nowrap;font-weight:650;overflow:hidden}.ck-preview-site{color:var(--ck-text-muted);font-size:11.5px}.ck-preview-text{color:var(--ck-text-muted);-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}@media (hover:hover){.ck-preview:hover{background:var(--ck-bg-hover)}}.ck-card-embedded{width:auto;height:100%;max-height:none;box-shadow:none;animation:ck-slide-in .22s var(--ck-ease);border:0;border-radius:0;flex-direction:column;display:flex;position:static;top:auto;bottom:auto;left:auto;right:auto}.ck-card-embedded .ck-card-body{flex:1;min-height:0}.ck-back svg{scale:-1 1}.ck-root[dir=rtl] .ck-back svg{scale:1}.ck-step svg{rotate:-90deg}.ck-step[data-dir=next] svg{rotate:90deg}.ck-card-pos{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px}@keyframes ck-slide-in{0%{opacity:0;translate:24px}}.ck-root[dir=rtl] .ck-card-embedded{animation-name:ck-slide-in-rtl}@keyframes ck-slide-in-rtl{0%{opacity:0;translate:-24px}}.ck-msg[data-reply] .ck-msg-body{background:var(--ck-bg-muted);border-radius:4px 12px 12px;max-width:100%;padding:6px 10px;display:inline-block}.ck-msg[data-reply][data-mine]{flex-direction:row-reverse}.ck-msg[data-reply][data-mine] .ck-msg-main{flex-direction:column;align-items:flex-end;display:flex}.ck-msg[data-reply][data-mine] .ck-msg-meta{flex-direction:row-reverse}.ck-msg[data-reply][data-mine] .ck-msg-actions{margin-inline-start:0;margin-inline-end:auto}.ck-msg[data-reply][data-mine] .ck-msg-body{background:var(--ck-accent-soft);border-radius:12px 4px 12px 12px}.ck-msg[data-reply][data-mine] .ck-reactions{justify-content:flex-end}.ck-msg+.ck-msg[data-reply]{border-top:0;padding-top:6px}.ck-msg[data-new]{animation:ck-reply-in .24s var(--ck-ease)}@keyframes ck-reply-in{0%{opacity:0;translate:0 8px}}.ck-mention-card{z-index:5;background:var(--ck-bg);box-shadow:var(--ck-shadow);pointer-events:none;animation:ck-pop .12s var(--ck-ease);border:1px solid #0000;border-radius:10px;align-items:center;gap:8px;padding:6px 10px 6px 6px;font-size:13px;display:flex;position:fixed}.ck-mention-card .ck-avatar{width:22px;height:22px;font-size:9px}.ck-thread-skeleton{gap:14px;display:grid}.ck-skeleton-meta{width:40%;height:10px}.ck-thread-skeleton .ck-msg-skeleton:nth-child(3){opacity:.7}.ck-thread-skeleton .ck-msg-skeleton:nth-child(4){opacity:.45}");
55
- var Oe = h.slice(0, 6), ke = /* @__PURE__ */ new Map();
56
- function C({ client: i, threadId: _, version: v = 0, onClose: y, onError: S, notify: C, embedded: w }) {
57
- let T = he(i.state, (e) => e.session), Pe = he(i.state, (e) => e.config?.read_only ?? !1), Fe = be(), Ie = a(null), E = he(i.state, (e) => e.threads.find((e) => e.id === _) ?? null), [D, O] = c(E), [k, A] = c([]), [j, Le] = c(null), M = g(i.options.project, "reply", _), [N, Re] = c(() => ae(M)), ze = (e) => {
58
- e !== N && (I.current = null), Re(e), ie(M, e);
59
- }, P = ce(i, (t) => S(new e(0, "file_rejected", t))), [Be, Ve] = c(null), [He, Ue] = c(null), We = (e, t) => {
60
- Ve({
61
- images: e,
62
- start: t
63
- }), He || import("./Viewer-CqtGrdD8.js").then((e) => Ue(() => e.Viewer), S);
64
- }, Ge = a(null), [Ke, qe] = c([]), [F, Je] = c(!1), [Ye, Xe] = c(!1), I = a(null), [Ze, Qe] = c(!1), [L, R] = c(null), [z, B] = c(null), [$e, V] = c(!1), [et, tt] = c(!1), [H, nt] = c(null);
65
- d(() => {
66
- if (!H) return;
67
- let e = (e) => {
68
- e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-picker-wrap")) || nt(null);
69
- };
70
- return addEventListener("pointerdown", e, !0), () => removeEventListener("pointerdown", e, !0);
71
- }, [H]);
72
- let [U, rt] = c([]), it = o(() => U.map((e) => e.name), [U]), [W, G] = c(null), at = a(/* @__PURE__ */ new Set()), [ot, st] = c(!1), [ct, lt] = c(!0), ut = a(null), dt = (e = !1) => ut.current?.scrollTo({
73
- top: ut.current.scrollHeight,
74
- behavior: e && !je() ? "smooth" : "auto"
75
- });
76
- d(() => {
77
- $e || dt();
78
- }, [k.length]);
79
- let ft = () => !$e && dt();
80
- d(() => {
81
- T && ue(i).then(rt);
82
- }, [T?.person.id]);
83
- let K = a(_);
84
- K.current = _;
85
- let q = a(null), pt = (e) => {
86
- q.current?.(), q.current = null;
87
- let t = () => {
88
- K.current === e && i.state.get().unread > 0 && i.markRead({ threadId: e }).catch(() => void 0);
89
- };
90
- if (i.inboxLoaded || i.state.get().unread > 0) return t();
91
- let n = i.state.subscribe(() => {
92
- i.inboxLoaded && (n(), q.current = null, t());
93
- });
94
- q.current = n;
95
- };
96
- d(() => () => q.current?.(), []);
97
- let J = async (t = !1) => {
98
- let n = _;
99
- try {
100
- let [e, r] = await Promise.all([i.getThread(n), i.allMessages(n, { refresh: t })]);
101
- if (K.current !== n) return;
102
- O(e), at.current.size || r.forEach((e) => at.current.add(e.id)), A(r), !ke.has(n) && typeof e.watching == "boolean" && lt(e.watching), pt(n);
103
- } catch (t) {
104
- if (K.current !== n) return;
105
- let r = t instanceof e && (t.status === 404 || t.status === 403);
106
- if (E && !r) {
107
- S(t);
108
- return;
109
- }
110
- if (E) {
111
- S(new e(404, "thread_not_found", u("threadNotFound"))), y();
112
- return;
113
- }
114
- Le({
115
- gone: r,
116
- text: r ? u("threadNotFound") : _e(t)
117
- });
118
- }
119
- };
120
- d(() => {
121
- O(E), A([]), Re(ae(M)), P.clear(), B(null), V(!1), G(null), at.current = /* @__PURE__ */ new Set(), st(!1), Xe(!1), I.current = null, lt(ke.get(_) ?? E?.watching ?? !0), J();
122
- }, [_]), d(() => {
123
- E && D && E.updated_at !== D.updated_at && J(!0);
124
- }, [E?.updated_at]);
125
- let mt = a(v);
126
- d(() => {
127
- v !== mt.current && (mt.current = v, J(!0));
128
- }, [v]);
129
- let Y = o(() => D ? t(D.anchor) : null, [D]);
130
- if (d(() => {
131
- !w && Y?.element && Y.state !== "detached" && Y.element.scrollIntoView({
132
- block: "center",
133
- behavior: je() ? "auto" : "smooth"
134
- });
135
- }, [Y?.element]), d(() => {
136
- D && Ie.current?.focus({ preventScroll: !0 });
137
- }, [D?.id]), d(() => {
138
- let e = (e) => {
139
- if (w && (e.key === "j" || e.key === "k") && !e.metaKey && !e.ctrlKey && !e.altKey && i.options.shortcuts !== !1 && !e.composedPath().some((e) => e instanceof HTMLElement && (e.isContentEditable || [
140
- "INPUT",
141
- "TEXTAREA",
142
- "SELECT"
143
- ].includes(e.tagName)))) {
144
- let t = e.key === "j" ? w.onNext : w.onPrev;
145
- t && (e.preventDefault(), t());
146
- } else e.key !== "e" && e.key !== "E" || e.metaKey || e.ctrlKey || e.altKey || !D || i.options.shortcuts === !1 || e.composedPath().some((e) => e instanceof HTMLElement && (e.isContentEditable || [
147
- "INPUT",
148
- "TEXTAREA",
149
- "SELECT"
150
- ].includes(e.tagName))) || T?.capabilities.comment && !Pe && D.status !== "resolved" && (e.preventDefault(), Q("resolved"));
151
- };
152
- return addEventListener("keydown", e), () => removeEventListener("keydown", e);
153
- }), !D) return /* @__PURE__ */ s("div", {
154
- class: w ? "ck-card ck-card-embedded" : "ck-card",
155
- style: w ? void 0 : m({
156
- x: innerWidth - 400,
157
- y: 80
158
- }),
159
- role: w ? "region" : "dialog",
160
- "aria-label": u("loadingThread"),
161
- "aria-busy": !j,
162
- "data-commentkit-ui": !0,
163
- children: [/* @__PURE__ */ s("div", {
164
- class: "ck-card-head",
165
- children: [
166
- w ? /* @__PURE__ */ s("button", {
167
- class: "ck-ghost ck-back",
168
- "aria-label": u("backToList"),
169
- onClick: w.onBack,
170
- children: /* @__PURE__ */ s(x, {
171
- name: "chevron",
172
- size: 16
173
- })
174
- }) : null,
175
- /* @__PURE__ */ s("span", {
176
- class: "ck-card-title",
177
- children: j ? "" : u("loadingThread")
178
- }),
179
- /* @__PURE__ */ s("button", {
180
- class: "ck-ghost",
181
- "aria-label": u("close"),
182
- onClick: w ? w.onBack : y,
183
- children: /* @__PURE__ */ s(x, { name: "close" })
184
- })
185
- ]
186
- }), j ? /* @__PURE__ */ s("div", {
187
- class: "ck-card-body ck-empty",
188
- role: "alert",
189
- children: [
190
- /* @__PURE__ */ s(de, { name: j.gone ? "gone" : "error" }),
191
- /* @__PURE__ */ s("span", { children: j.text }),
192
- /* @__PURE__ */ s("button", {
193
- class: "ck-btn",
194
- onClick: j.gone ? y : () => {
195
- Le(null), J();
196
- },
197
- children: u(j.gone ? "close" : "retry")
198
- })
199
- ]
200
- }) : /* @__PURE__ */ s("div", {
201
- class: "ck-card-body ck-thread-skeleton",
202
- children: [/* @__PURE__ */ s("div", { class: "ck-skeleton ck-skeleton-meta" }), [
203
- 0,
204
- 1,
205
- 2
206
- ].map(() => /* @__PURE__ */ s("div", {
207
- class: "ck-msg-skeleton",
208
- children: [/* @__PURE__ */ s("span", { class: "ck-skeleton ck-skeleton-avatar" }), /* @__PURE__ */ s("div", { children: [
209
- /* @__PURE__ */ s("div", { class: "ck-skeleton" }),
210
- /* @__PURE__ */ s("div", { class: "ck-skeleton" }),
211
- /* @__PURE__ */ s("div", { class: "ck-skeleton" })
212
- ] })]
213
- }))]
214
- })]
215
- });
216
- let X = T?.capabilities, Z = !!X?.comment && !Pe, ht = i.options.tools?.attachments !== !1, gt = T && D.author.id === T.person.id && D.author.type === (T.person.type === "guest" ? "guest" : "user"), _t = Y ? {
217
- x: Y.point.x - scrollX,
218
- y: Y.point.y - scrollY
219
- } : {
220
- x: innerWidth - 400,
221
- y: 80
222
- }, vt = m({
223
- x: Math.min(Math.max(_t.x, 0), innerWidth),
224
- y: Math.min(Math.max(_t.y, 0), innerHeight - 40)
225
- }), yt = T?.role === "guest" ? u("feedbackRef", { ref: D.reference }) : D.reference, bt = (t) => {
226
- if (!(t instanceof e && t.status === 412)) return S(t);
227
- R(null), C({
228
- text: u("editConflict"),
229
- tone: "info"
230
- }), J();
231
- }, Q = async (e) => {
232
- let t = D;
233
- try {
234
- O(await i.updateThread(D.id, { status: e })), e === "resolved" && import("./confetti-DTKpwF3O.js").then((e) => e.celebrate(ut.current)).catch(() => void 0), e === "resolved" ? C({
235
- text: u("resolvedToast", { ref: D.reference }),
236
- tone: "success",
237
- action: {
238
- label: u("undo"),
239
- run: () => void p(i, t, C, S).then((e) => e && K.current === e.id && O(e))
240
- }
241
- }) : e === "open" && (t.status === "resolved" || t.status === "closed") && C({
242
- text: u("reopenedToast", { ref: D.reference }),
243
- tone: "info"
244
- });
245
- } catch (e) {
246
- bt(e);
247
- }
248
- }, xt = () => i.watch(D.id, !ct).then((e) => {
249
- let t = e?.watching ?? !ct;
250
- ke.set(D.id, t), lt(t), C({ text: u(t ? "followed" : "muted", { ref: D.reference }) });
251
- }, S), St = () => {
252
- if (!L || F) return;
253
- Je(!0);
254
- let e = Te(L.body, U.map((e) => e.name)), t = U.filter((t) => /^\d+$/.test(t.id ?? "") && e.has(t.name)).map((e) => Number(e.id));
255
- i.editMessage(L.id, L.body, ...t.length ? [{ mentionIds: t }] : []).then((e) => {
256
- A((t) => t.map((t) => t.id === e.id ? e : t)), R(null), C({
257
- text: u("editedToast"),
258
- tone: "success"
259
- }), e.id === k[0]?.id && i.refreshThread(D.id);
260
- }, bt).finally(() => Je(!1));
261
- }, Ct = async () => {
262
- if (N.trim() && !F) {
263
- Je(!0), Xe(!1);
264
- try {
265
- let e = await P.ready(), t = e.ids;
266
- e.missing && C({
267
- text: u("sentWithoutFiles"),
268
- tone: "info"
269
- });
270
- let n = await i.reply(D.id, N.trim(), {
271
- replyTo: z?.id ?? null,
272
- mentionIds: Ke,
273
- attachmentIds: t,
274
- idempotencyKey: I.current ?? (I.current = crypto.randomUUID())
275
- });
276
- I.current = null, A((e) => e.some((e) => e.id === n.id) ? e : [...e, n]), B(null), V(!1), Re(""), P.clear(), oe(M), (D.status === "resolved" || D.status === "closed") && O({
277
- ...D,
278
- status: "open"
279
- });
280
- } catch (e) {
281
- Xe(te(e) ?? !0);
282
- } finally {
283
- Je(!1);
284
- }
285
- }
286
- }, wt = async (e, t) => {
287
- let n = e.reactions?.find((e) => e.emoji === t)?.mine ?? !1, r = (e) => {
288
- let r = (e.reactions ?? []).map((e) => e.emoji === t ? {
289
- ...e,
290
- count: e.count + (n ? -1 : 1),
291
- mine: !n
292
- } : e).filter((e) => e.count > 0);
293
- return !n && !r.some((e) => e.emoji === t) && r.push({
294
- emoji: t,
295
- count: 1,
296
- mine: !0
297
- }), {
298
- ...e,
299
- reactions: r
300
- };
301
- };
302
- A(k.map((t) => t.id === e.id ? r(t) : t));
303
- try {
304
- await i.react(e.id, t, !n);
305
- } catch (e) {
306
- S(e), J();
307
- }
308
- }, Tt = (e) => P.add(e), Et = (e) => {
309
- let t = k.findIndex((t) => t.id === e.id);
310
- A((t) => t.filter((t) => t.id !== e.id)), C({
311
- text: u("replyDeleted"),
312
- action: {
313
- label: u("undo"),
314
- run: () => K.current === D.id && A((n) => n.some((t) => t.id === e.id) ? n : [
315
- ...n.slice(0, t),
316
- e,
317
- ...n.slice(t)
318
- ])
319
- },
320
- expires: Ae,
321
- onExpire: () => void i.deleteMessage(e.id).then(() => i.refreshThread(D.id), (e) => {
322
- S(e), K.current === D.id && J();
323
- })
324
- });
325
- }, Dt = () => {
326
- let e = i.state.get().threads;
327
- i.state.set((e) => ({ threads: e.threads.filter((e) => e.id !== D.id) })), y(), C({
328
- text: u("threadDeleted", { ref: D.reference }),
329
- action: {
330
- label: u("undo"),
331
- run: () => i.state.set((t) => ({ threads: t.threads.some((e) => e.id === D.id) ? t.threads : e.filter((e) => e.id === D.id).concat(t.threads) }))
332
- },
333
- expires: Ae,
334
- onExpire: () => void i.deleteThread(D.id).catch((e) => {
335
- S(e), i.refreshThread(D.id);
336
- })
337
- });
338
- }, Ot = async (e, t) => {
339
- try {
340
- await navigator.clipboard.writeText(e), C({ text: t });
341
- } catch {
342
- S(Error(u("errorGeneric")));
343
- }
344
- }, kt = (() => {
345
- let e = b(D.page.url);
346
- if (!e) return "";
347
- let t = new URL(e);
348
- return t.searchParams.set("ck_thread", D.id), t.toString();
349
- })(), At = b(D.capture?.screenshot?.thumbnail_url, "image"), jt = b(D.capture?.screenshot?.url), Mt = D.status === "resolved" || D.status === "closed", Nt = b(D.page.url), $ = D.capture?.device, Pt = D.capture?.viewport, Ft = [
350
- [u("detailCreated"), /* @__PURE__ */ s("time", {
351
- dateTime: D.created_at,
352
- children: l(D.created_at)
353
- })],
354
- ...D.resolved_at && D.status === "resolved" ? [[u("detailResolved"), /* @__PURE__ */ s("time", {
355
- dateTime: D.resolved_at,
356
- children: l(D.resolved_at)
357
- })]] : [],
358
- ...Nt ? [[u("detailPage"), /* @__PURE__ */ s("a", {
359
- href: Nt,
360
- target: "_blank",
361
- rel: "noopener noreferrer",
362
- children: /* @__PURE__ */ s("bdi", { children: D.page.title || D.page.path })
363
- })]] : [],
364
- ...$?.browser || $?.os ? [[u("detailBrowser"), /* @__PURE__ */ s("bdi", { children: [$.browser && `${$.browser}${$.browser_version ? ` ${$.browser_version.split(".")[0]}` : ""}`, $.os && `${$.os}${$.os_version ? ` ${$.os_version}` : ""}`].filter(Boolean).join(" · ") })]] : [],
365
- ...Pt?.width ? [[u("detailWindow"), /* @__PURE__ */ s("bdi", {
366
- dir: "ltr",
367
- children: `${Pt.width} × ${Pt.height}`
368
- })]] : []
369
- ];
370
- return /* @__PURE__ */ s("div", {
371
- class: w ? "ck-card ck-card-embedded" : "ck-card",
372
- style: w ? void 0 : vt,
373
- role: w ? "region" : "dialog",
374
- "aria-label": yt,
375
- "data-commentkit-ui": !0,
376
- onKeyDown: w ? (e) => e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(), w.onBack()) : void 0,
377
- children: [
378
- /* @__PURE__ */ s("div", {
379
- class: "ck-card-head",
380
- style: { position: "relative" },
381
- children: [
382
- w ? /* @__PURE__ */ s("button", {
383
- class: "ck-ghost ck-back",
384
- "aria-label": u("backToList"),
385
- title: u("backToList"),
386
- onClick: w.onBack,
387
- children: /* @__PURE__ */ s(x, {
388
- name: "chevron",
389
- size: 16
390
- })
391
- }) : null,
392
- /* @__PURE__ */ s("span", {
393
- class: "ck-card-title",
394
- ref: Ie,
395
- tabIndex: -1,
396
- children: yt
397
- }),
398
- /* @__PURE__ */ s(ve, { status: D.status }),
399
- w?.position ? /* @__PURE__ */ s("span", {
400
- class: "ck-muted ck-card-pos",
401
- children: u("countOf", {
402
- n: w.position.n,
403
- total: w.position.total
404
- })
405
- }) : null,
406
- w?.onPrev ? /* @__PURE__ */ s("button", {
407
- class: "ck-ghost ck-step",
408
- "aria-label": u("previousThread"),
409
- title: `${u("previousThread")} (K)`,
410
- "aria-keyshortcuts": "K",
411
- onClick: w.onPrev,
412
- children: /* @__PURE__ */ s(x, {
413
- name: "chevron",
414
- size: 15
415
- })
416
- }) : null,
417
- w?.onNext ? /* @__PURE__ */ s("button", {
418
- class: "ck-ghost ck-step",
419
- "data-dir": "next",
420
- "aria-label": u("nextThread"),
421
- title: `${u("nextThread")} (J)`,
422
- "aria-keyshortcuts": "J",
423
- onClick: w.onNext,
424
- children: /* @__PURE__ */ s(x, {
425
- name: "chevron",
426
- size: 15
427
- })
428
- }) : null,
429
- /* @__PURE__ */ s("button", {
430
- class: "ck-ghost",
431
- "aria-label": u("more"),
432
- "aria-haspopup": "menu",
433
- "aria-expanded": Ze,
434
- onClick: () => Qe(!Ze),
435
- children: /* @__PURE__ */ s(x, { name: "more" })
436
- }),
437
- w ? null : /* @__PURE__ */ s("button", {
438
- class: "ck-ghost",
439
- "aria-label": u("close"),
440
- onClick: y,
441
- children: /* @__PURE__ */ s(x, { name: "close" })
442
- }),
443
- Ze ? /* @__PURE__ */ s("div", {
444
- class: "ck-menu",
445
- role: "menu",
446
- onClick: () => Qe(!1),
447
- onKeyDown: (e) => e.key === "Escape" ? (e.stopPropagation(), Qe(!1)) : Se(e, "[role=menuitem]", !0),
448
- children: [
449
- w ? /* @__PURE__ */ s("button", {
450
- role: "menuitem",
451
- onClick: () => w.onShow(D),
452
- children: u("showOnPage")
453
- }) : null,
454
- kt ? /* @__PURE__ */ s("button", {
455
- role: "menuitem",
456
- onClick: () => void Ot(kt, u("copied")),
457
- children: u("copyLink")
458
- }) : null,
459
- X?.export_for_agents ? /* @__PURE__ */ s("button", {
460
- role: "menuitem",
461
- onClick: () => void Ot(f(D, k), u("copiedForAgent")),
462
- children: u("copyForAgent")
463
- }) : null,
464
- X?.set_any_status && Z ? /* @__PURE__ */ s(n, { children: [
465
- /* @__PURE__ */ s("button", {
466
- role: "menuitem",
467
- onClick: () => void Q("in_progress"),
468
- children: u("markInProgress")
469
- }),
470
- /* @__PURE__ */ s("button", {
471
- role: "menuitem",
472
- onClick: () => void Q("in_review"),
473
- children: u("markInReview")
474
- }),
475
- /* @__PURE__ */ s("button", {
476
- role: "menuitem",
477
- onClick: () => void Q("closed"),
478
- children: u("closeThread")
479
- })
480
- ] }) : null,
481
- /* @__PURE__ */ s("button", {
482
- role: "menuitem",
483
- onClick: () => void xt(),
484
- children: u(ct ? "mute" : "unmute")
485
- }),
486
- Z && (X?.manage || gt && D.message_count <= 1) ? /* @__PURE__ */ s("button", {
487
- role: "menuitem",
488
- class: "ck-danger",
489
- onClick: Dt,
490
- children: u("delete")
491
- }) : null
492
- ]
493
- }) : null
494
- ]
495
- }),
496
- /* @__PURE__ */ s(pe, {
497
- client: i,
498
- thread: D,
499
- editable: !!X?.triage && Z,
500
- onChange: (e) => K.current === e.id && O(e),
501
- onError: bt
502
- }),
503
- /* @__PURE__ */ s("div", {
504
- class: "ck-card-body",
505
- ref: ut,
506
- onScroll: (e) => {
507
- let t = e.currentTarget;
508
- V(t.scrollHeight - t.scrollTop - t.clientHeight > 120), G(null);
509
- },
510
- onMouseOver: (e) => {
511
- let t = e.target.closest?.(".ck-mention");
512
- if (!t) return G(null);
513
- let n = t.textContent?.replace(/^@/, "") ?? "", r = U.find((e) => e.name === n) ?? U.find((e) => n.startsWith(e.name));
514
- if (!r) return;
515
- let i = t.getBoundingClientRect();
516
- G({
517
- person: r,
518
- x: i.left,
519
- y: i.bottom + 6
520
- });
521
- },
522
- onMouseLeave: () => G(null),
523
- children: [
524
- Y?.state === "detached" ? /* @__PURE__ */ s("div", {
525
- class: "ck-note",
526
- "data-tone": "warning",
527
- children: u("detached")
528
- }) : null,
529
- Y?.state === "moved" ? /* @__PURE__ */ s("p", {
530
- class: "ck-muted",
531
- children: u("moved")
532
- }) : null,
533
- me(D) ? /* @__PURE__ */ s("p", {
534
- class: "ck-muted",
535
- title: `${D.breakpoint}px`,
536
- children: u(`screen_${we(D.breakpoint)}`)
537
- }) : null,
538
- D.page.branch && i.options.branch ? /* @__PURE__ */ s("p", {
539
- class: "ck-muted ck-build",
540
- children: u("leftOnBranch", {
541
- branch: D.page.branch,
542
- commit: D.page.commit_sha ? ` @ ${D.page.commit_sha.slice(0, 7)}` : ""
543
- })
544
- }) : null,
545
- D.anchor.quote ? /* @__PURE__ */ s("blockquote", {
546
- class: "ck-quote",
547
- "aria-label": u("quotedText"),
548
- children: /* @__PURE__ */ s("bdi", { children: D.anchor.quote })
549
- }) : null,
550
- D.description?.trim() ? /* @__PURE__ */ s("details", {
551
- class: "ck-description",
552
- open: D.description.length <= 280,
553
- children: [/* @__PURE__ */ s("summary", { children: u("description") }), /* @__PURE__ */ s("p", { children: /* @__PURE__ */ s("bdi", { children: D.description }) })]
554
- }) : null,
555
- /* @__PURE__ */ s(fe, {
556
- client: i,
557
- thread: D,
558
- editable: Z && (!!X?.triage || !!gt),
559
- onChange: (e) => K.current === e.id && O(e),
560
- onError: S
561
- }),
562
- D.style_changes?.length ? /* @__PURE__ */ s(De, {
563
- thread: D,
564
- element: Y?.state === "detached" ? null : Y?.element ?? null,
565
- editable: Z && (!!X?.triage || !!gt),
566
- client: i,
567
- onChange: (e) => K.current === e.id && O(e),
568
- onError: bt
569
- }) : null,
570
- /* @__PURE__ */ s("div", {
571
- class: "ck-details",
572
- children: [/* @__PURE__ */ s("button", {
573
- class: "ck-details-toggle",
574
- "aria-expanded": et,
575
- "aria-controls": "ck-details",
576
- onClick: () => tt(!et),
577
- children: u("details")
578
- }), et ? /* @__PURE__ */ s("dl", {
579
- id: "ck-details",
580
- children: Ft.map(([e, t]) => /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("dt", { children: e }), /* @__PURE__ */ s("dd", { children: t })] }))
581
- }) : null]
582
- }),
583
- D.status === "in_review" && !X?.set_any_status && Z ? /* @__PURE__ */ s("div", {
584
- class: "ck-review-ask",
585
- children: [/* @__PURE__ */ s("div", { children: u("reviewAsk") }), /* @__PURE__ */ s("div", {
586
- class: "ck-actions",
587
- children: [/* @__PURE__ */ s("button", {
588
- class: "ck-btn ck-primary",
589
- onClick: () => void Q("resolved"),
590
- children: [
591
- /* @__PURE__ */ s(x, {
592
- name: "check",
593
- size: 14
594
- }),
595
- " ",
596
- u("looksGood")
597
- ]
598
- }), /* @__PURE__ */ s("button", {
599
- class: "ck-btn",
600
- onClick: () => st(!0),
601
- children: u("notYet")
602
- })]
603
- })]
604
- }) : null,
605
- k.map((e, t) => {
606
- let a = Ee(e.author, T), o = t === 0;
607
- return /* @__PURE__ */ s("div", {
608
- class: "ck-msg",
609
- id: `ck-msg-${e.id}`,
610
- "data-mine": a || void 0,
611
- "data-reply": !o || void 0,
612
- "data-new": !at.current.has(e.id) || void 0,
613
- children: [/* @__PURE__ */ s(xe, { person: e.author }), /* @__PURE__ */ s("div", {
614
- class: "ck-msg-main",
615
- children: [
616
- /* @__PURE__ */ s("div", {
617
- class: "ck-msg-meta",
618
- children: [
619
- /* @__PURE__ */ s("bdi", {
620
- class: "ck-msg-name",
621
- children: e.author.name
622
- }),
623
- /* @__PURE__ */ s("time", {
624
- dateTime: e.created_at,
625
- title: l(e.created_at),
626
- children: r(e.created_at)
627
- }),
628
- e.edited_at ? /* @__PURE__ */ s("span", {
629
- title: l(e.edited_at),
630
- children: ["· ", u("edited")]
631
- }) : null,
632
- L?.id === e.id ? null : /* @__PURE__ */ s("span", {
633
- class: "ck-msg-actions",
634
- children: [
635
- Z ? /* @__PURE__ */ s("button", {
636
- class: "ck-ghost ck-ghost-sm",
637
- "aria-label": u("replyTo", { name: e.author.name }),
638
- title: u("quoteReply"),
639
- onClick: () => B(e),
640
- children: /* @__PURE__ */ s(x, {
641
- name: "reply",
642
- size: 14
643
- })
644
- }) : null,
645
- /* @__PURE__ */ s("button", {
646
- class: "ck-ghost ck-ghost-sm",
647
- "aria-label": u("copyText"),
648
- title: u("copyText"),
649
- onClick: () => void Ot(e.body, u("copiedText")),
650
- children: /* @__PURE__ */ s(x, {
651
- name: "copy",
652
- size: 14
653
- })
654
- }),
655
- Z && a ? /* @__PURE__ */ s("button", {
656
- class: "ck-ghost ck-ghost-sm",
657
- onClick: () => R({
658
- id: e.id,
659
- body: e.body
660
- }),
661
- children: u("edit")
662
- }) : null,
663
- Z && (a || X?.manage) && !o ? /* @__PURE__ */ s("button", {
664
- class: "ck-ghost ck-ghost-sm ck-danger",
665
- onClick: () => Et(e),
666
- children: u("delete")
667
- }) : null
668
- ]
669
- })
670
- ]
671
- }),
672
- e.reply_to ? /* @__PURE__ */ s("button", {
673
- class: "ck-quote ck-quote-msg",
674
- onClick: () => document.querySelector("[data-commentkit-host]")?.shadowRoot?.getElementById(`ck-msg-${e.reply_to.id}`)?.scrollIntoView({
675
- block: "center",
676
- behavior: je() ? "auto" : "smooth"
677
- }),
678
- children: [
679
- /* @__PURE__ */ s("strong", { children: /* @__PURE__ */ s("bdi", { children: e.reply_to.author.name }) }),
680
- " ",
681
- /* @__PURE__ */ s("bdi", { children: e.reply_to.excerpt })
682
- ]
683
- }) : null,
684
- L?.id === e.id ? /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("div", {
685
- onKeyDown: (e) => {
686
- e.key === "Escape" && (e.stopPropagation(), R(null));
687
- },
688
- children: /* @__PURE__ */ s(se, {
689
- client: i,
690
- value: L.body,
691
- onChange: (t) => R({
692
- id: e.id,
693
- body: t
694
- }),
695
- onMentions: () => void 0,
696
- onSubmit: St,
697
- placeholder: u("edit"),
698
- autofocus: !0,
699
- disabled: F,
700
- canMention: !0
701
- })
702
- }), /* @__PURE__ */ s("div", {
703
- class: "ck-actions",
704
- children: [/* @__PURE__ */ s("button", {
705
- class: "ck-btn",
706
- onClick: () => R(null),
707
- children: u("cancel")
708
- }), /* @__PURE__ */ s("button", {
709
- class: "ck-btn ck-primary",
710
- disabled: F || !L.body.trim(),
711
- onClick: St,
712
- children: u(F ? "saving" : "save")
713
- })]
714
- })] }) : /* @__PURE__ */ s("div", {
715
- class: "ck-msg-body",
716
- dir: "auto",
717
- children: /* @__PURE__ */ s(ye, {
718
- text: e.body,
719
- people: it
720
- })
721
- }),
722
- L?.id === e.id ? null : /* @__PURE__ */ s(Ne, {
723
- client: i,
724
- text: e.body
725
- }),
726
- (() => {
727
- let t = (e.attachments ?? []).filter((e) => e.kind !== "screenshot"), r = [...o && At ? [{
728
- src: jt ?? At,
729
- name: u("screenshot"),
730
- href: jt
731
- }] : [], ...t.filter(Me).map((e) => ({
732
- src: b(e.url, "image") ?? b(e.thumbnail_url, "image"),
733
- name: e.name,
734
- href: b(e.url)
735
- }))], i = [...o && At ? [At] : [], ...t.filter(Me).map((e) => b(e.thumbnail_url, "image") ?? b(e.url, "image"))], a = t.filter((e) => !Me(e));
736
- return /* @__PURE__ */ s(n, { children: [i.length === 1 ? /* @__PURE__ */ s("button", {
737
- class: "ck-shot",
738
- "aria-label": u("openImage", { name: r[0].name }),
739
- onClick: () => We(r, 0),
740
- children: /* @__PURE__ */ s("img", {
741
- src: i[0],
742
- alt: r[0].name,
743
- loading: "lazy",
744
- onLoad: ft
745
- })
746
- }) : i.length ? /* @__PURE__ */ s("div", {
747
- class: "ck-grid",
748
- "data-count": Math.min(i.length, 4),
749
- children: i.slice(0, 4).map((e, t) => /* @__PURE__ */ s("button", {
750
- class: "ck-grid-item",
751
- "aria-label": u("openImage", { name: r[t].name }),
752
- onClick: () => We(r, t),
753
- children: [/* @__PURE__ */ s("img", {
754
- src: e,
755
- alt: r[t].name,
756
- loading: "lazy",
757
- onLoad: ft
758
- }), t === 3 && i.length > 4 ? /* @__PURE__ */ s("span", {
759
- class: "ck-grid-more",
760
- "aria-hidden": "true",
761
- children: ["+", i.length - 4]
762
- }) : null]
763
- }))
764
- }) : null, a.length ? /* @__PURE__ */ s("div", {
765
- class: "ck-files",
766
- children: a.map((e) => {
767
- let t = b(e.url);
768
- return t ? /* @__PURE__ */ s("a", {
769
- class: "ck-file",
770
- href: t,
771
- target: "_blank",
772
- rel: "noopener noreferrer",
773
- children: /* @__PURE__ */ s("bdi", { children: e.name })
774
- }) : /* @__PURE__ */ s("span", {
775
- class: "ck-file",
776
- children: /* @__PURE__ */ s("bdi", { children: e.name })
777
- });
778
- })
779
- }) : null] });
780
- })(),
781
- /* @__PURE__ */ s("div", {
782
- class: "ck-reactions",
783
- children: [
784
- (e.reactions ?? []).map((t) => {
785
- let n = `${ee("reactionLabel", t.count, { emoji: t.emoji })}${t.mine ? `, ${u("youReacted")}` : ""}`;
786
- return /* @__PURE__ */ s("button", {
787
- class: "ck-reaction",
788
- "aria-pressed": t.mine,
789
- "aria-label": n,
790
- title: n,
791
- onClick: () => void wt(e, t.emoji),
792
- children: [
793
- /* @__PURE__ */ s(Ce, { char: t.emoji }),
794
- " ",
795
- t.count
796
- ]
797
- });
798
- }),
799
- Z && Oe.filter((t) => !(e.reactions ?? []).some((e) => e.emoji === t)).slice(0, 3).map((t) => /* @__PURE__ */ s("button", {
800
- class: "ck-reaction ck-reaction-add",
801
- "aria-label": u("reactWith", { emoji: t }),
802
- title: u("reactWith", { emoji: t }),
803
- onClick: () => void wt(e, t),
804
- children: /* @__PURE__ */ s(Ce, { char: t })
805
- })),
806
- Z ? /* @__PURE__ */ s("span", {
807
- class: "ck-picker-wrap",
808
- children: [/* @__PURE__ */ s("button", {
809
- class: "ck-reaction ck-reaction-more",
810
- "aria-label": u("moreReactions"),
811
- title: u("moreReactions"),
812
- "aria-expanded": H === e.id,
813
- "aria-haspopup": "true",
814
- onClick: () => nt(H === e.id ? null : e.id),
815
- children: /* @__PURE__ */ s(x, {
816
- name: "smile",
817
- size: 14
818
- })
819
- }), H === e.id ? /* @__PURE__ */ s("div", {
820
- class: "ck-picker",
821
- role: "group",
822
- "aria-label": u("moreReactions"),
823
- ref: ge,
824
- onKeyDown: (e) => {
825
- e.key === "Escape" ? (e.stopPropagation(), nt(null)) : Se(e, "button", !1);
826
- },
827
- children: h.map((t) => {
828
- let n = (e.reactions ?? []).some((e) => e.emoji === t && e.mine);
829
- return /* @__PURE__ */ s("button", {
830
- "aria-pressed": n,
831
- "aria-label": u("reactWith", { emoji: t }),
832
- onClick: () => (nt(null), void wt(e, t)),
833
- children: /* @__PURE__ */ s(Ce, { char: t })
834
- });
835
- })
836
- }) : null]
837
- }) : null
838
- ]
839
- }),
840
- o && k.length === 1 ? /* @__PURE__ */ s("p", {
841
- class: "ck-muted ck-no-replies",
842
- children: u("noReplies")
843
- }) : null
844
- ]
845
- })]
846
- });
847
- })
848
- ]
849
- }),
850
- /* @__PURE__ */ s("div", {
851
- class: "ck-card-foot",
852
- style: {
853
- flexDirection: "column",
854
- alignItems: "stretch",
855
- position: "relative"
856
- },
857
- ...Z && ht ? ne(Tt) : {},
858
- children: [$e ? /* @__PURE__ */ s("button", {
859
- class: "ck-chip ck-jump",
860
- onClick: () => (V(!1), dt(!0)),
861
- children: [/* @__PURE__ */ s(x, {
862
- name: "down",
863
- size: 14
864
- }), u("jumpToLatest")]
865
- }) : null, Z ? /* @__PURE__ */ s(n, { children: [
866
- Fe ? null : /* @__PURE__ */ s("div", {
867
- class: "ck-note",
868
- "data-tone": "warning",
869
- role: "status",
870
- children: u("offline")
871
- }),
872
- Ye && Fe ? /* @__PURE__ */ s("div", {
873
- class: "ck-note",
874
- "data-tone": "warning",
875
- role: "alert",
876
- children: Ye === !0 ? /* @__PURE__ */ s(n, { children: [
877
- u("replyFailed"),
878
- " ",
879
- /* @__PURE__ */ s("button", {
880
- class: "ck-btn",
881
- disabled: F,
882
- onClick: () => void Ct(),
883
- children: u("retry")
884
- })
885
- ] }) : Ye
886
- }) : null,
887
- /* @__PURE__ */ s(se, {
888
- client: i,
889
- value: N,
890
- onChange: ze,
891
- onMentions: qe,
892
- onSubmit: () => void Ct(),
893
- placeholder: u(ot ? "notYetPlaceholder" : Mt ? "replyToReopen" : "replyPlaceholder"),
894
- autofocus: ot || !!z,
895
- disabled: F,
896
- canMention: !0,
897
- above: z ? /* @__PURE__ */ s("div", {
898
- class: "ck-quoting",
899
- role: "status",
900
- children: [
901
- /* @__PURE__ */ s(x, {
902
- name: "reply",
903
- size: 14
904
- }),
905
- /* @__PURE__ */ s("span", { children: [
906
- /* @__PURE__ */ s("strong", { children: /* @__PURE__ */ s("bdi", { children: z.author.name }) }),
907
- " ",
908
- /* @__PURE__ */ s("bdi", { children: z.body.slice(0, 140) })
909
- ] }),
910
- /* @__PURE__ */ s("button", {
911
- class: "ck-ghost ck-ghost-sm",
912
- "aria-label": u("quoteCancel"),
913
- onClick: () => B(null),
914
- children: /* @__PURE__ */ s(x, {
915
- name: "close",
916
- size: 14
917
- })
918
- })
919
- ]
920
- }) : null
921
- }),
922
- /* @__PURE__ */ s(le, {
923
- items: P.items,
924
- onRemove: P.remove,
925
- onRetry: P.retry,
926
- onOpen: (e) => We(P.items.filter((e) => e.preview).map((e) => ({
927
- src: e.preview,
928
- name: e.file.name
929
- })), e)
930
- }),
931
- /* @__PURE__ */ s("div", {
932
- class: "ck-actions",
933
- style: { marginTop: 0 },
934
- children: [
935
- ht ? /* @__PURE__ */ s(re, {
936
- input: Ge,
937
- onFiles: Tt
938
- }) : null,
939
- Mt ? /* @__PURE__ */ s("button", {
940
- class: "ck-btn",
941
- onClick: () => void Q("open"),
942
- children: u("reopen")
943
- }) : /* @__PURE__ */ s("button", {
944
- class: "ck-btn",
945
- title: u("resolveHint"),
946
- "aria-keyshortcuts": i.options.shortcuts === !1 ? void 0 : "E",
947
- onClick: () => void Q("resolved"),
948
- children: [
949
- /* @__PURE__ */ s(x, {
950
- name: "check",
951
- size: 14
952
- }),
953
- " ",
954
- u("resolve")
955
- ]
956
- }),
957
- /* @__PURE__ */ s("span", { class: "ck-spacer" }),
958
- /* @__PURE__ */ s("button", {
959
- class: "ck-btn ck-primary",
960
- disabled: F || !N.trim() || !Fe,
961
- onClick: () => void Ct(),
962
- children: u(F ? "sending" : "reply")
963
- })
964
- ]
965
- })
966
- ] }) : /* @__PURE__ */ s("div", {
967
- class: "ck-note",
968
- role: "status",
969
- children: u(Pe ? "readOnlyReply" : "noReplyAccess")
970
- })]
971
- }),
972
- Be && He ? /* @__PURE__ */ s(He, {
973
- images: Be.images,
974
- start: Be.start,
975
- onClose: () => Ve(null)
976
- }) : null,
977
- W ? /* @__PURE__ */ s("div", {
978
- class: "ck-mention-card",
979
- style: {
980
- left: `${Math.min(W.x, innerWidth - 220)}px`,
981
- top: `${W.y}px`
982
- },
983
- "aria-hidden": "true",
984
- children: [/* @__PURE__ */ s(xe, { person: W.person }), /* @__PURE__ */ s("bdi", {
985
- class: "ck-msg-name",
986
- children: W.person.name
987
- })]
988
- }) : null
989
- ]
990
- });
991
- }
992
- var Ae = 6e3;
993
- function je() {
994
- return matchMedia("(prefers-reduced-motion: reduce)").matches;
995
- }
996
- function Me(e) {
997
- return e.mime.startsWith("image/") && !!(b(e.url, "image") || b(e.thumbnail_url, "image"));
998
- }
999
- function Ne({ client: e, text: t }) {
1000
- let n = o(() => [...new Set([...t.matchAll(/https?:\/\/[^\s<>"')\u200b-\u200f\u202a-\u202e\u2060-\u2069\ufeff]+/g)].map((e) => b(e[0])).filter((e) => !!e))].slice(0, 2), [t]), [r, i] = c([]);
1001
- return d(() => {
1002
- let t = !0;
1003
- return i([]), n.length && Promise.all(n.map((t) => e.linkPreview(t))).then((e) => t && i(e.filter((e) => !!e))), () => {
1004
- t = !1;
1005
- };
1006
- }, [n.join(" ")]), r.length ? /* @__PURE__ */ s("div", {
1007
- class: "ck-previews",
1008
- children: r.map((e) => {
1009
- let t = b(e.url);
1010
- return t ? /* @__PURE__ */ s("a", {
1011
- class: "ck-preview",
1012
- href: t,
1013
- target: "_blank",
1014
- rel: "noopener noreferrer nofollow ugc",
1015
- children: [
1016
- /* @__PURE__ */ s("span", {
1017
- class: "ck-preview-site",
1018
- children: /* @__PURE__ */ s("bdi", { children: e.site })
1019
- }),
1020
- /* @__PURE__ */ s("strong", { children: /* @__PURE__ */ s("bdi", { children: e.title }) }),
1021
- e.description ? /* @__PURE__ */ s("span", {
1022
- class: "ck-preview-text",
1023
- children: /* @__PURE__ */ s("bdi", { children: e.description })
1024
- }) : null
1025
- ]
1026
- }) : null;
1027
- })
1028
- }) : null;
1029
- }
1030
- export { C as ThreadCard };