(self["webpackJsonp@lyrio/ui"]=self["webpackJsonp@lyrio/ui"]||[]).push([[153],{1659:function(e,i,n){"use strict";n.r(i);var t=n(29),a=n(1),r=(n(0),n(55)),l=n(1660),o=n.n(l),c=n(906),m=n(915),s=n(1081),u=n(701),b=n(22),d=n(1792),j=n(1803),f=n(601),g=n(602),p=n(1725),O=n(816),h=n(815),y={enableTimeMemoryLimit:!0,enableFileIo:!1,enableRunSamples:!0},x={enableTimeMemoryLimit:!0,enableInputFile:!0,enableOutputFile:!1,enableUserOutputFilename:!1};function v(e,i){var n=Object.values(u.a).includes(e.language)?e.language:Object.values(u.a)[0];return{interface:["stdio","shm"].includes(e.interface)?e.interface:"stdio",sharedMemorySize:"shm"!==e.interface?null:Number.isSafeInteger(e.sharedMemorySize)&&e.sharedMemorySize>=4&&e.sharedMemorySize<=128?e.sharedMemorySize:4,language:n,compileAndRunOptions:n===e.language?Object(u.e)(n,e.compileAndRunOptions):Object(u.g)(n),filename:e.filename&&"string"===typeof e.filename?e.filename:(i.find((function(e){return Object(u.c)(n,e.filename)}))||i[0]||{}).filename||"",timeLimit:Number.isSafeInteger(e.timeLimit)?e.timeLimit:null,memoryLimit:Number.isSafeInteger(e.memoryLimit)?e.memoryLimit:null}}var I=function(e){var i=Object(b.i)("problem_judge_settings"),n=e.judgeInfo.interactor;function r(i){e.onUpdateJudgeInfo((function(e){var n=e.interactor;return{interactor:Object.assign({},n,i)}}))}var l=function(e){return(e=Math.round(e))<4?4:e>128?128:e};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(c.a,Object(t.a)(Object(t.a)({},e),{},{options:y})),Object(a.jsxs)(d.a,{className:o.a.wrapper,children:[Object(a.jsxs)("div",{className:o.a.menuWrapper,children:[Object(a.jsx)(j.a,{size:"tiny",content:i(".interactor.interactor")}),Object(a.jsx)(f.a,{secondary:!0,pointing:!0,children:["stdio","shm"].map((function(e){return Object(a.jsx)(f.a.Item,{content:i(".interactor.interfaces.".concat(e)),active:n.interface===e,onClick:function(){return n.interface!==e&&r({interface:e,sharedMemorySize:"shm"===e?4:null})}},e)}))})]}),Object(a.jsx)(g.a,{color:"grey",className:o.a.checkerConfig,children:Object(a.jsxs)("div",{className:o.a.custom,children:[Object(a.jsx)(O.a,{type:"FormSelect",label:i(".interactor.filename"),placeholder:i(".interactor.filename_no_file"),value:n.filename,testData:e.testData,onChange:function(e){return r({filename:e})}}),Object(a.jsx)("div",{className:o.a.compileAndRunOptions,children:Object(a.jsx)(h.a,{elementAfterLanguageSelect:Object(a.jsxs)(d.a.Field,{style:{visibility:"shm"===n.interface?"":"hidden"},children:[Object(a.jsx)("label",{children:i(".interactor.shm_size")}),Object(a.jsx)(p.a,{value:l(n.sharedMemorySize),type:"number",min:4,max:128,label:"MiB",labelPosition:"right",onChange:function(e,i){var n=i.value;return r({sharedMemorySize:l(Number(n))})}})]}),language:n.language,compileAndRunOptions:n.compileAndRunOptions,onUpdateLanguage:function(e){return r({language:e})},onUpdateCompileAndRunOptions:function(e){return r({compileAndRunOptions:e})}})}),Object(a.jsxs)(d.a.Group,{children:[Object(a.jsxs)(d.a.Field,{width:8,children:[Object(a.jsx)("label",{children:i(".meta.time_limit")}),Object(a.jsx)(p.a,{className:o.a.labeledInput,placeholder:e.judgeInfo.timeLimit,value:null==n.timeLimit?"":n.timeLimit,label:"ms",labelPosition:"right",icon:"clock",iconPosition:"left",onChange:function(e,i){var n=i.value;return(""===n||Number.isSafeInteger(Number(n))&&Number(n)>=0)&&r({timeLimit:""===n?null:Number(n)})}})]}),Object(a.jsxs)(d.a.Field,{width:8,children:[Object(a.jsx)("label",{children:i(".meta.memory_limit")}),Object(a.jsx)(p.a,{className:o.a.labeledInput,placeholder:e.judgeInfo.memoryLimit,value:null==n.memoryLimit?"":n.memoryLimit,label:"MiB",labelPosition:"right",icon:"microchip",iconPosition:"left",onChange:function(e,i){var n=i.value;return(""===n||Number.isSafeInteger(Number(n))&&Number(n)>=0)&&r({memoryLimit:""===n?null:Number(n)})}})]})]})]})})]}),Object(a.jsx)(m.a,Object(t.a)(Object(t.a)({},e),{},{options:x})),Object(a.jsx)(s.a,Object(t.a)({},e))]})};I=Object(r.a)(I);var L={parseJudgeInfo:function(e,i){return Object.assign({},c.a.parseJudgeInfo(e,i,y),{interactor:v(e.interactor||{},i)},m.a.parseJudgeInfo(e,i,x),s.a.parseJudgeInfo(e,i))},normalizeJudgeInfo:function(e){c.a.normalizeJudgeInfo(e,y),e.interactor.sharedMemorySize||delete e.interactor.sharedMemorySize,null==e.interactor.timeLimit&&delete e.interactor.timeLimit,null==e.interactor.memoryLimit&&delete e.interactor.memoryLimit,m.a.normalizeJudgeInfo(e,x),s.a.normalizeJudgeInfo(e)}};i.default=Object.assign(I,L)}}]);
//# sourceMappingURL=153.e2c3cca6.chunk.js.map