@action-state-group/capsule-viewer 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17014,8 +17014,10 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
17014
17014
  obligationKey: obligation.key,
17015
17015
  article: obligation.article,
17016
17016
  testName: row2.name,
17017
- severity: row2.finding.severity,
17018
- recommendation: row2.finding.recommendation,
17017
+ ..."observed" in row2.finding ? { observed: row2.finding.observed } : {
17018
+ severity: row2.finding.severity,
17019
+ recommendation: row2.finding.recommendation
17020
+ },
17019
17021
  ownerDue: row2.finding.ownerDue,
17020
17022
  sessionIds: row2.sessionsByVerdict.get("not_met") ?? []
17021
17023
  });
@@ -17863,13 +17865,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17863
17865
  }
17864
17866
  function builtCommit() {
17865
17867
  if (false) return void 0;
17866
- return commitPrefix("9a4fae0d6bdb7dbd15a71262283d9234470d76e0");
17868
+ return commitPrefix("6662e2bf0fb9f7305b45e3ccf5ee0cb2ac868b43");
17867
17869
  }
17868
17870
  var commit = builtCommit();
17869
17871
  var unreleased = false;
17870
17872
  var VIEWER_BUILD = {
17871
17873
  viewer: "@action-state-group/capsule-viewer",
17872
- viewerVersion: "0.20.0",
17874
+ viewerVersion: "0.22.0",
17873
17875
  verifier: "@action-state-group/agent-action-capsule",
17874
17876
  verifierVersion: "0.16.0",
17875
17877
  cllVersion: "0.4.0",
@@ -18763,7 +18765,9 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18763
18765
  "groups.summary.h": "What was checked and what we found",
18764
18766
  "groups.summary.lede": "Each session (one conversation with the agent) was checked against {tests} under {obligations}. Results are counts of sessions: there is no overall score. Open a requirement to read the sessions behind its exceptions.",
18765
18767
  "groups.summary.basis": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, obligation titles, requirement names, the article, the plain-language summary, applicability, method, finding ids, severities, recommendations and the notes on undecided requirements and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them.`,
18768
+ "groups.summary.basis.v2": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, obligation titles, requirement names, the article, the plain-language summary, applicability, method, finding ids, what each finding observed, its owner and due date, and the notes on undecided requirements and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them.`,
18766
18769
  "groups.summary.basis.pack-titles": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, requirement names, the article, the plain-language summary, applicability, method, finding ids, severities, recommendations and the notes on undecided requirements and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them. Obligation titles are the Act's article headings, from this page's wording pack.`,
18770
+ "groups.summary.basis.pack-titles.v2": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, requirement names, the article, the plain-language summary, applicability, method, finding ids, what each finding observed, its owner and due date, and the notes on undecided requirements and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them. Obligation titles are the Act's article headings, from this page's wording pack.`,
18767
18771
  "groups.fn.records.one": "\xB9 Records are the {records} sealed items in this bundle. A session is one conversation with the agent, made of one or more records; this bundle has {n} session.",
18768
18772
  "groups.fn.records.other": "\xB9 Records are the {records} sealed items in this bundle. A session is one conversation with the agent, made of one or more records; this bundle has {n} sessions.",
18769
18773
  "groups.fn.resolved.tiered": "\xB2 A session is met when every requirement that applied to it was satisfied and at least one applied. A requirement the contract marks informational never changes the answer.",
@@ -19726,7 +19730,14 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19726
19730
  "generic.claim.unrecognized": "unrecognized claim type {type}",
19727
19731
  "generic.claim.contract": "Contract",
19728
19732
  "generic.claim.requirement": "Requirement",
19729
- "generic.claim.failure": "Why it failed verification"
19733
+ "generic.claim.failure": "Why it failed verification",
19734
+ "generic.receipt.open": "Open receipt",
19735
+ "generic.receipt.close": "Close receipt",
19736
+ "generic.receipt.not_carried": "Receipt not carried with this page.",
19737
+ "generic.receipt.no_module": "This page has no viewer for this kind of receipt, so it is not shown.",
19738
+ "generic.receipt.withheld": "The holder's disclosure policy keeps this receipt off this page.",
19739
+ "generic.receipt.unreadable": "This receipt could not be read, so it is not shown. The rest of the report is unchanged.",
19740
+ "generic.receipt.unverified": "This receipt did not pass its checks, so it is not shown. The rest of the report is unchanged."
19730
19741
  }
19731
19742
  };
19732
19743
 
@@ -20200,6 +20211,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
20200
20211
  "generic.producer.note",
20201
20212
  "generic.later.note",
20202
20213
  "generic.claim.failure",
