@liuovo/agentation-vue-ui 0.0.5 → 0.0.6

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 (44) hide show
  1. package/dist/index.js +3348 -15
  2. package/dist/index.js.map +1 -1
  3. package/dist/tsconfig.tsbuildinfo +1 -1
  4. package/package.json +2 -2
  5. package/dist/annotation-target.js +0 -266
  6. package/dist/annotation-target.js.map +0 -1
  7. package/dist/components/icons.js +0 -396
  8. package/dist/components/icons.js.map +0 -1
  9. package/dist/composables/useAnnotationsStore.js +0 -261
  10. package/dist/composables/useAnnotationsStore.js.map +0 -1
  11. package/dist/composables/useAreaSelection.js +0 -58
  12. package/dist/composables/useAreaSelection.js.map +0 -1
  13. package/dist/composables/useExport.js +0 -74
  14. package/dist/composables/useExport.js.map +0 -1
  15. package/dist/composables/useFreezeState.js +0 -28
  16. package/dist/composables/useFreezeState.js.map +0 -1
  17. package/dist/composables/useI18n.js +0 -18
  18. package/dist/composables/useI18n.js.map +0 -1
  19. package/dist/composables/useKeyboard.js +0 -122
  20. package/dist/composables/useKeyboard.js.map +0 -1
  21. package/dist/composables/useOverlay.js +0 -93
  22. package/dist/composables/useOverlay.js.map +0 -1
  23. package/dist/composables/useSelection.js +0 -38
  24. package/dist/composables/useSelection.js.map +0 -1
  25. package/dist/composables/useSettings.js +0 -133
  26. package/dist/composables/useSettings.js.map +0 -1
  27. package/dist/composables/useToolbarDrag.js +0 -253
  28. package/dist/composables/useToolbarDrag.js.map +0 -1
  29. package/dist/copy-fields.js +0 -23
  30. package/dist/copy-fields.js.map +0 -1
  31. package/dist/i18n/en.js +0 -143
  32. package/dist/i18n/en.js.map +0 -1
  33. package/dist/i18n/index.js +0 -23
  34. package/dist/i18n/index.js.map +0 -1
  35. package/dist/i18n/types.js +0 -2
  36. package/dist/i18n/types.js.map +0 -1
  37. package/dist/i18n/zh-CN.js +0 -143
  38. package/dist/i18n/zh-CN.js.map +0 -1
  39. package/dist/injection-keys.js +0 -9
  40. package/dist/injection-keys.js.map +0 -1
  41. package/dist/types.js +0 -2
  42. package/dist/types.js.map +0 -1
  43. package/dist/utils.js +0 -13
  44. package/dist/utils.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,15 +1,3348 @@
