@nekzus/liop-studio 1.0.0-alpha.4 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nekzus/liop-studio",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "LIOP Sovereign Studio — Developer studio, mesh scanner, and logic-on-origin inspector for LIOP & MCP.",
|
|
5
5
|
"author": "Nekzus Solutions and contributors",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@hono/node-server": "2.1.1",
|
|
61
|
-
"@nekzus/liop": "2.4.0-alpha.
|
|
61
|
+
"@nekzus/liop": "2.4.0-alpha.10",
|
|
62
62
|
"commander": "^13.1.0",
|
|
63
63
|
"hono": "4.13.5",
|
|
64
64
|
"picocolors": "^1.1.1",
|
|
@@ -94,8 +94,8 @@ curl -X POST http://127.0.0.1:16001/api/execute \\
|
|
|
94
94
|
"runtime": "wasi_v1",
|
|
95
95
|
"script_payload": "${e}"
|
|
96
96
|
}
|
|
97
|
-
}`}}}function Sm({toolName:e,code:t,targetType:n,grpcTarget:r,httpUrl:i,stdioCmd:a}){let[o,s]=(0,b.useState)(`typescript`),[c,l]=(0,b.useState)(!1),u=n===`grpc`?r:n===`http`?i:a,d=xm({lang:o,toolName:e,logicCode:t,targetType:n,targetEndpoint:u});return(0,F.jsx)(ym,{value:`export`,className:`m-0 space-y-3 pb-5`,children:(0,F.jsxs)(`div`,{className:`space-y-3 pt-1 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 p-0.5 bg-surface1 border border-border rounded-lg`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`typescript`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`typescript`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`TypeScript (SDK)`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`python`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`python`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`Python`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`curl`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`curl`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`cURL / CLI`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`grpc`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`grpc`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`gRPC JSON`})]}),(0,F.jsx)(`button`,{type:`button`,onClick:async()=>{await ke(d)&&(l(!0),setTimeout(()=>l(!1),2e3))},className:`text-xs flex items-center gap-1.5 px-3 py-1 rounded-md font-medium border transition-all cursor-pointer ${c?`bg-emerald-500/20 text-emerald-400 border-emerald-500/40`:`bg-surface1 text-zinc-200 border-border hover:bg-white/10 hover:text-white`}`,children:c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ne,{className:`h-3.5 w-3.5 text-emerald-400`}),(0,F.jsx)(`span`,{children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`Copy Code`})]})})]}),(0,F.jsx)(`div`,{className:`rounded-lg bg-editor border border-border p-3.5 font-mono text-xs text-[#7dd3fc] overflow-auto max-h-[250px] leading-relaxed select-all shadow-inner`,children:(0,F.jsx)(`pre`,{children:d})}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-zinc-400 font-mono`,children:[(0,F.jsxs)(`span`,{children:[`Target Tool:`,` `,(0,F.jsx)(`strong`,{className:`text-white`,children:e||`Analyze_Synthetic_Bank_Transactions`})]}),(0,F.jsxs)(`span`,{children:[`Endpoint: `,u||`127.0.0.1:15021`]})]})]})})}var Cm=ld(`relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7`,{variants:{variant:{default:`bg-background text-foreground border-border`,destructive:`border-destructive/50 bg-destructive/10 text-destructive dark:border-destructive [&>svg]:text-destructive`,success:`border-success/50 bg-success/10 text-success dark:border-success [&>svg]:text-success`,warning:`border-warning/50 bg-warning/10 text-warning dark:border-warning [&>svg]:text-warning`}},defaultVariants:{variant:`default`}}),wm=b.forwardRef(({className:e,variant:t,...n},r)=>(0,F.jsx)(`div`,{ref:r,role:`alert`,className:Pf(Cm({variant:t}),e),...n}));wm.displayName=`Alert`;var Tm=b.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`h5`,{ref:n,className:Pf(`mb-1 font-medium leading-none tracking-tight text-white`,e),...t}));Tm.displayName=`AlertTitle`;var Em=b.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:Pf(`text-xs [&_p]:leading-relaxed text-muted-foreground`,e),...t}));Em.displayName=`AlertDescription`;function Dm({result:e,meta:t}){let[n,r]=(0,b.useState)(`visual`),[i,a]=(0,b.useState)(!1),o=async()=>{await ke(JSON.stringify(e,null,2))&&(a(!0),setTimeout(()=>a(!1),1500))},s=(0,b.useMemo)(()=>e.totalBalance!==void 0||e.totalAccounts!==void 0?`banking`:e.totalPatients!==void 0||e.diagnosesDistribution!==void 0?`healthcare`:e.ticksProcessed!==void 0||e.vwap!==void 0?`hft`:e.totalSamples!==void 0||e.avgTemperature!==void 0?`iot`:e.layerAudit!==void 0||e.protocol!==void 0?`perimeter`:`generic`,[e]),c=e=>new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:0}).format(e);return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/60 pb-3`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-xs font-medium`,children:[(0,F.jsx)(xe,{className:`h-3.5 w-3.5`}),(0,F.jsxs)(`span`,{children:[s===`banking`&&`Core Banking Enclave • Verified Aggregation`,s===`healthcare`&&`Healthcare EHR Enclave • HIPAA Protected`,s===`hft`&&`HFT Market Oracle • Ultra Low Latency`,s===`iot`&&`Industrial Edge Telemetry • Hostile WAN Protected`,s===`perimeter`&&`Border LIO Gateway • Zero-Trust Perimeter`,s===`generic`&&`Origin Compute • Zero-Trust Execution`]})]})}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center bg-surface1 p-0.5 rounded-lg border border-white/10 text-[11px]`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(`visual`),className:`px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${n===`visual`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(te,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Visual Analytics`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(`json`),className:`px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${n===`json`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(le,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Raw JSON`})]})]}),(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`text-[11px] flex items-center gap-1.5 transition-colors px-2.5 py-1 rounded-md font-medium border cursor-pointer ${i?`text-emerald-400 bg-emerald-500/15 border-emerald-500/30`:`text-zinc-300 hover:text-white bg-surface1 hover:bg-white/5 border-white/10`}`,title:`Copy JSON Payload`,children:i?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ne,{className:`h-3 w-3 text-emerald-400`}),(0,F.jsx)(`span`,{children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Copy`})]})})]})]}),n===`visual`?(0,F.jsxs)(`div`,{className:`space-y-4`,children:[s===`banking`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-emerald-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Total Accounts In-Situ`}),(0,F.jsx)(se,{className:`h-3.5 w-3.5 text-emerald-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.totalAccounts??0).toLocaleString()}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/80 mt-1 flex items-center gap-1`,children:[(0,F.jsx)(re,{className:`h-2.5 w-2.5`}),(0,F.jsx)(`span`,{children:`100% Retained at origin`})]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-emerald-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Aggregated Balance`}),(0,F.jsx)(we,{className:`h-3.5 w-3.5 text-emerald-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-emerald-400 mt-1 font-mono`,children:c(e.totalBalance??0)}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Computed inside V8 Sandbox`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Mean Account Balance`}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-cyan-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:c(e.averageBalance??0)}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Statistical variance preserved`})]})]}),s===`healthcare`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-cyan-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Audited Patients`}),(0,F.jsx)(se,{className:`h-3.5 w-3.5 text-cyan-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.totalPatients??0).toLocaleString()}),(0,F.jsxs)(`div`,{className:`text-[10px] text-cyan-400/80 mt-1 flex items-center gap-1`,children:[(0,F.jsx)(fe,{className:`h-2.5 w-2.5`}),(0,F.jsx)(`span`,{children:`Zero HIPAA records leaked`})]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-cyan-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Mean Population Age`}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-cyan-400`})]}),(0,F.jsxs)(`div`,{className:`text-xl font-bold text-cyan-300 mt-1 font-mono`,children:[e.averageAge??0,` yrs`]}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Aggregated demographic mean`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Diagnostic Classes`}),(0,F.jsx)(P,{className:`h-3.5 w-3.5 text-purple-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:Object.keys(e.diagnosesDistribution||{}).length}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Differential privacy preserved`})]})]}),s===`hft`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-purple-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Orderbook Ticks`}),(0,F.jsx)(Oe,{className:`h-3.5 w-3.5 text-purple-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.ticksProcessed??0).toLocaleString()}),(0,F.jsx)(`div`,{className:`text-[10px] text-purple-400/80 mt-1`,children:`Sub-millisecond processing`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-purple-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Volume-Weighted Price (VWAP)`}),(0,F.jsx)(we,{className:`h-3.5 w-3.5 text-emerald-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-emerald-400 mt-1 font-mono`,children:e.vwap?`$${e.vwap.toFixed(4)}`:`Computed`}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Real-time orderbook weighting`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Avg Spread (bps)`}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-amber-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:e.avgSpreadBps?`${Number(e.avgSpreadBps).toFixed(1)} bps`:`0 bps`}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Microstructure liquidity metric`})]})]}),s===`iot`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-4 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Sensor Samples`}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.totalSamples??0).toLocaleString()})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-cyan-500/20`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Avg Temperature`}),(0,F.jsxs)(`div`,{className:`text-xl font-bold text-cyan-300 mt-1 font-mono`,children:[e.avgTemperature??0,`°C`]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-amber-500/20`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Max Temp Peak`}),(0,F.jsxs)(`div`,{className:`text-xl font-bold text-amber-400 mt-1 font-mono`,children:[e.maxTemperature??0,`°C`]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-rose-500/20`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Critical Alerts`}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-rose-400 mt-1 font-mono`,children:e.criticalCount??0})]})]}),s===`perimeter`&&e.layerAudit&&Array.isArray(e.layerAudit)&&(0,F.jsxs)(`div`,{className:`p-4 rounded-lg bg-surface1/60 border border-emerald-500/20 space-y-2`,children:[(0,F.jsxs)(`div`,{className:`text-xs font-semibold text-emerald-400 flex items-center gap-1.5`,children:[(0,F.jsx)(xe,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Zero-Trust 6-Layer Security Audit Confirmed`})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 pt-1`,children:e.layerAudit.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-zinc-300 bg-surface1 px-2.5 py-1.5 rounded border border-white/5`,children:[(0,F.jsx)(re,{className:`h-3.5 w-3.5 text-emerald-400 shrink-0`}),(0,F.jsx)(`span`,{children:e})]},e))})]}),(e.distribution||e.diagnosesDistribution||e.statusDistribution)&&(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/60 border border-white/10 space-y-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-zinc-200`,children:`Distribution Breakdown (In-Situ Grouping)`}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono text-zinc-400`,children:`Aggregated at Origin`})]}),(0,F.jsx)(`div`,{className:`space-y-2`,children:Object.entries(e.distribution||e.diagnosesDistribution||e.statusDistribution||{}).map(([t,n])=>{let r=Number(n)||0,i=e.totalAccounts||e.totalPatients||e.totalSamples||1,a=Math.min(100,Math.round(r/i*100));return(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-mono`,children:[(0,F.jsx)(`span`,{className:`text-zinc-300`,children:t}),(0,F.jsxs)(`span`,{className:`text-zinc-400`,children:[r.toLocaleString(),` (`,a,`%)`]})]}),(0,F.jsx)(`div`,{className:`h-1.5 w-full bg-white/5 rounded-full overflow-hidden`,children:(0,F.jsx)(`div`,{className:`h-full bg-emerald-500 rounded-full transition-all duration-500`,style:{width:`${a}%`}})})]},t)})})]}),(0,F.jsxs)(`div`,{className:`p-4 rounded-lg bg-gradient-to-br from-emerald-950/20 via-surface1/80 to-surface1/40 border border-emerald-500/30 space-y-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Se,{className:`h-4 w-4 text-emerald-400`}),(0,F.jsx)(`h4`,{className:`text-xs font-bold text-white uppercase tracking-wider`,children:`Protocol Value Differential: LIOP vs Traditional MCP`})]}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono px-2 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/30`,children:`SOVEREIGNTY CERTIFIED`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3 pt-1 text-xs`,children:[(0,F.jsxs)(`div`,{className:`space-y-1 bg-surface1/60 p-2.5 rounded border border-white/5`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 font-medium`,children:`LLM Context Tokens`}),(0,F.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`text-sm font-bold text-emerald-400 font-mono`,children:[`~`,t?.telemetry?.tokens?.totalTokens??197,` tok`]}),(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-500 line-through font-mono`,children:`~48,000 tok`})]}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/90 flex items-center gap-0.5`,children:[(0,F.jsx)(O,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`99.6% context reduction`})]})]}),(0,F.jsxs)(`div`,{className:`space-y-1 bg-surface1/60 p-2.5 rounded border border-white/5`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 font-medium`,children:`Wire Egress Payload`}),(0,F.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-sm font-bold text-emerald-400 font-mono`,children:t?.telemetry?.bandwidth?.payloadBytes?`${(t.telemetry.bandwidth.payloadBytes/1024).toFixed(2)} KB`:`0.72 KB`}),(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-500 line-through font-mono`,children:`195.2 KB`})]}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/90 flex items-center gap-0.5`,children:[(0,F.jsx)(O,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`99.6% network reduction`})]})]}),(0,F.jsxs)(`div`,{className:`space-y-1 bg-surface1/60 p-2.5 rounded border border-white/5`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 font-medium`,children:`PII Exposure Boundary`}),(0,F.jsx)(`div`,{className:`flex items-baseline gap-1.5`,children:(0,F.jsx)(`span`,{className:`text-sm font-bold text-emerald-400 font-mono`,children:`0 Leaked Records`})}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/90 flex items-center gap-0.5`,children:[(0,F.jsx)(re,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Enclave & PQC Kyber-768 sealed`})]})]})]})]})]}):(0,F.jsx)(`div`,{className:`rounded-lg bg-editor border border-border p-3.5 font-mono text-[11px] text-[#86efac] overflow-x-auto leading-relaxed shadow-inner`,children:(0,F.jsx)(`pre`,{children:JSON.stringify(e,null,2)})})]})}function Om({result:e,errorAlert:t,isRunning:n,meta:r}){return(0,F.jsxs)(ym,{value:`output`,className:`m-0 space-y-3 pb-5`,children:[t&&(0,F.jsx)(`div`,{className:`mb-3 pt-1`,children:(0,F.jsxs)(wm,{variant:`destructive`,className:`border-destructive/40 bg-destructive/10`,children:[(0,F.jsx)(Tm,{className:`text-xs font-semibold`,children:t.title}),(0,F.jsx)(Em,{className:`text-xs leading-relaxed mt-1`,children:t.desc})]})}),e?(0,F.jsx)(Dm,{result:e,meta:r}):!t&&!n?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-14 text-zinc-400 text-center space-y-2`,children:[(0,F.jsx)(Ce,{className:`h-6 w-6 text-zinc-500`}),(0,F.jsx)(`p`,{className:`text-xs font-medium text-zinc-200`,children:`Awaiting Execution`}),(0,F.jsxs)(`p`,{className:`text-[11px] text-zinc-400 max-w-[240px]`,children:[`Select a template, inspect the runtime schema with`,` `,(0,F.jsx)(`strong`,{children:`Env Schema`}),`, or click `,(0,F.jsx)(`strong`,{children:`Execute Logic`}),`.`]})]}):n?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-14 text-zinc-400 text-center space-y-2.5`,children:[(0,F.jsx)(de,{className:`h-6 w-6 animate-spin text-primary`}),(0,F.jsx)(`p`,{className:`text-xs text-zinc-300`,children:`Injecting logic and enforcing Zero-Trust policies...`})]}):null]})}function km({meta:e}){let[t,n]=(0,b.useState)(!1),r=async()=>{e?.zkHash&&await ke(e.zkHash)&&(n(!0),setTimeout(()=>n(!1),1500))};if(!e?.telemetry)return(0,F.jsx)(ym,{value:`telemetry`,className:`m-0 space-y-3 pb-5`,children:(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-14 text-zinc-400 text-center space-y-2`,children:[(0,F.jsx)(M,{className:`h-6 w-6 text-zinc-500`}),(0,F.jsx)(`p`,{className:`text-xs font-medium text-zinc-200`,children:`No Live Telemetry Recorded`}),(0,F.jsx)(`p`,{className:`text-[11px] text-zinc-400 max-w-[240px]`,children:`Execute a capability to measure live network RTT, BPE tokens, wire egress, and WASI instruction fuel.`})]})});let{tokens:i,fuel:a,bandwidth:o,phases:s}=e.telemetry;return(0,F.jsx)(ym,{value:`telemetry`,className:`m-0 space-y-3 pb-5`,children:(0,F.jsxs)(`div`,{className:`space-y-3 pt-1 text-xs`,children:[i&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`p-1.5 rounded-md bg-secondary text-primary`,children:(0,F.jsx)(Ce,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px]`,children:`Context Token Telemetry (BPE)`}),(0,F.jsxs)(`p`,{className:`text-[10px] text-zinc-400`,children:[`Tokenizer: `,i.estimatorName||`o200k_base`]})]})]}),i.savingsPercent!==void 0&&i.traditionalContextTokens!==void 0&&i.traditionalContextTokens>0&&(0,F.jsxs)(If,{className:`bg-emerald-500 text-black font-mono font-bold text-xs px-2 py-0.5 shadow-sm`,children:[`-`,i.savingsPercent,`% Tokens`]})]}),i.traditionalContextTokens&&i.traditionalContextTokens>0?(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pt-1 border-t border-border/60`,children:[(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`In-Situ Module`}),(0,F.jsxs)(`p`,{className:`text-sm font-bold font-mono text-emerald-400`,children:[i.totalTokens??0,` `,(0,F.jsx)(`span`,{className:`text-[10px] font-normal text-zinc-400`,children:`tok`})]}),(0,F.jsxs)(`p`,{className:`text-[9px] text-zinc-400 mt-0.5 font-mono`,children:[i.inputTokens??0,` in / `,i.outputTokens??0,` `,`out`]})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Raw Origin Dataset`}),(0,F.jsxs)(`p`,{className:`text-sm font-bold font-mono text-zinc-300`,children:[i.traditionalContextTokens.toLocaleString(),` `,(0,F.jsx)(`span`,{className:`text-[10px] font-normal text-zinc-400`,children:`tok`})]}),(0,F.jsx)(`p`,{className:`text-[9px] text-zinc-400 mt-0.5`,children:`Unfiltered context`})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Context Saved`}),(0,F.jsxs)(`p`,{className:`text-sm font-bold font-mono text-primary`,children:[(i.traditionalContextTokens-(i.totalTokens??0)).toLocaleString(),` `,(0,F.jsx)(`span`,{className:`text-[10px] font-normal text-zinc-400`,children:`tok`})]}),(0,F.jsx)(`p`,{className:`text-[9px] text-zinc-400 mt-0.5`,children:`Kept in origin enclave`})]})]}):(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pt-1 border-t border-border/60`,children:[(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Input Tokens`}),(0,F.jsx)(`p`,{className:`text-sm font-bold font-mono text-cyan-300`,children:i.inputTokens??0})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Output Tokens`}),(0,F.jsx)(`p`,{className:`text-sm font-bold font-mono text-emerald-400`,children:i.outputTokens??0})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Total Tokens`}),(0,F.jsx)(`p`,{className:`text-sm font-bold font-mono text-white`,children:i.totalTokens??0})]})]})]}),a&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(M,{className:`h-4 w-4 text-primary`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px]`,children:`WASI Instruction Fuel (AST Deterministic)`}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Execution quota enforced by origin runtime`})]})]}),(0,F.jsxs)(`div`,{className:`text-right font-mono`,children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-white`,children:(a.consumed??0).toLocaleString()}),(0,F.jsxs)(`span`,{className:`text-[10px] text-zinc-400`,children:[` `,`/ `,(a.maxLimit??1e6).toLocaleString(),` u`]})]})]}),(0,F.jsx)(`div`,{className:`w-full bg-secondary/80 rounded-full h-2 overflow-hidden border border-border`,children:(0,F.jsx)(`div`,{className:`bg-primary h-2 rounded-full transition-all duration-300`,style:{width:`${Math.min(100,Math.max(2,a.percentUsed??0))}%`}})}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-zinc-400 font-mono`,children:[(0,F.jsxs)(`span`,{children:[`Fuel Used:`,` `,(0,F.jsxs)(`strong`,{className:`text-primary font-semibold`,children:[a.percentUsed??0,`%`]})]}),(0,F.jsx)(`span`,{children:`Quantization: 100-Fuel-Bucket`})]})]}),o&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(N,{className:`h-4 w-4 text-primary`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px]`,children:`Wire Payload & Egress Traffic`}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Physical socket egress measured at runtime`})]})]}),o.egressReductionPercent!==void 0&&o.rawDatasetProtectedBytes!==void 0&&o.rawDatasetProtectedBytes>0&&(0,F.jsxs)(If,{variant:`outline`,className:`border-emerald-500/40 text-emerald-400 font-mono text-[10px]`,children:[`-`,o.egressReductionPercent,`% Wire Reduction`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border font-mono`,children:[(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-400 block font-sans`,children:`Wire Payload (Envelope + Output):`}),(0,F.jsx)(`strong`,{className:`text-white text-xs`,children:o.payloadBytes===void 0?`Measured in socket`:`${(o.payloadBytes/1024).toFixed(2)} KB`})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border font-mono`,children:[(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-400 block font-sans`,children:`Origin Dataset Retained:`}),(0,F.jsx)(`strong`,{className:`text-emerald-400 text-xs`,children:o.rawDatasetProtectedBytes&&o.rawDatasetProtectedBytes>0?`${(o.rawDatasetProtectedBytes/1024).toFixed(1)} KB`:`Zero egress leakage`})]})]})]}),s&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px] block`,children:`Phase Latency Breakdown`}),(0,F.jsxs)(`span`,{className:`text-[10px] font-mono text-zinc-400`,children:[`Total: `,s.totalLatencyMs??e.latencyMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-5 gap-1.5 text-center font-mono text-[10px]`,children:[(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Route`}),(0,F.jsxs)(`span`,{className:`text-zinc-200 font-semibold`,children:[s.discoveryMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Kyber`}),(0,F.jsxs)(`span`,{className:`text-primary font-semibold`,children:[s.pqcMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Seal`}),(0,F.jsxs)(`span`,{className:`text-zinc-200 font-semibold`,children:[s.sealingMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Sandbox`}),(0,F.jsxs)(`span`,{className:`text-emerald-400 font-semibold`,children:[s.wasiSandboxMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`ZK-Proof`}),(0,F.jsxs)(`span`,{className:`text-primary font-semibold`,children:[s.zkVerificationMs??0,` ms`]})]})]})]}),(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(j,{className:`h-4 w-4 text-emerald-400`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`font-semibold text-white text-[11px]`,children:`ZK-Receipt Proof & PQC Suite`}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`ML-KEM-768 • AES-256-GCM • HMAC SHA-256`})]})]}),(0,F.jsx)(If,{variant:`success`,className:`font-mono text-[10px]`,children:`VERIFIED`})]}),e.zkHash&&(0,F.jsxs)(`div`,{className:`flex items-center justify-between bg-editor p-2 rounded border border-border font-mono text-[10px] text-zinc-300`,children:[(0,F.jsx)(`span`,{className:`truncate mr-2 select-all font-mono text-emerald-300`,children:e.zkHash}),(0,F.jsx)(`button`,{type:`button`,onClick:r,className:`text-[10px] flex items-center gap-1 text-zinc-400 hover:text-white shrink-0 px-1.5 py-0.5 rounded bg-surface1 border border-border transition-colors cursor-pointer`,title:`Copy ZK-Receipt Hash`,children:t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ne,{className:`h-3 w-3 text-emerald-400`}),(0,F.jsx)(`span`,{className:`text-emerald-400`,children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Copy`})]})})]})]})]})})}function Am(e,[t,n]){return Math.min(n,Math.max(t,e))}function jm(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}var Mm=`ScrollArea`,[Nm,Pm]=qf(Mm),[Fm,Im]=Nm(Mm),Lm=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=b.useState(null),[l,u]=b.useState(null),[d,f]=b.useState(null),[p,m]=b.useState(null),[h,g]=b.useState(null),[_,v]=b.useState(0),[y,x]=b.useState(0),[S,C]=b.useState(!1),[w,T]=b.useState(!1),E=Zf(t,e=>c(e)),D=Sp(i);return(0,F.jsx)(Fm,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,F.jsx)(hp.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});Lm.displayName=Mm;var Rm=`ScrollAreaViewport`,zm=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Im(Rm,n),s=Zf(t,b.useRef(null),o.onViewportChange);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,F.jsx)(hp.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,F.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});zm.displayName=Rm;var Bm=`ScrollAreaScrollbar`,Vm=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Im(Bm,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return b.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,F.jsx)(Hm,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,F.jsx)(Um,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,F.jsx)(Wm,{...r,ref:t,forceMount:n}):i.type===`always`?(0,F.jsx)(Gm,{...r,ref:t,"data-state":`visible`}):null});Vm.displayName=Bm;var Hm=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Im(Bm,e.__scopeScrollArea),[a,o]=b.useState(!1);return b.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,F.jsx)(Gp,{present:n||a,children:(0,F.jsx)(Wm,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Um=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Im(Bm,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=dh(()=>c(`SCROLL_END`),100),[s,c]=jm(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return b.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),b.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,F.jsx)(Gp,{present:n||s!==`hidden`,children:(0,F.jsx)(Gm,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Kf(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Kf(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),Wm=b.forwardRef((e,t)=>{let n=Im(Bm,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=b.useState(!1),s=e.orientation===`horizontal`,c=dh(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return fh(n.viewport,c),fh(n.content,c),(0,F.jsx)(Gp,{present:r||a,children:(0,F.jsx)(Gm,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),Gm=b.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=Im(Bm,e.__scopeScrollArea),a=b.useRef(null),o=b.useRef(0),[s,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ih(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return oh(e,o.current,s,t)}return n===`horizontal`?(0,F.jsx)(Km,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=sh(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,F.jsx)(qm,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=sh(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Km=b.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Im(Bm,e.__scopeScrollArea),[o,s]=b.useState(),c=b.useRef(null),l=Zf(t,c,a.onScrollbarXChange);return b.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(Xm,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":ah(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),lh(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:rh(o.paddingLeft),paddingEnd:rh(o.paddingRight)}})}})}),qm=b.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Im(Bm,e.__scopeScrollArea),[o,s]=b.useState(),c=b.useRef(null),l=Zf(t,c,a.onScrollbarYChange);return b.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(Xm,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":ah(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),lh(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:rh(o.paddingTop),paddingEnd:rh(o.paddingBottom)}})}})}),[Jm,Ym]=Nm(Bm),Xm=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=Im(Bm,n),[m,h]=b.useState(null),g=Zf(t,e=>h(e)),_=b.useRef(null),v=b.useRef(``),y=p.viewport,x=r.content-r.viewport,S=gp(u),C=gp(c),w=dh(d,10);function T(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return b.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,x,S]),b.useEffect(C,[r,C]),fh(m,w),fh(p.content,w),(0,F.jsx)(Jm,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:gp(a),onThumbPointerUp:gp(o),onThumbPositionChange:C,onThumbPointerDown:gp(s),children:(0,F.jsx)(hp.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Kf(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Kf(e.onPointerMove,T),onPointerUp:Kf(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),Zm=`ScrollAreaThumb`,Qm=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Ym(Zm,e.__scopeScrollArea);return(0,F.jsx)(Gp,{present:n||i.hasThumb,children:(0,F.jsx)($m,{ref:t,...r})})}),$m=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=Im(Zm,n),o=Ym(Zm,n),{onThumbPositionChange:s}=o,c=Zf(t,e=>o.onThumbChange(e)),l=b.useRef(void 0),u=dh(()=>{l.current&&=(l.current(),void 0)},100);return b.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=uh(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,F.jsx)(hp.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Kf(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Kf(e.onPointerUp,o.onThumbPointerUp)})});Qm.displayName=Zm;var eh=`ScrollAreaCorner`,th=b.forwardRef((e,t)=>{let n=Im(eh,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,F.jsx)(nh,{...e,ref:t}):null});th.displayName=eh;var nh=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=Im(eh,n),[a,o]=b.useState(0),[s,c]=b.useState(0),l=!!(a&&s);return fh(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),fh(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,F.jsx)(hp.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function rh(e){return e?parseInt(e,10):0}function ih(e,t){let n=e/t;return isNaN(n)?0:n}function ah(e){let t=ih(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function oh(e,t,n,r=`ltr`){let i=ah(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return ch([c,l],d)(e)}function sh(e,t,n=`ltr`){let r=ah(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Am(e,n===`ltr`?[0,o]:[o*-1,0]);return ch([0,o],[0,s])(c)}function ch(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function lh(e,t){return e>0&&e<t}var uh=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function dh(e,t){let n=gp(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function fh(e,t){let n=gp(t);dp(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ph=Lm,mh=zm,hh=Vm,gh=th,_h=b.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(ph,{ref:r,className:Pf(`relative overflow-hidden`,e),...n,children:[(0,F.jsx)(mh,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,F.jsx)(vh,{}),(0,F.jsx)(gh,{})]}));_h.displayName=ph.displayName;var vh=b.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,F.jsx)(hh,{ref:r,orientation:t,className:Pf(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,F.jsx)(Qm,{className:`relative flex-1 rounded-full bg-border/40 hover:bg-border/70 transition-colors`})}));vh.displayName=hh.displayName;function yh({timeline:e,result:t,meta:n,errorAlert:r,isRunning:i,code:a,selectedToolName:o,targetType:s,grpcTarget:c,httpUrl:l,stdioCmd:u,activeTab:d,onTabChange:f}){let[p,m]=(0,b.useState)(`output`),h=d??p,g=e=>{f?f(e):m(e)};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 min-h-0 flex-1`,children:[(0,F.jsxs)(zf,{className:`p-3 bg-card border-border shadow-card shrink-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsxs)(`span`,{className:`text-xs font-semibold text-white flex items-center gap-1.5`,children:[(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-primary`}),`Execution Timeline & Cryptographic Pipeline`]}),i?(0,F.jsxs)(If,{variant:`warning`,className:`text-[10px] font-mono flex items-center gap-1`,children:[(0,F.jsx)(de,{className:`h-2.5 w-2.5 animate-spin`}),` In-Situ Processing`]}):(0,F.jsxs)(`span`,{className:`text-[10px] text-zinc-400 font-mono`,children:[e.filter(e=>e.status===`success`).length,` /`,` `,e.length,` Steps`]})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-5 gap-2`,children:e.map(e=>{let t=e.status===`success`,n=e.status===`running`,r=e.status===`failed`;return(0,F.jsxs)(`div`,{className:`p-2 rounded-lg border transition-all text-xs ${t?`bg-emerald-950/20 border-emerald-500/30 text-emerald-400`:n?`bg-amber-950/20 border-amber-500/40 text-amber-400 animate-pulse`:r?`bg-rose-950/20 border-rose-500/40 text-rose-400`:`bg-surface1/40 border-border/50 text-zinc-500`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-[11px] truncate`,children:e.label}),t&&(0,F.jsx)(re,{className:`h-3 w-3 text-emerald-400 shrink-0`}),n&&(0,F.jsx)(de,{className:`h-3 w-3 text-amber-400 animate-spin shrink-0`}),r&&(0,F.jsx)(ie,{className:`h-3 w-3 text-rose-400 shrink-0`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono`,children:[(0,F.jsx)(`span`,{className:`truncate text-zinc-400`,title:e.detail,children:e.detail}),e.durationMs!==void 0&&(0,F.jsxs)(`span`,{className:`shrink-0 ml-1 text-zinc-300`,children:[e.durationMs,`ms`]})]})]},e.phase)})})]}),(0,F.jsx)(zf,{className:`flex-1 min-h-0 bg-card border-border shadow-card flex flex-col overflow-hidden`,children:(0,F.jsxs)(gm,{value:h,onValueChange:e=>g(e),className:`flex-1 flex flex-col min-h-0`,children:[(0,F.jsxs)(Bf,{className:`py-2.5 px-5 border-b border-border bg-surface1/60 shrink-0 flex flex-row items-center justify-between`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-1 p-0.5 bg-surface1 border border-border rounded-lg relative`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`output`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`output`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(Ce,{className:`h-3.5 w-3.5 relative z-20 ${h===`output`?`text-black`:`text-zinc-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`output`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Output`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`debug`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`debug`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(ee,{className:`h-3.5 w-3.5 relative z-20 ${h===`debug`?`text-black`:`text-amber-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`debug`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Debug`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`export`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`export`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(ce,{className:`h-3.5 w-3.5 relative z-20 ${h===`export`?`text-black`:`text-cyan-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`export`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Export Code`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`telemetry`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`telemetry`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 relative z-20 ${h===`telemetry`?`text-black`:`text-emerald-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`telemetry`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Live Telemetry`})]})]})}),n?.latencyMs!==void 0&&(0,F.jsxs)(If,{variant:`outline`,className:`text-[10px] font-mono flex items-center gap-1 border-white/15 bg-secondary/60 text-zinc-300`,children:[(0,F.jsx)(D,{className:`h-3 w-3 text-primary`}),n.latencyMs,`ms total`]})]}),(0,F.jsx)(Uf,{className:`flex-1 min-h-0 overflow-hidden p-0`,children:(0,F.jsxs)(_h,{className:`h-full px-5`,children:[(0,F.jsx)(Om,{result:t,errorAlert:r,isRunning:i,meta:n}),(0,F.jsx)(bm,{timeline:e,targetType:s,meta:n}),(0,F.jsx)(Sm,{toolName:o,code:a,targetType:s,grpcTarget:c,httpUrl:l,stdioCmd:u}),(0,F.jsx)(km,{meta:n})]})})]})})]})}function bh({node:e,isConnected:t,onSwitchTarget:n,onSelectTool:r}){let i=e.status===`offline`,a=e.tier,o=e.transportType===`stdio`,s=e.transportType===`grpc`||!!e.ports?.grpc,c=e.transportType===`http`||!!e.ports?.http,l=a===1?{bgActive:`bg-tier1 border-emerald-500/60 ring-1 ring-emerald-500/30`,bgInactive:`bg-tier1 border-emerald-500/30 hover:brightness-110`,textAccent:`text-emerald-400`,badgeBorder:`border-emerald-500/30`,badgeBg:`bg-emerald-500/15`,badgeText:`text-emerald-300`,icon:xe}:a===2?{bgActive:`bg-tier2 border-cyan-500/60 ring-1 ring-cyan-500/30`,bgInactive:`bg-tier2 border-cyan-500/30 hover:brightness-110`,textAccent:`text-cyan-400`,badgeBorder:`border-cyan-500/30`,badgeBg:`bg-cyan-500/15`,badgeText:`text-cyan-200`,icon:N}:a===3?{bgActive:`bg-tier3 border-cyan-500/60 ring-1 ring-cyan-500/30`,bgInactive:`bg-tier3 border-purple-500/30 hover:brightness-110`,textAccent:`text-purple-400`,badgeBorder:`border-purple-500/30`,badgeBg:`bg-purple-500/15`,badgeText:`text-purple-200`,icon:A}:{bgActive:`bg-surface1 border-cyan-500/60 ring-1 ring-cyan-500/30`,bgInactive:`bg-surface1/60 border-border hover:border-border/80 hover:brightness-110`,textAccent:o?`text-amber-400`:s?`text-cyan-400`:`text-sky-400`,badgeBorder:`border-white/15`,badgeBg:`bg-white/10`,badgeText:`text-zinc-200`,icon:o?Ce:s?A:c?N:ve},u=l.icon,d=()=>{let t=e.ports?.grpc??e.ports?.http,r=e.ports?.grpc?`grpc`:`http`;n(r===`grpc`?`${e.host}:${t}`:`http://${e.host}:${t}/mcp`,r)},f=i=>{if(r(i),!t){let t=e.ports?.grpc??e.ports?.http,r=e.ports?.grpc?`grpc`:`http`;n(r===`grpc`?`${e.host}:${t}`:`http://${e.host}:${t}/mcp`,r,i)}},p=o?`stdio (local pipeline)`:e.ports?.grpc?`${e.host}:${e.ports.grpc}`:e.ports?.http?`${e.host}:${e.ports.http}`:e.host;return(0,F.jsxs)(`div`,{className:`p-2.5 rounded-md border transition-all ${i?`border-border/40 bg-surface1/20 opacity-60`:t?`${l.bgActive} shadow-sm`:l.bgInactive}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(u,{className:`h-3 w-3 ${i?`text-zinc-500`:l.textAccent}`}),(0,F.jsx)(`span`,{className:`text-xs font-semibold ${i?`text-zinc-400`:`text-zinc-100`}`,children:e.name}),t&&(0,F.jsxs)(`span`,{className:`text-[8px] font-mono px-1.5 py-0.2 rounded bg-cyan-500/25 border border-cyan-500/40 text-cyan-200 font-bold flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-cyan-400 animate-ping`}),`ACTIVE TARGET`]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[!t&&!i&&(0,F.jsxs)(`button`,{type:`button`,onClick:d,className:`text-[9px] font-mono px-1.5 py-0.2 rounded bg-surface1 hover:bg-primary hover:text-black border border-white/10 text-zinc-300 transition-colors flex items-center gap-1 cursor-pointer`,title:`Connect to ${e.name}`,children:[(0,F.jsx)(Oe,{className:`h-2.5 w-2.5 text-cyan-400`}),(0,F.jsx)(`span`,{children:`Connect`})]}),(0,F.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${i?`bg-rose-500`:l.textAccent.replace(`text-`,`bg-`)}`}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono ${i?`text-zinc-500 font-medium`:l.textAccent}`,children:i?`OFFLINE`:`${e.rttMs}ms`})]})]}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400 mb-1`,children:e.role}),(0,F.jsxs)(`div`,{className:`text-[10px] font-mono text-zinc-400 flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:p}),(0,F.jsx)(`span`,{className:`text-[9px] ${i?`text-zinc-500`:l.textAccent}`,children:e.isolation?.split(`+`)[0]||e.tierLabel?.split(`:`)[0]||(a===1?`Sovereign Node`:a===2?`Consortium Node`:a===3?`Client Edge`:`Direct Target`)})]}),!i&&e.tools.length>0&&(0,F.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.tools.map(n=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>f(n),className:`text-[9px] px-1.5 py-0.5 rounded ${l.badgeBg} hover:opacity-80 border ${l.badgeBorder} ${l.badgeText} transition-colors cursor-pointer`,title:t?`Load ${n} in Logic Studio`:`Connect to ${e.name} and load ${n}`,children:[`+ `,n]},n))})]})}function xh({tools:e,nodes:t,scanSummary:n,onlineNodes:r,totalNodes:i,hasNodeStats:a,isScanning:o,loadingTools:s,targetType:c,activeConnectedTarget:l,selectedToolName:u,onSelectTool:d,onSwitchTarget:f}){let[p,m]=(0,b.useState)(`nodes`),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(`all`),[y,x]=(0,b.useState)(null),S=async(e,t)=>{await ke(e)&&(x(t),setTimeout(()=>x(null),1500))},C=(0,b.useMemo)(()=>{let e=new Set;for(let n of t)(n.tier===1||n.tier===2||n.tier===3)&&e.add(n.tier);return Array.from(e).sort()},[t]),w=(0,b.useMemo)(()=>t.some(e=>e.tier===void 0||e.tier===null),[t]),T=C.length>0,E=(0,b.useMemo)(()=>{if(!h.trim())return e;let t=h.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)||e.domain?.toLowerCase().includes(t)||e.taxonomy?.domain?.toLowerCase().includes(t))},[e,h]),D=(0,b.useMemo)(()=>_===`all`?t:_===`standalone`?t.filter(e=>e.tier===void 0||e.tier===null):t.filter(e=>e.tier===_),[t,_]),O=(0,b.useMemo)(()=>D.filter(e=>e.tier===void 0||e.tier===null),[D]),ee=(0,b.useMemo)(()=>D.filter(e=>e.tier===1),[D]),te=(0,b.useMemo)(()=>D.filter(e=>e.tier===2),[D]),re=(0,b.useMemo)(()=>D.filter(e=>e.tier===3),[D]),ie=e=>{if(!l)return!1;if(c===`grpc`){let t=l.split(`:`)[1]||``;return!!(e.ports?.grpc&&String(e.ports.grpc)===t||e.host&&l.includes(e.host)&&t===String(e.ports?.grpc)||l&&l.toLowerCase().includes(e.id.toLowerCase()))}if(c===`http`){let t=l.match(/:(\d+)/)?.[1]||``;return!!(e.ports?.http&&String(e.ports.http)===t||l&&l.toLowerCase().includes(e.id.toLowerCase()))}return e.status===`online`&&l.toLowerCase().includes(e.id.toLowerCase())};return(0,F.jsxs)(`section`,{className:`lg:col-span-4 flex flex-col space-y-6`,children:[(0,F.jsxs)(zf,{className:`flex flex-col h-[560px] overflow-hidden bg-card border-border shadow-card`,children:[(0,F.jsxs)(Bf,{className:`pb-2.5 shrink-0 border-b border-border/40`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 p-0.5 bg-surface1 border border-white/10 rounded-lg`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>m(`nodes`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${p===`nodes`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(ve,{className:`h-3.5 w-3.5`}),`Server Scan`,` `,a?`(${r}/${i})`:``]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>m(`capabilities`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${p===`capabilities`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(Ee,{className:`h-3.5 w-3.5`}),`Capabilities (`,e.length,`)`]})]}),(0,F.jsx)(If,{variant:`outline`,className:`text-[10px] font-mono border-white/15 text-zinc-300`,children:p===`capabilities`?`${e.length} tools`:T?`${C.length} Active Layer${C.length>1?`s`:``}`:`${i} Targets`})]}),p===`capabilities`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Hf,{className:`text-xs text-zinc-400`,children:`Discovered runtime capabilities ready for secure in-situ execution.`}),(0,F.jsxs)(`div`,{className:`relative mt-2`,children:[(0,F.jsx)(_e,{className:`h-3.5 w-3.5 absolute left-2.5 top-2.5 text-zinc-400`}),(0,F.jsx)(`input`,{type:`text`,value:h,onChange:e=>g(e.target.value),placeholder:`Filter by capability or domain...`,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,className:`w-full h-8 pl-8 pr-7 bg-surface1 border border-white/15 rounded text-xs text-white placeholder:text-zinc-500 focus:outline-none focus:border-cyan-500/60 focus:ring-1 focus:ring-cyan-500/30 transition-all`}),h&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>g(``),className:`absolute right-2 top-2 text-zinc-400 hover:text-white p-0.5 rounded transition-colors`,title:`Clear filter`,children:(0,F.jsx)(De,{className:`h-3.5 w-3.5`})})]})]}):(0,F.jsxs)(`div`,{className:`flex items-center justify-between mt-1`,children:[(0,F.jsx)(`span`,{className:`text-[11px] text-zinc-400`,children:T?`Live scan across network layers:`:`Discovered network targets:`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>v(`all`),className:`text-[10px] px-1.5 py-0.5 rounded font-mono transition-colors ${_===`all`?`bg-primary/20 text-cyan-400 border border-cyan-500/40`:`text-zinc-400 hover:text-zinc-200 border border-transparent`}`,children:`All`}),w&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>v(`standalone`),className:`text-[10px] px-1.5 py-0.5 rounded font-mono transition-colors ${_===`standalone`?`bg-primary/20 text-cyan-400 border border-cyan-500/40`:`text-zinc-400 hover:text-zinc-200 border border-transparent`}`,children:`Direct`}),C.map(e=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>v(e),className:`text-[10px] px-1.5 py-0.5 rounded font-mono transition-colors ${_===e?`bg-primary/20 text-cyan-400 border border-cyan-500/40`:`text-zinc-400 hover:text-zinc-200 border border-transparent`}`,children:[`T`,e]},e))]})]})]}),(0,F.jsx)(Uf,{className:`flex-1 min-h-0 overflow-hidden p-0`,children:(0,F.jsx)(_h,{className:`h-full px-4 py-2`,children:p===`capabilities`?s?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-zinc-400 space-y-2`,children:[(0,F.jsx)(de,{className:`h-5 w-5 animate-spin text-primary`}),(0,F.jsx)(`span`,{className:`text-xs text-zinc-300`,children:`Discovering capabilities across tiers...`})]}):E.length===0?(0,F.jsxs)(`div`,{className:`text-center py-12 text-zinc-400 space-y-2`,children:[(0,F.jsx)(Te,{className:`h-6 w-6 mx-auto text-warning`}),(0,F.jsx)(`p`,{className:`text-xs font-medium text-zinc-200`,children:`No capabilities found`}),(0,F.jsx)(`p`,{className:`text-[11px] text-zinc-400 max-w-[200px] mx-auto`,children:`Try adjusting your search query.`})]}):(0,F.jsx)(`div`,{className:`space-y-2.5 pb-4`,children:E.map(e=>{let t=u===e.name,n=e.tier||(e.taxonomy?.clearanceTier===1?1:e.taxonomy?.clearanceTier===3?3:2);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>d(e.name),className:`w-full text-left p-3 rounded-md border transition-all cursor-pointer ${t?`bg-primary/10 border-primary/60 text-white shadow-sm ring-1 ring-primary/30`:`bg-secondary/40 border-border/70 hover:bg-secondary/80 hover:border-border`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-xs text-zinc-100 truncate max-w-[190px]`,children:e.name}),(0,F.jsxs)(If,{variant:n===1?`success`:n===2?`warning`:`default`,className:`text-[10px] py-0 px-1.5 font-normal`,children:[`Tier `,n]})]}),(0,F.jsx)(`p`,{className:`text-[11px] text-zinc-300 line-clamp-2 leading-relaxed`,children:e.description||`No description available.`}),(0,F.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between text-[10px] text-zinc-400`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1 truncate max-w-[180px]`,children:[(0,F.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${n===1?`bg-emerald-400`:n===2?`bg-cyan-400`:`bg-purple-400`}`}),e.providerNode||e.taxonomy?.domain||`Mesh Node`]}),(0,F.jsx)(`span`,{className:`font-mono text-[9px] opacity-75 shrink-0`,children:`WASI In-situ`})]})]},e.name)})}):(0,F.jsx)(`div`,{className:`space-y-4 pb-4`,children:t.length===0?(0,F.jsxs)(`div`,{className:`text-center py-10 px-4 bg-surface1/20 rounded-lg border border-white/5 space-y-2`,children:[(0,F.jsx)(ve,{className:`h-7 w-7 text-cyan-400 mx-auto opacity-70 animate-pulse`}),(0,F.jsx)(`p`,{className:`text-xs font-semibold text-zinc-200`,children:`Scanning Network Nodes...`}),(0,F.jsxs)(`p`,{className:`text-[11px] text-zinc-400 font-mono`,children:[`Querying `,l]})]}):(0,F.jsxs)(F.Fragment,{children:[(_===`all`||_===`standalone`)&&O.length>0&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-sky-400 border-b border-sky-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(ve,{className:`h-3.5 w-3.5 text-sky-400`}),`Direct Connection & Standalone Targets`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-sky-500/10 border border-sky-500/30 text-sky-300`,children:`Direct Compute`})]}),O.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]}),T&&(_===`all`||_===1)&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-emerald-400 border-b border-emerald-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(xe,{className:`h-3.5 w-3.5 text-emerald-400`}),`Tier 1: Sovereign Core Enclaves`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-emerald-500/10 border border-emerald-500/30 text-emerald-300`,children:`Zero-Trust • PSK`})]}),ee.length===0?(0,F.jsxs)(`div`,{className:`text-[10px] text-zinc-500 italic py-2 px-2.5 bg-surface1/30 rounded border border-white/5 flex items-center gap-1.5`,children:[(0,F.jsx)(Te,{className:`h-3 w-3 text-zinc-500`}),`No Tier 1 nodes detected on scanned target`]}):ee.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]}),T&&(_===`all`||_===2)&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-cyan-400 border-b border-cyan-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(N,{className:`h-3.5 w-3.5 text-cyan-400`}),`Tier 2: Consortium Relays & Gateways`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-cyan-500/10 border border-cyan-500/30 text-cyan-300`,children:`BLG • mTLS`})]}),te.length===0?(0,F.jsxs)(`div`,{className:`text-[10px] text-zinc-500 italic py-2 px-2.5 bg-surface1/30 rounded border border-white/5 flex items-center gap-1.5`,children:[(0,F.jsx)(Te,{className:`h-3 w-3 text-zinc-500`}),`No Tier 2 nodes detected on scanned target`]}):te.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]}),T&&(_===`all`||_===3)&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-purple-400 border-b border-purple-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(A,{className:`h-3.5 w-3.5 text-purple-400`}),`Tier 3: Public Backbone & Client Edge`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-purple-500/10 border border-purple-500/30 text-purple-300`,children:`AutoNAT / WAN`})]}),re.length===0?(0,F.jsxs)(`div`,{className:`text-[10px] text-zinc-500 italic py-2 px-2.5 bg-surface1/30 rounded border border-white/5 flex items-center gap-1.5`,children:[(0,F.jsx)(Te,{className:`h-3 w-3 text-zinc-500`}),`No Tier 3 edge nodes active on scanned target`]}):re.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]})]})})})})]}),(0,F.jsxs)(zf,{className:`p-4 bg-card border-border shadow-card shrink-0`,children:[(0,F.jsxs)(`h3`,{className:`text-xs font-semibold text-white mb-3 flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Mesh Discovery Telemetry`}),(0,F.jsxs)(`span`,{className:`font-mono text-[10px] text-zinc-400 font-normal flex items-center gap-1`,children:[o&&(0,F.jsx)(de,{className:`h-2.5 w-2.5 animate-spin text-primary`}),c.toUpperCase(),` / WASI`]})]}),(0,F.jsxs)(`div`,{className:`space-y-2.5 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Mesh Topology:`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`h-2 w-2 rounded-full ${r>0?`bg-emerald-400`:`bg-rose-500`}`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] font-medium ${r>0?`text-white`:`text-zinc-500`}`,children:r>0?`${r}/${i} Nodes Online`:`0 Nodes Online (Offline)`})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Architecture Mode:`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] ${r>0?`text-cyan-400`:`text-zinc-500`}`,children:r>0?T?`${C.length} Active Layer${C.length>1?`s`:``}`:`Direct Standalone Node`:`Offline`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Discovered Tools:`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] ${e.length>0?`text-emerald-400`:`text-zinc-500`}`,children:e.length>0?`${e.length} Capabilities`:`0 Available`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Avg Round-Trip Time:`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] ${r>0?`text-white font-semibold`:`text-zinc-500`}`,children:r>0?n?.avgLatencyMs!==void 0&&n.avgLatencyMs>0?`${n.avgLatencyMs} ms`:t.some(e=>e.rttMs>0&&e.status===`online`)?`${Math.round(t.filter(e=>e.status===`online`&&e.rttMs>0).reduce((e,t)=>e+t.rttMs,0)/Math.max(1,t.filter(e=>e.status===`online`&&e.rttMs>0).length))} ms`:`—`:`—`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between pt-0.5`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Active Target:`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`font-mono text-[11px] text-zinc-300 truncate max-w-[130px]`,title:l,children:l}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>S(l,`target`),className:`text-zinc-400 hover:text-white transition-colors p-0.5 rounded cursor-pointer`,title:`Copy Target Address`,children:y===`target`?(0,F.jsx)(ne,{className:`h-3 w-3 text-emerald-400`}):(0,F.jsx)(k,{className:`h-3 w-3`})})]})]})]})]})]})}function Sh({className:e=`h-8 w-8 text-primary`}){return(0,F.jsxs)(`svg`,{className:e,viewBox:`0 0 120 120`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`title`,{children:`LIOP Protocol Logo`}),(0,F.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,children:[(0,F.jsx)(`polygon`,{points:`100,76.57 76.57,100 43.43,100 20,76.57 20,43.43 43.43,20 76.57,20 100,43.43`}),(0,F.jsx)(`circle`,{cx:`60`,cy:`60`,r:`10`,fill:`currentColor`,stroke:`none`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(45 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(90 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(135 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(180 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(225 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(270 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(315 60 60)`})]})]})}function Ch({onlineNodes:e,totalNodes:t,hasNodeStats:n,isScanning:r,secondsAgo:i,theme:a,onThemeChange:o,onRescan:s}){return(0,F.jsx)(`header`,{className:`border-b border-border bg-card/90 backdrop-blur-sm sticky top-0 z-50 transition-colors`,children:(0,F.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 h-14 flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center space-x-3`,children:[(0,F.jsx)(Sh,{className:`h-8 w-8 text-primary shrink-0 transition-transform duration-200 hover:scale-105`}),(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-base font-bold tracking-tight text-white flex items-center gap-2`,children:[(0,F.jsx)(`span`,{children:`LIOP Studio`}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono font-medium px-1.5 py-0.2 text-cyan-300 border border-cyan-500/30 rounded bg-cyan-500/10`,children:`v1.0.0-alpha.0`})]}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400 -mt-0.5 hidden sm:block`,children:`Sovereign Logic & MCP Multi-Transport Inspector`})]})})]}),(0,F.jsxs)(`div`,{className:`flex items-center space-x-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center space-x-2 bg-secondary/80 border border-white/10 px-3 py-1 rounded-md text-xs`,children:[(0,F.jsx)(`span`,{className:`relative flex h-2 w-2`,children:e>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75`}),(0,F.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-emerald-500`})]}):(0,F.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-rose-500`})}),(0,F.jsx)(`span`,{className:`font-medium ${e>0?`text-white`:`text-rose-400`}`,children:n?e>0?`${e}/${t} Nodes Online`:`0 Nodes Online (Offline)`:r?`Scanning Mesh Nodes...`:`Topology Offline`}),(0,F.jsx)(`span`,{className:`text-cyan-400 font-mono text-[10px] hidden sm:inline`,children:`(3 Tiers)`}),(0,F.jsx)(`span`,{className:`text-zinc-400 font-mono text-[10px] border-l border-white/15 pl-1.5 hidden md:inline`,children:i===0?`live`:`${i}s ago`})]}),(0,F.jsxs)(Rf,{size:`sm`,variant:`outline`,onClick:s,disabled:r,className:`h-8 px-2.5 border-white/15 bg-surface1 text-zinc-300 hover:text-white hover:bg-white/5 flex items-center gap-1.5 text-xs`,title:`Re-scan mesh topology across all layers`,children:[(0,F.jsx)(he,{className:`h-3.5 w-3.5 text-cyan-400 ${r?`animate-spin`:``}`}),(0,F.jsx)(`span`,{className:`hidden md:inline font-mono text-[11px]`,children:`Scan`})]}),(0,F.jsxs)(`div`,{className:`relative flex items-center bg-surface1 border border-white/15 p-0.5 rounded-md`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(`obsidian`),className:`relative z-10 text-[11px] px-2.5 py-1 font-medium flex items-center gap-1.5 transition-colors duration-200`,title:`OLED Obsidian Theme`,children:[a===`obsidian`&&(0,F.jsx)(rd.div,{layoutId:`themeActivePill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(pe,{className:`relative z-20 h-3.5 w-3.5 transition-colors duration-200 ${a===`obsidian`?`text-black`:`text-zinc-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${a===`obsidian`?`text-black`:`text-zinc-300 hover:text-white`}`,children:`Obsidian`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(`slate`),className:`relative z-10 text-[11px] px-2.5 py-1 font-medium flex items-center gap-1.5 transition-colors duration-200`,title:`Slate Dark Theme`,children:[a===`slate`&&(0,F.jsx)(rd.div,{layoutId:`themeActivePill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(P,{className:`relative z-20 h-3.5 w-3.5 transition-colors duration-200 ${a===`slate`?`text-black`:`text-zinc-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${a===`slate`?`text-black`:`text-zinc-300 hover:text-white`}`,children:`Slate`})]})]})]})]})})}var wh=b.forwardRef(({className:e,type:t,...n},r)=>(0,F.jsx)(`input`,{type:t,className:Pf(`flex h-9 w-full rounded-md border border-border bg-surface1 px-3 py-1 text-xs text-white placeholder:text-zinc-500 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));wh.displayName=`Input`;var Th=({targetType:e,onTargetTypeChange:t,stdioCmd:n,onStdioCmdChange:r,httpUrl:i,onHttpUrlChange:a,grpcTarget:o,onGrpcTargetChange:s,onConnect:c,isConnecting:l,activeConnectedTarget:u,connected:d})=>(0,F.jsx)(`div`,{className:`w-full bg-surface1/90 border-b border-border px-4 py-2.5 backdrop-blur-sm transition-colors`,children:(0,F.jsxs)(`div`,{className:`max-w-7xl mx-auto flex flex-col md:flex-row items-stretch md:items-center justify-between gap-3 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 p-0.5 bg-background/80 border border-white/10 rounded-lg shrink-0`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`stdio`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`stdio`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(Ce,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`Stdio`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`http`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`http`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(N,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`HTTP / SSE`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`grpc`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`grpc`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(A,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`gRPC`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`mesh`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`mesh`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(Ee,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`LIOP Mesh`})]})]}),(0,F.jsxs)(`div`,{className:`flex-1 flex items-center gap-2`,children:[e===`stdio`&&(0,F.jsx)(`div`,{className:`flex-1 relative`,children:(0,F.jsx)(wh,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Command and arguments, e.g.: npx -y @modelcontextprotocol/server-filesystem /tmp`,className:`font-mono text-[11px] h-8 bg-background/90`})}),e===`http`&&(0,F.jsx)(`div`,{className:`flex-1 relative`,children:(0,F.jsx)(wh,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`MCP Server Endpoint URL, e.g.: http://127.0.0.1:15000/mcp`,className:`font-mono text-[11px] h-8 bg-background/90`})}),e===`grpc`&&(0,F.jsx)(`div`,{className:`flex-1 relative`,children:(0,F.jsx)(wh,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`Tonic gRPC Host:Port, e.g.: 127.0.0.1:13011`,className:`font-mono text-[11px] h-8 bg-background/90`})}),e===`mesh`&&(0,F.jsxs)(`div`,{className:`flex-1 flex items-center px-3 py-1 bg-background/80 border border-white/10 rounded-md font-mono text-[11px] text-zinc-300`,children:[(0,F.jsx)(`span`,{className:`text-cyan-400 mr-2`,children:`Preset Topology:`}),(0,F.jsx)(`span`,{children:`8 Sovereign Origin Nodes across 3 Tiers (Kademlia DHT + Swarm PSK)`})]}),(0,F.jsx)(Rf,{size:`sm`,onClick:c,disabled:l,className:`h-8 px-4 text-xs font-semibold shrink-0`,children:l?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(de,{className:`h-3.5 w-3.5 animate-spin mr-1.5`}),`Connecting...`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(me,{className:`h-3 w-3 fill-current mr-1.5`}),`Connect / Probe`]})})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 bg-background/90 border border-white/10 rounded-md shrink-0`,children:[(0,F.jsx)(`span`,{className:`relative flex h-2 w-2`,children:d?(0,F.jsx)(`span`,{className:`inline-flex rounded-full h-2 w-2 bg-emerald-500`}):(0,F.jsx)(`span`,{className:`inline-flex rounded-full h-2 w-2 bg-rose-500`})}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] truncate max-w-[220px] ${d?`text-zinc-300`:`text-rose-400 font-medium`}`,title:u,children:d?u||`Ready to connect`:u?`${u} (Offline)`:`Target Offline`})]})]})}),Eh=[{phase:`bootstrap`,label:`P2P Mesh Bootstrap`,detail:`Node synchronized`,status:`pending`},{phase:`discovery`,label:`Resource Discovery`,detail:`Multi-tier route resolution`,status:`pending`},{phase:`pqc`,label:`Kyber-768 Handshake`,detail:`ML-KEM key exchange`,status:`pending`},{phase:`sealing`,label:`AES-256-GCM Sealing`,detail:`Envelope cipher & sign`,status:`pending`},{phase:`execution`,label:`WASI Sandbox Run`,detail:`Logic injection on origin`,status:`pending`},{phase:`zk_verify`,label:`ZK-Receipt HMAC Seal`,detail:`Computational integrity proof`,status:`pending`}];function Dh(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(Eh),u=(0,b.useCallback)((e,t,n,r)=>{l(i=>{let a=!1;return i.map(i=>i.phase===e?(a=!0,{...i,status:n,detail:t,durationMs:r??i.durationMs}):a&&i.status!==`success`&&i.status!==`failed`?{...i,status:`pending`}:!a&&(i.status===`pending`||i.status===`running`)?{...i,status:`success`}:i)})},[]);return{isRunning:e,result:n,meta:i,errorAlert:o,setErrorAlert:s,timeline:c,handleExecute:(0,b.useCallback)(async n=>{let{targetTool:i,executionMode:o,code:c,formArgs:d,targetType:f}=n;if(!(!i||e)){t(!0),r(null),a(null),s(null),l([{phase:`bootstrap`,label:`Channel Bootstrap`,detail:`Target transport: ${f.toUpperCase()}`,status:`running`},{phase:`discovery`,label:`Resource Discovery`,detail:`Targeting tool ${i}...`,status:`pending`},{phase:`pqc`,label:`Kyber-768 / Channel Security`,detail:`Securing transport session...`,status:`pending`},{phase:`sealing`,label:`Payload Sealing`,detail:`Encrypting parameters & payload...`,status:`pending`},{phase:`execution`,label:`Origin / Sandbox Execution`,detail:`Executing inside target environment...`,status:`pending`},{phase:`zk_verify`,label:`ZK-Receipt HMAC Seal`,detail:`Cryptographic proof validation...`,status:`pending`}]);try{let e=await fetch(`/api/execute`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o===`form`?{tool:i,args:d}:{tool:i,logic:c})});if(!e.ok)throw Error(`Gateway error: ${e.statusText}`);let n=e.body?.getReader();if(!n)throw Error(`Unable to initialize SSE stream reader`);let l=new TextDecoder,f=``;for(;;){let{value:e,done:i}=await n.read();if(i)break;f+=l.decode(e,{stream:!0});let o=f.split(`
|
|
98
|
-
`);f=o.pop()||``;for(let e of o)if(e.trim()&&e.startsWith(`data: `)){let n=e.slice(6);try{let e=JSON.parse(n);e.type===`step`?u(e.phase,e.detail,e.status,e.durationMs):e.type===`result`?(r(e.payload),a(e.meta||null),t(!1)):e.type===`error`&&(s({title:e.payload.title||`Execution Error`,desc:e.payload.desc||`A sandbox failure occurred on origin node`}),a(e.meta||null),t(!1))}catch(t){console.error(`Error parsing SSE line:`,t,e)}}}}catch(e){s({title:`Connection Error`,desc:(e instanceof Error?e.message:String(e))||`Failed to communicate with Playground Gateway`}),t(!1),l(e=>e.map(e=>e.status===`running`?{...e,status:`failed`,detail:`Connection interrupted`}:e))}}},[e,u]),resetExecution:(0,b.useCallback)(()=>{r(null),a(null),s(null),l(Eh)},[]),updateTimelineStep:u}}function Oh(e={}){let{onTargetSwitched:t,onError:n}=e,
|
|
97
|
+
}`}}}function Sm({toolName:e,code:t,targetType:n,grpcTarget:r,httpUrl:i,stdioCmd:a}){let[o,s]=(0,b.useState)(`typescript`),[c,l]=(0,b.useState)(!1),u=n===`grpc`?r:n===`http`?i:a,d=xm({lang:o,toolName:e,logicCode:t,targetType:n,targetEndpoint:u});return(0,F.jsx)(ym,{value:`export`,className:`m-0 space-y-3 pb-5`,children:(0,F.jsxs)(`div`,{className:`space-y-3 pt-1 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 p-0.5 bg-surface1 border border-border rounded-lg`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`typescript`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`typescript`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`TypeScript (SDK)`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`python`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`python`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`Python`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`curl`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`curl`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`cURL / CLI`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(`grpc`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all cursor-pointer ${o===`grpc`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:`gRPC JSON`})]}),(0,F.jsx)(`button`,{type:`button`,onClick:async()=>{await ke(d)&&(l(!0),setTimeout(()=>l(!1),2e3))},className:`text-xs flex items-center gap-1.5 px-3 py-1 rounded-md font-medium border transition-all cursor-pointer ${c?`bg-emerald-500/20 text-emerald-400 border-emerald-500/40`:`bg-surface1 text-zinc-200 border-border hover:bg-white/10 hover:text-white`}`,children:c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ne,{className:`h-3.5 w-3.5 text-emerald-400`}),(0,F.jsx)(`span`,{children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`Copy Code`})]})})]}),(0,F.jsx)(`div`,{className:`rounded-lg bg-editor border border-border p-3.5 font-mono text-xs text-[#7dd3fc] overflow-auto max-h-[250px] leading-relaxed select-all shadow-inner`,children:(0,F.jsx)(`pre`,{children:d})}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-zinc-400 font-mono`,children:[(0,F.jsxs)(`span`,{children:[`Target Tool:`,` `,(0,F.jsx)(`strong`,{className:`text-white`,children:e||`Analyze_Synthetic_Bank_Transactions`})]}),(0,F.jsxs)(`span`,{children:[`Endpoint: `,u||`127.0.0.1:15021`]})]})]})})}var Cm=ld(`relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7`,{variants:{variant:{default:`bg-background text-foreground border-border`,destructive:`border-destructive/50 bg-destructive/10 text-destructive dark:border-destructive [&>svg]:text-destructive`,success:`border-success/50 bg-success/10 text-success dark:border-success [&>svg]:text-success`,warning:`border-warning/50 bg-warning/10 text-warning dark:border-warning [&>svg]:text-warning`}},defaultVariants:{variant:`default`}}),wm=b.forwardRef(({className:e,variant:t,...n},r)=>(0,F.jsx)(`div`,{ref:r,role:`alert`,className:Pf(Cm({variant:t}),e),...n}));wm.displayName=`Alert`;var Tm=b.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`h5`,{ref:n,className:Pf(`mb-1 font-medium leading-none tracking-tight text-white`,e),...t}));Tm.displayName=`AlertTitle`;var Em=b.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:Pf(`text-xs [&_p]:leading-relaxed text-muted-foreground`,e),...t}));Em.displayName=`AlertDescription`;function Dm({result:e,meta:t}){let[n,r]=(0,b.useState)(`visual`),[i,a]=(0,b.useState)(!1),o=async()=>{await ke(JSON.stringify(e,null,2))&&(a(!0),setTimeout(()=>a(!1),1500))},s=(0,b.useMemo)(()=>e.totalBalance!==void 0||e.totalAccounts!==void 0?`banking`:e.totalPatients!==void 0||e.diagnosesDistribution!==void 0?`healthcare`:e.ticksProcessed!==void 0||e.vwap!==void 0?`hft`:e.totalSamples!==void 0||e.avgTemperature!==void 0?`iot`:e.layerAudit!==void 0||e.protocol!==void 0?`perimeter`:`generic`,[e]),c=e=>new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:0}).format(e);return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/60 pb-3`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-xs font-medium`,children:[(0,F.jsx)(xe,{className:`h-3.5 w-3.5`}),(0,F.jsxs)(`span`,{children:[s===`banking`&&`Core Banking Enclave • Verified Aggregation`,s===`healthcare`&&`Healthcare EHR Enclave • HIPAA Protected`,s===`hft`&&`HFT Market Oracle • Ultra Low Latency`,s===`iot`&&`Industrial Edge Telemetry • Hostile WAN Protected`,s===`perimeter`&&`Border LIO Gateway • Zero-Trust Perimeter`,s===`generic`&&`Origin Compute • Zero-Trust Execution`]})]})}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center bg-surface1 p-0.5 rounded-lg border border-white/10 text-[11px]`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(`visual`),className:`px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${n===`visual`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(te,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Visual Analytics`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(`json`),className:`px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${n===`json`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(le,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Raw JSON`})]})]}),(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`text-[11px] flex items-center gap-1.5 transition-colors px-2.5 py-1 rounded-md font-medium border cursor-pointer ${i?`text-emerald-400 bg-emerald-500/15 border-emerald-500/30`:`text-zinc-300 hover:text-white bg-surface1 hover:bg-white/5 border-white/10`}`,title:`Copy JSON Payload`,children:i?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ne,{className:`h-3 w-3 text-emerald-400`}),(0,F.jsx)(`span`,{children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Copy`})]})})]})]}),n===`visual`?(0,F.jsxs)(`div`,{className:`space-y-4`,children:[s===`banking`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-emerald-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Total Accounts In-Situ`}),(0,F.jsx)(se,{className:`h-3.5 w-3.5 text-emerald-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.totalAccounts??0).toLocaleString()}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/80 mt-1 flex items-center gap-1`,children:[(0,F.jsx)(re,{className:`h-2.5 w-2.5`}),(0,F.jsx)(`span`,{children:`100% Retained at origin`})]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-emerald-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Aggregated Balance`}),(0,F.jsx)(we,{className:`h-3.5 w-3.5 text-emerald-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-emerald-400 mt-1 font-mono`,children:c(e.totalBalance??0)}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Computed inside V8 Sandbox`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Mean Account Balance`}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-cyan-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:c(e.averageBalance??0)}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Statistical variance preserved`})]})]}),s===`healthcare`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-cyan-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Audited Patients`}),(0,F.jsx)(se,{className:`h-3.5 w-3.5 text-cyan-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.totalPatients??0).toLocaleString()}),(0,F.jsxs)(`div`,{className:`text-[10px] text-cyan-400/80 mt-1 flex items-center gap-1`,children:[(0,F.jsx)(fe,{className:`h-2.5 w-2.5`}),(0,F.jsx)(`span`,{children:`Zero HIPAA records leaked`})]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-cyan-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Mean Population Age`}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-cyan-400`})]}),(0,F.jsxs)(`div`,{className:`text-xl font-bold text-cyan-300 mt-1 font-mono`,children:[e.averageAge??0,` yrs`]}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Aggregated demographic mean`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Diagnostic Classes`}),(0,F.jsx)(P,{className:`h-3.5 w-3.5 text-purple-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:Object.keys(e.diagnosesDistribution||{}).length}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Differential privacy preserved`})]})]}),s===`hft`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-purple-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Orderbook Ticks`}),(0,F.jsx)(Oe,{className:`h-3.5 w-3.5 text-purple-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.ticksProcessed??0).toLocaleString()}),(0,F.jsx)(`div`,{className:`text-[10px] text-purple-400/80 mt-1`,children:`Sub-millisecond processing`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-purple-500/20 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Volume-Weighted Price (VWAP)`}),(0,F.jsx)(we,{className:`h-3.5 w-3.5 text-emerald-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-emerald-400 mt-1 font-mono`,children:e.vwap?`$${e.vwap.toFixed(4)}`:`Computed`}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Real-time orderbook weighting`})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10 shadow-sm`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] text-zinc-400 font-medium flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Avg Spread (bps)`}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-amber-400`})]}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:e.avgSpreadBps?`${Number(e.avgSpreadBps).toFixed(1)} bps`:`0 bps`}),(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 mt-1`,children:`Microstructure liquidity metric`})]})]}),s===`iot`&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-4 gap-3`,children:[(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-white/10`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Sensor Samples`}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-white mt-1 font-mono`,children:(e.totalSamples??0).toLocaleString()})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-cyan-500/20`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Avg Temperature`}),(0,F.jsxs)(`div`,{className:`text-xl font-bold text-cyan-300 mt-1 font-mono`,children:[e.avgTemperature??0,`°C`]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-amber-500/20`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Max Temp Peak`}),(0,F.jsxs)(`div`,{className:`text-xl font-bold text-amber-400 mt-1 font-mono`,children:[e.maxTemperature??0,`°C`]})]}),(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/80 border border-rose-500/20`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-zinc-400 font-medium`,children:`Critical Alerts`}),(0,F.jsx)(`div`,{className:`text-xl font-bold text-rose-400 mt-1 font-mono`,children:e.criticalCount??0})]})]}),s===`perimeter`&&e.layerAudit&&Array.isArray(e.layerAudit)&&(0,F.jsxs)(`div`,{className:`p-4 rounded-lg bg-surface1/60 border border-emerald-500/20 space-y-2`,children:[(0,F.jsxs)(`div`,{className:`text-xs font-semibold text-emerald-400 flex items-center gap-1.5`,children:[(0,F.jsx)(xe,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{children:`Zero-Trust 6-Layer Security Audit Confirmed`})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 pt-1`,children:e.layerAudit.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-zinc-300 bg-surface1 px-2.5 py-1.5 rounded border border-white/5`,children:[(0,F.jsx)(re,{className:`h-3.5 w-3.5 text-emerald-400 shrink-0`}),(0,F.jsx)(`span`,{children:e})]},e))})]}),(e.distribution||e.diagnosesDistribution||e.statusDistribution)&&(0,F.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-surface1/60 border border-white/10 space-y-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-zinc-200`,children:`Distribution Breakdown (In-Situ Grouping)`}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono text-zinc-400`,children:`Aggregated at Origin`})]}),(0,F.jsx)(`div`,{className:`space-y-2`,children:Object.entries(e.distribution||e.diagnosesDistribution||e.statusDistribution||{}).map(([t,n])=>{let r=Number(n)||0,i=e.totalAccounts||e.totalPatients||e.totalSamples||1,a=Math.min(100,Math.round(r/i*100));return(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-mono`,children:[(0,F.jsx)(`span`,{className:`text-zinc-300`,children:t}),(0,F.jsxs)(`span`,{className:`text-zinc-400`,children:[r.toLocaleString(),` (`,a,`%)`]})]}),(0,F.jsx)(`div`,{className:`h-1.5 w-full bg-white/5 rounded-full overflow-hidden`,children:(0,F.jsx)(`div`,{className:`h-full bg-emerald-500 rounded-full transition-all duration-500`,style:{width:`${a}%`}})})]},t)})})]}),(0,F.jsxs)(`div`,{className:`p-4 rounded-lg bg-gradient-to-br from-emerald-950/20 via-surface1/80 to-surface1/40 border border-emerald-500/30 space-y-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Se,{className:`h-4 w-4 text-emerald-400`}),(0,F.jsx)(`h4`,{className:`text-xs font-bold text-white uppercase tracking-wider`,children:`Protocol Value Differential: LIOP vs Traditional MCP`})]}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono px-2 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/30`,children:`SOVEREIGNTY CERTIFIED`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-3 pt-1 text-xs`,children:[(0,F.jsxs)(`div`,{className:`space-y-1 bg-surface1/60 p-2.5 rounded border border-white/5`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 font-medium`,children:`LLM Context Tokens`}),(0,F.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`text-sm font-bold text-emerald-400 font-mono`,children:[`~`,t?.telemetry?.tokens?.totalTokens??197,` tok`]}),(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-500 line-through font-mono`,children:`~48,000 tok`})]}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/90 flex items-center gap-0.5`,children:[(0,F.jsx)(O,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`99.6% context reduction`})]})]}),(0,F.jsxs)(`div`,{className:`space-y-1 bg-surface1/60 p-2.5 rounded border border-white/5`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 font-medium`,children:`Wire Egress Payload`}),(0,F.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-sm font-bold text-emerald-400 font-mono`,children:t?.telemetry?.bandwidth?.payloadBytes?`${(t.telemetry.bandwidth.payloadBytes/1024).toFixed(2)} KB`:`0.72 KB`}),(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-500 line-through font-mono`,children:`195.2 KB`})]}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/90 flex items-center gap-0.5`,children:[(0,F.jsx)(O,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`99.6% network reduction`})]})]}),(0,F.jsxs)(`div`,{className:`space-y-1 bg-surface1/60 p-2.5 rounded border border-white/5`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-zinc-400 font-medium`,children:`PII Exposure Boundary`}),(0,F.jsx)(`div`,{className:`flex items-baseline gap-1.5`,children:(0,F.jsx)(`span`,{className:`text-sm font-bold text-emerald-400 font-mono`,children:`0 Leaked Records`})}),(0,F.jsxs)(`div`,{className:`text-[10px] text-emerald-400/90 flex items-center gap-0.5`,children:[(0,F.jsx)(re,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Enclave & PQC Kyber-768 sealed`})]})]})]})]})]}):(0,F.jsx)(`div`,{className:`rounded-lg bg-editor border border-border p-3.5 font-mono text-[11px] text-[#86efac] overflow-x-auto leading-relaxed shadow-inner`,children:(0,F.jsx)(`pre`,{children:JSON.stringify(e,null,2)})})]})}function Om({result:e,errorAlert:t,isRunning:n,meta:r}){return(0,F.jsxs)(ym,{value:`output`,className:`m-0 space-y-3 pb-5`,children:[t&&(0,F.jsx)(`div`,{className:`mb-3 pt-1`,children:(0,F.jsxs)(wm,{variant:`destructive`,className:`border-destructive/40 bg-destructive/10`,children:[(0,F.jsx)(Tm,{className:`text-xs font-semibold`,children:t.title}),(0,F.jsx)(Em,{className:`text-xs leading-relaxed mt-1`,children:t.desc})]})}),e?(0,F.jsx)(Dm,{result:e,meta:r}):!t&&!n?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-14 text-zinc-400 text-center space-y-2`,children:[(0,F.jsx)(Ce,{className:`h-6 w-6 text-zinc-500`}),(0,F.jsx)(`p`,{className:`text-xs font-medium text-zinc-200`,children:`Awaiting Execution`}),(0,F.jsxs)(`p`,{className:`text-[11px] text-zinc-400 max-w-[240px]`,children:[`Select a template, inspect the runtime schema with`,` `,(0,F.jsx)(`strong`,{children:`Env Schema`}),`, or click `,(0,F.jsx)(`strong`,{children:`Execute Logic`}),`.`]})]}):n?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-14 text-zinc-400 text-center space-y-2.5`,children:[(0,F.jsx)(de,{className:`h-6 w-6 animate-spin text-primary`}),(0,F.jsx)(`p`,{className:`text-xs text-zinc-300`,children:`Injecting logic and enforcing Zero-Trust policies...`})]}):null]})}function km({meta:e}){let[t,n]=(0,b.useState)(!1),r=async()=>{e?.zkHash&&await ke(e.zkHash)&&(n(!0),setTimeout(()=>n(!1),1500))};if(!e?.telemetry)return(0,F.jsx)(ym,{value:`telemetry`,className:`m-0 space-y-3 pb-5`,children:(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-14 text-zinc-400 text-center space-y-2`,children:[(0,F.jsx)(M,{className:`h-6 w-6 text-zinc-500`}),(0,F.jsx)(`p`,{className:`text-xs font-medium text-zinc-200`,children:`No Live Telemetry Recorded`}),(0,F.jsx)(`p`,{className:`text-[11px] text-zinc-400 max-w-[240px]`,children:`Execute a capability to measure live network RTT, BPE tokens, wire egress, and WASI instruction fuel.`})]})});let{tokens:i,fuel:a,bandwidth:o,phases:s}=e.telemetry;return(0,F.jsx)(ym,{value:`telemetry`,className:`m-0 space-y-3 pb-5`,children:(0,F.jsxs)(`div`,{className:`space-y-3 pt-1 text-xs`,children:[i&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`p-1.5 rounded-md bg-secondary text-primary`,children:(0,F.jsx)(Ce,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px]`,children:`Context Token Telemetry (BPE)`}),(0,F.jsxs)(`p`,{className:`text-[10px] text-zinc-400`,children:[`Tokenizer: `,i.estimatorName||`o200k_base`]})]})]}),i.savingsPercent!==void 0&&i.traditionalContextTokens!==void 0&&i.traditionalContextTokens>0&&(0,F.jsxs)(If,{className:`bg-emerald-500 text-black font-mono font-bold text-xs px-2 py-0.5 shadow-sm`,children:[`-`,i.savingsPercent,`% Tokens`]})]}),i.traditionalContextTokens&&i.traditionalContextTokens>0?(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pt-1 border-t border-border/60`,children:[(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`In-Situ Module`}),(0,F.jsxs)(`p`,{className:`text-sm font-bold font-mono text-emerald-400`,children:[i.totalTokens??0,` `,(0,F.jsx)(`span`,{className:`text-[10px] font-normal text-zinc-400`,children:`tok`})]}),(0,F.jsxs)(`p`,{className:`text-[9px] text-zinc-400 mt-0.5 font-mono`,children:[i.inputTokens??0,` in / `,i.outputTokens??0,` `,`out`]})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Raw Origin Dataset`}),(0,F.jsxs)(`p`,{className:`text-sm font-bold font-mono text-zinc-300`,children:[i.traditionalContextTokens.toLocaleString(),` `,(0,F.jsx)(`span`,{className:`text-[10px] font-normal text-zinc-400`,children:`tok`})]}),(0,F.jsx)(`p`,{className:`text-[9px] text-zinc-400 mt-0.5`,children:`Unfiltered context`})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Context Saved`}),(0,F.jsxs)(`p`,{className:`text-sm font-bold font-mono text-primary`,children:[(i.traditionalContextTokens-(i.totalTokens??0)).toLocaleString(),` `,(0,F.jsx)(`span`,{className:`text-[10px] font-normal text-zinc-400`,children:`tok`})]}),(0,F.jsx)(`p`,{className:`text-[9px] text-zinc-400 mt-0.5`,children:`Kept in origin enclave`})]})]}):(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pt-1 border-t border-border/60`,children:[(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Input Tokens`}),(0,F.jsx)(`p`,{className:`text-sm font-bold font-mono text-cyan-300`,children:i.inputTokens??0})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Output Tokens`}),(0,F.jsx)(`p`,{className:`text-sm font-bold font-mono text-emerald-400`,children:i.outputTokens??0})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border`,children:[(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Total Tokens`}),(0,F.jsx)(`p`,{className:`text-sm font-bold font-mono text-white`,children:i.totalTokens??0})]})]})]}),a&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(M,{className:`h-4 w-4 text-primary`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px]`,children:`WASI Instruction Fuel (AST Deterministic)`}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Execution quota enforced by origin runtime`})]})]}),(0,F.jsxs)(`div`,{className:`text-right font-mono`,children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-white`,children:(a.consumed??0).toLocaleString()}),(0,F.jsxs)(`span`,{className:`text-[10px] text-zinc-400`,children:[` `,`/ `,(a.maxLimit??1e6).toLocaleString(),` u`]})]})]}),(0,F.jsx)(`div`,{className:`w-full bg-secondary/80 rounded-full h-2 overflow-hidden border border-border`,children:(0,F.jsx)(`div`,{className:`bg-primary h-2 rounded-full transition-all duration-300`,style:{width:`${Math.min(100,Math.max(2,a.percentUsed??0))}%`}})}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-zinc-400 font-mono`,children:[(0,F.jsxs)(`span`,{children:[`Fuel Used:`,` `,(0,F.jsxs)(`strong`,{className:`text-primary font-semibold`,children:[a.percentUsed??0,`%`]})]}),(0,F.jsx)(`span`,{children:`Quantization: 100-Fuel-Bucket`})]})]}),o&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(N,{className:`h-4 w-4 text-primary`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px]`,children:`Wire Payload & Egress Traffic`}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`Physical socket egress measured at runtime`})]})]}),o.egressReductionPercent!==void 0&&o.rawDatasetProtectedBytes!==void 0&&o.rawDatasetProtectedBytes>0&&(0,F.jsxs)(If,{variant:`outline`,className:`border-emerald-500/40 text-emerald-400 font-mono text-[10px]`,children:[`-`,o.egressReductionPercent,`% Wire Reduction`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border font-mono`,children:[(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-400 block font-sans`,children:`Wire Payload (Envelope + Output):`}),(0,F.jsx)(`strong`,{className:`text-white text-xs`,children:o.payloadBytes===void 0?`Measured in socket`:`${(o.payloadBytes/1024).toFixed(2)} KB`})]}),(0,F.jsxs)(`div`,{className:`p-2 rounded bg-secondary/40 border border-border font-mono`,children:[(0,F.jsx)(`span`,{className:`text-[10px] text-zinc-400 block font-sans`,children:`Origin Dataset Retained:`}),(0,F.jsx)(`strong`,{className:`text-emerald-400 text-xs`,children:o.rawDatasetProtectedBytes&&o.rawDatasetProtectedBytes>0?`${(o.rawDatasetProtectedBytes/1024).toFixed(1)} KB`:`Zero egress leakage`})]})]})]}),s&&(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-white text-[11px] block`,children:`Phase Latency Breakdown`}),(0,F.jsxs)(`span`,{className:`text-[10px] font-mono text-zinc-400`,children:[`Total: `,s.totalLatencyMs??e.latencyMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-5 gap-1.5 text-center font-mono text-[10px]`,children:[(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Route`}),(0,F.jsxs)(`span`,{className:`text-zinc-200 font-semibold`,children:[s.discoveryMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Kyber`}),(0,F.jsxs)(`span`,{className:`text-primary font-semibold`,children:[s.pqcMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Seal`}),(0,F.jsxs)(`span`,{className:`text-zinc-200 font-semibold`,children:[s.sealingMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`Sandbox`}),(0,F.jsxs)(`span`,{className:`text-emerald-400 font-semibold`,children:[s.wasiSandboxMs??0,` ms`]})]}),(0,F.jsxs)(`div`,{className:`p-1.5 rounded bg-secondary/50 border border-border`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400 block text-[9px] font-sans`,children:`ZK-Proof`}),(0,F.jsxs)(`span`,{className:`text-primary font-semibold`,children:[s.zkVerificationMs??0,` ms`]})]})]})]}),(0,F.jsxs)(`div`,{className:`p-3 rounded-lg bg-surface1 border border-border space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(j,{className:`h-4 w-4 text-emerald-400`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`font-semibold text-white text-[11px]`,children:`ZK-Receipt Proof & PQC Suite`}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400`,children:`ML-KEM-768 • AES-256-GCM • HMAC SHA-256`})]})]}),(0,F.jsx)(If,{variant:`success`,className:`font-mono text-[10px]`,children:`VERIFIED`})]}),e.zkHash&&(0,F.jsxs)(`div`,{className:`flex items-center justify-between bg-editor p-2 rounded border border-border font-mono text-[10px] text-zinc-300`,children:[(0,F.jsx)(`span`,{className:`truncate mr-2 select-all font-mono text-emerald-300`,children:e.zkHash}),(0,F.jsx)(`button`,{type:`button`,onClick:r,className:`text-[10px] flex items-center gap-1 text-zinc-400 hover:text-white shrink-0 px-1.5 py-0.5 rounded bg-surface1 border border-border transition-colors cursor-pointer`,title:`Copy ZK-Receipt Hash`,children:t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ne,{className:`h-3 w-3 text-emerald-400`}),(0,F.jsx)(`span`,{className:`text-emerald-400`,children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:`Copy`})]})})]})]})]})})}function Am(e,[t,n]){return Math.min(n,Math.max(t,e))}function jm(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}var Mm=`ScrollArea`,[Nm,Pm]=qf(Mm),[Fm,Im]=Nm(Mm),Lm=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=b.useState(null),[l,u]=b.useState(null),[d,f]=b.useState(null),[p,m]=b.useState(null),[h,g]=b.useState(null),[_,v]=b.useState(0),[y,x]=b.useState(0),[S,C]=b.useState(!1),[w,T]=b.useState(!1),E=Zf(t,e=>c(e)),D=Sp(i);return(0,F.jsx)(Fm,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,F.jsx)(hp.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});Lm.displayName=Mm;var Rm=`ScrollAreaViewport`,zm=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Im(Rm,n),s=Zf(t,b.useRef(null),o.onViewportChange);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,F.jsx)(hp.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,F.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});zm.displayName=Rm;var Bm=`ScrollAreaScrollbar`,Vm=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Im(Bm,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return b.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,F.jsx)(Hm,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,F.jsx)(Um,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,F.jsx)(Wm,{...r,ref:t,forceMount:n}):i.type===`always`?(0,F.jsx)(Gm,{...r,ref:t,"data-state":`visible`}):null});Vm.displayName=Bm;var Hm=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Im(Bm,e.__scopeScrollArea),[a,o]=b.useState(!1);return b.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,F.jsx)(Gp,{present:n||a,children:(0,F.jsx)(Wm,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Um=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Im(Bm,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=dh(()=>c(`SCROLL_END`),100),[s,c]=jm(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return b.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),b.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,F.jsx)(Gp,{present:n||s!==`hidden`,children:(0,F.jsx)(Gm,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Kf(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Kf(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),Wm=b.forwardRef((e,t)=>{let n=Im(Bm,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=b.useState(!1),s=e.orientation===`horizontal`,c=dh(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return fh(n.viewport,c),fh(n.content,c),(0,F.jsx)(Gp,{present:r||a,children:(0,F.jsx)(Gm,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),Gm=b.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=Im(Bm,e.__scopeScrollArea),a=b.useRef(null),o=b.useRef(0),[s,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ih(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return oh(e,o.current,s,t)}return n===`horizontal`?(0,F.jsx)(Km,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=sh(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,F.jsx)(qm,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=sh(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Km=b.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Im(Bm,e.__scopeScrollArea),[o,s]=b.useState(),c=b.useRef(null),l=Zf(t,c,a.onScrollbarXChange);return b.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(Xm,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":ah(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),lh(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:rh(o.paddingLeft),paddingEnd:rh(o.paddingRight)}})}})}),qm=b.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Im(Bm,e.__scopeScrollArea),[o,s]=b.useState(),c=b.useRef(null),l=Zf(t,c,a.onScrollbarYChange);return b.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(Xm,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":ah(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),lh(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:rh(o.paddingTop),paddingEnd:rh(o.paddingBottom)}})}})}),[Jm,Ym]=Nm(Bm),Xm=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=Im(Bm,n),[m,h]=b.useState(null),g=Zf(t,e=>h(e)),_=b.useRef(null),v=b.useRef(``),y=p.viewport,x=r.content-r.viewport,S=gp(u),C=gp(c),w=dh(d,10);function T(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return b.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,x,S]),b.useEffect(C,[r,C]),fh(m,w),fh(p.content,w),(0,F.jsx)(Jm,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:gp(a),onThumbPointerUp:gp(o),onThumbPositionChange:C,onThumbPointerDown:gp(s),children:(0,F.jsx)(hp.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Kf(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Kf(e.onPointerMove,T),onPointerUp:Kf(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),Zm=`ScrollAreaThumb`,Qm=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Ym(Zm,e.__scopeScrollArea);return(0,F.jsx)(Gp,{present:n||i.hasThumb,children:(0,F.jsx)($m,{ref:t,...r})})}),$m=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=Im(Zm,n),o=Ym(Zm,n),{onThumbPositionChange:s}=o,c=Zf(t,e=>o.onThumbChange(e)),l=b.useRef(void 0),u=dh(()=>{l.current&&=(l.current(),void 0)},100);return b.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=uh(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,F.jsx)(hp.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Kf(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Kf(e.onPointerUp,o.onThumbPointerUp)})});Qm.displayName=Zm;var eh=`ScrollAreaCorner`,th=b.forwardRef((e,t)=>{let n=Im(eh,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,F.jsx)(nh,{...e,ref:t}):null});th.displayName=eh;var nh=b.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=Im(eh,n),[a,o]=b.useState(0),[s,c]=b.useState(0),l=!!(a&&s);return fh(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),fh(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,F.jsx)(hp.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function rh(e){return e?parseInt(e,10):0}function ih(e,t){let n=e/t;return isNaN(n)?0:n}function ah(e){let t=ih(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function oh(e,t,n,r=`ltr`){let i=ah(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return ch([c,l],d)(e)}function sh(e,t,n=`ltr`){let r=ah(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Am(e,n===`ltr`?[0,o]:[o*-1,0]);return ch([0,o],[0,s])(c)}function ch(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function lh(e,t){return e>0&&e<t}var uh=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function dh(e,t){let n=gp(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function fh(e,t){let n=gp(t);dp(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ph=Lm,mh=zm,hh=Vm,gh=th,_h=b.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(ph,{ref:r,className:Pf(`relative overflow-hidden`,e),...n,children:[(0,F.jsx)(mh,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,F.jsx)(vh,{}),(0,F.jsx)(gh,{})]}));_h.displayName=ph.displayName;var vh=b.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,F.jsx)(hh,{ref:r,orientation:t,className:Pf(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,F.jsx)(Qm,{className:`relative flex-1 rounded-full bg-border/40 hover:bg-border/70 transition-colors`})}));vh.displayName=hh.displayName;function yh({timeline:e,result:t,meta:n,errorAlert:r,isRunning:i,code:a,selectedToolName:o,targetType:s,grpcTarget:c,httpUrl:l,stdioCmd:u,activeTab:d,onTabChange:f}){let[p,m]=(0,b.useState)(`output`),h=d??p,g=e=>{f?f(e):m(e)};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 min-h-0 flex-1`,children:[(0,F.jsxs)(zf,{className:`p-3 bg-card border-border shadow-card shrink-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsxs)(`span`,{className:`text-xs font-semibold text-white flex items-center gap-1.5`,children:[(0,F.jsx)(D,{className:`h-3.5 w-3.5 text-primary`}),`Execution Timeline & Cryptographic Pipeline`]}),i?(0,F.jsxs)(If,{variant:`warning`,className:`text-[10px] font-mono flex items-center gap-1`,children:[(0,F.jsx)(de,{className:`h-2.5 w-2.5 animate-spin`}),` In-Situ Processing`]}):(0,F.jsxs)(`span`,{className:`text-[10px] text-zinc-400 font-mono`,children:[e.filter(e=>e.status===`success`).length,` /`,` `,e.length,` Steps`]})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-5 gap-2`,children:e.map(e=>{let t=e.status===`success`,n=e.status===`running`,r=e.status===`failed`;return(0,F.jsxs)(`div`,{className:`p-2 rounded-lg border transition-all text-xs ${t?`bg-emerald-950/20 border-emerald-500/30 text-emerald-400`:n?`bg-amber-950/20 border-amber-500/40 text-amber-400 animate-pulse`:r?`bg-rose-950/20 border-rose-500/40 text-rose-400`:`bg-surface1/40 border-border/50 text-zinc-500`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-[11px] truncate`,children:e.label}),t&&(0,F.jsx)(re,{className:`h-3 w-3 text-emerald-400 shrink-0`}),n&&(0,F.jsx)(de,{className:`h-3 w-3 text-amber-400 animate-spin shrink-0`}),r&&(0,F.jsx)(ie,{className:`h-3 w-3 text-rose-400 shrink-0`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono`,children:[(0,F.jsx)(`span`,{className:`truncate text-zinc-400`,title:e.detail,children:e.detail}),e.durationMs!==void 0&&(0,F.jsxs)(`span`,{className:`shrink-0 ml-1 text-zinc-300`,children:[e.durationMs,`ms`]})]})]},e.phase)})})]}),(0,F.jsx)(zf,{className:`flex-1 min-h-0 bg-card border-border shadow-card flex flex-col overflow-hidden`,children:(0,F.jsxs)(gm,{value:h,onValueChange:e=>g(e),className:`flex-1 flex flex-col min-h-0`,children:[(0,F.jsxs)(Bf,{className:`py-2.5 px-5 border-b border-border bg-surface1/60 shrink-0 flex flex-row items-center justify-between`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-1 p-0.5 bg-surface1 border border-border rounded-lg relative`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`output`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`output`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(Ce,{className:`h-3.5 w-3.5 relative z-20 ${h===`output`?`text-black`:`text-zinc-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`output`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Output`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`debug`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`debug`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(ee,{className:`h-3.5 w-3.5 relative z-20 ${h===`debug`?`text-black`:`text-amber-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`debug`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Debug`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`export`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`export`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(ce,{className:`h-3.5 w-3.5 relative z-20 ${h===`export`?`text-black`:`text-cyan-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`export`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Export Code`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>g(`telemetry`),className:`relative z-10 text-xs px-2.5 py-1 font-medium transition-colors duration-200 flex items-center gap-1.5 cursor-pointer`,children:[h===`telemetry`&&(0,F.jsx)(rd.div,{layoutId:`resultsTabPill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(D,{className:`h-3.5 w-3.5 relative z-20 ${h===`telemetry`?`text-black`:`text-emerald-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${h===`telemetry`?`text-black font-semibold`:`text-zinc-300 hover:text-white`}`,children:`Live Telemetry`})]})]})}),n?.latencyMs!==void 0&&(0,F.jsxs)(If,{variant:`outline`,className:`text-[10px] font-mono flex items-center gap-1 border-white/15 bg-secondary/60 text-zinc-300`,children:[(0,F.jsx)(D,{className:`h-3 w-3 text-primary`}),n.latencyMs,`ms total`]})]}),(0,F.jsx)(Uf,{className:`flex-1 min-h-0 overflow-hidden p-0`,children:(0,F.jsxs)(_h,{className:`h-full px-5`,children:[(0,F.jsx)(Om,{result:t,errorAlert:r,isRunning:i,meta:n}),(0,F.jsx)(bm,{timeline:e,targetType:s,meta:n}),(0,F.jsx)(Sm,{toolName:o,code:a,targetType:s,grpcTarget:c,httpUrl:l,stdioCmd:u}),(0,F.jsx)(km,{meta:n})]})})]})})]})}function bh({node:e,isConnected:t,onSwitchTarget:n,onSelectTool:r}){let i=e.status===`offline`,a=e.tier,o=e.transportType===`stdio`,s=e.transportType===`grpc`||!!e.ports?.grpc,c=e.transportType===`http`||!!e.ports?.http,l=a===1?{bgActive:`bg-tier1 border-emerald-500/60 ring-1 ring-emerald-500/30`,bgInactive:`bg-tier1 border-emerald-500/30 hover:brightness-110`,textAccent:`text-emerald-400`,badgeBorder:`border-emerald-500/30`,badgeBg:`bg-emerald-500/15`,badgeText:`text-emerald-300`,icon:xe}:a===2?{bgActive:`bg-tier2 border-cyan-500/60 ring-1 ring-cyan-500/30`,bgInactive:`bg-tier2 border-cyan-500/30 hover:brightness-110`,textAccent:`text-cyan-400`,badgeBorder:`border-cyan-500/30`,badgeBg:`bg-cyan-500/15`,badgeText:`text-cyan-200`,icon:N}:a===3?{bgActive:`bg-tier3 border-cyan-500/60 ring-1 ring-cyan-500/30`,bgInactive:`bg-tier3 border-purple-500/30 hover:brightness-110`,textAccent:`text-purple-400`,badgeBorder:`border-purple-500/30`,badgeBg:`bg-purple-500/15`,badgeText:`text-purple-200`,icon:A}:{bgActive:`bg-surface1 border-cyan-500/60 ring-1 ring-cyan-500/30`,bgInactive:`bg-surface1/60 border-border hover:border-border/80 hover:brightness-110`,textAccent:o?`text-amber-400`:s?`text-cyan-400`:`text-sky-400`,badgeBorder:`border-white/15`,badgeBg:`bg-white/10`,badgeText:`text-zinc-200`,icon:o?Ce:s?A:c?N:ve},u=l.icon,d=()=>{let t=e.ports?.grpc??e.ports?.http,r=e.ports?.grpc?`grpc`:`http`;n(r===`grpc`?`${e.host}:${t}`:`http://${e.host}:${t}/mcp`,r)},f=i=>{if(r(i),!t){let t=e.ports?.grpc??e.ports?.http,r=e.ports?.grpc?`grpc`:`http`;n(r===`grpc`?`${e.host}:${t}`:`http://${e.host}:${t}/mcp`,r,i)}},p=o?`stdio (local pipeline)`:e.ports?.grpc?`${e.host}:${e.ports.grpc}`:e.ports?.http?`${e.host}:${e.ports.http}`:e.host;return(0,F.jsxs)(`div`,{className:`p-2.5 rounded-md border transition-all ${i?`border-border/40 bg-surface1/20 opacity-60`:t?`${l.bgActive} shadow-sm`:l.bgInactive}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(u,{className:`h-3 w-3 ${i?`text-zinc-500`:l.textAccent}`}),(0,F.jsx)(`span`,{className:`text-xs font-semibold ${i?`text-zinc-400`:`text-zinc-100`}`,children:e.name}),t&&(0,F.jsxs)(`span`,{className:`text-[8px] font-mono px-1.5 py-0.2 rounded bg-cyan-500/25 border border-cyan-500/40 text-cyan-200 font-bold flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-cyan-400 animate-ping`}),`ACTIVE TARGET`]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[!t&&!i&&(0,F.jsxs)(`button`,{type:`button`,onClick:d,className:`text-[9px] font-mono px-1.5 py-0.2 rounded bg-surface1 hover:bg-primary hover:text-black border border-white/10 text-zinc-300 transition-colors flex items-center gap-1 cursor-pointer`,title:`Connect to ${e.name}`,children:[(0,F.jsx)(Oe,{className:`h-2.5 w-2.5 text-cyan-400`}),(0,F.jsx)(`span`,{children:`Connect`})]}),(0,F.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${i?`bg-rose-500`:l.textAccent.replace(`text-`,`bg-`)}`}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono ${i?`text-zinc-500 font-medium`:l.textAccent}`,children:i?`OFFLINE`:`${e.rttMs}ms`})]})]}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400 mb-1`,children:e.role}),(0,F.jsxs)(`div`,{className:`text-[10px] font-mono text-zinc-400 flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:p}),(0,F.jsx)(`span`,{className:`text-[9px] ${i?`text-zinc-500`:l.textAccent}`,children:e.isolation?.split(`+`)[0]||e.tierLabel?.split(`:`)[0]||(a===1?`Sovereign Node`:a===2?`Consortium Node`:a===3?`Client Edge`:`Direct Target`)})]}),!i&&e.tools.length>0&&(0,F.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.tools.map(n=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>f(n),className:`text-[9px] px-1.5 py-0.5 rounded ${l.badgeBg} hover:opacity-80 border ${l.badgeBorder} ${l.badgeText} transition-colors cursor-pointer`,title:t?`Load ${n} in Logic Studio`:`Connect to ${e.name} and load ${n}`,children:[`+ `,n]},n))})]})}function xh({tools:e,nodes:t,scanSummary:n,onlineNodes:r,totalNodes:i,hasNodeStats:a,isScanning:o,loadingTools:s,targetType:c,activeConnectedTarget:l,selectedToolName:u,onSelectTool:d,onSwitchTarget:f}){let[p,m]=(0,b.useState)(`nodes`),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(`all`),[y,x]=(0,b.useState)(null),S=async(e,t)=>{await ke(e)&&(x(t),setTimeout(()=>x(null),1500))},C=(0,b.useMemo)(()=>{let e=new Set;for(let n of t)(n.tier===1||n.tier===2||n.tier===3)&&e.add(n.tier);return Array.from(e).sort()},[t]),w=(0,b.useMemo)(()=>t.some(e=>e.tier===void 0||e.tier===null),[t]),T=C.length>0,E=(0,b.useMemo)(()=>{if(!h.trim())return e;let t=h.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)||e.domain?.toLowerCase().includes(t)||e.taxonomy?.domain?.toLowerCase().includes(t))},[e,h]),D=(0,b.useMemo)(()=>_===`all`?t:_===`standalone`?t.filter(e=>e.tier===void 0||e.tier===null):t.filter(e=>e.tier===_),[t,_]),O=(0,b.useMemo)(()=>D.filter(e=>e.tier===void 0||e.tier===null),[D]),ee=(0,b.useMemo)(()=>D.filter(e=>e.tier===1),[D]),te=(0,b.useMemo)(()=>D.filter(e=>e.tier===2),[D]),re=(0,b.useMemo)(()=>D.filter(e=>e.tier===3),[D]),ie=e=>{if(!l)return!1;if(c===`grpc`){let t=l.split(`:`)[1]||``;return!!(e.ports?.grpc&&String(e.ports.grpc)===t||e.host&&l.includes(e.host)&&t===String(e.ports?.grpc)||l?.toLowerCase().includes(e.id.toLowerCase()))}if(c===`http`){let t=l.match(/:(\d+)/)?.[1]||``;return!!(e.ports?.http&&String(e.ports.http)===t||l?.toLowerCase().includes(e.id.toLowerCase()))}return e.status===`online`&&l.toLowerCase().includes(e.id.toLowerCase())};return(0,F.jsxs)(`section`,{className:`lg:col-span-4 flex flex-col space-y-6`,children:[(0,F.jsxs)(zf,{className:`flex flex-col h-[560px] overflow-hidden bg-card border-border shadow-card`,children:[(0,F.jsxs)(Bf,{className:`pb-2.5 shrink-0 border-b border-border/40`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 p-0.5 bg-surface1 border border-white/10 rounded-lg`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>m(`nodes`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${p===`nodes`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(ve,{className:`h-3.5 w-3.5`}),`Server Scan`,` `,a?`(${r}/${i})`:``]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>m(`capabilities`),className:`text-xs px-2.5 py-1 rounded-md font-medium transition-all flex items-center gap-1.5 ${p===`capabilities`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(Ee,{className:`h-3.5 w-3.5`}),`Capabilities (`,e.length,`)`]})]}),(0,F.jsx)(If,{variant:`outline`,className:`text-[10px] font-mono border-white/15 text-zinc-300`,children:p===`capabilities`?`${e.length} tools`:T?`${C.length} Active Layer${C.length>1?`s`:``}`:`${i} Targets`})]}),p===`capabilities`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Hf,{className:`text-xs text-zinc-400`,children:`Discovered runtime capabilities ready for secure in-situ execution.`}),(0,F.jsxs)(`div`,{className:`relative mt-2`,children:[(0,F.jsx)(_e,{className:`h-3.5 w-3.5 absolute left-2.5 top-2.5 text-zinc-400`}),(0,F.jsx)(`input`,{type:`text`,value:h,onChange:e=>g(e.target.value),placeholder:`Filter by capability or domain...`,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,className:`w-full h-8 pl-8 pr-7 bg-surface1 border border-white/15 rounded text-xs text-white placeholder:text-zinc-500 focus:outline-none focus:border-cyan-500/60 focus:ring-1 focus:ring-cyan-500/30 transition-all`}),h&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>g(``),className:`absolute right-2 top-2 text-zinc-400 hover:text-white p-0.5 rounded transition-colors`,title:`Clear filter`,children:(0,F.jsx)(De,{className:`h-3.5 w-3.5`})})]})]}):(0,F.jsxs)(`div`,{className:`flex items-center justify-between mt-1`,children:[(0,F.jsx)(`span`,{className:`text-[11px] text-zinc-400`,children:T?`Live scan across network layers:`:`Discovered network targets:`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>v(`all`),className:`text-[10px] px-1.5 py-0.5 rounded font-mono transition-colors ${_===`all`?`bg-primary/20 text-cyan-400 border border-cyan-500/40`:`text-zinc-400 hover:text-zinc-200 border border-transparent`}`,children:`All`}),w&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>v(`standalone`),className:`text-[10px] px-1.5 py-0.5 rounded font-mono transition-colors ${_===`standalone`?`bg-primary/20 text-cyan-400 border border-cyan-500/40`:`text-zinc-400 hover:text-zinc-200 border border-transparent`}`,children:`Direct`}),C.map(e=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>v(e),className:`text-[10px] px-1.5 py-0.5 rounded font-mono transition-colors ${_===e?`bg-primary/20 text-cyan-400 border border-cyan-500/40`:`text-zinc-400 hover:text-zinc-200 border border-transparent`}`,children:[`T`,e]},e))]})]})]}),(0,F.jsx)(Uf,{className:`flex-1 min-h-0 overflow-hidden p-0`,children:(0,F.jsx)(_h,{className:`h-full px-4 py-2`,children:p===`capabilities`?s?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-zinc-400 space-y-2`,children:[(0,F.jsx)(de,{className:`h-5 w-5 animate-spin text-primary`}),(0,F.jsx)(`span`,{className:`text-xs text-zinc-300`,children:`Discovering capabilities across tiers...`})]}):E.length===0?(0,F.jsxs)(`div`,{className:`text-center py-12 text-zinc-400 space-y-2`,children:[(0,F.jsx)(Te,{className:`h-6 w-6 mx-auto text-warning`}),(0,F.jsx)(`p`,{className:`text-xs font-medium text-zinc-200`,children:`No capabilities found`}),(0,F.jsx)(`p`,{className:`text-[11px] text-zinc-400 max-w-[200px] mx-auto`,children:`Try adjusting your search query.`})]}):(0,F.jsx)(`div`,{className:`space-y-2.5 pb-4`,children:E.map(e=>{let t=u===e.name,n=e.tier||(e.taxonomy?.clearanceTier===1?1:e.taxonomy?.clearanceTier===3?3:2);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>d(e.name),className:`w-full text-left p-3 rounded-md border transition-all cursor-pointer ${t?`bg-primary/10 border-primary/60 text-white shadow-sm ring-1 ring-primary/30`:`bg-secondary/40 border-border/70 hover:bg-secondary/80 hover:border-border`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-xs text-zinc-100 truncate max-w-[190px]`,children:e.name}),(0,F.jsxs)(If,{variant:n===1?`success`:n===2?`warning`:`default`,className:`text-[10px] py-0 px-1.5 font-normal`,children:[`Tier `,n]})]}),(0,F.jsx)(`p`,{className:`text-[11px] text-zinc-300 line-clamp-2 leading-relaxed`,children:e.description||`No description available.`}),(0,F.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between text-[10px] text-zinc-400`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1 truncate max-w-[180px]`,children:[(0,F.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${n===1?`bg-emerald-400`:n===2?`bg-cyan-400`:`bg-purple-400`}`}),e.providerNode||e.taxonomy?.domain||`Mesh Node`]}),(0,F.jsx)(`span`,{className:`font-mono text-[9px] opacity-75 shrink-0`,children:`WASI In-situ`})]})]},e.name)})}):(0,F.jsx)(`div`,{className:`space-y-4 pb-4`,children:t.length===0?(0,F.jsxs)(`div`,{className:`text-center py-10 px-4 bg-surface1/20 rounded-lg border border-white/5 space-y-2`,children:[(0,F.jsx)(ve,{className:`h-7 w-7 text-cyan-400 mx-auto opacity-70 animate-pulse`}),(0,F.jsx)(`p`,{className:`text-xs font-semibold text-zinc-200`,children:`Scanning Network Nodes...`}),(0,F.jsxs)(`p`,{className:`text-[11px] text-zinc-400 font-mono`,children:[`Querying `,l]})]}):(0,F.jsxs)(F.Fragment,{children:[(_===`all`||_===`standalone`)&&O.length>0&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-sky-400 border-b border-sky-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(ve,{className:`h-3.5 w-3.5 text-sky-400`}),`Direct Connection & Standalone Targets`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-sky-500/10 border border-sky-500/30 text-sky-300`,children:`Direct Compute`})]}),O.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]}),T&&(_===`all`||_===1)&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-emerald-400 border-b border-emerald-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(xe,{className:`h-3.5 w-3.5 text-emerald-400`}),`Tier 1: Sovereign Core Enclaves`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-emerald-500/10 border border-emerald-500/30 text-emerald-300`,children:`Zero-Trust • PSK`})]}),ee.length===0?(0,F.jsxs)(`div`,{className:`text-[10px] text-zinc-500 italic py-2 px-2.5 bg-surface1/30 rounded border border-white/5 flex items-center gap-1.5`,children:[(0,F.jsx)(Te,{className:`h-3 w-3 text-zinc-500`}),`No Tier 1 nodes detected on scanned target`]}):ee.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]}),T&&(_===`all`||_===2)&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-cyan-400 border-b border-cyan-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(N,{className:`h-3.5 w-3.5 text-cyan-400`}),`Tier 2: Consortium Relays & Gateways`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-cyan-500/10 border border-cyan-500/30 text-cyan-300`,children:`BLG • mTLS`})]}),te.length===0?(0,F.jsxs)(`div`,{className:`text-[10px] text-zinc-500 italic py-2 px-2.5 bg-surface1/30 rounded border border-white/5 flex items-center gap-1.5`,children:[(0,F.jsx)(Te,{className:`h-3 w-3 text-zinc-500`}),`No Tier 2 nodes detected on scanned target`]}):te.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]}),T&&(_===`all`||_===3)&&(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-semibold text-purple-400 border-b border-purple-500/20 pb-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(A,{className:`h-3.5 w-3.5 text-purple-400`}),`Tier 3: Public Backbone & Client Edge`]}),(0,F.jsx)(`span`,{className:`text-[9px] font-mono px-1 py-0.2 rounded bg-purple-500/10 border border-purple-500/30 text-purple-300`,children:`AutoNAT / WAN`})]}),re.length===0?(0,F.jsxs)(`div`,{className:`text-[10px] text-zinc-500 italic py-2 px-2.5 bg-surface1/30 rounded border border-white/5 flex items-center gap-1.5`,children:[(0,F.jsx)(Te,{className:`h-3 w-3 text-zinc-500`}),`No Tier 3 edge nodes active on scanned target`]}):re.map(e=>(0,F.jsx)(bh,{node:e,isConnected:ie(e)&&e.status===`online`,onSwitchTarget:f,onSelectTool:d},e.id))]})]})})})})]}),(0,F.jsxs)(zf,{className:`p-4 bg-card border-border shadow-card shrink-0`,children:[(0,F.jsxs)(`h3`,{className:`text-xs font-semibold text-white mb-3 flex items-center justify-between`,children:[(0,F.jsx)(`span`,{children:`Mesh Discovery Telemetry`}),(0,F.jsxs)(`span`,{className:`font-mono text-[10px] text-zinc-400 font-normal flex items-center gap-1`,children:[o&&(0,F.jsx)(de,{className:`h-2.5 w-2.5 animate-spin text-primary`}),c.toUpperCase(),` / WASI`]})]}),(0,F.jsxs)(`div`,{className:`space-y-2.5 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Mesh Topology:`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`h-2 w-2 rounded-full ${r>0?`bg-emerald-400`:`bg-rose-500`}`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] font-medium ${r>0?`text-white`:`text-zinc-500`}`,children:r>0?`${r}/${i} Nodes Online`:`0 Nodes Online (Offline)`})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Architecture Mode:`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] ${r>0?`text-cyan-400`:`text-zinc-500`}`,children:r>0?T?`${C.length} Active Layer${C.length>1?`s`:``}`:`Direct Standalone Node`:`Offline`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Discovered Tools:`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] ${e.length>0?`text-emerald-400`:`text-zinc-500`}`,children:e.length>0?`${e.length} Capabilities`:`0 Available`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Avg Round-Trip Time:`}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] ${r>0?`text-white font-semibold`:`text-zinc-500`}`,children:r>0?n?.avgLatencyMs!==void 0&&n.avgLatencyMs>0?`${n.avgLatencyMs} ms`:t.some(e=>e.rttMs>0&&e.status===`online`)?`${Math.round(t.filter(e=>e.status===`online`&&e.rttMs>0).reduce((e,t)=>e+t.rttMs,0)/Math.max(1,t.filter(e=>e.status===`online`&&e.rttMs>0).length))} ms`:`—`:`—`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between pt-0.5`,children:[(0,F.jsx)(`span`,{className:`text-zinc-400`,children:`Active Target:`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`font-mono text-[11px] text-zinc-300 truncate max-w-[130px]`,title:l,children:l}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>S(l,`target`),className:`text-zinc-400 hover:text-white transition-colors p-0.5 rounded cursor-pointer`,title:`Copy Target Address`,children:y===`target`?(0,F.jsx)(ne,{className:`h-3 w-3 text-emerald-400`}):(0,F.jsx)(k,{className:`h-3 w-3`})})]})]})]})]})]})}function Sh({className:e=`h-8 w-8 text-primary`}){return(0,F.jsxs)(`svg`,{className:e,viewBox:`0 0 120 120`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`title`,{children:`LIOP Protocol Logo`}),(0,F.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,children:[(0,F.jsx)(`polygon`,{points:`100,76.57 76.57,100 43.43,100 20,76.57 20,43.43 43.43,20 76.57,20 100,43.43`}),(0,F.jsx)(`circle`,{cx:`60`,cy:`60`,r:`10`,fill:`currentColor`,stroke:`none`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(45 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(90 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(135 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(180 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(225 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(270 60 60)`}),(0,F.jsx)(`path`,{d:`M 60 60 C 60 45, 100 75, 100 60`,transform:`rotate(315 60 60)`})]})]})}function Ch({onlineNodes:e,totalNodes:t,hasNodeStats:n,isScanning:r,secondsAgo:i,theme:a,onThemeChange:o,onRescan:s}){return(0,F.jsx)(`header`,{className:`border-b border-border bg-card/90 backdrop-blur-sm sticky top-0 z-50 transition-colors`,children:(0,F.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 h-14 flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center space-x-3`,children:[(0,F.jsx)(Sh,{className:`h-8 w-8 text-primary shrink-0 transition-transform duration-200 hover:scale-105`}),(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-base font-bold tracking-tight text-white flex items-center gap-2`,children:[(0,F.jsx)(`span`,{children:`LIOP Studio`}),(0,F.jsx)(`span`,{className:`text-[10px] font-mono font-medium px-1.5 py-0.2 text-cyan-300 border border-cyan-500/30 rounded bg-cyan-500/10`,children:`v1.0.0-alpha.0`})]}),(0,F.jsx)(`p`,{className:`text-[10px] text-zinc-400 -mt-0.5 hidden sm:block`,children:`Sovereign Logic & MCP Multi-Transport Inspector`})]})})]}),(0,F.jsxs)(`div`,{className:`flex items-center space-x-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center space-x-2 bg-secondary/80 border border-white/10 px-3 py-1 rounded-md text-xs`,children:[(0,F.jsx)(`span`,{className:`relative flex h-2 w-2`,children:e>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75`}),(0,F.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-emerald-500`})]}):(0,F.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-rose-500`})}),(0,F.jsx)(`span`,{className:`font-medium ${e>0?`text-white`:`text-rose-400`}`,children:n?e>0?`${e}/${t} Nodes Online`:`0 Nodes Online (Offline)`:r?`Scanning Mesh Nodes...`:`Topology Offline`}),(0,F.jsx)(`span`,{className:`text-cyan-400 font-mono text-[10px] hidden sm:inline`,children:`(3 Tiers)`}),(0,F.jsx)(`span`,{className:`text-zinc-400 font-mono text-[10px] border-l border-white/15 pl-1.5 hidden md:inline`,children:i===0?`live`:`${i}s ago`})]}),(0,F.jsxs)(Rf,{size:`sm`,variant:`outline`,onClick:s,disabled:r,className:`h-8 px-2.5 border-white/15 bg-surface1 text-zinc-300 hover:text-white hover:bg-white/5 flex items-center gap-1.5 text-xs`,title:`Re-scan mesh topology across all layers`,children:[(0,F.jsx)(he,{className:`h-3.5 w-3.5 text-cyan-400 ${r?`animate-spin`:``}`}),(0,F.jsx)(`span`,{className:`hidden md:inline font-mono text-[11px]`,children:`Scan`})]}),(0,F.jsxs)(`div`,{className:`relative flex items-center bg-surface1 border border-white/15 p-0.5 rounded-md`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(`obsidian`),className:`relative z-10 text-[11px] px-2.5 py-1 font-medium flex items-center gap-1.5 transition-colors duration-200`,title:`OLED Obsidian Theme`,children:[a===`obsidian`&&(0,F.jsx)(rd.div,{layoutId:`themeActivePill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(pe,{className:`relative z-20 h-3.5 w-3.5 transition-colors duration-200 ${a===`obsidian`?`text-black`:`text-zinc-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${a===`obsidian`?`text-black`:`text-zinc-300 hover:text-white`}`,children:`Obsidian`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(`slate`),className:`relative z-10 text-[11px] px-2.5 py-1 font-medium flex items-center gap-1.5 transition-colors duration-200`,title:`Slate Dark Theme`,children:[a===`slate`&&(0,F.jsx)(rd.div,{layoutId:`themeActivePill`,className:`absolute inset-0 bg-primary rounded shadow-sm`,transition:{type:`spring`,stiffness:450,damping:35}}),(0,F.jsx)(P,{className:`relative z-20 h-3.5 w-3.5 transition-colors duration-200 ${a===`slate`?`text-black`:`text-zinc-400`}`}),(0,F.jsx)(`span`,{className:`relative z-20 font-medium transition-colors duration-200 ${a===`slate`?`text-black`:`text-zinc-300 hover:text-white`}`,children:`Slate`})]})]})]})]})})}var wh=b.forwardRef(({className:e,type:t,...n},r)=>(0,F.jsx)(`input`,{type:t,className:Pf(`flex h-9 w-full rounded-md border border-border bg-surface1 px-3 py-1 text-xs text-white placeholder:text-zinc-500 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));wh.displayName=`Input`;var Th=({targetType:e,onTargetTypeChange:t,stdioCmd:n,onStdioCmdChange:r,httpUrl:i,onHttpUrlChange:a,grpcTarget:o,onGrpcTargetChange:s,onConnect:c,isConnecting:l,activeConnectedTarget:u,connected:d})=>(0,F.jsx)(`div`,{className:`w-full bg-surface1/90 border-b border-border px-4 py-2.5 backdrop-blur-sm transition-colors`,children:(0,F.jsxs)(`div`,{className:`max-w-7xl mx-auto flex flex-col md:flex-row items-stretch md:items-center justify-between gap-3 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 p-0.5 bg-background/80 border border-white/10 rounded-lg shrink-0`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`stdio`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`stdio`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(Ce,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`Stdio`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`http`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`http`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(N,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`HTTP / SSE`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`grpc`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`grpc`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(A,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`gRPC`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t(`mesh`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1.5 transition-all ${e===`mesh`?`bg-primary text-black font-semibold shadow-sm`:`text-zinc-400 hover:text-white`}`,children:[(0,F.jsx)(Ee,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`LIOP Mesh`})]})]}),(0,F.jsxs)(`div`,{className:`flex-1 flex items-center gap-2`,children:[e===`stdio`&&(0,F.jsx)(`div`,{className:`flex-1 relative`,children:(0,F.jsx)(wh,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Command and arguments, e.g.: npx -y @modelcontextprotocol/server-filesystem /tmp`,className:`font-mono text-[11px] h-8 bg-background/90`})}),e===`http`&&(0,F.jsx)(`div`,{className:`flex-1 relative`,children:(0,F.jsx)(wh,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`MCP Server Endpoint URL, e.g.: http://127.0.0.1:15000/mcp`,className:`font-mono text-[11px] h-8 bg-background/90`})}),e===`grpc`&&(0,F.jsx)(`div`,{className:`flex-1 relative`,children:(0,F.jsx)(wh,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`Tonic gRPC Host:Port, e.g.: 127.0.0.1:13011`,className:`font-mono text-[11px] h-8 bg-background/90`})}),e===`mesh`&&(0,F.jsxs)(`div`,{className:`flex-1 flex items-center px-3 py-1 bg-background/80 border border-white/10 rounded-md font-mono text-[11px] text-zinc-300`,children:[(0,F.jsx)(`span`,{className:`text-cyan-400 mr-2`,children:`Preset Topology:`}),(0,F.jsx)(`span`,{children:`8 Sovereign Origin Nodes across 3 Tiers (Kademlia DHT + Swarm PSK)`})]}),(0,F.jsx)(Rf,{size:`sm`,onClick:c,disabled:l,className:`h-8 px-4 text-xs font-semibold shrink-0`,children:l?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(de,{className:`h-3.5 w-3.5 animate-spin mr-1.5`}),`Connecting...`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(me,{className:`h-3 w-3 fill-current mr-1.5`}),`Connect / Probe`]})})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 bg-background/90 border border-white/10 rounded-md shrink-0`,children:[(0,F.jsx)(`span`,{className:`relative flex h-2 w-2`,children:d?(0,F.jsx)(`span`,{className:`inline-flex rounded-full h-2 w-2 bg-emerald-500`}):(0,F.jsx)(`span`,{className:`inline-flex rounded-full h-2 w-2 bg-rose-500`})}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] truncate max-w-[220px] ${d?`text-zinc-300`:`text-rose-400 font-medium`}`,title:u,children:d?u||`Ready to connect`:u?`${u} (Offline)`:`Target Offline`})]})]})}),Eh=[{phase:`bootstrap`,label:`P2P Mesh Bootstrap`,detail:`Node synchronized`,status:`pending`},{phase:`discovery`,label:`Resource Discovery`,detail:`Multi-tier route resolution`,status:`pending`},{phase:`pqc`,label:`Kyber-768 Handshake`,detail:`ML-KEM key exchange`,status:`pending`},{phase:`sealing`,label:`AES-256-GCM Sealing`,detail:`Envelope cipher & sign`,status:`pending`},{phase:`execution`,label:`WASI Sandbox Run`,detail:`Logic injection on origin`,status:`pending`},{phase:`zk_verify`,label:`ZK-Receipt HMAC Seal`,detail:`Computational integrity proof`,status:`pending`}];function Dh(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(Eh),u=(0,b.useCallback)((e,t,n,r)=>{l(i=>{let a=!1;return i.map(i=>i.phase===e?(a=!0,{...i,status:n,detail:t,durationMs:r??i.durationMs}):a&&i.status!==`success`&&i.status!==`failed`?{...i,status:`pending`}:!a&&(i.status===`pending`||i.status===`running`)?{...i,status:`success`}:i)})},[]);return{isRunning:e,result:n,meta:i,errorAlert:o,setErrorAlert:s,timeline:c,handleExecute:(0,b.useCallback)(async n=>{let{targetTool:i,executionMode:o,code:c,formArgs:d,targetType:f}=n;if(!(!i||e)){t(!0),r(null),a(null),s(null),l([{phase:`bootstrap`,label:`Channel Bootstrap`,detail:`Target transport: ${f.toUpperCase()}`,status:`running`},{phase:`discovery`,label:`Resource Discovery`,detail:`Targeting tool ${i}...`,status:`pending`},{phase:`pqc`,label:`Kyber-768 / Channel Security`,detail:`Securing transport session...`,status:`pending`},{phase:`sealing`,label:`Payload Sealing`,detail:`Encrypting parameters & payload...`,status:`pending`},{phase:`execution`,label:`Origin / Sandbox Execution`,detail:`Executing inside target environment...`,status:`pending`},{phase:`zk_verify`,label:`ZK-Receipt HMAC Seal`,detail:`Cryptographic proof validation...`,status:`pending`}]);try{let e=await fetch(`/api/execute`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o===`form`?{tool:i,args:d}:{tool:i,logic:c})});if(!e.ok)throw Error(`Gateway error: ${e.statusText}`);let n=e.body?.getReader();if(!n)throw Error(`Unable to initialize SSE stream reader`);let l=new TextDecoder,f=``;for(;;){let{value:e,done:i}=await n.read();if(i)break;f+=l.decode(e,{stream:!0});let o=f.split(`
|
|
98
|
+
`);f=o.pop()||``;for(let e of o)if(e.trim()&&e.startsWith(`data: `)){let n=e.slice(6);try{let e=JSON.parse(n);e.type===`step`?u(e.phase,e.detail,e.status,e.durationMs):e.type===`result`?(r(e.payload),a(e.meta||null),t(!1)):e.type===`error`&&(s({title:e.payload.title||`Execution Error`,desc:e.payload.desc||`A sandbox failure occurred on origin node`}),a(e.meta||null),t(!1))}catch(t){console.error(`Error parsing SSE line:`,t,e)}}}}catch(e){s({title:`Connection Error`,desc:(e instanceof Error?e.message:String(e))||`Failed to communicate with Playground Gateway`}),t(!1),l(e=>e.map(e=>e.status===`running`?{...e,status:`failed`,detail:`Connection interrupted`}:e))}}},[e,u]),resetExecution:(0,b.useCallback)(()=>{r(null),a(null),s(null),l(Eh)},[]),updateTimelineStep:u}}function Oh(e={}){let{onTargetSwitched:t,onError:n}=e,r=(0,b.useRef)(t);r.current=t;let i=(0,b.useRef)(n);i.current=n;let[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)([]),[l,u]=(0,b.useState)([]),[d,f]=(0,b.useState)(null),[p,m]=(0,b.useState)(`http`),h=(0,b.useRef)(p);h.current=p;let[g,_]=(0,b.useState)(`npx -y @modelcontextprotocol/server-filesystem /tmp`),[v,y]=(0,b.useState)(`http://127.0.0.1:15000/mcp`),[x,S]=(0,b.useState)(`127.0.0.1:13011`),[C,w]=(0,b.useState)(!1),[T,E]=(0,b.useState)(!1),[D,O]=(0,b.useState)(!1),[ee,te]=(0,b.useState)(`http://127.0.0.1:15000/mcp`),[ne,re]=(0,b.useState)(Date.now()),[ie,ae]=(0,b.useState)(0),oe=d?.totalNodes??a?.totalNodes??l.length,k=d?.onlineNodes??a?.nodesOnline??l.filter(e=>e.status===`online`).length,A=oe>0,se=(0,b.useRef)(!1),ce=(0,b.useCallback)(async()=>{try{let e=await fetch(`/api/health`);e.ok&&o(await e.json())}catch(e){console.error(`Error fetching network health:`,e)}},[]),le=(0,b.useCallback)(async()=>{O(!0);try{let e=await fetch(`/api/tools`);e.ok&&c((await e.json()).tools||[])}catch(e){console.error(`Error fetching tools:`,e)}finally{O(!1)}},[]),j=(0,b.useCallback)(async(e,t=h.current||`http`,n)=>{w(!0);try{if(t===`grpc`){S(e),m(`grpc`);let t=await fetch(`/api/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:`grpc`,grpc:{target:e}})});if(!t.ok){let e=await t.json();throw Error(e.error||`Failed to connect to target`)}te(e)}else if(t===`http`){y(e),m(`http`);let t=await fetch(`/api/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:`http`,http:{url:e}})});if(!t.ok){let e=await t.json();throw Error(e.error||`Failed to connect to target`)}te(e)}await ce(),await le(),r.current&&n&&r.current(n)}catch(e){let t=e instanceof Error?e.message:String(e);i.current?.({title:`Target Switch Failed`,desc:t})}finally{w(!1)}},[ce,le]),M=(0,b.useCallback)(async(e=!1,t=!1)=>{t||E(!0);try{let t=await fetch(`/api/nodes?force=${e}`);if(t.ok){let e=await t.json(),n=e.nodes||[];if(u(n),f(e.summary||null),re(Date.now()),ae(0),!se.current&&n.length>0){let e=n.find(e=>e.status===`online`&&e.tools&&e.tools.length>0);if(e){se.current=!0;let t=e.ports?.grpc??e.ports?.http,n=e.ports?.grpc?`grpc`:`http`,r=n===`grpc`?`${e.host}:${t}`:`http://${e.host}:${t}/mcp`,i=e.tools[0];j(r,n,i)}}}}catch(e){console.error(`Error scanning mesh nodes:`,e)}finally{t||E(!1)}},[j]),N=(0,b.useCallback)(async()=>{w(!0);try{let e={type:p};if(p===`stdio`){let t=g.trim().split(/\s+/);e.stdio={command:t[0],args:t.slice(1)}}else p===`http`?e.http={url:v.trim()}:p===`grpc`?e.grpc={target:x.trim()}:p===`mesh`&&(e.mesh={});let t=await fetch(`/api/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw Error(n.error||`Failed to connect to target`);te(p===`stdio`?g:p===`http`?v:p===`grpc`?x:`Audit Mesh (8 Nodes Swarm)`),await ce(),await le(),await M(!0)}catch(e){let t=e instanceof Error?e.message:String(e);i.current?.({title:`Connection Failed`,desc:t})}finally{w(!1)}},[p,g,v,x,ce,le,M]);return(0,b.useEffect)(()=>{ce(),le(),M(!0)},[ce,le,M]),(0,b.useEffect)(()=>{let e=setInterval(()=>{ce(),M(!1,!0)},5e3);return()=>clearInterval(e)},[ce,M]),(0,b.useEffect)(()=>{let e=setInterval(()=>{ae(Math.floor((Date.now()-ne)/1e3))},1e3);return()=>clearInterval(e)},[ne]),{network:a,tools:s,nodes:l,scanSummary:d,targetType:p,setTargetType:m,stdioCmd:g,setStdioCmd:_,httpUrl:v,setHttpUrl:y,grpcTarget:x,setGrpcTarget:S,isConnecting:C,isScanning:T,loadingTools:D,activeConnectedTarget:ee,lastScanTimestamp:ne,secondsAgo:ie,totalNodes:oe,onlineNodes:k,hasNodeStats:A,fetchHealth:ce,fetchTools:le,fetchNodes:M,handleSwitchTarget:j,handleConnectTarget:N}}var kh=[{id:`hft`,name:`Market Analysis`,tool:`Analyze_HFT_Market_Data`,domain:`Financial HFT`,clearanceTier:`Tier 2`,description:`Computes VWAP and average HFT spreads with differential privacy utility preservation.`,code:`@LIOP{wasi_v1, HftAnalysis}
|
|
99
99
|
const ticks = env.records;
|
|
100
100
|
// Calculate VWAP and average bid/ask spreads
|
|
101
101
|
let sumPriceVol = 0;
|
|
@@ -264,7 +264,7 @@ return {
|
|
|
264
264
|
summary: "Logic executed directly at data origin under Zero-Trust WASI sandbox",
|
|
265
265
|
verifiedInSitu: true
|
|
266
266
|
};
|
|
267
|
-
@END`}];function Ah(){let[e,t]=(0,b.useState)(()=>localStorage.getItem(`liop_playground_theme`)||`obsidian`);(0,b.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e),document.documentElement.classList.remove(`theme-obsidian`,`theme-slate`),document.documentElement.classList.add(`theme-${e}`),localStorage.setItem(`liop_playground_theme`,e)},[e]);let[n,r]=(0,b.useState)(`output`),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(`logic`),[c,l]=(0,b.useState)({}),{isRunning:u,result:d,meta:f,errorAlert:p,setErrorAlert:m,timeline:h,handleExecute:g}=Dh(),{network:_,tools:v,nodes:y,scanSummary:x,targetType:S,setTargetType:C,stdioCmd:w,setStdioCmd:T,httpUrl:E,setHttpUrl:D,grpcTarget:O,setGrpcTarget:ee,isConnecting:te,isScanning:ne,loadingTools:re,activeConnectedTarget:ie,secondsAgo:ae,totalNodes:oe,onlineNodes:k,hasNodeStats:A,fetchHealth:se,fetchTools:ce,fetchNodes:le,handleSwitchTarget:j,handleConnectTarget:M}=Oh({onError:e=>m(e),onTargetSwitched:e=>{e&&
|
|
267
|
+
@END`}];function Ah(){let[e,t]=(0,b.useState)(()=>localStorage.getItem(`liop_playground_theme`)||`obsidian`);(0,b.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e),document.documentElement.classList.remove(`theme-obsidian`,`theme-slate`),document.documentElement.classList.add(`theme-${e}`),localStorage.setItem(`liop_playground_theme`,e)},[e]);let[n,r]=(0,b.useState)(`output`),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(`logic`),[c,l]=(0,b.useState)({}),{isRunning:u,result:d,meta:f,errorAlert:p,setErrorAlert:m,timeline:h,handleExecute:g}=Dh(),{network:_,tools:v,nodes:y,scanSummary:x,targetType:S,setTargetType:C,stdioCmd:w,setStdioCmd:T,httpUrl:E,setHttpUrl:D,grpcTarget:O,setGrpcTarget:ee,isConnecting:te,isScanning:ne,loadingTools:re,activeConnectedTarget:ie,secondsAgo:ae,totalNodes:oe,onlineNodes:k,hasNodeStats:A,fetchHealth:se,fetchTools:ce,fetchNodes:le,handleSwitchTarget:j,handleConnectTarget:M}=Oh({onError:e=>m(e),onTargetSwitched:e=>{e&&de(e)}}),[N,ue]=(0,b.useState)(null),[P,de]=(0,b.useState)(null),[fe,pe]=(0,b.useState)(kh[0].id),[me,he]=(0,b.useState)(kh[0].tool),[ge,_e]=(0,b.useState)(kh[0].code),ve=(0,b.useMemo)(()=>{let e=[];for(let t of kh){let n=t.tool.toLowerCase().replace(/_/g,``),r=v.some(e=>e.name.toLowerCase()===t.tool.toLowerCase()||e.name.toLowerCase().replace(/_/g,``)===n),i=y.some(e=>e.status===`online`&&e.tools&&e.tools.some(e=>e.toLowerCase()===t.tool.toLowerCase()||e.toLowerCase().replace(/_/g,``)===n));(r||i)&&e.push(t)}for(let t of v)if(!e.some(e=>e.tool.toLowerCase()===t.name.toLowerCase())){let n=t.name.replace(/[^a-zA-Z0-9]/g,``)||`OriginAnalysis`;e.push({id:`dyn-${t.name}`,name:t.name.replace(/_/g,` `),tool:t.name,domain:t.domain||`Dynamic Origin Capability`,clearanceTier:`Tier ${t.tier||1}`,description:t.description||`Dynamic Logic-on-Origin capability discovered on target node.`,code:`@LIOP{wasi_v1, ${n}}
|
|
268
268
|
const records = env.records || [];
|
|
269
269
|
// Return aggregated telemetry under zero-trust privacy
|
|
270
270
|
return {
|
|
@@ -272,4 +272,4 @@ return {
|
|
|
272
272
|
executionStatus: "PROCESSED_ON_ORIGIN",
|
|
273
273
|
verifiedInSitu: true
|
|
274
274
|
};
|
|
275
|
-
@END`})}return e.length>0?e:kh},[v,y]);(0,b.useEffect)(()=>{if(
|
|
275
|
+
@END`})}return e.length>0?e:kh},[v,y]);(0,b.useEffect)(()=>{if(ve.length>0){if(N){let e=ve.find(e=>e.id===N);if(e){pe(e.id),he(e.tool),_e(e.code),ue(null),de(null);return}}if(P){let e=ve.find(e=>e.tool.toLowerCase()===P.toLowerCase()||e.tool.toLowerCase().replace(/_/g,``)===P.toLowerCase().replace(/_/g,``));if(e){pe(e.id),he(e.tool),_e(e.code),de(null);return}}if(!ve.find(e=>e.id===fe)){let e=ve[0];pe(e.id),he(e.tool),_e(e.code)}}},[ve,fe,P,N]);let ye=(0,b.useCallback)(e=>{let t=ve.find(t=>t.id===e)||kh.find(t=>t.id===e);if(!t)return;let n=t.tool.toLowerCase().replace(/_/g,``),r=y.find(e=>e.status===`online`&&(e.tools?.some(e=>e.toLowerCase()===t.tool.toLowerCase()||e.toLowerCase().replace(/_/g,``)===n)||t.id===`perimeter`&&e.id===`blg`||t.id===`blg_banking`&&e.id===`blg`||t.id===`blg_healthcare`&&e.id===`blg`||t.id===`bank`&&e.id===`bank`||t.id===`vault`&&e.id===`vault`||t.id===`market`&&e.id===`oracle`||t.id===`iot`&&e.id===`edge`||t.id===`pii_attack`&&e.id===`bank`||t.id===`mesh`&&(e.id===`relay`||e.id===`oracle`)));if(r){let e=r.ports?.grpc??r.ports?.http,n=r.ports?.grpc?`grpc`:`http`,i=n===`grpc`?`${r.host}:${e}`:`http://${r.host}:${e}/mcp`;if(ie!==i){ue(t.id),de(t.tool),pe(t.id),_e(t.code),he(t.tool),j(i,n,t.tool);return}}pe(t.id),_e(t.code),he(t.tool)},[ve,y,ie,j]),be=(0,b.useCallback)(e=>{he(e);let t=ve.find(t=>t.tool.toLowerCase()===e.toLowerCase()||t.tool.toLowerCase().replace(/_/g,``)===e.toLowerCase().replace(/_/g,``))||kh.find(t=>t.tool.toLowerCase()===e.toLowerCase()||t.tool.toLowerCase().replace(/_/g,``)===e.toLowerCase().replace(/_/g,``));t&&(pe(t.id),_e(t.code))},[ve]),xe=(0,b.useCallback)(()=>{let e=ve.find(e=>e.id===fe);e&&_e(e.code)},[ve,fe]),Se=(0,b.useCallback)(e=>{if(!e||v.length===0)return!1;let t=e.toLowerCase().replace(/_/g,``);return v.some(n=>n.name.toLowerCase()===e.toLowerCase()||n.name.toLowerCase().replace(/_/g,``)===t)},[v]),Ce=(0,b.useMemo)(()=>ve.find(e=>e.id===fe),[ve,fe]),we=(0,b.useMemo)(()=>Se(o===`form`?me:Ce?.tool||me),[o,me,Ce,Se]),Te=(0,b.useMemo)(()=>v.find(e=>e.name===me),[v,me]),Ee=()=>{g({targetTool:me||Ce?.tool||ve[0]?.tool||``,executionMode:o,code:ge,formArgs:c,targetType:S})},De=(0,b.useMemo)(()=>{let e=new Set;for(let t of y)t.status===`online`&&(t.tier===1||t.tier===2||t.tier===3)&&e.add(t.tier);return e},[y]),Oe=De.size>0;return(0,F.jsxs)(`div`,{className:`min-h-screen bg-background flex flex-col font-sans antialiased text-foreground selection:bg-primary/20 selection:text-primary`,children:[(0,F.jsx)(Ch,{onlineNodes:k,totalNodes:oe,hasNodeStats:A,isScanning:ne,secondsAgo:ae,theme:e,onThemeChange:t,onRescan:()=>{le(!0,!1),ce(),se()}}),(0,F.jsx)(Th,{targetType:S,onTargetTypeChange:C,stdioCmd:w,onStdioCmdChange:T,httpUrl:E,onHttpUrlChange:D,grpcTarget:O,onGrpcTargetChange:ee,onConnect:M,isConnecting:te,activeConnectedTarget:ie,connected:_?.status===`healthy`}),(0,F.jsx)(`main`,{className:`flex-1 max-w-7xl w-full mx-auto p-4 md:p-6 flex flex-col gap-6`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6 items-start`,children:[(0,F.jsx)(xh,{tools:v,nodes:y,scanSummary:x,onlineNodes:k,totalNodes:oe,hasNodeStats:A,isScanning:ne,loadingTools:re,targetType:S,activeConnectedTarget:ie,selectedToolName:me,onSelectTool:be,onSwitchTarget:j}),(0,F.jsxs)(`section`,{className:`lg:col-span-8 flex flex-col space-y-6`,children:[(0,F.jsx)(Gf,{executionMode:o,onExecutionModeChange:s,availableTemplates:ve,selectedTemplateId:fe,onSelectTemplate:ye,selectedToolName:me,onSelectTool:be,code:ge,onCodeChange:_e,isRunning:u,tools:v,isCurrentToolSupported:we,currentTemplate:Ce,currentToolObj:Te,activeConnectedTarget:ie,isNetworkHealthy:_?.status===`healthy`,formArgs:c,onFormArgChange:(e,t)=>l(n=>({...n,[e]:t})),onResetTemplate:xe,onExecute:Ee,onOpenExportTab:()=>r(`export`),onOpenEnvModal:()=>a(!0)}),(0,F.jsx)(yh,{timeline:h,result:d,meta:f,errorAlert:p,isRunning:u,code:ge,selectedToolName:me,targetType:S,grpcTarget:O,httpUrl:E,stdioCmd:w,activeTab:n,onTabChange:r})]})]})}),(0,F.jsx)(Pe,{isOpen:i,onClose:()=>a(!1),toolName:me||`Analyze_Synthetic_Bank_Transactions`,tool:Te}),(0,F.jsx)(`footer`,{className:`border-t border-border bg-card/60 py-3 mt-auto transition-colors`,children:(0,F.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between text-[11px] text-zinc-400 gap-2`,children:[(0,F.jsx)(`div`,{children:`© 2026 Nekzus Solutions. Logic-Injection-on-Origin Protocol (LIOP).`}),(0,F.jsxs)(`div`,{className:`flex items-center space-x-4`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1 font-mono`,children:[(0,F.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${k>0?`bg-success`:`bg-rose-500`}`}),(0,F.jsx)(`span`,{className:`text-zinc-300`,children:Oe?`P2P Mesh: Multi-Tier Zero-Trust`:`Runtime: Direct Origin Execution`})]}),(0,F.jsx)(`span`,{className:`font-mono text-zinc-300`,children:k>0?Oe?`${k} Nodes Verified Across ${De.size} Layers`:`${k} Target Node${k>1?`s`:``} Online & Verified`:`Target Inactive (Offline)`})]})]})})]})}var jh=document.getElementById(`root`);jh&&(0,x.createRoot)(jh).render((0,F.jsx)(b.StrictMode,{children:(0,F.jsx)(Ah,{})}));
|
package/ui/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>LIOP - Logic-Injection-on-Origin Playground</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DQC14us6.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BMzlkxln.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-background text-foreground">
|