20214
+ // The deal receipt line under a claim (capsule-viewer#228): a pack cannot
20215
+ // make a receipt that is not carried read as "no record", or hide that a
20216
+ // carried receipt could not be read or did not pass its checks.
20217
+ "generic.receipt.open",
20218
+ "generic.receipt.close",
20219
+ "generic.receipt.not_carried",
20220
+ "generic.receipt.no_module",
20221
+ "generic.receipt.withheld",
20222
+ "generic.receipt.unreadable",
20223
+ "generic.receipt.unverified",
20203
20224
  // The shared front (report-front.ts): the mock-judge line, what the
20204
20225
  // aggregate's unknown count is, what the page and the bundle carry, and
20205
20226
  // the producer's findings label.
@@ -20556,6 +20577,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
20556
20577
  "groups.ob.ok.unverified",
20557
20578
  "groups.summary.basis",
20558
20579
  "groups.summary.basis.pack-titles",
20580
+ "groups.summary.basis.v2",
20581
+ "groups.summary.basis.pack-titles.v2",
20559
20582
  "groups.summary.lede",
20560
20583
  "groups.pf.case-record.from-claims",
20561
20584
  "groups.pf.no-claim",
@@ -20791,8 +20814,8 @@ ${key}`);
20791
20814
  }
20792
20815
  var DEFAULT_PACK_SHA256 = Object.freeze({
20793
20816
  lines: "4a03428e884337321754bd6657df0ebb6d5441821378a3b1ff17f2a625021cc5",
20794
- groups: "76acc9598202663738d7d2903ca1a042d9b7ca21799297946e4da39ea77d5250",
20795
- generic: "9987467e7d99ff4680fa6d7e2d2d634455f729958bfbd53ebac86c14508b031d"
20817
+ groups: "81aeee3abd2d336824d81e24c7f5fad87227ffb4ff8f247cad96c4c855912b9f",
20818
+ generic: "d97bae75af3f8493e4473d3af3220cda1bff1e51577d7e06f03648cc26ad819b"
20796
20819
  });
20797
20820
  function fill(key, text2, vars) {
20798
20821
  return text2.replace(PLACEHOLDER, (whole, name) => {
@@ -23993,7 +24016,7 @@ ${key}`);
23993
24016
  "p",
23994
24017
  "",
23995
24018
  w.t(
23996
- packTitlesOnPage(model, w) ? "groups.summary.basis.pack-titles" : "groups.summary.basis"
24019
+ (packTitlesOnPage(model, w) ? "groups.summary.basis.pack-titles" : "groups.summary.basis") + (presentation.version === 2 ? ".v2" : "")
23997
24020
  )
23998
24021
  );
23999
24022
  basis.dataset.basis = "terms";
@@ -24043,11 +24066,13 @@ ${key}`);
24043
24066
  const fh = el9("div", "fh");
24044
24067
  fh.append(
24045
24068
  maybeProducer(w, "b", "", w.t("groups.finding", { id: finding.id }), true),
24046
- severityPill(finding.severity, w),
24069
+ ...finding.severity === void 0 ? [] : [severityPill(finding.severity, w)],
24047
24070
  element4("span", count(w, "session", finding.sessionIds.length))
24048
24071
  );
24049
24072
  box.append(fh);
24050
- box.append(maybeProducer(w, "div", "rec", finding.recommendation, true));
24073
+ const statement = finding.observed ?? finding.recommendation;
24074
+ if (statement !== void 0)
24075
+ box.append(maybeProducer(w, "div", "rec", statement, true));
24051
24076
  const own = el9("div", "own", w.t("groups.finding.owner"));
24052
24077
  own.append(producerText(w, finding.ownerDue));
24053
24078
  box.append(own);
@@ -24478,12 +24503,8 @@ ${key}`);
24478
24503
  renderReportProofs2(levels.L2, model, bundle, verified, w);
24479
24504
  }
24480
24505
 
