-
Notifications
You must be signed in to change notification settings - Fork 0
/
route-challs.chunk.51267.esm.js
1 lines (1 loc) · 24.6 KB
/
route-challs.chunk.51267.esm.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"4x8c":function(e,t,n){function r(e,t,n){var r=t.split("."),o=e.__lsc||(e.__lsc={});return o[t+n]||(o[t+n]=function(t){for(var o=t&&t.target||this,a={},s=a,i="string"==typeof n?function(e,t,n,r){for(r=0,t=t.split?t.split("."):t;e&&r<t.length;)e=e[t[r++]];return void 0===e?n:e}(t,n):o.nodeName?o.type.match(/^che|rad/)?o.checked:o.value:t,l=0;l<r.length-1;l++)s=s[r[l]]||(s[r[l]]=!l&&e.state[r[l]]||{});s[r[l]]=i,e.setState(a)})}n("sL3o").Component.prototype.linkState=function(e,t){return r(this,e,t)},e.exports=r},"810C":function(e,t,n){"use strict";(function(e){var r=n("obyI"),o=n("C+Gs"),a=n("+mXV"),s=n("JltG");const i=Object(o.a)({card:{background:"#222",margin:"auto"},section:{display:"inline"},content:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",columnGap:"20px",margin:"20px 40px",textAlign:"center"},time:{fontSize:"40px"},absolute:{gridColumn:"span 4",fontSize:"15px",color:"#bbb"},sub:{gridColumn:"span 4",marginTop:"10px",fontSize:"20px"},over:{margin:"20px 40px",fontSize:"20px",textAlign:"center"}},({classes:t})=>{const[n,o]=Object(a.j)(Date.now());if(Object(a.d)(()=>{const e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[]),n>r.a.endTime)return e("div",{class:"row"},e("div",{class:"card "+t.card},e("div",{class:t.over},"The CTF is over.")));const i=n>r.a.startTime,l=i?r.a.endTime:r.a.startTime,c=l-n,u=Math.floor(c/864e5),p=Math.floor(c/36e5)%24,d=Math.floor(c/6e4)%60,f=Math.floor(c/1e3)%60;return e("div",{class:"row"},e("div",{class:"card "+t.card},e("div",{class:t.content},e("span",{class:t.time},u),e("span",{class:t.time},p),e("span",{class:t.time},d),e("span",{class:t.time},f),e("span",null,"Days"),e("span",null,"Hours"),e("span",null,"Minutes"),e("span",null,"Seconds"),e("span",{class:t.sub},"until ",r.a.ctfName," ",i?"ends":"starts"),e("span",{class:t.absolute},Object(s.a)(l)))))});t.a=i}).call(this,n("sL3o").h)},BHE3:function(e,t){"use strict";function n(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function r(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}var o={"":["<em>","</em>"],_:["<strong>","</strong>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};t.a=function e(t){function a(e){var t=o[e.replace(/\*/g,"_")[1]||""],n=f[f.length-1]==e;return t?t[1]?(f[n?"pop":"push"](e),t[0|n]):t[0]:e}function s(){for(var e="";f.length;)e+=a(f[f.length-1]);return e}var i,l,c,u,p,d=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^```(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:\!\[([^\]]*?)\]\(([^\)]+?)\))|(\[)|(\](?:\(([^\)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(\-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,3})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*])/gm,f=[],m="",g=0,b={};for(t=t.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return b[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");c=d.exec(t);)l=t.substring(g,c.index),g=d.lastIndex,i=c[0],l.match(/[^\\](\\\\)*\\$/)||(c[3]||c[4]?i='<pre class="code '+(c[4]?"poetry":c[2].toLowerCase())+'">'+n(r(c[3]||c[4]).replace(/^\n+|\n+$/g,""))+"</pre>":c[6]?((p=c[6]).match(/\./)&&(c[5]=c[5].replace(/^\d+/gm,"")),u=e(n(c[5].replace(/^\s*[>*+.-]/gm,""))),">"===p?p="blockquote":(p=p.match(/\./)?"ol":"ul",u=u.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),i="<"+p+">"+u+"</"+p+">"):c[8]?i='<img src="'+r(c[8])+'" alt="'+r(c[7])+'">':c[10]?(m=m.replace("<a>",'<a href="'+r(c[11]||b[l.toLowerCase()])+'">'),i=s()+"</a>"):c[9]?i="<a>":c[12]||c[14]?i="<"+(p="h"+(c[14]?c[14].length:"="===c[13][0]?1:2))+">"+e(c[12]||c[15])+"</"+p+">":c[16]?i="<code>"+r(c[16])+"</code>":(c[17]||c[1])&&(i=a(c[17]||"--"))),m+=l,m+=i;return(m+t.substring(g)+s()).trim()}},CoLn:function(e,t,n){"use strict";(function(e){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n("BHE3"),i=n("y713"),l=n("810C"),c=n("ZUSA"),u=n("ngDR");t.a=({content:t,components:n})=>{return e(i.a,{type:"html",trim:!1,markup:(r=t,r.split(/(?:\r?\n){2,}/).map(e=>[" ","\t","#","-","*"].some(t=>e.startsWith(t))?Object(s.a)(e):`<p>${Object(s.a)(e)}</p>`).join("\n\n")),components:o({Timer:l.a,Sponsors:c.a,ActionButton:u.a},n)});var r}}).call(this,n("sL3o").h)},"FrX+":function(e,t,n){"use strict";function r(e){return Object(o.h)(c.a,{...e,glyph:"clock",viewBox:"0 0 24 24"})}n.d(t,"a",(function(){return r}));var o=n("sL3o"),a=n("ziER"),s=n.n(a),i=n("5JeM"),l=n.n(i),c=n("VXtC");const u=new s.a({id:"clock",use:"clock-usage",viewBox:"0 0 24 24",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff" id="clock"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /><path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" /></symbol>'});l.a.add(u)},JltG:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));const r=e=>{const t=new Date(e);return`${t.toLocaleDateString()} ${t.toLocaleTimeString()}`},o=e=>{const t=new Date(e).getTimezoneOffset(),n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0"),a=t>0?"-":"+";return`${r(e)} UTC${a}${n}:${o}`},a=e=>{const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return"just now";const o=Math.floor(n/60);if(o<60)return`${o} minute${1===o?"":"s"} ago`;const a=Math.floor(o/60);if(a<24)return`${a} hour${1===a?"":"s"} ago`;const s=Math.floor(a/24);return s<7?`${s} day${1===s?"":"s"} ago`:r(e)}},LMLH:function(e,t,n){"use strict";(function(e){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var a=n("sL3o"),s=n("+mXV"),i=n("xgHZ"),l=n("WX8x"),c=n("C+Gs"),u=n("JltG"),p=n("FrX+");const d=Object(c.a)({button:{fontFamily:"inherit"},table:{display:"grid",gridTemplateColumns:"repeat(3, max-content)","& div":{margin:"auto",padding:"5px 10px",textAlign:"center",whiteSpace:"nowrap"}},label:{borderBottom:"1px solid #fff",width:"100%",textAlign:"center"},name:{overflow:"hidden",width:"300px"},inlineLabel:{display:"none"},icon:{width:"60px",margin:"auto"},empty:{"& h5":{color:"#fff !important"},padding:"0 3rem",paddingTop:"3rem"},modalBody:{maxHeight:"60vh !important"},"@media (max-width: 768px)":{inlineLabel:{display:"initial",borderRight:"1px solid #fff"},table:{gridTemplateColumns:"repeat(2, minmax(max-content, 1fr))","& div":{margin:"0"}},label:{display:"none"},number:{borderTop:"1px solid #fff"},name:{width:"initial",maxWidth:"300px"}}},t=>{let{onClose:n,classes:c,challName:d,solveCount:f,solves:m,page:g,setPage:b,pageSize:v,modalBodyRef:h}=t,y=o(t,["onClose","classes","challName","solveCount","solves","page","setPage","pageSize","modalBodyRef"]);const O=Object(s.a)(e=>{e.preventDefault(),n()},[n]);return e(i.a,r({},y,{open:null!==m,onClose:n}),null!==m&&e(a.Fragment,null,0===m.length?e("div",{class:c.empty},e("div",{class:c.icon},e(p.a,null)),e("h5",null,d," has no solves.")):e(a.Fragment,null,e("div",{class:"modal-header"},e("div",{class:"modal-title"},"Solves for ",d)),e("div",{class:"modal-body "+c.modalBody,ref:h},e("div",{class:c.table},e("div",{class:c.label},"#"),e("div",{class:c.label},"Team"),e("div",{class:c.label},"Solve time"),m.map((t,n)=>e(a.Fragment,null,e("div",{class:`${c.inlineLabel} ${c.number}`},"#"),e("div",{class:c.number},(g-1)*v+n+1),e("div",{class:c.inlineLabel},"Team"),e("div",{class:c.name},e("a",{href:"/profile/"+t.userId},t.userName)),e("div",{class:c.inlineLabel},"Solve time"),e("div",null,Object(u.b)(t.createdAt))))),e(l.a,r({totalItems:f,pageSize:v,page:g,setPage:b},{numVisiblePages:9})))),e("div",{class:"modal-footer"},e("div",{class:"btn-container u-inline-block"},e("button",{class:"btn-small outline "+c.button,onClick:O},"Close")))))});t.a=d}).call(this,n("sL3o").h)},VXtC:function(e,t,n){"use strict";(function(e){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(t){let{glyph:n,viewBox:a}=t,s=o(t,["glyph","viewBox"]);return e("svg",r({},s,{viewBox:a,xmlns:"http://www.w3.org/2000/svg"}),e("use",{xlinkHref:"#"+n}))}n.d(t,"a",(function(){return a}))}).call(this,n("sL3o").h)},WX8x:function(e,t,n){"use strict";(function(e){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(t){let{onClick:n,disabled:a,selected:i,children:l,tabindex:c}=t,u=o(t,["onClick","disabled","selected","children","tabindex"]);const p=u.class||"";delete u.class;const d=Object(s.a)(e=>{e.preventDefault(),n()},[n]);return e("div",r({class:`pagination-item short ${p}${i?" selected":""}`},u),e("a",{disabled:a,href:n&&"#",onClick:d,tabindex:c},l))}var s=n("+mXV"),i=n("sL3o"),l=n("C+Gs");const c=Object(l.a)({noHover:{backgroundColor:"transparent !important"},ellipses:{paddingLeft:"0.1em !important",paddingRight:"0.1em !important"}},({classes:t})=>{const n=Object(s.a)(e=>e.target.blur(),[]);return e("div",{class:"pagination-item short "+t.noHover},e("a",{class:"ellipses "+t.ellipses,tabindex:"-1",onFocus:n},"…"))});t.a=function({totalItems:t,pageSize:n,page:r,setPage:o,numVisiblePages:l}){l=l||9;const u=Math.ceil(t/n),{pages:p,startPage:d,endPage:f}=Object(s.g)(()=>{let e,t;u<=l?(e=1,t=u):(e=r-Math.ceil((l-1)/2),t=r+Math.floor((l-1)/2),e<1?(e=1,t=l):t>u&&(t=u,e=u-l+1),e>1&&(e+=2),t<u&&(t-=2));const n=[];for(let r=e;r<=t;r++)n.push(r);return{pages:n,startPage:e,endPage:t}},[u,r,l]),m=Object(s.g)(()=>{const e=[];for(let t=1;t<=u;t++)e.push(()=>o(t));return e},[o,u]);return e("div",{class:"pagination u-center"},e(a,{disabled:1===r,key:"<",onClick:m[r-1-1]},"<"),d>1&&e(i.Fragment,null,e(a,{key:1,onClick:m[0]},"1"),e(c,{key:".<"})),p.map(t=>e(a,{selected:t===r,key:t,onClick:m[t-1]},t)),f<u&&e(i.Fragment,null,e(c,{key:".>"}),e(a,{key:u,onClick:m[u-1]},u)),e(a,{disabled:r===u,key:">",onClick:m[r+1-1]},">"))}}).call(this,n("sL3o").h)},ZUSA:function(e,t,n){"use strict";(function(e){var r=n("obyI"),o=(n("4x8c"),n("CoLn")),a=n("C+Gs");t.a=Object(a.a)({icon:{padding:"10px",margin:"20px 0",background:"#fff",borderRadius:"10px","& img":{height:"6.250em",width:"auto"}},description:{"& a":{display:"inline",padding:"0"}},row:{marginBottom:"1.5em"},card:{background:"#222"}},({classes:t})=>{const{sponsors:n}=r.a;return e("div",{class:"row"},n.map(n=>{let r="card "+t.card;return n.small||(r+=" u-flex u-flex-column h-100"),e("div",{class:"col-6 "+t.row,key:n.name},e("div",{class:r},e("div",{class:"content"},n.icon&&e("figure",{class:"u-center "+t.icon},e("img",{src:n.icon})),e("p",{class:"title level"},n.name),e("small",{class:t.description},e(o.a,{content:n.description})))))}))})}).call(this,n("sL3o").h)},bQ6K:function(e,t,n){"use strict";(function(e){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var o=n("C+Gs"),a=n("+mXV"),s=n("hdRk"),i=n("ucLl"),l=n("LMLH"),c=n("CoLn");const u={A:t=>e("a",r({},t,{target:"_blank"}))};t.a=Object(o.a)({frame:{marginBottom:"1em",paddingBottom:"0.625em",background:"#222"},description:{"& a":{display:"inline",padding:0},"& p":{lineHeight:"1.4em",fontSize:"1em",marginTop:0},"& pre":{whiteSpace:"pre-wrap"}},divider:{margin:"0.625em",width:"80%"},points:{marginTop:"0.75rem !important",marginBottom:"0 !important",cursor:"pointer",display:"inline-block",transition:"opacity ease-in-out 0.2s"},solvesPending:{opacity:"0.6",pointerEvents:"none",cursor:"default"},tag:{background:"#111"},input:{background:"#111",color:"#fff !important"},submit:{background:"#111",color:"#fff","&:hover":{background:"#222"}}},({classes:t,problem:n})=>{const{toast:r}=Object(i.b)(),o=0!==n.files.length,[p,d]=Object(a.j)(null),[f,m]=Object(a.j)(!1),[g,b]=Object(a.j)(1),v=Object(a.i)(null),h=Object(a.a)(async e=>{const{kind:t,message:o,data:a}=await Object(s.b)({challId:n.id,limit:10,offset:10*(e-1)});"goodChallengeSolves"===t?(d(a.solves),b(e),v.current.scrollTop=0):r({body:o,type:"error"})},[n.id,r]),y=Object(a.a)(async e=>{if(e.preventDefault(),f)return;m(!0);const{kind:t,message:o,data:a}=await Object(s.b)({challId:n.id,limit:10,offset:0});m(!1),"goodChallengeSolves"===t?(d(a.solves),b(1)):r({body:o,type:"error"})},[n.id,r,f]),O=Object(a.a)(()=>d(null),[]);return e("div",{class:"frame "+t.frame},e("div",{class:"frame__body"},e("div",{class:"row u-no-padding"},e("div",{class:"col-6 u-no-padding"},e("div",{class:"frame__title title"},n.category,"/",n.name),e("div",{class:"frame__subtitle u-no-margin"},n.author)),e("div",{class:"col-6 u-no-padding u-text-right"},e("a",{class:`${t.points} ${f?t.solvesPending:""}`,onClick:y},n.solves,1===n.solves?" solve / ":" solves / ",n.points,1===n.points?" point":" points"))),e("div",{class:"content-no-padding u-center"},e("div",{class:"divider "+t.divider})),e("div",{class:t.description+" frame__subtitle"},e(c.a,{content:n.description,components:u})),o&&e("div",null,e("p",{class:"frame__subtitle u-no-margin"},"Downloads"),e("div",{class:"tag-container"},n.files.map(n=>e("div",{class:"tag "+t.tag,key:n.url},e("a",{native:!0,download:!0,href:""+n.url},n.name)))))),e(l.a,{solves:p,challName:n.name,solveCount:n.solves,pageSize:10,page:g,setPage:h,onClose:O,modalBodyRef:v}))})}).call(this,n("sL3o").h)},hdRk:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=async()=>(await fetch("/json/challs.json")).json(),o=async({challId:e,offset:t})=>(await fetch(`/json/solves/${e}/${t}.json`)).json()},ngDR:function(e,t,n){"use strict";(function(e){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var a=n("C+Gs");const s=Object(a.a)({button:{padding:"16px !important",color:"#fff",background:"#222",boxShadow:"rgba(250,250,250,0.6) 0px 0px 1rem 0px",fontSize:"20px",borderRadius:"1rem",textAlign:"center",transition:"box-shadow ease-in-out 0.2s, transform ease-in-out 0.2s",margin:"20px auto","&:hover":{boxShadow:"rgba(250,250,250,0.6) 0px 0px 1.1rem 0px",transform:"scale(1.1)",color:"#fff"},"& svg":{height:"1em",position:"relative",top:"0.125em"}}},t=>{let{classes:n}=t,a=o(t,["classes"]);return e("div",{class:"row u-center"},e("a",r({class:n.button},a)))});t.a=s}).call(this,n("sL3o").h)},obyI:function(e,t){"use strict";const n=JSON.parse(document.head.querySelector("meta[name=rctf-config]").content);t.a=n},"p/sG":function(e,t,n){"use strict";n.r(t),function(e){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n("+mXV"),i=n("obyI"),l=n("C+Gs"),c=n("bQ6K"),u=n("pEbl"),p=n("ucLl"),d=n("hdRk");const f=0,m=1,g=2;t.default=Object(l.a)({showSolved:{marginBottom:"0.625em"},frame:{marginBottom:"1em",paddingBottom:"0.625em",background:"#222"},row:{justifyContent:"center","& .title, & .frame__subtitle":{color:"#fff"}}},({classes:t})=>{const n=Object(s.g)(()=>JSON.parse(localStorage.getItem("challPageState")||"{}"),[]),[r,a]=Object(s.j)(null),[l,b]=Object(s.j)(n.categories||{}),[v,h]=Object(s.j)(f),{toast:y}=Object(p.b)(),O=Object(s.a)(e=>{b(t=>o(o({},t),{},{[e.target.dataset.category]:e.target.checked}))},[]);Object(s.d)(()=>{document.title="Challenges | "+i.a.ctfName},[]),Object(s.d)(()=>{(async()=>{if(null!==r)return;const{data:e,error:t,notStarted:n}=await Object(d.a)();if(t)return void y({body:t,type:"error"});if(h(n?m:g),n)return;const s=o({},l);e.forEach(e=>{void 0===s[e.category]&&(s[e.category]=!1)}),a(e),b(s)})()},[y,l,r]),Object(s.d)(()=>{localStorage.challPageState=JSON.stringify({categories:l})},[l]);const w=Object(s.g)(()=>{if(null===r)return[];let e=r,t=!1;return Object.values(l).forEach(e=>{e&&(t=!0)}),t&&Object.keys(l).forEach(t=>{!1===l[t]&&(e=e.filter(e=>e.category!==t))}),e.sort((e,t)=>{if(e.points===t.points){if(e.solves===t.solves){return(t.sortWeight||0)-(e.sortWeight||0)}return t.solves-e.solves}return e.points-t.points}),e},[r,l]),{categoryCounts:j}=Object(s.g)(()=>{const e=new Map;if(null!==r)for(const t of r)e.has(t.category)||e.set(t.category,{total:0,solved:0}),e.get(t.category).total+=1;return{categoryCounts:e}},[r]);return v===f?null:v===m?e(u.a,null):e("div",{class:"row "+t.row},e("div",{class:"col-3"},e("div",{class:"frame "+t.frame},e("div",{class:"frame__body"},e("div",{class:"frame__title title"},"Categories"),Array.from(j.entries()).sort((e,t)=>e[0].localeCompare(t[0])).map(([t,{total:n}])=>e("div",{key:t,class:"form-ext-control form-ext-checkbox"},e("input",{id:"category-"+t,"data-category":t,class:"form-ext-input",type:"checkbox",checked:l[t],onChange:O}),e("label",{for:"category-"+t,class:"form-ext-label"},t," (",n,")")))))),e("div",{class:"col-6"},w.map(t=>e(c.a,{key:t.id,problem:t}))))})}.call(this,n("sL3o").h)},pEbl:function(e,t,n){"use strict";(function(e){var r=n("C+Gs"),o=n("FrX+"),a=n("obyI");const s=Object(r.a)({card:{background:"#222",padding:"30px !important",flexDirection:"column"},icon:{width:"60px"}},({classes:t})=>e("div",{class:"row"},e("div",{class:"card u-center col-6 "+t.card},e("div",{class:t.icon},e(o.a,null)),e("h4",null,a.a.ctfName," has not started yet."))));t.a=s}).call(this,n("sL3o").h)},xgHZ:function(e,t,n){"use strict";(function(e){var r=n("+mXV"),o=n("Xjb4"),a=n("C+Gs");t.a=Object(a.a)({"@keyframes container":{from:{opacity:0},to:{opactiy:1}},"@keyframes content":{from:{transform:"scale(0.8)"},to:{transform:"scale(1)"}},modal:{background:"#222",color:"#fff",maxWidth:"initial"},animated:{"&":{display:"flex",animation:"$container 150ms ease-out"},"& .modal-content":{animation:"$content 150ms ease-out"},"&.leaving":{opacity:0,transition:"opacity 150ms ease-in"},"&.leaving .modal-content":{transform:"scale(0.8)",transition:"transform 150ms ease-in"}}},(function({classes:t,open:n,onClose:a,children:s}){const[i,l]=Object(r.j)(n);return Object(r.d)(()=>{if(!n){const e=setTimeout(()=>{l(!1)},150);return()=>clearTimeout(e)}l(!0)},[n]),Object(r.d)(()=>{function e(e){"Escape"===e.key&&a()}if(n)return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)},[n,a]),(n||i)&&Object(o.a)(e("div",{class:`modal shown ${t.animated}${n?"":" leaving"}`,hidden:!(n||i)},e("div",{class:"modal-overlay",onClick:a,"aria-label":"Close"}),e("div",{class:"modal-content "+t.modal,role:"document"},s)),document.body)}))}).call(this,n("sL3o").h)},y713:function(e,t,n){"use strict";function r(e,t,n){if(3===e.nodeType){var o="textContent"in e?e.textContent:e.nodeValue||"";if(!1!==r.options.trim){var a=0===t||t===n.length-1;if((!(o=o.match(/^[\s\n]+$/g)&&"all"!==r.options.trim?" ":o.replace(/(^[\s\n]+|[\s\n]+$)/g,"all"===r.options.trim||a?"":" "))||" "===o)&&n.length>1&&a)return null}return o}if(1!==e.nodeType)return null;var s=String(e.nodeName).toLowerCase();if("script"===s&&!r.options.allowScripts)return null;var i,l,u=r.h(s,function(e){var t=e&&e.length;if(!t)return null;for(var n={},o=0;o<t;o++){var a=e[o],s=a.name,i=a.value;""===i&&(i=!0),"on"===s.substring(0,2)&&r.options.allowEvents&&(i=new Function(i)),n[s]=i}return n}(e.attributes),(l=(i=e.childNodes)&&Array.prototype.map.call(i,r).filter(c))&&l.length?l:null);return r.visitor&&r.visitor(u),u}function o(e){var t=(e.type||"").toLowerCase(),n=o.map;n&&n.hasOwnProperty(t)?(e.type=n[t],e.props=Object.keys(e.props||{}).reduce((function(t,n){var r;return t[(r=n,r.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})))]=e.props[n],t}),{})):e.type=t.replace(/[^a-z0-9-]/i,"")}var a,s,i=n("sL3o"),l={},c=function(e){return e},u={};t.a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.setReviver=function(e){s=e},t.prototype.shouldComponentUpdate=function(e){var t=this.props;return e.wrap!==t.wrap||e.type!==t.type||e.markup!==t.markup},t.prototype.setComponents=function(e){if(this.map={},e)for(var t in e)if(e.hasOwnProperty(t)){var n=t.replace(/([A-Z]+)([A-Z][a-z0-9])|([a-z0-9]+)([A-Z])/g,"$1$3-$2$4").toLowerCase();this.map[n]=e[t]}},t.prototype.render=function(e){var t=e.wrap;void 0===t&&(t=!0);var n,c=e.type,p=e.markup,d=e.components,f=e.reviver,m=e.onError,g=e["allow-scripts"],b=e["allow-events"],v=e.trim,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["wrap","type","markup","components","reviver","onError","allow-scripts","allow-events","trim"]),y=f||this.reviver||this.constructor.prototype.reviver||s||i.h;this.setComponents(d);var O={allowScripts:g,allowEvents:b,trim:v};try{n=function(e,t,n,s,i){var c=function(e,t){var n,r,o,s,i="html"===t?"text/html":"application/xml";"html"===t?(s="body",o="<!DOCTYPE html>\n<html><body>"+e+"</body></html>"):(s="xml",o='<?xml version="1.0" encoding="UTF-8"?>\n<xml>'+e+"</xml>");try{n=(new DOMParser).parseFromString(o,i)}catch(e){r=e}if(n||"html"!==t||((n=a||(a=function(){if(document.implementation&&document.implementation.createHTMLDocument)return document.implementation.createHTMLDocument("");var e=document.createElement("iframe");return e.style.cssText="position:absolute; left:0; top:-999em; width:1px; height:1px; overflow:hidden;",e.setAttribute("sandbox","allow-forms"),document.body.appendChild(e),e.contentWindow.document}())).open(),n.write(o),n.close()),n){var l=n.getElementsByTagName(s)[0],c=l.firstChild;return e&&!c&&(l.error="Document parse failed."),c&&"parsererror"===String(c.nodeName).toLowerCase()&&(c.removeChild(c.firstChild),c.removeChild(c.lastChild),l.error=c.textContent||c.nodeValue||r||"Unknown error",l.removeChild(c)),l}}(e,t);if(c&&c.error)throw new Error(c.error);var p=c&&c.body||c;o.map=s||u;var d=p&&function(e,t,n,o){return r.visitor=t,r.h=n,r.options=o||l,r(e)}(p,o,n,i);return o.map=null,d&&d.props&&d.props.children||null}(p,c,y,this.map,O)}catch(e){m?m({error:e}):"undefined"!=typeof console&&console.error&&console.error("preact-markup: "+e)}if(!1===t)return n&&n[0]||null;var w=h.hasOwnProperty("className")?"className":"class",j=h[w];return j?j.splice?j.splice(0,0,"markup"):"string"==typeof j?h[w]+=" markup":"object"==typeof j&&(j.markup=!0):h[w]="markup",y("div",h,n||null)},t}(i.Component)}}]);