literally-aeo 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +16 -0
  2. package/dist/cli.mjs +1503 -548
  3. package/dist/lib/agents/methodology.js +3 -3
  4. package/dist/lib/bundle/contracts.js +1 -1
  5. package/dist/lib/bundle/export.js +12 -12
  6. package/dist/lib/bundle/journal.js +2 -2
  7. package/dist/lib/bundle/project-journal.js +5 -5
  8. package/dist/lib/bundle/project.js +10 -10
  9. package/dist/lib/bundle/read.js +13 -13
  10. package/dist/lib/bundle/recorder.js +3 -3
  11. package/dist/lib/bundle/redact.js +2 -2
  12. package/dist/lib/bundle/trace-coverage.js +2 -2
  13. package/dist/lib/bundle/verify-integrity.js +4 -4
  14. package/dist/lib/bundle/verify-measurement.js +2 -2
  15. package/dist/lib/bundle/verify-report.js +3 -3
  16. package/dist/lib/bundle/verify.js +8 -8
  17. package/dist/lib/checks/run-checks.js +4 -4
  18. package/dist/lib/chunks/{chunk-22SP35NA.js → chunk-2ANSPIUT.js} +1 -1
  19. package/dist/lib/chunks/{chunk-ITLJZUKL.js → chunk-54GMIPWV.js} +1 -1
  20. package/dist/lib/chunks/{chunk-QJX6YXXQ.js → chunk-65OIYOUH.js} +2 -2
  21. package/dist/lib/chunks/{chunk-ENPRRXH5.js → chunk-6MGXILUJ.js} +1 -1
  22. package/dist/lib/chunks/chunk-6OURIXQZ.js +472 -0
  23. package/dist/lib/chunks/{chunk-AMK6IHJD.js → chunk-746643QV.js} +1 -1
  24. package/dist/lib/chunks/{chunk-AMF3T5A3.js → chunk-74K4E3ZS.js} +1 -1
  25. package/dist/lib/chunks/{chunk-5EM6J7TG.js → chunk-7HCVSLVG.js} +1 -1
  26. package/dist/lib/chunks/{chunk-RWVXK7XE.js → chunk-7K2XT3WI.js} +5 -5
  27. package/dist/lib/chunks/{chunk-VOK4TUXV.js → chunk-7L4Y6N3V.js} +1 -1
  28. package/dist/lib/chunks/{chunk-TD47AB37.js → chunk-7QWT7LFM.js} +2 -2
  29. package/dist/lib/chunks/{chunk-ATKP5ZW6.js → chunk-7SA2CRSS.js} +1 -1
  30. package/dist/lib/chunks/{chunk-Q6TZB2OQ.js → chunk-ARKZ5PJN.js} +1 -1
  31. package/dist/lib/chunks/{chunk-FBMO6UV4.js → chunk-B6XGNJUU.js} +1 -1
  32. package/dist/lib/chunks/{chunk-RR63UE5H.js → chunk-BNX7S4GK.js} +4 -4
  33. package/dist/lib/chunks/chunk-BWBPEXEU.js +83 -0
  34. package/dist/lib/chunks/{chunk-DKR7LSP2.js → chunk-BZAPAGXM.js} +1 -1
  35. package/dist/lib/chunks/{chunk-FFDMGNRO.js → chunk-C2Q7YE7Y.js} +6 -6
  36. package/dist/lib/chunks/{chunk-NWABYXDQ.js → chunk-D2LJMNH3.js} +2 -2
  37. package/dist/lib/chunks/{chunk-XT5M3PPQ.js → chunk-EVEJ3MFU.js} +3 -3
  38. package/dist/lib/chunks/{chunk-U4AROC2Z.js → chunk-GC7DISQO.js} +1 -1
  39. package/dist/lib/chunks/{chunk-YRXYTCMY.js → chunk-JHUI2K5X.js} +1 -1
  40. package/dist/lib/chunks/chunk-JQFLWUCA.js +123 -0
  41. package/dist/lib/chunks/{chunk-HJEIEMPE.js → chunk-JREYIUNG.js} +4 -4
  42. package/dist/lib/chunks/{chunk-FXCUGNFL.js → chunk-JXQOWHWB.js} +1 -1
  43. package/dist/lib/chunks/{chunk-BKAERR7J.js → chunk-KFJ5O5CL.js} +2 -2
  44. package/dist/lib/chunks/{chunk-6P7EZJI7.js → chunk-KSJ3NZIJ.js} +4 -2
  45. package/dist/lib/chunks/{chunk-EZ23TKTX.js → chunk-L5HFTFFG.js} +2 -2
  46. package/dist/lib/chunks/{chunk-DI4LZR37.js → chunk-LJD37WAV.js} +2 -2
  47. package/dist/lib/chunks/{chunk-YPGJN232.js → chunk-MKA2EP7M.js} +1 -1
  48. package/dist/lib/chunks/{chunk-JN4332MJ.js → chunk-MMJ5UR2E.js} +1 -1
  49. package/dist/lib/chunks/{chunk-A2RW4ZMR.js → chunk-MQFFMD4Q.js} +1 -1
  50. package/dist/lib/chunks/{chunk-CRXJFOCK.js → chunk-NM2LUMQT.js} +4 -4
  51. package/dist/lib/chunks/{chunk-RYV25YGT.js → chunk-P5VVHTZU.js} +1 -1
  52. package/dist/lib/chunks/{chunk-JKBXKACC.js → chunk-PFG3ESJE.js} +7 -7
  53. package/dist/lib/chunks/{chunk-OF3WIGG7.js → chunk-Q7CWM6LZ.js} +6 -6
  54. package/dist/lib/chunks/{chunk-DU3MAXVC.js → chunk-R5NLULQW.js} +1 -1
  55. package/dist/lib/chunks/{chunk-T5Q5CBTA.js → chunk-RM7U5M5L.js} +1 -1
  56. package/dist/lib/chunks/{chunk-JGBJQ3TO.js → chunk-RQ6GUJI5.js} +1 -1
  57. package/dist/lib/chunks/{chunk-CMB2KSW2.js → chunk-RUSMX6JH.js} +16 -7
  58. package/dist/lib/chunks/{chunk-KFYTORIT.js → chunk-UNNRLD2U.js} +4 -4
  59. package/dist/lib/chunks/chunk-VFN2J4Z3.js +626 -0
  60. package/dist/lib/chunks/{chunk-3DVFQMJT.js → chunk-VPJN2GNC.js} +1 -1
  61. package/dist/lib/chunks/{chunk-NZOKSFIA.js → chunk-XSOTCSD3.js} +3 -3
  62. package/dist/lib/chunks/{chunk-M4XGUJMO.js → chunk-YX4EH6FR.js} +1 -1
  63. package/dist/lib/chunks/{chunk-WIRVKAYB.js → chunk-ZC4MKS3J.js} +11 -11
  64. package/dist/lib/chunks/{chunk-KC35BXW7.js → chunk-ZM4RHMBI.js} +1 -1
  65. package/dist/lib/cli/bundle-commands.js +57 -32
  66. package/dist/lib/cli/guide-command.js +1 -1
  67. package/dist/lib/cli/run-commands.js +36 -36
  68. package/dist/lib/cli/status-command.js +18 -18
  69. package/dist/lib/codex-workflow/aggregate.js +2 -2
  70. package/dist/lib/codex-workflow/author.js +3 -3
  71. package/dist/lib/codex-workflow/capture.js +5 -5
  72. package/dist/lib/codex-workflow/copy-editor.js +3 -3
  73. package/dist/lib/codex-workflow/copy.js +2 -2
  74. package/dist/lib/codex-workflow/finish.js +5 -5
  75. package/dist/lib/codex-workflow/loop.js +13 -13
  76. package/dist/lib/codex-workflow/run-source.js +5 -5
  77. package/dist/lib/codex-workflow/stage.js +4 -4
  78. package/dist/lib/engine/audit-file.js +3 -3
  79. package/dist/lib/engine/author.js +10 -10
  80. package/dist/lib/engine/cost-estimate.js +3 -3
  81. package/dist/lib/engine/local-run.js +17 -17
  82. package/dist/lib/engine/preflight.js +3 -3
  83. package/dist/lib/engine/rejudge.js +24 -24
  84. package/dist/lib/engine/resources.js +1 -1
  85. package/dist/lib/engine/run-bindings.js +3 -3
  86. package/dist/lib/engine/run-method.js +2 -2
  87. package/dist/lib/engine/run-models.js +4 -4
  88. package/dist/lib/engine/run-status.js +18 -18
  89. package/dist/lib/engine/templates.js +4 -4
  90. package/dist/lib/grounding/grounding-runtime.js +5 -5
  91. package/dist/lib/grounding/recorded-tools.js +4 -4
  92. package/dist/lib/pipeline.js +4 -4
  93. package/dist/lib/probes/bindings.js +2 -2
  94. package/dist/lib/probes/charged-trace.js +3 -3
  95. package/dist/lib/probes/probes.js +3 -3
  96. package/dist/lib/viewer/alternatives.js +8 -0
  97. package/dist/lib/viewer/cited-domains.js +8 -0
  98. package/dist/lib/viewer/page.js +3 -1
  99. package/dist/lib/viewer/presentation.js +41 -0
  100. package/dist/lib/viewer/server.js +15 -10
  101. package/dist/types/bundle/contracts.d.ts +1 -1
  102. package/dist/types/engine/resources.d.ts +2 -0
  103. package/dist/types/viewer/alternatives.d.ts +16 -0
  104. package/dist/types/viewer/cited-domains.d.ts +22 -0
  105. package/dist/types/viewer/page.d.ts +9 -2
  106. package/dist/types/viewer/presentation.d.ts +112 -0
  107. package/dist/types/viewer/server.d.ts +7 -3
  108. package/package.json +2 -1
  109. package/resources/fonts/Mulish-OFL.txt +93 -0
  110. package/resources/fonts/Mulish-VariableFont_wght.ttf +0 -0
  111. package/resources/fonts/SourceCodePro-OFL.txt +93 -0
  112. package/resources/fonts/SourceCodePro-VariableFont_wght.ttf +0 -0
  113. package/src/bundle/contracts.ts +1 -1
  114. package/src/cli/bundle-commands.ts +21 -0
  115. package/src/engine/resources.ts +9 -5
  116. package/src/report/core/rate-interval.ts +1 -2
  117. package/src/viewer/alternatives.ts +202 -0
  118. package/src/viewer/cited-domains.ts +127 -0
  119. package/src/viewer/page.ts +549 -236
  120. package/src/viewer/presentation.ts +759 -0
  121. package/src/viewer/server.ts +25 -4
  122. package/dist/lib/chunks/chunk-3TF4JGQA.js +0 -323
