import{o as e,b as t,d as s,e as a,j as l,x as n,q as r,l as o,m as i,u as c,D as u,E as d,w as m,h as p,t as v,n as h}from"./vendor.00762269.js";import{I as f}from"./account.dcb2750a.js";import{l as w}from"./load.52bfa58c.js";import{c as x}from"./codeforces.b6f27ebb.js";import{C as g,a as b}from"./c-table.c0504dbe.js";import{l as L,m as y,d as _,n as j}from"./index.01aab101.js";const k={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24"},C=[s("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)];var M={name:"ic-baseline-search",render:function(s,a){return e(),t("svg",k,C)}};const S={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24"},z=[s("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)];var A={name:"mdi-close",render:function(s,a){return e(),t("svg",S,z)}};const I=[...w(x),...w([])].sort(((e,t)=>t.startTime-e.startTime));const T={class:"divide-y"},B=s("h2",{class:"mb-4"},"所有比赛",-1),R={class:"my-4 relative"},Y={class:"font-600"},q={class:"flex flex-1 items-center justify-center"},D=h(" "),E=s("div",{class:"my-4 px-3"},"好像都没有找到比赛？",-1),N={key:0,class:"mt-4 flex justify-center"},U=h("↓ 浏览更多"),V={class:"mt-4 pt-4 text-gray-400"},F=h(" 共 "),G={class:"font-mono"},H=h(" 场比赛 "),J=a({setup(a){var w;const x=2*L,k="contest.size",C="contest.search",S=e=>sessionStorage.getItem(e),z=(e,t)=>{sessionStorage.setItem(e,t)},J=l(null!=(w=S(C))?w:""),K=l([]),O=()=>{""!==J.value?(K.value=I.filter((e=>e.name.toLowerCase().includes(J.value.toLowerCase()))),z(C,J.value)):z(C,"")};O();const P=j(O,500);n(J,(()=>{P()}));const Q=l(I.slice(0,(()=>{const e=S(k);return null!==e?+e:x})())),W=r((()=>""===J.value?Q.value:K.value)),X=()=>{const e=Q.value.length;Q.value.push(...I.slice(e,e+x)),z(k,String(Q.value.length))},Z=r((()=>""===J.value?I.length:K.value.length));return(a,l)=>{const n=o("router-link"),r=o("c-button");return e(),t("div",T,[B,s("div",null,[s("div",R,[i(c(M),{class:"absolute text-xl icon-search"}),u(s("input",{type:"text",name:"contest_search",id:"contest_search",class:"input-search w-full py-2 pr-2 outline-transparent rounded-md <md:shadow-box border border-light-900","onUpdate:modelValue":l[0]||(l[0]=e=>J.value=e)},null,512),[[d,J.value]]),i(c(A),{onClick:l[1]||(l[1]=e=>J.value=""),class:"absolute text-xl icon-close text-gray-400 outline-transparent rounded-full focus:bg-light-400"})]),i(c(g),{data:c(W)},{columns:m((({row:e,index:t})=>[i(c(b),{label:"#",center:""},{default:m((()=>[s("span",Y,v(t+1),1)])),_:2},1024),i(c(b),{label:"比赛","mobile-header-class":["min-w-8"]},{default:m((()=>[i(n,{to:e.path},{default:m((()=>[h(v(e.name),1)])),_:2},1032,["to"])])),_:2},1024),i(c(b),{label:"平台",center:""},{default:m((()=>[s("span",null,v(c(y)(e)),1)])),_:2},1024),i(c(b),{label:"时间",align:"center",width:"10em"},{default:m((()=>[s("span",null,v(c(_)(e.startTime).value),1)])),_:2},1024),i(c(b),{label:"人数",align:"center",width:"5em"},{default:m((()=>[s("div",q,[i(c(f)),D,s("span",null,"x "+v(e.participantNumber),1)])])),_:2},1024)])),empty:m((()=>[E])),_:1},8,["data"]),c(W).length<c(Z)?(e(),t("div",N,[i(r,{onClick:X,success:""},{default:m((()=>[U])),_:1})])):p("",!0)]),s("div",V,[F,s("span",G,v(c(Z)),1),H])])}}});export{J as default};
