PageSourceSearch

https://app.gopitcrew.com/assets/SharedRunPage-SAZHwZRu.js

js gopitcrew.com collected 2026-09-25 18:35:24 UTC 11,176 bytes, 1 lines download raw bytes

1import{w as k,n as p,l as e}from"./vendor-react-DqEQpdJ_.js";import{Y as T,L as R}from"./index-BIYvpNC2.js";import{H as E,M as S}from"./HtmlReportRenderer-DRX7I339.js";import{R as D}from"./ReportRenderer-CQLWVufC.js";import"./purify.es-A66Cw1IH.js";import"./pill-BH34j3yF.js";import{d as C}from"./FinalOutputSection-8oXkNeGr.js";import{l as P}from"./support-DH_BpLH3.js";import{b7 as h,aw as L,z as b,D as A,M as F}from"./vendor-icons-DEPTt6Sl.js";import"./vendor-radix-d0USATb1.js";import"./index-wwy72tYD.js";import"./index-BlgLXpZm.js";import"./ComponentRenderer-BrYAvVnE.js";import"./collapsible-Cay84UJG.js";const f="/pitcrew-new-logo-black.svg";function V(){const{shareToken:m}=k(),[n,j]=p.useState(null),[w,x]=p.useState(!0),[c,l]=p.useState(null);T(),p.useEffect(()=>{if(!m){l("Invalid share link"),x(!1);return}(async()=>{try{x(!0);const s=await R.getSharedRun(m);j(s)}catch(s){console.error("Failed to fetch shared run:",s);const a=s instanceof Error?s.message:"";a.includes("404")?l("This share link has expired or is invalid"):a.includes("403")?l("This share link has been revoked by the owner"):l("Failed to load shared report")}finally{x(!1)}})()},[m]);const u=r=>{if("json_report"in r&&typeof r.json_report=="object"&&r.json_report!==null)return r.json_report;if("state"in r&&typeof r.state=="object"&&r.state!==null){const s=r.state;if("final_report"in s&&typeof s.final_report=="object"&&s.final_report!==null){const a=s.final_report;if("sections"in a&&Array.isArray(a.sections))return a}}return null},g=r=>{if("html_report"in r&&typeof r.html_report=="string")return r.html_report;if("final_report"in r&&typeof r.final_report=="string"){const s=r.final_report;if(s.includes("<!DOCTYPE")||s.includes("<html")||s.includes("<div"))return s}if("report"in r&&typeof r.report=="string"){const s=r.report;if(s.includes("<!DOCTYPE")||s.includes("<html")||s.includes("<div"))return s}return""},y=r=>{if("markdown_report"in r&&typeof r.markdown_report=="string")return r.markdown_report;const s=["report","text","raw_response","content","markdown","response"];for(const a of s)if(a in r&&typeof r[a]=="string"){const i=r[a];if(i.includes("<!DOCTYPE")||i.includes("<html"))continue;return i}return""},N=r=>r?new Date(r).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A";if(w)return e.jsxs("div",{className:"shared-page min-h-screen flex flex-col",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:[e.jsx("header",{className:"bg-white border-b border-pc-border",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsx("img",{src:f,alt:"PitCrew",className:"h-10 w-auto"}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-pc-surface-2 border border-pc-border",children:[e.jsx(h,{className:"w-3.5 h-3.5 text-pc-text-3"}),e.jsx("span",{className:"text-xs font-medium text-pc-text-3",children:"Shared Report"})]})]})}),e.jsx("main",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-pc-primary/[0.08] border border-pc-primary/[0.12] flex items-center justify-center",children:e.jsx(L,{className:"w-7 h-7 animate-spin text-pc-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium text-pc-text-2",children:"Loading report..."}),e.jsx("p",{className:"text-xs text-pc-text-4 mt-1",children:"This may take a moment"})]})]})})]});const v=()=>c?c.includes("expired")?{title:"This Link Has Expired",message:"Share links are set to expire after a certain period for security reasons. This link is no longer active.",hint:"Please contact the person who shared this report with you to request a new link."}:c.includes("revoked")?{title:"Access Has Been Revoked",message:"The owner of this report has revoked access to this share link. This may have been done for security or privacy reasons.",hint:"If you still need access to this report, please reach out to the person who originally shared it with you."}:{title:"Unable to Load Report",message:"Something went wrong while trying to load this report. This could be a temporary issue with our servers.",hint:"Please try refreshing the page. If the problem persists, contact the report owner or our support team."}:{title:"Report Not Found",message:"We couldn't find the report you're looking for. This share link may be invalid, or the report may have been deleted.",hint:"If you received this link from someone, please contact them to request a new share link."};if(c||!n){const r=v();return e.jsxs("div",{className:"shared-page min-h-screen flex flex-col",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:[e.jsx("header",{className:"bg-white border-b border-pc-border sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsx("img",{src:f,alt:"PitCrew",className:"h-10 w-auto"}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-pc-surface-2 border border-pc-border",children:[e.jsx(h,{className:"w-3.5 h-3.5 text-pc-text-3"}),e.jsx("span",{className:"text-xs font-medium text-pc-text-3",children:"Shared Report"})]})]})}),e.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-6 py-8",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-pc-1 border border-pc-border p-6 mb-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-6 w-64 bg-pc-surface-2 rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-4 w-48 bg-pc-surface-2 rounded animate-pulse"})]}),e.jsx("div",{className:"h-6 w-20 bg-pc-surface-2 rounded-full animate-pulse"})]}),e.jsxs("div",{className:"flex items-center gap-6 pt-4 mt-4 border-t border-pc-surface-2",children:[e.jsx("div",{className:"h-4 w-32 bg-pc-surface-2 rounded animate-pulse"}),e.jsx("div",{className:"h-4 w-24 bg-pc-surface-2 rounded animate-pulse"})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-pc-1 border border-pc-border overflow-hidden",children:[e.jsxs("div",{className:"p-10 text-center",children:[e.jsx("div",{className:"w-14 h-14 roun
1ded-xl bg-pc-error/[0.08] border border-pc-error/[0.12] flex items-center justify-center mx-auto mb-5",children:e.jsx(b,{className:"w-7 h-7 text-pc-error"})}),e.jsx("h2",{className:"text-lg font-semibold text-pc-text mb-2",children:r.title}),e.jsx("p",{className:"text-sm text-pc-text-3 mb-1",children:r.message}),e.jsx("p",{className:"text-xs text-pc-text-4",children:r.hint})]}),e.jsx("div",{className:"px-6 py-6 border-t border-pc-border bg-pc-surface-2/30",children:e.jsxs("div",{className:"space-y-3 opacity-40",children:[e.jsx("div",{className:"h-3 w-full bg-pc-border rounded"}),e.jsx("div",{className:"h-3 w-11/12 bg-pc-border rounded"}),e.jsx("div",{className:"h-3 w-4/5 bg-pc-border rounded"}),e.jsx("div",{className:"h-3 w-full bg-pc-border rounded mt-6"}),e.jsx("div",{className:"h-3 w-3/4 bg-pc-border rounded"}),e.jsx("div",{className:"h-3 w-5/6 bg-pc-border rounded"})]})})]})]})]})}const t=n.run.output_data,d=(()=>{if(!t)return null;if("json_report"in t&&typeof t.json_report=="object")return"json_report";if("state"in t&&typeof t.state=="object"&&t.state!==null){const s=t.state;if("final_report"in s&&typeof s.final_report=="object"&&s.final_report!==null){const a=s.final_report;if("sections"in a&&Array.isArray(a.sections))return"json_report"}}if("markdown_report"in t&&typeof t.markdown_report=="string")return"markdown";const r=C(t);return r==="json_report"||r==="html"||r==="markdown"?r:null})(),_=r=>{const s=new Date(r),a=new Date,i=s.getTime()-a.getTime(),o=Math.ceil(i/(1e3*60*60*24));return o<0?"Expired":o===0?"Expires today":o===1?"Expires tomorrow":o<=7?`Expires in ${o} days`:`Expires ${s.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`};return e.jsxs("div",{className:"shared-page min-h-screen flex flex-col",style:{fontFamily:"'Inter', -apple-system, sans-serif"},children:[e.jsx("header",{className:"bg-white border-b border-pc-border sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsx("img",{src:f,alt:"PitCrew",className:"h-10 w-auto"}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-pc-surface-2 border border-pc-border",children:[e.jsx(h,{className:"w-3.5 h-3.5 text-pc-text-3"}),e.jsx("span",{className:"text-xs font-medium text-pc-text-3",children:"Shared Report"})]})]})}),e.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-6 py-8",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-pc-1 border border-pc-border p-6 mb-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-xl font-semibold text-pc-text mb-1",children:(t&&d==="json_report"?u(t)?.title:null)||n.board_snapshot?.name||"Analysis Report"}),n.board_snapshot?.description&&e.jsx("p",{className:"text-sm text-pc-text-3 mb-4",children:n.board_snapshot.description})]}),n.run.status==="completed"&&e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-pc-success/[0.08] border border-pc-success/[0.18]",children:[e.jsx(A,{className:"w-3.5 h-3.5 text-pc-success"}),e.jsx("span",{className:"text-xs font-medium text-pc-success",children:"Complete"})]})]}),e.jsxs("div",{className:"flex items-center gap-6 text-sm text-pc-text-3 pt-4 border-t border-pc-surface-2",children:[n.run.completed_at&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(F,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:N(n.run.completed_at)})]}),e.jsx("div",{className:"flex items-center gap-1.5 text-pc-text-4",children:e.jsx("span",{children:_(n.share_info.expires_at)})})]})]}),e.jsxs("div",{className:"shared-report-content bg-white rounded-xl shadow-pc-1 border border-pc-border overflow-hidden mb-6",children:[e.jsxs("div",{className:"p-6",children:[t&&d==="json_report"?e.jsx(D,{report:u(t),hideHeader:!0}):t&&d==="html"?e.jsx(E,{content:g(t)}):t&&d==="markdown"?e.jsx(S,{content:y(t)}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-pc-surface-2 flex items-center justify-center mx-auto mb-4",children:e.jsx(b,{className:"w-6 h-6 text-pc-text-4"})}),e.jsx("p",{className:"text-sm text-pc-text-3",children:"No output available"}),e.jsx("p",{className:"text-xs text-pc-text-4 mt-1",children:"This report doesn't contain viewable content"})]}),n.run.error_message&&e.jsxs("div",{className:"mt-6 p-4 bg-pc-error/[0.06] border border-pc-error/[0.12] rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-pc-error mb-1",children:"Error"}),e.jsx("p",{className:"text-sm text-pc-error/80",children:n.run.error_message})]})]}),e.jsx("div",{className:"px-6 py-4 bg-pc-surface-2 border-t border-pc-border",children:e.jsx("p",{className:"text-[11px] leading-[1.7] text-pc-text-4",children:P.text})})]})]})]})}export{V as SharedRunPage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.