1
- // Injection keys
2
- export { AREA_SELECTION_KEY, ANNOTATIONS_STORE_KEY, I18N_KEY, OVERLAY_KEY, RUNTIME_BRIDGE_KEY, SELECTION_KEY, SETTINGS_KEY, } from "./injection-keys.js";
3
- export { DEFAULT_LOCALE, SUPPORTED_LOCALES, LOCALE_LABELS, isValidLocale, resolveMessages, } from "./i18n/index.js";
4
- export { createI18nState } from "./composables/useI18n.js";
5
- export { createAnnotationsStore } from "./composables/useAnnotationsStore.js";
6
- export { createSelectionState } from "./composables/useSelection.js";
7
- export { createAreaSelectionState } from "./composables/useAreaSelection.js";
8
- export { createOverlayState } from "./composables/useOverlay.js";
9
- export { createSettingsState } from "./composables/useSettings.js";
10
- export { createExportActions } from "./composables/useExport.js";
11
- export { useKeyboardShortcuts } from "./composables/useKeyboard.js";
12
- // Components
13
- import OverlayRoot from "./components/OverlayRoot.vue";
14
- export { OverlayRoot };
15
- //# sourceMappingURL=index.js.map
1
+ import { computed as C, toValue as U, reactive as we, watch as re, ref as K, readonly as ro, onMounted as ke, onUnmounted as Ae, inject as io, h as T, defineComponent as Ce, nextTick as Ye, onBeforeUnmount as Mt, openBlock as w, createBlock as se, Transition as be, withCtx as le, createElementBlock as $, withModifiers as ce, normalizeStyle as q, normalizeClass as g, unref as d, createElementVNode as a, toDisplayString as E, createCommentVNode as Z, Fragment as ue, renderList as de, createTextVNode as Ke, withDirectives as co, vModelText as uo, createVNode as O, TransitionGroup as Lt, isRef as po, toRefs as vo, customRef as ho, shallowRef as go, renderSlot as fo, Teleport as Tt, withKeys as vt, provide as fe, markRaw as mo } from "vue";
2
+ import { formatToMarkdown as Pt, formatToJSON as $t, identifyElement as yo, getNearbyText as ht, getAccessibilityInfo as bo, getForensicComputedStyles as Dt, getNearbyElements as ko, getElementClasses as wo, getFullElementPath as Co, getElementPath as xo, parseComputedStylesString as gt } from "@liuovo/agentation-vue-core";
3
+ const It = Symbol("agentation-runtime-bridge"), Ge = Symbol("agentation-annotations-store"), Xe = Symbol("agentation-selection"), ct = Symbol("agentation-area-selection"), qe = Symbol("agentation-overlay"), Ze = Symbol("agentation-settings"), Qe = Symbol("agentation-i18n"), Ot = Symbol("agentation-freeze"), _o = {
4
+ toolbar: {
5
+ pause: "Pause animations (P)",
6
+ resume: "Resume animations (P)",
7
+ pauseAria: "Pause animations",
8
+ resumeAria: "Resume animations",
9
+ hideMarkers: "Hide markers (H)",
10
+ showMarkers: "Show markers (H)",
11
+ hideMarkersAria: "Hide markers",
12
+ showMarkersAria: "Show markers",
13
+ copyMarkdown: "Copy as Markdown (C)",
14
+ copyMarkdownAria: "Copy as Markdown",
15
+ copyJson: "Copy as JSON",
16
+ copyJsonAria: "Copy as JSON",
17
+ clearAll: "Clear all (X)",
18
+ clearAllAria: "Clear all annotations",
19
+ settings: "Settings",
20
+ toggleSettingsAria: "Toggle settings",
21
+ closeToolbar: "Close toolbar (Esc)",
22
+ closeToolbarAria: "Close toolbar"
23
+ },
24
+ popover: {
25
+ editPlaceholder: "Update feedback...",
26
+ createPlaceholder: "What should change?",
27
+ deleteAnnotation: "Delete annotation",
28
+ cancel: "Cancel",
29
+ save: "Save",
30
+ update: "Update"
31
+ },
32
+ marker: {
33
+ annotationAria: (e) => `Annotation ${e}`,
34
+ clickToEdit: "Click to edit"
35
+ },
36
+ workflow: {
37
+ statusPending: "Pending",
38
+ statusAcknowledged: "Acknowledged",
39
+ statusResolved: "Resolved",
40
+ statusDismissed: "Dismissed",
41
+ roleAgent: "Agent",
42
+ roleHuman: "Human",
43
+ thread: "Thread",
44
+ replyCount: (e) => `${e} ${e === 1 ? "reply" : "replies"}`
45
+ },
46
+ settings: {
47
+ lightMode: "Light mode",
48
+ darkMode: "Dark mode",
49
+ switchToLightAria: "Switch to light mode",
50
+ switchToDarkAria: "Switch to dark mode",
51
+ language: "Language",
52
+ outputDetail: "Output detail",
53
+ exportFormat: "Copy format",
54
+ exportFormatMarkdownAria: "Use Markdown copy format",
55
+ exportFormatJsonAria: "Use JSON copy format",
56
+ copySettings: "Copy content settings",
57
+ copySettingsDescription: "Only affects clipboard copy. MCP and webhook payloads stay unchanged.",
58
+ copyPrefix: "Prefix prompt",
59
+ copyPrefixDescription: "Prepended before copied content with a line break.",
60
+ copyPrefixPlaceholder: "Hi, help me revise the following",
61
+ copyExclusions: "Excluded fields",
62
+ copyExclusionsDescription: "Checked fields are removed from copied output when they are present.",
63
+ copyFieldLabels: {
64
+ projectArea: "Project area",
65
+ contextHints: "Context hints",
66
+ sourceLocation: "Source location",
67
+ component: "Component",
68
+ componentHierarchy: "Component hierarchy",
69
+ framework: "Framework / resolver",
70
+ elementPath: "Element path",
71
+ fullDomPath: "Full DOM path",
72
+ cssClasses: "CSS classes",
73
+ position: "Position",
74
+ selectedText: "Selected text",
75
+ context: "Context",
76
+ computedStyles: "Computed styles",
77
+ accessibility: "Accessibility",
78
+ nearbyElements: "Nearby elements",
79
+ url: "URL",
80
+ timestamp: "Timestamp",
81
+ viewport: "Viewport",
82
+ userAgent: "User Agent",
83
+ devicePixelRatio: "Device pixel ratio"
84
+ },
85
+ markerColour: "Marker colour",
86
+ clearOnCopy: "Clear on copy",
87
+ blockPageInteractions: "Block page interactions",
88
+ componentSource: "Component source",
89
+ manageMcpWebhooks: "Manage MCP & Webhooks",
90
+ getStarted: "Get started",
91
+ mcpConnection: "MCP Connection",
92
+ mcpDescription: "Connect to an MCP server to let AI agents consume and respond to your annotations in real time.",
93
+ mcpLearnMore: "Learn more",
94
+ mcpStatusConnected: "Connected",
95
+ mcpStatusDisconnected: "Disconnected",
96
+ webhooks: "Webhooks",
97
+ webhooksDescription: "Automatically send annotations to an external endpoint when created or updated.",
98
+ webhooksAutoSend: "Auto-send annotations",
99
+ webhooksUrlPlaceholder: "https://example.com/webhook",
100
+ outputDetailHelp: "Controls how much metadata is included when exporting annotations.",
101
+ componentSourceHelp: "Show the Vue component file path and line number for each selected element.",
102
+ blockInteractionsHelp: "Prevent clicks from triggering page navigation or actions while annotating.",
103
+ getStartedDescription: "Use one shared Agentation server for all local Vite projects, and scope agent reads with projectFilter when multiple apps share it.",
104
+ sharedServerTitle: "Shared server recommendation",
105
+ sharedServerDescription: "Point multiple projects at the same API and MCP transport ports. If those ports are already running, the plugin reuses the existing server instead of spawning another copy.",
106
+ isolationTitle: "Isolation alternative",
107
+ isolationDescription: "If you want strict separation, give each project different API/MCP ports and a distinct projectId. Shared mode is the default and usually simpler.",
108
+ projectScopeLabel: "Project scope",
109
+ apiEndpointLabel: "Browser sync API",
110
+ mcpHttpEndpointLabel: "Streamable HTTP MCP",
111
+ mcpSseEndpointLabel: "Legacy SSE MCP",
112
+ cliCommandLabel: "CLI server",
113
+ claudeCommandLabel: "Claude CLI",
114
+ cursorEndpointLabel: "Cursor / HTTP MCP",
115
+ codexEndpointLabel: "Codex / generic MCP",
116
+ webhookEnvLabel: "Webhook env",
117
+ webhookDescriptionLong: "The server reads AGENTATION_WEBHOOK_URL or AGENTATION_WEBHOOKS and forwards annotation events to those endpoints.",
118
+ copyValueAria: (e) => `Copy ${e}`
119
+ },
120
+ colors: {
121
+ purple: "Purple",
122
+ blue: "Blue",
123
+ cyan: "Cyan",
124
+ green: "Green",
125
+ yellow: "Yellow",
126
+ orange: "Orange",
127
+ red: "Red"
128
+ },
129
+ outputDetail: {
130
+ compact: "Compact",
131
+ standard: "Standard",
132
+ detailed: "Detailed",
133
+ forensic: "Forensic"
134
+ },
135
+ selection: {
136
+ areaLabel: (e, t, o) => `${e} ${e === 1 ? "element" : "elements"}: ${t}${o > 0 ? ` +${o} more` : ""}`
137
+ },
138
+ notifications: {
139
+ sourceUnavailableElement: "This element could not be mapped to Vue source. Try selecting a nearby component element.",
140
+ sourceUnavailableArea: "This selection could not be mapped to Vue source. Try a smaller component area.",
141
+ remoteSyncUpdated: (e) => `Agent sync updated ${e} annotations`,
142
+ syncFailed: (e) => `Sync failed: ${e}`
143
+ }
144
+ }, So = {
145
+ toolbar: {
146
+ pause: "暂停动画 (P)",
147
+ resume: "恢复动画 (P)",
148
+ pauseAria: "暂停动画",
149
+ resumeAria: "恢复动画",
150
+ hideMarkers: "隐藏标记 (H)",
151
+ showMarkers: "显示标记 (H)",
152
+ hideMarkersAria: "隐藏标记",
153
+ showMarkersAria: "显示标记",
154
+ copyMarkdown: "复制为 Markdown (C)",
155
+ copyMarkdownAria: "复制为 Markdown",
156
+ copyJson: "复制为 JSON",
157
+ copyJsonAria: "复制为 JSON",
158
+ clearAll: "清除全部 (X)",
159
+ clearAllAria: "清除所有批注",
160
+ settings: "设置",
161
+ toggleSettingsAria: "切换设置面板",
162
+ closeToolbar: "关闭工具栏 (Esc)",
163
+ closeToolbarAria: "关闭工具栏"
164
+ },
165
+ popover: {
166
+ editPlaceholder: "更新反馈...",
167
+ createPlaceholder: "需要修改什么?",
168
+ deleteAnnotation: "删除批注",
169
+ cancel: "取消",
170
+ save: "保存",
171
+ update: "更新"
172
+ },
173
+ marker: {
174
+ annotationAria: (e) => `批注 ${e}`,
175
+ clickToEdit: "点击编辑"
176
+ },
177
+ workflow: {
178
+ statusPending: "待处理",
179
+ statusAcknowledged: "已接收",
180
+ statusResolved: "已解决",
181
+ statusDismissed: "已忽略",
182
+ roleAgent: "Agent",
183
+ roleHuman: "人工",
184
+ thread: "线程",
185
+ replyCount: (e) => `${e} 条回复`
186
+ },
187
+ settings: {
188
+ lightMode: "浅色模式",
189
+ darkMode: "深色模式",
190
+ switchToLightAria: "切换到浅色模式",
191
+ switchToDarkAria: "切换到深色模式",
192
+ language: "语言",
193
+ outputDetail: "输出详情",
194
+ exportFormat: "复制格式",
195
+ exportFormatMarkdownAria: "使用 Markdown 复制格式",
196
+ exportFormatJsonAria: "使用 JSON 复制格式",
197
+ copySettings: "复制信息设置",
198
+ copySettingsDescription: "仅作用于复制到剪贴板,不影响 MCP / Webhooks 的发送内容。",
199
+ copyPrefix: "前缀提示词",
200
+ copyPrefixDescription: "复制时会加在最前面,并自动换行。",
201
+ copyPrefixPlaceholder: "你好,帮我修改以下",
202
+ copyExclusions: "排除项",
203
+ copyExclusionsDescription: "勾选后,复制时如果存在这些字段,就自动过滤掉不复制。",
204
+ copyFieldLabels: {
205
+ projectArea: "Project area",
206
+ contextHints: "Context hints",
207
+ sourceLocation: "源码位置",
208
+ component: "组件名",
209
+ componentHierarchy: "组件层级",
210
+ framework: "框架 / 解析器",
211
+ elementPath: "元素路径",
212
+ fullDomPath: "完整 DOM 路径",
213
+ cssClasses: "CSS 类名",
214
+ position: "位置信息",
215
+ selectedText: "选中文本",
216
+ context: "上下文",
217
+ computedStyles: "计算样式",
218
+ accessibility: "无障碍信息",
219
+ nearbyElements: "附近元素",
220
+ url: "URL",
221
+ timestamp: "时间戳",
222
+ viewport: "视口",
223
+ userAgent: "User Agent",
224
+ devicePixelRatio: "设备像素比"
225
+ },
226
+ markerColour: "标记颜色",
227
+ clearOnCopy: "复制后清除",
228
+ blockPageInteractions: "阻止页面交互",
229
+ componentSource: "组件源码",
230
+ manageMcpWebhooks: "管理 MCP 与 Webhooks",
231
+ getStarted: "快速开始",
232
+ mcpConnection: "MCP 连接",
233
+ mcpDescription: "连接 MCP 服务器,让 AI 代理实时获取并响应你的批注。",
234
+ mcpLearnMore: "了解更多",
235
+ mcpStatusConnected: "已连接",
236
+ mcpStatusDisconnected: "未连接",
237
+ webhooks: "Webhooks",
238
+ webhooksDescription: "创建或更新批注时自动发送到外部端点。",
239
+ webhooksAutoSend: "自动发送批注",
240
+ webhooksUrlPlaceholder: "https://example.com/webhook",
241
+ outputDetailHelp: "控制导出批注时包含多少元数据。",
242
+ componentSourceHelp: "显示所选元素对应的 Vue 组件文件路径和行号。",
243
+ blockInteractionsHelp: "批注期间阻止点击触发页面导航或操作。",
244
+ getStartedDescription: "建议让多个本地 Vite 项目共用一个 Agentation 服务,再通过 projectFilter 显式限定 agent 读取范围。",
245
+ sharedServerTitle: "共用服务推荐",
246
+ sharedServerDescription: "让多个项目指向同一组 API 与 MCP 端口。如果这些端口已经被别的项目启动,插件会直接复用,不再重复拉起一份服务。",
247
+ isolationTitle: "隔离方案",
248
+ isolationDescription: "如果你需要硬隔离,可以给每个项目配置不同的 API/MCP 端口,并设置独立 projectId。默认仍建议共用服务。",
249
+ projectScopeLabel: "项目作用域",
250
+ apiEndpointLabel: "浏览器同步 API",
251
+ mcpHttpEndpointLabel: "Streamable HTTP MCP",
252
+ mcpSseEndpointLabel: "兼容 SSE MCP",
253
+ cliCommandLabel: "CLI 启动命令",
254
+ claudeCommandLabel: "Claude CLI",
255
+ cursorEndpointLabel: "Cursor / HTTP MCP",
256
+ codexEndpointLabel: "Codex / 通用 MCP",
257
+ webhookEnvLabel: "Webhook 环境变量",
258
+ webhookDescriptionLong: "服务端会读取 AGENTATION_WEBHOOK_URL 或 AGENTATION_WEBHOOKS,并把批注事件转发到这些地址。",
259
+ copyValueAria: (e) => `复制${e}`
260
+ },
261
+ colors: {
262
+ purple: "紫色",
263
+ blue: "蓝色",
264
+ cyan: "青色",
265
+ green: "绿色",
266
+ yellow: "黄色",
267
+ orange: "橙色",
268
+ red: "红色"
269
+ },
270
+ outputDetail: {
271
+ compact: "精简",
272
+ standard: "标准",
273
+ detailed: "详细",
274
+ forensic: "取证级"
275
+ },
276
+ selection: {
277
+ areaLabel: (e, t, o) => `${e} 个元素:${t}${o > 0 ? ` 等另外 ${o} 项` : ""}`
278
+ },
279
+ notifications: {
280
+ sourceUnavailableElement: "无法将此元素映射到 Vue 源码。请尝试选择附近的组件元素。",
281
+ sourceUnavailableArea: "无法将此选区映射到 Vue 源码。请尝试缩小选区范围。",
282
+ remoteSyncUpdated: (e) => `Agent 同步已更新 ${e} 条批注`,
283
+ syncFailed: (e) => `同步失败:${e}`
284
+ }
285
+ }, Ft = ["en", "zh-CN"], Je = "en", Eo = {
286
+ en: "EN",
287
+ "zh-CN": "中文"
288
+ }, Ao = {
289
+ en: _o,
290
+ "zh-CN": So
291
+ }, Mo = new Set(Ft);
292
+ function ut(e) {
293
+ return typeof e == "string" && Mo.has(e);
294
+ }
295
+ function Lo(e) {
296
+ return Ao[ut(e) ? e : Je];
297
+ }
298
+ function To(e) {
299
+ const t = C(() => {
300
+ const n = U(e);
301
+ return ut(n) ? n : Je;
302
+ }), o = C(() => Lo(t.value));
303
+ return {
304
+ get locale() {
305
+ return t.value;
306
+ },
307
+ get messages() {
308
+ return o.value;
309
+ }
310
+ };
311
+ }
312
+ function Po(e) {
313
+ const t = e.getBoundingClientRect(), o = Array.from(e.classList).filter(dt).slice(0, 4), n = et(e.textContent).slice(0, 100);
314
+ return {
315
+ selector: Oo(e) ?? void 0,
316
+ tag: e.tagName.toLowerCase(),
317
+ text: n || void 0,
318
+ classes: o.length > 0 ? o : void 0,
319
+ position: {
320
+ x: t.left + window.scrollX,
321
+ y: t.top + window.scrollY,
322
+ width: t.width,
323
+ height: t.height
324
+ }
325
+ };
326
+ }
327
+ function $o(e) {
328
+ const t = e.metadata;
329
+ if (t != null && t.isMultiSelect) return null;
330
+ const o = Do(e);
331
+ if (!o) return null;
332
+ if (o.selector) {
333
+ const f = Ho(o.selector);
334
+ if (f) return f;
335
+ }
336
+ const n = o.tag;
337
+ if (!n) return null;
338
+ const l = Ht(n);
339
+ if (l.length === 0) return null;
340
+ const i = o.text ? l.filter((f) => et(f.textContent) === o.text) : [];
341
+ if (i.length === 1)
342
+ return i[0];
343
+ const s = (i.length > 0 ? i : l).map((f) => ({
344
+ candidate: f,
345
+ score: Ro(f, o)
346
+ })).sort((f, m) => m.score - f.score);
347
+ return s.length === 0 || s[0].score <= 0 ? null : s[0].candidate;
348
+ }
349
+ function Do(e) {
350
+ const t = e.metadata;
351
+ return Io(t == null ? void 0 : t.elementLocator);
352
+ }
353
+ function Io(e) {
354
+ if (!e || typeof e != "object") return null;
355
+ const t = e, o = {};
356
+ if (typeof t.selector == "string" && t.selector.trim() && (o.selector = t.selector), typeof t.tag == "string" && t.tag.trim() && (o.tag = t.tag.toLowerCase()), typeof t.text == "string" && t.text.trim() && (o.text = et(t.text).slice(0, 100)), Array.isArray(t.classes)) {
357
+ const n = t.classes.filter((l) => typeof l == "string" && l.trim().length > 0);
358
+ n.length > 0 && (o.classes = n);
359
+ }
360
+ return zo(t.position) && (o.position = t.position), Object.keys(o).length > 0 ? o : null;
361
+ }
362
+ function Oo(e) {
363
+ if (e.id)
364
+ return `#${CSS.escape(e.id)}`;
365
+ for (const o of ["data-testid", "data-test", "aria-label", "title", "name", "role"]) {
366
+ const n = e.getAttribute(o);
367
+ if (!n) continue;
368
+ const l = `${e.tagName.toLowerCase()}[${o}="${CSS.escape(n)}"]`;
369
+ if (Ie(l)) return l;
370
+ }
371
+ const t = Array.from(e.classList).filter(dt).slice(0, 4);
372
+ if (t.length > 0) {
373
+ const o = `${e.tagName.toLowerCase()}.${t.map((n) => CSS.escape(n)).join(".")}`;
374
+ if (Ie(o)) return o;
375
+ }
376
+ return Fo(e);
377
+ }
378
+ function Fo(e) {
379
+ const t = [];
380
+ let o = e, n = 0;
381
+ for (; o && o.tagName.toLowerCase() !== "body" && n < 5; ) {
382
+ const i = o.tagName.toLowerCase();
383
+ let r = i;
384
+ if (o.id) {
385
+ r = `${i}#${CSS.escape(o.id)}`, t.unshift(r);
386
+ const m = t.join(" > ");
387
+ return Ie(m) ? m : null;
388
+ }
389
+ const s = Array.from(o.classList).filter(dt).slice(0, 2);
390
+ if (s.length > 0)
391
+ r = `${i}.${s.map((m) => CSS.escape(m)).join(".")}`;
392
+ else if (o.parentElement) {
393
+ const m = Array.from(o.parentElement.children).filter((y) => y.tagName.toLowerCase() === i);
394
+ m.length > 1 && (r = `${i}:nth-of-type(${m.indexOf(o) + 1})`);
395
+ }
396
+ t.unshift(r);
397
+ const f = t.join(" > ");
398
+ if (Ie(f)) return f;
399
+ o = o.parentElement, n++;
400
+ }
401
+ const l = t.join(" > ");
402
+ return l && Ie(l) ? l : null;
403
+ }
404
+ function Ie(e) {
405
+ try {
406
+ return Ht(e).length === 1;
407
+ } catch {
408
+ return !1;
409
+ }
410
+ }
411
+ function Ho(e) {
412
+ try {
413
+ for (const t of Rt()) {
414
+ const o = t.querySelector(e);
415
+ if (o instanceof HTMLElement && !zt(o)) return o;
416
+ }
417
+ } catch {
418
+ return null;
419
+ }
420
+ return null;
421
+ }
422
+ function Ht(e) {
423
+ const t = [];
424
+ for (const o of Rt())
425
+ try {
426
+ o.querySelectorAll(e).forEach((n) => {
427
+ n instanceof HTMLElement && !zt(n) && t.push(n);
428
+ });
429
+ } catch {
430
+ }
431
+ return t;
432
+ }
433
+ function Rt() {
434
+ const e = [document], t = Array.from(document.children);
435
+ for (; t.length > 0; ) {
436
+ const o = t.shift();
437
+ o && (o instanceof HTMLElement && o.shadowRoot && (e.push(o.shadowRoot), t.push(...Array.from(o.shadowRoot.children))), t.push(...Array.from(o.children)));
438
+ }
439
+ return e;
440
+ }
441
+ function Ro(e, t) {
442
+ var n;
443
+ let o = 0;
444
+ if (t.text) {
445
+ const l = et(e.textContent);
446
+ l === t.text ? o += 12 : (l.includes(t.text) || t.text.includes(l)) && (o += 4);
447
+ }
448
+ if ((n = t.classes) != null && n.length) {
449
+ const l = new Set(Array.from(e.classList));
450
+ for (const i of t.classes)
451
+ l.has(i) && (o += 3);
452
+ }
453
+ if (t.position) {
454
+ const l = e.getBoundingClientRect(), i = l.left + window.scrollX - t.position.x, r = l.top + window.scrollY - t.position.y, s = Math.sqrt(i * i + r * r);
455
+ s <= 24 ? o += 10 : s <= 80 ? o += 6 : s <= 160 ? o += 2 : o -= Math.min(s / 100, 8);
456
+ }
457
+ return o;
458
+ }
459
+ function et(e) {
460
+ return (e ?? "").replace(/\s+/g, " ").trim();
461
+ }
462
+ function zt(e) {
463
+ return !!e.closest("[data-agentation-root], [data-annotation-marker]");
464
+ }
465
+ function dt(e) {
466
+ return ![
467
+ /^hover:/,
468
+ /^focus:/,
469
+ /^active:/,
470
+ /^disabled:/,
471
+ /^transition/,
472
+ /^duration/,
473
+ /^ease/,
474
+ /^[a-z0-9]{8,}$/,
475
+ /--/,
476
+ /\[.*\]/
477
+ ].some((t) => t.test(e));
478
+ }
479
+ function zo(e) {
480
+ if (!e || typeof e != "object") return !1;
481
+ const t = e;
482
+ return Re(t.x) && Re(t.y) && Re(t.width) && Re(t.height);
483
+ }
484
+ function Re(e) {
485
+ return typeof e == "number" && Number.isFinite(e);
486
+ }
487
+ function Ns(e) {
488
+ const t = we({
489
+ annotations: [],
490
+ enabled: !0
491
+ });
492
+ function o() {
493
+ try {
494
+ const y = e.storage.load();
495
+ t.annotations.splice(0, t.annotations.length, ...y);
496
+ } catch {
497
+ console.warn("[agentation] Failed to hydrate annotations from storage");
498
+ }
499
+ }
500
+ function n(y, u) {
501
+ var x;
502
+ const A = y.trim();
503
+ if (!A)
504
+ throw new Error("[agentation] Annotation comment must not be empty");
505
+ const b = No(A, u);
506
+ return t.annotations.push(b), m(), (x = e.sync) == null || x.enqueueUpsert(b), b;
507
+ }
508
+ function l(y) {
509
+ var b;
510
+ const u = t.annotations.findIndex((x) => x.id === y);
511
+ if (u < 0) return;
512
+ const A = t.annotations[u];
513
+ t.annotations.splice(u, 1), m(), (b = e.sync) == null || b.enqueueDelete(A);
514
+ }
515
+ function i(y, u) {
516
+ var P;
517
+ const A = u.trim();
518
+ if (!A) return;
519
+ const b = t.annotations.findIndex((J) => J.id === y);
520
+ if (b < 0) return;
521
+ const x = { ...t.annotations[b], comment: A };
522
+ t.annotations.splice(b, 1, x), m(), (P = e.sync) == null || P.enqueueUpdate(x);
523
+ }
524
+ function r() {
525
+ var u;
526
+ const y = [...t.annotations];
527
+ t.annotations.splice(0, t.annotations.length), e.storage.clear();
528
+ for (const A of y)
529
+ (u = e.sync) == null || u.enqueueDelete(A);
530
+ }
531
+ function s() {
532
+ return $t([...t.annotations], {
533
+ detailLevel: e.options.outputDetail,
534
+ page: mt()
535
+ });
536
+ }
537
+ function f() {
538
+ return Pt([...t.annotations], {
539
+ detailLevel: e.options.outputDetail,
540
+ page: mt()
541
+ });
542
+ }
543
+ function m() {
544
+ try {
545
+ t.annotations.length === 0 ? e.storage.clear() : e.storage.save([...t.annotations]);
546
+ } catch {
547
+ console.warn("[agentation] Failed to persist annotations");
548
+ }
549
+ }
550
+ return {
551
+ get annotations() {
552
+ return t.annotations;
553
+ },
554
+ get enabled() {
555
+ return t.enabled;
556
+ },
557
+ set enabled(y) {
558
+ t.enabled = y;
559
+ },
560
+ hydrate: o,
561
+ saveAnnotation: n,
562
+ updateAnnotation: i,
563
+ removeAnnotation: l,
564
+ clearAll: r,
565
+ exportJSON: s,
566
+ exportMarkdown: f
567
+ };
568
+ }
569
+ function No(e, t) {
570
+ const { element: o, source: n, elementName: l, selectedText: i, isMultiSelect: r } = t, s = yo(o);
571
+ return {
572
+ id: Bo(),
573
+ schemaVersion: 1,
574
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
575
+ url: window.location.href,
576
+ elementSelector: r ? l : s.name || l,
577
+ elementText: i,
578
+ comment: e,
579
+ source: { ...n },
580
+ metadata: jo(t)
581
+ };
582
+ }
583
+ function jo(e) {
584
+ const {
585
+ element: t,
586
+ rect: o,
587
+ elementPath: n,
588
+ source: l,
589
+ selectedText: i,
590
+ isMultiSelect: r = !1,
591
+ multiSelectElements: s,
592
+ elementBoundingBoxes: f
593
+ } = e, m = !r && yt(t), y = s == null ? void 0 : s.filter((x) => document.contains(x)).map((x) => {
594
+ const P = x.getBoundingClientRect();
595
+ return P.width > 0 && P.height > 0 ? ft(P, yt(x)) : null;
596
+ }).filter((x) => x !== null), u = y != null && y.length ? y : f, A = ft(o, r ? !1 : m), b = {
597
+ elementPath: n || xo(t) || void 0,
598
+ fullPath: Co(t) || void 0,
599
+ cssClasses: wo(t) || void 0,
600
+ boundingBox: A,
601
+ elementLocator: r ? void 0 : Po(t),
602
+ nearbyText: ht(t) || void 0,
603
+ nearbyElements: ko(t) || void 0,
604
+ computedStyles: Dt(t) || void 0,
605
+ accessibility: bo(t) || void 0,
606
+ isMultiSelect: r || void 0,
607
+ elementBoundingBoxes: u != null && u.length ? u : void 0,
608
+ isFixed: r ? void 0 : m,
609
+ project_area: Uo(e),
610
+ context_hints: Vo({
611
+ element: t,
612
+ source: l,
613
+ selectedText: i,
614
+ nearbyText: ht(t) || void 0,
615
+ isMultiSelect: r
616
+ })
617
+ };
618
+ return Object.fromEntries(
619
+ Object.entries(b).filter(([, x]) => x !== void 0)
620
+ );
621
+ }
622
+ function Uo(e) {
623
+ const t = window.location.pathname || "/", o = e.source.componentHierarchy || e.source.componentName, n = Nt(e.element), l = [t, o, n].filter(Boolean);
624
+ return l.length > 0 ? l.join(" :: ") : void 0;
625
+ }
626
+ function Vo(e) {
627
+ const t = /* @__PURE__ */ new Set(), { element: o, source: n, selectedText: l, nearbyText: i, isMultiSelect: r } = e, s = (f, m) => {
628
+ const y = m == null ? void 0 : m.trim();
629
+ y && t.add(`${f}: ${y.slice(0, 120)}`);
630
+ };
631
+ return s("route", window.location.pathname || "/"), s("component", n.componentName), s("componentHierarchy", n.componentHierarchy), s("framework", n.framework), s("selectedText", l), s("nearbyText", i), s("heading", Wo(o)), s("landmark", Nt(o)), s("role", o.getAttribute("role")), s("ariaLabel", o.getAttribute("aria-label")), s("name", o.getAttribute("name")), s("placeholder", o.getAttribute("placeholder")), s("title", o.getAttribute("title")), s("testId", o.getAttribute("data-testid") || o.getAttribute("data-test")), s("id", o.id || void 0), s("multiSelect", r ? "true" : void 0), t.size > 0 ? [...t].slice(0, 8) : void 0;
632
+ }
633
+ function ft(e, t) {
634
+ return {
635
+ x: t ? e.left : e.left + window.scrollX,
636
+ y: t ? e.top : e.top + window.scrollY,
637
+ width: e.width,
638
+ height: e.height
639
+ };
640
+ }
641
+ function mt() {
642
+ return {
643
+ pathname: window.location.pathname,
644
+ viewport: { width: window.innerWidth, height: window.innerHeight },
645
+ url: window.location.href,
646
+ userAgent: navigator.userAgent,
647
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
648
+ devicePixelRatio: window.devicePixelRatio
649
+ };
650
+ }
651
+ function Bo() {
652
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
653
+ }
654
+ function Wo(e) {
655
+ var o;
656
+ const t = ((o = e.closest("section, article, main, aside, form, dialog")) == null ? void 0 : o.querySelector("h1, h2, h3, h4, h5, h6")) ?? e.closest("label");
657
+ return (t == null ? void 0 : t.innerText.trim()) || void 0;
658
+ }
659
+ function Nt(e) {
660
+ const t = e.closest(
661
+ "[role], main, header, nav, aside, footer, section, article, form, dialog"
662
+ );
663
+ if (!t) return;
664
+ const o = t.getAttribute("role") || t.tagName.toLowerCase(), n = t.getAttribute("aria-label") || t.getAttribute("data-testid") || t.id;
665
+ return n ? `${o}:${n}` : o;
666
+ }
667
+ function yt(e) {
668
+ let t = e;
669
+ for (; t && t !== document.body; ) {
670
+ const o = window.getComputedStyle(t).position;
671
+ if (o === "fixed" || o === "sticky") return !0;
672
+ t = t.parentElement;
673
+ }
674
+ return !1;
675
+ }
676
+ function js() {
677
+ const e = we({
678
+ hovered: null,
679
+ selected: null
680
+ });
681
+ return {
682
+ get hovered() {
683
+ return e.hovered;
684
+ },
685
+ get selected() {
686
+ return e.selected;
687
+ },
688
+ setHovered(t) {
689
+ e.selected || (e.hovered = t);
690
+ },
691
+ clearHovered() {
692
+ e.hovered = null;
693
+ },
694
+ select(t) {
695
+ e.selected = t, e.hovered = null;
696
+ },
697
+ clearSelection() {
698
+ e.selected = null;
699
+ }
700
+ };
701
+ }
702
+ function Us() {
703
+ const e = we({
704
+ active: !1,
705
+ origin: null,
706
+ rect: null,
707
+ matched: []
708
+ });
709
+ return {
710
+ get active() {
711
+ return e.active;
712
+ },
713
+ get rect() {
714
+ return e.rect;
715
+ },
716
+ get matched() {
717
+ return e.matched;
718
+ },
719
+ start(t, o) {
720
+ e.active = !0, e.origin = { x: t, y: o }, e.rect = bt(t, o, t, o), e.matched.splice(0, e.matched.length);
721
+ },
722
+ update(t, o) {
723
+ e.origin && (e.rect = bt(e.origin.x, e.origin.y, t, o));
724
+ },
725
+ setMatched(t) {
726
+ e.matched.splice(0, e.matched.length, ...t);
727
+ },
728
+ clear() {
729
+ e.active = !1, e.origin = null, e.rect = null, e.matched.splice(0, e.matched.length);
730
+ }
731
+ };
732
+ }
733
+ function bt(e, t, o, n) {
734
+ const l = Math.min(e, o), i = Math.min(t, n), r = Math.max(e, o), s = Math.max(t, n);
735
+ return { left: l, top: i, right: r, bottom: s, width: r - l, height: s - i };
736
+ }
737
+ const kt = 12, Pe = 12, wt = 280, Ct = 260;
738
+ function Yo(e) {
739
+ const t = we({
740
+ visible: !1,
741
+ editingAnnotation: null,
742
+ editAnchorRect: null,
743
+ shakeTick: 0
744
+ }), o = C(
745
+ () => t.visible && (e.selected !== null || t.editingAnnotation !== null)
746
+ ), n = C(() => o.value ? t.editingAnnotation && t.editAnchorRect ? xt(t.editAnchorRect) : e.selected ? xt(e.selected.rect) : null : null);
747
+ return {
748
+ get popoverVisible() {
749
+ return o.value;
750
+ },
751
+ get popoverPosition() {
752
+ return n.value;
753
+ },
754
+ get editingAnnotation() {
755
+ return t.editingAnnotation;
756
+ },
757
+ get shakeTick() {
758
+ return t.shakeTick;
759
+ },
760
+ showPopover() {
761
+ e.selected && (t.visible && (t.shakeTick += 1), t.editingAnnotation = null, t.editAnchorRect = null, t.visible = !0);
762
+ },
763
+ hidePopover() {
764
+ t.visible = !1, t.editingAnnotation = null, t.editAnchorRect = null;
765
+ },
766
+ showEditPopover(l, i) {
767
+ t.visible && (t.shakeTick += 1), t.editingAnnotation = l, t.editAnchorRect = i, t.visible = !0;
768
+ }
769
+ };
770
+ }
771
+ function xt(e) {
772
+ const t = typeof window < "u" ? window.innerWidth : 1024, o = typeof window < "u" ? window.innerHeight : 768, n = e.bottom + kt, l = Math.max(Pe, e.top - Ct - kt), i = n + Ct <= o - Pe ? n : l, r = Math.max(Pe, t - wt - Pe), s = e.left + e.width / 2 - wt / 2, f = Math.min(Math.max(s, Pe), r);
773
+ return { top: i, left: f };
774
+ }
775
+ const jt = [
776
+ "projectArea",
777
+ "contextHints",
778
+ "sourceLocation",
779
+ "component",
780
+ "componentHierarchy",
781
+ "framework",
782
+ "elementPath",
783
+ "fullDomPath",
784
+ "cssClasses",
785
+ "position",
786
+ "selectedText",
787
+ "context",
788
+ "computedStyles",
789
+ "accessibility",
790
+ "nearbyElements",
791
+ "url",
792
+ "timestamp",
793
+ "viewport",
794
+ "userAgent",
795
+ "devicePixelRatio"
796
+ ], Ut = "agentation-vue-settings", Ko = [
797
+ { key: "purple", value: "#AF52DE" },
798
+ { key: "blue", value: "#3c82f7" },
799
+ { key: "cyan", value: "#5AC8FA" },
800
+ { key: "green", value: "#34C759" },
801
+ { key: "yellow", value: "#FFD60A" },
802
+ { key: "orange", value: "#FF9500" },
803
+ { key: "red", value: "#FF3B30" }
804
+ ], Jo = "#3c82f7";
805
+ function Vs(e) {
806
+ const t = Go(), o = we({
807
+ outputDetail: t.outputDetail ?? (e == null ? void 0 : e.outputDetail) ?? "standard",
808
+ darkMode: t.darkMode ?? (e == null ? void 0 : e.darkMode) ?? !0,
809
+ enabled: t.enabled ?? (e == null ? void 0 : e.enabled) ?? !0,
810
+ componentSourceEnabled: t.componentSourceEnabled ?? (e == null ? void 0 : e.componentSourceEnabled) ?? !0,
811
+ annotationColor: t.annotationColor ?? (e == null ? void 0 : e.annotationColor) ?? Jo,
812
+ showMarkers: t.showMarkers ?? (e == null ? void 0 : e.showMarkers) ?? !0,
813
+ copyFormat: t.copyFormat ?? (e == null ? void 0 : e.copyFormat) ?? "markdown",
814
+ copyPrefix: t.copyPrefix ?? (e == null ? void 0 : e.copyPrefix) ?? "",
815
+ copyExcludeFields: We(t.copyExcludeFields) ?? We(e == null ? void 0 : e.copyExcludeFields) ?? [],
816
+ autoClearAfterCopy: t.autoClearAfterCopy ?? (e == null ? void 0 : e.autoClearAfterCopy) ?? !1,
817
+ blockInteractions: t.blockInteractions ?? (e == null ? void 0 : e.blockInteractions) ?? !0,
818
+ locale: Be(t.locale) ?? Be(e == null ? void 0 : e.locale) ?? Je,
819
+ webhookUrl: t.webhookUrl ?? (e == null ? void 0 : e.webhookUrl) ?? "",
820
+ webhooksEnabled: t.webhooksEnabled ?? (e == null ? void 0 : e.webhooksEnabled) ?? !1
821
+ });
822
+ return re(
823
+ () => ({
824
+ outputDetail: o.outputDetail,
825
+ darkMode: o.darkMode,
826
+ enabled: o.enabled,
827
+ componentSourceEnabled: o.componentSourceEnabled,
828
+ annotationColor: o.annotationColor,
829
+ showMarkers: o.showMarkers,
830
+ copyFormat: o.copyFormat,
831
+ copyPrefix: o.copyPrefix,
832
+ copyExcludeFields: o.copyExcludeFields,
833
+ autoClearAfterCopy: o.autoClearAfterCopy,
834
+ blockInteractions: o.blockInteractions,
835
+ locale: o.locale,
836
+ webhookUrl: o.webhookUrl,
837
+ webhooksEnabled: o.webhooksEnabled
838
+ }),
839
+ (n) => Xo(n),
840
+ { deep: !0 }
841
+ ), {
842
+ get outputDetail() {
843
+ return o.outputDetail;
844
+ },
845
+ set outputDetail(n) {
846
+ o.outputDetail = n;
847
+ },
848
+ get darkMode() {
849
+ return o.darkMode;
850
+ },
851
+ set darkMode(n) {
852
+ o.darkMode = n;
853
+ },
854
+ get enabled() {
855
+ return o.enabled;
856
+ },
857
+ set enabled(n) {
858
+ o.enabled = n;
859
+ },
860
+ get componentSourceEnabled() {
861
+ return o.componentSourceEnabled;
862
+ },
863
+ set componentSourceEnabled(n) {
864
+ o.componentSourceEnabled = n;
865
+ },
866
+ get annotationColor() {
867
+ return o.annotationColor;
868
+ },
869
+ set annotationColor(n) {
870
+ o.annotationColor = n;
871
+ },
872
+ get showMarkers() {
873
+ return o.showMarkers;
874
+ },
875
+ set showMarkers(n) {
876
+ o.showMarkers = n;
877
+ },
878
+ get copyFormat() {
879
+ return o.copyFormat;
880
+ },
881
+ set copyFormat(n) {
882
+ o.copyFormat = n;
883
+ },
884
+ get copyPrefix() {
885
+ return o.copyPrefix;
886
+ },
887
+ set copyPrefix(n) {
888
+ o.copyPrefix = n;
889
+ },
890
+ get copyExcludeFields() {
891
+ return o.copyExcludeFields;
892
+ },
893
+ set copyExcludeFields(n) {
894
+ o.copyExcludeFields = We(n) ?? [];
895
+ },
896
+ get autoClearAfterCopy() {
897
+ return o.autoClearAfterCopy;
898
+ },
899
+ set autoClearAfterCopy(n) {
900
+ o.autoClearAfterCopy = n;
901
+ },
902
+ get blockInteractions() {
903
+ return o.blockInteractions;
904
+ },
905
+ set blockInteractions(n) {
906
+ o.blockInteractions = n;
907
+ },
908
+ get locale() {
909
+ return o.locale;
910
+ },
911
+ set locale(n) {
912
+ o.locale = Be(n) ?? Je;
913
+ },
914
+ get webhookUrl() {
915
+ return o.webhookUrl;
916
+ },
917
+ set webhookUrl(n) {
918
+ o.webhookUrl = n;
919
+ },
920
+ get webhooksEnabled() {
921
+ return o.webhooksEnabled;
922
+ },
923
+ set webhooksEnabled(n) {
924
+ o.webhooksEnabled = n;
925
+ },
926
+ toggleDarkMode() {
927
+ o.darkMode = !o.darkMode;
928
+ }
929
+ };
930
+ }
931
+ function Be(e) {
932
+ return ut(e) ? e : void 0;
933
+ }
934
+ function We(e) {
935
+ if (!Array.isArray(e)) return;
936
+ const t = new Set(jt);
937
+ return [...new Set(
938
+ e.filter((o) => t.has(o))
939
+ )];
940
+ }
941
+ function Go() {
942
+ if (typeof window > "u") return {};
943
+ try {
944
+ const e = window.localStorage.getItem(Ut);
945
+ if (!e) return {};
946
+ const t = JSON.parse(e);
947
+ return {
948
+ ...t,
949
+ locale: Be(t.locale),
950
+ copyExcludeFields: We(t.copyExcludeFields) ?? []
951
+ };
952
+ } catch {
953
+ return {};
954
+ }
955
+ }
956
+ function Xo(e) {
957
+ if (!(typeof window > "u"))
958
+ try {
959
+ window.localStorage.setItem(Ut, JSON.stringify(e));
960
+ } catch {
961
+ }
962
+ }
963
+ const Vt = [
964
+ "#agentation-app",
965
+ "#agentation-overlay",
966
+ "[data-agentation-root]",
967
+ "[data-feedback-toolbar]",
968
+ "[data-annotation-popup]",
969
+ "[data-annotation-marker]"
970
+ ], nt = Vt.flatMap((e) => [`:not(${e})`, `:not(${e} *)`]).join(""), it = "feedback-freeze-styles", at = "__agentation_freeze";
971
+ function qo() {
972
+ if (typeof window > "u")
973
+ return {
974
+ frozen: !1,
975
+ origSetTimeout: setTimeout,
976
+ origSetInterval: setInterval,
977
+ pausedAnimations: []
978
+ };
979
+ const e = window;
980
+ return e[at] || (e[at] = {
981
+ frozen: !1,
982
+ origSetTimeout: window.setTimeout.bind(window),
983
+ origSetInterval: window.setInterval.bind(window),
984
+ pausedAnimations: []
985
+ }), e[at];
986
+ }
987
+ const ve = qo(), Ee = ve.origSetTimeout;
988
+ ve.origSetInterval;
989
+ function Zo(e) {
990
+ let t = e;
991
+ for (; t; ) {
992
+ if (Vt.some((n) => {
993
+ var l, i;
994
+ return ((l = t == null ? void 0 : t.matches) == null ? void 0 : l.call(t, n)) || ((i = t == null ? void 0 : t.closest) == null ? void 0 : i.call(t, n));
995
+ }))
996
+ return !0;
997
+ const o = t.getRootNode();
998
+ t = o instanceof ShadowRoot ? o.host : t.parentElement;
999
+ }
1000
+ return !1;
1001
+ }
1002
+ function Qo() {
1003
+ if (typeof document > "u" || ve.frozen) return;
1004
+ ve.frozen = !0;
1005
+ let e = document.getElementById(it);
1006
+ e || (e = document.createElement("style"), e.id = it), e.textContent = `
1007
+ *${nt},
1008
+ *${nt}::before,
1009
+ *${nt}::after {
1010
+ animation-play-state: paused !important;
1011
+ transition: none !important;
1012
+ }
1013
+ `, document.head.appendChild(e), ve.pausedAnimations = [];
1014
+ try {
1015
+ document.getAnimations().forEach((t) => {
1016
+ var n;
1017
+ if (t.playState !== "running") return;
1018
+ const o = (n = t.effect) == null ? void 0 : n.target;
1019
+ Zo(o) || (t.pause(), ve.pausedAnimations.push(t));
1020
+ });
1021
+ } catch {
1022
+ }
1023
+ document.querySelectorAll("video").forEach((t) => {
1024
+ t.paused || (t.dataset.wasPaused = "false", t.pause());
1025
+ });
1026
+ }
1027
+ function _t() {
1028
+ var e;
1029
+ if (!(typeof document > "u") && ve.frozen) {
1030
+ ve.frozen = !1;
1031
+ for (const t of ve.pausedAnimations)
1032
+ try {
1033
+ t.play();
1034
+ } catch (o) {
1035
+ console.warn("[agentation] Error resuming animation:", o);
1036
+ }
1037
+ ve.pausedAnimations = [], (e = document.getElementById(it)) == null || e.remove(), document.querySelectorAll("video").forEach((t) => {
1038
+ t.dataset.wasPaused === "false" && (t.play().catch(() => {
1039
+ }), delete t.dataset.wasPaused);
1040
+ });
1041
+ }
1042
+ }
1043
+ function en() {
1044
+ const e = K(!1);
1045
+ function t() {
1046
+ e.value ? (_t(), e.value = !1) : (Qo(), e.value = !0);
1047
+ }
1048
+ function o() {
1049
+ e.value && (_t(), e.value = !1);
1050
+ }
1051
+ return {
1052
+ isFrozen: ro(e),
1053
+ toggleFreeze: t,
1054
+ cleanup: o
1055
+ };
1056
+ }
1057
+ function tn(e, t) {
1058
+ const o = K(null);
1059
+ async function n(u) {
1060
+ try {
1061
+ return await navigator.clipboard.writeText(u), !0;
1062
+ } catch {
1063
+ return i(u, "agentation-export.txt"), !1;
1064
+ }
1065
+ }
1066
+ function l(u) {
1067
+ o.value = u, Ee(() => {
1068
+ o.value === u && (o.value = null);
1069
+ }, 1400);
1070
+ }
1071
+ function i(u, A) {
1072
+ const b = new Blob([u], { type: "text/plain" }), x = URL.createObjectURL(b), P = document.createElement("a");
1073
+ P.href = x, P.download = A, P.click(), URL.revokeObjectURL(x);
1074
+ }
1075
+ async function r() {
1076
+ const u = f("json");
1077
+ await n(u) && l("json");
1078
+ }
1079
+ async function s() {
1080
+ const u = f("markdown");
1081
+ await n(u) && l("markdown");
1082
+ }
1083
+ function f(u) {
1084
+ const A = m(), b = u === "json" ? JSON.stringify($t([...e.annotations], {
1085
+ detailLevel: t.outputDetail,
1086
+ page: A,
1087
+ excludeFields: t.copyExcludeFields
1088
+ }), null, 2) : Pt([...e.annotations], {
1089
+ detailLevel: t.outputDetail,
1090
+ page: A,
1091
+ excludeFields: t.copyExcludeFields
1092
+ });
1093
+ return y(b);
1094
+ }
1095
+ function m() {
1096
+ return e.exportJSON().page;
1097
+ }
1098
+ function y(u) {
1099
+ const A = t.copyPrefix.replace(/\r\n/g, `
1100
+ `).trim();
1101
+ return A ? `${A}
1102
+ ${u}` : u;
1103
+ }
1104
+ return {
1105
+ get copyFeedback() {
1106
+ return o.value;
1107
+ },
1108
+ exportJSON: r,
1109
+ exportMarkdown: s
1110
+ };
1111
+ }
1112
+ function on(e) {
1113
+ const { store: t, selection: o, overlay: n, settings: l, exportActions: i, freezeState: r } = e;
1114
+ function s(m) {
1115
+ return !!m.closest("[data-agentation-root]");
1116
+ }
1117
+ function f(m) {
1118
+ if (m.isComposing) return;
1119
+ const y = document.activeElement;
1120
+ if ((m.metaKey || m.ctrlKey) && m.shiftKey && m.code === "KeyF") {
1121
+ m.preventDefault(), t.enabled = !t.enabled, t.enabled || (o.clearHovered(), o.clearSelection(), n.hidePopover());
1122
+ return;
1123
+ }
1124
+ if (m.key === "Escape") {
1125
+ if (st(y) && !s(y)) return;
1126
+ if (n.popoverVisible) {
1127
+ m.preventDefault(), o.clearSelection(), n.hidePopover();
1128
+ return;
1129
+ }
1130
+ if (o.selected) {
1131
+ m.preventDefault(), o.clearSelection();
1132
+ return;
1133
+ }
1134
+ if (t.enabled) {
1135
+ m.preventDefault(), t.enabled = !1, o.clearHovered();
1136
+ return;
1137
+ }
1138
+ }
1139
+ if (st(y) || st(m.target) || m.metaKey || m.ctrlKey || m.altKey) return;
1140
+ const u = m.key.toLowerCase();
1141
+ if (u === "p") {
1142
+ m.preventDefault(), r == null || r.toggleFreeze();
1143
+ return;
1144
+ }
1145
+ if (t.annotations.length !== 0) {
1146
+ if (u === "h") {
1147
+ m.preventDefault(), l.showMarkers = !l.showMarkers;
1148
+ return;
1149
+ }
1150
+ if (u === "c") {
1151
+ m.preventDefault(), l.copyFormat === "json" ? i == null || i.exportJSON() : i == null || i.exportMarkdown();
1152
+ return;
1153
+ }
1154
+ u === "x" && (m.preventDefault(), t.clearAll(), o.clearHovered(), o.clearSelection(), n.hidePopover());
1155
+ }
1156
+ }
1157
+ ke(() => {
1158
+ document.addEventListener("keydown", f, !0);
1159
+ }), Ae(() => {
1160
+ document.removeEventListener("keydown", f, !0);
1161
+ });
1162
+ }
1163
+ function st(e) {
1164
+ return e instanceof HTMLElement && (e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable);
1165
+ }
1166
+ function ee(e, t) {
1167
+ const o = io(e);
1168
+ if (o === void 0)
1169
+ throw new Error(`[agentation] Missing required injection: ${t}`);
1170
+ return o;
1171
+ }
1172
+ function te(e, t, o, n) {
1173
+ return T(
1174
+ "svg",
1175
+ {
1176
+ width: e,
1177
+ height: e,
1178
+ viewBox: t,
1179
+ fill: "none",
1180
+ xmlns: "http://www.w3.org/2000/svg",
1181
+ "aria-hidden": "true",
1182
+ focusable: "false",
1183
+ style: n
1184
+ },
1185
+ o
1186
+ );
1187
+ }
1188
+ const nn = (e) => {
1189
+ const t = e.size ?? 24;
1190
+ return te(t, "0 0 24 24", [
1191
+ T("path", { d: "M11.5 12L5.5 12", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1192
+ T("path", { d: "M18.5 6.75L5.5 6.75", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1193
+ T("path", { d: "M9.25 17.25L5.5 17.25", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1194
+ T("path", {
1195
+ d: "M16 12.75L16.5179 13.9677C16.8078 14.6494 17.3506 15.1922 18.0323 15.4821L19.25 16L18.0323 16.5179C17.3506 16.8078 16.8078 17.3506 16.5179 18.0323L16 19.25L15.4821 18.0323C15.1922 17.3506 14.6494 16.8078 13.9677 16.5179L12.75 16L13.9677 15.4821C14.6494 15.1922 15.1922 14.6494 15.4821 13.9677L16 12.75Z",
1196
+ stroke: "currentColor",
1197
+ "stroke-width": 1.5,
1198
+ "stroke-linejoin": "round"
1199
+ })
1200
+ ], e.style);
1201
+ }, $e = (e) => {
1202
+ const t = e.size ?? 24, o = e.copied ?? !1, n = "opacity 0.2s ease, transform 0.2s ease";
1203
+ return te(t, "0 0 24 24", [
1204
+ // Copy state
1205
+ T("g", { style: { opacity: o ? 0 : 1, transform: o ? "scale(0.8)" : "scale(1)", transformOrigin: "center", transition: n } }, [
1206
+ T("path", { d: "M4.75 11.25C4.75 10.4216 5.42157 9.75 6.25 9.75H12.75C13.5784 9.75 14.25 10.4216 14.25 11.25V17.75C14.25 18.5784 13.5784 19.25 12.75 19.25H6.25C5.42157 19.25 4.75 18.5784 4.75 17.75V11.25Z", stroke: "currentColor", "stroke-width": 1.5 }),
1207
+ T("path", { d: "M17.25 14.25H17.75C18.5784 14.25 19.25 13.5784 19.25 12.75V6.25C19.25 5.42157 18.5784 4.75 17.75 4.75H11.25C10.4216 4.75 9.75 5.42157 9.75 6.25V6.75", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round" })
1208
+ ]),
1209
+ // Checkmark state
1210
+ T("g", { style: { opacity: o ? 1 : 0, transform: o ? "scale(1)" : "scale(0.8)", transformOrigin: "center", transition: n } }, [
1211
+ T("path", { d: "M12 20C7.58172 20 4 16.4182 4 12C4 7.58172 7.58172 4 12 4C16.4182 4 20 7.58172 20 12C20 16.4182 16.4182 20 12 20Z", stroke: "#22c55e", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1212
+ T("path", { d: "M15 10L11 14.25L9.25 12.25", stroke: "#22c55e", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" })
1213
+ ])
1214
+ ], e.style);
1215
+ }, an = (e) => {
1216
+ const t = e.size ?? 18;
1217
+ return te(t, "0 0 20 20", [
1218
+ T("path", {
1219
+ d: "M7 2.75H10.9393C11.3369 2.75 11.7182 2.90804 12 3.18934L14.8107 6C15.092 6.28181 15.25 6.66304 15.25 7.06066V16.25C15.25 17.0784 14.5784 17.75 13.75 17.75H7C6.17157 17.75 5.5 17.0784 5.5 16.25V4.25C5.5 3.42157 6.17157 2.75 7 2.75Z",
1220
+ stroke: "currentColor",
1221
+ "stroke-width": 1.5,
1222
+ "stroke-linecap": "round",
1223
+ "stroke-linejoin": "round"
1224
+ }),
1225
+ T("path", {
1226
+ d: "M11 2.75V5.75C11 6.30228 11.4477 6.75 12 6.75H15",
1227
+ stroke: "currentColor",
1228
+ "stroke-width": 1.5,
1229
+ "stroke-linecap": "round",
1230
+ "stroke-linejoin": "round"
1231
+ }),
1232
+ T("path", {
1233
+ d: "M7.75 10.25H13",
1234
+ stroke: "currentColor",
1235
+ "stroke-width": 1.5,
1236
+ "stroke-linecap": "round"
1237
+ }),
1238
+ T("path", {
1239
+ d: "M7.75 13H13",
1240
+ stroke: "currentColor",
1241
+ "stroke-width": 1.5,
1242
+ "stroke-linecap": "round"
1243
+ }),
1244
+ T("path", {
1245
+ d: "M7.75 15.75H11.25",
1246
+ stroke: "currentColor",
1247
+ "stroke-width": 1.5,
1248
+ "stroke-linecap": "round"
1249
+ })
1250
+ ], e.style);
1251
+ }, Bt = (e) => {
1252
+ const t = e.size ?? 16;
1253
+ return te(t, "0 0 24 24", [
1254
+ T("path", {
1255
+ d: "M13.5 4C14.7426 4 15.75 5.00736 15.75 6.25V7H18.5C18.9142 7 19.25 7.33579 19.25 7.75C19.25 8.16421 18.9142 8.5 18.5 8.5H17.9678L17.6328 16.2217C17.61 16.7475 17.5912 17.1861 17.5469 17.543C17.5015 17.9087 17.4225 18.2506 17.2461 18.5723C16.9747 19.0671 16.5579 19.4671 16.0518 19.7168C15.7227 19.8791 15.3772 19.9422 15.0098 19.9717C14.6514 20.0004 14.2126 20 13.6865 20H10.3135C9.78735 20 9.34856 20.0004 8.99023 19.9717C8.62278 19.9422 8.27729 19.8791 7.94824 19.7168C7.44205 19.4671 7.02532 19.0671 6.75391 18.5723C6.57751 18.2506 6.49853 17.9087 6.45312 17.543C6.40883 17.1861 6.39005 16.7475 6.36719 16.2217L6.03223 8.5H5.5C5.08579 8.5 4.75 8.16421 4.75 7.75C4.75 7.33579 5.08579 7 5.5 7H8.25V6.25C8.25 5.00736 9.25736 4 10.5 4H13.5ZM7.86621 16.1562C7.89013 16.7063 7.90624 17.0751 7.94141 17.3584C7.97545 17.6326 8.02151 17.7644 8.06934 17.8516C8.19271 18.0763 8.38239 18.2577 8.6123 18.3711C8.70153 18.4151 8.83504 18.4545 9.11035 18.4766C9.39482 18.4994 9.76335 18.5 10.3135 18.5H13.6865C14.2367 18.5 14.6052 18.4994 14.8896 18.4766C15.165 18.4545 15.2985 18.4151 15.3877 18.3711C15.6176 18.2577 15.8073 18.0763 15.9307 17.8516C15.9785 17.7644 16.0245 17.6326 16.0586 17.3584C16.0938 17.0751 16.1099 16.7063 16.1338 16.1562L16.4668 8.5H7.5332L7.86621 16.1562ZM9.97656 10.75C10.3906 10.7371 10.7371 11.0626 10.75 11.4766L10.875 15.4766C10.8879 15.8906 10.5624 16.2371 10.1484 16.25C9.73443 16.2629 9.38794 15.9374 9.375 15.5234L9.25 11.5234C9.23706 11.1094 9.56255 10.7629 9.97656 10.75ZM14.0244 10.75C14.4384 10.7635 14.7635 11.1105 14.75 11.5244L14.6201 15.5244C14.6066 15.9384 14.2596 16.2634 13.8457 16.25C13.4317 16.2365 13.1067 15.8896 13.1201 15.4756L13.251 11.4756C13.2645 11.0617 13.6105 10.7366 14.0244 10.75ZM10.5 5.5C10.0858 5.5 9.75 5.83579 9.75 6.25V7H14.25V6.25C14.25 5.83579 13.9142 5.5 13.5 5.5H10.5Z",
1256
+ fill: "currentColor"
1257
+ })
1258
+ ], e.style);
1259
+ }, sn = (e) => {
1260
+ const t = e.size ?? 24;
1261
+ return te(t, "0 0 24 24", [
1262
+ T("path", {
1263
+ d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
1264
+ stroke: "currentColor",
1265
+ "stroke-width": 2,
1266
+ "stroke-linecap": "round",
1267
+ "stroke-linejoin": "round"
1268
+ }),
1269
+ T("circle", {
1270
+ cx: 12,
1271
+ cy: 12,
1272
+ r: 3,
1273
+ stroke: "currentColor",
1274
+ "stroke-width": 2,
1275
+ "stroke-linecap": "round",
1276
+ "stroke-linejoin": "round"
1277
+ })
1278
+ ], e.style);
1279
+ }, ln = (e) => {
1280
+ const t = e.size ?? 24;
1281
+ return te(t, "0 0 24 24", [
1282
+ T("path", {
1283
+ d: "M10.733 5.076A10.744 10.744 0 0 1 21.938 12 10.75 10.75 0 0 1 18.084 16.268",
1284
+ stroke: "currentColor",
1285
+ "stroke-width": 2,
1286
+ "stroke-linecap": "round",
1287
+ "stroke-linejoin": "round"
1288
+ }),
1289
+ T("path", {
1290
+ d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
1291
+ stroke: "currentColor",
1292
+ "stroke-width": 2,
1293
+ "stroke-linecap": "round",
1294
+ "stroke-linejoin": "round"
1295
+ }),
1296
+ T("path", {
1297
+ d: "M17.479 17.499A10.75 10.75 0 0 1 2.062 12 10.75 10.75 0 0 1 6.17 7.412",
1298
+ stroke: "currentColor",
1299
+ "stroke-width": 2,
1300
+ "stroke-linecap": "round",
1301
+ "stroke-linejoin": "round"
1302
+ }),
1303
+ T("path", {
1304
+ d: "m2 2 20 20",
1305
+ stroke: "currentColor",
1306
+ "stroke-width": 2,
1307
+ "stroke-linecap": "round",
1308
+ "stroke-linejoin": "round"
1309
+ })
1310
+ ], e.style);
1311
+ }, rn = (e) => {
1312
+ const t = e.size ?? 24;
1313
+ return te(t, "0 0 24 24", [
1314
+ T("rect", {
1315
+ x: 6,
1316
+ y: 4,
1317
+ width: 4,
1318
+ height: 16,
1319
+ rx: 1,
1320
+ fill: "currentColor"
1321
+ }),
1322
+ T("rect", {
1323
+ x: 14,
1324
+ y: 4,
1325
+ width: 4,
1326
+ height: 16,
1327
+ rx: 1,
1328
+ fill: "currentColor"
1329
+ })
1330
+ ], e.style);
1331
+ }, cn = (e) => {
1332
+ const t = e.size ?? 24;
1333
+ return te(t, "0 0 24 24", [
1334
+ T("path", {
1335
+ d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
1336
+ fill: "currentColor"
1337
+ })
1338
+ ], e.style);
1339
+ }, un = (e) => {
1340
+ const t = e.size ?? 16;
1341
+ return te(t, "0 0 24 24", [
1342
+ T("path", { d: "M10.6504 5.81117C10.9939 4.39628 13.0061 4.39628 13.3496 5.81117C13.5715 6.72517 14.6187 7.15891 15.4219 6.66952C16.6652 5.91193 18.0881 7.33479 17.3305 8.57815C16.8411 9.38134 17.2748 10.4285 18.1888 10.6504C19.6037 10.9939 19.6037 13.0061 18.1888 13.3496C17.2748 13.5715 16.8411 14.6187 17.3305 15.4219C18.0881 16.6652 16.6652 18.0881 15.4219 17.3305C14.6187 16.8411 13.5715 17.2748 13.3496 18.1888C13.0061 19.6037 10.9939 19.6037 10.6504 18.1888C10.4285 17.2748 9.38135 16.8411 8.57815 17.3305C7.33479 18.0881 5.91193 16.6652 6.66952 15.4219C7.15891 14.6187 6.72517 13.5715 5.81117 13.3496C4.39628 13.0061 4.39628 10.9939 5.81117 10.6504C6.72517 10.4285 7.15891 9.38134 6.66952 8.57815C5.91193 7.33479 7.33479 5.91192 8.57815 6.66952C9.38135 7.15891 10.4285 6.72517 10.6504 5.81117Z", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1343
+ T("circle", { cx: 12, cy: 12, r: 2.5, stroke: "currentColor", "stroke-width": 1.5 })
1344
+ ], e.style);
1345
+ }, dn = (e) => {
1346
+ const t = e.size ?? 18;
1347
+ return te(t, "0 0 24 24", [
1348
+ T("path", { d: "M9.25 7H14.75", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round" }),
1349
+ T("path", { d: "M8.89062 8.54688L11.25 14", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round" }),
1350
+ T("path", { d: "M15.1094 8.54688L12.75 14", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round" }),
1351
+ T("circle", { cx: 7, cy: 7, r: 2.25, stroke: "currentColor", "stroke-width": 1.5 }),
1352
+ T("circle", { cx: 17, cy: 7, r: 2.25, stroke: "currentColor", "stroke-width": 1.5 }),
1353
+ T("circle", { cx: 12, cy: 17, r: 2.25, stroke: "currentColor", "stroke-width": 1.5 })
1354
+ ], e.style);
1355
+ }, pn = (e) => {
1356
+ const t = e.size ?? 24;
1357
+ return te(t, "0 0 24 24", [
1358
+ T("path", { d: "M16.7198 6.21973C17.0127 5.92683 17.4874 5.92683 17.7803 6.21973C18.0732 6.51262 18.0732 6.9874 17.7803 7.28027L13.0606 12L17.7803 16.7197C18.0732 17.0126 18.0732 17.4874 17.7803 17.7803C17.4875 18.0731 17.0127 18.0731 16.7198 17.7803L12.0001 13.0605L7.28033 17.7803C6.98746 18.0731 6.51268 18.0731 6.21979 17.7803C5.92689 17.4874 5.92689 17.0126 6.21979 16.7197L10.9395 12L6.21979 7.28027C5.92689 6.98738 5.92689 6.51262 6.21979 6.21973C6.51268 5.92683 6.98744 5.92683 7.28033 6.21973L12.0001 10.9395L16.7198 6.21973Z", fill: "currentColor" })
1359
+ ], e.style);
1360
+ }, vn = (e) => {
1361
+ const t = e.size ?? 16;
1362
+ return te(t, "0 0 20 20", [
1363
+ T("path", { d: "M9.99999 12.7082C11.4958 12.7082 12.7083 11.4956 12.7083 9.99984C12.7083 8.50407 11.4958 7.2915 9.99999 7.2915C8.50422 7.2915 7.29166 8.50407 7.29166 9.99984C7.29166 11.4956 8.50422 12.7082 9.99999 12.7082Z", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1364
+ T("path", { d: "M10 3.9585V5.05698", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1365
+ T("path", { d: "M10 14.9429V16.0414", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1366
+ T("path", { d: "M5.7269 5.72656L6.50682 6.50649", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1367
+ T("path", { d: "M13.4932 13.4932L14.2731 14.2731", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1368
+ T("path", { d: "M3.95834 10H5.05683", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1369
+ T("path", { d: "M14.9432 10H16.0417", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1370
+ T("path", { d: "M5.7269 14.2731L6.50682 13.4932", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1371
+ T("path", { d: "M13.4932 6.50649L14.2731 5.72656", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" })
1372
+ ], e.style);
1373
+ }, hn = (e) => {
1374
+ const t = e.size ?? 16;
1375
+ return te(t, "0 0 20 20", [
1376
+ T("path", { d: "M15.5 10.4955C15.4037 11.5379 15.0124 12.5314 14.3721 13.3596C13.7317 14.1878 12.8688 14.8165 11.8841 15.1722C10.8995 15.5278 9.83397 15.5957 8.81217 15.3679C7.79038 15.1401 6.8546 14.6259 6.11434 13.8857C5.37408 13.1454 4.85995 12.2096 4.63211 11.1878C4.40427 10.166 4.47215 9.10048 4.82781 8.11585C5.18346 7.13123 5.81218 6.26825 6.64039 5.62791C7.4686 4.98756 8.46206 4.59634 9.5045 4.5C8.89418 5.32569 8.60049 6.34302 8.67685 7.36695C8.75321 8.39087 9.19454 9.35339 9.92058 10.0794C10.6466 10.8055 11.6091 11.2468 12.6331 11.3231C13.657 11.3995 14.6743 11.1058 15.5 10.4955Z", stroke: "currentColor", "stroke-width": 1.13793, "stroke-linecap": "round", "stroke-linejoin": "round" })
1377
+ ], e.style);
1378
+ }, De = (e) => {
1379
+ const t = e.size ?? 14;
1380
+ return te(t, "0 0 14 14", [
1381
+ T("style", "@keyframes ag-check-draw{0%{stroke-dashoffset:12}to{stroke-dashoffset:0}}@keyframes ag-check-bounce{0%{transform:scale(.5);opacity:0}50%{transform:scale(1.12);opacity:1}75%{transform:scale(.95)}to{transform:scale(1)}}"),
1382
+ T("path", {
1383
+ d: "M3.9375 7L6.125 9.1875L10.5 4.8125",
1384
+ stroke: "currentColor",
1385
+ "stroke-width": 1.5,
1386
+ "stroke-linecap": "round",
1387
+ "stroke-linejoin": "round",
1388
+ style: {
1389
+ strokeDasharray: 12,
1390
+ strokeDashoffset: 0,
1391
+ transformOrigin: "center",
1392
+ animation: "ag-check-draw 0.18s ease-out, ag-check-bounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"
1393
+ }
1394
+ })
1395
+ ], e.style);
1396
+ }, gn = (e) => {
1397
+ const t = e.size ?? 16;
1398
+ return te(t, "0 0 16 16", [
1399
+ T("path", { d: "M4.5 3C3.67 3 3 3.67 3 4.5v2c0 .55-.45 1-1 1v1c.55 0 1 .45 1 1v2c0 .83.67 1.5 1.5 1.5", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1400
+ T("path", { d: "M11.5 3c.83 0 1.5.67 1.5 1.5v2c0 .55.45 1 1 1v1c-.55 0-1 .45-1 1v2c0 .83-.67 1.5-1.5 1.5", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" })
1401
+ ], e.style);
1402
+ }, ze = (e) => {
1403
+ const t = e.size ?? 20;
1404
+ return te(t, "0 0 20 20", [
1405
+ T("circle", { cx: 10, cy: 10.5, r: 5.25, stroke: "currentColor", "stroke-width": 1.25 }),
1406
+ T("path", { d: "M8.5 8.75C8.5 7.92 9.17 7.25 10 7.25C10.83 7.25 11.5 7.92 11.5 8.75C11.5 9.58 10.83 10.25 10 10.25V11", stroke: "currentColor", "stroke-width": 1.25, "stroke-linecap": "round", "stroke-linejoin": "round" }),
1407
+ T("circle", { cx: 10, cy: 13, r: 0.75, fill: "currentColor" })
1408
+ ], e.style);
1409
+ }, St = (e) => {
1410
+ const t = e.size ?? 16;
1411
+ return te(t, "0 0 16 16", [
1412
+ T("path", { d: "M8.5 3.5L4 8L8.5 12.5", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" })
1413
+ ], e.style);
1414
+ }, Et = (e) => {
1415
+ const t = e.size ?? 16;
1416
+ return te(t, "0 0 16 16", [
1417
+ T("path", { d: "M8.5 11.5L12 8L8.5 4.5", stroke: "currentColor", "stroke-width": 1.5, "stroke-linecap": "round", "stroke-linejoin": "round" })
1418
+ ], e.style);
1419
+ }, fn = { class: "header" }, mn = ["aria-expanded"], yn = { class: "element-name" }, bn = {
1420
+ key: 1,
1421
+ class: "element-name"
1422
+ }, kn = {
1423
+ key: 0,
1424
+ class: "source-file"
1425
+ }, wn = {
1426
+ key: 1,
1427
+ class: "workflow-summary"
1428
+ }, Cn = { class: "status-row" }, xn = ["data-status"], _n = {
1429
+ key: 0,
1430
+ class: "thread-count"
1431
+ }, Sn = {
1432
+ key: 0,
1433
+ class: "thread-block"
1434
+ }, En = { class: "thread-title" }, An = { class: "thread-list" }, Mn = ["data-role"], Ln = { class: "thread-meta" }, Tn = { class: "thread-content" }, Pn = { class: "styles-inner" }, $n = { class: "styles-block" }, Dn = { class: "style-property" }, In = { class: "style-value" }, On = {
1435
+ key: 3,
1436
+ class: "quote"
1437
+ }, Fn = ["placeholder"], Hn = { class: "actions" }, Rn = { class: "delete-wrapper" }, zn = ["title", "aria-label"], Nn = ["disabled"], jn = /* @__PURE__ */ Ce({
1438
+ __name: "AnnotationPopover",
1439
+ setup(e) {
1440
+ const t = ee(Ge, "annotations store"), o = ee(Xe, "selection state"), n = ee(qe, "overlay state"), l = ee(Ze, "settings state"), i = ee(Qe, "i18n state"), r = K(""), s = K(!1), f = K(!1), m = K(null), y = C(() => i.messages), u = C(() => o.selected), A = C(() => n.popoverPosition), b = C(() => n.editingAnnotation), x = C(
1441
+ () => n.popoverVisible && u.value !== null && A.value !== null && !b.value
1442
+ ), P = C(
1443
+ () => n.popoverVisible && b.value !== null && A.value !== null
1444
+ ), J = C(() => x.value || P.value), G = C(() => {
1445
+ var p;
1446
+ return B(b.value) || (p = u.value) != null && p.isMultiSelect ? "#34C759" : l.annotationColor;
1447
+ }), oe = C(() => {
1448
+ const p = A.value;
1449
+ if (p)
1450
+ return {
1451
+ top: `${p.top}px`,
1452
+ left: `${p.left}px`,
1453
+ "--ag-popover-accent": G.value
1454
+ };
1455
+ }), N = C(() => {
1456
+ var p;
1457
+ return b.value ? b.value.elementSelector : ((p = u.value) == null ? void 0 : p.elementName) ?? "";
1458
+ }), R = C(() => {
1459
+ var p;
1460
+ if (!l.componentSourceEnabled) return "";
1461
+ if (b.value) {
1462
+ const M = b.value.source;
1463
+ return M.file ? M.line ? `${M.file}:${M.line}` : M.file : "";
1464
+ }
1465
+ return (p = u.value) != null && p.source.file ? u.value.source.line ? `${u.value.source.file}:${u.value.source.line}` : u.value.source.file : "";
1466
+ }), j = C(() => {
1467
+ var p, M;
1468
+ return ((p = b.value) == null ? void 0 : p.elementText) ?? ((M = u.value) == null ? void 0 : M.selectedText) ?? "";
1469
+ }), Q = C(() => {
1470
+ var p;
1471
+ return ((p = b.value) == null ? void 0 : p.thread) ?? [];
1472
+ }), ne = C(
1473
+ () => {
1474
+ var p;
1475
+ return ((p = b.value) == null ? void 0 : p.status) ?? "pending";
1476
+ }
1477
+ ), h = C(() => he(ne.value)), I = C(() => k(ne.value)), W = C(() => {
1478
+ var M;
1479
+ if (b.value)
1480
+ return z(b.value);
1481
+ const p = (M = u.value) == null ? void 0 : M.element;
1482
+ if (p)
1483
+ return gt(Dt(p));
1484
+ }), H = C(() => Object.entries(W.value ?? {})), X = C(() => H.value.length > 0);
1485
+ let L = null;
1486
+ re(
1487
+ [J, () => {
1488
+ var p;
1489
+ return (p = b.value) == null ? void 0 : p.id;
1490
+ }, () => {
1491
+ var p;
1492
+ return (p = u.value) == null ? void 0 : p.element;
1493
+ }],
1494
+ async ([p]) => {
1495
+ var M;
1496
+ if (!p) {
1497
+ r.value = "", s.value = !1;
1498
+ return;
1499
+ }
1500
+ r.value = ((M = b.value) == null ? void 0 : M.comment) ?? "", s.value = !1, await Ye(), ie();
1501
+ },
1502
+ { immediate: !0 }
1503
+ ), re(
1504
+ () => n.shakeTick ?? 0,
1505
+ (p, M) => {
1506
+ J.value && p !== M && Me();
1507
+ }
1508
+ ), Mt(() => {
1509
+ L && window.clearTimeout(L);
1510
+ });
1511
+ function V() {
1512
+ const p = r.value.trim();
1513
+ if (p) {
1514
+ if (b.value)
1515
+ try {
1516
+ t.updateAnnotation(b.value.id, p);
1517
+ } catch (M) {
1518
+ console.warn("[agentation] Failed to update annotation:", M);
1519
+ return;
1520
+ }
1521
+ else {
1522
+ const M = u.value;
1523
+ if (!M) return;
1524
+ try {
1525
+ t.saveAnnotation(p, M);
1526
+ } catch (Y) {
1527
+ console.warn("[agentation] Failed to save annotation:", Y);
1528
+ return;
1529
+ }
1530
+ }
1531
+ ae();
1532
+ }
1533
+ }
1534
+ function c() {
1535
+ b.value && (t.removeAnnotation(b.value.id), ae());
1536
+ }
1537
+ function ae() {
1538
+ r.value = "", s.value = !1, o.clearSelection(), n.hidePopover();
1539
+ }
1540
+ function ie() {
1541
+ const p = m.value;
1542
+ p && (p.focus(), p.selectionStart = p.selectionEnd = p.value.length, p.scrollTop = p.scrollHeight);
1543
+ }
1544
+ function Me() {
1545
+ L && window.clearTimeout(L), f.value = !1, Ye(() => {
1546
+ f.value = !0, L = Ee(() => {
1547
+ f.value = !1, ie(), L = null;
1548
+ }, 250);
1549
+ });
1550
+ }
1551
+ function Le(p) {
1552
+ p.isComposing || (p.key === "Enter" && !p.shiftKey && (p.preventDefault(), V()), p.key === "Escape" && (p.preventDefault(), ae()));
1553
+ }
1554
+ function he(p) {
1555
+ switch (p) {
1556
+ case "acknowledged":
1557
+ return y.value.workflow.statusAcknowledged;
1558
+ case "resolved":
1559
+ return y.value.workflow.statusResolved;
1560
+ case "dismissed":
1561
+ return y.value.workflow.statusDismissed;
1562
+ default:
1563
+ return y.value.workflow.statusPending;
1564
+ }
1565
+ }
1566
+ function k(p) {
1567
+ switch (p) {
1568
+ case "acknowledged":
1569
+ case "resolved":
1570
+ case "dismissed":
1571
+ return p;
1572
+ default:
1573
+ return "pending";
1574
+ }
1575
+ }
1576
+ function D(p) {
1577
+ return p === "agent" ? y.value.workflow.roleAgent : y.value.workflow.roleHuman;
1578
+ }
1579
+ function F(p) {
1580
+ const M = typeof p == "number" ? new Date(p) : new Date(p);
1581
+ return Number.isNaN(M.getTime()) ? "" : new Intl.DateTimeFormat(void 0, {
1582
+ month: "short",
1583
+ day: "numeric",
1584
+ hour: "2-digit",
1585
+ minute: "2-digit"
1586
+ }).format(M);
1587
+ }
1588
+ function B(p) {
1589
+ const M = p == null ? void 0 : p.metadata;
1590
+ return (M == null ? void 0 : M.isMultiSelect) === !0;
1591
+ }
1592
+ function z(p) {
1593
+ const M = p.metadata, Y = M == null ? void 0 : M.computedStyles;
1594
+ if (typeof Y == "string")
1595
+ return gt(Y);
1596
+ if (Y && typeof Y == "object")
1597
+ return Object.fromEntries(
1598
+ Object.entries(Y).filter((me) => typeof me[1] == "string")
1599
+ );
1600
+ }
1601
+ return (p, M) => (w(), se(be, { name: "popover" }, {
1602
+ default: le(() => [
1603
+ J.value ? (w(), $("div", {
1604
+ key: 0,
1605
+ class: g(["popover", { light: !d(l).darkMode, shaking: f.value }]),
1606
+ style: q(oe.value),
1607
+ "data-annotation-popup": "",
1608
+ onClick: M[2] || (M[2] = ce(() => {
1609
+ }, ["stop"]))
1610
+ }, [
1611
+ a("div", fn, [
1612
+ X.value ? (w(), $("button", {
1613
+ key: 0,
1614
+ class: "header-toggle",
1615
+ type: "button",
1616
+ "aria-expanded": s.value,
1617
+ onClick: M[0] || (M[0] = (Y) => s.value = !s.value)
1618
+ }, [
1619
+ (w(), $("svg", {
1620
+ class: g(["chevron", { expanded: s.value }]),
1621
+ width: "14",
1622
+ height: "14",
1623
+ viewBox: "0 0 14 14",
1624
+ fill: "none",
1625
+ xmlns: "http://www.w3.org/2000/svg"
1626
+ }, [...M[3] || (M[3] = [
1627
+ a("path", {
1628
+ d: "M5.5 10.25L9 7.25L5.75 4",
1629
+ stroke: "currentColor",
1630
+ "stroke-width": "1.5",
1631
+ "stroke-linecap": "round",
1632
+ "stroke-linejoin": "round"
1633
+ }, null, -1)
1634
+ ])], 2)),
1635
+ a("span", yn, E(N.value), 1)
1636
+ ], 8, mn)) : (w(), $("span", bn, E(N.value), 1))
1637
+ ]),
1638
+ R.value ? (w(), $("div", kn, E(R.value), 1)) : Z("", !0),
1639
+ b.value ? (w(), $("div", wn, [
1640
+ a("div", Cn, [
1641
+ a("span", {
1642
+ class: "status-pill",
1643
+ "data-status": I.value
1644
+ }, E(h.value), 9, xn),
1645
+ Q.value.length ? (w(), $("span", _n, E(y.value.workflow.replyCount(Q.value.length)), 1)) : Z("", !0)
1646
+ ]),
1647
+ Q.value.length ? (w(), $("div", Sn, [
1648
+ a("div", En, E(y.value.workflow.thread), 1),
1649
+ a("div", An, [
1650
+ (w(!0), $(ue, null, de(Q.value.slice(-4), (Y) => (w(), $("div", {
1651
+ key: Y.id,
1652
+ class: "thread-item",
1653
+ "data-role": Y.role
1654
+ }, [
1655
+ a("div", Ln, [
1656
+ a("span", null, E(D(Y.role)), 1),
1657
+ a("span", null, E(F(Y.timestamp)), 1)
1658
+ ]),
1659
+ a("div", Tn, E(Y.content), 1)
1660
+ ], 8, Mn))), 128))
1661
+ ])
1662
+ ])) : Z("", !0)
1663
+ ])) : Z("", !0),
1664
+ X.value ? (w(), $("div", {
1665
+ key: 2,
1666
+ class: g(["styles-wrapper", { expanded: s.value }])
1667
+ }, [
1668
+ a("div", Pn, [
1669
+ a("div", $n, [
1670
+ (w(!0), $(ue, null, de(H.value, ([Y, me]) => (w(), $("div", {
1671
+ key: Y,
1672
+ class: "style-line"
1673
+ }, [
1674
+ a("span", Dn, E(Y), 1),
1675
+ M[4] || (M[4] = Ke(" : ", -1)),
1676
+ a("span", In, E(me), 1),
1677
+ M[5] || (M[5] = Ke("; ", -1))
1678
+ ]))), 128))
1679
+ ])
1680
+ ])
1681
+ ], 2)) : Z("", !0),
1682
+ j.value ? (w(), $("div", On, " “" + E(j.value.slice(0, 80)) + E(j.value.length > 80 ? "..." : "") + "” ", 1)) : Z("", !0),
1683
+ co(a("textarea", {
1684
+ ref_key: "textareaRef",
1685
+ ref: m,
1686
+ "onUpdate:modelValue": M[1] || (M[1] = (Y) => r.value = Y),
1687
+ class: "textarea",
1688
+ rows: "2",
1689
+ placeholder: b.value ? y.value.popover.editPlaceholder : y.value.popover.createPlaceholder,
1690
+ onKeydown: Le
1691
+ }, null, 40, Fn), [
1692
+ [uo, r.value]
1693
+ ]),
1694
+ a("div", Hn, [
1695
+ a("div", Rn, [
1696
+ b.value ? (w(), $("button", {
1697
+ key: 0,
1698
+ class: "delete-button",
1699
+ type: "button",
1700
+ title: y.value.popover.deleteAnnotation,
1701
+ "aria-label": y.value.popover.deleteAnnotation,
1702
+ onClick: c
1703
+ }, [
1704
+ O(d(Bt), { size: 22 })
1705
+ ], 8, zn)) : Z("", !0)
1706
+ ]),
1707
+ a("button", {
1708
+ class: "btn-ghost",
1709
+ type: "button",
1710
+ onClick: ae
1711
+ }, E(y.value.popover.cancel), 1),
1712
+ a("button", {
1713
+ class: "btn-primary",
1714
+ type: "button",
1715
+ disabled: !r.value.trim(),
1716
+ style: q({ backgroundColor: G.value }),
1717
+ onClick: V
1718
+ }, E(b.value ? y.value.popover.update : y.value.popover.save), 13, Nn)
1719
+ ])
1720
+ ], 6)) : Z("", !0)
1721
+ ]),
1722
+ _: 1
1723
+ }));
1724
+ }
1725
+ }), xe = (e, t) => {
1726
+ const o = e.__vccOpts || e;
1727
+ for (const [n, l] of t)
1728
+ o[n] = l;
1729
+ return o;
1730
+ }, Un = /* @__PURE__ */ xe(jn, [["__scopeId", "data-v-b471fb94"]]), Vn = {
1731
+ key: 0,
1732
+ class: "drag-selection-layer",
1733
+ "aria-hidden": "true"
1734
+ }, Bn = /* @__PURE__ */ Ce({
1735
+ __name: "DragSelectionLayer",
1736
+ setup(e) {
1737
+ const t = ee(ct, "area selection state"), o = C(() => {
1738
+ const l = t.rect;
1739
+ return l ? {
1740
+ top: `${l.top}px`,
1741
+ left: `${l.left}px`,
1742
+ width: `${l.width}px`,
1743
+ height: `${l.height}px`
1744
+ } : null;
1745
+ }), n = C(() => t.active ? t.matched.filter((l) => document.contains(l.element)).map((l, i) => {
1746
+ const r = l.element.getBoundingClientRect();
1747
+ return { key: `match-${i}`, top: r.top, left: r.left, width: r.width, height: r.height };
1748
+ }).filter((l) => l.width > 0 && l.height > 0) : []);
1749
+ return (l, i) => d(t).active && o.value ? (w(), $("div", Vn, [
1750
+ (w(!0), $(ue, null, de(n.value, (r) => (w(), $("div", {
1751
+ key: r.key,
1752
+ class: "matched-box",
1753
+ style: q({ top: `${r.top}px`, left: `${r.left}px`, width: `${r.width}px`, height: `${r.height}px` })
1754
+ }, null, 4))), 128)),
1755
+ a("div", {
1756
+ class: "selection-rect",
1757
+ style: q(o.value)
1758
+ }, null, 4)
1759
+ ])) : Z("", !0);
1760
+ }
1761
+ }), Wn = /* @__PURE__ */ xe(Bn, [["__scopeId", "data-v-e50b5320"]]), Yn = {
1762
+ class: "highlight-layer",
1763
+ "aria-hidden": "true"
1764
+ }, Kn = /* @__PURE__ */ Ce({
1765
+ __name: "HighlightLayer",
1766
+ setup(e) {
1767
+ const t = ee(Xe, "selection state"), o = ee(ct, "area selection state"), n = we({
1768
+ boxes: []
1769
+ }), l = C(
1770
+ () => n.boxes.map((r) => ({
1771
+ ...r,
1772
+ style: {
1773
+ top: `${r.top}px`,
1774
+ left: `${r.left}px`,
1775
+ width: `${r.width}px`,
1776
+ height: `${r.height}px`
1777
+ }
1778
+ }))
1779
+ );
1780
+ re(
1781
+ () => [t.hovered, t.selected, o.active],
1782
+ () => i(),
1783
+ { immediate: !0 }
1784
+ ), ke(() => {
1785
+ window.addEventListener("scroll", i, !0), window.addEventListener("resize", i);
1786
+ }), Ae(() => {
1787
+ window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
1788
+ });
1789
+ function i() {
1790
+ var m, y;
1791
+ if (o.active) {
1792
+ n.boxes = [];
1793
+ return;
1794
+ }
1795
+ const r = t.selected;
1796
+ if ((m = r == null ? void 0 : r.multiSelectElements) != null && m.length) {
1797
+ const u = r.multiSelectElements.filter((A) => document.contains(A)).map((A, b) => {
1798
+ const x = A.getBoundingClientRect();
1799
+ return x.width > 0 && x.height > 0 ? { key: `selected-${b}`, isSelected: !0, top: x.top, left: x.left, width: x.width, height: x.height } : null;
1800
+ }).filter((A) => A !== null);
1801
+ if (u.length > 0) {
1802
+ n.boxes = u;
1803
+ return;
1804
+ }
1805
+ }
1806
+ if (r != null && r.isMultiSelect && ((y = r.elementBoundingBoxes) != null && y.length)) {
1807
+ n.boxes = r.elementBoundingBoxes.map((u, A) => ({
1808
+ key: `selected-${A}`,
1809
+ isSelected: !0,
1810
+ top: u.y - window.scrollY,
1811
+ left: u.x - window.scrollX,
1812
+ width: u.width,
1813
+ height: u.height
1814
+ })).filter((u) => u.width > 0 && u.height > 0);
1815
+ return;
1816
+ }
1817
+ const s = r ?? t.hovered;
1818
+ if (!s) {
1819
+ n.boxes = [];
1820
+ return;
1821
+ }
1822
+ const f = s.element.getBoundingClientRect();
1823
+ if (f.width <= 0 && f.height <= 0) {
1824
+ n.boxes = [];
1825
+ return;
1826
+ }
1827
+ n.boxes = [{
1828
+ key: r ? "selected" : "hovered",
1829
+ isSelected: r !== null,
1830
+ top: f.top,
1831
+ left: f.left,
1832
+ width: f.width,
1833
+ height: f.height
1834
+ }];
1835
+ }
1836
+ return (r, s) => (w(), $("div", Yn, [
1837
+ O(Lt, { name: "highlight" }, {
1838
+ default: le(() => [
1839
+ (w(!0), $(ue, null, de(l.value, (f) => (w(), $("div", {
1840
+ key: f.key,
1841
+ class: g(["highlight-box", { selected: f.isSelected }]),
1842
+ style: q(f.style)
1843
+ }, null, 6))), 128))
1844
+ ]),
1845
+ _: 1
1846
+ })
1847
+ ]));
1848
+ }
1849
+ }), Jn = /* @__PURE__ */ xe(Kn, [["__scopeId", "data-v-a77aeda9"]]), Gn = {
1850
+ key: 0,
1851
+ class: "marker-layer",
1852
+ "aria-hidden": "true",
1853
+ "data-annotation-marker": ""
1854
+ }, Xn = ["aria-label", "onClick", "onMouseenter"], qn = {
1855
+ key: 0,
1856
+ class: "tooltip"
1857
+ }, Zn = { class: "tooltip-element" }, Qn = { class: "tooltip-meta" }, ea = ["data-status"], ta = {
1858
+ key: 0,
1859
+ class: "tooltip-thread"
1860
+ }, oa = { class: "tooltip-comment" }, na = { class: "tooltip-hint" }, aa = /* @__PURE__ */ Ce({
1861
+ __name: "MarkerLayer",
1862
+ setup(e) {
1863
+ const t = ee(Ge, "annotations store"), o = ee(qe, "overlay state"), n = ee(Ze, "settings state"), l = ee(Qe, "i18n state"), i = K(null), r = C(() => l.messages), s = K(0), f = we({
1864
+ x: window.scrollX,
1865
+ y: window.scrollY
1866
+ }), m = C(() => n.showMarkers), y = C(() => n.annotationColor || "#3c82f7"), u = C(() => (s.value, t.annotations.map((I, W) => {
1867
+ const H = I.metadata;
1868
+ if (H != null && H.isMultiSelect) {
1869
+ const V = h(I);
1870
+ return V ? {
1871
+ id: I.id,
1872
+ number: W + 1,
1873
+ top: V.y - f.y,
1874
+ left: V.x + V.width / 2 - f.x,
1875
+ annotation: I
1876
+ } : null;
1877
+ }
1878
+ const X = $o(I);
1879
+ if (!X) return null;
1880
+ const L = X.getBoundingClientRect();
1881
+ return {
1882
+ id: I.id,
1883
+ number: W + 1,
1884
+ top: L.top,
1885
+ left: L.left + L.width / 2,
1886
+ annotation: I
1887
+ };
1888
+ }).filter((I) => I !== null)));
1889
+ let A = null, b = null, x = null;
1890
+ ke(() => {
1891
+ window.addEventListener("scroll", P, !0), window.addEventListener("resize", P), document.addEventListener("load", P, !0), document.addEventListener("transitionend", P, !0), document.addEventListener("animationend", P, !0), typeof ResizeObserver < "u" && (b = new ResizeObserver(() => P()), b.observe(document.documentElement), document.body && b.observe(document.body)), x = new MutationObserver(() => P()), x.observe(document.documentElement, {
1892
+ subtree: !0,
1893
+ childList: !0,
1894
+ characterData: !0
1895
+ }), x.observe(document.documentElement, {
1896
+ attributes: !0,
1897
+ attributeFilter: ["class", "style"]
1898
+ }), document.body && x.observe(document.body, {
1899
+ attributes: !0,
1900
+ attributeFilter: ["class", "style"]
1901
+ }), P();
1902
+ }), Ae(() => {
1903
+ window.removeEventListener("scroll", P, !0), window.removeEventListener("resize", P), document.removeEventListener("load", P, !0), document.removeEventListener("transitionend", P, !0), document.removeEventListener("animationend", P, !0), b == null || b.disconnect(), x == null || x.disconnect(), A !== null && window.cancelAnimationFrame(A);
1904
+ });
1905
+ function P() {
1906
+ A === null && (A = window.requestAnimationFrame(() => {
1907
+ A = null, J();
1908
+ }));
1909
+ }
1910
+ function J() {
1911
+ f.x = window.scrollX, f.y = window.scrollY, s.value += 1;
1912
+ }
1913
+ function G(I) {
1914
+ i.value = I;
1915
+ }
1916
+ function oe() {
1917
+ i.value = null;
1918
+ }
1919
+ function N(I, W) {
1920
+ W.stopPropagation(), i.value = null;
1921
+ const X = W.currentTarget.getBoundingClientRect();
1922
+ o.showEditPopover(I.annotation, X);
1923
+ }
1924
+ function R(I, W = 72) {
1925
+ return I.length > W ? `${I.slice(0, W)}…` : I;
1926
+ }
1927
+ function j(I) {
1928
+ return I.status ?? "pending";
1929
+ }
1930
+ function Q(I) {
1931
+ switch (j(I)) {
1932
+ case "acknowledged":
1933
+ return r.value.workflow.statusAcknowledged;
1934
+ case "resolved":
1935
+ return r.value.workflow.statusResolved;
1936
+ case "dismissed":
1937
+ return r.value.workflow.statusDismissed;
1938
+ default:
1939
+ return r.value.workflow.statusPending;
1940
+ }
1941
+ }
1942
+ function ne(I) {
1943
+ switch (j(I)) {
1944
+ case "acknowledged":
1945
+ return "#0ea5e9";
1946
+ case "resolved":
1947
+ return "#22c55e";
1948
+ case "dismissed":
1949
+ return "#94a3b8";
1950
+ default:
1951
+ return y.value;
1952
+ }
1953
+ }
1954
+ function h(I) {
1955
+ var W;
1956
+ return (W = I.metadata) == null ? void 0 : W.boundingBox;
1957
+ }
1958
+ return (I, W) => m.value ? (w(), $("div", Gn, [
1959
+ O(Lt, { name: "marker" }, {
1960
+ default: le(() => [
1961
+ (w(!0), $(ue, null, de(u.value, (H) => (w(), $("div", {
1962
+ key: H.id,
1963
+ class: "marker-wrapper",
1964
+ style: q({ top: `${H.top}px`, left: `${H.left}px` })
1965
+ }, [
1966
+ a("button", {
1967
+ class: g(["marker-dot", [{ hovered: i.value === H.id }, `status-${j(H.annotation)}`]]),
1968
+ style: q({ backgroundColor: i.value === H.id ? "#ff3b30" : ne(H.annotation) }),
1969
+ type: "button",
1970
+ "aria-label": r.value.marker.annotationAria(H.number),
1971
+ onClick: ce((X) => N(H, X), ["stop"]),
1972
+ onMouseenter: (X) => G(H.id),
1973
+ onMouseleave: oe
1974
+ }, E(H.number), 47, Xn),
1975
+ O(be, { name: "tooltip" }, {
1976
+ default: le(() => {
1977
+ var X;
1978
+ return [
1979
+ i.value === H.id ? (w(), $("div", qn, [
1980
+ a("div", Zn, E(H.annotation.elementSelector), 1),
1981
+ a("div", Qn, [
1982
+ a("span", {
1983
+ class: "tooltip-status",
1984
+ "data-status": j(H.annotation)
1985
+ }, E(Q(H.annotation)), 9, ea),
1986
+ (X = H.annotation.thread) != null && X.length ? (w(), $("span", ta, E(r.value.workflow.replyCount(H.annotation.thread.length)), 1)) : Z("", !0)
1987
+ ]),
1988
+ a("div", oa, E(R(H.annotation.comment)), 1),
1989
+ a("div", na, E(r.value.marker.clickToEdit), 1)
1990
+ ])) : Z("", !0)
1991
+ ];
1992
+ }),
1993
+ _: 2
1994
+ }, 1024)
1995
+ ], 4))), 128))
1996
+ ]),
1997
+ _: 1
1998
+ })
1999
+ ])) : Z("", !0);
2000
+ }
2001
+ }), sa = /* @__PURE__ */ xe(aa, [["__scopeId", "data-v-794e4bbb"]]), Wt = typeof window < "u" && typeof document < "u";
2002
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2003
+ const la = Object.prototype.toString, ra = (e) => la.call(e) === "[object Object]";
2004
+ function lt(e) {
2005
+ return Array.isArray(e) ? e : [e];
2006
+ }
2007
+ function ia(e, t = {}) {
2008
+ if (!po(e)) return vo(e);
2009
+ const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
2010
+ for (const n in e.value) o[n] = ho(() => ({
2011
+ get() {
2012
+ return e.value[n];
2013
+ },
2014
+ set(l) {
2015
+ var i;
2016
+ if (!((i = U(t.replaceRef)) !== null && i !== void 0) || i) if (Array.isArray(e.value)) {
2017
+ const r = [...e.value];
2018
+ r[n] = l, e.value = r;
2019
+ } else {
2020
+ const r = {
2021
+ ...e.value,
2022
+ [n]: l
2023
+ };
2024
+ Object.setPrototypeOf(r, Object.getPrototypeOf(e.value)), e.value = r;
2025
+ }
2026
+ else e.value[n] = l;
2027
+ }
2028
+ }));
2029
+ return o;
2030
+ }
2031
+ function ca(e, t, o) {
2032
+ return re(e, t, {
2033
+ ...o,
2034
+ immediate: !0
2035
+ });
2036
+ }
2037
+ const Yt = Wt ? window : void 0;
2038
+ function ua(e) {
2039
+ var t;
2040
+ const o = U(e);
2041
+ return (t = o == null ? void 0 : o.$el) !== null && t !== void 0 ? t : o;
2042
+ }
2043
+ function rt(...e) {
2044
+ const t = (n, l, i, r) => (n.addEventListener(l, i, r), () => n.removeEventListener(l, i, r)), o = C(() => {
2045
+ const n = lt(U(e[0])).filter((l) => l != null);
2046
+ return n.every((l) => typeof l != "string") ? n : void 0;
2047
+ });
2048
+ return ca(() => {
2049
+ var n, l;
2050
+ return [
2051
+ (n = (l = o.value) === null || l === void 0 ? void 0 : l.map((i) => ua(i))) !== null && n !== void 0 ? n : [Yt].filter((i) => i != null),
2052
+ lt(U(o.value ? e[1] : e[0])),
2053
+ lt(d(o.value ? e[2] : e[1])),
2054
+ U(o.value ? e[3] : e[2])
2055
+ ];
2056
+ }, ([n, l, i, r], s, f) => {
2057
+ if (!(n != null && n.length) || !(l != null && l.length) || !(i != null && i.length)) return;
2058
+ const m = ra(r) ? { ...r } : r, y = n.flatMap((u) => l.flatMap((A) => i.map((b) => t(u, A, b, m))));
2059
+ f(() => {
2060
+ y.forEach((u) => u());
2061
+ });
2062
+ }, { flush: "post" });
2063
+ }
2064
+ const Ne = {
2065
+ speed: 2,
2066
+ margin: 30,
2067
+ direction: "both"
2068
+ };
2069
+ function da(e) {
2070
+ e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));
2071
+ }
2072
+ function pa(e, t = {}) {
2073
+ var o, n, l, i;
2074
+ const { pointerTypes: r, preventDefault: s, stopPropagation: f, exact: m, onMove: y, onEnd: u, onStart: A, initialValue: b, axis: x = "both", draggingElement: P = Yt, containerElement: J, handle: G = e, buttons: oe = [0], restrictInView: N, autoScroll: R = !1 } = t, j = K((o = U(b)) !== null && o !== void 0 ? o : {
2075
+ x: 0,
2076
+ y: 0
2077
+ }), Q = K(), ne = (k) => r ? r.includes(k.pointerType) : !0, h = (k) => {
2078
+ U(s) && k.preventDefault(), U(f) && k.stopPropagation();
2079
+ }, I = U(R), W = typeof I == "object" ? {
2080
+ speed: (n = U(I.speed)) !== null && n !== void 0 ? n : Ne.speed,
2081
+ margin: (l = U(I.margin)) !== null && l !== void 0 ? l : Ne.margin,
2082
+ direction: (i = I.direction) !== null && i !== void 0 ? i : Ne.direction
2083
+ } : Ne, H = (k) => typeof k == "number" ? [k, k] : [k.x, k.y], X = (k, D, F) => {
2084
+ const { clientWidth: B, clientHeight: z, scrollLeft: p, scrollTop: M, scrollWidth: Y, scrollHeight: me } = k, [Oe, ye] = H(W.margin), [ge, Te] = H(W.speed);
2085
+ let _e = 0, Se = 0;
2086
+ (W.direction === "x" || W.direction === "both") && (F.x < Oe && p > 0 ? _e = -ge : F.x + D.width > B - Oe && p < Y - B && (_e = ge)), (W.direction === "y" || W.direction === "both") && (F.y < ye && M > 0 ? Se = -Te : F.y + D.height > z - ye && M < me - z && (Se = Te)), (_e || Se) && k.scrollBy({
2087
+ left: _e,
2088
+ top: Se,
2089
+ behavior: "auto"
2090
+ });
2091
+ };
2092
+ let L = null;
2093
+ const V = () => {
2094
+ const k = U(J);
2095
+ k && !L && (L = setInterval(() => {
2096
+ const D = U(e).getBoundingClientRect(), { x: F, y: B } = j.value, z = {
2097
+ x: F - k.scrollLeft,
2098
+ y: B - k.scrollTop
2099
+ };
2100
+ z.x >= 0 && z.y >= 0 && (X(k, D, z), z.x += k.scrollLeft, z.y += k.scrollTop, j.value = z);
2101
+ }, 1e3 / 60));
2102
+ }, c = () => {
2103
+ L && (clearInterval(L), L = null);
2104
+ }, ae = (k, D, F, B) => {
2105
+ const [z, p] = typeof F == "number" ? [F, F] : [F.x, F.y], { clientWidth: M, clientHeight: Y } = D;
2106
+ return k.x < z || k.x + B.width > M - z || k.y < p || k.y + B.height > Y - p;
2107
+ }, ie = () => {
2108
+ if (U(t.disabled) || !Q.value) return;
2109
+ const k = U(J);
2110
+ if (!k) return;
2111
+ const D = U(e).getBoundingClientRect(), { x: F, y: B } = j.value;
2112
+ ae({
2113
+ x: F - k.scrollLeft,
2114
+ y: B - k.scrollTop
2115
+ }, k, W.margin, D) ? V() : c();
2116
+ };
2117
+ U(R) && re(j, ie);
2118
+ const Me = (k) => {
2119
+ var D;
2120
+ if (!U(oe).includes(k.button) || U(t.disabled) || !ne(k) || U(m) && k.target !== U(e)) return;
2121
+ const F = U(J), B = F == null || (D = F.getBoundingClientRect) === null || D === void 0 ? void 0 : D.call(F), z = U(e).getBoundingClientRect(), p = {
2122
+ x: k.clientX - (F ? z.left - B.left + (R ? 0 : F.scrollLeft) : z.left),
2123
+ y: k.clientY - (F ? z.top - B.top + (R ? 0 : F.scrollTop) : z.top)
2124
+ };
2125
+ (A == null ? void 0 : A(p, k)) !== !1 && (Q.value = p, h(k));
2126
+ }, Le = (k) => {
2127
+ if (U(t.disabled) || !ne(k) || !Q.value) return;
2128
+ const D = U(J);
2129
+ D instanceof HTMLElement && da(D);
2130
+ const F = U(e).getBoundingClientRect();
2131
+ let { x: B, y: z } = j.value;
2132
+ if ((x === "x" || x === "both") && (B = k.clientX - Q.value.x, D && (B = Math.min(Math.max(0, B), D.scrollWidth - F.width))), (x === "y" || x === "both") && (z = k.clientY - Q.value.y, D && (z = Math.min(Math.max(0, z), D.scrollHeight - F.height))), U(R) && D && (L === null && X(D, F, {
2133
+ x: B,
2134
+ y: z
2135
+ }), B += D.scrollLeft, z += D.scrollTop), D && (N || R)) {
2136
+ if (x !== "y") {
2137
+ const p = B - D.scrollLeft;
2138
+ p < 0 ? B = D.scrollLeft : p > D.clientWidth - F.width && (B = D.clientWidth - F.width + D.scrollLeft);
2139
+ }
2140
+ if (x !== "x") {
2141
+ const p = z - D.scrollTop;
2142
+ p < 0 ? z = D.scrollTop : p > D.clientHeight - F.height && (z = D.clientHeight - F.height + D.scrollTop);
2143
+ }
2144
+ }
2145
+ j.value = {
2146
+ x: B,
2147
+ y: z
2148
+ }, y == null || y(j.value, k), h(k);
2149
+ }, he = (k) => {
2150
+ U(t.disabled) || !ne(k) || Q.value && (Q.value = void 0, R && c(), u == null || u(j.value, k), h(k));
2151
+ };
2152
+ if (Wt) {
2153
+ const k = () => {
2154
+ var D;
2155
+ return {
2156
+ capture: (D = t.capture) !== null && D !== void 0 ? D : !0,
2157
+ passive: !U(s)
2158
+ };
2159
+ };
2160
+ rt(G, "pointerdown", Me, k), rt(P, "pointermove", Le, k), rt(P, "pointerup", he, k);
2161
+ }
2162
+ return {
2163
+ ...ia(j),
2164
+ position: j,
2165
+ isDragging: C(() => !!Q.value),
2166
+ style: C(() => `
2167
+ left: ${j.value.x}px;
2168
+ top: ${j.value.y}px;
2169
+ ${R ? "text-wrap: nowrap;" : ""}
2170
+ `)
2171
+ };
2172
+ }
2173
+ const Kt = "agentation-vue-toolbar-position";
2174
+ function va(e = {}) {
2175
+ const t = e.padding ?? 20, o = e.toolbarHeight ?? 44, n = e.dragThreshold ?? 5, l = go(null), i = K(!1), r = K(!1), s = K(!1);
2176
+ let f = null, m = 297, y = 44;
2177
+ function u() {
2178
+ const L = l.value;
2179
+ if (!L) return;
2180
+ m = L.offsetWidth || m;
2181
+ const V = L.querySelector(".toolbar-container");
2182
+ V && (y = V.offsetWidth || y);
2183
+ }
2184
+ function A(L) {
2185
+ if (typeof window > "u") return L;
2186
+ const V = Math.max(0, m - y), c = t - V, ae = window.innerWidth - m - t, ie = window.innerHeight - o - t;
2187
+ return {
2188
+ x: Math.max(c, Math.min(Math.max(c, ae), L.x)),
2189
+ y: Math.max(t, Math.min(Math.max(t, ie), L.y))
2190
+ };
2191
+ }
2192
+ const b = "agentation-dragging";
2193
+ function x() {
2194
+ document.documentElement.classList.add(b);
2195
+ }
2196
+ function P() {
2197
+ document.documentElement.classList.remove(b);
2198
+ }
2199
+ function J(L) {
2200
+ return L instanceof Element && !!L.closest("button, input, textarea, select, [data-no-drag]");
2201
+ }
2202
+ const G = ha();
2203
+ G && (i.value = !0);
2204
+ const oe = G ? typeof window < "u" ? A(G) : G : { x: 0, y: 0 }, { x: N, y: R } = pa(l, {
2205
+ initialValue: oe,
2206
+ preventDefault: !0,
2207
+ onStart(L, V) {
2208
+ if (V.pointerType === "mouse" && V.button !== 0 || J(V.target)) return !1;
2209
+ const c = l.value;
2210
+ if (!c) return !1;
2211
+ if (u(), s.value = !1, !i.value) {
2212
+ const ae = c.getBoundingClientRect();
2213
+ N.value = ae.left, R.value = ae.top, i.value = !0;
2214
+ }
2215
+ f = {
2216
+ pointerX: V.clientX,
2217
+ pointerY: V.clientY,
2218
+ startX: N.value,
2219
+ startY: R.value
2220
+ };
2221
+ },
2222
+ onMove(L, V) {
2223
+ if (!f) return;
2224
+ if (!r.value) {
2225
+ const ae = V.clientX - f.pointerX, ie = V.clientY - f.pointerY;
2226
+ if (ae * ae + ie * ie <= n * n) {
2227
+ N.value = f.startX, R.value = f.startY;
2228
+ return;
2229
+ }
2230
+ r.value = !0, x();
2231
+ }
2232
+ const c = A(L);
2233
+ N.value = c.x, R.value = c.y;
2234
+ },
2235
+ onEnd() {
2236
+ f && r.value && (je({ x: N.value, y: R.value }), s.value = !0, P()), r.value = !1, f = null;
2237
+ }
2238
+ }), j = C(() => i.value ? { x: N.value, y: R.value } : null), Q = C(() => {
2239
+ if (i.value)
2240
+ return {
2241
+ left: `${N.value}px`,
2242
+ top: `${R.value}px`,
2243
+ right: "auto",
2244
+ bottom: "auto"
2245
+ };
2246
+ });
2247
+ function ne() {
2248
+ f && r.value && (je({ x: N.value, y: R.value }), s.value = !0, P()), r.value = !1, f = null;
2249
+ }
2250
+ function h() {
2251
+ if (u(), r.value || !i.value) return;
2252
+ const L = A({ x: N.value, y: R.value });
2253
+ N.value = L.x, R.value = L.y, je(L);
2254
+ }
2255
+ function I() {
2256
+ if (u(), !i.value) return;
2257
+ const L = A({ x: N.value, y: R.value });
2258
+ N.value = L.x, R.value = L.y, je(L);
2259
+ }
2260
+ function W(L) {
2261
+ l.value !== L && (l.value = L, u());
2262
+ }
2263
+ function H(L) {
2264
+ }
2265
+ function X() {
2266
+ const L = s.value;
2267
+ return s.value = !1, L;
2268
+ }
2269
+ return ke(() => {
2270
+ if (u(), i.value) {
2271
+ const L = A({ x: N.value, y: R.value });
2272
+ N.value = L.x, R.value = L.y;
2273
+ }
2274
+ window.addEventListener("resize", h), window.addEventListener("blur", ne);
2275
+ }), Ae(() => {
2276
+ r.value && P(), r.value = !1, f = null, window.removeEventListener("resize", h), window.removeEventListener("blur", ne);
2277
+ }), {
2278
+ position: j,
2279
+ isDragging: r,
2280
+ justFinishedDrag: s,
2281
+ toolbarStyle: Q,
2282
+ bindToolbarRef: W,
2283
+ onMouseDown: H,
2284
+ consumeJustFinishedDrag: X,
2285
+ syncConstraints: I
2286
+ };
2287
+ }
2288
+ function ha() {
2289
+ if (typeof window > "u") return null;
2290
+ try {
2291
+ const e = window.localStorage.getItem(Kt);
2292
+ if (!e) return null;
2293
+ const t = JSON.parse(e);
2294
+ return typeof t.x != "number" || typeof t.y != "number" ? null : { x: t.x, y: t.y };
2295
+ } catch {
2296
+ return null;
2297
+ }
2298
+ }
2299
+ function je(e) {
2300
+ if (!(typeof window > "u"))
2301
+ try {
2302
+ window.localStorage.setItem(Kt, JSON.stringify(e));
2303
+ } catch {
2304
+ }
2305
+ }
2306
+ const ga = /* @__PURE__ */ Ce({
2307
+ __name: "AgTooltip",
2308
+ props: {
2309
+ content: {}
2310
+ },
2311
+ setup(e) {
2312
+ const t = K(!1), o = K({ top: 0, left: 0 }), n = K(null);
2313
+ let l = null;
2314
+ function i(s) {
2315
+ var m;
2316
+ const f = (m = s.currentTarget) == null ? void 0 : m.firstElementChild;
2317
+ n.value = f, l = Ee(() => {
2318
+ if (!n.value) return;
2319
+ const y = n.value.getBoundingClientRect();
2320
+ o.value = {
2321
+ top: y.top + y.height / 2,
2322
+ left: y.left - 8
2323
+ }, t.value = !0;
2324
+ }, 500);
2325
+ }
2326
+ function r() {
2327
+ l && (clearTimeout(l), l = null), t.value = !1, n.value = null;
2328
+ }
2329
+ return Mt(() => {
2330
+ l && clearTimeout(l);
2331
+ }), (s, f) => (w(), $("span", {
2332
+ class: "ag-tooltip-trigger",
2333
+ onMouseenter: i,
2334
+ onMouseleave: r
2335
+ }, [
2336
+ fo(s.$slots, "default", {}, void 0, !0),
2337
+ (w(), se(Tt, { to: "body" }, [
2338
+ O(be, { name: "ag-tooltip" }, {
2339
+ default: le(() => [
2340
+ t.value ? (w(), $("div", {
2341
+ key: 0,
2342
+ "data-feedback-toolbar": "",
2343
+ style: q({
2344
+ position: "fixed",
2345
+ top: `${o.value.top}px`,
2346
+ left: `${o.value.left}px`,
2347
+ transform: "translate(-100%, -50%)",
2348
+ zIndex: 100010,
2349
+ maxWidth: "180px",
2350
+ padding: "6px 10px",
2351
+ borderRadius: "8px",
2352
+ background: "#383838",
2353
+ color: "rgba(255, 255, 255, 0.9)",
2354
+ fontSize: "11px",
2355
+ lineHeight: "1.4",
2356
+ fontFamily: "system-ui, -apple-system, sans-serif",
2357
+ fontWeight: "400",
2358
+ letterSpacing: "-0.01em",
2359
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
2360
+ pointerEvents: "none",
2361
+ whiteSpace: "normal"
2362
+ })
2363
+ }, E(e.content), 5)) : Z("", !0)
2364
+ ]),
2365
+ _: 1
2366
+ })
2367
+ ]))
2368
+ ], 32));
2369
+ }
2370
+ }), Ue = /* @__PURE__ */ xe(ga, [["__scopeId", "data-v-5bd9e12a"]]), fa = ["role", "tabindex"], ma = ["title", "aria-label", "data-state"], ya = ["title", "aria-label", "data-state", "disabled"], ba = ["title", "aria-label", "disabled", "data-active"], ka = ["title", "aria-label", "disabled"], wa = ["title", "aria-label", "data-active"], Ca = ["title", "aria-label"], xa = ["title", "aria-label"], _a = { class: "theme-icon-wrapper" }, Sa = { class: "settings-section" }, Ea = { class: "settings-row" }, Aa = ["aria-label"], Ma = ["lang", "aria-pressed", "onClick"], La = { class: "settings-section" }, Ta = { class: "settings-row" }, Pa = { class: "settings-label-with-help" }, $a = { class: "cycle-dots" }, Da = { class: "settings-section" }, Ia = { class: "settings-row" }, Oa = ["aria-label"], Fa = ["title", "aria-label", "aria-pressed"], Ha = ["title", "aria-label", "aria-pressed"], Ra = { class: "settings-section" }, za = { class: "nav-btn-left" }, Na = { class: "nav-btn-right" }, ja = { class: "settings-section" }, Ua = { class: "color-row" }, Va = ["title", "onClick"], Ba = { class: "settings-section" }, Wa = { class: "toggle-row" }, Ya = ["checked"], Ka = { class: "toggle-row" }, Ja = ["checked"], Ga = { class: "toggle-row" }, Xa = ["checked"], qa = { class: "settings-section" }, Za = { class: "nav-btn-left" }, Qa = { class: "nav-btn-right" }, es = ["title", "aria-label"], ts = { class: "settings-section" }, os = { class: "settings-section" }, ns = { class: "settings-row" }, as = ["value", "placeholder"], ss = { class: "settings-section" }, ls = { class: "settings-row" }, rs = { class: "copy-field-list" }, is = ["checked", "onChange"], cs = { class: "settings-section" }, us = { class: "settings-row" }, ds = { class: "settings-section" }, ps = { class: "settings-row" }, vs = { class: "settings-label-with-help" }, hs = { class: "toggle-row webhook-toggle" }, gs = ["checked"], fs = ["value", "placeholder"], ms = { class: "settings-section" }, ys = { class: "guide-card-title" }, bs = { class: "settings-section" }, ks = { class: "guide-grid" }, ws = { class: "guide-card-header" }, Cs = { class: "guide-card-title" }, xs = ["title", "aria-label", "data-copied", "onClick"], _s = { class: "settings-section" }, Ss = { class: "guide-grid" }, Es = { class: "guide-card-header" }, As = { class: "guide-card-title" }, Ms = ["title", "aria-label", "data-copied", "onClick"], Ls = { class: "settings-section" }, Ts = { class: "guide-card-header" }, Ps = { class: "guide-card-title" }, $s = ["title", "aria-label", "data-copied"], Ve = 16, At = 520, Ds = /* @__PURE__ */ Ce({
2371
+ __name: "Toolbar",
2372
+ props: {
2373
+ exportActions: {}
2374
+ },
2375
+ setup(e) {
2376
+ const t = ["compact", "standard", "detailed", "forensic"], o = ["main", "copy", "automations"], n = e, l = ee(Ge, "annotations store"), i = ee(Xe, "selection state"), r = ee(qe, "overlay state"), s = ee(Ze, "settings state"), f = ee(Qe, "i18n state"), m = ee(Ot, "freeze state"), y = ee(It, "runtime bridge"), u = K(null), A = K(null), b = K(null), x = K(null), P = K(!1), J = K(!1), G = K("main"), oe = K(null), N = K(null), R = K(!1), j = va({}), Q = C(() => l.annotations.length), ne = C(() => Q.value > 0), h = C(() => !s.darkMode), I = C(() => m.isFrozen.value), W = C(() => s.copyFormat), H = C(() => W.value === "markdown"), X = C(() => n.exportActions.copyFeedback === W.value), L = C(() => s.showMarkers), V = C(() => J.value), c = C(() => f.messages), ae = C(() => o.indexOf(G.value)), ie = C(() => {
2377
+ const S = o.length;
2378
+ return {
2379
+ "--ag-settings-page-count": String(S),
2380
+ width: `${S * 100}%`,
2381
+ transform: `translateX(-${ae.value * 100 / S}%)`,
2382
+ ...oe.value === null ? {} : { height: `${oe.value}px` }
2383
+ };
2384
+ }), Me = C(() => c.value.outputDetail[s.outputDetail]), Le = C(
2385
+ () => {
2386
+ var S;
2387
+ return (((S = j.position.value) == null ? void 0 : S.y) ?? Number.POSITIVE_INFINITY) < 230 ? "below" : "above";
2388
+ }
2389
+ ), he = C(() => !!y.sync), k = C(() => {
2390
+ var S;
2391
+ return (S = y.sync) == null ? void 0 : S.info;
2392
+ }), D = C(() => {
2393
+ var S;
2394
+ return ((S = k.value) == null ? void 0 : S.endpoint) ?? "http://localhost:4747";
2395
+ }), F = C(() => {
2396
+ var S;
2397
+ return ((S = k.value) == null ? void 0 : S.mcpHttpUrl) ?? "http://localhost:4748/mcp";
2398
+ }), B = C(() => {
2399
+ var S;
2400
+ return ((S = k.value) == null ? void 0 : S.mcpSseUrl) ?? "http://localhost:4748/sse";
2401
+ }), z = C(() => {
2402
+ var v;
2403
+ const S = He(D.value) ?? 4747, _ = He(((v = k.value) == null ? void 0 : v.mcpEndpoint) ?? "") ?? 4748;
2404
+ return `npx agentation-vue-mcp server --port ${S} --mcp-port ${_}`;
2405
+ }), p = C(() => {
2406
+ var v;
2407
+ const S = He(D.value) ?? 4747, _ = He(((v = k.value) == null ? void 0 : v.mcpEndpoint) ?? "") ?? 4748;
2408
+ return `claude mcp add agentation -- npx agentation-vue-mcp server --port ${S} --mcp-port ${_}`;
2409
+ }), M = C(() => s.webhooksEnabled ? s.webhookUrl.split(/[\n,]/).map((S) => S.trim()).filter(Boolean) : []), Y = C(() => M.value.length === 1 ? `AGENTATION_WEBHOOK_URL=${M.value[0]}` : M.value.length > 1 ? `AGENTATION_WEBHOOKS=${M.value.join(",")}` : `AGENTATION_WEBHOOK_URL=https://example.com/webhook
2410
+ AGENTATION_WEBHOOKS=https://a.example/webhook,https://b.example/webhook`), me = C(() => [
2411
+ { key: "mcp-http", label: c.value.settings.mcpHttpEndpointLabel, value: F.value },
2412
+ { key: "mcp-sse", label: c.value.settings.mcpSseEndpointLabel, value: B.value }
2413
+ ]), Oe = C(() => [
2414
+ { key: "cli-command", label: c.value.settings.cliCommandLabel, value: z.value },
2415
+ { key: "claude-command", label: c.value.settings.claudeCommandLabel, value: p.value },
2416
+ { key: "cursor-endpoint", label: c.value.settings.cursorEndpointLabel, value: F.value },
2417
+ { key: "codex-endpoint", label: c.value.settings.codexEndpointLabel, value: B.value }
2418
+ ]);
2419
+ re(P, async (S) => {
2420
+ S || (Fe(), i.clearHovered(), i.clearSelection(), r.hidePopover()), l.enabled = S, await Ye(), j.syncConstraints();
2421
+ }, { immediate: !0 });
2422
+ let ye = null, ge = null;
2423
+ ke(() => {
2424
+ document.addEventListener("pointerdown", Te, !0), window.addEventListener("resize", ot), R.value = !0, ye = Ee(() => {
2425
+ R.value = !1, ye = null;
2426
+ }, 760);
2427
+ }), Ae(() => {
2428
+ document.removeEventListener("pointerdown", Te, !0), window.removeEventListener("resize", ot), ye && window.clearTimeout(ye), ge && window.clearTimeout(ge);
2429
+ });
2430
+ function Te(S) {
2431
+ V.value && (Se(S) || Fe());
2432
+ }
2433
+ function _e(S) {
2434
+ const _ = S instanceof HTMLElement ? S : null;
2435
+ u.value = _, j.bindToolbarRef(_);
2436
+ }
2437
+ function Se(S) {
2438
+ const _ = u.value;
2439
+ if (!_) return !1;
2440
+ const v = typeof S.composedPath == "function" ? S.composedPath() : [];
2441
+ return v.length > 0 ? v.some((pe) => pe instanceof Node && _.contains(pe)) : S.target instanceof Node && _.contains(S.target);
2442
+ }
2443
+ function Jt() {
2444
+ P.value || j.consumeJustFinishedDrag() || (P.value = !0);
2445
+ }
2446
+ function Gt() {
2447
+ Fe(), P.value = !1, I.value && m.toggleFreeze();
2448
+ }
2449
+ function Xt() {
2450
+ m.toggleFreeze();
2451
+ }
2452
+ function qt() {
2453
+ s.showMarkers = !L.value;
2454
+ }
2455
+ function Fe() {
2456
+ J.value = !1, G.value = "main";
2457
+ }
2458
+ function Zt() {
2459
+ if (J.value) {
2460
+ Fe();
2461
+ return;
2462
+ }
2463
+ G.value = "main", J.value = !0;
2464
+ }
2465
+ function Qt() {
2466
+ J.value = !0, G.value = "automations";
2467
+ }
2468
+ function eo() {
2469
+ J.value = !0, G.value = "copy";
2470
+ }
2471
+ function pt() {
2472
+ G.value = "main";
2473
+ }
2474
+ function to(S) {
2475
+ s.copyExcludeFields = s.copyExcludeFields.includes(S) ? s.copyExcludeFields.filter((_) => _ !== S) : [...s.copyExcludeFields, S];
2476
+ }
2477
+ re(
2478
+ [V, G, c, F, B, z, p, Y, () => s.copyExcludeFields.length],
2479
+ async ([S]) => {
2480
+ if (!S) {
2481
+ oe.value = null;
2482
+ return;
2483
+ }
2484
+ await Ye(), ot();
2485
+ },
2486
+ { flush: "post" }
2487
+ );
2488
+ function oo() {
2489
+ l.clearAll(), i.clearHovered(), i.clearSelection(), r.hidePopover();
2490
+ }
2491
+ function no() {
2492
+ const S = t.findIndex((_) => _ === s.outputDetail);
2493
+ s.outputDetail = t[(S + 1) % t.length];
2494
+ }
2495
+ function ao() {
2496
+ return H.value ? n.exportActions.exportMarkdown() : n.exportActions.exportJSON();
2497
+ }
2498
+ function He(S) {
2499
+ try {
2500
+ const _ = new URL(S), v = _.protocol === "https:" ? 443 : 80, pe = parseInt(_.port || String(v), 10);
2501
+ return Number.isFinite(pe) ? pe : null;
2502
+ } catch {
2503
+ return null;
2504
+ }
2505
+ }
2506
+ async function tt(S, _) {
2507
+ await so(_) && (N.value = S, ge && window.clearTimeout(ge), ge = Ee(() => {
2508
+ N.value === S && (N.value = null), ge = null;
2509
+ }, 1400));
2510
+ }
2511
+ async function so(S) {
2512
+ var v;
2513
+ if (typeof navigator < "u" && ((v = navigator.clipboard) != null && v.writeText))
2514
+ try {
2515
+ return await navigator.clipboard.writeText(S), !0;
2516
+ } catch {
2517
+ }
2518
+ if (typeof document > "u") return !1;
2519
+ const _ = document.createElement("textarea");
2520
+ _.value = S, _.setAttribute("readonly", "true"), _.style.position = "fixed", _.style.opacity = "0", _.style.pointerEvents = "none", document.body.appendChild(_), _.select();
2521
+ try {
2522
+ return document.execCommand("copy");
2523
+ } catch {
2524
+ return !1;
2525
+ } finally {
2526
+ _.remove();
2527
+ }
2528
+ }
2529
+ function ot() {
2530
+ if (!V.value) {
2531
+ oe.value = null;
2532
+ return;
2533
+ }
2534
+ const S = G.value === "copy" ? b.value : G.value === "automations" ? x.value : A.value;
2535
+ S && (oe.value = Math.min(S.scrollHeight, lo()));
2536
+ }
2537
+ function lo() {
2538
+ return typeof window > "u" ? At : Math.min(At, Math.round(window.innerHeight * 0.72));
2539
+ }
2540
+ return (S, _) => (w(), $("div", {
2541
+ ref: _e,
2542
+ class: g(["toolbar", { dragging: d(j).isDragging.value }]),
2543
+ style: q(d(j).toolbarStyle.value),
2544
+ "data-feedback-toolbar": ""
2545
+ }, [
2546
+ a("div", {
2547
+ class: g(["toolbar-container", {
2548
+ collapsed: !P.value,
2549
+ expanded: P.value,
2550
+ light: h.value,
2551
+ dragging: d(j).isDragging.value,
2552
+ entrance: R.value
2553
+ }]),
2554
+ role: P.value ? void 0 : "button",
2555
+ tabindex: P.value ? -1 : 0,
2556
+ onClick: Jt,
2557
+ onKeydown: [
2558
+ _[12] || (_[12] = vt(ce((v) => P.value = !0, ["prevent"]), ["enter"])),
2559
+ _[13] || (_[13] = vt(ce((v) => P.value = !0, ["prevent"]), ["space"]))
2560
+ ]
2561
+ }, [
2562
+ a("div", {
2563
+ class: g(["toggle-content", P.value ? "hidden" : "visible"])
2564
+ }, [
2565
+ O(d(nn), { size: 24 }),
2566
+ ne.value ? (w(), $("span", {
2567
+ key: 0,
2568
+ class: g(["badge", { entrance: R.value }]),
2569
+ style: q({ backgroundColor: d(s).annotationColor })
2570
+ }, E(Q.value), 7)) : Z("", !0)
2571
+ ], 2),
2572
+ a("div", {
2573
+ class: g(["controls-content", P.value ? "visible" : "hidden"])
2574
+ }, [
2575
+ a("button", {
2576
+ class: g(["control-btn", { light: h.value }]),
2577
+ type: "button",
2578
+ title: I.value ? c.value.toolbar.resume : c.value.toolbar.pause,
2579
+ "aria-label": I.value ? c.value.toolbar.resumeAria : c.value.toolbar.pauseAria,
2580
+ "data-state": I.value ? "paused" : void 0,
2581
+ onClick: ce(Xt, ["stop"])
2582
+ }, [
2583
+ I.value ? (w(), se(d(cn), {
2584
+ key: 0,
2585
+ size: 24
2586
+ })) : (w(), se(d(rn), {
2587
+ key: 1,
2588
+ size: 24
2589
+ }))
2590
+ ], 10, ma),
2591
+ a("button", {
2592
+ class: g(["control-btn", { light: h.value }]),
2593
+ type: "button",
2594
+ title: L.value ? c.value.toolbar.hideMarkers : c.value.toolbar.showMarkers,
2595
+ "aria-label": L.value ? c.value.toolbar.hideMarkersAria : c.value.toolbar.showMarkersAria,
2596
+ "data-state": L.value ? void 0 : "hidden",
2597
+ disabled: !ne.value,
2598
+ onClick: ce(qt, ["stop"])
2599
+ }, [
2600
+ L.value ? (w(), se(d(sn), {
2601
+ key: 0,
2602
+ size: 24
2603
+ })) : (w(), se(d(ln), {
2604
+ key: 1,
2605
+ size: 24
2606
+ }))
2607
+ ], 10, ya),
2608
+ a("button", {
2609
+ class: g(["control-btn", { light: h.value }]),
2610
+ type: "button",
2611
+ title: H.value ? c.value.toolbar.copyMarkdown : c.value.toolbar.copyJson,
2612
+ "aria-label": H.value ? c.value.toolbar.copyMarkdownAria : c.value.toolbar.copyJsonAria,
2613
+ disabled: !ne.value,
2614
+ "data-active": X.value || void 0,
2615
+ onClick: _[0] || (_[0] = ce((v) => void ao(), ["stop"]))
2616
+ }, [
2617
+ O(d($e), {
2618
+ size: 24,
2619
+ copied: X.value
2620
+ }, null, 8, ["copied"])
2621
+ ], 10, ba),
2622
+ a("button", {
2623
+ class: g(["control-btn", { light: h.value }]),
2624
+ type: "button",
2625
+ title: c.value.toolbar.clearAll,
2626
+ "aria-label": c.value.toolbar.clearAllAria,
2627
+ disabled: !ne.value,
2628
+ "data-danger": "",
2629
+ onClick: ce(oo, ["stop"])
2630
+ }, [
2631
+ O(d(Bt), { size: 18 })
2632
+ ], 10, ka),
2633
+ a("div", {
2634
+ class: g(["divider", { light: h.value }])
2635
+ }, null, 2),
2636
+ a("button", {
2637
+ class: g(["control-btn", { light: h.value }]),
2638
+ type: "button",
2639
+ title: c.value.toolbar.settings,
2640
+ "aria-label": c.value.toolbar.toggleSettingsAria,
2641
+ "data-active": V.value || void 0,
2642
+ onClick: ce(Zt, ["stop"])
2643
+ }, [
2644
+ O(d(un), { size: 20 })
2645
+ ], 10, wa),
2646
+ a("button", {
2647
+ class: g(["control-btn", { light: h.value }]),
2648
+ type: "button",
2649
+ title: c.value.toolbar.closeToolbar,
2650
+ "aria-label": c.value.toolbar.closeToolbarAria,
2651
+ onClick: ce(Gt, ["stop"])
2652
+ }, [
2653
+ O(d(pn), { size: 20 })
2654
+ ], 10, Ca)
2655
+ ], 2),
2656
+ O(be, { name: "settings-panel" }, {
2657
+ default: le(() => [
2658
+ P.value && V.value ? (w(), $("div", {
2659
+ key: 0,
2660
+ class: g(["settings-panel", {
2661
+ light: h.value,
2662
+ below: Le.value === "below"
2663
+ }]),
2664
+ "data-no-drag": "",
2665
+ onClick: _[11] || (_[11] = ce(() => {
2666
+ }, ["stop"]))
2667
+ }, [
2668
+ a("div", {
2669
+ class: "settings-pages",
2670
+ style: q(ie.value)
2671
+ }, [
2672
+ a("div", {
2673
+ ref_key: "mainSettingsPageRef",
2674
+ ref: A,
2675
+ class: "settings-page"
2676
+ }, [
2677
+ a("div", {
2678
+ class: g(["settings-header", { light: h.value }])
2679
+ }, [
2680
+ a("span", {
2681
+ class: g(["settings-brand", { light: h.value }])
2682
+ }, [
2683
+ a("span", {
2684
+ class: "settings-slash",
2685
+ style: q({ color: d(s).annotationColor })
2686
+ }, "/", 4),
2687
+ _[14] || (_[14] = Ke("agentation ", -1))
2688
+ ], 2),
2689
+ a("button", {
2690
+ class: g(["theme-toggle", { light: h.value }]),
2691
+ type: "button",
2692
+ title: d(s).darkMode ? c.value.settings.lightMode : c.value.settings.darkMode,
2693
+ "aria-label": d(s).darkMode ? c.value.settings.switchToLightAria : c.value.settings.switchToDarkAria,
2694
+ onClick: _[1] || (_[1] = (v) => d(s).toggleDarkMode())
2695
+ }, [
2696
+ a("span", _a, [
2697
+ O(be, {
2698
+ name: "theme-icon",
2699
+ mode: "out-in"
2700
+ }, {
2701
+ default: le(() => [
2702
+ (w(), $("span", {
2703
+ key: d(s).darkMode ? "sun" : "moon",
2704
+ class: "theme-icon"
2705
+ }, [
2706
+ d(s).darkMode ? (w(), se(d(vn), {
2707
+ key: 0,
2708
+ size: 16
2709
+ })) : (w(), se(d(hn), {
2710
+ key: 1,
2711
+ size: 16
2712
+ }))
2713
+ ]))
2714
+ ]),
2715
+ _: 1
2716
+ })
2717
+ ])
2718
+ ], 10, xa)
2719
+ ], 2),
2720
+ a("div", Sa, [
2721
+ a("div", Ea, [
2722
+ a("span", {
2723
+ class: g(["settings-label", { light: h.value }])
2724
+ }, E(c.value.settings.language), 3),
2725
+ a("div", {
2726
+ class: g(["locale-switch", { light: h.value }]),
2727
+ role: "group",
2728
+ "aria-label": c.value.settings.language
2729
+ }, [
2730
+ (w(!0), $(ue, null, de(d(Ft), (v) => (w(), $("button", {
2731
+ key: v,
2732
+ class: g(["locale-btn", { active: d(s).locale === v, light: h.value }]),
2733
+ type: "button",
2734
+ lang: v,
2735
+ "aria-pressed": d(s).locale === v,
2736
+ onClick: (pe) => d(s).locale = v
2737
+ }, E(d(Eo)[v]), 11, Ma))), 128))
2738
+ ], 10, Aa)
2739
+ ])
2740
+ ]),
2741
+ a("div", La, [
2742
+ a("div", Ta, [
2743
+ a("span", Pa, [
2744
+ a("span", {
2745
+ class: g(["settings-label", { light: h.value }])
2746
+ }, E(c.value.settings.outputDetail), 3),
2747
+ O(Ue, {
2748
+ content: c.value.settings.outputDetailHelp
2749
+ }, {
2750
+ default: le(() => [
2751
+ O(d(ze), {
2752
+ size: Ve,
2753
+ style: q({ color: h.value ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.3)", cursor: "help" })
2754
+ }, null, 8, ["style"])
2755
+ ]),
2756
+ _: 1
2757
+ }, 8, ["content"])
2758
+ ]),
2759
+ a("button", {
2760
+ class: g(["cycle-btn", { light: h.value }]),
2761
+ type: "button",
2762
+ onClick: no
2763
+ }, [
2764
+ O(be, {
2765
+ name: "cycle-text",
2766
+ mode: "out-in"
2767
+ }, {
2768
+ default: le(() => [
2769
+ (w(), $("span", {
2770
+ key: d(s).outputDetail,
2771
+ class: "cycle-text"
2772
+ }, E(Me.value), 1))
2773
+ ]),
2774
+ _: 1
2775
+ }),
2776
+ a("span", $a, [
2777
+ (w(), $(ue, null, de(t, (v) => a("span", {
2778
+ key: v,
2779
+ class: g(["cycle-dot", { active: v === d(s).outputDetail, light: h.value }])
2780
+ }, null, 2)), 64))
2781
+ ])
2782
+ ], 2)
2783
+ ])
2784
+ ]),
2785
+ a("div", Da, [
2786
+ a("div", Ia, [
2787
+ a("span", {
2788
+ class: g(["settings-label", { light: h.value }])
2789
+ }, E(c.value.settings.exportFormat), 3),
2790
+ a("div", {
2791
+ class: g(["format-switch", { light: h.value }]),
2792
+ style: q({ "--ag-format-accent": d(s).annotationColor }),
2793
+ role: "group",
2794
+ "aria-label": c.value.settings.exportFormat
2795
+ }, [
2796
+ a("button", {
2797
+ class: g(["format-btn", { light: h.value, active: d(s).copyFormat === "markdown" }]),
2798
+ type: "button",
2799
+ title: c.value.toolbar.copyMarkdown,
2800
+ "aria-label": c.value.settings.exportFormatMarkdownAria,
2801
+ "aria-pressed": d(s).copyFormat === "markdown",
2802
+ onClick: _[2] || (_[2] = (v) => d(s).copyFormat = "markdown")
2803
+ }, [
2804
+ O(d(an), { size: 18 })
2805
+ ], 10, Fa),
2806
+ a("button", {
2807
+ class: g(["format-btn", { light: h.value, active: d(s).copyFormat === "json" }]),
2808
+ type: "button",
2809
+ title: c.value.toolbar.copyJson,
2810
+ "aria-label": c.value.settings.exportFormatJsonAria,
2811
+ "aria-pressed": d(s).copyFormat === "json",
2812
+ onClick: _[3] || (_[3] = (v) => d(s).copyFormat = "json")
2813
+ }, [
2814
+ O(d(gn), { size: 16 })
2815
+ ], 10, Ha)
2816
+ ], 14, Oa)
2817
+ ])
2818
+ ]),
2819
+ a("div", Ra, [
2820
+ a("button", {
2821
+ class: g(["nav-btn", { light: h.value }]),
2822
+ type: "button",
2823
+ onClick: eo
2824
+ }, [
2825
+ a("span", za, [
2826
+ O(d($e), { size: 18 }),
2827
+ a("span", null, E(c.value.settings.copySettings), 1)
2828
+ ]),
2829
+ a("span", Na, [
2830
+ O(d(Et), { size: 16 })
2831
+ ])
2832
+ ], 2)
2833
+ ]),
2834
+ a("div", ja, [
2835
+ a("span", {
2836
+ class: g(["settings-label", { light: h.value }])
2837
+ }, E(c.value.settings.markerColour), 3),
2838
+ a("div", Ua, [
2839
+ (w(!0), $(ue, null, de(d(Ko), (v) => (w(), $("button", {
2840
+ key: v.key,
2841
+ class: g(["color-ring", { selected: d(s).annotationColor === v.value }]),
2842
+ style: q({ borderColor: d(s).annotationColor === v.value ? v.value : "transparent" }),
2843
+ type: "button",
2844
+ title: c.value.colors[v.key],
2845
+ onClick: (pe) => d(s).annotationColor = v.value
2846
+ }, [
2847
+ a("span", {
2848
+ class: g(["color-dot", { selected: d(s).annotationColor === v.value }]),
2849
+ style: q({ backgroundColor: v.value })
2850
+ }, null, 6)
2851
+ ], 14, Va))), 128))
2852
+ ])
2853
+ ]),
2854
+ a("div", Ba, [
2855
+ a("label", Wa, [
2856
+ a("input", {
2857
+ class: "sr-only",
2858
+ type: "checkbox",
2859
+ checked: d(s).autoClearAfterCopy,
2860
+ onChange: _[4] || (_[4] = (v) => d(s).autoClearAfterCopy = v.target.checked)
2861
+ }, null, 40, Ya),
2862
+ a("span", {
2863
+ class: g(["checkbox", { checked: d(s).autoClearAfterCopy, light: h.value }])
2864
+ }, [
2865
+ d(s).autoClearAfterCopy ? (w(), se(d(De), {
2866
+ key: 0,
2867
+ size: 14
2868
+ })) : Z("", !0)
2869
+ ], 2),
2870
+ a("span", {
2871
+ class: g(["toggle-label", { light: h.value }])
2872
+ }, E(c.value.settings.clearOnCopy), 3)
2873
+ ]),
2874
+ a("label", Ka, [
2875
+ a("input", {
2876
+ class: "sr-only",
2877
+ type: "checkbox",
2878
+ checked: d(s).blockInteractions,
2879
+ onChange: _[5] || (_[5] = (v) => d(s).blockInteractions = v.target.checked)
2880
+ }, null, 40, Ja),
2881
+ a("span", {
2882
+ class: g(["checkbox", { checked: d(s).blockInteractions, light: h.value }])
2883
+ }, [
2884
+ d(s).blockInteractions ? (w(), se(d(De), {
2885
+ key: 0,
2886
+ size: 14
2887
+ })) : Z("", !0)
2888
+ ], 2),
2889
+ a("span", {
2890
+ class: g(["toggle-label", { light: h.value }])
2891
+ }, E(c.value.settings.blockPageInteractions), 3),
2892
+ O(Ue, {
2893
+ content: c.value.settings.blockInteractionsHelp
2894
+ }, {
2895
+ default: le(() => [
2896
+ O(d(ze), {
2897
+ size: Ve,
2898
+ style: q({ color: h.value ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.3)", cursor: "help", marginLeft: "2px" })
2899
+ }, null, 8, ["style"])
2900
+ ]),
2901
+ _: 1
2902
+ }, 8, ["content"])
2903
+ ]),
2904
+ a("label", Ga, [
2905
+ a("input", {
2906
+ class: "sr-only",
2907
+ type: "checkbox",
2908
+ checked: d(s).componentSourceEnabled,
2909
+ onChange: _[6] || (_[6] = (v) => d(s).componentSourceEnabled = v.target.checked)
2910
+ }, null, 40, Xa),
2911
+ a("span", {
2912
+ class: g(["checkbox", { checked: d(s).componentSourceEnabled, light: h.value }])
2913
+ }, [
2914
+ d(s).componentSourceEnabled ? (w(), se(d(De), {
2915
+ key: 0,
2916
+ size: 14
2917
+ })) : Z("", !0)
2918
+ ], 2),
2919
+ a("span", {
2920
+ class: g(["toggle-label", { light: h.value }])
2921
+ }, E(c.value.settings.componentSource), 3),
2922
+ O(Ue, {
2923
+ content: c.value.settings.componentSourceHelp
2924
+ }, {
2925
+ default: le(() => [
2926
+ O(d(ze), {
2927
+ size: Ve,
2928
+ style: q({ color: h.value ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.3)", cursor: "help", marginLeft: "2px" })
2929
+ }, null, 8, ["style"])
2930
+ ]),
2931
+ _: 1
2932
+ }, 8, ["content"])
2933
+ ])
2934
+ ]),
2935
+ a("div", qa, [
2936
+ a("button", {
2937
+ class: g(["nav-btn", { light: h.value }]),
2938
+ type: "button",
2939
+ onClick: Qt
2940
+ }, [
2941
+ a("span", Za, [
2942
+ O(d(dn), { size: 18 }),
2943
+ a("span", null, E(c.value.settings.manageMcpWebhooks), 1)
2944
+ ]),
2945
+ a("span", Qa, [
2946
+ a("span", {
2947
+ class: "nav-status-indicator",
2948
+ title: he.value ? c.value.settings.mcpStatusConnected : c.value.settings.mcpStatusDisconnected,
2949
+ "aria-label": he.value ? c.value.settings.mcpStatusConnected : c.value.settings.mcpStatusDisconnected
2950
+ }, [
2951
+ a("span", {
2952
+ class: g(["status-dot", he.value ? "connected" : "disconnected"])
2953
+ }, null, 2)
2954
+ ], 8, es),
2955
+ O(d(Et), { size: 16 })
2956
+ ])
2957
+ ], 2)
2958
+ ])
2959
+ ], 512),
2960
+ a("div", {
2961
+ ref_key: "copySettingsPageRef",
2962
+ ref: b,
2963
+ class: "settings-page"
2964
+ }, [
2965
+ a("div", {
2966
+ class: g(["settings-header automations-header", { light: h.value }])
2967
+ }, [
2968
+ a("button", {
2969
+ class: g(["back-btn", { light: h.value }]),
2970
+ type: "button",
2971
+ onClick: pt
2972
+ }, [
2973
+ O(d(St), { size: 16 }),
2974
+ a("span", null, E(c.value.settings.copySettings), 1)
2975
+ ], 2)
2976
+ ], 2),
2977
+ a("div", ts, [
2978
+ a("p", {
2979
+ class: g(["settings-description", { light: h.value }])
2980
+ }, E(c.value.settings.copySettingsDescription), 3)
2981
+ ]),
2982
+ a("div", os, [
2983
+ a("div", ns, [
2984
+ a("span", {
2985
+ class: g(["settings-label", { light: h.value }])
2986
+ }, E(c.value.settings.copyPrefix), 3)
2987
+ ]),
2988
+ a("p", {
2989
+ class: g(["settings-description", { light: h.value }])
2990
+ }, E(c.value.settings.copyPrefixDescription), 3),
2991
+ a("textarea", {
2992
+ class: g(["copy-prefix-input", { light: h.value }]),
2993
+ value: d(s).copyPrefix,
2994
+ placeholder: c.value.settings.copyPrefixPlaceholder,
2995
+ style: q({ borderColor: d(s).annotationColor }),
2996
+ rows: "3",
2997
+ spellcheck: "false",
2998
+ onInput: _[7] || (_[7] = (v) => d(s).copyPrefix = v.target.value)
2999
+ }, null, 46, as)
3000
+ ]),
3001
+ a("div", ss, [
3002
+ a("div", ls, [
3003
+ a("span", {
3004
+ class: g(["settings-label", { light: h.value }])
3005
+ }, E(c.value.settings.copyExclusions), 3)
3006
+ ]),
3007
+ a("p", {
3008
+ class: g(["settings-description", { light: h.value }])
3009
+ }, E(c.value.settings.copyExclusionsDescription), 3),
3010
+ a("div", rs, [
3011
+ (w(!0), $(ue, null, de(d(jt), (v) => (w(), $("label", {
3012
+ key: v,
3013
+ class: "toggle-row copy-field-row"
3014
+ }, [
3015
+ a("input", {
3016
+ class: "sr-only",
3017
+ type: "checkbox",
3018
+ checked: d(s).copyExcludeFields.includes(v),
3019
+ onChange: (pe) => to(v)
3020
+ }, null, 40, is),
3021
+ a("span", {
3022
+ class: g(["checkbox", { checked: d(s).copyExcludeFields.includes(v), light: h.value }])
3023
+ }, [
3024
+ d(s).copyExcludeFields.includes(v) ? (w(), se(d(De), {
3025
+ key: 0,
3026
+ size: 14
3027
+ })) : Z("", !0)
3028
+ ], 2),
3029
+ a("span", {
3030
+ class: g(["toggle-label", { light: h.value }])
3031
+ }, E(c.value.settings.copyFieldLabels[v]), 3)
3032
+ ]))), 128))
3033
+ ])
3034
+ ])
3035
+ ], 512),
3036
+ a("div", {
3037
+ ref_key: "automationsSettingsPageRef",
3038
+ ref: x,
3039
+ class: "settings-page"
3040
+ }, [
3041
+ a("div", {
3042
+ class: g(["settings-header automations-header", { light: h.value }])
3043
+ }, [
3044
+ a("button", {
3045
+ class: g(["back-btn", { light: h.value }]),
3046
+ type: "button",
3047
+ onClick: pt
3048
+ }, [
3049
+ O(d(St), { size: 16 }),
3050
+ a("span", null, E(c.value.settings.manageMcpWebhooks), 1)
3051
+ ], 2)
3052
+ ], 2),
3053
+ a("div", cs, [
3054
+ a("div", us, [
3055
+ a("span", {
3056
+ class: g(["settings-label", { light: h.value }])
3057
+ }, E(c.value.settings.mcpConnection), 3),
3058
+ a("span", {
3059
+ class: g(["mcp-status", { light: h.value }])
3060
+ }, [
3061
+ a("span", {
3062
+ class: g(["status-dot", he.value ? "connected" : "disconnected"])
3063
+ }, null, 2),
3064
+ Ke(" " + E(he.value ? c.value.settings.mcpStatusConnected : c.value.settings.mcpStatusDisconnected), 1)
3065
+ ], 2)
3066
+ ])
3067
+ ]),
3068
+ a("div", ds, [
3069
+ a("div", ps, [
3070
+ a("span", vs, [
3071
+ a("span", {
3072
+ class: g(["settings-label", { light: h.value }])
3073
+ }, E(c.value.settings.webhooks), 3),
3074
+ O(Ue, {
3075
+ content: c.value.settings.webhooksDescription
3076
+ }, {
3077
+ default: le(() => [
3078
+ O(d(ze), {
3079
+ size: Ve,
3080
+ style: q({ color: h.value ? "rgba(0,0,0,0.3)" : "rgba(255,255,255,0.3)", cursor: "help" })
3081
+ }, null, 8, ["style"])
3082
+ ]),
3083
+ _: 1
3084
+ }, 8, ["content"])
3085
+ ])
3086
+ ]),
3087
+ a("label", hs, [
3088
+ a("input", {
3089
+ class: "sr-only",
3090
+ type: "checkbox",
3091
+ checked: d(s).webhooksEnabled,
3092
+ onChange: _[8] || (_[8] = (v) => d(s).webhooksEnabled = v.target.checked)
3093
+ }, null, 40, gs),
3094
+ a("span", {
3095
+ class: g(["checkbox", { checked: d(s).webhooksEnabled, light: h.value }])
3096
+ }, [
3097
+ d(s).webhooksEnabled ? (w(), se(d(De), {
3098
+ key: 0,
3099
+ size: 14
3100
+ })) : Z("", !0)
3101
+ ], 2),
3102
+ a("span", {
3103
+ class: g(["toggle-label", { light: h.value }])
3104
+ }, E(c.value.settings.webhooksAutoSend), 3)
3105
+ ]),
3106
+ a("p", {
3107
+ class: g(["settings-description", { light: h.value }])
3108
+ }, E(c.value.settings.webhooksDescription), 3),
3109
+ a("textarea", {
3110
+ class: g(["webhook-url", { light: h.value }]),
3111
+ value: d(s).webhookUrl,
3112
+ placeholder: c.value.settings.webhooksUrlPlaceholder,
3113
+ style: q({ borderColor: d(s).annotationColor }),
3114
+ rows: "2",
3115
+ spellcheck: "false",
3116
+ onInput: _[9] || (_[9] = (v) => d(s).webhookUrl = v.target.value)
3117
+ }, null, 46, fs)
3118
+ ]),
3119
+ a("div", ms, [
3120
+ a("div", {
3121
+ class: g(["guide-card", { light: h.value }])
3122
+ }, [
3123
+ a("div", ys, E(c.value.settings.mcpConnection), 1),
3124
+ a("p", {
3125
+ class: g(["settings-description", { light: h.value }])
3126
+ }, E(c.value.settings.mcpDescription), 3)
3127
+ ], 2)
3128
+ ]),
3129
+ a("div", bs, [
3130
+ a("div", ks, [
3131
+ (w(!0), $(ue, null, de(me.value, (v) => (w(), $("div", {
3132
+ key: v.key,
3133
+ class: g(["guide-card", { light: h.value }])
3134
+ }, [
3135
+ a("div", ws, [
3136
+ a("div", Cs, E(v.label), 1),
3137
+ a("button", {
3138
+ class: g(["guide-copy-btn", { light: h.value }]),
3139
+ type: "button",
3140
+ title: c.value.settings.copyValueAria(v.label),
3141
+ "aria-label": c.value.settings.copyValueAria(v.label),
3142
+ "data-copied": N.value === v.key || void 0,
3143
+ onClick: (pe) => void tt(v.key, v.value)
3144
+ }, [
3145
+ O(d($e), {
3146
+ size: 16,
3147
+ copied: N.value === v.key
3148
+ }, null, 8, ["copied"])
3149
+ ], 10, xs)
3150
+ ]),
3151
+ a("pre", {
3152
+ class: g(["guide-code", { light: h.value }])
3153
+ }, E(v.value), 3)
3154
+ ], 2))), 128))
3155
+ ])
3156
+ ]),
3157
+ a("div", _s, [
3158
+ a("div", Ss, [
3159
+ (w(!0), $(ue, null, de(Oe.value, (v) => (w(), $("div", {
3160
+ key: v.key,
3161
+ class: g(["guide-card", { light: h.value }])
3162
+ }, [
3163
+ a("div", Es, [
3164
+ a("div", As, E(v.label), 1),
3165
+ a("button", {
3166
+ class: g(["guide-copy-btn", { light: h.value }]),
3167
+ type: "button",
3168
+ title: c.value.settings.copyValueAria(v.label),
3169
+ "aria-label": c.value.settings.copyValueAria(v.label),
3170
+ "data-copied": N.value === v.key || void 0,
3171
+ onClick: (pe) => void tt(v.key, v.value)
3172
+ }, [
3173
+ O(d($e), {
3174
+ size: 16,
3175
+ copied: N.value === v.key
3176
+ }, null, 8, ["copied"])
3177
+ ], 10, Ms)
3178
+ ]),
3179
+ a("pre", {
3180
+ class: g(["guide-code", { light: h.value }])
3181
+ }, E(v.value), 3)
3182
+ ], 2))), 128))
3183
+ ])
3184
+ ]),
3185
+ a("div", Ls, [
3186
+ a("div", {
3187
+ class: g(["guide-card", { light: h.value }])
3188
+ }, [
3189
+ a("div", Ts, [
3190
+ a("div", Ps, E(c.value.settings.webhookEnvLabel), 1),
3191
+ a("button", {
3192
+ class: g(["guide-copy-btn", { light: h.value }]),
3193
+ type: "button",
3194
+ title: c.value.settings.copyValueAria(c.value.settings.webhookEnvLabel),
3195
+ "aria-label": c.value.settings.copyValueAria(c.value.settings.webhookEnvLabel),
3196
+ "data-copied": N.value === "webhook-env" || void 0,
3197
+ onClick: _[10] || (_[10] = (v) => void tt("webhook-env", Y.value))
3198
+ }, [
3199
+ O(d($e), {
3200
+ size: 16,
3201
+ copied: N.value === "webhook-env"
3202
+ }, null, 8, ["copied"])
3203
+ ], 10, $s)
3204
+ ]),
3205
+ a("p", {
3206
+ class: g(["settings-description", { light: h.value }])
3207
+ }, E(c.value.settings.webhookDescriptionLong), 3),
3208
+ a("pre", {
3209
+ class: g(["guide-code", { light: h.value }])
3210
+ }, E(Y.value), 3)
3211
+ ], 2)
3212
+ ])
3213
+ ], 512)
3214
+ ], 4)
3215
+ ], 2)) : Z("", !0)
3216
+ ]),
3217
+ _: 1
3218
+ })
3219
+ ], 42, fa)
3220
+ ], 6));
3221
+ }
3222
+ }), Is = /* @__PURE__ */ xe(Ds, [["__scopeId", "data-v-43325b58"]]), Os = ["lang"], Fs = ["data-kind"], Hs = /* @__PURE__ */ Ce({
3223
+ __name: "OverlayRoot",
3224
+ props: {
3225
+ bridge: {},
3226
+ store: {},
3227
+ selection: {},
3228
+ settings: {},
3229
+ areaSelection: {}
3230
+ },
3231
+ setup(e) {
3232
+ const t = e, o = Yo(t.selection), n = t.settings, l = To(() => n.locale), i = en(), r = tn(t.store, n), s = K(null);
3233
+ fe(It, mo(t.bridge)), fe(Ge, t.store), fe(Xe, t.selection), fe(ct, t.areaSelection), fe(qe, o), fe(Ze, n), fe(Qe, l), fe(Ot, i), on({
3234
+ store: t.store,
3235
+ selection: t.selection,
3236
+ overlay: o,
3237
+ settings: n,
3238
+ exportActions: r,
3239
+ freezeState: i
3240
+ }), ke(() => {
3241
+ var u;
3242
+ t.bridge.overlayRoot.dataset.agentationRoot = "", t.store.hydrate(), (u = t.bridge.sync) == null || u.init();
3243
+ });
3244
+ let f = null, m = null, y = null;
3245
+ return ke(() => {
3246
+ var u, A, b;
3247
+ m = ((A = (u = t.bridge).subscribeNotifications) == null ? void 0 : A.call(u, (x) => {
3248
+ f && clearTimeout(f), s.value = {
3249
+ ...x,
3250
+ id: Date.now()
3251
+ }, f = Ee(() => {
3252
+ s.value = null, f = null;
3253
+ }, x.duration ?? 2600);
3254
+ })) ?? null, y = ((b = t.bridge.sync) == null ? void 0 : b.subscribe((x) => {
3255
+ var P, J, G, oe;
3256
+ if (x.type === "reconciled") {
3257
+ t.store.hydrate(), x.source === "remote" && x.annotationCount !== void 0 && ((J = (P = t.bridge).notify) == null || J.call(P, {
3258
+ kind: "info",
3259
+ duration: 2200,
3260
+ message: l.messages.notifications.remoteSyncUpdated(x.annotationCount)
3261
+ }));
3262
+ return;
3263
+ }
3264
+ x.type === "error" && x.message && ((oe = (G = t.bridge).notify) == null || oe.call(G, {
3265
+ kind: "warning",
3266
+ duration: 2600,
3267
+ message: l.messages.notifications.syncFailed(x.message)
3268
+ }));
3269
+ })) ?? null;
3270
+ }), Ae(() => {
3271
+ m == null || m(), y == null || y(), f && clearTimeout(f), delete t.bridge.overlayRoot.dataset.agentationRoot, i.cleanup();
3272
+ }), re(
3273
+ () => t.selection.selected,
3274
+ (u) => {
3275
+ u ? o.showPopover() : o.hidePopover();
3276
+ }
3277
+ ), re(
3278
+ () => n.darkMode,
3279
+ (u) => {
3280
+ t.bridge.overlayRoot.dataset.agTheme = u ? "dark" : "light";
3281
+ },
3282
+ { immediate: !0 }
3283
+ ), re(
3284
+ () => n.outputDetail,
3285
+ (u) => {
3286
+ t.bridge.options.outputDetail = u;
3287
+ },
3288
+ { immediate: !0 }
3289
+ ), re(
3290
+ () => l.locale,
3291
+ (u) => {
3292
+ t.bridge.overlayRoot.lang = u;
3293
+ },
3294
+ { immediate: !0 }
3295
+ ), (u, A) => (w(), $("div", {
3296
+ class: g(["agentation-root", { dark: d(n).darkMode, light: !d(n).darkMode }]),
3297
+ lang: d(l).locale,
3298
+ "data-agentation-root": ""
3299
+ }, [
3300
+ O(Is, { "export-actions": d(r) }, null, 8, ["export-actions"]),
3301
+ O(Un),
3302
+ O(be, { name: "toast" }, {
3303
+ default: le(() => [
3304
+ s.value ? (w(), $("div", {
3305
+ key: 0,
3306
+ class: "toast",
3307
+ "data-kind": s.value.kind ?? "info",
3308
+ role: "status",
3309
+ "aria-live": "polite"
3310
+ }, E(s.value.message), 9, Fs)) : Z("", !0)
3311
+ ]),
3312
+ _: 1
3313
+ }),
3314
+ (w(), se(Tt, {
3315
+ to: e.bridge.overlayRoot
3316
+ }, [
3317
+ O(Jn),
3318
+ O(Wn),
3319
+ O(sa)
3320
+ ], 8, ["to"]))
3321
+ ], 10, Os));
3322
+ }
3323
+ }), Bs = /* @__PURE__ */ xe(Hs, [["__scopeId", "data-v-8eebc944"]]);
3324
+ export {
3325
+ Ge as ANNOTATIONS_STORE_KEY,
3326
+ ct as AREA_SELECTION_KEY,
3327
+ Je as DEFAULT_LOCALE,
3328
+ Qe as I18N_KEY,
3329
+ Eo as LOCALE_LABELS,
3330
+ qe as OVERLAY_KEY,
3331
+ Bs as OverlayRoot,
3332
+ It as RUNTIME_BRIDGE_KEY,
3333
+ Xe as SELECTION_KEY,
3334
+ Ze as SETTINGS_KEY,
3335
+ Ft as SUPPORTED_LOCALES,
3336
+ Ns as createAnnotationsStore,
3337
+ Us as createAreaSelectionState,
3338
+ tn as createExportActions,
3339
+ To as createI18nState,
3340
+ Yo as createOverlayState,
3341
+ js as createSelectionState,
3342
+ Vs as createSettingsState,
3343
+ ut as isValidLocale,
3344
+ Lo as resolveMessages,
3345
+ on as useKeyboardShortcuts
3346
+ };
3347
+ import "./index.css"
3348
+ //# sourceMappingURL=index.js.map