PageSourceSearch

https://keepreap.com/assets/PastPaperUpload-CCu-jRM1.js

js keepreap.com collected 2026-10-02 01:34:49 UTC 4,353 bytes, 1 lines download raw bytes

1import{u as _,au as y,r as u,j as e,cZ as k,L as v,B as P,bG as h,fd as C,w as F,fg as L}from"./index.js";import{k as T,l as B}from"./pastPapersApi-DdRyme73.js";import{C as M,c as R,f as A}from"./image-prepare-DMMEq6qP.js";import{C as I}from"./circle-x-DSaGNJEP.js";function $(){const{t}=_(),{token:i=""}=y(),{data:s,isLoading:c,error:b,refetch:f}=T(i,{skip:!i}),[g]=B(),[x,o]=u.useState([]),m=u.useRef(null),d=(a,r)=>{o(l=>l.map(n=>n.key===a?{...n,...r}:n))},j=async a=>{if(!(!a||a.length===0)){for(const r of Array.from(a)){const l=`${r.name}-${r.size}-${r.lastModified}`;o(n=>[...n.filter(p=>p.key!==l),{key:l,name:r.name,state:"compressing",warning:null}]);try{const n=await R(r);d(l,{state:"uploading"});const p=await A(n.blob),w=await g({token:i,clientFileId:l,mimeType:n.mimeType,dataBase64:p,width:n.width,height:n.height}).unwrap();d(l,{state:"done",warning:w.warning})}catch{d(l,{state:"failed",warning:null})}}f()}},N=(s==null?void 0:s.status)==="expired"||(s==null?void 0:s.status)==="revoked";return e.jsxs("div",{className:"bg-brand-bg flex min-h-screen flex-col",children:[e.jsxs("header",{className:"border-brand-border-subtle flex shrink-0 items-center justify-between border-b px-4 py-3",children:[e.jsx(k,{variant:"lockup",size:"sm"}),e.jsx("span",{className:"text-brand-text-3 text-xs",children:t("past_papers.upload.badge")})]}),e.jsxs("main",{className:"mx-auto flex w-full max-w-md flex-1 flex-col px-4 py-6",children:[c&&e.jsx(v,{scope:"page"}),(b||!c&&!s)&&e.jsx("p",{className:"border-brand-danger text-brand-danger rounded-xl border border-dashed p-6 text-center text-sm",children:t("past_papers.upload.invalid_link")}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-brand-text-2 text-sm",children:s.paperTitle}),e.jsx("h1",{className:"text-brand-text-1 mt-1 text-lg font-semibold",children:s.questionLabel}),e.jsx("p",{className:"text-brand-text-3 mt-2 text-xs",children:t("past_papers.upload.hint",{max:s.maxFiles,mb:Math.round(s.maxBytesPerFile/(1024*1024))})})]}),N?e.jsx("p",{className:"bg-brand-warning-surface text-brand-warning mt-6 rounded-xl p-4 text-center text-sm",children:t("past_papers.upload.expired")}):e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:m,type:"file",accept:"image/*",capture:"environment",multiple:!0,className:"hidden",onChange:a=>{j(a.target.files),a.target.value=""}}),e.jsxs("div",{className:"border-brand-border-subtle bg-brand-bg mt-6 flex min-h-[220px] w-full flex-col items-center justify-center gap-4 roun
1ded-xl border border-dashed p-6",children:[e.jsx(M,{className:"text-brand-text-3 h-12 w-12"}),e.jsx(P,{variant:"primary",size:"lg",onClick:()=>{var a;return(a=m.current)==null?void 0:a.click()},className:"w-full",children:t("past_papers.upload.take_photo")})]})]}),e.jsx("p",{className:"text-brand-text-3 mt-4 text-center text-xs",children:t("past_papers.upload.uploaded_count",{count:s.uploadedCount,max:s.maxFiles})}),x.length>0&&e.jsx("ul",{className:"mt-6 space-y-2",children:x.map((a,r)=>e.jsxs("li",{className:"border-brand-border-subtle flex items-center gap-3 rounded-xl border px-3 py-2",children:[e.jsx("span",{className:"text-brand-text-3 w-6 shrink-0 text-xs tabular-nums",children:r+1}),e.jsx("span",{className:"text-brand-text-1 min-w-0 flex-1 truncate text-sm",children:a.name}),e.jsxs("span",{className:F("shrink-0 text-xs",a.state==="failed"?"text-brand-danger":"text-brand-text-2"),children:[a.state==="compressing"&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(h,{className:"h-3.5 w-3.5 animate-spin"}),t("past_papers.upload.state_compressing")]}),a.state==="uploading"&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(h,{className:"h-3.5 w-3.5 animate-spin"}),t("past_papers.upload.state_uploading")]}),a.state==="done"&&e.jsxs("span",{className:"text-brand-success inline-flex items-center gap-1",children:[e.jsx(C,{className:"h-3.5 w-3.5"}),t("past_papers.upload.state_done")]}),a.state==="failed"&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),t("past_papers.upload.state_failed")]})]})]},a.key))}),e.jsx("p",{className:"text-brand-text-3 mt-auto pt-8 text-center text-[11px]",children:t("past_papers.upload.privacy_note",{minutes:L.ticketTtlMinutes})})]})]})]})}export{$ 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.