PageSourceSearch

https://ocn-production.up.railway.app/assets/Downloads-3QhJ78Jm.js

js ocn-production.up.railway.app collected 2026-10-03 12:13:21 UTC 4,607 bytes, 1 lines download raw bytes

1import{j as e}from"./motion-5l-h5bh-.js";import{a as c,L as h}from"./react-BR8zwAvh.js";import{d as j,S as y,F as N,w as v,x as w,t as u,y as f,J as _,z as S,o as z,h as C}from"./index-CQw4MaZD.js";import{P as D,a as E}from"./index-ChMEbGMs.js";function x(r){var i,o;const a=(r.url||r.title||"").split(/[?#]/)[0];return(((i=/\.([a-z0-9]{1,5})$/i.exec(a))==null?void 0:i[1])||((o=r.mime)==null?void 0:o.split("/").pop())||"file").slice(0,4).toUpperCase()}const d="all";function P(){const[r,a]=c.useState(d),{data:m,isLoading:i}=j({queryKey:["customer","downloads"],queryFn:async()=>(await C.get("/customer/orders",{params:{limit:100}})).data.orders}),o=c.useMemo(()=>(m||[]).filter(t=>{var n;return(n=t.deliverables)==null?void 0:n.length}),[m]),b=o.reduce((t,n)=>{var s;return t+(((s=n.deliverables)==null?void 0:s.length)||0)},0),k=c.useMemo(()=>{const t=new Map;for(const n of o)for(const s of n.deliverables||[]){const l=x(s);t.set(l,(t.get(l)||0)+1)}return[...t.entries()].sort((n,s)=>s[1]-n[1]||n[0].localeCompare(s[0])).slice(0,4)},[o]),p=c.useMemo(()=>o.map(t=>({order:t,files:(t.deliverables||[]).filter(n=>r===d||x(n)===r)})).filter(t=>t.files.length),[o,r]),g=[{key:d,label:"All files",count:b},...k.map(([t,n])=>({key:t,label:t,count:n}))];return e.jsx(D,{title:"Downloads",description:"Everything delivered on your projects. Download them here any time — the files are tied to your account, so a link cannot be shared.",actions:o.length?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.map(t=>{const n=t.key===r;return e.jsxs("button",{onClick:()=>a(t.key),"aria-pressed":n,className:`inline-flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-[13px] font-medium transition-colors ${n?"border-ink-900 bg-ink-900 text-surface":"border-ink-300 bg-surface text-ink-700 hover:border-ink-900 hover:text-ink-900"}`,children:[t.label,e.jsx("span",{className:`font-mono text-[10px] ${n?"opacity-70":"text-ink-400"}`,children:t.count})]},t.key)})}):void 0,children:i?e.jsx("div",{className:"panel p-5",children:e.jsx(y,{rows:4})}):o.length?p.length?e.jsx(v,{className:"flex flex-col gap-6",stagger:.07,children:p.map(({order:t,files:n})=>e.jsx(w,{children:e.jsxs("section",{className:"panel overflow-hidden",children:[e.jsxs("header",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-ink-200 bg-surface-2 px-5 py-3",children:[e.jsx(h,{to:`/dashboard/orders/${t._id}`,className:"font-mono text-xs font-semibold text-ink-900 transition-colors hover:text-brand-600",children:t.orderNo}),e.jsx("p",{className:"min-w-0 truncate text-sm text-ink-700",children:t.items.map(s=>s.title).join(", ")}),e.jsxs("span",{className:"ml-auto shrink-0 font-mono text-[11px] text-ink-500",children:[n.length," file",n.length===1?"":"s"]})]}),e.jsx("ul",{children:n.map(s=>e.jsxs("li",{className:"grid grid-cols-[3rem_minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1 border-b border-ink-100 px-5 py-3.5 last:border-b-0 sm:grid-cols-[3.5rem_minmax(0,1fr)_8rem_5.5rem_auto]",children:[e.jsx("span",{className:"rounded-sm bg-ink-100 px-1.5 py-1 text-center font-mono text-[10px] font-semibold text-ink-600",children:x(s)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-ink-900",children:s.title}),s.note&&e.jsx("p",{className:"mt-0.5 truncate text-xs text-ink-400",children:s.note}),e.jsxs("p",{className:"mt-0.5 font-mono text-[10px] text-ink-400 sm:hidden",children:[u(s.uploadedAt),s.size?` · ${f(s.size)}`:""]})]}),e.jsx("span",{className:"hidden font-mono text-[11px] text-ink-500 sm:block",children:u(s.uploadedAt)}),e.jsx("span",{className:"hidden font-mono text-[11px] text-ink-500 sm:block",children:s.size?f(s.size):"—"}),e.jsx("button",{onClick:()=>_("customer",t._id,s._id).catch(l=>S.error(z(l))),className:"justify-self-end rounded-lg border border-ink-300 px-3.5 py-1.5 text-[13px] font-semibold text-ink-900 transition-colors hover:border-ink-900 hover:bg-ink-900 hover:text-surface",children:"Get"})]},s._id))})]})},t._id))}):e.jsxs("div",{className:"panel px-5 py-14 text-center",children:[e.jsxs("p",{className:"text-sm text-ink-500",children:["No ",r," files in your deliveries."]}),e.jsx("button",{className:"btn-secondary btn-sm mt-4",onClick:()=>a(d),children:"Show every file"})]}):e.jsx(E,{bodyClassName:"p-2",children:e.jsx(N,{icon:"Download",title:"Nothing to download yet",description:"Source code, design files and documents appear here once your project is delivered.",action:e.jsx(h,{to:"/dashboard/orders",className:"btn-primary btn-sm",children:"View my orders"})})})})}export{P as default};

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.