@thehammer/template-verification 0.2.4 → 0.2.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.
- package/dist/context.d.ts +11 -0
- package/dist/lib/hostBridge.d.ts +25 -0
- package/dist/style.css +1 -1
- package/dist/template-verification.js +626 -573
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { DanxChip as
|
|
3
|
-
const z = "tv-chrome",
|
|
4
|
-
let
|
|
5
|
-
function
|
|
1
|
+
import { ref as N, watch as re, defineComponent as Q, computed as d, openBlock as n, createElementBlock as o, normalizeClass as R, createElementVNode as s, toDisplayString as m, createCommentVNode as b, createBlock as A, unref as r, withCtx as O, createTextVNode as I, createVNode as V, onBeforeUnmount as Le, Fragment as j, renderList as F, withKeys as ze, withModifiers as le, renderSlot as Me, withDirectives as Pe, isRef as we, vModelCheckbox as Be } from "vue";
|
|
2
|
+
import { DanxChip as H, CodeViewer as _e, useToast as Ve, DanxDialog as ce, DanxTooltip as ve, DanxProgressBar as De, DanxAlert as ke, DanxTabs as Fe, MarkdownEditor as qe, DanxFileViewer as $e, DanxButton as de, DanxInput as Ye, DanxSkeleton as Oe, DanxIcon as He, gearIcon as Je, DanxBadge as Ke, DanxToastContainer as Ge } from "@thehammer/danx-ui";
|
|
3
|
+
const z = "tv-chrome", Ie = "template-verification:enabled";
|
|
4
|
+
let se = null;
|
|
5
|
+
function Qe(e) {
|
|
6
6
|
var t;
|
|
7
7
|
try {
|
|
8
8
|
return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(e)) ?? null;
|
|
@@ -10,185 +10,187 @@ function Je(e) {
|
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function We(e, t) {
|
|
14
14
|
var a;
|
|
15
15
|
try {
|
|
16
16
|
(a = globalThis.localStorage) == null || a.setItem(e, t);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
20
|
+
function Xe(e) {
|
|
21
|
+
const t = Qe(Ie);
|
|
22
22
|
return t === null ? e : t === "true";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const t =
|
|
26
|
-
return
|
|
24
|
+
function Te(e) {
|
|
25
|
+
const t = N(Xe((e == null ? void 0 : e.defaultEnabled) ?? !1));
|
|
26
|
+
return re(
|
|
27
27
|
t,
|
|
28
|
-
(a) =>
|
|
28
|
+
(a) => We(Ie, a ? "true" : "false")
|
|
29
29
|
), {
|
|
30
30
|
enabled: t,
|
|
31
31
|
data: (e == null ? void 0 : e.data) ?? {},
|
|
32
32
|
saveOverride: e == null ? void 0 : e.saveOverride,
|
|
33
33
|
workflowInputId: e == null ? void 0 : e.workflowInputId,
|
|
34
34
|
auditUrl: e == null ? void 0 : e.auditUrl,
|
|
35
|
-
|
|
35
|
+
loading: (e == null ? void 0 : e.loading) ?? !1,
|
|
36
|
+
comparisonOpen: N(!1)
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
39
|
+
function Ae() {
|
|
40
|
+
return se || (se = Te()), se;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
42
|
+
function Ca(e) {
|
|
43
|
+
se = Te(e);
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
const e =
|
|
45
|
+
function oe() {
|
|
46
|
+
const e = Ae();
|
|
46
47
|
return {
|
|
47
48
|
enabled: e.enabled,
|
|
48
49
|
data: e.data,
|
|
49
50
|
saveOverride: e.saveOverride,
|
|
50
51
|
workflowInputId: e.workflowInputId,
|
|
51
52
|
auditUrl: e.auditUrl,
|
|
53
|
+
loading: e.loading,
|
|
52
54
|
openComparison: () => {
|
|
53
55
|
e.comparisonOpen.value = !0;
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
59
|
+
function Ze() {
|
|
60
|
+
return Ae().comparisonOpen;
|
|
59
61
|
}
|
|
60
|
-
function
|
|
62
|
+
function xe(e) {
|
|
61
63
|
return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
|
|
62
64
|
}
|
|
63
|
-
const
|
|
65
|
+
const et = {
|
|
64
66
|
high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
|
|
65
67
|
medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
|
|
66
68
|
low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
|
|
67
69
|
unverifiable: "bg-gray-50 text-gray-500 ring-1 ring-inset ring-gray-400/20"
|
|
68
|
-
},
|
|
70
|
+
}, ie = {
|
|
69
71
|
high: "High",
|
|
70
72
|
medium: "Medium",
|
|
71
73
|
low: "Low",
|
|
72
74
|
unverifiable: "Unverifiable"
|
|
73
|
-
},
|
|
74
|
-
function
|
|
75
|
-
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved :
|
|
75
|
+
}, Ue = ["override", "extracted", "claim"];
|
|
76
|
+
function ye(e) {
|
|
77
|
+
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : tt(e.candidates) : { value: null, source: "none" };
|
|
76
78
|
}
|
|
77
|
-
function
|
|
79
|
+
function tt(e) {
|
|
78
80
|
if (e)
|
|
79
|
-
for (const t of
|
|
81
|
+
for (const t of Ue) {
|
|
80
82
|
const a = e[t];
|
|
81
83
|
if (a != null)
|
|
82
84
|
return { value: a.value, source: t };
|
|
83
85
|
}
|
|
84
86
|
return { value: null, source: "none" };
|
|
85
87
|
}
|
|
86
|
-
function
|
|
87
|
-
var g,
|
|
88
|
-
const t = (
|
|
88
|
+
function fe(e) {
|
|
89
|
+
var g, x;
|
|
90
|
+
const t = (x = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : x.reasoning;
|
|
89
91
|
if (t == null) return null;
|
|
90
92
|
const a = String(t).trim();
|
|
91
93
|
return a === "" ? null : a;
|
|
92
94
|
}
|
|
93
|
-
function
|
|
94
|
-
var g,
|
|
95
|
-
const t = (
|
|
95
|
+
function pe(e) {
|
|
96
|
+
var g, x;
|
|
97
|
+
const t = (x = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : x.cited_text;
|
|
96
98
|
if (t == null) return null;
|
|
97
99
|
const a = String(t).trim();
|
|
98
100
|
return a === "" ? null : a;
|
|
99
101
|
}
|
|
100
|
-
function
|
|
101
|
-
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy :
|
|
102
|
+
function Ne(e) {
|
|
103
|
+
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : at(e.candidates) : !1;
|
|
102
104
|
}
|
|
103
|
-
function
|
|
105
|
+
function at(e) {
|
|
104
106
|
if (!e) return !1;
|
|
105
|
-
const t =
|
|
107
|
+
const t = Ue.map((a) => e[a]).filter((a) => a != null).map((a) => nt(a.value));
|
|
106
108
|
return t.length < 2 ? !1 : new Set(t).size > 1;
|
|
107
109
|
}
|
|
108
|
-
function
|
|
110
|
+
function nt(e) {
|
|
109
111
|
return JSON.stringify(e ?? null);
|
|
110
112
|
}
|
|
111
|
-
const
|
|
112
|
-
function
|
|
113
|
+
const lt = /* @__PURE__ */ new Set(["name", "type"]);
|
|
114
|
+
function Re(e, t = "") {
|
|
113
115
|
const a = [];
|
|
114
|
-
return
|
|
116
|
+
return me(e, t, a), a;
|
|
115
117
|
}
|
|
116
|
-
function
|
|
118
|
+
function me(e, t, a) {
|
|
117
119
|
if (Array.isArray(e)) {
|
|
118
|
-
e.forEach((
|
|
120
|
+
e.forEach((u, c) => me(u, `${t}[${c}]`, a));
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
|
-
if (!
|
|
122
|
-
const
|
|
123
|
-
for (const [
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
if (Array.isArray(
|
|
127
|
-
|
|
123
|
+
if (!Se(e)) return;
|
|
124
|
+
const x = e.__meta ?? {};
|
|
125
|
+
for (const [u, c] of Object.entries(e)) {
|
|
126
|
+
if (u === "__meta") continue;
|
|
127
|
+
const l = t ? `${t}.${u}` : u;
|
|
128
|
+
if (Array.isArray(c) || Se(c)) {
|
|
129
|
+
me(c, l, a);
|
|
128
130
|
continue;
|
|
129
131
|
}
|
|
130
|
-
const h =
|
|
131
|
-
!h &&
|
|
132
|
-
path:
|
|
133
|
-
label:
|
|
132
|
+
const h = x[u];
|
|
133
|
+
!h && lt.has(u) || a.push({
|
|
134
|
+
path: l,
|
|
135
|
+
label: u,
|
|
134
136
|
meta: h ?? null,
|
|
135
|
-
value:
|
|
137
|
+
value: c,
|
|
136
138
|
unanchored: !h
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
|
-
function
|
|
142
|
+
function Se(e) {
|
|
141
143
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
142
144
|
}
|
|
143
|
-
function
|
|
145
|
+
function je(e) {
|
|
144
146
|
var a;
|
|
145
147
|
if (e.candidates.override) return !1;
|
|
146
148
|
const t = (a = e.candidates.extracted) == null ? void 0 : a.confidence;
|
|
147
149
|
return e.discrepancy || t == null || t <= 2;
|
|
148
150
|
}
|
|
149
|
-
function
|
|
150
|
-
const t =
|
|
151
|
-
(
|
|
151
|
+
function st(e) {
|
|
152
|
+
const t = Re(e).filter(
|
|
153
|
+
(u) => u.meta !== null
|
|
152
154
|
), a = t.length;
|
|
153
|
-
let g = 0,
|
|
154
|
-
for (const
|
|
155
|
-
if (
|
|
155
|
+
let g = 0, x = 0;
|
|
156
|
+
for (const u of t) {
|
|
157
|
+
if (u.meta.candidates.override) {
|
|
156
158
|
g++;
|
|
157
159
|
continue;
|
|
158
160
|
}
|
|
159
|
-
|
|
161
|
+
je(u.meta) && x++;
|
|
160
162
|
}
|
|
161
163
|
return {
|
|
162
164
|
total: a,
|
|
163
165
|
verified: g,
|
|
164
|
-
needsReview:
|
|
166
|
+
needsReview: x,
|
|
165
167
|
percent: a === 0 ? 100 : Math.round(g / a * 100)
|
|
166
168
|
};
|
|
167
169
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
const g = (
|
|
170
|
+
function rt(e, t, a) {
|
|
171
|
+
var u;
|
|
172
|
+
const g = (u = t.value) == null ? void 0 : u.anchor;
|
|
171
173
|
if (!e.saveOverride || !g) return null;
|
|
172
|
-
const
|
|
173
|
-
return async (
|
|
174
|
-
const h = await
|
|
174
|
+
const x = e.saveOverride;
|
|
175
|
+
return async (c, l) => {
|
|
176
|
+
const h = await x({
|
|
175
177
|
workflow_input_id: e.workflowInputId,
|
|
176
178
|
object_ids: g.object_ids,
|
|
177
179
|
field: g.field,
|
|
178
180
|
field_path: g.field_path,
|
|
179
|
-
value:
|
|
180
|
-
source_choice:
|
|
181
|
+
value: c,
|
|
182
|
+
source_choice: l
|
|
181
183
|
});
|
|
182
184
|
return a(h), h;
|
|
183
185
|
};
|
|
184
186
|
}
|
|
185
|
-
const
|
|
187
|
+
const it = ["data-status", "title"], ot = {
|
|
186
188
|
class: "tv-confidence-glyph",
|
|
187
189
|
"aria-hidden": "true"
|
|
188
|
-
},
|
|
190
|
+
}, ut = {
|
|
189
191
|
key: 0,
|
|
190
192
|
class: "tv-confidence-label"
|
|
191
|
-
},
|
|
193
|
+
}, ge = /* @__PURE__ */ Q({
|
|
192
194
|
__name: "ConfidenceIcon",
|
|
193
195
|
props: {
|
|
194
196
|
confidence: {},
|
|
@@ -197,7 +199,7 @@ const lt = ["data-status", "title"], nt = {
|
|
|
197
199
|
},
|
|
198
200
|
setup(e) {
|
|
199
201
|
const t = e, a = d(
|
|
200
|
-
() => t.status ??
|
|
202
|
+
() => t.status ?? xe(t.confidence)
|
|
201
203
|
), g = {
|
|
202
204
|
high: "✔",
|
|
203
205
|
// check
|
|
@@ -206,150 +208,156 @@ const lt = ["data-status", "title"], nt = {
|
|
|
206
208
|
low: "✕",
|
|
207
209
|
// x
|
|
208
210
|
unverifiable: "?"
|
|
209
|
-
},
|
|
210
|
-
return (
|
|
211
|
-
class: R(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none",
|
|
211
|
+
}, x = d(() => g[a.value]), u = d(() => et[a.value]), c = d(() => ie[a.value]);
|
|
212
|
+
return (l, h) => (n(), o("span", {
|
|
213
|
+
class: R(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", u.value]),
|
|
212
214
|
"data-status": a.value,
|
|
213
|
-
title:
|
|
215
|
+
title: c.value
|
|
214
216
|
}, [
|
|
215
|
-
|
|
216
|
-
e.showLabel ? (
|
|
217
|
-
], 10,
|
|
217
|
+
s("span", ot, m(x.value), 1),
|
|
218
|
+
e.showLabel ? (n(), o("span", ut, m(c.value), 1)) : b("", !0)
|
|
219
|
+
], 10, it));
|
|
218
220
|
}
|
|
219
221
|
});
|
|
220
|
-
async function
|
|
222
|
+
async function dt(e, t) {
|
|
221
223
|
const a = t.object_ids.at(-1), g = new URLSearchParams({
|
|
222
224
|
object_id: String(a),
|
|
223
225
|
field: t.field
|
|
224
|
-
}),
|
|
225
|
-
if (!
|
|
226
|
+
}), x = e.includes("?") ? "&" : "?", u = await fetch(`${e}${x}${g}`);
|
|
227
|
+
if (!u.ok)
|
|
226
228
|
throw new Error(
|
|
227
|
-
`data-point-audit ${
|
|
229
|
+
`data-point-audit ${u.status}: ${await u.text()}`
|
|
228
230
|
);
|
|
229
|
-
return (await
|
|
231
|
+
return (await u.json()).data ?? [];
|
|
230
232
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
233
|
+
function Ce(e) {
|
|
234
|
+
typeof window > "u" || !window.top || window.top === window || window.top.postMessage(
|
|
235
|
+
{ source: "danxbot-template", type: "nested-viewer-active", active: e },
|
|
236
|
+
"*"
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
function Ee(e) {
|
|
240
|
+
var a, g, x;
|
|
233
241
|
if (!e || e.length === 0) return [];
|
|
234
242
|
const t = /* @__PURE__ */ new Map();
|
|
235
|
-
for (const
|
|
236
|
-
const
|
|
237
|
-
let
|
|
238
|
-
|
|
239
|
-
fileLabel:
|
|
240
|
-
fileUrl:
|
|
241
|
-
file:
|
|
243
|
+
for (const u of e) {
|
|
244
|
+
const c = ct(u);
|
|
245
|
+
let l = t.get(c);
|
|
246
|
+
l || (l = {
|
|
247
|
+
fileLabel: vt(u),
|
|
248
|
+
fileUrl: u.file_url ?? ((a = u.file) == null ? void 0 : a.url),
|
|
249
|
+
file: u.file,
|
|
242
250
|
sources: []
|
|
243
|
-
}, t.set(
|
|
251
|
+
}, t.set(c, l)), !l.fileUrl && (u.file_url ?? ((g = u.file) == null ? void 0 : g.url)) && (l.fileUrl = u.file_url ?? ((x = u.file) == null ? void 0 : x.url)), !l.file && u.file && (l.file = u.file), l.sources.push(u);
|
|
244
252
|
}
|
|
245
253
|
return [...t.values()];
|
|
246
254
|
}
|
|
247
|
-
function
|
|
255
|
+
function ct(e) {
|
|
248
256
|
const t = e.file_name ?? e.file_id ?? e.stored_file_id ?? e.source_id ?? e.id;
|
|
249
257
|
return t != null ? String(t) : "__unknown__";
|
|
250
258
|
}
|
|
251
|
-
function
|
|
259
|
+
function vt(e) {
|
|
252
260
|
var t;
|
|
253
261
|
return (t = e.file) != null && t.name ? e.file.name : e.file_name ? e.file_name : e.file_id !== void 0 && e.file_id !== null ? `File ${e.file_id}` : e.stored_file_id !== void 0 && e.stored_file_id !== null ? `File ${e.stored_file_id}` : e.source_type ? e.source_type : "Source";
|
|
254
262
|
}
|
|
255
|
-
function
|
|
263
|
+
function ft(e) {
|
|
256
264
|
const t = e.page ?? e.page_number;
|
|
257
265
|
return t != null ? `Page ${t}` : e.explanation ? String(e.explanation) : e.source_type ? String(e.source_type) : "Citation";
|
|
258
266
|
}
|
|
259
|
-
const
|
|
267
|
+
const pt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" }, mt = { class: "tv-audit-call-header flex flex-wrap items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2" }, gt = {
|
|
260
268
|
key: 3,
|
|
261
269
|
class: "font-mono text-[11px] text-gray-400"
|
|
262
|
-
},
|
|
270
|
+
}, xt = {
|
|
263
271
|
key: 4,
|
|
264
272
|
class: "text-[11px] font-medium text-gray-500"
|
|
265
|
-
},
|
|
273
|
+
}, yt = {
|
|
266
274
|
key: 5,
|
|
267
275
|
class: "text-[11px] text-gray-400"
|
|
268
|
-
},
|
|
276
|
+
}, bt = { class: "tv-audit-call-body flex flex-col gap-2 p-3" }, ht = /* @__PURE__ */ Q({
|
|
269
277
|
__name: "AuditCallCard",
|
|
270
278
|
props: {
|
|
271
279
|
call: {}
|
|
272
280
|
},
|
|
273
281
|
setup(e) {
|
|
274
282
|
const t = e, a = d(() => {
|
|
275
|
-
const
|
|
276
|
-
return
|
|
283
|
+
const l = t.call.status_code;
|
|
284
|
+
return l == null ? "muted" : l >= 200 && l < 300 ? "success" : l >= 400 ? "danger" : "warning";
|
|
277
285
|
}), g = d(() => {
|
|
278
|
-
const
|
|
279
|
-
return
|
|
280
|
-
}),
|
|
286
|
+
const l = t.call.run_time_ms;
|
|
287
|
+
return l == null ? null : l >= 1e3 ? `${(l / 1e3).toFixed(1)}s` : `${l}ms`;
|
|
288
|
+
}), x = d(() => {
|
|
281
289
|
if (!t.call.started_at) return null;
|
|
282
|
-
const
|
|
283
|
-
return Number.isNaN(
|
|
284
|
-
}),
|
|
290
|
+
const l = new Date(t.call.started_at);
|
|
291
|
+
return Number.isNaN(l.getTime()) ? t.call.started_at : l.toLocaleString();
|
|
292
|
+
}), u = d(
|
|
285
293
|
() => JSON.stringify(t.call.request ?? null, null, 2)
|
|
286
|
-
),
|
|
294
|
+
), c = d(
|
|
287
295
|
() => JSON.stringify(t.call.response ?? null, null, 2)
|
|
288
296
|
);
|
|
289
|
-
return (
|
|
290
|
-
|
|
291
|
-
e.call.stage ? (
|
|
297
|
+
return (l, h) => (n(), o("div", pt, [
|
|
298
|
+
s("div", mt, [
|
|
299
|
+
e.call.stage ? (n(), A(r(H), {
|
|
292
300
|
key: 0,
|
|
293
301
|
variant: "muted",
|
|
294
302
|
size: "xxs",
|
|
295
303
|
class: "tv-audit-stage"
|
|
296
304
|
}, {
|
|
297
|
-
default:
|
|
298
|
-
|
|
305
|
+
default: O(() => [
|
|
306
|
+
I(m(e.call.stage), 1)
|
|
299
307
|
]),
|
|
300
308
|
_: 1
|
|
301
309
|
})) : b("", !0),
|
|
302
|
-
e.call.model ? (
|
|
310
|
+
e.call.model ? (n(), A(r(H), {
|
|
303
311
|
key: 1,
|
|
304
312
|
variant: "info",
|
|
305
313
|
size: "xs",
|
|
306
314
|
class: "tv-audit-model"
|
|
307
315
|
}, {
|
|
308
|
-
default:
|
|
309
|
-
|
|
316
|
+
default: O(() => [
|
|
317
|
+
I(m(e.call.model), 1)
|
|
310
318
|
]),
|
|
311
319
|
_: 1
|
|
312
320
|
})) : b("", !0),
|
|
313
|
-
e.call.service ? (
|
|
321
|
+
e.call.service ? (n(), A(r(H), {
|
|
314
322
|
key: 2,
|
|
315
323
|
variant: "muted",
|
|
316
324
|
size: "xxs"
|
|
317
325
|
}, {
|
|
318
|
-
default:
|
|
319
|
-
|
|
326
|
+
default: O(() => [
|
|
327
|
+
I(m(e.call.service), 1)
|
|
320
328
|
]),
|
|
321
329
|
_: 1
|
|
322
330
|
})) : b("", !0),
|
|
323
|
-
e.call.endpoint ? (
|
|
324
|
-
h[0] || (h[0] =
|
|
325
|
-
|
|
331
|
+
e.call.endpoint ? (n(), o("span", gt, m(e.call.endpoint), 1)) : b("", !0),
|
|
332
|
+
h[0] || (h[0] = s("span", { class: "flex-1" }, null, -1)),
|
|
333
|
+
V(r(H), {
|
|
326
334
|
variant: a.value,
|
|
327
335
|
size: "xxs",
|
|
328
336
|
class: "tv-audit-status"
|
|
329
337
|
}, {
|
|
330
|
-
default:
|
|
331
|
-
|
|
338
|
+
default: O(() => [
|
|
339
|
+
I(m(e.call.status_code ?? "…"), 1)
|
|
332
340
|
]),
|
|
333
341
|
_: 1
|
|
334
342
|
}, 8, ["variant"]),
|
|
335
|
-
g.value ? (
|
|
336
|
-
|
|
343
|
+
g.value ? (n(), o("span", xt, m(g.value), 1)) : b("", !0),
|
|
344
|
+
x.value ? (n(), o("span", yt, m(x.value), 1)) : b("", !0)
|
|
337
345
|
]),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
h[1] || (h[1] =
|
|
341
|
-
|
|
342
|
-
"model-value":
|
|
346
|
+
s("div", bt, [
|
|
347
|
+
s("div", null, [
|
|
348
|
+
h[1] || (h[1] = s("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Request ", -1)),
|
|
349
|
+
V(r(_e), {
|
|
350
|
+
"model-value": u.value,
|
|
343
351
|
format: "json",
|
|
344
352
|
collapsible: "",
|
|
345
353
|
"default-collapsed": "",
|
|
346
354
|
class: "tv-audit-request"
|
|
347
355
|
}, null, 8, ["model-value"])
|
|
348
356
|
]),
|
|
349
|
-
|
|
350
|
-
h[2] || (h[2] =
|
|
351
|
-
|
|
352
|
-
"model-value":
|
|
357
|
+
s("div", null, [
|
|
358
|
+
h[2] || (h[2] = s("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Response ", -1)),
|
|
359
|
+
V(r(_e), {
|
|
360
|
+
"model-value": c.value,
|
|
353
361
|
format: "json",
|
|
354
362
|
collapsible: "",
|
|
355
363
|
"default-collapsed": "",
|
|
@@ -359,46 +367,46 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
359
367
|
])
|
|
360
368
|
]));
|
|
361
369
|
}
|
|
362
|
-
}),
|
|
370
|
+
}), wt = { class: "tv-modal flex h-full flex-col gap-4 overflow-y-auto p-1" }, _t = { class: "tv-modal-resolved flex flex-col gap-3 rounded-xl border border-gray-200 bg-gradient-to-br from-gray-50 to-white p-4 shadow-sm" }, kt = { class: "flex flex-wrap items-start justify-between gap-4" }, $t = { class: "min-w-0 flex-1" }, St = { class: "tv-resolved-value mt-1 break-words font-mono text-xl font-semibold leading-snug text-gray-900" }, Ct = { class: "mt-1 text-[11px] text-gray-400" }, Vt = { class: "tv-resolved-source font-medium text-gray-500" }, Dt = { class: "tv-confidence-meter w-56 shrink-0" }, Ot = { class: "mt-2" }, It = {
|
|
363
371
|
key: 1,
|
|
364
372
|
class: "tv-confidence-value text-sm text-gray-400"
|
|
365
|
-
},
|
|
373
|
+
}, Tt = {
|
|
366
374
|
key: 0,
|
|
367
375
|
class: "tv-tab-evidence flex min-h-0 flex-1 flex-col gap-4"
|
|
368
|
-
},
|
|
376
|
+
}, At = {
|
|
369
377
|
key: 0,
|
|
370
378
|
class: "tv-reasoning-card rounded-lg border border-gray-200 p-3"
|
|
371
|
-
},
|
|
379
|
+
}, Ut = {
|
|
372
380
|
key: 1,
|
|
373
|
-
class: "tv-cited-
|
|
374
|
-
},
|
|
381
|
+
class: "tv-cited-block"
|
|
382
|
+
}, Nt = { class: "tv-cited-text rounded-lg border-l-4 border-blue-200 bg-blue-50/50 px-4 py-3 text-sm italic leading-relaxed text-gray-700" }, Rt = {
|
|
375
383
|
key: 2,
|
|
376
384
|
class: "tv-evidence-viewer flex min-h-[24rem] flex-1 flex-col overflow-hidden rounded-lg border border-gray-200"
|
|
377
|
-
},
|
|
385
|
+
}, jt = { class: "tv-page-count flex items-center justify-between border-b border-gray-100 bg-gray-50 px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, Et = { class: "tv-page-count-value normal-case text-gray-500" }, Lt = {
|
|
378
386
|
key: 0,
|
|
379
387
|
class: "tv-page-context border-t border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500"
|
|
380
|
-
},
|
|
388
|
+
}, zt = {
|
|
381
389
|
key: 3,
|
|
382
390
|
class: "tv-no-source rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
383
|
-
},
|
|
391
|
+
}, Mt = {
|
|
384
392
|
key: 4,
|
|
385
393
|
class: "tv-full-documents flex flex-wrap items-center gap-2"
|
|
386
|
-
},
|
|
394
|
+
}, Pt = {
|
|
387
395
|
key: 1,
|
|
388
396
|
class: "tv-tab-candidates flex flex-col gap-3"
|
|
389
|
-
},
|
|
397
|
+
}, Bt = { class: "flex flex-wrap items-center justify-between gap-3" }, Ft = { class: "min-w-0 flex-1" }, qt = { class: "flex items-center gap-2" }, Yt = { class: "mt-2 break-words font-mono text-base text-gray-900" }, Ht = { class: "mt-1 text-xs text-gray-400" }, Jt = {
|
|
390
398
|
key: 0,
|
|
391
399
|
class: "tv-custom-entry flex items-center gap-2 rounded-lg border border-dashed border-gray-300 p-4"
|
|
392
|
-
},
|
|
400
|
+
}, Kt = {
|
|
393
401
|
key: 1,
|
|
394
402
|
class: "tv-read-only text-center text-xs text-gray-400"
|
|
395
|
-
},
|
|
403
|
+
}, Gt = {
|
|
396
404
|
key: 2,
|
|
397
405
|
class: "tv-tab-audit flex flex-col gap-3"
|
|
398
|
-
},
|
|
406
|
+
}, Qt = {
|
|
399
407
|
key: 2,
|
|
400
408
|
class: "tv-audit-empty rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
401
|
-
},
|
|
409
|
+
}, Wt = /* @__PURE__ */ Q({
|
|
402
410
|
__name: "VerificationModal",
|
|
403
411
|
props: {
|
|
404
412
|
modelValue: { type: Boolean },
|
|
@@ -408,353 +416,388 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
408
416
|
},
|
|
409
417
|
emits: ["update:modelValue", "saved"],
|
|
410
418
|
setup(e, { emit: t }) {
|
|
411
|
-
const a = e, g = t,
|
|
419
|
+
const a = e, g = t, x = oe(), u = Ve(), c = d({
|
|
412
420
|
get: () => a.modelValue,
|
|
413
421
|
set: (v) => g("update:modelValue", v)
|
|
414
|
-
}),
|
|
422
|
+
}), l = d(() => ye(a.meta)), h = d(() => a.meta.candidates.extracted), k = d(() => a.meta.candidates.claim), w = d(() => a.meta.candidates.override), y = d(() => {
|
|
415
423
|
var v;
|
|
416
424
|
return ((v = h.value) == null ? void 0 : v.confidence) ?? null;
|
|
417
|
-
}),
|
|
425
|
+
}), $ = d(() => xe(y.value)), S = d(() => fe(a.meta)), U = d(() => pe(a.meta)), T = d(() => {
|
|
418
426
|
var v;
|
|
419
|
-
return
|
|
420
|
-
}),
|
|
421
|
-
(
|
|
422
|
-
).join(" › ")),
|
|
427
|
+
return Ee((v = h.value) == null ? void 0 : v.sources);
|
|
428
|
+
}), q = d(() => (a.meta.anchor.field_path || a.label || "Data point").split(".").map(
|
|
429
|
+
(i) => i.replace(/\[\d+\]/g, "").replace(/_/g, " ").replace(/^\w/, (C) => C.toUpperCase())
|
|
430
|
+
).join(" › ")), Z = {
|
|
423
431
|
high: "success",
|
|
424
432
|
medium: "warning",
|
|
425
433
|
low: "danger",
|
|
426
434
|
unverifiable: "muted"
|
|
427
|
-
},
|
|
428
|
-
var
|
|
435
|
+
}, M = N("evidence"), J = d(() => !!x.auditUrl), ee = d(() => {
|
|
436
|
+
var i;
|
|
429
437
|
const v = [
|
|
430
438
|
{
|
|
431
439
|
value: "evidence",
|
|
432
440
|
label: "Evidence",
|
|
433
|
-
count:
|
|
441
|
+
count: T.value.reduce((C, f) => C + f.sources.length, 0)
|
|
434
442
|
},
|
|
435
443
|
{
|
|
436
444
|
value: "candidates",
|
|
437
445
|
label: "Candidates",
|
|
438
|
-
count:
|
|
446
|
+
count: D.value.length
|
|
439
447
|
}
|
|
440
448
|
];
|
|
441
|
-
return
|
|
449
|
+
return J.value && v.push({
|
|
442
450
|
value: "audit",
|
|
443
451
|
label: "Audit trail",
|
|
444
|
-
count: ((
|
|
452
|
+
count: ((i = Y.value) == null ? void 0 : i.length) ?? void 0
|
|
445
453
|
}), v;
|
|
446
|
-
}),
|
|
447
|
-
() =>
|
|
448
|
-
),
|
|
449
|
-
const v =
|
|
454
|
+
}), E = d(
|
|
455
|
+
() => T.value.map((v) => v.file).filter((v) => !!v)
|
|
456
|
+
), K = N(null), W = d(() => {
|
|
457
|
+
const v = K.value ?? E.value[0];
|
|
450
458
|
if (!v) return null;
|
|
451
|
-
const
|
|
452
|
-
(
|
|
459
|
+
const i = T.value.find(
|
|
460
|
+
(f) => f.file && String(f.file.id) === String(v.id)
|
|
453
461
|
);
|
|
454
|
-
if (!
|
|
455
|
-
const C =
|
|
462
|
+
if (!i) return null;
|
|
463
|
+
const C = i.sources.find((f) => f.explanation);
|
|
456
464
|
return (C == null ? void 0 : C.explanation) ?? null;
|
|
457
|
-
}),
|
|
465
|
+
}), X = d(() => {
|
|
458
466
|
const v = /* @__PURE__ */ new Map();
|
|
459
|
-
for (const
|
|
460
|
-
for (const C of
|
|
461
|
-
const
|
|
462
|
-
|
|
467
|
+
for (const i of T.value)
|
|
468
|
+
for (const C of i.sources) {
|
|
469
|
+
const f = C.original_file;
|
|
470
|
+
f && !v.has(String(f.id)) && v.set(String(f.id), f);
|
|
463
471
|
}
|
|
464
472
|
return [...v.values()];
|
|
465
|
-
}),
|
|
466
|
-
get: () =>
|
|
473
|
+
}), P = N(null), p = d({
|
|
474
|
+
get: () => P.value !== null,
|
|
467
475
|
set: (v) => {
|
|
468
|
-
v || (
|
|
476
|
+
v || (P.value = null);
|
|
469
477
|
}
|
|
470
|
-
}),
|
|
478
|
+
}), _ = d(() => c.value || p.value);
|
|
479
|
+
re(
|
|
480
|
+
_,
|
|
481
|
+
(v) => Ce(v),
|
|
482
|
+
{ immediate: !0 }
|
|
483
|
+
), Le(() => Ce(!1));
|
|
484
|
+
const D = d(() => {
|
|
471
485
|
const v = [];
|
|
472
|
-
return
|
|
486
|
+
return w.value && v.push({
|
|
473
487
|
key: "override",
|
|
474
488
|
title: "Human override",
|
|
475
489
|
variant: "success",
|
|
476
|
-
value:
|
|
490
|
+
value: w.value.value,
|
|
477
491
|
detail: [
|
|
478
|
-
|
|
479
|
-
|
|
492
|
+
w.value.source_choice ? `basis: ${w.value.source_choice}` : null,
|
|
493
|
+
w.value.set_at ? new Date(w.value.set_at).toLocaleString() : null
|
|
480
494
|
].filter(Boolean).join(" · "),
|
|
481
|
-
winner:
|
|
495
|
+
winner: l.value.source === "override"
|
|
482
496
|
}), h.value && v.push({
|
|
483
497
|
key: "extracted",
|
|
484
498
|
title: "Extracted",
|
|
485
|
-
variant:
|
|
499
|
+
variant: Z[$.value],
|
|
486
500
|
value: h.value.value,
|
|
487
|
-
detail:
|
|
501
|
+
detail: y.value != null ? `Confidence ${y.value}/5 · ${ie[$.value]}` : "No confidence recorded",
|
|
488
502
|
accept: a.save ? () => {
|
|
489
|
-
var
|
|
490
|
-
return
|
|
503
|
+
var i;
|
|
504
|
+
return G(be((i = h.value) == null ? void 0 : i.value), "extracted");
|
|
491
505
|
} : void 0,
|
|
492
|
-
winner:
|
|
493
|
-
}),
|
|
506
|
+
winner: l.value.source === "extracted"
|
|
507
|
+
}), k.value && v.push({
|
|
494
508
|
key: "claim",
|
|
495
509
|
title: "Claim",
|
|
496
510
|
variant: "info",
|
|
497
|
-
value:
|
|
498
|
-
detail:
|
|
511
|
+
value: k.value.value,
|
|
512
|
+
detail: k.value.claim_set_label ?? "Reference output",
|
|
499
513
|
accept: a.save ? () => {
|
|
500
|
-
var
|
|
501
|
-
return
|
|
514
|
+
var i;
|
|
515
|
+
return G(be((i = k.value) == null ? void 0 : i.value), "claim");
|
|
502
516
|
} : void 0,
|
|
503
|
-
winner:
|
|
517
|
+
winner: l.value.source === "claim"
|
|
504
518
|
}), v;
|
|
505
|
-
}),
|
|
506
|
-
async function
|
|
507
|
-
if (!(!a.save ||
|
|
508
|
-
|
|
519
|
+
}), B = N(""), L = N(!1);
|
|
520
|
+
async function G(v, i) {
|
|
521
|
+
if (!(!a.save || L.value)) {
|
|
522
|
+
L.value = !0;
|
|
509
523
|
try {
|
|
510
|
-
const C = await a.save(v,
|
|
511
|
-
g("saved", C),
|
|
524
|
+
const C = await a.save(v, i);
|
|
525
|
+
g("saved", C), u.success(`Verified — ${q.value} locked in`);
|
|
512
526
|
} catch (C) {
|
|
513
|
-
console.error("template-verification: save failed", C),
|
|
527
|
+
console.error("template-verification: save failed", C), u.danger(`Could not save ${q.value} — try again`);
|
|
514
528
|
} finally {
|
|
515
|
-
|
|
529
|
+
L.value = !1;
|
|
516
530
|
}
|
|
517
531
|
}
|
|
518
532
|
}
|
|
519
|
-
const
|
|
520
|
-
function
|
|
533
|
+
const te = () => G(B.value, "custom");
|
|
534
|
+
function be(v) {
|
|
521
535
|
return v == null ? null : String(v);
|
|
522
536
|
}
|
|
523
|
-
function
|
|
537
|
+
function he(v) {
|
|
524
538
|
return v == null ? "—" : String(v);
|
|
525
539
|
}
|
|
526
|
-
const Y =
|
|
527
|
-
return
|
|
528
|
-
[
|
|
529
|
-
async ([v,
|
|
530
|
-
if (!(v !== "audit" || !
|
|
531
|
-
|
|
540
|
+
const Y = N(null), ae = N(!1), ne = N(null);
|
|
541
|
+
return re(
|
|
542
|
+
[M, c],
|
|
543
|
+
async ([v, i]) => {
|
|
544
|
+
if (!(v !== "audit" || !i || Y.value !== null || ae.value) && x.auditUrl) {
|
|
545
|
+
ae.value = !0, ne.value = null;
|
|
532
546
|
try {
|
|
533
|
-
Y.value = await
|
|
534
|
-
|
|
547
|
+
Y.value = await dt(
|
|
548
|
+
x.auditUrl,
|
|
535
549
|
a.meta.anchor
|
|
536
550
|
);
|
|
537
551
|
} catch (C) {
|
|
538
|
-
|
|
552
|
+
ne.value = C instanceof Error ? C.message : String(C);
|
|
539
553
|
} finally {
|
|
540
|
-
|
|
554
|
+
ae.value = !1;
|
|
541
555
|
}
|
|
542
556
|
}
|
|
543
557
|
},
|
|
544
558
|
{ immediate: !0 }
|
|
545
|
-
), (v,
|
|
546
|
-
|
|
547
|
-
modelValue:
|
|
548
|
-
"onUpdate:modelValue":
|
|
549
|
-
title:
|
|
559
|
+
), (v, i) => (n(), o(j, null, [
|
|
560
|
+
V(r(ce), {
|
|
561
|
+
modelValue: c.value,
|
|
562
|
+
"onUpdate:modelValue": i[3] || (i[3] = (C) => c.value = C),
|
|
563
|
+
title: q.value,
|
|
550
564
|
width: 90,
|
|
551
565
|
height: 90,
|
|
552
566
|
"close-x": "",
|
|
553
567
|
class: R(r(z))
|
|
554
568
|
}, {
|
|
555
|
-
default:
|
|
569
|
+
default: O(() => {
|
|
556
570
|
var C;
|
|
557
571
|
return [
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
572
|
+
s("div", wt, [
|
|
573
|
+
s("section", _t, [
|
|
574
|
+
s("div", kt, [
|
|
575
|
+
s("div", $t, [
|
|
576
|
+
i[6] || (i[6] = s("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
|
|
577
|
+
s("div", St, m(he(l.value.value)), 1),
|
|
578
|
+
s("div", Ct, [
|
|
579
|
+
i[5] || (i[5] = I(" source of truth: ", -1)),
|
|
580
|
+
s("span", Vt, m(l.value.source), 1)
|
|
567
581
|
])
|
|
568
582
|
]),
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
583
|
+
s("div", Dt, [
|
|
584
|
+
V(r(ve), {
|
|
585
|
+
tooltip: "How certain the AI was when it extracted this value — not whether the quote below was checked against the source (see the Evidence tab's own badge for that).",
|
|
586
|
+
placement: "top"
|
|
587
|
+
}, {
|
|
588
|
+
trigger: O(() => [...i[7] || (i[7] = [
|
|
589
|
+
s("div", { class: "w-fit text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)
|
|
590
|
+
])]),
|
|
591
|
+
_: 1
|
|
592
|
+
}),
|
|
593
|
+
s("div", Ot, [
|
|
594
|
+
y.value != null ? (n(), A(r(De), {
|
|
573
595
|
key: 0,
|
|
574
|
-
value:
|
|
596
|
+
value: y.value,
|
|
575
597
|
max: 5,
|
|
576
598
|
size: "md",
|
|
577
|
-
variant:
|
|
599
|
+
variant: Z[$.value],
|
|
578
600
|
gradient: "",
|
|
579
601
|
shimmer: "",
|
|
580
602
|
"show-text": "",
|
|
581
603
|
"text-position": "beside",
|
|
582
|
-
label: `${
|
|
583
|
-
}, null, 8, ["value", "variant", "label"])) : (
|
|
604
|
+
label: `${y.value}/5`
|
|
605
|
+
}, null, 8, ["value", "variant", "label"])) : (n(), o("div", It, " No confidence recorded "))
|
|
584
606
|
]),
|
|
585
|
-
|
|
607
|
+
s("div", {
|
|
586
608
|
class: R(["tv-confidence-label mt-1 text-right text-xs font-medium", {
|
|
587
|
-
"text-green-600":
|
|
588
|
-
"text-yellow-600":
|
|
589
|
-
"text-red-600":
|
|
590
|
-
"text-gray-400":
|
|
609
|
+
"text-green-600": $.value === "high",
|
|
610
|
+
"text-yellow-600": $.value === "medium",
|
|
611
|
+
"text-red-600": $.value === "low",
|
|
612
|
+
"text-gray-400": $.value === "unverifiable"
|
|
591
613
|
}])
|
|
592
|
-
}, m(r(
|
|
614
|
+
}, m(r(ie)[$.value]), 3)
|
|
593
615
|
])
|
|
594
616
|
]),
|
|
595
|
-
e.meta.discrepancy ? (
|
|
617
|
+
e.meta.discrepancy ? (n(), A(r(ke), {
|
|
596
618
|
key: 0,
|
|
597
619
|
variant: "warning",
|
|
598
620
|
class: "tv-discrepancy"
|
|
599
621
|
}, {
|
|
600
|
-
default:
|
|
601
|
-
|
|
622
|
+
default: O(() => [...i[8] || (i[8] = [
|
|
623
|
+
I(" Sources disagree on this value — review the candidates and pick a winner. ", -1)
|
|
602
624
|
])]),
|
|
603
625
|
_: 1
|
|
604
626
|
})) : b("", !0)
|
|
605
627
|
]),
|
|
606
|
-
|
|
607
|
-
modelValue:
|
|
608
|
-
"onUpdate:modelValue":
|
|
609
|
-
tabs:
|
|
628
|
+
V(r(Fe), {
|
|
629
|
+
modelValue: M.value,
|
|
630
|
+
"onUpdate:modelValue": i[0] || (i[0] = (f) => M.value = f),
|
|
631
|
+
tabs: ee.value,
|
|
610
632
|
class: "tv-modal-tabs"
|
|
611
633
|
}, null, 8, ["modelValue", "tabs"]),
|
|
612
|
-
|
|
613
|
-
S.value ? (
|
|
614
|
-
|
|
615
|
-
|
|
634
|
+
M.value === "evidence" ? (n(), o("section", Tt, [
|
|
635
|
+
S.value ? (n(), o("div", At, [
|
|
636
|
+
i[9] || (i[9] = s("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
|
|
637
|
+
V(r(qe), {
|
|
616
638
|
"model-value": S.value,
|
|
617
639
|
readonly: "",
|
|
618
640
|
class: "tv-reasoning"
|
|
619
641
|
}, null, 8, ["model-value"])
|
|
620
642
|
])) : b("", !0),
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
643
|
+
U.value ? (n(), o("div", Ut, [
|
|
644
|
+
i[10] || (i[10] = s("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, [
|
|
645
|
+
I(" Source quote "),
|
|
646
|
+
s("span", { class: "font-normal normal-case text-gray-400" }, "— the raw text as written in the document below, not the cleaned-up resolved value above")
|
|
647
|
+
], -1)),
|
|
648
|
+
s("blockquote", Nt, [
|
|
649
|
+
I(" “" + m(U.value) + "” ", 1),
|
|
650
|
+
V(r(ve), {
|
|
651
|
+
tooltip: (C = h.value) != null && C.cited_text_verified ? "This exact wording was mechanically found in the source document — independent of the AI's extraction confidence above." : "This quote could not be mechanically matched verbatim against the source document — it may be paraphrased or OCR-garbled.",
|
|
652
|
+
placement: "top"
|
|
653
|
+
}, {
|
|
654
|
+
trigger: O(() => {
|
|
655
|
+
var f;
|
|
656
|
+
return [
|
|
657
|
+
V(r(H), {
|
|
658
|
+
variant: (f = h.value) != null && f.cited_text_verified ? "success" : "muted",
|
|
659
|
+
size: "xxs",
|
|
660
|
+
class: "tv-cited-verified ml-2 not-italic"
|
|
661
|
+
}, {
|
|
662
|
+
default: O(() => {
|
|
663
|
+
var ue;
|
|
664
|
+
return [
|
|
665
|
+
I(m((ue = h.value) != null && ue.cited_text_verified ? "✔ quote matches source" : "quote unmatched"), 1)
|
|
666
|
+
];
|
|
667
|
+
}),
|
|
668
|
+
_: 1
|
|
669
|
+
}, 8, ["variant"])
|
|
670
|
+
];
|
|
671
|
+
}),
|
|
672
|
+
_: 1
|
|
673
|
+
}, 8, ["tooltip"])
|
|
674
|
+
])
|
|
636
675
|
])) : b("", !0),
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
"
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
"
|
|
676
|
+
E.value.length ? (n(), o("div", Rt, [
|
|
677
|
+
s("div", jt, [
|
|
678
|
+
i[11] || (i[11] = s("span", null, "Source pages", -1)),
|
|
679
|
+
s("span", Et, m(E.value.length) + " page" + m(E.value.length === 1 ? "" : "s") + " cited", 1)
|
|
680
|
+
]),
|
|
681
|
+
V(r($e), {
|
|
682
|
+
file: E.value[0],
|
|
683
|
+
"file-in-preview": K.value,
|
|
684
|
+
"onUpdate:fileInPreview": i[1] || (i[1] = (f) => K.value = f),
|
|
685
|
+
"related-files": E.value,
|
|
686
|
+
"layout-toggles": ["continuous"],
|
|
687
|
+
sidebar: "",
|
|
645
688
|
zoomable: "",
|
|
646
689
|
"storage-key": "tv-evidence-viewer",
|
|
647
690
|
class: "h-full min-h-0 flex-1"
|
|
648
691
|
}, null, 8, ["file", "file-in-preview", "related-files"]),
|
|
649
|
-
|
|
650
|
-
])) : (
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
(
|
|
654
|
-
key: String(
|
|
692
|
+
W.value ? (n(), o("div", Lt, m(W.value), 1)) : b("", !0)
|
|
693
|
+
])) : (n(), o("div", zt, " No source pages recorded for this data point ")),
|
|
694
|
+
X.value.length ? (n(), o("div", Mt, [
|
|
695
|
+
i[12] || (i[12] = s("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Full documents:", -1)),
|
|
696
|
+
(n(!0), o(j, null, F(X.value, (f) => (n(), A(r(de), {
|
|
697
|
+
key: String(f.id),
|
|
655
698
|
size: "sm",
|
|
656
699
|
variant: "info",
|
|
657
700
|
class: "tv-open-document",
|
|
658
|
-
onClick: (
|
|
701
|
+
onClick: (ue) => P.value = f
|
|
659
702
|
}, {
|
|
660
|
-
default:
|
|
661
|
-
|
|
703
|
+
default: O(() => [
|
|
704
|
+
I(m(f.name), 1)
|
|
662
705
|
]),
|
|
663
706
|
_: 2
|
|
664
707
|
}, 1032, ["onClick"]))), 128))
|
|
665
708
|
])) : b("", !0)
|
|
666
709
|
])) : b("", !0),
|
|
667
|
-
|
|
668
|
-
(
|
|
669
|
-
key:
|
|
710
|
+
M.value === "candidates" ? (n(), o("section", Pt, [
|
|
711
|
+
(n(!0), o(j, null, F(D.value, (f) => (n(), o("div", {
|
|
712
|
+
key: f.key,
|
|
670
713
|
class: R(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
|
|
671
|
-
|
|
672
|
-
e.meta.discrepancy && !
|
|
714
|
+
f.winner ? "border-gray-300 bg-gray-50 shadow-sm" : "border-gray-200",
|
|
715
|
+
e.meta.discrepancy && !f.winner ? "tv-candidate-disagrees border-amber-200" : ""
|
|
673
716
|
]])
|
|
674
717
|
}, [
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
variant:
|
|
718
|
+
s("div", Bt, [
|
|
719
|
+
s("div", Ft, [
|
|
720
|
+
s("div", qt, [
|
|
721
|
+
V(r(H), {
|
|
722
|
+
variant: f.variant,
|
|
680
723
|
size: "xs"
|
|
681
724
|
}, {
|
|
682
|
-
default:
|
|
683
|
-
|
|
725
|
+
default: O(() => [
|
|
726
|
+
I(m(f.title), 1)
|
|
684
727
|
]),
|
|
685
728
|
_: 2
|
|
686
729
|
}, 1032, ["variant"]),
|
|
687
|
-
|
|
730
|
+
f.winner ? (n(), A(r(H), {
|
|
688
731
|
key: 0,
|
|
689
732
|
variant: "success",
|
|
690
733
|
size: "xxs",
|
|
691
734
|
class: "tv-winner-chip"
|
|
692
735
|
}, {
|
|
693
|
-
default:
|
|
694
|
-
|
|
736
|
+
default: O(() => [...i[13] || (i[13] = [
|
|
737
|
+
I("current value", -1)
|
|
695
738
|
])]),
|
|
696
739
|
_: 1
|
|
697
740
|
})) : b("", !0)
|
|
698
741
|
]),
|
|
699
|
-
|
|
700
|
-
|
|
742
|
+
s("div", Yt, m(he(f.value)), 1),
|
|
743
|
+
s("div", Ht, m(f.detail), 1)
|
|
701
744
|
]),
|
|
702
|
-
|
|
745
|
+
f.accept && !f.winner ? (n(), A(r(de), {
|
|
703
746
|
key: 0,
|
|
704
747
|
size: "sm",
|
|
705
|
-
variant:
|
|
706
|
-
loading:
|
|
707
|
-
class: R(`tv-accept-${
|
|
708
|
-
onClick:
|
|
748
|
+
variant: f.variant,
|
|
749
|
+
loading: L.value,
|
|
750
|
+
class: R(`tv-accept-${f.key}`),
|
|
751
|
+
onClick: f.accept
|
|
709
752
|
}, {
|
|
710
|
-
default:
|
|
711
|
-
|
|
753
|
+
default: O(() => [...i[14] || (i[14] = [
|
|
754
|
+
I("Accept this value", -1)
|
|
712
755
|
])]),
|
|
713
756
|
_: 1
|
|
714
757
|
}, 8, ["variant", "loading", "class", "onClick"])) : b("", !0)
|
|
715
758
|
])
|
|
716
759
|
], 2))), 128)),
|
|
717
|
-
e.save ? (
|
|
718
|
-
|
|
719
|
-
modelValue:
|
|
720
|
-
"onUpdate:modelValue":
|
|
760
|
+
e.save ? (n(), o("div", Jt, [
|
|
761
|
+
V(r(Ye), {
|
|
762
|
+
modelValue: B.value,
|
|
763
|
+
"onUpdate:modelValue": i[2] || (i[2] = (f) => B.value = f),
|
|
721
764
|
size: "sm",
|
|
722
765
|
class: "tv-custom-input flex-1",
|
|
723
766
|
placeholder: "Type the correct value…",
|
|
724
|
-
disabled:
|
|
767
|
+
disabled: L.value
|
|
725
768
|
}, null, 8, ["modelValue", "disabled"]),
|
|
726
|
-
|
|
769
|
+
V(r(de), {
|
|
727
770
|
variant: "success",
|
|
728
771
|
size: "sm",
|
|
729
772
|
class: "tv-accept-custom",
|
|
730
|
-
loading:
|
|
731
|
-
disabled: !
|
|
732
|
-
onClick:
|
|
773
|
+
loading: L.value,
|
|
774
|
+
disabled: !B.value,
|
|
775
|
+
onClick: te
|
|
733
776
|
}, {
|
|
734
|
-
default:
|
|
735
|
-
|
|
777
|
+
default: O(() => [...i[15] || (i[15] = [
|
|
778
|
+
I("Save custom value", -1)
|
|
736
779
|
])]),
|
|
737
780
|
_: 1
|
|
738
781
|
}, 8, ["loading", "disabled"])
|
|
739
|
-
])) : (
|
|
782
|
+
])) : (n(), o("div", Kt, " Read-only render — corrections are disabled here "))
|
|
740
783
|
])) : b("", !0),
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
key:
|
|
784
|
+
M.value === "audit" ? (n(), o("section", Gt, [
|
|
785
|
+
ae.value ? (n(), o(j, { key: 0 }, F(2, (f) => V(r(Oe), {
|
|
786
|
+
key: f,
|
|
744
787
|
shape: "rounded",
|
|
745
788
|
class: "tv-audit-skeleton h-24 w-full"
|
|
746
|
-
})), 64)) :
|
|
789
|
+
})), 64)) : ne.value ? (n(), A(r(ke), {
|
|
747
790
|
key: 1,
|
|
748
791
|
variant: "danger",
|
|
749
792
|
class: "tv-audit-error"
|
|
750
793
|
}, {
|
|
751
|
-
default:
|
|
752
|
-
|
|
794
|
+
default: O(() => [
|
|
795
|
+
I(" Could not load the audit trail: " + m(ne.value), 1)
|
|
753
796
|
]),
|
|
754
797
|
_: 1
|
|
755
|
-
})) : Y.value && Y.value.length === 0 ? (
|
|
756
|
-
key: String(
|
|
757
|
-
call:
|
|
798
|
+
})) : Y.value && Y.value.length === 0 ? (n(), o("div", Qt, " No LLM calls recorded for this data point ")) : Y.value ? (n(!0), o(j, { key: 3 }, F(Y.value, (f) => (n(), A(ht, {
|
|
799
|
+
key: String(f.id),
|
|
800
|
+
call: f
|
|
758
801
|
}, null, 8, ["call"]))), 128)) : b("", !0)
|
|
759
802
|
])) : b("", !0)
|
|
760
803
|
])
|
|
@@ -762,21 +805,23 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
762
805
|
}),
|
|
763
806
|
_: 1
|
|
764
807
|
}, 8, ["modelValue", "title", "class"]),
|
|
765
|
-
|
|
808
|
+
P.value ? (n(), A(r(ce), {
|
|
766
809
|
key: 0,
|
|
767
|
-
modelValue:
|
|
768
|
-
"onUpdate:modelValue":
|
|
769
|
-
title:
|
|
810
|
+
modelValue: p.value,
|
|
811
|
+
"onUpdate:modelValue": i[4] || (i[4] = (C) => p.value = C),
|
|
812
|
+
title: P.value.name,
|
|
770
813
|
width: 90,
|
|
771
814
|
height: 90,
|
|
772
815
|
"close-x": "",
|
|
773
816
|
class: R(r(z))
|
|
774
817
|
}, {
|
|
775
|
-
default:
|
|
776
|
-
|
|
777
|
-
file:
|
|
818
|
+
default: O(() => [
|
|
819
|
+
V(r($e), {
|
|
820
|
+
file: P.value,
|
|
778
821
|
downloadable: "",
|
|
779
822
|
zoomable: "",
|
|
823
|
+
sidebar: "",
|
|
824
|
+
"storage-key": "tv-document-viewer",
|
|
780
825
|
class: "tv-document-viewer h-full"
|
|
781
826
|
}, null, 8, ["file"])
|
|
782
827
|
]),
|
|
@@ -784,15 +829,15 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
784
829
|
}, 8, ["modelValue", "title", "class"])) : b("", !0)
|
|
785
830
|
], 64));
|
|
786
831
|
}
|
|
787
|
-
}),
|
|
832
|
+
}), Xt = ["contenteditable", "data-editable"], Zt = {
|
|
788
833
|
key: 1,
|
|
789
834
|
class: "tv-verified-chip inline-flex items-center gap-1 rounded-full bg-green-600 px-2 py-0.5 text-[11px] font-semibold leading-none text-white",
|
|
790
835
|
"data-status": "verified"
|
|
791
|
-
},
|
|
836
|
+
}, ea = {
|
|
792
837
|
key: 2,
|
|
793
838
|
class: "tv-discrepancy-indicator ml-0.5 text-amber-500",
|
|
794
839
|
"aria-label": "discrepancy"
|
|
795
|
-
},
|
|
840
|
+
}, Va = /* @__PURE__ */ Q({
|
|
796
841
|
__name: "VerifiedField",
|
|
797
842
|
props: {
|
|
798
843
|
source: {},
|
|
@@ -801,226 +846,234 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
801
846
|
format: { type: Function }
|
|
802
847
|
},
|
|
803
848
|
setup(e) {
|
|
804
|
-
const t = e, a =
|
|
805
|
-
var
|
|
806
|
-
return
|
|
807
|
-
}),
|
|
849
|
+
const t = e, a = oe(), g = d(() => a.enabled.value), x = d(() => a.loading), u = N(null), c = d(() => {
|
|
850
|
+
var p;
|
|
851
|
+
return u.value ? u.value : t.source && t.field ? ((p = t.source.__meta) == null ? void 0 : p[t.field]) ?? null : null;
|
|
852
|
+
}), l = d(() => ye(c.value)), h = d(() => {
|
|
808
853
|
if (t.original !== void 0 && t.original !== null)
|
|
809
854
|
return t.original;
|
|
810
|
-
if (
|
|
811
|
-
return
|
|
855
|
+
if (c.value && l.value.value !== null && l.value.value !== void 0)
|
|
856
|
+
return l.value.value;
|
|
812
857
|
if (t.source && t.field) return t.source[t.field];
|
|
813
|
-
}),
|
|
814
|
-
const
|
|
815
|
-
return
|
|
816
|
-
}),
|
|
858
|
+
}), k = d(() => {
|
|
859
|
+
const p = h.value;
|
|
860
|
+
return p == null ? "" : typeof t.format == "function" ? t.format(p) : String(p);
|
|
861
|
+
}), w = d(
|
|
817
862
|
() => {
|
|
818
|
-
var
|
|
819
|
-
return
|
|
863
|
+
var p, _, D;
|
|
864
|
+
return xe((D = (_ = (p = c.value) == null ? void 0 : p.candidates) == null ? void 0 : _.extracted) == null ? void 0 : D.confidence);
|
|
820
865
|
}
|
|
821
|
-
),
|
|
822
|
-
var
|
|
823
|
-
return !!((
|
|
824
|
-
}),
|
|
825
|
-
var
|
|
826
|
-
const
|
|
827
|
-
return !!(
|
|
828
|
-
}),
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
w.
|
|
836
|
-
|
|
866
|
+
), y = d(() => Ne(c.value)), $ = d(() => {
|
|
867
|
+
var p, _;
|
|
868
|
+
return !!((_ = (p = c.value) == null ? void 0 : p.candidates) != null && _.override);
|
|
869
|
+
}), S = d(() => {
|
|
870
|
+
var _;
|
|
871
|
+
const p = (_ = c.value) == null ? void 0 : _.candidates;
|
|
872
|
+
return !!(p != null && p.override || p != null && p.extracted || p != null && p.claim);
|
|
873
|
+
}), U = d(() => g.value), T = d(() => !!c.value), q = d(() => {
|
|
874
|
+
const p = c.value;
|
|
875
|
+
return U.value && !!p && je(p);
|
|
876
|
+
}), Z = d(() => {
|
|
877
|
+
var L, G, te;
|
|
878
|
+
const p = (G = (L = c.value) == null ? void 0 : L.candidates) == null ? void 0 : G.extracted;
|
|
879
|
+
if (!p) return "No verification data";
|
|
880
|
+
const _ = [], D = ie[w.value];
|
|
881
|
+
_.push(
|
|
882
|
+
p.confidence != null ? `${D} (${p.confidence}/5)` : D
|
|
837
883
|
);
|
|
838
|
-
const
|
|
839
|
-
return
|
|
884
|
+
const B = ((te = p.sources) == null ? void 0 : te.length) ?? 0;
|
|
885
|
+
return B > 0 && _.push(`${B} source ${B === 1 ? "page" : "pages"}`), y.value && _.push("sources disagree"), _.join(" · ");
|
|
840
886
|
});
|
|
841
|
-
function M(
|
|
842
|
-
var
|
|
843
|
-
|
|
887
|
+
function M(p) {
|
|
888
|
+
var _;
|
|
889
|
+
u.value = p, (_ = t.source) != null && _.__meta && t.field && (t.source.__meta[t.field] = p);
|
|
844
890
|
}
|
|
845
|
-
const
|
|
846
|
-
function
|
|
847
|
-
|
|
891
|
+
const J = d(() => rt(a, c, M)), ee = d(() => !!J.value), E = N(!1), K = N(!1);
|
|
892
|
+
function W() {
|
|
893
|
+
c.value && (E.value = !0);
|
|
848
894
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
895
|
+
const X = d(() => T.value);
|
|
896
|
+
async function P(p) {
|
|
897
|
+
K.value = !1;
|
|
898
|
+
const D = (p.target.textContent ?? "").trim();
|
|
899
|
+
!J.value || D === k.value || await J.value(D, "custom");
|
|
853
900
|
}
|
|
854
|
-
return (
|
|
855
|
-
class: R(["tv-field inline-flex items-baseline gap-1",
|
|
901
|
+
return (p, _) => (n(), o("span", {
|
|
902
|
+
class: R(["tv-field inline-flex items-baseline gap-1", q.value ? "tv-needs-review" : ""])
|
|
856
903
|
}, [
|
|
857
|
-
|
|
858
|
-
class: R([
|
|
859
|
-
"tv-field-value",
|
|
860
|
-
S.value && !k.value ? "tv-field-unverified cursor-pointer border-b border-dotted border-gray-300" : ""
|
|
861
|
-
]),
|
|
862
|
-
contenteditable: j.value,
|
|
863
|
-
"data-editable": j.value ? "true" : "false",
|
|
864
|
-
onFocus: w[0] || (w[0] = (V) => X.value = !0),
|
|
865
|
-
onBlur: Q,
|
|
866
|
-
onKeydown: w[1] || (w[1] = Ne(te((V) => V.target.blur(), ["prevent"]), ["enter"])),
|
|
867
|
-
onClick: w[2] || (w[2] = (V) => S.value && !k.value ? F() : void 0)
|
|
868
|
-
}, [
|
|
869
|
-
Re(f.$slots, "default", {
|
|
870
|
-
value: s.value,
|
|
871
|
-
formatted: h.value
|
|
872
|
-
}, () => [
|
|
873
|
-
T(m(h.value), 1)
|
|
874
|
-
])
|
|
875
|
-
], 42, Yt),
|
|
876
|
-
S.value && k.value ? (l(), N(r(Me), {
|
|
904
|
+
x.value ? (n(), A(r(Oe), {
|
|
877
905
|
key: 0,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}, {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
906
|
+
shape: "rounded",
|
|
907
|
+
class: "tv-field-skeleton inline-block h-[1em] w-16 align-middle"
|
|
908
|
+
})) : (n(), o(j, { key: 1 }, [
|
|
909
|
+
s("span", {
|
|
910
|
+
class: R([
|
|
911
|
+
"tv-field-value",
|
|
912
|
+
U.value && !S.value ? "tv-field-unverified cursor-pointer border-b border-dotted border-gray-300" : ""
|
|
913
|
+
]),
|
|
914
|
+
contenteditable: ee.value,
|
|
915
|
+
"data-editable": ee.value ? "true" : "false",
|
|
916
|
+
onFocus: _[0] || (_[0] = (D) => K.value = !0),
|
|
917
|
+
onBlur: P,
|
|
918
|
+
onKeydown: _[1] || (_[1] = ze(le((D) => D.target.blur(), ["prevent"]), ["enter"])),
|
|
919
|
+
onClick: _[2] || (_[2] = (D) => U.value && !S.value ? W() : void 0)
|
|
920
|
+
}, [
|
|
921
|
+
Me(p.$slots, "default", {
|
|
922
|
+
value: h.value,
|
|
923
|
+
formatted: k.value
|
|
924
|
+
}, () => [
|
|
925
|
+
I(m(k.value), 1)
|
|
926
|
+
])
|
|
927
|
+
], 42, Xt),
|
|
928
|
+
U.value ? (n(), A(r(ve), {
|
|
929
|
+
key: 0,
|
|
930
|
+
tooltip: Z.value,
|
|
931
|
+
placement: "top"
|
|
932
|
+
}, {
|
|
933
|
+
trigger: O(() => [
|
|
934
|
+
s("button", {
|
|
935
|
+
type: "button",
|
|
936
|
+
class: R(["tv-overlay inline-flex items-center align-middle transition-transform duration-150", [r(z), X.value ? "cursor-pointer hover:scale-110" : "cursor-default"]]),
|
|
937
|
+
onClick: _[3] || (_[3] = (D) => X.value ? W() : void 0)
|
|
938
|
+
}, [
|
|
939
|
+
$.value ? (n(), o("span", Zt, "✔")) : (n(), A(ge, {
|
|
940
|
+
key: 0,
|
|
941
|
+
status: w.value
|
|
942
|
+
}, null, 8, ["status"])),
|
|
943
|
+
y.value && !$.value ? (n(), o("span", ea, "⚠")) : b("", !0)
|
|
944
|
+
], 2)
|
|
945
|
+
]),
|
|
946
|
+
_: 1
|
|
947
|
+
}, 8, ["tooltip"])) : b("", !0),
|
|
948
|
+
c.value ? (n(), A(Wt, {
|
|
949
|
+
key: 1,
|
|
950
|
+
modelValue: E.value,
|
|
951
|
+
"onUpdate:modelValue": _[4] || (_[4] = (D) => E.value = D),
|
|
952
|
+
meta: c.value,
|
|
953
|
+
label: e.field,
|
|
954
|
+
save: J.value
|
|
955
|
+
}, null, 8, ["modelValue", "meta", "label", "save"])) : b("", !0)
|
|
956
|
+
], 64))
|
|
904
957
|
], 2));
|
|
905
958
|
}
|
|
906
|
-
}),
|
|
959
|
+
}), ta = { class: "tv-comparison-page flex flex-col gap-4" }, aa = {
|
|
907
960
|
key: 0,
|
|
908
961
|
class: "tv-comparison-empty text-gray-400"
|
|
909
|
-
},
|
|
962
|
+
}, na = {
|
|
910
963
|
key: 1,
|
|
911
964
|
class: "tv-anchored-group flex flex-col gap-3"
|
|
912
|
-
},
|
|
965
|
+
}, la = { class: "flex items-center gap-2" }, sa = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, ra = { class: "tv-datapoint-resolved font-medium" }, ia = {
|
|
913
966
|
key: 0,
|
|
914
967
|
class: "tv-datapoint-discrepancy text-xs font-medium text-amber-600"
|
|
915
|
-
},
|
|
968
|
+
}, oa = { class: "tv-datapoint-candidates ml-4 text-xs text-gray-600" }, ua = { class: "font-medium" }, da = {
|
|
916
969
|
key: 0,
|
|
917
970
|
class: "tv-datapoint-reasoning ml-4 text-xs italic text-gray-500"
|
|
918
|
-
},
|
|
971
|
+
}, ca = {
|
|
919
972
|
key: 1,
|
|
920
973
|
class: "tv-datapoint-cited ml-4 text-xs text-gray-500"
|
|
921
|
-
},
|
|
974
|
+
}, va = { class: "tv-datapoint-sources ml-4 text-xs text-gray-500" }, fa = ["href"], pa = { key: 1 }, ma = { class: "ml-1" }, ga = {
|
|
922
975
|
key: 2,
|
|
923
976
|
class: "tv-unanchored-group flex flex-col gap-1"
|
|
924
|
-
},
|
|
977
|
+
}, xa = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, ya = { class: "tv-datapoint-value" }, ba = /* @__PURE__ */ Q({
|
|
925
978
|
__name: "ComparisonPage",
|
|
926
979
|
setup(e) {
|
|
927
|
-
const t =
|
|
928
|
-
function
|
|
929
|
-
const
|
|
930
|
-
return
|
|
980
|
+
const t = oe(), a = d(() => Re(t.data)), g = d(() => a.value.filter((k) => !k.unanchored)), x = d(() => a.value.filter((k) => k.unanchored));
|
|
981
|
+
function u(k) {
|
|
982
|
+
const w = ye(k).value;
|
|
983
|
+
return w == null ? "" : String(w);
|
|
931
984
|
}
|
|
932
|
-
function
|
|
933
|
-
return
|
|
985
|
+
function c(k) {
|
|
986
|
+
return k == null ? "" : String(k);
|
|
934
987
|
}
|
|
935
|
-
function
|
|
936
|
-
var
|
|
937
|
-
return (
|
|
988
|
+
function l(k) {
|
|
989
|
+
var w, y, $;
|
|
990
|
+
return ($ = (y = (w = k.meta) == null ? void 0 : w.candidates) == null ? void 0 : y.extracted) == null ? void 0 : $.confidence;
|
|
938
991
|
}
|
|
939
|
-
function h(
|
|
940
|
-
var
|
|
941
|
-
const
|
|
942
|
-
if (!
|
|
943
|
-
const
|
|
944
|
-
return
|
|
992
|
+
function h(k) {
|
|
993
|
+
var $;
|
|
994
|
+
const w = ($ = k.meta) == null ? void 0 : $.candidates;
|
|
995
|
+
if (!w) return [];
|
|
996
|
+
const y = [];
|
|
997
|
+
return w.override && y.push({ source: "override", value: w.override.value }), w.extracted && y.push({ source: "extracted", value: w.extracted.value }), w.claim && y.push({ source: "claim", value: w.claim.value }), y;
|
|
945
998
|
}
|
|
946
|
-
return (
|
|
947
|
-
|
|
948
|
-
a.value.length === 0 ? (
|
|
949
|
-
g.value.length ? (
|
|
950
|
-
(
|
|
951
|
-
var
|
|
952
|
-
return
|
|
953
|
-
key:
|
|
999
|
+
return (k, w) => (n(), o("div", ta, [
|
|
1000
|
+
w[1] || (w[1] = s("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
|
|
1001
|
+
a.value.length === 0 ? (n(), o("p", aa, " No data points to compare. ")) : b("", !0),
|
|
1002
|
+
g.value.length ? (n(), o("section", na, [
|
|
1003
|
+
(n(!0), o(j, null, F(g.value, (y) => {
|
|
1004
|
+
var $, S, U;
|
|
1005
|
+
return n(), o("div", {
|
|
1006
|
+
key: y.path,
|
|
954
1007
|
class: "tv-datapoint border-t border-gray-100 pt-2"
|
|
955
1008
|
}, [
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
confidence:
|
|
1009
|
+
s("div", la, [
|
|
1010
|
+
s("span", sa, m(y.path), 1),
|
|
1011
|
+
s("span", ra, m(u(y.meta)), 1),
|
|
1012
|
+
V(ge, {
|
|
1013
|
+
confidence: l(y),
|
|
961
1014
|
"show-label": ""
|
|
962
1015
|
}, null, 8, ["confidence"]),
|
|
963
|
-
r(
|
|
1016
|
+
r(Ne)(y.meta) ? (n(), o("span", ia, "⚠ discrepancy")) : b("", !0)
|
|
964
1017
|
]),
|
|
965
|
-
|
|
966
|
-
(
|
|
967
|
-
key:
|
|
1018
|
+
s("ul", oa, [
|
|
1019
|
+
(n(!0), o(j, null, F(h(y), (T) => (n(), o("li", {
|
|
1020
|
+
key: T.source,
|
|
968
1021
|
class: "tv-candidate"
|
|
969
1022
|
}, [
|
|
970
|
-
|
|
971
|
-
|
|
1023
|
+
s("span", ua, m(T.source) + ":", 1),
|
|
1024
|
+
I(" " + m(c(T.value)), 1)
|
|
972
1025
|
]))), 128))
|
|
973
1026
|
]),
|
|
974
|
-
r(
|
|
975
|
-
r(
|
|
976
|
-
|
|
977
|
-
(
|
|
978
|
-
key:
|
|
1027
|
+
r(fe)(y.meta) ? (n(), o("p", da, m(r(fe)(y.meta)), 1)) : b("", !0),
|
|
1028
|
+
r(pe)(y.meta) ? (n(), o("p", ca, " “" + m(r(pe)(y.meta)) + "” ", 1)) : b("", !0),
|
|
1029
|
+
s("ul", va, [
|
|
1030
|
+
(n(!0), o(j, null, F(r(Ee)((U = (S = ($ = y.meta) == null ? void 0 : $.candidates) == null ? void 0 : S.extracted) == null ? void 0 : U.sources), (T, q) => (n(), o("li", {
|
|
1031
|
+
key: q,
|
|
979
1032
|
class: "tv-source-group"
|
|
980
1033
|
}, [
|
|
981
|
-
|
|
1034
|
+
T.fileUrl ? (n(), o("a", {
|
|
982
1035
|
key: 0,
|
|
983
|
-
href:
|
|
1036
|
+
href: T.fileUrl,
|
|
984
1037
|
class: "tv-source-link text-blue-600 underline",
|
|
985
1038
|
target: "_blank",
|
|
986
1039
|
rel: "noopener"
|
|
987
|
-
}, m(
|
|
988
|
-
|
|
1040
|
+
}, m(T.fileLabel), 9, fa)) : (n(), o("span", pa, m(T.fileLabel), 1)),
|
|
1041
|
+
s("span", ma, "(" + m(T.sources.map(r(ft)).join(", ")) + ")", 1)
|
|
989
1042
|
]))), 128))
|
|
990
1043
|
])
|
|
991
1044
|
]);
|
|
992
1045
|
}), 128))
|
|
993
1046
|
])) : b("", !0),
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
(
|
|
997
|
-
key:
|
|
1047
|
+
x.value.length ? (n(), o("section", ga, [
|
|
1048
|
+
w[0] || (w[0] = s("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
|
|
1049
|
+
(n(!0), o(j, null, F(x.value, (y) => (n(), o("div", {
|
|
1050
|
+
key: y.path,
|
|
998
1051
|
class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
|
|
999
1052
|
}, [
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1053
|
+
s("span", xa, m(y.path), 1),
|
|
1054
|
+
s("span", ya, m(c(y.value)), 1),
|
|
1055
|
+
V(ge, { status: "unverifiable" })
|
|
1003
1056
|
]))), 128))
|
|
1004
1057
|
])) : b("", !0)
|
|
1005
1058
|
]));
|
|
1006
1059
|
}
|
|
1007
|
-
}),
|
|
1060
|
+
}), ha = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, wa = { class: "tv-progress-block" }, _a = { class: "mb-1 flex items-baseline justify-between" }, ka = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, Da = /* @__PURE__ */ Q({
|
|
1008
1061
|
__name: "VerificationChrome",
|
|
1009
1062
|
setup(e) {
|
|
1010
|
-
const t =
|
|
1011
|
-
|
|
1012
|
-
() =>
|
|
1013
|
-
(
|
|
1014
|
-
|
|
1063
|
+
const t = oe(), { enabled: a, openComparison: g } = t, x = Ze(), u = Ve(), c = N(!1), l = d(() => st(t.data)), h = N(!1);
|
|
1064
|
+
re(
|
|
1065
|
+
() => l.value.percent,
|
|
1066
|
+
($) => {
|
|
1067
|
+
$ === 100 && l.value.total > 0 && !h.value && (h.value = !0, u.success("All data points verified 🎯"));
|
|
1015
1068
|
}
|
|
1016
1069
|
);
|
|
1017
|
-
let
|
|
1018
|
-
function
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
|
|
1022
|
-
const S = k
|
|
1023
|
-
|
|
1070
|
+
let k = 0;
|
|
1071
|
+
function w() {
|
|
1072
|
+
const $ = document.querySelectorAll(".tv-needs-review");
|
|
1073
|
+
if (!$.length) return;
|
|
1074
|
+
k = k % $.length;
|
|
1075
|
+
const S = $[k];
|
|
1076
|
+
k++, S.scrollIntoView({ behavior: "smooth", block: "center" }), S.animate(
|
|
1024
1077
|
[
|
|
1025
1078
|
{ boxShadow: "0 0 0 0 rgba(245, 158, 11, 0.8)" },
|
|
1026
1079
|
{ boxShadow: "0 0 0 12px rgba(245, 158, 11, 0)" }
|
|
@@ -1028,88 +1081,88 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1028
1081
|
{ duration: 900, iterations: 2 }
|
|
1029
1082
|
);
|
|
1030
1083
|
}
|
|
1031
|
-
function
|
|
1032
|
-
g(),
|
|
1084
|
+
function y() {
|
|
1085
|
+
g(), c.value = !1;
|
|
1033
1086
|
}
|
|
1034
|
-
return (
|
|
1035
|
-
|
|
1087
|
+
return ($, S) => (n(), o(j, null, [
|
|
1088
|
+
s("button", {
|
|
1036
1089
|
type: "button",
|
|
1037
1090
|
class: R(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-11 w-11 items-center justify-center rounded-full bg-gray-900 text-white shadow-lg transition-transform hover:scale-105", r(z)]),
|
|
1038
1091
|
title: "Verification",
|
|
1039
|
-
onClick: S[0] || (S[0] =
|
|
1092
|
+
onClick: S[0] || (S[0] = le((U) => c.value = !c.value, ["stop"]))
|
|
1040
1093
|
}, [
|
|
1041
|
-
|
|
1042
|
-
icon: r(
|
|
1094
|
+
V(r(He), {
|
|
1095
|
+
icon: r(Je),
|
|
1043
1096
|
class: "h-5 w-5"
|
|
1044
1097
|
}, null, 8, ["icon"]),
|
|
1045
|
-
r(a) &&
|
|
1098
|
+
r(a) && l.value.needsReview > 0 ? (n(), A(r(Ke), {
|
|
1046
1099
|
key: 0,
|
|
1047
|
-
value:
|
|
1100
|
+
value: l.value.needsReview,
|
|
1048
1101
|
variant: "warning",
|
|
1049
1102
|
class: "tv-needs-review-badge absolute -right-1 -top-1"
|
|
1050
1103
|
}, null, 8, ["value"])) : b("", !0)
|
|
1051
1104
|
], 2),
|
|
1052
|
-
|
|
1105
|
+
c.value ? (n(), o("div", {
|
|
1053
1106
|
key: 0,
|
|
1054
1107
|
class: R(["tv-settings-panel fixed bottom-20 right-4 z-50 flex w-72 flex-col gap-4 rounded-xl bg-white p-4 shadow-2xl ring-1 ring-gray-200", r(z)])
|
|
1055
1108
|
}, [
|
|
1056
|
-
|
|
1057
|
-
S[3] || (S[3] =
|
|
1058
|
-
|
|
1059
|
-
"onUpdate:modelValue": S[1] || (S[1] = (
|
|
1109
|
+
s("label", ha, [
|
|
1110
|
+
S[3] || (S[3] = s("span", null, "Verification overlay", -1)),
|
|
1111
|
+
Pe(s("input", {
|
|
1112
|
+
"onUpdate:modelValue": S[1] || (S[1] = (U) => we(a) ? a.value = U : null),
|
|
1060
1113
|
type: "checkbox",
|
|
1061
1114
|
class: "tv-enable-checkbox h-4 w-4 accent-gray-900"
|
|
1062
1115
|
}, null, 512), [
|
|
1063
|
-
[
|
|
1116
|
+
[Be, r(a)]
|
|
1064
1117
|
])
|
|
1065
1118
|
]),
|
|
1066
|
-
r(a) &&
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
S[4] || (S[4] =
|
|
1070
|
-
|
|
1119
|
+
r(a) && l.value.total > 0 ? (n(), o(j, { key: 0 }, [
|
|
1120
|
+
s("div", wa, [
|
|
1121
|
+
s("div", _a, [
|
|
1122
|
+
S[4] || (S[4] = s("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
|
|
1123
|
+
s("span", ka, m(l.value.verified) + " / " + m(l.value.total), 1)
|
|
1071
1124
|
]),
|
|
1072
|
-
|
|
1073
|
-
value:
|
|
1074
|
-
max:
|
|
1125
|
+
V(r(De), {
|
|
1126
|
+
value: l.value.verified,
|
|
1127
|
+
max: l.value.total,
|
|
1075
1128
|
size: "md",
|
|
1076
|
-
variant:
|
|
1077
|
-
striped:
|
|
1078
|
-
"animate-stripes":
|
|
1079
|
-
glow:
|
|
1129
|
+
variant: l.value.percent === 100 ? "success" : "info",
|
|
1130
|
+
striped: l.value.percent < 100,
|
|
1131
|
+
"animate-stripes": l.value.percent < 100,
|
|
1132
|
+
glow: l.value.percent === 100,
|
|
1080
1133
|
gradient: ""
|
|
1081
1134
|
}, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"])
|
|
1082
1135
|
]),
|
|
1083
|
-
|
|
1136
|
+
l.value.needsReview > 0 ? (n(), o("button", {
|
|
1084
1137
|
key: 0,
|
|
1085
1138
|
type: "button",
|
|
1086
1139
|
class: R(["tv-next-flagged flex items-center justify-between rounded-lg bg-amber-50 px-3 py-2 text-left text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 transition hover:bg-amber-100", r(z)]),
|
|
1087
|
-
onClick:
|
|
1140
|
+
onClick: le(w, ["stop"])
|
|
1088
1141
|
}, [
|
|
1089
|
-
|
|
1090
|
-
S[5] || (S[5] =
|
|
1142
|
+
s("span", null, m(l.value.needsReview) + " need" + m(l.value.needsReview === 1 ? "s" : "") + " review", 1),
|
|
1143
|
+
S[5] || (S[5] = s("span", { "aria-hidden": "true" }, "→", -1))
|
|
1091
1144
|
], 2)) : b("", !0)
|
|
1092
1145
|
], 64)) : b("", !0),
|
|
1093
|
-
|
|
1146
|
+
s("button", {
|
|
1094
1147
|
type: "button",
|
|
1095
1148
|
class: R(["tv-open-comparison rounded-lg border border-gray-200 px-3 py-2 text-sm font-medium text-gray-600 transition hover:bg-gray-50", r(z)]),
|
|
1096
|
-
onClick:
|
|
1149
|
+
onClick: le(y, ["stop"])
|
|
1097
1150
|
}, " Open comparison page ", 2)
|
|
1098
1151
|
], 2)) : b("", !0),
|
|
1099
|
-
|
|
1100
|
-
modelValue: r(
|
|
1101
|
-
"onUpdate:modelValue": S[2] || (S[2] = (
|
|
1152
|
+
V(r(ce), {
|
|
1153
|
+
modelValue: r(x),
|
|
1154
|
+
"onUpdate:modelValue": S[2] || (S[2] = (U) => we(x) ? x.value = U : null),
|
|
1102
1155
|
title: "Verification comparison",
|
|
1103
1156
|
width: 80,
|
|
1104
1157
|
"close-x": "",
|
|
1105
1158
|
class: R(r(z))
|
|
1106
1159
|
}, {
|
|
1107
|
-
default:
|
|
1108
|
-
|
|
1160
|
+
default: O(() => [
|
|
1161
|
+
V(ba)
|
|
1109
1162
|
]),
|
|
1110
1163
|
_: 1
|
|
1111
1164
|
}, 8, ["modelValue", "class"]),
|
|
1112
|
-
|
|
1165
|
+
V(r(Ge), {
|
|
1113
1166
|
class: R(r(z))
|
|
1114
1167
|
}, null, 8, ["class"])
|
|
1115
1168
|
], 64));
|
|
@@ -1117,27 +1170,27 @@ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1117
1170
|
});
|
|
1118
1171
|
export {
|
|
1119
1172
|
z as CHROME_CLASS,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1173
|
+
ba as ComparisonPage,
|
|
1174
|
+
ge as ConfidenceIcon,
|
|
1175
|
+
Ie as ENABLED_STORAGE_KEY,
|
|
1176
|
+
Ue as RESOLUTION_PRIORITY,
|
|
1177
|
+
et as STATUS_COLORS,
|
|
1178
|
+
ie as STATUS_LABELS,
|
|
1179
|
+
Da as VerificationChrome,
|
|
1180
|
+
Wt as VerificationModal,
|
|
1181
|
+
Va as VerifiedField,
|
|
1182
|
+
xe as bucketConfidence,
|
|
1183
|
+
at as candidatesDisagree,
|
|
1184
|
+
pe as citedTextOf,
|
|
1185
|
+
st as computeProgress,
|
|
1186
|
+
dt as fetchDataPointAudit,
|
|
1187
|
+
Ee as groupSources,
|
|
1188
|
+
Ne as hasDiscrepancy,
|
|
1189
|
+
Ca as initVerification,
|
|
1190
|
+
fe as reasoningOf,
|
|
1191
|
+
tt as resolveCandidates,
|
|
1192
|
+
ye as resolveDataPoint,
|
|
1193
|
+
ft as sourceRowLabel,
|
|
1194
|
+
oe as useVerification,
|
|
1195
|
+
Re as walkDataPoints
|
|
1143
1196
|
};
|