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