1import{u as D,r as i,j as e}from"./vendor-react-wpXF2Dvf.js";import{r as M,u as _,ae as l,cD as g,cE as z,aG as $,T as d}from"./main-BDOnhuy4.js";import{A as F}from"./AlertV2-Beylrktz.js";import{B as v}from"./BadgeV2-BWYT74gA.js";import{B as K}from"./Breadcrumb-BWVckPp8.js";import{I as n}from"./IBBlank-C6fcXumq.js";import{I as G}from"./Input-DeJiTAt1.js";import{L as V,T as w}from"./LayeredTabs-D3msEab6.js";import{F as W}from"./Feedback-QWmms5zt.js";import{I as U}from"./IBLayout-C7P6wQRk.js";import{I as Y}from"./IbEssay-BI_vOfhy.js";import{u as H}from"./ib-essay-find-DbipbbKM.js";import{u as Q}from"./ib-essay-send-DZ9pVVh2.js";import{g as R}from"./getKlassNum-BrCmJq9H.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./superschool-sdk-BmtTBy0Q.js";import"./vendor-query-fYiNqPbw.js";import"./vendor-react-pdf-3ecbNM6a.js";import"./superschool-ui-DXud_9UO.js";import"./vendor-radix-kOLjYi5a.js";import"./vendor-recharts-DgZqauKz.js";import"./vendor-tiptap-DtaI5KiI.js";import"./vendor-i18n-BUJziXlB.js";import"./SolidSVGIcon-DXUtgANW.js";import"./SVGIcon-D21iE7oi.js";import"./ib-feedback-CO-GqOcw.js";import"./Check-DHx7k91g.js";import"./ImageNFileUpload-BGwuA8lv.js";import"./addfile-eQB3_APc.js";import"./fileNameGuard-DsoHfV4f.js";import"./ib-essay-update-CXzHeEcl.js";import"./uploadFileTypeEnum-BgwMIn1b.js";import"./useFileUpload-Du6gZQGo.js";import"./useImageAndDocument-CZ3ValCj.js";import"./validator-DTdIPQMX.js";const Se=()=>{var h,j,y;const b=M(),p=D(),s=(h=p.state)==null?void 0:h.project,N=(j=p.state)==null?void 0:j.type,{me:m}=_(),[a,o]=i.useState(!1),{data:t,refetch:E,isLoading:T}
1=H(s.id),[I,x]=i.useState("update"),[u,C]=i.useState(N||"checklist"),[f,c]=i.useState(null),[k,B]=i.useState(!0),{sentIBEssay:L,isLoading:S}=Q({onSuccess:()=>{c(`ìì¸ì´ê° 2ì ì¶ëììµëë¤`)},onError:r=>{console.error("IB íë¡ì í¸ ìì± ì¤ ì¤ë¥ ë°ì:",r)}}),O=r=>{C(r)},P=r=>{o(!a),E(),c(r==="update"?`ìì¸ì´ê° 3ì ì¥ëììµëë¤`:`ì²´í¬ë¦¬ì¤í¸ê° 4ìì ëììµëë¤`)};if(m==null)return e.jsx(n,{});if(t==null)return e.jsx(n,{});const A=R(s.leader);return e.jsxs("div",{children:[(T||S)&&e.jsx(n,{}),e.jsx(U,{topContent:e.jsx("div",{children:e.jsx("div",{className:"w-full pt-16 pb-6",children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsxs("div",{className:"flex w-full flex-row items-center justify-between",children:[e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsx(v,{color:"brown",size:24,type:"solid_strong",children:"TOK"}),e.jsx(v,{color:"gray",size:24,type:"solid_regular",children:"ìì¸ì´"})]}),e.jsx(K,{data:{ì§íìí:"/portal/student/ib","TOK ìì¸ì´":`/portal/student/ib/tok/essay/${s.id}`,"ìì¸ì´ ìì¸":`/portal/student/ib/tok/${s.id}/essay/${t.id}`}})]}),e.jsx(d,{variant:"heading",className:"w-[692px] overflow-hidden text-ellipsis whitespace-nowrap",children:(y=s==null?void 0:s.tokOutline)==null?void 0:y.themeQuestion})]})})}),bottomContent:e.jsx("div",{className:"flex grow flex-col",children:e.jsxs("div",{className:"flex h-full flex-row gap-4 py-6",children:[e.jsxs("div",{className:"relative flex h-[812px] w-[848px] flex-col justify-between gap-6 rounded-xl bg-white p-6",children:[k&&e.jsx(n,{type:"section-opacity"}),e.jsx("div",{className:"h-full w-full",children:e.jsx("iframe",{src:g(t.filePath),width:"100%",height:"100%",style:{border:"none"},title:"PDF Viewer",onLoad:()=>{B(!1)}})}),e.jsxs("footer",{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{className:"flex flex-row items-center gap-2",children:[e.jsx(l,{size:40,variant:"outline",color:"gray400",onClick:()=>{z(g(t.filePath),`${A}_${s.leader.name}_TOKìì¸ì´_ìì¸ì´.pdf`)},children:"ë¤ì´ë¡ë"}),s.status!=="COMPLETE"&&e.jsx(l,{size:40,variant:"outline",color:"gray400",disabled:s.status==="WAIT_COMPLETE",onClick:()=>{x("update"),o(!a)},children:"ìì¸ì´ ì¬ì ë¡ë"})]}),e.jsx(l,{size:40,variant:"solid",color:"gray100",onClick:()=>b.push(`/portal/student/ib/tok/essay/${s.id}`,{type:"ESSAY"}),children:"ëª©ë¡ ëìê°ê¸°"})]})]}),e.jsxs("div",{className:"flex h-[720px] w-[416px] flex-col gap-6 rounded-xl bg-white p-6",children:[e.jsxs(V.TwoDepth,{onChange:O,value:u,fullWidth:!0,children:[e.jsx(w,{value:"feedback",children:e.jsx("p",{children:"ì§í기ë¡"})}),e.jsx(w,{value:"checklist",children:e.jsx("p",{children:"ì²´í¬ë¦¬ì¤í¸"})})]}),u==="feedback"?e.jsx("div",{className:"h-full w-full",children:t.status==="PENDING"?e.jsxs("div",{className:"flex flex-col items-center gap-6 py-20",children:[e.jsx("div",{className:"h-12 w-12 px-[2.50px]",children:e.jsx("img",{src:$,className:"h-12 w-[43px] object-cover"})}),e.jsx(d,{variant:"body2",children:"ì§í기ë¡ì´ ììµëë¤."})]}):e.jsx(W,{referenceId:t.id,referenceTable:"ESSAY",user:m,useTextarea:s.status!=="COMPLETE"})}):e.jsxs("div",{className:"flex h-full w-full flex-col justify-between",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between rounded-lg",children:[e.jsx(d,{variant:"body3",children:"ì¬ì© ë¨ì´ ì"}),e.jsx(G.Basic,{size:32,type:"number",value:t.charCount,readonly:!0})]}),s.status!=="COMPLETE"&&e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(l,{size:40,variant:"outline",color:"gray400",disabled:s.status==="WAIT_COMPLETE",onClick:()=>{x("update_check"),o(!a)},children:"ìì "})})]})]})]})}),floatingButton:(t==null?void 0:t.status)==="PENDING"&&e.jsx("div",{className:"flex w-full justify-center",children:e.jsx(l,{variant:"solid",color:"orange800",size:48,className:"w-[416px]",onClick:()=>L(t.id),children:"ìì¸ì´ ì ì¶"})}),bottomBgColor:"bg-gray-50"}),a&&e.jsx(Y,{modalOpen:a,setModalClose:()=>o(!a),type:I,projectId:s.id,onSuccess:P,essayData:t}),f&&e.jsx(F,{message:f,confirmText:"íì¸",onConfirm:()=>c(null)})]})};export{Se as TOKEssayDetailPage};
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.