@commentkit/comment-kit 0.0.0-stage → 0.6.2

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 (207) hide show
  1. package/CHANGELOG.md +276 -0
  2. package/LICENSE +18 -0
  3. package/README.md +766 -2
  4. package/dist/angular/ShadowRootContext-2BrAO1qU.js +7 -0
  5. package/dist/angular/chunk-Cyg4N8Ue.js +11 -0
  6. package/dist/angular/comment-kit-ui-wEJfMh4T.js +9483 -0
  7. package/dist/angular/dom-ON-u4y6t.js +97 -0
  8. package/dist/angular/error-boundary-CxhCm8iF.js +21 -0
  9. package/dist/angular/limits-AEqOBweE.js +71 -0
  10. package/dist/angular/mount-ui-CxChSb8B.js +55 -0
  11. package/dist/angular/pusher-Vs-W-c8I.js +2504 -0
  12. package/dist/angular/realtime-CfJZMEAi.js +558 -0
  13. package/dist/angular/shadow-root-C7wgghDv.js +86 -0
  14. package/dist/angular/styles-CvndAWRF.js +2 -0
  15. package/dist/angular.es.js +3656 -0
  16. package/dist/comment-kit.es.js +3361 -0
  17. package/dist/core/ShadowRootContext--ArKkwbH.js +7 -0
  18. package/dist/core/chunk-t7YoJN_i.js +11 -0
  19. package/dist/core/comment-kit-ui-DjWARy4X.js +9483 -0
  20. package/dist/core/dom-x9svfpMk.js +223 -0
  21. package/dist/core/error-boundary-CN_BGsYl.js +21 -0
  22. package/dist/core/mount-ui-DrFjMJJu.js +55 -0
  23. package/dist/core/pusher-CizoY5NA.js +2504 -0
  24. package/dist/core/realtime-DYf6E_sN.js +278 -0
  25. package/dist/core/shadow-root-09zwHxly.js +86 -0
  26. package/dist/core/styles-D19zARBi.js +2 -0
  27. package/dist/core/websocket-manager-DorGPjR4.js +351 -0
  28. package/dist/preact/ShadowRootContext-CJWLIRy4.js +7 -0
  29. package/dist/preact/chunk-CZ0PdaaN.js +11 -0
  30. package/dist/preact/comment-kit-ui-BKi15Z4Q.js +9483 -0
  31. package/dist/preact/dom-BAV8grk_.js +97 -0
  32. package/dist/preact/error-boundary-B4-Bfy3g.js +21 -0
  33. package/dist/preact/limits-C3ZEKcL_.js +71 -0
  34. package/dist/preact/mount-ui-b9JcJQYE.js +55 -0
  35. package/dist/preact/pusher-BP4kCufH.js +2504 -0
  36. package/dist/preact/realtime-BFgP4BlB.js +558 -0
  37. package/dist/preact/shadow-root-DAhpHo_W.js +86 -0
  38. package/dist/preact/styles-Dwd4AJR8.js +2 -0
  39. package/dist/preact.es.js +3465 -0
  40. package/dist/qwik/ShadowRootContext-CTbULRKq.js +7 -0
  41. package/dist/qwik/chunk-CKKKzG2Q.js +11 -0
  42. package/dist/qwik/comment-kit-ui-CRmJhZlX.js +9483 -0
  43. package/dist/qwik/dom-BjJ-QroQ.js +97 -0
  44. package/dist/qwik/error-boundary-C4hlYQwS.js +21 -0
  45. package/dist/qwik/limits-DK35yjGY.js +71 -0
  46. package/dist/qwik/mount-ui-CaRrLb9u.js +55 -0
  47. package/dist/qwik/pusher-B1KgC4iB.js +2504 -0
  48. package/dist/qwik/realtime-DUhkZAVc.js +558 -0
  49. package/dist/qwik/shadow-root-tLjXys-_.js +86 -0
  50. package/dist/qwik/styles-BB1B91hh.js +2 -0
  51. package/dist/qwik.es.js +3458 -0
  52. package/dist/react/chunk--MHYZ-zp.js +12 -0
  53. package/dist/react/limits-Dflmuf1P.js +168 -0
  54. package/dist/react/pusher-3dki8s2l.js +2505 -0
  55. package/dist/react/realtime-C7h-Agwo.js +558 -0
  56. package/dist/react.es.js +13010 -0
  57. package/dist/solid/ShadowRootContext-BS6MCclL.js +7 -0
  58. package/dist/solid/chunk-B2NCWFvW.js +11 -0
  59. package/dist/solid/comment-kit-ui-Dw_67h_e.js +9483 -0
  60. package/dist/solid/dom-Bpw1A0oz.js +97 -0
  61. package/dist/solid/error-boundary-9mimpbZA.js +21 -0
  62. package/dist/solid/limits-B_69IbLl.js +71 -0
  63. package/dist/solid/mount-ui-bPWYgjmm.js +55 -0
  64. package/dist/solid/pusher-_RVNpj1f.js +2504 -0
  65. package/dist/solid/realtime-DK86zDCJ.js +558 -0
  66. package/dist/solid/shadow-root-D5nErAFI.js +86 -0
  67. package/dist/solid/styles-CtYBghRP.js +2 -0
  68. package/dist/solid.es.js +3446 -0
  69. package/dist/svelte/ShadowRootContext-DhByMr-q.js +7 -0
  70. package/dist/svelte/chunk-Pi70BKld.js +11 -0
  71. package/dist/svelte/comment-kit-ui-DhCWlEd8.js +9483 -0
  72. package/dist/svelte/dom-mfioQqLy.js +97 -0
  73. package/dist/svelte/error-boundary-C3GWI_IX.js +21 -0
  74. package/dist/svelte/limits-CURF22v3.js +71 -0
  75. package/dist/svelte/mount-ui-DtXWMEYn.js +55 -0
  76. package/dist/svelte/pusher-DN1BiUDw.js +2504 -0
  77. package/dist/svelte/realtime-zYOctwRk.js +558 -0
  78. package/dist/svelte/shadow-root-Cz-v-rYe.js +86 -0
  79. package/dist/svelte/styles-DKCGeARl.js +2 -0
  80. package/dist/svelte.es.js +3478 -0
  81. package/dist/types/adapters/bridge.d.ts +125 -0
  82. package/dist/types/adapters/errors.d.ts +3 -0
  83. package/dist/types/angular/index.d.ts +135 -0
  84. package/dist/types/core/agent-context.d.ts +17 -0
  85. package/dist/types/core/api-client.d.ts +137 -0
  86. package/dist/types/core/auth.d.ts +18 -0
  87. package/dist/types/core/comment-kit-core.d.ts +215 -0
  88. package/dist/types/core/comments.d.ts +43 -0
  89. package/dist/types/core/dev-grab.d.ts +14 -0
  90. package/dist/types/core/keyboard.d.ts +12 -0
  91. package/dist/types/core/limits.d.ts +52 -0
  92. package/dist/types/core/offline-queue.d.ts +23 -0
  93. package/dist/types/core/realtime.d.ts +9 -0
  94. package/dist/types/core/screenshot.d.ts +12 -0
  95. package/dist/types/core/session.d.ts +9 -0
  96. package/dist/types/core/source-resolver.d.ts +19 -0
  97. package/dist/types/core/state.d.ts +24 -0
  98. package/dist/types/core/types.d.ts +610 -0
  99. package/dist/types/core/websocket-manager.d.ts +107 -0
  100. package/dist/types/index.d.ts +85 -0
  101. package/dist/types/preact/index.d.ts +25 -0
  102. package/dist/types/qwik/index.d.ts +70 -0
  103. package/dist/types/react/client.d.ts +31 -0
  104. package/dist/types/react/comment-kit-ui.d.ts +9 -0
  105. package/dist/types/react/components/comment-fab.d.ts +34 -0
  106. package/dist/types/react/components/dev-export-panel.d.ts +10 -0
  107. package/dist/types/react/components/element-selector.d.ts +11 -0
  108. package/dist/types/react/components/live-region.d.ts +16 -0
  109. package/dist/types/react/components/screenshot-capture.d.ts +17 -0
  110. package/dist/types/react/components/status-indicator.d.ts +43 -0
  111. package/dist/types/react/error-boundary.d.ts +25 -0
  112. package/dist/types/react/index.d.ts +4 -0
  113. package/dist/types/react/is-local-host.d.ts +2 -0
  114. package/dist/types/react/mount-ui.d.ts +19 -0
  115. package/dist/types/react/shadow-root.d.ts +23 -0
  116. package/dist/types/react/shims/use-sync-external-store-with-selector.d.ts +4 -0
  117. package/dist/types/react/shims/use-sync-external-store.d.ts +1 -0
  118. package/dist/types/react/ui/lib/ShadowRootContext.d.ts +10 -0
  119. package/dist/types/react/ui/lib/cn.d.ts +12 -0
  120. package/dist/types/react/ui/primitives/alert-dialog/alert-dialog.d.ts +23 -0
  121. package/dist/types/react/ui/primitives/alert-dialog/index.d.ts +1 -0
  122. package/dist/types/react/ui/primitives/avatar/avatar.d.ts +10 -0
  123. package/dist/types/react/ui/primitives/avatar/index.d.ts +1 -0
  124. package/dist/types/react/ui/primitives/badge/badge.d.ts +5 -0
  125. package/dist/types/react/ui/primitives/badge/index.d.ts +1 -0
  126. package/dist/types/react/ui/primitives/button/button.d.ts +6 -0
  127. package/dist/types/react/ui/primitives/button/index.d.ts +1 -0
  128. package/dist/types/react/ui/primitives/card/card.d.ts +11 -0
  129. package/dist/types/react/ui/primitives/card/index.d.ts +1 -0
  130. package/dist/types/react/ui/primitives/checkbox/checkbox.d.ts +3 -0
  131. package/dist/types/react/ui/primitives/checkbox/index.d.ts +1 -0
  132. package/dist/types/react/ui/primitives/dialog/dialog.d.ts +17 -0
  133. package/dist/types/react/ui/primitives/dialog/index.d.ts +1 -0
  134. package/dist/types/react/ui/primitives/dropdown-menu/dropdown-menu.d.ts +29 -0
  135. package/dist/types/react/ui/primitives/dropdown-menu/index.d.ts +1 -0
  136. package/dist/types/react/ui/primitives/empty/empty.d.ts +10 -0
  137. package/dist/types/react/ui/primitives/empty/index.d.ts +1 -0
  138. package/dist/types/react/ui/primitives/field/field.d.ts +22 -0
  139. package/dist/types/react/ui/primitives/field/index.d.ts +1 -0
  140. package/dist/types/react/ui/primitives/hover-card/hover-card.d.ts +6 -0
  141. package/dist/types/react/ui/primitives/hover-card/index.d.ts +1 -0
  142. package/dist/types/react/ui/primitives/input/index.d.ts +1 -0
  143. package/dist/types/react/ui/primitives/input/input.d.ts +3 -0
  144. package/dist/types/react/ui/primitives/input-group/index.d.ts +1 -0
  145. package/dist/types/react/ui/primitives/input-group/input-group.d.ts +16 -0
  146. package/dist/types/react/ui/primitives/kbd/index.d.ts +1 -0
  147. package/dist/types/react/ui/primitives/kbd/kbd.d.ts +4 -0
  148. package/dist/types/react/ui/primitives/label/index.d.ts +1 -0
  149. package/dist/types/react/ui/primitives/label/label.d.ts +3 -0
  150. package/dist/types/react/ui/primitives/native-select/index.d.ts +1 -0
  151. package/dist/types/react/ui/primitives/native-select/native-select.d.ts +7 -0
  152. package/dist/types/react/ui/primitives/popover/index.d.ts +1 -0
  153. package/dist/types/react/ui/primitives/popover/popover.d.ts +9 -0
  154. package/dist/types/react/ui/primitives/preview/component-preview.d.ts +8 -0
  155. package/dist/types/react/ui/primitives/progress/index.d.ts +1 -0
  156. package/dist/types/react/ui/primitives/progress/progress.d.ts +7 -0
  157. package/dist/types/react/ui/primitives/radio-group/index.d.ts +1 -0
  158. package/dist/types/react/ui/primitives/radio-group/radio-group.d.ts +6 -0
  159. package/dist/types/react/ui/primitives/scroll-area/index.d.ts +1 -0
  160. package/dist/types/react/ui/primitives/scroll-area/scroll-area.d.ts +6 -0
  161. package/dist/types/react/ui/primitives/select/index.d.ts +1 -0
  162. package/dist/types/react/ui/primitives/select/select.d.ts +15 -0
  163. package/dist/types/react/ui/primitives/separator/index.d.ts +1 -0
  164. package/dist/types/react/ui/primitives/separator/separator.d.ts +3 -0
  165. package/dist/types/react/ui/primitives/sheet/index.d.ts +1 -0
  166. package/dist/types/react/ui/primitives/sheet/sheet.d.ts +14 -0
  167. package/dist/types/react/ui/primitives/skeleton/index.d.ts +1 -0
  168. package/dist/types/react/ui/primitives/skeleton/skeleton.d.ts +3 -0
  169. package/dist/types/react/ui/primitives/slider/index.d.ts +1 -0
  170. package/dist/types/react/ui/primitives/slider/slider.d.ts +7 -0
  171. package/dist/types/react/ui/primitives/sonner/index.d.ts +1 -0
  172. package/dist/types/react/ui/primitives/sonner/sonner.d.ts +4 -0
  173. package/dist/types/react/ui/primitives/spinner/index.d.ts +1 -0
  174. package/dist/types/react/ui/primitives/spinner/spinner.d.ts +3 -0
  175. package/dist/types/react/ui/primitives/switch/index.d.ts +1 -0
  176. package/dist/types/react/ui/primitives/switch/switch.d.ts +5 -0
  177. package/dist/types/react/ui/primitives/tabs/index.d.ts +1 -0
  178. package/dist/types/react/ui/primitives/tabs/tabs.d.ts +8 -0
  179. package/dist/types/react/ui/primitives/textarea/index.d.ts +1 -0
  180. package/dist/types/react/ui/primitives/textarea/textarea.d.ts +3 -0
  181. package/dist/types/react/ui/primitives/toggle/index.d.ts +1 -0
  182. package/dist/types/react/ui/primitives/toggle/toggle.d.ts +7 -0
  183. package/dist/types/react/ui/primitives/toggle-group/index.d.ts +1 -0
  184. package/dist/types/react/ui/primitives/toggle-group/toggle-group.d.ts +14 -0
  185. package/dist/types/react/ui/primitives/tooltip/index.d.ts +1 -0
  186. package/dist/types/react/ui/primitives/tooltip/tooltip.d.ts +7 -0
  187. package/dist/types/solid/index.d.ts +37 -0
  188. package/dist/types/svelte/index.d.ts +55 -0
  189. package/dist/types/utils/dom.d.ts +59 -0
  190. package/dist/types/utils/event-emitter.d.ts +11 -0
  191. package/dist/types/utils/freeze-animations.d.ts +8 -0
  192. package/dist/types/utils/text.d.ts +9 -0
  193. package/dist/types/utils/validation.d.ts +10 -0
  194. package/dist/types/vue/index.d.ts +87 -0
  195. package/dist/vue/ShadowRootContext-BQTcHNil.js +7 -0
  196. package/dist/vue/chunk-DHrubWSL.js +11 -0
  197. package/dist/vue/comment-kit-ui-BX1wDZ2c.js +9483 -0
  198. package/dist/vue/dom-eo0P9Z6Z.js +97 -0
  199. package/dist/vue/error-boundary-DW6uGR8U.js +21 -0
  200. package/dist/vue/limits-B6csdQeI.js +71 -0
  201. package/dist/vue/mount-ui-DdTYzv6J.js +55 -0
  202. package/dist/vue/pusher-cmjNbW6a.js +2504 -0
  203. package/dist/vue/realtime-YJKvS2eB.js +558 -0
  204. package/dist/vue/shadow-root-SLTVf5yk.js +86 -0
  205. package/dist/vue/styles-BrHt1-ia.js +2 -0
  206. package/dist/vue.es.js +3495 -0
  207. package/package.json +205 -4
