import{aw as h,aC as w,aE as v,aF as y,aD as C}from"./app-session-runtime-CeFJDILJ.js";import{b as r,n as R,e as p}from"./vendor-lit-B2r-dKc0.js";import{aJ as d}from"./vendor-lucide-B9Yl1Gez.js";import"./vendor-mini-lit-CpUQub-j.js";import"./vendor-marked-_iteVaMm.js";import"./app-review-C3CmcSYC.js";import"./app-panel-workspace-C3XDRCgE.js";import"./app-routing-C_r2pdnC.js";import"./app-message-reducer-wATqnZGf.js";import"./vendor-sortable-B1o3v0Qs.js";import"./app-inbox-CaZD85aD.js";import"./app-pr-walkthrough-WipZACSB.js";function u(i){const t=i?.content?.filter(o=>o.type==="text").map(o=>o.text).join(`
`)||"";let e=null;try{e=JSON.parse(t)}catch{}return{text:t,data:e}}function f(i){const t=i?.toLowerCase()==="pass";return r`<span class="px-1.5 py-0.5 rounded text-xs font-medium ${t?"bg-green-500/20 text-green-600 dark:text-green-400":"bg-red-500/20 text-red-600 dark:text-red-400"}">${t?"✓ PASS":"✗ FAIL"}</span>`}class P{render(t,e,o){h();const s=w(e,o);if(!e)return{content:r`<div>
					${v(s,d,"Submitting verification…")}
					${t?r`<div class="mt-2 space-y-2">
						${t.verdict?r`<div>${f(t.verdict)}</div>`:""}
						${t.summary?r`<div class="text-sm"><markdown-block .content=${t.summary}></markdown-block></div>`:""}
						${t.report_html?r`<div class="text-xs text-muted-foreground italic">HTML report attached</div>`:""}
					</div>`:""}
				</div>`,isCustom:!1};if(e.isError){const{text:g}=u(e),x=y(e);return{content:r`<div>
					${v(s,d,x?"Aborted verification":"Verification failed")}
					<div class="mt-1 text-xs ${x?"text-amber-600 dark:text-amber-400":"text-destructive"}">${g}</div>
				</div>`,isCustom:!1}}const{data:n,text:b}=u(e),$=n?.verdict||t?.verdict||"",a=n?.summary||t?.summary||b||"",c=n?.report_html||t?.report_html||"",l=a.length>300,m=p(),k=p();return{content:r`<div>
				${C(s,d,r`Verification: ${f($)}`,m,k,!l)}
				<div ${R(m)} class="${l?"max-h-0":"max-h-[2000px] mt-3"} overflow-hidden transition-all duration-300">
					<div class="text-sm">
						<markdown-block .content=${a}></markdown-block>
					</div>
					${c?r`
						<details class="mt-3">
							<summary class="text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors">View HTML report</summary>
							<iframe
								class="w-full h-[400px] mt-2 rounded border border-border"
								sandbox="allow-scripts"
								.srcdoc=${c}
							></iframe>
						</details>
					`:""}
				</div>
			</div>`,isCustom:!1}}}export{P as VerificationResultRenderer};
