import{k as f,h as r,j as e,M as d,Y as h,B as C,K as y}from"./vendor.e6eaca24.js";import{u as k,L as _}from"./index.c6944236.js";import{a as w}from"./StatusText.c4c8fc8c.js";import{S as x}from"./ScoreText.136453e4.js";const V="_leftContainer_3dfm7_1",N="_rightContainer_3dfm7_5",g="_actionMenu_3dfm7_9",v="_menuItemImportant_3dfm7_59",p="_menuItemDangerous_3dfm7_69",M="_submitView_3dfm7_88",I="_inStatementView_3dfm7_93",L="_editorWrapper_3dfm7_100",T="_skipSamples_3dfm7_119",B="_submitButton_3dfm7_124",A="_lastSubmission_3dfm7_127",W="_scoreText_3dfm7_141",D="_disabled_3dfm7_144";var i={leftContainer:V,rightContainer:N,actionMenu:g,menuItemImportant:v,menuItemDangerous:p,submitView:M,inStatementView:I,editorWrapper:L,skipSamples:T,submitButton:B,lastSubmission:A,scoreText:W,disabled:D};let u=t=>{const s=k("problem");return r("div",{className:i.submitView,style:{display:t.inSubmitView?null:"none"},children:[e("div",{className:i.leftContainer,children:t.mainContent}),r("div",{className:i.rightContainer,children:[r(d,{pointing:!0,secondary:!0,vertical:!0,className:i.actionMenu,children:[e(d.Item,{name:s(".submit.back_to_statement"),icon:"arrow left",onClick:t.onCloseSubmitView}),e("div",{})]}),t.sidebarContent,t.showSkipSamples&&e(h,{className:i.skipSamples,label:s(".submit.skip_samples"),checked:t.submissionContent.skipSamples,onChange:(m,{checked:c})=>t.onUpdateSubmissionContent("skipSamples",c)}),e(C,{className:i.submitButton,primary:!0,fluid:!0,icon:"paper plane",loading:t.pendingSubmit,disabled:t.submitDisabled,content:s(".submit.submit"),onClick:()=>t.onSubmit(t.onGetSubmitFile)}),t.lastSubmission&&t.lastSubmission.lastSubmission&&r("div",{className:i.lastSubmission,children:[e(y,{size:"tiny",content:s(".submit.last_submission")}),e(_,{href:`/s/${t.lastSubmission.lastSubmission.id}`,children:e(w,{status:t.lastSubmission.lastSubmission.status})}),e(_,{className:i.scoreText,href:`/s/${t.lastSubmission.lastSubmission.id}`,children:e(x,{score:t.lastSubmission.lastSubmission.score||0})})]})]})]})};u=f(u);const F=t=>e("div",{className:i.editorWrapper+(t.disabled?" "+i.disabled:""),children:t.children});var H=Object.assign(u,{EditorWrapper:F});function K(t,s){const m=a=>Number.isSafeInteger(a)&&a>=0,c=m(t[s])?t[s]:1/0;let n=1/0,o=-1/0;for(const a of t.subtasks||[]){const S=m(a[s])?a[s]:c;for(const b of a.testcases||[]){const l=m(b[s])?b[s]:S;l!==0&&(n=Math.min(n,l),o=Math.max(o,l))}}return Number.isFinite(n)?n===o?n.toString():n+" - "+o:null}function O(t){return Array.isArray(t==null?void 0:t.subtasks)&&t.subtasks.some(s=>Array.isArray(s==null?void 0:s.testcases)&&(s==null?void 0:s.testcases.length)>0)}export{H as S,K as g,O as h};
