From ffd0d98fd5baed2350302a81bb228f6b697cd418 Mon Sep 17 00:00:00 2001 From: SebastianGoeb Date: Fri, 29 Dec 2023 09:58:20 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Sebastia?= =?UTF-8?q?nGoeb/chinese-chart@3056f58a13a8e93709be05aeae45edf1bb6afcf4=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- assets/{index-6oTYUsDg.js => index-2yKMUUTb.js} | 2 +- index.html | 2 +- sw.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename assets/{index-6oTYUsDg.js => index-2yKMUUTb.js} (92%) diff --git a/404.html b/404.html index 1b30289..3c89090 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@ HSK Chart - + diff --git a/assets/index-6oTYUsDg.js b/assets/index-2yKMUUTb.js similarity index 92% rename from assets/index-6oTYUsDg.js rename to assets/index-2yKMUUTb.js index 95a7d2d..6b4c773 100644 --- a/assets/index-6oTYUsDg.js +++ b/assets/index-2yKMUUTb.js @@ -28,4 +28,4 @@ function print() { __p += __j.call(arguments, '') } `).slice(1).map(r=>{const[a,h,c,d,_]=r.split(" ");return{level:Number(a),no:Number(h),chinese:c,pinyin:d,english:_}})}function Yo(u){var r;const s=new Map;for(const a of u)s.has(a.level)||s.set(a.level,[]),(r=s.get(a.level))==null||r.push(a);return Array.from(s.entries()).map(([a,h])=>({level:a,words:h}))}async function rv(u){const s=await fetch(`word-frequencies/${u}.tsv`);return iv(await s.text())}function iv(u){return u.split(` `).map(s=>{const[r,a]=s.split(" ");return{word:r.trim(),frequency:Number(a)}})}function uv(u,s){let r=0;return s.map(a=>{const h=u.slice(r,Math.min(u.length,a)).map(c=>c.word);return r=a,{frequency:a,words:h}})}const sv=ye('

Compare

'),So=ye("
'),ov=ye('
'),lv=ye('');function av(u){return{name:String(u.level),words:u.words.map(s=>s.chinese)}}function cv(u){return{name:String(u.frequency),words:u.words}}const qt=[{name:"new_hsk",displayName:"New HSK",type:"hsk"},{name:"活着",displayName:"活着",type:"frequency"},{name:"subtlex",displayName:"Subtlex",type:"frequency"}],hv=[300,1e3,3e3,1e4,3e4,1e5];function dv(u,s){const r=new Map,a=u.flatMap(c=>c.words),h=s.flatMap(c=>c.words);return u.forEach(c=>{s.forEach(d=>{r.set(`${c.name}-${d.name}`,Kr.intersection(c.words,d.words))})}),u.forEach(c=>{r.set(`${c.name}-undefined`,Kr.difference(c.words,h))}),s.forEach(c=>{r.set(`undefined-${c.name}`,Kr.difference(c.words,a))}),r}function gv(){const u=new Map;qt.map(S=>{if(S.type==="hsk"){const[m]=Kt(zt.NEW,Zo,{initialValue:[]});u.set(S.name,()=>Yo(m()).map(av))}else{const[m]=Kt(S.name,rv,{initialValue:[]});u.set(S.name,()=>uv(m(),hv).map(cv))}});const[s,r]=Le(qt[0].name),[a,h]=Le(qt[0].name),c=ae(()=>{var S;return((S=u.get(s()))==null?void 0:S())??[]}),d=ae(()=>{var S;return((S=u.get(a()))==null?void 0:S())??[]}),_=ae(()=>dv(c(),d())),y=()=>{H1(()=>{const S=s();r(a()),h(S)})};return(()=>{const S=sv(),m=S.firstChild,R=m.nextSibling,O=R.firstChild,q=O.nextSibling,p=q.firstChild,b=q.nextSibling,T=R.nextSibling,Z=T.firstChild,W=Z.firstChild;W.firstChild;const P=Z.nextSibling;return O.addEventListener("change",$=>r($.target.value)),ue(O,ie(Mn,{each:qt,children:$=>(()=>{const N=So();return ue(N,()=>$.displayName),Ne(()=>N.value=$.name),N})()})),q.$$click=()=>y(),Gt(p,"src",ev),b.addEventListener("change",$=>h($.target.value)),ue(b,ie(Mn,{each:qt,children:$=>(()=>{const N=So();return ue(N,()=>$.displayName),Ne(()=>N.value=$.name),N})()})),ue(W,ie(Mn,{get each(){return[...d().map($=>$.name),void 0]},children:$=>(()=>{const N=fv();return ue(N,$??"n/a"),N})()}),null),ue(P,ie(Mn,{get each(){return[...c(),void 0]},children:$=>(()=>{const N=ov(),H=N.firstChild;return ue(H,()=>($==null?void 0:$.name)??"n/a"),ue(N,ie(Mn,{get each(){return[...d(),void 0]},children:Y=>(()=>{const M=lv();return ue(M,()=>{var F;return(F=_().get(($==null?void 0:$.name)+"-"+(Y==null?void 0:Y.name)))==null?void 0:F.length}),M})()}),null),N})()})),Ne(()=>O.value=s()),Ne(()=>b.value=a()),S})()}kn(["click"]);async function pv(u){const r=await(await fetch("new_hsk_anki_notes.tsv")).text(),a=new Map;return r.split(` `).forEach(h=>{const[c,d,_]=h.split(" "),y=c.split("")[0];a.set(y,Number(d))}),a}async function vv(u){const r=await(await fetch("old_hsk.tsv")).text(),a=new Map;return r.split(` -`).slice(1).forEach(h=>{const[c,d,_,y,S]=h.split(" ");Number(c)<=4&&a.set(_,1)}),a}const[Gr,_v]=Le(zt.NEW),[$u,Eo]=Le(100),[Iu,Ou]=Le(void 0);var Pu={exports:{}};(function(u,s){(function(r,a){var h={version:"3.0.1",x86:{},x64:{}};function c(p,b){return(p&65535)*b+(((p>>>16)*b&65535)<<16)}function d(p,b){return p<>>32-b}function _(p){return p^=p>>>16,p=c(p,2246822507),p^=p>>>13,p=c(p,3266489909),p^=p>>>16,p}function y(p,b){p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535],b=[b[0]>>>16,b[0]&65535,b[1]>>>16,b[1]&65535];var T=[0,0,0,0];return T[3]+=p[3]+b[3],T[2]+=T[3]>>>16,T[3]&=65535,T[2]+=p[2]+b[2],T[1]+=T[2]>>>16,T[2]&=65535,T[1]+=p[1]+b[1],T[0]+=T[1]>>>16,T[1]&=65535,T[0]+=p[0]+b[0],T[0]&=65535,[T[0]<<16|T[1],T[2]<<16|T[3]]}function S(p,b){p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535],b=[b[0]>>>16,b[0]&65535,b[1]>>>16,b[1]&65535];var T=[0,0,0,0];return T[3]+=p[3]*b[3],T[2]+=T[3]>>>16,T[3]&=65535,T[2]+=p[2]*b[3],T[1]+=T[2]>>>16,T[2]&=65535,T[2]+=p[3]*b[2],T[1]+=T[2]>>>16,T[2]&=65535,T[1]+=p[1]*b[3],T[0]+=T[1]>>>16,T[1]&=65535,T[1]+=p[2]*b[2],T[0]+=T[1]>>>16,T[1]&=65535,T[1]+=p[3]*b[1],T[0]+=T[1]>>>16,T[1]&=65535,T[0]+=p[0]*b[3]+p[1]*b[2]+p[2]*b[1]+p[3]*b[0],T[0]&=65535,[T[0]<<16|T[1],T[2]<<16|T[3]]}function m(p,b){return b%=64,b===32?[p[1],p[0]]:b<32?[p[0]<>>32-b,p[1]<>>32-b]:(b-=32,[p[1]<>>32-b,p[0]<>>32-b])}function R(p,b){return b%=64,b===0?p:b<32?[p[0]<>>32-b,p[1]<>>1]),p=S(p,[4283543511,3981806797]),p=O(p,[0,p[0]>>>1]),p=S(p,[3301882366,444984403]),p=O(p,[0,p[0]>>>1]),p}h.x86.hash32=function(p,b){p=p||"",b=b||0;for(var T=p.length%4,Z=p.length-T,W=b,P=0,$=3432918353,N=461845907,H=0;H>>0},h.x86.hash128=function(p,b){p=p||"",b=b||0;for(var T=p.length%16,Z=p.length-T,W=b,P=b,$=b,N=b,H=0,Y=0,M=0,F=0,X=597399067,_e=2869860233,fn=951274213,on=2716044179,J=0;J>>0).toString(16)).slice(-8)+("00000000"+(P>>>0).toString(16)).slice(-8)+("00000000"+($>>>0).toString(16)).slice(-8)+("00000000"+(N>>>0).toString(16)).slice(-8)},h.x64.hash128=function(p,b){p=p||"",b=b||0;for(var T=p.length%16,Z=p.length-T,W=[0,b],P=[0,b],$=[0,0],N=[0,0],H=[2277735313,289559509],Y=[1291169091,658871167],M=0;M>>0).toString(16)).slice(-8)+("00000000"+(W[1]>>>0).toString(16)).slice(-8)+("00000000"+(P[0]>>>0).toString(16)).slice(-8)+("00000000"+(P[1]>>>0).toString(16)).slice(-8)},u.exports&&(s=u.exports=h),s.murmurHash3=h})()})(Pu,Pu.exports);var xv=Pu.exports,wv=xv;const mv=nv(wv);function Su(u,s){let r=0,a=0,h=0;for(let d=0;d
'),Cv=ye('
');function Sv(u){const s=ae(()=>u.word.chinese.length),r=()=>$u()/100,a=()=>4*r(),h=ae(()=>{const _=u.intervals.get(u.word.chinese);return _!==void 0&&_>0});function c(){var S,m;const{level:_,no:y}=u.word;return _===((S=Iu())==null?void 0:S.level)&&y===((m=Iu())==null?void 0:m.no)}function d(){if(c())Ou(void 0);else{const{level:_,no:y}=u.word;Ou({level:_,no:y})}}return(()=>{const _=Cv(),y=_.firstChild,S=y.firstChild;return S.$$click=d,ue(S,()=>u.word.chinese),ue(y,ie(vt,{get when(){return c()},get children(){const m=yv(),R=m.firstChild,O=R.nextSibling,q=O.nextSibling;return ue(O,()=>u.word.pinyin),ue(q,()=>u.word.english),m}}),null),Ne(m=>{const R=a()+"rem",O=a()/8+"rem",q=a()+(s()-1)*a()/2+"rem",p=1.5*r()+"rem",b=a()/2+"px",T={"border-slate-400":!h(),"bg-slate-300":!h(),"hover:bg-slate-200":!h()&&!c(),"border-lime-700":h(),"bg-lime-500":h(),"hover:bg-lime-400":h()&&!c(),"z-20":c()};return R!==m._v$&&((m._v$=R)!=null?_.style.setProperty("height",R):_.style.removeProperty("height")),O!==m._v$2&&((m._v$2=O)!=null?_.style.setProperty("padding",O):_.style.removeProperty("padding")),q!==m._v$3&&((m._v$3=q)!=null?_.style.setProperty("width",q):_.style.removeProperty("width")),p!==m._v$4&&((m._v$4=p)!=null?S.style.setProperty("font-size",p):S.style.removeProperty("font-size")),b!==m._v$5&&((m._v$5=b)!=null?S.style.setProperty("border-width",b):S.style.removeProperty("border-width")),m._v$6=Bo(S,T,m._v$6),m},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0}),_})()}kn(["click"]);const Ev=ye('

Level - / -%

');function Lo(u){return u.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Lv(u){const s=ae(()=>u.level.words.filter(c=>(u.intervals.get(c.chinese)??0)>0).length),r=ae(()=>u.level.words.length),a=ae(()=>Kr.sortBy(u.level.words,c=>mv.x64.hash128(c.chinese))),h=()=>{const c=Lo(Av().trim()).toLowerCase();return c===""?a():a().filter(d=>Su(d.chinese.toLowerCase(),c)>.5||Su(d.english.toLowerCase(),c)>.5||Su(Lo(d.pinyin.toLowerCase()),c)>.5)};return(()=>{const c=Ev(),d=c.firstChild,_=d.firstChild,y=_.nextSibling,S=y.nextSibling,m=S.nextSibling,R=m.nextSibling,O=R.nextSibling,q=O.nextSibling,p=q.nextSibling;p.nextSibling;const b=d.nextSibling;return ue(d,()=>u.level.level,y),ue(d,s,m),ue(d,r,O),ue(d,()=>(s()/r()*100).toFixed(0),p),ue(b,ie(Mn,{get each(){return h()},children:T=>ie(Sv,{word:T,get intervals(){return u.intervals}})})),c})()}const Rv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='currentColor'%20aria-hidden='true'%20data-slot='icon'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='m21%2021-5.197-5.197m0%200A7.5%207.5%200%201%200%205.196%205.196a7.5%207.5%200%200%200%2010.607%2010.607Z'/%3e%3c/svg%3e",Tv=ye('
'),$v=ye('