24481
- // src/generic-report-view.ts
24482
- var GENERIC_FRAME = {
24483
- tag: "div",
24484
- className: "gr",
24485
- page: "contract-report",
24486
- css: `
24506
+ // src/generic-report-styles.ts
24507
+ var GENERIC_REPORT_CSS = `
24487
24508
  .gr{${COMPLIANCE_FRAME_VARS}
24488
24509
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
24489
24510
  .gr *{box-sizing:border-box}
@@ -24501,7 +24522,18 @@ ${key}`);
24501
24522
  .gr .rreason{margin:4px 0 6px 22px}
24502
24523
  .gr .rreason[data-tone="warn"],.gr .rflag[data-tone="warn"]{background:var(--bad-l);color:var(--bad);font-weight:700}
24503
24524
  .gr .tier-note{font-size:12.5px;color:var(--slate)}
24504
- ` + levelCss("gr") + frontCss(".gr")
24525
+ .gr .rcpt{margin:6px 0 6px 22px;font-size:13px}
24526
+ .gr .rcpt button{font:inherit;color:var(--navy);background:#fff;border:1px solid var(--navy);border-radius:6px;padding:2px 10px;cursor:pointer}
24527
+ .gr .rcpt-note{color:var(--slate);margin:0}
24528
+ .gr .rcpt-panel{margin-top:8px;border-top:1px solid #D9DDE3;padding-top:8px}
24529
+ ` + levelCss("gr") + frontCss(".gr");
24530
+
24531
+ // src/generic-report-view.ts
24532
+ var GENERIC_FRAME = {
24533
+ tag: "div",
24534
+ className: "gr",
24535
+ page: "contract-report",
24536
+ css: GENERIC_REPORT_CSS
24505
24537
  };
24506
24538
  var VERDICT_TONE = {
24507
24539
  met: "ok",
@@ -24620,7 +24652,76 @@ ${key}`);
24620
24652
  );
24621
24653
  return [line];
24622
24654
  }
24623
- function claimItem(claim, w, reasons) {
24655
+ function dealIdOf(claimId) {
24656
+ const at = claimId.indexOf("::");
24657
+ return at > 0 ? claimId.slice(0, at) : void 0;
24658
+ }
24659
+ function receiptLine(claim, w, receipts3) {
24660
+ const deal = dealIdOf(claim.id);
24661
+ if (deal === void 0) return [];
24662
+ const line = el10("div", "rcpt");
24663
+ line.dataset.receiptDeal = deal;
24664
+ const text2 = Object.prototype.hasOwnProperty.call(receipts3.texts, deal) ? receipts3.texts[deal] : void 0;
24665
+ if (text2 === void 0 || text2 === null) {
24666
+ const note = el10(
24667
+ "p",
24668
+ "rcpt-note",
24669
+ w.t(
24670
+ text2 === null ? "generic.receipt.withheld" : "generic.receipt.not_carried"
24671
+ )
24672
+ );
24673
+ note.dataset.receipt = text2 === null ? "withheld" : "not-carried";
24674
+ line.append(note);
24675
+ return [line];
24676
+ }
24677
+ const button = el10(
24678
+ "button",
24679
+ "",
24680
+ w.t("generic.receipt.open")
24681
+ );
24682
+ button.setAttribute("type", "button");
24683
+ button.setAttribute("aria-expanded", "false");
24684
+ button.dataset.receipt = "open";
24685
+ const panel = el10("div", "rcpt-panel");
24686
+ panel.hidden = true;
24687
+ let state = "closed";
24688
+ button.addEventListener("click", () => {
24689
+ if (state === "shown") {
24690
+ panel.hidden = true;
24691
+ state = "hidden";
24692
+ button.setAttribute("aria-expanded", "false");
24693
+ button.textContent = w.t("generic.receipt.open");
24694
+ return;
24695
+ }
24696
+ panel.hidden = false;
24697
+ button.setAttribute("aria-expanded", "true");
24698
+ button.textContent = w.t("generic.receipt.close");
24699
+ if (state === "hidden") {
24700
+ state = "shown";
24701
+ return;
24702
+ }
24703
+ state = "shown";
24704
+ button.disabled = true;
24705
+ const showOutcome = (outcome) => {
24706
+ button.disabled = false;
24707
+ panel.dataset.receiptState = outcome;
24708
+ if (outcome === "opened") return;
24709
+ panel.replaceChildren(
24710
+ el10(
24711
+ "p",
24712
+ "rcpt-note",
24713
+ w.t(
24714
+ outcome === "no-module" ? "generic.receipt.no_module" : outcome === "unverified" ? "generic.receipt.unverified" : "generic.receipt.unreadable"
24715
+ )
24716
+ )
24717
+ );
24718
+ };
24719
+ receipts3.open(text2, panel).then(showOutcome, () => showOutcome("unreadable"));
24720
+ });
24721
+ line.append(button, panel);
24722
+ return [line];
24723
+ }
24724
+ function claimItem(claim, w, reasons, receipts3) {
24624
24725
  const item = el10("li", "");
24625
24726
  item.dataset.claimRef = claim.id;
24626
24727
  const head2 = el10("span", "");
@@ -24628,11 +24729,12 @@ ${key}`);
24628
24729
  head2.append(id, " ", verdictPill(shownVerdict(claim), w));
24629
24730
  item.append(
24630
24731
  levelToggle(2, head2, () => claimProofs(claim, w), { className: "claim" }),
24631
- ...reasonLines(claim, w, reasons)
24732
+ ...reasonLines(claim, w, reasons),
24733
+ ...receipts3 === void 0 ? [] : receiptLine(claim, w, receipts3)
24632
24734
  );
24633
24735
  return item;
24634
24736
  }
24635
- function rowItem(row2, w, later, tierOf, reasons) {
24737
+ function rowItem(row2, w, later, tierOf, reasons, receipts3) {
24636
24738
  const label = w.row(row2.requirementRef, "label");
24637
24739
  const name = el10("span", "rname");
24638
24740
  if (label !== void 0)
@@ -24675,7 +24777,8 @@ ${key}`);
24675
24777
  ))
