@xcpcio/board-app 0.53.2 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/404.html +1 -1
- package/dist/assets/{Balloon.vue_vue_type_script_setup_true_lang-CNaNh1cd.js → Balloon.vue_vue_type_script_setup_true_lang-B58P9kc_.js} +1 -1
- package/dist/assets/Board-DzGFyq7Y.js +1 -0
- package/dist/assets/Board-gJRXyNvZ.css +1 -0
- package/dist/assets/{ContestStateBadge-fTJw-IjF.js → ContestStateBadge-kyzEE_y0.js} +1 -1
- package/dist/assets/{Countdown-1A-2QJ7m.js → Countdown-VhHt93-Y.js} +1 -1
- package/dist/assets/{DataSourceInput.vue_vue_type_script_setup_true_lang-CXts-riZ.js → DataSourceInput.vue_vue_type_script_setup_true_lang-ItvHR9Qe.js} +1 -1
- package/dist/assets/{Footer.vue_vue_type_script_setup_true_lang-Bk0nFBfB.js → Footer.vue_vue_type_script_setup_true_lang-CFhhwrFp.js} +1 -1
- package/dist/assets/{NavBar-C6sQ5txU.js → NavBar-D-0E9-D6.js} +1 -1
- package/dist/assets/{Resolver-A6qSPE_R.js → Resolver-Dm29vdoV.js} +1 -1
- package/dist/assets/{RightArrowIcon-ClOVVo1B.js → RightArrowIcon-DkTO5M_b.js} +1 -1
- package/dist/assets/{TheInput.vue_vue_type_script_setup_true_lang-D5spkHqx.js → TheInput.vue_vue_type_script_setup_true_lang-C80810Iu.js} +1 -1
- package/dist/assets/{Tooltip.vue_vue_type_script_setup_true_lang-FgOX36Lq.js → Tooltip.vue_vue_type_script_setup_true_lang-CivUau2c.js} +1 -1
- package/dist/assets/{_...all_-DmfbP4Ao.js → _...all_-B-coFtNQ.js} +1 -1
- package/dist/assets/{_...all_-BSvAEkM-.js → _...all_-D2j5jZRJ.js} +2 -2
- package/dist/assets/{_name_-AmLA_ZW6.js → _name_-DLnWsOOY.js} +1 -1
- package/dist/assets/{about-tPNAra1j.js → about-BI-IuMMG.js} +1 -1
- package/dist/assets/board-CYpV6N1-.js +1 -0
- package/dist/assets/{board-layout-C2v-fo1W.js → board-layout-iqYyMbo7.js} +1 -1
- package/dist/assets/{constant-b2ZZlr_Y.js → constant-Bp6N_6CR.js} +1 -1
- package/dist/assets/{default-D4907N0j.js → default-Dua7zuJz.js} +1 -1
- package/dist/assets/{en-DDlXf_8q.js → en-Bjc9Zdq9.js} +1 -1
- package/dist/assets/{headless-C_cFBCtG.js → headless-TXjG73-A.js} +1 -1
- package/dist/assets/{home-CRZ6rGwZ.js → home-BICvykpJ.js} +1 -1
- package/dist/assets/{index-CVZtA3I-.js → index-BSdw3fii.js} +4 -4
- package/dist/assets/{index-Bvki346r.js → index-BjviE8XK.js} +1 -1
- package/dist/assets/{index-XjAdtRAz.js → index-BuqFZWN0.js} +1 -1
- package/dist/assets/{index-BjCWriHl.css → index-BybaF8un.css} +1 -1
- package/dist/assets/{index-cu4LZbd6.js → index-CElS_fcG.js} +1 -1
- package/dist/assets/{index-Dar9HUtt.js → index-Cc06bvsk.js} +2 -2
- package/dist/assets/{index-DQYGiW5A.js → index-D5y2RQEx.js} +1 -1
- package/dist/assets/{index-ClcpF-3G.js → index-DfYfbXG4.js} +1 -1
- package/dist/assets/{index-BnOiKE-V.js → index-aqsbX7cA.js} +1 -1
- package/dist/assets/{index-layout-Bp7ERlAB.js → index-layout-CuYu1LJW.js} +1 -1
- package/dist/assets/{index-D5Eq7tNN.js → index-shmFGiVI.js} +1 -1
- package/dist/assets/{pagination-CHOfWwrE.js → pagination-BeE7gsif.js} +1 -1
- package/dist/assets/{query-C-pLpLZb.js → query-D-g5Deb_.js} +1 -1
- package/dist/assets/{test-Bw2mUsPy.js → test-j9jx5ZPp.js} +1 -1
- package/dist/assets/{use-vmodel-BKVjZ-1P.js → use-vmodel-dRzus2DH.js} +1 -1
- package/dist/assets/{user-o9hs8HNN.js → user-DCOj5vXR.js} +1 -1
- package/dist/assets/{virtual_pwa-register-8shrxAmh.js → virtual_pwa-register-DYmC-FJF.js} +1 -1
- package/dist/assets/{zh-CN-CNJkghp4.js → zh-CN-BgAN9IOl.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/auto-imports.d.ts +2 -0
- package/src/components/board/HeatMapTooltip.less +113 -0
- package/src/components/board/HeatMapTooltip.vue +68 -0
- package/src/components/board/Statistics.vue +6 -0
- package/src/components/board/SubmitHeatMap.less +13 -0
- package/src/components/board/SubmitHeatMap.vue +243 -0
- package/src/components.d.ts +2 -0
- package/src/composables/constant.ts +1 -0
- package/dist/assets/Board-D7W2MZ4t.js +0 -1
- package/dist/assets/Board-_AOcbImO.css +0 -1
- package/dist/assets/board-D0VTebOf.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var at=n=>{throw TypeError(n)};var K=(n,t,s)=>t.has(n)||at("Cannot "+s);var e=(n,t,s)=>(K(n,t,"read from private field"),s?s.call(n):t.get(n)),m=(n,t,s)=>t.has(n)?at("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),l=(n,t,s,i)=>(K(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),p=(n,t,s)=>(K(n,t,"access private method"),s);import{a4 as Rt,a5 as ot,a6 as C,a7 as G,a8 as B,a9 as Ot,aa as ht,ab as ut,ac as St,ad as wt,ae as Ct,af as ct,ag as It,ah as Tt,ai as Et,aj as Qt,g as mt,ak as Dt,al as Ft,C as W,am as lt,an as Ut,ao as dt,ap as jt}from"./index-CVZtA3I-.js";import{a as xt}from"./constant-b2ZZlr_Y.js";import{u as vt}from"./index-ClcpF-3G.js";var y,a,k,v,D,L,T,w,N,M,$,F,U,E,A,u,_,Y,H,J,X,Z,q,tt,yt,bt,Pt=(bt=class extends Rt{constructor(t,s){super();m(this,u);m(this,y);m(this,a);m(this,k);m(this,v);m(this,D);m(this,L);m(this,T);m(this,w);m(this,N);m(this,M);m(this,$);m(this,F);m(this,U);m(this,E);m(this,A,new Set);this.options=s,l(this,y,t),l(this,w,null),l(this,T,ot()),this.options.experimental_prefetchInRender||e(this,T).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(e(this,a).addObserver(this),ft(e(this,a),this.options)?p(this,u,_).call(this):this.updateResult(),p(this,u,X).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return et(e(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return et(e(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,p(this,u,Z).call(this),p(this,u,q).call(this),e(this,a).removeObserver(this)}setOptions(t,s){const i=this.options,o=e(this,a);if(this.options=e(this,y).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof C(this.options.enabled,e(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");p(this,u,tt).call(this),e(this,a).setOptions(this.options),i._defaulted&&!G(this.options,i)&&e(this,y).getQueryCache().notify({type:"observerOptionsUpdated",query:e(this,a),observer:this});const r=this.hasListeners();r&&pt(e(this,a),o,this.options,i)&&p(this,u,_).call(this),this.updateResult(s),r&&(e(this,a)!==o||C(this.options.enabled,e(this,a))!==C(i.enabled,e(this,a))||B(this.options.staleTime,e(this,a))!==B(i.staleTime,e(this,a)))&&p(this,u,Y).call(this);const c=p(this,u,H).call(this);r&&(e(this,a)!==o||C(this.options.enabled,e(this,a))!==C(i.enabled,e(this,a))||c!==e(this,E))&&p(this,u,J).call(this,c)}getOptimisticResult(t){const s=e(this,y).getQueryCache().build(e(this,y),t),i=this.createResult(s,t);return Mt(this,i)&&(l(this,v,i),l(this,L,this.options),l(this,D,e(this,a).state)),i}getCurrentResult(){return e(this,v)}trackResult(t,s){const i={};return Object.keys(t).forEach(o=>{Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),s==null||s(o),t[o])})}),i}trackProp(t){e(this,A).add(t)}getCurrentQuery(){return e(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=e(this,y).defaultQueryOptions(t),i=e(this,y).getQueryCache().build(e(this,y),s);return i.isFetchingOptimistic=!0,i.fetch().then(()=>this.createResult(i,s))}fetch(t){return p(this,u,_).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),e(this,v)))}createResult(t,s){var rt;const i=e(this,a),o=this.options,r=e(this,v),c=e(this,D),b=e(this,L),R=t!==i?t.state:e(this,k),{state:d}=t;let f={...d},Q=!1,h;if(s._optimisticResults){const O=this.hasListeners(),z=!O&&ft(t,s),gt=O&&pt(t,i,s,o);(z||gt)&&(f={...f,...Ct(d.data,t.options)}),s._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:I,errorUpdatedAt:j,status:S}=f;if(s.select&&f.data!==void 0)if(r&&f.data===(c==null?void 0:c.data)&&s.select===e(this,N))h=e(this,M);else try{l(this,N,s.select),h=s.select(f.data),h=ct(r==null?void 0:r.data,h,s),l(this,M,h),l(this,w,null)}catch(O){l(this,w,O)}else h=f.data;if(s.placeholderData!==void 0&&h===void 0&&S==="pending"){let O;if(r!=null&&r.isPlaceholderData&&s.placeholderData===(b==null?void 0:b.placeholderData))O=r.data;else if(O=typeof s.placeholderData=="function"?s.placeholderData((rt=e(this,$))==null?void 0:rt.state.data,e(this,$)):s.placeholderData,s.select&&O!==void 0)try{O=s.select(O),l(this,w,null)}catch(z){l(this,w,z)}O!==void 0&&(S="success",h=ct(r==null?void 0:r.data,O,s),Q=!0)}e(this,w)&&(I=e(this,w),h=e(this,M),j=Date.now(),S="error");const x=f.fetchStatus==="fetching",P=S==="pending",V=S==="error",it=P&&x,nt=h!==void 0;return{status:S,fetchStatus:f.fetchStatus,isPending:P,isSuccess:S==="success",isError:V,isInitialLoading:it,isLoading:it,data:h,dataUpdatedAt:f.dataUpdatedAt,error:I,errorUpdatedAt:j,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>R.dataUpdateCount||f.errorUpdateCount>R.errorUpdateCount,isFetching:x,isRefetching:x&&!P,isLoadingError:V&&!nt,isPaused:f.fetchStatus==="paused",isPlaceholderData:Q,isRefetchError:V&&nt,isStale:st(t,s),refetch:this.refetch,promise:e(this,T)}}updateResult(t){const s=e(this,v),i=this.createResult(e(this,a),this.options);if(l(this,D,e(this,a).state),l(this,L,this.options),e(this,D).data!==void 0&&l(this,$,e(this,a)),G(i,s))return;if(this.options.experimental_prefetchInRender){const c=R=>{i.status==="error"?R.reject(i.error):i.data!==void 0&&R.resolve(i.data)},b=()=>{const R=l(this,T,i.promise=ot());c(R)},g=e(this,T);switch(g.status){case"pending":c(g);break;case"fulfilled":(i.status==="error"||i.data!==g.value)&&b();break;case"rejected":(i.status!=="error"||i.error!==g.reason)&&b();break}}l(this,v,i);const o={},r=()=>{if(!s)return!0;const{notifyOnChangeProps:c}=this.options,b=typeof c=="function"?c():c;if(b==="all"||!b&&!e(this,A).size)return!0;const g=new Set(b??e(this,A));return this.options.throwOnError&&g.add("error"),Object.keys(e(this,v)).some(R=>{const d=R;return e(this,v)[d]!==s[d]&&g.has(d)})};(t==null?void 0:t.listeners)!==!1&&r()&&(o.listeners=!0),p(this,u,yt).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&p(this,u,X).call(this)}},y=new WeakMap,a=new WeakMap,k=new WeakMap,v=new WeakMap,D=new WeakMap,L=new WeakMap,T=new WeakMap,w=new WeakMap,N=new WeakMap,M=new WeakMap,$=new WeakMap,F=new WeakMap,U=new WeakMap,E=new WeakMap,A=new WeakMap,u=new WeakSet,_=function(t){p(this,u,tt).call(this);let s=e(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(Ot)),s},Y=function(){p(this,u,Z).call(this);const t=B(this.options.staleTime,e(this,a));if(ht||e(this,v).isStale||!ut(t))return;const i=St(e(this,v).dataUpdatedAt,t)+1;l(this,F,setTimeout(()=>{e(this,v).isStale||this.updateResult()},i))},H=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(e(this,a)):this.options.refetchInterval)??!1},J=function(t){p(this,u,q).call(this),l(this,E,t),!(ht||C(this.options.enabled,e(this,a))===!1||!ut(e(this,E))||e(this,E)===0)&&l(this,U,setInterval(()=>{(this.options.refetchIntervalInBackground||wt.isFocused())&&p(this,u,_).call(this)},e(this,E)))},X=function(){p(this,u,Y).call(this),p(this,u,J).call(this,p(this,u,H).call(this))},Z=function(){e(this,F)&&(clearTimeout(e(this,F)),l(this,F,void 0))},q=function(){e(this,U)&&(clearInterval(e(this,U)),l(this,U,void 0))},tt=function(){const t=e(this,y).getQueryCache().build(e(this,y),this.options);if(t===e(this,a))return;const s=e(this,a);l(this,a,t),l(this,k,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},yt=function(t){It.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(e(this,v))}),e(this,y).getQueryCache().notify({query:e(this,a),type:"observerResultsUpdated"})})},bt);function Lt(n,t){return C(t.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&t.retryOnMount===!1)}function ft(n,t){return Lt(n,t)||n.state.data!==void 0&&et(n,t,t.refetchOnMount)}function et(n,t,s){if(C(t.enabled,n)!==!1){const i=typeof s=="function"?s(n):s;return i==="always"||i!==!1&&st(n,t)}return!1}function pt(n,t,s,i){return(n!==t||C(i.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&st(n,s)}function st(n,t){return C(t.enabled,n)!==!1&&n.isStaleByTime(B(t.staleTime,n))}function Mt(n,t){return!G(n.getCurrentResult(),t)}function $t(n=""){if(!Tt())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const t=Qt(n),s=Et(t);if(!s)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return s}function At(n,t,s){const i=$t(),o=mt(()=>{const h=Dt(t);typeof h.enabled=="function"&&(h.enabled=h.enabled());const I=i.defaultQueryOptions(h);return I._optimisticResults=i.isRestoring.value?"isRestoring":"optimistic",I}),r=new n(i,o.value),c=Ft(r.getCurrentResult());let b=()=>{};W(i.isRestoring,h=>{h||(b(),b=r.subscribe(I=>{lt(c,I)}))},{immediate:!0});const g=()=>{r.setOptions(o.value),lt(c,r.getCurrentResult())};W(o,g),Ut(()=>{b()});const R=(...h)=>(g(),c.refetch(...h)),d=()=>new Promise((h,I)=>{let j=()=>{};const S=()=>{if(o.value.enabled!==!1){r.setOptions(o.value);const x=r.getOptimisticResult(o.value);x.isStale?(j(),r.fetchOptimistic(o.value).then(h,P=>{dt(o.value.throwOnError,[P,r.getCurrentQuery()])?I(P):h(r.getCurrentResult())})):(j(),h(x))}};S(),j=W(o,S)});W(()=>c.error,h=>{if(c.isError&&!c.isFetching&&dt(o.value.throwOnError,[h,r.getCurrentQuery()]))throw h});const Q=jt(c);for(const h in c)typeof c[h]=="function"&&(Q[h]=c[h]);return Q.suspense=d,Q.refetch=R,Q}function _t(n,t){return At(Pt,n)}const kt=3;async function Nt(n,t){const s=n.startsWith("/")?n.slice(1):n;let i=`${window.DATA_HOST}${s}`;const o={allInOne:!1};if(i.includes("#")){const d=new URLSearchParams(i.split("#")[1]);o.allInOne=d.get("allInOne")==="true",i=i.split("#")[0]}n.startsWith("http")&&(i=n),i.endsWith("/")&&(i=i.slice(0,-1));const r=d=>d.includes("?")?`${d}&t=${t??0}`:`${d}?t=${t??0}`,c=o.allInOne?[await fetch(r(i))]:[await fetch(r(`${i}/config.json`)),await fetch(r(`${i}/team.json`)),await fetch(r(`${i}/run.json`))],{status:b,statusText:g}=c[0];if(b>=300||b<200)throw new Error(`fetch data failed. [status=${b}] [statusText=${g}]`);return Promise.all(c.map(d=>d.json())).then(d=>o.allInOne?d[0]:{contest:d[0],teams:d[1],submissions:d[2]})}function Gt(n,t,s=!1){let i=3e4,o=i;const r=mt(()=>Math.floor(t.value.getTime()/1e3/10));return xt.value==="I18N"&&(i=10*1e3,o=i),s&&(i=Number.POSITIVE_INFINITY,o=!1),_t({queryKey:[n,r.value],queryFn:()=>Nt(n,r.value),retry:kt,staleTime:i,refetchInterval:o})}function Yt(){return vt("data-source","",{transform:String})}function Ht(){return vt("battle-of-giants","",{transform:String})}export{Ht as a,Yt as g,Gt as u};
|
|
1
|
+
var at=n=>{throw TypeError(n)};var K=(n,t,s)=>t.has(n)||at("Cannot "+s);var e=(n,t,s)=>(K(n,t,"read from private field"),s?s.call(n):t.get(n)),m=(n,t,s)=>t.has(n)?at("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),l=(n,t,s,i)=>(K(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),p=(n,t,s)=>(K(n,t,"access private method"),s);import{a4 as Rt,a5 as ot,a6 as C,a7 as G,a8 as B,a9 as Ot,aa as ht,ab as ut,ac as St,ad as wt,ae as Ct,af as ct,ag as It,ah as Tt,ai as Et,aj as Qt,g as mt,ak as Dt,al as Ft,C as W,am as lt,an as Ut,ao as dt,ap as jt}from"./index-BSdw3fii.js";import{a as xt}from"./constant-Bp6N_6CR.js";import{u as vt}from"./index-DfYfbXG4.js";var y,a,k,v,D,L,T,w,N,M,$,F,U,E,A,u,_,Y,H,J,X,Z,q,tt,yt,bt,Pt=(bt=class extends Rt{constructor(t,s){super();m(this,u);m(this,y);m(this,a);m(this,k);m(this,v);m(this,D);m(this,L);m(this,T);m(this,w);m(this,N);m(this,M);m(this,$);m(this,F);m(this,U);m(this,E);m(this,A,new Set);this.options=s,l(this,y,t),l(this,w,null),l(this,T,ot()),this.options.experimental_prefetchInRender||e(this,T).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(e(this,a).addObserver(this),ft(e(this,a),this.options)?p(this,u,_).call(this):this.updateResult(),p(this,u,X).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return et(e(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return et(e(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,p(this,u,Z).call(this),p(this,u,q).call(this),e(this,a).removeObserver(this)}setOptions(t,s){const i=this.options,o=e(this,a);if(this.options=e(this,y).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof C(this.options.enabled,e(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");p(this,u,tt).call(this),e(this,a).setOptions(this.options),i._defaulted&&!G(this.options,i)&&e(this,y).getQueryCache().notify({type:"observerOptionsUpdated",query:e(this,a),observer:this});const r=this.hasListeners();r&&pt(e(this,a),o,this.options,i)&&p(this,u,_).call(this),this.updateResult(s),r&&(e(this,a)!==o||C(this.options.enabled,e(this,a))!==C(i.enabled,e(this,a))||B(this.options.staleTime,e(this,a))!==B(i.staleTime,e(this,a)))&&p(this,u,Y).call(this);const c=p(this,u,H).call(this);r&&(e(this,a)!==o||C(this.options.enabled,e(this,a))!==C(i.enabled,e(this,a))||c!==e(this,E))&&p(this,u,J).call(this,c)}getOptimisticResult(t){const s=e(this,y).getQueryCache().build(e(this,y),t),i=this.createResult(s,t);return Mt(this,i)&&(l(this,v,i),l(this,L,this.options),l(this,D,e(this,a).state)),i}getCurrentResult(){return e(this,v)}trackResult(t,s){const i={};return Object.keys(t).forEach(o=>{Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),s==null||s(o),t[o])})}),i}trackProp(t){e(this,A).add(t)}getCurrentQuery(){return e(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=e(this,y).defaultQueryOptions(t),i=e(this,y).getQueryCache().build(e(this,y),s);return i.isFetchingOptimistic=!0,i.fetch().then(()=>this.createResult(i,s))}fetch(t){return p(this,u,_).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),e(this,v)))}createResult(t,s){var rt;const i=e(this,a),o=this.options,r=e(this,v),c=e(this,D),b=e(this,L),R=t!==i?t.state:e(this,k),{state:d}=t;let f={...d},Q=!1,h;if(s._optimisticResults){const O=this.hasListeners(),z=!O&&ft(t,s),gt=O&&pt(t,i,s,o);(z||gt)&&(f={...f,...Ct(d.data,t.options)}),s._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:I,errorUpdatedAt:j,status:S}=f;if(s.select&&f.data!==void 0)if(r&&f.data===(c==null?void 0:c.data)&&s.select===e(this,N))h=e(this,M);else try{l(this,N,s.select),h=s.select(f.data),h=ct(r==null?void 0:r.data,h,s),l(this,M,h),l(this,w,null)}catch(O){l(this,w,O)}else h=f.data;if(s.placeholderData!==void 0&&h===void 0&&S==="pending"){let O;if(r!=null&&r.isPlaceholderData&&s.placeholderData===(b==null?void 0:b.placeholderData))O=r.data;else if(O=typeof s.placeholderData=="function"?s.placeholderData((rt=e(this,$))==null?void 0:rt.state.data,e(this,$)):s.placeholderData,s.select&&O!==void 0)try{O=s.select(O),l(this,w,null)}catch(z){l(this,w,z)}O!==void 0&&(S="success",h=ct(r==null?void 0:r.data,O,s),Q=!0)}e(this,w)&&(I=e(this,w),h=e(this,M),j=Date.now(),S="error");const x=f.fetchStatus==="fetching",P=S==="pending",V=S==="error",it=P&&x,nt=h!==void 0;return{status:S,fetchStatus:f.fetchStatus,isPending:P,isSuccess:S==="success",isError:V,isInitialLoading:it,isLoading:it,data:h,dataUpdatedAt:f.dataUpdatedAt,error:I,errorUpdatedAt:j,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>R.dataUpdateCount||f.errorUpdateCount>R.errorUpdateCount,isFetching:x,isRefetching:x&&!P,isLoadingError:V&&!nt,isPaused:f.fetchStatus==="paused",isPlaceholderData:Q,isRefetchError:V&&nt,isStale:st(t,s),refetch:this.refetch,promise:e(this,T)}}updateResult(t){const s=e(this,v),i=this.createResult(e(this,a),this.options);if(l(this,D,e(this,a).state),l(this,L,this.options),e(this,D).data!==void 0&&l(this,$,e(this,a)),G(i,s))return;if(this.options.experimental_prefetchInRender){const c=R=>{i.status==="error"?R.reject(i.error):i.data!==void 0&&R.resolve(i.data)},b=()=>{const R=l(this,T,i.promise=ot());c(R)},g=e(this,T);switch(g.status){case"pending":c(g);break;case"fulfilled":(i.status==="error"||i.data!==g.value)&&b();break;case"rejected":(i.status!=="error"||i.error!==g.reason)&&b();break}}l(this,v,i);const o={},r=()=>{if(!s)return!0;const{notifyOnChangeProps:c}=this.options,b=typeof c=="function"?c():c;if(b==="all"||!b&&!e(this,A).size)return!0;const g=new Set(b??e(this,A));return this.options.throwOnError&&g.add("error"),Object.keys(e(this,v)).some(R=>{const d=R;return e(this,v)[d]!==s[d]&&g.has(d)})};(t==null?void 0:t.listeners)!==!1&&r()&&(o.listeners=!0),p(this,u,yt).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&p(this,u,X).call(this)}},y=new WeakMap,a=new WeakMap,k=new WeakMap,v=new WeakMap,D=new WeakMap,L=new WeakMap,T=new WeakMap,w=new WeakMap,N=new WeakMap,M=new WeakMap,$=new WeakMap,F=new WeakMap,U=new WeakMap,E=new WeakMap,A=new WeakMap,u=new WeakSet,_=function(t){p(this,u,tt).call(this);let s=e(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(Ot)),s},Y=function(){p(this,u,Z).call(this);const t=B(this.options.staleTime,e(this,a));if(ht||e(this,v).isStale||!ut(t))return;const i=St(e(this,v).dataUpdatedAt,t)+1;l(this,F,setTimeout(()=>{e(this,v).isStale||this.updateResult()},i))},H=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(e(this,a)):this.options.refetchInterval)??!1},J=function(t){p(this,u,q).call(this),l(this,E,t),!(ht||C(this.options.enabled,e(this,a))===!1||!ut(e(this,E))||e(this,E)===0)&&l(this,U,setInterval(()=>{(this.options.refetchIntervalInBackground||wt.isFocused())&&p(this,u,_).call(this)},e(this,E)))},X=function(){p(this,u,Y).call(this),p(this,u,J).call(this,p(this,u,H).call(this))},Z=function(){e(this,F)&&(clearTimeout(e(this,F)),l(this,F,void 0))},q=function(){e(this,U)&&(clearInterval(e(this,U)),l(this,U,void 0))},tt=function(){const t=e(this,y).getQueryCache().build(e(this,y),this.options);if(t===e(this,a))return;const s=e(this,a);l(this,a,t),l(this,k,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},yt=function(t){It.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(e(this,v))}),e(this,y).getQueryCache().notify({query:e(this,a),type:"observerResultsUpdated"})})},bt);function Lt(n,t){return C(t.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&t.retryOnMount===!1)}function ft(n,t){return Lt(n,t)||n.state.data!==void 0&&et(n,t,t.refetchOnMount)}function et(n,t,s){if(C(t.enabled,n)!==!1){const i=typeof s=="function"?s(n):s;return i==="always"||i!==!1&&st(n,t)}return!1}function pt(n,t,s,i){return(n!==t||C(i.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&st(n,s)}function st(n,t){return C(t.enabled,n)!==!1&&n.isStaleByTime(B(t.staleTime,n))}function Mt(n,t){return!G(n.getCurrentResult(),t)}function $t(n=""){if(!Tt())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const t=Qt(n),s=Et(t);if(!s)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return s}function At(n,t,s){const i=$t(),o=mt(()=>{const h=Dt(t);typeof h.enabled=="function"&&(h.enabled=h.enabled());const I=i.defaultQueryOptions(h);return I._optimisticResults=i.isRestoring.value?"isRestoring":"optimistic",I}),r=new n(i,o.value),c=Ft(r.getCurrentResult());let b=()=>{};W(i.isRestoring,h=>{h||(b(),b=r.subscribe(I=>{lt(c,I)}))},{immediate:!0});const g=()=>{r.setOptions(o.value),lt(c,r.getCurrentResult())};W(o,g),Ut(()=>{b()});const R=(...h)=>(g(),c.refetch(...h)),d=()=>new Promise((h,I)=>{let j=()=>{};const S=()=>{if(o.value.enabled!==!1){r.setOptions(o.value);const x=r.getOptimisticResult(o.value);x.isStale?(j(),r.fetchOptimistic(o.value).then(h,P=>{dt(o.value.throwOnError,[P,r.getCurrentQuery()])?I(P):h(r.getCurrentResult())})):(j(),h(x))}};S(),j=W(o,S)});W(()=>c.error,h=>{if(c.isError&&!c.isFetching&&dt(o.value.throwOnError,[h,r.getCurrentQuery()]))throw h});const Q=jt(c);for(const h in c)typeof c[h]=="function"&&(Q[h]=c[h]);return Q.suspense=d,Q.refetch=R,Q}function _t(n,t){return At(Pt,n)}const kt=3;async function Nt(n,t){const s=n.startsWith("/")?n.slice(1):n;let i=`${window.DATA_HOST}${s}`;const o={allInOne:!1};if(i.includes("#")){const d=new URLSearchParams(i.split("#")[1]);o.allInOne=d.get("allInOne")==="true",i=i.split("#")[0]}n.startsWith("http")&&(i=n),i.endsWith("/")&&(i=i.slice(0,-1));const r=d=>d.includes("?")?`${d}&t=${t??0}`:`${d}?t=${t??0}`,c=o.allInOne?[await fetch(r(i))]:[await fetch(r(`${i}/config.json`)),await fetch(r(`${i}/team.json`)),await fetch(r(`${i}/run.json`))],{status:b,statusText:g}=c[0];if(b>=300||b<200)throw new Error(`fetch data failed. [status=${b}] [statusText=${g}]`);return Promise.all(c.map(d=>d.json())).then(d=>o.allInOne?d[0]:{contest:d[0],teams:d[1],submissions:d[2]})}function Gt(n,t,s=!1){let i=3e4,o=i;const r=mt(()=>Math.floor(t.value.getTime()/1e3/10));return xt.value==="I18N"&&(i=10*1e3,o=i),s&&(i=Number.POSITIVE_INFINITY,o=!1),_t({queryKey:[n,r.value],queryFn:()=>Nt(n,r.value),retry:kt,staleTime:i,refetchInterval:o})}function Yt(){return vt("data-source","",{transform:String})}function Ht(){return vt("battle-of-giants","",{transform:String})}export{Ht as a,Yt as g,Gt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as p}from"./TheInput.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as p}from"./TheInput.vue_vue_type_script_setup_true_lang-C80810Iu.js";import{d as c,p as f,H as _,u as b,o as h,c as v,b as e,k as a,h as s,a as x,z as y,O as g}from"./index-BSdw3fii.js";import{u as k}from"./user-DCOj5vXR.js";import{b as l}from"./route-block-B_A1xBdJ.js";import"./use-vmodel-dRzus2DH.js";const V={flex:"","flex-col":"","justify-center":"","items-center":""},w={"text-sm":"","opacity-75":""},I={"w-48":""},B={class:"hidden",for:"input"},C=["disabled"],N=c({name:"IndexPage",__name:"test",setup(R){const i=k(),o=f(i.savedName),u=_();function r(){o.value&&u.push(`/hi/${encodeURIComponent(o.value)}`)}const{t:n}=b();return(U,t)=>{const d=p;return h(),v("div",V,[t[1]||(t[1]=e("div",{"text-4xl":""},[e("div",{"i-carbon-campsite":""})],-1)),t[2]||(t[2]=e("p",null,[e("a",{rel:"noreferrer",href:"https://github.com/antfu/vitesse",target:"_blank"}," Vitesse ")],-1)),e("p",null,[e("em",w,a(s(n)("intro.desc")),1)]),t[3]||(t[3]=e("div",{"py-4":""},null,-1)),e("div",I,[x(d,{modelValue:s(o),"onUpdate:modelValue":t[0]||(t[0]=m=>y(o)?o.value=m:null),placeholder:s(n)("intro.whats-your-name"),autocomplete:"false",onKeydown:g(r,["enter"])},null,8,["modelValue","placeholder"]),e("label",B,a(s(n)("intro.whats-your-name")),1)]),e("div",null,[e("button",{"m-3":"","text-sm":"",btn:"",disabled:!s(o),onClick:r},a(s(n)("button.go")),9,C)])])}}});typeof l=="function"&&l(N);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aw as c,ax as r}from"./index-
|
|
1
|
+
import{aw as c,ax as r}from"./index-BSdw3fii.js";const d=(...p)=>{const s=c().proxy.$props,t=Object.create(null);for(const e of p)if(typeof e=="string")t[e]=r(s,e,void 0,{eventName:`update:${e}`,passive:!0});else{const[o,n=o,a=`update:${o}`,u={}]=e;t[o]=r(s,n,void 0,{eventName:a,passive:!0,...u})}return t};export{d as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{au as m,p as r,g as t}from"./index-
|
|
1
|
+
import{au as m,p as r,g as t}from"./index-BSdw3fii.js";const l=m("user",()=>{const e=r(""),s=r(new Set),u=t(()=>Array.from(s.value)),o=t(()=>u.value.filter(a=>a!==e.value));function n(a){e.value&&s.value.add(e.value),e.value=a}return{setNewName:n,otherNames:o,savedName:e}});export{l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as u}from"./index-
|
|
1
|
+
import{_ as u}from"./index-BSdw3fii.js";function _(c={}){const{immediate:o=!1,onNeedRefresh:p,onOfflineReady:a,onRegistered:r,onRegisteredSW:s,onRegisterError:t}=c;let i,n;const d=async(e=!0)=>{await n};async function l(){if("serviceWorker"in navigator){if(i=await u(async()=>{const{Workbox:e}=await import("./workbox-window.prod.es5-D5gOYdM7.js");return{Workbox:e}},[],import.meta.url).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{t==null||t(e)}),!i)return;i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||a==null||a()}),i.register({immediate:o}).then(e=>{s?s("/sw.js",e):r==null||r(e)}).catch(e=>{t==null||t(e)})}}return n=l(),d}export{_ as registerSW};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={button:{about:{t:0,b:{t:2,i:[{t:3}],s:"关于"}},back:{t:0,b:{t:2,i:[{t:3}],s:"返回"}},go:{t:0,b:{t:2,i:[{t:3}],s:"确定"}},home:{t:0,b:{t:2,i:[{t:3}],s:"首页"}},confirm:{t:0,b:{t:2,i:[{t:3}],s:"确认"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},toggle_dark:{t:0,b:{t:2,i:[{t:3}],s:"切换深色模式"}},toggle_langs:{t:0,b:{t:2,i:[{t:3}],s:"切换语言"}}},intro:{desc:{t:0,b:{t:2,i:[{t:3}],s:"固执己见的 Vite 项目模板"}},"dynamic-route":{t:0,b:{t:2,i:[{t:3}],s:"动态路由演示"}},hi:{t:0,b:{t:2,i:[{t:3,v:"你好,"},{t:4,k:"name"}]}},aka:{t:0,b:{t:2,i:[{t:3}],s:"也叫"}},"whats-your-name":{t:0,b:{t:2,i:[{t:3}],s:"输入你的名字"}}},"not-found":{t:0,b:{t:2,i:[{t:3}],s:"未找到页面"}},common:{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},colon:{t:0,b:{t:2,i:[{t:3}],s:":"}}},index:{start:{t:0,b:{t:2,i:[{t:3}],s:"开始时间"}},duration:{t:0,b:{t:2,i:[{t:3}],s:"持续时长"}}},type_menu:{rank:{t:0,b:{t:2,i:[{t:3}],s:"排名"}},submissions:{t:0,b:{t:2,i:[{t:3}],s:"提交"}},statistics:{t:0,b:{t:2,i:[{t:3}],s:"统计"}},balloon:{t:0,b:{t:2,i:[{t:3}],s:"气球"}},export:{t:0,b:{t:2,i:[{t:3}],s:"导出"}},resolver:{t:0,b:{t:2,i:[{t:3}],s:"滚榜"}},options:{t:0,b:{t:2,i:[{t:3}],s:"选项"}},awards:{t:0,b:{t:2,i:[{t:3}],s:"奖项"}},utility:{t:0,b:{t:2,i:[{t:3}],s:"工具"}},countdown:{t:0,b:{t:2,i:[{t:3}],s:"倒计时"}}},standings:{start_time:{t:0,b:{t:2,i:[{t:3}],s:"开始时间"}},end_time:{t:0,b:{t:2,i:[{t:3}],s:"结束时间"}},elapsed:{t:0,b:{t:2,i:[{t:3}],s:"当前时间"}},remaining:{t:0,b:{t:2,i:[{t:3}],s:"剩余时间"}},place:{t:0,b:{t:2,i:[{t:3}],s:"Place"}},team:{t:0,b:{t:2,i:[{t:3}],s:"Team"}},solved:{t:0,b:{t:2,i:[{t:3}],s:"Solved"}},penalty:{t:0,b:{t:2,i:[{t:3}],s:"Penalty"}},dirt:{t:0,b:{t:2,i:[{t:3}],s:"Dirt"}},se:{t:0,b:{t:2,i:[{t:3}],s:"SE"}},statistics:{submitted:{t:0,b:{t:2,i:[{t:3}],s:"Submitted"}},attempted:{t:0,b:{t:2,i:[{t:3}],s:"Attempted"}},accepted:{t:0,b:{t:2,i:[{t:3}],s:"Accepted"}},dirt:{t:0,b:{t:2,i:[{t:3}],s:"Dirt"}},se:{t:0,b:{t:2,i:[{t:3}],s:"SE"}},first_solved:{t:0,b:{t:2,i:[{t:3}],s:"First Solved"}},last_solved:{t:0,b:{t:2,i:[{t:3}],s:"Last Solved"}},head_data:{problems:{t:0,b:{t:2,i:[{t:3}],s:"题目数"}},teams:{t:0,b:{t:2,i:[{t:3}],s:"队伍数"}},submissions:{t:0,b:{t:2,i:[{t:3}],s:"提交数"}}}},options:{calculation_of_penalty:{t:0,b:{t:2,i:[{t:3}],s:"罚时计算方式"}},in_minutes:{t:0,b:{t:2,i:[{t:3}],s:"精确到分钟进行累加"}},in_seconds:{t:0,b:{t:2,i:[{t:3}],s:"精确到秒进行累加"}},accumulate_in_seconds_and_finally_to_the_minute:{t:0,b:{t:2,i:[{t:3}],s:"精确到秒进行累加,最后精确到分钟"}}}},submissions:{total_submissions:{t:0,b:{t:2,i:[{t:3}],s:"总提交数"}}}};export{t as default};
|
|
1
|
+
const t={button:{about:{t:0,b:{t:2,i:[{t:3}],s:"关于"}},back:{t:0,b:{t:2,i:[{t:3}],s:"返回"}},go:{t:0,b:{t:2,i:[{t:3}],s:"确定"}},home:{t:0,b:{t:2,i:[{t:3}],s:"首页"}},confirm:{t:0,b:{t:2,i:[{t:3}],s:"确认"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},toggle_dark:{t:0,b:{t:2,i:[{t:3}],s:"切换深色模式"}},toggle_langs:{t:0,b:{t:2,i:[{t:3}],s:"切换语言"}}},intro:{desc:{t:0,b:{t:2,i:[{t:3}],s:"固执己见的 Vite 项目模板"}},"dynamic-route":{t:0,b:{t:2,i:[{t:3}],s:"动态路由演示"}},hi:{t:0,b:{t:2,i:[{t:3,v:"你好,"},{t:4,k:"name"}]}},aka:{t:0,b:{t:2,i:[{t:3}],s:"也叫"}},"whats-your-name":{t:0,b:{t:2,i:[{t:3}],s:"输入你的名字"}}},"not-found":{t:0,b:{t:2,i:[{t:3}],s:"未找到页面"}},common:{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},colon:{t:0,b:{t:2,i:[{t:3}],s:":"}}},index:{start:{t:0,b:{t:2,i:[{t:3}],s:"开始时间"}},duration:{t:0,b:{t:2,i:[{t:3}],s:"持续时长"}}},type_menu:{rank:{t:0,b:{t:2,i:[{t:3}],s:"排名"}},submissions:{t:0,b:{t:2,i:[{t:3}],s:"提交"}},statistics:{t:0,b:{t:2,i:[{t:3}],s:"统计"}},balloon:{t:0,b:{t:2,i:[{t:3}],s:"气球"}},export:{t:0,b:{t:2,i:[{t:3}],s:"导出"}},resolver:{t:0,b:{t:2,i:[{t:3}],s:"滚榜"}},options:{t:0,b:{t:2,i:[{t:3}],s:"选项"}},awards:{t:0,b:{t:2,i:[{t:3}],s:"奖项"}},utility:{t:0,b:{t:2,i:[{t:3}],s:"工具"}},countdown:{t:0,b:{t:2,i:[{t:3}],s:"倒计时"}}},standings:{start_time:{t:0,b:{t:2,i:[{t:3}],s:"开始时间"}},end_time:{t:0,b:{t:2,i:[{t:3}],s:"结束时间"}},elapsed:{t:0,b:{t:2,i:[{t:3}],s:"当前时间"}},remaining:{t:0,b:{t:2,i:[{t:3}],s:"剩余时间"}},place:{t:0,b:{t:2,i:[{t:3}],s:"Place"}},team:{t:0,b:{t:2,i:[{t:3}],s:"Team"}},solved:{t:0,b:{t:2,i:[{t:3}],s:"Solved"}},penalty:{t:0,b:{t:2,i:[{t:3}],s:"Penalty"}},dirt:{t:0,b:{t:2,i:[{t:3}],s:"Dirt"}},se:{t:0,b:{t:2,i:[{t:3}],s:"SE"}},statistics:{submitted:{t:0,b:{t:2,i:[{t:3}],s:"Submitted"}},attempted:{t:0,b:{t:2,i:[{t:3}],s:"Attempted"}},accepted:{t:0,b:{t:2,i:[{t:3}],s:"Accepted"}},dirt:{t:0,b:{t:2,i:[{t:3}],s:"Dirt"}},se:{t:0,b:{t:2,i:[{t:3}],s:"SE"}},first_solved:{t:0,b:{t:2,i:[{t:3}],s:"First Solved"}},last_solved:{t:0,b:{t:2,i:[{t:3}],s:"Last Solved"}},head_data:{problems:{t:0,b:{t:2,i:[{t:3}],s:"题目数"}},teams:{t:0,b:{t:2,i:[{t:3}],s:"队伍数"}},submissions:{t:0,b:{t:2,i:[{t:3}],s:"提交数"}}},submit_heatmap:{t:0,b:{t:2,i:[{t:3}],s:"提交热力图"}}},options:{calculation_of_penalty:{t:0,b:{t:2,i:[{t:3}],s:"罚时计算方式"}},in_minutes:{t:0,b:{t:2,i:[{t:3}],s:"精确到分钟进行累加"}},in_seconds:{t:0,b:{t:2,i:[{t:3}],s:"精确到秒进行累加"}},accumulate_in_seconds_and_finally_to_the_minute:{t:0,b:{t:2,i:[{t:3}],s:"精确到秒进行累加,最后精确到分钟"}}}},submissions:{total_submissions:{t:0,b:{t:2,i:[{t:3}],s:"总提交数"}}}};export{t as default};
|
package/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.54.0/dist/balloon-192x192.png"><link rel="mask-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.54.0/dist/balloon-512x512.svg" color="#00aba9"><meta name="msapplication-TileColor" content="#00aba9"><script>function normalizePath(_){for(;_.endsWith("/");)_=_.slice(0,-1);return`${_}/`}{let _="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.54.0/dist";_=normalizePath(_),window.CDN_HOST=_,window.__toAssetUrl=_=>window.CDN_HOST+_}try{let _=__DATA_HOST__;_=normalizePath(_),window.DATA_HOST=_}catch(_){window.DATA_HOST="/data/"}try{let _=__DATA_REGION__;window.DATA_REGION=_}catch(_){window.DATA_REGION="CN"}try{let _=__DEFAULT_LANG__;window.DEFAULT_LANG=_}catch(_){window.DEFAULT_LANG="en"}</script><script>!function(){localStorage.getItem("vueuse-color-scheme")||localStorage.setItem("vueuse-color-scheme","light");const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,o=localStorage.getItem("vueuse-color-scheme")||"auto";("dark"===o||e&&"light"!==o)&&document.documentElement.classList.toggle("dark",!0)}()</script><script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.54.0/dist/assets/index-BSdw3fii.js"></script><link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.54.0/dist/assets/index-BybaF8un.css"><link rel="manifest" href="/manifest.webmanifest"></head><body class="font-sans"><div id="app"></div><noscript>This website requires JavaScript to function properly. Please enable JavaScript to continue.</noscript><script>try{var umamiJSUrl=__UMAMI_JS_URL__,umamiWebsiteId=__UMAMI_WEBSITE_ID__;!function(){var e=document.createElement("script");e.src=umamiJSUrl,e.defer=!0,e.setAttribute("data-website-id",umamiWebsiteId);var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var plausibleJSUrl=__PLAUSIBLE_JS_URL__,plausibleDataDomain=__PLAUSIBLE_DATA_DOMAIN__;!function(){var e=document.createElement("script");e.src=plausibleJSUrl,e.defer=!0,e.setAttribute("data-domain",plausibleDataDomain);var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var baiduAnalyticsId=__BAIDU_ANALYTICS_ID__,_hmt=_hmt||[];!function(){var e=document.createElement("script");e.src=`https://hm.baidu.com/hm.js?${baiduAnalyticsId}`;var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var googleAnalyticsId=__GOOGLE_ANALYTICS_ID__;!function(){var e,t,a,r,c,n;location.port||(e=window,t=document,a="script",r="ga",e.GoogleAnalyticsObject=r,e[r]=e[r]||function(){(e[r].q=e[r].q||[]).push(arguments)},e[r].l=1*new Date,c=t.createElement(a),n=t.getElementsByTagName(a)[0],c.async=1,c.src="//www.google-analytics.com/analytics.js",n.parentNode.insertBefore(c,n),ga("create",`${googleAnalyticsId}`,"auto"),ga("send","pageview"))}()}catch(e){}</script></body></html>
|
package/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(n,
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const t=s=>l(s,r),o={module:{uri:r},exports:u,require:t};e[r]=Promise.all(n.map((s=>o[s]||t(s)))).then((s=>(i(...s),u)))}}define(["./workbox-86deb690"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/_..-8Wh-Y8sB.css",revision:null},{url:"assets/_...all_-B-coFtNQ.js",revision:null},{url:"assets/_...all_-D2j5jZRJ.js",revision:null},{url:"assets/_name_-DLnWsOOY.js",revision:null},{url:"assets/_plugin-vue_export-helper-DlAUqK2U.js",revision:null},{url:"assets/about-BI-IuMMG.js",revision:null},{url:"assets/Balloon.vue_vue_type_script_setup_true_lang-B58P9kc_.js",revision:null},{url:"assets/board-CYpV6N1-.js",revision:null},{url:"assets/Board-DzGFyq7Y.js",revision:null},{url:"assets/Board-gJRXyNvZ.css",revision:null},{url:"assets/board-layout-iqYyMbo7.js",revision:null},{url:"assets/constant-Bp6N_6CR.js",revision:null},{url:"assets/ContestStateBadge-kyzEE_y0.js",revision:null},{url:"assets/ContestStateBadge-yOXRkC0c.css",revision:null},{url:"assets/Countdown-De6dfmWB.css",revision:null},{url:"assets/Countdown-VhHt93-Y.js",revision:null},{url:"assets/DataSourceInput.vue_vue_type_script_setup_true_lang-ItvHR9Qe.js",revision:null},{url:"assets/default-Dua7zuJz.js",revision:null},{url:"assets/en-Bjc9Zdq9.js",revision:null},{url:"assets/Footer.vue_vue_type_script_setup_true_lang-CFhhwrFp.js",revision:null},{url:"assets/headless-TXjG73-A.js",revision:null},{url:"assets/home-BICvykpJ.js",revision:null},{url:"assets/index-aqsbX7cA.js",revision:null},{url:"assets/index-BerApwlM.css",revision:null},{url:"assets/index-BjviE8XK.js",revision:null},{url:"assets/index-BP90wE2A.css",revision:null},{url:"assets/index-BSdw3fii.js",revision:null},{url:"assets/index-BuqFZWN0.js",revision:null},{url:"assets/index-BybaF8un.css",revision:null},{url:"assets/index-Cc06bvsk.js",revision:null},{url:"assets/index-CElS_fcG.js",revision:null},{url:"assets/index-D5y2RQEx.js",revision:null},{url:"assets/index-DfYfbXG4.js",revision:null},{url:"assets/index-layout-CuYu1LJW.js",revision:null},{url:"assets/index-shmFGiVI.js",revision:null},{url:"assets/NavBar-D-0E9-D6.js",revision:null},{url:"assets/NavBar-K1-1c5jR.css",revision:null},{url:"assets/pagination-BeE7gsif.js",revision:null},{url:"assets/query-D-g5Deb_.js",revision:null},{url:"assets/Resolver-Dm29vdoV.js",revision:null},{url:"assets/Resolver-DRiWpQTB.css",revision:null},{url:"assets/RightArrowIcon-DkTO5M_b.js",revision:null},{url:"assets/route-block-B_A1xBdJ.js",revision:null},{url:"assets/test-j9jx5ZPp.js",revision:null},{url:"assets/TheInput.vue_vue_type_script_setup_true_lang-C80810Iu.js",revision:null},{url:"assets/Tooltip-VVqtpO6L.css",revision:null},{url:"assets/Tooltip.vue_vue_type_script_setup_true_lang-CivUau2c.js",revision:null},{url:"assets/use-vmodel-dRzus2DH.js",revision:null},{url:"assets/user-DCOj5vXR.js",revision:null},{url:"assets/virtual_pwa-register-DYmC-FJF.js",revision:null},{url:"assets/workbox-window.prod.es5-D5gOYdM7.js",revision:null},{url:"assets/zh-CN-BgAN9IOl.js",revision:null},{url:"index.html",revision:"aae2cc4dbd8b921b56ba792f646c7c96"},{url:"balloon2-192x192.png",revision:"c857ae6d9dfae118ab4397d4358422bd"},{url:"balloon2-512x512.png",revision:"065594f4f743fe3884793c03d3fe7d9e"},{url:"favicon.svg",revision:"5a744f4ccbb122d4a0575be779ddcd43"},{url:"safari-pinned-tab.svg",revision:"5eaf74d1c43d30e0af743b68a3f48504"},{url:"manifest.webmanifest",revision:"3082e8d8ebc9619c6c1055ff243a02a8"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/board-app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.54.0",
|
|
5
5
|
"description": "XCPCIO Board App",
|
|
6
6
|
"author": "Dup4 <lyuzhi.pan@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"vue-router": "^4.4.5",
|
|
55
55
|
"vue-search-select": "^3.2.0",
|
|
56
56
|
"vue-toast-notification": "^3.1.3",
|
|
57
|
-
"@xcpcio/core": "0.
|
|
58
|
-
"@xcpcio/types": "0.
|
|
57
|
+
"@xcpcio/core": "0.54.0",
|
|
58
|
+
"@xcpcio/types": "0.54.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@antfu/eslint-config": "^3.7.3",
|
package/src/auto-imports.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare global {
|
|
|
17
17
|
const RATING_DATA_HOST: typeof import('./composables/constant')['RATING_DATA_HOST']
|
|
18
18
|
const RATING_TITLE_SUFFIX: typeof import('./composables/constant')['RATING_TITLE_SUFFIX']
|
|
19
19
|
const RESOLVER_TITLE_SUFFIX: typeof import('./composables/constant')['RESOLVER_TITLE_SUFFIX']
|
|
20
|
+
const SUBMISSION_TITLE_SUFFIX: typeof import('./composables/constant')['SUBMISSION_TITLE_SUFFIX']
|
|
20
21
|
const TITLE_SUFFIX: typeof import('./composables/constant')['TITLE_SUFFIX']
|
|
21
22
|
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
|
|
22
23
|
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
|
|
@@ -354,6 +355,7 @@ declare module 'vue' {
|
|
|
354
355
|
readonly RATING_DATA_HOST: UnwrapRef<typeof import('./composables/constant')['RATING_DATA_HOST']>
|
|
355
356
|
readonly RATING_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['RATING_TITLE_SUFFIX']>
|
|
356
357
|
readonly RESOLVER_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['RESOLVER_TITLE_SUFFIX']>
|
|
358
|
+
readonly SUBMISSION_TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['SUBMISSION_TITLE_SUFFIX']>
|
|
357
359
|
readonly TITLE_SUFFIX: UnwrapRef<typeof import('./composables/constant')['TITLE_SUFFIX']>
|
|
358
360
|
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
|
|
359
361
|
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.tooltip-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tooltip {
|
|
7
|
+
position: absolute;
|
|
8
|
+
padding: 8px 12px;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
line-height: 1.4;
|
|
12
|
+
text-align: center;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
visibility: hidden;
|
|
15
|
+
transition: opacity 0.3s, visibility 0.3s;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
background-color: #1f2937;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dark.tooltip {
|
|
23
|
+
background-color: #374151;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tooltip.visible {
|
|
27
|
+
opacity: 1;
|
|
28
|
+
visibility: visible;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tooltip::after {
|
|
32
|
+
content: '';
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 0;
|
|
35
|
+
height: 0;
|
|
36
|
+
border: 6px solid transparent;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tooltip.top {
|
|
40
|
+
bottom: 100%;
|
|
41
|
+
left: 50%;
|
|
42
|
+
transform: translateX(-50%) translateY(-5px);
|
|
43
|
+
margin-bottom: 5px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.tooltip.top::after {
|
|
47
|
+
top: 100%;
|
|
48
|
+
left: 50%;
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
border-top-color: #1f2937;
|
|
51
|
+
border-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dark.tooltip.top::after {
|
|
55
|
+
border-top-color: #374151;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.tooltip.bottom {
|
|
59
|
+
top: 100%;
|
|
60
|
+
left: 50%;
|
|
61
|
+
transform: translateX(-50%) translateY(5px);
|
|
62
|
+
margin-top: 5px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.tooltip.bottom::after {
|
|
66
|
+
bottom: 100%;
|
|
67
|
+
left: 50%;
|
|
68
|
+
transform: translateX(-50%);
|
|
69
|
+
border-bottom-color: #1f2937;
|
|
70
|
+
border-top: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dark.tooltip.bottom::after {
|
|
74
|
+
border-bottom-color: #374151;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.tooltip.left {
|
|
78
|
+
right: 100%;
|
|
79
|
+
top: 50%;
|
|
80
|
+
transform: translateY(-50%) translateX(-5px);
|
|
81
|
+
margin-right: 5px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.tooltip.left::after {
|
|
85
|
+
left: 100%;
|
|
86
|
+
top: 50%;
|
|
87
|
+
transform: translateY(-50%);
|
|
88
|
+
border-left-color: #1f2937;
|
|
89
|
+
border-right: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.dark.tooltip.left::after {
|
|
93
|
+
border-left-color: #374151;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.tooltip.right {
|
|
97
|
+
left: 100%;
|
|
98
|
+
top: 50%;
|
|
99
|
+
transform: translateY(-50%) translateX(5px);
|
|
100
|
+
margin-left: 5px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.tooltip.right::after {
|
|
104
|
+
right: 100%;
|
|
105
|
+
top: 50%;
|
|
106
|
+
transform: translateY(-50%);
|
|
107
|
+
border-right-color: #1f2937;
|
|
108
|
+
border-left: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.dark.tooltip.right::after {
|
|
112
|
+
border-right-color: #374151;
|
|
113
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
content: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: "",
|
|
6
|
+
},
|
|
7
|
+
position: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "top",
|
|
10
|
+
validator: (value: string) => ["top", "right", "bottom", "left"].includes(value),
|
|
11
|
+
},
|
|
12
|
+
delay: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 100,
|
|
15
|
+
},
|
|
16
|
+
textColor: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "#fff",
|
|
19
|
+
},
|
|
20
|
+
width: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "auto",
|
|
23
|
+
},
|
|
24
|
+
zIndex: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 1000,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const isVisible = ref(false);
|
|
31
|
+
let timeoutId: ReturnType<typeof setTimeout>;
|
|
32
|
+
|
|
33
|
+
const tooltipStyle = computed(() => ({
|
|
34
|
+
color: props.textColor,
|
|
35
|
+
width: props.width,
|
|
36
|
+
zIndex: props.zIndex,
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
function showTooltip() {
|
|
40
|
+
clearTimeout(timeoutId);
|
|
41
|
+
timeoutId = setTimeout(() => {
|
|
42
|
+
isVisible.value = true;
|
|
43
|
+
}, props.delay);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function hideTooltip() {
|
|
47
|
+
clearTimeout(timeoutId);
|
|
48
|
+
isVisible.value = false;
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<div class="tooltip-container" @mouseenter="showTooltip" @mouseleave="hideTooltip">
|
|
54
|
+
<slot />
|
|
55
|
+
<div
|
|
56
|
+
class="tooltip"
|
|
57
|
+
:class="[position, { visible: isVisible }]"
|
|
58
|
+
:style="tooltipStyle"
|
|
59
|
+
>
|
|
60
|
+
{{ content }}
|
|
61
|
+
<slot name="tooltip-content" />
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<style scoped lang="less">
|
|
67
|
+
@import "./HeatMapTooltip.less";
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@correct-colors: #9be9a8, #40c463, #30a14e, #216e39;
|
|
2
|
+
@incorrect-colors: #ff8c8c, #ff4d4f, #ff1a1a, #d40d0d;
|
|
3
|
+
|
|
4
|
+
.generate-heat-rules(@class, @colors) {
|
|
5
|
+
each(@colors, {
|
|
6
|
+
.@{class}[data-level="@{index}"] {
|
|
7
|
+
background-color: @value;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.generate-heat-rules(correct-heat, @correct-colors);
|
|
13
|
+
.generate-heat-rules(incorrect-heat, @incorrect-colors);
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { isAccepted, isRejected, type Rank } from "@xcpcio/core";
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
rank: Rank;
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
|
|
10
|
+
const rank = computed(() => props.rank);
|
|
11
|
+
|
|
12
|
+
const mapTimeDiffLength = 20;
|
|
13
|
+
const startTime = rank.value.contest.getStartTime();
|
|
14
|
+
const endTime = rank.value.contest.getEndTime();
|
|
15
|
+
const totalDuration = endTime.diff(startTime, "minute");
|
|
16
|
+
const intervalSize = totalDuration / mapTimeDiffLength;
|
|
17
|
+
|
|
18
|
+
const submissions = computed(() => rank.value.getSubmissions());
|
|
19
|
+
|
|
20
|
+
const intervalDescriptions = Array.from({ length: mapTimeDiffLength }, (_, index) => {
|
|
21
|
+
const start = index * intervalSize;
|
|
22
|
+
const end = (index + 1) * intervalSize;
|
|
23
|
+
return `Between ${start} and ${end} minutes: `;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const submissionsByProblemId = computed(() => {
|
|
27
|
+
const result = new Map();
|
|
28
|
+
|
|
29
|
+
rank.value.contest.problems.forEach((p) => {
|
|
30
|
+
result.set(p.id, { correct: [], incorrect: [] });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
submissions.value.forEach((s) => {
|
|
34
|
+
const entry = result.get(s.problemId);
|
|
35
|
+
if (!entry) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (isAccepted(s.status)) {
|
|
40
|
+
entry.correct.push(s);
|
|
41
|
+
} else if (isRejected(s.status)) {
|
|
42
|
+
entry.incorrect.push(s);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return result;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
function generateHeatMap(submissions: Map<any, any>, type: "correct" | "incorrect") {
|
|
50
|
+
const counts = Array.from<number>({ length: mapTimeDiffLength }).fill(0);
|
|
51
|
+
|
|
52
|
+
submissions.forEach((s) => {
|
|
53
|
+
const index = Math.min(Math.floor(s.timestampToMinute / intervalSize), mapTimeDiffLength - 1);
|
|
54
|
+
counts[index]++;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return counts.map((count, i) => ({
|
|
58
|
+
count,
|
|
59
|
+
level: 0,
|
|
60
|
+
description: `${intervalDescriptions[i]}${count} ${type} submissions`,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function calcPreciseQuan(sortedValues: number[], p: number): number {
|
|
65
|
+
if (sortedValues.length === 0) {
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const position = (sortedValues.length - 1) * p;
|
|
70
|
+
const index = Math.floor(position);
|
|
71
|
+
const fraction = position - index;
|
|
72
|
+
|
|
73
|
+
if (sortedValues[index + 1] !== undefined) {
|
|
74
|
+
return sortedValues[index] + fraction * (sortedValues[index + 1] - sortedValues[index]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return sortedValues[index];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function calcStaticThresholds(counts: number[]) {
|
|
81
|
+
const nonZeroCounts = counts.filter(c => c > 0);
|
|
82
|
+
|
|
83
|
+
if (nonZeroCounts.length === 0) {
|
|
84
|
+
return [0, 0, 0, 0, 0];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const sorted = [...nonZeroCounts].sort((a, b) => a - b);
|
|
88
|
+
|
|
89
|
+
return [
|
|
90
|
+
0,
|
|
91
|
+
calcPreciseQuan(sorted, 0.2),
|
|
92
|
+
calcPreciseQuan(sorted, 0.4),
|
|
93
|
+
calcPreciseQuan(sorted, 0.6),
|
|
94
|
+
calcPreciseQuan(sorted, 0.8),
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function getDynamicHeatLevel(value: number, thresholds: number[]): number {
|
|
99
|
+
for (let i = thresholds.length - 1; i >= 0; i--) {
|
|
100
|
+
if (value === 0) {
|
|
101
|
+
return 0;
|
|
102
|
+
} else if (value >= thresholds[i]) {
|
|
103
|
+
return i;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const heatMapData = computed(() =>
|
|
110
|
+
rank.value.contest.problems.map((p) => {
|
|
111
|
+
const { correct, incorrect } = submissionsByProblemId.value.get(p.id)!;
|
|
112
|
+
|
|
113
|
+
const correctHeatMap = generateHeatMap(correct, "correct");
|
|
114
|
+
const incorrectHeatMap = generateHeatMap(incorrect, "incorrect");
|
|
115
|
+
|
|
116
|
+
const correctCounts = correctHeatMap.map(i => i.count);
|
|
117
|
+
const correctThresholds = calcStaticThresholds(correctCounts);
|
|
118
|
+
|
|
119
|
+
const incorrectCounts = incorrectHeatMap.map(i => i.count);
|
|
120
|
+
const incorrectThresholds = calcStaticThresholds(incorrectCounts);
|
|
121
|
+
|
|
122
|
+
correctHeatMap.forEach(i => i.level = getDynamicHeatLevel(i.count, correctThresholds));
|
|
123
|
+
incorrectHeatMap.forEach(i => i.level = getDynamicHeatLevel(i.count, incorrectThresholds));
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
label: p.label,
|
|
127
|
+
balloonColor: p.balloonColor,
|
|
128
|
+
correctHeatMap,
|
|
129
|
+
incorrectHeatMap,
|
|
130
|
+
};
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
133
|
+
</script>
|
|
134
|
+
|
|
135
|
+
<template>
|
|
136
|
+
<div flex flex-col mb-8>
|
|
137
|
+
<span
|
|
138
|
+
text-align-center
|
|
139
|
+
text-size-lg
|
|
140
|
+
font-semibold
|
|
141
|
+
mb-8
|
|
142
|
+
>
|
|
143
|
+
{{ t("standings.statistics.submit_heatmap") }}
|
|
144
|
+
</span>
|
|
145
|
+
|
|
146
|
+
<div
|
|
147
|
+
grid grid-cols-3
|
|
148
|
+
gap-10 space-y-0
|
|
149
|
+
place-items-center
|
|
150
|
+
>
|
|
151
|
+
<div
|
|
152
|
+
v-for="heatMap in heatMapData" :key="heatMap.label"
|
|
153
|
+
class="w-350px h-100px"
|
|
154
|
+
flex flex-col
|
|
155
|
+
items-center justify-center
|
|
156
|
+
border border-gray-100 dark:border-gray-600
|
|
157
|
+
rounded-md
|
|
158
|
+
shadow
|
|
159
|
+
>
|
|
160
|
+
<div
|
|
161
|
+
mb-1
|
|
162
|
+
size-30px
|
|
163
|
+
flex
|
|
164
|
+
justify-center items-center
|
|
165
|
+
rounded-md
|
|
166
|
+
:style="{ backgroundColor: heatMap.balloonColor.background_color, color: heatMap.balloonColor.color }"
|
|
167
|
+
>
|
|
168
|
+
<span text-size-lg font-semibold>
|
|
169
|
+
{{ heatMap.label }}
|
|
170
|
+
</span>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div
|
|
174
|
+
flex flex-row
|
|
175
|
+
gap-1
|
|
176
|
+
>
|
|
177
|
+
<div
|
|
178
|
+
v-for="(correctItem, index) in heatMap.correctHeatMap" :key="`correct-${index}`"
|
|
179
|
+
>
|
|
180
|
+
<HeatMapTooltip
|
|
181
|
+
:content="correctItem.description"
|
|
182
|
+
position="top"
|
|
183
|
+
>
|
|
184
|
+
<div
|
|
185
|
+
:data-level="correctItem.level"
|
|
186
|
+
class="correct-heat"
|
|
187
|
+
size-12px
|
|
188
|
+
rounded-1
|
|
189
|
+
shadow
|
|
190
|
+
border border-gray-100 dark:border-gray-600
|
|
191
|
+
/>
|
|
192
|
+
<template #popper>
|
|
193
|
+
<div
|
|
194
|
+
flex
|
|
195
|
+
>
|
|
196
|
+
<div>
|
|
197
|
+
{{ correctItem.description }}
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</template>
|
|
201
|
+
</HeatMapTooltip>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<div
|
|
206
|
+
flex flex-row
|
|
207
|
+
gap-1
|
|
208
|
+
>
|
|
209
|
+
<div
|
|
210
|
+
v-for="(incorrectItem, index) in heatMap.incorrectHeatMap" :key="`incorrect-${index}`"
|
|
211
|
+
>
|
|
212
|
+
<HeatMapTooltip
|
|
213
|
+
:content="incorrectItem.description"
|
|
214
|
+
position="top"
|
|
215
|
+
>
|
|
216
|
+
<div
|
|
217
|
+
:data-level="incorrectItem.level"
|
|
218
|
+
class="incorrect-heat"
|
|
219
|
+
size-12px
|
|
220
|
+
rounded-1
|
|
221
|
+
shadow
|
|
222
|
+
border border-gray-100 dark:border-gray-600
|
|
223
|
+
/>
|
|
224
|
+
<template #popper>
|
|
225
|
+
<div
|
|
226
|
+
flex
|
|
227
|
+
>
|
|
228
|
+
<div>
|
|
229
|
+
{{ incorrectItem.description }}
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</template>
|
|
233
|
+
</HeatMapTooltip>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</template>
|
|
240
|
+
|
|
241
|
+
<style scoped lang="less">
|
|
242
|
+
@import "./SubmitHeatMap.less";
|
|
243
|
+
</style>
|
package/src/components.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ declare module 'vue' {
|
|
|
29
29
|
GiantsScoreBoard: typeof import('./components/battle-of-giants/GiantsScoreBoard.vue')['default']
|
|
30
30
|
GirlIcon: typeof import('./components/icon/GirlIcon.vue')['default']
|
|
31
31
|
GoBack: typeof import('./components/GoBack.vue')['default']
|
|
32
|
+
HeatMapTooltip: typeof import('./components/board/HeatMapTooltip.vue')['default']
|
|
32
33
|
Modal: typeof import('./components/board/Modal.vue')['default']
|
|
33
34
|
ModalMenu: typeof import('./components/board/ModalMenu.vue')['default']
|
|
34
35
|
NavBar: typeof import('./components/NavBar.vue')['default']
|
|
@@ -56,6 +57,7 @@ declare module 'vue' {
|
|
|
56
57
|
Statistics: typeof import('./components/board/Statistics.vue')['default']
|
|
57
58
|
SubmissionsTable: typeof import('./components/board/SubmissionsTable.vue')['default']
|
|
58
59
|
SubmissionsTableModal: typeof import('./components/board/SubmissionsTableModal.vue')['default']
|
|
60
|
+
SubmitHeatMap: typeof import('./components/board/SubmitHeatMap.vue')['default']
|
|
59
61
|
TablePagination: typeof import('./components/table/TablePagination.vue')['default']
|
|
60
62
|
TeamAwards: typeof import('./components/board/TeamAwards.vue')['default']
|
|
61
63
|
TeamInfoModal: typeof import('./components/board/TeamInfoModal.vue')['default']
|