import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Mi as s,ki as a}from"./vendor-frame-CwiylG4Y.js";import{ph as r}from"./shared-1-3-6x7RKF.js";import{Ao as t}from"./shared-6-Cf_fMhRZ.js";import{nn as o}from"./vendor-all-2-BJdkbLSj.js";import{R as n}from"./shared-frame-DbQbH4Yr.js";import{Po as l}from"./shared-4-6CEyRAHb.js";import{On as i,in as d,wn as c}from"./shared-8-C1HP2d2B.js";import{n as m,r as f}from"./c6b270778-Dt4cHcCk.js";import{t as u}from"./c881d0c23-B6Nki60Z.js";var p=e(s()),x=a();function j({children:e}){return(0,x.jsxs)("div",{className:"relative flex flex-col overflow-hidden bg-surface-2 font-ui",style:{borderRadius:c},children:[e,(0,x.jsx)(i,{})]})}var h=(0,p.memo)(function({data:e,onCopy:s,onPlatformClick:a,readOnly:r}){const{didCopy:t,copyToClipboard:i}=l(),d=(0,p.useCallback)(async e=>{await i(f,e.currentTarget),s?.()},[i,s]),c=(0,p.useCallback)(e=>a?.(e),[a]);return(0,x.jsx)(j,{children:(0,x.jsxs)("div",{className:"flex flex-col gap-md p-lg",children:[(0,x.jsx)("span",{className:"text-body text-secondary",children:e.caption??(0,x.jsx)(o,{defaultMessage:"Run this in your terminal to use Claude Code",id:"OmNnxDbJXM"})}),(0,x.jsxs)("div",{className:"flex items-center justify-between gap-md rounded bg-surface-1 px-md py-sm",children:[(0,x.jsx)("code",{className:"truncate font-mono text-body text-primary",children:f}),!r&&(0,x.jsx)(n,{variant:"onContent",size:"sm",icon:"Copy","aria-live":"polite",onClick:d,children:t?(0,x.jsx)(o,{defaultMessage:"Copied",id:"p556q3uvbn"}):(0,x.jsx)(o,{defaultMessage:"Copy",id:"4l6vz1/eZ5"})})]}),!r&&(0,x.jsxs)("div",{className:"flex flex-col gap-sm",children:[(0,x.jsx)("span",{className:"text-body text-secondary",children:(0,x.jsx)(o,{defaultMessage:"Or run it where you already work:",id:"CF1J4TAG0h"})}),(0,x.jsx)(m,{onPlatformClick:c})]})]})})});var y=(0,p.memo)(function(){return(0,x.jsxs)("div",{className:"flex flex-col gap-md bg-surface-2 p-lg font-ui",style:{borderRadius:c},children:[(0,x.jsx)(d,{width:"60%",height:20}),(0,x.jsx)(d,{width:"100%",height:44}),(0,x.jsx)(d,{width:"80%",height:28})]})}),b=(0,p.memo)(function({input:e,isStreaming:s,partialJson:a,conversationUuid:o,readOnly:n,disableAnalytics:l}){const{shownRef:i,trackRender:d,trackClick:c}=t("claude_code_install",o,l),m=(0,p.useMemo)(()=>function(e){let s;if("string"==typeof e)try{s=r(e)}catch{return null}else{if(!e||"object"!=typeof e)return null;s=e}if(!s||"object"!=typeof s)return null;const a=s;return{caption:u(a.caption,160),summary:u(a.summary,200)}}(a??e),[a,e]);(0,p.useEffect)(()=>{s||d(m?"rendered":"blank")},[s,m,d]);const f=(0,p.useCallback)(()=>c("copy_command"),[c]),j=(0,p.useCallback)(e=>c("install_destination",{platform:e}),[c]);return m?(0,x.jsx)("div",{ref:i,children:(0,x.jsx)(h,{data:m,onCopy:f,onPlatformClick:j,readOnly:n})}):s?(0,x.jsx)(y,{}):null});export{b as default};