24676
24778
  body.append(el10("p", "rnote", w.t("generic.later.note", { date })));
24677
24779
  const list2 = el10("ul", "claims");
24678
- for (const claim of row2.claims) list2.append(claimItem(claim, w, reasons));
24780
+ for (const claim of row2.claims)
24781
+ list2.append(claimItem(claim, w, reasons, receipts3));
24679
24782
  body.append(el10("h3", "", w.t("generic.claims.h")), list2);
24680
24783
  return body;
24681
24784
  },
@@ -24685,7 +24788,7 @@ ${key}`);
24685
24788
  toggle.dataset.contract = row2.contractRef;
24686
24789
  return toggle;
24687
24790
  }
24688
- function groupedRows(rows, w, later, tierOf, reasons) {
24791
+ function groupedRows(rows, w, later, tierOf, reasons, receipts3) {
24689
24792
  const box = el10("div", "groups");
24690
24793
  const order = [];
24691
24794
  const byGroup = /* @__PURE__ */ new Map();
@@ -24710,7 +24813,7 @@ ${key}`);
24710
24813
  part.append(heading);
24711
24814
  }
24712
24815
  for (const row2 of byGroup.get(group))
24713
- part.append(rowItem(row2, w, later, tierOf, reasons));
24816
+ part.append(rowItem(row2, w, later, tierOf, reasons, receipts3));
24714
24817
  box.append(part);
24715
24818
  }
24716
24819
  return box;
@@ -24720,10 +24823,10 @@ ${key}`);
24720
24823
  heading.append(" ", tagSource(el10("code", "", contract), "producer"));
24721
24824
  return heading;
24722
24825
  }
24723
- function byContract(rows, w, later, tierOf, reasons) {
24826
+ function byContract(rows, w, later, tierOf, reasons, receipts3) {
24724
24827
  const contracts = [...new Set(rows.map((row2) => row2.contractRef))];
24725
24828
  if (contracts.length <= 1)
24726
- return groupedRows(rows, w, later, tierOf, reasons);
24829
+ return groupedRows(rows, w, later, tierOf, reasons, receipts3);
24727
24830
  const box = el10("div", "contracts");
24728
24831
  for (const contract of contracts) {
24729
24832
  const part = el10("div", "contract");
@@ -24735,14 +24838,15 @@ ${key}`);
24735
24838
  w,
24736
24839
  later,
24737
24840
  tierOf,
24738
- reasons
24841
+ reasons,
24842
+ receipts3
24739
24843
  )
24740
24844
  );
24741
24845
  box.append(part);
24742
24846
  }
24743
24847
  return box;
24744
24848
  }
24745
- async function drawGeneric(levels, result3, bundle, verified, w, tierOf, reasons) {
24849
+ async function drawGeneric(levels, result3, bundle, verified, w, tierOf, reasons, receipts3) {
24746
24850
  const tierFor = (claim) => tierOf === void 0 ? "unstated" : tierOf(claim.contractRef, claim.requirementRef);
24747
24851
  const inForce = result3.claims.filter((claim) => !claim.later);
24748
24852
  const later = result3.claims.filter((claim) => claim.later);
@@ -24768,7 +24872,7 @@ ${key}`);
24768
24872
  section.dataset.section = "rows";
24769
24873
  const rows = rowsOf(inForce);
24770
24874
  if (tierOf === void 0)
24771
- section.append(byContract(rows, w, false, void 0, reasons));
24875
+ section.append(byContract(rows, w, false, void 0, reasons, receipts3));
24772
24876
  else
24773
24877
  for (const tier of ROW_TIERS) {
24774
24878
  const inTier = rows.filter(
@@ -24786,7 +24890,7 @@ ${key}`);
24786
24890
  })
24787
24891
  ),
24788
24892
  el10("p", "rnote", w.t(`generic.rtier.${tier}.note`)),
24789
- byContract(inTier, w, false, tierOf, reasons)
24893
+ byContract(inTier, w, false, tierOf, reasons, receipts3)
24790
24894
  );
24791
24895
  section.append(part);
24792
24896
  }
@@ -24800,7 +24904,7 @@ ${key}`);
24800
24904
  "",
24801
24905
  w.t("generic.later.title", { n: later.length.toLocaleString() })
24802
24906
  ),
24803
- byContract(laterRows, w, true, tierOf, reasons)
24907
+ byContract(laterRows, w, true, tierOf, reasons, receipts3)
24804
24908
  );
24805
24909
  section.append(part);
24806
24910
  }
@@ -24855,7 +24959,7 @@ ${key}`);
24855
24959
  function citesOneContract(result3) {
24856
24960
  return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
24857
24961
  }