@@ -0,0 +1,223 @@
1
+ var e = typeof window < "u", t = 1920, n = 1080, r = 1;
2
+ function i(e) {
3
+ if (typeof CSS < "u" && typeof CSS.escape == "function") return CSS.escape(e);
4
+ let t = Array.from(e);
5
+ return t.map((n, r) => {
6
+ let i = n.codePointAt(0), a = r > 0 ? t[r - 1] : "";
7
+ return i === 0 || i < 32 || i === 127 || r === 0 && /[0-9]/.test(n) || r === 1 && a === "-" && /[0-9]/.test(n) || r === 0 && n === "-" && e.length === 1 || !/[a-zA-Z0-9_-]/.test(n) ? `\\${i.toString(16)} ` : n;
8
+ }).join("");
9
+ }
10
+ function a(e) {
11
+ return e.includes("\"") ? e.includes("'") ? `concat(${e.split("\"").map((e) => `"${e}"`).join(", '\"', ")})` : `'${e}'` : `"${e}"`;
12
+ }
13
+ function o(e) {
14
+ return Number.isFinite(e) ? e : 0;
15
+ }
16
+ function s(e, t) {
17
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
18
+ }
19
+ function c(r) {
20
+ /* v8 ignore start -- SSR fallbacks unreachable in jsdom */
21
+ let i = e ? s(window.innerWidth, t) : t, a = e ? s(window.innerHeight, n) : n;
22
+ /* v8 ignore stop */
23
+ return {
24
+ width: s(r?.width, i),
25
+ height: s(r?.height, a)
26
+ };
27
+ }
28
+ function l() {
29
+ let e = globalThis.crypto;
30
+ if (typeof e?.randomUUID == "function") return e.randomUUID().replace(/-/g, "").slice(0, 12);
31
+ if (typeof e?.getRandomValues == "function") {
32
+ let t = new Uint8Array(8);
33
+ return e.getRandomValues(t), Array.from(t, (e) => e.toString(36).padStart(2, "0")).join("").slice(0, 12);
34
+ }
35
+ return Math.random().toString(36).slice(2, 14);
36
+ }
37
+ function u(e) {
38
+ return Number.isFinite(e) && e > 0 ? e : 0;
39
+ }
40
+ var d = 8;
41
+ function f(t) {
42
+ if (t.id) return `#${i(t.id)}`;
43
+ let n = e && typeof document < "u" && typeof document.querySelectorAll == "function", a = [], o = t;
44
+ for (; o && o.nodeType === r && a.length < d;) {
45
+ let e = o.nodeName.toLowerCase();
46
+ if (o.className && typeof o.className == "string") {
47
+ let t = o.className.split(/\s+/).filter(Boolean).find((e) => !e.startsWith("ck-"));
48
+ t && (e += `.${i(t)}`);
49
+ }
50
+ if (o.parentElement) {
51
+ let t = o.nodeName.toLowerCase(), n = Array.from(o.parentElement.children).filter((e) => e.nodeName.toLowerCase() === t);
52
+ n.length > 1 && (e += `:nth-of-type(${n.indexOf(o) + 1})`);
53
+ }
54
+ if (a.unshift(e), n) {
55
+ let e = a.join(" > ");
56
+ try {
57
+ if (document.querySelectorAll(e).length === 1) return e;
58
+ } catch {}
59
+ }
60
+ o = o.parentElement;
61
+ }
62
+ return a.join(" > ");
63
+ }
64
+ function p(e) {
65
+ if (e.id) return `//*[@id=${a(e.id)}]`;
66
+ let t = [], n = e;
67
+ for (; n && n.nodeType === r;) {
68
+ let e = 1, r = n.previousElementSibling;
69
+ for (; r;) r.nodeName === n.nodeName && e++, r = r.previousElementSibling;
70
+ t.unshift(`${n.nodeName.toLowerCase()}[${e}]`), n = n.parentElement;
71
+ }
72
+ return "/" + t.join("/");
73
+ }
74
+ function m(t, n) {
75
+ /* v8 ignore start -- SSR guard unreachable in jsdom */
76
+ if (!e) return null;
77
+ /* v8 ignore stop */
78
+ if (typeof t == "string") try {
79
+ let e = document.querySelector(t);
80
+ if (e) return e;
81
+ } catch {}
82
+ if (typeof n == "string" && n) try {
83
+ let e = document.evaluate(n, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
84
+ return e?.nodeType === r ? e : null;
85
+ } catch {}
86
+ return null;
87
+ }
88
+ function h(e, t, n) {
89
+ let { width: r, height: i } = c(n);
90
+ return {
91
+ x: o(e) / r * 100,
92
+ y: o(t) / i * 100
93
+ };
94
+ }
95
+ function g(e, t, n) {
96
+ let { width: r, height: i } = c(n);
97
+ return {
98
+ x: o(e) / 100 * r,
99
+ y: o(t) / 100 * i
100
+ };
101
+ }
102
+ function _() {
103
+ /* v8 ignore stop */
104
+ return e ? {
105
+ url: window.location.href,
106
+ path: window.location.pathname + window.location.search,
107
+ title: document.title,
108
+ domain: window.location.hostname
109
+ } : {
110
+ url: "",
111
+ path: "",
112
+ title: "",
113
+ domain: ""
114
+ };
115
+ }
116
+ function v(t) {
117
+ /* v8 ignore start -- SSR guard unreachable in jsdom */
118
+ if (!e) return !1;
119
+ /* v8 ignore stop */
120
+ let n = t.getBoundingClientRect();
121
+ return Number.isFinite(n.top) && Number.isFinite(n.left) && Number.isFinite(n.bottom) && Number.isFinite(n.right) && n.top >= 0 && n.left >= 0 && n.bottom <= window.innerHeight && n.right <= window.innerWidth;
122
+ }
123
+ function y(t) {
124
+ let n = t.getBoundingClientRect(), r = e ? window.pageXOffset || document.documentElement.scrollLeft : 0, i = e ? window.pageYOffset || document.documentElement.scrollTop : 0;
125
+ /* v8 ignore stop */
126
+ return {
127
+ top: n.top + i,
128
+ left: n.left + r,
129
+ width: n.width,
130
+ height: n.height,
131
+ bottom: n.bottom + i,
132
+ right: n.right + r
133
+ };
134
+ }
135
+ function b(e = "ck") {
136
+ return `${e}_${Date.now().toString(36)}_${l()}`;
137
+ }
138
+ function x(e, t) {
139
+ let n = null, r = u(t), i = (...t) => {
140
+ n && clearTimeout(n), n = setTimeout(() => {
141
+ n = null, e(...t);
142
+ }, r);
143
+ };
144
+ return i.cancel = () => {
145
+ n &&= (clearTimeout(n), null);
146
+ }, i;
147
+ }
148
+ function S(e, t) {
149
+ let n = !1, r = null, i = null, a = u(t), o = () => {
150
+ i = setTimeout(() => {
151
+ if (i = null, r) {
152
+ let t = r;
153
+ r = null, e(...t), o();
154
+ } else n = !1;
155
+ }, a);
156
+ }, s = (...t) => {
157
+ n ? r = t : (e(...t), n = !0, o());
158
+ };
159
+ return s.cancel = () => {
160
+ i &&= (clearTimeout(i), null), n = !1, r = null;
161
+ }, s;
162
+ }
163
+ var C = new Set([
164
+ "button",
165
+ "link",
166
+ "textbox",
167
+ "checkbox",
168
+ "radio",
169
+ "switch",
170
+ "slider",
171
+ "spinbutton",
172
+ "combobox",
173
+ "listbox",
174
+ "menu",
175
+ "menubar",
176
+ "menuitem",
177
+ "menuitemcheckbox",
178
+ "menuitemradio",
179
+ "option",
180
+ "tab",
181
+ "treeitem",
182
+ "searchbox",
183
+ "gridcell"
184
+ ]);
185
+ function w(e) {
186
+ if ([
187
+ "A",
188
+ "BUTTON",
189
+ "INPUT",
190
+ "SELECT",
191
+ "TEXTAREA"
192
+ ].includes(e.tagName)) return !0;
193
+ let t = e.getAttribute("contenteditable");
194
+ if (t !== null && t.toLowerCase() !== "false") return !0;
195
+ let n = e.getAttribute("role");
196
+ if (n && C.has(n.toLowerCase())) return !0;
197
+ let r = e.getAttribute("tabindex");
198
+ return !!(r !== null && Number.parseInt(r, 10) >= 0 || e.getAttribute("onclick"));
199
+ }
200
+ function T() {
201
+ /* v8 ignore start -- SSR guard unreachable in jsdom */
202
+ if (!e) return "";
203
+ /* v8 ignore stop */
204
+ let t = window.getSelection();
205
+ return t ? t.toString().trim() : "";
206
+ }
207
+ function E() {
208
+ /* v8 ignore start -- SSR guard unreachable in jsdom */
209
+ if (!e) return null;
210
+ /* v8 ignore stop */
211
+ let t = window.getSelection();
212
+ if (!t || t.rangeCount === 0) return null;
213
+ let n = t.getRangeAt(0), i = n.commonAncestorContainer, a = i.nodeType === r ? i : i.parentElement;
214
+ return a ? {
215
+ text: t.toString(),
216
+ startOffset: n.startOffset,
217
+ endOffset: n.endOffset,
218
+ element: f(a),
219
+ xpath: p(a),
220
+ range: n
221
+ } : null;
222
+ }
223
+ export { p as a, E as c, w as d, g as f, f as i, T as l, h as m, m as n, _ as o, S as p, b as r, y as s, x as t, v as u };
@@ -0,0 +1,21 @@
1
+ import e from "react";
2
+ var t = class extends e.Component {
3
+ constructor(...e) {
4
+ super(...e), this.state = { hasError: !1 };
5
+ }
6
+ static getDerivedStateFromError() {
7
+ return { hasError: !0 };
8
+ }
9
+ componentDidUpdate(e) {
10
+ this.state.hasError && e.resetKey !== this.props.resetKey && this.setState({ hasError: !1 });
11
+ }
12
+ componentDidCatch(e, t) {
13
+ try {
14
+ console.error("[CommentKit] UI error caught by ErrorBoundary:", e, t.componentStack);
15
+ } catch {}
16
+ }
17
+ render() {
18
+ return this.state.hasError ? this.props.fallback ?? null : this.props.children;
19
+ }
20
+ };
21
+ export { t as ErrorBoundary };
@@ -0,0 +1,55 @@
1
+ function e(e) {
2
+ let t = e;
3
+ if (!t || typeof t.getState != "function" || typeof t.on != "function") throw TypeError("CommentKit UI requires a valid CommentKitCore instance");
4
+ }
5
+ function t() {
6
+ if (typeof document > "u" || !document.body) throw Error("CommentKit UI requires a browser document body");
7
+ return document.body;
8
+ }
9
+ function n(e) {
10
+ return typeof e == "function";
11
+ }
12
+ async function r(r) {
13
+ e(r);
14
+ let i = await import("react"), { createRoot: a } = await import("react-dom/client"), { default: o } = await import("./styles-D19zARBi.js"), { ShadowContainer: s } = await import("./shadow-root-09zwHxly.js"), { ErrorBoundary: c } = await import("./error-boundary-CN_BGsYl.js"), { CommentKitUI: l } = await import("./comment-kit-ui-DjWARy4X.js"), u = typeof r.getConfig == "function" ? r.getConfig() : void 0, d = s, f = c, p = t();
15
+ if (p.querySelector("[data-commentkit], [data-commentkit-host]")) return console.warn("[CommentKit] UI is already mounted on this page — skipping duplicate mount. Destroy the existing instance first if you need to remount."), { unmount() {} };
16
+ let m = document.createElement("div");
17
+ m.setAttribute("data-commentkit", ""), p.appendChild(m);
18
+ let h = !0, g = null, _ = null, v = () => {
19
+ if (h = !1, _) {
20
+ try {
21
+ _();
22
+ } catch {}
23
+ _ = null;
24
+ }
25
+ if (g) {
26
+ try {
27
+ g.unmount();
28
+ } catch {}
29
+ g = null;
30
+ }
31
+ m.remove();
32
+ }, y = (e) => {
33
+ if (!h || !g) return;
34
+ let t = i.createElement(l, {
35
+ core: r,
36
+ state: e
37
+ }), n = i.createElement(d, {
38
+ styles: o,
39
+ config: u
40
+ }, t);
41
+ g.render(i.createElement(f, null, n));
42
+ };
43
+ try {
44
+ g = a(m), y(r.getState());
45
+ let e = r.on("state:changed", y);
46
+ if (!n(e)) throw TypeError("CommentKit core subscription did not return an unsubscribe function");
47
+ _ = e;
48
+ } catch (e) {
49
+ throw v(), e;
50
+ }
51
+ return { unmount() {
52
+ v();
53
+ } };
54
+ }
55
+ export { r as mountCommentKitUI };