@@ -0,0 +1,626 @@
1
+ // src/viewer/page.ts
2
+ var styles = `
3
+ :root {
4
+ --darkest: #000; --lightest: #fff; --brand-1: #ffd08a; --brand-1-light: #ffedd2;
5
+ --neutral-1: #f1f1f1; --neutral-2: #c8c8c8; --positive: #059669;
6
+ --positive-deep: #065f46; --mention: #8b5cf6; --mention-deep: #5b21b6;
7
+ --negative: #ef4444; --muted: rgb(0 0 0 / 0.6); --muted-strong: rgb(0 0 0 / 0.7);
8
+ --backdrop: rgb(0 0 0 / 0.25);
9
+ --font-body: Mulish, system-ui, -apple-system, "Segoe UI", sans-serif;
10
+ --font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
11
+ /* Light only, as the hosted report is, whatever the system theme. */
12
+ color-scheme: light;
13
+ }
14
+ * { box-sizing: border-box; }
15
+ html { -webkit-text-size-adjust: 100%; }
16
+ body { margin: 0; background: var(--lightest); color: var(--darkest);
17
+ font: 16px/1.5 var(--font-body); }
18
+ p, h1, h2, h3, ul { margin: 0; }
19
+ ul { padding: 0; list-style: none; }
20
+ button { font: inherit; color: inherit; }
21
+ button:not(:disabled) { cursor: pointer; }
22
+ :focus-visible { outline: 2px solid var(--darkest); outline-offset: 2px; }
23
+ .mono { font-family: var(--font-mono); }
24
+ .muted { color: var(--muted); }
25
+ .container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
26
+ .band { background: var(--lightest); }
27
+ .band.soft { background: var(--neutral-1); }
28
+ .band > .container > .band-inner { padding: 60px 0; }
29
+ .banner { background: var(--darkest); color: var(--lightest); padding: 12px 20px;
30
+ text-align: center; font-size: 14px; }
31
+ .eyebrow { font-family: var(--font-mono); font-size: 14px; line-height: 20px;
32
+ font-weight: 500; text-transform: uppercase; }
33
+ .h1 { font-size: 32px; line-height: 37px; font-weight: 900; text-wrap: balance; }
34
+ .h2 { font-size: 28px; line-height: 34px; font-weight: 900; text-wrap: balance; }
35
+ .h5 { font-size: 18px; line-height: 25px; font-weight: 800; }
36
+ .body-1 { font-size: 20px; line-height: 24px; font-weight: 500; }
37
+ .body-2 { font-size: 18px; line-height: 22px; font-weight: 500; }
38
+ .hero { background: var(--brand-1-light); }
39
+ .hero-grid { display: grid; gap: 40px; padding: 40px 0 60px; }
40
+ .hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
41
+ .hero-copy .body-1 { max-width: 720px; }
42
+ .measured { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--muted); }
43
+ .measurement { border: 1px solid var(--neutral-2); border-radius: 8px; background: var(--lightest);
44
+ padding: 20px; box-shadow: 8px 8px var(--neutral-2); }
45
+ .measurement-figure { font-size: 50px; line-height: 56px; font-weight: 900; margin-top: 12px; }
46
+ .facts { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
47
+ .facts li { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500;
48
+ border: 1px solid var(--neutral-2); border-radius: 4px; background: var(--neutral-1); padding: 12px; }
49
+ .header { display: grid; gap: 16px; }
50
+ .header-title { display: flex; flex-direction: column; gap: 12px; }
51
+ .header.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
52
+ .header.center .body-2 { max-width: 820px; }
53
+ .scorecards { margin-top: 40px; border-radius: 16px; background: var(--brand-1-light); padding: 30px 20px; }
54
+ .scorecards-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
55
+ .stat { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
56
+ .stat-figure { font-family: var(--font-mono); font-size: 40px; line-height: 36px;
57
+ font-variant-numeric: tabular-nums; }
58
+ .stat-label { font-size: 16px; font-weight: 700; }
59
+ .stat-detail { font-size: 14px; color: var(--muted-strong); }
60
+ .interval { display: block; }
61
+ .tip-trigger { background: none; border: 0; padding: 0; margin: 0; text-align: left;
62
+ font-size: 14px; color: var(--muted-strong); text-decoration: underline dotted;
63
+ text-underline-offset: 4px; cursor: help; }
64
+ .tip { display: block; margin-top: 4px; font-size: 12px; color: var(--muted-strong); }
65
+ .tip[hidden] { display: none; }
66
+ .subsection { margin-top: 40px; }
67
+ .card { margin-top: 20px; border: 1px solid var(--neutral-2); border-radius: 8px;
68
+ background: var(--lightest); padding: 20px; }
69
+ .card-title { font-size: 16px; font-weight: 700; }
70
+ .card-lead { margin-top: 4px; font-size: 14px; color: var(--muted); }
71
+ .scroll { overflow-x: auto; }
72
+ table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
73
+ th { font-family: var(--font-mono); font-weight: 500; color: var(--muted); text-align: left;
74
+ border-bottom: 1px solid var(--neutral-2); padding: 8px 12px; }
75
+ td { border-bottom: 1px solid var(--neutral-2); padding: 10px 12px; vertical-align: top; }
76
+ .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
77
+ .rate { font-weight: 600; font-variant-numeric: tabular-nums; }
78
+ tr.total td { border-bottom: 0; font-weight: 700; color: var(--darkest); }
79
+ tr.selectable { cursor: pointer; }
80
+ tr.selectable:hover { background: var(--neutral-1); }
81
+ .row-button { background: none; border: 0; padding: 0; text-align: left; }
82
+ .matrix-card { margin-top: 40px; padding: 16px; }
83
+ .matrix { min-width: 640px; }
84
+ .matrix th, .matrix td { text-align: center; padding: 8px 12px; }
85
+ .matrix th.prompt-head, .matrix td.prompt { text-align: left; position: sticky; left: 0;
86
+ z-index: 1; background: var(--lightest); }
87
+ .matrix td.prompt { max-width: 280px; }
88
+ .matrix .group { border-bottom: 0; padding-bottom: 4px; font-size: 11px; letter-spacing: 0.05em;
89
+ text-transform: uppercase; }
90
+ .matrix .agents-start { border-left: 1px solid var(--neutral-2); }
91
+ .prompt-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
92
+ overflow: hidden; font-size: 12px; line-height: 1.375; }
93
+ .prompt-category { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em;
94
+ text-transform: uppercase; color: var(--muted); }
95
+ .cell { display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
96
+ gap: 2px; min-width: 36px; min-height: 36px; padding: 4px 6px; border: 1px solid transparent;
97
+ border-radius: 6px; background: none; }
98
+ .cell:hover { border-color: var(--neutral-2); background: var(--neutral-1); }
99
+ .cell-count { font-size: 9px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
100
+ .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral-2); }
101
+ .dot.primary { width: 10px; height: 10px; background: var(--positive); }
102
+ .dot.mentioned { background: var(--mention); }
103
+ .dot.absent { background: var(--negative); opacity: 0.7; }
104
+ .legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; font-size: 11px; color: var(--muted); }
105
+ .legend li { display: flex; align-items: center; gap: 8px; }
106
+ .hint { margin-top: 12px; border: 1px solid var(--brand-1); border-radius: 6px;
107
+ background: var(--brand-1-light); padding: 8px 12px; font-size: 12px; line-height: 1.625; }
108
+ .bars { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
109
+ .bars li { display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto; align-items: center; gap: 12px; }
110
+ .bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
111
+ .bar-domain { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--muted); }
112
+ .bar { height: 6px; overflow: hidden; border-radius: 999px; background: var(--neutral-1); }
113
+ .bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--darkest); }
114
+ .bar-value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
115
+ .hosts { margin-left: 8px; font-size: 12px; color: var(--muted); }
116
+ .more { margin-top: 12px; background: none; border: 0; padding: 0; font-family: var(--font-mono);
117
+ font-size: 12px; text-decoration: underline; text-decoration-color: var(--brand-1);
118
+ text-decoration-thickness: 2px; text-underline-offset: 4px; }
119
+ .label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
120
+ text-transform: uppercase; color: var(--muted); }
121
+ .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
122
+ .pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--neutral-2);
123
+ border-radius: 999px; background: var(--neutral-1); padding: 4px 10px; font-size: 12px; }
124
+ .pill.plain { background: var(--lightest); }
125
+ .pill.dashed { border-style: dashed; background: none; color: var(--muted); }
126
+ .pill.mono { font-family: var(--font-mono); }
127
+ .pill.pass, .pill.primary { border-color: rgb(5 150 105 / 0.3); background: rgb(5 150 105 / 0.1);
128
+ color: var(--positive-deep); font-weight: 500; }
129
+ .pill.mentioned { border-color: rgb(139 92 246 / 0.3); background: rgb(139 92 246 / 0.1);
130
+ color: var(--mention-deep); font-weight: 500; }
131
+ .pill.fail, .pill.absent { border-color: rgb(239 68 68 / 0.2); background: rgb(239 68 68 / 0.1);
132
+ font-weight: 500; }
133
+ .pill-count { color: var(--muted); font-variant-numeric: tabular-nums; }
134
+ .verification td:nth-child(2) { white-space: nowrap; }
135
+ .footer { max-width: 720px; margin: 0 auto; text-align: center; font-size: 14px;
136
+ line-height: 1.625; color: var(--muted); }
137
+ .footer > * + * { margin-top: 12px; }
138
+ .footer h2 { margin-top: 24px; font-size: 14px; font-weight: 700; color: var(--muted-strong); }
139
+ .footer ul { margin-top: 8px; padding-left: 20px; list-style: disc; text-align: left; }
140
+ .footer ul li + li { margin-top: 4px; }
141
+ .footer-note { margin-top: 32px; border-top: 1px solid var(--neutral-2); padding-top: 24px; }
142
+ .sheet-backdrop { position: fixed; inset: 0; z-index: 1000; background: var(--backdrop); cursor: pointer; }
143
+ .sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001; display: flex;
144
+ flex-direction: column; width: 100%; max-width: 560px; background: var(--lightest);
145
+ padding: 20px; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
146
+ .sheet[hidden], .sheet-backdrop[hidden] { display: none; }
147
+ .sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
148
+ .sheet-description { margin-top: 4px; font-size: 14px; color: var(--muted); }
149
+ .sheet-close { flex-shrink: 0; border: 1px solid var(--neutral-2); border-radius: 6px;
150
+ background: none; padding: 4px 10px; font-family: var(--font-mono); font-size: 14px; }
151
+ .sheet-close:hover { background: var(--neutral-1); }
152
+ .sheet-body { display: flex; flex-direction: column; gap: 20px; flex: 1; min-height: 0;
153
+ margin-top: 20px; padding-right: 4px; overflow-y: auto; }
154
+ .prompt-box { border: 1px solid var(--neutral-2); border-radius: 8px; background: var(--neutral-1); padding: 16px; }
155
+ .prompt-box p { margin-top: 8px; font-size: 14px; line-height: 1.625; }
156
+ .prompt-box p.prompt-category { font-size: 11px; letter-spacing: 0.14em; }
157
+ .run { border: 1px solid var(--neutral-2); border-radius: 8px; background: var(--lightest); padding: 16px; }
158
+ .run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
159
+ .run-head .pills { margin-top: 0; justify-content: flex-end; }
160
+ .run-title { font-size: 14px; font-weight: 700; }
161
+ .run-surface { font-size: 12px; color: var(--muted); }
162
+ .run-block { margin-top: 16px; }
163
+ .snippet { margin-top: 16px; border-radius: 6px; background: var(--neutral-1); padding: 12px; }
164
+ .answer { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.625; }
165
+ .answer mark { background: var(--brand-1-light); color: inherit; border-radius: 2px;
166
+ box-shadow: 0 0 0 1px var(--brand-1); }
167
+ .links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
168
+ .source { max-width: 100%; background: none; border: 0; padding: 0; text-align: left;
169
+ overflow-wrap: anywhere; font-size: 12px; font-weight: 500; text-decoration: underline;
170
+ text-decoration-color: var(--brand-1); text-decoration-thickness: 2px; text-underline-offset: 4px; }
171
+ .source:hover { text-decoration-color: var(--darkest); }
172
+ .source-meta { margin-top: 2px; font-size: 11px; color: var(--muted); }
173
+ .empty { border: 1px dashed var(--neutral-2); border-radius: 6px; padding: 12px; font-size: 14px; color: var(--muted); }
174
+ @media (min-width: 480px) {
175
+ .h1 { font-size: 40px; line-height: 50px; }
176
+ .h2 { font-size: 32px; line-height: 38px; }
177
+ .scorecards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
178
+ .sheet { padding: 32px; }
179
+ }
180
+ @media (min-width: 768px) {
181
+ .container { padding: 0 30px; }
182
+ .h1 { font-size: 44px; line-height: 56px; }
183
+ .h2 { font-size: 36px; line-height: 42px; }
184
+ .h5 { font-size: 20px; }
185
+ .body-1 { font-size: 22px; line-height: 28px; }
186
+ .body-2 { font-size: 20px; line-height: 25px; }
187
+ .hero-grid { padding-top: 80px; }
188
+ .measurement { padding: 30px; }
189
+ .header.split { grid-template-columns: 0.8fr 1fr; align-items: start; gap: 40px; }
190
+ .scorecards { padding: 30px 40px; }
191
+ .scorecards-grid { gap: 40px; }
192
+ .matrix-card { padding: 20px; }
193
+ }
194
+ @media (min-width: 992px) {
195
+ .container { padding: 0 40px; }
196
+ .band > .container > .band-inner { padding: 100px 0; }
197
+ .eyebrow { font-size: 16px; }
198
+ .h2 { font-size: 42px; line-height: 50px; }
199
+ .body-1 { font-size: 24px; line-height: 30px; }
200
+ .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(340px, 0.62fr); align-items: center;
201
+ padding: 100px 0; }
202
+ .measurement-figure { font-size: 72px; line-height: 78px; }
203
+ .facts li { font-size: 16px; }
204
+ .scorecards { padding: 40px 60px; }
205
+ .scorecards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
206
+ .scorecards-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
207
+ .stat-figure { font-size: 56px; line-height: 48px; }
208
+ }
209
+ @media (min-width: 1280px) {
210
+ .scorecards-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
211
+ }
212
+ @media (prefers-reduced-motion: reduce) {
213
+ * { scroll-behavior: auto; transition: none; }
214
+ }
215
+ `;
216
+ var script = `
217
+ const token = new URLSearchParams(location.search).get('t');
218
+ const get = async (path) => {
219
+ const response = await fetch('/data/' + path + '?t=' + encodeURIComponent(token));
220
+ if (!response.ok) return null;
221
+ return response.json();
222
+ };
223
+ const el = (tag, attrs = {}, ...children) => {
224
+ const node = document.createElement(tag);
225
+ for (const [key, value] of Object.entries(attrs)) {
226
+ if (key === 'class') node.className = value;
227
+ else if (key.startsWith('on')) node.addEventListener(key.slice(2), value);
228
+ else node.setAttribute(key, value);
229
+ }
230
+ for (const child of children.flat()) {
231
+ if (child === null || child === undefined || child === false) continue;
232
+ node.append(typeof child === 'string' ? document.createTextNode(child) : child);
233
+ }
234
+ return node;
235
+ };
236
+ const plural = (count, noun) => count + ' ' + noun + (count === 1 ? '' : 's');
237
+
238
+ // Escape closes whatever is open: a tooltip, or the evidence sheet.
239
+ const dismissals = [];
240
+ document.addEventListener('keydown', (event) => {
241
+ if (event.key === 'Escape') for (const dismiss of dismissals) dismiss();
242
+ });
243
+
244
+ // The counts behind an interval, in a tooltip (WCAG 1.4.13). It opens on
245
+ // hover, on keyboard focus and on a tap; it stays open while the pointer is
246
+ // over it; Escape closes it; and a screen reader reads it as the interval's
247
+ // description. It sits in the flow under the interval, so a scrolling table
248
+ // cannot clip it and it hides nothing.
249
+ let tipCount = 0;
250
+ const intervalOf = (interval) => {
251
+ if (!interval) return null;
252
+ tipCount += 1;
253
+ const id = 'tip-' + tipCount;
254
+ const tip = el('span', { class: 'tip', role: 'tooltip', id, hidden: '' }, interval.counts);
255
+ let hovered = false;
256
+ let focused = false;
257
+ const sync = () => {
258
+ if (hovered || focused) tip.removeAttribute('hidden');
259
+ else tip.setAttribute('hidden', '');
260
+ };
261
+ const trigger = el('button', { type: 'button', class: 'tip-trigger',
262
+ 'aria-label': interval.label, 'aria-describedby': id,
263
+ // Safari focuses no button on a click or a tap, and a button that kept
264
+ // focus through Escape gets no new focus event: a click (or Enter or
265
+ // Space) opens the tip itself, until focus moves on.
266
+ onclick: () => { trigger.focus(); focused = true; sync(); },
267
+ onfocus: () => { focused = true; sync(); },
268
+ onblur: () => { focused = false; sync(); },
269
+ }, interval.text);
270
+ dismissals.push(() => { hovered = false; focused = false; sync(); });
271
+ return el('span', { class: 'interval',
272
+ onmouseenter: () => { hovered = true; sync(); },
273
+ onmouseleave: () => { hovered = false; sync(); },
274
+ }, trigger, tip);
275
+ };
276
+
277
+ // External sources open only on a deliberate click, in a new context.
278
+ const sourceLink = (url) => el('button', { class: 'source', type: 'button',
279
+ onclick: () => { if (/^https?:\\/\\//.test(url)) window.open(url, '_blank', 'noopener,noreferrer'); },
280
+ }, url);
281
+
282
+ // The brand's name marked in a captured answer, every piece of it text.
283
+ const highlighted = (text, term) => {
284
+ const needle = term.trim().toLowerCase();
285
+ if (!needle) return [text];
286
+ const haystack = text.toLowerCase();
287
+ const pieces = [];
288
+ let from = 0;
289
+ for (let at = haystack.indexOf(needle); at !== -1; at = haystack.indexOf(needle, from)) {
290
+ pieces.push(text.slice(from, at), el('mark', {}, text.slice(at, at + needle.length)));
291
+ from = at + needle.length;
292
+ }
293
+ pieces.push(text.slice(from));
294
+ return pieces.filter((piece) => piece !== '');
295
+ };
296
+
297
+ // The side sheet behind a matrix cell or a cited domain.
298
+ const createSheet = () => {
299
+ const title = el('h2', { class: 'h5', id: 'sheet-title' });
300
+ const description = el('p', { class: 'sheet-description' });
301
+ const body = el('div', { class: 'sheet-body' });
302
+ let opener = null;
303
+ let isOpen = false;
304
+ const backdrop = el('div', { class: 'sheet-backdrop', hidden: '', onclick: () => close() });
305
+ const closeButton = el('button', { type: 'button', class: 'sheet-close', onclick: () => close() }, 'Close');
306
+ const panel = el('div', { class: 'sheet', role: 'dialog', 'aria-modal': 'true',
307
+ 'aria-labelledby': 'sheet-title', hidden: '' },
308
+ el('div', { class: 'sheet-head' }, el('div', {}, title, description), closeButton), body);
309
+ const close = () => {
310
+ if (!isOpen) return;
311
+ isOpen = false;
312
+ backdrop.setAttribute('hidden', '');
313
+ panel.setAttribute('hidden', '');
314
+ // Focus returns to what opened the sheet.
315
+ opener?.focus();
316
+ };
317
+ dismissals.push(close);
318
+ const open = (from, heading, summary, content) => {
319
+ opener = from;
320
+ title.replaceChildren(heading);
321
+ description.replaceChildren(summary);
322
+ body.replaceChildren(...content);
323
+ backdrop.removeAttribute('hidden');
324
+ panel.removeAttribute('hidden');
325
+ isOpen = true;
326
+ closeButton.focus();
327
+ };
328
+ return { nodes: [backdrop, panel], open };
329
+ };
330
+
331
+ const band = (tone, ...content) => el('section', { class: tone === 'soft' ? 'band soft' : 'band' },
332
+ el('div', { class: 'container' }, el('div', { class: 'band-inner' }, ...content)));
333
+
334
+ const sectionHeader = (eyebrow, heading, lead, layout) => {
335
+ const title = el('div', { class: 'header-title' },
336
+ el('p', { class: 'eyebrow' }, eyebrow), el('h2', { class: 'h2' }, heading));
337
+ return el('div', { class: 'header ' + (layout || (lead ? 'split' : '')) },
338
+ title, lead ? el('p', { class: 'body-2' }, lead) : null);
339
+ };
340
+
341
+ const statusLabels = { primary: 'Primary', mentioned: 'Mentioned', absent: 'Absent', no_overview: 'No AI Overview' };
342
+ const retrievalLabels = { searched: 'searched the web', memory: 'answered from memory', unknown: 'retrieval unknown' };
343
+
344
+ const runCard = (run, brandName) => el('article', { class: 'run' },
345
+ el('div', { class: 'run-head' },
346
+ el('div', {}, el('p', { class: 'run-title' }, 'Run ' + run.runNumber),
347
+ el('p', { class: 'run-surface' }, run.surface + (run.cliVersion ? ' \xB7 ' + run.cliVersion : ''))),
348
+ el('div', { class: 'pills' },
349
+ run.retrieval ? el('span', { class: 'pill mono' + (run.retrieval === 'unknown' ? ' dashed' : '') },
350
+ retrievalLabels[run.retrieval]) : null,
351
+ el('span', { class: 'pill ' + (run.status === 'no_overview' ? 'dashed' : run.status) }, statusLabels[run.status]))),
352
+ run.snippet ? el('div', { class: 'snippet' }, el('p', { class: 'label' }, 'Detected mention'),
353
+ el('p', { class: 'answer' }, ...highlighted(run.snippet, brandName))) : null,
354
+ run.answer ? el('div', { class: 'run-block' }, el('p', { class: 'label' }, 'Full captured answer'),
355
+ el('p', { class: 'answer' }, ...highlighted(run.answer, brandName)))
356
+ : el('p', { class: 'empty run-block' }, run.status === 'no_overview'
357
+ ? 'The results page showed no AI Overview: there is no answer to show.'
358
+ : 'No captured answer in this bundle matches this run.'),
359
+ run.mentionedBrands.length ? el('div', { class: 'run-block' }, el('p', { class: 'label' }, 'Mentioned companies'),
360
+ el('ul', { class: 'pills' }, run.mentionedBrands.map((brand) => el('li', {}, el('span', { class: 'pill plain' }, brand))))) : null,
361
+ run.citedUrls.length ? el('div', { class: 'run-block' }, el('p', { class: 'label' }, 'URLs in response'),
362
+ el('ul', { class: 'links' }, run.citedUrls.map((url) => el('li', {}, sourceLink(url))))) : null,
363
+ );
364
+
365
+ const scorecards = (cards) => el('div', { class: 'scorecards' },
366
+ el('div', { class: cards.length >= 5 ? 'scorecards-grid five' : 'scorecards-grid' },
367
+ cards.map((card) => el('div', { class: 'stat' },
368
+ el('p', { class: 'stat-figure' }, card.headline),
369
+ intervalOf(card.headlineInterval),
370
+ el('p', { class: 'stat-label' }, card.label),
371
+ card.detail ? el('p', { class: 'stat-detail' }, card.detail) : null,
372
+ intervalOf(card.detailInterval)))));
373
+
374
+ const surfaceRates = (rows) => rows.length === 0 ? null : el('section', { class: 'subsection', 'aria-label': 'Rates by AI surface' },
375
+ el('p', { class: 'h5' }, 'By AI surface'),
376
+ el('div', { class: 'scroll' }, el('table', { class: 'by-model' },
377
+ el('thead', {}, el('tr', {}, el('th', {}, 'AI surface'), el('th', {}, 'Share of voice'), el('th', {}, 'Citation rate'))),
378
+ el('tbody', {}, rows.map((row) => el('tr', {},
379
+ el('td', {}, row.surface),
380
+ el('td', {}, el('span', { class: 'rate' }, row.shareOfVoice.percent), intervalOf(row.shareOfVoice.interval)),
381
+ el('td', {}, el('span', { class: 'rate' }, row.citationRate.percent), intervalOf(row.citationRate.interval))))))));
382
+
383
+ const dot = (status) => el('span', { class: 'dot ' + status, role: 'img',
384
+ 'aria-label': { primary: 'Primary mention', mentioned: 'Secondary mention', absent: 'Not mentioned', no_data: 'No data' }[status] });
385
+
386
+ const matrix = (section, brandName, sheet) => {
387
+ const { assistantSurfaces, agentSurfaces, rows } = section.matrix;
388
+ const surfaces = [...assistantSurfaces, ...agentSurfaces];
389
+ const firstAgent = assistantSurfaces.length;
390
+ const edge = (index, base) => base + (agentSurfaces.length && index === firstAgent ? ' agents-start' : '');
391
+ const groups = agentSurfaces.length === 0 ? null : el('tr', {},
392
+ el('td', { class: 'prompt group', 'aria-hidden': 'true' }),
393
+ assistantSurfaces.length ? el('th', { class: 'group', colspan: String(assistantSurfaces.length), scope: 'colgroup' }, 'AI assistants') : null,
394
+ el('th', { class: 'group agents-start', colspan: String(agentSurfaces.length), scope: 'colgroup' }, 'Coding agents'));
395
+ const body = rows.map((row, promptIdx) => el('tr', {},
396
+ el('td', { class: 'prompt', title: row.prompt },
397
+ el('span', { class: 'prompt-text' }, row.prompt), el('span', { class: 'prompt-category' }, row.category)),
398
+ row.cells.map((cell, index) => el('td', { class: edge(index, '') },
399
+ cell.status === 'no_data' ? dot('no_data') : (() => {
400
+ const button = el('button', { type: 'button', class: 'cell',
401
+ 'aria-label': surfaces[index] + ', prompt ' + (promptIdx + 1) + ': ' + cell.status + '. Inspect evidence.',
402
+ onclick: () => sheet.open(button, surfaces[index] + ' evidence',
403
+ 'Prompt ' + (promptIdx + 1) + ' \xB7 ' + cell.mentioned + '/' + cell.runs.length + ' runs mentioned ' + brandName,
404
+ [el('section', { class: 'prompt-box' }, el('h3', { class: 'label' }, 'Prompt'), el('p', {}, row.prompt),
405
+ el('p', { class: 'prompt-category' }, row.category)),
406
+ ...cell.runs.map((run) => runCard(run, brandName))]),
407
+ }, dot(cell.status), el('span', { class: 'cell-count' }, cell.mentioned + '/' + cell.runs.length));
408
+ return button;
409
+ })()))));
410
+ return el('div', { class: 'card matrix-card' },
411
+ el('div', { class: 'scroll', role: 'group', 'aria-label': 'AI answer evidence matrix', tabindex: '0' },
412
+ el('table', { class: 'matrix' },
413
+ el('thead', {}, groups, el('tr', {}, el('th', { class: 'prompt-head' }, 'Prompt'),
414
+ surfaces.map((surface, index) => el('th', { class: edge(index, '') }, surface)))),
415
+ el('tbody', {}, body))),
416
+ el('ul', { class: 'legend' },
417
+ [['primary', 'Primary recommendation'], ['mentioned', 'Mentioned secondarily'], ['absent', 'Not mentioned'], ['no_data', 'No data']]
418
+ .map(([status, text]) => el('li', {}, el('span', { class: 'dot ' + status }), text))),
419
+ el('p', { class: 'hint' }, 'Click any dot with a run count to inspect the captured AI answers, cited URLs, and highlighted mentions behind that result.'));
420
+ };
421
+
422
+ const alternatives = (rows) => rows.length === 0 ? null : el('div', { class: 'card' },
423
+ el('h3', { class: 'card-title' }, 'Who buyers hear about instead'),
424
+ el('p', { class: 'card-lead' }, 'Competing companies and products named in the answers, ranked by share of voice (answers that mention them / answers captured).'),
425
+ el('ul', { class: 'bars' }, rows.map((row) => {
426
+ const fill = el('span', { class: 'bar-fill' });
427
+ // CSSOM, which the page's Content Security Policy allows, unlike a style attribute.
428
+ if (fill.style) fill.style.width = (row.share * 100) + '%';
429
+ return el('li', {},
430
+ el('span', { class: 'bar-name', title: row.domain || row.name }, row.name,
431
+ row.domain && row.domain.toLowerCase() !== row.name.trim().toLowerCase() ? el('span', { class: 'bar-domain' }, row.domain) : null),
432
+ el('span', { class: 'bar' }, fill),
433
+ el('span', { class: 'bar-value' }, row.percent + ' ' + row.mentioning + '/' + row.captured));
434
+ })));
435
+
436
+ const citedDomains = (domains, sheet) => {
437
+ const total = domains.reduce((sum, domain) => sum + domain.count, 0);
438
+ const shown = 10;
439
+ const body = el('tbody');
440
+ const more = el('button', { type: 'button', class: 'more' });
441
+ let showAll = false;
442
+ const rowOf = (domain) => {
443
+ const inspect = (from) => sheet.open(from, domain.domain, plural(domain.count, 'citation') + ' across the captured answers',
444
+ [el('ul', { class: 'links' }, domain.urls.map((url) => el('li', {}, sourceLink(url.url),
445
+ el('p', { class: 'source-meta' }, plural(url.count, 'citation') + ' \xB7 ' + url.surfaces.join(', ')),
446
+ ...url.prompts.map((prompt) => el('p', { class: 'source-meta' }, prompt)))))]);
447
+ const name = el('span', { class: domain.isBrand ? 'rate' : '' }, domain.domain);
448
+ const hosts = domain.hosts ? el('span', { class: 'hosts' }, domain.hosts.map((host) => host.label + ' ' + host.count).join(' \xB7 ')) : null;
449
+ if (domain.count === 0) return el('tr', {}, el('td', {}, name, hosts), el('td', { class: 'num' }, '0'));
450
+ const button = el('button', { type: 'button', class: 'row-button',
451
+ 'aria-label': 'Inspect the ' + domain.count + ' cited URLs behind ' + domain.domain,
452
+ onclick: (event) => { event.stopPropagation?.(); inspect(button); } }, name, hosts);
453
+ return el('tr', { class: 'selectable', onclick: () => inspect(button) },
454
+ el('td', {}, button), el('td', { class: 'num' }, String(domain.count)));
455
+ };
456
+ const sync = () => {
457
+ body.replaceChildren(...(showAll ? domains : domains.slice(0, shown)).map(rowOf));
458
+ const hidden = domains.length - shown;
459
+ more.replaceChildren(showAll ? 'Show fewer domains' : '+' + plural(hidden, 'more domain'));
460
+ if (hidden > 0) more.removeAttribute('hidden'); else more.setAttribute('hidden', '');
461
+ };
462
+ more.addEventListener('click', () => { showAll = !showAll; sync(); });
463
+ sync();
464
+ return el('div', { class: 'card' },
465
+ el('h3', { class: 'card-title' }, 'What gets cited'),
466
+ el('p', { class: 'card-lead' }, 'Domains behind the URLs cited in these answers'
467
+ + (total > 0 ? ' (' + total + ' citations captured). Click a domain to inspect the URLs behind it.' : '.')),
468
+ el('div', { class: 'scroll' }, el('table', {},
469
+ el('thead', {}, el('tr', {}, el('th', {}, 'Domain'), el('th', { class: 'num' }, 'Citations'))), body)),
470
+ more);
471
+ };
472
+
473
+ const sourceCategories = [['owned', 'Owned'], ['competitor', 'Competitor'], ['social', 'Social & community'],
474
+ ['institutional', 'Institutional'], ['earned', 'Earned']];
475
+
476
+ const sourceMix = (mix) => !mix || mix.rows.length === 0 ? null : el('div', { class: 'card' },
477
+ el('h3', { class: 'card-title' }, 'Where the citations come from'),
478
+ el('p', { class: 'card-lead' }, 'Every cited URL classified: the brand\u2019s own pages, competitor pages, social and community threads, institutional references, or earned media. Each surface leans differently.'),
479
+ el('div', { class: 'scroll', role: 'group', 'aria-label': 'Citation sources by AI surface', tabindex: '0' },
480
+ el('table', {},
481
+ el('thead', {}, el('tr', {}, el('th', {}, 'Surface'), sourceCategories.map(([, label]) => el('th', { class: 'num' }, label)))),
482
+ el('tbody', {},
483
+ mix.rows.map((row) => el('tr', {}, el('td', { class: 'rate' }, row.surface),
484
+ sourceCategories.map(([key]) => el('td', { class: 'num' }, row.counts[key] ? String(row.counts[key]) : '\u2014')))),
485
+ el('tr', { class: 'total' }, el('td', {}, 'All surfaces'),
486
+ sourceCategories.map(([key]) => el('td', { class: 'num' }, mix.total[key] ? String(mix.total[key]) : '\u2014')))))));
487
+
488
+ const perception = (view, brandName) => {
489
+ if (!view) return null;
490
+ const mentions = view.positive + view.neutral + view.negative;
491
+ if (mentions === 0 && view.phrases.length === 0) return null;
492
+ return el('div', { class: 'card' },
493
+ el('h3', { class: 'card-title' }, 'How the answers talk about ' + brandName),
494
+ mentions > 0 ? el('p', { class: 'card-lead' }, 'Across ' + mentions + ' answers that mention ' + brandName + ': '
495
+ + view.positive + ' positive, ' + view.neutral + ' neutral, ' + view.negative + ' negative.') : null,
496
+ view.phrases.length ? el('div', { class: 'run-block' },
497
+ el('p', { class: 'label' }, 'Phrases the answers attach to ' + brandName),
498
+ el('ul', { class: 'pills' }, view.phrases.map((phrase) => el('li', {},
499
+ el('span', { class: 'pill', title: 'Said by ' + phrase.surfaces.join(', ') },
500
+ el('span', {}, '\u201C' + phrase.text + '\u201D'),
501
+ phrase.count > 1 ? el('span', { class: 'pill-count' }, '\xD7' + phrase.count) : null))))) : null);
502
+ };
503
+
504
+ const verification = (result) => el('div', { class: 'card' },
505
+ el('h3', { class: 'card-title' }, 'Checks'),
506
+ el('p', { class: 'card-lead' }, 'Capture authenticity: self-reported. Checks run on this machine, offline.'),
507
+ el('div', { class: 'scroll' }, el('table', { class: 'verification' },
508
+ el('thead', {}, el('tr', {}, el('th', {}, 'Check'), el('th', {}, 'Outcome'), el('th', {}, 'Why'))),
509
+ el('tbody', {}, result.checks.map((check) => el('tr', {},
510
+ el('td', {}, check.title),
511
+ el('td', {}, el('span', { class: 'pill ' + (check.outcome === 'pass' ? 'pass' : check.outcome === 'fail' ? 'fail' : 'dashed') },
512
+ check.outcome.replace('_', ' '))),
513
+ el('td', { class: 'muted' }, check.outcome === 'pass' ? '' : check.explanation)))))));
514
+
515
+ const hero = (report, info) => el('section', { class: 'hero' }, el('div', { class: 'container' },
516
+ el('div', { class: 'hero-grid' },
517
+ el('div', { class: 'hero-copy' },
518
+ el('p', { class: 'eyebrow' }, 'AI visibility audit'),
519
+ el('h1', { class: 'h1' }, report.hero.title),
520
+ el('p', { class: 'body-1' }, report.hero.subtitle),
521
+ el('p', { class: 'measured' }, 'Measured ' + report.hero.measuredOn + ' \xB7 ' + info.originLabel)),
522
+ el('div', { class: 'measurement' },
523
+ el('p', { class: 'eyebrow' }, 'The measurement'),
524
+ el('p', { class: 'measurement-figure' }, String(report.hero.probeCount)),
525
+ el('p', { class: 'h5' }, 'captured AI answers'),
526
+ el('ul', { class: 'facts' }, report.hero.facts.map((fact) => el('li', {}, fact)))))));
527
+
528
+ const plainHero = (info) => el('section', { class: 'hero' }, el('div', { class: 'container' },
529
+ el('div', { class: 'hero-grid' }, el('div', { class: 'hero-copy' },
530
+ el('p', { class: 'eyebrow' }, 'Literally.dev AEO'),
531
+ el('h1', { class: 'h1' }, 'AI visibility audit'),
532
+ el('p', { class: 'measured' }, info.originLabel)))));
533
+
534
+ const render = async () => {
535
+ const root = document.getElementById('app');
536
+ const [info, result, report] = await Promise.all([get('__viewer'), get('__verification'), get('__report')]);
537
+ root.replaceChildren();
538
+ if (!info || !report) {
539
+ root.append(el('p', { class: 'container' }, 'This viewer link is not valid. Start it again with literally-aeo view.'));
540
+ return;
541
+ }
542
+ const sheet = createSheet();
543
+ const shown = report.outcome === 'shown';
544
+ if (info.workingState) {
545
+ root.append(el('div', { class: 'banner' },
546
+ 'Working state, not a finalized revision: this is not an integrity receipt. Export the run to finalize it.'));
547
+ }
548
+ root.append(shown ? hero(report, info) : plainHero(info));
549
+ const bands = [];
550
+ if (shown && report.intro) {
551
+ bands.push([sectionHeader('AI search visibility', report.intro.heading, report.intro.lead, 'center')]);
552
+ }
553
+ if (result || !shown) {
554
+ // A working state is not verified: no claim that it was.
555
+ bands.push([sectionHeader('Evidence', 'Verification', result
556
+ ? 'The bundle re-checked on this machine: its hashes, its event chain and every metric recomputed from its own judgments. A check that cannot run says so.'
557
+ : undefined),
558
+ result ? verification(result) : null,
559
+ shown ? null : el('p', { class: 'card empty' }, report.outcome === 'missing'
560
+ ? 'This run has no report yet: the measurement did not finish.'
561
+ : 'The report cannot be shown: ' + report.reason)]);
562
+ }
563
+ for (const section of shown ? report.sections : []) {
564
+ bands.push([
565
+ sectionHeader('AI search visibility', section.title),
566
+ scorecards(section.scorecards),
567
+ surfaceRates(section.surfaceRates),
568
+ matrix(section, report.brand.name, sheet),
569
+ alternatives(section.alternatives),
570
+ citedDomains(section.citedDomains, sheet),
571
+ sourceMix(section.sourceMix),
572
+ perception(section.perception, report.brand.name),
573
+ ]);
574
+ }
575
+ bands.push([el('div', { class: 'footer' },
576
+ shown ? el('p', {}, report.footer.baseline) : null,
577
+ shown && report.footer.methodology.length ? el('section', { 'aria-labelledby': 'methodology' },
578
+ el('h2', { id: 'methodology' }, 'Methodology'),
579
+ el('ul', { class: 'methodology' }, report.footer.methodology.map((sentence) => el('li', {}, sentence)))) : null,
580
+ ...(shown ? report.footer.notes : []).map((note) => el('p', {}, note)),
581
+ el('p', { class: 'footer-note' },
582
+ 'Generated with Literally.dev AEO ' + info.toolVersion + ', an open-source AI visibility audit tool. '
583
+ + info.originLabel + '. Literally.dev did not review this result. Bundle: ' + info.source + '.'))]);
584
+ bands.forEach((content, index) => root.append(band(index % 2 === 1 ? 'soft' : 'plain', ...content)));
585
+ root.append(...sheet.nodes);
586
+ };
587
+
588
+ render().catch((error) => {
589
+ document.getElementById('app').textContent = 'The viewer could not load this bundle: ' + error.message;
590
+ });
591
+ `;
592
+ var viewerFontFiles = {
593
+ body: "Mulish-VariableFont_wght.ttf",
594
+ mono: "SourceCodePro-VariableFont_wght.ttf"
595
+ };
596
+ var fontFaces = (token) => {
597
+ const source = (file) => `url("/fonts/${file}?t=${encodeURIComponent(token)}") format("truetype")`;
598
+ return `
599
+ @font-face { font-family: Mulish; font-weight: 200 1000; font-display: swap;
600
+ src: ${source(viewerFontFiles.body)}; }
601
+ @font-face { font-family: "Source Code Pro"; font-weight: 200 900; font-display: swap;
602
+ src: ${source(viewerFontFiles.mono)}; }
603
+ `;
604
+ };
605
+ var viewerPage = (nonce, fontToken) => {
606
+ const faces = fontToken === void 0 ? "" : fontFaces(fontToken);
607
+ return `<!doctype html>
608
+ <html lang="en">
609
+ <head>
610
+ <meta charset="utf-8">
611
+ <meta name="viewport" content="width=device-width, initial-scale=1">
612
+ <meta name="referrer" content="no-referrer">
613
+ <title>Literally.dev AEO</title>
614
+ <style nonce="${nonce}">${faces}${styles}</style>
615
+ </head>
616
+ <body>
617
+ <main id="app"><p class="container">Loading the audit\u2026</p></main>
618
+ <script nonce="${nonce}">${script}</script>
619
+ </body>
620
+ </html>`;
621
+ };
622
+
623
+ export {
624
+ viewerFontFiles,
625
+ viewerPage
626
+ };
@@ -13,7 +13,7 @@ import {
13
13
  bindingOf,
14
14
  probeAdapterProfiles,
15
15
  profileOf
16
- } from "./chunk-5EM6J7TG.js";
16
+ } from "./chunk-7HCVSLVG.js";
17
17
  import {
18
18
  codexBinaryVersion,
19
19
  resolveCodexBinary