24858
- async function renderContractReport(result3, input, bundle, verified, host, wording, contract) {
24962
+ async function renderContractReport(result3, input, bundle, verified, host, wording, contract, receipts3) {
24859
24963
  const tierOf = tierReader(result3, contract);
24860
24964
  const w = await contractReportWords(input.grouping, wording, {
24861
24965
  singleContract: citesOneContract(result3)
@@ -24943,7 +25047,8 @@ ${key}`);
24943
25047
  tierOf,
24944
25048
  // The pack's `row.<ref>.reason.<code>` words apply only to a Result
24945
25049
  // citing one contract (the Words gate); the reason itself shows always.
24946
- input.reasons
25050
+ input.reasons,
25051
+ receipts3
24947
25052
  );
24948
25053
  regions.L0.append(levels.L0);
24949
25054
  regions.L1.append(levels.L1);
@@ -26197,23 +26302,31 @@ ${pad.repeat(depth)}`;
26197
26302
  function strArray(value) {
26198
26303
  return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
26199
26304
  }
26200
- function readFinding(value) {
26305
+ var COMPLIANCE_KEY_V1 = "eu-ai-act-compliance/v1";
26306
+ var COMPLIANCE_KEY_V2 = "eu-ai-act-obligations-report/v2";
26307
+ function readFinding(value, key) {
26201
26308
  const obj = object12(value);
26202
26309
  const id = str2(obj?.id);
26310
+ const ownerDue = str2(obj?.owner_due);
26311
+ if (key === COMPLIANCE_KEY_V2) {
26312
+ const observed = str2(obj?.observed);
26313
+ if (id === void 0 || observed === void 0 || ownerDue === void 0)
26314
+ return void 0;
26315
+ return { id, observed, ownerDue };
26316
+ }
26203
26317
  const severity = str2(obj?.severity);
26204
26318
  const recommendation = str2(obj?.recommendation);
26205
- const ownerDue = str2(obj?.owner_due);
26206
26319
  if (id === void 0 || severity === void 0 || recommendation === void 0 || ownerDue === void 0)
26207
26320
  return void 0;
26208
26321
  return { id, severity, recommendation, ownerDue };
26209
26322
  }
26210
- function readRow(value) {
26323
+ function readRow(value, key) {
26211
26324
  const obj = object12(value);
26212
26325
  const criterionId = str2(obj?.criterion_id);
26213
26326
  const name = str2(obj?.name);
26214
26327
  if (criterionId === void 0 || name === void 0) return void 0;
26215
26328
  const notEvaluableNote = str2(obj?.not_evaluable_note);
26216
- const finding = obj?.finding === void 0 ? void 0 : readFinding(obj.finding);
26329
+ const finding = obj?.finding === void 0 ? void 0 : readFinding(obj.finding, key);
26217
26330
  return {
26218
26331
  criterionId,
26219
26332
  name,
@@ -26228,7 +26341,7 @@ ${pad.repeat(depth)}`;
26228
26341
  if (status2 === void 0 || note === void 0) return void 0;
26229
26342
  return { status: status2, note };
26230
26343
  }
26231
- function readObligation(value) {
26344
+ function readObligation(value, extension) {
26232
26345
  const obj = object12(value);
26233
26346
  const key = str2(obj?.key);
26234
26347
  const article = str2(obj?.article);
@@ -26239,7 +26352,7 @@ ${pad.repeat(depth)}`;
26239
26352
  if (key === void 0 || article === void 0 || title === void 0 || plain2 === void 0 || method === void 0 || applicability === void 0)
26240
26353
  return void 0;
26241
26354
  const rows = Array.isArray(obj?.rows) ? obj.rows.flatMap((r) => {
26242
- const row2 = readRow(r);
26355
+ const row2 = readRow(r, extension);
26243
26356
  return row2 === void 0 ? [] : [row2];
26244
26357
  }) : [];
26245
26358
  return {
@@ -26267,25 +26380,29 @@ ${pad.repeat(depth)}`;
26267
26380
  ...note === void 0 ? {} : { note }
26268
26381
  };
26269
26382
  }
26270
- function readCompliancePresentation(bundle) {
26383
+ function readComplianceBlock(bundle, key) {
26271
26384
  const top = object12(bundle);
26272
26385
  const extensions2 = object12(top?.extensions);
26273
- const block = object12(extensions2?.["eu-ai-act-compliance/v1"]);
26386
+ const block = object12(extensions2?.[key]);
26274
26387
  if (block === void 0 || block.enabled !== true) return void 0;
26275
26388
  const regulation = str2(block.regulation) ?? "Regulation (EU) 2024/1689";
26276
26389
  const obligations = Array.isArray(block.obligations) ? block.obligations.flatMap((o) => {
26277
- const obligation = readObligation(o);
26390
+ const obligation = readObligation(o, key);
26278
26391
  return obligation === void 0 ? [] : [obligation];
26279
26392
  }) : [];
26280
26393
  if (obligations.length === 0) return void 0;
26281
26394
  const qualityProtocol = readQualityProtocol(block.quality_protocol);
26282
26395
  return {
26283
26396
  enabled: true,
26397
+ version: key === COMPLIANCE_KEY_V2 ? 2 : 1,
26284
26398
  regulation,
26285
26399
  obligations,
26286
26400
  ...qualityProtocol === void 0 ? {} : { qualityProtocol }
26287
26401
  };
26288
26402
  }
26403
+ function readCompliancePresentation(bundle) {
26404
+ return readComplianceBlock(bundle, COMPLIANCE_KEY_V2) ?? readComplianceBlock(bundle, COMPLIANCE_KEY_V1);
26405
+ }
26289
26406
 
26290
26407
  // src/presentation-registry.ts
26291
26408
  var PRESENTATION_MANIFEST_VERSION = "aac.presentation-manifest/v0";
@@ -26377,7 +26494,7 @@ ${pad.repeat(depth)}`;
26377
26494
  var EXTENSION_READERS = {
26378
26495
  [CONTRACT_REPORT_KIND]: readContractReport,
26379
26496
  "outcome-report/v1": (bundle) => readOutcomeReportPresentation(bundle) !== void 0,
26380
- "eu-ai-act-compliance/v1": (bundle) => readCompliancePresentation(bundle) !== void 0
26497
+ [COMPLIANCE_KEY_V1]: (bundle) => readComplianceBlock(bundle, COMPLIANCE_KEY_V1) !== void 0
26381
26498
  };
26382
26499
  function describeContext(context) {
26383
26500
  const bundle = isPlainObject(context.bundle) ? context.bundle : {};
@@ -26608,9 +26725,16 @@ ${pad.repeat(depth)}`;
26608
26725
  id: "outcome-report-card",
26609
26726
  accepts: (bundle) => readOutcomeReportPresentation(bundle) !== void 0
26610
26727
  },
26611
- "eu-ai-act-compliance/v1": {
26728
+ [COMPLIANCE_KEY_V1]: {
26612
26729
  id: "compliance-card",
26613
- accepts: (bundle) => readCompliancePresentation(bundle) !== void 0
26730
+ // The card draws the v2 block when it accepts one, so the v1 block is
26731
+ // read only when no v2 block is accepted.
26732
+ accepts: (bundle) => readComplianceBlock(bundle, COMPLIANCE_KEY_V1) !== void 0 && readComplianceBlock(bundle, COMPLIANCE_KEY_V2) === void 0
26733
+ },
26734
+ // The v2 name of the same card (findings state what was observed).
26735
+ [COMPLIANCE_KEY_V2]: {
26736
+ id: "compliance-card",
26737
+ accepts: (bundle) => readComplianceBlock(bundle, COMPLIANCE_KEY_V2) !== void 0
26614
26738
  }
26615
26739
  });
26616
26740
  function aliasExtensionRows(bundle, rows, applied) {
@@ -26701,9 +26825,10 @@ ${pad.repeat(depth)}`;
26701
26825
  }
26702
26826
  const link = element6("a", CHECKED_SECTION_TITLE);
26703
26827
  link.className = "cv-shell-link";
26704
- link.setAttribute("href", `#${CHECKED_SECTION_ID}`);
26828
+ const checkedId = checkedSectionId(root);
26829
+ link.setAttribute("href", `#${checkedId}`);
26705
26830
  link.addEventListener("click", () => {
26706
- const section = root.ownerDocument.getElementById(CHECKED_SECTION_ID);
26831
+ const section = root.ownerDocument.getElementById(checkedId);
26707
26832
  if (section instanceof root.ownerDocument.defaultView.HTMLDetailsElement)
26708
26833
  section.open = true;
26709
26834
  });
@@ -26820,6 +26945,24 @@ ${pad.repeat(depth)}`;
26820
26945
  ]);
26821
26946
  var CHECKED_SECTION_TITLE = "How this page was checked";
26822
26947
  var CHECKED_SECTION_ID = "cv-checked";
26948
+ var checkedIds = /* @__PURE__ */ new WeakMap();
26949
+ var renderRoots = /* @__PURE__ */ new WeakSet();
26950
+ var nestedRenders = 0;
26951
+ function checkedSectionId(root) {
26952
+ const known = checkedIds.get(root);
26953
+ if (known !== void 0) return known;
26954
+ let nested = false;
26955
+ for (let a = root.parentElement; a !== null; a = a.parentElement)
26956
+ if (renderRoots.has(a)) {
26957
+ nested = true;
26958
+ break;
26959
+ }
26960
+ renderRoots.add(root);
26961
+ nestedRenders += 1;
26962
+ const id = nested ? `${CHECKED_SECTION_ID}-${nestedRenders}` : CHECKED_SECTION_ID;
26963
+ checkedIds.set(root, id);
26964
+ return id;
26965
+ }
26823
26966
  function renderPresentationHeader(root, bundle) {
26824
26967
  const presentation = readPresentationBlock(bundle);
26825
26968
  if (presentation === void 0) return;
@@ -27242,7 +27385,7 @@ ${pad.repeat(depth)}`;
27242
27385
  scope.dataset.checks = "scope";
27243
27386
  host.append(scope);
27244
27387
  }
27245
- async function renderVerificationPage(root, context, styled, applied, refused, citedSigners, verifierHint, depth, stamps, charts, contract, l3) {
27388
+ async function renderVerificationPage(root, context, styled, applied, refused, citedSigners, verifierHint, depth, stamps, charts, contract, l3, checkedId) {
27246
27389
  const { bundle, verification: verified } = context;
27247
27390
  const section = element6("section");
27248
27391
  section.dataset.page = "verification";
@@ -27352,7 +27495,7 @@ ${pad.repeat(depth)}`;
27352
27495
  page.append(element6("p", model.verifyIndependentlyLine));
27353
27496
  const folded = document.createElement("details");
27354
27497
  folded.className = "cv-checked";
27355
- folded.id = CHECKED_SECTION_ID;
27498
+ folded.id = checkedId;
27356
27499
  folded.dataset.checked = "";
27357
27500
  folded.open = !bundleVerified(verified) || depth === "L2";
27358
27501
  const line = checkedSummaryLine(bundleVerified(verified), model);
@@ -28244,7 +28387,8 @@ ${pad.repeat(depth)}`;
28244
28387
  model.verification,
28245
28388
  { L0: host.L0, L1: host.L1, L2: host.L2, depth: host.depth },
28246
28389
  host.wording,
28247
- host.contract
28390
+ host.contract,
28391
+ host.receipts
28248
28392
  );
28249
28393
  }
28250
28394
  };
@@ -28652,6 +28796,33 @@ ${pad.repeat(depth)}`;
28652
28796
  }
28653
28797
  var SETTLE_MS = 100;
28654
28798
  var checkingRenders = /* @__PURE__ */ new WeakMap();
28799
+ var RECEIPT_MODULE_IDS = /* @__PURE__ */ new Set([
28800
+ "capsulectl.deal-view/v0",
28801
+ "capsulectl.deal-view-composed/v0"
28802
+ ]);
28803
+ async function openReceipt(text2, panel, options) {
28804
+ let bundle;
28805
+ try {
28806
+ bundle = JSON.parse(text2);
28807
+ } catch {
28808
+ return "unreadable";
28809
+ }
28810
+ const context = await buildVerifiedBundleContext(bundle);
28811
+ const registry = options.registry ?? defaultRegistry;
28812
+ const resolution = await registry.resolve(
28813
+ context,
28814
+ DEFAULT_AUDIENCE,
28815
+ DEFAULT_FORMAT
28816
+ );
28817
+ if (resolution.kind !== "module" || !RECEIPT_MODULE_IDS.has(resolution.module.manifest.id))
28818
+ return bundleVerified(context.verification) ? "no-module" : "unverified";
28819
+ await renderEvidenceGraph(context, panel, void 0, {
28820
+ audience: DEFAULT_AUDIENCE,
28821
+ format: DEFAULT_FORMAT,
28822
+ ...options.registry === void 0 ? {} : { registry: options.registry }
28823
+ });
28824
+ return "opened";
28825
+ }
28655
28826
  async function renderVerifiedContext(context, root, options) {
28656
28827
  const { bundle, verification } = context;
28657
28828
  const verified = bundleVerified(verification);
@@ -28938,6 +29109,12 @@ ${pad.repeat(depth)}`;
28938
29109
  depth,
28939
29110
  ...options.wording === void 0 ? {} : { wording: options.wording },
28940
29111
  ...contract.checked === void 0 ? {} : { contract: contract.checked },
29112
+ ...options.receipts === void 0 ? {} : {
29113
+ receipts: {
29114
+ texts: options.receipts,
29115
+ open: (text2, panel) => openReceipt(text2, panel, options)
29116
+ }
29117
+ },
28941
29118
  setChromeClass(name) {
28942
29119
  if (name !== OUTCOME_CHROME && name !== COMPLIANCE_CHROME)
28943
29120
  throw new Error(`unknown chrome class ${JSON.stringify(name)}`);
@@ -29036,7 +29213,8 @@ ${pad.repeat(depth)}`;
29036
29213
  options.wording
29037
29214
  ),
29038
29215
  voice: options.voice ?? "shared"
29039
- } : void 0
29216
+ } : void 0,
29217
+ checkedSectionId(root)
29040
29218
  );
29041
29219
  const summary = root.querySelector("[data-verify-summary]");
29042
29220
  if (summary !== null) summary.textContent = checkedLine;
@@ -0,0 +1 @@
1
+ export declare const GENERIC_REPORT_CSS: string;
@@ -0,0 +1,36 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ /**
3
+ * The generic contract-report view's own stylesheet, scoped under `.gr`. It is
4
+ * its own module, as the other cards' are, so the emitter can list its hash in
5
+ * the page's CSP (CORE_RUNTIME_STYLES): the view inserts it as a `<style>`
6
+ * element at render time.
7
+ */
8
+ import { COMPLIANCE_FRAME_VARS } from "./frame-tokens.generated.js";
9
+ import { levelCss } from "./report-levels.js";
10
+ import { frontCss } from "./report-front-styles.js";
11
+ export const GENERIC_REPORT_CSS = `
12
+ .gr{${COMPLIANCE_FRAME_VARS}
13
+ font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
14
+ .gr *{box-sizing:border-box}
15
+ .gr h1,.gr h2,.gr h3{font-family:Georgia,"Iowan Old Style",Cambria,serif;color:var(--navy);margin:0}
16
+ .gr h1{font-size:28px;margin:6px 0 4px}
17
+ .gr h2{font-size:21px;margin:0 0 6px}
18
+ .gr h3{font-size:17px;margin:18px 0 6px}
19
+ .gr .rsum,.gr .counts{color:var(--slate);margin:0 0 8px}
20
+ .gr .rnote{font-size:12.5px;color:var(--slate);margin:2px 0 8px}
21
+ .gr .tally{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:13px;margin:4px 0}
22
+ .gr .rname{font-weight:600;color:var(--navy)}
23
+ .gr .rname code,.gr .cid{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;word-break:break-all}
24
+ .gr ul.claims{list-style:none;margin:6px 0 0;padding:0}
25
+ .gr .rreason,.gr .rflag{font-size:12.5px;border-radius:6px;padding:2px 8px;background:#EEF0F3;color:var(--slate)}
26
+ .gr .rreason{margin:4px 0 6px 22px}
27
+ .gr .rreason[data-tone="warn"],.gr .rflag[data-tone="warn"]{background:var(--bad-l);color:var(--bad);font-weight:700}
28
+ .gr .tier-note{font-size:12.5px;color:var(--slate)}
29
+ .gr .rcpt{margin:6px 0 6px 22px;font-size:13px}
30
+ .gr .rcpt button{font:inherit;color:var(--navy);background:#fff;border:1px solid var(--navy);border-radius:6px;padding:2px 10px;cursor:pointer}
31
+ .gr .rcpt-note{color:var(--slate);margin:0}
32
+ .gr .rcpt-panel{margin-top:8px;border-top:1px solid #D9DDE3;padding-top:8px}
33
+ ` +
34
+ levelCss("gr") +
35
+ frontCss(".gr");
36
+ //# sourceMappingURL=generic-report-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-report-styles.js","sourceRoot":"","sources":["../src/generic-report-styles.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC;;;;;GAKG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAC7B;MACI,qBAAqB;;;;;;;;;;;;;;;;;;;;;CAqB1B;IACC,QAAQ,CAAC,IAAI,CAAC;IACd,QAAQ,CAAC,KAAK,CAAC,CAAC"}
@@ -28,6 +28,20 @@ export declare const GENERIC_FRAME: {
28
28
  };
29
29
  /** The reasons the Result's producer gives for claims, by claim id (claim-reasons.ts). */
30
30
  type ReasonsOf = ReadonlyMap<string, ClaimReason>;
31
+ /** What opening a carried receipt came to: drawn, no module for it, not readable, or read but not passing its checks. */
32
+ export type ReceiptOpen = "opened" | "no-module" | "unreadable" | "unverified";
33
+ /**
34
+ * The deal receipts a report page carries (the page's `receipts` option):
35
+ * each deal's receipt bundle as the JSON text the node served, by deal id, and
36
+ * the runtime's way to draw one into a panel. The page never reads a
37
+ * receipt's content itself; the receipt module the page also carries draws it.
38
+ */
39
+ export interface ReceiptsInput {
40
+ readonly texts: Readonly<Record<string, string | null>>;
41
+ readonly open: (text: string, panel: HTMLElement) => Promise<ReceiptOpen>;
42
+ }
43
+ /** The deal a claim belongs to: its id before the first `::`, as the inference-deals Result writes it, or none. */
44
+ export declare function dealIdOf(claimId: string): string | undefined;
31
45
  /**
32
46
  * Draw the `generic` grouping into the three region wrappers
33
47
  * (contract-report.ts made them and put the stylesheet in L0).
@@ -36,5 +50,5 @@ export declare function drawGeneric(levels: {
36
50
  readonly L0: HTMLElement;
37
51
  readonly L1: HTMLElement;
38
52
  readonly L2: HTMLElement;
39
- }, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf, reasons?: ReasonsOf): Promise<void>;
53
+ }, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf, reasons?: ReasonsOf, receipts?: ReceiptsInput): Promise<void>;
40
54
  export {};